@opencrvs/toolkit 1.8.0-rc.fca3e39 → 1.8.0-rc.fcb9386

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 (46) hide show
  1. package/README.md +1 -1
  2. package/dist/commons/api/router.d.ts +12639 -14167
  3. package/dist/commons/conditionals/conditionals.d.ts +32 -6
  4. package/dist/commons/conditionals/validate.d.ts +12 -17
  5. package/dist/commons/events/ActionConfig.d.ts +92869 -2005
  6. package/dist/commons/events/ActionDocument.d.ts +8019 -401
  7. package/dist/commons/events/ActionInput.d.ts +2365 -548
  8. package/dist/commons/events/ActionType.d.ts +26 -16
  9. package/dist/commons/events/AdvancedSearchConfig.d.ts +957 -22
  10. package/dist/commons/events/CompositeFieldValue.d.ts +3 -0
  11. package/dist/commons/events/Conditional.d.ts +21 -5
  12. package/dist/commons/events/Constants.d.ts +2 -0
  13. package/dist/commons/events/CountryConfigQueryInput.d.ts +2982 -0
  14. package/dist/commons/events/CreatedAtLocation.d.ts +3 -0
  15. package/dist/commons/events/Draft.d.ts +93 -60
  16. package/dist/commons/events/EventConfig.d.ts +42302 -1760
  17. package/dist/commons/events/EventConfigInput.d.ts +6 -3
  18. package/dist/commons/events/EventDocument.d.ts +1225 -529
  19. package/dist/commons/events/EventIndex.d.ts +1328 -13
  20. package/dist/commons/events/EventMetadata.d.ts +270 -11
  21. package/dist/commons/events/FieldConfig.d.ts +4704 -786
  22. package/dist/commons/events/FieldType.d.ts +4 -3
  23. package/dist/commons/events/FieldTypeMapping.d.ts +33 -5
  24. package/dist/commons/events/FieldValue.d.ts +12 -7
  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 +31 -2
  30. package/dist/commons/events/WorkqueueColumnConfig.d.ts +53 -0
  31. package/dist/commons/events/WorkqueueConfig.d.ts +4525 -20
  32. package/dist/commons/events/defineConfig.d.ts +6560 -223
  33. package/dist/commons/events/event.d.ts +54 -0
  34. package/dist/commons/events/field.d.ts +82 -0
  35. package/dist/commons/events/index.d.ts +9 -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 +93 -327
  39. package/dist/commons/events/utils.d.ts +3701 -96
  40. package/dist/commons/events/utils.test.d.ts +2 -0
  41. package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
  42. package/dist/conditionals/index.js +210 -122
  43. package/dist/events/index.js +4464 -1981
  44. package/dist/scopes/index.d.ts +158 -1
  45. package/dist/scopes/index.js +152 -1
  46. 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,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.ZodOptional<z.ZodNullable<z.ZodString>>;
42
+ acceptedAt: z.ZodString;
43
+ createdByRole: z.ZodString;
44
+ }, "strip", z.ZodTypeAny, {
45
+ createdAt: string;
46
+ createdBy: string;
47
+ createdByRole: string;
48
+ acceptedAt: string;
49
+ createdAtLocation?: string | null | undefined;
50
+ }, {
51
+ createdAt: string;
52
+ createdBy: string;
53
+ createdByRole: string;
54
+ acceptedAt: string;
55
+ createdAtLocation?: string | null | undefined;
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.ZodOptional<z.ZodNullable<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
+ registrationNumber: string;
71
+ acceptedAt: string;
72
+ createdAtLocation?: string | null | undefined;
73
+ }, {
74
+ createdAt: string;
75
+ createdBy: string;
76
+ createdByRole: string;
77
+ registrationNumber: string;
78
+ acceptedAt: string;
79
+ createdAtLocation?: string | null | undefined;
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.ZodOptional<z.ZodNullable<z.ZodString>>;
87
+ acceptedAt: z.ZodString;
88
+ createdByRole: z.ZodString;
89
+ }, "strip", z.ZodTypeAny, {
90
+ createdAt: string;
91
+ createdBy: string;
92
+ createdByRole: string;
93
+ acceptedAt: string;
94
+ createdAtLocation?: string | null | undefined;
95
+ }, {
96
+ createdAt: string;
97
+ createdBy: string;
98
+ createdByRole: string;
99
+ acceptedAt: string;
100
+ createdAtLocation?: string | null | undefined;
101
+ }>>>;
102
+ REGISTERED: z.ZodOptional<z.ZodNullable<z.ZodObject<z.objectUtil.extendShape<{
103
+ createdAt: z.ZodString;
104
+ createdBy: z.ZodString;
105
+ createdAtLocation: z.ZodOptional<z.ZodNullable<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
+ registrationNumber: string;
115
+ acceptedAt: string;
116
+ createdAtLocation?: string | null | undefined;
117
+ }, {
118
+ createdAt: string;
119
+ createdBy: string;
120
+ createdByRole: string;
121
+ registrationNumber: string;
122
+ acceptedAt: string;
123
+ createdAtLocation?: string | null | undefined;
124
+ }>>>;
125
+ }, "strip", z.ZodTypeAny, {
126
+ DECLARED?: {
127
+ createdAt: string;
128
+ createdBy: string;
129
+ createdByRole: string;
130
+ acceptedAt: string;
131
+ createdAtLocation?: string | null | undefined;
132
+ } | null | undefined;
133
+ REGISTERED?: {
134
+ createdAt: string;
135
+ createdBy: string;
136
+ createdByRole: string;
137
+ registrationNumber: string;
138
+ acceptedAt: string;
139
+ createdAtLocation?: string | null | undefined;
140
+ } | null | undefined;
141
+ }, {
142
+ DECLARED?: {
143
+ createdAt: string;
144
+ createdBy: string;
145
+ createdByRole: string;
146
+ acceptedAt: string;
147
+ createdAtLocation?: string | null | undefined;
148
+ } | null | undefined;
149
+ REGISTERED?: {
150
+ createdAt: string;
151
+ createdBy: string;
152
+ createdByRole: string;
153
+ registrationNumber: string;
154
+ acceptedAt: string;
155
+ createdAtLocation?: string | null | undefined;
156
+ } | null | undefined;
157
+ }>;
28
158
  /**
29
159
  * Event metadata exposed to client.
30
160
  *
@@ -43,42 +173,171 @@ 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.ZodOptional<z.ZodNullable<z.ZodString>>;
181
+ acceptedAt: z.ZodString;
182
+ createdByRole: z.ZodString;
183
+ }, "strip", z.ZodTypeAny, {
184
+ createdAt: string;
185
+ createdBy: string;
186
+ createdByRole: string;
187
+ acceptedAt: string;
188
+ createdAtLocation?: string | null | undefined;
189
+ }, {
190
+ createdAt: string;
191
+ createdBy: string;
192
+ createdByRole: string;
193
+ acceptedAt: string;
194
+ createdAtLocation?: string | null | undefined;
195
+ }>>>;
196
+ REGISTERED: z.ZodOptional<z.ZodNullable<z.ZodObject<z.objectUtil.extendShape<{
197
+ createdAt: z.ZodString;
198
+ createdBy: z.ZodString;
199
+ createdAtLocation: z.ZodOptional<z.ZodNullable<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
+ registrationNumber: string;
209
+ acceptedAt: string;
210
+ createdAtLocation?: string | null | undefined;
211
+ }, {
212
+ createdAt: string;
213
+ createdBy: string;
214
+ createdByRole: string;
215
+ registrationNumber: string;
216
+ acceptedAt: string;
217
+ createdAtLocation?: string | null | undefined;
218
+ }>>>;
219
+ }, "strip", z.ZodTypeAny, {
220
+ DECLARED?: {
221
+ createdAt: string;
222
+ createdBy: string;
223
+ createdByRole: string;
224
+ acceptedAt: string;
225
+ createdAtLocation?: string | null | undefined;
226
+ } | null | undefined;
227
+ REGISTERED?: {
228
+ createdAt: string;
229
+ createdBy: string;
230
+ createdByRole: string;
231
+ registrationNumber: string;
232
+ acceptedAt: string;
233
+ createdAtLocation?: string | null | undefined;
234
+ } | null | undefined;
235
+ }, {
236
+ DECLARED?: {
237
+ createdAt: string;
238
+ createdBy: string;
239
+ createdByRole: string;
240
+ acceptedAt: string;
241
+ createdAtLocation?: string | null | undefined;
242
+ } | null | undefined;
243
+ REGISTERED?: {
244
+ createdAt: string;
245
+ createdBy: string;
246
+ createdByRole: string;
247
+ registrationNumber: string;
248
+ acceptedAt: string;
249
+ createdAtLocation?: string | null | undefined;
250
+ } | null | undefined;
251
+ }>;
46
252
  createdAt: z.ZodString;
253
+ dateOfEvent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
47
254
  createdBy: z.ZodString;
48
- createdAtLocation: z.ZodString;
49
- modifiedAt: z.ZodString;
255
+ updatedByUserRole: z.ZodString;
256
+ createdAtLocation: z.ZodOptional<z.ZodNullable<z.ZodString>>;
257
+ createdBySignature: z.ZodOptional<z.ZodNullable<z.ZodString>>;
258
+ updatedAtLocation: z.ZodOptional<z.ZodNullable<z.ZodString>>;
259
+ updatedAt: z.ZodString;
50
260
  assignedTo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
51
- updatedBy: z.ZodString;
261
+ updatedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
52
262
  trackingId: z.ZodString;
263
+ flags: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNativeEnum<{
264
+ readonly CERTIFICATE_PRINTED: "certificate-printed";
265
+ }>]>, "many">;
53
266
  }, "strip", z.ZodTypeAny, {
54
267
  type: string;
55
268
  id: string;
56
269
  status: "ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED";
57
270
  createdAt: string;
58
271
  createdBy: string;
59
- 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
+ acceptedAt: string;
280
+ createdAtLocation?: string | null | undefined;
281
+ } | null | undefined;
282
+ REGISTERED?: {
283
+ createdAt: string;
284
+ createdBy: string;
285
+ createdByRole: string;
286
+ registrationNumber: string;
287
+ acceptedAt: string;
288
+ createdAtLocation?: string | null | undefined;
289
+ } | null | undefined;
290
+ };
291
+ updatedByUserRole: string;
292
+ flags: string[];
293
+ createdBySignature?: string | null | undefined;
294
+ createdAtLocation?: string | null | undefined;
63
295
  assignedTo?: string | null | undefined;
296
+ dateOfEvent?: string | null | undefined;
297
+ updatedAtLocation?: string | null | undefined;
298
+ updatedBy?: string | null | undefined;
64
299
  }, {
65
300
  type: string;
66
301
  id: string;
67
302
  status: "ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED";
68
303
  createdAt: string;
69
304
  createdBy: string;
70
- createdAtLocation: string;
305
+ updatedAt: string;
71
306
  trackingId: string;
72
- modifiedAt: string;
73
- updatedBy: string;
307
+ legalStatuses: {
308
+ DECLARED?: {
309
+ createdAt: string;
310
+ createdBy: string;
311
+ createdByRole: string;
312
+ acceptedAt: string;
313
+ createdAtLocation?: string | null | undefined;
314
+ } | null | undefined;
315
+ REGISTERED?: {
316
+ createdAt: string;
317
+ createdBy: string;
318
+ createdByRole: string;
319
+ registrationNumber: string;
320
+ acceptedAt: string;
321
+ createdAtLocation?: string | null | undefined;
322
+ } | null | undefined;
323
+ };
324
+ updatedByUserRole: string;
325
+ flags: string[];
326
+ createdBySignature?: string | null | undefined;
327
+ createdAtLocation?: string | null | undefined;
74
328
  assignedTo?: string | null | undefined;
329
+ dateOfEvent?: string | null | undefined;
330
+ updatedAtLocation?: string | null | undefined;
331
+ updatedBy?: string | null | undefined;
75
332
  }>;
76
333
  export type EventMetadata = z.infer<typeof EventMetadata>;
77
- export type EventMetadataKeys = `event.${keyof EventMetadata}`;
334
+ export declare const EventMetadataKeysArray: readonly ["id", "type", "status", "createdAt", "dateOfEvent", "createdBy", "updatedByUserRole", "createdAtLocation", "updatedAtLocation", "updatedAt", "assignedTo", "updatedBy", "trackingId", "legalStatuses", "flags"];
335
+ export declare const EventMetadataKeys: z.ZodEnum<["id", "type", "status", "createdAt", "dateOfEvent", "createdBy", "updatedByUserRole", "createdAtLocation", "updatedAtLocation", "updatedAt", "assignedTo", "updatedBy", "trackingId", "legalStatuses", "flags"]>;
336
+ export type EventMetadataKeys = z.infer<typeof EventMetadataKeys>;
78
337
  /**
79
338
  * Mapping of event metadata keys to translation configuration.
80
339
  * Consider introducing type in same manner as we have in FieldConfig.
81
340
  * We need a way to know how to parse it.
82
341
  */
83
- export declare const eventMetadataLabelMap: Record<EventMetadataKeys, TranslationConfig>;
342
+ export declare const eventMetadataLabelMap: Record<Exclude<`event.${EventMetadataKeys}`, 'event.legalStatuses'>, TranslationConfig>;
84
343
  //# sourceMappingURL=EventMetadata.d.ts.map