@opencrvs/toolkit 1.8.1-rc.bbbfede → 1.8.1-rc.bbdfdc1

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 (39) hide show
  1. package/build.sh +5 -0
  2. package/dist/commons/api/router.d.ts +433 -800
  3. package/dist/commons/conditionals/validate.d.ts +8 -0
  4. package/dist/commons/events/ActionConfig.d.ts +2004 -366
  5. package/dist/commons/events/ActionDocument.d.ts +1302 -1389
  6. package/dist/commons/events/ActionInput.d.ts +658 -1136
  7. package/dist/commons/events/AdvancedSearchConfig.d.ts +83 -65
  8. package/dist/commons/events/CompositeFieldValue.d.ts +6 -6
  9. package/dist/commons/events/CountryConfigQueryInput.d.ts +88 -88
  10. package/dist/commons/events/Draft.d.ts +48 -92
  11. package/dist/commons/events/EventConfig.d.ts +695 -168
  12. package/dist/commons/events/EventDocument.d.ts +475 -846
  13. package/dist/commons/events/EventIndex.d.ts +184 -68
  14. package/dist/commons/events/EventMetadata.d.ts +9 -15
  15. package/dist/commons/events/FieldConfig.d.ts +254 -43
  16. package/dist/commons/events/FieldTypeMapping.d.ts +16 -16
  17. package/dist/commons/events/FieldValue.d.ts +12 -12
  18. package/dist/commons/events/FormConfig.d.ts +1032 -246
  19. package/dist/commons/events/PageConfig.d.ts +264 -46
  20. package/dist/commons/events/WorkqueueConfig.d.ts +288 -164
  21. package/dist/commons/events/defineConfig.d.ts +129 -30
  22. package/dist/commons/events/event.d.ts +14 -6
  23. package/dist/commons/events/field.d.ts +14 -0
  24. package/dist/commons/events/test.utils.d.ts +17 -13
  25. package/dist/commons/events/utils.d.ts +236 -64
  26. package/dist/commons/notification/UserNotifications.d.ts +547 -0
  27. package/dist/commons/notification/index.d.ts +2 -0
  28. package/dist/conditionals/index.js +3 -2
  29. package/dist/events/index.js +162 -87
  30. package/dist/notification/index.d.ts +2 -0
  31. package/dist/notification/index.d.ts.map +1 -0
  32. package/dist/notification/index.js +5362 -0
  33. package/package.json +3 -2
  34. package/tsconfig.json +3 -2
  35. package/tsconfig.tsbuildinfo +1 -1
  36. package/dist/commons/conditionals/conditionals.test.d.ts +0 -2
  37. package/dist/commons/conditionals/validate-address.test.d.ts +0 -2
  38. package/dist/commons/conditionals/validate.test.d.ts +0 -2
  39. package/dist/commons/events/utils.test.d.ts +0 -2
@@ -0,0 +1,547 @@
1
+ import { z } from 'zod';
2
+ export declare const TriggerEvent: {
3
+ readonly USER_CREATED: "user-created";
4
+ readonly USER_UPDATED: "user-updated";
5
+ readonly USERNAME_REMINDER: "username-reminder";
6
+ readonly RESET_PASSWORD: "reset-password";
7
+ readonly RESET_PASSWORD_BY_ADMIN: "reset-password-by-admin";
8
+ readonly TWO_FA: "2fa";
9
+ };
10
+ export type TriggerEvent = (typeof TriggerEvent)[keyof typeof TriggerEvent];
11
+ export declare const FullName: z.ZodObject<{
12
+ use: z.ZodString;
13
+ family: z.ZodString;
14
+ given: z.ZodArray<z.ZodString, "many">;
15
+ }, "strip", z.ZodTypeAny, {
16
+ use: string;
17
+ given: string[];
18
+ family: string;
19
+ }, {
20
+ use: string;
21
+ given: string[];
22
+ family: string;
23
+ }>;
24
+ export type FullName = z.infer<typeof FullName>;
25
+ export declare const Recipient: z.ZodObject<{
26
+ name: z.ZodArray<z.ZodObject<{
27
+ use: z.ZodString;
28
+ family: z.ZodString;
29
+ given: z.ZodArray<z.ZodString, "many">;
30
+ }, "strip", z.ZodTypeAny, {
31
+ use: string;
32
+ given: string[];
33
+ family: string;
34
+ }, {
35
+ use: string;
36
+ given: string[];
37
+ family: string;
38
+ }>, "many">;
39
+ mobile: z.ZodOptional<z.ZodString>;
40
+ email: z.ZodOptional<z.ZodString>;
41
+ }, "strip", z.ZodTypeAny, {
42
+ name: {
43
+ use: string;
44
+ given: string[];
45
+ family: string;
46
+ }[];
47
+ email?: string | undefined;
48
+ mobile?: string | undefined;
49
+ }, {
50
+ name: {
51
+ use: string;
52
+ given: string[];
53
+ family: string;
54
+ }[];
55
+ email?: string | undefined;
56
+ mobile?: string | undefined;
57
+ }>;
58
+ export type Recipient = z.infer<typeof Recipient>;
59
+ export declare const BasePayload: z.ZodObject<{
60
+ recipient: z.ZodObject<{
61
+ name: z.ZodArray<z.ZodObject<{
62
+ use: z.ZodString;
63
+ family: z.ZodString;
64
+ given: z.ZodArray<z.ZodString, "many">;
65
+ }, "strip", z.ZodTypeAny, {
66
+ use: string;
67
+ given: string[];
68
+ family: string;
69
+ }, {
70
+ use: string;
71
+ given: string[];
72
+ family: string;
73
+ }>, "many">;
74
+ mobile: z.ZodOptional<z.ZodString>;
75
+ email: z.ZodOptional<z.ZodString>;
76
+ }, "strip", z.ZodTypeAny, {
77
+ name: {
78
+ use: string;
79
+ given: string[];
80
+ family: string;
81
+ }[];
82
+ email?: string | undefined;
83
+ mobile?: string | undefined;
84
+ }, {
85
+ name: {
86
+ use: string;
87
+ given: string[];
88
+ family: string;
89
+ }[];
90
+ email?: string | undefined;
91
+ mobile?: string | undefined;
92
+ }>;
93
+ }, "strip", z.ZodTypeAny, {
94
+ recipient: {
95
+ name: {
96
+ use: string;
97
+ given: string[];
98
+ family: string;
99
+ }[];
100
+ email?: string | undefined;
101
+ mobile?: string | undefined;
102
+ };
103
+ }, {
104
+ recipient: {
105
+ name: {
106
+ use: string;
107
+ given: string[];
108
+ family: string;
109
+ }[];
110
+ email?: string | undefined;
111
+ mobile?: string | undefined;
112
+ };
113
+ }>;
114
+ export type BasePayload = z.infer<typeof BasePayload>;
115
+ export declare const TriggerPayload: {
116
+ readonly "user-created": z.ZodObject<z.objectUtil.extendShape<{
117
+ recipient: z.ZodObject<{
118
+ name: z.ZodArray<z.ZodObject<{
119
+ use: z.ZodString;
120
+ family: z.ZodString;
121
+ given: z.ZodArray<z.ZodString, "many">;
122
+ }, "strip", z.ZodTypeAny, {
123
+ use: string;
124
+ given: string[];
125
+ family: string;
126
+ }, {
127
+ use: string;
128
+ given: string[];
129
+ family: string;
130
+ }>, "many">;
131
+ mobile: z.ZodOptional<z.ZodString>;
132
+ email: z.ZodOptional<z.ZodString>;
133
+ }, "strip", z.ZodTypeAny, {
134
+ name: {
135
+ use: string;
136
+ given: string[];
137
+ family: string;
138
+ }[];
139
+ email?: string | undefined;
140
+ mobile?: string | undefined;
141
+ }, {
142
+ name: {
143
+ use: string;
144
+ given: string[];
145
+ family: string;
146
+ }[];
147
+ email?: string | undefined;
148
+ mobile?: string | undefined;
149
+ }>;
150
+ }, {
151
+ username: z.ZodString;
152
+ temporaryPassword: z.ZodString;
153
+ }>, "strip", z.ZodTypeAny, {
154
+ recipient: {
155
+ name: {
156
+ use: string;
157
+ given: string[];
158
+ family: string;
159
+ }[];
160
+ email?: string | undefined;
161
+ mobile?: string | undefined;
162
+ };
163
+ username: string;
164
+ temporaryPassword: string;
165
+ }, {
166
+ recipient: {
167
+ name: {
168
+ use: string;
169
+ given: string[];
170
+ family: string;
171
+ }[];
172
+ email?: string | undefined;
173
+ mobile?: string | undefined;
174
+ };
175
+ username: string;
176
+ temporaryPassword: string;
177
+ }>;
178
+ readonly "user-updated": z.ZodObject<z.objectUtil.extendShape<{
179
+ recipient: z.ZodObject<{
180
+ name: z.ZodArray<z.ZodObject<{
181
+ use: z.ZodString;
182
+ family: z.ZodString;
183
+ given: z.ZodArray<z.ZodString, "many">;
184
+ }, "strip", z.ZodTypeAny, {
185
+ use: string;
186
+ given: string[];
187
+ family: string;
188
+ }, {
189
+ use: string;
190
+ given: string[];
191
+ family: string;
192
+ }>, "many">;
193
+ mobile: z.ZodOptional<z.ZodString>;
194
+ email: z.ZodOptional<z.ZodString>;
195
+ }, "strip", z.ZodTypeAny, {
196
+ name: {
197
+ use: string;
198
+ given: string[];
199
+ family: string;
200
+ }[];
201
+ email?: string | undefined;
202
+ mobile?: string | undefined;
203
+ }, {
204
+ name: {
205
+ use: string;
206
+ given: string[];
207
+ family: string;
208
+ }[];
209
+ email?: string | undefined;
210
+ mobile?: string | undefined;
211
+ }>;
212
+ }, {
213
+ username: z.ZodString;
214
+ }>, "strip", z.ZodTypeAny, {
215
+ recipient: {
216
+ name: {
217
+ use: string;
218
+ given: string[];
219
+ family: string;
220
+ }[];
221
+ email?: string | undefined;
222
+ mobile?: string | undefined;
223
+ };
224
+ username: string;
225
+ }, {
226
+ recipient: {
227
+ name: {
228
+ use: string;
229
+ given: string[];
230
+ family: string;
231
+ }[];
232
+ email?: string | undefined;
233
+ mobile?: string | undefined;
234
+ };
235
+ username: string;
236
+ }>;
237
+ readonly "username-reminder": z.ZodObject<z.objectUtil.extendShape<{
238
+ recipient: z.ZodObject<{
239
+ name: z.ZodArray<z.ZodObject<{
240
+ use: z.ZodString;
241
+ family: z.ZodString;
242
+ given: z.ZodArray<z.ZodString, "many">;
243
+ }, "strip", z.ZodTypeAny, {
244
+ use: string;
245
+ given: string[];
246
+ family: string;
247
+ }, {
248
+ use: string;
249
+ given: string[];
250
+ family: string;
251
+ }>, "many">;
252
+ mobile: z.ZodOptional<z.ZodString>;
253
+ email: z.ZodOptional<z.ZodString>;
254
+ }, "strip", z.ZodTypeAny, {
255
+ name: {
256
+ use: string;
257
+ given: string[];
258
+ family: string;
259
+ }[];
260
+ email?: string | undefined;
261
+ mobile?: string | undefined;
262
+ }, {
263
+ name: {
264
+ use: string;
265
+ given: string[];
266
+ family: string;
267
+ }[];
268
+ email?: string | undefined;
269
+ mobile?: string | undefined;
270
+ }>;
271
+ }, {
272
+ username: z.ZodString;
273
+ }>, "strip", z.ZodTypeAny, {
274
+ recipient: {
275
+ name: {
276
+ use: string;
277
+ given: string[];
278
+ family: string;
279
+ }[];
280
+ email?: string | undefined;
281
+ mobile?: string | undefined;
282
+ };
283
+ username: string;
284
+ }, {
285
+ recipient: {
286
+ name: {
287
+ use: string;
288
+ given: string[];
289
+ family: string;
290
+ }[];
291
+ email?: string | undefined;
292
+ mobile?: string | undefined;
293
+ };
294
+ username: string;
295
+ }>;
296
+ readonly "reset-password": z.ZodObject<z.objectUtil.extendShape<{
297
+ recipient: z.ZodObject<{
298
+ name: z.ZodArray<z.ZodObject<{
299
+ use: z.ZodString;
300
+ family: z.ZodString;
301
+ given: z.ZodArray<z.ZodString, "many">;
302
+ }, "strip", z.ZodTypeAny, {
303
+ use: string;
304
+ given: string[];
305
+ family: string;
306
+ }, {
307
+ use: string;
308
+ given: string[];
309
+ family: string;
310
+ }>, "many">;
311
+ mobile: z.ZodOptional<z.ZodString>;
312
+ email: z.ZodOptional<z.ZodString>;
313
+ }, "strip", z.ZodTypeAny, {
314
+ name: {
315
+ use: string;
316
+ given: string[];
317
+ family: string;
318
+ }[];
319
+ email?: string | undefined;
320
+ mobile?: string | undefined;
321
+ }, {
322
+ name: {
323
+ use: string;
324
+ given: string[];
325
+ family: string;
326
+ }[];
327
+ email?: string | undefined;
328
+ mobile?: string | undefined;
329
+ }>;
330
+ }, {
331
+ temporaryPassword: z.ZodString;
332
+ }>, "strip", z.ZodTypeAny, {
333
+ recipient: {
334
+ name: {
335
+ use: string;
336
+ given: string[];
337
+ family: string;
338
+ }[];
339
+ email?: string | undefined;
340
+ mobile?: string | undefined;
341
+ };
342
+ temporaryPassword: string;
343
+ }, {
344
+ recipient: {
345
+ name: {
346
+ use: string;
347
+ given: string[];
348
+ family: string;
349
+ }[];
350
+ email?: string | undefined;
351
+ mobile?: string | undefined;
352
+ };
353
+ temporaryPassword: string;
354
+ }>;
355
+ readonly "reset-password-by-admin": z.ZodObject<z.objectUtil.extendShape<{
356
+ recipient: z.ZodObject<{
357
+ name: z.ZodArray<z.ZodObject<{
358
+ use: z.ZodString;
359
+ family: z.ZodString;
360
+ given: z.ZodArray<z.ZodString, "many">;
361
+ }, "strip", z.ZodTypeAny, {
362
+ use: string;
363
+ given: string[];
364
+ family: string;
365
+ }, {
366
+ use: string;
367
+ given: string[];
368
+ family: string;
369
+ }>, "many">;
370
+ mobile: z.ZodOptional<z.ZodString>;
371
+ email: z.ZodOptional<z.ZodString>;
372
+ }, "strip", z.ZodTypeAny, {
373
+ name: {
374
+ use: string;
375
+ given: string[];
376
+ family: string;
377
+ }[];
378
+ email?: string | undefined;
379
+ mobile?: string | undefined;
380
+ }, {
381
+ name: {
382
+ use: string;
383
+ given: string[];
384
+ family: string;
385
+ }[];
386
+ email?: string | undefined;
387
+ mobile?: string | undefined;
388
+ }>;
389
+ }, {
390
+ temporaryPassword: z.ZodString;
391
+ admin: z.ZodObject<{
392
+ id: z.ZodString;
393
+ name: z.ZodArray<z.ZodObject<{
394
+ use: z.ZodString;
395
+ given: z.ZodArray<z.ZodString, "many">;
396
+ family: z.ZodString;
397
+ }, "strip", z.ZodTypeAny, {
398
+ use: string;
399
+ given: string[];
400
+ family: string;
401
+ }, {
402
+ use: string;
403
+ given: string[];
404
+ family: string;
405
+ }>, "many">;
406
+ role: z.ZodString;
407
+ avatar: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
408
+ signature: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
409
+ }, "strip", z.ZodTypeAny, {
410
+ id: string;
411
+ name: {
412
+ use: string;
413
+ given: string[];
414
+ family: string;
415
+ }[];
416
+ role: string;
417
+ signature?: string | undefined;
418
+ avatar?: string | undefined;
419
+ }, {
420
+ id: string;
421
+ name: {
422
+ use: string;
423
+ given: string[];
424
+ family: string;
425
+ }[];
426
+ role: string;
427
+ signature?: string | undefined;
428
+ avatar?: string | undefined;
429
+ }>;
430
+ }>, "strip", z.ZodTypeAny, {
431
+ recipient: {
432
+ name: {
433
+ use: string;
434
+ given: string[];
435
+ family: string;
436
+ }[];
437
+ email?: string | undefined;
438
+ mobile?: string | undefined;
439
+ };
440
+ temporaryPassword: string;
441
+ admin: {
442
+ id: string;
443
+ name: {
444
+ use: string;
445
+ given: string[];
446
+ family: string;
447
+ }[];
448
+ role: string;
449
+ signature?: string | undefined;
450
+ avatar?: string | undefined;
451
+ };
452
+ }, {
453
+ recipient: {
454
+ name: {
455
+ use: string;
456
+ given: string[];
457
+ family: string;
458
+ }[];
459
+ email?: string | undefined;
460
+ mobile?: string | undefined;
461
+ };
462
+ temporaryPassword: string;
463
+ admin: {
464
+ id: string;
465
+ name: {
466
+ use: string;
467
+ given: string[];
468
+ family: string;
469
+ }[];
470
+ role: string;
471
+ signature?: string | undefined;
472
+ avatar?: string | undefined;
473
+ };
474
+ }>;
475
+ readonly "2fa": z.ZodObject<z.objectUtil.extendShape<{
476
+ recipient: z.ZodObject<{
477
+ name: z.ZodArray<z.ZodObject<{
478
+ use: z.ZodString;
479
+ family: z.ZodString;
480
+ given: z.ZodArray<z.ZodString, "many">;
481
+ }, "strip", z.ZodTypeAny, {
482
+ use: string;
483
+ given: string[];
484
+ family: string;
485
+ }, {
486
+ use: string;
487
+ given: string[];
488
+ family: string;
489
+ }>, "many">;
490
+ mobile: z.ZodOptional<z.ZodString>;
491
+ email: z.ZodOptional<z.ZodString>;
492
+ }, "strip", z.ZodTypeAny, {
493
+ name: {
494
+ use: string;
495
+ given: string[];
496
+ family: string;
497
+ }[];
498
+ email?: string | undefined;
499
+ mobile?: string | undefined;
500
+ }, {
501
+ name: {
502
+ use: string;
503
+ given: string[];
504
+ family: string;
505
+ }[];
506
+ email?: string | undefined;
507
+ mobile?: string | undefined;
508
+ }>;
509
+ }, {
510
+ code: z.ZodString;
511
+ }>, "strip", z.ZodTypeAny, {
512
+ code: string;
513
+ recipient: {
514
+ name: {
515
+ use: string;
516
+ given: string[];
517
+ family: string;
518
+ }[];
519
+ email?: string | undefined;
520
+ mobile?: string | undefined;
521
+ };
522
+ }, {
523
+ code: string;
524
+ recipient: {
525
+ name: {
526
+ use: string;
527
+ given: string[];
528
+ family: string;
529
+ }[];
530
+ email?: string | undefined;
531
+ mobile?: string | undefined;
532
+ };
533
+ }>;
534
+ };
535
+ export type TriggerPayload = {
536
+ [K in TriggerEvent]: z.infer<(typeof TriggerPayload)[K]>;
537
+ };
538
+ export declare function triggerUserEventNotification<T extends TriggerEvent>({ event, payload, countryConfigUrl, authHeader }: {
539
+ event: T;
540
+ payload: TriggerPayload[T];
541
+ countryConfigUrl: string;
542
+ authHeader: {
543
+ Authorization: string;
544
+ };
545
+ }): Promise<Response>;
546
+ export declare function parseUserEventTrigger<T extends TriggerEvent>(event: T, body: unknown): TriggerPayload[T];
547
+ //# sourceMappingURL=UserNotifications.d.ts.map
@@ -0,0 +1,2 @@
1
+ export * from './UserNotifications';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -287,8 +287,9 @@ function createFieldConditionals(fieldId) {
287
287
  properties: {
288
288
  [fieldId]: {
289
289
  type: "string",
290
- pattern: "^[\\p{Script=Latin}0-9'._-]*(\\([\\p{Script=Latin}0-9'._-]+\\))?[\\p{Script=Latin}0-9'._-]*( [\\p{Script=Latin}0-9'._-]*(\\([\\p{Script=Latin}0-9'._-]+\\))?[\\p{Script=Latin}0-9'._-]*)*$",
291
- description: "Name must contain only letters, numbers, and allowed special characters ('._-). No double spaces."
290
+ minLength: 1,
291
+ pattern: "^[\\p{Script=Latin}0-9'.-]*(\\([\\p{Script=Latin}0-9'.-]+\\))?[\\p{Script=Latin}0-9'.-]*( [\\p{Script=Latin}0-9'.-]*(\\([\\p{Script=Latin}0-9'.-]+\\))?[\\p{Script=Latin}0-9'.-]*)*$",
292
+ description: "Name must contain only letters, numbers, and allowed special characters ('.-). No double spaces."
292
293
  }
293
294
  }
294
295
  }),