sea-backend-helpers 1.5.7 → 1.5.9
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/constants/cache/index.d.ts +6 -1
- package/dist/constants/cache/index.d.ts.map +1 -1
- package/dist/constants/cache/index.js +22 -1
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +2 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/modules/remote/remote.service.d.ts +2 -1
- package/dist/modules/remote/remote.service.d.ts.map +1 -1
- package/dist/types/jwt/index.d.ts +5 -0
- package/dist/types/jwt/index.d.ts.map +1 -0
- package/dist/types/jwt/index.js +2 -0
- package/dist/utils/cache/index.d.ts +7 -3
- package/dist/utils/cache/index.d.ts.map +1 -1
- package/dist/utils/cache/index.js +13 -3
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +2 -1
- package/dist/utils/jwt/index.d.ts +1 -0
- package/dist/utils/jwt/index.d.ts.map +1 -1
- package/dist/utils/jwt/index.js +4 -2
- package/package.json +9 -5
|
@@ -5,6 +5,11 @@ export declare enum CacheableModules {
|
|
|
5
5
|
EmailTemplateVersion = "EmailTemplateVersion",
|
|
6
6
|
File = "File",
|
|
7
7
|
Task = "Task",
|
|
8
|
-
Project = "Project"
|
|
8
|
+
Project = "Project",
|
|
9
|
+
ProjectMilestone = "ProjectMilestone",
|
|
10
|
+
ProjectSection = "ProjectSection",
|
|
11
|
+
Initiative = "Initiative",
|
|
12
|
+
KPI = "KPI"
|
|
9
13
|
}
|
|
14
|
+
export declare const getCacheModuleName: (module: CacheableModules) => string;
|
|
10
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/constants/cache/index.ts"],"names":[],"mappings":"AAAA,oBAAY,gBAAgB;IAC1B,OAAO,YAAY;IACnB,YAAY,iBAAiB;IAC7B,aAAa,kBAAkB;IAC/B,oBAAoB,yBAAyB;IAC7C,IAAI,SAAS;IACb,IAAI,SAAS;IACb,OAAO,YAAY;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/constants/cache/index.ts"],"names":[],"mappings":"AAAA,oBAAY,gBAAgB;IAC1B,OAAO,YAAY;IACnB,YAAY,iBAAiB;IAC7B,aAAa,kBAAkB;IAC/B,oBAAoB,yBAAyB;IAC7C,IAAI,SAAS;IACb,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,gBAAgB,qBAAqB;IACrC,cAAc,mBAAmB;IACjC,UAAU,eAAe;IACzB,GAAG,QAAQ;CACZ;AAeD,eAAO,MAAM,kBAAkB,WAAY,gBAAgB,KAAG,MAE7D,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CacheableModules = void 0;
|
|
3
|
+
exports.getCacheModuleName = exports.CacheableModules = void 0;
|
|
4
4
|
var CacheableModules;
|
|
5
5
|
(function (CacheableModules) {
|
|
6
6
|
CacheableModules["Account"] = "Account";
|
|
@@ -10,4 +10,25 @@ var CacheableModules;
|
|
|
10
10
|
CacheableModules["File"] = "File";
|
|
11
11
|
CacheableModules["Task"] = "Task";
|
|
12
12
|
CacheableModules["Project"] = "Project";
|
|
13
|
+
CacheableModules["ProjectMilestone"] = "ProjectMilestone";
|
|
14
|
+
CacheableModules["ProjectSection"] = "ProjectSection";
|
|
15
|
+
CacheableModules["Initiative"] = "Initiative";
|
|
16
|
+
CacheableModules["KPI"] = "KPI";
|
|
13
17
|
})(CacheableModules || (exports.CacheableModules = CacheableModules = {}));
|
|
18
|
+
const CacheableModuleNames = {
|
|
19
|
+
[CacheableModules.Account]: "Remote-Account",
|
|
20
|
+
[CacheableModules.Organization]: "Remote-Organization",
|
|
21
|
+
[CacheableModules.EmailTemplate]: "Remote-EmailTemplate",
|
|
22
|
+
[CacheableModules.EmailTemplateVersion]: "Remote-EmailTemplateVersion",
|
|
23
|
+
[CacheableModules.File]: "Remote-File",
|
|
24
|
+
[CacheableModules.Task]: "Remote-Task",
|
|
25
|
+
[CacheableModules.Project]: "Remote-Project",
|
|
26
|
+
[CacheableModules.ProjectMilestone]: "Remote-ProjectMilestone",
|
|
27
|
+
[CacheableModules.ProjectSection]: "Remote-ProjectSection",
|
|
28
|
+
[CacheableModules.Initiative]: "Remote-Initiative",
|
|
29
|
+
[CacheableModules.KPI]: "Remote-KPI",
|
|
30
|
+
};
|
|
31
|
+
const getCacheModuleName = (module) => {
|
|
32
|
+
return CacheableModuleNames[module] || "Unknown";
|
|
33
|
+
};
|
|
34
|
+
exports.getCacheModuleName = getCacheModuleName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC"}
|
package/dist/constants/index.js
CHANGED
|
@@ -33,5 +33,6 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.Queue = void 0;
|
|
36
|
+
exports.Cache = exports.Queue = void 0;
|
|
37
37
|
exports.Queue = __importStar(require("./queue"));
|
|
38
|
+
exports.Cache = __importStar(require("./cache"));
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AAGjC,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAG3C,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAG3C,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AAGzC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AAGjC,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AAGjC,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAG3C,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAG3C,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AAGzC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AAGjC,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AAGvC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.Services = exports.Types = exports.Constants = exports.Validators = exports.Decorators = exports.Utils = void 0;
|
|
36
|
+
exports.Modules = exports.Services = exports.Types = exports.Constants = exports.Validators = exports.Decorators = exports.Utils = void 0;
|
|
37
37
|
// Utils
|
|
38
38
|
exports.Utils = __importStar(require("./utils"));
|
|
39
39
|
// Decorators
|
|
@@ -46,3 +46,5 @@ exports.Constants = __importStar(require("./constants"));
|
|
|
46
46
|
exports.Types = __importStar(require("./types"));
|
|
47
47
|
// Services
|
|
48
48
|
exports.Services = __importStar(require("./services"));
|
|
49
|
+
// Modules
|
|
50
|
+
exports.Modules = __importStar(require("./modules"));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { HttpService } from "@nestjs/axios";
|
|
2
|
+
import { CacheableModules } from "../../constants/cache";
|
|
2
3
|
export interface RemoteServiceOptions {
|
|
3
4
|
baseURL: string;
|
|
4
5
|
auth?: {
|
|
@@ -6,7 +7,7 @@ export interface RemoteServiceOptions {
|
|
|
6
7
|
password: string;
|
|
7
8
|
};
|
|
8
9
|
path: string;
|
|
9
|
-
model:
|
|
10
|
+
model: CacheableModules;
|
|
10
11
|
cache?: {
|
|
11
12
|
get: (key: string) => Promise<any> | any;
|
|
12
13
|
set: (key: string, value: any, ttl?: number) => Promise<void> | void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote.service.d.ts","sourceRoot":"","sources":["../../../src/modules/remote/remote.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"remote.service.d.ts","sourceRoot":"","sources":["../../../src/modules/remote/remote.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,gBAAgB,CAAC;IAExB,KAAK,CAAC,EAAE;QACN,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;QACzC,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;KACtE,CAAC;CACH;AAED,qBAAa,aAAa;IAEtB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,OAAO;gBADP,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,oBAAoB;IAGzC,cAAc;IAId,MAAM,CAAC,EAAE,CAAC,EAAE,MAAM;YAIX,YAAY;YASZ,UAAU;IASlB,SAAS,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAkB3C,aAAa,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAQ/C,UAAU,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE;IAK3B,QAAQ,CAAC,CAAC,EAAE,KAAK,SAAK,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC;CAU5C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/jwt/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { CacheableModules } from "../../constants/cache";
|
|
2
2
|
import { Cache } from "@nestjs/cache-manager";
|
|
3
|
-
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
3
|
+
type Token = "Token";
|
|
4
|
+
export declare const generateCacheKey: (id: string, type: CacheableModules | Token) => string;
|
|
5
|
+
export declare const set: <T>(id: string, type: CacheableModules | Token, value: T, cache: Cache, ttl?: number) => Promise<void>;
|
|
6
|
+
export declare const get: <T>(id: string, type: CacheableModules | Token, cache: Cache) => Promise<T | undefined>;
|
|
7
|
+
export declare const updateIfExist: <T>(id: string, type: CacheableModules | Token, value: T, cache: Cache, ttl?: number) => Promise<void>;
|
|
8
|
+
export declare const deleteIfExist: (id: string, type: CacheableModules | Token, cache: Cache) => void;
|
|
9
|
+
export {};
|
|
6
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/cache/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/cache/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,KAAK,KAAK,GAAG,OAAO,CAAC;AACrB,eAAO,MAAM,gBAAgB,OACvB,MAAM,QACJ,gBAAgB,GAAG,KAAK,WAG/B,CAAC;AAEF,eAAO,MAAM,GAAG,GAAU,CAAC,MACrB,MAAM,QACJ,gBAAgB,GAAG,KAAK,SACvB,CAAC,SACD,KAAK,gCAMb,CAAC;AAEF,eAAO,MAAM,GAAG,GAAU,CAAC,MACrB,MAAM,QACJ,gBAAgB,GAAG,KAAK,SACvB,KAAK,2BAKb,CAAC;AAEF,eAAO,MAAM,aAAa,GAAU,CAAC,MAC/B,MAAM,QACJ,gBAAgB,GAAG,KAAK,SACvB,CAAC,SACD,KAAK,gCAOb,CAAC;AAEF,eAAO,MAAM,aAAa,OACpB,MAAM,QACJ,gBAAgB,GAAG,KAAK,SACvB,KAAK,SAKb,CAAC"}
|
|
@@ -9,16 +9,26 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.deleteIfExist = exports.updateIfExist = exports.generateCacheKey = void 0;
|
|
12
|
+
exports.deleteIfExist = exports.updateIfExist = exports.get = exports.set = exports.generateCacheKey = void 0;
|
|
13
13
|
const generateCacheKey = (id, type) => {
|
|
14
14
|
return `${type}:${id}`;
|
|
15
15
|
};
|
|
16
16
|
exports.generateCacheKey = generateCacheKey;
|
|
17
|
-
const
|
|
17
|
+
const set = (id_1, type_1, value_1, cache_1, ...args_1) => __awaiter(void 0, [id_1, type_1, value_1, cache_1, ...args_1], void 0, function* (id, type, value, cache, ttl = 1000 * 3600) {
|
|
18
|
+
const key = (0, exports.generateCacheKey)(id, type);
|
|
19
|
+
cache.set(key, value, ttl);
|
|
20
|
+
});
|
|
21
|
+
exports.set = set;
|
|
22
|
+
const get = (id, type, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
23
|
+
const key = (0, exports.generateCacheKey)(id, type);
|
|
24
|
+
return cache.get(key);
|
|
25
|
+
});
|
|
26
|
+
exports.get = get;
|
|
27
|
+
const updateIfExist = (id_1, type_1, value_1, cache_1, ...args_1) => __awaiter(void 0, [id_1, type_1, value_1, cache_1, ...args_1], void 0, function* (id, type, value, cache, ttl = 1000 * 3600) {
|
|
18
28
|
const key = (0, exports.generateCacheKey)(id, type);
|
|
19
29
|
const data = yield cache.get(key);
|
|
20
30
|
if (data)
|
|
21
|
-
cache.set(key, value);
|
|
31
|
+
cache.set(key, value, ttl);
|
|
22
32
|
});
|
|
23
33
|
exports.updateIfExist = updateIfExist;
|
|
24
34
|
const deleteIfExist = (id, type, cache) => {
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC"}
|
package/dist/utils/index.js
CHANGED
|
@@ -33,8 +33,9 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.PDF = exports.JWT = exports.File = exports.Bcrypt = void 0;
|
|
36
|
+
exports.Cache = exports.PDF = exports.JWT = exports.File = exports.Bcrypt = void 0;
|
|
37
37
|
exports.Bcrypt = __importStar(require("./bcrypt"));
|
|
38
38
|
exports.File = __importStar(require("./file"));
|
|
39
39
|
exports.JWT = __importStar(require("./jwt"));
|
|
40
40
|
exports.PDF = __importStar(require("./pdf"));
|
|
41
|
+
exports.Cache = __importStar(require("./cache"));
|
|
@@ -3,6 +3,7 @@ export declare const verifyJWTRequest: (authorization: string | undefined, publi
|
|
|
3
3
|
payload: any;
|
|
4
4
|
success: boolean;
|
|
5
5
|
message: string;
|
|
6
|
+
token: string;
|
|
6
7
|
};
|
|
7
8
|
export declare const validatePermissions: (acceptedPermissionKeys: CONSTANTS.Permission.PermissionKeys[], accountPermissionKeys: CONSTANTS.Permission.PermissionKeys[], validationStrategy: CONSTANTS.Permission.ValidationStrategy) => boolean;
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/jwt/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,eAAO,MAAM,gBAAgB,kBACZ,MAAM,GAAG,SAAS,aACtB,MAAM,CAAC,eAAe,CAAC,aACvB,CAAC,CAAC,SAAS,MAAM,GAAG,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,KAAK,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/jwt/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,eAAO,MAAM,gBAAgB,kBACZ,MAAM,GAAG,SAAS,aACtB,MAAM,CAAC,eAAe,CAAC,aACvB,CAAC,CAAC,SAAS,MAAM,GAAG,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,KAAK,CAAC;;;;;CA4BvE,CAAC;AAEF,eAAO,MAAM,mBAAmB,2BACN,SAAS,CAAC,UAAU,CAAC,cAAc,EAAE,yBACtC,SAAS,CAAC,UAAU,CAAC,cAAc,EAAE,sBACxC,SAAS,CAAC,UAAU,CAAC,kBAAkB,KAC1D,OAeF,CAAC"}
|
package/dist/utils/jwt/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.validatePermissions = exports.verifyJWTRequest = void 0;
|
|
4
|
+
const sea_platform_helpers_1 = require("sea-platform-helpers");
|
|
4
5
|
const verifyJWTRequest = (authorization, publicKey, verifyJWT) => {
|
|
5
6
|
let success = true, message = "", payload = undefined;
|
|
6
7
|
if (!authorization) {
|
|
7
8
|
success = false;
|
|
8
|
-
message =
|
|
9
|
+
message = sea_platform_helpers_1.CONSTANTS.Server.ERROR_MESSAGES.INVALID_INPUT;
|
|
9
10
|
}
|
|
10
11
|
authorization = authorization + "";
|
|
11
12
|
let token = authorization;
|
|
@@ -16,12 +17,13 @@ const verifyJWTRequest = (authorization, publicKey, verifyJWT) => {
|
|
|
16
17
|
}
|
|
17
18
|
catch (error) {
|
|
18
19
|
success = false;
|
|
19
|
-
message =
|
|
20
|
+
message = sea_platform_helpers_1.CONSTANTS.Server.ERROR_MESSAGES.UNAUTHENTICATED;
|
|
20
21
|
}
|
|
21
22
|
return {
|
|
22
23
|
payload,
|
|
23
24
|
success,
|
|
24
25
|
message,
|
|
26
|
+
token,
|
|
25
27
|
};
|
|
26
28
|
};
|
|
27
29
|
exports.verifyJWTRequest = verifyJWTRequest;
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sea-backend-helpers",
|
|
3
3
|
"description": "SEA Backend helpers library",
|
|
4
|
-
"version": "1.5.
|
|
4
|
+
"version": "1.5.9",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "tsc --build",
|
|
8
|
-
"watch": "tsc --watch"
|
|
8
|
+
"watch": "tsc --watch",
|
|
9
|
+
"link:dev": "npm link sea-platform-helpers"
|
|
9
10
|
},
|
|
10
11
|
"files": [
|
|
11
12
|
"dist/**/*"
|
|
@@ -20,6 +21,7 @@
|
|
|
20
21
|
"author": "",
|
|
21
22
|
"license": "ISC",
|
|
22
23
|
"dependencies": {
|
|
24
|
+
"@nestjs/axios": "^4.0.0",
|
|
23
25
|
"@nestjs/bullmq": "^10.2.3",
|
|
24
26
|
"bcrypt": "^5.1.1",
|
|
25
27
|
"bullmq": "^5.56.8",
|
|
@@ -27,20 +29,22 @@
|
|
|
27
29
|
"class-validator": "^0.14.1",
|
|
28
30
|
"ejs": "^3.1.10",
|
|
29
31
|
"moment": "^2.30.1",
|
|
32
|
+
"puppeteer": "^24.22.0",
|
|
30
33
|
"reflect-metadata": "^0.1.13",
|
|
31
34
|
"rxjs": "^7.0.0",
|
|
32
|
-
"puppeteer": "^24.22.0",
|
|
33
35
|
"sea-backend-helpers": "file:",
|
|
34
|
-
"sea-platform-helpers": "^1.5.
|
|
36
|
+
"sea-platform-helpers": "^1.5.12"
|
|
35
37
|
},
|
|
36
38
|
"peerDependencies": {
|
|
37
39
|
"@nestjs/common": "^10.0.0",
|
|
40
|
+
"@nestjs/core": "^10.0.0",
|
|
38
41
|
"@nestjs/jwt": "^10.0.0"
|
|
39
42
|
},
|
|
40
43
|
"devDependencies": {
|
|
44
|
+
"@nestjs/cache-manager": "^3.0.1",
|
|
41
45
|
"@types/bcrypt": "^5.0.2",
|
|
42
|
-
"@types/langs": "^2.0.5",
|
|
43
46
|
"@types/ejs": "^3.1.5",
|
|
47
|
+
"@types/langs": "^2.0.5",
|
|
44
48
|
"@types/numeral": "^2.0.5"
|
|
45
49
|
}
|
|
46
50
|
}
|