@meebon/meebon-crypto 1.2.0 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3,6 +3,6 @@ import { MeebonCryptoKeyPair } from '../types/global';
|
|
|
3
3
|
/**
|
|
4
4
|
* Middleware Function for Encryption and Decryption
|
|
5
5
|
*/
|
|
6
|
-
declare const encryptionMiddleware: ({ privateKey, publicKey, }: MeebonCryptoKeyPair) => (req: Request, res: Response, next: NextFunction) => void
|
|
6
|
+
declare const encryptionMiddleware: ({ privateKey, publicKey, }: MeebonCryptoKeyPair) => (req: Request, res: Response, next: NextFunction) => void;
|
|
7
7
|
export default encryptionMiddleware;
|
|
8
8
|
//# sourceMappingURL=ExpressEncryptionMiddleware.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpressEncryptionMiddleware.d.ts","sourceRoot":"","sources":["../lib/ExpressEncryptionMiddleware.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAkB,MAAM,SAAS,CAAA;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD;;GAEG;AACH,QAAA,MAAM,oBAAoB,+BAAgC,mBAAmB,
|
|
1
|
+
{"version":3,"file":"ExpressEncryptionMiddleware.d.ts","sourceRoot":"","sources":["../lib/ExpressEncryptionMiddleware.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAkB,MAAM,SAAS,CAAA;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD;;GAEG;AACH,QAAA,MAAM,oBAAoB,+BAAgC,mBAAmB,WAC9D,OAAO,OAAO,QAAQ,QAAQ,YAAY,SAyBxD,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { MeebonCrypto } from './MeebonCrypto';
|
|
2
|
-
export declare const EncryptionMiddleware: ({ privateKey, publicKey, }: import("../types/global").MeebonCryptoKeyPair) => (req: import("express").Request, res: import("express").Response, next: import("express").NextFunction) => void
|
|
2
|
+
export declare const EncryptionMiddleware: ({ privateKey, publicKey, }: import("../types/global").MeebonCryptoKeyPair) => (req: import("express").Request, res: import("express").Response, next: import("express").NextFunction) => void;
|
|
3
3
|
export default MeebonCrypto;
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,eAAO,MAAM,oBAAoB,gMAAuB,CAAC;AACzD,eAAe,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -80,13 +80,13 @@ var MeebonCrypto = class _MeebonCrypto {
|
|
|
80
80
|
|
|
81
81
|
// lib/ExpressEncryptionMiddleware.ts
|
|
82
82
|
var encryptionMiddleware = ({ privateKey, publicKey }) => {
|
|
83
|
-
|
|
83
|
+
return (req, res, next) => {
|
|
84
84
|
if (req.body.data) {
|
|
85
85
|
try {
|
|
86
86
|
const encrypted = MeebonCrypto.encryptData(req.body.dataToEncrypt, publicKey);
|
|
87
87
|
req.body.data = encrypted;
|
|
88
88
|
} catch (error) {
|
|
89
|
-
|
|
89
|
+
throw new Error(error?.message ?? error);
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
const originalSend = res.send;
|
|
@@ -103,7 +103,6 @@ var encryptionMiddleware = ({ privateKey, publicKey }) => {
|
|
|
103
103
|
};
|
|
104
104
|
return next();
|
|
105
105
|
};
|
|
106
|
-
return output;
|
|
107
106
|
};
|
|
108
107
|
var ExpressEncryptionMiddleware_default = encryptionMiddleware;
|
|
109
108
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meebon/meebon-crypto",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "kajalanS <103587022+kajalanS@users.noreply.github.com>",
|
|
6
6
|
"homepage": "https://github.com/KsoftmHub/meebon-crypto?tab=readme-ov-file#getting-started",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"types": "types",
|
|
11
11
|
"directories": {
|
|
12
12
|
"lib": "lib",
|
|
13
|
-
"
|
|
13
|
+
"tests": "tests",
|
|
14
14
|
"types": "types"
|
|
15
15
|
},
|
|
16
16
|
"files": [
|