@opencrvs/toolkit 2.1.0-rc.d876831 → 2.1.0-rc.d987aec

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 (81) hide show
  1. package/README.md +2 -12
  2. package/build.sh +9 -1
  3. package/create-countryconfig/index.js +412 -59
  4. package/create-countryconfig/node_modules/.bin/degit +21 -0
  5. package/create-countryconfig/package.json +4 -1
  6. package/dist/application-config/index.js +248 -215
  7. package/dist/authentication/index.d.ts +67 -0
  8. package/dist/authentication/index.d.ts.map +1 -0
  9. package/dist/authentication/index.js +750 -0
  10. package/dist/cli.js +1650 -100
  11. package/dist/commons/api/router.d.ts +407 -50
  12. package/dist/commons/conditionals/conditionals.d.ts +6 -6
  13. package/dist/commons/conditionals/validate.d.ts +7 -3
  14. package/dist/commons/events/ActionDocument.d.ts +4 -4
  15. package/dist/commons/events/ActionInput.d.ts +4 -4
  16. package/dist/commons/events/AdvancedSearchConfig.d.ts +12 -0
  17. package/dist/commons/events/EventDocument.d.ts +470 -2
  18. package/dist/commons/events/EventMetadata.d.ts +1 -11
  19. package/dist/commons/events/EventStatus.d.ts +19 -0
  20. package/dist/commons/events/FieldConfig.d.ts +24 -5
  21. package/dist/commons/events/FieldTypeMapping.d.ts +15 -15
  22. package/dist/commons/events/locations.d.ts +63 -10
  23. package/dist/commons/events/test.utils.d.ts +25 -4
  24. package/dist/commons/events/utils.d.ts +13 -2
  25. package/dist/commons/notification/UserNotifications.d.ts +28 -13
  26. package/dist/commons/notification/dispatch.d.ts +10 -0
  27. package/dist/commons/notification/index.d.ts +1 -0
  28. package/dist/conditionals/index.js +79 -57
  29. package/dist/csv.d.ts +25 -0
  30. package/dist/csv.d.ts.map +1 -0
  31. package/dist/csv.js +120 -0
  32. package/dist/environment/logger.d.ts +3 -0
  33. package/dist/environment/logger.d.ts.map +1 -1
  34. package/dist/environment/manage-users.js +1 -1
  35. package/dist/environment/questions.d.ts.map +1 -1
  36. package/dist/environment/questions.js +20 -14
  37. package/dist/environment/setup-environment.js +26 -6
  38. package/dist/environment/templates.d.ts +0 -1
  39. package/dist/environment/templates.d.ts.map +1 -1
  40. package/dist/environment/templates.js +3 -8
  41. package/dist/events/index.js +2632 -2481
  42. package/dist/migrations/v2.0/checkout-upstream-files.d.ts +2 -2
  43. package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
  44. package/dist/migrations/v2.0/checkout-upstream-files.js +2 -2
  45. package/dist/migrations/v2.1/add-recovery-link-notifications.d.ts +3 -0
  46. package/dist/migrations/v2.1/add-recovery-link-notifications.d.ts.map +1 -0
  47. package/dist/migrations/v2.1/add-recovery-link-notifications.js +511 -0
  48. package/dist/migrations/v2.1/add-translations.d.ts +9 -0
  49. package/dist/migrations/v2.1/add-translations.d.ts.map +1 -0
  50. package/dist/migrations/v2.1/add-translations.js +213 -0
  51. package/dist/migrations/v2.1/enable-telemetry.d.ts +3 -0
  52. package/dist/migrations/v2.1/enable-telemetry.d.ts.map +1 -0
  53. package/dist/migrations/v2.1/enable-telemetry.js +438 -0
  54. package/dist/migrations/v2.1/index.d.ts.map +1 -1
  55. package/dist/migrations/v2.1/index.js +1058 -0
  56. package/dist/notification/index.js +1027 -1452
  57. package/dist/scopes/index.d.ts +77 -7
  58. package/dist/scopes/index.js +79 -57
  59. package/dist/telemetry/index.d.ts +45 -0
  60. package/dist/telemetry/index.d.ts.map +1 -0
  61. package/dist/telemetry/index.js +39 -0
  62. package/dist/templates/charts-values/dependencies/values.yaml +2 -0
  63. package/dist/templates/charts-values/opencrvs-services/values.yaml +1 -1
  64. package/dist/templates/charts-values/opentelemetry/values.yaml +22 -0
  65. package/dist/templates/charts-values/traefik/values.yaml +23 -9
  66. package/dist/templates/inventory/inventory.template.yml +1 -3
  67. package/dist/translations/check.d.ts +21 -0
  68. package/dist/translations/check.d.ts.map +1 -0
  69. package/dist/translations/check.js +132 -0
  70. package/dist/verify/endpoints.d.ts +2 -0
  71. package/dist/verify/endpoints.d.ts.map +1 -0
  72. package/dist/verify/endpoints.js +345 -0
  73. package/opencrvs-toolkit-2.1.0-rc.d987aec.tgz +0 -0
  74. package/package.json +9 -4
  75. package/tsconfig.build.json +11 -0
  76. package/tsconfig.build.tsbuildinfo +1 -0
  77. package/tsconfig.json +3 -0
  78. package/dist/templates/inventory/production.example.yml +0 -77
  79. package/dist/templates/inventory/qa.example.yml +0 -48
  80. package/opencrvs-toolkit-2.1.0-rc.d876831.tgz +0 -0
  81. package/tsconfig.tsbuildinfo +0 -1
@@ -29,15 +29,11 @@ export declare function mapFieldTypeToZod(field: FieldConfig, actionType?: Actio
29
29
  }> | z.ZodNumber | z.ZodObject<Readonly<{
30
30
  [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
31
31
  }>, z.core.$strip> | z.ZodObject<{
32
- age: z.ZodNumber;
33
- asOfDateRef: z.ZodString;
34
- }, z.core.$strip> | z.ZodObject<{
35
- label: z.ZodString;
36
- value: z.ZodString;
37
- }, z.core.$strip> | z.ZodObject<{
38
32
  path: z.core.$ZodBranded<z.ZodString, "DocumentPath", "out">;
39
33
  originalFilename: z.ZodString;
40
34
  type: z.ZodString;
35
+ }, z.core.$strip> | z.ZodObject<{
36
+ data: z.ZodRecord<z.ZodString, z.ZodString>;
41
37
  }, z.core.$strip> | z.ZodObject<{
42
38
  data: z.ZodAny;
43
39
  }, z.core.$strip> | z.ZodObject<{
@@ -47,7 +43,11 @@ export declare function mapFieldTypeToZod(field: FieldConfig, actionType?: Actio
47
43
  numericValue: z.ZodOptional<z.ZodNumber>;
48
44
  unit: z.ZodOptional<z.ZodString>;
49
45
  }, z.core.$strip> | z.ZodObject<{
50
- data: z.ZodRecord<z.ZodString, z.ZodString>;
46
+ age: z.ZodNumber;
47
+ asOfDateRef: z.ZodString;
48
+ }, z.core.$strip> | z.ZodObject<{
49
+ label: z.ZodString;
50
+ value: z.ZodString;
51
51
  }, z.core.$strip> | z.ZodObject<{
52
52
  firstname: z.ZodString;
53
53
  surname: z.ZodString;
@@ -65,15 +65,11 @@ export declare function mapFieldTypeToZod(field: FieldConfig, actionType?: Actio
65
65
  }>>> | z.ZodOptional<z.ZodNullable<z.ZodNumber>> | z.ZodOptional<z.ZodNullable<z.ZodObject<Readonly<{
66
66
  [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
67
67
  }>, z.core.$strip>>> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
68
- age: z.ZodNumber;
69
- asOfDateRef: z.ZodString;
70
- }, z.core.$strip>>> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
71
- label: z.ZodString;
72
- value: z.ZodString;
73
- }, z.core.$strip>>> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
74
68
  path: z.core.$ZodBranded<z.ZodString, "DocumentPath", "out">;
75
69
  originalFilename: z.ZodString;
76
70
  type: z.ZodString;
71
+ }, z.core.$strip>>> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
72
+ data: z.ZodRecord<z.ZodString, z.ZodString>;
77
73
  }, z.core.$strip>>> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
78
74
  data: z.ZodAny;
79
75
  }, z.core.$strip>>> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -82,6 +78,12 @@ export declare function mapFieldTypeToZod(field: FieldConfig, actionType?: Actio
82
78
  }, z.core.$strip>>> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
83
79
  numericValue: z.ZodOptional<z.ZodNumber>;
84
80
  unit: z.ZodOptional<z.ZodString>;
81
+ }, z.core.$strip>>> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
82
+ age: z.ZodNumber;
83
+ asOfDateRef: z.ZodString;
84
+ }, z.core.$strip>>> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
85
+ label: z.ZodString;
86
+ value: z.ZodString;
85
87
  }, z.core.$strip>>> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
86
88
  data: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
87
89
  country: z.ZodString;
@@ -152,8 +154,6 @@ export declare function mapFieldTypeToZod(field: FieldConfig, actionType?: Actio
152
154
  label: z.ZodString;
153
155
  value: z.ZodString;
154
156
  }, z.core.$strip>>>]>>;
155
- }, z.core.$strip>>> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
156
- data: z.ZodRecord<z.ZodString, z.ZodString>;
157
157
  }, z.core.$strip>>> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
158
158
  firstname: z.ZodString;
159
159
  surname: z.ZodString;
@@ -17,10 +17,16 @@ export declare const LocationStatus: z.ZodEnum<{
17
17
  inactive: "inactive";
18
18
  }>;
19
19
  export type LocationStatus = z.infer<typeof LocationStatus>;
20
+ /** Thrown when a user's assigned office is inactive and must not be allowed to authenticate. */
21
+ export declare class InactiveOfficeError extends Error {
22
+ constructor(message?: string);
23
+ }
20
24
  /**
21
- * A single element of the append-only `versions` history of a location or
22
- * administrative area. Versions are sorted ascending by `effectiveFrom`
23
- * ('0001-01-01' is used as the beginning-of-time sentinel).
25
+ * A single element of the `versions` history of a location or administrative
26
+ * area. Versions are sorted ascending by `effectiveFrom` ('0001-01-01' is used
27
+ * as the beginning-of-time sentinel). Updates only ever append, but a
28
+ * not-yet-effective version can be withdrawn and seeding replaces a history
29
+ * wholesale, so the array is not append-only.
24
30
  */
25
31
  export declare const LocationVersion: z.ZodObject<{
26
32
  versionId: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
@@ -131,9 +137,25 @@ export type ClientLocation = z.infer<typeof ClientLocation>;
131
137
  export declare function toClientLocation(location: Location): ClientLocation;
132
138
  /** See {@link toClientLocation}. */
133
139
  export declare function toClientAdministrativeArea(area: AdministrativeArea): ClientAdministrativeArea;
140
+ export declare const SeededLocationVersions: z.ZodArray<z.ZodObject<{
141
+ versionId: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
142
+ effectiveFrom: z.ZodISODate;
143
+ name: z.ZodString;
144
+ externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
145
+ status: z.ZodEnum<{
146
+ active: "active";
147
+ inactive: "inactive";
148
+ }>;
149
+ }, z.core.$strip>>;
150
+ export type SeededLocationVersions = z.infer<typeof SeededLocationVersions>;
134
151
  /**
135
- * Input payload for the locations `set` mutation. Carries only the seedable
136
- * identity and hierarchy fields — version history is managed by the server.
152
+ * Input payload for the locations `set` mutation. Carries the seedable
153
+ * identity and hierarchy fields, plus an optional pre-built history.
154
+ *
155
+ * Last-write-wins on history: a repeated seed of the same row replaces its
156
+ * stored `versions`, so a caller that means to keep one has to send it every
157
+ * time. Seeding is only reachable while system initialisation is incomplete,
158
+ * so this replaces what an earlier seed attempt wrote, never a live history.
137
159
  */
138
160
  export declare const SetLocationPayload: z.ZodObject<{
139
161
  id: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
@@ -141,18 +163,38 @@ export declare const SetLocationPayload: z.ZodObject<{
141
163
  externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
142
164
  administrativeAreaId: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
143
165
  locationType: z.ZodNullable<z.ZodString>;
166
+ versions: z.ZodOptional<z.ZodArray<z.ZodObject<{
167
+ versionId: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
168
+ effectiveFrom: z.ZodISODate;
169
+ name: z.ZodString;
170
+ externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
171
+ status: z.ZodEnum<{
172
+ active: "active";
173
+ inactive: "inactive";
174
+ }>;
175
+ }, z.core.$strip>>>;
144
176
  }, z.core.$strip>;
145
177
  export type SetLocationPayload = z.infer<typeof SetLocationPayload>;
146
178
  /**
147
- * Input payload for the administrative areas `set` mutation. Carries only the
148
- * seedable identity and hierarchy fields — version history is managed by the
149
- * server.
179
+ * Input payload for the administrative areas `set` mutation. Twin of
180
+ * {@link SetLocationPayload}, including the optional pre-built `versions`
181
+ * history and the same semantics for omitting it.
150
182
  */
151
183
  export declare const SetAdministrativeAreaPayload: z.ZodObject<{
152
184
  id: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
153
185
  name: z.ZodString;
154
186
  externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
155
187
  parentId: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
188
+ versions: z.ZodOptional<z.ZodArray<z.ZodObject<{
189
+ versionId: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
190
+ effectiveFrom: z.ZodISODate;
191
+ name: z.ZodString;
192
+ externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
193
+ status: z.ZodEnum<{
194
+ active: "active";
195
+ inactive: "inactive";
196
+ }>;
197
+ }, z.core.$strip>>>;
156
198
  }, z.core.$strip>;
157
199
  export type SetAdministrativeAreaPayload = z.infer<typeof SetAdministrativeAreaPayload>;
158
200
  /**
@@ -167,6 +209,17 @@ export type SetAdministrativeAreaPayload = z.infer<typeof SetAdministrativeAreaP
167
209
  export declare function resolveVersion<T extends {
168
210
  effectiveFrom: string;
169
211
  }>(versions: T[], anchor: string): T;
212
+ /**
213
+ * Whether the entity is selectable at `anchor`: it must already have a
214
+ * version effective by then, and the version that resolves at `anchor` must
215
+ * be active. `resolveVersion` alone is not enough for this — when `anchor`
216
+ * precedes every version it falls back to the earliest one, which would
217
+ * otherwise make a location created after `anchor` look selectable.
218
+ */
219
+ export declare function isSelectableAtAnchor<T extends {
220
+ effectiveFrom: string;
221
+ status: string;
222
+ }>(versions: T[], anchor: string): boolean;
170
223
  /**
171
224
  * Whether the entity holds the given externalId with active status at the
172
225
  * anchor date or at any point after it. Used for point-in-time uniqueness of
@@ -198,7 +251,7 @@ export type EventIndexWithAdministrativeHierarchy = Omit<ToArrayFields<EventInde
198
251
  * Return false early to break out of checks as soon as possible - if any option is not satisfied, the scope does not allow access to the event, so no need to check further options.
199
252
  *
200
253
  */
201
- export declare function canAccessEventWithScope(event: Partial<EventIndexWithAdministrativeHierarchy>, scope: RecordScopeV2, user: UserContext | SystemContext, customActionType?: string): boolean;
254
+ export declare function canAccessEventWithScope(event: EventIndexWithAdministrativeHierarchy, scope: RecordScopeV2, user: UserContext | SystemContext, customActionType?: string): boolean;
202
255
  export type UserWithResolvedHierarchy = {
203
256
  role: string;
204
257
  administrativeHierarchy: UUID[];
@@ -219,7 +272,7 @@ export declare function canAccessOtherUserWithScopes({ scopes, userToAccess, use
219
272
  *
220
273
  * One of the scopes must allow access for the event to be accessible.
221
274
  */
222
- export declare function userCanAccessEventWithScopes(event: Partial<EventIndexWithAdministrativeHierarchy>, scopes: RecordScopeV2[], user: UserContext | SystemContext, customActionType?: string): boolean;
275
+ export declare function userCanAccessEventWithScopes(event: EventIndexWithAdministrativeHierarchy, scopes: RecordScopeV2[], user: UserContext | SystemContext, customActionType?: string): boolean;
223
276
  export declare function getAdministrativeAreaHierarchy<A extends {
224
277
  id: UUID;
225
278
  parentId: UUID | null;
@@ -1,5 +1,6 @@
1
1
  import { UUID } from '../uuid';
2
2
  import { ActionDocument, ActionUpdate } from './ActionDocument';
3
+ import { ValidatorContext } from '../conditionals/validate';
3
4
  import { ApproveCorrectionActionInput, ArchiveActionInput, AssignActionInput, DeclareActionInput, EditActionInput, MarkAsDuplicateActionInput, MarkNotDuplicateActionInput, NotifyActionInput, RegisterActionInput, RejectCorrectionActionInput, RejectDeclarationActionInput, RequestCorrectionActionInput, UnarchiveActionInput, UnassignActionInput } from './ActionInput';
4
5
  import { ActionType } from './ActionType';
5
6
  import { Draft } from './Draft';
@@ -9,7 +10,7 @@ import { EventIndex } from './EventIndex';
9
10
  import { EventInput } from './EventInput';
10
11
  import { TranslationConfig } from './TranslationConfig';
11
12
  import { FieldConfig } from './FieldConfig';
12
- import { SetLocationPayload, SetAdministrativeAreaPayload } from './locations';
13
+ import { LocationVersion, SetLocationPayload, SetAdministrativeAreaPayload, ClientAdministrativeArea } from './locations';
13
14
  import { WorkqueueConfig } from './WorkqueueConfig';
14
15
  import * as z from 'zod/v4';
15
16
  import { DocumentPath } from '../documents';
@@ -43,6 +44,13 @@ export declare function generateUuid(rng?: () => number): UUID;
43
44
  export declare function generateTrackingId(rng: () => number): string;
44
45
  export declare function generateRegistrationNumber(rng: () => number): string;
45
46
  export declare function generateRandomSignature(rng: () => number): DocumentPath;
47
+ /**
48
+ * Builds one element of a location / administrative area `versions` history.
49
+ * Every field is defaulted so a call names only what its assertion is about —
50
+ * an `effectiveFrom`, a `name`, or an explicit `versionId` when the test needs
51
+ * to control version identity.
52
+ */
53
+ export declare function locationVersion(overrides?: Partial<LocationVersion>, rng?: () => number): LocationVersion;
46
54
  export declare function fieldConfigsToActionPayload(fields: FieldConfig[], rng: () => number,
47
55
  /**
48
56
  * Given hierarchy, ensures that related fields (e.g. location and administrative area) have valid values based on the hierarchy.
@@ -124,9 +132,6 @@ export declare function eventPayloadGenerator(rng: () => number, configuration?:
124
132
  declaration: {};
125
133
  annotation: {};
126
134
  eventId: string;
127
- content: {
128
- reason: string;
129
- };
130
135
  };
131
136
  unarchive: (eventId: string, input?: Partial<Pick<UnarchiveActionInput, 'transactionId' | 'declaration' | 'keepAssignment'>>) => {
132
137
  keepAssignment?: boolean | undefined;
@@ -291,4 +296,20 @@ export declare const generateEventConfig: ({ id, fields, placeOfEventId, dateOfE
291
296
  placeOfEventId?: string;
292
297
  dateOfEventId?: string;
293
298
  }) => EventConfig;
299
+ /**
300
+ * Get the leaf administrative area IDs from a list of administrative areas.
301
+ *
302
+ * A leaf administrative area is defined as an administrative area that does not have any children in the provided list.
303
+ * AdministrativeArea might have a CRVS_OFFICE as children, but is still considered to be a leaf administrative area.
304
+ *
305
+ * @param administrativeAreas - The list of administrative areas to search.
306
+ * @returns The list of leaf administrative area IDs.
307
+ */
308
+ export declare function getLeafAdministrativeAreaIds(administrativeAreas: Map<UUID, ClientAdministrativeArea>): Array<{
309
+ id: UUID;
310
+ }>;
311
+ export declare function generateTestValidatorContext(userRole?: TestUserRole, eventWithConfig?: {
312
+ event: EventDocument;
313
+ eventConfig: EventConfig;
314
+ }): ValidatorContext;
294
315
  //# sourceMappingURL=test.utils.d.ts.map
@@ -10,6 +10,7 @@ import { UUID } from '../uuid';
10
10
  import { ActionConfig, ActionConfigTypes } from './ActionConfig';
11
11
  import { FormConfig } from './FormConfig';
12
12
  import { PlainDate, SelectDateRangeValue } from './FieldValue';
13
+ import { EventIndex } from './EventIndex';
13
14
  export declare function ageToDate(age: number, asOfDate: PlainDate): string & import("zod").$brand<"PlainDate">;
14
15
  export declare function getDeclarationFields(configuration: EventConfig): FieldConfig[];
15
16
  export declare function getDeclarationPages(configuration: EventConfig): {
@@ -255,9 +256,9 @@ export declare function findLastAssignmentAction(actions: Action[]): {
255
256
  status: "Accepted" | "Rejected" | "Requested";
256
257
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
257
258
  type: "ARCHIVE";
258
- content: {
259
+ content?: {
259
260
  reason: string;
260
- };
261
+ } | undefined;
261
262
  } | {
262
263
  id: string & import("zod").$brand<"UUID">;
263
264
  transactionId: string;
@@ -597,4 +598,14 @@ export declare function getCompleteActionDeclaration<T extends EventState | Acti
597
598
  export declare function getAcceptedActions(event: EventDocument): ActionDocument[];
598
599
  export declare function aggregateActionDeclarations(event: EventDocument): EventState;
599
600
  export declare function aggregateActionAnnotations(event: EventDocument): EventState;
601
+ /**
602
+ * 2.1. onwards secured fields have accepted conditionals.
603
+ * Secured fields are not present in EventIndex payload.
604
+ * When we derive @see EventIndex from @see EventDocument, we will have all the fields present.
605
+ *
606
+ * To keep the views consistent, and not to change if event.get gets triggered, we need to clean out the secured fields.
607
+ *
608
+ * @returns EventIndex without values that evaluate to secured: true.
609
+ */
610
+ export declare function dropSecuredDeclarationFields(eventConfig: EventConfig, eventIndex: EventIndex, validatorContext: ValidatorContext): EventIndex;
600
611
  //# sourceMappingURL=utils.d.ts.map
@@ -5,6 +5,8 @@ export declare const TriggerEvent: {
5
5
  readonly USERNAME_REMINDER: 'username-reminder';
6
6
  readonly RESET_PASSWORD: 'reset-password';
7
7
  readonly RESET_PASSWORD_BY_ADMIN: 'reset-password-by-admin';
8
+ readonly PASSWORD_RESET_LINK: 'password-reset-link';
9
+ readonly USERNAME_REMINDER_LINK: 'username-reminder-link';
8
10
  readonly RESEND_INVITE: 'resend-invite';
9
11
  readonly TWO_FA: '2fa';
10
12
  readonly ALL_USER_NOTIFICATION: 'all-user-notification';
@@ -113,6 +115,32 @@ export declare const TriggerPayload: {
113
115
  role: z.ZodString;
114
116
  }, z.core.$strip>;
115
117
  }, z.core.$strip>;
118
+ readonly "password-reset-link": z.ZodObject<{
119
+ recipient: z.ZodObject<{
120
+ name: z.ZodOptional<z.ZodObject<{
121
+ firstname: z.ZodString;
122
+ surname: z.ZodString;
123
+ middlename: z.ZodOptional<z.ZodString>;
124
+ }, z.core.$strip>>;
125
+ mobile: z.ZodOptional<z.ZodString>;
126
+ email: z.ZodOptional<z.ZodString>;
127
+ bcc: z.ZodOptional<z.ZodArray<z.ZodString>>;
128
+ }, z.core.$strip>;
129
+ token: z.ZodString;
130
+ }, z.core.$strip>;
131
+ readonly "username-reminder-link": z.ZodObject<{
132
+ recipient: z.ZodObject<{
133
+ name: z.ZodOptional<z.ZodObject<{
134
+ firstname: z.ZodString;
135
+ surname: z.ZodString;
136
+ middlename: z.ZodOptional<z.ZodString>;
137
+ }, z.core.$strip>>;
138
+ mobile: z.ZodOptional<z.ZodString>;
139
+ email: z.ZodOptional<z.ZodString>;
140
+ bcc: z.ZodOptional<z.ZodArray<z.ZodString>>;
141
+ }, z.core.$strip>;
142
+ token: z.ZodString;
143
+ }, z.core.$strip>;
116
144
  readonly "resend-invite": z.ZodObject<{
117
145
  recipient: z.ZodObject<{
118
146
  name: z.ZodOptional<z.ZodObject<{
@@ -184,18 +212,5 @@ export declare const TriggerPayload: {
184
212
  export type TriggerPayload = {
185
213
  [K in TriggerEvent]: z.infer<(typeof TriggerPayload)[K]>;
186
214
  };
187
- export declare function triggerUserEventNotification(args: {
188
- event: typeof TriggerEvent.ALL_USER_NOTIFICATION;
189
- payload: TriggerPayload[typeof TriggerEvent.ALL_USER_NOTIFICATION];
190
- countryConfigUrl: string;
191
- }): Promise<Response>;
192
- export declare function triggerUserEventNotification<T extends Exclude<TriggerEvent, typeof TriggerEvent.ALL_USER_NOTIFICATION>>(args: {
193
- event: T;
194
- payload: TriggerPayload[T];
195
- countryConfigUrl: string;
196
- authHeader: {
197
- Authorization: string;
198
- };
199
- }): Promise<Response>;
200
215
  export declare function parseUserEventTrigger<T extends TriggerEvent>(event: T, body: unknown): TriggerPayload[T];
201
216
  //# sourceMappingURL=UserNotifications.d.ts.map
@@ -0,0 +1,10 @@
1
+ import { TriggerEvent, TriggerPayload } from './UserNotifications';
2
+ export declare function triggerUserEventNotification<T extends TriggerEvent>({ event, payload, countryConfigUrl, authHeader }: {
3
+ event: T;
4
+ payload: TriggerPayload[T];
5
+ countryConfigUrl: string;
6
+ authHeader: {
7
+ Authorization: string;
8
+ };
9
+ }): Promise<Response>;
10
+ //# sourceMappingURL=dispatch.d.ts.map
@@ -1,2 +1,3 @@
1
1
  export * from './UserNotifications';
2
+ export * from './dispatch';
2
3
  //# sourceMappingURL=index.d.ts.map