@opencrvs/toolkit 1.8.0-rc.fd936ab → 1.8.0-rc.fe4d9d5

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 +14404 -468
  2. package/dist/commons/conditionals/conditionals.d.ts +14 -6
  3. package/dist/commons/conditionals/validate.d.ts +10 -6
  4. package/dist/commons/events/ActionConfig.d.ts +117418 -1729
  5. package/dist/commons/events/ActionDocument.d.ts +2410 -383
  6. package/dist/commons/events/ActionInput.d.ts +1583 -303
  7. package/dist/commons/events/ActionType.d.ts +6 -0
  8. package/dist/commons/events/AdvancedSearchConfig.d.ts +1029 -22
  9. package/dist/commons/events/CompositeFieldValue.d.ts +31 -0
  10. package/dist/commons/events/Constants.d.ts +3 -0
  11. package/dist/commons/events/CountryConfigQueryInput.d.ts +3068 -0
  12. package/dist/commons/events/CreatedAtLocation.d.ts +3 -0
  13. package/dist/commons/events/Draft.d.ts +148 -29
  14. package/dist/commons/events/EventConfig.d.ts +56369 -1354
  15. package/dist/commons/events/EventDocument.d.ts +1508 -264
  16. package/dist/commons/events/EventIndex.d.ts +2026 -25
  17. package/dist/commons/events/EventMetadata.d.ts +332 -43
  18. package/dist/commons/events/FieldConfig.d.ts +5436 -1038
  19. package/dist/commons/events/FieldType.d.ts +6 -3
  20. package/dist/commons/events/FieldTypeMapping.d.ts +103 -54
  21. package/dist/commons/events/FieldValue.d.ts +49 -8
  22. package/dist/commons/events/FormConfig.d.ts +49156 -514
  23. package/dist/commons/events/PageConfig.d.ts +12206 -204
  24. package/dist/commons/events/SummaryConfig.d.ts +93 -42
  25. package/dist/commons/events/User.d.ts +31 -2
  26. package/dist/commons/events/WorkqueueColumnConfig.d.ts +53 -0
  27. package/dist/commons/events/WorkqueueConfig.d.ts +6290 -20
  28. package/dist/commons/events/defineConfig.d.ts +8993 -58
  29. package/dist/commons/events/event.d.ts +54 -0
  30. package/dist/commons/events/field.d.ts +77 -0
  31. package/dist/commons/events/index.d.ts +8 -0
  32. package/dist/commons/events/scopes.d.ts +44 -0
  33. package/dist/commons/events/serializer.d.ts +2 -0
  34. package/dist/commons/events/test.utils.d.ts +160 -78
  35. package/dist/commons/events/utils.d.ts +13353 -68
  36. package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
  37. package/dist/conditionals/index.js +76 -36
  38. package/dist/events/index.js +4097 -1530
  39. package/dist/scopes/index.d.ts +97 -6
  40. package/dist/scopes/index.js +109 -38
  41. package/package.json +3 -2
@@ -3,27 +3,168 @@ import { TranslationConfig } from './TranslationConfig';
3
3
  /**
4
4
  * Event statuses recognized by the system
5
5
  */
6
- export declare const EventStatus: {
7
- readonly CREATED: "CREATED";
8
- readonly NOTIFIED: "NOTIFIED";
9
- readonly DECLARED: "DECLARED";
10
- readonly VALIDATED: "VALIDATED";
11
- readonly REGISTERED: "REGISTERED";
12
- readonly CERTIFIED: "CERTIFIED";
13
- readonly REJECTED: "REJECTED";
14
- readonly ARCHIVED: "ARCHIVED";
6
+ export declare const EventStatus: z.ZodEnum<["CREATED", "NOTIFIED", "DECLARED", "VALIDATED", "REGISTERED", "CERTIFIED", "REJECTED", "ARCHIVED"]>;
7
+ export type EventStatus = z.infer<typeof EventStatus>;
8
+ export declare const CustomFlags: {
9
+ readonly CERTIFICATE_PRINTED: "certificate-printed";
15
10
  };
16
- export type EventStatus = (typeof EventStatus)[keyof typeof EventStatus];
17
- export declare const eventStatuses: ("ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED")[];
18
- export declare const EventStatuses: z.ZodNativeEnum<{
19
- readonly CREATED: "CREATED";
20
- readonly NOTIFIED: "NOTIFIED";
21
- readonly DECLARED: "DECLARED";
22
- readonly VALIDATED: "VALIDATED";
23
- readonly REGISTERED: "REGISTERED";
24
- readonly CERTIFIED: "CERTIFIED";
25
- readonly REJECTED: "REJECTED";
26
- readonly ARCHIVED: "ARCHIVED";
11
+ export type CustomFlags = (typeof CustomFlags)[keyof typeof CustomFlags];
12
+ export declare const Flag: z.ZodUnion<[z.ZodString, z.ZodNativeEnum<{
13
+ readonly CERTIFICATE_PRINTED: "certificate-printed";
14
+ }>]>;
15
+ export type Flag = z.infer<typeof Flag>;
16
+ export declare const ZodDate: z.ZodString;
17
+ export declare const ActionCreationMetadata: z.ZodObject<{
18
+ createdAt: z.ZodString;
19
+ createdBy: z.ZodString;
20
+ createdAtLocation: z.ZodOptional<z.ZodNullable<z.ZodString>>;
21
+ createdByUserType: z.ZodOptional<z.ZodNullable<z.ZodEnum<["user", "system"]>>>;
22
+ acceptedAt: z.ZodString;
23
+ createdByRole: z.ZodString;
24
+ createdBySignature: z.ZodOptional<z.ZodNullable<z.ZodString>>;
25
+ }, "strip", z.ZodTypeAny, {
26
+ createdAt: string;
27
+ createdBy: string;
28
+ createdByRole: string;
29
+ acceptedAt: string;
30
+ createdByUserType?: "system" | "user" | null | undefined;
31
+ createdBySignature?: string | null | undefined;
32
+ createdAtLocation?: string | null | undefined;
33
+ }, {
34
+ createdAt: string;
35
+ createdBy: string;
36
+ createdByRole: string;
37
+ acceptedAt: string;
38
+ createdByUserType?: "system" | "user" | null | undefined;
39
+ createdBySignature?: string | null | undefined;
40
+ createdAtLocation?: string | null | undefined;
41
+ }>;
42
+ export type ActionCreationMetadata = z.infer<typeof ActionCreationMetadata>;
43
+ export declare const RegistrationCreationMetadata: z.ZodObject<z.objectUtil.extendShape<{
44
+ createdAt: z.ZodString;
45
+ createdBy: z.ZodString;
46
+ createdAtLocation: z.ZodOptional<z.ZodNullable<z.ZodString>>;
47
+ createdByUserType: z.ZodOptional<z.ZodNullable<z.ZodEnum<["user", "system"]>>>;
48
+ acceptedAt: z.ZodString;
49
+ createdByRole: z.ZodString;
50
+ createdBySignature: z.ZodOptional<z.ZodNullable<z.ZodString>>;
51
+ }, {
52
+ registrationNumber: z.ZodString;
53
+ }>, "strip", z.ZodTypeAny, {
54
+ createdAt: string;
55
+ createdBy: string;
56
+ createdByRole: string;
57
+ registrationNumber: string;
58
+ acceptedAt: string;
59
+ createdByUserType?: "system" | "user" | null | undefined;
60
+ createdBySignature?: string | null | undefined;
61
+ createdAtLocation?: string | null | undefined;
62
+ }, {
63
+ createdAt: string;
64
+ createdBy: string;
65
+ createdByRole: string;
66
+ registrationNumber: string;
67
+ acceptedAt: string;
68
+ createdByUserType?: "system" | "user" | null | undefined;
69
+ createdBySignature?: string | null | undefined;
70
+ createdAtLocation?: string | null | undefined;
71
+ }>;
72
+ export type RegistrationCreationMetadata = z.infer<typeof RegistrationCreationMetadata>;
73
+ export declare const LegalStatuses: z.ZodObject<{
74
+ DECLARED: z.ZodOptional<z.ZodNullable<z.ZodObject<{
75
+ createdAt: z.ZodString;
76
+ createdBy: z.ZodString;
77
+ createdAtLocation: z.ZodOptional<z.ZodNullable<z.ZodString>>;
78
+ createdByUserType: z.ZodOptional<z.ZodNullable<z.ZodEnum<["user", "system"]>>>;
79
+ acceptedAt: z.ZodString;
80
+ createdByRole: z.ZodString;
81
+ createdBySignature: z.ZodOptional<z.ZodNullable<z.ZodString>>;
82
+ }, "strip", z.ZodTypeAny, {
83
+ createdAt: string;
84
+ createdBy: string;
85
+ createdByRole: string;
86
+ acceptedAt: string;
87
+ createdByUserType?: "system" | "user" | null | undefined;
88
+ createdBySignature?: string | null | undefined;
89
+ createdAtLocation?: string | null | undefined;
90
+ }, {
91
+ createdAt: string;
92
+ createdBy: string;
93
+ createdByRole: string;
94
+ acceptedAt: string;
95
+ createdByUserType?: "system" | "user" | null | undefined;
96
+ createdBySignature?: string | null | undefined;
97
+ createdAtLocation?: string | null | undefined;
98
+ }>>>;
99
+ REGISTERED: z.ZodOptional<z.ZodNullable<z.ZodObject<z.objectUtil.extendShape<{
100
+ createdAt: z.ZodString;
101
+ createdBy: z.ZodString;
102
+ createdAtLocation: z.ZodOptional<z.ZodNullable<z.ZodString>>;
103
+ createdByUserType: z.ZodOptional<z.ZodNullable<z.ZodEnum<["user", "system"]>>>;
104
+ acceptedAt: z.ZodString;
105
+ createdByRole: z.ZodString;
106
+ createdBySignature: z.ZodOptional<z.ZodNullable<z.ZodString>>;
107
+ }, {
108
+ registrationNumber: z.ZodString;
109
+ }>, "strip", z.ZodTypeAny, {
110
+ createdAt: string;
111
+ createdBy: string;
112
+ createdByRole: string;
113
+ registrationNumber: string;
114
+ acceptedAt: string;
115
+ createdByUserType?: "system" | "user" | null | undefined;
116
+ createdBySignature?: string | null | undefined;
117
+ createdAtLocation?: string | null | undefined;
118
+ }, {
119
+ createdAt: string;
120
+ createdBy: string;
121
+ createdByRole: string;
122
+ registrationNumber: string;
123
+ acceptedAt: string;
124
+ createdByUserType?: "system" | "user" | null | undefined;
125
+ createdBySignature?: string | null | undefined;
126
+ createdAtLocation?: string | null | undefined;
127
+ }>>>;
128
+ }, "strip", z.ZodTypeAny, {
129
+ DECLARED?: {
130
+ createdAt: string;
131
+ createdBy: string;
132
+ createdByRole: string;
133
+ acceptedAt: string;
134
+ createdByUserType?: "system" | "user" | null | undefined;
135
+ createdBySignature?: string | null | undefined;
136
+ createdAtLocation?: string | null | undefined;
137
+ } | null | undefined;
138
+ REGISTERED?: {
139
+ createdAt: string;
140
+ createdBy: string;
141
+ createdByRole: string;
142
+ registrationNumber: string;
143
+ acceptedAt: string;
144
+ createdByUserType?: "system" | "user" | null | undefined;
145
+ createdBySignature?: string | null | undefined;
146
+ createdAtLocation?: string | null | undefined;
147
+ } | null | undefined;
148
+ }, {
149
+ DECLARED?: {
150
+ createdAt: string;
151
+ createdBy: string;
152
+ createdByRole: string;
153
+ acceptedAt: string;
154
+ createdByUserType?: "system" | "user" | null | undefined;
155
+ createdBySignature?: string | null | undefined;
156
+ createdAtLocation?: string | null | undefined;
157
+ } | null | undefined;
158
+ REGISTERED?: {
159
+ createdAt: string;
160
+ createdBy: string;
161
+ createdByRole: string;
162
+ registrationNumber: string;
163
+ acceptedAt: string;
164
+ createdByUserType?: "system" | "user" | null | undefined;
165
+ createdBySignature?: string | null | undefined;
166
+ createdAtLocation?: string | null | undefined;
167
+ } | null | undefined;
27
168
  }>;
28
169
  /**
29
170
  * Event metadata exposed to client.
@@ -33,55 +174,203 @@ export declare const EventStatuses: z.ZodNativeEnum<{
33
174
  export declare const EventMetadata: z.ZodObject<{
34
175
  id: z.ZodString;
35
176
  type: z.ZodString;
36
- status: z.ZodNativeEnum<{
37
- readonly CREATED: "CREATED";
38
- readonly NOTIFIED: "NOTIFIED";
39
- readonly DECLARED: "DECLARED";
40
- readonly VALIDATED: "VALIDATED";
41
- readonly REGISTERED: "REGISTERED";
42
- readonly CERTIFIED: "CERTIFIED";
43
- readonly REJECTED: "REJECTED";
44
- readonly ARCHIVED: "ARCHIVED";
177
+ status: z.ZodEnum<["CREATED", "NOTIFIED", "DECLARED", "VALIDATED", "REGISTERED", "CERTIFIED", "REJECTED", "ARCHIVED"]>;
178
+ legalStatuses: z.ZodObject<{
179
+ DECLARED: z.ZodOptional<z.ZodNullable<z.ZodObject<{
180
+ createdAt: z.ZodString;
181
+ createdBy: z.ZodString;
182
+ createdAtLocation: z.ZodOptional<z.ZodNullable<z.ZodString>>;
183
+ createdByUserType: z.ZodOptional<z.ZodNullable<z.ZodEnum<["user", "system"]>>>;
184
+ acceptedAt: z.ZodString;
185
+ createdByRole: z.ZodString;
186
+ createdBySignature: z.ZodOptional<z.ZodNullable<z.ZodString>>;
187
+ }, "strip", z.ZodTypeAny, {
188
+ createdAt: string;
189
+ createdBy: string;
190
+ createdByRole: string;
191
+ acceptedAt: string;
192
+ createdByUserType?: "system" | "user" | null | undefined;
193
+ createdBySignature?: string | null | undefined;
194
+ createdAtLocation?: string | null | undefined;
195
+ }, {
196
+ createdAt: string;
197
+ createdBy: string;
198
+ createdByRole: string;
199
+ acceptedAt: string;
200
+ createdByUserType?: "system" | "user" | null | undefined;
201
+ createdBySignature?: string | null | undefined;
202
+ createdAtLocation?: string | null | undefined;
203
+ }>>>;
204
+ REGISTERED: z.ZodOptional<z.ZodNullable<z.ZodObject<z.objectUtil.extendShape<{
205
+ createdAt: z.ZodString;
206
+ createdBy: z.ZodString;
207
+ createdAtLocation: z.ZodOptional<z.ZodNullable<z.ZodString>>;
208
+ createdByUserType: z.ZodOptional<z.ZodNullable<z.ZodEnum<["user", "system"]>>>;
209
+ acceptedAt: z.ZodString;
210
+ createdByRole: z.ZodString;
211
+ createdBySignature: z.ZodOptional<z.ZodNullable<z.ZodString>>;
212
+ }, {
213
+ registrationNumber: z.ZodString;
214
+ }>, "strip", z.ZodTypeAny, {
215
+ createdAt: string;
216
+ createdBy: string;
217
+ createdByRole: string;
218
+ registrationNumber: string;
219
+ acceptedAt: string;
220
+ createdByUserType?: "system" | "user" | null | undefined;
221
+ createdBySignature?: string | null | undefined;
222
+ createdAtLocation?: string | null | undefined;
223
+ }, {
224
+ createdAt: string;
225
+ createdBy: string;
226
+ createdByRole: string;
227
+ registrationNumber: string;
228
+ acceptedAt: string;
229
+ createdByUserType?: "system" | "user" | null | undefined;
230
+ createdBySignature?: string | null | undefined;
231
+ createdAtLocation?: string | null | undefined;
232
+ }>>>;
233
+ }, "strip", z.ZodTypeAny, {
234
+ DECLARED?: {
235
+ createdAt: string;
236
+ createdBy: string;
237
+ createdByRole: string;
238
+ acceptedAt: string;
239
+ createdByUserType?: "system" | "user" | null | undefined;
240
+ createdBySignature?: string | null | undefined;
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
+ createdByUserType?: "system" | "user" | null | undefined;
250
+ createdBySignature?: string | null | undefined;
251
+ createdAtLocation?: string | null | undefined;
252
+ } | null | undefined;
253
+ }, {
254
+ DECLARED?: {
255
+ createdAt: string;
256
+ createdBy: string;
257
+ createdByRole: string;
258
+ acceptedAt: string;
259
+ createdByUserType?: "system" | "user" | null | undefined;
260
+ createdBySignature?: string | null | undefined;
261
+ createdAtLocation?: string | null | undefined;
262
+ } | null | undefined;
263
+ REGISTERED?: {
264
+ createdAt: string;
265
+ createdBy: string;
266
+ createdByRole: string;
267
+ registrationNumber: string;
268
+ acceptedAt: string;
269
+ createdByUserType?: "system" | "user" | null | undefined;
270
+ createdBySignature?: string | null | undefined;
271
+ createdAtLocation?: string | null | undefined;
272
+ } | null | undefined;
45
273
  }>;
46
274
  createdAt: z.ZodString;
275
+ dateOfEvent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
47
276
  createdBy: z.ZodString;
48
- createdAtLocation: z.ZodString;
49
- modifiedAt: z.ZodString;
277
+ createdByUserType: z.ZodOptional<z.ZodNullable<z.ZodEnum<["user", "system"]>>>;
278
+ updatedByUserRole: z.ZodString;
279
+ createdAtLocation: z.ZodOptional<z.ZodNullable<z.ZodString>>;
280
+ createdBySignature: z.ZodOptional<z.ZodNullable<z.ZodString>>;
281
+ updatedAtLocation: z.ZodOptional<z.ZodNullable<z.ZodString>>;
282
+ updatedAt: z.ZodString;
50
283
  assignedTo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
51
- updatedBy: z.ZodString;
284
+ updatedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
52
285
  trackingId: z.ZodString;
53
- registrationNumber: z.ZodOptional<z.ZodNullable<z.ZodString>>;
286
+ flags: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNativeEnum<{
287
+ readonly CERTIFICATE_PRINTED: "certificate-printed";
288
+ }>]>, "many">;
54
289
  }, "strip", z.ZodTypeAny, {
55
290
  type: string;
56
291
  id: string;
57
292
  status: "ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED";
58
293
  createdAt: string;
59
294
  createdBy: string;
60
- createdAtLocation: string;
295
+ updatedAt: string;
61
296
  trackingId: string;
62
- modifiedAt: string;
63
- updatedBy: string;
297
+ legalStatuses: {
298
+ DECLARED?: {
299
+ createdAt: string;
300
+ createdBy: string;
301
+ createdByRole: string;
302
+ acceptedAt: string;
303
+ createdByUserType?: "system" | "user" | null | undefined;
304
+ createdBySignature?: string | null | undefined;
305
+ createdAtLocation?: string | null | undefined;
306
+ } | null | undefined;
307
+ REGISTERED?: {
308
+ createdAt: string;
309
+ createdBy: string;
310
+ createdByRole: string;
311
+ registrationNumber: string;
312
+ acceptedAt: string;
313
+ createdByUserType?: "system" | "user" | null | undefined;
314
+ createdBySignature?: string | null | undefined;
315
+ createdAtLocation?: string | null | undefined;
316
+ } | null | undefined;
317
+ };
318
+ updatedByUserRole: string;
319
+ flags: string[];
320
+ createdByUserType?: "system" | "user" | null | undefined;
321
+ createdBySignature?: string | null | undefined;
322
+ createdAtLocation?: string | null | undefined;
64
323
  assignedTo?: string | null | undefined;
65
- registrationNumber?: string | null | undefined;
324
+ dateOfEvent?: string | null | undefined;
325
+ updatedAtLocation?: string | null | undefined;
326
+ updatedBy?: string | null | undefined;
66
327
  }, {
67
328
  type: string;
68
329
  id: string;
69
330
  status: "ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED";
70
331
  createdAt: string;
71
332
  createdBy: string;
72
- createdAtLocation: string;
333
+ updatedAt: string;
73
334
  trackingId: string;
74
- modifiedAt: string;
75
- updatedBy: string;
335
+ legalStatuses: {
336
+ DECLARED?: {
337
+ createdAt: string;
338
+ createdBy: string;
339
+ createdByRole: string;
340
+ acceptedAt: string;
341
+ createdByUserType?: "system" | "user" | null | undefined;
342
+ createdBySignature?: string | null | undefined;
343
+ createdAtLocation?: string | null | undefined;
344
+ } | null | undefined;
345
+ REGISTERED?: {
346
+ createdAt: string;
347
+ createdBy: string;
348
+ createdByRole: string;
349
+ registrationNumber: string;
350
+ acceptedAt: string;
351
+ createdByUserType?: "system" | "user" | null | undefined;
352
+ createdBySignature?: string | null | undefined;
353
+ createdAtLocation?: string | null | undefined;
354
+ } | null | undefined;
355
+ };
356
+ updatedByUserRole: string;
357
+ flags: string[];
358
+ createdByUserType?: "system" | "user" | null | undefined;
359
+ createdBySignature?: string | null | undefined;
360
+ createdAtLocation?: string | null | undefined;
76
361
  assignedTo?: string | null | undefined;
77
- registrationNumber?: string | null | undefined;
362
+ dateOfEvent?: string | null | undefined;
363
+ updatedAtLocation?: string | null | undefined;
364
+ updatedBy?: string | null | undefined;
78
365
  }>;
79
366
  export type EventMetadata = z.infer<typeof EventMetadata>;
80
- export type EventMetadataKeys = `event.${keyof EventMetadata}`;
367
+ export declare const EventMetadataKeysArray: readonly ["id", "type", "status", "createdAt", "dateOfEvent", "createdBy", "createdByUserType", "updatedByUserRole", "createdAtLocation", "updatedAtLocation", "updatedAt", "assignedTo", "updatedBy", "trackingId", "legalStatuses", "flags"];
368
+ export declare const EventMetadataKeys: z.ZodEnum<["id", "type", "status", "createdAt", "dateOfEvent", "createdBy", "createdByUserType", "updatedByUserRole", "createdAtLocation", "updatedAtLocation", "updatedAt", "assignedTo", "updatedBy", "trackingId", "legalStatuses", "flags"]>;
369
+ export type EventMetadataKeys = z.infer<typeof EventMetadataKeys>;
81
370
  /**
82
371
  * Mapping of event metadata keys to translation configuration.
83
372
  * Consider introducing type in same manner as we have in FieldConfig.
84
373
  * We need a way to know how to parse it.
85
374
  */
86
- export declare const eventMetadataLabelMap: Record<EventMetadataKeys, TranslationConfig>;
375
+ export declare const eventMetadataLabelMap: Record<Exclude<`event.${EventMetadataKeys}`, 'event.legalStatuses'>, TranslationConfig>;
87
376
  //# sourceMappingURL=EventMetadata.d.ts.map