@servicelabsco/nestjs-utility-services 1.0.143 → 1.0.147

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 (58) hide show
  1. package/dist/app.controller.d.ts +1 -5
  2. package/dist/app.controller.js +2 -9
  3. package/dist/app.controller.js.map +1 -1
  4. package/dist/auth/es6.classes.d.ts +1 -1
  5. package/dist/common/libraries/platform.utility.d.ts +3 -0
  6. package/dist/common/libraries/platform.utility.js +10 -0
  7. package/dist/common/libraries/platform.utility.js.map +1 -1
  8. package/dist/config/entity.constants.d.ts +2 -0
  9. package/dist/config/entity.constants.js +2 -0
  10. package/dist/config/entity.constants.js.map +1 -1
  11. package/dist/migrations/1643398296090-CreateMailLogTable.d.ts +5 -0
  12. package/dist/migrations/1643398296090-CreateMailLogTable.js +25 -0
  13. package/dist/migrations/1643398296090-CreateMailLogTable.js.map +1 -0
  14. package/dist/platformUtility/dtos/index.d.ts +1 -0
  15. package/dist/platformUtility/dtos/index.js +1 -0
  16. package/dist/platformUtility/dtos/index.js.map +1 -1
  17. package/dist/platformUtility/dtos/mail.options.dto.d.ts +13 -0
  18. package/dist/platformUtility/dtos/mail.options.dto.js +59 -0
  19. package/dist/platformUtility/dtos/mail.options.dto.js.map +1 -0
  20. package/dist/platformUtility/es6.classes.d.ts +3 -2
  21. package/dist/platformUtility/es6.classes.js +2 -1
  22. package/dist/platformUtility/es6.classes.js.map +1 -1
  23. package/dist/platformUtility/services/index.d.ts +1 -0
  24. package/dist/platformUtility/services/index.js +1 -0
  25. package/dist/platformUtility/services/index.js.map +1 -1
  26. package/dist/platformUtility/services/local.property.service.d.ts +3 -0
  27. package/dist/platformUtility/services/local.property.service.js +10 -0
  28. package/dist/platformUtility/services/local.property.service.js.map +1 -1
  29. package/dist/platformUtility/services/mail.service.d.ts +12 -1
  30. package/dist/platformUtility/services/mail.service.js +89 -2
  31. package/dist/platformUtility/services/mail.service.js.map +1 -1
  32. package/dist/platformUtility/services/queue.service.d.ts +3 -1
  33. package/dist/platformUtility/services/queue.service.js +10 -3
  34. package/dist/platformUtility/services/queue.service.js.map +1 -1
  35. package/dist/system/commands/vaccine.command.js +0 -10
  36. package/dist/system/commands/vaccine.command.js.map +1 -1
  37. package/dist/system/controllers/base.controller.d.ts +3 -1
  38. package/dist/system/controllers/base.controller.js +6 -4
  39. package/dist/system/controllers/base.controller.js.map +1 -1
  40. package/dist/system/controllers/data.controller.d.ts +3 -1
  41. package/dist/system/controllers/data.controller.js +6 -5
  42. package/dist/system/controllers/data.controller.js.map +1 -1
  43. package/dist/system/entities/index.d.ts +1 -0
  44. package/dist/system/entities/index.js +1 -0
  45. package/dist/system/entities/index.js.map +1 -1
  46. package/dist/system/entities/mail.log.entity.d.ts +12 -0
  47. package/dist/system/entities/mail.log.entity.js +57 -0
  48. package/dist/system/entities/mail.log.entity.js.map +1 -0
  49. package/dist/system/es6.classes.d.ts +4 -3
  50. package/dist/system/es6.classes.js +2 -0
  51. package/dist/system/es6.classes.js.map +1 -1
  52. package/dist/system/jobs/model.scanner.job.d.ts +4 -2
  53. package/dist/system/jobs/model.scanner.job.js +9 -8
  54. package/dist/system/jobs/model.scanner.job.js.map +1 -1
  55. package/dist/system/services/common.service.d.ts +3 -2
  56. package/dist/system/services/common.service.js +6 -9
  57. package/dist/system/services/common.service.js.map +1 -1
  58. package/package.json +2 -1
@@ -1,13 +1,9 @@
1
1
  import { AppService } from './app.service';
2
2
  import { QueueService } from './platformUtility/services/queue.service';
3
- import { ModelScannerJob } from './system/jobs/model.scanner.job';
4
- import { UploadService } from './system/services/upload.service';
5
3
  export declare class AppController {
6
4
  private readonly appService;
7
5
  private readonly queueService;
8
- private readonly modelScannerJob;
9
- private readonly uploadService;
10
- constructor(appService: AppService, queueService: QueueService, modelScannerJob: ModelScannerJob, uploadService: UploadService);
6
+ constructor(appService: AppService, queueService: QueueService);
11
7
  get(): Promise<{
12
8
  message: string;
13
9
  }>;
@@ -23,14 +23,10 @@ const common_1 = require("@nestjs/common");
23
23
  const app_service_1 = require("./app.service");
24
24
  const auth_1 = require("./common/libraries/auth");
25
25
  const queue_service_1 = require("./platformUtility/services/queue.service");
26
- const model_scanner_job_1 = require("./system/jobs/model.scanner.job");
27
- const upload_service_1 = require("./system/services/upload.service");
28
26
  let AppController = class AppController {
29
- constructor(appService, queueService, modelScannerJob, uploadService) {
27
+ constructor(appService, queueService) {
30
28
  this.appService = appService;
31
29
  this.queueService = queueService;
32
- this.modelScannerJob = modelScannerJob;
33
- this.uploadService = uploadService;
34
30
  }
35
31
  get() {
36
32
  return __awaiter(this, void 0, void 0, function* () {
@@ -66,10 +62,7 @@ __decorate([
66
62
  ], AppController.prototype, "set", null);
67
63
  AppController = __decorate([
68
64
  (0, common_1.Controller)(),
69
- __metadata("design:paramtypes", [app_service_1.AppService,
70
- queue_service_1.QueueService,
71
- model_scanner_job_1.ModelScannerJob,
72
- upload_service_1.UploadService])
65
+ __metadata("design:paramtypes", [app_service_1.AppService, queue_service_1.QueueService])
73
66
  ], AppController);
74
67
  exports.AppController = AppController;
75
68
  //# sourceMappingURL=app.controller.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"app.controller.js","sourceRoot":"","sources":["../src/app.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,2CAAiD;AACjD,+CAA2C;AAC3C,kDAA+C;AAC/C,4EAAwE;AACxE,uEAAkE;AAClE,qEAAiE;AAGjE,IAAa,aAAa,GAA1B,MAAa,aAAa;IACtB,YACqB,UAAsB,EACtB,YAA0B,EAC1B,eAAgC,EAChC,aAA4B;QAH5B,eAAU,GAAV,UAAU,CAAY;QACtB,iBAAY,GAAZ,YAAY,CAAc;QAC1B,oBAAe,GAAf,eAAe,CAAiB;QAChC,kBAAa,GAAb,aAAa,CAAe;IAC9C,CAAC;IAGE,GAAG;;YACL,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC;QACvC,CAAC;KAAA;IAQK,iBAAiB;;YACnB,OAAO,WAAI,CAAC,IAAI,EAAE,CAAC;QACvB,CAAC;KAAA;IAGK,GAAG;8DAAI,CAAC;KAAA;CACjB,CAAA;AAhBG;IADC,IAAA,YAAG,GAAE;;;;wCAGL;AAQD;IADC,IAAA,YAAG,EAAC,UAAU,CAAC;;;;sDAGf;AAGD;IADC,IAAA,YAAG,EAAC,KAAK,CAAC;;;;wCACG;AAxBL,aAAa;IADzB,IAAA,mBAAU,GAAE;qCAGwB,wBAAU;QACR,4BAAY;QACT,mCAAe;QACjB,8BAAa;GALxC,aAAa,CAyBzB;AAzBY,sCAAa"}
1
+ {"version":3,"file":"app.controller.js","sourceRoot":"","sources":["../src/app.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,2CAAiD;AACjD,+CAA2C;AAC3C,kDAA+C;AAE/C,4EAAwE;AAGxE,IAAa,aAAa,GAA1B,MAAa,aAAa;IACtB,YAA6B,UAAsB,EAAmB,YAA0B;QAAnE,eAAU,GAAV,UAAU,CAAY;QAAmB,iBAAY,GAAZ,YAAY,CAAc;IAAG,CAAC;IAG9F,GAAG;;YACL,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC;QACvC,CAAC;KAAA;IAQK,iBAAiB;;YACnB,OAAO,WAAI,CAAC,IAAI,EAAE,CAAC;QACvB,CAAC;KAAA;IAGK,GAAG;8DAAI,CAAC;KAAA;CACjB,CAAA;AAhBG;IADC,IAAA,YAAG,GAAE;;;;wCAGL;AAQD;IADC,IAAA,YAAG,EAAC,UAAU,CAAC;;;;sDAGf;AAGD;IADC,IAAA,YAAG,EAAC,KAAK,CAAC;;;;wCACG;AAnBL,aAAa;IADzB,IAAA,mBAAU,GAAE;qCAEgC,wBAAU,EAAiC,4BAAY;GADvF,aAAa,CAoBzB;AApBY,sCAAa"}
@@ -28,7 +28,7 @@ import { GoogleStrategy } from './strategies/google.strategy';
28
28
  declare const es6Classes: {
29
29
  controllers: (typeof AuthController | typeof SocialController | typeof UserController)[];
30
30
  dtos: (typeof UserLoginDto | typeof CreateUserDto | typeof OfflineUserDto | typeof PermissionAssignmentDto | typeof RoleAssignmentDto | typeof UpdateUserDto)[];
31
- entities: (typeof CreatorEntity | typeof UserReferralEntity | typeof DeviceTokenEntity | typeof RefreshTokenEntity | typeof CountryEntity)[];
31
+ entities: (typeof CreatorEntity | typeof CountryEntity | typeof UserReferralEntity | typeof DeviceTokenEntity | typeof RefreshTokenEntity)[];
32
32
  middlewares: (typeof BasicAuthMiddleware | typeof JwtMiddleware | typeof RestrictedMiddleware)[];
33
33
  services: (typeof RefreshTokenService | typeof AuthService | typeof DeviceTokenService | typeof UserService | typeof SocialService | typeof AccessManager | typeof RoleManager | typeof Es6Service)[];
34
34
  strategies: (typeof FbStrategy | typeof GoogleStrategy)[];
@@ -3,4 +3,7 @@ export declare class PlatformUtility {
3
3
  static generateRandomNumber(digits: number): number;
4
4
  static generateRandomAlpha(len: number): string;
5
5
  static generateRandomAlphaNumeric(len: number): string;
6
+ static getEntity(hash: string): any;
7
+ static getService(hash: string): any;
8
+ static getJob(hash: string): any;
6
9
  }
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PlatformUtility = void 0;
4
4
  const randomstring = require("randomstring");
5
+ const platform_constants_1 = require("../../config/platform.constants");
5
6
  class PlatformUtility {
6
7
  static ucwords(str) {
7
8
  return (str + '').replace(/^(.)|\s+(.)/g, ($1) => {
@@ -19,6 +20,15 @@ class PlatformUtility {
19
20
  static generateRandomAlphaNumeric(len) {
20
21
  return randomstring.generate(len, { charset: 'alphanumeric' });
21
22
  }
23
+ static getEntity(hash) {
24
+ return platform_constants_1.default.entities[hash];
25
+ }
26
+ static getService(hash) {
27
+ return platform_constants_1.default.services[hash];
28
+ }
29
+ static getJob(hash) {
30
+ return platform_constants_1.default.jobs[hash];
31
+ }
22
32
  }
23
33
  exports.PlatformUtility = PlatformUtility;
24
34
  //# sourceMappingURL=platform.utility.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"platform.utility.js","sourceRoot":"","sources":["../../../src/common/libraries/platform.utility.ts"],"names":[],"mappings":";;;AAAA,6CAA6C;AAO7C,MAAa,eAAe;IAQxB,MAAM,CAAC,OAAO,CAAC,GAAG;QACd,OAAO,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC,EAAE,EAAE,EAAE;YAC7C,OAAO,EAAE,CAAC,WAAW,EAAE,CAAC;QAC5B,CAAC,CAAC,CAAC;IACP,CAAC;IAUD,MAAM,CAAC,oBAAoB,CAAC,MAAc;QACtC,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;QAChD,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;QAEhD,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;IACzD,CAAC;IASD,MAAM,CAAC,mBAAmB,CAAC,GAAW;QAClC,OAAO,YAAY,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,CAAC;IACjE,CAAC;IASD,MAAM,CAAC,0BAA0B,CAAC,GAAW;QACzC,OAAO,YAAY,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC,CAAC;IACnE,CAAC;CACJ;AAlDD,0CAkDC"}
1
+ {"version":3,"file":"platform.utility.js","sourceRoot":"","sources":["../../../src/common/libraries/platform.utility.ts"],"names":[],"mappings":";;;AAAA,6CAA6C;AAC7C,wEAAgE;AAOhE,MAAa,eAAe;IAQxB,MAAM,CAAC,OAAO,CAAC,GAAG;QACd,OAAO,CAAC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system/entities/form.preference.entity'
24
24
  import { ListPreferenceEntity } from '../system/entities/list.preference.entity';
25
25
  import { LookupTypeEntity } from '../system/entities/lookup.type.entity';
26
26
  import { LookupValueEntity } from '../system/entities/lookup.value.entity';
27
+ import { MailLogEntity } from '../system/entities/mail.log.entity';
27
28
  import { MenuEntity } from '../system/entities/menu.entity';
28
29
  import { MenuRoleEntity } from '../system/entities/menu.role.entity';
29
30
  import { ModelColumnEntity } from '../system/entities/model.column.entity';
@@ -84,6 +85,7 @@ declare const entityConstants: {
84
85
  adb199a467c1d3df2eee56ef45adde17: typeof ListPreferenceEntity;
85
86
  '9efb14076dca6034ab4c3255c5c63aa2': typeof LookupTypeEntity;
86
87
  ca12043141c4bbc3b08a13bd8dfa9bc8: typeof LookupValueEntity;
88
+ a3da8b74348b592a71fe3667f5d92954: typeof MailLogEntity;
87
89
  '1ef387eee5c23a8d3c8f6a3130e1c397': typeof MenuEntity;
88
90
  '0357bfa9c9022c76f5302e2274e249fe': typeof MenuRoleEntity;
89
91
  e9e8c013efaa8c7456bc2384506d86df: typeof ModelColumnEntity;
@@ -25,6 +25,7 @@ const form_preference_entity_1 = require("../system/entities/form.preference.ent
25
25
  const list_preference_entity_1 = require("../system/entities/list.preference.entity");
26
26
  const lookup_type_entity_1 = require("../system/entities/lookup.type.entity");
27
27
  const lookup_value_entity_1 = require("../system/entities/lookup.value.entity");
28
+ const mail_log_entity_1 = require("../system/entities/mail.log.entity");
28
29
  const menu_entity_1 = require("../system/entities/menu.entity");
29
30
  const menu_role_entity_1 = require("../system/entities/menu.role.entity");
30
31
  const model_column_entity_1 = require("../system/entities/model.column.entity");
@@ -85,6 +86,7 @@ const entityConstants = {
85
86
  adb199a467c1d3df2eee56ef45adde17: list_preference_entity_1.ListPreferenceEntity,
86
87
  '9efb14076dca6034ab4c3255c5c63aa2': lookup_type_entity_1.LookupTypeEntity,
87
88
  ca12043141c4bbc3b08a13bd8dfa9bc8: lookup_value_entity_1.LookupValueEntity,
89
+ a3da8b74348b592a71fe3667f5d92954: mail_log_entity_1.MailLogEntity,
88
90
  '1ef387eee5c23a8d3c8f6a3130e1c397': menu_entity_1.MenuEntity,
89
91
  '0357bfa9c9022c76f5302e2274e249fe': menu_role_entity_1.MenuRoleEntity,
90
92
  e9e8c013efaa8c7456bc2384506d86df: model_column_entity_1.ModelColumnEntity,
@@ -1 +1 @@
1
- {"version":3,"file":"entity.constants.js","sourceRoot":"","sources":["../../src/config/entity.constants.ts"],"names":[],"mappings":";AAAA,oEAAgE;AAChE,oEAAgE;AAChE,8EAAyE;AACzE,gFAA2E;AAC3E,8DAA0D;AAC1D,gFAA2E;AAC3E,8EAA0E;AAC1E,kEAA8D;AAC9D,wFAAmF;AACnF,4EAAuE;AACvE,kFAA6E;AAC7E,4FAAsF;AACtF,kEAA8D;AAC9D,kFAA6E;AAC7E,0FAAqF;AACrF,oEAAgE;AAChE,sEAAkE;AAClE,wEAAoE;AACpE,gFAA2E;AAC3E,8EAAyE;AACzE,8EAAyE;AACzE,gEAA4D;AAC5D,sFAAiF;AACjF,sFAAiF;AACjF,8EAAyE;AACzE,gFAA2E;AAC3E,gEAA4D;AAC5D,0EAAqE;AACrE,gFAA2E;AAC3E,kEAA8D;AAC9D,4FAAuF;AACvF,4EAAuE;AACvE,oEAAgE;AAChE,8EAAyE;AACzE,kFAA6E;AAC7E,sFAAiF;AACjF,8EAAyE;AACzE,gFAA2E;AAC3E,wEAAoE;AACpE,gFAA4E;AAC5E,kFAA6E;AAC7E,oEAAgE;AAChE,gFAA2E;AAC3E,8FAAyF;AACzF,8EAAyE;AACzE,sFAAiF;AACjF,oFAA+E;AAC/E,kFAA6E;AAC7E,sEAAkE;AAClE,gFAA2E;AAC3E,kFAA6E;AAC7E,0EAAqE;AACrE,gGAA0F;AAC1F,oFAA8E;AAC9E,4EAAuE;AACvE,0FAAoF;AACpF,kGAA4F;AAC5F,sFAAgF;AAChF,sFAAiF;AAEjF,MAAM,eAAe,GAAG;IACpB,kCAAkC,EAAE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,qDAAwB;IAC5D,gCAAgC,EAAE,qCAAgB;IAClD,gCAAgC,EAAE,6CAAoB;IACtD,kCAAkC,EAAE,2CAAmB;IACvD,gCAAgC,EAAE,yCAAkB;IACpD,kCAAkC,EAAE,8BAAa;IACjD,kCAAkC,EAAE,uCAAiB;IACrD,kCAAkC,EAAE,yCAAkB;IACtD,kCAAkC,EAAE,iCAAc;IAClD,kCAAkC,EAAE,sDAAwB;IAC5D,kCAAkC,EAAE,0CAAkB;IACtD,kCAAkC,EAAE,mCAAe;IACnD,kCAAkC,EAAE,gDAAqB;IACzD,kCAAkC,EAAE,wDAAyB;IAC7D,kCAAkC,EAAE,4CAAmB;IACvD,gCAAgC,EAAE,6CAAoB;CACzD,CAAC;AAEF,iBAAS,eAAe,CAAC"}
1
+ {"version":3,"file":"entity.constants.js","sourceRoot":"","sources":["../../src/config/entity.constants.ts"],"names":[],"mappings":";AAAA,oEAAgE;AAChE,oEAAgE;AAChE,8EAAyE;AACzE,gFAA2E;AAC3E,8DAA0D;AAC1D,gFAA2E;AAC3E,8EAA0E;AAC1E,kEAA8D;AAC9D,wFAAmF;AACnF,4EAAuE;AACvE,kFAA6E;AAC7E,4FAAsF;AACtF,kEAA8D;AAC9D,kFAA6E;AAC7E,0FAAqF;AACrF,oEAAgE;AAChE,sEAAkE;AAClE,wEAAoE;AACpE,gFAA2E;AAC3E,8EAAyE;AACzE,8EAAyE;AACzE,gEAA4D;AAC5D,sFAAiF;AACjF,sFAAiF;AACjF,8EAAyE;AACzE,gFAA2E;AAC3E,wEAAmE;AACnE,gEAA4D;AAC5D,0EAAqE;AACrE,gFAA2E;AAC3E,kEAA8D;AAC9D,4FAAuF;AACvF,4EAAuE;AACvE,oEAAgE;AAChE,8EAAyE;AACzE,kFAA6E;AAC7E,sFAAiF;AACjF,8EAAyE;AACzE,gFAA2E;AAC3E,wEAAoE;AACpE,gFAA4E;AAC5E,kFAA6E;AAC7E,oEAAgE;AAChE,gFAA2E;AAC3E,8FAAyF;AAC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kC,EAAE,qCAAgB;IACpD,gCAAgC,EAAE,yCAAkB;IACpD,kCAAkC,EAAE,6CAAoB;IACxD,gCAAgC,EAAE,qCAAgB;IAClD,kCAAkC,EAAE,uCAAiB;IACrD,kCAAkC,EAAE,gCAAc;IAClD,gCAAgC,EAAE,wCAAkB;IACpD,kCAAkC,EAAE,yCAAkB;IACtD,gCAAgC,EAAE,4BAAY;IAC9C,kCAAkC,EAAE,uCAAiB;IACrD,kCAAkC,EAAE,qDAAwB;IAC5D,gCAAgC,EAAE,qCAAgB;IAClD,gCAAgC,EAAE,6CAAoB;IACtD,kCAAkC,EAAE,2CAAmB;IACvD,gCAAgC,EAAE,yCAAkB;IACpD,kCAAkC,EAAE,8BAAa;IACjD,kCAAkC,EAAE,uCAAiB;IACrD,kCAAkC,EAAE,yCAAkB;IACtD,kCAAkC,EAAE,iCAAc;IAClD,kCAAkC,EAAE,sDAAwB;IAC5D,kCAAkC,EAAE,0CAAkB;IACtD,kCAAkC,EAAE,mCAAe;IACnD,kCAAkC,EAAE,gDAAqB;IACzD,kCAAkC,EAAE,wDAAyB;IAC7D,kCAAkC,EAAE,4CAAmB;IACvD,gCAAgC,EAAE,6CAAoB;CACzD,CAAC;AAEF,iBAAS,eAAe,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { MigrationUtility } from './../common/libraries/migration.utility';
2
+ export declare class CreateMailLogTable1643398296090 extends MigrationUtility {
3
+ constructor();
4
+ process(): void;
5
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateMailLogTable1643398296090 = void 0;
4
+ const migration_utility_1 = require("./../common/libraries/migration.utility");
5
+ class CreateMailLogTable1643398296090 extends migration_utility_1.MigrationUtility {
6
+ constructor() {
7
+ super('sys_mail_logs');
8
+ this.process();
9
+ }
10
+ process() {
11
+ this.primary();
12
+ this.source();
13
+ this.string('gateway');
14
+ this.string('identifier');
15
+ this.string('to');
16
+ this.dateTime('processed_on');
17
+ this.dateTime('delivered_on');
18
+ this.dateTime('opened_on');
19
+ this.json('attributes');
20
+ this.whoColumns();
21
+ this.index(['identifier']);
22
+ }
23
+ }
24
+ exports.CreateMailLogTable1643398296090 = CreateMailLogTable1643398296090;
25
+ //# sourceMappingURL=1643398296090-CreateMailLogTable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1643398296090-CreateMailLogTable.js","sourceRoot":"","sources":["../../src/migrations/1643398296090-CreateMailLogTable.ts"],"names":[],"mappings":";;;AAAA,+EAA2E;AAE3E,MAAa,+BAAgC,SAAQ,oCAAgB;IACjE;QACI,KAAK,CAAC,eAAe,CAAC,CAAC;QACvB,IAAI,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;IAED,OAAO;QACH,IAAI,CAAC,OAAO,EAAE,CAAC;QACf,IAAI,CAAC,MAAM,EAAE,CAAC;QAEd,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACvB,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QAE1B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAElB,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;QAC9B,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;QAC9B,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QAE3B,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAExB,IAAI,CAAC,UAAU,EAAE,CAAC;QAElB,IAAI,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;IAC/B,CAAC;CACJ;AAzBD,0EAyBC"}
@@ -2,3 +2,4 @@ export * from './fcm.response.dto';
2
2
  export * from './push.notification.response.dto';
3
3
  export * from './push.notification.template.dto';
4
4
  export * from './queue.options.dto';
5
+ export * from './mail.options.dto';
@@ -14,4 +14,5 @@ __exportStar(require("./fcm.response.dto"), exports);
14
14
  __exportStar(require("./push.notification.response.dto"), exports);
15
15
  __exportStar(require("./push.notification.template.dto"), exports);
16
16
  __exportStar(require("./queue.options.dto"), exports);
17
+ __exportStar(require("./mail.options.dto"), exports);
17
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platformUtility/dtos/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAmC;AACnC,mEAAiD;AACjD,mEAAiD;AACjD,sDAAoC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platformUtility/dtos/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAmC;AACnC,mEAAiD;AACjD,mEAAiD;AACjD,sDAAoC;AACpC,qDAAmC"}
@@ -0,0 +1,13 @@
1
+ export declare class MailOptionsDto {
2
+ to?: string;
3
+ from?: string;
4
+ subject: string;
5
+ html?: string;
6
+ text?: string;
7
+ files?: {
8
+ file: string;
9
+ name?: string;
10
+ }[];
11
+ bcc?: string;
12
+ cc?: string;
13
+ }
@@ -0,0 +1,59 @@
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.MailOptionsDto = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ class MailOptionsDto {
16
+ }
17
+ __decorate([
18
+ (0, class_validator_1.IsOptional)(),
19
+ (0, class_transformer_1.Expose)(),
20
+ __metadata("design:type", String)
21
+ ], MailOptionsDto.prototype, "to", void 0);
22
+ __decorate([
23
+ (0, class_validator_1.IsOptional)(),
24
+ (0, class_transformer_1.Expose)(),
25
+ __metadata("design:type", String)
26
+ ], MailOptionsDto.prototype, "from", void 0);
27
+ __decorate([
28
+ (0, class_validator_1.IsOptional)(),
29
+ (0, class_transformer_1.Expose)(),
30
+ __metadata("design:type", String)
31
+ ], MailOptionsDto.prototype, "subject", void 0);
32
+ __decorate([
33
+ (0, class_validator_1.IsOptional)(),
34
+ (0, class_transformer_1.Expose)(),
35
+ __metadata("design:type", String)
36
+ ], MailOptionsDto.prototype, "html", void 0);
37
+ __decorate([
38
+ (0, class_validator_1.IsOptional)(),
39
+ (0, class_transformer_1.Expose)(),
40
+ __metadata("design:type", String)
41
+ ], MailOptionsDto.prototype, "text", void 0);
42
+ __decorate([
43
+ (0, class_validator_1.IsOptional)(),
44
+ (0, class_transformer_1.Expose)(),
45
+ (0, class_validator_1.IsArray)(),
46
+ __metadata("design:type", Array)
47
+ ], MailOptionsDto.prototype, "files", void 0);
48
+ __decorate([
49
+ (0, class_validator_1.IsOptional)(),
50
+ (0, class_transformer_1.Expose)(),
51
+ __metadata("design:type", String)
52
+ ], MailOptionsDto.prototype, "bcc", void 0);
53
+ __decorate([
54
+ (0, class_validator_1.IsOptional)(),
55
+ (0, class_transformer_1.Expose)(),
56
+ __metadata("design:type", String)
57
+ ], MailOptionsDto.prototype, "cc", void 0);
58
+ exports.MailOptionsDto = MailOptionsDto;
59
+ //# sourceMappingURL=mail.options.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mail.options.dto.js","sourceRoot":"","sources":["../../../src/platformUtility/dtos/mail.options.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA2C;AAC3C,qDAAsD;AACtD,MAAa,cAAc;CAiC1B;AA9BG;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAM,GAAE;;0CACG;AAIZ;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAM,GAAE;;4CACK;AAId;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAM,GAAE;;+CACO;AAIhB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAM,GAAE;;4CACK;AAId;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAM,GAAE;;4CACK;AAKd;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAM,GAAE;IACR,IAAA,yBAAO,GAAE;;6CACgC;AAI1C;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAM,GAAE;;2CACI;AAIb;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAM,GAAE;;0CACG;AAhChB,wCAiCC"}
@@ -4,6 +4,7 @@ import { SyncClassCommand } from './commands/sync.class.command';
4
4
  import { EventConsumer } from './consumers/event.consumer';
5
5
  import { JobConsumer } from './consumers/job.consumer';
6
6
  import { FcmResponseDto } from './dtos/fcm.response.dto';
7
+ import { MailOptionsDto } from './dtos/mail.options.dto';
7
8
  import { PushNotificationResponseDto } from './dtos/push.notification.response.dto';
8
9
  import { PushNotificationTemplateDto } from './dtos/push.notification.template.dto';
9
10
  import { QueueOptionsDto } from './dtos/queue.options.dto';
@@ -33,11 +34,11 @@ import { BaseSubscriber } from './subscribers/base.subscriber';
33
34
  declare const es6Classes: {
34
35
  commands: (typeof EntityGeneratorCommand | typeof MaintenanceCommand | typeof SyncClassCommand)[];
35
36
  consumers: (typeof EventConsumer | typeof JobConsumer)[];
36
- dtos: (typeof QueueOptionsDto | typeof FcmResponseDto | typeof PushNotificationResponseDto | typeof PushNotificationTemplateDto)[];
37
+ dtos: (typeof QueueOptionsDto | typeof MailOptionsDto | typeof FcmResponseDto | typeof PushNotificationResponseDto | typeof PushNotificationTemplateDto)[];
37
38
  jobs: (typeof RecordWatcherJob)[];
38
39
  libraries: (typeof FileSystemUtility | typeof CreateIndexFile | typeof CreateEntityConstantsFile | typeof CreateEs6ClassesFile | typeof CreateEs6JobsFile | typeof CreateEs6ServiceFile)[];
39
40
  middlewares: (typeof MaintenanceMiddleware)[];
40
- services: (typeof MaintenanceService | typeof ShutdownService | typeof CacheService | typeof QueueService | typeof RemoteRequestService | typeof SqlService | typeof DynamoService | typeof AuditService | typeof LocalPropertyService | typeof Es6JobsService | typeof FcmNotificationService | typeof MailService | typeof StartupService | typeof Es6Service)[];
41
+ services: (typeof LocalPropertyService | typeof MaintenanceService | typeof ShutdownService | typeof CacheService | typeof QueueService | typeof DynamoService | typeof MailService | typeof RemoteRequestService | typeof SqlService | typeof AuditService | typeof FcmNotificationService | typeof StartupService | typeof Es6JobsService | typeof Es6Service)[];
41
42
  subscribers: (typeof BaseSubscriber)[];
42
43
  };
43
44
  export default es6Classes;
@@ -6,6 +6,7 @@ const sync_class_command_1 = require("./commands/sync.class.command");
6
6
  const event_consumer_1 = require("./consumers/event.consumer");
7
7
  const job_consumer_1 = require("./consumers/job.consumer");
8
8
  const fcm_response_dto_1 = require("./dtos/fcm.response.dto");
9
+ const mail_options_dto_1 = require("./dtos/mail.options.dto");
9
10
  const push_notification_response_dto_1 = require("./dtos/push.notification.response.dto");
10
11
  const push_notification_template_dto_1 = require("./dtos/push.notification.template.dto");
11
12
  const queue_options_dto_1 = require("./dtos/queue.options.dto");
@@ -35,7 +36,7 @@ const base_subscriber_1 = require("./subscribers/base.subscriber");
35
36
  const es6Classes = {
36
37
  commands: [entity_generator_command_1.EntityGeneratorCommand, maintenance_command_1.MaintenanceCommand, sync_class_command_1.SyncClassCommand],
37
38
  consumers: [event_consumer_1.EventConsumer, job_consumer_1.JobConsumer],
38
- dtos: [fcm_response_dto_1.FcmResponseDto, push_notification_response_dto_1.PushNotificationResponseDto, push_notification_template_dto_1.PushNotificationTemplateDto, queue_options_dto_1.QueueOptionsDto],
39
+ dtos: [fcm_response_dto_1.FcmResponseDto, mail_options_dto_1.MailOptionsDto, push_notification_response_dto_1.PushNotificationResponseDto, push_notification_template_dto_1.PushNotificationTemplateDto, queue_options_dto_1.QueueOptionsDto],
39
40
  jobs: [record_watcher_job_1.RecordWatcherJob],
40
41
  libraries: [create_entity_constants_file_1.CreateEntityConstantsFile, create_es6_classes_file_1.CreateEs6ClassesFile, create_es6_jobs_file_1.CreateEs6JobsFile, create_es6_service_file_1.CreateEs6ServiceFile, create_index_file_1.CreateIndexFile, file_system_utility_1.FileSystemUtility],
41
42
  middlewares: [maintenance_middleware_1.MaintenanceMiddleware],
@@ -1 +1 @@
1
- {"version":3,"file":"es6.classes.js","sourceRoot":"","sources":["../../src/platformUtility/es6.classes.ts"],"names":[],"mappings":";;AAAA,kFAA6E;AAC7E,wEAAoE;AACpE,sEAAiE;AACjE,+DAA2D;AAC3D,2DAAuD;AACvD,8DAAyD;AACzD,0FAAoF;AACpF,0FAAoF;AACpF,gEAA2D;AAC3D,kEAA6D;AAC7D,2FAAqF;AACrF,iFAA2E;AAC3E,2EAAqE;AACrE,iFAA2E;AAC3E,qEAAgE;AAChE,yEAAoE;AACpE,iFAA6E;AAC7E,4DAAwD;AACxD,4DAAwD;AACxD,8DAA0D;AAC1D,kEAA6D;AAC7D,wDAAoD;AACpD,kFAA6E;AAC7E,8EAAyE;AACzE,0DAAsD;AACtD,wEAAoE;AACpE,4DAAwD;AACxD,8EAAyE;AACzE,kEAA8D;AAC9D,wDAAoD;AACpD,gEAA4D;AAC5D,mEAA+D;AAE/D,MAAM,UAAU,GAAG;IACf,QAAQ,EAAE,CAAC,iDAAsB,EAAE,wCAAkB,EAAE,qCAAgB,CAAC;IACxE,SAAS,EAAE,CAAC,8BAAa,EAAE,0BAAW,CAAC;IACvC,IAAI,EAAE,CAAC,iCAAc,EAAE,4DAA2B,EAAE,4DAA2B,EAAE,mCAAe,CAAC;IACjG,IAAI,EAAE,CAAC,qCAAgB,CAAC;IACxB,SAAS,EAAE,CAAC,wDAAyB,EAAE,8CAAoB,EAAE,wCAAiB,EAAE,8CAAoB,EAAE,mCAAe,EAAE,uCAAiB,CAAC;IACzI,WAAW,EAAE,CAAC,8CAAqB,CAAC;IACpC,QAAQ,EAAE;QACN,4BAAY;QACZ,4BAAY;QACZ,8BAAa;QACb,iCAAc;QACd,wBAAU;QACV,iDAAsB;QACtB,6CAAoB;QACpB,0BAAW;QACX,wCAAkB;QAClB,4BAAY;QACZ,6CAAoB;QACpB,kCAAe;QACf,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,kFAA6E;AAC7E,wEAAoE;AACpE,sEAAiE;AACjE,+DAA2D;AAC3D,2DAAuD;AACvD,8DAAyD;AACzD,8DAAyD;AACzD,0FAAoF;AACpF,0FAAoF;AACpF,gEAA2D;AAC3D,kEAA6D;AAC7D,2FAAqF;AACrF,iFAA2E;AAC3E,2EAAqE;AACrE,iFAA2E;AAC3E,qEAAgE;AAChE,yEAAoE;AACpE,iFAA6E;AAC7E,4DAAwD;AACxD,4DAAwD;AACxD,8DAA0D;AAC1D,kEAA6D;AAC7D,wDAAoD;AACpD,kFAA6E;AAC7E,8EAAyE;AACzE,0DAAsD;AACtD,wEAAoE;AACpE,4DAAwD;AACxD,8EAAyE;AACzE,kEAA8D;AAC9D,wDAAoD;AACpD,gEAA4D;AAC5D,mEAA+D;AAE/D,MAAM,UAAU,GAAG;IACf,QAAQ,EAAE,CAAC,iDAAsB,EAAE,wCAAkB,EAAE,qCAAgB,CAAC;IACxE,SAAS,EAAE,CAAC,8BAAa,EAAE,0BAAW,CAAC;IACvC,IAAI,EAAE,CAAC,iCAAc,EAAE,iCAAc,EAAE,4DAA2B,EAAE,4DAA2B,EAAE,mCAAe,CAAC;IACjH,IAAI,EAAE,CAAC,qCAAgB,CAAC;IACxB,SAAS,EAAE,CAAC,wDAAyB,EAAE,8CAAoB,EAAE,wCAAiB,EAAE,8CAAoB,EAAE,mCAAe,EAAE,uCAAiB,CAAC;IACzI,WAAW,EAAE,CAAC,8CAAqB,CAAC;IACpC,QAAQ,EAAE;QACN,4BAAY;QACZ,4BAAY;QACZ,8BAAa;QACb,iCAAc;QACd,wBAAU;QACV,iDAAsB;QACtB,6CAAoB;QACpB,0BAAW;QACX,wCAAkB;QAClB,4BAAY;QACZ,6CAAoB;QACpB,kCAAe;QACf,wBAAU;QACV,gCAAc;KACjB;IACD,WAAW,EAAE,CAAC,gCAAc,CAAC;CAChC,CAAC;AAEF,kBAAe,UAAU,CAAC"}
@@ -10,3 +10,4 @@ export * from './remote.request.service';
10
10
  export * from './shutdown.service';
11
11
  export * from './sql.service';
12
12
  export * from './startup.service';
13
+ export * from './mail.service';
@@ -22,4 +22,5 @@ __exportStar(require("./remote.request.service"), exports);
22
22
  __exportStar(require("./shutdown.service"), exports);
23
23
  __exportStar(require("./sql.service"), exports);
24
24
  __exportStar(require("./startup.service"), exports);
25
+ __exportStar(require("./mail.service"), exports);
25
26
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platformUtility/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAAgC;AAChC,kDAAgC;AAChC,mDAAiC;AACjC,6DAA2C;AAC3C,2DAAyC;AACzC,iDAA+B;AAC/B,wDAAsC;AACtC,kDAAgC;AAChC,2DAAyC;AACzC,qDAAmC;AACnC,gDAA8B;AAC9B,oDAAkC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platformUtility/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAAgC;AAChC,kDAAgC;AAChC,mDAAiC;AACjC,6DAA2C;AAC3C,2DAAyC;AACzC,iDAA+B;AAC/B,wDAAsC;AACtC,kDAAgC;AAChC,2DAAyC;AACzC,qDAAmC;AACnC,gDAA8B;AAC9B,oDAAkC;AAClC,iDAA+B"}
@@ -2,4 +2,7 @@ export declare class LocalPropertyService {
2
2
  constructor();
3
3
  set(key: string, value: any): any;
4
4
  get(key: any): any;
5
+ getEntity(hash: string): any;
6
+ getJob(hash: string): any;
7
+ getService(hash: string): any;
5
8
  }
@@ -10,6 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.LocalPropertyService = void 0;
13
+ const platform_utility_1 = require("./../../common/libraries/platform.utility");
13
14
  const common_1 = require("@nestjs/common");
14
15
  const platform_constants_1 = require("../../config/platform.constants");
15
16
  const entityConstants = require("../../config/entity.constants");
@@ -24,6 +25,15 @@ let LocalPropertyService = class LocalPropertyService {
24
25
  get(key) {
25
26
  return platform_constants_1.default[key];
26
27
  }
28
+ getEntity(hash) {
29
+ return platform_utility_1.PlatformUtility.getEntity(hash);
30
+ }
31
+ getJob(hash) {
32
+ return platform_utility_1.PlatformUtility.getJob(hash);
33
+ }
34
+ getService(hash) {
35
+ return platform_utility_1.PlatformUtility.getService(hash);
36
+ }
27
37
  };
28
38
  LocalPropertyService = __decorate([
29
39
  (0, common_1.Injectable)(),
@@ -1 +1 @@
1
- {"version":3,"file":"local.property.service.js","sourceRoot":"","sources":["../../../src/platformUtility/services/local.property.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,wEAAgE;AAChE,iEAAkE;AAQlE,IAAa,oBAAoB,GAAjC,MAAa,oBAAoB;IAK7B;QAEI,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;IAC1C,CAAC;IAQD,GAAG,CAAC,GAAW,EAAE,KAAU;QACvB,4BAAiB,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QAC/B,OAAO,KAAK,CAAC;IACjB,CAAC;IAQD,GAAG,CAAC,GAAG;QACH,OAAO,4BAAiB,CAAC,GAAG,CAAC,CAAC;IAClC,CAAC;CACJ,CAAA;AA9BY,oBAAoB;IADhC,IAAA,mBAAU,GAAE;;GACA,oBAAoB,CA8BhC;AA9BY,oDAAoB"}
1
+ {"version":3,"file":"local.property.service.js","sourceRoot":"","sources":["../../../src/platformUtility/services/local.property.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gFAA4E;AAC5E,2CAA4C;AAC5C,wEAAgE;AAChE,iEAAkE;AAQlE,IAAa,oBAAoB,GAAjC,MAAa,oBAAoB;IAK7B;QAEI,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;IAC1C,CAAC;IAQD,GAAG,CAAC,GAAW,EAAE,KAAU;QACvB,4BAAiB,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QAC/B,OAAO,KAAK,CAAC;IACjB,CAAC;IAQD,GAAG,CAAC,GAAG;QACH,OAAO,4BAAiB,CAAC,GAAG,CAAC,CAAC;IAClC,CAAC;IAQD,SAAS,CAAC,IAAY;QAClB,OAAO,kCAAe,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAQD,MAAM,CAAC,IAAY;QACf,OAAO,kCAAe,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IAQD,UAAU,CAAC,IAAY;QACnB,OAAO,kCAAe,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAC5C,CAAC;CACJ,CAAA;AA5DY,oBAAoB;IADhC,IAAA,mBAAU,GAAE;;GACA,oBAAoB,CA4DhC;AA5DY,oDAAoB"}
@@ -1,3 +1,14 @@
1
+ import { DynamoService } from './dynamo.service';
2
+ import { MailLogEntity } from './../../system/entities/mail.log.entity';
3
+ import { MailOptionsDto } from './../dtos/mail.options.dto';
1
4
  export declare class MailService {
2
- send(html: string): Promise<void>;
5
+ private readonly dynamoService;
6
+ constructor(dynamoService: DynamoService);
7
+ send(options: MailOptionsDto, metadata?: any): Promise<MailLogEntity>;
8
+ private saveToDynamo;
9
+ private sendMailViaSendgrid;
10
+ private getAttachments;
11
+ private getFileBuffer;
12
+ private getLocalFileBuffer;
13
+ private getNetworkFileBuffer;
3
14
  }
@@ -5,6 +5,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
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
6
  return c > 3 && r && Object.defineProperty(target, key, r), r;
7
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
+ };
8
11
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
9
12
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
10
13
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -16,15 +19,99 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
16
19
  };
17
20
  Object.defineProperty(exports, "__esModule", { value: true });
18
21
  exports.MailService = void 0;
22
+ const dynamo_service_1 = require("./dynamo.service");
23
+ const class_transformer_1 = require("class-transformer");
24
+ const mail_log_entity_1 = require("./../../system/entities/mail.log.entity");
19
25
  const common_1 = require("@nestjs/common");
26
+ const axios_1 = require("axios");
27
+ const class_validator_1 = require("class-validator");
28
+ const config = require("config");
29
+ const fs_1 = require("fs");
30
+ const sgMail = require('@sendgrid/mail');
31
+ const mailConfig = config.get('mail');
20
32
  let MailService = class MailService {
21
- send(html) {
33
+ constructor(dynamoService) {
34
+ this.dynamoService = dynamoService;
35
+ }
36
+ send(options, metadata) {
37
+ return __awaiter(this, void 0, void 0, function* () {
38
+ const response = yield this.sendMailViaSendgrid(options);
39
+ const body = { gateway: 'sendgrid', identifier: response[0].headers['x-message-id'], to: options.to };
40
+ const log = (0, class_transformer_1.plainToClass)(mail_log_entity_1.MailLogEntity, Object.assign(Object.assign({}, body), metadata));
41
+ yield log.save();
42
+ yield this.saveToDynamo(log, options, response);
43
+ return log;
44
+ });
45
+ }
46
+ saveToDynamo(log, options, response) {
47
+ const dynamoItem = { entity_hash: 'a3da8b74348b592a71fe3667f5d92954', entity_id: log.id, options, response };
48
+ return this.dynamoService.setItem('sk_entity_records', dynamoItem);
49
+ }
50
+ sendMailViaSendgrid(options) {
51
+ return __awaiter(this, void 0, void 0, function* () {
52
+ sgMail.setApiKey(mailConfig.sendgrid);
53
+ const attachments = yield this.getAttachments(options.files);
54
+ const msg = Object.assign(Object.assign({}, options), {
55
+ from: mailConfig.from,
56
+ attachments,
57
+ });
58
+ return new Promise((resolve, reject) => {
59
+ sgMail
60
+ .send(msg)
61
+ .then((res) => {
62
+ resolve(res);
63
+ })
64
+ .catch((error) => {
65
+ reject(error);
66
+ });
67
+ });
68
+ });
69
+ }
70
+ getAttachments(files) {
71
+ var _a;
72
+ return __awaiter(this, void 0, void 0, function* () {
73
+ if (!files)
74
+ return [];
75
+ const attachments = [];
76
+ for (const file of files) {
77
+ const content = yield this.getFileBuffer(file.file);
78
+ const filename = (_a = file.name) !== null && _a !== void 0 ? _a : file.file.split('/').pop();
79
+ attachments.push({
80
+ content,
81
+ filename,
82
+ type: 'application/pdf',
83
+ disposition: 'attachment',
84
+ });
85
+ }
86
+ return attachments;
87
+ });
88
+ }
89
+ getFileBuffer(file) {
90
+ return __awaiter(this, void 0, void 0, function* () {
91
+ if ((0, class_validator_1.isURL)(file))
92
+ return this.getNetworkFileBuffer(file);
93
+ return this.getLocalFileBuffer(file);
94
+ });
95
+ }
96
+ getLocalFileBuffer(file) {
97
+ return __awaiter(this, void 0, void 0, function* () {
98
+ return (0, fs_1.readFileSync)(file).toString('base64');
99
+ });
100
+ }
101
+ getNetworkFileBuffer(url) {
22
102
  return __awaiter(this, void 0, void 0, function* () {
103
+ const response = yield (0, axios_1.default)({
104
+ url,
105
+ method: 'GET',
106
+ responseType: 'arraybuffer',
107
+ });
108
+ return Buffer.from(response.data, 'binary').toString('base64');
23
109
  });
24
110
  }
25
111
  };
26
112
  MailService = __decorate([
27
- (0, common_1.Injectable)()
113
+ (0, common_1.Injectable)(),
114
+ __metadata("design:paramtypes", [dynamo_service_1.DynamoService])
28
115
  ], MailService);
29
116
  exports.MailService = MailService;
30
117
  //# sourceMappingURL=mail.service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mail.service.js","sourceRoot":"","sources":["../../../src/platformUtility/services/mail.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,2CAA4C;AAG5C,IAAa,WAAW,GAAxB,MAAa,WAAW;IACd,IAAI,CAAC,IAAY;;QAsBvB,CAAC;KAAA;CACJ,CAAA;AAxBY,WAAW;IADvB,IAAA,mBAAU,GAAE;GACA,WAAW,CAwBvB;AAxBY,kCAAW"}
1
+ {"version":3,"file":"mail.service.js","sourceRoot":"","sources":["../../../src/platformUtility/services/mail.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,qDAAiD;AACjD,yDAAiD;AACjD,6EAAwE;AACxE,2CAA4C;AAC5C,iCAA0B;AAC1B,qDAAgD;AAChD,iCAAiC;AACjC,2BAAkC;AAIlC,MAAM,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AACzC,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAQtC,IAAa,WAAW,GAAxB,MAAa,WAAW;IAMpB,YAA6B,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IAAG,CAAC;IASvD,IAAI,CAAC,OAAuB,EAAE,QAAc;;YAC9C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;YAEzD,MAAM,IAAI,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC;YACtG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from 'bull';
2
3
  import { QueueOptionsDto } from '../dtos/queue.options.dto';
3
4
  import { MaintenanceService } from './maintenance.service';
@@ -8,10 +9,11 @@ export declare class QueueService {
8
9
  private readonly maintenanceService;
9
10
  private readonly shutdownService;
10
11
  private readonly cacheService;
12
+ private readonly localPropertyService;
11
13
  data: any;
12
14
  private restartIdentifier;
13
15
  private logger;
14
- constructor(businessQueue: Queue, maintenanceService: MaintenanceService, shutdownService: ShutdownService, cacheService: CacheService);
16
+ constructor(businessQueue: Queue, maintenanceService: MaintenanceService, shutdownService: ShutdownService, cacheService: CacheService, localPropertyService: LocalPropertyService);
15
17
  add(type: string, data: any, options?: QueueOptionsDto): Promise<Job>;
16
18
  getStats(): Promise<any>;
17
19
  addJob(type: string, data: any, options?: QueueOptionsDto): Promise<Job>;
@@ -22,6 +22,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
22
22
  };
23
23
  Object.defineProperty(exports, "__esModule", { value: true });
24
24
  exports.QueueService = void 0;
25
+ const operation_exception_1 = require("./../../common/exceptions/operation.exception");
26
+ const local_property_service_1 = require("./local.property.service");
25
27
  const bull_1 = require("@nestjs/bull");
26
28
  const common_1 = require("@nestjs/common");
27
29
  const date_util_1 = require("../../common/libraries/date.util");
@@ -31,11 +33,12 @@ const shutdown_service_1 = require("./shutdown.service");
31
33
  const cache_service_1 = require("./cache.service");
32
34
  const queueName = platform_constants_1.default.queue;
33
35
  let QueueService = class QueueService {
34
- constructor(businessQueue, maintenanceService, shutdownService, cacheService) {
36
+ constructor(businessQueue, maintenanceService, shutdownService, cacheService, localPropertyService) {
35
37
  this.businessQueue = businessQueue;
36
38
  this.maintenanceService = maintenanceService;
37
39
  this.shutdownService = shutdownService;
38
40
  this.cacheService = cacheService;
41
+ this.localPropertyService = localPropertyService;
39
42
  this.data = {};
40
43
  this.restartIdentifier = 'queue_restart_time';
41
44
  this.logger = new common_1.Logger('EventQueueManager');
@@ -60,10 +63,13 @@ let QueueService = class QueueService {
60
63
  }
61
64
  addJob(type, data, options) {
62
65
  return __awaiter(this, void 0, void 0, function* () {
66
+ const jobInstance = this.localPropertyService.getJob(type);
67
+ if (!jobInstance)
68
+ throw new operation_exception_1.OperationException(`trying to dispatch job which is not available`);
63
69
  const payload = {
64
70
  job: type,
65
71
  payload: data,
66
- name: platform_constants_1.default.jobs[type].constructor.name,
72
+ name: jobInstance.constructor.name,
67
73
  };
68
74
  options = options !== null && options !== void 0 ? options : {};
69
75
  return this.businessQueue.add('generic.job.trigger', payload, options);
@@ -251,7 +257,8 @@ QueueService = __decorate([
251
257
  __param(0, (0, bull_1.InjectQueue)(queueName)),
252
258
  __metadata("design:paramtypes", [Object, maintenance_service_1.MaintenanceService,
253
259
  shutdown_service_1.ShutdownService,
254
- cache_service_1.CacheService])
260
+ cache_service_1.CacheService,
261
+ local_property_service_1.LocalPropertyService])
255
262
  ], QueueService);
256
263
  exports.QueueService = QueueService;
257
264
  //# sourceMappingURL=queue.service.js.map