@opencrvs/toolkit 1.8.0-rc.fb2e700 → 1.8.0-rc.fbb40d1

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/dist/commons/api/router.d.ts +11542 -4327
  2. package/dist/commons/conditionals/conditionals.d.ts +11 -7
  3. package/dist/commons/conditionals/validate.d.ts +4 -6
  4. package/dist/commons/events/ActionConfig.d.ts +104357 -1720
  5. package/dist/commons/events/ActionDocument.d.ts +865 -452
  6. package/dist/commons/events/ActionInput.d.ts +443 -363
  7. package/dist/commons/events/AdvancedSearchConfig.d.ts +957 -22
  8. package/dist/commons/events/CompositeFieldValue.d.ts +3 -0
  9. package/dist/commons/events/Constants.d.ts +2 -0
  10. package/dist/commons/events/CountryConfigQueryInput.d.ts +2982 -0
  11. package/dist/commons/events/CreatedAtLocation.d.ts +2 -0
  12. package/dist/commons/events/Draft.d.ts +52 -39
  13. package/dist/commons/events/EventConfig.d.ts +50126 -1345
  14. package/dist/commons/events/EventDocument.d.ts +550 -330
  15. package/dist/commons/events/EventIndex.d.ts +1327 -18
  16. package/dist/commons/events/EventMetadata.d.ts +269 -16
  17. package/dist/commons/events/FieldConfig.d.ts +4280 -754
  18. package/dist/commons/events/FieldType.d.ts +3 -3
  19. package/dist/commons/events/FieldTypeMapping.d.ts +11 -4
  20. package/dist/commons/events/FieldValue.d.ts +7 -4
  21. package/dist/commons/events/FormConfig.d.ts +43591 -439
  22. package/dist/commons/events/PageConfig.d.ts +10860 -204
  23. package/dist/commons/events/SummaryConfig.d.ts +95 -39
  24. package/dist/commons/events/User.d.ts +31 -2
  25. package/dist/commons/events/WorkqueueColumnConfig.d.ts +53 -0
  26. package/dist/commons/events/WorkqueueConfig.d.ts +4525 -20
  27. package/dist/commons/events/defineConfig.d.ts +7940 -28
  28. package/dist/commons/events/event.d.ts +54 -0
  29. package/dist/commons/events/field.d.ts +82 -0
  30. package/dist/commons/events/index.d.ts +7 -0
  31. package/dist/commons/events/scopes.d.ts +45 -0
  32. package/dist/commons/events/serializer.d.ts +2 -0
  33. package/dist/commons/events/test.utils.d.ts +22 -51
  34. package/dist/commons/events/transactions.d.ts +1 -1
  35. package/dist/commons/events/utils.d.ts +3670 -71
  36. package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
  37. package/dist/conditionals/index.js +55 -35
  38. package/dist/events/index.js +3662 -1691
  39. package/dist/scopes/index.d.ts +94 -6
  40. package/dist/scopes/index.js +42 -21
  41. 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,13 +34,134 @@ 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.ZodBranded<z.ZodString, "UUID">>>;
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 & z.BRAND<"UUID">) | 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.ZodBranded<z.ZodString, "UUID">>>;
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 & z.BRAND<"UUID">) | 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.ZodBranded<z.ZodString, "UUID">>>;
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 & z.BRAND<"UUID">) | 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.ZodBranded<z.ZodString, "UUID">>>;
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 & z.BRAND<"UUID">) | 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 & z.BRAND<"UUID">) | 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 & z.BRAND<"UUID">) | 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
  *
31
161
  * Accessed through `event.` in configuration.
32
162
  */
33
163
  export declare const EventMetadata: z.ZodObject<{
34
- id: z.ZodString;
164
+ id: z.ZodBranded<z.ZodString, "UUID">;
35
165
  type: z.ZodString;
36
166
  status: z.ZodNativeEnum<{
37
167
  readonly CREATED: "CREATED";
@@ -43,45 +173,168 @@ 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.ZodBranded<z.ZodString, "UUID">>>;
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 & z.BRAND<"UUID">) | 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.ZodBranded<z.ZodString, "UUID">>>;
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 & z.BRAND<"UUID">) | 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 & z.BRAND<"UUID">) | 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 & z.BRAND<"UUID">) | 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.ZodBranded<z.ZodString, "UUID">>>;
257
+ updatedAtLocation: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodString, "UUID">>>;
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;
53
- registrationNumber: z.ZodOptional<z.ZodNullable<z.ZodString>>;
262
+ flags: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNativeEnum<{
263
+ readonly CERTIFICATE_PRINTED: "certificate-printed";
264
+ }>]>, "many">;
54
265
  }, "strip", z.ZodTypeAny, {
55
266
  type: string;
56
- id: string;
267
+ id: string & z.BRAND<"UUID">;
57
268
  status: "ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED";
58
269
  createdAt: string;
59
270
  createdBy: string;
60
- createdAtLocation: string;
271
+ updatedAt: string;
61
272
  trackingId: string;
62
- modifiedAt: string;
63
- updatedBy: string;
273
+ legalStatuses: {
274
+ DECLARED?: {
275
+ createdAt: string;
276
+ createdBy: string;
277
+ createdByRole: string;
278
+ acceptedAt: string;
279
+ createdAtLocation?: (string & z.BRAND<"UUID">) | null | undefined;
280
+ } | null | undefined;
281
+ REGISTERED?: {
282
+ createdAt: string;
283
+ createdBy: string;
284
+ createdByRole: string;
285
+ registrationNumber: string;
286
+ acceptedAt: string;
287
+ createdAtLocation?: (string & z.BRAND<"UUID">) | null | undefined;
288
+ } | null | undefined;
289
+ };
290
+ updatedByUserRole: string;
291
+ flags: string[];
292
+ createdAtLocation?: (string & z.BRAND<"UUID">) | null | undefined;
64
293
  assignedTo?: string | null | undefined;
65
- registrationNumber?: string | null | undefined;
294
+ dateOfEvent?: string | null | undefined;
295
+ updatedAtLocation?: (string & z.BRAND<"UUID">) | null | undefined;
296
+ updatedBy?: string | null | undefined;
66
297
  }, {
67
298
  type: string;
68
299
  id: string;
69
300
  status: "ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED";
70
301
  createdAt: string;
71
302
  createdBy: string;
72
- createdAtLocation: string;
303
+ updatedAt: string;
73
304
  trackingId: string;
74
- modifiedAt: string;
75
- updatedBy: string;
305
+ legalStatuses: {
306
+ DECLARED?: {
307
+ createdAt: string;
308
+ createdBy: string;
309
+ createdByRole: string;
310
+ acceptedAt: string;
311
+ createdAtLocation?: string | null | undefined;
312
+ } | null | undefined;
313
+ REGISTERED?: {
314
+ createdAt: string;
315
+ createdBy: string;
316
+ createdByRole: string;
317
+ registrationNumber: string;
318
+ acceptedAt: string;
319
+ createdAtLocation?: string | null | undefined;
320
+ } | null | undefined;
321
+ };
322
+ updatedByUserRole: string;
323
+ flags: string[];
324
+ createdAtLocation?: string | null | undefined;
76
325
  assignedTo?: string | null | undefined;
77
- registrationNumber?: string | null | undefined;
326
+ dateOfEvent?: string | null | undefined;
327
+ updatedAtLocation?: string | null | undefined;
328
+ updatedBy?: string | null | undefined;
78
329
  }>;
79
330
  export type EventMetadata = z.infer<typeof EventMetadata>;
80
- export type EventMetadataKeys = `event.${keyof EventMetadata}`;
331
+ export declare const EventMetadataKeysArray: readonly ["id", "type", "status", "createdAt", "dateOfEvent", "createdBy", "updatedByUserRole", "createdAtLocation", "updatedAtLocation", "updatedAt", "assignedTo", "updatedBy", "trackingId", "legalStatuses", "flags"];
332
+ export declare const EventMetadataKeys: z.ZodEnum<["id", "type", "status", "createdAt", "dateOfEvent", "createdBy", "updatedByUserRole", "createdAtLocation", "updatedAtLocation", "updatedAt", "assignedTo", "updatedBy", "trackingId", "legalStatuses", "flags"]>;
333
+ export type EventMetadataKeys = z.infer<typeof EventMetadataKeys>;
81
334
  /**
82
335
  * Mapping of event metadata keys to translation configuration.
83
336
  * Consider introducing type in same manner as we have in FieldConfig.
84
337
  * We need a way to know how to parse it.
85
338
  */
86
- export declare const eventMetadataLabelMap: Record<EventMetadataKeys, TranslationConfig>;
339
+ export declare const eventMetadataLabelMap: Record<Exclude<`event.${EventMetadataKeys}`, 'event.legalStatuses'>, TranslationConfig>;
87
340
  //# sourceMappingURL=EventMetadata.d.ts.map