sea-backend-helpers 1.5.6 → 1.5.8
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 +15 -0
- package/dist/constants/cache/index.d.ts.map +1 -0
- package/dist/constants/cache/index.js +34 -0
- 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/index.d.ts +2 -0
- package/dist/modules/index.d.ts.map +1 -0
- package/dist/modules/index.js +37 -0
- package/dist/modules/remote/index.d.ts +3 -0
- package/dist/modules/remote/index.d.ts.map +1 -0
- package/dist/modules/remote/index.js +7 -0
- package/dist/modules/remote/remote.module.d.ts +10 -0
- package/dist/modules/remote/remote.module.d.ts.map +1 -0
- package/dist/modules/remote/remote.module.js +71 -0
- package/dist/modules/remote/remote.service.d.ts +29 -0
- package/dist/modules/remote/remote.service.d.ts.map +1 -0
- package/dist/modules/remote/remote.service.js +92 -0
- package/dist/remote/account/account.module.d.ts +6 -0
- package/dist/remote/account/account.module.d.ts.map +1 -0
- package/dist/remote/account/account.module.js +40 -0
- package/dist/remote/account/account.service.d.ts +12 -0
- package/dist/remote/account/account.service.d.ts.map +1 -0
- package/dist/remote/account/account.service.js +73 -0
- package/dist/services/remote.service.d.ts +18 -0
- package/dist/services/remote.service.d.ts.map +1 -0
- package/dist/services/remote.service.js +45 -0
- package/dist/utils/cache/index.d.ts +6 -0
- package/dist/utils/cache/index.d.ts.map +1 -0
- package/dist/utils/cache/index.js +28 -0
- 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/package.json +9 -5
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare enum CacheableModules {
|
|
2
|
+
Account = "Account",
|
|
3
|
+
Organization = "Organization",
|
|
4
|
+
EmailTemplate = "EmailTemplate",
|
|
5
|
+
EmailTemplateVersion = "EmailTemplateVersion",
|
|
6
|
+
File = "File",
|
|
7
|
+
Task = "Task",
|
|
8
|
+
Project = "Project",
|
|
9
|
+
ProjectMilestone = "ProjectMilestone",
|
|
10
|
+
ProjectSection = "ProjectSection",
|
|
11
|
+
Initiative = "Initiative",
|
|
12
|
+
KPI = "KPI"
|
|
13
|
+
}
|
|
14
|
+
export declare const getCacheModuleName: (module: CacheableModules) => string;
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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;IACnB,gBAAgB,qBAAqB;IACrC,cAAc,mBAAmB;IACjC,UAAU,eAAe;IACzB,GAAG,QAAQ;CACZ;AAeD,eAAO,MAAM,kBAAkB,WAAY,gBAAgB,KAAG,MAE7D,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCacheModuleName = exports.CacheableModules = void 0;
|
|
4
|
+
var CacheableModules;
|
|
5
|
+
(function (CacheableModules) {
|
|
6
|
+
CacheableModules["Account"] = "Account";
|
|
7
|
+
CacheableModules["Organization"] = "Organization";
|
|
8
|
+
CacheableModules["EmailTemplate"] = "EmailTemplate";
|
|
9
|
+
CacheableModules["EmailTemplateVersion"] = "EmailTemplateVersion";
|
|
10
|
+
CacheableModules["File"] = "File";
|
|
11
|
+
CacheableModules["Task"] = "Task";
|
|
12
|
+
CacheableModules["Project"] = "Project";
|
|
13
|
+
CacheableModules["ProjectMilestone"] = "ProjectMilestone";
|
|
14
|
+
CacheableModules["ProjectSection"] = "ProjectSection";
|
|
15
|
+
CacheableModules["Initiative"] = "Initiative";
|
|
16
|
+
CacheableModules["KPI"] = "KPI";
|
|
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"));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/modules/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
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.Remote = void 0;
|
|
37
|
+
exports.Remote = __importStar(require("./remote"));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/remote/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RemoteService = exports.RemoteModule = void 0;
|
|
4
|
+
var remote_module_1 = require("./remote.module");
|
|
5
|
+
Object.defineProperty(exports, "RemoteModule", { enumerable: true, get: function () { return remote_module_1.RemoteModule; } });
|
|
6
|
+
var remote_service_1 = require("./remote.service");
|
|
7
|
+
Object.defineProperty(exports, "RemoteService", { enumerable: true, get: function () { return remote_service_1.RemoteService; } });
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DynamicModule } from "@nestjs/common";
|
|
2
|
+
import { RemoteServiceOptions } from "./remote.service";
|
|
3
|
+
export declare class RemoteModule {
|
|
4
|
+
static forFeature(name: string, options: RemoteServiceOptions): DynamicModule;
|
|
5
|
+
static forFeatureAsync(name: string, options: {
|
|
6
|
+
inject?: any[];
|
|
7
|
+
useFactory: (...args: any[]) => RemoteServiceOptions;
|
|
8
|
+
}): DynamicModule;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=remote.module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote.module.d.ts","sourceRoot":"","sources":["../../../src/modules/remote/remote.module.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,aAAa,EAAY,MAAM,gBAAgB,CAAC;AAEjE,OAAO,EAAiB,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAEvE,qBACa,YAAY;IACvB,MAAM,CAAC,UAAU,CACf,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,oBAAoB,GAC5B,aAAa;IAuBhB,MAAM,CAAC,eAAe,CACpB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;QACP,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC;QACf,UAAU,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,oBAAoB,CAAC;KACtD,GACA,aAAa;CAyBjB"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
9
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
10
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
11
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
12
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
13
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
14
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
var RemoteModule_1;
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.RemoteModule = void 0;
|
|
20
|
+
// remote.module.ts
|
|
21
|
+
const common_1 = require("@nestjs/common");
|
|
22
|
+
const axios_1 = require("@nestjs/axios");
|
|
23
|
+
const remote_service_1 = require("./remote.service");
|
|
24
|
+
let RemoteModule = RemoteModule_1 = class RemoteModule {
|
|
25
|
+
static forFeature(name, options) {
|
|
26
|
+
// 1️⃣ Register HttpModule with the correct baseURL & auth
|
|
27
|
+
const httpModule = axios_1.HttpModule.register({
|
|
28
|
+
baseURL: options.baseURL,
|
|
29
|
+
auth: options.auth,
|
|
30
|
+
});
|
|
31
|
+
// 2️⃣ Create a provider for the RemoteService instance
|
|
32
|
+
const provider = {
|
|
33
|
+
provide: name, // unique token per instance
|
|
34
|
+
useFactory: (httpService) => new remote_service_1.RemoteService(httpService, options),
|
|
35
|
+
inject: [axios_1.HttpService], // inject HttpService from the registered HttpModule
|
|
36
|
+
};
|
|
37
|
+
return {
|
|
38
|
+
module: RemoteModule_1,
|
|
39
|
+
imports: [httpModule],
|
|
40
|
+
providers: [provider],
|
|
41
|
+
exports: [provider],
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
static forFeatureAsync(name, options) {
|
|
45
|
+
const httpModule = axios_1.HttpModule.registerAsync({
|
|
46
|
+
useFactory: (...args) => __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
const opts = yield options.useFactory(...args);
|
|
48
|
+
return { baseURL: opts.baseURL, auth: opts.auth };
|
|
49
|
+
}),
|
|
50
|
+
inject: options.inject || [],
|
|
51
|
+
});
|
|
52
|
+
const provider = {
|
|
53
|
+
provide: name,
|
|
54
|
+
useFactory: (httpService, ...args) => __awaiter(this, void 0, void 0, function* () {
|
|
55
|
+
const opts = yield options.useFactory(...args);
|
|
56
|
+
return new remote_service_1.RemoteService(httpService, opts);
|
|
57
|
+
}),
|
|
58
|
+
inject: [axios_1.HttpService, ...(options.inject || [])],
|
|
59
|
+
};
|
|
60
|
+
return {
|
|
61
|
+
module: RemoteModule_1,
|
|
62
|
+
imports: [httpModule], // only HttpModule here, never ConfigService
|
|
63
|
+
providers: [provider],
|
|
64
|
+
exports: [provider],
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
exports.RemoteModule = RemoteModule;
|
|
69
|
+
exports.RemoteModule = RemoteModule = RemoteModule_1 = __decorate([
|
|
70
|
+
(0, common_1.Module)({})
|
|
71
|
+
], RemoteModule);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { HttpService } from "@nestjs/axios";
|
|
2
|
+
import { CacheableModules } from "../../constants/cache";
|
|
3
|
+
export interface RemoteServiceOptions {
|
|
4
|
+
baseURL: string;
|
|
5
|
+
auth?: {
|
|
6
|
+
username: string;
|
|
7
|
+
password: string;
|
|
8
|
+
};
|
|
9
|
+
path: string;
|
|
10
|
+
model: CacheableModules;
|
|
11
|
+
cache?: {
|
|
12
|
+
get: (key: string) => Promise<any> | any;
|
|
13
|
+
set: (key: string, value: any, ttl?: number) => Promise<void> | void;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export declare class RemoteService {
|
|
17
|
+
private readonly httpService;
|
|
18
|
+
private readonly options;
|
|
19
|
+
constructor(httpService: HttpService, options: RemoteServiceOptions);
|
|
20
|
+
getHttpService(): HttpService;
|
|
21
|
+
getUrl(id?: string): string;
|
|
22
|
+
private getFromCache;
|
|
23
|
+
private setToCache;
|
|
24
|
+
fetchById<T>(id: string): Promise<T | null>;
|
|
25
|
+
checkFindById<T>(id: string): Promise<T | null>;
|
|
26
|
+
fetchByIds<T>(ids: string[]): Promise<(Awaited<T> | null)[]>;
|
|
27
|
+
fetchAll<T>(query?: string): Promise<T[]>;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=remote.service.d.ts.map
|
|
@@ -0,0 +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;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,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.RemoteService = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const rxjs_1 = require("rxjs");
|
|
15
|
+
class RemoteService {
|
|
16
|
+
constructor(httpService, options) {
|
|
17
|
+
this.httpService = httpService;
|
|
18
|
+
this.options = options;
|
|
19
|
+
}
|
|
20
|
+
getHttpService() {
|
|
21
|
+
return this.httpService;
|
|
22
|
+
}
|
|
23
|
+
getUrl(id) {
|
|
24
|
+
return id ? `${this.options.path}/${id}` : this.options.path;
|
|
25
|
+
}
|
|
26
|
+
getFromCache(key) {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
if (!this.options.cache)
|
|
29
|
+
return null;
|
|
30
|
+
try {
|
|
31
|
+
return yield this.options.cache.get(key);
|
|
32
|
+
}
|
|
33
|
+
catch (_a) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
setToCache(key, value) {
|
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
if (!this.options.cache)
|
|
41
|
+
return;
|
|
42
|
+
try {
|
|
43
|
+
yield this.options.cache.set(key, value);
|
|
44
|
+
}
|
|
45
|
+
catch (_a) {
|
|
46
|
+
// ignore caching errors
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
fetchById(id) {
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
const cacheKey = `${this.options.model}:${id}`;
|
|
53
|
+
const cached = yield this.getFromCache(cacheKey);
|
|
54
|
+
if (cached)
|
|
55
|
+
return cached;
|
|
56
|
+
try {
|
|
57
|
+
const response = yield (0, rxjs_1.firstValueFrom)(this.httpService.get(this.getUrl(id)));
|
|
58
|
+
yield this.setToCache(cacheKey, response.data);
|
|
59
|
+
return response.data;
|
|
60
|
+
}
|
|
61
|
+
catch (_a) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
checkFindById(id) {
|
|
67
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
const object = yield this.fetchById(id);
|
|
69
|
+
if (!object)
|
|
70
|
+
throw new common_1.NotFoundException(`${this.options.model} is not found!`);
|
|
71
|
+
return object;
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
fetchByIds(ids) {
|
|
75
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
const results = yield Promise.all(ids.map((id) => this.fetchById(id)));
|
|
77
|
+
return results;
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
fetchAll() {
|
|
81
|
+
return __awaiter(this, arguments, void 0, function* (query = "") {
|
|
82
|
+
try {
|
|
83
|
+
const response = yield (0, rxjs_1.firstValueFrom)(this.httpService.get(this.getUrl() + query));
|
|
84
|
+
return response.data || [];
|
|
85
|
+
}
|
|
86
|
+
catch (_a) {
|
|
87
|
+
return [];
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
exports.RemoteService = RemoteService;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account.module.d.ts","sourceRoot":"","sources":["../../../src/remote/account/account.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAU,MAAM,gBAAgB,CAAC;AAEvD,OAAc,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAGlD,qBACa,aAAa;IACxB,MAAM,CAAC,QAAQ,CAAC,YAAY,EAAE,kBAAkB,GAAG,aAAa;CAiBjE"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
var AccountModule_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.AccountModule = void 0;
|
|
14
|
+
const common_1 = require("@nestjs/common");
|
|
15
|
+
const axios_1 = require("@nestjs/axios");
|
|
16
|
+
const axios_2 = __importDefault(require("axios"));
|
|
17
|
+
const account_service_1 = require("./account.service");
|
|
18
|
+
let AccountModule = AccountModule_1 = class AccountModule {
|
|
19
|
+
static register(axiosOptions) {
|
|
20
|
+
return {
|
|
21
|
+
module: AccountModule_1,
|
|
22
|
+
imports: [axios_1.HttpModule],
|
|
23
|
+
providers: [
|
|
24
|
+
{
|
|
25
|
+
provide: "ACCOUNT_HTTP_PROVIDER",
|
|
26
|
+
useFactory: () => {
|
|
27
|
+
const axiosInstance = axios_2.default.create(axiosOptions);
|
|
28
|
+
return new axios_1.HttpService(axiosInstance);
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
account_service_1.AccountService,
|
|
32
|
+
],
|
|
33
|
+
exports: [account_service_1.AccountService],
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
exports.AccountModule = AccountModule;
|
|
38
|
+
exports.AccountModule = AccountModule = AccountModule_1 = __decorate([
|
|
39
|
+
(0, common_1.Module)({})
|
|
40
|
+
], AccountModule);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HttpService } from "@nestjs/axios";
|
|
2
|
+
import { Cache } from "@nestjs/cache-manager";
|
|
3
|
+
import { DTO } from "sea-platform-helpers";
|
|
4
|
+
export declare class AccountService {
|
|
5
|
+
private readonly httpService;
|
|
6
|
+
private readonly cacheManager;
|
|
7
|
+
constructor(httpService: HttpService, cacheManager: Cache);
|
|
8
|
+
fetchById(id: string): Promise<DTO.Account.IAccount | null>;
|
|
9
|
+
checkFindById(id: string): Promise<DTO.Account.IAccount>;
|
|
10
|
+
fetchByIds(ids: string[]): Promise<DTO.Account.IAccount[]>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=account.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account.service.d.ts","sourceRoot":"","sources":["../../../src/remote/account/account.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAiB,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAE3C,qBACa,cAAc;IAGvB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAE5B,OAAO,CAAC,QAAQ,CAAC,YAAY;gBAFZ,WAAW,EAAE,WAAW,EAExB,YAAY,EAAE,KAAK;IAGhC,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAmB3D,aAAa,CAAC,EAAE,EAAE,MAAM;IAMxB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;CAGjE"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.AccountService = void 0;
|
|
25
|
+
const axios_1 = require("@nestjs/axios");
|
|
26
|
+
const common_1 = require("@nestjs/common");
|
|
27
|
+
const cache_manager_1 = require("@nestjs/cache-manager");
|
|
28
|
+
const rxjs_1 = require("rxjs");
|
|
29
|
+
let AccountService = class AccountService {
|
|
30
|
+
constructor(httpService, cacheManager) {
|
|
31
|
+
this.httpService = httpService;
|
|
32
|
+
this.cacheManager = cacheManager;
|
|
33
|
+
}
|
|
34
|
+
fetchById(id) {
|
|
35
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
const cacheKey = `account:${id}`;
|
|
37
|
+
const cached = yield this.cacheManager.get(cacheKey);
|
|
38
|
+
if (cached)
|
|
39
|
+
return cached;
|
|
40
|
+
try {
|
|
41
|
+
const response = yield (0, rxjs_1.firstValueFrom)(this.httpService.get(`/api/external/accounts/${id}`));
|
|
42
|
+
const account = response.data;
|
|
43
|
+
if (account)
|
|
44
|
+
yield this.cacheManager.set(cacheKey, account);
|
|
45
|
+
return account;
|
|
46
|
+
}
|
|
47
|
+
catch (_a) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
checkFindById(id) {
|
|
53
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
const account = yield this.fetchById(id);
|
|
55
|
+
if (!account)
|
|
56
|
+
throw new common_1.NotFoundException("Account not found!");
|
|
57
|
+
return account;
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
fetchByIds(ids) {
|
|
61
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
62
|
+
return Promise.all(ids.map((id) => this.fetchById(id)));
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
exports.AccountService = AccountService;
|
|
67
|
+
exports.AccountService = AccountService = __decorate([
|
|
68
|
+
(0, common_1.Injectable)(),
|
|
69
|
+
__param(0, (0, common_1.Inject)("ACCOUNT_HTTP_PROVIDER")),
|
|
70
|
+
__param(1, (0, common_1.Inject)(cache_manager_1.CACHE_MANAGER)),
|
|
71
|
+
__metadata("design:paramtypes", [axios_1.HttpService,
|
|
72
|
+
cache_manager_1.Cache])
|
|
73
|
+
], AccountService);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HttpService } from "@nestjs/axios";
|
|
2
|
+
export interface RemoteServiceOptions {
|
|
3
|
+
baseURL: string;
|
|
4
|
+
auth?: {
|
|
5
|
+
username: string;
|
|
6
|
+
password: string;
|
|
7
|
+
};
|
|
8
|
+
path: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class RemoteService {
|
|
11
|
+
private readonly httpService;
|
|
12
|
+
private readonly options;
|
|
13
|
+
constructor(httpService: HttpService, options: RemoteServiceOptions);
|
|
14
|
+
private getUrl;
|
|
15
|
+
fetchById<T>(id: string): Promise<T | null>;
|
|
16
|
+
fetchAll<T>(): Promise<T[]>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=remote.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote.service.d.ts","sourceRoot":"","sources":["../../src/services/remote.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,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;CACd;AAED,qBAAa,aAAa;IAEtB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,OAAO;gBADP,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,oBAAoB;IAGhD,OAAO,CAAC,MAAM;IAIR,SAAS,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAW3C,QAAQ,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,EAAE,CAAC;CAUlC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.RemoteService = void 0;
|
|
13
|
+
const rxjs_1 = require("rxjs");
|
|
14
|
+
class RemoteService {
|
|
15
|
+
constructor(httpService, options) {
|
|
16
|
+
this.httpService = httpService;
|
|
17
|
+
this.options = options;
|
|
18
|
+
}
|
|
19
|
+
getUrl(id) {
|
|
20
|
+
return id ? `${this.options.path}/${id}` : this.options.path;
|
|
21
|
+
}
|
|
22
|
+
fetchById(id) {
|
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
try {
|
|
25
|
+
const response = yield (0, rxjs_1.firstValueFrom)(this.httpService.get(this.getUrl(id)));
|
|
26
|
+
return response.data;
|
|
27
|
+
}
|
|
28
|
+
catch (_a) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
fetchAll() {
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
try {
|
|
36
|
+
const response = yield (0, rxjs_1.firstValueFrom)(this.httpService.get(this.getUrl()));
|
|
37
|
+
return response.data || [];
|
|
38
|
+
}
|
|
39
|
+
catch (_a) {
|
|
40
|
+
return [];
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.RemoteService = RemoteService;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CacheableModules } from "../../constants/cache";
|
|
2
|
+
import { Cache } from "@nestjs/cache-manager";
|
|
3
|
+
export declare const generateCacheKey: (id: string, type: CacheableModules) => string;
|
|
4
|
+
export declare const updateIfExist: <T>(id: string, type: CacheableModules, value: T, cache: Cache) => Promise<void>;
|
|
5
|
+
export declare const deleteIfExist: (id: string, type: CacheableModules, cache: Cache) => void;
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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;AAE9C,eAAO,MAAM,gBAAgB,OAAQ,MAAM,QAAQ,gBAAgB,WAElE,CAAC;AAEF,eAAO,MAAM,aAAa,GAAU,CAAC,MAC/B,MAAM,QACJ,gBAAgB,SACf,CAAC,SACD,KAAK,kBAMb,CAAC;AAEF,eAAO,MAAM,aAAa,OACpB,MAAM,QACJ,gBAAgB,SACf,KAAK,SAKb,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.deleteIfExist = exports.updateIfExist = exports.generateCacheKey = void 0;
|
|
13
|
+
const generateCacheKey = (id, type) => {
|
|
14
|
+
return `${type}:${id}`;
|
|
15
|
+
};
|
|
16
|
+
exports.generateCacheKey = generateCacheKey;
|
|
17
|
+
const updateIfExist = (id, type, value, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
+
const key = (0, exports.generateCacheKey)(id, type);
|
|
19
|
+
const data = yield cache.get(key);
|
|
20
|
+
if (data)
|
|
21
|
+
cache.set(key, value);
|
|
22
|
+
});
|
|
23
|
+
exports.updateIfExist = updateIfExist;
|
|
24
|
+
const deleteIfExist = (id, type, cache) => {
|
|
25
|
+
const key = (0, exports.generateCacheKey)(id, type);
|
|
26
|
+
cache.del(key);
|
|
27
|
+
};
|
|
28
|
+
exports.deleteIfExist = deleteIfExist;
|
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"));
|
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.8",
|
|
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.11"
|
|
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
|
}
|