@opencrvs/toolkit 1.8.0-rc.ff2e7b6 → 1.8.0-rc.ff5b3f3

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 (43) hide show
  1. package/README.md +1 -1
  2. package/dist/commons/api/router.d.ts +14000 -10258
  3. package/dist/commons/conditionals/conditionals.d.ts +31 -5
  4. package/dist/commons/conditionals/validate-address.test.d.ts +2 -0
  5. package/dist/commons/conditionals/validate.d.ts +39 -17
  6. package/dist/commons/conditionals/validate.test.d.ts +2 -0
  7. package/dist/commons/events/ActionConfig.d.ts +96433 -2024
  8. package/dist/commons/events/ActionDocument.d.ts +9819 -312
  9. package/dist/commons/events/ActionInput.d.ts +5362 -497
  10. package/dist/commons/events/ActionType.d.ts +26 -11
  11. package/dist/commons/events/AdvancedSearchConfig.d.ts +957 -22
  12. package/dist/commons/events/CompositeFieldValue.d.ts +155 -2
  13. package/dist/commons/events/Conditional.d.ts +21 -5
  14. package/dist/commons/events/Draft.d.ts +367 -51
  15. package/dist/commons/events/EventConfig.d.ts +46117 -1819
  16. package/dist/commons/events/EventConfigInput.d.ts +6 -3
  17. package/dist/commons/events/EventDocument.d.ts +3521 -424
  18. package/dist/commons/events/EventIndex.d.ts +1735 -10
  19. package/dist/commons/events/EventInput.d.ts +13 -0
  20. package/dist/commons/events/EventMetadata.d.ts +274 -8
  21. package/dist/commons/events/FieldConfig.d.ts +4765 -787
  22. package/dist/commons/events/FieldType.d.ts +4 -3
  23. package/dist/commons/events/FieldTypeMapping.d.ts +164 -6
  24. package/dist/commons/events/FieldValue.d.ts +82 -5
  25. package/dist/commons/events/FormConfig.d.ts +43810 -73
  26. package/dist/commons/events/PageConfig.d.ts +10991 -0
  27. package/dist/commons/events/SummaryConfig.d.ts +95 -39
  28. package/dist/commons/events/TemplateConfig.d.ts +5 -5
  29. package/dist/commons/events/User.d.ts +5 -0
  30. package/dist/commons/events/WorkqueueConfig.d.ts +1549 -19
  31. package/dist/commons/events/defineConfig.d.ts +7282 -230
  32. package/dist/commons/events/event.d.ts +54 -0
  33. package/dist/commons/events/field.d.ts +82 -0
  34. package/dist/commons/events/index.d.ts +5 -1
  35. package/dist/commons/events/scopes.d.ts +45 -0
  36. package/dist/commons/events/test.utils.d.ts +129 -239
  37. package/dist/commons/events/utils.d.ts +3793 -73
  38. package/dist/commons/events/utils.test.d.ts +2 -0
  39. package/dist/conditionals/index.js +196 -108
  40. package/dist/events/index.js +3033 -1382
  41. package/dist/scopes/index.d.ts +158 -1
  42. package/dist/scopes/index.js +152 -1
  43. package/package.json +3 -2
@@ -6,6 +6,10 @@ export declare const GeographicalArea: {
6
6
  readonly URBAN: "URBAN";
7
7
  readonly RURAL: "RURAL";
8
8
  };
9
+ export declare const AddressType: {
10
+ readonly DOMESTIC: "DOMESTIC";
11
+ readonly INTERNATIONAL: "INTERNATIONAL";
12
+ };
9
13
  export declare const FileFieldValue: z.ZodObject<{
10
14
  filename: z.ZodString;
11
15
  originalFilename: z.ZodString;
@@ -22,6 +26,7 @@ export declare const FileFieldValue: z.ZodObject<{
22
26
  export type FileFieldValue = z.infer<typeof FileFieldValue>;
23
27
  export declare const UrbanAddressValue: z.ZodObject<z.objectUtil.extendShape<{
24
28
  country: z.ZodString;
29
+ addressType: z.ZodLiteral<"DOMESTIC">;
25
30
  province: z.ZodString;
26
31
  district: z.ZodString;
27
32
  }, {
@@ -34,6 +39,7 @@ export declare const UrbanAddressValue: z.ZodObject<z.objectUtil.extendShape<{
34
39
  }>, "strip", z.ZodTypeAny, {
35
40
  country: string;
36
41
  district: string;
42
+ addressType: "DOMESTIC";
37
43
  province: string;
38
44
  urbanOrRural: "URBAN";
39
45
  number?: string | undefined;
@@ -44,6 +50,7 @@ export declare const UrbanAddressValue: z.ZodObject<z.objectUtil.extendShape<{
44
50
  }, {
45
51
  country: string;
46
52
  district: string;
53
+ addressType: "DOMESTIC";
47
54
  province: string;
48
55
  urbanOrRural: "URBAN";
49
56
  number?: string | undefined;
@@ -54,6 +61,7 @@ export declare const UrbanAddressValue: z.ZodObject<z.objectUtil.extendShape<{
54
61
  }>;
55
62
  export declare const RuralAddressValue: z.ZodObject<z.objectUtil.extendShape<{
56
63
  country: z.ZodString;
64
+ addressType: z.ZodLiteral<"DOMESTIC">;
57
65
  province: z.ZodString;
58
66
  district: z.ZodString;
59
67
  }, {
@@ -62,18 +70,21 @@ export declare const RuralAddressValue: z.ZodObject<z.objectUtil.extendShape<{
62
70
  }>, "strip", z.ZodTypeAny, {
63
71
  country: string;
64
72
  district: string;
73
+ addressType: "DOMESTIC";
65
74
  province: string;
66
75
  urbanOrRural: "RURAL";
67
76
  village?: string | undefined;
68
77
  }, {
69
78
  country: string;
70
79
  district: string;
80
+ addressType: "DOMESTIC";
71
81
  province: string;
72
82
  urbanOrRural: "RURAL";
73
83
  village?: string | undefined;
74
84
  }>;
75
85
  export declare const UrbanAddressUpdateValue: z.ZodObject<z.objectUtil.extendShape<{
76
86
  country: z.ZodString;
87
+ addressType: z.ZodLiteral<"DOMESTIC">;
77
88
  province: z.ZodString;
78
89
  district: z.ZodString;
79
90
  }, {
@@ -86,6 +97,7 @@ export declare const UrbanAddressUpdateValue: z.ZodObject<z.objectUtil.extendSha
86
97
  }>, "strip", z.ZodTypeAny, {
87
98
  country: string;
88
99
  district: string;
100
+ addressType: "DOMESTIC";
89
101
  province: string;
90
102
  urbanOrRural: "URBAN";
91
103
  number?: string | null | undefined;
@@ -96,6 +108,7 @@ export declare const UrbanAddressUpdateValue: z.ZodObject<z.objectUtil.extendSha
96
108
  }, {
97
109
  country: string;
98
110
  district: string;
111
+ addressType: "DOMESTIC";
99
112
  province: string;
100
113
  urbanOrRural: "URBAN";
101
114
  number?: string | null | undefined;
@@ -104,8 +117,10 @@ export declare const UrbanAddressUpdateValue: z.ZodObject<z.objectUtil.extendSha
104
117
  street?: string | null | undefined;
105
118
  zipCode?: string | null | undefined;
106
119
  }>;
120
+ export type UrbanAddressUpdateValue = z.infer<typeof UrbanAddressUpdateValue>;
107
121
  export declare const RuralAddressUpdateValue: z.ZodObject<z.objectUtil.extendShape<{
108
122
  country: z.ZodString;
123
+ addressType: z.ZodLiteral<"DOMESTIC">;
109
124
  province: z.ZodString;
110
125
  district: z.ZodString;
111
126
  }, {
@@ -114,18 +129,53 @@ export declare const RuralAddressUpdateValue: z.ZodObject<z.objectUtil.extendSha
114
129
  }>, "strip", z.ZodTypeAny, {
115
130
  country: string;
116
131
  district: string;
132
+ addressType: "DOMESTIC";
117
133
  province: string;
118
134
  urbanOrRural: "RURAL";
119
135
  village?: string | null | undefined;
120
136
  }, {
121
137
  country: string;
122
138
  district: string;
139
+ addressType: "DOMESTIC";
123
140
  province: string;
124
141
  urbanOrRural: "RURAL";
125
142
  village?: string | null | undefined;
126
143
  }>;
127
- export declare const AddressFieldValue: z.ZodDiscriminatedUnion<"urbanOrRural", [z.ZodObject<z.objectUtil.extendShape<{
144
+ export type RuralAddressUpdateValue = z.infer<typeof RuralAddressUpdateValue>;
145
+ export declare const GenericAddressValue: z.ZodObject<{
146
+ country: z.ZodString;
147
+ addressType: z.ZodLiteral<"INTERNATIONAL">;
148
+ state: z.ZodString;
149
+ district2: z.ZodString;
150
+ cityOrTown: z.ZodOptional<z.ZodString>;
151
+ addressLine1: z.ZodOptional<z.ZodString>;
152
+ addressLine2: z.ZodOptional<z.ZodString>;
153
+ addressLine3: z.ZodOptional<z.ZodString>;
154
+ postcodeOrZip: z.ZodOptional<z.ZodString>;
155
+ }, "strip", z.ZodTypeAny, {
156
+ country: string;
157
+ state: string;
158
+ addressType: "INTERNATIONAL";
159
+ district2: string;
160
+ cityOrTown?: string | undefined;
161
+ addressLine1?: string | undefined;
162
+ addressLine2?: string | undefined;
163
+ addressLine3?: string | undefined;
164
+ postcodeOrZip?: string | undefined;
165
+ }, {
166
+ country: string;
167
+ state: string;
168
+ addressType: "INTERNATIONAL";
169
+ district2: string;
170
+ cityOrTown?: string | undefined;
171
+ addressLine1?: string | undefined;
172
+ addressLine2?: string | undefined;
173
+ addressLine3?: string | undefined;
174
+ postcodeOrZip?: string | undefined;
175
+ }>;
176
+ export declare const AddressFieldValue: z.ZodUnion<[z.ZodDiscriminatedUnion<"urbanOrRural", [z.ZodObject<z.objectUtil.extendShape<{
128
177
  country: z.ZodString;
178
+ addressType: z.ZodLiteral<"DOMESTIC">;
129
179
  province: z.ZodString;
130
180
  district: z.ZodString;
131
181
  }, {
@@ -138,6 +188,7 @@ export declare const AddressFieldValue: z.ZodDiscriminatedUnion<"urbanOrRural",
138
188
  }>, "strip", z.ZodTypeAny, {
139
189
  country: string;
140
190
  district: string;
191
+ addressType: "DOMESTIC";
141
192
  province: string;
142
193
  urbanOrRural: "URBAN";
143
194
  number?: string | undefined;
@@ -148,6 +199,7 @@ export declare const AddressFieldValue: z.ZodDiscriminatedUnion<"urbanOrRural",
148
199
  }, {
149
200
  country: string;
150
201
  district: string;
202
+ addressType: "DOMESTIC";
151
203
  province: string;
152
204
  urbanOrRural: "URBAN";
153
205
  number?: string | undefined;
@@ -157,6 +209,7 @@ export declare const AddressFieldValue: z.ZodDiscriminatedUnion<"urbanOrRural",
157
209
  zipCode?: string | undefined;
158
210
  }>, z.ZodObject<z.objectUtil.extendShape<{
159
211
  country: z.ZodString;
212
+ addressType: z.ZodLiteral<"DOMESTIC">;
160
213
  province: z.ZodString;
161
214
  district: z.ZodString;
162
215
  }, {
@@ -165,18 +218,83 @@ export declare const AddressFieldValue: z.ZodDiscriminatedUnion<"urbanOrRural",
165
218
  }>, "strip", z.ZodTypeAny, {
166
219
  country: string;
167
220
  district: string;
221
+ addressType: "DOMESTIC";
168
222
  province: string;
169
223
  urbanOrRural: "RURAL";
170
224
  village?: string | undefined;
171
225
  }, {
172
226
  country: string;
173
227
  district: string;
228
+ addressType: "DOMESTIC";
174
229
  province: string;
175
230
  urbanOrRural: "RURAL";
176
231
  village?: string | undefined;
232
+ }>]>, z.ZodObject<{
233
+ country: z.ZodString;
234
+ addressType: z.ZodLiteral<"INTERNATIONAL">;
235
+ state: z.ZodString;
236
+ district2: z.ZodString;
237
+ cityOrTown: z.ZodOptional<z.ZodString>;
238
+ addressLine1: z.ZodOptional<z.ZodString>;
239
+ addressLine2: z.ZodOptional<z.ZodString>;
240
+ addressLine3: z.ZodOptional<z.ZodString>;
241
+ postcodeOrZip: z.ZodOptional<z.ZodString>;
242
+ }, "strip", z.ZodTypeAny, {
243
+ country: string;
244
+ state: string;
245
+ addressType: "INTERNATIONAL";
246
+ district2: string;
247
+ cityOrTown?: string | undefined;
248
+ addressLine1?: string | undefined;
249
+ addressLine2?: string | undefined;
250
+ addressLine3?: string | undefined;
251
+ postcodeOrZip?: string | undefined;
252
+ }, {
253
+ country: string;
254
+ state: string;
255
+ addressType: "INTERNATIONAL";
256
+ district2: string;
257
+ cityOrTown?: string | undefined;
258
+ addressLine1?: string | undefined;
259
+ addressLine2?: string | undefined;
260
+ addressLine3?: string | undefined;
261
+ postcodeOrZip?: string | undefined;
177
262
  }>]>;
178
- export declare const AddressFieldUpdateValue: z.ZodDiscriminatedUnion<"urbanOrRural", [z.ZodObject<z.objectUtil.extendShape<{
263
+ export declare const GenericAddressUpdateValue: z.ZodObject<{
179
264
  country: z.ZodString;
265
+ addressType: z.ZodLiteral<"INTERNATIONAL">;
266
+ state: z.ZodString;
267
+ district2: z.ZodString;
268
+ cityOrTown: z.ZodOptional<z.ZodNullable<z.ZodString>>;
269
+ addressLine1: z.ZodOptional<z.ZodNullable<z.ZodString>>;
270
+ addressLine2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
271
+ addressLine3: z.ZodOptional<z.ZodNullable<z.ZodString>>;
272
+ postcodeOrZip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
273
+ }, "strip", z.ZodTypeAny, {
274
+ country: string;
275
+ state: string;
276
+ addressType: "INTERNATIONAL";
277
+ district2: string;
278
+ cityOrTown?: string | null | undefined;
279
+ addressLine1?: string | null | undefined;
280
+ addressLine2?: string | null | undefined;
281
+ addressLine3?: string | null | undefined;
282
+ postcodeOrZip?: string | null | undefined;
283
+ }, {
284
+ country: string;
285
+ state: string;
286
+ addressType: "INTERNATIONAL";
287
+ district2: string;
288
+ cityOrTown?: string | null | undefined;
289
+ addressLine1?: string | null | undefined;
290
+ addressLine2?: string | null | undefined;
291
+ addressLine3?: string | null | undefined;
292
+ postcodeOrZip?: string | null | undefined;
293
+ }>;
294
+ export type GenericAddressUpdateValue = z.infer<typeof GenericAddressUpdateValue>;
295
+ export declare const AddressFieldUpdateValue: z.ZodUnion<[z.ZodDiscriminatedUnion<"urbanOrRural", [z.ZodObject<z.objectUtil.extendShape<{
296
+ country: z.ZodString;
297
+ addressType: z.ZodLiteral<"DOMESTIC">;
180
298
  province: z.ZodString;
181
299
  district: z.ZodString;
182
300
  }, {
@@ -189,6 +307,7 @@ export declare const AddressFieldUpdateValue: z.ZodDiscriminatedUnion<"urbanOrRu
189
307
  }>, "strip", z.ZodTypeAny, {
190
308
  country: string;
191
309
  district: string;
310
+ addressType: "DOMESTIC";
192
311
  province: string;
193
312
  urbanOrRural: "URBAN";
194
313
  number?: string | null | undefined;
@@ -199,6 +318,7 @@ export declare const AddressFieldUpdateValue: z.ZodDiscriminatedUnion<"urbanOrRu
199
318
  }, {
200
319
  country: string;
201
320
  district: string;
321
+ addressType: "DOMESTIC";
202
322
  province: string;
203
323
  urbanOrRural: "URBAN";
204
324
  number?: string | null | undefined;
@@ -208,6 +328,7 @@ export declare const AddressFieldUpdateValue: z.ZodDiscriminatedUnion<"urbanOrRu
208
328
  zipCode?: string | null | undefined;
209
329
  }>, z.ZodObject<z.objectUtil.extendShape<{
210
330
  country: z.ZodString;
331
+ addressType: z.ZodLiteral<"DOMESTIC">;
211
332
  province: z.ZodString;
212
333
  district: z.ZodString;
213
334
  }, {
@@ -216,15 +337,47 @@ export declare const AddressFieldUpdateValue: z.ZodDiscriminatedUnion<"urbanOrRu
216
337
  }>, "strip", z.ZodTypeAny, {
217
338
  country: string;
218
339
  district: string;
340
+ addressType: "DOMESTIC";
219
341
  province: string;
220
342
  urbanOrRural: "RURAL";
221
343
  village?: string | null | undefined;
222
344
  }, {
223
345
  country: string;
224
346
  district: string;
347
+ addressType: "DOMESTIC";
225
348
  province: string;
226
349
  urbanOrRural: "RURAL";
227
350
  village?: string | null | undefined;
351
+ }>]>, z.ZodObject<{
352
+ country: z.ZodString;
353
+ addressType: z.ZodLiteral<"INTERNATIONAL">;
354
+ state: z.ZodString;
355
+ district2: z.ZodString;
356
+ cityOrTown: z.ZodOptional<z.ZodNullable<z.ZodString>>;
357
+ addressLine1: z.ZodOptional<z.ZodNullable<z.ZodString>>;
358
+ addressLine2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
359
+ addressLine3: z.ZodOptional<z.ZodNullable<z.ZodString>>;
360
+ postcodeOrZip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
361
+ }, "strip", z.ZodTypeAny, {
362
+ country: string;
363
+ state: string;
364
+ addressType: "INTERNATIONAL";
365
+ district2: string;
366
+ cityOrTown?: string | null | undefined;
367
+ addressLine1?: string | null | undefined;
368
+ addressLine2?: string | null | undefined;
369
+ addressLine3?: string | null | undefined;
370
+ postcodeOrZip?: string | null | undefined;
371
+ }, {
372
+ country: string;
373
+ state: string;
374
+ addressType: "INTERNATIONAL";
375
+ district2: string;
376
+ cityOrTown?: string | null | undefined;
377
+ addressLine1?: string | null | undefined;
378
+ addressLine2?: string | null | undefined;
379
+ addressLine3?: string | null | undefined;
380
+ postcodeOrZip?: string | null | undefined;
228
381
  }>]>;
229
382
  export type AddressFieldValue = z.infer<typeof AddressFieldValue>;
230
383
  export declare const FileFieldValueWithOption: z.ZodObject<{
@@ -1,15 +1,15 @@
1
1
  import { JSONSchema } from '../conditionals/conditionals';
2
2
  import { z } from 'zod';
3
- export declare function Conditional(): z.ZodType<JSONSchema, z.ZodTypeDef, JSONSchema>;
3
+ export declare const Conditional: z.ZodType<JSONSchema, z.ZodTypeDef, JSONSchema>;
4
4
  /**
5
5
  * By default, when conditionals are undefined, action is visible and enabled to everyone.
6
6
  */
7
7
  export declare const ConditionalType: {
8
- /** When 'SHOW' conditional is defined, the action is shown to the user only if the condition is met */
9
8
  readonly SHOW: "SHOW";
10
- /** If 'ENABLE' conditional is defined, the action is enabled only if the condition is met */
11
9
  readonly ENABLE: "ENABLE";
10
+ readonly DISPLAY_ON_REVIEW: "DISPLAY_ON_REVIEW";
12
11
  };
12
+ export type ConditionalType = (typeof ConditionalType)[keyof typeof ConditionalType];
13
13
  export declare const ShowConditional: z.ZodObject<{
14
14
  type: z.ZodLiteral<"SHOW">;
15
15
  conditional: z.ZodType<JSONSchema, z.ZodTypeDef, JSONSchema>;
@@ -31,9 +31,25 @@ export declare const EnableConditional: z.ZodObject<{
31
31
  conditional: JSONSchema;
32
32
  }>;
33
33
  /** @knipignore */
34
- export type AllActionConditionalFields = typeof ShowConditional | typeof EnableConditional;
34
+ export type ActionConditionalType = typeof ShowConditional | typeof EnableConditional;
35
35
  /** @knipignore */
36
36
  export type InferredActionConditional = z.infer<typeof ShowConditional> | z.infer<typeof EnableConditional>;
37
- export declare const ActionConditional: z.ZodDiscriminatedUnion<"type", AllActionConditionalFields[]>;
37
+ export declare const ActionConditional: z.ZodDiscriminatedUnion<"type", ActionConditionalType[]>;
38
38
  export type ActionConditional = InferredActionConditional;
39
+ export declare const DisplayOnReviewConditional: z.ZodObject<{
40
+ type: z.ZodLiteral<"DISPLAY_ON_REVIEW">;
41
+ conditional: z.ZodType<JSONSchema, z.ZodTypeDef, JSONSchema>;
42
+ }, "strip", z.ZodTypeAny, {
43
+ type: "DISPLAY_ON_REVIEW";
44
+ conditional: JSONSchema;
45
+ }, {
46
+ type: "DISPLAY_ON_REVIEW";
47
+ conditional: JSONSchema;
48
+ }>;
49
+ /** @knipignore */
50
+ export type FieldConditionalType = typeof ShowConditional | typeof EnableConditional | typeof DisplayOnReviewConditional;
51
+ /** @knipignore */
52
+ export type InferredFieldConditional = z.infer<typeof ShowConditional> | z.infer<typeof EnableConditional> | z.infer<typeof DisplayOnReviewConditional>;
53
+ export declare const FieldConditional: z.ZodDiscriminatedUnion<"type", FieldConditionalType[]>;
54
+ export type FieldConditional = z.infer<typeof FieldConditional>;
39
55
  //# sourceMappingURL=Conditional.d.ts.map