nestjs-cryptography 2.2.1

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Marc Jorge
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ export declare const CRYPTOGRAPHY_OPTIONS = "CRYPTOGRAPHY_OPTIONS";
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CRYPTOGRAPHY_OPTIONS = void 0;
4
+ exports.CRYPTOGRAPHY_OPTIONS = 'CRYPTOGRAPHY_OPTIONS';
@@ -0,0 +1,4 @@
1
+ import { CryptographyOptionsInterface } from './interfaces';
2
+ export declare const ConfigurableModuleClass: import("@nestjs/common").ConfigurableModuleCls<CryptographyOptionsInterface, "register", "create", {
3
+ isGlobal: boolean;
4
+ }>, MODULE_OPTIONS_TOKEN: string | symbol;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var _a;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.MODULE_OPTIONS_TOKEN = exports.ConfigurableModuleClass = void 0;
5
+ const common_1 = require("@nestjs/common");
6
+ _a = new common_1.ConfigurableModuleBuilder()
7
+ .setExtras({
8
+ isGlobal: true,
9
+ }, (definition, extras) => ({
10
+ ...definition,
11
+ global: extras.isGlobal,
12
+ }))
13
+ .build(), exports.ConfigurableModuleClass = _a.ConfigurableModuleClass, exports.MODULE_OPTIONS_TOKEN = _a.MODULE_OPTIONS_TOKEN;
@@ -0,0 +1,3 @@
1
+ import { ConfigurableModuleClass } from './cryptography.module-definition';
2
+ export declare class CryptographyModule extends ConfigurableModuleClass {
3
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.CryptographyModule = void 0;
10
+ const common_1 = require("@nestjs/common");
11
+ const cryptography_module_definition_1 = require("./cryptography.module-definition");
12
+ const cryptography_service_1 = require("./cryptography.service");
13
+ let CryptographyModule = class CryptographyModule extends cryptography_module_definition_1.ConfigurableModuleClass {
14
+ };
15
+ exports.CryptographyModule = CryptographyModule;
16
+ exports.CryptographyModule = CryptographyModule = __decorate([
17
+ (0, common_1.Module)({
18
+ providers: [cryptography_service_1.CryptographyService],
19
+ exports: [cryptography_service_1.CryptographyService],
20
+ })
21
+ ], CryptographyModule);
@@ -0,0 +1,36 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import * as crypto from 'node:crypto';
4
+ import { CryptographyOptionsInterface } from './interfaces';
5
+ export declare class CryptographyService {
6
+ private options;
7
+ constructor(options: CryptographyOptionsInterface);
8
+ private convertDataToBuffer;
9
+ private extractIV;
10
+ private extractAuthTagFromCypheredData;
11
+ private extractCipheredData;
12
+ private extractSalt;
13
+ private extractCipheredDEK;
14
+ private extractCipheredDataWithDEK;
15
+ private createSaferRandomData;
16
+ private generateKeyDEK;
17
+ genUUID(secure?: boolean): string;
18
+ genRandomPassword(length: number, encoding: 'base64' | 'hex'): string;
19
+ generateSymmetricKey(length?: number): crypto.KeyObject;
20
+ deriveMasterKey(masterKey: string | Buffer, salt: Buffer, length: number): Promise<Buffer>;
21
+ createArgonHashFromPassword(data: string | Buffer): Promise<Buffer>;
22
+ verifyArgonHashFromPassword(hash: string, data: string | Buffer): Promise<boolean>;
23
+ createCustomHash(algorithm: string, data: string, outputLength?: number): Buffer;
24
+ verifyCustomHash(algorithm: string, data: string, oldHash: string | Buffer, outputLength?: number): boolean;
25
+ createSecureHash(data: string): Buffer;
26
+ verifySecureHash(data: string, oldHash: string | Buffer): boolean;
27
+ createCustomHmac(algorithm: string, key: Buffer, data: string): Buffer;
28
+ verifyCustomHmac(algorithm: string, key: Buffer, data: string, oldHmac: string | Buffer): boolean;
29
+ createSecureHmac(data: string): Buffer;
30
+ verifySecureHmac(data: string, oldHmac: Buffer | string): boolean;
31
+ createInsecureFastHash(data: string): Buffer;
32
+ private symmetricDataEncrypt;
33
+ private symmetricDataDecrypt;
34
+ symmetricSecureDataEncrypt(data: string | Buffer): Promise<Buffer>;
35
+ symmetricSecureDataDecrypt(data: string | Buffer): Promise<Buffer>;
36
+ }
@@ -0,0 +1,221 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
19
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
20
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
21
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
22
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
23
+ };
24
+ var __importStar = (this && this.__importStar) || function (mod) {
25
+ if (mod && mod.__esModule) return mod;
26
+ var result = {};
27
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
28
+ __setModuleDefault(result, mod);
29
+ return result;
30
+ };
31
+ var __metadata = (this && this.__metadata) || function (k, v) {
32
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
33
+ };
34
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
35
+ return function (target, key) { decorator(target, key, paramIndex); }
36
+ };
37
+ Object.defineProperty(exports, "__esModule", { value: true });
38
+ exports.CryptographyService = void 0;
39
+ const crypto = __importStar(require("node:crypto"));
40
+ const argon2 = __importStar(require("argon2"));
41
+ const common_1 = require("@nestjs/common");
42
+ const cryptography_module_definition_1 = require("./cryptography.module-definition");
43
+ let CryptographyService = class CryptographyService {
44
+ constructor(options) {
45
+ this.options = options;
46
+ }
47
+ convertDataToBuffer(data) {
48
+ return Buffer.isBuffer(data) ? data : Buffer.from(data, 'hex');
49
+ }
50
+ extractIV(data) {
51
+ return data.subarray(0, 12);
52
+ }
53
+ extractAuthTagFromCypheredData(data) {
54
+ return data.subarray(76, 92);
55
+ }
56
+ extractCipheredData(data) {
57
+ return data.subarray(92, data.length);
58
+ }
59
+ extractSalt(data) {
60
+ return data.subarray(12, 76);
61
+ }
62
+ extractCipheredDEK(data) {
63
+ return data.subarray(0, 124);
64
+ }
65
+ extractCipheredDataWithDEK(data) {
66
+ return data.subarray(124, data.length);
67
+ }
68
+ createSaferRandomData(length) {
69
+ return Buffer.from(crypto.hkdfSync('sha3-256', crypto.createSecretKey(crypto.randomBytes(64)), crypto.randomBytes(64), Buffer.alloc(0), length));
70
+ }
71
+ generateKeyDEK() {
72
+ return crypto.createSecretKey(this.createSaferRandomData(32));
73
+ }
74
+ genUUID(secure = false) {
75
+ return crypto.randomUUID({
76
+ disableEntropyCache: secure,
77
+ });
78
+ }
79
+ genRandomPassword(length, encoding) {
80
+ return crypto.randomBytes(length).toString(encoding).slice(0, length);
81
+ }
82
+ generateSymmetricKey(length = 256) {
83
+ return crypto.generateKeySync('hmac', { length });
84
+ }
85
+ async deriveMasterKey(masterKey, salt, length) {
86
+ return await argon2.hash(masterKey, {
87
+ hashLength: length ? length : this.options.kdf.defaultOutputKeyLength,
88
+ salt: salt,
89
+ type: this.options.kdf.argon2Type,
90
+ memoryCost: this.options.kdf.memoryCost,
91
+ timeCost: this.options.kdf.timeCost,
92
+ raw: true,
93
+ });
94
+ }
95
+ async createArgonHashFromPassword(data) {
96
+ const tmpData = await argon2.hash(data, {
97
+ hashLength: this.options.hashing.password.outputKeyLength,
98
+ type: this.options.hashing.password.argon2Type,
99
+ memoryCost: this.options.hashing.password.memoryCost,
100
+ timeCost: this.options.hashing.password.timeCost,
101
+ raw: false,
102
+ });
103
+ return Buffer.isBuffer(tmpData) ? tmpData : Buffer.from(tmpData);
104
+ }
105
+ async verifyArgonHashFromPassword(hash, data) {
106
+ return await argon2.verify(hash, data);
107
+ }
108
+ createCustomHash(algorithm, data, outputLength = 0) {
109
+ const hash = crypto.createHash(algorithm, {
110
+ ...(outputLength && { outputLength }),
111
+ });
112
+ hash.update(data);
113
+ return hash.digest();
114
+ }
115
+ verifyCustomHash(algorithm, data, oldHash, outputLength = 0) {
116
+ const hash = this.createCustomHash(algorithm, data, outputLength);
117
+ if (Buffer.isBuffer(oldHash)) {
118
+ return crypto.timingSafeEqual(hash, oldHash);
119
+ }
120
+ else {
121
+ return crypto.timingSafeEqual(Buffer.from(oldHash, 'hex'), hash);
122
+ }
123
+ }
124
+ createSecureHash(data) {
125
+ return this.createCustomHash('shake256', data, 48);
126
+ }
127
+ verifySecureHash(data, oldHash) {
128
+ const hash = this.createCustomHash('shake256', data, 48);
129
+ const buffOldHash = Buffer.isBuffer(oldHash)
130
+ ? oldHash
131
+ : Buffer.from(oldHash, 'hex');
132
+ return crypto.timingSafeEqual(hash, buffOldHash);
133
+ }
134
+ createCustomHmac(algorithm, key, data) {
135
+ const hmac = crypto.createHmac(algorithm, crypto.createSecretKey(key));
136
+ hmac.update(data);
137
+ key = null;
138
+ return hmac.digest();
139
+ }
140
+ verifyCustomHmac(algorithm, key, data, oldHmac) {
141
+ const hmac = this.createCustomHmac(algorithm, key, data);
142
+ if (Buffer.isBuffer(oldHmac)) {
143
+ return crypto.timingSafeEqual(hmac, oldHmac);
144
+ }
145
+ else {
146
+ return crypto.timingSafeEqual(Buffer.from(oldHmac, 'hex'), hmac);
147
+ }
148
+ }
149
+ createSecureHmac(data) {
150
+ const key = Buffer.from(this.options.hashing.hmac.masterKey, 'hex');
151
+ const salt = crypto.randomBytes(16);
152
+ const secureKey = Buffer.from(crypto.hkdfSync('sha3-256', crypto.createSecretKey(key), salt, Buffer.alloc(0), 64));
153
+ const hmac = this.createCustomHmac('sha3-256', secureKey, data);
154
+ return Buffer.concat([Buffer.from(salt), Buffer.from(hmac)], salt.length + hmac.length);
155
+ }
156
+ verifySecureHmac(data, oldHmac) {
157
+ const key = Buffer.from(this.options.hashing.hmac.masterKey, 'hex');
158
+ const buffOldHmac = Buffer.isBuffer(oldHmac)
159
+ ? oldHmac
160
+ : Buffer.from(oldHmac, 'hex');
161
+ const saltOldHmac = buffOldHmac.subarray(0, 16);
162
+ const hashOldHmac = buffOldHmac.subarray(16, buffOldHmac.length);
163
+ const secureKey = Buffer.from(crypto.hkdfSync('sha3-256', crypto.createSecretKey(key), saltOldHmac, Buffer.alloc(0), 64));
164
+ const hmac = this.createCustomHmac('sha3-256', secureKey, data);
165
+ return crypto.timingSafeEqual(hmac, hashOldHmac);
166
+ }
167
+ createInsecureFastHash(data) {
168
+ return crypto.createHash('sha1').update(data).digest();
169
+ }
170
+ async symmetricDataEncrypt(data, key) {
171
+ const iv = this.createSaferRandomData(12);
172
+ const salt = this.createSaferRandomData(64);
173
+ const secureEncryptionKey = await this.deriveMasterKey(key, salt, 32);
174
+ const cipher = crypto.createCipheriv('aes-256-gcm', crypto.createSecretKey(secureEncryptionKey), iv, {
175
+ authTagLength: 16,
176
+ });
177
+ let cipheredData = cipher.update(data);
178
+ cipheredData = Buffer.concat([
179
+ Buffer.from(cipheredData),
180
+ Buffer.from(cipher.final()),
181
+ ]);
182
+ return Buffer.concat([iv, salt, cipher.getAuthTag(), cipheredData]);
183
+ }
184
+ async symmetricDataDecrypt(data, key) {
185
+ data = Buffer.isBuffer(data) ? data : Buffer.from(data, 'hex');
186
+ const iv = this.extractIV(data);
187
+ const salt = this.extractSalt(data);
188
+ const authTag = this.extractAuthTagFromCypheredData(data);
189
+ const cipheredData = this.extractCipheredData(data);
190
+ const decryptionKey = await this.deriveMasterKey(key, salt, 32);
191
+ const decipher = crypto.createDecipheriv('aes-256-gcm', crypto.createSecretKey(decryptionKey), iv, {
192
+ authTagLength: 16,
193
+ });
194
+ decipher.setAuthTag(authTag);
195
+ let decipheredData = decipher.update(cipheredData);
196
+ decipheredData = Buffer.concat([
197
+ Buffer.from(decipheredData),
198
+ Buffer.from(decipher.final()),
199
+ ]);
200
+ return decipheredData;
201
+ }
202
+ async symmetricSecureDataEncrypt(data) {
203
+ const dek = this.createSaferRandomData(32);
204
+ const cipheredData = await this.symmetricDataEncrypt(data, dek);
205
+ const cipheredDek = await this.symmetricDataEncrypt(dek, this.options.encryption.symmetric.masterKey);
206
+ return Buffer.concat([cipheredDek, cipheredData]);
207
+ }
208
+ async symmetricSecureDataDecrypt(data) {
209
+ data = Buffer.isBuffer(data) ? data : Buffer.from(data, 'hex');
210
+ const cipheredDek = this.extractCipheredDEK(data);
211
+ const cipheredData = this.extractCipheredDataWithDEK(data);
212
+ const decipheredDek = await this.symmetricDataDecrypt(cipheredDek, this.options.encryption.symmetric.masterKey);
213
+ return await this.symmetricDataDecrypt(cipheredData, decipheredDek);
214
+ }
215
+ };
216
+ exports.CryptographyService = CryptographyService;
217
+ exports.CryptographyService = CryptographyService = __decorate([
218
+ (0, common_1.Injectable)(),
219
+ __param(0, (0, common_1.Inject)(cryptography_module_definition_1.MODULE_OPTIONS_TOKEN)),
220
+ __metadata("design:paramtypes", [Object])
221
+ ], CryptographyService);
@@ -0,0 +1,3 @@
1
+ export * from './cryptography.module';
2
+ export * from './interfaces';
3
+ export * from './cryptography.service';
package/dist/index.js ADDED
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./cryptography.module"), exports);
18
+ __exportStar(require("./interfaces"), exports);
19
+ __exportStar(require("./cryptography.service"), exports);
@@ -0,0 +1,29 @@
1
+ export declare enum Argon2Type {
2
+ argon2d = 0,
3
+ argon2i = 1,
4
+ argon2id = 2
5
+ }
6
+ export interface CryptographyOptionsInterface {
7
+ kdf: {
8
+ defaultOutputKeyLength: number;
9
+ argon2Type: Argon2Type;
10
+ memoryCost: number;
11
+ timeCost: number;
12
+ };
13
+ hashing: {
14
+ password: {
15
+ outputKeyLength: number;
16
+ argon2Type: Argon2Type;
17
+ memoryCost: number;
18
+ timeCost: number;
19
+ };
20
+ hmac: {
21
+ masterKey: string;
22
+ };
23
+ };
24
+ encryption: {
25
+ symmetric: {
26
+ masterKey: string;
27
+ };
28
+ };
29
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Argon2Type = void 0;
4
+ var Argon2Type;
5
+ (function (Argon2Type) {
6
+ Argon2Type[Argon2Type["argon2d"] = 0] = "argon2d";
7
+ Argon2Type[Argon2Type["argon2i"] = 1] = "argon2i";
8
+ Argon2Type[Argon2Type["argon2id"] = 2] = "argon2id";
9
+ })(Argon2Type || (exports.Argon2Type = Argon2Type = {}));
@@ -0,0 +1 @@
1
+ export * from './cryptography-options.interface';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./cryptography-options.interface"), exports);
package/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist';
package/index.js ADDED
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ function __export(m) {
3
+ for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
4
+ }
5
+ exports.__esModule = true;
6
+ __export(require("./dist"));
package/nest-cli.json ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/nest-cli",
3
+ "collection": "@nestjs/schematics",
4
+ "sourceRoot": "src",
5
+ "compilerOptions": {
6
+ "deleteOutDir": true
7
+ }
8
+ }
package/package.json ADDED
@@ -0,0 +1,82 @@
1
+ {
2
+ "name": "nestjs-cryptography",
3
+ "version": "2.2.1",
4
+ "author": {
5
+ "name": "Marc Jorge Gonzalez",
6
+ "url": "https://github.com/mjorgegulab"
7
+ },
8
+ "license": "MIT",
9
+ "description": "Secure NestJS cryptography module 🔐",
10
+ "publishConfig": {
11
+ "registry": "https://npm.pkg.github.com/"
12
+ },
13
+ "homepage": "https://github.com/mjorgegulab/nestjs-cryptography",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/mjorgegulab/nestjs-cryptography.git"
17
+ },
18
+ "bugs": {
19
+ "url": "https://github.com/mjorgegulab/nestjs-cryptography/issues"
20
+ },
21
+ "scripts": {
22
+ "build": "rimraf -rf dist && tsc -p tsconfig.json",
23
+ "format": "prettier --write \"lib/**/*.ts\" \"test/**/*.ts\"",
24
+ "lint": "eslint --fix",
25
+ "publish:npm": "npm publish --access=public",
26
+ "prepublish": "yarn run build",
27
+ "prepack": "yarn run build"
28
+ },
29
+ "dependencies": {
30
+ "argon2": "^0.41.1"
31
+ },
32
+ "devDependencies": {
33
+ "@nestjs/common": "^10.4.1",
34
+ "@nestjs/core": "^10.4.1",
35
+ "@nestjs/cli": "^10.4.5",
36
+ "reflect-metadata": "^0.2.2",
37
+ "rxjs": "^7.8.1",
38
+ "@nestjs/platform-express": "^10.4.1",
39
+ "@nestjs/schematics": "^10.1.4",
40
+ "@nestjs/testing": "^10.4.1",
41
+ "@types/express": "^4.17.21",
42
+ "@types/jest": "29.5.12",
43
+ "@types/node": "22.5.4",
44
+ "@types/supertest": "^6.0.2",
45
+ "@typescript-eslint/eslint-plugin": "^7.12.0",
46
+ "@typescript-eslint/parser": "^7.12.0",
47
+ "eslint": "^8.57.0",
48
+ "eslint-config-prettier": "^9.1.0",
49
+ "eslint-plugin-prettier": "^5.1.3",
50
+ "jest": "29.7.0",
51
+ "prettier": "^3.3.3",
52
+ "source-map-support": "^0.5.21",
53
+ "supertest": "^7.0.0",
54
+ "ts-jest": "29.2.5",
55
+ "ts-loader": "^9.5.1",
56
+ "ts-node": "^10.9.2",
57
+ "tsconfig-paths": "4.2.0",
58
+ "typescript": "^5.4.5",
59
+ "rimraf": "^5.0.7"
60
+ },
61
+ "peerDependencies": {
62
+ "@nestjs/common": "^9.0.0 || ^10.0.0",
63
+ "@nestjs/core": "^9.0.0 || ^10.0.0"
64
+ },
65
+ "jest": {
66
+ "moduleFileExtensions": [
67
+ "js",
68
+ "json",
69
+ "ts"
70
+ ],
71
+ "rootDir": "src",
72
+ "testRegex": ".*\\.spec\\.ts$",
73
+ "transform": {
74
+ "^.+\\.(t|j)s$": "ts-jest"
75
+ },
76
+ "collectCoverageFrom": [
77
+ "**/*.(t|j)s"
78
+ ],
79
+ "coverageDirectory": "../coverage",
80
+ "testEnvironment": "node"
81
+ }
82
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "exclude": ["node_modules", "test", "dist", "**/*spec.ts"]
4
+ }