@opencrvs/toolkit 1.8.0-rc.ffe8c17 → 1.8.1-rc.0c972dc

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