@opencrvs/toolkit 1.8.0-rc.faacbde → 1.8.0-rc.facf9d6

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 (44) hide show
  1. package/dist/commons/api/router.d.ts +12657 -13930
  2. package/dist/commons/conditionals/conditionals.d.ts +25 -6
  3. package/dist/commons/conditionals/validate.d.ts +12 -17
  4. package/dist/commons/events/ActionConfig.d.ts +94298 -1733
  5. package/dist/commons/events/ActionDocument.d.ts +7848 -230
  6. package/dist/commons/events/ActionInput.d.ts +1417 -388
  7. package/dist/commons/events/ActionType.d.ts +6 -3
  8. package/dist/commons/events/AdvancedSearchConfig.d.ts +957 -22
  9. package/dist/commons/events/CompositeFieldValue.d.ts +3 -0
  10. package/dist/commons/events/Conditional.d.ts +21 -5
  11. package/dist/commons/events/Constants.d.ts +2 -0
  12. package/dist/commons/events/CountryConfigQueryInput.d.ts +2982 -0
  13. package/dist/commons/events/CreatedAtLocation.d.ts +3 -0
  14. package/dist/commons/events/Draft.d.ts +62 -28
  15. package/dist/commons/events/EventConfig.d.ts +42895 -1350
  16. package/dist/commons/events/EventDocument.d.ts +950 -254
  17. package/dist/commons/events/EventIndex.d.ts +1342 -13
  18. package/dist/commons/events/EventMetadata.d.ts +300 -11
  19. package/dist/commons/events/FieldConfig.d.ts +4549 -802
  20. package/dist/commons/events/FieldType.d.ts +3 -3
  21. package/dist/commons/events/FieldTypeMapping.d.ts +16 -6
  22. package/dist/commons/events/FieldValue.d.ts +9 -4
  23. package/dist/commons/events/FormConfig.d.ts +43951 -439
  24. package/dist/commons/events/PageConfig.d.ts +10954 -234
  25. package/dist/commons/events/SummaryConfig.d.ts +95 -39
  26. package/dist/commons/events/TemplateConfig.d.ts +5 -5
  27. package/dist/commons/events/User.d.ts +31 -2
  28. package/dist/commons/events/WorkqueueColumnConfig.d.ts +53 -0
  29. package/dist/commons/events/WorkqueueConfig.d.ts +4525 -20
  30. package/dist/commons/events/defineConfig.d.ts +6600 -66
  31. package/dist/commons/events/event.d.ts +54 -0
  32. package/dist/commons/events/field.d.ts +73 -0
  33. package/dist/commons/events/index.d.ts +7 -0
  34. package/dist/commons/events/scopes.d.ts +45 -0
  35. package/dist/commons/events/serializer.d.ts +2 -0
  36. package/dist/commons/events/test.utils.d.ts +52 -160
  37. package/dist/commons/events/utils.d.ts +3726 -39
  38. package/dist/commons/events/utils.test.d.ts +2 -0
  39. package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
  40. package/dist/conditionals/index.js +197 -144
  41. package/dist/events/index.js +4233 -2017
  42. package/dist/scopes/index.d.ts +158 -1
  43. package/dist/scopes/index.js +152 -1
  44. package/package.json +3 -2
@@ -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,143 @@ 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.ZodOptional<z.ZodNullable<z.ZodString>>;
42
+ acceptedAt: z.ZodString;
43
+ createdByRole: z.ZodString;
44
+ createdBySignature: z.ZodOptional<z.ZodNullable<z.ZodString>>;
45
+ }, "strip", z.ZodTypeAny, {
46
+ createdAt: string;
47
+ createdBy: string;
48
+ createdByRole: string;
49
+ acceptedAt: string;
50
+ createdBySignature?: string | null | undefined;
51
+ createdAtLocation?: string | null | undefined;
52
+ }, {
53
+ createdAt: string;
54
+ createdBy: string;
55
+ createdByRole: string;
56
+ acceptedAt: string;
57
+ createdBySignature?: string | null | undefined;
58
+ createdAtLocation?: string | null | undefined;
59
+ }>;
60
+ export type ActionCreationMetadata = z.infer<typeof ActionCreationMetadata>;
61
+ export declare const RegistrationCreationMetadata: z.ZodObject<z.objectUtil.extendShape<{
62
+ createdAt: z.ZodString;
63
+ createdBy: z.ZodString;
64
+ createdAtLocation: z.ZodOptional<z.ZodNullable<z.ZodString>>;
65
+ acceptedAt: z.ZodString;
66
+ createdByRole: z.ZodString;
67
+ createdBySignature: z.ZodOptional<z.ZodNullable<z.ZodString>>;
68
+ }, {
69
+ registrationNumber: z.ZodString;
70
+ }>, "strip", z.ZodTypeAny, {
71
+ createdAt: string;
72
+ createdBy: string;
73
+ createdByRole: string;
74
+ registrationNumber: string;
75
+ acceptedAt: string;
76
+ createdBySignature?: string | null | undefined;
77
+ createdAtLocation?: string | null | undefined;
78
+ }, {
79
+ createdAt: string;
80
+ createdBy: string;
81
+ createdByRole: string;
82
+ registrationNumber: string;
83
+ acceptedAt: string;
84
+ createdBySignature?: string | null | undefined;
85
+ createdAtLocation?: string | null | undefined;
86
+ }>;
87
+ export type RegistrationCreationMetadata = z.infer<typeof RegistrationCreationMetadata>;
88
+ export declare const LegalStatuses: z.ZodObject<{
89
+ DECLARED: z.ZodOptional<z.ZodNullable<z.ZodObject<{
90
+ createdAt: z.ZodString;
91
+ createdBy: z.ZodString;
92
+ createdAtLocation: z.ZodOptional<z.ZodNullable<z.ZodString>>;
93
+ acceptedAt: z.ZodString;
94
+ createdByRole: z.ZodString;
95
+ createdBySignature: z.ZodOptional<z.ZodNullable<z.ZodString>>;
96
+ }, "strip", z.ZodTypeAny, {
97
+ createdAt: string;
98
+ createdBy: string;
99
+ createdByRole: string;
100
+ acceptedAt: string;
101
+ createdBySignature?: string | null | undefined;
102
+ createdAtLocation?: string | null | undefined;
103
+ }, {
104
+ createdAt: string;
105
+ createdBy: string;
106
+ createdByRole: string;
107
+ acceptedAt: string;
108
+ createdBySignature?: string | null | undefined;
109
+ createdAtLocation?: string | null | undefined;
110
+ }>>>;
111
+ REGISTERED: z.ZodOptional<z.ZodNullable<z.ZodObject<z.objectUtil.extendShape<{
112
+ createdAt: z.ZodString;
113
+ createdBy: z.ZodString;
114
+ createdAtLocation: z.ZodOptional<z.ZodNullable<z.ZodString>>;
115
+ acceptedAt: z.ZodString;
116
+ createdByRole: z.ZodString;
117
+ createdBySignature: z.ZodOptional<z.ZodNullable<z.ZodString>>;
118
+ }, {
119
+ registrationNumber: z.ZodString;
120
+ }>, "strip", z.ZodTypeAny, {
121
+ createdAt: string;
122
+ createdBy: string;
123
+ createdByRole: string;
124
+ registrationNumber: string;
125
+ acceptedAt: string;
126
+ createdBySignature?: string | null | undefined;
127
+ createdAtLocation?: string | null | undefined;
128
+ }, {
129
+ createdAt: string;
130
+ createdBy: string;
131
+ createdByRole: string;
132
+ registrationNumber: string;
133
+ acceptedAt: string;
134
+ createdBySignature?: string | null | undefined;
135
+ createdAtLocation?: string | null | undefined;
136
+ }>>>;
137
+ }, "strip", z.ZodTypeAny, {
138
+ DECLARED?: {
139
+ createdAt: string;
140
+ createdBy: string;
141
+ createdByRole: string;
142
+ acceptedAt: string;
143
+ createdBySignature?: string | null | undefined;
144
+ createdAtLocation?: string | null | undefined;
145
+ } | null | undefined;
146
+ REGISTERED?: {
147
+ createdAt: string;
148
+ createdBy: string;
149
+ createdByRole: string;
150
+ registrationNumber: string;
151
+ acceptedAt: string;
152
+ createdBySignature?: string | null | undefined;
153
+ createdAtLocation?: string | null | undefined;
154
+ } | null | undefined;
155
+ }, {
156
+ DECLARED?: {
157
+ createdAt: string;
158
+ createdBy: string;
159
+ createdByRole: string;
160
+ acceptedAt: string;
161
+ createdBySignature?: string | null | undefined;
162
+ createdAtLocation?: string | null | undefined;
163
+ } | null | undefined;
164
+ REGISTERED?: {
165
+ createdAt: string;
166
+ createdBy: string;
167
+ createdByRole: string;
168
+ registrationNumber: string;
169
+ acceptedAt: string;
170
+ createdBySignature?: string | null | undefined;
171
+ createdAtLocation?: string | null | undefined;
172
+ } | null | undefined;
173
+ }>;
28
174
  /**
29
175
  * Event metadata exposed to client.
30
176
  *
@@ -43,42 +189,185 @@ export declare const EventMetadata: z.ZodObject<{
43
189
  readonly REJECTED: "REJECTED";
44
190
  readonly ARCHIVED: "ARCHIVED";
45
191
  }>;
192
+ legalStatuses: z.ZodObject<{
193
+ DECLARED: z.ZodOptional<z.ZodNullable<z.ZodObject<{
194
+ createdAt: z.ZodString;
195
+ createdBy: z.ZodString;
196
+ createdAtLocation: z.ZodOptional<z.ZodNullable<z.ZodString>>;
197
+ acceptedAt: z.ZodString;
198
+ createdByRole: z.ZodString;
199
+ createdBySignature: z.ZodOptional<z.ZodNullable<z.ZodString>>;
200
+ }, "strip", z.ZodTypeAny, {
201
+ createdAt: string;
202
+ createdBy: string;
203
+ createdByRole: string;
204
+ acceptedAt: string;
205
+ createdBySignature?: string | null | undefined;
206
+ createdAtLocation?: string | null | undefined;
207
+ }, {
208
+ createdAt: string;
209
+ createdBy: string;
210
+ createdByRole: string;
211
+ acceptedAt: string;
212
+ createdBySignature?: string | null | undefined;
213
+ createdAtLocation?: string | null | undefined;
214
+ }>>>;
215
+ REGISTERED: z.ZodOptional<z.ZodNullable<z.ZodObject<z.objectUtil.extendShape<{
216
+ createdAt: z.ZodString;
217
+ createdBy: z.ZodString;
218
+ createdAtLocation: z.ZodOptional<z.ZodNullable<z.ZodString>>;
219
+ acceptedAt: z.ZodString;
220
+ createdByRole: z.ZodString;
221
+ createdBySignature: z.ZodOptional<z.ZodNullable<z.ZodString>>;
222
+ }, {
223
+ registrationNumber: z.ZodString;
224
+ }>, "strip", z.ZodTypeAny, {
225
+ createdAt: string;
226
+ createdBy: string;
227
+ createdByRole: string;
228
+ registrationNumber: string;
229
+ acceptedAt: string;
230
+ createdBySignature?: string | null | undefined;
231
+ createdAtLocation?: string | null | undefined;
232
+ }, {
233
+ createdAt: string;
234
+ createdBy: string;
235
+ createdByRole: string;
236
+ registrationNumber: string;
237
+ acceptedAt: string;
238
+ createdBySignature?: string | null | undefined;
239
+ createdAtLocation?: string | null | undefined;
240
+ }>>>;
241
+ }, "strip", z.ZodTypeAny, {
242
+ DECLARED?: {
243
+ createdAt: string;
244
+ createdBy: string;
245
+ createdByRole: string;
246
+ acceptedAt: string;
247
+ createdBySignature?: string | null | undefined;
248
+ createdAtLocation?: string | null | undefined;
249
+ } | null | undefined;
250
+ REGISTERED?: {
251
+ createdAt: string;
252
+ createdBy: string;
253
+ createdByRole: string;
254
+ registrationNumber: string;
255
+ acceptedAt: string;
256
+ createdBySignature?: string | null | undefined;
257
+ createdAtLocation?: string | null | undefined;
258
+ } | null | undefined;
259
+ }, {
260
+ DECLARED?: {
261
+ createdAt: string;
262
+ createdBy: string;
263
+ createdByRole: string;
264
+ acceptedAt: string;
265
+ createdBySignature?: string | null | undefined;
266
+ createdAtLocation?: string | null | undefined;
267
+ } | null | undefined;
268
+ REGISTERED?: {
269
+ createdAt: string;
270
+ createdBy: string;
271
+ createdByRole: string;
272
+ registrationNumber: string;
273
+ acceptedAt: string;
274
+ createdBySignature?: string | null | undefined;
275
+ createdAtLocation?: string | null | undefined;
276
+ } | null | undefined;
277
+ }>;
46
278
  createdAt: z.ZodString;
279
+ dateOfEvent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
47
280
  createdBy: z.ZodString;
48
- createdAtLocation: z.ZodString;
49
- modifiedAt: z.ZodString;
281
+ updatedByUserRole: z.ZodString;
282
+ createdAtLocation: z.ZodOptional<z.ZodNullable<z.ZodString>>;
283
+ createdBySignature: z.ZodOptional<z.ZodNullable<z.ZodString>>;
284
+ updatedAtLocation: z.ZodOptional<z.ZodNullable<z.ZodString>>;
285
+ updatedAt: z.ZodString;
50
286
  assignedTo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
51
- updatedBy: z.ZodString;
287
+ updatedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
52
288
  trackingId: z.ZodString;
289
+ flags: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNativeEnum<{
290
+ readonly CERTIFICATE_PRINTED: "certificate-printed";
291
+ }>]>, "many">;
53
292
  }, "strip", z.ZodTypeAny, {
54
293
  type: string;
55
294
  id: string;
56
295
  status: "ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED";
57
296
  createdAt: string;
58
297
  createdBy: string;
59
- createdAtLocation: string;
298
+ updatedAt: string;
60
299
  trackingId: string;
61
- modifiedAt: string;
62
- updatedBy: string;
300
+ legalStatuses: {
301
+ DECLARED?: {
302
+ createdAt: string;
303
+ createdBy: string;
304
+ createdByRole: string;
305
+ acceptedAt: string;
306
+ createdBySignature?: string | null | undefined;
307
+ createdAtLocation?: string | null | undefined;
308
+ } | null | undefined;
309
+ REGISTERED?: {
310
+ createdAt: string;
311
+ createdBy: string;
312
+ createdByRole: string;
313
+ registrationNumber: string;
314
+ acceptedAt: string;
315
+ createdBySignature?: string | null | undefined;
316
+ createdAtLocation?: string | null | undefined;
317
+ } | null | undefined;
318
+ };
319
+ updatedByUserRole: string;
320
+ flags: string[];
321
+ createdBySignature?: string | null | undefined;
322
+ createdAtLocation?: string | null | undefined;
63
323
  assignedTo?: string | null | undefined;
324
+ dateOfEvent?: string | null | undefined;
325
+ updatedAtLocation?: string | null | undefined;
326
+ updatedBy?: string | null | undefined;
64
327
  }, {
65
328
  type: string;
66
329
  id: string;
67
330
  status: "ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED";
68
331
  createdAt: string;
69
332
  createdBy: string;
70
- createdAtLocation: string;
333
+ updatedAt: string;
71
334
  trackingId: string;
72
- modifiedAt: string;
73
- updatedBy: string;
335
+ legalStatuses: {
336
+ DECLARED?: {
337
+ createdAt: string;
338
+ createdBy: string;
339
+ createdByRole: string;
340
+ acceptedAt: string;
341
+ createdBySignature?: string | null | undefined;
342
+ createdAtLocation?: string | null | undefined;
343
+ } | null | undefined;
344
+ REGISTERED?: {
345
+ createdAt: string;
346
+ createdBy: string;
347
+ createdByRole: string;
348
+ registrationNumber: string;
349
+ acceptedAt: string;
350
+ createdBySignature?: string | null | undefined;
351
+ createdAtLocation?: string | null | undefined;
352
+ } | null | undefined;
353
+ };
354
+ updatedByUserRole: string;
355
+ flags: string[];
356
+ createdBySignature?: string | null | undefined;
357
+ createdAtLocation?: string | null | undefined;
74
358
  assignedTo?: string | null | undefined;
359
+ dateOfEvent?: string | null | undefined;
360
+ updatedAtLocation?: string | null | undefined;
361
+ updatedBy?: string | null | undefined;
75
362
  }>;
76
363
  export type EventMetadata = z.infer<typeof EventMetadata>;
77
- export type EventMetadataKeys = `event.${keyof EventMetadata}`;
364
+ export declare const EventMetadataKeysArray: readonly ["id", "type", "status", "createdAt", "dateOfEvent", "createdBy", "updatedByUserRole", "createdAtLocation", "updatedAtLocation", "updatedAt", "assignedTo", "updatedBy", "trackingId", "legalStatuses", "flags"];
365
+ export declare const EventMetadataKeys: z.ZodEnum<["id", "type", "status", "createdAt", "dateOfEvent", "createdBy", "updatedByUserRole", "createdAtLocation", "updatedAtLocation", "updatedAt", "assignedTo", "updatedBy", "trackingId", "legalStatuses", "flags"]>;
366
+ export type EventMetadataKeys = z.infer<typeof EventMetadataKeys>;
78
367
  /**
79
368
  * Mapping of event metadata keys to translation configuration.
80
369
  * Consider introducing type in same manner as we have in FieldConfig.
81
370
  * We need a way to know how to parse it.
82
371
  */
83
- export declare const eventMetadataLabelMap: Record<EventMetadataKeys, TranslationConfig>;
372
+ export declare const eventMetadataLabelMap: Record<Exclude<`event.${EventMetadataKeys}`, 'event.legalStatuses'>, TranslationConfig>;
84
373
  //# sourceMappingURL=EventMetadata.d.ts.map