grm-shared-library 1.1.210 → 1.1.212
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.
- package/README.md +58 -0
- package/dist/cjs/kafka/dtos/account-deletion/account-deletion-request-payload.dto.js +6 -0
- package/dist/cjs/kafka/dtos/account-deletion/account-deletion-request-payload.dto.js.map +1 -1
- package/dist/cjs/kafka/dtos/otp/create-otp-payload.dto.js +6 -0
- package/dist/cjs/kafka/dtos/otp/create-otp-payload.dto.js.map +1 -1
- package/dist/cjs/kafka/dtos/password/password-reset-payload.dto.js +6 -0
- package/dist/cjs/kafka/dtos/password/password-reset-payload.dto.js.map +1 -1
- package/dist/cjs/kafka/dtos/user/create-user-registered-payload.dto.js +6 -0
- package/dist/cjs/kafka/dtos/user/create-user-registered-payload.dto.js.map +1 -1
- package/dist/cjs/modules/notification/constants/notification-sender.const.js +30 -0
- package/dist/cjs/modules/notification/constants/notification-sender.const.js.map +1 -0
- package/dist/cjs/modules/notification/dtos/organization-notification-settings.dto.js +354 -0
- package/dist/cjs/modules/notification/dtos/organization-notification-settings.dto.js.map +1 -0
- package/dist/cjs/modules/notification/enums/email-sender-verification.enum.js +33 -0
- package/dist/cjs/modules/notification/enums/email-sender-verification.enum.js.map +1 -0
- package/dist/cjs/modules/notification/enums/notification-branding-source.enum.js +22 -0
- package/dist/cjs/modules/notification/enums/notification-branding-source.enum.js.map +1 -0
- package/dist/cjs/modules/notification/enums/notification-sender-source.enum.js +15 -0
- package/dist/cjs/modules/notification/enums/notification-sender-source.enum.js.map +1 -0
- package/dist/cjs/modules/notification/enums/notification-sender-status.enum.js +24 -0
- package/dist/cjs/modules/notification/enums/notification-sender-status.enum.js.map +1 -0
- package/dist/cjs/modules/notification/enums/sms-provider-name.enum.js +5 -0
- package/dist/cjs/modules/notification/enums/sms-provider-name.enum.js.map +1 -1
- package/dist/cjs/modules/notification/enums/sms-sender-type.enum.js +22 -0
- package/dist/cjs/modules/notification/enums/sms-sender-type.enum.js.map +1 -0
- package/dist/cjs/modules/notification/index.js +10 -0
- package/dist/cjs/modules/notification/index.js.map +1 -1
- package/dist/cjs/modules/notification/interfaces/organization-notification-settings.js +3 -0
- package/dist/cjs/modules/notification/interfaces/organization-notification-settings.js.map +1 -0
- package/dist/cjs/modules/notification/utils/notification-sender.util.js +67 -0
- package/dist/cjs/modules/notification/utils/notification-sender.util.js.map +1 -0
- package/dist/cjs/modules/permission/data/permissions.data.js +12 -0
- package/dist/cjs/modules/permission/data/permissions.data.js.map +1 -1
- package/dist/cjs/modules/permission/enums/permission-actions.enum.js +31 -0
- package/dist/cjs/modules/permission/enums/permission-actions.enum.js.map +1 -1
- package/dist/cjs/modules/permission/enums/permissions-module.enum.js +1 -0
- package/dist/cjs/modules/permission/enums/permissions-module.enum.js.map +1 -1
- package/dist/cjs/modules/role/constants/roles-by-scope.js +2 -1
- package/dist/cjs/modules/role/constants/roles-by-scope.js.map +1 -1
- package/dist/cjs/modules/role/data/roles.data.js +95 -2
- package/dist/cjs/modules/role/data/roles.data.js.map +1 -1
- package/dist/cjs/modules/role/enums/role.enum.js +6 -0
- package/dist/cjs/modules/role/enums/role.enum.js.map +1 -1
- package/dist/esm/kafka/dtos/account-deletion/account-deletion-request-payload.dto.js +7 -1
- package/dist/esm/kafka/dtos/account-deletion/account-deletion-request-payload.dto.js.map +1 -1
- package/dist/esm/kafka/dtos/otp/create-otp-payload.dto.js +7 -1
- package/dist/esm/kafka/dtos/otp/create-otp-payload.dto.js.map +1 -1
- package/dist/esm/kafka/dtos/password/password-reset-payload.dto.js +7 -1
- package/dist/esm/kafka/dtos/password/password-reset-payload.dto.js.map +1 -1
- package/dist/esm/kafka/dtos/user/create-user-registered-payload.dto.js +7 -1
- package/dist/esm/kafka/dtos/user/create-user-registered-payload.dto.js.map +1 -1
- package/dist/esm/modules/notification/constants/notification-sender.const.js +27 -0
- package/dist/esm/modules/notification/constants/notification-sender.const.js.map +1 -0
- package/dist/esm/modules/notification/dtos/organization-notification-settings.dto.js +343 -0
- package/dist/esm/modules/notification/dtos/organization-notification-settings.dto.js.map +1 -0
- package/dist/esm/modules/notification/enums/email-sender-verification.enum.js +30 -0
- package/dist/esm/modules/notification/enums/email-sender-verification.enum.js.map +1 -0
- package/dist/esm/modules/notification/enums/notification-branding-source.enum.js +19 -0
- package/dist/esm/modules/notification/enums/notification-branding-source.enum.js.map +1 -0
- package/dist/esm/modules/notification/enums/notification-sender-source.enum.js +12 -0
- package/dist/esm/modules/notification/enums/notification-sender-source.enum.js.map +1 -0
- package/dist/esm/modules/notification/enums/notification-sender-status.enum.js +21 -0
- package/dist/esm/modules/notification/enums/notification-sender-status.enum.js.map +1 -0
- package/dist/esm/modules/notification/enums/sms-provider-name.enum.js +5 -0
- package/dist/esm/modules/notification/enums/sms-provider-name.enum.js.map +1 -1
- package/dist/esm/modules/notification/enums/sms-sender-type.enum.js +19 -0
- package/dist/esm/modules/notification/enums/sms-sender-type.enum.js.map +1 -0
- package/dist/esm/modules/notification/index.js +10 -0
- package/dist/esm/modules/notification/index.js.map +1 -1
- package/dist/esm/modules/notification/interfaces/organization-notification-settings.js +2 -0
- package/dist/esm/modules/notification/interfaces/organization-notification-settings.js.map +1 -0
- package/dist/esm/modules/notification/utils/notification-sender.util.js +60 -0
- package/dist/esm/modules/notification/utils/notification-sender.util.js.map +1 -0
- package/dist/esm/modules/permission/data/permissions.data.js +12 -0
- package/dist/esm/modules/permission/data/permissions.data.js.map +1 -1
- package/dist/esm/modules/permission/enums/permission-actions.enum.js +31 -0
- package/dist/esm/modules/permission/enums/permission-actions.enum.js.map +1 -1
- package/dist/esm/modules/permission/enums/permissions-module.enum.js +1 -0
- package/dist/esm/modules/permission/enums/permissions-module.enum.js.map +1 -1
- package/dist/esm/modules/role/constants/roles-by-scope.js +2 -1
- package/dist/esm/modules/role/constants/roles-by-scope.js.map +1 -1
- package/dist/esm/modules/role/data/roles.data.js +95 -2
- package/dist/esm/modules/role/data/roles.data.js.map +1 -1
- package/dist/esm/modules/role/enums/role.enum.js +6 -0
- package/dist/esm/modules/role/enums/role.enum.js.map +1 -1
- package/dist/types/kafka/dtos/account-deletion/account-deletion-request-payload.dto.d.ts +6 -0
- package/dist/types/kafka/dtos/otp/create-otp-payload.dto.d.ts +6 -0
- package/dist/types/kafka/dtos/password/password-reset-payload.dto.d.ts +6 -0
- package/dist/types/kafka/dtos/user/create-user-registered-payload.dto.d.ts +6 -0
- package/dist/types/modules/notification/constants/notification-sender.const.d.ts +16 -0
- package/dist/types/modules/notification/dtos/organization-notification-settings.dto.d.ts +64 -0
- package/dist/types/modules/notification/enums/email-sender-verification.enum.d.ts +27 -0
- package/dist/types/modules/notification/enums/notification-branding-source.enum.d.ts +17 -0
- package/dist/types/modules/notification/enums/notification-sender-source.enum.d.ts +10 -0
- package/dist/types/modules/notification/enums/notification-sender-status.enum.d.ts +19 -0
- package/dist/types/modules/notification/enums/sms-provider-name.enum.d.ts +6 -1
- package/dist/types/modules/notification/enums/sms-sender-type.enum.d.ts +17 -0
- package/dist/types/modules/notification/index.d.ts +9 -0
- package/dist/types/modules/notification/interfaces/email-send-request.d.ts +6 -0
- package/dist/types/modules/notification/interfaces/email-send-result.d.ts +7 -0
- package/dist/types/modules/notification/interfaces/organization-notification-settings.d.ts +163 -0
- package/dist/types/modules/notification/interfaces/provider-attempt.d.ts +5 -0
- package/dist/types/modules/notification/interfaces/sms-send-result.d.ts +7 -0
- package/dist/types/modules/notification/utils/notification-sender.util.d.ts +25 -0
- package/dist/types/modules/permission/enums/permission-actions.enum.d.ts +20 -1
- package/dist/types/modules/permission/enums/permissions-module.enum.d.ts +2 -1
- package/dist/types/modules/role/enums/role.enum.d.ts +6 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -146,6 +146,39 @@ filtering) are delivered in later phases and should build on top of these types.
|
|
|
146
146
|
npm test # compiles src/modules/country and runs the country/currency suite
|
|
147
147
|
```
|
|
148
148
|
|
|
149
|
+
## Organization notification settings
|
|
150
|
+
|
|
151
|
+
Clarion is multi-tenant, so what a customer sees in a notification belongs to the
|
|
152
|
+
**organization** that serves them. `modules/notification` carries the contract for
|
|
153
|
+
that, shared by clarion-notification (owner), the gateway (proxy) and
|
|
154
|
+
clarion-authentication (emitter):
|
|
155
|
+
|
|
156
|
+
- **`organizationId` is the key.** The four auth event payloads (`CreateOTPPayloadDto`,
|
|
157
|
+
`CreateUserRegisteredPayloadDto`, `PasswordResetPayloadDto`,
|
|
158
|
+
`AccountDeletionRequestPayloadDto`) gained an optional `organizationId`, and
|
|
159
|
+
`EmailSendRequest` / `SmsSendRequest` carry one. `appId` stays on every payload, but
|
|
160
|
+
only as the fallback for an emitter that has not been upgraded. The notification
|
|
161
|
+
service validates with `whitelist: true`, so it must be on a version that declares
|
|
162
|
+
the field or the field is stripped before anything reads it.
|
|
163
|
+
- **Branding resolves field by field** - `NotificationBrandingSource`: the
|
|
164
|
+
organization's profile, then its record in clarion-organization, then the legacy
|
|
165
|
+
per-app defaults, then the platform. `UpsertOrganizationNotificationBrandingDto`
|
|
166
|
+
turns `""` into `null`, and null means *inherit again*, not *blank*.
|
|
167
|
+
- **Email senders are verified per provider** (`EmailSenderProviderVerification`). A
|
|
168
|
+
provider only sends from an address it has `VERIFIED`; otherwise that provider uses
|
|
169
|
+
the platform sender and keeps the organization's display name and reply-to.
|
|
170
|
+
- **SMS senders are requested, then approved** (`NotificationSenderStatus`). Only
|
|
171
|
+
`ACTIVE` senders are used; everything else falls back to the country-aware default.
|
|
172
|
+
`validateSmsSenderId(type, value)` is the one definition of a valid sender.
|
|
173
|
+
- **Providers describe themselves** (`SmsProviderDescriptor`), like tracking providers
|
|
174
|
+
do. `SmsProviderName` only reserves a code; the catalogue says what is usable.
|
|
175
|
+
- Every send result records `sender` and `senderSource`
|
|
176
|
+
(`ORGANIZATION` | `PLATFORM_DEFAULT`), so "why was this Upesy-branded?" is a query.
|
|
177
|
+
|
|
178
|
+
Values that end up inside email CSS or headers are validated as such: colours are
|
|
179
|
+
`#RRGGBB` only, logos are `https` only, and a sender display name may not contain a
|
|
180
|
+
line break. `notification-sender.spec.ts` pins each of those.
|
|
181
|
+
|
|
149
182
|
## Roles and permissions
|
|
150
183
|
|
|
151
184
|
This package is the authority on both. clarion-authentication seeds them into its
|
|
@@ -194,11 +227,36 @@ all twelve (everybody who could administer tracking before the split still can);
|
|
|
194
227
|
`Organization:User` - the five `read` actions; `Control-Centre:User` and `Responder` -
|
|
195
228
|
position and history; `Mobile-User` - **none**.
|
|
196
229
|
|
|
230
|
+
### The Notification permission module
|
|
231
|
+
|
|
232
|
+
An organization's notification settings (clarion-notification) decide what its
|
|
233
|
+
**customers** see: how emails are branded, the address they come from, and the sender
|
|
234
|
+
ID its SMS arrive under. They have actions of their own rather than reusing
|
|
235
|
+
`update:organization`, because a wrong logo or sender goes out on every OTP and alert.
|
|
236
|
+
|
|
237
|
+
| Action | Covers |
|
|
238
|
+
|---|---|
|
|
239
|
+
| `read:notification-settings` | Reading the settings, the effective (resolved) branding and the SMS provider catalogue. |
|
|
240
|
+
| `manage:notification-settings` | Saving branding; adding, verifying and removing email senders; **requesting** SMS senders; sending a test email. |
|
|
241
|
+
| `approve:notification-sender` | Moving an SMS sender to `ACTIVE` / `SUSPENDED` / `REJECTED`. |
|
|
242
|
+
|
|
243
|
+
Owner and Admin hold the first two. **No role holds `approve:notification-sender`** -
|
|
244
|
+
only Super-Admin (`*`) passes it, and `roles.spec.ts` pins that. Activating a sender
|
|
245
|
+
asserts that it is registered with the provider and the telco; an organization able to
|
|
246
|
+
approve its own could send SMS under any name it typed.
|
|
247
|
+
|
|
197
248
|
### Adding a role: every step fails silently on its own
|
|
198
249
|
|
|
199
250
|
1. **Here** - the `Roles` value, a scope list, and a `ROLES_DATA` entry. `roles.spec.ts`
|
|
200
251
|
fails if a scoped role is unseeded, a seeded role is not in the enum, or a role
|
|
201
252
|
holds an action the catalogue does not list.
|
|
253
|
+
|
|
254
|
+
The same spec holds the rule for **actions**: every `PermissionActions` value must
|
|
255
|
+
be in `PERMISSIONS_DATA`, under exactly one module. An action outside the catalogue
|
|
256
|
+
still *works* - the gateway matches on the string - but role management can neither
|
|
257
|
+
show nor assign it, which is how the four `zone` actions went unnoticed for so long
|
|
258
|
+
(they now have a `Zone` module). Role and module names are also pinned to 50
|
|
259
|
+
characters, the width of the columns clarion-authentication stores them in.
|
|
202
260
|
2. **clarion-authentication** - `users.roles` is a Postgres ENUM array, so the label
|
|
203
261
|
needs an `ALTER TYPE "users_roles_enum" ADD VALUE IF NOT EXISTS` migration. Without
|
|
204
262
|
it the role is seeded, offered by the admin, and rejected at the INSERT.
|
|
@@ -22,6 +22,12 @@ __decorate([
|
|
|
22
22
|
(0, class_validator_1.IsNotEmpty)(),
|
|
23
23
|
__metadata("design:type", String)
|
|
24
24
|
], AccountDeletionRequestPayloadDto.prototype, "appId", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_validator_1.IsInt)(),
|
|
27
|
+
(0, class_validator_1.IsPositive)(),
|
|
28
|
+
(0, class_validator_1.IsOptional)(),
|
|
29
|
+
__metadata("design:type", Number)
|
|
30
|
+
], AccountDeletionRequestPayloadDto.prototype, "organizationId", void 0);
|
|
25
31
|
__decorate([
|
|
26
32
|
(0, class_validator_1.IsNumber)(),
|
|
27
33
|
(0, class_validator_1.IsNotEmpty)(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-deletion-request-payload.dto.js","sourceRoot":"","sources":["../../../../../src/kafka/dtos/account-deletion/account-deletion-request-payload.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"account-deletion-request-payload.dto.js","sourceRoot":"","sources":["../../../../../src/kafka/dtos/account-deletion/account-deletion-request-payload.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA0I;AAC1I,yDAA8C;AAC9C,wDAA0D;AAC1D,uGAA6F;AAE7F,MAAa,gCAAgC;CA4C5C;AA5CD,4EA4CC;AAzCG;IAFC,IAAA,wBAAM,EAAC,wBAAa,CAAC;IACrB,IAAA,4BAAU,GAAE;;+DACS;AAUtB;IAHC,IAAA,uBAAK,GAAE;IACP,IAAA,4BAAU,GAAE;IACZ,IAAA,4BAAU,GAAE;;wEACW;AAIxB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;gEACG;AAIhB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;8DACC;AAId;IAFC,IAAA,yBAAO,GAAE;IACT,IAAA,4BAAU,GAAE;;+DACE;AAIf;IAFC,IAAA,wBAAM,EAAC,gDAAmB,CAAC;IAC3B,IAAA,4BAAU,GAAE;;gEACgB;AAM7B;IAJC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,EAAC,GAAG,CAAC;IACd,IAAA,6BAAS,EAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC;;4EAC/B;AAI5B;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;mEACM;AAInB;IAFC,IAAA,8BAAY,GAAE;IACd,IAAA,4BAAU,GAAE;;mEACM"}
|
|
@@ -21,6 +21,12 @@ __decorate([
|
|
|
21
21
|
(0, class_validator_1.IsNotEmpty)(),
|
|
22
22
|
__metadata("design:type", String)
|
|
23
23
|
], CreateOTPPayloadDto.prototype, "appId", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, class_validator_1.IsInt)(),
|
|
26
|
+
(0, class_validator_1.IsPositive)(),
|
|
27
|
+
(0, class_validator_1.IsOptional)(),
|
|
28
|
+
__metadata("design:type", Number)
|
|
29
|
+
], CreateOTPPayloadDto.prototype, "organizationId", void 0);
|
|
24
30
|
__decorate([
|
|
25
31
|
(0, class_validator_1.IsString)(),
|
|
26
32
|
(0, class_validator_1.IsNotEmpty)(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-otp-payload.dto.js","sourceRoot":"","sources":["../../../../../src/kafka/dtos/otp/create-otp-payload.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"create-otp-payload.dto.js","sourceRoot":"","sources":["../../../../../src/kafka/dtos/otp/create-otp-payload.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAwI;AACxI,uEAAmE;AACnE,wDAA0D;AAE1D,MAAa,mBAAmB;CA0D/B;AA1DD,kDA0DC;AAvDG;IAFC,IAAA,wBAAM,EAAC,wBAAa,CAAC;IACrB,IAAA,4BAAU,GAAE;;kDACS;AAUtB;IAHC,IAAA,uBAAK,GAAE;IACP,IAAA,4BAAU,GAAE;IACZ,IAAA,4BAAU,GAAE;;2DACW;AAIxB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;iDACC;AAId;IAFC,IAAA,yBAAO,GAAE;IACT,IAAA,4BAAU,GAAE;;kDACE;AAIf;IAFC,IAAA,+BAAa,GAAE;IACf,IAAA,4BAAU,GAAE;;wDACQ;AAIrB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;iDACC;AAId;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;8DACc;AAI3B;IAFC,IAAA,wBAAM,GAAE;IACR,IAAA,4BAAU,GAAE;8BACgB,IAAI;uEAAC;AAIlC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;gDACA;AAIb;IAFC,IAAA,wBAAM,GAAE;IACR,IAAA,4BAAU,GAAE;8BACE,IAAI;yDAAC;AAIpB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;qEACqB;AAIlC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;mDACM;AAInB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;uDACoB"}
|
|
@@ -21,6 +21,12 @@ __decorate([
|
|
|
21
21
|
(0, class_validator_1.IsNotEmpty)(),
|
|
22
22
|
__metadata("design:type", String)
|
|
23
23
|
], PasswordResetPayloadDto.prototype, "appId", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, class_validator_1.IsInt)(),
|
|
26
|
+
(0, class_validator_1.IsPositive)(),
|
|
27
|
+
(0, class_validator_1.IsOptional)(),
|
|
28
|
+
__metadata("design:type", Number)
|
|
29
|
+
], PasswordResetPayloadDto.prototype, "organizationId", void 0);
|
|
24
30
|
__decorate([
|
|
25
31
|
(0, class_validator_1.IsString)(),
|
|
26
32
|
(0, class_validator_1.IsNotEmpty)(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"password-reset-payload.dto.js","sourceRoot":"","sources":["../../../../../src/kafka/dtos/password/password-reset-payload.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"password-reset-payload.dto.js","sourceRoot":"","sources":["../../../../../src/kafka/dtos/password/password-reset-payload.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA6G;AAC7G,yDAA8C;AAC9C,wDAA0D;AAE1D,MAAa,uBAAuB;CAgCnC;AAhCD,0DAgCC;AA7BG;IAFC,IAAA,wBAAM,EAAC,wBAAa,CAAC;IACrB,IAAA,4BAAU,GAAE;;sDACS;AAUtB;IAHC,IAAA,uBAAK,GAAE;IACP,IAAA,4BAAU,GAAE;IACZ,IAAA,4BAAU,GAAE;;+DACW;AAIxB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;qDACC;AAId;IAFC,IAAA,yBAAO,GAAE;IACT,IAAA,4BAAU,GAAE;;sDACE;AAKf;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,sBAAI,GAAE;IACN,IAAA,6BAAS,EAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC;;0DACxC;AAKnB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,6BAAS,EAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC;;wDAC1C"}
|
|
@@ -25,6 +25,12 @@ __decorate([
|
|
|
25
25
|
(0, class_validator_1.IsNotEmpty)(),
|
|
26
26
|
__metadata("design:type", String)
|
|
27
27
|
], CreateUserRegisteredPayloadDto.prototype, "appId", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, class_validator_1.IsInt)(),
|
|
30
|
+
(0, class_validator_1.IsPositive)(),
|
|
31
|
+
(0, class_validator_1.IsOptional)(),
|
|
32
|
+
__metadata("design:type", Number)
|
|
33
|
+
], CreateUserRegisteredPayloadDto.prototype, "organizationId", void 0);
|
|
28
34
|
__decorate([
|
|
29
35
|
(0, class_validator_1.IsString)(),
|
|
30
36
|
(0, class_validator_1.IsNotEmpty)(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-user-registered-payload.dto.js","sourceRoot":"","sources":["../../../../../src/kafka/dtos/user/create-user-registered-payload.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"create-user-registered-payload.dto.js","sourceRoot":"","sources":["../../../../../src/kafka/dtos/user/create-user-registered-payload.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAkJ;AAClJ,wDAA0D;AAE1D,MAAa,8BAA8B;CAsC1C;AAtCD,wEAsCC;AAnCG;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;0DACD;AAIZ;IAFC,IAAA,wBAAM,EAAC,wBAAa,CAAC;IACrB,IAAA,4BAAU,GAAE;;6DACS;AAUtB;IAHC,IAAA,uBAAK,GAAE;IACP,IAAA,4BAAU,GAAE;IACZ,IAAA,4BAAU,GAAE;;sEACW;AAIxB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;4DACC;AAId;IAFC,IAAA,yBAAO,GAAE;IACT,IAAA,4BAAU,GAAE;;6DACE;AAIf;IAFC,IAAA,+BAAa,GAAE;IACf,IAAA,4BAAU,GAAE;;mEACQ;AAIrB;IAFC,IAAA,wBAAM,GAAE;IACR,IAAA,4BAAU,GAAE;8BACD,IAAI;iEAAC;AAIjB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;kEACoB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MAX_SMS_SENDERS_PER_ORGANIZATION = exports.MAX_EMAIL_SENDERS_PER_ORGANIZATION = exports.SMS_SENDER_ID_HINTS = exports.SMS_SENDER_ID_PATTERNS = exports.BRAND_COLOUR_PATTERN = void 0;
|
|
4
|
+
const sms_sender_type_enum_1 = require("../enums/sms-sender-type.enum");
|
|
5
|
+
/** `#RRGGBB`. The only colour format accepted, because it is inlined into email CSS. */
|
|
6
|
+
exports.BRAND_COLOUR_PATTERN = /^#[0-9a-fA-F]{6}$/;
|
|
7
|
+
/**
|
|
8
|
+
* What a sender value must look like, per type.
|
|
9
|
+
*
|
|
10
|
+
* ALPHANUMERIC follows the GSM rule every supported provider enforces: 3-11
|
|
11
|
+
* characters, at least one letter (an all-digit "name" is a number, and telcos
|
|
12
|
+
* reject it as spoofing).
|
|
13
|
+
*/
|
|
14
|
+
exports.SMS_SENDER_ID_PATTERNS = Object.freeze({
|
|
15
|
+
[sms_sender_type_enum_1.SmsSenderType.ALPHANUMERIC]: /^(?=.*[A-Za-z])[A-Za-z0-9 _.&-]{3,11}$/,
|
|
16
|
+
[sms_sender_type_enum_1.SmsSenderType.PHONE_NUMBER]: /^\+[1-9]\d{6,14}$/,
|
|
17
|
+
[sms_sender_type_enum_1.SmsSenderType.SHORT_CODE]: /^\d{3,8}$/,
|
|
18
|
+
[sms_sender_type_enum_1.SmsSenderType.MESSAGING_SERVICE]: /^MG[0-9a-fA-F]{32}$/,
|
|
19
|
+
});
|
|
20
|
+
/** Human-readable form of {@link SMS_SENDER_ID_PATTERNS}, for validation messages and form hints. */
|
|
21
|
+
exports.SMS_SENDER_ID_HINTS = Object.freeze({
|
|
22
|
+
[sms_sender_type_enum_1.SmsSenderType.ALPHANUMERIC]: '3-11 characters (letters, digits, space, _ . & -) with at least one letter, e.g. G4S',
|
|
23
|
+
[sms_sender_type_enum_1.SmsSenderType.PHONE_NUMBER]: 'an E.164 number, e.g. +254711000000',
|
|
24
|
+
[sms_sender_type_enum_1.SmsSenderType.SHORT_CODE]: '3-8 digits, e.g. 22384',
|
|
25
|
+
[sms_sender_type_enum_1.SmsSenderType.MESSAGING_SERVICE]: 'a Twilio Messaging Service SID (MG followed by 32 hex characters)',
|
|
26
|
+
});
|
|
27
|
+
/** Upper bounds that keep one organization from turning its settings into a list to page through. */
|
|
28
|
+
exports.MAX_EMAIL_SENDERS_PER_ORGANIZATION = 10;
|
|
29
|
+
exports.MAX_SMS_SENDERS_PER_ORGANIZATION = 30;
|
|
30
|
+
//# sourceMappingURL=notification-sender.const.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification-sender.const.js","sourceRoot":"","sources":["../../../../../src/modules/notification/constants/notification-sender.const.ts"],"names":[],"mappings":";;;AAAA,wEAA8D;AAE9D,wFAAwF;AAC3E,QAAA,oBAAoB,GAAG,mBAAmB,CAAC;AAExD;;;;;;GAMG;AACU,QAAA,sBAAsB,GAA4C,MAAM,CAAC,MAAM,CAAC;IACzF,CAAC,oCAAa,CAAC,YAAY,CAAC,EAAE,wCAAwC;IACtE,CAAC,oCAAa,CAAC,YAAY,CAAC,EAAE,mBAAmB;IACjD,CAAC,oCAAa,CAAC,UAAU,CAAC,EAAE,WAAW;IACvC,CAAC,oCAAa,CAAC,iBAAiB,CAAC,EAAE,qBAAqB;CAC3D,CAAC,CAAC;AAEH,qGAAqG;AACxF,QAAA,mBAAmB,GAA4C,MAAM,CAAC,MAAM,CAAC;IACtF,CAAC,oCAAa,CAAC,YAAY,CAAC,EAAE,sFAAsF;IACpH,CAAC,oCAAa,CAAC,YAAY,CAAC,EAAE,qCAAqC;IACnE,CAAC,oCAAa,CAAC,UAAU,CAAC,EAAE,wBAAwB;IACpD,CAAC,oCAAa,CAAC,iBAAiB,CAAC,EAAE,mEAAmE;CACzG,CAAC,CAAC;AAEH,qGAAqG;AACxF,QAAA,kCAAkC,GAAG,EAAE,CAAC;AACxC,QAAA,gCAAgC,GAAG,EAAE,CAAC"}
|
|
@@ -0,0 +1,354 @@
|
|
|
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.SendTestNotificationEmailDto = exports.ReviewOrganizationSmsSenderDto = exports.UpdateOrganizationSmsSenderDto = exports.CreateOrganizationSmsSenderDto = exports.UpdateOrganizationEmailSenderDto = exports.CreateOrganizationEmailSenderDto = exports.UpsertOrganizationNotificationBrandingDto = exports.NotificationSocialLinksDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_transformer_1 = require("class-transformer");
|
|
15
|
+
const class_validator_1 = require("class-validator");
|
|
16
|
+
const country_code_enum_1 = require("../../country/enums/country-code.enum");
|
|
17
|
+
const incident_app_id_enum_1 = require("../../incident/enums/incident-app-id.enum");
|
|
18
|
+
const notification_sender_const_1 = require("../constants/notification-sender.const");
|
|
19
|
+
const notification_sender_status_enum_1 = require("../enums/notification-sender-status.enum");
|
|
20
|
+
const sms_provider_name_enum_1 = require("../enums/sms-provider-name.enum");
|
|
21
|
+
const sms_sender_type_enum_1 = require("../enums/sms-sender-type.enum");
|
|
22
|
+
/**
|
|
23
|
+
* A cleared form field arrives as `""`. Branding is resolved field by field, so
|
|
24
|
+
* "cleared" has a real meaning - stop overriding, inherit again - and is stored
|
|
25
|
+
* as null. Without this an empty string would override the inherited value with
|
|
26
|
+
* nothing, and the email would go out with a blank footer.
|
|
27
|
+
*/
|
|
28
|
+
const emptyToNull = ({ value }) => typeof value === 'string' && value.trim() === '' ? null : typeof value === 'string' ? value.trim() : value;
|
|
29
|
+
/** Validate only when a value was actually supplied; null (inherit) and undefined (untouched) pass. */
|
|
30
|
+
const whenPresent = (_, value) => value !== null && value !== undefined;
|
|
31
|
+
const HTTPS_ONLY = { protocols: ['https'], require_protocol: true };
|
|
32
|
+
const COLOUR_MESSAGE = 'must be a #RRGGBB hex colour, e.g. #FC1B23';
|
|
33
|
+
class NotificationSocialLinksDto {
|
|
34
|
+
}
|
|
35
|
+
exports.NotificationSocialLinksDto = NotificationSocialLinksDto;
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, swagger_1.ApiPropertyOptional)({ nullable: true }),
|
|
38
|
+
(0, class_transformer_1.Transform)(emptyToNull),
|
|
39
|
+
(0, class_validator_1.ValidateIf)(whenPresent),
|
|
40
|
+
(0, class_validator_1.IsUrl)(HTTPS_ONLY),
|
|
41
|
+
(0, class_validator_1.MaxLength)(255),
|
|
42
|
+
__metadata("design:type", Object)
|
|
43
|
+
], NotificationSocialLinksDto.prototype, "facebook", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, swagger_1.ApiPropertyOptional)({ nullable: true }),
|
|
46
|
+
(0, class_transformer_1.Transform)(emptyToNull),
|
|
47
|
+
(0, class_validator_1.ValidateIf)(whenPresent),
|
|
48
|
+
(0, class_validator_1.IsUrl)(HTTPS_ONLY),
|
|
49
|
+
(0, class_validator_1.MaxLength)(255),
|
|
50
|
+
__metadata("design:type", Object)
|
|
51
|
+
], NotificationSocialLinksDto.prototype, "x", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, swagger_1.ApiPropertyOptional)({ nullable: true }),
|
|
54
|
+
(0, class_transformer_1.Transform)(emptyToNull),
|
|
55
|
+
(0, class_validator_1.ValidateIf)(whenPresent),
|
|
56
|
+
(0, class_validator_1.IsUrl)(HTTPS_ONLY),
|
|
57
|
+
(0, class_validator_1.MaxLength)(255),
|
|
58
|
+
__metadata("design:type", Object)
|
|
59
|
+
], NotificationSocialLinksDto.prototype, "instagram", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, swagger_1.ApiPropertyOptional)({ nullable: true }),
|
|
62
|
+
(0, class_transformer_1.Transform)(emptyToNull),
|
|
63
|
+
(0, class_validator_1.ValidateIf)(whenPresent),
|
|
64
|
+
(0, class_validator_1.IsUrl)(HTTPS_ONLY),
|
|
65
|
+
(0, class_validator_1.MaxLength)(255),
|
|
66
|
+
__metadata("design:type", Object)
|
|
67
|
+
], NotificationSocialLinksDto.prototype, "linkedin", void 0);
|
|
68
|
+
/**
|
|
69
|
+
* Saves an organization's branding. A PUT of the whole profile: a field sent as
|
|
70
|
+
* null (or "") stops overriding and inherits again; a field left out is untouched.
|
|
71
|
+
*/
|
|
72
|
+
class UpsertOrganizationNotificationBrandingDto {
|
|
73
|
+
}
|
|
74
|
+
exports.UpsertOrganizationNotificationBrandingDto = UpsertOrganizationNotificationBrandingDto;
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
77
|
+
enum: incident_app_id_enum_1.IncidentAppId,
|
|
78
|
+
nullable: true,
|
|
79
|
+
description: 'Super-admin only. Lets events that still carry only an appId resolve to this organization.',
|
|
80
|
+
}),
|
|
81
|
+
(0, class_transformer_1.Transform)(emptyToNull),
|
|
82
|
+
(0, class_validator_1.ValidateIf)(whenPresent),
|
|
83
|
+
(0, class_validator_1.IsEnum)(incident_app_id_enum_1.IncidentAppId),
|
|
84
|
+
__metadata("design:type", Object)
|
|
85
|
+
], UpsertOrganizationNotificationBrandingDto.prototype, "appId", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
(0, swagger_1.ApiPropertyOptional)({ nullable: true, example: 'G4S Kenya Ltd' }),
|
|
88
|
+
(0, class_transformer_1.Transform)(emptyToNull),
|
|
89
|
+
(0, class_validator_1.ValidateIf)(whenPresent),
|
|
90
|
+
(0, class_validator_1.IsString)(),
|
|
91
|
+
(0, class_validator_1.MaxLength)(100),
|
|
92
|
+
__metadata("design:type", Object)
|
|
93
|
+
], UpsertOrganizationNotificationBrandingDto.prototype, "companyName", void 0);
|
|
94
|
+
__decorate([
|
|
95
|
+
(0, swagger_1.ApiPropertyOptional)({ nullable: true, example: 'G4S Kenya' }),
|
|
96
|
+
(0, class_transformer_1.Transform)(emptyToNull),
|
|
97
|
+
(0, class_validator_1.ValidateIf)(whenPresent),
|
|
98
|
+
(0, class_validator_1.IsString)(),
|
|
99
|
+
(0, class_validator_1.MaxLength)(60),
|
|
100
|
+
__metadata("design:type", Object)
|
|
101
|
+
], UpsertOrganizationNotificationBrandingDto.prototype, "appName", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
(0, swagger_1.ApiPropertyOptional)({ nullable: true, description: 'HTTPS only: email clients block anything else.' }),
|
|
104
|
+
(0, class_transformer_1.Transform)(emptyToNull),
|
|
105
|
+
(0, class_validator_1.ValidateIf)(whenPresent),
|
|
106
|
+
(0, class_validator_1.IsUrl)(HTTPS_ONLY),
|
|
107
|
+
(0, class_validator_1.MaxLength)(500),
|
|
108
|
+
__metadata("design:type", Object)
|
|
109
|
+
], UpsertOrganizationNotificationBrandingDto.prototype, "logoUrl", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
(0, swagger_1.ApiPropertyOptional)({ nullable: true, example: '#FC1B23' }),
|
|
112
|
+
(0, class_transformer_1.Transform)(emptyToNull),
|
|
113
|
+
(0, class_validator_1.ValidateIf)(whenPresent),
|
|
114
|
+
(0, class_validator_1.Matches)(notification_sender_const_1.BRAND_COLOUR_PATTERN, { message: `primaryColour ${COLOUR_MESSAGE}` }),
|
|
115
|
+
__metadata("design:type", Object)
|
|
116
|
+
], UpsertOrganizationNotificationBrandingDto.prototype, "primaryColour", void 0);
|
|
117
|
+
__decorate([
|
|
118
|
+
(0, swagger_1.ApiPropertyOptional)({ nullable: true, description: 'Derived from the primary colour when omitted.' }),
|
|
119
|
+
(0, class_transformer_1.Transform)(emptyToNull),
|
|
120
|
+
(0, class_validator_1.ValidateIf)(whenPresent),
|
|
121
|
+
(0, class_validator_1.Matches)(notification_sender_const_1.BRAND_COLOUR_PATTERN, { message: `primaryColourDark ${COLOUR_MESSAGE}` }),
|
|
122
|
+
__metadata("design:type", Object)
|
|
123
|
+
], UpsertOrganizationNotificationBrandingDto.prototype, "primaryColourDark", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
(0, swagger_1.ApiPropertyOptional)({ nullable: true, example: '#101010' }),
|
|
126
|
+
(0, class_transformer_1.Transform)(emptyToNull),
|
|
127
|
+
(0, class_validator_1.ValidateIf)(whenPresent),
|
|
128
|
+
(0, class_validator_1.Matches)(notification_sender_const_1.BRAND_COLOUR_PATTERN, { message: `accentColour ${COLOUR_MESSAGE}` }),
|
|
129
|
+
__metadata("design:type", Object)
|
|
130
|
+
], UpsertOrganizationNotificationBrandingDto.prototype, "accentColour", void 0);
|
|
131
|
+
__decorate([
|
|
132
|
+
(0, swagger_1.ApiPropertyOptional)({ nullable: true }),
|
|
133
|
+
(0, class_transformer_1.Transform)(emptyToNull),
|
|
134
|
+
(0, class_validator_1.ValidateIf)(whenPresent),
|
|
135
|
+
(0, class_validator_1.IsString)(),
|
|
136
|
+
(0, class_validator_1.MaxLength)(255),
|
|
137
|
+
__metadata("design:type", Object)
|
|
138
|
+
], UpsertOrganizationNotificationBrandingDto.prototype, "physicalAddress", void 0);
|
|
139
|
+
__decorate([
|
|
140
|
+
(0, swagger_1.ApiPropertyOptional)({ nullable: true, example: '+254 709 555 000' }),
|
|
141
|
+
(0, class_transformer_1.Transform)(emptyToNull),
|
|
142
|
+
(0, class_validator_1.ValidateIf)(whenPresent),
|
|
143
|
+
(0, class_validator_1.IsString)(),
|
|
144
|
+
(0, class_validator_1.Matches)(/^[+0-9 ()-]{5,30}$/, { message: 'phoneNumber may contain digits, spaces, +, ( ) and - only' }),
|
|
145
|
+
__metadata("design:type", Object)
|
|
146
|
+
], UpsertOrganizationNotificationBrandingDto.prototype, "phoneNumber", void 0);
|
|
147
|
+
__decorate([
|
|
148
|
+
(0, swagger_1.ApiPropertyOptional)({ nullable: true }),
|
|
149
|
+
(0, class_transformer_1.Transform)(emptyToNull),
|
|
150
|
+
(0, class_validator_1.ValidateIf)(whenPresent),
|
|
151
|
+
(0, class_validator_1.IsEmail)(),
|
|
152
|
+
(0, class_validator_1.MaxLength)(254),
|
|
153
|
+
__metadata("design:type", Object)
|
|
154
|
+
], UpsertOrganizationNotificationBrandingDto.prototype, "contactEmail", void 0);
|
|
155
|
+
__decorate([
|
|
156
|
+
(0, swagger_1.ApiPropertyOptional)({ nullable: true }),
|
|
157
|
+
(0, class_transformer_1.Transform)(emptyToNull),
|
|
158
|
+
(0, class_validator_1.ValidateIf)(whenPresent),
|
|
159
|
+
(0, class_validator_1.IsEmail)(),
|
|
160
|
+
(0, class_validator_1.MaxLength)(254),
|
|
161
|
+
__metadata("design:type", Object)
|
|
162
|
+
], UpsertOrganizationNotificationBrandingDto.prototype, "supportEmail", void 0);
|
|
163
|
+
__decorate([
|
|
164
|
+
(0, swagger_1.ApiPropertyOptional)({ nullable: true }),
|
|
165
|
+
(0, class_transformer_1.Transform)(emptyToNull),
|
|
166
|
+
(0, class_validator_1.ValidateIf)(whenPresent),
|
|
167
|
+
(0, class_validator_1.IsUrl)(HTTPS_ONLY),
|
|
168
|
+
(0, class_validator_1.MaxLength)(255),
|
|
169
|
+
__metadata("design:type", Object)
|
|
170
|
+
], UpsertOrganizationNotificationBrandingDto.prototype, "websiteUrl", void 0);
|
|
171
|
+
__decorate([
|
|
172
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
173
|
+
nullable: true,
|
|
174
|
+
description: 'Where links in a notification point. Plain http is accepted so a local client can be targeted.',
|
|
175
|
+
}),
|
|
176
|
+
(0, class_transformer_1.Transform)(emptyToNull),
|
|
177
|
+
(0, class_validator_1.ValidateIf)(whenPresent),
|
|
178
|
+
(0, class_validator_1.IsUrl)({ protocols: ['http', 'https'], require_protocol: true, require_tld: false }),
|
|
179
|
+
(0, class_validator_1.MaxLength)(255),
|
|
180
|
+
__metadata("design:type", Object)
|
|
181
|
+
], UpsertOrganizationNotificationBrandingDto.prototype, "clientBaseUrl", void 0);
|
|
182
|
+
__decorate([
|
|
183
|
+
(0, swagger_1.ApiPropertyOptional)({ type: NotificationSocialLinksDto, nullable: true }),
|
|
184
|
+
(0, class_validator_1.ValidateIf)(whenPresent),
|
|
185
|
+
(0, class_validator_1.ValidateNested)(),
|
|
186
|
+
(0, class_transformer_1.Type)(() => NotificationSocialLinksDto),
|
|
187
|
+
__metadata("design:type", Object)
|
|
188
|
+
], UpsertOrganizationNotificationBrandingDto.prototype, "social", void 0);
|
|
189
|
+
class CreateOrganizationEmailSenderDto {
|
|
190
|
+
}
|
|
191
|
+
exports.CreateOrganizationEmailSenderDto = CreateOrganizationEmailSenderDto;
|
|
192
|
+
__decorate([
|
|
193
|
+
(0, swagger_1.ApiProperty)({ example: 'notifications@ke.g4s.com', description: 'The address mail is sent from.' }),
|
|
194
|
+
(0, class_transformer_1.Transform)(({ value }) => (typeof value === 'string' ? value.trim().toLowerCase() : value)),
|
|
195
|
+
(0, class_validator_1.IsEmail)(),
|
|
196
|
+
(0, class_validator_1.MaxLength)(254),
|
|
197
|
+
__metadata("design:type", String)
|
|
198
|
+
], CreateOrganizationEmailSenderDto.prototype, "fromEmail", void 0);
|
|
199
|
+
__decorate([
|
|
200
|
+
(0, swagger_1.ApiPropertyOptional)({ nullable: true, example: 'G4S Kenya', description: 'Falls back to the company name.' }),
|
|
201
|
+
(0, class_transformer_1.Transform)(emptyToNull),
|
|
202
|
+
(0, class_validator_1.ValidateIf)(whenPresent),
|
|
203
|
+
(0, class_validator_1.IsString)(),
|
|
204
|
+
(0, class_validator_1.MaxLength)(100)
|
|
205
|
+
// A display name is interpolated into the From header; a line break there is header injection.
|
|
206
|
+
,
|
|
207
|
+
(0, class_validator_1.Matches)(/^[^\r\n<>"]*$/, { message: 'fromName may not contain line breaks, quotes or angle brackets' }),
|
|
208
|
+
__metadata("design:type", Object)
|
|
209
|
+
], CreateOrganizationEmailSenderDto.prototype, "fromName", void 0);
|
|
210
|
+
__decorate([
|
|
211
|
+
(0, swagger_1.ApiPropertyOptional)({ nullable: true, description: 'Falls back to fromEmail.' }),
|
|
212
|
+
(0, class_transformer_1.Transform)(emptyToNull),
|
|
213
|
+
(0, class_validator_1.ValidateIf)(whenPresent),
|
|
214
|
+
(0, class_validator_1.IsEmail)(),
|
|
215
|
+
(0, class_validator_1.MaxLength)(254),
|
|
216
|
+
__metadata("design:type", Object)
|
|
217
|
+
], CreateOrganizationEmailSenderDto.prototype, "replyTo", void 0);
|
|
218
|
+
__decorate([
|
|
219
|
+
(0, swagger_1.ApiPropertyOptional)({ description: 'Make this the sender used by default. The first sender always is.' }),
|
|
220
|
+
(0, class_validator_1.IsBoolean)(),
|
|
221
|
+
(0, class_validator_1.IsOptional)(),
|
|
222
|
+
__metadata("design:type", Boolean)
|
|
223
|
+
], CreateOrganizationEmailSenderDto.prototype, "isDefault", void 0);
|
|
224
|
+
class UpdateOrganizationEmailSenderDto {
|
|
225
|
+
}
|
|
226
|
+
exports.UpdateOrganizationEmailSenderDto = UpdateOrganizationEmailSenderDto;
|
|
227
|
+
__decorate([
|
|
228
|
+
(0, swagger_1.ApiPropertyOptional)({ nullable: true }),
|
|
229
|
+
(0, class_transformer_1.Transform)(emptyToNull),
|
|
230
|
+
(0, class_validator_1.ValidateIf)(whenPresent),
|
|
231
|
+
(0, class_validator_1.IsString)(),
|
|
232
|
+
(0, class_validator_1.MaxLength)(100),
|
|
233
|
+
(0, class_validator_1.Matches)(/^[^\r\n<>"]*$/, { message: 'fromName may not contain line breaks, quotes or angle brackets' }),
|
|
234
|
+
__metadata("design:type", Object)
|
|
235
|
+
], UpdateOrganizationEmailSenderDto.prototype, "fromName", void 0);
|
|
236
|
+
__decorate([
|
|
237
|
+
(0, swagger_1.ApiPropertyOptional)({ nullable: true }),
|
|
238
|
+
(0, class_transformer_1.Transform)(emptyToNull),
|
|
239
|
+
(0, class_validator_1.ValidateIf)(whenPresent),
|
|
240
|
+
(0, class_validator_1.IsEmail)(),
|
|
241
|
+
(0, class_validator_1.MaxLength)(254),
|
|
242
|
+
__metadata("design:type", Object)
|
|
243
|
+
], UpdateOrganizationEmailSenderDto.prototype, "replyTo", void 0);
|
|
244
|
+
__decorate([
|
|
245
|
+
(0, swagger_1.ApiPropertyOptional)(),
|
|
246
|
+
(0, class_validator_1.IsBoolean)(),
|
|
247
|
+
(0, class_validator_1.IsOptional)(),
|
|
248
|
+
__metadata("design:type", Boolean)
|
|
249
|
+
], UpdateOrganizationEmailSenderDto.prototype, "isDefault", void 0);
|
|
250
|
+
__decorate([
|
|
251
|
+
(0, swagger_1.ApiPropertyOptional)(),
|
|
252
|
+
(0, class_validator_1.IsBoolean)(),
|
|
253
|
+
(0, class_validator_1.IsOptional)(),
|
|
254
|
+
__metadata("design:type", Boolean)
|
|
255
|
+
], UpdateOrganizationEmailSenderDto.prototype, "active", void 0);
|
|
256
|
+
class CreateOrganizationSmsSenderDto {
|
|
257
|
+
}
|
|
258
|
+
exports.CreateOrganizationSmsSenderDto = CreateOrganizationSmsSenderDto;
|
|
259
|
+
__decorate([
|
|
260
|
+
(0, swagger_1.ApiProperty)({ enum: sms_provider_name_enum_1.SmsProviderName, description: 'The provider account the sender is registered with.' }),
|
|
261
|
+
(0, class_validator_1.IsEnum)(sms_provider_name_enum_1.SmsProviderName),
|
|
262
|
+
__metadata("design:type", String)
|
|
263
|
+
], CreateOrganizationSmsSenderDto.prototype, "provider", void 0);
|
|
264
|
+
__decorate([
|
|
265
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
266
|
+
enum: country_code_enum_1.CountryCode,
|
|
267
|
+
nullable: true,
|
|
268
|
+
description: 'Destination country the sender is registered for. Omit for every country the provider serves.',
|
|
269
|
+
}),
|
|
270
|
+
(0, class_transformer_1.Transform)(emptyToNull),
|
|
271
|
+
(0, class_validator_1.ValidateIf)(whenPresent),
|
|
272
|
+
(0, class_validator_1.IsEnum)(country_code_enum_1.CountryCode),
|
|
273
|
+
__metadata("design:type", Object)
|
|
274
|
+
], CreateOrganizationSmsSenderDto.prototype, "countryCode", void 0);
|
|
275
|
+
__decorate([
|
|
276
|
+
(0, swagger_1.ApiProperty)({ enum: sms_sender_type_enum_1.SmsSenderType }),
|
|
277
|
+
(0, class_validator_1.IsEnum)(sms_sender_type_enum_1.SmsSenderType),
|
|
278
|
+
__metadata("design:type", String)
|
|
279
|
+
], CreateOrganizationSmsSenderDto.prototype, "senderType", void 0);
|
|
280
|
+
__decorate([
|
|
281
|
+
(0, swagger_1.ApiProperty)({ example: 'G4S', description: 'Validated against senderType by the service.' }),
|
|
282
|
+
(0, class_transformer_1.Transform)(({ value }) => (typeof value === 'string' ? value.trim() : value)),
|
|
283
|
+
(0, class_validator_1.IsString)(),
|
|
284
|
+
(0, class_validator_1.MaxLength)(40),
|
|
285
|
+
__metadata("design:type", String)
|
|
286
|
+
], CreateOrganizationSmsSenderDto.prototype, "senderId", void 0);
|
|
287
|
+
__decorate([
|
|
288
|
+
(0, swagger_1.ApiPropertyOptional)({ nullable: true, description: 'Registration reference or anything the operator needs later.' }),
|
|
289
|
+
(0, class_transformer_1.Transform)(emptyToNull),
|
|
290
|
+
(0, class_validator_1.ValidateIf)(whenPresent),
|
|
291
|
+
(0, class_validator_1.IsString)(),
|
|
292
|
+
(0, class_validator_1.MaxLength)(500),
|
|
293
|
+
__metadata("design:type", Object)
|
|
294
|
+
], CreateOrganizationSmsSenderDto.prototype, "notes", void 0);
|
|
295
|
+
class UpdateOrganizationSmsSenderDto {
|
|
296
|
+
}
|
|
297
|
+
exports.UpdateOrganizationSmsSenderDto = UpdateOrganizationSmsSenderDto;
|
|
298
|
+
__decorate([
|
|
299
|
+
(0, swagger_1.ApiPropertyOptional)({ enum: country_code_enum_1.CountryCode, nullable: true }),
|
|
300
|
+
(0, class_transformer_1.Transform)(emptyToNull),
|
|
301
|
+
(0, class_validator_1.ValidateIf)(whenPresent),
|
|
302
|
+
(0, class_validator_1.IsEnum)(country_code_enum_1.CountryCode),
|
|
303
|
+
__metadata("design:type", Object)
|
|
304
|
+
], UpdateOrganizationSmsSenderDto.prototype, "countryCode", void 0);
|
|
305
|
+
__decorate([
|
|
306
|
+
(0, swagger_1.ApiPropertyOptional)({ enum: sms_sender_type_enum_1.SmsSenderType }),
|
|
307
|
+
(0, class_validator_1.IsEnum)(sms_sender_type_enum_1.SmsSenderType),
|
|
308
|
+
(0, class_validator_1.IsOptional)(),
|
|
309
|
+
__metadata("design:type", String)
|
|
310
|
+
], UpdateOrganizationSmsSenderDto.prototype, "senderType", void 0);
|
|
311
|
+
__decorate([
|
|
312
|
+
(0, swagger_1.ApiPropertyOptional)({ description: 'Changing the value sends the sender back to PENDING.' }),
|
|
313
|
+
(0, class_transformer_1.Transform)(({ value }) => (typeof value === 'string' ? value.trim() : value)),
|
|
314
|
+
(0, class_validator_1.IsString)(),
|
|
315
|
+
(0, class_validator_1.MaxLength)(40),
|
|
316
|
+
(0, class_validator_1.IsOptional)(),
|
|
317
|
+
__metadata("design:type", String)
|
|
318
|
+
], UpdateOrganizationSmsSenderDto.prototype, "senderId", void 0);
|
|
319
|
+
__decorate([
|
|
320
|
+
(0, swagger_1.ApiPropertyOptional)({ nullable: true }),
|
|
321
|
+
(0, class_transformer_1.Transform)(emptyToNull),
|
|
322
|
+
(0, class_validator_1.ValidateIf)(whenPresent),
|
|
323
|
+
(0, class_validator_1.IsString)(),
|
|
324
|
+
(0, class_validator_1.MaxLength)(500),
|
|
325
|
+
__metadata("design:type", Object)
|
|
326
|
+
], UpdateOrganizationSmsSenderDto.prototype, "notes", void 0);
|
|
327
|
+
/** Platform operators only: records the outcome of registering the sender with the provider. */
|
|
328
|
+
class ReviewOrganizationSmsSenderDto {
|
|
329
|
+
}
|
|
330
|
+
exports.ReviewOrganizationSmsSenderDto = ReviewOrganizationSmsSenderDto;
|
|
331
|
+
__decorate([
|
|
332
|
+
(0, swagger_1.ApiProperty)({ enum: notification_sender_status_enum_1.NotificationSenderStatus }),
|
|
333
|
+
(0, class_validator_1.IsEnum)(notification_sender_status_enum_1.NotificationSenderStatus),
|
|
334
|
+
__metadata("design:type", String)
|
|
335
|
+
], ReviewOrganizationSmsSenderDto.prototype, "status", void 0);
|
|
336
|
+
__decorate([
|
|
337
|
+
(0, swagger_1.ApiPropertyOptional)({ nullable: true }),
|
|
338
|
+
(0, class_transformer_1.Transform)(emptyToNull),
|
|
339
|
+
(0, class_validator_1.ValidateIf)(whenPresent),
|
|
340
|
+
(0, class_validator_1.IsString)(),
|
|
341
|
+
(0, class_validator_1.MaxLength)(500),
|
|
342
|
+
__metadata("design:type", Object)
|
|
343
|
+
], ReviewOrganizationSmsSenderDto.prototype, "notes", void 0);
|
|
344
|
+
class SendTestNotificationEmailDto {
|
|
345
|
+
}
|
|
346
|
+
exports.SendTestNotificationEmailDto = SendTestNotificationEmailDto;
|
|
347
|
+
__decorate([
|
|
348
|
+
(0, swagger_1.ApiProperty)({ description: 'Where the branded test email goes.' }),
|
|
349
|
+
(0, class_transformer_1.Transform)(({ value }) => (typeof value === 'string' ? value.trim().toLowerCase() : value)),
|
|
350
|
+
(0, class_validator_1.IsEmail)(),
|
|
351
|
+
(0, class_validator_1.MaxLength)(254),
|
|
352
|
+
__metadata("design:type", String)
|
|
353
|
+
], SendTestNotificationEmailDto.prototype, "to", void 0);
|
|
354
|
+
//# 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,6CAAmE;AACnE,yDAAoD;AACpD,qDAWyB;AACzB,6EAAoE;AACpE,oFAA0E;AAC1E,sFAA8E;AAC9E,8FAAoF;AACpF,4EAAkE;AAClE,wEAA8D;AAE9D;;;;;GAKG;AACH,MAAM,WAAW,GAAG,CAAC,EAAE,KAAK,EAAsB,EAAE,EAAE,CAClD,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;AAE/G,uGAAuG;AACvG,MAAM,WAAW,GAAG,CAAC,CAAU,EAAE,KAAc,EAAE,EAAE,CAAC,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC;AAE1F,MAAM,UAAU,GAAG,EAAE,SAAS,EAAE,CAAC,OAAO,CAAC,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC;AACpE,MAAM,cAAc,GAAG,4CAA4C,CAAC;AAEpE,MAAa,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AAC,EAAE,IAAI,EAAE,0DAAwB,EAAE,CAAC;IAC/C,IAAA,wBAAM,EAAC,0DAAwB,CAAC;;8DACC;AAIlC;IAFC,IAAA,6BAAmB,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACvC,IAAA,6BAAS,EAAC,WAAW,CAAC;IAAE,IAAA,4BAAU,EAAC,WAAW,CAAC;IAAE,IAAA,0BAAQ,GAAE;IAAE,IAAA,2BAAS,EAAC,GAAG,CAAC;;6DACtD;AAG1B,MAAa,4BAA4B;CAKxC;AALD,oEAKC;AADG;IAHC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,oCAAoC,EAAE,CAAC;IAClE,IAAA,6BAAS,EAAC,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,IAAA,yBAAO,GAAE;IAAE,IAAA,2BAAS,EAAC,GAAG,CAAC;;wDACd"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EmailSenderVerificationMethod = exports.EmailSenderVerificationStatus = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Whether an email provider will accept mail FROM an organization's address.
|
|
6
|
+
*
|
|
7
|
+
* Tracked per provider because the answer differs per provider: an address can be
|
|
8
|
+
* a verified sender in Twilio SendGrid while its domain is unknown to Mailgun.
|
|
9
|
+
* A provider only ever sends from an address it has VERIFIED; for every other
|
|
10
|
+
* state that provider falls back to the platform sender (keeping the
|
|
11
|
+
* organization's display name and reply-to), so a half-configured organization
|
|
12
|
+
* never loses mail to an "unverified sender" rejection.
|
|
13
|
+
*/
|
|
14
|
+
var EmailSenderVerificationStatus;
|
|
15
|
+
(function (EmailSenderVerificationStatus) {
|
|
16
|
+
/** The provider does not know this address or its domain. */
|
|
17
|
+
EmailSenderVerificationStatus["UNVERIFIED"] = "UNVERIFIED";
|
|
18
|
+
/** Verification was started and is waiting on the owner (inbox click or DNS records). */
|
|
19
|
+
EmailSenderVerificationStatus["PENDING"] = "PENDING";
|
|
20
|
+
/** The provider accepts mail from this address. */
|
|
21
|
+
EmailSenderVerificationStatus["VERIFIED"] = "VERIFIED";
|
|
22
|
+
/** The last check could not be completed (provider error); the previous answer no longer holds. */
|
|
23
|
+
EmailSenderVerificationStatus["FAILED"] = "FAILED";
|
|
24
|
+
})(EmailSenderVerificationStatus || (exports.EmailSenderVerificationStatus = EmailSenderVerificationStatus = {}));
|
|
25
|
+
/** How the provider recognises the address. */
|
|
26
|
+
var EmailSenderVerificationMethod;
|
|
27
|
+
(function (EmailSenderVerificationMethod) {
|
|
28
|
+
/** The exact address was verified on its own (SendGrid Single Sender Verification). */
|
|
29
|
+
EmailSenderVerificationMethod["SINGLE_SENDER"] = "SINGLE_SENDER";
|
|
30
|
+
/** The whole domain is authenticated (SendGrid domain authentication, Mailgun domain). */
|
|
31
|
+
EmailSenderVerificationMethod["DOMAIN"] = "DOMAIN";
|
|
32
|
+
})(EmailSenderVerificationMethod || (exports.EmailSenderVerificationMethod = EmailSenderVerificationMethod = {}));
|
|
33
|
+
//# 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,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,6CAA7B,6BAA6B,QASxC;AAED,+CAA+C;AAC/C,IAAY,6BAKX;AALD,WAAY,6BAA6B;IACrC,uFAAuF;IACvF,gEAA+B,CAAA;IAC/B,0FAA0F;IAC1F,kDAAiB,CAAA;AACrB,CAAC,EALW,6BAA6B,6CAA7B,6BAA6B,QAKxC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotificationBrandingSource = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Where one resolved branding value came from. Branding is resolved field by
|
|
6
|
+
* field, highest precedence first, so a half-filled profile still produces a
|
|
7
|
+
* complete email:
|
|
8
|
+
*
|
|
9
|
+
* PROFILE the organization's notification settings
|
|
10
|
+
* ORGANIZATION the organization record (clarion-organization)
|
|
11
|
+
* APP_DEFAULT the legacy per-app defaults (deprecated; kept so nothing
|
|
12
|
+
* changes for an organization that has configured nothing)
|
|
13
|
+
* PLATFORM_DEFAULT the platform's own branding
|
|
14
|
+
*/
|
|
15
|
+
var NotificationBrandingSource;
|
|
16
|
+
(function (NotificationBrandingSource) {
|
|
17
|
+
NotificationBrandingSource["PROFILE"] = "PROFILE";
|
|
18
|
+
NotificationBrandingSource["ORGANIZATION"] = "ORGANIZATION";
|
|
19
|
+
NotificationBrandingSource["APP_DEFAULT"] = "APP_DEFAULT";
|
|
20
|
+
NotificationBrandingSource["PLATFORM_DEFAULT"] = "PLATFORM_DEFAULT";
|
|
21
|
+
})(NotificationBrandingSource || (exports.NotificationBrandingSource = NotificationBrandingSource = {}));
|
|
22
|
+
//# 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,IAAY,0BAKX;AALD,WAAY,0BAA0B;IAClC,iDAAmB,CAAA;IACnB,2DAA6B,CAAA;IAC7B,yDAA2B,CAAA;IAC3B,mEAAqC,CAAA;AACzC,CAAC,EALW,0BAA0B,0CAA1B,0BAA0B,QAKrC"}
|