@sdflc/backend-helpers 1.0.77 → 1.0.78
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/README.md +178 -178
- package/build/BaseCore.d.ts +88 -88
- package/build/BaseCore.js +819 -819
- package/build/BaseGateway.d.ts +49 -49
- package/build/BaseGateway.js +484 -484
- package/build/DataCache.d.ts +14 -14
- package/build/DataCache.js +104 -104
- package/build/Database.d.ts +32 -32
- package/build/Database.js +198 -198
- package/build/DbMigratorAndSeeder.d.ts +49 -49
- package/build/DbMigratorAndSeeder.js +238 -228
- package/build/RedisDataLoader.d.ts +41 -41
- package/build/RedisDataLoader.js +248 -248
- package/build/apiContext.d.ts +11 -11
- package/build/apiContext.js +143 -143
- package/build/{BaseController.d.ts → baseController.d.ts} +17 -17
- package/build/{BaseController.js → baseController.js} +66 -66
- package/build/checkItHelpers.d.ts +3 -3
- package/build/checkItHelpers.js +28 -28
- package/build/commonValidators.d.ts +17 -17
- package/build/commonValidators.js +298 -298
- package/build/configBulder.d.ts +2 -2
- package/build/configBulder.js +32 -32
- package/build/constants.d.ts +30 -30
- package/build/constants.js +80 -81
- package/build/dbHelpers.d.ts +43 -43
- package/build/dbHelpers.js +166 -166
- package/build/dbSeeder.d.ts +2 -2
- package/build/dbSeeder.js +92 -82
- package/build/dbTableHelpers.d.ts +11 -11
- package/build/dbTableHelpers.js +110 -110
- package/build/downloadHelpers.d.ts +2 -2
- package/build/downloadHelpers.js +83 -83
- package/build/index.d.ts +21 -21
- package/build/index.js +37 -37
- package/build/interfaces/ApiContext.d.ts +24 -24
- package/build/interfaces/ApiContext.js +2 -2
- package/build/interfaces/ApiContextInterface.d.ts +12 -12
- package/build/interfaces/ApiContextInterface.js +2 -2
- package/build/interfaces/BaseCoreActionsInterface.d.ts +38 -38
- package/build/interfaces/BaseCoreActionsInterface.js +2 -2
- package/build/interfaces/BaseCoreDoAuthOnActionInterface.d.ts +12 -12
- package/build/interfaces/BaseCoreDoAuthOnActionInterface.js +2 -2
- package/build/interfaces/BaseCoreDoingWhatInterface.d.ts +13 -13
- package/build/interfaces/BaseCoreDoingWhatInterface.js +2 -2
- package/build/interfaces/BaseCorePropsInterface.d.ts +36 -36
- package/build/interfaces/BaseCorePropsInterface.js +2 -2
- package/build/interfaces/BaseCoreValidatorsInterface.d.ts +13 -13
- package/build/interfaces/BaseCoreValidatorsInterface.js +2 -2
- package/build/interfaces/BaseGatewayPropsInterface.d.ts +39 -39
- package/build/interfaces/BaseGatewayPropsInterface.js +2 -2
- package/build/interfaces/BuildConfigOptions.d.ts +6 -6
- package/build/interfaces/BuildConfigOptions.js +2 -2
- package/build/interfaces/BuildDefaultResolversOptions.d.ts +17 -17
- package/build/interfaces/BuildDefaultResolversOptions.js +2 -2
- package/build/interfaces/BuildListQueryArgsInterface.d.ts +6 -6
- package/build/interfaces/BuildListQueryArgsInterface.js +2 -2
- package/build/interfaces/CacheInterface.d.ts +15 -15
- package/build/interfaces/CacheInterface.js +2 -2
- package/build/interfaces/CommonValidatorArgs.d.ts +3 -3
- package/build/interfaces/CommonValidatorArgs.js +2 -2
- package/build/interfaces/CoreActionInterface.d.ts +14 -14
- package/build/interfaces/CoreActionInterface.js +2 -2
- package/build/interfaces/CreateUserTokenArgs.d.ts +11 -11
- package/build/interfaces/CreateUserTokenArgs.js +2 -2
- package/build/interfaces/CreateUserTokenResult.d.ts +4 -4
- package/build/interfaces/CreateUserTokenResult.js +2 -2
- package/build/interfaces/DatabaseOptions.d.ts +22 -22
- package/build/interfaces/DatabaseOptions.js +2 -2
- package/build/interfaces/DatabaseReadInterface.d.ts +14 -14
- package/build/interfaces/DatabaseReadInterface.js +2 -2
- package/build/interfaces/DbFieldAddDefaultInterface.d.ts +9 -9
- package/build/interfaces/DbFieldAddDefaultInterface.js +2 -2
- package/build/interfaces/DownloadFileArgs.d.ts +6 -6
- package/build/interfaces/DownloadFileArgs.js +2 -2
- package/build/interfaces/ExtractCredentialsArgs.d.ts +19 -19
- package/build/interfaces/ExtractCredentialsArgs.js +2 -2
- package/build/interfaces/JwtTokenSecretAndSettings.d.ts +5 -5
- package/build/interfaces/JwtTokenSecretAndSettings.js +2 -2
- package/build/interfaces/ListArgsInterface.d.ts +5 -5
- package/build/interfaces/ListArgsInterface.js +2 -2
- package/build/interfaces/LoaderInterface.d.ts +4 -4
- package/build/interfaces/LoaderInterface.js +2 -2
- package/build/interfaces/PaginationInterface.d.ts +7 -7
- package/build/interfaces/PaginationInterface.js +2 -2
- package/build/interfaces/SortItemInterface.d.ts +4 -4
- package/build/interfaces/SortItemInterface.js +2 -2
- package/build/interfaces/UserTokenParams.d.ts +8 -8
- package/build/interfaces/UserTokenParams.js +2 -2
- package/build/interfaces/VerifyUserTokenArgs.d.ts +13 -13
- package/build/interfaces/VerifyUserTokenArgs.js +2 -2
- package/build/interfaces/index.d.ts +28 -28
- package/build/interfaces/index.js +43 -43
- package/build/knexConfigBuilder.d.ts +1 -1
- package/build/knexConfigBuilder.js +80 -80
- package/build/passwordHelpers.d.ts +5 -5
- package/build/passwordHelpers.js +30 -30
- package/build/redisClient.d.ts +17 -17
- package/build/redisClient.js +97 -97
- package/build/resolversHelpers.d.ts +3 -3
- package/build/resolversHelpers.js +62 -62
- package/build/userToken.d.ts +8 -8
- package/build/userToken.js +86 -86
- package/build/utils.d.ts +2 -2
- package/build/utils.js +21 -21
- package/package.json +71 -71
package/build/userToken.js
CHANGED
|
@@ -1,86 +1,86 @@
|
|
|
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.verifyUserToken = exports.createUserToken = exports.getDefaultJwtIssuer = exports.setDefaultJwtIssuer = exports.getDefaultJwtAlgorithm = exports.setDefaultJwtAlgorithm = void 0;
|
|
7
|
-
const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
|
|
8
|
-
const uuid_1 = require("uuid");
|
|
9
|
-
const api_helpers_1 = require("@sdflc/api-helpers");
|
|
10
|
-
const constants_1 = require("./constants");
|
|
11
|
-
const dayjs_1 = __importDefault(require("dayjs"));
|
|
12
|
-
let defaultJwtAlgorithm = constants_1.DEFAULT_JWT_ALGORITHM;
|
|
13
|
-
let defaultIssuer = constants_1.DEFAULT_JWT_ISSUER;
|
|
14
|
-
const setDefaultJwtAlgorithm = (algorithm) => {
|
|
15
|
-
defaultJwtAlgorithm = algorithm;
|
|
16
|
-
};
|
|
17
|
-
exports.setDefaultJwtAlgorithm = setDefaultJwtAlgorithm;
|
|
18
|
-
const getDefaultJwtAlgorithm = () => {
|
|
19
|
-
return defaultJwtAlgorithm;
|
|
20
|
-
};
|
|
21
|
-
exports.getDefaultJwtAlgorithm = getDefaultJwtAlgorithm;
|
|
22
|
-
const setDefaultJwtIssuer = (issuer) => {
|
|
23
|
-
defaultIssuer = issuer;
|
|
24
|
-
};
|
|
25
|
-
exports.setDefaultJwtIssuer = setDefaultJwtIssuer;
|
|
26
|
-
const getDefaultJwtIssuer = () => {
|
|
27
|
-
return defaultIssuer;
|
|
28
|
-
};
|
|
29
|
-
exports.getDefaultJwtIssuer = getDefaultJwtIssuer;
|
|
30
|
-
const createUserToken = (params, secret, opt) => {
|
|
31
|
-
const { algorithm, audience, issuer, jwtid, noTimestamp, header, keyid, expiresIn, useFingerprint } = opt || {};
|
|
32
|
-
if (!params || !secret) {
|
|
33
|
-
return api_helpers_1.OpResult.fail(api_helpers_1.OP_RESULT_CODES.VALIDATION_FAILED, null, 'Failed to create user JWT');
|
|
34
|
-
}
|
|
35
|
-
if (useFingerprint) {
|
|
36
|
-
const fingerprint = (0, uuid_1.v4)();
|
|
37
|
-
params['fingerprint'] = fingerprint;
|
|
38
|
-
}
|
|
39
|
-
const token = jsonwebtoken_1.default.sign(params, secret, {
|
|
40
|
-
algorithm: algorithm || defaultJwtAlgorithm,
|
|
41
|
-
audience,
|
|
42
|
-
issuer: issuer || defaultIssuer,
|
|
43
|
-
jwtid: jwtid || (0, uuid_1.v4)(),
|
|
44
|
-
subject: params.userId,
|
|
45
|
-
noTimestamp: noTimestamp !== null && noTimestamp !== void 0 ? noTimestamp : false,
|
|
46
|
-
header,
|
|
47
|
-
keyid,
|
|
48
|
-
expiresIn: expiresIn && !isNaN(expiresIn) ? expiresIn : undefined,
|
|
49
|
-
});
|
|
50
|
-
return api_helpers_1.OpResult.ok({ token, fingerprint: params.fingerprint });
|
|
51
|
-
};
|
|
52
|
-
exports.createUserToken = createUserToken;
|
|
53
|
-
const verifyUserToken = (token, secret, args) => {
|
|
54
|
-
const { algorithms, audience, issuer, ignoreExpiration, ignoreNotBefore, subject, clockTolerance, maxAge, clockTimestamp, nonce, fingerprint, } = args || {};
|
|
55
|
-
if (!args) {
|
|
56
|
-
return api_helpers_1.OpResult.fail(api_helpers_1.OP_RESULT_CODES.VALIDATION_FAILED, null, 'Cannot verify user token as there are no parameters specified');
|
|
57
|
-
}
|
|
58
|
-
try {
|
|
59
|
-
const obj = jsonwebtoken_1.default.verify(token, secret, {
|
|
60
|
-
algorithms: algorithms || [defaultJwtAlgorithm],
|
|
61
|
-
audience,
|
|
62
|
-
issuer: issuer || defaultIssuer,
|
|
63
|
-
ignoreExpiration,
|
|
64
|
-
ignoreNotBefore,
|
|
65
|
-
subject,
|
|
66
|
-
clockTolerance,
|
|
67
|
-
maxAge,
|
|
68
|
-
clockTimestamp,
|
|
69
|
-
nonce,
|
|
70
|
-
});
|
|
71
|
-
if ((obj === null || obj === void 0 ? void 0 : obj.fingerprint) && obj.fingerprint != fingerprint) {
|
|
72
|
-
return api_helpers_1.OpResult.fail(api_helpers_1.OP_RESULT_CODES.UNAUTHORIZED, null, 'User unauthenticated');
|
|
73
|
-
}
|
|
74
|
-
return api_helpers_1.OpResult.ok(obj);
|
|
75
|
-
}
|
|
76
|
-
catch (ex) {
|
|
77
|
-
if (ex.name === 'TokenExpiredError') {
|
|
78
|
-
return api_helpers_1.OpResult.fail(api_helpers_1.OP_RESULT_CODES.EXPIRED, null, `User authorization has expired at ${(0, dayjs_1.default)(ex.expiredAt).toDate()}`);
|
|
79
|
-
}
|
|
80
|
-
else if (ex.name === 'JsonWebTokenError') {
|
|
81
|
-
return api_helpers_1.OpResult.fail(api_helpers_1.OP_RESULT_CODES.EXPIRED, null, `JWT is invalid, reason: ${ex.message}`);
|
|
82
|
-
}
|
|
83
|
-
return api_helpers_1.OpResult.fail(api_helpers_1.OP_RESULT_CODES.UNAUTHORIZED, null, 'User unauthenticated');
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
exports.verifyUserToken = verifyUserToken;
|
|
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.verifyUserToken = exports.createUserToken = exports.getDefaultJwtIssuer = exports.setDefaultJwtIssuer = exports.getDefaultJwtAlgorithm = exports.setDefaultJwtAlgorithm = void 0;
|
|
7
|
+
const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
|
|
8
|
+
const uuid_1 = require("uuid");
|
|
9
|
+
const api_helpers_1 = require("@sdflc/api-helpers");
|
|
10
|
+
const constants_1 = require("./constants");
|
|
11
|
+
const dayjs_1 = __importDefault(require("dayjs"));
|
|
12
|
+
let defaultJwtAlgorithm = constants_1.DEFAULT_JWT_ALGORITHM;
|
|
13
|
+
let defaultIssuer = constants_1.DEFAULT_JWT_ISSUER;
|
|
14
|
+
const setDefaultJwtAlgorithm = (algorithm) => {
|
|
15
|
+
defaultJwtAlgorithm = algorithm;
|
|
16
|
+
};
|
|
17
|
+
exports.setDefaultJwtAlgorithm = setDefaultJwtAlgorithm;
|
|
18
|
+
const getDefaultJwtAlgorithm = () => {
|
|
19
|
+
return defaultJwtAlgorithm;
|
|
20
|
+
};
|
|
21
|
+
exports.getDefaultJwtAlgorithm = getDefaultJwtAlgorithm;
|
|
22
|
+
const setDefaultJwtIssuer = (issuer) => {
|
|
23
|
+
defaultIssuer = issuer;
|
|
24
|
+
};
|
|
25
|
+
exports.setDefaultJwtIssuer = setDefaultJwtIssuer;
|
|
26
|
+
const getDefaultJwtIssuer = () => {
|
|
27
|
+
return defaultIssuer;
|
|
28
|
+
};
|
|
29
|
+
exports.getDefaultJwtIssuer = getDefaultJwtIssuer;
|
|
30
|
+
const createUserToken = (params, secret, opt) => {
|
|
31
|
+
const { algorithm, audience, issuer, jwtid, noTimestamp, header, keyid, expiresIn, useFingerprint } = opt || {};
|
|
32
|
+
if (!params || !secret) {
|
|
33
|
+
return api_helpers_1.OpResult.fail(api_helpers_1.OP_RESULT_CODES.VALIDATION_FAILED, null, 'Failed to create user JWT');
|
|
34
|
+
}
|
|
35
|
+
if (useFingerprint) {
|
|
36
|
+
const fingerprint = (0, uuid_1.v4)();
|
|
37
|
+
params['fingerprint'] = fingerprint;
|
|
38
|
+
}
|
|
39
|
+
const token = jsonwebtoken_1.default.sign(params, secret, {
|
|
40
|
+
algorithm: algorithm || defaultJwtAlgorithm,
|
|
41
|
+
audience,
|
|
42
|
+
issuer: issuer || defaultIssuer,
|
|
43
|
+
jwtid: jwtid || (0, uuid_1.v4)(),
|
|
44
|
+
subject: params.userId,
|
|
45
|
+
noTimestamp: noTimestamp !== null && noTimestamp !== void 0 ? noTimestamp : false,
|
|
46
|
+
header,
|
|
47
|
+
keyid,
|
|
48
|
+
expiresIn: expiresIn && !isNaN(expiresIn) ? expiresIn : undefined,
|
|
49
|
+
});
|
|
50
|
+
return api_helpers_1.OpResult.ok({ token, fingerprint: params.fingerprint });
|
|
51
|
+
};
|
|
52
|
+
exports.createUserToken = createUserToken;
|
|
53
|
+
const verifyUserToken = (token, secret, args) => {
|
|
54
|
+
const { algorithms, audience, issuer, ignoreExpiration, ignoreNotBefore, subject, clockTolerance, maxAge, clockTimestamp, nonce, fingerprint, } = args || {};
|
|
55
|
+
if (!args) {
|
|
56
|
+
return api_helpers_1.OpResult.fail(api_helpers_1.OP_RESULT_CODES.VALIDATION_FAILED, null, 'Cannot verify user token as there are no parameters specified');
|
|
57
|
+
}
|
|
58
|
+
try {
|
|
59
|
+
const obj = jsonwebtoken_1.default.verify(token, secret, {
|
|
60
|
+
algorithms: algorithms || [defaultJwtAlgorithm],
|
|
61
|
+
audience,
|
|
62
|
+
issuer: issuer || defaultIssuer,
|
|
63
|
+
ignoreExpiration,
|
|
64
|
+
ignoreNotBefore,
|
|
65
|
+
subject,
|
|
66
|
+
clockTolerance,
|
|
67
|
+
maxAge,
|
|
68
|
+
clockTimestamp,
|
|
69
|
+
nonce,
|
|
70
|
+
});
|
|
71
|
+
if ((obj === null || obj === void 0 ? void 0 : obj.fingerprint) && obj.fingerprint != fingerprint) {
|
|
72
|
+
return api_helpers_1.OpResult.fail(api_helpers_1.OP_RESULT_CODES.UNAUTHORIZED, null, 'User unauthenticated');
|
|
73
|
+
}
|
|
74
|
+
return api_helpers_1.OpResult.ok(obj);
|
|
75
|
+
}
|
|
76
|
+
catch (ex) {
|
|
77
|
+
if (ex.name === 'TokenExpiredError') {
|
|
78
|
+
return api_helpers_1.OpResult.fail(api_helpers_1.OP_RESULT_CODES.EXPIRED, null, `User authorization has expired at ${(0, dayjs_1.default)(ex.expiredAt).toDate()}`);
|
|
79
|
+
}
|
|
80
|
+
else if (ex.name === 'JsonWebTokenError') {
|
|
81
|
+
return api_helpers_1.OpResult.fail(api_helpers_1.OP_RESULT_CODES.EXPIRED, null, `JWT is invalid, reason: ${ex.message}`);
|
|
82
|
+
}
|
|
83
|
+
return api_helpers_1.OpResult.fail(api_helpers_1.OP_RESULT_CODES.UNAUTHORIZED, null, 'User unauthenticated');
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
exports.verifyUserToken = verifyUserToken;
|
package/build/utils.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const setFunction: (func: any, defaultFunc: () => any) => any;
|
|
2
|
-
export declare const setFunctions: (obj: any, defaultFuncs?: any) => any;
|
|
1
|
+
export declare const setFunction: (func: any, defaultFunc: () => any) => any;
|
|
2
|
+
export declare const setFunctions: (obj: any, defaultFuncs?: any) => any;
|
package/build/utils.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
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.setFunctions = exports.setFunction = void 0;
|
|
7
|
-
const check_types_1 = __importDefault(require("check-types"));
|
|
8
|
-
const setFunction = (func, defaultFunc) => {
|
|
9
|
-
return check_types_1.default.function(func) ? func : defaultFunc;
|
|
10
|
-
};
|
|
11
|
-
exports.setFunction = setFunction;
|
|
12
|
-
const setFunctions = (obj, defaultFuncs = {}) => {
|
|
13
|
-
const keys = Object.keys(defaultFuncs || {});
|
|
14
|
-
return keys.reduce((acc, key) => {
|
|
15
|
-
if (check_types_1.default.function(obj[key])) {
|
|
16
|
-
acc[key] = obj[key];
|
|
17
|
-
}
|
|
18
|
-
return acc;
|
|
19
|
-
}, {});
|
|
20
|
-
};
|
|
21
|
-
exports.setFunctions = setFunctions;
|
|
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.setFunctions = exports.setFunction = void 0;
|
|
7
|
+
const check_types_1 = __importDefault(require("check-types"));
|
|
8
|
+
const setFunction = (func, defaultFunc) => {
|
|
9
|
+
return check_types_1.default.function(func) ? func : defaultFunc;
|
|
10
|
+
};
|
|
11
|
+
exports.setFunction = setFunction;
|
|
12
|
+
const setFunctions = (obj, defaultFuncs = {}) => {
|
|
13
|
+
const keys = Object.keys(defaultFuncs || {});
|
|
14
|
+
return keys.reduce((acc, key) => {
|
|
15
|
+
if (check_types_1.default.function(obj[key])) {
|
|
16
|
+
acc[key] = obj[key];
|
|
17
|
+
}
|
|
18
|
+
return acc;
|
|
19
|
+
}, {});
|
|
20
|
+
};
|
|
21
|
+
exports.setFunctions = setFunctions;
|
package/package.json
CHANGED
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@sdflc/backend-helpers",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
"@
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
"@
|
|
54
|
-
"@
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
}
|
|
71
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@sdflc/backend-helpers",
|
|
3
|
+
"version": "1.0.78",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Set of helper functions and classes to simplify building backend apps within @sdflc ecosystem",
|
|
6
|
+
"main": "build/index.js",
|
|
7
|
+
"types": "build/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"build/**/*"
|
|
10
|
+
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "rimraf ./build && tsc",
|
|
13
|
+
"lint": "eslint .",
|
|
14
|
+
"test": "echo No Tests Available Yet",
|
|
15
|
+
"testToDo": "jest --config jest.config.ts",
|
|
16
|
+
"format": "prettier --write \"src/**/*.ts\"",
|
|
17
|
+
"prepare": "husky",
|
|
18
|
+
"prepare1": "husky install",
|
|
19
|
+
"prepublishOnly": "npm test && npm run lint",
|
|
20
|
+
"preversion": "npm run lint",
|
|
21
|
+
"version": "npm run format && git add -A src",
|
|
22
|
+
"postversion": "git push && git push --tags"
|
|
23
|
+
},
|
|
24
|
+
"author": "Sergey Demidenko",
|
|
25
|
+
"license": "ISC",
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/bcrypt": "^5.0.2",
|
|
28
|
+
"@types/bluebird": "^3.5.42",
|
|
29
|
+
"@types/check-types": "^11.2.2",
|
|
30
|
+
"@types/dotenv-safe": "^8.1.6",
|
|
31
|
+
"@types/is-uuid": "^1.0.2",
|
|
32
|
+
"@types/jest": "^29.5.14",
|
|
33
|
+
"@types/jsonwebtoken": "^9.0.8",
|
|
34
|
+
"@types/lodash": "^4.17.15",
|
|
35
|
+
"@types/node": "^22.13.4",
|
|
36
|
+
"@types/uuid": "^10.0.0",
|
|
37
|
+
"@typescript-eslint/eslint-plugin": "^8.24.1",
|
|
38
|
+
"@typescript-eslint/parser": "^8.24.1",
|
|
39
|
+
"eslint": "^9.20.1",
|
|
40
|
+
"eslint-config-prettier": "^10.0.1",
|
|
41
|
+
"eslint-plugin-jest": "^28.11.0",
|
|
42
|
+
"eslint-plugin-prettier": "^5.2.3",
|
|
43
|
+
"husky": "^9.1.7",
|
|
44
|
+
"jest": "^29.7.0",
|
|
45
|
+
"prettier": "^3.5.1",
|
|
46
|
+
"rimraf": "^6.0.1",
|
|
47
|
+
"run-script-os": "^1.1.6",
|
|
48
|
+
"ts-jest": "^29.2.5",
|
|
49
|
+
"ts-node": "^10.9.2",
|
|
50
|
+
"typescript": "^5.7.3"
|
|
51
|
+
},
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"@sdflc/api-helpers": "^1.1.12",
|
|
54
|
+
"@sdflc/utils": "^1.0.23",
|
|
55
|
+
"bcrypt": "^5.1.1",
|
|
56
|
+
"bluebird": "^3.7.2",
|
|
57
|
+
"check-types": "^11.2.3",
|
|
58
|
+
"checkit": "^0.7.0",
|
|
59
|
+
"dataloader": "^2.2.3",
|
|
60
|
+
"dayjs": "^1.11.13",
|
|
61
|
+
"dotenv-safe": "^9.1.0",
|
|
62
|
+
"is-uuid": "^1.0.2",
|
|
63
|
+
"json-stable-stringify": "^1.2.1",
|
|
64
|
+
"jsonwebtoken": "^9.0.2",
|
|
65
|
+
"knex": "^3.1.0",
|
|
66
|
+
"lodash": "^4.17.21",
|
|
67
|
+
"pg": "^8.13.3",
|
|
68
|
+
"redis": "^4.7.0",
|
|
69
|
+
"uuid": "^11.1.0"
|
|
70
|
+
}
|
|
71
|
+
}
|