@degenerate/rules 0.0.2 → 0.0.4
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/generic/src/errors/safe/safe-rules-errors.d.ts +19 -0
- package/dist/generic/src/errors/safe/safe-rules-errors.d.ts.map +1 -1
- package/dist/generic/src/errors/safe/safe-rules-errors.js +25 -2
- package/dist/rules/src/evaluation/check-function-integrity.d.ts +1 -1
- package/dist/rules/src/evaluation/check-function-integrity.d.ts.map +1 -1
- package/dist/rules/src/evaluation/check-if-proposal-is-valid.d.ts +1 -1
- package/dist/rules/src/evaluation/check-if-proposal-is-valid.d.ts.map +1 -1
- package/dist/rules/src/evaluation/conditions/boolean-conditions.d.ts +1 -1
- package/dist/rules/src/evaluation/conditions/boolean-conditions.d.ts.map +1 -1
- package/dist/rules/src/evaluation/conditions/boolean-conditions.js +4 -5
- package/dist/rules/src/evaluation/conditions/contains-conditions.d.ts +1 -1
- package/dist/rules/src/evaluation/conditions/contains-conditions.d.ts.map +1 -1
- package/dist/rules/src/evaluation/conditions/contains-conditions.js +2 -2
- package/dist/rules/src/evaluation/conditions/empty-conditions.d.ts +1 -1
- package/dist/rules/src/evaluation/conditions/empty-conditions.d.ts.map +1 -1
- package/dist/rules/src/evaluation/conditions/empty-conditions.js +6 -6
- package/dist/rules/src/evaluation/conditions/equality-conditions.d.ts +1 -1
- package/dist/rules/src/evaluation/conditions/equality-conditions.d.ts.map +1 -1
- package/dist/rules/src/evaluation/conditions/equality-conditions.js +3 -3
- package/dist/rules/src/evaluation/conditions/null-conditions.d.ts +1 -1
- package/dist/rules/src/evaluation/conditions/null-conditions.d.ts.map +1 -1
- package/dist/rules/src/evaluation/conditions/null-conditions.js +3 -3
- package/dist/rules/src/evaluation/conditions/range-conditions.d.ts +1 -1
- package/dist/rules/src/evaluation/conditions/range-conditions.d.ts.map +1 -1
- package/dist/rules/src/evaluation/conditions/range-conditions.js +5 -5
- package/dist/rules/src/evaluation/conditions/special-conditions.d.ts +1 -1
- package/dist/rules/src/evaluation/conditions/special-conditions.d.ts.map +1 -1
- package/dist/rules/src/evaluation/conditions/special-conditions.js +3 -3
- package/dist/rules/src/evaluation/conditions/starts-end-with-conditions.d.ts +2 -2
- package/dist/rules/src/evaluation/conditions/starts-end-with-conditions.d.ts.map +1 -1
- package/dist/rules/src/evaluation/conditions/starts-end-with-conditions.js +22 -3
- package/dist/rules/src/evaluation/conditions/typeof-rule-conditions.d.ts +1 -1
- package/dist/rules/src/evaluation/conditions/typeof-rule-conditions.d.ts.map +1 -1
- package/dist/rules/src/evaluation/conditions/typeof-rule-conditions.js +12 -12
- package/dist/rules/src/evaluation/determine-if-data-has-changed.d.ts +1 -1
- package/dist/rules/src/evaluation/determine-if-data-has-changed.d.ts.map +1 -1
- package/dist/rules/src/evaluation/evaluate-rule-conditions.d.ts +1 -1
- package/dist/rules/src/evaluation/evaluate-rule-conditions.d.ts.map +1 -1
- package/dist/rules/src/evaluation/evaluate-rule-conditions.js +20 -20
- package/dist/rules/src/evaluation/evaluate-rule.d.ts +1 -1
- package/dist/rules/src/evaluation/evaluate-rule.d.ts.map +1 -1
- package/dist/rules/src/evaluation/evaluate-rules.d.ts +1 -1
- package/dist/rules/src/evaluation/evaluate-rules.d.ts.map +1 -1
- package/dist/rules/src/evaluation/get-data-changed-information.d.ts +1 -1
- package/dist/rules/src/evaluation/get-data-changed-information.d.ts.map +1 -1
- package/dist/rules/src/evaluation/get-root-property-results.d.ts +1 -1
- package/dist/rules/src/evaluation/get-root-property-results.d.ts.map +1 -1
- package/dist/rules/src/evaluation/index.d.ts +9 -0
- package/dist/rules/src/evaluation/index.d.ts.map +1 -1
- package/dist/rules/src/evaluation/index.js +9 -0
- package/dist/rules/src/evaluation/start-rule-evaluation.d.ts +1 -1
- package/dist/rules/src/evaluation/start-rule-evaluation.d.ts.map +1 -1
- package/dist/rules/src/evaluation/start-rule-evaluation.js +3 -3
- package/package.json +5 -2
- package/dist/generic/src/_settings/cryptography-settings.d.ts +0 -27
- package/dist/generic/src/_settings/cryptography-settings.d.ts.map +0 -1
- package/dist/generic/src/_settings/cryptography-settings.js +0 -27
- package/dist/generic/src/crypto/calculate-combined-hash.d.ts +0 -13
- package/dist/generic/src/crypto/calculate-combined-hash.d.ts.map +0 -1
- package/dist/generic/src/crypto/calculate-combined-hash.js +0 -44
- package/dist/generic/src/crypto/calculate-hash.d.ts +0 -7
- package/dist/generic/src/crypto/calculate-hash.d.ts.map +0 -1
- package/dist/generic/src/crypto/calculate-hash.js +0 -37
- package/dist/generic/src/crypto/index.d.ts +0 -13
- package/dist/generic/src/crypto/index.d.ts.map +0 -1
- package/dist/generic/src/crypto/index.js +0 -34
- package/dist/generic/src/crypto/private-public-keys/create-key-pair-from-mnemonic.d.ts +0 -12
- package/dist/generic/src/crypto/private-public-keys/create-key-pair-from-mnemonic.d.ts.map +0 -1
- package/dist/generic/src/crypto/private-public-keys/create-key-pair-from-mnemonic.js +0 -44
- package/dist/generic/src/crypto/private-public-keys/create-key-pair-from-private-key.d.ts +0 -11
- package/dist/generic/src/crypto/private-public-keys/create-key-pair-from-private-key.d.ts.map +0 -1
- package/dist/generic/src/crypto/private-public-keys/create-key-pair-from-private-key.js +0 -40
- package/dist/generic/src/crypto/private-public-keys/generation/create-256-private-key-from-mnemonic.d.ts +0 -11
- package/dist/generic/src/crypto/private-public-keys/generation/create-256-private-key-from-mnemonic.d.ts.map +0 -1
- package/dist/generic/src/crypto/private-public-keys/generation/create-256-private-key-from-mnemonic.js +0 -45
- package/dist/generic/src/crypto/private-public-keys/generation/create-entropy-for-elliptical-curve.d.ts +0 -10
- package/dist/generic/src/crypto/private-public-keys/generation/create-entropy-for-elliptical-curve.d.ts.map +0 -1
- package/dist/generic/src/crypto/private-public-keys/generation/create-entropy-for-elliptical-curve.js +0 -40
- package/dist/generic/src/crypto/private-public-keys/generation/create-random-256-private-key.d.ts +0 -8
- package/dist/generic/src/crypto/private-public-keys/generation/create-random-256-private-key.d.ts.map +0 -1
- package/dist/generic/src/crypto/private-public-keys/generation/create-random-256-private-key.js +0 -41
- package/dist/generic/src/crypto/private-public-keys/generation/generate-key-pair.d.ts +0 -11
- package/dist/generic/src/crypto/private-public-keys/generation/generate-key-pair.d.ts.map +0 -1
- package/dist/generic/src/crypto/private-public-keys/generation/generate-key-pair.js +0 -39
- package/dist/generic/src/crypto/private-public-keys/generation/get-private-public-key-from-keypair.d.ts +0 -15
- package/dist/generic/src/crypto/private-public-keys/generation/get-private-public-key-from-keypair.d.ts.map +0 -1
- package/dist/generic/src/crypto/private-public-keys/generation/get-private-public-key-from-keypair.js +0 -21
- package/dist/generic/src/crypto/signature/create-crypto-signature.d.ts +0 -9
- package/dist/generic/src/crypto/signature/create-crypto-signature.d.ts.map +0 -1
- package/dist/generic/src/crypto/signature/create-crypto-signature.js +0 -13
- package/dist/generic/src/crypto/signature/verify-crypto-signature-by-data.d.ts +0 -13
- package/dist/generic/src/crypto/signature/verify-crypto-signature-by-data.d.ts.map +0 -1
- package/dist/generic/src/crypto/signature/verify-crypto-signature-by-data.js +0 -45
- package/dist/generic/src/crypto/signature/verify-crypto-signature-by-hash.d.ts +0 -13
- package/dist/generic/src/crypto/signature/verify-crypto-signature-by-hash.d.ts.map +0 -1
- package/dist/generic/src/crypto/signature/verify-crypto-signature-by-hash.js +0 -42
- package/dist/generic/src/helpers/array/array-helpers.d.ts +0 -8
- package/dist/generic/src/helpers/array/array-helpers.d.ts.map +0 -1
- package/dist/generic/src/helpers/array/array-helpers.js +0 -14
- package/dist/generic/src/helpers/data/data-helpers.d.ts +0 -46
- package/dist/generic/src/helpers/data/data-helpers.d.ts.map +0 -1
- package/dist/generic/src/helpers/data/data-helpers.js +0 -106
- package/dist/generic/src/helpers/file/file-helpers.d.ts +0 -12
- package/dist/generic/src/helpers/file/file-helpers.d.ts.map +0 -1
- package/dist/generic/src/helpers/file/file-helpers.js +0 -39
- package/dist/generic/src/helpers/id-helpers.d.ts +0 -8
- package/dist/generic/src/helpers/id-helpers.d.ts.map +0 -1
- package/dist/generic/src/helpers/id-helpers.js +0 -19
- package/dist/generic/src/helpers/index.d.ts +0 -11
- package/dist/generic/src/helpers/index.d.ts.map +0 -1
- package/dist/generic/src/helpers/index.js +0 -31
- package/dist/generic/src/helpers/lodash/lodash-helpers.d.ts +0 -14
- package/dist/generic/src/helpers/lodash/lodash-helpers.d.ts.map +0 -1
- package/dist/generic/src/helpers/lodash/lodash-helpers.js +0 -28
- package/dist/generic/src/helpers/object-helpers.d.ts +0 -23
- package/dist/generic/src/helpers/object-helpers.d.ts.map +0 -1
- package/dist/generic/src/helpers/object-helpers.js +0 -54
- package/dist/generic/src/helpers/object-validation-helpers.d.ts +0 -59
- package/dist/generic/src/helpers/object-validation-helpers.d.ts.map +0 -1
- package/dist/generic/src/helpers/object-validation-helpers.js +0 -233
- package/dist/generic/src/helpers/request/params-object-helpers.d.ts +0 -38
- package/dist/generic/src/helpers/request/params-object-helpers.d.ts.map +0 -1
- package/dist/generic/src/helpers/request/params-object-helpers.js +0 -54
- package/dist/generic/src/helpers/request/query-object-helpers.d.ts +0 -12
- package/dist/generic/src/helpers/request/query-object-helpers.d.ts.map +0 -1
- package/dist/generic/src/helpers/request/query-object-helpers.js +0 -25
- package/dist/generic/src/helpers/request/request-object-helpers.d.ts +0 -19
- package/dist/generic/src/helpers/request/request-object-helpers.d.ts.map +0 -1
- package/dist/generic/src/helpers/request/request-object-helpers.js +0 -28
- package/dist/generic/src/index.d.ts +0 -6
- package/dist/generic/src/index.d.ts.map +0 -1
- package/dist/generic/src/index.js +0 -23
package/dist/generic/src/crypto/private-public-keys/generation/create-random-256-private-key.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
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 (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.createRandom256PrivateKey = void 0;
|
|
27
|
-
const crypto = __importStar(require("crypto"));
|
|
28
|
-
const cryptography_settings_1 = require("../../../_settings/cryptography-settings");
|
|
29
|
-
/**
|
|
30
|
-
* Generates a random private key 256 bits in length.
|
|
31
|
-
*
|
|
32
|
-
* @returns A random private key (256 bits) as a hexadecimal string.
|
|
33
|
-
*/
|
|
34
|
-
const createRandom256PrivateKey = () => {
|
|
35
|
-
// Generate 32 random bytes
|
|
36
|
-
const randomBytes = crypto.randomBytes(32);
|
|
37
|
-
// Create a SHA-256 hash of the random bytes
|
|
38
|
-
const hash = crypto.createHash(cryptography_settings_1.CryptoSettings.Hash.Algorithm).update(randomBytes).digest(cryptography_settings_1.CryptoSettings.Hash.Digest);
|
|
39
|
-
return hash;
|
|
40
|
-
};
|
|
41
|
-
exports.createRandom256PrivateKey = createRandom256PrivateKey;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { EllipticalCurvesSigning, EllipticalCurvesEncryption } from '../../../_settings/cryptography-settings';
|
|
2
|
-
import * as Elliptic from 'elliptic';
|
|
3
|
-
/**
|
|
4
|
-
* This function generates a key pair from a private key and entropy using the elliptic library.
|
|
5
|
-
*
|
|
6
|
-
* @param privateKey the private key in hexadecimal format
|
|
7
|
-
* @param entropy the entropy in hexadecimal format
|
|
8
|
-
*/
|
|
9
|
-
declare const generateKeyPair: (curve: EllipticalCurvesSigning | EllipticalCurvesEncryption, privateKey: string, entropy: string) => Elliptic.ec.KeyPair;
|
|
10
|
-
export { generateKeyPair };
|
|
11
|
-
//# sourceMappingURL=generate-key-pair.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate-key-pair.d.ts","sourceRoot":"","sources":["../../../../../../../generic/src/crypto/private-public-keys/generation/generate-key-pair.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AAC/G,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AAErC;;;;;GAKG;AACH,QAAA,MAAM,eAAe,UAAW,uBAAuB,GAAG,0BAA0B,cAAc,MAAM,WAC3F,MAAM,KAAG,QAAQ,CAAC,EAAE,CAAC,OAMjC,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
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 (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.generateKeyPair = void 0;
|
|
27
|
-
const Elliptic = __importStar(require("elliptic"));
|
|
28
|
-
/**
|
|
29
|
-
* This function generates a key pair from a private key and entropy using the elliptic library.
|
|
30
|
-
*
|
|
31
|
-
* @param privateKey the private key in hexadecimal format
|
|
32
|
-
* @param entropy the entropy in hexadecimal format
|
|
33
|
-
*/
|
|
34
|
-
const generateKeyPair = (curve, privateKey, entropy) => {
|
|
35
|
-
const ellipticalCurve = new Elliptic.ec(curve);
|
|
36
|
-
const keyPair = ellipticalCurve.genKeyPair({ pers: privateKey, entropy: entropy });
|
|
37
|
-
return keyPair;
|
|
38
|
-
};
|
|
39
|
-
exports.generateKeyPair = generateKeyPair;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as Elliptic from 'elliptic';
|
|
2
|
-
/**
|
|
3
|
-
* This function gets the private key from a key pair.
|
|
4
|
-
*
|
|
5
|
-
* @param keyPair the key pair to get the private key from
|
|
6
|
-
*/
|
|
7
|
-
declare const getPrivateKeyFromKeyPair: (keyPair: Elliptic.ec.KeyPair) => string;
|
|
8
|
-
/**
|
|
9
|
-
* This function gets the public key from a key pair.
|
|
10
|
-
*
|
|
11
|
-
* @param keyPair the key pair to get the public key from
|
|
12
|
-
*/
|
|
13
|
-
declare const getPublicKeyFromKeyPair: (keyPair: Elliptic.ec.KeyPair) => string;
|
|
14
|
-
export { getPrivateKeyFromKeyPair, getPublicKeyFromKeyPair };
|
|
15
|
-
//# sourceMappingURL=get-private-public-key-from-keypair.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-private-public-key-from-keypair.d.ts","sourceRoot":"","sources":["../../../../../../../generic/src/crypto/private-public-keys/generation/get-private-public-key-from-keypair.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AAErC;;;;GAIG;AACH,QAAA,MAAM,wBAAwB,YAAa,QAAQ,CAAC,EAAE,CAAC,OAAO,KAAG,MAEhE,CAAC;AAEF;;;;GAIG;AACH,QAAA,MAAM,uBAAuB,YAAa,QAAQ,CAAC,EAAE,CAAC,OAAO,KAAG,MAE/D,CAAC;AAEF,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getPublicKeyFromKeyPair = exports.getPrivateKeyFromKeyPair = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* This function gets the private key from a key pair.
|
|
6
|
-
*
|
|
7
|
-
* @param keyPair the key pair to get the private key from
|
|
8
|
-
*/
|
|
9
|
-
const getPrivateKeyFromKeyPair = (keyPair) => {
|
|
10
|
-
return keyPair.getPrivate('hex');
|
|
11
|
-
};
|
|
12
|
-
exports.getPrivateKeyFromKeyPair = getPrivateKeyFromKeyPair;
|
|
13
|
-
/**
|
|
14
|
-
* This function gets the public key from a key pair.
|
|
15
|
-
*
|
|
16
|
-
* @param keyPair the key pair to get the public key from
|
|
17
|
-
*/
|
|
18
|
-
const getPublicKeyFromKeyPair = (keyPair) => {
|
|
19
|
-
return keyPair.getPublic('hex');
|
|
20
|
-
};
|
|
21
|
-
exports.getPublicKeyFromKeyPair = getPublicKeyFromKeyPair;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as Elliptic from 'elliptic';
|
|
2
|
-
/**
|
|
3
|
-
* This function creates a signature for a hash using an elliptical curve.
|
|
4
|
-
* @param keyPair the key pair to use for signing.
|
|
5
|
-
* @param hashToSign the hash to sign.
|
|
6
|
-
*/
|
|
7
|
-
declare const createEllipticalCurveSignature: (keyPair: Elliptic.ec.KeyPair, hashToSign: string) => string;
|
|
8
|
-
export { createEllipticalCurveSignature };
|
|
9
|
-
//# sourceMappingURL=create-crypto-signature.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-crypto-signature.d.ts","sourceRoot":"","sources":["../../../../../../generic/src/crypto/signature/create-crypto-signature.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AAErC;;;;GAIG;AACH,QAAA,MAAM,8BAA8B,YAAa,QAAQ,CAAC,EAAE,CAAC,OAAO,cAAc,MAAM,KAAG,MAG1F,CAAC;AAEF,OAAO,EAAE,8BAA8B,EAAE,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createEllipticalCurveSignature = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* This function creates a signature for a hash using an elliptical curve.
|
|
6
|
-
* @param keyPair the key pair to use for signing.
|
|
7
|
-
* @param hashToSign the hash to sign.
|
|
8
|
-
*/
|
|
9
|
-
const createEllipticalCurveSignature = (keyPair, hashToSign) => {
|
|
10
|
-
const signature = keyPair.sign(hashToSign).toDER('hex');
|
|
11
|
-
return signature;
|
|
12
|
-
};
|
|
13
|
-
exports.createEllipticalCurveSignature = createEllipticalCurveSignature;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { EllipticalCurvesSigning, EllipticalCurvesEncryption } from '../../_settings/cryptography-settings';
|
|
2
|
-
/**
|
|
3
|
-
* This function verifies the signature of the data using the public key
|
|
4
|
-
*
|
|
5
|
-
* @param curve the curve used for the signature
|
|
6
|
-
* @param data the data to verify
|
|
7
|
-
* @param signature the signature to verify
|
|
8
|
-
* @param publicKey the public key to verify the signature
|
|
9
|
-
* @returns
|
|
10
|
-
*/
|
|
11
|
-
declare const verifyCryptoSignatureByData: (curve: EllipticalCurvesSigning | EllipticalCurvesEncryption, data: any, signature: string, publicKey: string) => Promise<boolean>;
|
|
12
|
-
export { verifyCryptoSignatureByData };
|
|
13
|
-
//# sourceMappingURL=verify-crypto-signature-by-data.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"verify-crypto-signature-by-data.d.ts","sourceRoot":"","sources":["../../../../../../generic/src/crypto/signature/verify-crypto-signature-by-data.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AAE5G;;;;;;;;GAQG;AACH,QAAA,MAAM,2BAA2B,UAAiB,uBAAuB,GAAG,0BAA0B,QAAQ,GAAG,aAAa,MAAM,aACrH,MAAM,KAAG,OAAO,CAAC,OAAO,CAMtC,CAAC;AAEF,OAAO,EAAE,2BAA2B,EAAE,CAAC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
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 (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.verifyCryptoSignatureByData = void 0;
|
|
27
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
28
|
-
const elliptic = __importStar(require("elliptic"));
|
|
29
|
-
/**
|
|
30
|
-
* This function verifies the signature of the data using the public key
|
|
31
|
-
*
|
|
32
|
-
* @param curve the curve used for the signature
|
|
33
|
-
* @param data the data to verify
|
|
34
|
-
* @param signature the signature to verify
|
|
35
|
-
* @param publicKey the public key to verify the signature
|
|
36
|
-
* @returns
|
|
37
|
-
*/
|
|
38
|
-
const verifyCryptoSignatureByData = async (curve, data, signature, publicKey) => {
|
|
39
|
-
// convert data to a string.
|
|
40
|
-
const hash = JSON.stringify(data);
|
|
41
|
-
// eslint-disable-next-line new-cap
|
|
42
|
-
const key = new elliptic.ec(curve).keyFromPublic(publicKey, 'hex');
|
|
43
|
-
return key.verify(hash, signature);
|
|
44
|
-
};
|
|
45
|
-
exports.verifyCryptoSignatureByData = verifyCryptoSignatureByData;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { EllipticalCurvesSigning, EllipticalCurvesEncryption } from '../../_settings/cryptography-settings';
|
|
2
|
-
/**
|
|
3
|
-
* This function verifies the signature of the data using the public key
|
|
4
|
-
*
|
|
5
|
-
* @param curve the curve used for the signature
|
|
6
|
-
* @param hash the hash to verify
|
|
7
|
-
* @param signature the signature to verify
|
|
8
|
-
* @param publicKey the public key to verify the signature
|
|
9
|
-
* @returns
|
|
10
|
-
*/
|
|
11
|
-
declare const verifyCryptoSignatureByHash: (curve: EllipticalCurvesSigning | EllipticalCurvesEncryption, hash: string, signature: string, publicKey: string) => Promise<boolean>;
|
|
12
|
-
export { verifyCryptoSignatureByHash };
|
|
13
|
-
//# sourceMappingURL=verify-crypto-signature-by-hash.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"verify-crypto-signature-by-hash.d.ts","sourceRoot":"","sources":["../../../../../../generic/src/crypto/signature/verify-crypto-signature-by-hash.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AAE5G;;;;;;;;GAQG;AACH,QAAA,MAAM,2BAA2B,UAAiB,uBAAuB,GAAG,0BAA0B,QAAQ,MAAM,aAAa,MAAM,aACxH,MAAM,KAAG,OAAO,CAAC,OAAO,CAItC,CAAC;AAEF,OAAO,EAAE,2BAA2B,EAAE,CAAC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
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 (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.verifyCryptoSignatureByHash = void 0;
|
|
27
|
-
const elliptic = __importStar(require("elliptic"));
|
|
28
|
-
/**
|
|
29
|
-
* This function verifies the signature of the data using the public key
|
|
30
|
-
*
|
|
31
|
-
* @param curve the curve used for the signature
|
|
32
|
-
* @param hash the hash to verify
|
|
33
|
-
* @param signature the signature to verify
|
|
34
|
-
* @param publicKey the public key to verify the signature
|
|
35
|
-
* @returns
|
|
36
|
-
*/
|
|
37
|
-
const verifyCryptoSignatureByHash = async (curve, hash, signature, publicKey) => {
|
|
38
|
-
// eslint-disable-next-line new-cap
|
|
39
|
-
const key = new elliptic.ec(curve).keyFromPublic(publicKey, 'hex');
|
|
40
|
-
return key.verify(hash, signature);
|
|
41
|
-
};
|
|
42
|
-
exports.verifyCryptoSignatureByHash = verifyCryptoSignatureByHash;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* this gets a random item from an array.
|
|
3
|
-
*
|
|
4
|
-
* @param incomingArray the incoming array to get a random item from.
|
|
5
|
-
*/
|
|
6
|
-
declare const getRandomItemFromArray: <T>(incomingArray: T[]) => T;
|
|
7
|
-
export { getRandomItemFromArray };
|
|
8
|
-
//# sourceMappingURL=array-helpers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"array-helpers.d.ts","sourceRoot":"","sources":["../../../../../../generic/src/helpers/array/array-helpers.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,QAAA,MAAM,sBAAsB,GAAI,CAAC,iBAAiB,CAAC,EAAE,KAAG,CAGvD,CAAC;AAEF,OAAO,EAAE,sBAAsB,EAAE,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// This file contains the helper functions for arrays.
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.getRandomItemFromArray = void 0;
|
|
5
|
-
/**
|
|
6
|
-
* this gets a random item from an array.
|
|
7
|
-
*
|
|
8
|
-
* @param incomingArray the incoming array to get a random item from.
|
|
9
|
-
*/
|
|
10
|
-
const getRandomItemFromArray = (incomingArray) => {
|
|
11
|
-
const randomIndex = Math.floor(Math.random() * incomingArray.length);
|
|
12
|
-
return incomingArray[randomIndex];
|
|
13
|
-
};
|
|
14
|
-
exports.getRandomItemFromArray = getRandomItemFromArray;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { IGenericData, ISearchableIndex } from '../../models/data/data-models';
|
|
2
|
-
/**
|
|
3
|
-
* This adds the generic data to the object.
|
|
4
|
-
*
|
|
5
|
-
* @param incomingObject the object to add the generic data to.
|
|
6
|
-
* @param userId the user ID to add the generic data to.
|
|
7
|
-
* @param versionNumber the version number to add to the generic data.
|
|
8
|
-
* @returns
|
|
9
|
-
*/
|
|
10
|
-
declare const addGenericDataToObject: <T>(incomingObject: any, userId: string, versionNumber?: number) => T;
|
|
11
|
-
/**
|
|
12
|
-
* This creates the generic data record for the database
|
|
13
|
-
*
|
|
14
|
-
* @param userId the user ID to create the generic data for.
|
|
15
|
-
* @param versionNumber the version number to create the generic data for.
|
|
16
|
-
* @returns
|
|
17
|
-
*/
|
|
18
|
-
declare const createGenericData: (userId: string, versionNumber?: number) => IGenericData;
|
|
19
|
-
/**
|
|
20
|
-
* This takes an incoming string and creates a searchable index object.
|
|
21
|
-
* @param itemForSearchableIndex the item for a searchable index to be created on
|
|
22
|
-
*/
|
|
23
|
-
declare const createSearchableIndex: (itemForSearchableIndex: string) => ISearchableIndex;
|
|
24
|
-
/**
|
|
25
|
-
* This removed all the generic data from an object.
|
|
26
|
-
*
|
|
27
|
-
* @param data
|
|
28
|
-
*/
|
|
29
|
-
declare const deleteGenericDataOnObject: (data: any) => any;
|
|
30
|
-
/**
|
|
31
|
-
* This function removes all whitespace from a string
|
|
32
|
-
*
|
|
33
|
-
* @param str the string to remove whitespace from
|
|
34
|
-
* @returns
|
|
35
|
-
*/
|
|
36
|
-
declare const removeWhitespaceFromObject: (str: string) => string;
|
|
37
|
-
/**
|
|
38
|
-
* This function updates the generic data on an object.
|
|
39
|
-
* @param data the data to update the generic data on
|
|
40
|
-
* @param userId the user Id to update the object with
|
|
41
|
-
*
|
|
42
|
-
* @returns
|
|
43
|
-
*/
|
|
44
|
-
declare const updateGenericDataOnObject: <T>(data: T, userId: string) => any;
|
|
45
|
-
export { addGenericDataToObject, createGenericData, createSearchableIndex, deleteGenericDataOnObject, removeWhitespaceFromObject, updateGenericDataOnObject, };
|
|
46
|
-
//# sourceMappingURL=data-helpers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data-helpers.d.ts","sourceRoot":"","sources":["../../../../../../generic/src/helpers/data/data-helpers.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAE/E;;;;;;;GAOG;AACH,QAAA,MAAM,sBAAsB,GAAI,CAAC,kBAAkB,GAAG,UAAU,MAAM,6BAAsB,CAU3F,CAAC;AAGF;;;;;;GAMG;AACH,QAAA,MAAM,iBAAiB,WAAY,MAAM,6BAAsB,YAU9D,CAAC;AAEF;;;GAGG;AACH,QAAA,MAAM,qBAAqB,2BAA4B,MAAM,KAAG,gBAgB/D,CAAC;AAEF;;;;GAIG;AACH,QAAA,MAAM,yBAAyB,SAAU,GAAG,KAAG,GAQ9C,CAAC;AAEF;;;;;GAKG;AACH,QAAA,MAAM,0BAA0B,QAAS,MAAM,KAAG,MAEjD,CAAC;AAEF;;;;;;GAMG;AACH,QAAA,MAAM,yBAAyB,GAAI,CAAC,QAAQ,CAAC,UAAU,MAAM,KAAG,GAO/D,CAAC;AAEF,OAAO,EACH,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,EACrB,yBAAyB,EACzB,0BAA0B,EAC1B,yBAAyB,GAC5B,CAAC"}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
-
// This contains the interfaces for the data helpers.
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.updateGenericDataOnObject = exports.removeWhitespaceFromObject = exports.deleteGenericDataOnObject = exports.createSearchableIndex = exports.createGenericData = exports.addGenericDataToObject = void 0;
|
|
6
|
-
const errors_1 = require("../../errors");
|
|
7
|
-
/**
|
|
8
|
-
* This adds the generic data to the object.
|
|
9
|
-
*
|
|
10
|
-
* @param incomingObject the object to add the generic data to.
|
|
11
|
-
* @param userId the user ID to add the generic data to.
|
|
12
|
-
* @param versionNumber the version number to add to the generic data.
|
|
13
|
-
* @returns
|
|
14
|
-
*/
|
|
15
|
-
const addGenericDataToObject = (incomingObject, userId, versionNumber = 1) => {
|
|
16
|
-
const timestamp = Date.now();
|
|
17
|
-
return {
|
|
18
|
-
...incomingObject,
|
|
19
|
-
versionNumber,
|
|
20
|
-
createdAt: timestamp,
|
|
21
|
-
createdBy: userId,
|
|
22
|
-
updatedAt: timestamp,
|
|
23
|
-
updatedBy: userId,
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
exports.addGenericDataToObject = addGenericDataToObject;
|
|
27
|
-
/**
|
|
28
|
-
* This creates the generic data record for the database
|
|
29
|
-
*
|
|
30
|
-
* @param userId the user ID to create the generic data for.
|
|
31
|
-
* @param versionNumber the version number to create the generic data for.
|
|
32
|
-
* @returns
|
|
33
|
-
*/
|
|
34
|
-
const createGenericData = (userId, versionNumber = 1) => {
|
|
35
|
-
const timestamp = Date.now();
|
|
36
|
-
return {
|
|
37
|
-
versionNumber,
|
|
38
|
-
createdAt: timestamp,
|
|
39
|
-
createdBy: userId,
|
|
40
|
-
updatedAt: timestamp,
|
|
41
|
-
updatedBy: userId,
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
exports.createGenericData = createGenericData;
|
|
45
|
-
/**
|
|
46
|
-
* This takes an incoming string and creates a searchable index object.
|
|
47
|
-
* @param itemForSearchableIndex the item for a searchable index to be created on
|
|
48
|
-
*/
|
|
49
|
-
const createSearchableIndex = (itemForSearchableIndex) => {
|
|
50
|
-
if (typeof itemForSearchableIndex !== 'string' || itemForSearchableIndex.length === 0) {
|
|
51
|
-
throw new errors_1.UnableToCreateSearchableIndexError(itemForSearchableIndex);
|
|
52
|
-
}
|
|
53
|
-
const searchableIndex = {}; // the searchable index object.
|
|
54
|
-
const characters = itemForSearchableIndex.toLowerCase().split(''); // the words in the item, lowercase it and split it.
|
|
55
|
-
// this takes the characters and creates a searchable index.
|
|
56
|
-
// it includes all previous characters in the word.
|
|
57
|
-
// Handle the first character separately
|
|
58
|
-
characters.reduce((accumulator, current) => {
|
|
59
|
-
const updatedAccumulator = accumulator + current;
|
|
60
|
-
searchableIndex[updatedAccumulator] = true;
|
|
61
|
-
return updatedAccumulator;
|
|
62
|
-
}, '');
|
|
63
|
-
return searchableIndex;
|
|
64
|
-
};
|
|
65
|
-
exports.createSearchableIndex = createSearchableIndex;
|
|
66
|
-
/**
|
|
67
|
-
* This removed all the generic data from an object.
|
|
68
|
-
*
|
|
69
|
-
* @param data
|
|
70
|
-
*/
|
|
71
|
-
const deleteGenericDataOnObject = (data) => {
|
|
72
|
-
if (data) {
|
|
73
|
-
delete data.createdAt; // the timestamp of when the user was created.
|
|
74
|
-
delete data.createdBy; // the user id of the user who created the item.
|
|
75
|
-
delete data.updatedAt; // when the user was last updated.
|
|
76
|
-
delete data.updatedBy; // the user id of the user who updated the item.
|
|
77
|
-
}
|
|
78
|
-
return data;
|
|
79
|
-
};
|
|
80
|
-
exports.deleteGenericDataOnObject = deleteGenericDataOnObject;
|
|
81
|
-
/**
|
|
82
|
-
* This function removes all whitespace from a string
|
|
83
|
-
*
|
|
84
|
-
* @param str the string to remove whitespace from
|
|
85
|
-
* @returns
|
|
86
|
-
*/
|
|
87
|
-
const removeWhitespaceFromObject = (str) => {
|
|
88
|
-
return str.replace(/\s/g, '');
|
|
89
|
-
};
|
|
90
|
-
exports.removeWhitespaceFromObject = removeWhitespaceFromObject;
|
|
91
|
-
/**
|
|
92
|
-
* This function updates the generic data on an object.
|
|
93
|
-
* @param data the data to update the generic data on
|
|
94
|
-
* @param userId the user Id to update the object with
|
|
95
|
-
*
|
|
96
|
-
* @returns
|
|
97
|
-
*/
|
|
98
|
-
const updateGenericDataOnObject = (data, userId) => {
|
|
99
|
-
const now = Date.now();
|
|
100
|
-
return {
|
|
101
|
-
...data,
|
|
102
|
-
updatedAt: now,
|
|
103
|
-
updatedBy: userId,
|
|
104
|
-
};
|
|
105
|
-
};
|
|
106
|
-
exports.updateGenericDataOnObject = updateGenericDataOnObject;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This gets all the files in a directory recursively.
|
|
3
|
-
*
|
|
4
|
-
* @param dirPath the directory path to get the files from.
|
|
5
|
-
* @param arrayOfFiles the array of files to add to.
|
|
6
|
-
* @param ignoreIndexFiles the flag to ignore index files.
|
|
7
|
-
* @param ignoreTestFiles the flag to ignore test files.
|
|
8
|
-
* @returns
|
|
9
|
-
*/
|
|
10
|
-
declare const getAllFiles: (dirPath: string, arrayOfFiles?: string[], ignoreIndexFiles?: boolean, ignoreTestFiles?: boolean) => string[];
|
|
11
|
-
export { getAllFiles };
|
|
12
|
-
//# sourceMappingURL=file-helpers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-helpers.d.ts","sourceRoot":"","sources":["../../../../../../generic/src/helpers/file/file-helpers.ts"],"names":[],"mappings":"AAKA;;;;;;;;GAQG;AACH,QAAA,MAAM,WAAW,YAAa,MAAM,iBAAgB,MAAM,EAAE,4DAAyD,MAAM,EAmB1H,CAAA;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getAllFiles = void 0;
|
|
7
|
-
const fs_1 = __importDefault(require("fs"));
|
|
8
|
-
const path_1 = __importDefault(require("path"));
|
|
9
|
-
// This contains all the functions for helping with files in the degenerate packages.
|
|
10
|
-
/**
|
|
11
|
-
* This gets all the files in a directory recursively.
|
|
12
|
-
*
|
|
13
|
-
* @param dirPath the directory path to get the files from.
|
|
14
|
-
* @param arrayOfFiles the array of files to add to.
|
|
15
|
-
* @param ignoreIndexFiles the flag to ignore index files.
|
|
16
|
-
* @param ignoreTestFiles the flag to ignore test files.
|
|
17
|
-
* @returns
|
|
18
|
-
*/
|
|
19
|
-
const getAllFiles = (dirPath, arrayOfFiles = [], ignoreIndexFiles = true, ignoreTestFiles = true) => {
|
|
20
|
-
const files = fs_1.default.readdirSync(dirPath);
|
|
21
|
-
// loop through all the files in the directory.
|
|
22
|
-
files.forEach((file) => {
|
|
23
|
-
const filePath = path_1.default.join(dirPath, file);
|
|
24
|
-
if (fs_1.default.statSync(filePath).isDirectory()) {
|
|
25
|
-
getAllFiles(filePath, arrayOfFiles);
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
if (ignoreTestFiles && file.endsWith('.test.ts')) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
if (ignoreIndexFiles && file === 'index.ts') {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
arrayOfFiles.push(filePath);
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
return arrayOfFiles;
|
|
38
|
-
};
|
|
39
|
-
exports.getAllFiles = getAllFiles;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"id-helpers.d.ts","sourceRoot":"","sources":["../../../../../generic/src/helpers/id-helpers.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,QAAA,MAAM,QAAQ,uBAAkB,MAS/B,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// This file contains the helper functions for generating ids.
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.createId = void 0;
|
|
5
|
-
/**
|
|
6
|
-
* This creates a random Id.
|
|
7
|
-
* @param length the length of the id to generate.
|
|
8
|
-
* @returns
|
|
9
|
-
*/
|
|
10
|
-
const createId = (length = 18) => {
|
|
11
|
-
let result = '';
|
|
12
|
-
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
|
13
|
-
const charactersLength = characters.length;
|
|
14
|
-
for (let i = 0; i < length; i++) {
|
|
15
|
-
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
|
16
|
-
}
|
|
17
|
-
return result;
|
|
18
|
-
};
|
|
19
|
-
exports.createId = createId;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export * from './id-helpers';
|
|
2
|
-
export * from './object-helpers';
|
|
3
|
-
export * from './object-validation-helpers';
|
|
4
|
-
export * from './request/params-object-helpers';
|
|
5
|
-
export * from './request/query-object-helpers';
|
|
6
|
-
export * from './request/request-object-helpers';
|
|
7
|
-
export * from './array/array-helpers';
|
|
8
|
-
export * from './data/data-helpers';
|
|
9
|
-
export * from './file/file-helpers';
|
|
10
|
-
export * from './lodash/lodash-helpers';
|
|
11
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../generic/src/helpers/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC;AAM5C,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AAKjD,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
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
|
-
//#region main exports
|
|
18
|
-
__exportStar(require("./id-helpers"), exports);
|
|
19
|
-
__exportStar(require("./object-helpers"), exports);
|
|
20
|
-
__exportStar(require("./object-validation-helpers"), exports);
|
|
21
|
-
// #endregion main exports
|
|
22
|
-
// #region request exports
|
|
23
|
-
__exportStar(require("./request/params-object-helpers"), exports);
|
|
24
|
-
__exportStar(require("./request/query-object-helpers"), exports);
|
|
25
|
-
__exportStar(require("./request/request-object-helpers"), exports);
|
|
26
|
-
//#endregion request exports
|
|
27
|
-
// additional
|
|
28
|
-
__exportStar(require("./array/array-helpers"), exports);
|
|
29
|
-
__exportStar(require("./data/data-helpers"), exports);
|
|
30
|
-
__exportStar(require("./file/file-helpers"), exports);
|
|
31
|
-
__exportStar(require("./lodash/lodash-helpers"), exports);
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/***************************************************
|
|
2
|
-
* This contains a list of the lodash equivalent functions without the lodash bloat and vulnerabilites.
|
|
3
|
-
****************************************************/
|
|
4
|
-
/**
|
|
5
|
-
* This function is used to break an array into smaller arrays.
|
|
6
|
-
*
|
|
7
|
-
* @param arr the array to be broken into smaller arrays.
|
|
8
|
-
* @param amount the amount of items to be in each array.
|
|
9
|
-
* @param startAt start at a specific index of this array
|
|
10
|
-
* @returns
|
|
11
|
-
*/
|
|
12
|
-
declare const chunk: <T>(arr: Array<T>, amount?: number, startAt?: number) => T[][];
|
|
13
|
-
export { chunk };
|
|
14
|
-
//# sourceMappingURL=lodash-helpers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lodash-helpers.d.ts","sourceRoot":"","sources":["../../../../../../generic/src/helpers/lodash/lodash-helpers.ts"],"names":[],"mappings":"AACA;;sDAEsD;AAEtD;;;;;;;GAOG;AACH,QAAA,MAAM,KAAK,GAAI,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,wCAA8B,CAAC,EAAE,EAW/D,CAAC;AAEF,OAAO,EAAE,KAAK,EAAE,CAAC"}
|