@opencrvs/toolkit 1.8.0-rc.f8e4107 → 1.8.0-rc.f97f8f2

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 (39) hide show
  1. package/dist/commons/api/router.d.ts +8418 -4827
  2. package/dist/commons/conditionals/conditionals.d.ts +9 -70
  3. package/dist/commons/conditionals/validate.d.ts +4 -6
  4. package/dist/commons/events/ActionConfig.d.ts +90025 -1680
  5. package/dist/commons/events/ActionDocument.d.ts +643 -417
  6. package/dist/commons/events/ActionInput.d.ts +248 -240
  7. package/dist/commons/events/AdvancedSearchConfig.d.ts +274 -23
  8. package/dist/commons/events/CompositeFieldValue.d.ts +3 -0
  9. package/dist/commons/events/CountryConfigQueryInput.d.ts +1506 -0
  10. package/dist/commons/events/Draft.d.ts +38 -30
  11. package/dist/commons/events/EventConfig.d.ts +42787 -1385
  12. package/dist/commons/events/EventDocument.d.ts +413 -312
  13. package/dist/commons/events/EventIndex.d.ts +948 -155
  14. package/dist/commons/events/EventInput.d.ts +13 -0
  15. package/dist/commons/events/EventMetadata.d.ts +274 -11
  16. package/dist/commons/events/FieldConfig.d.ts +3778 -769
  17. package/dist/commons/events/FieldType.d.ts +3 -3
  18. package/dist/commons/events/FieldTypeMapping.d.ts +11 -4
  19. package/dist/commons/events/FieldValue.d.ts +7 -4
  20. package/dist/commons/events/FormConfig.d.ts +40417 -439
  21. package/dist/commons/events/PageConfig.d.ts +10077 -203
  22. package/dist/commons/events/SummaryConfig.d.ts +95 -39
  23. package/dist/commons/events/User.d.ts +31 -2
  24. package/dist/commons/events/WorkqueueColumnConfig.d.ts +42 -0
  25. package/dist/commons/events/WorkqueueConfig.d.ts +2834 -19
  26. package/dist/commons/events/defineConfig.d.ts +7008 -81
  27. package/dist/commons/events/event.d.ts +27 -0
  28. package/dist/commons/events/field.d.ts +68 -0
  29. package/dist/commons/events/index.d.ts +6 -0
  30. package/dist/commons/events/scopes.d.ts +26 -0
  31. package/dist/commons/events/serializer.d.ts +2 -0
  32. package/dist/commons/events/test.utils.d.ts +7 -44
  33. package/dist/commons/events/utils.d.ts +3551 -65
  34. package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
  35. package/dist/conditionals/index.js +54 -83
  36. package/dist/events/index.js +2044 -1072
  37. package/dist/scopes/index.d.ts +105 -1
  38. package/dist/scopes/index.js +140 -0
  39. 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
  *
@@ -32,6 +162,7 @@ export declare const EventStatuses: z.ZodNativeEnum<{
32
162
  */
33
163
  export declare const EventMetadata: z.ZodObject<{
34
164
  id: z.ZodString;
165
+ title: z.ZodString;
35
166
  type: z.ZodString;
36
167
  status: z.ZodNativeEnum<{
37
168
  readonly CREATED: "CREATED";
@@ -43,48 +174,180 @@ export declare const EventMetadata: z.ZodObject<{
43
174
  readonly REJECTED: "REJECTED";
44
175
  readonly ARCHIVED: "ARCHIVED";
45
176
  }>;
177
+ legalStatuses: z.ZodObject<{
178
+ DECLARED: z.ZodOptional<z.ZodNullable<z.ZodObject<{
179
+ createdAt: z.ZodString;
180
+ createdBy: z.ZodString;
181
+ createdAtLocation: z.ZodString;
182
+ acceptedAt: z.ZodString;
183
+ createdByRole: z.ZodString;
184
+ }, "strip", z.ZodTypeAny, {
185
+ createdAt: string;
186
+ createdBy: string;
187
+ createdByRole: string;
188
+ createdAtLocation: string;
189
+ acceptedAt: string;
190
+ }, {
191
+ createdAt: string;
192
+ createdBy: string;
193
+ createdByRole: string;
194
+ createdAtLocation: string;
195
+ acceptedAt: string;
196
+ }>>>;
197
+ REGISTERED: z.ZodOptional<z.ZodNullable<z.ZodObject<z.objectUtil.extendShape<{
198
+ createdAt: z.ZodString;
199
+ createdBy: z.ZodString;
200
+ createdAtLocation: z.ZodString;
201
+ acceptedAt: z.ZodString;
202
+ createdByRole: z.ZodString;
203
+ }, {
204
+ registrationNumber: z.ZodString;
205
+ }>, "strip", z.ZodTypeAny, {
206
+ createdAt: string;
207
+ createdBy: string;
208
+ createdByRole: string;
209
+ createdAtLocation: string;
210
+ registrationNumber: string;
211
+ acceptedAt: string;
212
+ }, {
213
+ createdAt: string;
214
+ createdBy: string;
215
+ createdByRole: string;
216
+ createdAtLocation: string;
217
+ registrationNumber: string;
218
+ acceptedAt: string;
219
+ }>>>;
220
+ }, "strip", z.ZodTypeAny, {
221
+ DECLARED?: {
222
+ createdAt: string;
223
+ createdBy: string;
224
+ createdByRole: string;
225
+ createdAtLocation: string;
226
+ acceptedAt: string;
227
+ } | null | undefined;
228
+ REGISTERED?: {
229
+ createdAt: string;
230
+ createdBy: string;
231
+ createdByRole: string;
232
+ createdAtLocation: string;
233
+ registrationNumber: string;
234
+ acceptedAt: string;
235
+ } | null | undefined;
236
+ }, {
237
+ DECLARED?: {
238
+ createdAt: string;
239
+ createdBy: string;
240
+ createdByRole: string;
241
+ createdAtLocation: string;
242
+ acceptedAt: string;
243
+ } | null | undefined;
244
+ REGISTERED?: {
245
+ createdAt: string;
246
+ createdBy: string;
247
+ createdByRole: string;
248
+ createdAtLocation: string;
249
+ registrationNumber: string;
250
+ acceptedAt: string;
251
+ } | null | undefined;
252
+ }>;
46
253
  createdAt: z.ZodString;
254
+ dateOfEvent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
47
255
  createdBy: z.ZodString;
256
+ updatedByUserRole: z.ZodString;
48
257
  createdAtLocation: z.ZodString;
49
- updatedAtLocation: z.ZodString;
258
+ updatedAtLocation: z.ZodOptional<z.ZodNullable<z.ZodString>>;
50
259
  updatedAt: z.ZodString;
51
260
  assignedTo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
52
- updatedBy: z.ZodString;
261
+ updatedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
53
262
  trackingId: z.ZodString;
54
- 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">;
55
266
  }, "strip", z.ZodTypeAny, {
56
267
  type: string;
57
268
  id: string;
58
269
  status: "ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED";
270
+ title: string;
59
271
  createdAt: string;
60
272
  createdBy: string;
61
273
  createdAtLocation: string;
62
- updatedAtLocation: string;
63
274
  updatedAt: string;
64
275
  trackingId: string;
65
- updatedBy: string;
276
+ legalStatuses: {
277
+ DECLARED?: {
278
+ createdAt: string;
279
+ createdBy: string;
280
+ createdByRole: string;
281
+ createdAtLocation: string;
282
+ acceptedAt: string;
283
+ } | null | undefined;
284
+ REGISTERED?: {
285
+ createdAt: string;
286
+ createdBy: string;
287
+ createdByRole: string;
288
+ createdAtLocation: string;
289
+ registrationNumber: string;
290
+ acceptedAt: string;
291
+ } | null | undefined;
292
+ };
293
+ updatedByUserRole: string;
294
+ flags: string[];
66
295
  assignedTo?: string | null | undefined;
67
- registrationNumber?: string | null | undefined;
296
+ dateOfEvent?: string | null | undefined;
297
+ updatedAtLocation?: string | null | undefined;
298
+ updatedBy?: string | null | undefined;
68
299
  }, {
69
300
  type: string;
70
301
  id: string;
71
302
  status: "ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED";
303
+ title: string;
72
304
  createdAt: string;
73
305
  createdBy: string;
74
306
  createdAtLocation: string;
75
- updatedAtLocation: string;
76
307
  updatedAt: string;
77
308
  trackingId: string;
78
- updatedBy: string;
309
+ legalStatuses: {
310
+ DECLARED?: {
311
+ createdAt: string;
312
+ createdBy: string;
313
+ createdByRole: string;
314
+ createdAtLocation: string;
315
+ acceptedAt: string;
316
+ } | null | undefined;
317
+ REGISTERED?: {
318
+ createdAt: string;
319
+ createdBy: string;
320
+ createdByRole: string;
321
+ createdAtLocation: string;
322
+ registrationNumber: string;
323
+ acceptedAt: string;
324
+ } | null | undefined;
325
+ };
326
+ updatedByUserRole: string;
327
+ flags: string[];
79
328
  assignedTo?: string | null | undefined;
80
- registrationNumber?: string | null | undefined;
329
+ dateOfEvent?: string | null | undefined;
330
+ updatedAtLocation?: string | null | undefined;
331
+ updatedBy?: string | null | undefined;
81
332
  }>;
82
333
  export type EventMetadata = z.infer<typeof EventMetadata>;
83
- export type EventMetadataKeys = `event.${keyof EventMetadata}`;
334
+ export declare const EventMetadataKeys: z.ZodEnum<["id", "title", "type", "status", "createdAt", "dateOfEvent", "createdBy", "updatedByUserRole", "createdAtLocation", "updatedAtLocation", "updatedAt", "assignedTo", "updatedBy", "trackingId", "legalStatuses", "flags"]>;
335
+ export type EventMetadataKeys = z.infer<typeof EventMetadataKeys>;
336
+ /**
337
+ * This ensures `event.field()` takes a key from `EventMetadata`
338
+ */
339
+ export declare const EventMetadataParameter: z.ZodObject<{
340
+ $event: z.ZodEnum<["id", "title", "type", "status", "createdAt", "dateOfEvent", "createdBy", "updatedByUserRole", "createdAtLocation", "updatedAtLocation", "updatedAt", "assignedTo", "updatedBy", "trackingId", "legalStatuses", "flags"]>;
341
+ }, "strip", z.ZodTypeAny, {
342
+ $event: "type" | "id" | "status" | "title" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "dateOfEvent" | "updatedAt" | "trackingId" | "legalStatuses" | "updatedByUserRole" | "updatedAtLocation" | "updatedBy" | "flags";
343
+ }, {
344
+ $event: "type" | "id" | "status" | "title" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "dateOfEvent" | "updatedAt" | "trackingId" | "legalStatuses" | "updatedByUserRole" | "updatedAtLocation" | "updatedBy" | "flags";
345
+ }>;
346
+ export type EventMetadataParameter = z.infer<typeof EventMetadataParameter>;
84
347
  /**
85
348
  * Mapping of event metadata keys to translation configuration.
86
349
  * Consider introducing type in same manner as we have in FieldConfig.
87
350
  * We need a way to know how to parse it.
88
351
  */
89
- export declare const eventMetadataLabelMap: Record<EventMetadataKeys, TranslationConfig>;
352
+ export declare const eventMetadataLabelMap: Record<Exclude<`event.${EventMetadataKeys}`, 'event.legalStatuses'>, TranslationConfig>;
90
353
  //# sourceMappingURL=EventMetadata.d.ts.map