@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
@@ -2,12 +2,25 @@ import { z } from 'zod';
2
2
  export declare const EventInput: z.ZodObject<{
3
3
  transactionId: z.ZodString;
4
4
  type: z.ZodString;
5
+ dateOfEvent: z.ZodOptional<z.ZodObject<{
6
+ fieldId: z.ZodString;
7
+ }, "strip", z.ZodTypeAny, {
8
+ fieldId: string;
9
+ }, {
10
+ fieldId: string;
11
+ }>>;
5
12
  }, "strip", z.ZodTypeAny, {
6
13
  type: string;
7
14
  transactionId: string;
15
+ dateOfEvent?: {
16
+ fieldId: string;
17
+ } | undefined;
8
18
  }, {
9
19
  type: string;
10
20
  transactionId: string;
21
+ dateOfEvent?: {
22
+ fieldId: string;
23
+ } | undefined;
11
24
  }>;
12
25
  export type EventInput = z.infer<typeof EventInput>;
13
26
  //# sourceMappingURL=EventInput.d.ts.map
@@ -14,6 +14,15 @@ export declare const EventStatus: {
14
14
  readonly ARCHIVED: "ARCHIVED";
15
15
  };
16
16
  export type EventStatus = (typeof EventStatus)[keyof typeof EventStatus];
17
+ export declare const EventStatusEnum: z.ZodEnum<["CREATED", "NOTIFIED", "DECLARED", "VALIDATED", "REGISTERED", "CERTIFIED", "REJECTED", "ARCHIVED"]>;
18
+ export declare const CustomFlags: {
19
+ readonly CERTIFICATE_PRINTED: "certificate-printed";
20
+ };
21
+ export type CustomFlags = (typeof CustomFlags)[keyof typeof CustomFlags];
22
+ export declare const Flag: z.ZodUnion<[z.ZodString, z.ZodNativeEnum<{
23
+ readonly CERTIFICATE_PRINTED: "certificate-printed";
24
+ }>]>;
25
+ export type Flag = z.infer<typeof Flag>;
17
26
  export declare const eventStatuses: ("ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED")[];
18
27
  export declare const EventStatuses: z.ZodNativeEnum<{
19
28
  readonly CREATED: "CREATED";
@@ -25,6 +34,127 @@ export declare const EventStatuses: z.ZodNativeEnum<{
25
34
  readonly REJECTED: "REJECTED";
26
35
  readonly ARCHIVED: "ARCHIVED";
27
36
  }>;
37
+ export declare const ZodDate: z.ZodString;
38
+ export declare const ActionCreationMetadata: z.ZodObject<{
39
+ createdAt: z.ZodString;
40
+ createdBy: z.ZodString;
41
+ createdAtLocation: z.ZodString;
42
+ acceptedAt: z.ZodString;
43
+ createdByRole: z.ZodString;
44
+ }, "strip", z.ZodTypeAny, {
45
+ createdAt: string;
46
+ createdBy: string;
47
+ createdByRole: string;
48
+ createdAtLocation: string;
49
+ acceptedAt: string;
50
+ }, {
51
+ createdAt: string;
52
+ createdBy: string;
53
+ createdByRole: string;
54
+ createdAtLocation: string;
55
+ acceptedAt: string;
56
+ }>;
57
+ export type ActionCreationMetadata = z.infer<typeof ActionCreationMetadata>;
58
+ export declare const RegistrationCreationMetadata: z.ZodObject<z.objectUtil.extendShape<{
59
+ createdAt: z.ZodString;
60
+ createdBy: z.ZodString;
61
+ createdAtLocation: z.ZodString;
62
+ acceptedAt: z.ZodString;
63
+ createdByRole: z.ZodString;
64
+ }, {
65
+ registrationNumber: z.ZodString;
66
+ }>, "strip", z.ZodTypeAny, {
67
+ createdAt: string;
68
+ createdBy: string;
69
+ createdByRole: string;
70
+ createdAtLocation: string;
71
+ registrationNumber: string;
72
+ acceptedAt: string;
73
+ }, {
74
+ createdAt: string;
75
+ createdBy: string;
76
+ createdByRole: string;
77
+ createdAtLocation: string;
78
+ registrationNumber: string;
79
+ acceptedAt: string;
80
+ }>;
81
+ export type RegistrationCreationMetadata = z.infer<typeof RegistrationCreationMetadata>;
82
+ export declare const LegalStatuses: z.ZodObject<{
83
+ DECLARED: z.ZodOptional<z.ZodNullable<z.ZodObject<{
84
+ createdAt: z.ZodString;
85
+ createdBy: z.ZodString;
86
+ createdAtLocation: z.ZodString;
87
+ acceptedAt: z.ZodString;
88
+ createdByRole: z.ZodString;
89
+ }, "strip", z.ZodTypeAny, {
90
+ createdAt: string;
91
+ createdBy: string;
92
+ createdByRole: string;
93
+ createdAtLocation: string;
94
+ acceptedAt: string;
95
+ }, {
96
+ createdAt: string;
97
+ createdBy: string;
98
+ createdByRole: string;
99
+ createdAtLocation: string;
100
+ acceptedAt: string;
101
+ }>>>;
102
+ REGISTERED: z.ZodOptional<z.ZodNullable<z.ZodObject<z.objectUtil.extendShape<{
103
+ createdAt: z.ZodString;
104
+ createdBy: z.ZodString;
105
+ createdAtLocation: z.ZodString;
106
+ acceptedAt: z.ZodString;
107
+ createdByRole: z.ZodString;
108
+ }, {
109
+ registrationNumber: z.ZodString;
110
+ }>, "strip", z.ZodTypeAny, {
111
+ createdAt: string;
112
+ createdBy: string;
113
+ createdByRole: string;
114
+ createdAtLocation: string;
115
+ registrationNumber: string;
116
+ acceptedAt: string;
117
+ }, {
118
+ createdAt: string;
119
+ createdBy: string;
120
+ createdByRole: string;
121
+ createdAtLocation: string;
122
+ registrationNumber: string;
123
+ acceptedAt: string;
124
+ }>>>;
125
+ }, "strip", z.ZodTypeAny, {
126
+ DECLARED?: {
127
+ createdAt: string;
128
+ createdBy: string;
129
+ createdByRole: string;
130
+ createdAtLocation: string;
131
+ acceptedAt: string;
132
+ } | null | undefined;
133
+ REGISTERED?: {
134
+ createdAt: string;
135
+ createdBy: string;
136
+ createdByRole: string;
137
+ createdAtLocation: string;
138
+ registrationNumber: string;
139
+ acceptedAt: string;
140
+ } | null | undefined;
141
+ }, {
142
+ DECLARED?: {
143
+ createdAt: string;
144
+ createdBy: string;
145
+ createdByRole: string;
146
+ createdAtLocation: string;
147
+ acceptedAt: string;
148
+ } | null | undefined;
149
+ REGISTERED?: {
150
+ createdAt: string;
151
+ createdBy: string;
152
+ createdByRole: string;
153
+ createdAtLocation: string;
154
+ registrationNumber: string;
155
+ acceptedAt: string;
156
+ } | null | undefined;
157
+ }>;
28
158
  /**
29
159
  * Event metadata exposed to client.
30
160
  *
@@ -43,13 +173,95 @@ export declare const EventMetadata: z.ZodObject<{
43
173
  readonly REJECTED: "REJECTED";
44
174
  readonly ARCHIVED: "ARCHIVED";
45
175
  }>;
176
+ legalStatuses: z.ZodObject<{
177
+ DECLARED: z.ZodOptional<z.ZodNullable<z.ZodObject<{
178
+ createdAt: z.ZodString;
179
+ createdBy: z.ZodString;
180
+ createdAtLocation: z.ZodString;
181
+ acceptedAt: z.ZodString;
182
+ createdByRole: z.ZodString;
183
+ }, "strip", z.ZodTypeAny, {
184
+ createdAt: string;
185
+ createdBy: string;
186
+ createdByRole: string;
187
+ createdAtLocation: string;
188
+ acceptedAt: string;
189
+ }, {
190
+ createdAt: string;
191
+ createdBy: string;
192
+ createdByRole: string;
193
+ createdAtLocation: string;
194
+ acceptedAt: string;
195
+ }>>>;
196
+ REGISTERED: z.ZodOptional<z.ZodNullable<z.ZodObject<z.objectUtil.extendShape<{
197
+ createdAt: z.ZodString;
198
+ createdBy: z.ZodString;
199
+ createdAtLocation: z.ZodString;
200
+ acceptedAt: z.ZodString;
201
+ createdByRole: z.ZodString;
202
+ }, {
203
+ registrationNumber: z.ZodString;
204
+ }>, "strip", z.ZodTypeAny, {
205
+ createdAt: string;
206
+ createdBy: string;
207
+ createdByRole: string;
208
+ createdAtLocation: string;
209
+ registrationNumber: string;
210
+ acceptedAt: string;
211
+ }, {
212
+ createdAt: string;
213
+ createdBy: string;
214
+ createdByRole: string;
215
+ createdAtLocation: string;
216
+ registrationNumber: string;
217
+ acceptedAt: string;
218
+ }>>>;
219
+ }, "strip", z.ZodTypeAny, {
220
+ DECLARED?: {
221
+ createdAt: string;
222
+ createdBy: string;
223
+ createdByRole: string;
224
+ createdAtLocation: string;
225
+ acceptedAt: string;
226
+ } | null | undefined;
227
+ REGISTERED?: {
228
+ createdAt: string;
229
+ createdBy: string;
230
+ createdByRole: string;
231
+ createdAtLocation: string;
232
+ registrationNumber: string;
233
+ acceptedAt: string;
234
+ } | null | undefined;
235
+ }, {
236
+ DECLARED?: {
237
+ createdAt: string;
238
+ createdBy: string;
239
+ createdByRole: string;
240
+ createdAtLocation: string;
241
+ acceptedAt: string;
242
+ } | null | undefined;
243
+ REGISTERED?: {
244
+ createdAt: string;
245
+ createdBy: string;
246
+ createdByRole: string;
247
+ createdAtLocation: string;
248
+ registrationNumber: string;
249
+ acceptedAt: string;
250
+ } | null | undefined;
251
+ }>;
46
252
  createdAt: z.ZodString;
253
+ dateOfEvent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
47
254
  createdBy: z.ZodString;
255
+ updatedByUserRole: z.ZodString;
48
256
  createdAtLocation: z.ZodString;
49
- modifiedAt: z.ZodString;
257
+ updatedAtLocation: z.ZodOptional<z.ZodNullable<z.ZodString>>;
258
+ updatedAt: z.ZodString;
50
259
  assignedTo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
51
- updatedBy: z.ZodString;
260
+ updatedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
52
261
  trackingId: z.ZodString;
262
+ flags: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNativeEnum<{
263
+ readonly CERTIFICATE_PRINTED: "certificate-printed";
264
+ }>]>, "many">;
53
265
  }, "strip", z.ZodTypeAny, {
54
266
  type: string;
55
267
  id: string;
@@ -57,10 +269,31 @@ export declare const EventMetadata: z.ZodObject<{
57
269
  createdAt: string;
58
270
  createdBy: string;
59
271
  createdAtLocation: string;
272
+ updatedAt: string;
60
273
  trackingId: string;
61
- modifiedAt: string;
62
- updatedBy: string;
274
+ legalStatuses: {
275
+ DECLARED?: {
276
+ createdAt: string;
277
+ createdBy: string;
278
+ createdByRole: string;
279
+ createdAtLocation: string;
280
+ acceptedAt: string;
281
+ } | null | undefined;
282
+ REGISTERED?: {
283
+ createdAt: string;
284
+ createdBy: string;
285
+ createdByRole: string;
286
+ createdAtLocation: string;
287
+ registrationNumber: string;
288
+ acceptedAt: string;
289
+ } | null | undefined;
290
+ };
291
+ updatedByUserRole: string;
292
+ flags: string[];
63
293
  assignedTo?: string | null | undefined;
294
+ dateOfEvent?: string | null | undefined;
295
+ updatedAtLocation?: string | null | undefined;
296
+ updatedBy?: string | null | undefined;
64
297
  }, {
65
298
  type: string;
66
299
  id: string;
@@ -68,17 +301,50 @@ export declare const EventMetadata: z.ZodObject<{
68
301
  createdAt: string;
69
302
  createdBy: string;
70
303
  createdAtLocation: string;
304
+ updatedAt: string;
71
305
  trackingId: string;
72
- modifiedAt: string;
73
- updatedBy: string;
306
+ legalStatuses: {
307
+ DECLARED?: {
308
+ createdAt: string;
309
+ createdBy: string;
310
+ createdByRole: string;
311
+ createdAtLocation: string;
312
+ acceptedAt: string;
313
+ } | null | undefined;
314
+ REGISTERED?: {
315
+ createdAt: string;
316
+ createdBy: string;
317
+ createdByRole: string;
318
+ createdAtLocation: string;
319
+ registrationNumber: string;
320
+ acceptedAt: string;
321
+ } | null | undefined;
322
+ };
323
+ updatedByUserRole: string;
324
+ flags: string[];
74
325
  assignedTo?: string | null | undefined;
326
+ dateOfEvent?: string | null | undefined;
327
+ updatedAtLocation?: string | null | undefined;
328
+ updatedBy?: string | null | undefined;
75
329
  }>;
76
330
  export type EventMetadata = z.infer<typeof EventMetadata>;
77
- export type EventMetadataKeys = `event.${keyof EventMetadata}`;
331
+ export declare const EventMetadataKeys: z.ZodEnum<["id", "type", "status", "createdAt", "dateOfEvent", "createdBy", "updatedByUserRole", "createdAtLocation", "updatedAtLocation", "updatedAt", "assignedTo", "updatedBy", "trackingId", "legalStatuses", "flags"]>;
332
+ export type EventMetadataKeys = z.infer<typeof EventMetadataKeys>;
333
+ /**
334
+ * This ensures `event.field()` takes a key from `EventMetadata`
335
+ */
336
+ export declare const EventMetadataParameter: z.ZodObject<{
337
+ $event: z.ZodEnum<["id", "type", "status", "createdAt", "dateOfEvent", "createdBy", "updatedByUserRole", "createdAtLocation", "updatedAtLocation", "updatedAt", "assignedTo", "updatedBy", "trackingId", "legalStatuses", "flags"]>;
338
+ }, "strip", z.ZodTypeAny, {
339
+ $event: "type" | "id" | "status" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "dateOfEvent" | "updatedAt" | "trackingId" | "legalStatuses" | "updatedByUserRole" | "updatedAtLocation" | "updatedBy" | "flags";
340
+ }, {
341
+ $event: "type" | "id" | "status" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "dateOfEvent" | "updatedAt" | "trackingId" | "legalStatuses" | "updatedByUserRole" | "updatedAtLocation" | "updatedBy" | "flags";
342
+ }>;
343
+ export type EventMetadataParameter = z.infer<typeof EventMetadataParameter>;
78
344
  /**
79
345
  * Mapping of event metadata keys to translation configuration.
80
346
  * Consider introducing type in same manner as we have in FieldConfig.
81
347
  * We need a way to know how to parse it.
82
348
  */
83
- export declare const eventMetadataLabelMap: Record<EventMetadataKeys, TranslationConfig>;
349
+ export declare const eventMetadataLabelMap: Record<Exclude<`event.${EventMetadataKeys}`, 'event.legalStatuses'>, TranslationConfig>;
84
350
  //# sourceMappingURL=EventMetadata.d.ts.map