@opencrvs/toolkit 1.8.1-rc.448a7dd → 1.8.1-rc.44f4f51

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.
@@ -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
@@ -917,9 +917,9 @@ var SelectDateRangeField = BaseField.extend({
917
917
  options: import_zod7.z.array(SelectDateRangeOption).describe("A list of options")
918
918
  }).describe("Select input with date range options");
919
919
  var NameConfig = import_zod7.z.object({
920
- firstname: import_zod7.z.object({ required: import_zod7.z.boolean(), label: TranslationConfig.optional() }).optional(),
921
- middlename: import_zod7.z.object({ required: import_zod7.z.boolean(), label: TranslationConfig.optional() }).optional(),
922
- surname: import_zod7.z.object({ required: import_zod7.z.boolean(), label: TranslationConfig.optional() }).optional()
920
+ firstname: import_zod7.z.object({ required: import_zod7.z.boolean() }).optional(),
921
+ middlename: import_zod7.z.object({ required: import_zod7.z.boolean() }).optional(),
922
+ surname: import_zod7.z.object({ required: import_zod7.z.boolean() }).optional()
923
923
  });
924
924
  var NameField = BaseField.extend({
925
925
  type: import_zod7.z.literal(FieldType.NAME),
@@ -933,10 +933,10 @@ var NameField = BaseField.extend({
933
933
  firstname: { required: true },
934
934
  surname: { required: true }
935
935
  }).optional(),
936
- order: import_zod7.z.array(import_zod7.z.enum(["firstname", "middlename", "surname"])).optional(),
937
936
  maxLength: import_zod7.z.number().optional().describe("Maximum length of the text"),
938
937
  prefix: TranslationConfig.optional(),
939
- postfix: TranslationConfig.optional()
938
+ postfix: TranslationConfig.optional(),
939
+ searchMode: import_zod7.z.boolean().optional()
940
940
  }).default({
941
941
  name: {
942
942
  firstname: { required: true },
@@ -1004,32 +1004,10 @@ var Office = BaseField.extend({
1004
1004
  }).describe("Input field for an office");
1005
1005
  var Address = BaseField.extend({
1006
1006
  type: import_zod7.z.literal(FieldType.ADDRESS),
1007
+ defaultValue: AddressFieldValue.optional(),
1007
1008
  configuration: import_zod7.z.object({
1008
- lineSeparator: import_zod7.z.string().optional(),
1009
- fields: import_zod7.z.array(
1010
- import_zod7.z.enum([
1011
- "number",
1012
- "country",
1013
- "province",
1014
- "addressType",
1015
- "district",
1016
- "urbanOrRural",
1017
- "town",
1018
- "residentialArea",
1019
- "street",
1020
- "zipCode",
1021
- "village",
1022
- "state",
1023
- "district2",
1024
- "cityOrTown",
1025
- "addressLine1",
1026
- "addressLine2",
1027
- "addressLine3",
1028
- "postcodeOrZip"
1029
- ])
1030
- ).optional()
1031
- }).optional(),
1032
- defaultValue: AddressFieldValue.optional()
1009
+ searchMode: import_zod7.z.boolean().optional()
1010
+ }).optional()
1033
1011
  }).describe("Address input field \u2013 a combination of location and text fields");
1034
1012
  var DataEntry = import_zod7.z.union([
1035
1013
  import_zod7.z.object({
@@ -4479,7 +4457,7 @@ function getCurrentEventStateWithDrafts({
4479
4457
  configuration
4480
4458
  }) {
4481
4459
  const actions = event2.actions.slice().sort((a, b) => a.createdAt.localeCompare(b.createdAt));
4482
- const activeDrafts = drafts.map((draft) => draft.action).flatMap((action) => {
4460
+ const activeDrafts = findActiveDrafts(event2, drafts).map((draft) => draft.action).flatMap((action) => {
4483
4461
  if (action.type === ActionType.REQUEST_CORRECTION) {
4484
4462
  return [
4485
4463
  action,
@@ -0,0 +1,2 @@
1
+ export * from '../commons/notification';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/notification/index.ts"],"names":[],"mappings":"AAUA,cAAc,gCAAgC,CAAA"}