@servicelabsco/nestjs-utility-services 1.2.20 → 1.2.22

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 (44) hide show
  1. package/dist/common/libraries/platform.utility.js +2 -2
  2. package/dist/common/libraries/platform.utility.js.map +1 -1
  3. package/dist/migrations/1698026335959-AddActiveSysSmsTemplatesTable.ts.d.ts +5 -0
  4. package/dist/migrations/1698026335959-AddActiveSysSmsTemplatesTable.ts.js +15 -0
  5. package/dist/migrations/1698026335959-AddActiveSysSmsTemplatesTable.ts.js.map +1 -0
  6. package/dist/platformUtility/dtos/index.d.ts +2 -0
  7. package/dist/platformUtility/dtos/index.js +2 -0
  8. package/dist/platformUtility/dtos/index.js.map +1 -1
  9. package/dist/platformUtility/dtos/kaleyra.callback.payload.dto.d.ts +11 -0
  10. package/dist/platformUtility/dtos/kaleyra.callback.payload.dto.js +7 -0
  11. package/dist/platformUtility/dtos/kaleyra.callback.payload.dto.js.map +1 -0
  12. package/dist/platformUtility/dtos/set.sms.payload.dto.d.ts +8 -0
  13. package/dist/platformUtility/dtos/set.sms.payload.dto.js +47 -0
  14. package/dist/platformUtility/dtos/set.sms.payload.dto.js.map +1 -0
  15. package/dist/platformUtility/es6.classes.d.ts +7 -3
  16. package/dist/platformUtility/es6.classes.js +8 -0
  17. package/dist/platformUtility/es6.classes.js.map +1 -1
  18. package/dist/platformUtility/libraries/index.d.ts +2 -0
  19. package/dist/platformUtility/libraries/index.js +2 -0
  20. package/dist/platformUtility/libraries/index.js.map +1 -1
  21. package/dist/platformUtility/libraries/process.kaleyra.callback.response.d.ts +6 -0
  22. package/dist/platformUtility/libraries/process.kaleyra.callback.response.js +20 -0
  23. package/dist/platformUtility/libraries/process.kaleyra.callback.response.js.map +1 -0
  24. package/dist/platformUtility/libraries/process.kaleyra.sms.d.ts +1 -1
  25. package/dist/platformUtility/libraries/process.kaleyra.sms.js +18 -11
  26. package/dist/platformUtility/libraries/process.kaleyra.sms.js.map +1 -1
  27. package/dist/platformUtility/libraries/set.sms.message.d.ts +10 -0
  28. package/dist/platformUtility/libraries/set.sms.message.js +37 -0
  29. package/dist/platformUtility/libraries/set.sms.message.js.map +1 -0
  30. package/dist/platformUtility/platform.utility.module.js +2 -1
  31. package/dist/platformUtility/platform.utility.module.js.map +1 -1
  32. package/dist/platformUtility/services/sms.service.d.ts +5 -3
  33. package/dist/platformUtility/services/sms.service.js +8 -3
  34. package/dist/platformUtility/services/sms.service.js.map +1 -1
  35. package/dist/system/dtos/sms.message.attributes.dto.d.ts +1 -0
  36. package/dist/system/dtos/sms.message.attributes.dto.js.map +1 -1
  37. package/dist/system/entities/sms.template.entity.d.ts +1 -0
  38. package/dist/system/entities/sms.template.entity.js +4 -0
  39. package/dist/system/entities/sms.template.entity.js.map +1 -1
  40. package/dist/system/jobs/sms.message.job.d.ts +1 -4
  41. package/dist/system/jobs/sms.message.job.js +3 -15
  42. package/dist/system/jobs/sms.message.job.js.map +1 -1
  43. package/dist/tsconfig.build.tsbuildinfo +1 -1
  44. package/package.json +1 -1
@@ -106,9 +106,9 @@ class PlatformUtility {
106
106
  return true;
107
107
  }
108
108
  static replaceTemplate(template, payload) {
109
- const keys = Object.keys(payload);
109
+ const keys = Object.keys(payload || {});
110
110
  keys.forEach((key) => {
111
- template = template.replace(`{${key}}`, payload[key]);
111
+ template = template.replaceAll(`{{${key}}}`, payload[key]);
112
112
  });
113
113
  return template;
114
114
  }
@@ -1 +1 @@
1
- {"version":3,"file":"platform.utility.js","sourceRoot":"","sources":["../../../src/common/libraries/platform.utility.ts"],"names":[],"mappings":";;;AAAA,2CAAqC;AACrC,wEAAgE;AAQhE,MAAa,eAAe;IAOxB,MAAM,CAAC,mBAAmB;QACtB,OAAO,4BAAiB,CAAC;IAC7B,CAAC;IASD,MAAM,CAAC,OAAO,CAAC,GAAW;QACtB,IAAI,CAAC,GAAG;YAAE,OAAO,GAAG,CAAC;QAErB,OAAO,CAAC,GAAG,CAAC,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AAC,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAC7D,IAAI,CAAC,MAAM;YAAE,OAAO;QAEpB,OAAO,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAC1C,CAAC;CACJ;AAjTD,0CAiTC"}
@@ -0,0 +1,5 @@
1
+ import { MigrationUtility } from '../common/libraries/migration.utility';
2
+ export declare class AddActiveSysSmsTemplatesTable1698026335959 extends MigrationUtility {
3
+ constructor();
4
+ process(): void;
5
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AddActiveSysSmsTemplatesTable1698026335959 = void 0;
4
+ const migration_utility_1 = require("../common/libraries/migration.utility");
5
+ class AddActiveSysSmsTemplatesTable1698026335959 extends migration_utility_1.MigrationUtility {
6
+ constructor() {
7
+ super('sys_sms_templates');
8
+ this.process();
9
+ }
10
+ process() {
11
+ this.boolean('active');
12
+ }
13
+ }
14
+ exports.AddActiveSysSmsTemplatesTable1698026335959 = AddActiveSysSmsTemplatesTable1698026335959;
15
+ //# sourceMappingURL=1698026335959-AddActiveSysSmsTemplatesTable.ts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1698026335959-AddActiveSysSmsTemplatesTable.ts.js","sourceRoot":"","sources":["../../src/migrations/1698026335959-AddActiveSysSmsTemplatesTable.ts.ts"],"names":[],"mappings":";;;AAAA,6EAAyE;AAEzE,MAAa,0CAA2C,SAAQ,oCAAgB;IAC5E;QACI,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAC3B,IAAI,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;IAED,OAAO;QACH,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC;CACJ;AATD,gGASC"}
@@ -3,12 +3,14 @@ export * from './common.attributes.dto';
3
3
  export * from './failed.bull.job.attributes.dto';
4
4
  export * from './fcm.response.dto';
5
5
  export * from './job.payload.dto';
6
+ export * from './kaleyra.callback.payload.dto';
6
7
  export * from './mail.options.dto';
7
8
  export * from './pending.bull.job.attributes.dto';
8
9
  export * from './push.notification.response.dto';
9
10
  export * from './push.notification.template.dto';
10
11
  export * from './queue.options.dto';
11
12
  export * from './remote.raw.response.dto';
13
+ export * from './set.sms.payload.dto';
12
14
  export * from './sms.payload.dto';
13
15
  export * from './smtp.config.dto';
14
16
  export * from './source.column.dto';
@@ -19,12 +19,14 @@ __exportStar(require("./common.attributes.dto"), exports);
19
19
  __exportStar(require("./failed.bull.job.attributes.dto"), exports);
20
20
  __exportStar(require("./fcm.response.dto"), exports);
21
21
  __exportStar(require("./job.payload.dto"), exports);
22
+ __exportStar(require("./kaleyra.callback.payload.dto"), exports);
22
23
  __exportStar(require("./mail.options.dto"), exports);
23
24
  __exportStar(require("./pending.bull.job.attributes.dto"), exports);
24
25
  __exportStar(require("./push.notification.response.dto"), exports);
25
26
  __exportStar(require("./push.notification.template.dto"), exports);
26
27
  __exportStar(require("./queue.options.dto"), exports);
27
28
  __exportStar(require("./remote.raw.response.dto"), exports);
29
+ __exportStar(require("./set.sms.payload.dto"), exports);
28
30
  __exportStar(require("./sms.payload.dto"), exports);
29
31
  __exportStar(require("./smtp.config.dto"), exports);
30
32
  __exportStar(require("./source.column.dto"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platformUtility/dtos/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AAAA,0DAAwC;AAAA,mEAAiD;AAAA,qDAAmC;AAAA,oDAAkC;AAAA,qDAAmC;AAAA,oEAAkD;AAAA,mEAAiD;AAAA,mEAAiD;AAAA,sDAAoC;AAAA,4DAA0C;AAAA,oDAAkC;AAAA,oDAAkC;AAAA,sDAAoC;AAAA,sDAAmC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platformUtility/dtos/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AAAA,0DAAwC;AAAA,mEAAiD;AAAA,qDAAmC;AAAA,oDAAkC;AAAA,iEAA+C;AAAA,qDAAmC;AAAA,oEAAkD;AAAA,mEAAiD;AAAA,mEAAiD;AAAA,sDAAoC;AAAA,4DAA0C;AAAA,wDAAsC;AAAA,oDAAkC;AAAA,oDAAkC;AAAA,sDAAoC;AAAA,sDAAmC"}
@@ -0,0 +1,11 @@
1
+ export declare class KaleyraCallbackPayloadDto {
2
+ sent_time: string;
3
+ sender: string;
4
+ price: string;
5
+ length: string;
6
+ type: string;
7
+ id: string;
8
+ status: string;
9
+ message_id: string;
10
+ recipient: string;
11
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.KaleyraCallbackPayloadDto = void 0;
4
+ class KaleyraCallbackPayloadDto {
5
+ }
6
+ exports.KaleyraCallbackPayloadDto = KaleyraCallbackPayloadDto;
7
+ //# sourceMappingURL=kaleyra.callback.payload.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kaleyra.callback.payload.dto.js","sourceRoot":"","sources":["../../../src/platformUtility/dtos/kaleyra.callback.payload.dto.ts"],"names":[],"mappings":";;;AAAA,MAAa,yBAAyB;CAUrC;AAVD,8DAUC"}
@@ -0,0 +1,8 @@
1
+ import { SourceColumnDto } from './source.column.dto';
2
+ export declare class SetSmsPayloadDto {
3
+ source?: SourceColumnDto;
4
+ dialing_code?: number;
5
+ mobile: string;
6
+ template: string;
7
+ context?: Object;
8
+ }
@@ -0,0 +1,47 @@
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.SetSmsPayloadDto = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ const source_column_dto_1 = require("./source.column.dto");
16
+ class SetSmsPayloadDto {
17
+ }
18
+ exports.SetSmsPayloadDto = SetSmsPayloadDto;
19
+ __decorate([
20
+ (0, class_transformer_1.Expose)(),
21
+ (0, class_validator_1.IsOptional)(),
22
+ (0, class_validator_1.ValidateNested)(),
23
+ (0, class_transformer_1.Type)(() => source_column_dto_1.SourceColumnDto),
24
+ __metadata("design:type", source_column_dto_1.SourceColumnDto)
25
+ ], SetSmsPayloadDto.prototype, "source", void 0);
26
+ __decorate([
27
+ (0, class_transformer_1.Expose)(),
28
+ (0, class_validator_1.IsNumber)(),
29
+ (0, class_validator_1.IsOptional)(),
30
+ __metadata("design:type", Number)
31
+ ], SetSmsPayloadDto.prototype, "dialing_code", void 0);
32
+ __decorate([
33
+ (0, class_transformer_1.Expose)(),
34
+ (0, class_validator_1.IsNotEmpty)(),
35
+ __metadata("design:type", String)
36
+ ], SetSmsPayloadDto.prototype, "mobile", void 0);
37
+ __decorate([
38
+ (0, class_transformer_1.Expose)(),
39
+ (0, class_validator_1.IsNotEmpty)(),
40
+ __metadata("design:type", String)
41
+ ], SetSmsPayloadDto.prototype, "template", void 0);
42
+ __decorate([
43
+ (0, class_transformer_1.Expose)(),
44
+ (0, class_validator_1.IsOptional)(),
45
+ __metadata("design:type", Object)
46
+ ], SetSmsPayloadDto.prototype, "context", void 0);
47
+ //# sourceMappingURL=set.sms.payload.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set.sms.payload.dto.js","sourceRoot":"","sources":["../../../src/platformUtility/dtos/set.sms.payload.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAiD;AACjD,qDAAmF;AACnF,2DAAsD;AAEtD,MAAa,gBAAgB;CAuB5B;AAvBD,4CAuBC;AAlBG;IAJC,IAAA,0BAAM,GAAE;IACR,IAAA,4BAAU,GAAE;IACZ,IAAA,gCAAc,GAAE;IAChB,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,mCAAe,CAAC;8BACnB,mCAAe;gDAAC;AAKzB;IAHC,IAAA,0BAAM,GAAE;IACR,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;sDACS;AAItB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,4BAAU,GAAE;;gDACE;AAIf;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,4BAAU,GAAE;;kDACI;AAIjB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,4BAAU,GAAE;8BACH,MAAM;iDAAC"}
@@ -9,11 +9,13 @@ import { AwsConfigDto } from './dtos/aws.config.dto';
9
9
  import { CommonAttributesDto } from './dtos/common.attributes.dto';
10
10
  import { FcmResponseDto } from './dtos/fcm.response.dto';
11
11
  import { JobPayloadDto } from './dtos/job.payload.dto';
12
+ import { KaleyraCallbackPayloadDto } from './dtos/kaleyra.callback.payload.dto';
12
13
  import { MailOptionsDto } from './dtos/mail.options.dto';
13
14
  import { PushNotificationResponseDto } from './dtos/push.notification.response.dto';
14
15
  import { PushNotificationTemplateDto } from './dtos/push.notification.template.dto';
15
16
  import { QueueOptionsDto } from './dtos/queue.options.dto';
16
17
  import { RemoteRawResponseDto } from './dtos/remote.raw.response.dto';
18
+ import { SetSmsPayloadDto } from './dtos/set.sms.payload.dto';
17
19
  import { SmsPayloadDto } from './dtos/sms.payload.dto';
18
20
  import { SmtpConfigDto } from './dtos/smtp.config.dto';
19
21
  import { SourceColumnDto } from './dtos/source.column.dto';
@@ -33,8 +35,10 @@ import { CreateIndexFile } from './libraries/create.index.file';
33
35
  import { FileSystemUtility } from './libraries/file.system.utility';
34
36
  import { ProcessAuditLogData } from './libraries/process.audit.log.data';
35
37
  import { ProcessCommonMail } from './libraries/process.common.mail';
38
+ import { ProcessKaleyraCallbackResponse } from './libraries/process.kaleyra.callback.response';
36
39
  import { ProcessKaleyraSms } from './libraries/process.kaleyra.sms';
37
40
  import { ProcessSmtpMail } from './libraries/process.smtp.mail';
41
+ import { SetSmsMessage } from './libraries/set.sms.message';
38
42
  import { MaintenanceMiddleware } from './middlewares/maintenance.middleware';
39
43
  import { TrimPipe } from './middlewares/trim.pipe';
40
44
  import { AuditService } from './services/audit.service';
@@ -58,12 +62,12 @@ declare const es6Classes: {
58
62
  commands: (typeof MaintenanceCommand | typeof SqsWorkerCommand | typeof SyncClassCommand)[];
59
63
  consumers: (typeof EventConsumer | typeof JobConsumer)[];
60
64
  controllers: (typeof BullJobController | typeof QueueController)[];
61
- dtos: (typeof JobPayloadDto | typeof QueueOptionsDto | typeof SourceColumnDto | typeof CommonAttributesDto | typeof AwsConfigDto | typeof SmsPayloadDto | typeof RemoteRawResponseDto | typeof FcmResponseDto | typeof MailOptionsDto | typeof PushNotificationResponseDto | typeof PushNotificationTemplateDto | typeof SmtpConfigDto | typeof StringSearchDto)[];
65
+ dtos: (typeof JobPayloadDto | typeof QueueOptionsDto | typeof SourceColumnDto | typeof CommonAttributesDto | typeof AwsConfigDto | typeof FcmResponseDto | typeof KaleyraCallbackPayloadDto | typeof MailOptionsDto | typeof PushNotificationResponseDto | typeof PushNotificationTemplateDto | typeof RemoteRawResponseDto | typeof SetSmsPayloadDto | typeof SmsPayloadDto | typeof SmtpConfigDto | typeof StringSearchDto)[];
62
66
  entities: (typeof FailedBullJobEntity | typeof PendingBullJobEntity)[];
63
67
  jobs: (typeof LoadFailedBullJob | typeof RecordWatcherJob | typeof ReloadPendingBullJob | typeof TestJob)[];
64
- libraries: (typeof ProcessAuditLogData | typeof ProcessKaleyraSms | typeof CommonSqsPolling | typeof FileSystemUtility | typeof CreateEs6ClassesFile | typeof CreateEs6JobsFile | typeof CreateEntityConstantsFile | typeof CreateEs6ServiceFile | typeof CreateIndexFile | typeof ProcessCommonMail | typeof ProcessSmtpMail)[];
68
+ libraries: (typeof ProcessAuditLogData | typeof CommonSqsPolling | typeof FileSystemUtility | typeof CreateEs6ClassesFile | typeof CreateEs6JobsFile | typeof CreateEntityConstantsFile | typeof CreateEs6ServiceFile | typeof CreateIndexFile | typeof ProcessCommonMail | typeof ProcessKaleyraCallbackResponse | typeof ProcessKaleyraSms | typeof ProcessSmtpMail | typeof SetSmsMessage)[];
65
69
  middlewares: (typeof MaintenanceMiddleware | typeof TrimPipe)[];
66
- services: (typeof CacheService | typeof LocalPropertyService | typeof AwsConfigService | typeof SqsService | typeof QueueService | typeof SqlService | typeof DynamoService | typeof MaintenanceService | typeof AuditService | typeof RemoteRequestService | typeof SmsService | typeof Es6JobsService | typeof FcmNotificationService | typeof MailService | typeof ShutdownService | typeof StartupService)[];
70
+ services: (typeof CacheService | typeof LocalPropertyService | typeof AwsConfigService | typeof SqsService | typeof QueueService | typeof SqlService | typeof DynamoService | typeof MaintenanceService | typeof AuditService | typeof RemoteRequestService | typeof Es6JobsService | typeof FcmNotificationService | typeof MailService | typeof ShutdownService | typeof SmsService | typeof StartupService)[];
67
71
  subscribers: (typeof BaseSubscriber)[];
68
72
  };
69
73
  export default es6Classes;
@@ -12,12 +12,14 @@ const common_attributes_dto_1 = require("./dtos/common.attributes.dto");
12
12
  const failed_bull_job_attributes_dto_1 = require("./dtos/failed.bull.job.attributes.dto");
13
13
  const fcm_response_dto_1 = require("./dtos/fcm.response.dto");
14
14
  const job_payload_dto_1 = require("./dtos/job.payload.dto");
15
+ const kaleyra_callback_payload_dto_1 = require("./dtos/kaleyra.callback.payload.dto");
15
16
  const mail_options_dto_1 = require("./dtos/mail.options.dto");
16
17
  const pending_bull_job_attributes_dto_1 = require("./dtos/pending.bull.job.attributes.dto");
17
18
  const push_notification_response_dto_1 = require("./dtos/push.notification.response.dto");
18
19
  const push_notification_template_dto_1 = require("./dtos/push.notification.template.dto");
19
20
  const queue_options_dto_1 = require("./dtos/queue.options.dto");
20
21
  const remote_raw_response_dto_1 = require("./dtos/remote.raw.response.dto");
22
+ const set_sms_payload_dto_1 = require("./dtos/set.sms.payload.dto");
21
23
  const sms_payload_dto_1 = require("./dtos/sms.payload.dto");
22
24
  const smtp_config_dto_1 = require("./dtos/smtp.config.dto");
23
25
  const source_column_dto_1 = require("./dtos/source.column.dto");
@@ -37,8 +39,10 @@ const create_index_file_1 = require("./libraries/create.index.file");
37
39
  const file_system_utility_1 = require("./libraries/file.system.utility");
38
40
  const process_audit_log_data_1 = require("./libraries/process.audit.log.data");
39
41
  const process_common_mail_1 = require("./libraries/process.common.mail");
42
+ const process_kaleyra_callback_response_1 = require("./libraries/process.kaleyra.callback.response");
40
43
  const process_kaleyra_sms_1 = require("./libraries/process.kaleyra.sms");
41
44
  const process_smtp_mail_1 = require("./libraries/process.smtp.mail");
45
+ const set_sms_message_1 = require("./libraries/set.sms.message");
42
46
  const maintenance_middleware_1 = require("./middlewares/maintenance.middleware");
43
47
  const trim_pipe_1 = require("./middlewares/trim.pipe");
44
48
  const audit_service_1 = require("./services/audit.service");
@@ -68,12 +72,14 @@ const es6Classes = {
68
72
  failed_bull_job_attributes_dto_1.FailedBullJobAttributesDto,
69
73
  fcm_response_dto_1.FcmResponseDto,
70
74
  job_payload_dto_1.JobPayloadDto,
75
+ kaleyra_callback_payload_dto_1.KaleyraCallbackPayloadDto,
71
76
  mail_options_dto_1.MailOptionsDto,
72
77
  pending_bull_job_attributes_dto_1.PendingBullJobAttributesDto,
73
78
  push_notification_response_dto_1.PushNotificationResponseDto,
74
79
  push_notification_template_dto_1.PushNotificationTemplateDto,
75
80
  queue_options_dto_1.QueueOptionsDto,
76
81
  remote_raw_response_dto_1.RemoteRawResponseDto,
82
+ set_sms_payload_dto_1.SetSmsPayloadDto,
77
83
  sms_payload_dto_1.SmsPayloadDto,
78
84
  smtp_config_dto_1.SmtpConfigDto,
79
85
  source_column_dto_1.SourceColumnDto,
@@ -91,8 +97,10 @@ const es6Classes = {
91
97
  file_system_utility_1.FileSystemUtility,
92
98
  process_audit_log_data_1.ProcessAuditLogData,
93
99
  process_common_mail_1.ProcessCommonMail,
100
+ process_kaleyra_callback_response_1.ProcessKaleyraCallbackResponse,
94
101
  process_kaleyra_sms_1.ProcessKaleyraSms,
95
102
  process_smtp_mail_1.ProcessSmtpMail,
103
+ set_sms_message_1.SetSmsMessage,
96
104
  ],
97
105
  middlewares: [maintenance_middleware_1.MaintenanceMiddleware, trim_pipe_1.TrimPipe],
98
106
  services: [
@@ -1 +1 @@
1
- {"version":3,"file":"es6.classes.js","sourceRoot":"","sources":["../../src/platformUtility/es6.classes.ts"],"names":[],"mappings":";;AAAA,wEAAoE;AACpE,sEAAiE;AACjE,sEAAiE;AACjE,+DAA2D;AAC3D,2DAAuD;AACvD,2EAAsE;AACtE,qEAAiE;AACjE,0DAAqD;AACrD,wEAAmE;AACnE,0FAAmF;AACnF,8DAAyD;AACzD,4DAAuD;AACvD,8DAAyD;AACzD,4FAAqF;AACrF,0FAAoF;AACpF,0FAAoF;AACpF,gEAA2D;AAC3D,4EAAsE;AACtE,4DAAuD;AACvD,4DAAuD;AACvD,gEAA2D;AAC3D,gEAA2D;AAC3D,8EAAwE;AACxE,gFAA0E;AAC1E,sEAAgE;AAChE,kEAA6D;AAC7D,4EAAsE;AACtE,8CAA0C;AAC1C,uEAAkE;AAClE,2FAAqF;AACrF,iFAA2E;AAC3E,2EAAqE;AACrE,iFAA2E;AAC3E,qEAAgE;AAChE,yEAAoE;AACpE,+EAAyE;AACzE,yEAAoE;AACpE,yEAAoE;AACpE,qEAAgE;AAChE,iFAA6E;AAC7E,uDAAmD;AACnD,4DAAwD;AACxD,sEAAiE;AACjE,4DAAwD;AACxD,8DAA0D;AAC1D,kEAA6D;AAC7D,kFAA6E;AAC7E,8EAAyE;AACzE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C"}
1
+ {"version":3,"file":"es6.classes.js","sourceRoot":"","sources":["../../src/platformUtility/es6.classes.ts"],"names":[],"mappings":";;AAAA,wEAAoE;AACpE,sEAAiE;AACjE,sEAAiE;AACjE,+DAA2D;AAC3D,2DAAuD;AACvD,2EAAsE;AACtE,qEAAiE;AACjE,0DAAqD;AACrD,wEAAmE;AACnE,0FAAmF;AACnF,8DAAyD;AACzD,4DAAuD;AACvD,sFAAgF;AAChF,8DAAyD;AACzD,4FAAqF;AACrF,0FAAoF;AACpF,0FAAoF;AACpF,gEAA2D;AAC3D,4EAAsE;AACtE,oEAA8D;AAC9D,4DAAuD;AACvD,4DAAuD;AACvD,gEAA2D;AAC3D,gEAA2D;AAC3D,8EAAwE;AACxE,gFAA0E;AAC1E,sEAAgE;AAChE,kEAA6D;AAC7D,4EAAsE;AACtE,8CAA0C;AAC1C,uEAAkE;AAClE,2FAAqF;AACrF,iFAA2E;AAC3E,2EAAqE;AACrE,iFAA2E;AAC3E,qEAAgE;AAChE,yEAAoE;AACpE,+EAAyE;AACzE,yEAAoE;AACpE,qGAA+F;AAC/F,yEAAoE;AACpE,qEAAgE;AAChE,iEAA4D;AAC5D,iFAA6E;AAC7E,uDAAmD;AACnD,4DAAwD;AACxD,sEAAiE;AACjE,4DAAwD;AACxD,8DAA0D;AAC1D,kEAA6D;AAC7D,kFAA6E;AAC7E,8EAAyE;AACzE,0DAAsD;AACtD,wEAAoE;AACpE,4DAAwD;AACxD,8EAAyE;AACzE,kEAA8D;AAC9D,wDAAoD;AACpD,wDAAoD;AACpD,wDAAoD;AACpD,gEAA4D;AAC5D,mEAA+D;AAE/D,MAAM,UAAU,GAAG;IACf,QAAQ,EAAE,CAAC,wCAAkB,EAAE,qCAAgB,EAAE,qCAAgB,CAAC;IAClE,SAAS,EAAE,CAAC,8BAAa,EAAE,0BAAW,CAAC;IACvC,WAAW,EAAE,CAAC,uCAAiB,EAAE,kCAAe,CAAC;IACjD,IAAI,EAAE;QACF,6BAAY;QACZ,2CAAmB;QACnB,2DAA0B;QAC1B,iCAAc;QACd,+BAAa;QACb,wDAAyB;QACzB,iCAAc;QACd,6DAA2B;QAC3B,4DAA2B;QAC3B,4DAA2B;QAC3B,mCAAe;QACf,8CAAoB;QACpB,sCAAgB;QAChB,+BAAa;QACb,+BAAa;QACb,mCAAe;QACf,mCAAe;KAClB;IACD,QAAQ,EAAE,CAAC,4CAAmB,EAAE,8CAAoB,CAAC;IACrD,IAAI,EAAE,CAAC,wCAAiB,EAAE,qCAAgB,EAAE,8CAAoB,EAAE,kBAAO,CAAC;IAC1E,SAAS,EAAE;QACP,qCAAgB;QAChB,wDAAyB;QACzB,8CAAoB;QACpB,wCAAiB;QACjB,8CAAoB;QACpB,mCAAe;QACf,uCAAiB;QACjB,4CAAmB;QACnB,uCAAiB;QACjB,kEAA8B;QAC9B,uCAAiB;QACjB,mCAAe;QACf,+BAAa;KAChB;IACD,WAAW,EAAE,CAAC,8CAAqB,EAAE,oBAAQ,CAAC;IAC9C,QAAQ,EAAE;QACN,4BAAY;QACZ,qCAAgB;QAChB,4BAAY;QACZ,8BAAa;QACb,iCAAc;QACd,iDAAsB;QACtB,6CAAoB;QACpB,0BAAW;QACX,wCAAkB;QAClB,4BAAY;QACZ,6CAAoB;QACpB,kCAAe;QACf,wBAAU;QACV,wBAAU;QACV,wBAAU;QACV,gCAAc;KACjB;IACD,WAAW,EAAE,CAAC,gCAAc,CAAC;CAChC,CAAC;AAEF,kBAAe,UAAU,CAAC"}
@@ -7,5 +7,7 @@ export * from './create.index.file';
7
7
  export * from './file.system.utility';
8
8
  export * from './process.audit.log.data';
9
9
  export * from './process.common.mail';
10
+ export * from './process.kaleyra.callback.response';
10
11
  export * from './process.kaleyra.sms';
11
12
  export * from './process.smtp.mail';
13
+ export * from './set.sms.message';
@@ -23,6 +23,8 @@ __exportStar(require("./create.index.file"), exports);
23
23
  __exportStar(require("./file.system.utility"), exports);
24
24
  __exportStar(require("./process.audit.log.data"), exports);
25
25
  __exportStar(require("./process.common.mail"), exports);
26
+ __exportStar(require("./process.kaleyra.callback.response"), exports);
26
27
  __exportStar(require("./process.kaleyra.sms"), exports);
27
28
  __exportStar(require("./process.smtp.mail"), exports);
29
+ __exportStar(require("./set.sms.message"), exports);
28
30
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platformUtility/libraries/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AAAA,iEAA+C;AAAA,4DAA0C;AAAA,yDAAuC;AAAA,4DAA0C;AAAA,sDAAoC;AAAA,wDAAsC;AAAA,2DAAyC;AAAA,wDAAsC;AAAA,wDAAsC;AAAA,sDAAmC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platformUtility/libraries/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AAAA,iEAA+C;AAAA,4DAA0C;AAAA,yDAAuC;AAAA,4DAA0C;AAAA,sDAAoC;AAAA,wDAAsC;AAAA,2DAAyC;AAAA,wDAAsC;AAAA,sEAAoD;AAAA,wDAAsC;AAAA,sDAAoC;AAAA,oDAAiC"}
@@ -0,0 +1,6 @@
1
+ import { SmsMessageEntity } from '../../system/entities/sms.message.entity';
2
+ import { KaleyraCallbackPayloadDto } from '../dtos/kaleyra.callback.payload.dto';
3
+ export declare class ProcessKaleyraCallbackResponse {
4
+ process(payload: KaleyraCallbackPayloadDto): Promise<SmsMessageEntity>;
5
+ private setUTCDate;
6
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProcessKaleyraCallbackResponse = void 0;
4
+ const date_fns_1 = require("date-fns");
5
+ const sms_message_entity_1 = require("../../system/entities/sms.message.entity");
6
+ class ProcessKaleyraCallbackResponse {
7
+ async process(payload) {
8
+ const message = await sms_message_entity_1.SmsMessageEntity.findOne({ where: { gateway_id: 1, identifier: payload.message_id } });
9
+ if (payload.status.toLowerCase() !== 'delivered')
10
+ return;
11
+ message.delivered_on = this.setUTCDate(new Date(payload.sent_time));
12
+ return message.save();
13
+ }
14
+ setUTCDate(date) {
15
+ const systemOffset = new Date().getTimezoneOffset();
16
+ return (0, date_fns_1.subMinutes)(date, systemOffset);
17
+ }
18
+ }
19
+ exports.ProcessKaleyraCallbackResponse = ProcessKaleyraCallbackResponse;
20
+ //# sourceMappingURL=process.kaleyra.callback.response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process.kaleyra.callback.response.js","sourceRoot":"","sources":["../../../src/platformUtility/libraries/process.kaleyra.callback.response.ts"],"names":[],"mappings":";;;AAAA,uCAAsC;AACtC,iFAA4E;AAG5E,MAAa,8BAA8B;IACvC,KAAK,CAAC,OAAO,CAAC,OAAkC;QAC5C,MAAM,OAAO,GAAG,MAAM,qCAAgB,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QAE7G,IAAI,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,WAAW;YAAE,OAAO;QACzD,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;QAEpE,OAAO,OAAO,CAAC,IAAI,EAAE,CAAC;IAC1B,CAAC;IAEO,UAAU,CAAC,IAAU;QACzB,MAAM,YAAY,GAAG,IAAI,IAAI,EAAE,CAAC,iBAAiB,EAAE,CAAC;QAEpD,OAAO,IAAA,qBAAU,EAAC,IAAI,EAAE,YAAY,CAAC,CAAC;IAC1C,CAAC;CACJ;AAfD,wEAeC"}
@@ -6,7 +6,7 @@ export declare class ProcessKaleyraSms {
6
6
  private readonly remoteRequestService;
7
7
  private readonly propertyService;
8
8
  constructor(remoteRequestService: RemoteRequestService, propertyService: PropertyService);
9
- send(data: SmsPayloadDto): Promise<any>;
9
+ send(data: SmsPayloadDto): Promise<import("..").RemoteRawResponseDto | SmsPayloadDto>;
10
10
  sendSms(message: SmsMessageEntity): Promise<SmsMessageEntity | "test-environment here">;
11
11
  private trigger;
12
12
  }
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ProcessKaleyraSms = void 0;
4
4
  const qs = require("qs");
5
- const sms_template_entity_1 = require("../../system/entities/sms.template.entity");
6
5
  const operation_exception_1 = require("../../common/exceptions/operation.exception");
7
6
  const platform_utility_1 = require("../../common/libraries/platform.utility");
7
+ const sms_template_entity_1 = require("../../system/entities/sms.template.entity");
8
8
  class ProcessKaleyraSms {
9
9
  constructor(remoteRequestService, propertyService) {
10
10
  this.remoteRequestService = remoteRequestService;
@@ -21,38 +21,45 @@ class ProcessKaleyraSms {
21
21
  const template = await sms_template_entity_1.SmsTemplateEntity.first(message.template_id);
22
22
  template.message = message.content;
23
23
  const payload = { mobile: message.mobile, template, content: message.content };
24
- const identifier = await this.trigger(payload);
25
- message.identifier = identifier;
24
+ const response = await this.trigger(payload);
25
+ global.console.log('response', response);
26
+ if (Array.isArray(response?.data?.data)) {
27
+ message.identifier = response?.data?.data[0].message_id;
28
+ }
29
+ else {
30
+ message.attributes = { ...message.attributes, error: response };
31
+ }
26
32
  return message.save();
27
33
  }
28
34
  async trigger(data) {
29
35
  const key = await this.propertyService.get('kaleyra.api.key', false);
30
36
  const sid = await this.propertyService.get('kaleyra.api.sid', false);
37
+ const callbackProfileId = await this.propertyService.get('kaleyra.callback.identifier', false);
31
38
  if (!(key && sid))
32
39
  throw new operation_exception_1.OperationException(`kaleyra api keys are not setup properly`);
33
- const apiUrl = process.env.SERVER_URL;
34
40
  const payload = {
35
41
  api_key: key,
36
42
  method: 'sms',
37
- message: data.content,
43
+ body: data.content,
38
44
  to: `+91${data.mobile}`,
45
+ type: data?.template?.attributes?.type || 'TXN',
46
+ source: 'API',
39
47
  sender: data.template.sender,
40
48
  entity_id: data.template.entity_identifier,
41
49
  template_id: data.template.template_identifier,
42
- callback: `${apiUrl}/capture-kaleyra-webhook`,
43
50
  };
51
+ if (callbackProfileId)
52
+ payload.callback_profile_id = callbackProfileId;
44
53
  const options = {
45
54
  method: 'POST',
46
- url: `https://api.in.kaleyra.io/v1/${sid}/messages`,
47
- params: payload,
55
+ url: `https://api.kaleyra.io/v1/${sid}/messages`,
48
56
  headers: {
49
- 'Content-Type': 'application/x-www-form-urlencoded',
57
+ 'content-type': 'application/x-www-form-urlencoded',
50
58
  'api-key': key,
51
59
  },
52
60
  data: qs.stringify(payload),
53
61
  };
54
- const response = await this.remoteRequestService.sendThroughAxios(options);
55
- return response.data[0].message_id;
62
+ return this.remoteRequestService.getRawResponse(options);
56
63
  }
57
64
  }
58
65
  exports.ProcessKaleyraSms = ProcessKaleyraSms;
@@ -1 +1 @@
1
- {"version":3,"file":"process.kaleyra.sms.js","sourceRoot":"","sources":["../../../src/platformUtility/libraries/process.kaleyra.sms.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AAEzB,mFAA8E;AAI9E,qFAAiF;AACjF,8EAA0E;AAO1E,MAAa,iBAAiB;IAM1B,YACqB,oBAA0C,EAC1C,eAAgC;QADhC,yBAAoB,GAApB,oBAAoB,CAAsB;QAC1C,oBAAe,GAAf,eAAe,CAAiB;IAClD,CAAC;IAQJ,KAAK,CAAC,IAAI,CAAC,IAAmB;QAC1B,IAAI,CAAC,kCAAe,CAAC,uBAAuB,EAAE;YAAE,OAAO,IAAI,CAAC;QAE5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IAQD,KAAK,CAAC,OAAO,CAAC,OAAyB;QACnC,IAAI,CAAC,kCAAe,CAAC,uBAAuB,EAAE;YAAE,OAAO,uBAAuB,CAAC;QAE/E,MAAM,QAAQ,GAAG,MAAM,uCAAiB,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QACpE,QAAQ,CAAC,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,EAAE,IAAI,CAAC,QAAQ,CAAC,mBAAmB;SACjD,CAAC;QAEF,IAAI,iBAAiB;YAAE,OAAO,CAAC,mBAAmB,GAAG,iBAAiB,CAAC;QAEvE,MAAM,OAAO,GAAQ;YACjB,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,6BAA6B,GAAG,WAAW;YAChD,OAAO,EAAE;gBACL,cAAc,EAAE,mCAAmC;gBACnD,SAAS,EAAE,GAAG;aACjB;YACD,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC;SAC9B,CAAC;QAEF,OAAO,IAAI,CAAC,oBAAoB,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IAC7D,CAAC;CACJ;AAzFD,8CAyFC"}
@@ -0,0 +1,10 @@
1
+ import { SmsMessageEntity } from '../../system/entities/sms.message.entity';
2
+ import { SetSmsPayloadDto } from '../dtos/set.sms.payload.dto';
3
+ export declare class SetSmsMessage {
4
+ private payload;
5
+ private template;
6
+ private content;
7
+ process(payload: SetSmsPayloadDto): Promise<SmsMessageEntity>;
8
+ private getTemplate;
9
+ private setSmsMessage;
10
+ }
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SetSmsMessage = void 0;
4
+ const operation_exception_1 = require("../../common/exceptions/operation.exception");
5
+ const platform_utility_1 = require("../../common/libraries/platform.utility");
6
+ const sms_message_entity_1 = require("../../system/entities/sms.message.entity");
7
+ const sms_template_entity_1 = require("../../system/entities/sms.template.entity");
8
+ class SetSmsMessage {
9
+ async process(payload) {
10
+ this.payload = payload;
11
+ this.template = await this.getTemplate();
12
+ this.content = platform_utility_1.PlatformUtility.replaceTemplate(this.template.message, payload.context);
13
+ return this.setSmsMessage();
14
+ }
15
+ async getTemplate() {
16
+ const template = await sms_template_entity_1.SmsTemplateEntity.findOne({ where: { identifier: this.payload.template, active: true } });
17
+ if (!template)
18
+ throw new operation_exception_1.OperationException(`No such template exists`);
19
+ return template;
20
+ }
21
+ async setSmsMessage() {
22
+ const message = new sms_message_entity_1.SmsMessageEntity();
23
+ if (this.payload.source) {
24
+ message.source_type = this.payload.source.source_type;
25
+ message.source_id = this.payload.source.source_id;
26
+ }
27
+ message.dialing_code = this.payload.dialing_code || 91;
28
+ message.mobile = parseInt(this.payload.mobile);
29
+ message.content = this.content;
30
+ message.template_id = this.template.id;
31
+ message.gateway_id = 1;
32
+ message.attributes = this.template.attributes || {};
33
+ return message.save();
34
+ }
35
+ }
36
+ exports.SetSmsMessage = SetSmsMessage;
37
+ //# sourceMappingURL=set.sms.message.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set.sms.message.js","sourceRoot":"","sources":["../../../src/platformUtility/libraries/set.sms.message.ts"],"names":[],"mappings":";;;AAAA,qFAAiF;AACjF,8EAA0E;AAC1E,iFAA4E;AAC5E,mFAA8E;AAG9E,MAAa,aAAa;IAKtB,KAAK,CAAC,OAAO,CAAC,OAAyB;QACnC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QAEzC,IAAI,CAAC,OAAO,GAAG,kCAAe,CAAC,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAEvF,OAAO,IAAI,CAAC,aAAa,EAAE,CAAC;IAChC,CAAC;IAEO,KAAK,CAAC,WAAW;QACrB,MAAM,QAAQ,GAAG,MAAM,uCAAiB,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QAEjH,IAAI,CAAC,QAAQ;YAAE,MAAM,IAAI,wCAAkB,CAAC,yBAAyB,CAAC,CAAC;QAEvE,OAAO,QAAQ,CAAC;IACpB,CAAC;IAEO,KAAK,CAAC,aAAa;QACvB,MAAM,OAAO,GAAG,IAAI,qCAAgB,EAAE,CAAC;QAEvC,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;YACrB,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC;YACtD,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC;SACrD;QAED,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,IAAI,EAAE,CAAC;QACvD,OAAO,CAAC,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC/C,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAE/B,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QACvC,OAAO,CAAC,UAAU,GAAG,CAAC,CAAC;QAEvB,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,IAAI,EAAE,CAAC;QAEpD,OAAO,OAAO,CAAC,IAAI,EAAE,CAAC;IAC1B,CAAC;CACJ;AAzCD,sCAyCC"}
@@ -16,13 +16,14 @@ const system_module_1 = require("../system/system.module");
16
16
  const es6_classes_1 = require("./es6.classes");
17
17
  const cacheConfig = require("../config/cache.config");
18
18
  const name = process.env.BULL_QUEUE_NAME;
19
+ const maxDataPoints = parseInt(process.env.BULL_MAX_METRIC_POINTS || '100000', 10);
19
20
  let PlatformUtilityModule = class PlatformUtilityModule {
20
21
  };
21
22
  exports.PlatformUtilityModule = PlatformUtilityModule;
22
23
  exports.PlatformUtilityModule = PlatformUtilityModule = __decorate([
23
24
  (0, common_1.Module)({
24
25
  imports: [
25
- bull_1.BullModule.registerQueue({ name }),
26
+ bull_1.BullModule.registerQueue({ name, metrics: { maxDataPoints } }),
26
27
  cache_manager_1.CacheModule.register(cacheConfig),
27
28
  (0, common_1.forwardRef)(() => auth_module_1.AuthModule),
28
29
  (0, common_1.forwardRef)(() => system_module_1.SystemModule),
@@ -1 +1 @@
1
- {"version":3,"file":"platform.utility.module.js","sourceRoot":"","sources":["../../src/platformUtility/platform.utility.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,uCAA0C;AAC1C,yDAAoD;AACpD,2CAAoD;AACpD,yBAAuB;AAEvB,qDAAiD;AACjD,2DAAuD;AACvD,+CAAuC;AACvC,sDAAuD;AAEvD,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;AAalC,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;CAAG,CAAA;AAAxB,sDAAqB;gCAArB,qBAAqB;IAXjC,IAAA,eAAM,EAAC;QACJ,OAAO,EAAE;YACL,iBAAU,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,CAAC;YAClC,2BAAW,CAAC,QAAQ,CAAqB,WAAW,CAAC;YACrD,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,wBAAU,CAAC;YAC5B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,4BAAY,CAAC;SACjC;QACD,SAAS,EAAE,CAAC,GAAG,qBAAU,CAAC,QAAQ,EAAE,GAAG,qBAAU,CAAC,SAAS,EAAE,GAAG,qBAAU,CAAC,WAAW,EAAE,GAAG,qBAAU,CAAC,QAAQ,EAAE,GAAG,qBAAU,CAAC,IAAI,CAAC;QACnI,WAAW,EAAE,qBAAU,CAAC,WAAW;QACnC,OAAO,EAAE,CAAC,GAAG,qBAAU,CAAC,QAAQ,EAAE,GAAG,qBAAU,CAAC,IAAI,CAAC;KACxD,CAAC;GACW,qBAAqB,CAAG"}
1
+ {"version":3,"file":"platform.utility.module.js","sourceRoot":"","sources":["../../src/platformUtility/platform.utility.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,uCAA0C;AAC1C,yDAAoD;AACpD,2CAAoD;AACpD,yBAAuB;AAEvB,qDAAiD;AACjD,2DAAuD;AACvD,+CAAuC;AACvC,sDAAuD;AAEvD,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;AACzC,MAAM,aAAa,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,sBAAsB,IAAI,QAAQ,EAAE,EAAE,CAAC,CAAC;AAa5E,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;CAAG,CAAA;AAAxB,sDAAqB;gCAArB,qBAAqB;IAXjC,IAAA,eAAM,EAAC;QACJ,OAAO,EAAE;YACL,iBAAU,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,EAAE,CAAC;YAC9D,2BAAW,CAAC,QAAQ,CAAqB,WAAW,CAAC;YACrD,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,wBAAU,CAAC;YAC5B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,4BAAY,CAAC;SACjC;QACD,SAAS,EAAE,CAAC,GAAG,qBAAU,CAAC,QAAQ,EAAE,GAAG,qBAAU,CAAC,SAAS,EAAE,GAAG,qBAAU,CAAC,WAAW,EAAE,GAAG,qBAAU,CAAC,QAAQ,EAAE,GAAG,qBAAU,CAAC,IAAI,CAAC;QACnI,WAAW,EAAE,qBAAU,CAAC,WAAW;QACnC,OAAO,EAAE,CAAC,GAAG,qBAAU,CAAC,QAAQ,EAAE,GAAG,qBAAU,CAAC,IAAI,CAAC;KACxD,CAAC;GACW,qBAAqB,CAAG"}
@@ -1,12 +1,14 @@
1
1
  import { SmsMessageEntity } from '../../system/entities/sms.message.entity';
2
+ import { PropertyService } from '../../system/services/property.service';
3
+ import { SetSmsPayloadDto } from '../dtos/set.sms.payload.dto';
2
4
  import { SmsPayloadDto } from '../dtos/sms.payload.dto';
3
5
  import { RemoteRequestService } from './remote.request.service';
4
- import { PropertyService } from '../../system/services/property.service';
5
6
  export declare class SmsService {
6
7
  private readonly remoteRequestService;
7
8
  private readonly propertyService;
8
9
  constructor(remoteRequestService: RemoteRequestService, propertyService: PropertyService);
9
- send(data: SmsPayloadDto): Promise<any>;
10
- sendSms(message: SmsMessageEntity): Promise<SmsMessageEntity | "test-environment here">;
10
+ sendWithoutMessage(data: SmsPayloadDto): Promise<import("..").RemoteRawResponseDto | SmsPayloadDto>;
11
+ setAndSendMessage(payload: SetSmsPayloadDto): Promise<SmsMessageEntity | "test-environment here">;
12
+ sendMessage(message: SmsMessageEntity): Promise<SmsMessageEntity | "test-environment here">;
11
13
  private handleTestEnvironment;
12
14
  }
@@ -12,20 +12,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.SmsService = void 0;
13
13
  const common_1 = require("@nestjs/common");
14
14
  const platform_utility_1 = require("../../common/libraries/platform.utility");
15
+ const property_service_1 = require("../../system/services/property.service");
15
16
  const process_kaleyra_sms_1 = require("../libraries/process.kaleyra.sms");
17
+ const set_sms_message_1 = require("../libraries/set.sms.message");
16
18
  const remote_request_service_1 = require("./remote.request.service");
17
- const property_service_1 = require("../../system/services/property.service");
18
19
  let SmsService = class SmsService {
19
20
  constructor(remoteRequestService, propertyService) {
20
21
  this.remoteRequestService = remoteRequestService;
21
22
  this.propertyService = propertyService;
22
23
  }
23
- async send(data) {
24
+ async sendWithoutMessage(data) {
24
25
  if (!platform_utility_1.PlatformUtility.isProductionEnvironment())
25
26
  return data;
26
27
  return new process_kaleyra_sms_1.ProcessKaleyraSms(this.remoteRequestService, this.propertyService).send(data);
27
28
  }
28
- async sendSms(message) {
29
+ async setAndSendMessage(payload) {
30
+ const message = await new set_sms_message_1.SetSmsMessage().process(payload);
31
+ return this.sendMessage(message);
32
+ }
33
+ async sendMessage(message) {
29
34
  if (!platform_utility_1.PlatformUtility.isProductionEnvironment())
30
35
  return this.handleTestEnvironment(message);
31
36
  return new process_kaleyra_sms_1.ProcessKaleyraSms(this.remoteRequestService, this.propertyService).sendSms(message);
@@ -1 +1 @@
1
- {"version":3,"file":"sms.service.js","sourceRoot":"","sources":["../../../src/platformUtility/services/sms.service.ts"],"names":[],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hB,MAAM,UAAU;IAMnB,YACqB,oBAA0C,EAC1C,eAAgC;QADhC,yBAAoB,GAApB,oBAAoB,CAAsB;QAC1C,oBAAe,GAAf,eAAe,CAAiB;IAClD,CAAC;IAQJ,KAAK,CAAC,kBAAkB,CAAC,IAAmB;QACxC,IAAI,CAAC,kCAAe,CAAC,uBAAuB,EAAE;YAAE,OAAO,IAAI,CAAC;QAC5D,OAAO,IAAI,uCAAiB,CAAC,IAAI,CAAC,oBAAoB,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7F,CAAC;IAQD,KAAK,CAAC,iBAAiB,CAAC,OAAyB;QAC7C,MAAM,OAAO,GAAG,MAAM,IAAI,+BAAa,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAC3D,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IAQD,KAAK,CAAC,WAAW,CAAC,OAAyB;QACvC,IAAI,CAAC,kCAAe,CAAC,uBAAuB,EAAE;YAAE,OAAO,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC;QAE3F,OAAO,IAAI,uCAAiB,CAAC,IAAI,CAAC,oBAAoB,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACnG,CAAC;IASO,KAAK,CAAC,qBAAqB,CAAC,OAAyB;QACzD,OAAO,CAAC,UAAU,GAAG,kBAAkB,CAAC;QACxC,OAAO,OAAO,CAAC,IAAI,EAAE,CAAC;IAC1B,CAAC;CACJ,CAAA;AAxDY,gCAAU;qBAAV,UAAU;IADtB,IAAA,mBAAU,GAAE;qCAQkC,6CAAoB;QACzB,kCAAe;GAR5C,UAAU,CAwDtB"}
@@ -1,4 +1,5 @@
1
1
  import { CommonAttributesDto } from '../../platformUtility/dtos/common.attributes.dto';
2
2
  export declare class SmsMessageAttributesDto extends CommonAttributesDto {
3
3
  encrypt?: boolean;
4
+ error?: any;
4
5
  }
@@ -1 +1 @@
1
- {"version":3,"file":"sms.message.attributes.dto.js","sourceRoot":"","sources":["../../../src/system/dtos/sms.message.attributes.dto.ts"],"names":[],"mappings":";;;AAAA,4FAAuF;AAEvF,MAAa,uBAAwB,SAAQ,2CAAmB;CAE/D;AAFD,0DAEC"}
1
+ {"version":3,"file":"sms.message.attributes.dto.js","sourceRoot":"","sources":["../../../src/system/dtos/sms.message.attributes.dto.ts"],"names":[],"mappings":";;;AAAA,4FAAuF;AAEvF,MAAa,uBAAwB,SAAQ,2CAAmB;CAG/D;AAHD,0DAGC"}
@@ -7,6 +7,7 @@ export declare class SmsTemplateEntity extends CommonEntity {
7
7
  template_identifier: string;
8
8
  sender: string;
9
9
  message: string;
10
+ active: boolean;
10
11
  gateway_id: number;
11
12
  attributes: any;
12
13
  gateway: LookupValueEntity;