@opencrvs/toolkit 1.8.0-rc.fd16d13 → 1.8.0-rc.fd16dc2

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 (47) hide show
  1. package/README.md +1 -1
  2. package/dist/commons/api/router.d.ts +12875 -13596
  3. package/dist/commons/conditionals/conditionals.d.ts +31 -12
  4. package/dist/commons/conditionals/validate.d.ts +18 -17
  5. package/dist/commons/events/ActionConfig.d.ts +124475 -2015
  6. package/dist/commons/events/ActionDocument.d.ts +11605 -921
  7. package/dist/commons/events/ActionInput.d.ts +5999 -1302
  8. package/dist/commons/events/ActionType.d.ts +30 -11
  9. package/dist/commons/events/AdvancedSearchConfig.d.ts +1260 -22
  10. package/dist/commons/events/CompositeFieldValue.d.ts +92 -21
  11. package/dist/commons/events/Conditional.d.ts +21 -5
  12. package/dist/commons/events/Constants.d.ts +3 -0
  13. package/dist/commons/events/CountryConfigQueryInput.d.ts +4132 -0
  14. package/dist/commons/events/CreatedAtLocation.d.ts +2 -0
  15. package/dist/commons/events/Draft.d.ts +408 -130
  16. package/dist/commons/events/EventConfig.d.ts +59982 -1782
  17. package/dist/commons/events/EventConfigInput.d.ts +6 -3
  18. package/dist/commons/events/EventDocument.d.ts +4029 -1116
  19. package/dist/commons/events/EventIndex.d.ts +2226 -24
  20. package/dist/commons/events/EventMetadata.d.ts +343 -42
  21. package/dist/commons/events/FieldConfig.d.ts +6364 -1008
  22. package/dist/commons/events/FieldType.d.ts +8 -3
  23. package/dist/commons/events/FieldTypeMapping.d.ts +193 -63
  24. package/dist/commons/events/FieldValue.d.ts +118 -28
  25. package/dist/commons/events/FormConfig.d.ts +52557 -90
  26. package/dist/commons/events/PageConfig.d.ts +13129 -0
  27. package/dist/commons/events/SummaryConfig.d.ts +93 -42
  28. package/dist/commons/events/TemplateConfig.d.ts +5 -5
  29. package/dist/commons/events/User.d.ts +34 -2
  30. package/dist/commons/events/WorkqueueColumnConfig.d.ts +53 -0
  31. package/dist/commons/events/WorkqueueConfig.d.ts +8116 -20
  32. package/dist/commons/events/defineConfig.d.ts +9801 -301
  33. package/dist/commons/events/event.d.ts +46 -0
  34. package/dist/commons/events/field.d.ts +82 -0
  35. package/dist/commons/events/index.d.ts +10 -1
  36. package/dist/commons/events/scopes.d.ts +44 -0
  37. package/dist/commons/events/serializer.d.ts +2 -0
  38. package/dist/commons/events/test.utils.d.ts +227 -292
  39. package/dist/commons/events/transactions.d.ts +1 -1
  40. package/dist/commons/events/utils.d.ts +16184 -103
  41. package/dist/commons/events/utils.test.d.ts +2 -0
  42. package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
  43. package/dist/conditionals/index.js +211 -115
  44. package/dist/events/index.js +5652 -2368
  45. package/dist/scopes/index.d.ts +247 -1
  46. package/dist/scopes/index.js +231 -1
  47. package/package.json +4 -3
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { AddressFieldValue, AddressFieldUpdateValue, FileFieldValue, FileFieldWithOptionValue } from './CompositeFieldValue';
2
+ import { AddressFieldValue, AddressFieldUpdateValue, FileFieldValue, FileFieldWithOptionValue, NameFieldValue, NameFieldUpdateValue } from './CompositeFieldValue';
3
3
  /**
4
4
  * FieldValues defined in this file are primitive field values.
5
5
  * FieldValues defined in CompositeFieldValue.ts are composed of multiple primitive field values (Address, File etc).
@@ -13,42 +13,70 @@ import { AddressFieldValue, AddressFieldUpdateValue, FileFieldValue, FileFieldWi
13
13
  *
14
14
  */
15
15
  export declare const TextValue: z.ZodString;
16
- export declare const RequiredTextValue: z.ZodString;
16
+ export declare const NonEmptyTextValue: z.ZodString;
17
17
  export declare const DateValue: z.ZodString;
18
+ export declare const DatetimeValue: z.ZodString;
19
+ export declare const SelectDateRangeValue: z.ZodEnum<["last7Days", "last30Days", "last90Days", "last365Days"]>;
20
+ export declare const DateRangeFieldValue: z.ZodUnion<[z.ZodObject<{
21
+ start: z.ZodString;
22
+ end: z.ZodString;
23
+ }, "strip", z.ZodTypeAny, {
24
+ start: string;
25
+ end: string;
26
+ }, {
27
+ start: string;
28
+ end: string;
29
+ }>, z.ZodString]>;
30
+ export type DateRangeFieldValue = z.infer<typeof DateRangeFieldValue>;
31
+ export type SelectDateRangeValue = z.infer<typeof SelectDateRangeValue>;
18
32
  export declare const EmailValue: z.ZodString;
19
33
  export declare const CheckboxFieldValue: z.ZodBoolean;
20
34
  export type CheckboxFieldValue = z.infer<typeof CheckboxFieldValue>;
21
35
  export declare const NumberFieldValue: z.ZodNumber;
22
36
  export type NumberFieldValue = z.infer<typeof NumberFieldValue>;
23
- export declare const FieldValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
24
- filename: z.ZodString;
37
+ export declare const DataFieldValue: z.ZodUndefined;
38
+ export type DataFieldValue = z.infer<typeof DataFieldValue>;
39
+ export declare const SignatureFieldValue: z.ZodString;
40
+ export type SignatureFieldValue = z.infer<typeof SignatureFieldValue>;
41
+ export declare const FieldValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodUnion<[z.ZodObject<{
42
+ start: z.ZodString;
43
+ end: z.ZodString;
44
+ }, "strip", z.ZodTypeAny, {
45
+ start: string;
46
+ end: string;
47
+ }, {
48
+ start: string;
49
+ end: string;
50
+ }>, z.ZodString]>, z.ZodEnum<["last7Days", "last30Days", "last90Days", "last365Days"]>, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
51
+ path: z.ZodEffects<z.ZodString, string, string>;
25
52
  originalFilename: z.ZodString;
26
53
  type: z.ZodString;
27
54
  }, "strip", z.ZodTypeAny, {
28
55
  type: string;
29
- filename: string;
56
+ path: string;
30
57
  originalFilename: string;
31
58
  }, {
32
59
  type: string;
33
- filename: string;
60
+ path: string;
34
61
  originalFilename: string;
35
62
  }>, z.ZodArray<z.ZodObject<{
36
- filename: z.ZodString;
63
+ path: z.ZodEffects<z.ZodString, string, string>;
37
64
  originalFilename: z.ZodString;
38
65
  type: z.ZodString;
39
66
  option: z.ZodString;
40
67
  }, "strip", z.ZodTypeAny, {
41
68
  type: string;
42
69
  option: string;
43
- filename: string;
70
+ path: string;
44
71
  originalFilename: string;
45
72
  }, {
46
73
  type: string;
47
74
  option: string;
48
- filename: string;
75
+ path: string;
49
76
  originalFilename: string;
50
77
  }>, "many">, z.ZodObject<z.objectUtil.extendShape<{
51
- country: z.ZodLiteral<string>;
78
+ country: z.ZodString;
79
+ addressType: z.ZodLiteral<"DOMESTIC">;
52
80
  province: z.ZodString;
53
81
  district: z.ZodString;
54
82
  }, {
@@ -61,6 +89,7 @@ export declare const FieldValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBool
61
89
  }>, "strip", z.ZodTypeAny, {
62
90
  country: string;
63
91
  district: string;
92
+ addressType: "DOMESTIC";
64
93
  province: string;
65
94
  urbanOrRural: "URBAN";
66
95
  number?: string | undefined;
@@ -71,6 +100,7 @@ export declare const FieldValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBool
71
100
  }, {
72
101
  country: string;
73
102
  district: string;
103
+ addressType: "DOMESTIC";
74
104
  province: string;
75
105
  urbanOrRural: "URBAN";
76
106
  number?: string | undefined;
@@ -79,7 +109,8 @@ export declare const FieldValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBool
79
109
  street?: string | undefined;
80
110
  zipCode?: string | undefined;
81
111
  }>, z.ZodObject<z.objectUtil.extendShape<{
82
- country: z.ZodLiteral<string>;
112
+ country: z.ZodString;
113
+ addressType: z.ZodLiteral<"DOMESTIC">;
83
114
  province: z.ZodString;
84
115
  district: z.ZodString;
85
116
  }, {
@@ -88,17 +119,20 @@ export declare const FieldValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBool
88
119
  }>, "strip", z.ZodTypeAny, {
89
120
  country: string;
90
121
  district: string;
122
+ addressType: "DOMESTIC";
91
123
  province: string;
92
124
  urbanOrRural: "RURAL";
93
125
  village?: string | undefined;
94
126
  }, {
95
127
  country: string;
96
128
  district: string;
129
+ addressType: "DOMESTIC";
97
130
  province: string;
98
131
  urbanOrRural: "RURAL";
99
132
  village?: string | undefined;
100
- }>, z.ZodObject<{
101
- country: z.ZodEffects<z.ZodString, string, string>;
133
+ }>, z.ZodUndefined, z.ZodObject<{
134
+ country: z.ZodString;
135
+ addressType: z.ZodLiteral<"INTERNATIONAL">;
102
136
  state: z.ZodString;
103
137
  district2: z.ZodString;
104
138
  cityOrTown: z.ZodOptional<z.ZodString>;
@@ -109,6 +143,7 @@ export declare const FieldValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBool
109
143
  }, "strip", z.ZodTypeAny, {
110
144
  country: string;
111
145
  state: string;
146
+ addressType: "INTERNATIONAL";
112
147
  district2: string;
113
148
  cityOrTown?: string | undefined;
114
149
  addressLine1?: string | undefined;
@@ -118,43 +153,78 @@ export declare const FieldValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBool
118
153
  }, {
119
154
  country: string;
120
155
  state: string;
156
+ addressType: "INTERNATIONAL";
121
157
  district2: string;
122
158
  cityOrTown?: string | undefined;
123
159
  addressLine1?: string | undefined;
124
160
  addressLine2?: string | undefined;
125
161
  addressLine3?: string | undefined;
126
162
  postcodeOrZip?: string | undefined;
127
- }>]>;
163
+ }>, z.ZodObject<{
164
+ firstname: z.ZodString;
165
+ surname: z.ZodString;
166
+ middlename: z.ZodOptional<z.ZodString>;
167
+ }, "strip", z.ZodTypeAny, {
168
+ firstname: string;
169
+ surname: string;
170
+ middlename?: string | undefined;
171
+ }, {
172
+ firstname: string;
173
+ surname: string;
174
+ middlename?: string | undefined;
175
+ }>, z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
176
+ firstname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
177
+ surname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
178
+ middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
179
+ }, "strip", z.ZodTypeAny, {
180
+ firstname?: string | null | undefined;
181
+ surname?: string | null | undefined;
182
+ middlename?: string | null | undefined;
183
+ }, {
184
+ firstname?: string | null | undefined;
185
+ surname?: string | null | undefined;
186
+ middlename?: string | null | undefined;
187
+ }>, z.ZodNull]>, z.ZodUndefined]>]>;
128
188
  export type FieldValue = z.infer<typeof FieldValue>;
129
- export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
130
- filename: z.ZodString;
189
+ export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodUnion<[z.ZodObject<{
190
+ start: z.ZodString;
191
+ end: z.ZodString;
192
+ }, "strip", z.ZodTypeAny, {
193
+ start: string;
194
+ end: string;
195
+ }, {
196
+ start: string;
197
+ end: string;
198
+ }>, z.ZodString]>, z.ZodEnum<["last7Days", "last30Days", "last90Days", "last365Days"]>, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
199
+ path: z.ZodEffects<z.ZodString, string, string>;
131
200
  originalFilename: z.ZodString;
132
201
  type: z.ZodString;
133
202
  }, "strip", z.ZodTypeAny, {
134
203
  type: string;
135
- filename: string;
204
+ path: string;
136
205
  originalFilename: string;
137
206
  }, {
138
207
  type: string;
139
- filename: string;
208
+ path: string;
140
209
  originalFilename: string;
141
210
  }>, z.ZodArray<z.ZodObject<{
142
- filename: z.ZodString;
211
+ path: z.ZodEffects<z.ZodString, string, string>;
143
212
  originalFilename: z.ZodString;
144
213
  type: z.ZodString;
145
214
  option: z.ZodString;
146
215
  }, "strip", z.ZodTypeAny, {
147
216
  type: string;
148
217
  option: string;
149
- filename: string;
218
+ path: string;
150
219
  originalFilename: string;
151
220
  }, {
152
221
  type: string;
153
222
  option: string;
154
- filename: string;
223
+ path: string;
155
224
  originalFilename: string;
156
225
  }>, "many">, z.ZodObject<z.objectUtil.extendShape<{
157
- country: z.ZodLiteral<string>;
226
+ country: z.ZodString;
227
+ addressType: z.ZodLiteral<"DOMESTIC">;
158
228
  province: z.ZodString;
159
229
  district: z.ZodString;
160
230
  }, {
@@ -167,6 +237,7 @@ export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.Z
167
237
  }>, "strip", z.ZodTypeAny, {
168
238
  country: string;
169
239
  district: string;
240
+ addressType: "DOMESTIC";
170
241
  province: string;
171
242
  urbanOrRural: "URBAN";
172
243
  number?: string | null | undefined;
@@ -177,6 +248,7 @@ export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.Z
177
248
  }, {
178
249
  country: string;
179
250
  district: string;
251
+ addressType: "DOMESTIC";
180
252
  province: string;
181
253
  urbanOrRural: "URBAN";
182
254
  number?: string | null | undefined;
@@ -185,7 +257,8 @@ export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.Z
185
257
  street?: string | null | undefined;
186
258
  zipCode?: string | null | undefined;
187
259
  }>, z.ZodObject<z.objectUtil.extendShape<{
188
- country: z.ZodLiteral<string>;
260
+ country: z.ZodString;
261
+ addressType: z.ZodLiteral<"DOMESTIC">;
189
262
  province: z.ZodString;
190
263
  district: z.ZodString;
191
264
  }, {
@@ -194,17 +267,20 @@ export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.Z
194
267
  }>, "strip", z.ZodTypeAny, {
195
268
  country: string;
196
269
  district: string;
270
+ addressType: "DOMESTIC";
197
271
  province: string;
198
272
  urbanOrRural: "RURAL";
199
273
  village?: string | null | undefined;
200
274
  }, {
201
275
  country: string;
202
276
  district: string;
277
+ addressType: "DOMESTIC";
203
278
  province: string;
204
279
  urbanOrRural: "RURAL";
205
280
  village?: string | null | undefined;
206
- }>, z.ZodObject<{
207
- country: z.ZodEffects<z.ZodString, string, string>;
281
+ }>, z.ZodUndefined, z.ZodObject<{
282
+ country: z.ZodString;
283
+ addressType: z.ZodLiteral<"INTERNATIONAL">;
208
284
  state: z.ZodString;
209
285
  district2: z.ZodString;
210
286
  cityOrTown: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -215,6 +291,7 @@ export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.Z
215
291
  }, "strip", z.ZodTypeAny, {
216
292
  country: string;
217
293
  state: string;
294
+ addressType: "INTERNATIONAL";
218
295
  district2: string;
219
296
  cityOrTown?: string | null | undefined;
220
297
  addressLine1?: string | null | undefined;
@@ -224,22 +301,35 @@ export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.Z
224
301
  }, {
225
302
  country: string;
226
303
  state: string;
304
+ addressType: "INTERNATIONAL";
227
305
  district2: string;
228
306
  cityOrTown?: string | null | undefined;
229
307
  addressLine1?: string | null | undefined;
230
308
  addressLine2?: string | null | undefined;
231
309
  addressLine3?: string | null | undefined;
232
310
  postcodeOrZip?: string | null | undefined;
233
- }>]>;
311
+ }>, z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
312
+ firstname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
313
+ surname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
314
+ middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
315
+ }, "strip", z.ZodTypeAny, {
316
+ firstname?: string | null | undefined;
317
+ surname?: string | null | undefined;
318
+ middlename?: string | null | undefined;
319
+ }, {
320
+ firstname?: string | null | undefined;
321
+ surname?: string | null | undefined;
322
+ middlename?: string | null | undefined;
323
+ }>, z.ZodNull]>, z.ZodUndefined]>]>;
234
324
  export type FieldUpdateValue = z.infer<typeof FieldUpdateValue>;
235
325
  /**
236
326
  * NOTE: This is an exception. We need schema as a type in order to generate schema dynamically.
237
327
  * */
238
- export type FieldValueSchema = typeof FileFieldValue | typeof FileFieldWithOptionValue | typeof CheckboxFieldValue | typeof AddressFieldValue | typeof NumberFieldValue | z.ZodString | z.ZodBoolean;
328
+ export type FieldValueSchema = typeof FileFieldValue | typeof FileFieldWithOptionValue | typeof CheckboxFieldValue | typeof AddressFieldValue | typeof NumberFieldValue | typeof DataFieldValue | typeof NameFieldValue | z.ZodString | z.ZodBoolean;
239
329
  /**
240
330
  * NOTE: This is an exception. We need schema as a type in order to generate schema dynamically.
241
331
  *
242
332
  * FieldValueInputSchema uses Input types which have set optional values as nullish
243
333
  * */
244
- export type FieldUpdateValueSchema = typeof FileFieldValue | typeof FileFieldWithOptionValue | typeof CheckboxFieldValue | typeof AddressFieldUpdateValue | typeof NumberFieldValue | z.ZodString | z.ZodBoolean;
334
+ export type FieldUpdateValueSchema = typeof DateRangeFieldValue | typeof SelectDateRangeValue | typeof FileFieldValue | typeof FileFieldWithOptionValue | typeof CheckboxFieldValue | typeof AddressFieldUpdateValue | typeof NumberFieldValue | typeof DataFieldValue | typeof NameFieldValue | typeof NameFieldUpdateValue | z.ZodString | z.ZodBoolean;
245
335
  //# sourceMappingURL=FieldValue.d.ts.map