grm-shared-library 1.1.211 → 1.1.213

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 (114) hide show
  1. package/README.md +51 -0
  2. package/dist/cjs/kafka/dtos/account-deletion/account-deletion-request-payload.dto.js +6 -0
  3. package/dist/cjs/kafka/dtos/account-deletion/account-deletion-request-payload.dto.js.map +1 -1
  4. package/dist/cjs/kafka/dtos/otp/create-otp-payload.dto.js +6 -0
  5. package/dist/cjs/kafka/dtos/otp/create-otp-payload.dto.js.map +1 -1
  6. package/dist/cjs/kafka/dtos/password/password-reset-payload.dto.js +6 -0
  7. package/dist/cjs/kafka/dtos/password/password-reset-payload.dto.js.map +1 -1
  8. package/dist/cjs/kafka/dtos/user/create-user-registered-payload.dto.js +6 -0
  9. package/dist/cjs/kafka/dtos/user/create-user-registered-payload.dto.js.map +1 -1
  10. package/dist/cjs/modules/notification/constants/notification-sender.const.js +30 -0
  11. package/dist/cjs/modules/notification/constants/notification-sender.const.js.map +1 -0
  12. package/dist/cjs/modules/notification/dtos/billing-notification.dto.js +213 -0
  13. package/dist/cjs/modules/notification/dtos/billing-notification.dto.js.map +1 -0
  14. package/dist/cjs/modules/notification/dtos/organization-notification-settings.dto.js +354 -0
  15. package/dist/cjs/modules/notification/dtos/organization-notification-settings.dto.js.map +1 -0
  16. package/dist/cjs/modules/notification/enums/billing-notification.enum.js +33 -0
  17. package/dist/cjs/modules/notification/enums/billing-notification.enum.js.map +1 -0
  18. package/dist/cjs/modules/notification/enums/email-sender-verification.enum.js +33 -0
  19. package/dist/cjs/modules/notification/enums/email-sender-verification.enum.js.map +1 -0
  20. package/dist/cjs/modules/notification/enums/notification-branding-source.enum.js +22 -0
  21. package/dist/cjs/modules/notification/enums/notification-branding-source.enum.js.map +1 -0
  22. package/dist/cjs/modules/notification/enums/notification-sender-source.enum.js +15 -0
  23. package/dist/cjs/modules/notification/enums/notification-sender-source.enum.js.map +1 -0
  24. package/dist/cjs/modules/notification/enums/notification-sender-status.enum.js +24 -0
  25. package/dist/cjs/modules/notification/enums/notification-sender-status.enum.js.map +1 -0
  26. package/dist/cjs/modules/notification/enums/sms-provider-name.enum.js +5 -0
  27. package/dist/cjs/modules/notification/enums/sms-provider-name.enum.js.map +1 -1
  28. package/dist/cjs/modules/notification/enums/sms-sender-type.enum.js +22 -0
  29. package/dist/cjs/modules/notification/enums/sms-sender-type.enum.js.map +1 -0
  30. package/dist/cjs/modules/notification/index.js +14 -0
  31. package/dist/cjs/modules/notification/index.js.map +1 -1
  32. package/dist/cjs/modules/notification/interfaces/billing-notification-result.js +3 -0
  33. package/dist/cjs/modules/notification/interfaces/billing-notification-result.js.map +1 -0
  34. package/dist/cjs/modules/notification/interfaces/organization-notification-settings.js +3 -0
  35. package/dist/cjs/modules/notification/interfaces/organization-notification-settings.js.map +1 -0
  36. package/dist/cjs/modules/notification/utils/notification-sender.util.js +67 -0
  37. package/dist/cjs/modules/notification/utils/notification-sender.util.js.map +1 -0
  38. package/dist/cjs/modules/permission/data/permissions.data.js +8 -0
  39. package/dist/cjs/modules/permission/data/permissions.data.js.map +1 -1
  40. package/dist/cjs/modules/permission/enums/permission-actions.enum.js +15 -0
  41. package/dist/cjs/modules/permission/enums/permission-actions.enum.js.map +1 -1
  42. package/dist/cjs/modules/permission/enums/permissions-module.enum.js +1 -0
  43. package/dist/cjs/modules/permission/enums/permissions-module.enum.js.map +1 -1
  44. package/dist/cjs/modules/role/data/roles.data.js +8 -0
  45. package/dist/cjs/modules/role/data/roles.data.js.map +1 -1
  46. package/dist/esm/kafka/dtos/account-deletion/account-deletion-request-payload.dto.js +7 -1
  47. package/dist/esm/kafka/dtos/account-deletion/account-deletion-request-payload.dto.js.map +1 -1
  48. package/dist/esm/kafka/dtos/otp/create-otp-payload.dto.js +7 -1
  49. package/dist/esm/kafka/dtos/otp/create-otp-payload.dto.js.map +1 -1
  50. package/dist/esm/kafka/dtos/password/password-reset-payload.dto.js +7 -1
  51. package/dist/esm/kafka/dtos/password/password-reset-payload.dto.js.map +1 -1
  52. package/dist/esm/kafka/dtos/user/create-user-registered-payload.dto.js +7 -1
  53. package/dist/esm/kafka/dtos/user/create-user-registered-payload.dto.js.map +1 -1
  54. package/dist/esm/modules/notification/constants/notification-sender.const.js +27 -0
  55. package/dist/esm/modules/notification/constants/notification-sender.const.js.map +1 -0
  56. package/dist/esm/modules/notification/dtos/billing-notification.dto.js +205 -0
  57. package/dist/esm/modules/notification/dtos/billing-notification.dto.js.map +1 -0
  58. package/dist/esm/modules/notification/dtos/organization-notification-settings.dto.js +343 -0
  59. package/dist/esm/modules/notification/dtos/organization-notification-settings.dto.js.map +1 -0
  60. package/dist/esm/modules/notification/enums/billing-notification.enum.js +30 -0
  61. package/dist/esm/modules/notification/enums/billing-notification.enum.js.map +1 -0
  62. package/dist/esm/modules/notification/enums/email-sender-verification.enum.js +30 -0
  63. package/dist/esm/modules/notification/enums/email-sender-verification.enum.js.map +1 -0
  64. package/dist/esm/modules/notification/enums/notification-branding-source.enum.js +19 -0
  65. package/dist/esm/modules/notification/enums/notification-branding-source.enum.js.map +1 -0
  66. package/dist/esm/modules/notification/enums/notification-sender-source.enum.js +12 -0
  67. package/dist/esm/modules/notification/enums/notification-sender-source.enum.js.map +1 -0
  68. package/dist/esm/modules/notification/enums/notification-sender-status.enum.js +21 -0
  69. package/dist/esm/modules/notification/enums/notification-sender-status.enum.js.map +1 -0
  70. package/dist/esm/modules/notification/enums/sms-provider-name.enum.js +5 -0
  71. package/dist/esm/modules/notification/enums/sms-provider-name.enum.js.map +1 -1
  72. package/dist/esm/modules/notification/enums/sms-sender-type.enum.js +19 -0
  73. package/dist/esm/modules/notification/enums/sms-sender-type.enum.js.map +1 -0
  74. package/dist/esm/modules/notification/index.js +14 -0
  75. package/dist/esm/modules/notification/index.js.map +1 -1
  76. package/dist/esm/modules/notification/interfaces/billing-notification-result.js +2 -0
  77. package/dist/esm/modules/notification/interfaces/billing-notification-result.js.map +1 -0
  78. package/dist/esm/modules/notification/interfaces/organization-notification-settings.js +2 -0
  79. package/dist/esm/modules/notification/interfaces/organization-notification-settings.js.map +1 -0
  80. package/dist/esm/modules/notification/utils/notification-sender.util.js +60 -0
  81. package/dist/esm/modules/notification/utils/notification-sender.util.js.map +1 -0
  82. package/dist/esm/modules/permission/data/permissions.data.js +8 -0
  83. package/dist/esm/modules/permission/data/permissions.data.js.map +1 -1
  84. package/dist/esm/modules/permission/enums/permission-actions.enum.js +15 -0
  85. package/dist/esm/modules/permission/enums/permission-actions.enum.js.map +1 -1
  86. package/dist/esm/modules/permission/enums/permissions-module.enum.js +1 -0
  87. package/dist/esm/modules/permission/enums/permissions-module.enum.js.map +1 -1
  88. package/dist/esm/modules/role/data/roles.data.js +8 -0
  89. package/dist/esm/modules/role/data/roles.data.js.map +1 -1
  90. package/dist/types/kafka/dtos/account-deletion/account-deletion-request-payload.dto.d.ts +6 -0
  91. package/dist/types/kafka/dtos/otp/create-otp-payload.dto.d.ts +6 -0
  92. package/dist/types/kafka/dtos/password/password-reset-payload.dto.d.ts +6 -0
  93. package/dist/types/kafka/dtos/user/create-user-registered-payload.dto.d.ts +6 -0
  94. package/dist/types/modules/notification/constants/notification-sender.const.d.ts +16 -0
  95. package/dist/types/modules/notification/dtos/billing-notification.dto.d.ts +56 -0
  96. package/dist/types/modules/notification/dtos/organization-notification-settings.dto.d.ts +64 -0
  97. package/dist/types/modules/notification/enums/billing-notification.enum.d.ts +27 -0
  98. package/dist/types/modules/notification/enums/email-sender-verification.enum.d.ts +27 -0
  99. package/dist/types/modules/notification/enums/notification-branding-source.enum.d.ts +17 -0
  100. package/dist/types/modules/notification/enums/notification-sender-source.enum.d.ts +10 -0
  101. package/dist/types/modules/notification/enums/notification-sender-status.enum.d.ts +19 -0
  102. package/dist/types/modules/notification/enums/sms-provider-name.enum.d.ts +6 -1
  103. package/dist/types/modules/notification/enums/sms-sender-type.enum.d.ts +17 -0
  104. package/dist/types/modules/notification/index.d.ts +12 -0
  105. package/dist/types/modules/notification/interfaces/billing-notification-result.d.ts +35 -0
  106. package/dist/types/modules/notification/interfaces/email-send-request.d.ts +6 -0
  107. package/dist/types/modules/notification/interfaces/email-send-result.d.ts +7 -0
  108. package/dist/types/modules/notification/interfaces/organization-notification-settings.d.ts +163 -0
  109. package/dist/types/modules/notification/interfaces/provider-attempt.d.ts +5 -0
  110. package/dist/types/modules/notification/interfaces/sms-send-result.d.ts +7 -0
  111. package/dist/types/modules/notification/utils/notification-sender.util.d.ts +25 -0
  112. package/dist/types/modules/permission/enums/permission-actions.enum.d.ts +4 -1
  113. package/dist/types/modules/permission/enums/permissions-module.enum.d.ts +2 -1
  114. package/package.json +1 -1
@@ -0,0 +1,343 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ 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;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
11
+ import { Transform, Type } from 'class-transformer';
12
+ import { IsBoolean, IsEmail, IsEnum, IsOptional, IsString, IsUrl, Matches, MaxLength, ValidateIf, ValidateNested, } from 'class-validator';
13
+ import { CountryCode } from '../../country/enums/country-code.enum';
14
+ import { IncidentAppId } from '../../incident/enums/incident-app-id.enum';
15
+ import { BRAND_COLOUR_PATTERN } from '../constants/notification-sender.const';
16
+ import { NotificationSenderStatus } from '../enums/notification-sender-status.enum';
17
+ import { SmsProviderName } from '../enums/sms-provider-name.enum';
18
+ import { SmsSenderType } from '../enums/sms-sender-type.enum';
19
+ /**
20
+ * A cleared form field arrives as `""`. Branding is resolved field by field, so
21
+ * "cleared" has a real meaning - stop overriding, inherit again - and is stored
22
+ * as null. Without this an empty string would override the inherited value with
23
+ * nothing, and the email would go out with a blank footer.
24
+ */
25
+ const emptyToNull = ({ value }) => typeof value === 'string' && value.trim() === '' ? null : typeof value === 'string' ? value.trim() : value;
26
+ /** Validate only when a value was actually supplied; null (inherit) and undefined (untouched) pass. */
27
+ const whenPresent = (_, value) => value !== null && value !== undefined;
28
+ const HTTPS_ONLY = { protocols: ['https'], require_protocol: true };
29
+ const COLOUR_MESSAGE = 'must be a #RRGGBB hex colour, e.g. #FC1B23';
30
+ export class NotificationSocialLinksDto {
31
+ }
32
+ __decorate([
33
+ ApiPropertyOptional({ nullable: true }),
34
+ Transform(emptyToNull),
35
+ ValidateIf(whenPresent),
36
+ IsUrl(HTTPS_ONLY),
37
+ MaxLength(255),
38
+ __metadata("design:type", Object)
39
+ ], NotificationSocialLinksDto.prototype, "facebook", void 0);
40
+ __decorate([
41
+ ApiPropertyOptional({ nullable: true }),
42
+ Transform(emptyToNull),
43
+ ValidateIf(whenPresent),
44
+ IsUrl(HTTPS_ONLY),
45
+ MaxLength(255),
46
+ __metadata("design:type", Object)
47
+ ], NotificationSocialLinksDto.prototype, "x", void 0);
48
+ __decorate([
49
+ ApiPropertyOptional({ nullable: true }),
50
+ Transform(emptyToNull),
51
+ ValidateIf(whenPresent),
52
+ IsUrl(HTTPS_ONLY),
53
+ MaxLength(255),
54
+ __metadata("design:type", Object)
55
+ ], NotificationSocialLinksDto.prototype, "instagram", void 0);
56
+ __decorate([
57
+ ApiPropertyOptional({ nullable: true }),
58
+ Transform(emptyToNull),
59
+ ValidateIf(whenPresent),
60
+ IsUrl(HTTPS_ONLY),
61
+ MaxLength(255),
62
+ __metadata("design:type", Object)
63
+ ], NotificationSocialLinksDto.prototype, "linkedin", void 0);
64
+ /**
65
+ * Saves an organization's branding. A PUT of the whole profile: a field sent as
66
+ * null (or "") stops overriding and inherits again; a field left out is untouched.
67
+ */
68
+ export class UpsertOrganizationNotificationBrandingDto {
69
+ }
70
+ __decorate([
71
+ ApiPropertyOptional({
72
+ enum: IncidentAppId,
73
+ nullable: true,
74
+ description: 'Super-admin only. Lets events that still carry only an appId resolve to this organization.',
75
+ }),
76
+ Transform(emptyToNull),
77
+ ValidateIf(whenPresent),
78
+ IsEnum(IncidentAppId),
79
+ __metadata("design:type", Object)
80
+ ], UpsertOrganizationNotificationBrandingDto.prototype, "appId", void 0);
81
+ __decorate([
82
+ ApiPropertyOptional({ nullable: true, example: 'G4S Kenya Ltd' }),
83
+ Transform(emptyToNull),
84
+ ValidateIf(whenPresent),
85
+ IsString(),
86
+ MaxLength(100),
87
+ __metadata("design:type", Object)
88
+ ], UpsertOrganizationNotificationBrandingDto.prototype, "companyName", void 0);
89
+ __decorate([
90
+ ApiPropertyOptional({ nullable: true, example: 'G4S Kenya' }),
91
+ Transform(emptyToNull),
92
+ ValidateIf(whenPresent),
93
+ IsString(),
94
+ MaxLength(60),
95
+ __metadata("design:type", Object)
96
+ ], UpsertOrganizationNotificationBrandingDto.prototype, "appName", void 0);
97
+ __decorate([
98
+ ApiPropertyOptional({ nullable: true, description: 'HTTPS only: email clients block anything else.' }),
99
+ Transform(emptyToNull),
100
+ ValidateIf(whenPresent),
101
+ IsUrl(HTTPS_ONLY),
102
+ MaxLength(500),
103
+ __metadata("design:type", Object)
104
+ ], UpsertOrganizationNotificationBrandingDto.prototype, "logoUrl", void 0);
105
+ __decorate([
106
+ ApiPropertyOptional({ nullable: true, example: '#FC1B23' }),
107
+ Transform(emptyToNull),
108
+ ValidateIf(whenPresent),
109
+ Matches(BRAND_COLOUR_PATTERN, { message: `primaryColour ${COLOUR_MESSAGE}` }),
110
+ __metadata("design:type", Object)
111
+ ], UpsertOrganizationNotificationBrandingDto.prototype, "primaryColour", void 0);
112
+ __decorate([
113
+ ApiPropertyOptional({ nullable: true, description: 'Derived from the primary colour when omitted.' }),
114
+ Transform(emptyToNull),
115
+ ValidateIf(whenPresent),
116
+ Matches(BRAND_COLOUR_PATTERN, { message: `primaryColourDark ${COLOUR_MESSAGE}` }),
117
+ __metadata("design:type", Object)
118
+ ], UpsertOrganizationNotificationBrandingDto.prototype, "primaryColourDark", void 0);
119
+ __decorate([
120
+ ApiPropertyOptional({ nullable: true, example: '#101010' }),
121
+ Transform(emptyToNull),
122
+ ValidateIf(whenPresent),
123
+ Matches(BRAND_COLOUR_PATTERN, { message: `accentColour ${COLOUR_MESSAGE}` }),
124
+ __metadata("design:type", Object)
125
+ ], UpsertOrganizationNotificationBrandingDto.prototype, "accentColour", void 0);
126
+ __decorate([
127
+ ApiPropertyOptional({ nullable: true }),
128
+ Transform(emptyToNull),
129
+ ValidateIf(whenPresent),
130
+ IsString(),
131
+ MaxLength(255),
132
+ __metadata("design:type", Object)
133
+ ], UpsertOrganizationNotificationBrandingDto.prototype, "physicalAddress", void 0);
134
+ __decorate([
135
+ ApiPropertyOptional({ nullable: true, example: '+254 709 555 000' }),
136
+ Transform(emptyToNull),
137
+ ValidateIf(whenPresent),
138
+ IsString(),
139
+ Matches(/^[+0-9 ()-]{5,30}$/, { message: 'phoneNumber may contain digits, spaces, +, ( ) and - only' }),
140
+ __metadata("design:type", Object)
141
+ ], UpsertOrganizationNotificationBrandingDto.prototype, "phoneNumber", void 0);
142
+ __decorate([
143
+ ApiPropertyOptional({ nullable: true }),
144
+ Transform(emptyToNull),
145
+ ValidateIf(whenPresent),
146
+ IsEmail(),
147
+ MaxLength(254),
148
+ __metadata("design:type", Object)
149
+ ], UpsertOrganizationNotificationBrandingDto.prototype, "contactEmail", void 0);
150
+ __decorate([
151
+ ApiPropertyOptional({ nullable: true }),
152
+ Transform(emptyToNull),
153
+ ValidateIf(whenPresent),
154
+ IsEmail(),
155
+ MaxLength(254),
156
+ __metadata("design:type", Object)
157
+ ], UpsertOrganizationNotificationBrandingDto.prototype, "supportEmail", void 0);
158
+ __decorate([
159
+ ApiPropertyOptional({ nullable: true }),
160
+ Transform(emptyToNull),
161
+ ValidateIf(whenPresent),
162
+ IsUrl(HTTPS_ONLY),
163
+ MaxLength(255),
164
+ __metadata("design:type", Object)
165
+ ], UpsertOrganizationNotificationBrandingDto.prototype, "websiteUrl", void 0);
166
+ __decorate([
167
+ ApiPropertyOptional({
168
+ nullable: true,
169
+ description: 'Where links in a notification point. Plain http is accepted so a local client can be targeted.',
170
+ }),
171
+ Transform(emptyToNull),
172
+ ValidateIf(whenPresent),
173
+ IsUrl({ protocols: ['http', 'https'], require_protocol: true, require_tld: false }),
174
+ MaxLength(255),
175
+ __metadata("design:type", Object)
176
+ ], UpsertOrganizationNotificationBrandingDto.prototype, "clientBaseUrl", void 0);
177
+ __decorate([
178
+ ApiPropertyOptional({ type: NotificationSocialLinksDto, nullable: true }),
179
+ ValidateIf(whenPresent),
180
+ ValidateNested(),
181
+ Type(() => NotificationSocialLinksDto),
182
+ __metadata("design:type", Object)
183
+ ], UpsertOrganizationNotificationBrandingDto.prototype, "social", void 0);
184
+ export class CreateOrganizationEmailSenderDto {
185
+ }
186
+ __decorate([
187
+ ApiProperty({ example: 'notifications@ke.g4s.com', description: 'The address mail is sent from.' }),
188
+ Transform(({ value }) => (typeof value === 'string' ? value.trim().toLowerCase() : value)),
189
+ IsEmail(),
190
+ MaxLength(254),
191
+ __metadata("design:type", String)
192
+ ], CreateOrganizationEmailSenderDto.prototype, "fromEmail", void 0);
193
+ __decorate([
194
+ ApiPropertyOptional({ nullable: true, example: 'G4S Kenya', description: 'Falls back to the company name.' }),
195
+ Transform(emptyToNull),
196
+ ValidateIf(whenPresent),
197
+ IsString(),
198
+ MaxLength(100)
199
+ // A display name is interpolated into the From header; a line break there is header injection.
200
+ ,
201
+ Matches(/^[^\r\n<>"]*$/, { message: 'fromName may not contain line breaks, quotes or angle brackets' }),
202
+ __metadata("design:type", Object)
203
+ ], CreateOrganizationEmailSenderDto.prototype, "fromName", void 0);
204
+ __decorate([
205
+ ApiPropertyOptional({ nullable: true, description: 'Falls back to fromEmail.' }),
206
+ Transform(emptyToNull),
207
+ ValidateIf(whenPresent),
208
+ IsEmail(),
209
+ MaxLength(254),
210
+ __metadata("design:type", Object)
211
+ ], CreateOrganizationEmailSenderDto.prototype, "replyTo", void 0);
212
+ __decorate([
213
+ ApiPropertyOptional({ description: 'Make this the sender used by default. The first sender always is.' }),
214
+ IsBoolean(),
215
+ IsOptional(),
216
+ __metadata("design:type", Boolean)
217
+ ], CreateOrganizationEmailSenderDto.prototype, "isDefault", void 0);
218
+ export class UpdateOrganizationEmailSenderDto {
219
+ }
220
+ __decorate([
221
+ ApiPropertyOptional({ nullable: true }),
222
+ Transform(emptyToNull),
223
+ ValidateIf(whenPresent),
224
+ IsString(),
225
+ MaxLength(100),
226
+ Matches(/^[^\r\n<>"]*$/, { message: 'fromName may not contain line breaks, quotes or angle brackets' }),
227
+ __metadata("design:type", Object)
228
+ ], UpdateOrganizationEmailSenderDto.prototype, "fromName", void 0);
229
+ __decorate([
230
+ ApiPropertyOptional({ nullable: true }),
231
+ Transform(emptyToNull),
232
+ ValidateIf(whenPresent),
233
+ IsEmail(),
234
+ MaxLength(254),
235
+ __metadata("design:type", Object)
236
+ ], UpdateOrganizationEmailSenderDto.prototype, "replyTo", void 0);
237
+ __decorate([
238
+ ApiPropertyOptional(),
239
+ IsBoolean(),
240
+ IsOptional(),
241
+ __metadata("design:type", Boolean)
242
+ ], UpdateOrganizationEmailSenderDto.prototype, "isDefault", void 0);
243
+ __decorate([
244
+ ApiPropertyOptional(),
245
+ IsBoolean(),
246
+ IsOptional(),
247
+ __metadata("design:type", Boolean)
248
+ ], UpdateOrganizationEmailSenderDto.prototype, "active", void 0);
249
+ export class CreateOrganizationSmsSenderDto {
250
+ }
251
+ __decorate([
252
+ ApiProperty({ enum: SmsProviderName, description: 'The provider account the sender is registered with.' }),
253
+ IsEnum(SmsProviderName),
254
+ __metadata("design:type", String)
255
+ ], CreateOrganizationSmsSenderDto.prototype, "provider", void 0);
256
+ __decorate([
257
+ ApiPropertyOptional({
258
+ enum: CountryCode,
259
+ nullable: true,
260
+ description: 'Destination country the sender is registered for. Omit for every country the provider serves.',
261
+ }),
262
+ Transform(emptyToNull),
263
+ ValidateIf(whenPresent),
264
+ IsEnum(CountryCode),
265
+ __metadata("design:type", Object)
266
+ ], CreateOrganizationSmsSenderDto.prototype, "countryCode", void 0);
267
+ __decorate([
268
+ ApiProperty({ enum: SmsSenderType }),
269
+ IsEnum(SmsSenderType),
270
+ __metadata("design:type", String)
271
+ ], CreateOrganizationSmsSenderDto.prototype, "senderType", void 0);
272
+ __decorate([
273
+ ApiProperty({ example: 'G4S', description: 'Validated against senderType by the service.' }),
274
+ Transform(({ value }) => (typeof value === 'string' ? value.trim() : value)),
275
+ IsString(),
276
+ MaxLength(40),
277
+ __metadata("design:type", String)
278
+ ], CreateOrganizationSmsSenderDto.prototype, "senderId", void 0);
279
+ __decorate([
280
+ ApiPropertyOptional({ nullable: true, description: 'Registration reference or anything the operator needs later.' }),
281
+ Transform(emptyToNull),
282
+ ValidateIf(whenPresent),
283
+ IsString(),
284
+ MaxLength(500),
285
+ __metadata("design:type", Object)
286
+ ], CreateOrganizationSmsSenderDto.prototype, "notes", void 0);
287
+ export class UpdateOrganizationSmsSenderDto {
288
+ }
289
+ __decorate([
290
+ ApiPropertyOptional({ enum: CountryCode, nullable: true }),
291
+ Transform(emptyToNull),
292
+ ValidateIf(whenPresent),
293
+ IsEnum(CountryCode),
294
+ __metadata("design:type", Object)
295
+ ], UpdateOrganizationSmsSenderDto.prototype, "countryCode", void 0);
296
+ __decorate([
297
+ ApiPropertyOptional({ enum: SmsSenderType }),
298
+ IsEnum(SmsSenderType),
299
+ IsOptional(),
300
+ __metadata("design:type", String)
301
+ ], UpdateOrganizationSmsSenderDto.prototype, "senderType", void 0);
302
+ __decorate([
303
+ ApiPropertyOptional({ description: 'Changing the value sends the sender back to PENDING.' }),
304
+ Transform(({ value }) => (typeof value === 'string' ? value.trim() : value)),
305
+ IsString(),
306
+ MaxLength(40),
307
+ IsOptional(),
308
+ __metadata("design:type", String)
309
+ ], UpdateOrganizationSmsSenderDto.prototype, "senderId", void 0);
310
+ __decorate([
311
+ ApiPropertyOptional({ nullable: true }),
312
+ Transform(emptyToNull),
313
+ ValidateIf(whenPresent),
314
+ IsString(),
315
+ MaxLength(500),
316
+ __metadata("design:type", Object)
317
+ ], UpdateOrganizationSmsSenderDto.prototype, "notes", void 0);
318
+ /** Platform operators only: records the outcome of registering the sender with the provider. */
319
+ export class ReviewOrganizationSmsSenderDto {
320
+ }
321
+ __decorate([
322
+ ApiProperty({ enum: NotificationSenderStatus }),
323
+ IsEnum(NotificationSenderStatus),
324
+ __metadata("design:type", String)
325
+ ], ReviewOrganizationSmsSenderDto.prototype, "status", void 0);
326
+ __decorate([
327
+ ApiPropertyOptional({ nullable: true }),
328
+ Transform(emptyToNull),
329
+ ValidateIf(whenPresent),
330
+ IsString(),
331
+ MaxLength(500),
332
+ __metadata("design:type", Object)
333
+ ], ReviewOrganizationSmsSenderDto.prototype, "notes", void 0);
334
+ export class SendTestNotificationEmailDto {
335
+ }
336
+ __decorate([
337
+ ApiProperty({ description: 'Where the branded test email goes.' }),
338
+ Transform(({ value }) => (typeof value === 'string' ? value.trim().toLowerCase() : value)),
339
+ IsEmail(),
340
+ MaxLength(254),
341
+ __metadata("design:type", String)
342
+ ], SendTestNotificationEmailDto.prototype, "to", void 0);
343
+ //# sourceMappingURL=organization-notification-settings.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organization-notification-settings.dto.js","sourceRoot":"","sources":["../../../../../src/modules/notification/dtos/organization-notification-settings.dto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,E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AAE,CAAC;IACvC,SAAS,CAAC,WAAW,CAAC;IAAE,UAAU,CAAC,WAAW,CAAC;IAAE,QAAQ,EAAE;IAAE,SAAS,CAAC,GAAG,CAAC;;6DACtD;AAG1B,MAAM,OAAO,4BAA4B;CAKxC;AADG;IAHC,WAAW,CAAC,EAAE,WAAW,EAAE,oCAAoC,EAAE,CAAC;IAClE,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAC1F,OAAO,EAAE;IAAE,SAAS,CAAC,GAAG,CAAC;;wDACd"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * The emails clarion-billing can ask clarion-notification to send.
3
+ *
4
+ * A closed set on purpose. The route renders a template BY NAME on the say-so of
5
+ * another service; accepting any string would let a caller render any template in
6
+ * the notification service (an OTP email, a password reset) with a body of its
7
+ * choosing. Each value here has copy defaults in the notification service - add
8
+ * the value and the defaults together.
9
+ */
10
+ export var BillingEmailTemplate;
11
+ (function (BillingEmailTemplate) {
12
+ /** An invoice or settlement invoice is ready. Normally carries the PDF. */
13
+ BillingEmailTemplate["INVOICE"] = "billing_invoice";
14
+ /** A payment was received. Normally carries the receipt PDF. */
15
+ BillingEmailTemplate["RECEIPT"] = "billing_receipt";
16
+ /** A corporate order was placed or confirmed. */
17
+ BillingEmailTemplate["ORDER_CONFIRMATION"] = "billing_order_confirmation";
18
+ /** Anything else billing needs to say; the caller supplies heading and intro. */
19
+ BillingEmailTemplate["GENERIC"] = "billing_generic";
20
+ })(BillingEmailTemplate || (BillingEmailTemplate = {}));
21
+ /** What a referenced billing document is. Mirrors the documents clarion-billing stores in clarion-dms. */
22
+ export var BillingDocumentType;
23
+ (function (BillingDocumentType) {
24
+ BillingDocumentType["INVOICE"] = "INVOICE";
25
+ BillingDocumentType["RECEIPT"] = "RECEIPT";
26
+ BillingDocumentType["CORPORATE_ORDER"] = "CORPORATE_ORDER";
27
+ BillingDocumentType["SETTLEMENT_INVOICE"] = "SETTLEMENT_INVOICE";
28
+ BillingDocumentType["SETTLEMENT_RECEIPT"] = "SETTLEMENT_RECEIPT";
29
+ })(BillingDocumentType || (BillingDocumentType = {}));
30
+ //# sourceMappingURL=billing-notification.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing-notification.enum.js","sourceRoot":"","sources":["../../../../../src/modules/notification/enums/billing-notification.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,CAAN,IAAY,oBASX;AATD,WAAY,oBAAoB;IAC5B,2EAA2E;IAC3E,mDAA2B,CAAA;IAC3B,gEAAgE;IAChE,mDAA2B,CAAA;IAC3B,iDAAiD;IACjD,yEAAiD,CAAA;IACjD,iFAAiF;IACjF,mDAA2B,CAAA;AAC/B,CAAC,EATW,oBAAoB,KAApB,oBAAoB,QAS/B;AAED,0GAA0G;AAC1G,MAAM,CAAN,IAAY,mBAMX;AAND,WAAY,mBAAmB;IAC3B,0CAAmB,CAAA;IACnB,0CAAmB,CAAA;IACnB,0DAAmC,CAAA;IACnC,gEAAyC,CAAA;IACzC,gEAAyC,CAAA;AAC7C,CAAC,EANW,mBAAmB,KAAnB,mBAAmB,QAM9B"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Whether an email provider will accept mail FROM an organization's address.
3
+ *
4
+ * Tracked per provider because the answer differs per provider: an address can be
5
+ * a verified sender in Twilio SendGrid while its domain is unknown to Mailgun.
6
+ * A provider only ever sends from an address it has VERIFIED; for every other
7
+ * state that provider falls back to the platform sender (keeping the
8
+ * organization's display name and reply-to), so a half-configured organization
9
+ * never loses mail to an "unverified sender" rejection.
10
+ */
11
+ export var EmailSenderVerificationStatus;
12
+ (function (EmailSenderVerificationStatus) {
13
+ /** The provider does not know this address or its domain. */
14
+ EmailSenderVerificationStatus["UNVERIFIED"] = "UNVERIFIED";
15
+ /** Verification was started and is waiting on the owner (inbox click or DNS records). */
16
+ EmailSenderVerificationStatus["PENDING"] = "PENDING";
17
+ /** The provider accepts mail from this address. */
18
+ EmailSenderVerificationStatus["VERIFIED"] = "VERIFIED";
19
+ /** The last check could not be completed (provider error); the previous answer no longer holds. */
20
+ EmailSenderVerificationStatus["FAILED"] = "FAILED";
21
+ })(EmailSenderVerificationStatus || (EmailSenderVerificationStatus = {}));
22
+ /** How the provider recognises the address. */
23
+ export var EmailSenderVerificationMethod;
24
+ (function (EmailSenderVerificationMethod) {
25
+ /** The exact address was verified on its own (SendGrid Single Sender Verification). */
26
+ EmailSenderVerificationMethod["SINGLE_SENDER"] = "SINGLE_SENDER";
27
+ /** The whole domain is authenticated (SendGrid domain authentication, Mailgun domain). */
28
+ EmailSenderVerificationMethod["DOMAIN"] = "DOMAIN";
29
+ })(EmailSenderVerificationMethod || (EmailSenderVerificationMethod = {}));
30
+ //# sourceMappingURL=email-sender-verification.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-sender-verification.enum.js","sourceRoot":"","sources":["../../../../../src/modules/notification/enums/email-sender-verification.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,CAAN,IAAY,6BASX;AATD,WAAY,6BAA6B;IACrC,6DAA6D;IAC7D,0DAAyB,CAAA;IACzB,yFAAyF;IACzF,oDAAmB,CAAA;IACnB,mDAAmD;IACnD,sDAAqB,CAAA;IACrB,mGAAmG;IACnG,kDAAiB,CAAA;AACrB,CAAC,EATW,6BAA6B,KAA7B,6BAA6B,QASxC;AAED,+CAA+C;AAC/C,MAAM,CAAN,IAAY,6BAKX;AALD,WAAY,6BAA6B;IACrC,uFAAuF;IACvF,gEAA+B,CAAA;IAC/B,0FAA0F;IAC1F,kDAAiB,CAAA;AACrB,CAAC,EALW,6BAA6B,KAA7B,6BAA6B,QAKxC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Where one resolved branding value came from. Branding is resolved field by
3
+ * field, highest precedence first, so a half-filled profile still produces a
4
+ * complete email:
5
+ *
6
+ * PROFILE the organization's notification settings
7
+ * ORGANIZATION the organization record (clarion-organization)
8
+ * APP_DEFAULT the legacy per-app defaults (deprecated; kept so nothing
9
+ * changes for an organization that has configured nothing)
10
+ * PLATFORM_DEFAULT the platform's own branding
11
+ */
12
+ export var NotificationBrandingSource;
13
+ (function (NotificationBrandingSource) {
14
+ NotificationBrandingSource["PROFILE"] = "PROFILE";
15
+ NotificationBrandingSource["ORGANIZATION"] = "ORGANIZATION";
16
+ NotificationBrandingSource["APP_DEFAULT"] = "APP_DEFAULT";
17
+ NotificationBrandingSource["PLATFORM_DEFAULT"] = "PLATFORM_DEFAULT";
18
+ })(NotificationBrandingSource || (NotificationBrandingSource = {}));
19
+ //# sourceMappingURL=notification-branding-source.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-branding-source.enum.js","sourceRoot":"","sources":["../../../../../src/modules/notification/enums/notification-branding-source.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,CAAN,IAAY,0BAKX;AALD,WAAY,0BAA0B;IAClC,iDAAmB,CAAA;IACnB,2DAA6B,CAAA;IAC7B,yDAA2B,CAAA;IAC3B,mEAAqC,CAAA;AACzC,CAAC,EALW,0BAA0B,KAA1B,0BAA0B,QAKrC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Whose identity a message actually went out under. Recorded on every delivery
3
+ * log so "why did this customer get an Upesy-branded SMS?" is a query, not a guess.
4
+ */
5
+ export var NotificationSenderSource;
6
+ (function (NotificationSenderSource) {
7
+ /** The organization's own verified email address / active SMS sender. */
8
+ NotificationSenderSource["ORGANIZATION"] = "ORGANIZATION";
9
+ /** The platform's default (country-aware) sender. */
10
+ NotificationSenderSource["PLATFORM_DEFAULT"] = "PLATFORM_DEFAULT";
11
+ })(NotificationSenderSource || (NotificationSenderSource = {}));
12
+ //# sourceMappingURL=notification-sender-source.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-sender-source.enum.js","sourceRoot":"","sources":["../../../../../src/modules/notification/enums/notification-sender-source.enum.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAN,IAAY,wBAKX;AALD,WAAY,wBAAwB;IAChC,yEAAyE;IACzE,yDAA6B,CAAA;IAC7B,qDAAqD;IACrD,iEAAqC,CAAA;AACzC,CAAC,EALW,wBAAwB,KAAxB,wBAAwB,QAKnC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Lifecycle of an organization-owned SMS sender.
3
+ *
4
+ * A sender ID only works once the provider (and, behind it, the telco) has
5
+ * registered it, which happens outside Clarion. So an organization REQUESTS a
6
+ * sender and a platform operator ACTIVATES it after the registration is real.
7
+ * Only ACTIVE senders are ever used to send; every other state falls back to the
8
+ * platform's country-aware default sender.
9
+ */
10
+ export var NotificationSenderStatus;
11
+ (function (NotificationSenderStatus) {
12
+ /** Requested by the organization; not yet confirmed as registered with the provider. */
13
+ NotificationSenderStatus["PENDING"] = "PENDING";
14
+ /** Registered with the provider and in use. */
15
+ NotificationSenderStatus["ACTIVE"] = "ACTIVE";
16
+ /** Temporarily taken out of use (e.g. the telco suspended it). Kept for history. */
17
+ NotificationSenderStatus["SUSPENDED"] = "SUSPENDED";
18
+ /** The provider or the operator refused the registration. */
19
+ NotificationSenderStatus["REJECTED"] = "REJECTED";
20
+ })(NotificationSenderStatus || (NotificationSenderStatus = {}));
21
+ //# sourceMappingURL=notification-sender-status.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-sender-status.enum.js","sourceRoot":"","sources":["../../../../../src/modules/notification/enums/notification-sender-status.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,CAAN,IAAY,wBASX;AATD,WAAY,wBAAwB;IAChC,wFAAwF;IACxF,+CAAmB,CAAA;IACnB,+CAA+C;IAC/C,6CAAiB,CAAA;IACjB,oFAAoF;IACpF,mDAAuB,CAAA;IACvB,6DAA6D;IAC7D,iDAAqB,CAAA;AACzB,CAAC,EATW,wBAAwB,KAAxB,wBAAwB,QASnC"}
@@ -1,11 +1,16 @@
1
1
  /**
2
2
  * Identifiers for the SMS providers the notification service can dispatch through.
3
3
  * Provider order/fallback is configuration-driven; new providers can be appended.
4
+ *
5
+ * A code here only RESERVES the name. Whether a provider can actually be used is
6
+ * answered by the notification service's provider catalog
7
+ * (`SmsProviderDescriptor`), which lists only providers with a registered adapter.
4
8
  */
5
9
  export var SmsProviderName;
6
10
  (function (SmsProviderName) {
7
11
  SmsProviderName["TWILIO"] = "twilio";
8
12
  SmsProviderName["UWAZII"] = "uwazii";
9
13
  SmsProviderName["AFRICASTALKING"] = "africastalking";
14
+ SmsProviderName["CELCOM"] = "celcom";
10
15
  })(SmsProviderName || (SmsProviderName = {}));
11
16
  //# sourceMappingURL=sms-provider-name.enum.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sms-provider-name.enum.js","sourceRoot":"","sources":["../../../../../src/modules/notification/enums/sms-provider-name.enum.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAN,IAAY,eAIX;AAJD,WAAY,eAAe;IACvB,oCAAiB,CAAA;IACjB,oCAAiB,CAAA;IACjB,oDAAiC,CAAA;AACrC,CAAC,EAJW,eAAe,KAAf,eAAe,QAI1B"}
1
+ {"version":3,"file":"sms-provider-name.enum.js","sourceRoot":"","sources":["../../../../../src/modules/notification/enums/sms-provider-name.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAN,IAAY,eAKX;AALD,WAAY,eAAe;IACvB,oCAAiB,CAAA;IACjB,oCAAiB,CAAA;IACjB,oDAAiC,CAAA;IACjC,oCAAiB,CAAA;AACrB,CAAC,EALW,eAAe,KAAf,eAAe,QAK1B"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * What kind of identity an SMS is sent from.
3
+ *
4
+ * The type decides how the value is validated and how a provider is handed it:
5
+ * an alphanumeric name and a phone number both travel as the provider's "from",
6
+ * while a Twilio Messaging Service SID replaces the from entirely.
7
+ */
8
+ export var SmsSenderType;
9
+ (function (SmsSenderType) {
10
+ /** A registered alphanumeric sender name, e.g. `G4S`. At most 11 characters. */
11
+ SmsSenderType["ALPHANUMERIC"] = "ALPHANUMERIC";
12
+ /** An E.164 long number, e.g. `+254711000000`. */
13
+ SmsSenderType["PHONE_NUMBER"] = "PHONE_NUMBER";
14
+ /** A telco short code, e.g. `22384`. */
15
+ SmsSenderType["SHORT_CODE"] = "SHORT_CODE";
16
+ /** A provider-side sender pool (Twilio Messaging Service SID, `MG…`). */
17
+ SmsSenderType["MESSAGING_SERVICE"] = "MESSAGING_SERVICE";
18
+ })(SmsSenderType || (SmsSenderType = {}));
19
+ //# sourceMappingURL=sms-sender-type.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sms-sender-type.enum.js","sourceRoot":"","sources":["../../../../../src/modules/notification/enums/sms-sender-type.enum.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAN,IAAY,aASX;AATD,WAAY,aAAa;IACrB,gFAAgF;IAChF,8CAA6B,CAAA;IAC7B,kDAAkD;IAClD,8CAA6B,CAAA;IAC7B,wCAAwC;IACxC,0CAAyB,CAAA;IACzB,yEAAyE;IACzE,wDAAuC,CAAA;AAC3C,CAAC,EATW,aAAa,KAAb,aAAa,QASxB"}
@@ -4,6 +4,11 @@ export * from './enums/sms-provider-name.enum';
4
4
  export * from './enums/email-provider-name.enum';
5
5
  export * from './enums/notification-overall-status.enum';
6
6
  export * from './enums/provider-failure-reason.enum';
7
+ export * from './enums/sms-sender-type.enum';
8
+ export * from './enums/notification-sender-status.enum';
9
+ export * from './enums/email-sender-verification.enum';
10
+ export * from './enums/notification-sender-source.enum';
11
+ export * from './enums/notification-branding-source.enum';
7
12
  // Result/interface contracts (display-safe)
8
13
  export * from './interfaces/provider-attempt';
9
14
  export * from './interfaces/per-channel-result';
@@ -13,4 +18,13 @@ export * from './interfaces/notification-dispatch-result';
13
18
  // Backend/service-level request contracts
14
19
  export * from './interfaces/sms-send-request';
15
20
  export * from './interfaces/email-send-request';
21
+ // Organization notification settings (branding + sender identity)
22
+ export * from './interfaces/organization-notification-settings';
23
+ export * from './dtos/organization-notification-settings.dto';
24
+ export * from './constants/notification-sender.const';
25
+ export * from './utils/notification-sender.util';
26
+ // clarion-billing -> clarion-notification HTTP contract (POST /billing/notifications/*)
27
+ export * from './enums/billing-notification.enum';
28
+ export * from './dtos/billing-notification.dto';
29
+ export * from './interfaces/billing-notification-result';
16
30
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/notification/index.ts"],"names":[],"mappings":"AAAA,QAAQ;AACR,cAAc,mCAAmC,CAAC;AAClD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AACjD,cAAc,0CAA0C,CAAC;AACzD,cAAc,sCAAsC,CAAC;AAErD,4CAA4C;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2CAA2C,CAAC;AAE1D,0CAA0C;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/notification/index.ts"],"names":[],"mappings":"AAAA,QAAQ;AACR,cAAc,mCAAmC,CAAC;AAClD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AACjD,cAAc,0CAA0C,CAAC;AACzD,cAAc,sCAAsC,CAAC;AACrD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yCAAyC,CAAC;AACxD,cAAc,wCAAwC,CAAC;AACvD,cAAc,yCAAyC,CAAC;AACxD,cAAc,2CAA2C,CAAC;AAE1D,4CAA4C;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2CAA2C,CAAC;AAE1D,0CAA0C;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAEhD,kEAAkE;AAClE,cAAc,iDAAiD,CAAC;AAChE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,uCAAuC,CAAC;AACtD,cAAc,kCAAkC,CAAC;AAEjD,wFAAwF;AACxF,cAAc,mCAAmC,CAAC;AAClD,cAAc,iCAAiC,CAAC;AAChD,cAAc,0CAA0C,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=billing-notification-result.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing-notification-result.js","sourceRoot":"","sources":["../../../../../src/modules/notification/interfaces/billing-notification-result.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=organization-notification-settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organization-notification-settings.js","sourceRoot":"","sources":["../../../../../src/modules/notification/interfaces/organization-notification-settings.ts"],"names":[],"mappings":""}