@servicelabsco/nestjs-utility-services 1.0.148 → 1.0.149
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/app.module.js +2 -0
- package/dist/app.module.js.map +1 -1
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +32 -0
- package/dist/cli.js.map +1 -0
- package/dist/platformUtility/commands/sqs.worker.command.d.ts +2 -4
- package/dist/platformUtility/commands/sqs.worker.command.js +16 -10
- package/dist/platformUtility/commands/sqs.worker.command.js.map +1 -1
- package/package.json +4 -2
package/dist/app.module.js
CHANGED
@@ -10,6 +10,7 @@ exports.AppModule = void 0;
|
|
10
10
|
const bull_1 = require("@nestjs/bull");
|
11
11
|
const common_1 = require("@nestjs/common");
|
12
12
|
const typeorm_1 = require("@nestjs/typeorm");
|
13
|
+
const nestjs_command_1 = require("nestjs-command");
|
13
14
|
const nestjs_console_1 = require("nestjs-console");
|
14
15
|
const app_controller_1 = require("./app.controller");
|
15
16
|
const app_service_1 = require("./app.service");
|
@@ -43,6 +44,7 @@ AppModule = __decorate([
|
|
43
44
|
security_module_1.SecurityModule,
|
44
45
|
common_module_1.CommonModule,
|
45
46
|
nestjs_console_1.ConsoleModule,
|
47
|
+
nestjs_command_1.CommandModule,
|
46
48
|
],
|
47
49
|
controllers: [app_controller_1.AppController],
|
48
50
|
providers: [app_service_1.AppService],
|
package/dist/app.module.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"app.module.js","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,uCAA0C;AAC1C,2CAA2E;AAC3E,6CAAgD;AAChD,mDAA+C;AAC/C,qDAAiD;AACjD,+CAA2C;AAC3C,oDAAgD;AAChD,oFAA+E;AAC/E,sEAAkE;AAClE,oFAAgF;AAChF,0DAAsD;AACtD,qDAAqD;AACrD,qDAAqD;AACrD,iGAA6F;AAC7F,uFAAkF;AAClF,gEAA4D;AAC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YACZ,8BAAa;YACb,8BAAa;SAChB;QACD,WAAW,EAAE,CAAC,8BAAa,CAAC;QAC5B,SAAS,EAAE,CAAC,wBAAU,CAAC;KAC1B,CAAC;GACW,SAAS,CAOrB;AAPY,8BAAS"}
|
package/dist/cli.d.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
package/dist/cli.js
ADDED
@@ -0,0 +1,32 @@
|
|
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
|
+
const app_module_1 = require("./app.module");
|
13
|
+
const core_1 = require("@nestjs/core");
|
14
|
+
const nestjs_command_1 = require("nestjs-command");
|
15
|
+
function bootstrap() {
|
16
|
+
return __awaiter(this, void 0, void 0, function* () {
|
17
|
+
const app = yield core_1.NestFactory.createApplicationContext(app_module_1.AppModule, {
|
18
|
+
logger: ['error'],
|
19
|
+
});
|
20
|
+
try {
|
21
|
+
yield app.select(nestjs_command_1.CommandModule).get(nestjs_command_1.CommandService).exec();
|
22
|
+
yield app.close();
|
23
|
+
}
|
24
|
+
catch (error) {
|
25
|
+
global.console.error(error);
|
26
|
+
yield app.close();
|
27
|
+
process.exit(1);
|
28
|
+
}
|
29
|
+
});
|
30
|
+
}
|
31
|
+
bootstrap();
|
32
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,6CAAyC;AACzC,uCAA2C;AAC3C,mDAA+D;AAE/D,SAAe,SAAS;;QACpB,MAAM,GAAG,GAAG,MAAM,kBAAW,CAAC,wBAAwB,CAAC,sBAAS,EAAE;YAC9D,MAAM,EAAE,CAAC,OAAO,CAAC;SACpB,CAAC,CAAC;QAEH,IAAI;YACA,MAAM,GAAG,CAAC,MAAM,CAAC,8BAAa,CAAC,CAAC,GAAG,CAAC,+BAAc,CAAC,CAAC,IAAI,EAAE,CAAC;YAC3D,MAAM,GAAG,CAAC,KAAK,EAAE,CAAC;SACrB;QAAC,OAAO,KAAK,EAAE;YACZ,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAC5B,MAAM,GAAG,CAAC,KAAK,EAAE,CAAC;YAClB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACnB;IACL,CAAC;CAAA;AACD,SAAS,EAAE,CAAC"}
|
@@ -1,12 +1,10 @@
|
|
1
|
-
import { ConsoleService } from 'nestjs-console';
|
2
1
|
import { QueueService } from '../../platformUtility/services/queue.service';
|
3
2
|
export declare class SqsWorkerCommand {
|
4
3
|
private readonly queueService;
|
5
|
-
private readonly consoleService;
|
6
4
|
private counter;
|
7
5
|
private start_time;
|
8
|
-
constructor(queueService: QueueService
|
9
|
-
|
6
|
+
constructor(queueService: QueueService);
|
7
|
+
test(): Promise<void>;
|
10
8
|
private processMessage;
|
11
9
|
private dropMessage;
|
12
10
|
private fetchMessages;
|
@@ -21,18 +21,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.SqsWorkerCommand = void 0;
|
22
22
|
const common_1 = require("@nestjs/common");
|
23
23
|
const config = require("config");
|
24
|
-
const
|
24
|
+
const nestjs_command_1 = require("nestjs-command");
|
25
25
|
const platform_constants_1 = require("../../config/platform.constants");
|
26
26
|
const queue_service_1 = require("../../platformUtility/services/queue.service");
|
27
27
|
const date_util_1 = require("./../../common/libraries/date.util");
|
28
28
|
const sqsQueue = config.get('sqs.fifo');
|
29
29
|
let SqsWorkerCommand = class SqsWorkerCommand {
|
30
|
-
constructor(queueService
|
30
|
+
constructor(queueService) {
|
31
31
|
this.queueService = queueService;
|
32
|
-
this.consoleService = consoleService;
|
33
32
|
this.counter = 0;
|
34
33
|
this.start_time = date_util_1.DateUtil.getDateTimeInFormat();
|
35
|
-
|
34
|
+
}
|
35
|
+
test() {
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
37
|
+
global.console.log(platform_constants_1.default.jobs);
|
36
38
|
while (true) {
|
37
39
|
yield this.queueService.pause();
|
38
40
|
yield this.checkForSystem();
|
@@ -51,11 +53,6 @@ let SqsWorkerCommand = class SqsWorkerCommand {
|
|
51
53
|
global.console.log(`[sqs.fifo][events] ${this.start_time} : ${this.counter}`);
|
52
54
|
}
|
53
55
|
});
|
54
|
-
const cli = this.consoleService.getCli();
|
55
|
-
this.consoleService.createCommand({
|
56
|
-
command: 'queue:sqs',
|
57
|
-
description: 'sync all entities and their definitions defined within the system',
|
58
|
-
}, this.runWorker, cli);
|
59
56
|
}
|
60
57
|
processMessage(message) {
|
61
58
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -103,9 +100,18 @@ let SqsWorkerCommand = class SqsWorkerCommand {
|
|
103
100
|
});
|
104
101
|
}
|
105
102
|
};
|
103
|
+
__decorate([
|
104
|
+
(0, nestjs_command_1.Command)({
|
105
|
+
command: 'queue:sqs',
|
106
|
+
describe: 'create a user',
|
107
|
+
}),
|
108
|
+
__metadata("design:type", Function),
|
109
|
+
__metadata("design:paramtypes", []),
|
110
|
+
__metadata("design:returntype", Promise)
|
111
|
+
], SqsWorkerCommand.prototype, "test", null);
|
106
112
|
SqsWorkerCommand = __decorate([
|
107
113
|
(0, common_1.Injectable)(),
|
108
|
-
__metadata("design:paramtypes", [queue_service_1.QueueService
|
114
|
+
__metadata("design:paramtypes", [queue_service_1.QueueService])
|
109
115
|
], SqsWorkerCommand);
|
110
116
|
exports.SqsWorkerCommand = SqsWorkerCommand;
|
111
117
|
//# sourceMappingURL=sqs.worker.command.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"sqs.worker.command.js","sourceRoot":"","sources":["../../../src/platformUtility/commands/sqs.worker.command.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,iCAAiC;AACjC,
|
1
|
+
{"version":3,"file":"sqs.worker.command.js","sourceRoot":"","sources":["../../../src/platformUtility/commands/sqs.worker.command.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,iCAAiC;AACjC,mDAA6D;AAE7D,wEAAgE;AAChE,gFAA4E;AAC5E,kEAA8D;AAG9D,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AAQxC,IAAa,gBAAgB,GAA7B,MAAa,gBAAgB;IAUzB,YAA6B,YAA0B;QAA1B,iBAAY,GAAZ,YAAY,CAAc;QAT/C,YAAO,GAAG,CAAC,CAAC;QACZ,eAAU,GAAG,oBAAQ,CAAC,mBAAmB,EAAE,CAAC;IAkBpD,CAAC;IAKK,IAAI;;YACN,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,4BAAiB,CAAC,IAAI,CAAC,CAAC;YAC3C,OAAO,IAAI,EAAE;gBACT,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC;gBAChC,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;gBAE5B,IAAI,MAAM,CAAC;gBAEX,IAAI;oBACA,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;iBACvC;gBAAC,OAAO,KAAK,EAAE;oBACZ,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;iBACtC;gBAED,IAAI,CAAC,C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gBAEhF,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;gBACvC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;aACtC;oBAAS;gBACN,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;aAC3C;QACL,CAAC;KAAA;IASa,WAAW,CAAC,EAAU;;YAChC,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QAC7D,CAAC;KAAA;IAQa,aAAa;;YACvB,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QAC1D,CAAC;KAAA;IAEa,eAAe,CAAC,QAAe;;YACzC,KAAK,MAAM,OAAO,IAAI,QAAQ;gBAAE,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACvE,CAAC;KAAA;IAQa,cAAc;;YACxB,MAAM,IAAI,CAAC,YAAY,CAAC,mBAAmB,EAAE,CAAC;YAE9C,IAAI,MAAM,IAAI,CAAC,YAAY,CAAC,qBAAqB,EAAE,EAAE;gBACjD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aACnB;QACL,CAAC;KAAA;CACJ,CAAA;AAlHG;IAJC,IAAA,wBAAO,EAAC;QACL,OAAO,EAAE,WAAW;QACpB,QAAQ,EAAE,eAAe;KAC5B,CAAC;;;;4CAsBD;AA9CQ,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;qCAWkC,4BAAY;GAV9C,gBAAgB,CA2I5B;AA3IY,4CAAgB"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@servicelabsco/nestjs-utility-services",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.149",
|
4
4
|
"description": "NestJS generic packages to support development",
|
5
5
|
"author": "Hemant Kumar Sah <hemantanshu@gmail.com>",
|
6
6
|
"license": "MIT",
|
@@ -64,12 +64,14 @@
|
|
64
64
|
"express-rate-limit": "^5.5.0",
|
65
65
|
"helmet": "^4.6.0",
|
66
66
|
"md5": "^2.3.0",
|
67
|
+
"nestjs-command": "^3.1.1",
|
67
68
|
"parse-bearer-token": "^1.0.1",
|
68
69
|
"passport-facebook": "^3.0.0",
|
69
70
|
"passport-google-oauth20": "^2.0.0",
|
70
71
|
"prompt-sync": "^4.2.0",
|
71
72
|
"randomstring": "^1.2.1",
|
72
|
-
"ua-parser-js": "^0.7.28"
|
73
|
+
"ua-parser-js": "^0.7.28",
|
74
|
+
"yargs": "^17.3.1"
|
73
75
|
},
|
74
76
|
"devDependencies": {
|
75
77
|
"@nestjs/bull": "^0.4.2",
|