@opencrvs/toolkit 1.8.0-rc.fef85f2 → 1.8.0-rc.ff0a1b5

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