@servicelabsco/nestjs-utility-services 1.2.21 → 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 (28) hide show
  1. package/dist/platformUtility/dtos/index.d.ts +1 -0
  2. package/dist/platformUtility/dtos/index.js +1 -0
  3. package/dist/platformUtility/dtos/index.js.map +1 -1
  4. package/dist/platformUtility/dtos/kaleyra.callback.payload.dto.d.ts +11 -0
  5. package/dist/platformUtility/dtos/kaleyra.callback.payload.dto.js +7 -0
  6. package/dist/platformUtility/dtos/kaleyra.callback.payload.dto.js.map +1 -0
  7. package/dist/platformUtility/es6.classes.d.ts +5 -3
  8. package/dist/platformUtility/es6.classes.js +4 -0
  9. package/dist/platformUtility/es6.classes.js.map +1 -1
  10. package/dist/platformUtility/libraries/index.d.ts +1 -0
  11. package/dist/platformUtility/libraries/index.js +1 -0
  12. package/dist/platformUtility/libraries/index.js.map +1 -1
  13. package/dist/platformUtility/libraries/process.kaleyra.callback.response.d.ts +6 -0
  14. package/dist/platformUtility/libraries/process.kaleyra.callback.response.js +20 -0
  15. package/dist/platformUtility/libraries/process.kaleyra.callback.response.js.map +1 -0
  16. package/dist/platformUtility/libraries/process.kaleyra.sms.d.ts +1 -1
  17. package/dist/platformUtility/libraries/process.kaleyra.sms.js +16 -13
  18. package/dist/platformUtility/libraries/process.kaleyra.sms.js.map +1 -1
  19. package/dist/platformUtility/services/sms.service.d.ts +3 -3
  20. package/dist/platformUtility/services/sms.service.js +4 -4
  21. package/dist/platformUtility/services/sms.service.js.map +1 -1
  22. package/dist/system/dtos/sms.message.attributes.dto.d.ts +1 -0
  23. package/dist/system/dtos/sms.message.attributes.dto.js.map +1 -1
  24. package/dist/system/jobs/sms.message.job.d.ts +1 -4
  25. package/dist/system/jobs/sms.message.job.js +3 -15
  26. package/dist/system/jobs/sms.message.job.js.map +1 -1
  27. package/dist/tsconfig.build.tsbuildinfo +1 -1
  28. package/package.json +1 -1
@@ -3,6 +3,7 @@ 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';
@@ -19,6 +19,7 @@ __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);
@@ -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,wDAAsC;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"}
@@ -9,6 +9,7 @@ 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';
@@ -34,6 +35,7 @@ import { CreateIndexFile } from './libraries/create.index.file';
34
35
  import { FileSystemUtility } from './libraries/file.system.utility';
35
36
  import { ProcessAuditLogData } from './libraries/process.audit.log.data';
36
37
  import { ProcessCommonMail } from './libraries/process.common.mail';
38
+ import { ProcessKaleyraCallbackResponse } from './libraries/process.kaleyra.callback.response';
37
39
  import { ProcessKaleyraSms } from './libraries/process.kaleyra.sms';
38
40
  import { ProcessSmtpMail } from './libraries/process.smtp.mail';
39
41
  import { SetSmsMessage } from './libraries/set.sms.message';
@@ -60,12 +62,12 @@ declare const es6Classes: {
60
62
  commands: (typeof MaintenanceCommand | typeof SqsWorkerCommand | typeof SyncClassCommand)[];
61
63
  consumers: (typeof EventConsumer | typeof JobConsumer)[];
62
64
  controllers: (typeof BullJobController | typeof QueueController)[];
63
- dtos: (typeof JobPayloadDto | typeof QueueOptionsDto | typeof SourceColumnDto | typeof CommonAttributesDto | typeof AwsConfigDto | typeof SetSmsPayloadDto | 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)[];
64
66
  entities: (typeof FailedBullJobEntity | typeof PendingBullJobEntity)[];
65
67
  jobs: (typeof LoadFailedBullJob | typeof RecordWatcherJob | typeof ReloadPendingBullJob | typeof TestJob)[];
66
- libraries: (typeof ProcessAuditLogData | typeof ProcessKaleyraSms | typeof SetSmsMessage | 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)[];
67
69
  middlewares: (typeof MaintenanceMiddleware | typeof TrimPipe)[];
68
- 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)[];
69
71
  subscribers: (typeof BaseSubscriber)[];
70
72
  };
71
73
  export default es6Classes;
@@ -12,6 +12,7 @@ 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");
@@ -38,6 +39,7 @@ const create_index_file_1 = require("./libraries/create.index.file");
38
39
  const file_system_utility_1 = require("./libraries/file.system.utility");
39
40
  const process_audit_log_data_1 = require("./libraries/process.audit.log.data");
40
41
  const process_common_mail_1 = require("./libraries/process.common.mail");
42
+ const process_kaleyra_callback_response_1 = require("./libraries/process.kaleyra.callback.response");
41
43
  const process_kaleyra_sms_1 = require("./libraries/process.kaleyra.sms");
42
44
  const process_smtp_mail_1 = require("./libraries/process.smtp.mail");
43
45
  const set_sms_message_1 = require("./libraries/set.sms.message");
@@ -70,6 +72,7 @@ const es6Classes = {
70
72
  failed_bull_job_attributes_dto_1.FailedBullJobAttributesDto,
71
73
  fcm_response_dto_1.FcmResponseDto,
72
74
  job_payload_dto_1.JobPayloadDto,
75
+ kaleyra_callback_payload_dto_1.KaleyraCallbackPayloadDto,
73
76
  mail_options_dto_1.MailOptionsDto,
74
77
  pending_bull_job_attributes_dto_1.PendingBullJobAttributesDto,
75
78
  push_notification_response_dto_1.PushNotificationResponseDto,
@@ -94,6 +97,7 @@ const es6Classes = {
94
97
  file_system_utility_1.FileSystemUtility,
95
98
  process_audit_log_data_1.ProcessAuditLogData,
96
99
  process_common_mail_1.ProcessCommonMail,
100
+ process_kaleyra_callback_response_1.ProcessKaleyraCallbackResponse,
97
101
  process_kaleyra_sms_1.ProcessKaleyraSms,
98
102
  process_smtp_mail_1.ProcessSmtpMail,
99
103
  set_sms_message_1.SetSmsMessage,
@@ -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,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,yEAAoE;AACpE,qEAAgE;AAChE,iEAA4D;AAC5D,iF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AAY;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"}
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,6 +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';
12
13
  export * from './set.sms.message';
@@ -23,6 +23,7 @@ __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);
28
29
  __exportStar(require("./set.sms.message"), exports);
@@ -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,sDAAoC;AAAA,oDAAiC"}
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
  }
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ProcessKaleyraSms = void 0;
4
4
  const qs = require("qs");
5
5
  const operation_exception_1 = require("../../common/exceptions/operation.exception");
6
- const custom_crypt_1 = require("../../common/libraries/custom.crypt");
7
6
  const platform_utility_1 = require("../../common/libraries/platform.utility");
8
7
  const sms_template_entity_1 = require("../../system/entities/sms.template.entity");
9
8
  class ProcessKaleyraSms {
@@ -22,41 +21,45 @@ class ProcessKaleyraSms {
22
21
  const template = await sms_template_entity_1.SmsTemplateEntity.first(message.template_id);
23
22
  template.message = message.content;
24
23
  const payload = { mobile: message.mobile, template, content: message.content };
25
- const identifier = await this.trigger(payload);
26
- message.identifier = identifier;
27
- if (template.attributes?.is_sensitive)
28
- message.content = custom_crypt_1.CustomCrypt.encrypt(message.content);
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
+ }
29
32
  return message.save();
30
33
  }
31
34
  async trigger(data) {
32
35
  const key = await this.propertyService.get('kaleyra.api.key', false);
33
36
  const sid = await this.propertyService.get('kaleyra.api.sid', false);
37
+ const callbackProfileId = await this.propertyService.get('kaleyra.callback.identifier', false);
34
38
  if (!(key && sid))
35
39
  throw new operation_exception_1.OperationException(`kaleyra api keys are not setup properly`);
36
- const apiUrl = process.env.SERVER_URL;
37
- const type = data.template?.attributes?.type || 'TXN';
38
40
  const payload = {
39
41
  api_key: key,
42
+ method: 'sms',
40
43
  body: data.content,
41
44
  to: `+91${data.mobile}`,
45
+ type: data?.template?.attributes?.type || 'TXN',
46
+ source: 'API',
42
47
  sender: data.template.sender,
43
- type,
44
48
  entity_id: data.template.entity_identifier,
45
49
  template_id: data.template.template_identifier,
46
- callback: `${apiUrl}/capture-kaleyra-webhook`,
47
50
  };
51
+ if (callbackProfileId)
52
+ payload.callback_profile_id = callbackProfileId;
48
53
  const options = {
49
54
  method: 'POST',
50
55
  url: `https://api.kaleyra.io/v1/${sid}/messages`,
51
- params: payload,
52
56
  headers: {
53
- 'Content-Type': 'application/x-www-form-urlencoded',
57
+ 'content-type': 'application/x-www-form-urlencoded',
54
58
  'api-key': key,
55
59
  },
56
60
  data: qs.stringify(payload),
57
61
  };
58
- const response = await this.remoteRequestService.sendThroughAxios(options);
59
- return response.data[0].message_id;
62
+ return this.remoteRequestService.getRawResponse(options);
60
63
  }
61
64
  }
62
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;AACzB,qFAAiF;AACjF,sEAAkE;AAClE,8EAA0E;AAE1E,mFAA8E;AAU9E,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,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AAO,GAAQ;YACjB,OAAO,EAAE,GAAG;YACZ,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,IAAI,CAAC,OAAO;YAClB,EAAE,EAAE,MAAM,IAAI,CAAC,MAAM,EAAE;YACvB,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,IAAI,KAAK;YAC/C,MAAM,EAAE,KAAK;YACb,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM;YAC5B,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,iBAAiB;YAC1C,WAAW,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"}
@@ -7,8 +7,8 @@ export declare class SmsService {
7
7
  private readonly remoteRequestService;
8
8
  private readonly propertyService;
9
9
  constructor(remoteRequestService: RemoteRequestService, propertyService: PropertyService);
10
- send(data: SmsPayloadDto): Promise<any>;
11
- setSms(payload: SetSmsPayloadDto): Promise<SmsMessageEntity | "test-environment here">;
12
- 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">;
13
13
  private handleTestEnvironment;
14
14
  }
@@ -21,16 +21,16 @@ let SmsService = class SmsService {
21
21
  this.remoteRequestService = remoteRequestService;
22
22
  this.propertyService = propertyService;
23
23
  }
24
- async send(data) {
24
+ async sendWithoutMessage(data) {
25
25
  if (!platform_utility_1.PlatformUtility.isProductionEnvironment())
26
26
  return data;
27
27
  return new process_kaleyra_sms_1.ProcessKaleyraSms(this.remoteRequestService, this.propertyService).send(data);
28
28
  }
29
- async setSms(payload) {
29
+ async setAndSendMessage(payload) {
30
30
  const message = await new set_sms_message_1.SetSmsMessage().process(payload);
31
- return this.sendSms(message);
31
+ return this.sendMessage(message);
32
32
  }
33
- async sendSms(message) {
33
+ async sendMessage(message) {
34
34
  if (!platform_utility_1.PlatformUtility.isProductionEnvironment())
35
35
  return this.handleTestEnvironment(message);
36
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":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,8EAA0E;AAE1E,6EAAyE;AAGzE,0EAAqE;AACrE,kEAA6D;AAC7D,qEAAgE;AAGzD,IAAM,UAAU,GAAhB,MAAM,UAAU;IAMnB,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;QAC5D,OAAO,IAAI,uCAAiB,CAAC,IAAI,CAAC,oBAAoB,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7F,CAAC;IAQD,KAAK,CAAC,MAAM,CAAC,OAAyB;QA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C,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"}
@@ -1,12 +1,9 @@
1
1
  import { DatabaseEventDto } from '../../common/dtos/database.event.dto';
2
2
  import { CommonJob } from '../../common/libraries/common.job';
3
3
  import { QueueService } from '../../platformUtility/services/queue.service';
4
- import { SmsService } from '../../platformUtility/services/sms.service';
5
4
  import { SmsMessageEntity } from '../entities/sms.message.entity';
6
5
  export declare class SmsMessageJob extends CommonJob {
7
6
  protected readonly queueService: QueueService;
8
- private readonly smsService;
9
- constructor(queueService: QueueService, smsService: SmsService);
7
+ constructor(queueService: QueueService);
10
8
  handle(evt: DatabaseEventDto<SmsMessageEntity>): Promise<void>;
11
- private sendMessage;
12
9
  }
@@ -13,28 +13,16 @@ exports.SmsMessageJob = void 0;
13
13
  const common_1 = require("@nestjs/common");
14
14
  const common_job_1 = require("../../common/libraries/common.job");
15
15
  const queue_service_1 = require("../../platformUtility/services/queue.service");
16
- const sms_service_1 = require("../../platformUtility/services/sms.service");
17
- const sms_message_entity_1 = require("../entities/sms.message.entity");
18
16
  let SmsMessageJob = class SmsMessageJob extends common_job_1.CommonJob {
19
- constructor(queueService, smsService) {
17
+ constructor(queueService) {
20
18
  super('568a28e3b79c7a722c9ec0d0b55515c6');
21
19
  this.queueService = queueService;
22
- this.smsService = smsService;
23
- }
24
- async handle(evt) {
25
- await this.sendMessage(evt);
26
- }
27
- async sendMessage(evt) {
28
- if (!this.isNewRecord(evt))
29
- return;
30
- const message = await sms_message_entity_1.SmsMessageEntity.first(evt.entity.id);
31
- return this.smsService.sendSms(message);
32
20
  }
21
+ async handle(evt) { }
33
22
  };
34
23
  exports.SmsMessageJob = SmsMessageJob;
35
24
  exports.SmsMessageJob = SmsMessageJob = __decorate([
36
25
  (0, common_1.Injectable)(),
37
- __metadata("design:paramtypes", [queue_service_1.QueueService,
38
- sms_service_1.SmsService])
26
+ __metadata("design:paramtypes", [queue_service_1.QueueService])
39
27
  ], SmsMessageJob);
40
28
  //# sourceMappingURL=sms.message.job.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sms.message.job.js","sourceRoot":"","sources":["../../../src/system/jobs/sms.message.job.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAE5C,kEAA8D;AAC9D,gFAA4E;AAC5E,4EAAwE;AACxE,uEAAkE;AAG3D,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,sBAAS;IACxC,YACuB,YAA0B,EAC5B,UAAsB;QAEvC,KAAK,CAAC,kCAAkC,CAAC,CAAC;QAHvB,iBAAY,GAAZ,YAAY,CAAc;QAC5B,eAAU,GAAV,UAAU,CAAY;IAG3C,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,GAAuC;QAChD,MAAM,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC;IAEO,KAAK,CAAC,WAAW,CAAC,GAAuC;QAC7D,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC;YAAE,OAAO;QAEnC,MAAM,OAAO,GAAG,MAAM,qCAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC5D,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5C,CAAC;CACJ,CAAA;AAjBY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;qCAG4B,4BAAY;QAChB,wBAAU;GAHlC,aAAa,CAiBzB"}
1
+ {"version":3,"file":"sms.message.job.js","sourceRoot":"","sources":["../../../src/system/jobs/sms.message.job.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAE5C,kEAA8D;AAC9D,gFAA4E;AAIrE,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,sBAAS;IACxC,YAA+B,YAA0B;QACrD,KAAK,CAAC,kCAAkC,CAAC,CAAC;QADf,iBAAY,GAAZ,YAAY,CAAc;IAEzD,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,GAAuC,IA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