@opencrvs/toolkit 1.8.0-rc.f988087 → 1.8.0-rc.f988670

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 (48) hide show
  1. package/README.md +1 -1
  2. package/dist/commons/api/router.d.ts +13703 -10688
  3. package/dist/commons/conditionals/conditionals.d.ts +32 -12
  4. package/dist/commons/conditionals/validate.d.ts +53 -17
  5. package/dist/commons/events/ActionConfig.d.ts +128971 -2093
  6. package/dist/commons/events/ActionDocument.d.ts +13021 -780
  7. package/dist/commons/events/ActionInput.d.ts +8135 -1182
  8. package/dist/commons/events/ActionType.d.ts +31 -12
  9. package/dist/commons/events/AdvancedSearchConfig.d.ts +1300 -22
  10. package/dist/commons/events/CompositeFieldValue.d.ts +192 -11
  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 +608 -117
  16. package/dist/commons/events/EventConfig.d.ts +61501 -1806
  17. package/dist/commons/events/EventConfigInput.d.ts +6 -3
  18. package/dist/commons/events/EventDocument.d.ts +5806 -1003
  19. package/dist/commons/events/EventIndex.d.ts +2350 -26
  20. package/dist/commons/events/EventMetadata.d.ts +347 -44
  21. package/dist/commons/events/FieldConfig.d.ts +7394 -956
  22. package/dist/commons/events/FieldType.d.ts +16 -2
  23. package/dist/commons/events/FieldTypeMapping.d.ts +269 -37
  24. package/dist/commons/events/FieldValue.d.ts +164 -20
  25. package/dist/commons/events/FormConfig.d.ts +54435 -90
  26. package/dist/commons/events/PageConfig.d.ts +13647 -0
  27. package/dist/commons/events/SummaryConfig.d.ts +93 -42
  28. package/dist/commons/events/TemplateConfig.d.ts +38 -0
  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 +8240 -20
  32. package/dist/commons/events/defineConfig.d.ts +10034 -307
  33. package/dist/commons/events/event.d.ts +54 -0
  34. package/dist/commons/events/field.d.ts +108 -0
  35. package/dist/commons/events/index.d.ts +11 -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 +281 -237
  39. package/dist/commons/events/transactions.d.ts +1 -1
  40. package/dist/commons/events/utils.d.ts +16549 -70
  41. package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
  42. package/dist/conditionals/index.js +228 -116
  43. package/dist/events/index.js +5572 -1907
  44. package/dist/scopes/index.d.ts +247 -1
  45. package/dist/scopes/index.js +231 -1
  46. package/package.json +4 -3
  47. package/tsconfig.json +1 -1
  48. package/dist/commons/conditionals/conditionals.test.d.ts +0 -2
@@ -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
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;
@@ -80,6 +110,7 @@ export declare const FieldValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBool
80
110
  zipCode?: string | undefined;
81
111
  }>, z.ZodObject<z.objectUtil.extendShape<{
82
112
  country: z.ZodString;
113
+ addressType: z.ZodLiteral<"DOMESTIC">;
83
114
  province: z.ZodString;
84
115
  district: z.ZodString;
85
116
  }, {
@@ -88,46 +119,112 @@ 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
- }>]>;
133
+ }>, z.ZodUndefined, z.ZodObject<{
134
+ country: z.ZodString;
135
+ addressType: z.ZodLiteral<"INTERNATIONAL">;
136
+ state: z.ZodString;
137
+ district2: z.ZodString;
138
+ cityOrTown: z.ZodOptional<z.ZodString>;
139
+ addressLine1: z.ZodOptional<z.ZodString>;
140
+ addressLine2: z.ZodOptional<z.ZodString>;
141
+ addressLine3: z.ZodOptional<z.ZodString>;
142
+ postcodeOrZip: z.ZodOptional<z.ZodString>;
143
+ }, "strip", z.ZodTypeAny, {
144
+ country: string;
145
+ state: string;
146
+ addressType: "INTERNATIONAL";
147
+ district2: string;
148
+ cityOrTown?: string | undefined;
149
+ addressLine1?: string | undefined;
150
+ addressLine2?: string | undefined;
151
+ addressLine3?: string | undefined;
152
+ postcodeOrZip?: string | undefined;
153
+ }, {
154
+ country: string;
155
+ state: string;
156
+ addressType: "INTERNATIONAL";
157
+ district2: string;
158
+ cityOrTown?: string | undefined;
159
+ addressLine1?: string | undefined;
160
+ addressLine2?: string | undefined;
161
+ addressLine3?: string | undefined;
162
+ postcodeOrZip?: string | undefined;
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.ZodString;
177
+ surname: z.ZodString;
178
+ middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
179
+ }, "strip", z.ZodTypeAny, {
180
+ firstname: string;
181
+ surname: string;
182
+ middlename?: string | null | undefined;
183
+ }, {
184
+ firstname: string;
185
+ surname: string;
186
+ middlename?: string | null | undefined;
187
+ }>, z.ZodNull]>, z.ZodUndefined]>]>;
101
188
  export type FieldValue = z.infer<typeof FieldValue>;
102
- export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
103
- 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>;
104
200
  originalFilename: z.ZodString;
105
201
  type: z.ZodString;
106
202
  }, "strip", z.ZodTypeAny, {
107
203
  type: string;
108
- filename: string;
204
+ path: string;
109
205
  originalFilename: string;
110
206
  }, {
111
207
  type: string;
112
- filename: string;
208
+ path: string;
113
209
  originalFilename: string;
114
210
  }>, z.ZodArray<z.ZodObject<{
115
- filename: z.ZodString;
211
+ path: z.ZodEffects<z.ZodString, string, string>;
116
212
  originalFilename: z.ZodString;
117
213
  type: z.ZodString;
118
214
  option: z.ZodString;
119
215
  }, "strip", z.ZodTypeAny, {
120
216
  type: string;
121
217
  option: string;
122
- filename: string;
218
+ path: string;
123
219
  originalFilename: string;
124
220
  }, {
125
221
  type: string;
126
222
  option: string;
127
- filename: string;
223
+ path: string;
128
224
  originalFilename: string;
129
225
  }>, "many">, z.ZodObject<z.objectUtil.extendShape<{
130
226
  country: z.ZodString;
227
+ addressType: z.ZodLiteral<"DOMESTIC">;
131
228
  province: z.ZodString;
132
229
  district: z.ZodString;
133
230
  }, {
@@ -140,6 +237,7 @@ export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.Z
140
237
  }>, "strip", z.ZodTypeAny, {
141
238
  country: string;
142
239
  district: string;
240
+ addressType: "DOMESTIC";
143
241
  province: string;
144
242
  urbanOrRural: "URBAN";
145
243
  number?: string | null | undefined;
@@ -150,6 +248,7 @@ export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.Z
150
248
  }, {
151
249
  country: string;
152
250
  district: string;
251
+ addressType: "DOMESTIC";
153
252
  province: string;
154
253
  urbanOrRural: "URBAN";
155
254
  number?: string | null | undefined;
@@ -159,6 +258,7 @@ export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.Z
159
258
  zipCode?: string | null | undefined;
160
259
  }>, z.ZodObject<z.objectUtil.extendShape<{
161
260
  country: z.ZodString;
261
+ addressType: z.ZodLiteral<"DOMESTIC">;
162
262
  province: z.ZodString;
163
263
  district: z.ZodString;
164
264
  }, {
@@ -167,25 +267,69 @@ export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.Z
167
267
  }>, "strip", z.ZodTypeAny, {
168
268
  country: string;
169
269
  district: string;
270
+ addressType: "DOMESTIC";
170
271
  province: string;
171
272
  urbanOrRural: "RURAL";
172
273
  village?: string | null | undefined;
173
274
  }, {
174
275
  country: string;
175
276
  district: string;
277
+ addressType: "DOMESTIC";
176
278
  province: string;
177
279
  urbanOrRural: "RURAL";
178
280
  village?: string | null | undefined;
179
- }>]>;
281
+ }>, z.ZodUndefined, z.ZodObject<{
282
+ country: z.ZodString;
283
+ addressType: z.ZodLiteral<"INTERNATIONAL">;
284
+ state: z.ZodString;
285
+ district2: z.ZodString;
286
+ cityOrTown: z.ZodOptional<z.ZodNullable<z.ZodString>>;
287
+ addressLine1: z.ZodOptional<z.ZodNullable<z.ZodString>>;
288
+ addressLine2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
289
+ addressLine3: z.ZodOptional<z.ZodNullable<z.ZodString>>;
290
+ postcodeOrZip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
291
+ }, "strip", z.ZodTypeAny, {
292
+ country: string;
293
+ state: string;
294
+ addressType: "INTERNATIONAL";
295
+ district2: string;
296
+ cityOrTown?: string | null | undefined;
297
+ addressLine1?: string | null | undefined;
298
+ addressLine2?: string | null | undefined;
299
+ addressLine3?: string | null | undefined;
300
+ postcodeOrZip?: string | null | undefined;
301
+ }, {
302
+ country: string;
303
+ state: string;
304
+ addressType: "INTERNATIONAL";
305
+ district2: string;
306
+ cityOrTown?: string | null | undefined;
307
+ addressLine1?: string | null | undefined;
308
+ addressLine2?: string | null | undefined;
309
+ addressLine3?: string | null | undefined;
310
+ postcodeOrZip?: string | null | undefined;
311
+ }>, z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
312
+ firstname: z.ZodString;
313
+ surname: z.ZodString;
314
+ middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
315
+ }, "strip", z.ZodTypeAny, {
316
+ firstname: string;
317
+ surname: string;
318
+ middlename?: string | null | undefined;
319
+ }, {
320
+ firstname: string;
321
+ surname: string;
322
+ middlename?: string | null | undefined;
323
+ }>, z.ZodNull]>, z.ZodUndefined]>]>;
180
324
  export type FieldUpdateValue = z.infer<typeof FieldUpdateValue>;
181
325
  /**
182
326
  * NOTE: This is an exception. We need schema as a type in order to generate schema dynamically.
183
327
  * */
184
- 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;
185
329
  /**
186
330
  * NOTE: This is an exception. We need schema as a type in order to generate schema dynamically.
187
331
  *
188
332
  * FieldValueInputSchema uses Input types which have set optional values as nullish
189
333
  * */
190
- 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;
191
335
  //# sourceMappingURL=FieldValue.d.ts.map