@opencrvs/toolkit 1.8.0-rc.f82791e → 1.8.0-rc.f8296f8

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 (40) hide show
  1. package/dist/commons/api/router.d.ts +7485 -3044
  2. package/dist/commons/conditionals/conditionals.d.ts +2 -1
  3. package/dist/commons/events/ActionConfig.d.ts +20595 -2656
  4. package/dist/commons/events/ActionDocument.d.ts +760 -553
  5. package/dist/commons/events/ActionInput.d.ts +377 -305
  6. package/dist/commons/events/AdvancedSearchConfig.d.ts +637 -48
  7. package/dist/commons/events/Constants.d.ts +2 -0
  8. package/dist/commons/events/CountryConfigQueryInput.d.ts +2982 -0
  9. package/dist/commons/events/CreatedAtLocation.d.ts +2 -0
  10. package/dist/commons/events/Draft.d.ts +43 -40
  11. package/dist/commons/events/EventConfig.d.ts +16491 -7434
  12. package/dist/commons/events/EventDocument.d.ts +471 -423
  13. package/dist/commons/events/EventIndex.d.ts +694 -293
  14. package/dist/commons/events/EventInput.d.ts +0 -13
  15. package/dist/commons/events/EventMetadata.d.ts +262 -16
  16. package/dist/commons/events/FieldConfig.d.ts +850 -69
  17. package/dist/commons/events/FieldType.d.ts +3 -2
  18. package/dist/commons/events/FieldTypeMapping.d.ts +11 -4
  19. package/dist/commons/events/FieldValue.d.ts +6 -3
  20. package/dist/commons/events/FormConfig.d.ts +5749 -925
  21. package/dist/commons/events/PageConfig.d.ts +1191 -3
  22. package/dist/commons/events/SummaryConfig.d.ts +17 -0
  23. package/dist/commons/events/User.d.ts +31 -7
  24. package/dist/commons/events/WorkqueueColumnConfig.d.ts +53 -0
  25. package/dist/commons/events/WorkqueueConfig.d.ts +4491 -10
  26. package/dist/commons/events/defineConfig.d.ts +1269 -7
  27. package/dist/commons/events/event.d.ts +37 -8
  28. package/dist/commons/events/field.d.ts +24 -10
  29. package/dist/commons/events/index.d.ts +4 -0
  30. package/dist/commons/events/scopes.d.ts +20 -1
  31. package/dist/commons/events/serializer.d.ts +2 -0
  32. package/dist/commons/events/test.utils.d.ts +35 -14
  33. package/dist/commons/events/transactions.d.ts +1 -1
  34. package/dist/commons/events/utils.d.ts +313 -24
  35. package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
  36. package/dist/conditionals/index.js +19 -2
  37. package/dist/events/index.js +2859 -1192
  38. package/dist/scopes/index.d.ts +158 -1
  39. package/dist/scopes/index.js +152 -1
  40. package/package.json +1 -1
@@ -2,25 +2,12 @@ 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
- }>>;
12
5
  }, "strip", z.ZodTypeAny, {
13
6
  type: string;
14
7
  transactionId: string;
15
- dateOfEvent?: {
16
- fieldId: string;
17
- } | undefined;
18
8
  }, {
19
9
  type: string;
20
10
  transactionId: string;
21
- dateOfEvent?: {
22
- fieldId: string;
23
- } | undefined;
24
11
  }>;
25
12
  export type EventInput = z.infer<typeof EventInput>;
26
13
  //# 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";
@@ -26,13 +35,133 @@ export declare const EventStatuses: z.ZodNativeEnum<{
26
35
  readonly ARCHIVED: "ARCHIVED";
27
36
  }>;
28
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
+ }>;
29
158
  /**
30
159
  * Event metadata exposed to client.
31
160
  *
32
161
  * Accessed through `event.` in configuration.
33
162
  */
34
163
  export declare const EventMetadata: z.ZodObject<{
35
- id: z.ZodString;
164
+ id: z.ZodBranded<z.ZodString, "UUID">;
36
165
  type: z.ZodString;
37
166
  status: z.ZodNativeEnum<{
38
167
  readonly CREATED: "CREATED";
@@ -44,54 +173,171 @@ export declare const EventMetadata: z.ZodObject<{
44
173
  readonly REJECTED: "REJECTED";
45
174
  readonly ARCHIVED: "ARCHIVED";
46
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
+ }>;
47
252
  createdAt: z.ZodString;
48
253
  dateOfEvent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
49
254
  createdBy: z.ZodString;
50
255
  updatedByUserRole: z.ZodString;
51
- createdAtLocation: z.ZodString;
52
- updatedAtLocation: z.ZodString;
256
+ createdAtLocation: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodString, "UUID">>>;
257
+ createdBySignature: z.ZodOptional<z.ZodNullable<z.ZodString>>;
258
+ updatedAtLocation: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodString, "UUID">>>;
53
259
  updatedAt: z.ZodString;
54
260
  assignedTo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
55
- updatedBy: z.ZodString;
261
+ updatedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
56
262
  trackingId: z.ZodString;
57
- registrationNumber: z.ZodOptional<z.ZodNullable<z.ZodString>>;
263
+ flags: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNativeEnum<{
264
+ readonly CERTIFICATE_PRINTED: "certificate-printed";
265
+ }>]>, "many">;
58
266
  }, "strip", z.ZodTypeAny, {
59
267
  type: string;
60
- id: string;
268
+ id: string & z.BRAND<"UUID">;
61
269
  status: "ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED";
62
270
  createdAt: string;
63
271
  createdBy: string;
64
- createdAtLocation: string;
65
- updatedAtLocation: string;
66
272
  updatedAt: string;
67
273
  trackingId: string;
274
+ legalStatuses: {
275
+ DECLARED?: {
276
+ createdAt: string;
277
+ createdBy: string;
278
+ createdByRole: string;
279
+ acceptedAt: string;
280
+ createdAtLocation?: (string & z.BRAND<"UUID">) | 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 & z.BRAND<"UUID">) | null | undefined;
289
+ } | null | undefined;
290
+ };
68
291
  updatedByUserRole: string;
69
- updatedBy: string;
292
+ flags: string[];
293
+ createdBySignature?: string | null | undefined;
294
+ createdAtLocation?: (string & z.BRAND<"UUID">) | null | undefined;
70
295
  assignedTo?: string | null | undefined;
71
- registrationNumber?: string | null | undefined;
72
296
  dateOfEvent?: string | null | undefined;
297
+ updatedAtLocation?: (string & z.BRAND<"UUID">) | null | undefined;
298
+ updatedBy?: string | null | undefined;
73
299
  }, {
74
300
  type: string;
75
301
  id: string;
76
302
  status: "ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED";
77
303
  createdAt: string;
78
304
  createdBy: string;
79
- createdAtLocation: string;
80
- updatedAtLocation: string;
81
305
  updatedAt: string;
82
306
  trackingId: 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
+ };
83
324
  updatedByUserRole: string;
84
- updatedBy: string;
325
+ flags: string[];
326
+ createdBySignature?: string | null | undefined;
327
+ createdAtLocation?: string | null | undefined;
85
328
  assignedTo?: string | null | undefined;
86
- registrationNumber?: string | null | undefined;
87
329
  dateOfEvent?: string | null | undefined;
330
+ updatedAtLocation?: string | null | undefined;
331
+ updatedBy?: string | null | undefined;
88
332
  }>;
89
333
  export type EventMetadata = z.infer<typeof EventMetadata>;
90
- 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>;
91
337
  /**
92
338
  * Mapping of event metadata keys to translation configuration.
93
339
  * Consider introducing type in same manner as we have in FieldConfig.
94
340
  * We need a way to know how to parse it.
95
341
  */
96
- export declare const eventMetadataLabelMap: Record<EventMetadataKeys, TranslationConfig>;
342
+ export declare const eventMetadataLabelMap: Record<Exclude<`event.${EventMetadataKeys}`, 'event.legalStatuses'>, TranslationConfig>;
97
343
  //# sourceMappingURL=EventMetadata.d.ts.map