@mondart/nestjs-common-module-core 3.0.0 → 3.1.0
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/dist/guards/auth-throttle.guard.d.ts +0 -1
- package/dist/guards/auth-throttle.guard.d.ts.map +1 -1
- package/dist/guards/auth-throttle.guard.js +6 -11
- package/dist/guards/auth-throttle.guard.js.map +1 -1
- package/dist/helpers/aes.helper.d.ts +6 -0
- package/dist/helpers/aes.helper.d.ts.map +1 -0
- package/dist/helpers/aes.helper.js +80 -0
- package/dist/helpers/aes.helper.js.map +1 -0
- package/dist/helpers/cli-command.helper.d.ts +5 -0
- package/dist/helpers/cli-command.helper.d.ts.map +1 -0
- package/dist/helpers/cli-command.helper.js +100 -0
- package/dist/helpers/cli-command.helper.js.map +1 -0
- package/dist/helpers/generate-hash.helper.d.ts +5 -0
- package/dist/helpers/generate-hash.helper.d.ts.map +1 -0
- package/dist/helpers/generate-hash.helper.js +60 -0
- package/dist/helpers/generate-hash.helper.js.map +1 -0
- package/dist/helpers/hmac.helper.d.ts +4 -0
- package/dist/helpers/hmac.helper.d.ts.map +1 -0
- package/dist/helpers/hmac.helper.js +11 -0
- package/dist/helpers/hmac.helper.js.map +1 -0
- package/dist/helpers/index.d.ts +10 -2
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/index.js +10 -2
- package/dist/helpers/index.js.map +1 -1
- package/dist/helpers/method.helper.d.ts +4 -0
- package/dist/helpers/method.helper.d.ts.map +1 -0
- package/dist/helpers/method.helper.js +24 -0
- package/dist/helpers/method.helper.js.map +1 -0
- package/dist/helpers/phone.helper.d.ts +4 -0
- package/dist/helpers/phone.helper.d.ts.map +1 -0
- package/dist/helpers/phone.helper.js +9 -0
- package/dist/helpers/phone.helper.js.map +1 -0
- package/dist/helpers/ram-usage.helper.d.ts +5 -0
- package/dist/helpers/ram-usage.helper.d.ts.map +1 -0
- package/dist/helpers/ram-usage.helper.js +15 -0
- package/dist/helpers/ram-usage.helper.js.map +1 -0
- package/dist/helpers/yup.helper.d.ts +19 -0
- package/dist/helpers/yup.helper.d.ts.map +1 -0
- package/dist/helpers/yup.helper.js +130 -0
- package/dist/helpers/yup.helper.js.map +1 -0
- package/dist/interfaces/generate-cache-key-params.interface.d.ts +6 -0
- package/dist/interfaces/generate-cache-key-params.interface.d.ts.map +1 -0
- package/dist/interfaces/generate-cache-key-params.interface.js +3 -0
- package/dist/interfaces/generate-cache-key-params.interface.js.map +1 -0
- package/dist/interfaces/index.d.ts +1 -0
- package/dist/interfaces/index.d.ts.map +1 -1
- package/dist/interfaces/index.js +1 -0
- package/dist/interfaces/index.js.map +1 -1
- package/package.json +3 -1
|
@@ -7,6 +7,5 @@ export declare class AuthThrottlerGuard extends ThrottlerGuard {
|
|
|
7
7
|
protected generateKey(context: ExecutionContext, tracker: string, throttlerName: string): string;
|
|
8
8
|
private getEmailOrUserKey;
|
|
9
9
|
private getDeviceKey;
|
|
10
|
-
private hmac;
|
|
11
10
|
}
|
|
12
11
|
//# sourceMappingURL=auth-throttle.guard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-throttle.guard.d.ts","sourceRoot":"","sources":["../../src/guards/auth-throttle.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAc,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"auth-throttle.guard.d.ts","sourceRoot":"","sources":["../../src/guards/auth-throttle.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAc,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAKvC,qBACa,kBAAmB,SAAQ,cAAc;cACpC,UAAU,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;cAMzC,eAAe,CAC7B,OAAO,EAAE,gBAAgB,EACzB,oBAAoB,EAAE,oBAAoB,GACzC,OAAO,CAAC,MAAM,CAAC;IAQlB,SAAS,CAAC,WAAW,CACnB,OAAO,EAAE,gBAAgB,EACzB,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,GACpB,MAAM;IAyBT,OAAO,CAAC,iBAAiB;IA2BzB,OAAO,CAAC,YAAY;CAsBrB"}
|
|
@@ -9,9 +9,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.AuthThrottlerGuard = void 0;
|
|
10
10
|
const common_1 = require("@nestjs/common");
|
|
11
11
|
const throttler_1 = require("@nestjs/throttler");
|
|
12
|
-
const crypto_1 = require("crypto");
|
|
13
12
|
const decorators_1 = require("../decorators");
|
|
14
13
|
const exceptions_1 = require("../exceptions");
|
|
14
|
+
const hmac_helper_1 = require("../helpers/hmac.helper");
|
|
15
15
|
let AuthThrottlerGuard = class AuthThrottlerGuard extends throttler_1.ThrottlerGuard {
|
|
16
16
|
async getTracker(req) {
|
|
17
17
|
const iamContext = (0, decorators_1.getIamContext)(req);
|
|
@@ -37,37 +37,32 @@ let AuthThrottlerGuard = class AuthThrottlerGuard extends throttler_1.ThrottlerG
|
|
|
37
37
|
identity = `ip:${tracker}`;
|
|
38
38
|
break;
|
|
39
39
|
}
|
|
40
|
-
return
|
|
40
|
+
return hmac_helper_1.HmacHelper.hmac(`${routeKey}:${throttlerName}:${identity}`);
|
|
41
41
|
}
|
|
42
42
|
getEmailOrUserKey(req) {
|
|
43
43
|
const iamContext = (0, decorators_1.getIamContext)(req);
|
|
44
44
|
const keycloakSub = iamContext.userId;
|
|
45
45
|
if (keycloakSub) {
|
|
46
|
-
return `sub:${
|
|
46
|
+
return `sub:${hmac_helper_1.HmacHelper.hmac(keycloakSub)}`;
|
|
47
47
|
}
|
|
48
48
|
const email = req.body?.email;
|
|
49
49
|
if (!email || typeof email !== 'string') {
|
|
50
50
|
return null;
|
|
51
51
|
}
|
|
52
52
|
const normalizedEmail = email.trim().toLowerCase();
|
|
53
|
-
return `email:${
|
|
53
|
+
return `email:${hmac_helper_1.HmacHelper.hmac(normalizedEmail)}`;
|
|
54
54
|
}
|
|
55
55
|
getDeviceKey(req) {
|
|
56
56
|
const signedDeviceId = req.signedCookies?.did;
|
|
57
57
|
if (signedDeviceId) {
|
|
58
|
-
return `device:${
|
|
58
|
+
return `device:${hmac_helper_1.HmacHelper.hmac(signedDeviceId)}`;
|
|
59
59
|
}
|
|
60
60
|
const sessionId = req.sessionID;
|
|
61
61
|
if (sessionId) {
|
|
62
|
-
return `session:${
|
|
62
|
+
return `session:${hmac_helper_1.HmacHelper.hmac(sessionId)}`;
|
|
63
63
|
}
|
|
64
64
|
return null;
|
|
65
65
|
}
|
|
66
|
-
hmac(value) {
|
|
67
|
-
return (0, crypto_1.createHmac)('sha256', process.env.RATE_LIMIT_HASH_SECRET)
|
|
68
|
-
.update(value)
|
|
69
|
-
.digest('hex');
|
|
70
|
-
}
|
|
71
66
|
};
|
|
72
67
|
exports.AuthThrottlerGuard = AuthThrottlerGuard;
|
|
73
68
|
exports.AuthThrottlerGuard = AuthThrottlerGuard = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-throttle.guard.js","sourceRoot":"","sources":["../../src/guards/auth-throttle.guard.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA8D;AAC9D,iDAAyE;
|
|
1
|
+
{"version":3,"file":"auth-throttle.guard.js","sourceRoot":"","sources":["../../src/guards/auth-throttle.guard.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA8D;AAC9D,iDAAyE;AAEzE,8CAA8C;AAC9C,8CAAyD;AACzD,wDAAoD;AAG7C,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,0BAAc;IAC1C,KAAK,CAAC,UAAU,CAAC,GAAY;QACrC,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@@ -0,0 +1,80 @@
|
|
|
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 __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.AesHelper = void 0;
|
|
37
|
+
const crypto = __importStar(require("crypto"));
|
|
38
|
+
const IV_LEN = 16;
|
|
39
|
+
const SALT_LEN = 16;
|
|
40
|
+
const KEY_LEN = 32;
|
|
41
|
+
const PBKDF2_ITERS = 100_000;
|
|
42
|
+
const PBKDF2_DIGEST = 'sha256';
|
|
43
|
+
class AesHelper {
|
|
44
|
+
static encrypt(text, secretKey) {
|
|
45
|
+
if (!text)
|
|
46
|
+
return undefined;
|
|
47
|
+
const salt = crypto.randomBytes(SALT_LEN);
|
|
48
|
+
const iv = crypto.randomBytes(IV_LEN);
|
|
49
|
+
const key = this.deriveKey(secretKey, salt);
|
|
50
|
+
const cipher = crypto.createCipheriv('aes-256-cbc', key, iv);
|
|
51
|
+
const encrypted = Buffer.concat([
|
|
52
|
+
cipher.update(text, 'utf8'),
|
|
53
|
+
cipher.final(),
|
|
54
|
+
]);
|
|
55
|
+
return (salt.toString('hex') + iv.toString('hex') + encrypted.toString('hex'));
|
|
56
|
+
}
|
|
57
|
+
static decrypt(encryptedText, secretKey) {
|
|
58
|
+
if (!encryptedText || encryptedText.length < (SALT_LEN + IV_LEN) * 2) {
|
|
59
|
+
throw new Error('Invalid encrypted payload');
|
|
60
|
+
}
|
|
61
|
+
const saltHex = encryptedText.slice(0, SALT_LEN * 2);
|
|
62
|
+
const ivHex = encryptedText.slice(SALT_LEN * 2, (SALT_LEN + IV_LEN) * 2);
|
|
63
|
+
const dataHex = encryptedText.slice((SALT_LEN + IV_LEN) * 2);
|
|
64
|
+
const salt = Buffer.from(saltHex, 'hex');
|
|
65
|
+
const iv = Buffer.from(ivHex, 'hex');
|
|
66
|
+
const encryptedData = Buffer.from(dataHex, 'hex');
|
|
67
|
+
const key = this.deriveKey(secretKey, salt);
|
|
68
|
+
const decipher = crypto.createDecipheriv('aes-256-cbc', key, iv);
|
|
69
|
+
const decrypted = Buffer.concat([
|
|
70
|
+
decipher.update(encryptedData),
|
|
71
|
+
decipher.final(),
|
|
72
|
+
]);
|
|
73
|
+
return decrypted.toString('utf8');
|
|
74
|
+
}
|
|
75
|
+
static deriveKey(secretKey, salt) {
|
|
76
|
+
return crypto.pbkdf2Sync(Buffer.from(secretKey, 'utf8'), salt, PBKDF2_ITERS, KEY_LEN, PBKDF2_DIGEST);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
exports.AesHelper = AesHelper;
|
|
80
|
+
//# sourceMappingURL=aes.helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aes.helper.js","sourceRoot":"","sources":["../../src/helpers/aes.helper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AAEjC,MAAM,MAAM,GAAG,EAAE,CAAC;AAClB,MAAM,QAAQ,GAAG,EAAE,CAAC;AACpB,MAAM,OAAO,GAAG,EAAE,CAAC;AACnB,MAAM,YAAY,GAAG,OAAO,CAAC;AAC7B,MAAM,aAAa,GAAG,QAAQ,CAAC;AAE/B,MAAa,SAAS;IAEpB,MAAM,CAAC,OAAO,CAAC,IAAY,EAAE,SAAiB;QAC5C,IAAI,CAAC,IAAI;YAAE,OAAO,SAAS,CAAC;QAE5B,MAAM,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAC1C,MAAM,EAAE,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QACtC,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QAE5C,MAAM,MAAM,GAAG,MAAM,CAAC,cAAc,CAAC,aAAa,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;QAC7D,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC;YAC9B,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC;YAC3B,MAAM,CAAC,KAAK,EAAE;SACf,CAAC,CAAC;QAGH,OAAO,CACL,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,GAA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O,MAAM,CAAC,SAAS,CAAC,SAAiB,EAAE,IAAY;QACtD,OAAO,MAAM,CAAC,UAAU,CACtB,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,EAC9B,IAAI,EACJ,YAAY,EACZ,OAAO,EACP,aAAa,CACd,CAAC;IACJ,CAAC;CACF;AArDD,8BAqDC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-command.helper.d.ts","sourceRoot":"","sources":["../../src/helpers/cli-command.helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAG/C,qBAAa,gBAAgB;WACd,aAAa,CAAC,CAAC,EAAE,QAAQ,EAAE,UAAU,CAAC,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;CAiH1E"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CliCommandHelper = void 0;
|
|
4
|
+
const class_validator_1 = require("class-validator");
|
|
5
|
+
class CliCommandHelper {
|
|
6
|
+
static async promptFromDto(dtoClass) {
|
|
7
|
+
const metadataStorage = (0, class_validator_1.getMetadataStorage)();
|
|
8
|
+
const properties = metadataStorage
|
|
9
|
+
.getTargetValidationMetadatas(dtoClass, '', false, false)
|
|
10
|
+
.map((meta) => meta.propertyName)
|
|
11
|
+
.filter((value, index, self) => self.indexOf(value) === index);
|
|
12
|
+
const questions = [];
|
|
13
|
+
for (const property of properties) {
|
|
14
|
+
const type = Reflect.getMetadata('design:type', dtoClass.prototype, property);
|
|
15
|
+
const apiPropertyMetadata = Reflect.getMetadata('swagger/apiModelProperties', dtoClass.prototype, property);
|
|
16
|
+
const enumValues = apiPropertyMetadata?.enum;
|
|
17
|
+
const isOptional = apiPropertyMetadata?.required === false;
|
|
18
|
+
if (!type)
|
|
19
|
+
continue;
|
|
20
|
+
let question;
|
|
21
|
+
if (enumValues && Array.isArray(enumValues)) {
|
|
22
|
+
question = {
|
|
23
|
+
name: property,
|
|
24
|
+
type: 'select',
|
|
25
|
+
message: `Select ${property}:`,
|
|
26
|
+
choices: enumValues,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
switch (type.name) {
|
|
31
|
+
case 'String':
|
|
32
|
+
question = {
|
|
33
|
+
name: property,
|
|
34
|
+
};
|
|
35
|
+
if (property.toLowerCase().includes('pass')) {
|
|
36
|
+
question.type = 'password';
|
|
37
|
+
question.message = `Enter ${property} (hidden):`;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
question.type = 'input';
|
|
41
|
+
question.message = `Enter ${property}:`;
|
|
42
|
+
}
|
|
43
|
+
if (!isOptional) {
|
|
44
|
+
question.message += ' (required)';
|
|
45
|
+
question.validate = (input) => {
|
|
46
|
+
if (!input || input.trim() === '') {
|
|
47
|
+
return `${property} is required`;
|
|
48
|
+
}
|
|
49
|
+
return true;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
break;
|
|
53
|
+
case 'Number':
|
|
54
|
+
question = {
|
|
55
|
+
name: property,
|
|
56
|
+
type: 'number',
|
|
57
|
+
message: `Enter ${property} (number):`,
|
|
58
|
+
};
|
|
59
|
+
if (!isOptional) {
|
|
60
|
+
question.message += ' (required)';
|
|
61
|
+
question.validate = (input) => {
|
|
62
|
+
if (!input) {
|
|
63
|
+
return `${property} is required`;
|
|
64
|
+
}
|
|
65
|
+
return true;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
break;
|
|
69
|
+
case 'Boolean':
|
|
70
|
+
question = {
|
|
71
|
+
name: property,
|
|
72
|
+
type: 'confirm',
|
|
73
|
+
message: `Set ${property} (y/n)?`,
|
|
74
|
+
};
|
|
75
|
+
if (!isOptional) {
|
|
76
|
+
question.message += ' (required)';
|
|
77
|
+
question.validate = (input) => {
|
|
78
|
+
if (!input) {
|
|
79
|
+
return `${property} is required`;
|
|
80
|
+
}
|
|
81
|
+
return true;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
break;
|
|
85
|
+
default:
|
|
86
|
+
if (type.prototype) {
|
|
87
|
+
const nestedQuestion = await CliCommandHelper.promptFromDto(type);
|
|
88
|
+
questions.push(...nestedQuestion);
|
|
89
|
+
}
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if (question)
|
|
94
|
+
questions.push(question);
|
|
95
|
+
}
|
|
96
|
+
return questions;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
exports.CliCommandHelper = CliCommandHelper;
|
|
100
|
+
//# sourceMappingURL=cli-command.helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-command.helper.js","sourceRoot":"","sources":["../../src/helpers/cli-command.helper.ts"],"names":[],"mappings":";;;AACA,qDAAqD;AAErD,MAAa,gBAAgB;IAC3B,MAAM,CAAC,KAAK,CAAC,aAAa,CAAI,QAAqB;QAEjD,MAAM,eAAe,GAAG,IAAA,oCAAkB,GAAE,CAAC;QAE7C,MAAM,UAAU,GAAG,eAAe;aAC/B,4BAA4B,CAAC,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC;aACxD,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC;aAEhC,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,CAAC;QAEjE,MAAM,SAAS,GAAe,EAAE,CAAC;QAGjC,KAAK,MAAM,QAAQ,IAAI,UAAU,EAAE,CAAC;YAElC,MAAM,IAAI,GAAG,OAAO,CAAC,WAAW,CAC9B,aAAa,EACb,QAAQ,CAAC,SAAS,EAClB,QAAQ,CACT,CAAC;YAGF,MAAM,mBAAmB,GAAG,OAAO,CAAC,WAAW,CAC7C,4BAA4B,EA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C;CACF;AAlHD,4CAkHC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-hash.helper.d.ts","sourceRoot":"","sources":["../../src/helpers/generate-hash.helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AAGhE,qBAAa,kBAAkB;IAS7B,MAAM,CAAC,gBAAgB,CAAC,EACtB,IAAI,EACJ,MAAM,EACN,MAAM,GACP,EAAE,+BAA+B,GAAG,MAAM;CAqB5C"}
|
|
@@ -0,0 +1,60 @@
|
|
|
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 __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.GenerateHashHelper = void 0;
|
|
37
|
+
const crypto = __importStar(require("crypto"));
|
|
38
|
+
class GenerateHashHelper {
|
|
39
|
+
static generateCacheKey({ args, suffix, prefix, }) {
|
|
40
|
+
let cacheKey = prefix ? `${prefix}:` : '';
|
|
41
|
+
if (args && Object.keys(args)?.length) {
|
|
42
|
+
let argsKeys = '';
|
|
43
|
+
Object.keys(args)
|
|
44
|
+
.filter((key) => args[key])
|
|
45
|
+
.forEach((key, index) => {
|
|
46
|
+
argsKeys += `${index !== 0 ? ':' : ''}${key}>${JSON.stringify(args[key])}`;
|
|
47
|
+
});
|
|
48
|
+
const hash = crypto.createHash('sha256');
|
|
49
|
+
cacheKey += `${hash.update(`${argsKeys}`).digest('hex')}`;
|
|
50
|
+
}
|
|
51
|
+
cacheKey += suffix
|
|
52
|
+
? suffix.startsWith(':')
|
|
53
|
+
? `${suffix}`
|
|
54
|
+
: `:${suffix}`
|
|
55
|
+
: '';
|
|
56
|
+
return cacheKey;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.GenerateHashHelper = GenerateHashHelper;
|
|
60
|
+
//# sourceMappingURL=generate-hash.helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-hash.helper.js","sourceRoot":"","sources":["../../src/helpers/generate-hash.helper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+CAAiC;AAEjC,MAAa,kBAAkB;IAS7B,MAAM,CAAC,gBAAgB,CAAC,EACtB,IAAI,EACJ,MAAM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AAM,EACb,UAAU,GAAE,MAAyD,GACpE,MAAM;CAGV"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HmacHelper = void 0;
|
|
4
|
+
const crypto_1 = require("crypto");
|
|
5
|
+
class HmacHelper {
|
|
6
|
+
static hmac(value, hashSecret = process.env?.HMAC_SECRET_KEY || 'yourHmacSecret') {
|
|
7
|
+
return (0, crypto_1.createHmac)('sha256', hashSecret).update(value).digest('hex');
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.HmacHelper = HmacHelper;
|
|
11
|
+
//# sourceMappingURL=hmac.helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hmac.helper.js","sourceRoot":"","sources":["../../src/helpers/hmac.helper.ts"],"names":[],"mappings":";;;AAAA,mCAAoC;AAEpC,MAAa,UAAU;IACrB,MAAM,CAAC,IAAI,CACT,KAAa,EACb,aAAqB,OAAO,CAAC,GAAG,EAAE,eAAe,IAAI,gBAAgB;QAErE,OAAO,IAAA,mBAAU,EAAC,QAAQ,EAAE,UAAU,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACtE,CAAC;CACF;AAPD,gCAOC"}
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
|
+
export * from './aes.helper';
|
|
2
|
+
export * from './cli-command.helper';
|
|
3
|
+
export * from './convert-string-case.helper';
|
|
4
|
+
export * from './generate-hash.helper';
|
|
1
5
|
export * from './get-env.helper';
|
|
2
|
-
export * from './
|
|
6
|
+
export * from './hmac.helper';
|
|
3
7
|
export * from './message-formatter.helper';
|
|
4
|
-
export * from './
|
|
8
|
+
export * from './method.helper';
|
|
9
|
+
export * from './multi-inheritance.helper';
|
|
10
|
+
export * from './phone.helper';
|
|
11
|
+
export * from './ram-usage.helper';
|
|
5
12
|
export * from './rxjs-catch-error.helper';
|
|
6
13
|
export * from './rxjs-timeout-custom-callback.helper';
|
|
14
|
+
export * from './yup.helper';
|
|
7
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iBAAiB,CAAC;AAChC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uCAAuC,CAAC;AACtD,cAAc,cAAc,CAAC"}
|
package/dist/helpers/index.js
CHANGED
|
@@ -14,10 +14,18 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./aes.helper"), exports);
|
|
18
|
+
__exportStar(require("./cli-command.helper"), exports);
|
|
19
|
+
__exportStar(require("./convert-string-case.helper"), exports);
|
|
20
|
+
__exportStar(require("./generate-hash.helper"), exports);
|
|
17
21
|
__exportStar(require("./get-env.helper"), exports);
|
|
18
|
-
__exportStar(require("./
|
|
22
|
+
__exportStar(require("./hmac.helper"), exports);
|
|
19
23
|
__exportStar(require("./message-formatter.helper"), exports);
|
|
20
|
-
__exportStar(require("./
|
|
24
|
+
__exportStar(require("./method.helper"), exports);
|
|
25
|
+
__exportStar(require("./multi-inheritance.helper"), exports);
|
|
26
|
+
__exportStar(require("./phone.helper"), exports);
|
|
27
|
+
__exportStar(require("./ram-usage.helper"), exports);
|
|
21
28
|
__exportStar(require("./rxjs-catch-error.helper"), exports);
|
|
22
29
|
__exportStar(require("./rxjs-timeout-custom-callback.helper"), exports);
|
|
30
|
+
__exportStar(require("./yup.helper"), exports);
|
|
23
31
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,6DAA2C;AAC3C,6DAA2C;AAC3C
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,uDAAqC;AACrC,+DAA6C;AAC7C,yDAAuC;AACvC,mDAAiC;AACjC,gDAA8B;AAC9B,6DAA2C;AAC3C,kDAAgC;AAChC,6DAA2C;AAC3C,iDAA+B;AAC/B,qDAAmC;AACnC,4DAA0C;AAC1C,wEAAsD;AACtD,+CAA6B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"method.helper.d.ts","sourceRoot":"","sources":["../../src/helpers/method.helper.ts"],"names":[],"mappings":"AAAA,qBAAa,YAAY;IACvB,MAAM,CAAC,aAAa,CAAC,EAAE,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,MAAM;CAgB7D"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MethodHelper = void 0;
|
|
4
|
+
class MethodHelper {
|
|
5
|
+
static getMethodName(fn) {
|
|
6
|
+
if (fn.name)
|
|
7
|
+
return fn.name;
|
|
8
|
+
try {
|
|
9
|
+
const src = fn.toString();
|
|
10
|
+
const dotMatch = src.match(/\.([a-zA-Z0-9_]+)\s*\(/);
|
|
11
|
+
if (dotMatch?.[1])
|
|
12
|
+
return dotMatch[1];
|
|
13
|
+
const funcMatch = src.match(/function\s+([a-zA-Z0-9_]+)\s*\(/);
|
|
14
|
+
if (funcMatch?.[1])
|
|
15
|
+
return funcMatch[1];
|
|
16
|
+
return src.split('\n')[0].slice(0, 50) + '...';
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
return '<anonymous>';
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.MethodHelper = MethodHelper;
|
|
24
|
+
//# sourceMappingURL=method.helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"method.helper.js","sourceRoot":"","sources":["../../src/helpers/method.helper.ts"],"names":[],"mappings":";;;AAAA,MAAa,YAAY;IACvB,MAAM,CAAC,aAAa,CAAC,EAA8B;QACjD,IAAI,EAAE,CAAC,IAAI;YAAE,OAAO,EAAE,CAAC,IAAI,CAAC;QAC5B,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC;YAE1B,MAAM,QAAQ,GAAG,GAAG,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;YACrD,IAAI,QAAQ,EAAE,CAAC,CAAC,CAAC;gBAAE,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC;YAEtC,MAAM,SAAS,GAAG,GAAG,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC;YAC/D,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC;gBAAE,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC;YAExC,OAAO,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC;QACjD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,aAAa,CAAC;QACvB,CAAC;IACH,CAAC;CACF;AAjBD,oCAiBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phone.helper.d.ts","sourceRoot":"","sources":["../../src/helpers/phone.helper.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,WAAW;IAC9B,MAAM,CAAC,6BAA6B,CAAC,WAAW,EAAE,MAAM;CAGzD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class PhoneHelper {
|
|
4
|
+
static convertFormattedPhoneToNumber(phoneNumber) {
|
|
5
|
+
return phoneNumber ? phoneNumber.replace(/\D/g, '') : phoneNumber;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
exports.default = PhoneHelper;
|
|
9
|
+
//# sourceMappingURL=phone.helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phone.helper.js","sourceRoot":"","sources":["../../src/helpers/phone.helper.ts"],"names":[],"mappings":";;AAAA,MAAqB,WAAW;IAC9B,MAAM,CAAC,6BAA6B,CAAC,WAAmB;QACtD,OAAO,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC;IACpE,CAAC;CACF;AAJD,8BAIC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ram-usage.helper.d.ts","sourceRoot":"","sources":["../../src/helpers/ram-usage.helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,qBAAa,cAAc;IACzB,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM;CAcpD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RamUsageHelper = void 0;
|
|
4
|
+
class RamUsageHelper {
|
|
5
|
+
static logRamUsage(logger, preText) {
|
|
6
|
+
const used = process.memoryUsage();
|
|
7
|
+
if (preText)
|
|
8
|
+
logger.debug(preText);
|
|
9
|
+
logger.debug(`Memory usage: RSS=${(used.rss / 1024 / 1024).toFixed(2)} MB, HeapTotal=${(used.heapTotal /
|
|
10
|
+
1024 /
|
|
11
|
+
1024).toFixed(2)} MB, HeapUsed=${(used.heapUsed / 1024 / 1024).toFixed(2)} MB, External=${(used.external / 1024 / 1024).toFixed(2)} MB`);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.RamUsageHelper = RamUsageHelper;
|
|
15
|
+
//# sourceMappingURL=ram-usage.helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ram-usage.helper.js","sourceRoot":"","sources":["../../src/helpers/ram-usage.helper.ts"],"names":[],"mappings":";;;AAEA,MAAa,cAAc;IACzB,MAAM,CAAC,WAAW,CAAC,MAAc,EAAE,OAAgB;QAEjD,MAAM,IAAI,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;QACnC,IAAI,OAAO;YAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACnC,MAAM,CAAC,KAAK,CACV,qBAAqB,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,kBAAkB,CACxE,IAAI,CAAC,SAAS;YACd,IAAI;YACJ,IAAI,CACL,CAAC,OAAO,CAAC,CAAC,CAAC,iBAAiB,CAAC,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,OAAO,CAChE,CAAC,CACF,iBAAiB,CAAC,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAChE,CAAC;IACJ,CAAC;CACF;AAfD,wCAeC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as yup from 'yup';
|
|
2
|
+
type ExtraParams = Record<string, unknown>;
|
|
3
|
+
type SchemaDescriptor = {
|
|
4
|
+
type: string;
|
|
5
|
+
optional: boolean;
|
|
6
|
+
nullable: boolean;
|
|
7
|
+
fields?: Record<string, SchemaDescriptor>;
|
|
8
|
+
of?: SchemaDescriptor;
|
|
9
|
+
tests?: {
|
|
10
|
+
name?: string;
|
|
11
|
+
params?: ExtraParams;
|
|
12
|
+
}[];
|
|
13
|
+
};
|
|
14
|
+
export declare class YupHelper {
|
|
15
|
+
static extractYupDescriptor(describeNode: any): SchemaDescriptor;
|
|
16
|
+
static buildYupSchema(descriptor: SchemaDescriptor): yup.AnySchema;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=yup.helper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"yup.helper.d.ts","sourceRoot":"","sources":["../../src/helpers/yup.helper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAE3B,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE3C,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC1C,EAAE,CAAC,EAAE,gBAAgB,CAAC;IACtB,KAAK,CAAC,EAAE;QACN,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,WAAW,CAAC;KACtB,EAAE,CAAC;CACL,CAAC;AAEF,qBAAa,SAAS;IACpB,MAAM,CAAC,oBAAoB,CAAC,YAAY,EAAE,GAAG,GAAG,gBAAgB;IA8BhE,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,gBAAgB,GAAG,GAAG,CAAC,SAAS;CAiFnE"}
|
|
@@ -0,0 +1,130 @@
|
|
|
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 __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.YupHelper = void 0;
|
|
37
|
+
const yup = __importStar(require("yup"));
|
|
38
|
+
class YupHelper {
|
|
39
|
+
static extractYupDescriptor(describeNode) {
|
|
40
|
+
const descriptor = {
|
|
41
|
+
type: describeNode.type,
|
|
42
|
+
optional: describeNode.optional ?? true,
|
|
43
|
+
nullable: describeNode.nullable ?? false,
|
|
44
|
+
};
|
|
45
|
+
if (describeNode.tests && Array.isArray(describeNode.tests)) {
|
|
46
|
+
descriptor.tests = describeNode.tests.map((test) => {
|
|
47
|
+
return {
|
|
48
|
+
name: test.name,
|
|
49
|
+
params: test.params || {},
|
|
50
|
+
};
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
if (describeNode.type === 'object' && describeNode.fields) {
|
|
54
|
+
descriptor.fields = {};
|
|
55
|
+
for (const [key, value] of Object.entries(describeNode.fields)) {
|
|
56
|
+
descriptor.fields[key] = this.extractYupDescriptor(value);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (describeNode.type === 'array' && describeNode.innerType) {
|
|
60
|
+
descriptor.of = this.extractYupDescriptor(describeNode.innerType);
|
|
61
|
+
}
|
|
62
|
+
return descriptor;
|
|
63
|
+
}
|
|
64
|
+
static buildYupSchema(descriptor) {
|
|
65
|
+
let schema;
|
|
66
|
+
switch (descriptor.type) {
|
|
67
|
+
case 'string':
|
|
68
|
+
schema = yup.string();
|
|
69
|
+
break;
|
|
70
|
+
case 'number':
|
|
71
|
+
schema = yup.number();
|
|
72
|
+
break;
|
|
73
|
+
case 'boolean':
|
|
74
|
+
schema = yup.boolean();
|
|
75
|
+
break;
|
|
76
|
+
case 'date':
|
|
77
|
+
schema = yup.date();
|
|
78
|
+
break;
|
|
79
|
+
case 'array':
|
|
80
|
+
if (!descriptor.of)
|
|
81
|
+
throw new Error(`Missing "of" in array descriptor`);
|
|
82
|
+
schema = yup.array().of(this.buildYupSchema(descriptor.of));
|
|
83
|
+
break;
|
|
84
|
+
case 'object':
|
|
85
|
+
if (!descriptor.fields)
|
|
86
|
+
throw new Error(`Missing "fields" in object descriptor`);
|
|
87
|
+
const shape = {};
|
|
88
|
+
for (const [key, fieldDescriptor] of Object.entries(descriptor.fields)) {
|
|
89
|
+
shape[key] = this.buildYupSchema(fieldDescriptor);
|
|
90
|
+
}
|
|
91
|
+
schema = yup.object().shape(shape);
|
|
92
|
+
break;
|
|
93
|
+
default:
|
|
94
|
+
throw new Error(`Unsupported schema type: ${descriptor.type}`);
|
|
95
|
+
}
|
|
96
|
+
if (descriptor.tests) {
|
|
97
|
+
for (const test of descriptor.tests) {
|
|
98
|
+
const method = schema[test.name];
|
|
99
|
+
if (typeof method === 'function') {
|
|
100
|
+
const params = test.params
|
|
101
|
+
? Object.keys(test.params)
|
|
102
|
+
.filter((key) => key !== 'regex')
|
|
103
|
+
.map((key) => test.params[key])
|
|
104
|
+
: [];
|
|
105
|
+
const args = [];
|
|
106
|
+
if (params.length > 0) {
|
|
107
|
+
args.push(...params);
|
|
108
|
+
}
|
|
109
|
+
try {
|
|
110
|
+
schema = method.apply(schema, args);
|
|
111
|
+
}
|
|
112
|
+
catch (e) {
|
|
113
|
+
console.warn(`Failed to apply test "${test.name}" with args`, args, e);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
console.warn(`Unsupported test method "${test.name}" for type "${descriptor.type}"`);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
if (descriptor.nullable)
|
|
122
|
+
schema = schema.nullable();
|
|
123
|
+
if (!descriptor.optional &&
|
|
124
|
+
!descriptor.tests.map((test) => test.name).includes('required'))
|
|
125
|
+
schema = schema.required();
|
|
126
|
+
return schema;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
exports.YupHelper = YupHelper;
|
|
130
|
+
//# sourceMappingURL=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,CAAC,UAAU,CAAC,QAAQ;YACpB,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC;YAE/D,MAAM,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;QAE7B,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAhHD,8BAgHC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-cache-key-params.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/generate-cache-key-params.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,+BAA+B;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-cache-key-params.interface.js","sourceRoot":"","sources":["../../src/interfaces/generate-cache-key-params.interface.ts"],"names":[],"mappings":""}
|
|
@@ -4,4 +4,5 @@ export * from './get-user.interface';
|
|
|
4
4
|
export * from './kafka-failed-response.interface';
|
|
5
5
|
export * from './kafka-success-response.interface';
|
|
6
6
|
export * from './pagination-query';
|
|
7
|
+
export * from './generate-cache-key-params.interface';
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,yCAAyC,CAAC;AACxD,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,yCAAyC,CAAC;AACxD,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,oBAAoB,CAAC;AACnC,cAAc,uCAAuC,CAAC"}
|
package/dist/interfaces/index.js
CHANGED
|
@@ -20,4 +20,5 @@ __exportStar(require("./get-user.interface"), exports);
|
|
|
20
20
|
__exportStar(require("./kafka-failed-response.interface"), exports);
|
|
21
21
|
__exportStar(require("./kafka-success-response.interface"), exports);
|
|
22
22
|
__exportStar(require("./pagination-query"), exports);
|
|
23
|
+
__exportStar(require("./generate-cache-key-params.interface"), exports);
|
|
23
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0EAAwD;AACxD,wDAAsC;AACtC,uDAAqC;AACrC,oEAAkD;AAClD,qEAAmD;AACnD,qDAAmC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0EAAwD;AACxD,wDAAsC;AACtC,uDAAqC;AACrC,oEAAkD;AAClD,qEAAmD;AACnD,qDAAmC;AACnC,wEAAsD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mondart/nestjs-common-module-core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "Core utilities, DTOs, decorators, entities, filters, validators and helpers for NestJS.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Mondart"
|
|
@@ -29,6 +29,8 @@
|
|
|
29
29
|
"class-validator": "^0.14.3",
|
|
30
30
|
"nestjs-paginate": "^12.8.3",
|
|
31
31
|
"reflect-metadata": "^0.2.0",
|
|
32
|
+
"inquirer": "^13.2.2",
|
|
33
|
+
"yup": "^1.7.1",
|
|
32
34
|
"rxjs": "^7.8.2",
|
|
33
35
|
"typeorm": "^0.3.28"
|
|
34
36
|
},
|