@servicelabsco/nestjs-utility-services 1.2.97 → 1.2.98

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.
Files changed (65) hide show
  1. package/dist/app.controller.d.ts +4 -1
  2. package/dist/app.controller.js +31 -1
  3. package/dist/app.controller.js.map +1 -1
  4. package/dist/app.module.js +2 -2
  5. package/dist/app.module.js.map +1 -1
  6. package/dist/app.service.d.ts +0 -9
  7. package/dist/app.service.js +2 -34
  8. package/dist/app.service.js.map +1 -1
  9. package/dist/common/libraries/common.job.d.ts +3 -3
  10. package/dist/common/libraries/common.job.js +12 -5
  11. package/dist/common/libraries/common.job.js.map +1 -1
  12. package/dist/config/queue.config.d.ts +1 -2
  13. package/dist/config/queue.config.js +1 -5
  14. package/dist/config/queue.config.js.map +1 -1
  15. package/dist/platformUtility/consumers/index.d.ts +0 -1
  16. package/dist/platformUtility/consumers/index.js +0 -1
  17. package/dist/platformUtility/consumers/index.js.map +1 -1
  18. package/dist/platformUtility/consumers/job.consumer.d.ts +14 -3
  19. package/dist/platformUtility/consumers/job.consumer.js +94 -11
  20. package/dist/platformUtility/consumers/job.consumer.js.map +1 -1
  21. package/dist/platformUtility/controllers/bull.job.controller.d.ts +4 -4
  22. package/dist/platformUtility/controllers/bull.job.controller.js +5 -5
  23. package/dist/platformUtility/controllers/bull.job.controller.js.map +1 -1
  24. package/dist/platformUtility/dtos/queue.options.dto.d.ts +1 -1
  25. package/dist/platformUtility/dtos/queue.options.dto.js +1 -2
  26. package/dist/platformUtility/dtos/queue.options.dto.js.map +1 -1
  27. package/dist/platformUtility/es6.classes.d.ts +1 -2
  28. package/dist/platformUtility/es6.classes.js +1 -2
  29. package/dist/platformUtility/es6.classes.js.map +1 -1
  30. package/dist/platformUtility/jobs/test.job.d.ts +3 -1
  31. package/dist/platformUtility/jobs/test.job.js +4 -1
  32. package/dist/platformUtility/jobs/test.job.js.map +1 -1
  33. package/dist/platformUtility/platform.utility.module.js +5 -3
  34. package/dist/platformUtility/platform.utility.module.js.map +1 -1
  35. package/dist/platformUtility/services/mail.service.js +3 -1
  36. package/dist/platformUtility/services/mail.service.js.map +1 -1
  37. package/dist/platformUtility/services/maintenance.service.js +0 -1
  38. package/dist/platformUtility/services/maintenance.service.js.map +1 -1
  39. package/dist/platformUtility/services/queue.service.d.ts +9 -10
  40. package/dist/platformUtility/services/queue.service.js +9 -42
  41. package/dist/platformUtility/services/queue.service.js.map +1 -1
  42. package/dist/platformUtility/services/shutdown.service.d.ts +3 -1
  43. package/dist/platformUtility/services/shutdown.service.js +6 -2
  44. package/dist/platformUtility/services/shutdown.service.js.map +1 -1
  45. package/dist/system/commands/event.queue.command.js +0 -1
  46. package/dist/system/commands/event.queue.command.js.map +1 -1
  47. package/dist/system/es6.classes.d.ts +3 -1
  48. package/dist/system/es6.classes.js +4 -0
  49. package/dist/system/es6.classes.js.map +1 -1
  50. package/dist/system/jobs/index.d.ts +2 -0
  51. package/dist/system/jobs/index.js +2 -0
  52. package/dist/system/jobs/index.js.map +1 -1
  53. package/dist/system/jobs/set.event.queue.job.d.ts +11 -0
  54. package/dist/system/jobs/set.event.queue.job.js +65 -0
  55. package/dist/system/jobs/set.event.queue.job.js.map +1 -0
  56. package/dist/system/jobs/sqs.polling.job.d.ts +21 -0
  57. package/dist/system/jobs/sqs.polling.job.js +79 -0
  58. package/dist/system/jobs/sqs.polling.job.js.map +1 -0
  59. package/dist/system/services/es6.jobs.service.d.ts +5 -1
  60. package/dist/system/services/es6.jobs.service.js +9 -1
  61. package/dist/system/services/es6.jobs.service.js.map +1 -1
  62. package/package.json +5 -3
  63. package/dist/platformUtility/consumers/event.consumer.d.ts +0 -17
  64. package/dist/platformUtility/consumers/event.consumer.js +0 -101
  65. package/dist/platformUtility/consumers/event.consumer.js.map +0 -1
@@ -0,0 +1,65 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.SetEventQueueJob = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const common_job_1 = require("../../common/libraries/common.job");
15
+ const date_util_1 = require("../../common/libraries/date.util");
16
+ const queue_service_1 = require("../../platformUtility/services/queue.service");
17
+ const event_queue_service_1 = require("../services/event.queue.service");
18
+ let SetEventQueueJob = class SetEventQueueJob extends common_job_1.CommonJob {
19
+ constructor(eventQueueService, queueService) {
20
+ super('eedbbd37e8ca956ab13f24b5028aaa83');
21
+ this.eventQueueService = eventQueueService;
22
+ this.queueService = queueService;
23
+ }
24
+ async handle() {
25
+ const events = await this.eventQueueService.getActiveEvents();
26
+ for (const event of events) {
27
+ await this.setEvent(event);
28
+ }
29
+ }
30
+ async setEvent(event) {
31
+ event.start_time = date_util_1.DateUtil.getDateTime();
32
+ await event.save();
33
+ try {
34
+ const payload = this.typeCastParameter(event.parameter);
35
+ const job = await this.queueService.addJob(event.event.identifier, payload);
36
+ global.console.log('triggered event : ', event.event.identifier, payload, job.id);
37
+ }
38
+ catch (error) {
39
+ global.console.error('cannot trigger event', event);
40
+ global.console.error(error);
41
+ }
42
+ event.end_time = date_util_1.DateUtil.getDateTime();
43
+ return event.save();
44
+ }
45
+ typeCastParameter(value) {
46
+ if (!value.length)
47
+ return null;
48
+ if (!isNaN(+value))
49
+ return +value;
50
+ const str = value.toLowerCase();
51
+ if (['true', 'false'].includes(str)) {
52
+ if (str === 'true')
53
+ return true;
54
+ return false;
55
+ }
56
+ return value;
57
+ }
58
+ };
59
+ exports.SetEventQueueJob = SetEventQueueJob;
60
+ exports.SetEventQueueJob = SetEventQueueJob = __decorate([
61
+ (0, common_1.Injectable)(),
62
+ __metadata("design:paramtypes", [event_queue_service_1.EventQueueService,
63
+ queue_service_1.QueueService])
64
+ ], SetEventQueueJob);
65
+ //# sourceMappingURL=set.event.queue.job.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set.event.queue.job.js","sourceRoot":"","sources":["../../../src/system/jobs/set.event.queue.job.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,kEAA8D;AAC9D,gEAA4D;AAC5D,gFAA4E;AAE5E,yEAAoE;AAG7D,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,sBAAS;IAC3C,YACqB,iBAAoC,EAClC,YAA0B;QAE7C,KAAK,CAAC,kCAAkC,CAAC,CAAC;QAHzB,sBAAiB,GAAjB,iBAAiB,CAAmB;QAClC,iBAAY,GAAZ,YAAY,CAAc;IAGjD,CAAC;IACD,KAAK,CAAC,MAAM;QACR,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,eAAe,EAAE,CAAC;QAC9D,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YACzB,MAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC/B,CAAC;IACL,CAAC;IAEO,KAAK,CAAC,QAAQ,CAAC,KAAuB;QAE1C,KAAK,CAAC,UAAU,GAAG,oBAAQ,CAAC,WAAW,EAAE,CAAC;QAC1C,MAAM,KAAK,CAAC,IAAI,EAAE,CAAC;QAEnB,IAAI,CAAC;YACD,MAAM,OAAO,GAAG,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;YACxD,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;YAE5E,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,KAAK,CAAC,KAAK,CAAC,UAAU,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;QACtF,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;YACpD,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC;QAED,KAAK,CAAC,QAAQ,GAAG,oBAAQ,CAAC,WAAW,EAAE,CAAC;QACxC,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;IACxB,CAAC;IASO,iBAAiB,CAAC,KAAa;QACnC,IAAI,CAAC,KAAK,CAAC,MAAM;YAAE,OAAO,IAAI,CAAC;QAC/B,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC;YAAE,OAAO,CAAC,KAAK,CAAC;QAElC,MAAM,GAAG,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;QAEhC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAClC,IAAI,GAAG,KAAK,MAAM;gBAAE,OAAO,IAAI,CAAC;YAChC,OAAO,KAAK,CAAC;QACjB,CAAC;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ,CAAA;AArDY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;qCAG+B,uCAAiB;QACpB,4BAAY;GAHxC,gBAAgB,CAqD5B"}
@@ -0,0 +1,21 @@
1
+ import { CommonJob } from '../../common/libraries/common.job';
2
+ import { MaintenanceService } from '../../platformUtility/services/maintenance.service';
3
+ import { QueueService } from '../../platformUtility/services/queue.service';
4
+ import { SqsService } from '../../platformUtility/services/sqs.service';
5
+ import { PropertyService } from '../services/property.service';
6
+ export declare class SqsPollingJob extends CommonJob {
7
+ protected readonly queueService: QueueService;
8
+ private readonly propertyService;
9
+ private readonly sqsService;
10
+ protected readonly maintenanceService: MaintenanceService;
11
+ protected noDuplicate: boolean;
12
+ private isFifo;
13
+ private sqsQueue;
14
+ protected priority: number;
15
+ protected timeout: number;
16
+ constructor(queueService: QueueService, propertyService: PropertyService, sqsService: SqsService, maintenanceService: MaintenanceService);
17
+ handle(slug: string): Promise<void>;
18
+ private processMessages;
19
+ private processMessage;
20
+ private init;
21
+ }
@@ -0,0 +1,79 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.SqsPollingJob = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const common_job_1 = require("../../common/libraries/common.job");
15
+ const platform_constants_1 = require("../../config/platform.constants");
16
+ const maintenance_service_1 = require("../../platformUtility/services/maintenance.service");
17
+ const queue_service_1 = require("../../platformUtility/services/queue.service");
18
+ const sqs_service_1 = require("../../platformUtility/services/sqs.service");
19
+ const property_service_1 = require("../services/property.service");
20
+ let SqsPollingJob = class SqsPollingJob extends common_job_1.CommonJob {
21
+ constructor(queueService, propertyService, sqsService, maintenanceService) {
22
+ super('844b338ab982fd3e1cf1cea14cfc361d');
23
+ this.queueService = queueService;
24
+ this.propertyService = propertyService;
25
+ this.sqsService = sqsService;
26
+ this.maintenanceService = maintenanceService;
27
+ this.noDuplicate = true;
28
+ this.isFifo = false;
29
+ this.sqsQueue = '';
30
+ this.priority = 4;
31
+ this.timeout = 600000;
32
+ }
33
+ async handle(slug) {
34
+ await this.init(slug);
35
+ if (!this.sqsQueue)
36
+ return;
37
+ const startTime = Date.now();
38
+ const fetchCount = this.isFifo ? 1 : 10;
39
+ while (true) {
40
+ const response = await this.sqsService.get(this.sqsQueue, fetchCount);
41
+ if (!(response?.Messages && Array.isArray(response.Messages)))
42
+ return;
43
+ await this.processMessages(response.Messages);
44
+ if (this.maintenanceService.runtimeLock)
45
+ return;
46
+ if (this.maintenanceService.isInMaintenance)
47
+ return;
48
+ if (Date.now() - startTime > this.timeout * 0.9)
49
+ return;
50
+ }
51
+ }
52
+ async processMessages(messages) {
53
+ for (const message of messages) {
54
+ await this.processMessage(message);
55
+ }
56
+ }
57
+ async processMessage(message) {
58
+ const data = JSON.parse(message.Body);
59
+ const name = data?.name || '';
60
+ this.logger.log(`[Processing SQS] ${this.sqsQueue} : ${message.MessageId} : ${name} `);
61
+ await this.sqsService.delete(this.sqsQueue, message.ReceiptHandle);
62
+ return platform_constants_1.default.jobs[name].handle(data);
63
+ }
64
+ async init(slug) {
65
+ this.sqsQueue = await this.propertyService.get(`sqs.${slug}.url`);
66
+ if (!this.sqsQueue)
67
+ return;
68
+ this.isFifo = this.sqsQueue.split('.').pop()?.toLowerCase() === 'fifo';
69
+ }
70
+ };
71
+ exports.SqsPollingJob = SqsPollingJob;
72
+ exports.SqsPollingJob = SqsPollingJob = __decorate([
73
+ (0, common_1.Injectable)(),
74
+ __metadata("design:paramtypes", [queue_service_1.QueueService,
75
+ property_service_1.PropertyService,
76
+ sqs_service_1.SqsService,
77
+ maintenance_service_1.MaintenanceService])
78
+ ], SqsPollingJob);
79
+ //# sourceMappingURL=sqs.polling.job.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file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AAE,WAAW,EAAE,KAAK,MAAM,CAAC;IAC3E,CAAC;CACJ,CAAA;AAzDY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;qCAU4B,4BAAY;QACX,kCAAe;QACpB,wBAAU;QACA,wCAAkB;GAZpD,aAAa,CAyDzB"}
@@ -15,8 +15,10 @@ import { RefreshPropertyCacheJob } from '../jobs/refresh.property.cache.job';
15
15
  import { RelationshipMapperJob } from '../jobs/relationship.mapper.job';
16
16
  import { ReportColumnSyncJob } from '../jobs/report.column.sync.job';
17
17
  import { ScheduledEventJob } from '../jobs/scheduled.event.job';
18
+ import { SetEventQueueJob } from '../jobs/set.event.queue.job';
18
19
  import { SetScheduledEventJob } from '../jobs/set.scheduled.event.job';
19
20
  import { SmsMessageJob } from '../jobs/sms.message.job';
21
+ import { SqsPollingJob } from '../jobs/sqs.polling.job';
20
22
  import { UserGroupMemberJob } from '../jobs/user.group.member.job';
21
23
  import { UserGroupPermissionJob } from '../jobs/user.group.permission.job';
22
24
  import { UserGroupRoleJob } from '../jobs/user.group.role.job';
@@ -38,13 +40,15 @@ export declare class Es6JobsService {
38
40
  private readonly relationshipMapperJob;
39
41
  private readonly reportColumnSyncJob;
40
42
  private readonly scheduledEventJob;
43
+ private readonly setEventQueueJob;
41
44
  private readonly setScheduledEventJob;
42
45
  private readonly smsMessageJob;
46
+ private readonly sqsPollingJob;
43
47
  private readonly userGroupMemberJob;
44
48
  private readonly userGroupPermissionJob;
45
49
  private readonly userGroupRoleJob;
46
50
  private jobs;
47
- constructor(cleanScheduledEventJob: CleanScheduledEventJob, clientCredentialJob: ClientCredentialJob, clientJob: ClientJob, columnMapperJob: ColumnMapperJob, commentJob: CommentJob, credentialIpJob: CredentialIpJob, documentJob: DocumentJob, mailEventJob: MailEventJob, mailRecipientJob: MailRecipientJob, mailValidationJob: MailValidationJob, mobileValidationJob: MobileValidationJob, modelScannerJob: ModelScannerJob, propertyJob: PropertyJob, refreshPropertyCacheJob: RefreshPropertyCacheJob, relationshipMapperJob: RelationshipMapperJob, reportColumnSyncJob: ReportColumnSyncJob, scheduledEventJob: ScheduledEventJob, setScheduledEventJob: SetScheduledEventJob, smsMessageJob: SmsMessageJob, userGroupMemberJob: UserGroupMemberJob, userGroupPermissionJob: UserGroupPermissionJob, userGroupRoleJob: UserGroupRoleJob);
51
+ constructor(cleanScheduledEventJob: CleanScheduledEventJob, clientCredentialJob: ClientCredentialJob, clientJob: ClientJob, columnMapperJob: ColumnMapperJob, commentJob: CommentJob, credentialIpJob: CredentialIpJob, documentJob: DocumentJob, mailEventJob: MailEventJob, mailRecipientJob: MailRecipientJob, mailValidationJob: MailValidationJob, mobileValidationJob: MobileValidationJob, modelScannerJob: ModelScannerJob, propertyJob: PropertyJob, refreshPropertyCacheJob: RefreshPropertyCacheJob, relationshipMapperJob: RelationshipMapperJob, reportColumnSyncJob: ReportColumnSyncJob, scheduledEventJob: ScheduledEventJob, setEventQueueJob: SetEventQueueJob, setScheduledEventJob: SetScheduledEventJob, smsMessageJob: SmsMessageJob, sqsPollingJob: SqsPollingJob, userGroupMemberJob: UserGroupMemberJob, userGroupPermissionJob: UserGroupPermissionJob, userGroupRoleJob: UserGroupRoleJob);
48
52
  alignJobs(): void;
49
53
  setJobs(): void;
50
54
  }
@@ -28,14 +28,16 @@ const refresh_property_cache_job_1 = require("../jobs/refresh.property.cache.job
28
28
  const relationship_mapper_job_1 = require("../jobs/relationship.mapper.job");
29
29
  const report_column_sync_job_1 = require("../jobs/report.column.sync.job");
30
30
  const scheduled_event_job_1 = require("../jobs/scheduled.event.job");
31
+ const set_event_queue_job_1 = require("../jobs/set.event.queue.job");
31
32
  const set_scheduled_event_job_1 = require("../jobs/set.scheduled.event.job");
32
33
  const sms_message_job_1 = require("../jobs/sms.message.job");
34
+ const sqs_polling_job_1 = require("../jobs/sqs.polling.job");
33
35
  const user_group_member_job_1 = require("../jobs/user.group.member.job");
34
36
  const user_group_permission_job_1 = require("../jobs/user.group.permission.job");
35
37
  const user_group_role_job_1 = require("../jobs/user.group.role.job");
36
38
  const platform_utility_1 = require("../../common/libraries/platform.utility");
37
39
  let Es6JobsService = class Es6JobsService {
38
- constructor(cleanScheduledEventJob, clientCredentialJob, clientJob, columnMapperJob, commentJob, credentialIpJob, documentJob, mailEventJob, mailRecipientJob, mailValidationJob, mobileValidationJob, modelScannerJob, propertyJob, refreshPropertyCacheJob, relationshipMapperJob, reportColumnSyncJob, scheduledEventJob, setScheduledEventJob, smsMessageJob, userGroupMemberJob, userGroupPermissionJob, userGroupRoleJob) {
40
+ constructor(cleanScheduledEventJob, clientCredentialJob, clientJob, columnMapperJob, commentJob, credentialIpJob, documentJob, mailEventJob, mailRecipientJob, mailValidationJob, mobileValidationJob, modelScannerJob, propertyJob, refreshPropertyCacheJob, relationshipMapperJob, reportColumnSyncJob, scheduledEventJob, setEventQueueJob, setScheduledEventJob, smsMessageJob, sqsPollingJob, userGroupMemberJob, userGroupPermissionJob, userGroupRoleJob) {
39
41
  this.cleanScheduledEventJob = cleanScheduledEventJob;
40
42
  this.clientCredentialJob = clientCredentialJob;
41
43
  this.clientJob = clientJob;
@@ -53,8 +55,10 @@ let Es6JobsService = class Es6JobsService {
53
55
  this.relationshipMapperJob = relationshipMapperJob;
54
56
  this.reportColumnSyncJob = reportColumnSyncJob;
55
57
  this.scheduledEventJob = scheduledEventJob;
58
+ this.setEventQueueJob = setEventQueueJob;
56
59
  this.setScheduledEventJob = setScheduledEventJob;
57
60
  this.smsMessageJob = smsMessageJob;
61
+ this.sqsPollingJob = sqsPollingJob;
58
62
  this.userGroupMemberJob = userGroupMemberJob;
59
63
  this.userGroupPermissionJob = userGroupPermissionJob;
60
64
  this.userGroupRoleJob = userGroupRoleJob;
@@ -81,8 +85,10 @@ let Es6JobsService = class Es6JobsService {
81
85
  '64724c02cc076f23566976dc765eb6b6': this.relationshipMapperJob,
82
86
  '7676ffc477bc85ccfd8418b70f2377c9': this.reportColumnSyncJob,
83
87
  bb97644f2c505dc135d01f4c6959ec1f: this.scheduledEventJob,
88
+ eedbbd37e8ca956ab13f24b5028aaa83: this.setEventQueueJob,
84
89
  '40d4fd2c9c09856b54d90643c5f03171': this.setScheduledEventJob,
85
90
  '568a28e3b79c7a722c9ec0d0b55515c6': this.smsMessageJob,
91
+ '844b338ab982fd3e1cf1cea14cfc361d': this.sqsPollingJob,
86
92
  bf1fee009fc168b17af954099311394e: this.userGroupMemberJob,
87
93
  '8a125595f1811f55136f9317a929eb60': this.userGroupPermissionJob,
88
94
  '12b346ca5184797168e1d1c0267b58a5': this.userGroupRoleJob,
@@ -112,8 +118,10 @@ exports.Es6JobsService = Es6JobsService = __decorate([
112
118
  relationship_mapper_job_1.RelationshipMapperJob,
113
119
  report_column_sync_job_1.ReportColumnSyncJob,
114
120
  scheduled_event_job_1.ScheduledEventJob,
121
+ set_event_queue_job_1.SetEventQueueJob,
115
122
  set_scheduled_event_job_1.SetScheduledEventJob,
116
123
  sms_message_job_1.SmsMessageJob,
124
+ sqs_polling_job_1.SqsPollingJob,
117
125
  user_group_member_job_1.UserGroupMemberJob,
118
126
  user_group_permission_job_1.UserGroupPermissionJob,
119
127
  user_group_role_job_1.UserGroupRoleJob])
@@ -1 +1 @@
1
- {"version":3,"file":"es6.jobs.service.js","sourceRoot":"","sources":["../../../src/system/services/es6.jobs.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,iFAA2E;AAC3E,yEAAoE;AACpE,mDAA+C;AAC/C,iEAA4D;AAC5D,qDAAiD;AACjD,iEAA4D;AAC5D,uDAAmD;AACnD,2DAAsD;AACtD,mEAA8D;AAC9D,qEAAgE;AAChE,yEAAoE;AACpE,iEAA4D;AAC5D,uDAAmD;AACnD,mFAA6E;AAC7E,6EAAwE;AACxE,2EAAqE;AACrE,qEAAgE;AAChE,6EAAuE;AACvE,6DAAwD;AACxD,yEAAmE;AACnE,iFAA2E;AAC3E,qEAA+D;AAC/D,8EAA0E;AAQnE,IAAM,cAAc,GAApB,MAA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,2CAAmB;QACvB,mCAAe;QACnB,0BAAW;QACC,oDAAuB;QACzB,+CAAqB;QACvB,4CAAmB;QACrB,uCAAiB;QACd,8CAAoB;QAC3B,+BAAa;QACR,0CAAkB;QACd,kDAAsB;QAC5B,sCAAgB;GAzB9C,cAAc,CAqE1B"}
1
+ {"version":3,"file":"es6.jobs.service.js","sourceRoot":"","sources":["../../../src/system/services/es6.jobs.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,iFAA2E;AAC3E,yEAAoE;AACpE,mDAA+C;AAC/C,iEAA4D;AAC5D,qDAAiD;AACjD,iEAA4D;AAC5D,uDAAmD;AACnD,2DAAsD;AACtD,mEAA8D;AAC9D,qEAAgE;AAChE,yEAAoE;AACpE,iEAA4D;AAC5D,uDAAmD;AACnD,mFAA6E;AAC7E,6EAAwE;AACxE,2EAAqE;AACrE,qEAAgE;AAChE,qEAA+D;AAC/D,6EAAuE;AACvE,6DAAwD;AACxD,6DAAwD;AACxD,yEAAmE;AACnE,iFAA2E;AAC3E,qEAA+D;AAC/D,8EAA0E;AAQnE,IAAM,cAAc,GAApB,MAAM,cAAc;IAGvB,YACqB,sBAA8C,EAC9C,mBAAwC,EACxC,SAAoB,EACpB,eAAgC,EAChC,UAAsB,EACtB,eAAgC,EAChC,WAAwB,EACxB,YAA0B,EAC1B,gBAAkC,EAClC,iBAAoC,EACpC,mBAAwC,EACxC,eAAgC,EAChC,WAAwB,EACxB,uBAAgD,EAChD,qBAA4C,EAC5C,mBAAwC,EACxC,iBAAoC,EACpC,gBAAkC,EAClC,oBAA0C,EAC1C,aAA4B,EAC5B,aAA4B,EAC5B,kBAAsC,EACtC,sBAA8C,EAC9C,gBAAkC;QAvBlC,2BAAsB,GAAtB,sBAAsB,CAAwB;QAC9C,wBAAmB,GAAnB,mBAAmB,CAAqB;QACxC,cAAS,GAAT,SAAS,CAAW;QACpB,oBAAe,GAAf,eAAe,CAAiB;QAChC,eAAU,GAAV,UAAU,CAAY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YAC1D,gCAAgC,EAAE,IAAI,CAAC,mBAAmB;YAC1D,kCAAkC,EAAE,IAAI,CAAC,eAAe;YACxD,kCAAkC,EAAE,IAAI,CAAC,WAAW;YACpD,gCAAgC,EAAE,IAAI,CAAC,uBAAuB;YAC9D,kCAAkC,EAAE,IAAI,CAAC,qBAAqB;YAC9D,kCAAkC,EAAE,IAAI,CAAC,mBAAmB;YAC5D,gCAAgC,EAAE,IAAI,CAAC,iBAAiB;YACxD,gCAAgC,EAAE,IAAI,CAAC,gBAAgB;YACvD,kCAAkC,EAAE,IAAI,CAAC,oBAAoB;YAC7D,kCAAkC,EAAE,IAAI,CAAC,aAAa;YACtD,kCAAkC,EAAE,IAAI,CAAC,aAAa;YACtD,gCAAgC,EAAE,IAAI,CAAC,kBAAkB;YACzD,kCAAkC,EAAE,IAAI,CAAC,sBAAsB;YAC/D,kCAAkC,EAAE,IAAI,CAAC,gBAAgB;SAC5D,CAAC;IACN,CAAC;IAMD,OAAO;QACH,kCAAe,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;CACJ,CAAA;AAzEY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;qCAKoC,kDAAsB;QACzB,2CAAmB;QAC7B,sBAAS;QACH,mCAAe;QACpB,wBAAU;QACL,mCAAe;QACnB,0BAAW;QACV,6BAAY;QACR,qCAAgB;QACf,uCAAiB;QACf,2CAAmB;QACvB,mCAAe;QACnB,0BAAW;QACC,oDAAuB;QACzB,+CAAqB;QACvB,4CAAmB;QACrB,uCAAiB;QAClB,sCAAgB;QACZ,8CAAoB;QAC3B,+BAAa;QACb,+BAAa;QACR,0CAAkB;QACd,kDAAsB;QAC5B,sCAAgB;GA3B9C,cAAc,CAyE1B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicelabsco/nestjs-utility-services",
3
- "version": "1.2.97",
3
+ "version": "1.2.98",
4
4
  "description": "NestJS generic packages to support development",
5
5
  "author": "Hemant Kumar Sah <hemantanshu@gmail.com>",
6
6
  "license": "MIT",
@@ -55,7 +55,7 @@
55
55
  "@aws-sdk/s3-request-presigner": "^3.414.0",
56
56
  "@aws-sdk/util-dynamodb": "^3.414.0",
57
57
  "@nestjs/axios": "^3.0.0",
58
- "@nestjs/bull": "^10.0.1",
58
+ "@nestjs/bullmq": "^10.2.1",
59
59
  "@nestjs/cache-manager": "^2.1.0",
60
60
  "@nestjs/common": "^10.0.0",
61
61
  "@nestjs/config": "^3.1.1",
@@ -72,7 +72,7 @@
72
72
  "@socket.io/redis-adapter": "^8.2.1",
73
73
  "axios": "^1.5.0",
74
74
  "bcryptjs": "^2.4.3",
75
- "bull": "^4.11.3",
75
+ "bullmq": "^5.20.0",
76
76
  "cache-manager": "^3.6.0",
77
77
  "cache-manager-redis-store": "^2.0.0",
78
78
  "class-transformer": "^0.5.1",
@@ -87,6 +87,7 @@
87
87
  "express-rate-limit": "^7.0.1",
88
88
  "handlebars": "^4.7.8",
89
89
  "helmet": "^7.0.0",
90
+ "html-to-text": "^9.0.5",
90
91
  "md5": "^2.3.0",
91
92
  "nestjs-command": "^3.1.4",
92
93
  "nestjs-console": "^9.0.0",
@@ -106,6 +107,7 @@
106
107
  "@nestjs/schematics": "^10.0.0",
107
108
  "@nestjs/testing": "^10.0.0",
108
109
  "@types/express": "^4.17.17",
110
+ "@types/html-to-text": "^9.0.4",
109
111
  "@types/jest": "^29.5.2",
110
112
  "@types/multer": "^1.4.7",
111
113
  "@types/node": "^20.3.1",
@@ -1,17 +0,0 @@
1
- import { Job } from 'bull';
2
- import { QueueService } from '../services/queue.service';
3
- import { MaintenanceService } from '../services/maintenance.service';
4
- export declare class EventConsumer {
5
- private readonly queueService;
6
- private readonly maintenanceService;
7
- private logger;
8
- constructor(queueService: QueueService, maintenanceService: MaintenanceService);
9
- activeEvent(job: Job): Promise<void>;
10
- completionEvent(job: Job): Promise<void>;
11
- failureEvent(job: Job): Promise<void>;
12
- queueStalled(): Promise<void>;
13
- queueResumed(): Promise<void>;
14
- setActiveRecord(job: Job): void;
15
- setCompletedRecord(job: Job): void;
16
- private getJobName;
17
- }
@@ -1,101 +0,0 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.EventConsumer = void 0;
13
- const bull_1 = require("@nestjs/bull");
14
- const common_1 = require("@nestjs/common");
15
- const date_util_1 = require("../../common/libraries/date.util");
16
- const platform_constants_1 = require("../../config/platform.constants");
17
- const queue_service_1 = require("../services/queue.service");
18
- const maintenance_service_1 = require("../services/maintenance.service");
19
- const queue = platform_constants_1.default.queue;
20
- let EventConsumer = class EventConsumer {
21
- constructor(queueService, maintenanceService) {
22
- this.queueService = queueService;
23
- this.maintenanceService = maintenanceService;
24
- this.logger = new common_1.Logger('QueueManager');
25
- }
26
- async activeEvent(job) {
27
- this.setActiveRecord(job);
28
- await this.maintenanceService.disableQueueIfRequired();
29
- }
30
- async completionEvent(job) {
31
- this.logger.log(`[${job.queue.name}][ Processed ] ${job.id} : ${this.getJobName(job)} : ${job.finishedOn - job.processedOn} ms`);
32
- ++this.queueService.data.stats.completed_jobs;
33
- this.setCompletedRecord(job);
34
- await this.maintenanceService.disableQueueIfRequired();
35
- }
36
- async failureEvent(job) {
37
- this.logger.error(`[${job.queue.name}][ Failure ] ${job.id} : ${this.getJobName(job)} `);
38
- ++this.queueService.data.stats.failed_jobs;
39
- this.setCompletedRecord(job);
40
- await this.maintenanceService.disableQueueIfRequired();
41
- }
42
- async queueStalled() {
43
- this.logger.warn('Queue has been stalled');
44
- }
45
- async queueResumed() {
46
- this.logger.log(`Queue has been resumed`);
47
- await this.maintenanceService.disableQueueIfRequired();
48
- }
49
- setActiveRecord(job) {
50
- this.logger.log(`[${job.queue.name}][ Processing] ${job.id} : ${this.getJobName(job)} `);
51
- this.queueService.data.active_jobs[job.id] = {
52
- name: job.name,
53
- start_time: date_util_1.DateUtil.getDateTime(),
54
- };
55
- ++this.queueService.data.stats.pending_jobs;
56
- }
57
- setCompletedRecord(job) {
58
- delete this.queueService.data.active_jobs[job.id];
59
- --this.queueService.data.stats.pending_jobs;
60
- }
61
- getJobName(job) {
62
- return job.name === 'generic.job.trigger' ? job.data.name : job.name;
63
- }
64
- };
65
- exports.EventConsumer = EventConsumer;
66
- __decorate([
67
- (0, bull_1.OnQueueActive)(),
68
- __metadata("design:type", Function),
69
- __metadata("design:paramtypes", [Object]),
70
- __metadata("design:returntype", Promise)
71
- ], EventConsumer.prototype, "activeEvent", null);
72
- __decorate([
73
- (0, bull_1.OnQueueCompleted)(),
74
- __metadata("design:type", Function),
75
- __metadata("design:paramtypes", [Object]),
76
- __metadata("design:returntype", Promise)
77
- ], EventConsumer.prototype, "completionEvent", null);
78
- __decorate([
79
- (0, bull_1.OnQueueFailed)(),
80
- __metadata("design:type", Function),
81
- __metadata("design:paramtypes", [Object]),
82
- __metadata("design:returntype", Promise)
83
- ], EventConsumer.prototype, "failureEvent", null);
84
- __decorate([
85
- (0, bull_1.OnQueuePaused)(),
86
- __metadata("design:type", Function),
87
- __metadata("design:paramtypes", []),
88
- __metadata("design:returntype", Promise)
89
- ], EventConsumer.prototype, "queueStalled", null);
90
- __decorate([
91
- (0, bull_1.OnQueueResumed)(),
92
- __metadata("design:type", Function),
93
- __metadata("design:paramtypes", []),
94
- __metadata("design:returntype", Promise)
95
- ], EventConsumer.prototype, "queueResumed", null);
96
- exports.EventConsumer = EventConsumer = __decorate([
97
- (0, bull_1.Processor)(queue),
98
- __metadata("design:paramtypes", [queue_service_1.QueueService,
99
- maintenance_service_1.MaintenanceService])
100
- ], EventConsumer);
101
- //# sourceMappingURL=event.consumer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"event.consumer.js","sourceRoot":"","sources":["../../../src/platformUtility/consumers/event.consumer.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uCAAwH;AACxH,2CAAwC;AAExC,gEAA4D;AAC5D,wEAAgE;AAChE,6DAAyD;AACzD,yEAAqE;AAErE,MAAM,KAAK,GAAG,4BAAiB,CAAC,KAAK,CAAC;AAQ/B,IAAM,aAAa,GAAnB,MAAM,aAAa;IAatB,YACqB,YAA0B,EAC1B,kBAAsC;QADtC,iBAAY,GAAZ,YAAY,CAAc;QAC1B,uBAAkB,GAAlB,kBAAkB,CAAoB;QARnD,WAAM,GAAW,IAAI,eAAM,CAAC,cAAc,CAAC,CAAC;IASjD,CAAC;IAQE,AAAN,KAAK,CAAC,WAAW,CAAC,GAAQ;QAEtB,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;QAC1B,MAAM,IAAI,CAAC,kBAAkB,CAAC,sBAAsB,EAAE,CAAC;IAC3D,CAAC;IASK,AAAN,KAAK,CAAC,eAAe,CAAC,GAAQ;QAE1B,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,kBAAkB,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,UAAU,GAAG,GAAG,CAAC,WAAW,KAAK,CAAC,CAAC;QAEjI,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC;QAC9C,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;QAC7B,MAA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