Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ipbyrne/mongo-encrypted-query

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ipbyrne/mongo-encrypted-query - npm Package Compare versions

Comparing version 1.1.2 to 2.0.0

2

dist/cipher/cipher.d.ts
import { PrivateKeyJwk } from "../types";
export declare const generate: () => Promise<{
privateKeyJwk: import("jose/types").JWK;
privateKeyJwk: import("jose").JWK;
}>;
export declare const encrypt: (data: any, privateKeyJwk: PrivateKeyJwk) => string;
export declare const decrypt: (ciphertext: string, privateKeyJwk: PrivateKeyJwk) => string;

@@ -5,4 +5,3 @@ "use strict";

const tslib_1 = require("tslib");
const generate_key_pair_1 = require("jose/util/generate_key_pair");
const export_1 = require("jose/key/export");
const jose_1 = require("jose");
const crypto_1 = tslib_1.__importDefault(require("crypto"));

@@ -12,6 +11,6 @@ const enc = "aes-256-gcm";

const alg = "ECDH-ES+A256KW";
const { privateKey } = yield (0, generate_key_pair_1.generateKeyPair)(alg, {
const { privateKey } = yield (0, jose_1.generateKeyPair)(alg, {
crv: "X25519",
});
const privateKeyJwk = yield (0, export_1.exportJWK)(privateKey);
const privateKeyJwk = yield (0, jose_1.exportJWK)(privateKey);
return { privateKeyJwk };

@@ -18,0 +17,0 @@ });

@@ -1,2 +0,8 @@

import * as cipher from "./cipher";
export default cipher;
declare const _default: {
generate: () => Promise<{
privateKeyJwk: import("jose").JWK;
}>;
encrypt: (data: any, privateKeyJwk: import("..").PrivateKeyJwk) => string;
decrypt: (ciphertext: string, privateKeyJwk: import("..").PrivateKeyJwk) => string;
};
export default _default;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const cipher = __importStar(require("./cipher"));
exports.default = cipher;
const cipher_1 = require("./cipher");
exports.default = { generate: cipher_1.generate, encrypt: cipher_1.encrypt, decrypt: cipher_1.decrypt };
//# sourceMappingURL=index.js.map
import { PrivateKeyJwk, Data } from "./types";
import * as Types from "./types";
export { PrivateKeyJwk, Data, HDPath, KeyTypes, KTY, Path, CRV, X, KeyCreateParam, KeyCreateParamFromKey, PublicKeyJwk, } from "./types";
export declare const encryptQuery: (query: any, privateKeyJwk: PrivateKeyJwk, encryptKeys?: boolean, prefix?: string) => any;

@@ -11,6 +11,5 @@ export declare const encryptData: (data: Data | any, privateKeyJwk: PrivateKeyJwk, encryptKeys?: boolean) => any;

generateEncryptionPrivateKey: () => Promise<{
privateKeyJwk: import("jose/types").JWK;
privateKeyJwk: import("jose").JWK;
}>;
Types: typeof Types;
};
export default _default;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.decryptData = exports.encryptData = exports.encryptQuery = void 0;
exports.decryptData = exports.encryptData = exports.encryptQuery = exports.KeyTypes = void 0;
const utils_1 = require("./utils");
const cipher_1 = require("./cipher/cipher");
const Types = __importStar(require("./types"));
var types_1 = require("./types");
Object.defineProperty(exports, "KeyTypes", { enumerable: true, get: function () { return types_1.KeyTypes; } });
const encryptQuery = (query, privateKeyJwk, encryptKeys = true, prefix) => {

@@ -54,4 +55,3 @@ const encryptedQuery = (0, utils_1.createEntrypedQuery)(query, privateKeyJwk, encryptKeys);

generateEncryptionPrivateKey: cipher_1.generate,
Types,
};
//# sourceMappingURL=index.js.map

@@ -9,3 +9,3 @@ "use strict";

const keys_1 = require("./keys");
const findByQuery = (query, usePrefix = false) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
const findByQuery = (query_1, ...args_1) => tslib_1.__awaiter(void 0, [query_1, ...args_1], void 0, function* (query, usePrefix = false) {
const connection = yield (0, database_1.connect)();

@@ -12,0 +12,0 @@ const VerifiableCredentials = connection.collection("verifiable-credentials");

@@ -9,3 +9,3 @@ "use strict";

const _1 = tslib_1.__importDefault(require("../."));
const saveVC = (verifiableCredential, usePrefix = false) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
const saveVC = (verifiableCredential_1, ...args_1) => tslib_1.__awaiter(void 0, [verifiableCredential_1, ...args_1], void 0, function* (verifiableCredential, usePrefix = false) {
const connection = yield (0, database_1.connect)();

@@ -12,0 +12,0 @@ const VerifiableCredentials = connection.collection("verifiable-credentials");

@@ -5,3 +5,3 @@ export type HDPath = string;

X25519 = "X25519",
SECP256K1 = "secp256k1",
SECP256K1 = "secp256k1",// used for bitcoin
P256 = "P-256"

@@ -8,0 +8,0 @@ }

@@ -10,3 +10,3 @@ "use strict";

KeyTypes["P256"] = "P-256";
})(KeyTypes = exports.KeyTypes || (exports.KeyTypes = {}));
})(KeyTypes || (exports.KeyTypes = KeyTypes = {}));
//# sourceMappingURL=types.js.map

@@ -6,3 +6,3 @@ {

"license": "Apache-2.0",
"version": "1.1.2",
"version": "2.0.0",
"main": "dist/index.js",

@@ -52,3 +52,3 @@ "typings": "dist/index.d.ts",

"ts-node": "^10.8.1",
"typescript": "^4.7.4"
"typescript": "^5"
},

@@ -58,4 +58,4 @@ "dependencies": {

"dotenv": "^16.1.3",
"jose": "^3.20.1",
"tslib": "^2.0.1"
"jose": "^5.2.1",
"tslib": "^2.6.2"
},

@@ -62,0 +62,0 @@ "description": "[![CI](https://github.com/ipbyrne/mongo-encrypted-query/actions/workflows/ci.yml/badge.svg)](https://github.com/ipbyrne/mongo-encrypted-query/actions/workflows/ci.yml) ![Branches](./badges/coverage-branches.svg) ![Functions](./badges/coverage-functions.svg) ![Lines](./badges/coverage-lines.svg) ![Statements](./badges/coverage-statements.svg) ![Jest coverage](./badges/coverage-jest%20coverage.svg)",

@@ -1,3 +0,2 @@

import { generateKeyPair } from "jose/util/generate_key_pair";
import { exportJWK } from "jose/key/export";
import { generateKeyPair, exportJWK } from "jose";
import { PrivateKeyJwk } from "../types";

@@ -4,0 +3,0 @@ import crypto from "crypto";

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc