@opencrvs/toolkit 1.8.0-rc.f7910f3 → 1.8.0-rc.f7aaf07

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 (46) hide show
  1. package/README.md +1 -1
  2. package/dist/commons/api/router.d.ts +20619 -14618
  3. package/dist/commons/conditionals/conditionals.d.ts +36 -6
  4. package/dist/commons/conditionals/validate.d.ts +18 -17
  5. package/dist/commons/events/ActionConfig.d.ts +116370 -6084
  6. package/dist/commons/events/ActionDocument.d.ts +9528 -401
  7. package/dist/commons/events/ActionInput.d.ts +3536 -519
  8. package/dist/commons/events/ActionType.d.ts +32 -16
  9. package/dist/commons/events/AdvancedSearchConfig.d.ts +1233 -22
  10. package/dist/commons/events/CompositeFieldValue.d.ts +31 -0
  11. package/dist/commons/events/Conditional.d.ts +21 -5
  12. package/dist/commons/events/Constants.d.ts +3 -0
  13. package/dist/commons/events/CountryConfigQueryInput.d.ts +3068 -0
  14. package/dist/commons/events/CreatedAtLocation.d.ts +3 -0
  15. package/dist/commons/events/Draft.d.ts +193 -59
  16. package/dist/commons/events/EventConfig.d.ts +55962 -3150
  17. package/dist/commons/events/EventConfigInput.d.ts +5 -2
  18. package/dist/commons/events/EventDocument.d.ts +2192 -552
  19. package/dist/commons/events/EventIndex.d.ts +2026 -22
  20. package/dist/commons/events/EventMetadata.d.ts +332 -40
  21. package/dist/commons/events/FieldConfig.d.ts +5678 -1061
  22. package/dist/commons/events/FieldType.d.ts +6 -3
  23. package/dist/commons/events/FieldTypeMapping.d.ts +103 -54
  24. package/dist/commons/events/FieldValue.d.ts +49 -8
  25. package/dist/commons/events/FormConfig.d.ts +49225 -346
  26. package/dist/commons/events/PageConfig.d.ts +12337 -0
  27. package/dist/commons/events/SummaryConfig.d.ts +93 -42
  28. package/dist/commons/events/TemplateConfig.d.ts +5 -5
  29. package/dist/commons/events/User.d.ts +31 -2
  30. package/dist/commons/events/WorkqueueColumnConfig.d.ts +53 -0
  31. package/dist/commons/events/WorkqueueConfig.d.ts +6290 -20
  32. package/dist/commons/events/defineConfig.d.ts +9039 -501
  33. package/dist/commons/events/event.d.ts +54 -0
  34. package/dist/commons/events/field.d.ts +82 -0
  35. package/dist/commons/events/index.d.ts +10 -1
  36. package/dist/commons/events/scopes.d.ts +44 -0
  37. package/dist/commons/events/serializer.d.ts +2 -0
  38. package/dist/commons/events/test.utils.d.ts +161 -300
  39. package/dist/commons/events/utils.d.ts +13384 -186
  40. package/dist/commons/events/utils.test.d.ts +2 -0
  41. package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
  42. package/dist/conditionals/index.js +228 -120
  43. package/dist/events/index.js +5066 -2198
  44. package/dist/scopes/index.d.ts +161 -1
  45. package/dist/scopes/index.js +202 -1
  46. 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,52 +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;
286
+ flags: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNativeEnum<{
287
+ readonly CERTIFICATE_PRINTED: "certificate-printed";
288
+ }>]>, "many">;
53
289
  }, "strip", z.ZodTypeAny, {
54
290
  type: string;
55
291
  id: string;
56
292
  status: "ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED";
57
293
  createdAt: string;
58
294
  createdBy: string;
59
- createdAtLocation: string;
295
+ updatedAt: string;
60
296
  trackingId: string;
61
- modifiedAt: string;
62
- 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;
63
323
  assignedTo?: string | null | undefined;
324
+ dateOfEvent?: string | null | undefined;
325
+ updatedAtLocation?: string | null | undefined;
326
+ updatedBy?: string | null | undefined;
64
327
  }, {
65
328
  type: string;
66
329
  id: string;
67
330
  status: "ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED";
68
331
  createdAt: string;
69
332
  createdBy: string;
70
- createdAtLocation: string;
333
+ updatedAt: string;
71
334
  trackingId: string;
72
- modifiedAt: string;
73
- 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;
74
361
  assignedTo?: string | null | undefined;
362
+ dateOfEvent?: string | null | undefined;
363
+ updatedAtLocation?: string | null | undefined;
364
+ updatedBy?: string | null | undefined;
75
365
  }>;
76
366
  export type EventMetadata = z.infer<typeof EventMetadata>;
77
- 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>;
78
370
  /**
79
371
  * Mapping of event metadata keys to translation configuration.
80
372
  * Consider introducing type in same manner as we have in FieldConfig.
81
373
  * We need a way to know how to parse it.
82
374
  */
83
- export declare const eventMetadataLabelMap: Record<EventMetadataKeys, TranslationConfig>;
375
+ export declare const eventMetadataLabelMap: Record<Exclude<`event.${EventMetadataKeys}`, 'event.legalStatuses'>, TranslationConfig>;
84
376
  //# sourceMappingURL=EventMetadata.d.ts.map