@opencrvs/toolkit 1.8.0-rc.fd6feaa → 1.8.0-rc.fd8a78f

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