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

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