@opencrvs/toolkit 1.8.1-rc.38b4f18 → 1.8.1-rc.3a45fd9

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