@servicelabsco/slabs-access-manager 0.1.169 → 0.1.171

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 (157) hide show
  1. package/dist/access/controllers/business.notification.channel.preference.controller.d.ts +17 -0
  2. package/dist/access/controllers/business.notification.channel.preference.controller.js +112 -0
  3. package/dist/access/controllers/business.notification.channel.preference.controller.js.map +1 -0
  4. package/dist/access/controllers/business.user.notification.preference.controller.d.ts +21 -0
  5. package/dist/access/controllers/business.user.notification.preference.controller.js +138 -0
  6. package/dist/access/controllers/business.user.notification.preference.controller.js.map +1 -0
  7. package/dist/access/controllers/business.webhook.controller.d.ts +13 -0
  8. package/dist/access/controllers/business.webhook.controller.js +81 -0
  9. package/dist/access/controllers/business.webhook.controller.js.map +1 -0
  10. package/dist/access/controllers/index.d.ts +3 -0
  11. package/dist/access/controllers/index.js +3 -0
  12. package/dist/access/controllers/index.js.map +1 -1
  13. package/dist/access/dtos/add.business.user.notification.preference.dto.d.ts +6 -0
  14. package/dist/access/dtos/add.business.user.notification.preference.dto.js +43 -0
  15. package/dist/access/dtos/add.business.user.notification.preference.dto.js.map +1 -0
  16. package/dist/access/dtos/add.notification.channel.preference.dto.d.ts +6 -0
  17. package/dist/access/dtos/add.notification.channel.preference.dto.js +43 -0
  18. package/dist/access/dtos/add.notification.channel.preference.dto.js.map +1 -0
  19. package/dist/access/dtos/add.webhook.dto.d.ts +5 -0
  20. package/dist/access/dtos/add.webhook.dto.js +36 -0
  21. package/dist/access/dtos/add.webhook.dto.js.map +1 -0
  22. package/dist/access/dtos/business.notification.channel.preference.list.filter.dto.d.ts +4 -0
  23. package/dist/access/dtos/business.notification.channel.preference.list.filter.dto.js +25 -0
  24. package/dist/access/dtos/business.notification.channel.preference.list.filter.dto.js.map +1 -0
  25. package/dist/access/dtos/business.user.notification.preference.attributes.dto.d.ts +3 -0
  26. package/dist/access/dtos/business.user.notification.preference.attributes.dto.js +8 -0
  27. package/dist/access/dtos/business.user.notification.preference.attributes.dto.js.map +1 -0
  28. package/dist/access/dtos/business.user.notification.preference.list.filter.dto.d.ts +5 -0
  29. package/dist/access/dtos/business.user.notification.preference.list.filter.dto.js +31 -0
  30. package/dist/access/dtos/business.user.notification.preference.list.filter.dto.js.map +1 -0
  31. package/dist/access/dtos/business.webhook.attributes.dto.d.ts +3 -0
  32. package/dist/access/dtos/business.webhook.attributes.dto.js +8 -0
  33. package/dist/access/dtos/business.webhook.attributes.dto.js.map +1 -0
  34. package/dist/access/dtos/bz.notification.channel.preference.attributes.dto.d.ts +3 -0
  35. package/dist/access/dtos/bz.notification.channel.preference.attributes.dto.js +8 -0
  36. package/dist/access/dtos/bz.notification.channel.preference.attributes.dto.js.map +1 -0
  37. package/dist/access/dtos/index.d.ts +11 -0
  38. package/dist/access/dtos/index.js +11 -0
  39. package/dist/access/dtos/index.js.map +1 -1
  40. package/dist/access/dtos/send.webhook.request.payload.d.ts +4 -0
  41. package/dist/access/dtos/send.webhook.request.payload.js +7 -0
  42. package/dist/access/dtos/send.webhook.request.payload.js.map +1 -0
  43. package/dist/access/dtos/webhook.event.attributes.dto.d.ts +3 -0
  44. package/dist/access/dtos/webhook.event.attributes.dto.js +8 -0
  45. package/dist/access/dtos/webhook.event.attributes.dto.js.map +1 -0
  46. package/dist/access/dtos/webhook.log.attributes.dto.d.ts +3 -0
  47. package/dist/access/dtos/webhook.log.attributes.dto.js +8 -0
  48. package/dist/access/dtos/webhook.log.attributes.dto.js.map +1 -0
  49. package/dist/access/entities/app.integration.entity.d.ts +1 -0
  50. package/dist/access/entities/app.integration.entity.js +4 -0
  51. package/dist/access/entities/app.integration.entity.js.map +1 -1
  52. package/dist/access/entities/business.user.notification.preference.entity.d.ts +15 -0
  53. package/dist/access/entities/business.user.notification.preference.entity.js +68 -0
  54. package/dist/access/entities/business.user.notification.preference.entity.js.map +1 -0
  55. package/dist/access/entities/business.webhook.entity.d.ts +12 -0
  56. package/dist/access/entities/business.webhook.entity.js +52 -0
  57. package/dist/access/entities/business.webhook.entity.js.map +1 -0
  58. package/dist/access/entities/bz.notification.channel.preference.entity.d.ts +13 -0
  59. package/dist/access/entities/bz.notification.channel.preference.entity.js +59 -0
  60. package/dist/access/entities/bz.notification.channel.preference.entity.js.map +1 -0
  61. package/dist/access/entities/index.d.ts +5 -0
  62. package/dist/access/entities/index.js +5 -0
  63. package/dist/access/entities/index.js.map +1 -1
  64. package/dist/access/entities/webhook.event.entity.d.ts +9 -0
  65. package/dist/access/entities/webhook.event.entity.js +42 -0
  66. package/dist/access/entities/webhook.event.entity.js.map +1 -0
  67. package/dist/access/entities/webhook.log.entity.d.ts +16 -0
  68. package/dist/access/entities/webhook.log.entity.js +66 -0
  69. package/dist/access/entities/webhook.log.entity.js.map +1 -0
  70. package/dist/access/enums/index.d.ts +1 -0
  71. package/dist/access/enums/index.js +1 -0
  72. package/dist/access/enums/index.js.map +1 -1
  73. package/dist/access/enums/notification.channel.type.enum.d.ts +7 -0
  74. package/dist/access/enums/notification.channel.type.enum.js +12 -0
  75. package/dist/access/enums/notification.channel.type.enum.js.map +1 -0
  76. package/dist/access/es6.classes.d.ts +30 -8
  77. package/dist/access/es6.classes.js +67 -2
  78. package/dist/access/es6.classes.js.map +1 -1
  79. package/dist/access/jobs/business.user.notification.preference.job.d.ts +7 -0
  80. package/dist/access/jobs/business.user.notification.preference.job.js +29 -0
  81. package/dist/access/jobs/business.user.notification.preference.job.js.map +1 -0
  82. package/dist/access/jobs/business.webhook.job.d.ts +7 -0
  83. package/dist/access/jobs/business.webhook.job.js +29 -0
  84. package/dist/access/jobs/business.webhook.job.js.map +1 -0
  85. package/dist/access/jobs/bz.notification.channel.preference.job.d.ts +7 -0
  86. package/dist/access/jobs/bz.notification.channel.preference.job.js +29 -0
  87. package/dist/access/jobs/bz.notification.channel.preference.job.js.map +1 -0
  88. package/dist/access/jobs/index.d.ts +5 -0
  89. package/dist/access/jobs/index.js +5 -0
  90. package/dist/access/jobs/index.js.map +1 -1
  91. package/dist/access/jobs/webhook.event.job.d.ts +7 -0
  92. package/dist/access/jobs/webhook.event.job.js +29 -0
  93. package/dist/access/jobs/webhook.event.job.js.map +1 -0
  94. package/dist/access/jobs/webhook.log.job.d.ts +7 -0
  95. package/dist/access/jobs/webhook.log.job.js +29 -0
  96. package/dist/access/jobs/webhook.log.job.js.map +1 -0
  97. package/dist/access/libraries/business.notification.channel.preference.list.d.ts +21 -0
  98. package/dist/access/libraries/business.notification.channel.preference.list.js +41 -0
  99. package/dist/access/libraries/business.notification.channel.preference.list.js.map +1 -0
  100. package/dist/access/libraries/business.user.notification.preference.list.d.ts +22 -0
  101. package/dist/access/libraries/business.user.notification.preference.list.js +47 -0
  102. package/dist/access/libraries/business.user.notification.preference.list.js.map +1 -0
  103. package/dist/access/libraries/index.d.ts +3 -0
  104. package/dist/access/libraries/index.js +3 -0
  105. package/dist/access/libraries/index.js.map +1 -1
  106. package/dist/access/libraries/send.webhook.request.d.ts +20 -0
  107. package/dist/access/libraries/send.webhook.request.js +71 -0
  108. package/dist/access/libraries/send.webhook.request.js.map +1 -0
  109. package/dist/access/services/es6.jobs.service.d.ts +11 -1
  110. package/dist/access/services/es6.jobs.service.js +21 -1
  111. package/dist/access/services/es6.jobs.service.js.map +1 -1
  112. package/dist/access/services/webhook.service.d.ts +5 -2
  113. package/dist/access/services/webhook.service.js +12 -2
  114. package/dist/access/services/webhook.service.js.map +1 -1
  115. package/dist/access/subscribers/business.user.notification.preference.subscriber.d.ts +10 -0
  116. package/dist/access/subscribers/business.user.notification.preference.subscriber.js +34 -0
  117. package/dist/access/subscribers/business.user.notification.preference.subscriber.js.map +1 -0
  118. package/dist/access/subscribers/business.webhook.subscriber.d.ts +10 -0
  119. package/dist/access/subscribers/business.webhook.subscriber.js +34 -0
  120. package/dist/access/subscribers/business.webhook.subscriber.js.map +1 -0
  121. package/dist/access/subscribers/bz.notification.channel.preference.subscriber.d.ts +10 -0
  122. package/dist/access/subscribers/bz.notification.channel.preference.subscriber.js +34 -0
  123. package/dist/access/subscribers/bz.notification.channel.preference.subscriber.js.map +1 -0
  124. package/dist/access/subscribers/index.d.ts +5 -0
  125. package/dist/access/subscribers/index.js +5 -0
  126. package/dist/access/subscribers/index.js.map +1 -1
  127. package/dist/access/subscribers/webhook.event.subscriber.d.ts +10 -0
  128. package/dist/access/subscribers/webhook.event.subscriber.js +34 -0
  129. package/dist/access/subscribers/webhook.event.subscriber.js.map +1 -0
  130. package/dist/access/subscribers/webhook.log.subscriber.d.ts +10 -0
  131. package/dist/access/subscribers/webhook.log.subscriber.js +34 -0
  132. package/dist/access/subscribers/webhook.log.subscriber.js.map +1 -0
  133. package/dist/config/entity.constants.d.ts +10 -0
  134. package/dist/config/entity.constants.js +10 -0
  135. package/dist/config/entity.constants.js.map +1 -1
  136. package/dist/migrations/1725343070093-AddEnabledGloballyBzAppIntegrationsTable.d.ts +5 -0
  137. package/dist/migrations/1725343070093-AddEnabledGloballyBzAppIntegrationsTable.js +15 -0
  138. package/dist/migrations/1725343070093-AddEnabledGloballyBzAppIntegrationsTable.js.map +1 -0
  139. package/dist/migrations/1725343451546-AddNotificationChannelDataSeederTable.d.ts +7 -0
  140. package/dist/migrations/1725343451546-AddNotificationChannelDataSeederTable.js +65 -0
  141. package/dist/migrations/1725343451546-AddNotificationChannelDataSeederTable.js.map +1 -0
  142. package/dist/migrations/1725343967311-CreateBzUserNotificationPreferencesTable.d.ts +5 -0
  143. package/dist/migrations/1725343967311-CreateBzUserNotificationPreferencesTable.js +22 -0
  144. package/dist/migrations/1725343967311-CreateBzUserNotificationPreferencesTable.js.map +1 -0
  145. package/dist/migrations/1725354088464-CreateBzNotificationChannelPreferenceTable.d.ts +5 -0
  146. package/dist/migrations/1725354088464-CreateBzNotificationChannelPreferenceTable.js +21 -0
  147. package/dist/migrations/1725354088464-CreateBzNotificationChannelPreferenceTable.js.map +1 -0
  148. package/dist/migrations/1725422481585-CreateBusinessWebhookTable.d.ts +5 -0
  149. package/dist/migrations/1725422481585-CreateBusinessWebhookTable.js +22 -0
  150. package/dist/migrations/1725422481585-CreateBusinessWebhookTable.js.map +1 -0
  151. package/dist/migrations/1725428002811-CreateWebhookEventTable.d.ts +5 -0
  152. package/dist/migrations/1725428002811-CreateWebhookEventTable.js +21 -0
  153. package/dist/migrations/1725428002811-CreateWebhookEventTable.js.map +1 -0
  154. package/dist/migrations/1725428278040-CreateWebhookLogTable.d.ts +5 -0
  155. package/dist/migrations/1725428278040-CreateWebhookLogTable.js +24 -0
  156. package/dist/migrations/1725428278040-CreateWebhookLogTable.js.map +1 -0
  157. package/package.json +1 -1
@@ -0,0 +1,17 @@
1
+ import { AddNotificationChannelPreferenceDto } from '../dtos/add.notification.channel.preference.dto';
2
+ import { BusinessParamDto } from '../dtos/business.param.dto';
3
+ import { BusinessUserNotificationPreferenceListFilterDto } from '../dtos/business.user.notification.preference.list.filter.dto';
4
+ import { BzNotificationChannelPreferenceEntity } from '../entities/bz.notification.channel.preference.entity';
5
+ import { AccessBusinessService } from '../services/access.business.service';
6
+ import { ListingService } from '../services/listing.service';
7
+ export declare class BusinessNotificationChannelPreferenceController {
8
+ private readonly accessBusinessService;
9
+ private readonly listingService;
10
+ constructor(accessBusinessService: AccessBusinessService, listingService: ListingService);
11
+ search(body: BusinessUserNotificationPreferenceListFilterDto): Promise<import("..").ListResponseDto>;
12
+ create(body: AddNotificationChannelPreferenceDto): Promise<BzNotificationChannelPreferenceEntity>;
13
+ show(params: BusinessParamDto): Promise<BzNotificationChannelPreferenceEntity>;
14
+ activate(params: BusinessParamDto): Promise<BzNotificationChannelPreferenceEntity>;
15
+ deactivate(params: BusinessParamDto): Promise<BzNotificationChannelPreferenceEntity>;
16
+ handleStatus(status: boolean, id: number): Promise<BzNotificationChannelPreferenceEntity>;
17
+ }
@@ -0,0 +1,112 @@
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
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.BusinessNotificationChannelPreferenceController = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const nestjs_utility_services_1 = require("@servicelabsco/nestjs-utility-services");
18
+ const add_notification_channel_preference_dto_1 = require("../dtos/add.notification.channel.preference.dto");
19
+ const business_param_dto_1 = require("../dtos/business.param.dto");
20
+ const business_user_notification_preference_list_filter_dto_1 = require("../dtos/business.user.notification.preference.list.filter.dto");
21
+ const bz_notification_channel_preference_entity_1 = require("../entities/bz.notification.channel.preference.entity");
22
+ const business_notification_channel_preference_list_1 = require("../libraries/business.notification.channel.preference.list");
23
+ const access_business_service_1 = require("../services/access.business.service");
24
+ const listing_service_1 = require("../services/listing.service");
25
+ let BusinessNotificationChannelPreferenceController = class BusinessNotificationChannelPreferenceController {
26
+ constructor(accessBusinessService, listingService) {
27
+ this.accessBusinessService = accessBusinessService;
28
+ this.listingService = listingService;
29
+ }
30
+ async search(body) {
31
+ const business = await this.accessBusinessService.validateAccess();
32
+ return new business_notification_channel_preference_list_1.ProcessBusinessNotificationChannelPreferenceList(business, this.listingService).process(body);
33
+ }
34
+ async create(body) {
35
+ const business = await this.accessBusinessService.validateAccess();
36
+ let r = bz_notification_channel_preference_entity_1.BzNotificationChannelPreferenceEntity.create({ business_id: business.id });
37
+ if (body?.id)
38
+ r = await bz_notification_channel_preference_entity_1.BzNotificationChannelPreferenceEntity.first(body?.id);
39
+ r.user_id = body.user_id;
40
+ r.channel_id = body.channel_id;
41
+ r.active = true;
42
+ return r.save();
43
+ }
44
+ async show(params) {
45
+ const business = await this.accessBusinessService.validateAccess();
46
+ const data = await bz_notification_channel_preference_entity_1.BzNotificationChannelPreferenceEntity.findOne({
47
+ where: { business_id: business.id, id: params.id },
48
+ relations: ['user', 'channel'],
49
+ });
50
+ if (!data)
51
+ throw new nestjs_utility_services_1.OperationException('Invalid ID');
52
+ return data;
53
+ }
54
+ async activate(params) {
55
+ return this.handleStatus(true, params.id);
56
+ }
57
+ async deactivate(params) {
58
+ return this.handleStatus(false, params.id);
59
+ }
60
+ async handleStatus(status, id) {
61
+ const business = await this.accessBusinessService.validateAccess();
62
+ const r = await bz_notification_channel_preference_entity_1.BzNotificationChannelPreferenceEntity.first(id);
63
+ if (r?.business_id !== business.id)
64
+ throw new nestjs_utility_services_1.AccessException();
65
+ if (status === r.active)
66
+ throw new nestjs_utility_services_1.OperationException(`Invalid Operation`);
67
+ r.active = status;
68
+ return r.save();
69
+ }
70
+ };
71
+ exports.BusinessNotificationChannelPreferenceController = BusinessNotificationChannelPreferenceController;
72
+ __decorate([
73
+ (0, common_1.Post)('search'),
74
+ __param(0, (0, common_1.Body)()),
75
+ __metadata("design:type", Function),
76
+ __metadata("design:paramtypes", [business_user_notification_preference_list_filter_dto_1.BusinessUserNotificationPreferenceListFilterDto]),
77
+ __metadata("design:returntype", Promise)
78
+ ], BusinessNotificationChannelPreferenceController.prototype, "search", null);
79
+ __decorate([
80
+ (0, common_1.Post)(),
81
+ __param(0, (0, common_1.Body)()),
82
+ __metadata("design:type", Function),
83
+ __metadata("design:paramtypes", [add_notification_channel_preference_dto_1.AddNotificationChannelPreferenceDto]),
84
+ __metadata("design:returntype", Promise)
85
+ ], BusinessNotificationChannelPreferenceController.prototype, "create", null);
86
+ __decorate([
87
+ (0, common_1.Get)(':id'),
88
+ __param(0, (0, common_1.Param)()),
89
+ __metadata("design:type", Function),
90
+ __metadata("design:paramtypes", [business_param_dto_1.BusinessParamDto]),
91
+ __metadata("design:returntype", Promise)
92
+ ], BusinessNotificationChannelPreferenceController.prototype, "show", null);
93
+ __decorate([
94
+ (0, common_1.Post)(':id/activate'),
95
+ __param(0, (0, common_1.Param)()),
96
+ __metadata("design:type", Function),
97
+ __metadata("design:paramtypes", [business_param_dto_1.BusinessParamDto]),
98
+ __metadata("design:returntype", Promise)
99
+ ], BusinessNotificationChannelPreferenceController.prototype, "activate", null);
100
+ __decorate([
101
+ (0, common_1.Post)(':id/deactivate'),
102
+ __param(0, (0, common_1.Param)()),
103
+ __metadata("design:type", Function),
104
+ __metadata("design:paramtypes", [business_param_dto_1.BusinessParamDto]),
105
+ __metadata("design:returntype", Promise)
106
+ ], BusinessNotificationChannelPreferenceController.prototype, "deactivate", null);
107
+ exports.BusinessNotificationChannelPreferenceController = BusinessNotificationChannelPreferenceController = __decorate([
108
+ (0, common_1.Controller)('api/b/notification-channel'),
109
+ __metadata("design:paramtypes", [access_business_service_1.AccessBusinessService,
110
+ listing_service_1.ListingService])
111
+ ], BusinessNotificationChannelPreferenceController);
112
+ //# sourceMappingURL=business.notification.channel.preference.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"business.notification.channel.preference.controller.js","sourceRoot":"","sources":["../../../src/access/controllers/business.notification.channel.preference.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAoE;AACpE,oFAA6F;AAC7F,6GAAsG;AACtG,mEAA8D;AAC9D,yIAAgI;AAChI,qHAA8G;AAC9G,8HAA8H;AAC9H,iFAA4E;AAC5E,iEAA6D;AAQtD,IAAM,+CAA+C,GAArD,MAAM,+CAA+C;IACxD,YACqB,qBAA4C,EAC5C,cAA8B;QAD9B,0BAAqB,GAArB,qBAAqB,CAAuB;QAC5C,mBAAc,GAAd,cAAc,CAAgB;IAChD,CAAC;IAGE,AAAN,K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IAAA,cAAK,GAAE,CAAA;;qCAAS,qCAAgB;;iFAEjD;0DAhDQ,+CAA+C;IAD3D,IAAA,mBAAU,EAAC,4BAA4B,CAAC;qCAGO,+CAAqB;QAC5B,gCAAc;GAH1C,+CAA+C,CA4D3D"}
@@ -0,0 +1,21 @@
1
+ import { SqlService } from '@servicelabsco/nestjs-utility-services';
2
+ import { AddBusinessUserNotificationPreferenceDto } from '../dtos/add.business.user.notification.preference.dto';
3
+ import { BusinessParamDto } from '../dtos/business.param.dto';
4
+ import { BusinessUserNotificationPreferenceListFilterDto } from '../dtos/business.user.notification.preference.list.filter.dto';
5
+ import { DbFindDto } from '../dtos/db.find.dto';
6
+ import { BusinessUserNotificationPreferenceEntity } from '../entities/business.user.notification.preference.entity';
7
+ import { AccessBusinessService } from '../services/access.business.service';
8
+ import { ListingService } from '../services/listing.service';
9
+ export declare class BusinessUserNotificationPreferenceController {
10
+ private readonly accessBusinessService;
11
+ private readonly listingService;
12
+ private readonly sqlService;
13
+ constructor(accessBusinessService: AccessBusinessService, listingService: ListingService, sqlService: SqlService);
14
+ search(body: BusinessUserNotificationPreferenceListFilterDto): Promise<import("..").ListResponseDto>;
15
+ create(body: AddBusinessUserNotificationPreferenceDto): Promise<BusinessUserNotificationPreferenceEntity>;
16
+ findNotifications(body: DbFindDto): Promise<any>;
17
+ show(params: BusinessParamDto): Promise<BusinessUserNotificationPreferenceEntity>;
18
+ activate(params: BusinessParamDto): Promise<BusinessUserNotificationPreferenceEntity>;
19
+ deactivate(params: BusinessParamDto): Promise<BusinessUserNotificationPreferenceEntity>;
20
+ handleStatus(status: boolean, id: number): Promise<BusinessUserNotificationPreferenceEntity>;
21
+ }
@@ -0,0 +1,138 @@
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
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.BusinessUserNotificationPreferenceController = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const nestjs_utility_services_1 = require("@servicelabsco/nestjs-utility-services");
18
+ const add_business_user_notification_preference_dto_1 = require("../dtos/add.business.user.notification.preference.dto");
19
+ const business_param_dto_1 = require("../dtos/business.param.dto");
20
+ const business_user_notification_preference_list_filter_dto_1 = require("../dtos/business.user.notification.preference.list.filter.dto");
21
+ const db_find_dto_1 = require("../dtos/db.find.dto");
22
+ const business_user_notification_preference_entity_1 = require("../entities/business.user.notification.preference.entity");
23
+ const business_user_notification_preference_list_1 = require("../libraries/business.user.notification.preference.list");
24
+ const process_db_find_1 = require("../libraries/process.db.find");
25
+ const access_business_service_1 = require("../services/access.business.service");
26
+ const listing_service_1 = require("../services/listing.service");
27
+ let BusinessUserNotificationPreferenceController = class BusinessUserNotificationPreferenceController {
28
+ constructor(accessBusinessService, listingService, sqlService) {
29
+ this.accessBusinessService = accessBusinessService;
30
+ this.listingService = listingService;
31
+ this.sqlService = sqlService;
32
+ }
33
+ async search(body) {
34
+ const business = await this.accessBusinessService.validateAccess();
35
+ return new business_user_notification_preference_list_1.ProcessBusinessUserNotificationPreferenceList(business, this.listingService).process(body);
36
+ }
37
+ async create(body) {
38
+ const business = await this.accessBusinessService.validateAccess();
39
+ let r = business_user_notification_preference_entity_1.BusinessUserNotificationPreferenceEntity.create({ business_id: business.id });
40
+ if (body?.id)
41
+ r = await business_user_notification_preference_entity_1.BusinessUserNotificationPreferenceEntity.first(body?.id);
42
+ r.user_id = body.user_id;
43
+ r.channel_id = body.channel_id;
44
+ r.notification_id = body?.notification_id;
45
+ r.active = true;
46
+ return r.save();
47
+ }
48
+ async findNotifications(body) {
49
+ const business = await this.accessBusinessService.validateAccess();
50
+ const config = {
51
+ primaryCondition: `a.deleted_at is null`,
52
+ tableName: 'utl_notification_details a',
53
+ columns: ['a.id', 'b.name', 'a.identifier', 'b.active'],
54
+ idsCompareKey: 'a.id',
55
+ searchCompareKeys: ['b.name'],
56
+ statusCompareKeys: ['a.active', 'b.active'],
57
+ order: 'a.id desc',
58
+ ...body,
59
+ };
60
+ return new process_db_find_1.ProcessDbFind(this.sqlService).process(config);
61
+ }
62
+ async show(params) {
63
+ const business = await this.accessBusinessService.validateAccess();
64
+ const data = await business_user_notification_preference_entity_1.BusinessUserNotificationPreferenceEntity.findOne({
65
+ where: { business_id: business.id, id: params.id },
66
+ relations: ['user', 'channel'],
67
+ });
68
+ if (!data)
69
+ throw new nestjs_utility_services_1.OperationException('Invalid ID');
70
+ return data;
71
+ }
72
+ async activate(params) {
73
+ return this.handleStatus(true, params.id);
74
+ }
75
+ async deactivate(params) {
76
+ return this.handleStatus(false, params.id);
77
+ }
78
+ async handleStatus(status, id) {
79
+ const business = await this.accessBusinessService.validateAccess();
80
+ const r = await business_user_notification_preference_entity_1.BusinessUserNotificationPreferenceEntity.first(id);
81
+ if (r?.business_id !== business.id)
82
+ throw new nestjs_utility_services_1.AccessException();
83
+ if (status === r.active)
84
+ throw new nestjs_utility_services_1.OperationException(`Invalid Operation`);
85
+ r.active = status;
86
+ return r.save();
87
+ }
88
+ };
89
+ exports.BusinessUserNotificationPreferenceController = BusinessUserNotificationPreferenceController;
90
+ __decorate([
91
+ (0, common_1.Post)('search'),
92
+ __param(0, (0, common_1.Body)()),
93
+ __metadata("design:type", Function),
94
+ __metadata("design:paramtypes", [business_user_notification_preference_list_filter_dto_1.BusinessUserNotificationPreferenceListFilterDto]),
95
+ __metadata("design:returntype", Promise)
96
+ ], BusinessUserNotificationPreferenceController.prototype, "search", null);
97
+ __decorate([
98
+ (0, common_1.Post)(),
99
+ __param(0, (0, common_1.Body)()),
100
+ __metadata("design:type", Function),
101
+ __metadata("design:paramtypes", [add_business_user_notification_preference_dto_1.AddBusinessUserNotificationPreferenceDto]),
102
+ __metadata("design:returntype", Promise)
103
+ ], BusinessUserNotificationPreferenceController.prototype, "create", null);
104
+ __decorate([
105
+ (0, common_1.Post)('find-notifications'),
106
+ __param(0, (0, common_1.Body)()),
107
+ __metadata("design:type", Function),
108
+ __metadata("design:paramtypes", [db_find_dto_1.DbFindDto]),
109
+ __metadata("design:returntype", Promise)
110
+ ], BusinessUserNotificationPreferenceController.prototype, "findNotifications", null);
111
+ __decorate([
112
+ (0, common_1.Get)(':id'),
113
+ __param(0, (0, common_1.Param)()),
114
+ __metadata("design:type", Function),
115
+ __metadata("design:paramtypes", [business_param_dto_1.BusinessParamDto]),
116
+ __metadata("design:returntype", Promise)
117
+ ], BusinessUserNotificationPreferenceController.prototype, "show", null);
118
+ __decorate([
119
+ (0, common_1.Post)(':id/activate'),
120
+ __param(0, (0, common_1.Param)()),
121
+ __metadata("design:type", Function),
122
+ __metadata("design:paramtypes", [business_param_dto_1.BusinessParamDto]),
123
+ __metadata("design:returntype", Promise)
124
+ ], BusinessUserNotificationPreferenceController.prototype, "activate", null);
125
+ __decorate([
126
+ (0, common_1.Post)(':id/deactivate'),
127
+ __param(0, (0, common_1.Param)()),
128
+ __metadata("design:type", Function),
129
+ __metadata("design:paramtypes", [business_param_dto_1.BusinessParamDto]),
130
+ __metadata("design:returntype", Promise)
131
+ ], BusinessUserNotificationPreferenceController.prototype, "deactivate", null);
132
+ exports.BusinessUserNotificationPreferenceController = BusinessUserNotificationPreferenceController = __decorate([
133
+ (0, common_1.Controller)('api/b/user-notification'),
134
+ __metadata("design:paramtypes", [access_business_service_1.AccessBusinessService,
135
+ listing_service_1.ListingService,
136
+ nestjs_utility_services_1.SqlService])
137
+ ], BusinessUserNotificationPreferenceController);
138
+ //# sourceMappingURL=business.user.notification.preference.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"business.user.notification.preference.controller.js","sourceRoot":"","sources":["../../../src/access/controllers/business.user.notification.preference.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAoE;AACpE,oFAAyG;AACzG,yHAAiH;AACjH,mEAA8D;AAC9D,yIAAgI;AAChI,qDAAgD;AAEhD,2HAAoH;AACpH,wHAAwH;AACxH,kEAA6D;AAC7D,iFAA4E;AAC5E,iEAA6D;AAQtD,IAAM,4CAA4C,GAAlD,MAAM,4CAA4C;IACrD,YACqB,qBAA4C,EAC5C,cAA8B,EAC9B,UAAsB;QAFtB,0BAAqB,GAArB,qBAAqB,CAAuB;QAC5C,mBAAc,GAAd,cAAc,CAAgB;QAC9B,eAAU,GAAV,UAAU,CAAY;IACxC,CAAC;IAGE,AAAN,KAAK,CAAC,MAAM,CAAS,IAAqD;QACtE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,cAAc,EAAE,CAAC;QACnE,OAAO,IAAI,0FAA6C,CAAC,QAAQ,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1G,CAAC;IAGK,AAAN,KAAK,CAAC,MAAM,CAAS,IAA8C;QAC/D,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,cAAc,EAAE,CAAC;QAEnE,IAAI,CAAC,GAAG,uFAAwC,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC;QACtF,IAAI,IAAI,EAAE,EAAE;YAAE,CAAC,GAAG,MAAM,uFAAwC,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAEjF,CAAC,CAAC,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,cAAc,CAAC;IACL,WAAA,IAAA,cAAK,GAAE,CAAA;;qCAAS,qCAAgB;;4EAE/C;AAGK;IADL,IAAA,aAAI,EAAC,gBAAgB,CAAC;IACL,WAAA,IAAA,cAAK,GAAE,CAAA;;qCAAS,qCAAgB;;8EAEjD;uDApEQ,4CAA4C;IADxD,IAAA,mBAAU,EAAC,yBAAyB,CAAC;qCAGU,+CAAqB;QAC5B,gCAAc;QAClB,oCAAU;GAJlC,4CAA4C,CAgFxD"}
@@ -0,0 +1,13 @@
1
+ import { SqlService, StringSearchDto } from '@servicelabsco/nestjs-utility-services';
2
+ import { AddWebhookDto } from '../dtos/add.webhook.dto';
3
+ import { BusinessParamDto } from '../dtos/business.param.dto';
4
+ import { BusinessWebhookEntity } from '../entities/business.webhook.entity';
5
+ import { AccessBusinessService } from '../services/access.business.service';
6
+ export declare class BusinessWebhookController {
7
+ private readonly accessBusinessService;
8
+ private readonly sqlService;
9
+ constructor(accessBusinessService: AccessBusinessService, sqlService: SqlService);
10
+ find(body: StringSearchDto): Promise<any>;
11
+ show(params: BusinessParamDto): Promise<BusinessWebhookEntity>;
12
+ create(body: AddWebhookDto): Promise<BusinessWebhookEntity>;
13
+ }
@@ -0,0 +1,81 @@
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
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.BusinessWebhookController = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const nestjs_utility_services_1 = require("@servicelabsco/nestjs-utility-services");
18
+ const add_webhook_dto_1 = require("../dtos/add.webhook.dto");
19
+ const business_param_dto_1 = require("../dtos/business.param.dto");
20
+ const business_webhook_entity_1 = require("../entities/business.webhook.entity");
21
+ const process_db_find_1 = require("../libraries/process.db.find");
22
+ const access_business_service_1 = require("../services/access.business.service");
23
+ let BusinessWebhookController = class BusinessWebhookController {
24
+ constructor(accessBusinessService, sqlService) {
25
+ this.accessBusinessService = accessBusinessService;
26
+ this.sqlService = sqlService;
27
+ }
28
+ async find(body) {
29
+ await this.accessBusinessService.validateAccess();
30
+ const config = {
31
+ tableName: 'utl_webhook_events a',
32
+ primaryCondition: `a.deleted_at is null`,
33
+ searchCompareKeys: ['a.name'],
34
+ columns: ['a.*'],
35
+ order: `a.name asc`,
36
+ idsCompareKey: 'a.id',
37
+ ...body,
38
+ };
39
+ return new process_db_find_1.ProcessDbFind(this.sqlService).process(config);
40
+ }
41
+ async show(params) {
42
+ const business = await this.accessBusinessService.validateAccess();
43
+ return business_webhook_entity_1.BusinessWebhookEntity.findOne({ where: { id: params.id, business_id: business.id } });
44
+ }
45
+ async create(body) {
46
+ const business = await this.accessBusinessService.validateAccess();
47
+ const wh = await business_webhook_entity_1.BusinessWebhookEntity.firstOrCreate({ business_id: business.id });
48
+ wh.active = true;
49
+ wh.url = body.url;
50
+ wh.event_type = JSON.stringify(body.events);
51
+ return wh.save();
52
+ }
53
+ };
54
+ exports.BusinessWebhookController = BusinessWebhookController;
55
+ __decorate([
56
+ (0, common_1.Post)('find-event'),
57
+ __param(0, (0, common_1.Body)()),
58
+ __metadata("design:type", Function),
59
+ __metadata("design:paramtypes", [nestjs_utility_services_1.StringSearchDto]),
60
+ __metadata("design:returntype", Promise)
61
+ ], BusinessWebhookController.prototype, "find", null);
62
+ __decorate([
63
+ (0, common_1.Get)('detail'),
64
+ __param(0, (0, common_1.Param)()),
65
+ __metadata("design:type", Function),
66
+ __metadata("design:paramtypes", [business_param_dto_1.BusinessParamDto]),
67
+ __metadata("design:returntype", Promise)
68
+ ], BusinessWebhookController.prototype, "show", null);
69
+ __decorate([
70
+ (0, common_1.Post)(),
71
+ __param(0, (0, common_1.Body)()),
72
+ __metadata("design:type", Function),
73
+ __metadata("design:paramtypes", [add_webhook_dto_1.AddWebhookDto]),
74
+ __metadata("design:returntype", Promise)
75
+ ], BusinessWebhookController.prototype, "create", null);
76
+ exports.BusinessWebhookController = BusinessWebhookController = __decorate([
77
+ (0, common_1.Controller)('api/b/webhook'),
78
+ __metadata("design:paramtypes", [access_business_service_1.AccessBusinessService,
79
+ nestjs_utility_services_1.SqlService])
80
+ ], BusinessWebhookController);
81
+ //# sourceMappingURL=business.webhook.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"business.webhook.controller.js","sourceRoot":"","sources":["../../../src/access/controllers/business.webhook.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAoE;AACpE,oFAAqF;AACrF,6DAAwD;AACxD,mEAA8D;AAE9D,iFAA4E;AAC5E,kEAA6D;AAC7D,iFAA4E;AAQrE,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;IAClC,YACqB,qBAA4C,EAC5C,UAAsB;QADtB,0BAAqB,GAArB,qBAAqB,CAAuB;QAC5C,eAAU,GAAV,UAAU,CAAY;IACxC,CAAC;IAGE,AAAN,KAAK,CAAC,IAAI,CAAS,IAAqB;QACpC,MAAM,IAAI,CAAC,qBAAqB,CAAC,cAAc,EAAE,CAAC;QAElD,MAAM,MAAM,GAAqB;YAC7B,SAAS,EAAE,sBAAsB;YACjC,gBAAgB,EAAE,sBAAsB;YACxC,iBAAiB,EAAE,CAAC,QAAQ,CAAC;YAC7B,OAAO,EAAE,CAAC,KAAK,CAAC;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;qCAAO,+BAAa;;uDAUvC;oCAxCQ,yBAAyB;IADrC,IAAA,mBAAU,EAAC,eAAe,CAAC;qCAGoB,+CAAqB;QAChC,oCAAU;GAHlC,yBAAyB,CAyCrC"}
@@ -3,8 +3,11 @@ export * from './api.account.controller';
3
3
  export * from './bulk.upload.controller';
4
4
  export * from './bulk.upload.item.controller';
5
5
  export * from './business.app.integration.controller';
6
+ export * from './business.notification.channel.preference.controller';
6
7
  export * from './business.preference.controller';
7
8
  export * from './business.user.group.controller';
9
+ export * from './business.user.notification.preference.controller';
10
+ export * from './business.webhook.controller';
8
11
  export * from './choice.list.controller';
9
12
  export * from './choice.type.controller';
10
13
  export * from './common.webhook.controller';
@@ -19,8 +19,11 @@ __exportStar(require("./api.account.controller"), exports);
19
19
  __exportStar(require("./bulk.upload.controller"), exports);
20
20
  __exportStar(require("./bulk.upload.item.controller"), exports);
21
21
  __exportStar(require("./business.app.integration.controller"), exports);
22
+ __exportStar(require("./business.notification.channel.preference.controller"), exports);
22
23
  __exportStar(require("./business.preference.controller"), exports);
23
24
  __exportStar(require("./business.user.group.controller"), exports);
25
+ __exportStar(require("./business.user.notification.preference.controller"), exports);
26
+ __exportStar(require("./business.webhook.controller"), exports);
24
27
  __exportStar(require("./choice.list.controller"), exports);
25
28
  __exportStar(require("./choice.type.controller"), exports);
26
29
  __exportStar(require("./common.webhook.controller"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/access/controllers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC;AAAA,2DAAyC;AAAA,2DAAyC;AAAA,gEAA8C;AAAA,wEAAsD;AAAA,mEAAiD;AAAA,mEAAiD;AAAA,2DAAyC;AAAA,2DAAyC;AAAA,8DAA4C;AAAA,4DAA0C;AAAA,iEAA+C;AAAA,mEAAiD;AAAA,yDAAuC;AAAA,gEAA8C;AAAA,8DAA4C;AAAA,4DAA0C;AAAA,yDAAuC;AAAA,4DAA0C;AAAA,0DAAwC;AAAA,uDAAqC;AAAA,kEAAgD;AAAA,gEAA8C;AAAA,qEAAmD;AAAA,mDAAiC;AAAA,iEAA+C;AAAA,+DAA4C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/access/controllers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC;AAAA,2DAAyC;AAAA,2DAAyC;AAAA,gEAA8C;AAAA,wEAAsD;AAAA,wFAAsE;AAAA,mEAAiD;AAAA,mEAAiD;AAAA,qFAAmE;AAAA,gEAA8C;AAAA,2DAAyC;AAAA,2DAAyC;AAAA,8DAA4C;AAAA,4DAA0C;AAAA,iEAA+C;AAAA,mEAAiD;AAAA,yDAAuC;AAAA,gEAA8C;AAAA,8DAA4C;AAAA,4DAA0C;AAAA,yDAAuC;AAAA,4DAA0C;AAAA,0DAAwC;AAAA,uDAAqC;AAAA,kEAAgD;AAAA,gEAA8C;AAAA,qEAAmD;AAAA,mDAAiC;AAAA,iEAA+C;AAAA,+DAA4C"}
@@ -0,0 +1,6 @@
1
+ export declare class AddBusinessUserNotificationPreferenceDto {
2
+ id?: number;
3
+ user_id: number;
4
+ channel_id: number;
5
+ notification_id?: number;
6
+ }
@@ -0,0 +1,43 @@
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.AddBusinessUserNotificationPreferenceDto = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ const notification_channel_type_enum_1 = require("../enums/notification.channel.type.enum");
16
+ class AddBusinessUserNotificationPreferenceDto {
17
+ }
18
+ exports.AddBusinessUserNotificationPreferenceDto = AddBusinessUserNotificationPreferenceDto;
19
+ __decorate([
20
+ (0, class_transformer_1.Expose)(),
21
+ (0, class_validator_1.IsOptional)(),
22
+ (0, class_validator_1.IsNumber)(),
23
+ __metadata("design:type", Number)
24
+ ], AddBusinessUserNotificationPreferenceDto.prototype, "id", void 0);
25
+ __decorate([
26
+ (0, class_transformer_1.Expose)(),
27
+ (0, class_validator_1.IsNumber)(),
28
+ (0, class_validator_1.IsNotEmpty)(),
29
+ __metadata("design:type", Number)
30
+ ], AddBusinessUserNotificationPreferenceDto.prototype, "user_id", void 0);
31
+ __decorate([
32
+ (0, class_transformer_1.Expose)(),
33
+ (0, class_validator_1.IsEnum)(notification_channel_type_enum_1.NotificationChannelTypeEnum),
34
+ (0, class_validator_1.IsNotEmpty)(),
35
+ __metadata("design:type", Number)
36
+ ], AddBusinessUserNotificationPreferenceDto.prototype, "channel_id", void 0);
37
+ __decorate([
38
+ (0, class_transformer_1.Expose)(),
39
+ (0, class_validator_1.IsNumber)(),
40
+ (0, class_validator_1.IsNotEmpty)(),
41
+ __metadata("design:type", Number)
42
+ ], AddBusinessUserNotificationPreferenceDto.prototype, "notification_id", void 0);
43
+ //# sourceMappingURL=add.business.user.notification.preference.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add.business.user.notification.preference.dto.js","sourceRoot":"","sources":["../../../src/access/dtos/add.business.user.notification.preference.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA2C;AAC3C,qDAA2E;AAC3E,4FAAsF;AAEtF,MAAa,wCAAwC;CAoBpD;AApBD,4FAoBC;AAhBG;IAHC,IAAA,0BAAM,GAAE;IACR,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;oEACC;AAKZ;IAHC,IAAA,0BAAM,GAAE;IACR,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;yEACG;AAKhB;IAHC,IAAA,0BAAM,GAAE;IACR,IAAA,wBAAM,EAAC,4DAA2B,CAAC;IACnC,IAAA,4BAAU,GAAE;;4EACM;AAKnB;IAHC,IAAA,0BAAM,GAAE;IACR,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;iFACY"}
@@ -0,0 +1,6 @@
1
+ export declare class AddNotificationChannelPreferenceDto {
2
+ id?: number;
3
+ user_id: number;
4
+ channel_id: number;
5
+ notification_id: number;
6
+ }
@@ -0,0 +1,43 @@
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.AddNotificationChannelPreferenceDto = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ const notification_channel_type_enum_1 = require("../enums/notification.channel.type.enum");
16
+ class AddNotificationChannelPreferenceDto {
17
+ }
18
+ exports.AddNotificationChannelPreferenceDto = AddNotificationChannelPreferenceDto;
19
+ __decorate([
20
+ (0, class_transformer_1.Expose)(),
21
+ (0, class_validator_1.IsNumber)(),
22
+ (0, class_validator_1.IsOptional)(),
23
+ __metadata("design:type", Number)
24
+ ], AddNotificationChannelPreferenceDto.prototype, "id", void 0);
25
+ __decorate([
26
+ (0, class_transformer_1.Expose)(),
27
+ (0, class_validator_1.IsNumber)(),
28
+ (0, class_validator_1.IsNotEmpty)(),
29
+ __metadata("design:type", Number)
30
+ ], AddNotificationChannelPreferenceDto.prototype, "user_id", void 0);
31
+ __decorate([
32
+ (0, class_transformer_1.Expose)(),
33
+ (0, class_validator_1.IsEnum)(notification_channel_type_enum_1.NotificationChannelTypeEnum),
34
+ (0, class_validator_1.IsNotEmpty)(),
35
+ __metadata("design:type", Number)
36
+ ], AddNotificationChannelPreferenceDto.prototype, "channel_id", void 0);
37
+ __decorate([
38
+ (0, class_transformer_1.Expose)(),
39
+ (0, class_validator_1.IsNumber)(),
40
+ (0, class_validator_1.IsNotEmpty)(),
41
+ __metadata("design:type", Number)
42
+ ], AddNotificationChannelPreferenceDto.prototype, "notification_id", void 0);
43
+ //# sourceMappingURL=add.notification.channel.preference.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add.notification.channel.preference.dto.js","sourceRoot":"","sources":["../../../src/access/dtos/add.notification.channel.preference.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA2C;AAC3C,qDAA2E;AAC3E,4FAAsF;AAEtF,MAAa,mCAAmC;CAoB/C;AApBD,kFAoBC;AAhBG;IAHC,IAAA,0BAAM,GAAE;IACR,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;+DACD;AAKZ;IAHC,IAAA,0BAAM,GAAE;IACR,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;oEACG;AAKhB;IAHC,IAAA,0BAAM,GAAE;IACR,IAAA,wBAAM,EAAC,4DAA2B,CAAC;IACnC,IAAA,4BAAU,GAAE;;uEACM;AAKnB;IAHC,IAAA,0BAAM,GAAE;IACR,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;4EACW"}
@@ -0,0 +1,5 @@
1
+ export declare class AddWebhookDto {
2
+ id?: number;
3
+ url?: string;
4
+ events: string[];
5
+ }
@@ -0,0 +1,36 @@
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.AddWebhookDto = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ class AddWebhookDto {
16
+ }
17
+ exports.AddWebhookDto = AddWebhookDto;
18
+ __decorate([
19
+ (0, class_transformer_1.Expose)(),
20
+ (0, class_validator_1.IsOptional)(),
21
+ (0, class_validator_1.IsNumber)(),
22
+ __metadata("design:type", Number)
23
+ ], AddWebhookDto.prototype, "id", void 0);
24
+ __decorate([
25
+ (0, class_transformer_1.Expose)(),
26
+ (0, class_validator_1.IsNotEmpty)(),
27
+ (0, class_validator_1.IsString)(),
28
+ __metadata("design:type", String)
29
+ ], AddWebhookDto.prototype, "url", void 0);
30
+ __decorate([
31
+ (0, class_transformer_1.Expose)(),
32
+ (0, class_validator_1.IsNotEmpty)(),
33
+ (0, class_validator_1.IsArray)(),
34
+ __metadata("design:type", Array)
35
+ ], AddWebhookDto.prototype, "events", void 0);
36
+ //# sourceMappingURL=add.webhook.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add.webhook.dto.js","sourceRoot":"","sources":["../../../src/access/dtos/add.webhook.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA2C;AAC3C,qDAAsF;AAEtF,MAAa,aAAa;CAezB;AAfD,sCAeC;AAXG;IAHC,IAAA,0BAAM,GAAE;IACR,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;yCACC;AAKZ;IAHC,IAAA,0BAAM,GAAE;IACR,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;0CACE;AAKb;IAHC,IAAA,0BAAM,GAAE;IACR,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,GAAE;;6CACO"}
@@ -0,0 +1,4 @@
1
+ import { CommonListFilterDto } from './common.list.filter.dto';
2
+ export declare class BusinessNotificationChannelPreferenceListFilterDto extends CommonListFilterDto {
3
+ channel_id?: number;
4
+ }