@opencrvs/toolkit 1.8.0-rc.feaeeb7 → 1.8.0-rc.feef45c

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 (41) hide show
  1. package/README.md +1 -1
  2. package/dist/commons/api/router.d.ts +10781 -10314
  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 +85782 -2035
  8. package/dist/commons/events/ActionDocument.d.ts +9850 -363
  9. package/dist/commons/events/ActionInput.d.ts +5365 -584
  10. package/dist/commons/events/ActionType.d.ts +27 -12
  11. package/dist/commons/events/AdvancedSearchConfig.d.ts +371 -25
  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 +374 -59
  15. package/dist/commons/events/EventConfig.d.ts +40846 -1801
  16. package/dist/commons/events/EventConfigInput.d.ts +6 -3
  17. package/dist/commons/events/EventDocument.d.ts +3672 -504
  18. package/dist/commons/events/EventIndex.d.ts +921 -7
  19. package/dist/commons/events/EventInput.d.ts +13 -0
  20. package/dist/commons/events/EventMetadata.d.ts +16 -3
  21. package/dist/commons/events/FieldConfig.d.ts +3955 -757
  22. package/dist/commons/events/FieldType.d.ts +6 -2
  23. package/dist/commons/events/FieldTypeMapping.d.ts +154 -3
  24. package/dist/commons/events/FieldValue.d.ts +77 -3
  25. package/dist/commons/events/FormConfig.d.ts +38982 -69
  26. package/dist/commons/events/PageConfig.d.ts +9803 -0
  27. package/dist/commons/events/SummaryConfig.d.ts +81 -42
  28. package/dist/commons/events/TemplateConfig.d.ts +30 -10
  29. package/dist/commons/events/User.d.ts +5 -0
  30. package/dist/commons/events/WorkqueueConfig.d.ts +44 -20
  31. package/dist/commons/events/defineConfig.d.ts +6749 -230
  32. package/dist/commons/events/event.d.ts +25 -0
  33. package/dist/commons/events/field.d.ts +68 -0
  34. package/dist/commons/events/index.d.ts +5 -1
  35. package/dist/commons/events/scopes.d.ts +26 -0
  36. package/dist/commons/events/test.utils.d.ts +128 -238
  37. package/dist/commons/events/utils.d.ts +3528 -90
  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 +2201 -1197
  41. package/package.json +3 -2
@@ -1,24 +1,39 @@
1
+ import { z } from 'zod';
1
2
  /**
2
3
  * Actions recognized by the system
3
4
  */
4
5
  export declare const ActionType: {
6
+ readonly DELETE: "DELETE";
5
7
  readonly CREATE: "CREATE";
6
- readonly ASSIGN: "ASSIGN";
7
- readonly UNASSIGN: "UNASSIGN";
8
- readonly REGISTER: "REGISTER";
9
- readonly VALIDATE: "VALIDATE";
10
- readonly REQUEST_CORRECTION: "REQUEST_CORRECTION";
11
- readonly REJECT_CORRECTION: "REJECT_CORRECTION";
12
- readonly APPROVE_CORRECTION: "APPROVE_CORRECTION";
13
- readonly DETECT_DUPLICATE: "DETECT_DUPLICATE";
14
8
  readonly NOTIFY: "NOTIFY";
15
9
  readonly DECLARE: "DECLARE";
16
- readonly DELETE: "DELETE";
17
- readonly PRINT_CERTIFICATE: "PRINT_CERTIFICATE";
18
- readonly CUSTOM: "CUSTOM";
10
+ readonly VALIDATE: "VALIDATE";
11
+ readonly REGISTER: "REGISTER";
12
+ readonly DETECT_DUPLICATE: "DETECT_DUPLICATE";
19
13
  readonly REJECT: "REJECT";
20
14
  readonly MARKED_AS_DUPLICATE: "MARKED_AS_DUPLICATE";
21
- readonly ARCHIVED: "ARCHIVED";
15
+ readonly ARCHIVE: "ARCHIVE";
16
+ readonly PRINT_CERTIFICATE: "PRINT_CERTIFICATE";
17
+ readonly REQUEST_CORRECTION: "REQUEST_CORRECTION";
18
+ readonly REJECT_CORRECTION: "REJECT_CORRECTION";
19
+ readonly APPROVE_CORRECTION: "APPROVE_CORRECTION";
20
+ readonly READ: "READ";
21
+ readonly ASSIGN: "ASSIGN";
22
+ readonly UNASSIGN: "UNASSIGN";
22
23
  };
23
24
  export type ActionType = (typeof ActionType)[keyof typeof ActionType];
25
+ export declare const ConfirmableActions: readonly ["NOTIFY", "DECLARE", "VALIDATE", "REGISTER", "REJECT", "ARCHIVE", "PRINT_CERTIFICATE"];
26
+ /** Testing building types from enums as an alternative */
27
+ export declare const ActionTypes: z.ZodEnum<["DELETE", "CREATE", "NOTIFY", "DECLARE", "VALIDATE", "REGISTER", "DETECT_DUPLICATE", "REJECT", "MARKED_AS_DUPLICATE", "ARCHIVE", "PRINT_CERTIFICATE", "REQUEST_CORRECTION", "REJECT_CORRECTION", "APPROVE_CORRECTION", "READ", "ASSIGN", "UNASSIGN"]>;
28
+ /** Actions which change event data (declaration) before registration / during declaration. */
29
+ export declare const DeclarationActions: z.ZodEnum<["DECLARE", "VALIDATE", "REGISTER"]>;
30
+ export type DeclarationActionType = z.infer<typeof DeclarationActions>;
31
+ /** Actions that can modify declaration data. Request can be corrected after declaring it. */
32
+ export declare const DeclarationUpdateActions: z.ZodEnum<["DECLARE", "VALIDATE", "REGISTER", "REQUEST_CORRECTION"]>;
33
+ export type DeclarationUpdateActionType = z.infer<typeof DeclarationUpdateActions>;
34
+ /** Actions which update annotation or status of an event. */
35
+ export declare const annotationActions: z.ZodEnum<["DELETE", "CREATE", "NOTIFY", "DETECT_DUPLICATE", "REJECT", "MARKED_AS_DUPLICATE", "ARCHIVE", "PRINT_CERTIFICATE", "REQUEST_CORRECTION", "REJECT_CORRECTION", "APPROVE_CORRECTION", "READ", "ASSIGN", "UNASSIGN"]>;
36
+ export type AnnotationActionType = z.infer<typeof annotationActions>;
37
+ /** Actions which requires the user to be assigned */
38
+ export declare const writeActions: z.ZodEnum<["DELETE", "NOTIFY", "DECLARE", "VALIDATE", "REGISTER", "DETECT_DUPLICATE", "REJECT", "MARKED_AS_DUPLICATE", "ARCHIVE", "PRINT_CERTIFICATE", "REQUEST_CORRECTION", "REJECT_CORRECTION", "APPROVE_CORRECTION"]>;
24
39
  //# sourceMappingURL=ActionType.d.ts.map
@@ -1,51 +1,397 @@
1
1
  import { z } from 'zod';
2
2
  import { TranslationConfig } from './TranslationConfig';
3
+ export declare const MatchType: z.ZodEnum<["FUZZY", "EXACT", "RANGE", "ANY_OF"]>;
4
+ export type MatchType = z.infer<typeof MatchType>;
5
+ export declare const FieldConfigSchema: z.ZodObject<z.objectUtil.extendShape<{
6
+ config: z.ZodObject<{
7
+ type: z.ZodEnum<["FUZZY", "EXACT", "RANGE", "ANY_OF"]>;
8
+ }, "strip", z.ZodTypeAny, {
9
+ type: "FUZZY" | "EXACT" | "RANGE" | "ANY_OF";
10
+ }, {
11
+ type: "FUZZY" | "EXACT" | "RANGE" | "ANY_OF";
12
+ }>;
13
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
14
+ value: z.ZodString;
15
+ label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
16
+ id: string;
17
+ description: string;
18
+ defaultMessage: string;
19
+ }>;
20
+ }, "strip", z.ZodTypeAny, {
21
+ value: string;
22
+ label: TranslationConfig;
23
+ }, {
24
+ value: string;
25
+ label: {
26
+ id: string;
27
+ description: string;
28
+ defaultMessage: string;
29
+ };
30
+ }>, "many">>;
31
+ }, {
32
+ fieldId: z.ZodString;
33
+ fieldType: z.ZodLiteral<"field">;
34
+ }>, "strip", z.ZodTypeAny, {
35
+ config: {
36
+ type: "FUZZY" | "EXACT" | "RANGE" | "ANY_OF";
37
+ };
38
+ fieldId: string;
39
+ fieldType: "field";
40
+ options?: {
41
+ value: string;
42
+ label: TranslationConfig;
43
+ }[] | undefined;
44
+ }, {
45
+ config: {
46
+ type: "FUZZY" | "EXACT" | "RANGE" | "ANY_OF";
47
+ };
48
+ fieldId: string;
49
+ fieldType: "field";
50
+ options?: {
51
+ value: string;
52
+ label: {
53
+ id: string;
54
+ description: string;
55
+ defaultMessage: string;
56
+ };
57
+ }[] | undefined;
58
+ }>;
59
+ export declare const EventFieldId: z.ZodEnum<["trackingId", "status"]>;
60
+ export type EventFieldId = z.infer<typeof EventFieldId>;
61
+ export declare const EventFieldConfigSchema: z.ZodObject<z.objectUtil.extendShape<{
62
+ config: z.ZodObject<{
63
+ type: z.ZodEnum<["FUZZY", "EXACT", "RANGE", "ANY_OF"]>;
64
+ }, "strip", z.ZodTypeAny, {
65
+ type: "FUZZY" | "EXACT" | "RANGE" | "ANY_OF";
66
+ }, {
67
+ type: "FUZZY" | "EXACT" | "RANGE" | "ANY_OF";
68
+ }>;
69
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
70
+ value: z.ZodString;
71
+ label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
72
+ id: string;
73
+ description: string;
74
+ defaultMessage: string;
75
+ }>;
76
+ }, "strip", z.ZodTypeAny, {
77
+ value: string;
78
+ label: TranslationConfig;
79
+ }, {
80
+ value: string;
81
+ label: {
82
+ id: string;
83
+ description: string;
84
+ defaultMessage: string;
85
+ };
86
+ }>, "many">>;
87
+ }, {
88
+ fieldId: z.ZodEnum<["trackingId", "status"]>;
89
+ fieldType: z.ZodLiteral<"event">;
90
+ }>, "strip", z.ZodTypeAny, {
91
+ config: {
92
+ type: "FUZZY" | "EXACT" | "RANGE" | "ANY_OF";
93
+ };
94
+ fieldId: "status" | "trackingId";
95
+ fieldType: "event";
96
+ options?: {
97
+ value: string;
98
+ label: TranslationConfig;
99
+ }[] | undefined;
100
+ }, {
101
+ config: {
102
+ type: "FUZZY" | "EXACT" | "RANGE" | "ANY_OF";
103
+ };
104
+ fieldId: "status" | "trackingId";
105
+ fieldType: "event";
106
+ options?: {
107
+ value: string;
108
+ label: {
109
+ id: string;
110
+ description: string;
111
+ defaultMessage: string;
112
+ };
113
+ }[] | undefined;
114
+ }>;
115
+ export declare const SearchField: z.ZodDiscriminatedUnion<"fieldType", [z.ZodObject<z.objectUtil.extendShape<{
116
+ config: z.ZodObject<{
117
+ type: z.ZodEnum<["FUZZY", "EXACT", "RANGE", "ANY_OF"]>;
118
+ }, "strip", z.ZodTypeAny, {
119
+ type: "FUZZY" | "EXACT" | "RANGE" | "ANY_OF";
120
+ }, {
121
+ type: "FUZZY" | "EXACT" | "RANGE" | "ANY_OF";
122
+ }>;
123
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
124
+ value: z.ZodString;
125
+ label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
126
+ id: string;
127
+ description: string;
128
+ defaultMessage: string;
129
+ }>;
130
+ }, "strip", z.ZodTypeAny, {
131
+ value: string;
132
+ label: TranslationConfig;
133
+ }, {
134
+ value: string;
135
+ label: {
136
+ id: string;
137
+ description: string;
138
+ defaultMessage: string;
139
+ };
140
+ }>, "many">>;
141
+ }, {
142
+ fieldId: z.ZodString;
143
+ fieldType: z.ZodLiteral<"field">;
144
+ }>, "strip", z.ZodTypeAny, {
145
+ config: {
146
+ type: "FUZZY" | "EXACT" | "RANGE" | "ANY_OF";
147
+ };
148
+ fieldId: string;
149
+ fieldType: "field";
150
+ options?: {
151
+ value: string;
152
+ label: TranslationConfig;
153
+ }[] | undefined;
154
+ }, {
155
+ config: {
156
+ type: "FUZZY" | "EXACT" | "RANGE" | "ANY_OF";
157
+ };
158
+ fieldId: string;
159
+ fieldType: "field";
160
+ options?: {
161
+ value: string;
162
+ label: {
163
+ id: string;
164
+ description: string;
165
+ defaultMessage: string;
166
+ };
167
+ }[] | undefined;
168
+ }>, z.ZodObject<z.objectUtil.extendShape<{
169
+ config: z.ZodObject<{
170
+ type: z.ZodEnum<["FUZZY", "EXACT", "RANGE", "ANY_OF"]>;
171
+ }, "strip", z.ZodTypeAny, {
172
+ type: "FUZZY" | "EXACT" | "RANGE" | "ANY_OF";
173
+ }, {
174
+ type: "FUZZY" | "EXACT" | "RANGE" | "ANY_OF";
175
+ }>;
176
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
177
+ value: z.ZodString;
178
+ label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
179
+ id: string;
180
+ description: string;
181
+ defaultMessage: string;
182
+ }>;
183
+ }, "strip", z.ZodTypeAny, {
184
+ value: string;
185
+ label: TranslationConfig;
186
+ }, {
187
+ value: string;
188
+ label: {
189
+ id: string;
190
+ description: string;
191
+ defaultMessage: string;
192
+ };
193
+ }>, "many">>;
194
+ }, {
195
+ fieldId: z.ZodEnum<["trackingId", "status"]>;
196
+ fieldType: z.ZodLiteral<"event">;
197
+ }>, "strip", z.ZodTypeAny, {
198
+ config: {
199
+ type: "FUZZY" | "EXACT" | "RANGE" | "ANY_OF";
200
+ };
201
+ fieldId: "status" | "trackingId";
202
+ fieldType: "event";
203
+ options?: {
204
+ value: string;
205
+ label: TranslationConfig;
206
+ }[] | undefined;
207
+ }, {
208
+ config: {
209
+ type: "FUZZY" | "EXACT" | "RANGE" | "ANY_OF";
210
+ };
211
+ fieldId: "status" | "trackingId";
212
+ fieldType: "event";
213
+ options?: {
214
+ value: string;
215
+ label: {
216
+ id: string;
217
+ description: string;
218
+ defaultMessage: string;
219
+ };
220
+ }[] | undefined;
221
+ }>]>;
222
+ export type SearchField = z.infer<typeof SearchField>;
3
223
  export declare const AdvancedSearchConfig: z.ZodObject<{
4
224
  title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
5
225
  id: string;
6
226
  description: string;
7
227
  defaultMessage: string;
8
228
  }>;
9
- fields: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
10
- fieldId: z.ZodString;
11
- config: z.ZodOptional<z.ZodObject<{
12
- type: z.ZodEnum<["FUZZY", "EXACT", "RANGE"]>;
229
+ fields: z.ZodArray<z.ZodDiscriminatedUnion<"fieldType", [z.ZodObject<z.objectUtil.extendShape<{
230
+ config: z.ZodObject<{
231
+ type: z.ZodEnum<["FUZZY", "EXACT", "RANGE", "ANY_OF"]>;
13
232
  }, "strip", z.ZodTypeAny, {
14
- type: "FUZZY" | "EXACT" | "RANGE";
233
+ type: "FUZZY" | "EXACT" | "RANGE" | "ANY_OF";
15
234
  }, {
16
- type: "FUZZY" | "EXACT" | "RANGE";
17
- }>>;
18
- }, "strip", z.ZodTypeAny, {
235
+ type: "FUZZY" | "EXACT" | "RANGE" | "ANY_OF";
236
+ }>;
237
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
238
+ value: z.ZodString;
239
+ label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
240
+ id: string;
241
+ description: string;
242
+ defaultMessage: string;
243
+ }>;
244
+ }, "strip", z.ZodTypeAny, {
245
+ value: string;
246
+ label: TranslationConfig;
247
+ }, {
248
+ value: string;
249
+ label: {
250
+ id: string;
251
+ description: string;
252
+ defaultMessage: string;
253
+ };
254
+ }>, "many">>;
255
+ }, {
256
+ fieldId: z.ZodString;
257
+ fieldType: z.ZodLiteral<"field">;
258
+ }>, "strip", z.ZodTypeAny, {
259
+ config: {
260
+ type: "FUZZY" | "EXACT" | "RANGE" | "ANY_OF";
261
+ };
19
262
  fieldId: string;
20
- config?: {
21
- type: "FUZZY" | "EXACT" | "RANGE";
22
- } | undefined;
263
+ fieldType: "field";
264
+ options?: {
265
+ value: string;
266
+ label: TranslationConfig;
267
+ }[] | undefined;
23
268
  }, {
269
+ config: {
270
+ type: "FUZZY" | "EXACT" | "RANGE" | "ANY_OF";
271
+ };
24
272
  fieldId: string;
25
- config?: {
26
- type: "FUZZY" | "EXACT" | "RANGE";
27
- } | undefined;
28
- }>, "many">>>;
273
+ fieldType: "field";
274
+ options?: {
275
+ value: string;
276
+ label: {
277
+ id: string;
278
+ description: string;
279
+ defaultMessage: string;
280
+ };
281
+ }[] | undefined;
282
+ }>, z.ZodObject<z.objectUtil.extendShape<{
283
+ config: z.ZodObject<{
284
+ type: z.ZodEnum<["FUZZY", "EXACT", "RANGE", "ANY_OF"]>;
285
+ }, "strip", z.ZodTypeAny, {
286
+ type: "FUZZY" | "EXACT" | "RANGE" | "ANY_OF";
287
+ }, {
288
+ type: "FUZZY" | "EXACT" | "RANGE" | "ANY_OF";
289
+ }>;
290
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
291
+ value: z.ZodString;
292
+ label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
293
+ id: string;
294
+ description: string;
295
+ defaultMessage: string;
296
+ }>;
297
+ }, "strip", z.ZodTypeAny, {
298
+ value: string;
299
+ label: TranslationConfig;
300
+ }, {
301
+ value: string;
302
+ label: {
303
+ id: string;
304
+ description: string;
305
+ defaultMessage: string;
306
+ };
307
+ }>, "many">>;
308
+ }, {
309
+ fieldId: z.ZodEnum<["trackingId", "status"]>;
310
+ fieldType: z.ZodLiteral<"event">;
311
+ }>, "strip", z.ZodTypeAny, {
312
+ config: {
313
+ type: "FUZZY" | "EXACT" | "RANGE" | "ANY_OF";
314
+ };
315
+ fieldId: "status" | "trackingId";
316
+ fieldType: "event";
317
+ options?: {
318
+ value: string;
319
+ label: TranslationConfig;
320
+ }[] | undefined;
321
+ }, {
322
+ config: {
323
+ type: "FUZZY" | "EXACT" | "RANGE" | "ANY_OF";
324
+ };
325
+ fieldId: "status" | "trackingId";
326
+ fieldType: "event";
327
+ options?: {
328
+ value: string;
329
+ label: {
330
+ id: string;
331
+ description: string;
332
+ defaultMessage: string;
333
+ };
334
+ }[] | undefined;
335
+ }>]>, "many">;
29
336
  }, "strip", z.ZodTypeAny, {
30
337
  title: TranslationConfig;
31
- fields: {
338
+ fields: ({
339
+ config: {
340
+ type: "FUZZY" | "EXACT" | "RANGE" | "ANY_OF";
341
+ };
32
342
  fieldId: string;
33
- config?: {
34
- type: "FUZZY" | "EXACT" | "RANGE";
35
- } | undefined;
36
- }[];
343
+ fieldType: "field";
344
+ options?: {
345
+ value: string;
346
+ label: TranslationConfig;
347
+ }[] | undefined;
348
+ } | {
349
+ config: {
350
+ type: "FUZZY" | "EXACT" | "RANGE" | "ANY_OF";
351
+ };
352
+ fieldId: "status" | "trackingId";
353
+ fieldType: "event";
354
+ options?: {
355
+ value: string;
356
+ label: TranslationConfig;
357
+ }[] | undefined;
358
+ })[];
37
359
  }, {
38
360
  title: {
39
361
  id: string;
40
362
  description: string;
41
363
  defaultMessage: string;
42
364
  };
43
- fields?: {
365
+ fields: ({
366
+ config: {
367
+ type: "FUZZY" | "EXACT" | "RANGE" | "ANY_OF";
368
+ };
44
369
  fieldId: string;
45
- config?: {
46
- type: "FUZZY" | "EXACT" | "RANGE";
47
- } | undefined;
48
- }[] | undefined;
370
+ fieldType: "field";
371
+ options?: {
372
+ value: string;
373
+ label: {
374
+ id: string;
375
+ description: string;
376
+ defaultMessage: string;
377
+ };
378
+ }[] | undefined;
379
+ } | {
380
+ config: {
381
+ type: "FUZZY" | "EXACT" | "RANGE" | "ANY_OF";
382
+ };
383
+ fieldId: "status" | "trackingId";
384
+ fieldType: "event";
385
+ options?: {
386
+ value: string;
387
+ label: {
388
+ id: string;
389
+ description: string;
390
+ defaultMessage: string;
391
+ };
392
+ }[] | undefined;
393
+ })[];
49
394
  }>;
395
+ export type AdvancedSearchConfigInput = z.infer<typeof AdvancedSearchConfig>;
50
396
  export type AdvancedSearchConfig = z.infer<typeof AdvancedSearchConfig>;
51
397
  //# sourceMappingURL=AdvancedSearchConfig.d.ts.map