@opencrvs/toolkit 1.8.0-rc.f7e8fb5 → 1.8.0-rc.f8296f8

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 (49) hide show
  1. package/README.md +1 -1
  2. package/dist/commons/api/router.d.ts +15240 -10314
  3. package/dist/commons/conditionals/conditionals.d.ts +33 -6
  4. package/dist/commons/conditionals/validate-address.test.d.ts +2 -0
  5. package/dist/commons/conditionals/validate.d.ts +39 -17
  6. package/dist/commons/conditionals/validate.test.d.ts +2 -0
  7. package/dist/commons/events/ActionConfig.d.ts +103709 -2005
  8. package/dist/commons/events/ActionDocument.d.ts +10074 -380
  9. package/dist/commons/events/ActionInput.d.ts +5484 -547
  10. package/dist/commons/events/ActionType.d.ts +26 -11
  11. package/dist/commons/events/AdvancedSearchConfig.d.ts +957 -22
  12. package/dist/commons/events/CompositeFieldValue.d.ts +155 -2
  13. package/dist/commons/events/Conditional.d.ts +21 -5
  14. package/dist/commons/events/Constants.d.ts +2 -0
  15. package/dist/commons/events/CountryConfigQueryInput.d.ts +2982 -0
  16. package/dist/commons/events/CreatedAtLocation.d.ts +2 -0
  17. package/dist/commons/events/Draft.d.ts +384 -63
  18. package/dist/commons/events/EventConfig.d.ts +49921 -1795
  19. package/dist/commons/events/EventConfigInput.d.ts +6 -3
  20. package/dist/commons/events/EventDocument.d.ts +3733 -517
  21. package/dist/commons/events/EventIndex.d.ts +1330 -15
  22. package/dist/commons/events/EventMetadata.d.ts +272 -13
  23. package/dist/commons/events/FieldConfig.d.ts +4765 -787
  24. package/dist/commons/events/FieldType.d.ts +4 -3
  25. package/dist/commons/events/FieldTypeMapping.d.ts +164 -6
  26. package/dist/commons/events/FieldValue.d.ts +82 -5
  27. package/dist/commons/events/FormConfig.d.ts +43810 -73
  28. package/dist/commons/events/PageConfig.d.ts +10991 -0
  29. package/dist/commons/events/SummaryConfig.d.ts +95 -39
  30. package/dist/commons/events/TemplateConfig.d.ts +5 -5
  31. package/dist/commons/events/User.d.ts +31 -2
  32. package/dist/commons/events/WorkqueueColumnConfig.d.ts +53 -0
  33. package/dist/commons/events/WorkqueueConfig.d.ts +4525 -20
  34. package/dist/commons/events/defineConfig.d.ts +8010 -223
  35. package/dist/commons/events/event.d.ts +54 -0
  36. package/dist/commons/events/field.d.ts +82 -0
  37. package/dist/commons/events/index.d.ts +9 -1
  38. package/dist/commons/events/scopes.d.ts +45 -0
  39. package/dist/commons/events/serializer.d.ts +2 -0
  40. package/dist/commons/events/test.utils.d.ts +153 -242
  41. package/dist/commons/events/transactions.d.ts +1 -1
  42. package/dist/commons/events/utils.d.ts +3740 -98
  43. package/dist/commons/events/utils.test.d.ts +2 -0
  44. package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
  45. package/dist/conditionals/index.js +215 -110
  46. package/dist/events/index.js +4519 -1910
  47. package/dist/scopes/index.d.ts +158 -1
  48. package/dist/scopes/index.js +152 -1
  49. package/package.json +3 -2
@@ -1,15 +1,18 @@
1
1
  import { z } from 'zod';
2
- import { ActionType } from './ActionType';
3
2
  export declare const Draft: z.ZodObject<{
4
- id: z.ZodString;
5
- eventId: z.ZodString;
3
+ id: z.ZodBranded<z.ZodString, "UUID">;
4
+ eventId: z.ZodBranded<z.ZodString, "UUID">;
6
5
  transactionId: z.ZodString;
7
6
  createdAt: z.ZodString;
8
7
  action: z.ZodObject<Omit<z.objectUtil.extendShape<{
9
8
  id: z.ZodString;
9
+ transactionId: z.ZodString;
10
10
  createdAt: z.ZodString;
11
11
  createdBy: z.ZodString;
12
- data: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
12
+ createdByRole: z.ZodString;
13
+ createdBySignature: z.ZodOptional<z.ZodNullable<z.ZodString>>;
14
+ createdAtLocation: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodString, "UUID">>>;
15
+ declaration: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
13
16
  filename: z.ZodString;
14
17
  originalFilename: z.ZodString;
15
18
  type: z.ZodString;
@@ -38,6 +41,7 @@ export declare const Draft: z.ZodObject<{
38
41
  originalFilename: string;
39
42
  }>, "many">, z.ZodObject<z.objectUtil.extendShape<{
40
43
  country: z.ZodString;
44
+ addressType: z.ZodLiteral<"DOMESTIC">;
41
45
  province: z.ZodString;
42
46
  district: z.ZodString;
43
47
  }, {
@@ -50,6 +54,7 @@ export declare const Draft: z.ZodObject<{
50
54
  }>, "strip", z.ZodTypeAny, {
51
55
  country: string;
52
56
  district: string;
57
+ addressType: "DOMESTIC";
53
58
  province: string;
54
59
  urbanOrRural: "URBAN";
55
60
  number?: string | null | undefined;
@@ -60,6 +65,7 @@ export declare const Draft: z.ZodObject<{
60
65
  }, {
61
66
  country: string;
62
67
  district: string;
68
+ addressType: "DOMESTIC";
63
69
  province: string;
64
70
  urbanOrRural: "URBAN";
65
71
  number?: string | null | undefined;
@@ -69,6 +75,7 @@ export declare const Draft: z.ZodObject<{
69
75
  zipCode?: string | null | undefined;
70
76
  }>, z.ZodObject<z.objectUtil.extendShape<{
71
77
  country: z.ZodString;
78
+ addressType: z.ZodLiteral<"DOMESTIC">;
72
79
  province: z.ZodString;
73
80
  district: z.ZodString;
74
81
  }, {
@@ -77,17 +84,49 @@ export declare const Draft: z.ZodObject<{
77
84
  }>, "strip", z.ZodTypeAny, {
78
85
  country: string;
79
86
  district: string;
87
+ addressType: "DOMESTIC";
80
88
  province: string;
81
89
  urbanOrRural: "RURAL";
82
90
  village?: string | null | undefined;
83
91
  }, {
84
92
  country: string;
85
93
  district: string;
94
+ addressType: "DOMESTIC";
86
95
  province: string;
87
96
  urbanOrRural: "RURAL";
88
97
  village?: string | null | undefined;
98
+ }>, z.ZodUndefined, z.ZodObject<{
99
+ country: z.ZodString;
100
+ addressType: z.ZodLiteral<"INTERNATIONAL">;
101
+ state: z.ZodString;
102
+ district2: z.ZodString;
103
+ cityOrTown: z.ZodOptional<z.ZodNullable<z.ZodString>>;
104
+ addressLine1: z.ZodOptional<z.ZodNullable<z.ZodString>>;
105
+ addressLine2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
106
+ addressLine3: z.ZodOptional<z.ZodNullable<z.ZodString>>;
107
+ postcodeOrZip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
108
+ }, "strip", z.ZodTypeAny, {
109
+ country: string;
110
+ state: string;
111
+ addressType: "INTERNATIONAL";
112
+ district2: string;
113
+ cityOrTown?: string | null | undefined;
114
+ addressLine1?: string | null | undefined;
115
+ addressLine2?: string | null | undefined;
116
+ addressLine3?: string | null | undefined;
117
+ postcodeOrZip?: string | null | undefined;
118
+ }, {
119
+ country: string;
120
+ state: string;
121
+ addressType: "INTERNATIONAL";
122
+ district2: string;
123
+ cityOrTown?: string | null | undefined;
124
+ addressLine1?: string | null | undefined;
125
+ addressLine2?: string | null | undefined;
126
+ addressLine3?: string | null | undefined;
127
+ postcodeOrZip?: string | null | undefined;
89
128
  }>]>>;
90
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
129
+ annotation: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
91
130
  filename: z.ZodString;
92
131
  originalFilename: z.ZodString;
93
132
  type: z.ZodString;
@@ -116,6 +155,7 @@ export declare const Draft: z.ZodObject<{
116
155
  originalFilename: string;
117
156
  }>, "many">, z.ZodObject<z.objectUtil.extendShape<{
118
157
  country: z.ZodString;
158
+ addressType: z.ZodLiteral<"DOMESTIC">;
119
159
  province: z.ZodString;
120
160
  district: z.ZodString;
121
161
  }, {
@@ -128,6 +168,7 @@ export declare const Draft: z.ZodObject<{
128
168
  }>, "strip", z.ZodTypeAny, {
129
169
  country: string;
130
170
  district: string;
171
+ addressType: "DOMESTIC";
131
172
  province: string;
132
173
  urbanOrRural: "URBAN";
133
174
  number?: string | null | undefined;
@@ -138,6 +179,7 @@ export declare const Draft: z.ZodObject<{
138
179
  }, {
139
180
  country: string;
140
181
  district: string;
182
+ addressType: "DOMESTIC";
141
183
  province: string;
142
184
  urbanOrRural: "URBAN";
143
185
  number?: string | null | undefined;
@@ -147,6 +189,7 @@ export declare const Draft: z.ZodObject<{
147
189
  zipCode?: string | null | undefined;
148
190
  }>, z.ZodObject<z.objectUtil.extendShape<{
149
191
  country: z.ZodString;
192
+ addressType: z.ZodLiteral<"DOMESTIC">;
150
193
  province: z.ZodString;
151
194
  district: z.ZodString;
152
195
  }, {
@@ -155,28 +198,67 @@ export declare const Draft: z.ZodObject<{
155
198
  }>, "strip", z.ZodTypeAny, {
156
199
  country: string;
157
200
  district: string;
201
+ addressType: "DOMESTIC";
158
202
  province: string;
159
203
  urbanOrRural: "RURAL";
160
204
  village?: string | null | undefined;
161
205
  }, {
162
206
  country: string;
163
207
  district: string;
208
+ addressType: "DOMESTIC";
164
209
  province: string;
165
210
  urbanOrRural: "RURAL";
166
211
  village?: string | null | undefined;
167
- }>]>>>;
168
- createdAtLocation: z.ZodString;
212
+ }>, z.ZodUndefined, z.ZodObject<{
213
+ country: z.ZodString;
214
+ addressType: z.ZodLiteral<"INTERNATIONAL">;
215
+ state: z.ZodString;
216
+ district2: z.ZodString;
217
+ cityOrTown: z.ZodOptional<z.ZodNullable<z.ZodString>>;
218
+ addressLine1: z.ZodOptional<z.ZodNullable<z.ZodString>>;
219
+ addressLine2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
220
+ addressLine3: z.ZodOptional<z.ZodNullable<z.ZodString>>;
221
+ postcodeOrZip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
222
+ }, "strip", z.ZodTypeAny, {
223
+ country: string;
224
+ state: string;
225
+ addressType: "INTERNATIONAL";
226
+ district2: string;
227
+ cityOrTown?: string | null | undefined;
228
+ addressLine1?: string | null | undefined;
229
+ addressLine2?: string | null | undefined;
230
+ addressLine3?: string | null | undefined;
231
+ postcodeOrZip?: string | null | undefined;
232
+ }, {
233
+ country: string;
234
+ state: string;
235
+ addressType: "INTERNATIONAL";
236
+ district2: string;
237
+ cityOrTown?: string | null | undefined;
238
+ addressLine1?: string | null | undefined;
239
+ addressLine2?: string | null | undefined;
240
+ addressLine3?: string | null | undefined;
241
+ postcodeOrZip?: string | null | undefined;
242
+ }>]>>>>;
243
+ status: z.ZodEnum<["Requested", "Accepted", "Rejected"]>;
244
+ originalActionId: z.ZodNullable<z.ZodOptional<z.ZodBranded<z.ZodString, "UUID">>>;
169
245
  }, {
170
- type: z.ZodEnum<[ActionType, ...ActionType[]]>;
246
+ type: z.ZodEnum<["DELETE", "CREATE", "NOTIFY", "DECLARE", "VALIDATE", "REGISTER", "DETECT_DUPLICATE", "REJECT", "MARKED_AS_DUPLICATE", "ARCHIVE", "PRINT_CERTIFICATE", "REQUEST_CORRECTION", "REJECT_CORRECTION", "APPROVE_CORRECTION", "READ", "ASSIGN", "UNASSIGN"]>;
171
247
  }>, "id">, "strip", z.ZodTypeAny, {
172
- type: ActionType;
173
- data: Record<string, string | number | boolean | {
248
+ type: "DECLARE" | "REGISTER" | "VALIDATE" | "DELETE" | "CREATE" | "NOTIFY" | "DETECT_DUPLICATE" | "REJECT" | "MARKED_AS_DUPLICATE" | "ARCHIVE" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "REJECT_CORRECTION" | "APPROVE_CORRECTION" | "READ" | "ASSIGN" | "UNASSIGN";
249
+ status: "Rejected" | "Requested" | "Accepted";
250
+ transactionId: string;
251
+ createdAt: string;
252
+ createdBy: string;
253
+ createdByRole: string;
254
+ declaration: Record<string, string | number | boolean | {
174
255
  type: string;
175
256
  filename: string;
176
257
  originalFilename: string;
177
258
  } | {
178
259
  country: string;
179
260
  district: string;
261
+ addressType: "DOMESTIC";
180
262
  province: string;
181
263
  urbanOrRural: "URBAN";
182
264
  number?: string | null | undefined;
@@ -187,25 +269,36 @@ export declare const Draft: z.ZodObject<{
187
269
  } | {
188
270
  country: string;
189
271
  district: string;
272
+ addressType: "DOMESTIC";
190
273
  province: string;
191
274
  urbanOrRural: "RURAL";
192
275
  village?: string | null | undefined;
276
+ } | {
277
+ country: string;
278
+ state: string;
279
+ addressType: "INTERNATIONAL";
280
+ district2: string;
281
+ cityOrTown?: string | null | undefined;
282
+ addressLine1?: string | null | undefined;
283
+ addressLine2?: string | null | undefined;
284
+ addressLine3?: string | null | undefined;
285
+ postcodeOrZip?: string | null | undefined;
193
286
  } | {
194
287
  type: string;
195
288
  option: string;
196
289
  filename: string;
197
290
  originalFilename: string;
198
- }[]>;
199
- createdAt: string;
200
- createdBy: string;
201
- createdAtLocation: string;
202
- metadata?: Record<string, string | number | boolean | {
291
+ }[] | [string, string] | undefined>;
292
+ createdBySignature?: string | null | undefined;
293
+ createdAtLocation?: (string & z.BRAND<"UUID">) | null | undefined;
294
+ annotation?: Record<string, string | number | boolean | {
203
295
  type: string;
204
296
  filename: string;
205
297
  originalFilename: string;
206
298
  } | {
207
299
  country: string;
208
300
  district: string;
301
+ addressType: "DOMESTIC";
209
302
  province: string;
210
303
  urbanOrRural: "URBAN";
211
304
  number?: string | null | undefined;
@@ -216,24 +309,42 @@ export declare const Draft: z.ZodObject<{
216
309
  } | {
217
310
  country: string;
218
311
  district: string;
312
+ addressType: "DOMESTIC";
219
313
  province: string;
220
314
  urbanOrRural: "RURAL";
221
315
  village?: string | null | undefined;
316
+ } | {
317
+ country: string;
318
+ state: string;
319
+ addressType: "INTERNATIONAL";
320
+ district2: string;
321
+ cityOrTown?: string | null | undefined;
322
+ addressLine1?: string | null | undefined;
323
+ addressLine2?: string | null | undefined;
324
+ addressLine3?: string | null | undefined;
325
+ postcodeOrZip?: string | null | undefined;
222
326
  } | {
223
327
  type: string;
224
328
  option: string;
225
329
  filename: string;
226
330
  originalFilename: string;
227
- }[]> | undefined;
331
+ }[] | [string, string] | undefined> | null | undefined;
332
+ originalActionId?: (string & z.BRAND<"UUID">) | null | undefined;
228
333
  }, {
229
- type: ActionType;
230
- data: Record<string, string | number | boolean | {
334
+ type: "DECLARE" | "REGISTER" | "VALIDATE" | "DELETE" | "CREATE" | "NOTIFY" | "DETECT_DUPLICATE" | "REJECT" | "MARKED_AS_DUPLICATE" | "ARCHIVE" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "REJECT_CORRECTION" | "APPROVE_CORRECTION" | "READ" | "ASSIGN" | "UNASSIGN";
335
+ status: "Rejected" | "Requested" | "Accepted";
336
+ transactionId: string;
337
+ createdAt: string;
338
+ createdBy: string;
339
+ createdByRole: string;
340
+ declaration: Record<string, string | number | boolean | {
231
341
  type: string;
232
342
  filename: string;
233
343
  originalFilename: string;
234
344
  } | {
235
345
  country: string;
236
346
  district: string;
347
+ addressType: "DOMESTIC";
237
348
  province: string;
238
349
  urbanOrRural: "URBAN";
239
350
  number?: string | null | undefined;
@@ -244,25 +355,36 @@ export declare const Draft: z.ZodObject<{
244
355
  } | {
245
356
  country: string;
246
357
  district: string;
358
+ addressType: "DOMESTIC";
247
359
  province: string;
248
360
  urbanOrRural: "RURAL";
249
361
  village?: string | null | undefined;
362
+ } | {
363
+ country: string;
364
+ state: string;
365
+ addressType: "INTERNATIONAL";
366
+ district2: string;
367
+ cityOrTown?: string | null | undefined;
368
+ addressLine1?: string | null | undefined;
369
+ addressLine2?: string | null | undefined;
370
+ addressLine3?: string | null | undefined;
371
+ postcodeOrZip?: string | null | undefined;
250
372
  } | {
251
373
  type: string;
252
374
  option: string;
253
375
  filename: string;
254
376
  originalFilename: string;
255
- }[]>;
256
- createdAt: string;
257
- createdBy: string;
258
- createdAtLocation: string;
259
- metadata?: Record<string, string | number | boolean | {
377
+ }[] | [string, string] | undefined>;
378
+ createdBySignature?: string | null | undefined;
379
+ createdAtLocation?: string | null | undefined;
380
+ annotation?: Record<string, string | number | boolean | {
260
381
  type: string;
261
382
  filename: string;
262
383
  originalFilename: string;
263
384
  } | {
264
385
  country: string;
265
386
  district: string;
387
+ addressType: "DOMESTIC";
266
388
  province: string;
267
389
  urbanOrRural: "URBAN";
268
390
  number?: string | null | undefined;
@@ -273,30 +395,48 @@ export declare const Draft: z.ZodObject<{
273
395
  } | {
274
396
  country: string;
275
397
  district: string;
398
+ addressType: "DOMESTIC";
276
399
  province: string;
277
400
  urbanOrRural: "RURAL";
278
401
  village?: string | null | undefined;
402
+ } | {
403
+ country: string;
404
+ state: string;
405
+ addressType: "INTERNATIONAL";
406
+ district2: string;
407
+ cityOrTown?: string | null | undefined;
408
+ addressLine1?: string | null | undefined;
409
+ addressLine2?: string | null | undefined;
410
+ addressLine3?: string | null | undefined;
411
+ postcodeOrZip?: string | null | undefined;
279
412
  } | {
280
413
  type: string;
281
414
  option: string;
282
415
  filename: string;
283
416
  originalFilename: string;
284
- }[]> | undefined;
417
+ }[] | [string, string] | undefined> | null | undefined;
418
+ originalActionId?: string | null | undefined;
285
419
  }>;
286
420
  }, "strip", z.ZodTypeAny, {
287
- id: string;
288
- createdAt: string;
289
- eventId: string;
421
+ id: string & z.BRAND<"UUID">;
290
422
  transactionId: string;
423
+ createdAt: string;
424
+ eventId: string & z.BRAND<"UUID">;
291
425
  action: {
292
- type: ActionType;
293
- data: Record<string, string | number | boolean | {
426
+ type: "DECLARE" | "REGISTER" | "VALIDATE" | "DELETE" | "CREATE" | "NOTIFY" | "DETECT_DUPLICATE" | "REJECT" | "MARKED_AS_DUPLICATE" | "ARCHIVE" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "REJECT_CORRECTION" | "APPROVE_CORRECTION" | "READ" | "ASSIGN" | "UNASSIGN";
427
+ status: "Rejected" | "Requested" | "Accepted";
428
+ transactionId: string;
429
+ createdAt: string;
430
+ createdBy: string;
431
+ createdByRole: string;
432
+ declaration: Record<string, string | number | boolean | {
294
433
  type: string;
295
434
  filename: string;
296
435
  originalFilename: string;
297
436
  } | {
298
437
  country: string;
299
438
  district: string;
439
+ addressType: "DOMESTIC";
300
440
  province: string;
301
441
  urbanOrRural: "URBAN";
302
442
  number?: string | null | undefined;
@@ -307,25 +447,36 @@ export declare const Draft: z.ZodObject<{
307
447
  } | {
308
448
  country: string;
309
449
  district: string;
450
+ addressType: "DOMESTIC";
310
451
  province: string;
311
452
  urbanOrRural: "RURAL";
312
453
  village?: string | null | undefined;
454
+ } | {
455
+ country: string;
456
+ state: string;
457
+ addressType: "INTERNATIONAL";
458
+ district2: string;
459
+ cityOrTown?: string | null | undefined;
460
+ addressLine1?: string | null | undefined;
461
+ addressLine2?: string | null | undefined;
462
+ addressLine3?: string | null | undefined;
463
+ postcodeOrZip?: string | null | undefined;
313
464
  } | {
314
465
  type: string;
315
466
  option: string;
316
467
  filename: string;
317
468
  originalFilename: string;
318
- }[]>;
319
- createdAt: string;
320
- createdBy: string;
321
- createdAtLocation: string;
322
- metadata?: Record<string, string | number | boolean | {
469
+ }[] | [string, string] | undefined>;
470
+ createdBySignature?: string | null | undefined;
471
+ createdAtLocation?: (string & z.BRAND<"UUID">) | null | undefined;
472
+ annotation?: Record<string, string | number | boolean | {
323
473
  type: string;
324
474
  filename: string;
325
475
  originalFilename: string;
326
476
  } | {
327
477
  country: string;
328
478
  district: string;
479
+ addressType: "DOMESTIC";
329
480
  province: string;
330
481
  urbanOrRural: "URBAN";
331
482
  number?: string | null | undefined;
@@ -336,30 +487,48 @@ export declare const Draft: z.ZodObject<{
336
487
  } | {
337
488
  country: string;
338
489
  district: string;
490
+ addressType: "DOMESTIC";
339
491
  province: string;
340
492
  urbanOrRural: "RURAL";
341
493
  village?: string | null | undefined;
494
+ } | {
495
+ country: string;
496
+ state: string;
497
+ addressType: "INTERNATIONAL";
498
+ district2: string;
499
+ cityOrTown?: string | null | undefined;
500
+ addressLine1?: string | null | undefined;
501
+ addressLine2?: string | null | undefined;
502
+ addressLine3?: string | null | undefined;
503
+ postcodeOrZip?: string | null | undefined;
342
504
  } | {
343
505
  type: string;
344
506
  option: string;
345
507
  filename: string;
346
508
  originalFilename: string;
347
- }[]> | undefined;
509
+ }[] | [string, string] | undefined> | null | undefined;
510
+ originalActionId?: (string & z.BRAND<"UUID">) | null | undefined;
348
511
  };
349
512
  }, {
350
513
  id: string;
514
+ transactionId: string;
351
515
  createdAt: string;
352
516
  eventId: string;
353
- transactionId: string;
354
517
  action: {
355
- type: ActionType;
356
- data: Record<string, string | number | boolean | {
518
+ type: "DECLARE" | "REGISTER" | "VALIDATE" | "DELETE" | "CREATE" | "NOTIFY" | "DETECT_DUPLICATE" | "REJECT" | "MARKED_AS_DUPLICATE" | "ARCHIVE" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "REJECT_CORRECTION" | "APPROVE_CORRECTION" | "READ" | "ASSIGN" | "UNASSIGN";
519
+ status: "Rejected" | "Requested" | "Accepted";
520
+ transactionId: string;
521
+ createdAt: string;
522
+ createdBy: string;
523
+ createdByRole: string;
524
+ declaration: Record<string, string | number | boolean | {
357
525
  type: string;
358
526
  filename: string;
359
527
  originalFilename: string;
360
528
  } | {
361
529
  country: string;
362
530
  district: string;
531
+ addressType: "DOMESTIC";
363
532
  province: string;
364
533
  urbanOrRural: "URBAN";
365
534
  number?: string | null | undefined;
@@ -370,25 +539,36 @@ export declare const Draft: z.ZodObject<{
370
539
  } | {
371
540
  country: string;
372
541
  district: string;
542
+ addressType: "DOMESTIC";
373
543
  province: string;
374
544
  urbanOrRural: "RURAL";
375
545
  village?: string | null | undefined;
546
+ } | {
547
+ country: string;
548
+ state: string;
549
+ addressType: "INTERNATIONAL";
550
+ district2: string;
551
+ cityOrTown?: string | null | undefined;
552
+ addressLine1?: string | null | undefined;
553
+ addressLine2?: string | null | undefined;
554
+ addressLine3?: string | null | undefined;
555
+ postcodeOrZip?: string | null | undefined;
376
556
  } | {
377
557
  type: string;
378
558
  option: string;
379
559
  filename: string;
380
560
  originalFilename: string;
381
- }[]>;
382
- createdAt: string;
383
- createdBy: string;
384
- createdAtLocation: string;
385
- metadata?: Record<string, string | number | boolean | {
561
+ }[] | [string, string] | undefined>;
562
+ createdBySignature?: string | null | undefined;
563
+ createdAtLocation?: string | null | undefined;
564
+ annotation?: Record<string, string | number | boolean | {
386
565
  type: string;
387
566
  filename: string;
388
567
  originalFilename: string;
389
568
  } | {
390
569
  country: string;
391
570
  district: string;
571
+ addressType: "DOMESTIC";
392
572
  province: string;
393
573
  urbanOrRural: "URBAN";
394
574
  number?: string | null | undefined;
@@ -399,21 +579,33 @@ export declare const Draft: z.ZodObject<{
399
579
  } | {
400
580
  country: string;
401
581
  district: string;
582
+ addressType: "DOMESTIC";
402
583
  province: string;
403
584
  urbanOrRural: "RURAL";
404
585
  village?: string | null | undefined;
586
+ } | {
587
+ country: string;
588
+ state: string;
589
+ addressType: "INTERNATIONAL";
590
+ district2: string;
591
+ cityOrTown?: string | null | undefined;
592
+ addressLine1?: string | null | undefined;
593
+ addressLine2?: string | null | undefined;
594
+ addressLine3?: string | null | undefined;
595
+ postcodeOrZip?: string | null | undefined;
405
596
  } | {
406
597
  type: string;
407
598
  option: string;
408
599
  filename: string;
409
600
  originalFilename: string;
410
- }[]> | undefined;
601
+ }[] | [string, string] | undefined> | null | undefined;
602
+ originalActionId?: string | null | undefined;
411
603
  };
412
604
  }>;
413
605
  export declare const DraftInput: z.ZodObject<z.objectUtil.extendShape<{
414
- eventId: z.ZodString;
606
+ eventId: z.ZodBranded<z.ZodString, "UUID">;
415
607
  transactionId: z.ZodString;
416
- data: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
608
+ declaration: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
417
609
  filename: z.ZodString;
418
610
  originalFilename: z.ZodString;
419
611
  type: z.ZodString;
@@ -442,6 +634,7 @@ export declare const DraftInput: z.ZodObject<z.objectUtil.extendShape<{
442
634
  originalFilename: string;
443
635
  }>, "many">, z.ZodObject<z.objectUtil.extendShape<{
444
636
  country: z.ZodString;
637
+ addressType: z.ZodLiteral<"DOMESTIC">;
445
638
  province: z.ZodString;
446
639
  district: z.ZodString;
447
640
  }, {
@@ -454,6 +647,7 @@ export declare const DraftInput: z.ZodObject<z.objectUtil.extendShape<{
454
647
  }>, "strip", z.ZodTypeAny, {
455
648
  country: string;
456
649
  district: string;
650
+ addressType: "DOMESTIC";
457
651
  province: string;
458
652
  urbanOrRural: "URBAN";
459
653
  number?: string | null | undefined;
@@ -464,6 +658,7 @@ export declare const DraftInput: z.ZodObject<z.objectUtil.extendShape<{
464
658
  }, {
465
659
  country: string;
466
660
  district: string;
661
+ addressType: "DOMESTIC";
467
662
  province: string;
468
663
  urbanOrRural: "URBAN";
469
664
  number?: string | null | undefined;
@@ -473,6 +668,7 @@ export declare const DraftInput: z.ZodObject<z.objectUtil.extendShape<{
473
668
  zipCode?: string | null | undefined;
474
669
  }>, z.ZodObject<z.objectUtil.extendShape<{
475
670
  country: z.ZodString;
671
+ addressType: z.ZodLiteral<"DOMESTIC">;
476
672
  province: z.ZodString;
477
673
  district: z.ZodString;
478
674
  }, {
@@ -481,17 +677,49 @@ export declare const DraftInput: z.ZodObject<z.objectUtil.extendShape<{
481
677
  }>, "strip", z.ZodTypeAny, {
482
678
  country: string;
483
679
  district: string;
680
+ addressType: "DOMESTIC";
484
681
  province: string;
485
682
  urbanOrRural: "RURAL";
486
683
  village?: string | null | undefined;
487
684
  }, {
488
685
  country: string;
489
686
  district: string;
687
+ addressType: "DOMESTIC";
490
688
  province: string;
491
689
  urbanOrRural: "RURAL";
492
690
  village?: string | null | undefined;
493
- }>]>>;
494
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
691
+ }>, z.ZodUndefined, z.ZodObject<{
692
+ country: z.ZodString;
693
+ addressType: z.ZodLiteral<"INTERNATIONAL">;
694
+ state: z.ZodString;
695
+ district2: z.ZodString;
696
+ cityOrTown: z.ZodOptional<z.ZodNullable<z.ZodString>>;
697
+ addressLine1: z.ZodOptional<z.ZodNullable<z.ZodString>>;
698
+ addressLine2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
699
+ addressLine3: z.ZodOptional<z.ZodNullable<z.ZodString>>;
700
+ postcodeOrZip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
701
+ }, "strip", z.ZodTypeAny, {
702
+ country: string;
703
+ state: string;
704
+ addressType: "INTERNATIONAL";
705
+ district2: string;
706
+ cityOrTown?: string | null | undefined;
707
+ addressLine1?: string | null | undefined;
708
+ addressLine2?: string | null | undefined;
709
+ addressLine3?: string | null | undefined;
710
+ postcodeOrZip?: string | null | undefined;
711
+ }, {
712
+ country: string;
713
+ state: string;
714
+ addressType: "INTERNATIONAL";
715
+ district2: string;
716
+ cityOrTown?: string | null | undefined;
717
+ addressLine1?: string | null | undefined;
718
+ addressLine2?: string | null | undefined;
719
+ addressLine3?: string | null | undefined;
720
+ postcodeOrZip?: string | null | undefined;
721
+ }>]>>>;
722
+ annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
495
723
  filename: z.ZodString;
496
724
  originalFilename: z.ZodString;
497
725
  type: z.ZodString;
@@ -520,6 +748,7 @@ export declare const DraftInput: z.ZodObject<z.objectUtil.extendShape<{
520
748
  originalFilename: string;
521
749
  }>, "many">, z.ZodObject<z.objectUtil.extendShape<{
522
750
  country: z.ZodString;
751
+ addressType: z.ZodLiteral<"DOMESTIC">;
523
752
  province: z.ZodString;
524
753
  district: z.ZodString;
525
754
  }, {
@@ -532,6 +761,7 @@ export declare const DraftInput: z.ZodObject<z.objectUtil.extendShape<{
532
761
  }>, "strip", z.ZodTypeAny, {
533
762
  country: string;
534
763
  district: string;
764
+ addressType: "DOMESTIC";
535
765
  province: string;
536
766
  urbanOrRural: "URBAN";
537
767
  number?: string | null | undefined;
@@ -542,6 +772,7 @@ export declare const DraftInput: z.ZodObject<z.objectUtil.extendShape<{
542
772
  }, {
543
773
  country: string;
544
774
  district: string;
775
+ addressType: "DOMESTIC";
545
776
  province: string;
546
777
  urbanOrRural: "URBAN";
547
778
  number?: string | null | undefined;
@@ -551,6 +782,7 @@ export declare const DraftInput: z.ZodObject<z.objectUtil.extendShape<{
551
782
  zipCode?: string | null | undefined;
552
783
  }>, z.ZodObject<z.objectUtil.extendShape<{
553
784
  country: z.ZodString;
785
+ addressType: z.ZodLiteral<"DOMESTIC">;
554
786
  province: z.ZodString;
555
787
  district: z.ZodString;
556
788
  }, {
@@ -559,27 +791,65 @@ export declare const DraftInput: z.ZodObject<z.objectUtil.extendShape<{
559
791
  }>, "strip", z.ZodTypeAny, {
560
792
  country: string;
561
793
  district: string;
794
+ addressType: "DOMESTIC";
562
795
  province: string;
563
796
  urbanOrRural: "RURAL";
564
797
  village?: string | null | undefined;
565
798
  }, {
566
799
  country: string;
567
800
  district: string;
801
+ addressType: "DOMESTIC";
568
802
  province: string;
569
803
  urbanOrRural: "RURAL";
570
804
  village?: string | null | undefined;
805
+ }>, z.ZodUndefined, z.ZodObject<{
806
+ country: z.ZodString;
807
+ addressType: z.ZodLiteral<"INTERNATIONAL">;
808
+ state: z.ZodString;
809
+ district2: z.ZodString;
810
+ cityOrTown: z.ZodOptional<z.ZodNullable<z.ZodString>>;
811
+ addressLine1: z.ZodOptional<z.ZodNullable<z.ZodString>>;
812
+ addressLine2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
813
+ addressLine3: z.ZodOptional<z.ZodNullable<z.ZodString>>;
814
+ postcodeOrZip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
815
+ }, "strip", z.ZodTypeAny, {
816
+ country: string;
817
+ state: string;
818
+ addressType: "INTERNATIONAL";
819
+ district2: string;
820
+ cityOrTown?: string | null | undefined;
821
+ addressLine1?: string | null | undefined;
822
+ addressLine2?: string | null | undefined;
823
+ addressLine3?: string | null | undefined;
824
+ postcodeOrZip?: string | null | undefined;
825
+ }, {
826
+ country: string;
827
+ state: string;
828
+ addressType: "INTERNATIONAL";
829
+ district2: string;
830
+ cityOrTown?: string | null | undefined;
831
+ addressLine1?: string | null | undefined;
832
+ addressLine2?: string | null | undefined;
833
+ addressLine3?: string | null | undefined;
834
+ postcodeOrZip?: string | null | undefined;
571
835
  }>]>>>;
836
+ originalActionId: z.ZodOptional<z.ZodBranded<z.ZodString, "UUID">>;
837
+ keepAssignment: z.ZodOptional<z.ZodBoolean>;
572
838
  }, {
573
- type: z.ZodEnum<[ActionType, ...ActionType[]]>;
839
+ type: z.ZodEnum<["DELETE", "CREATE", "NOTIFY", "DECLARE", "VALIDATE", "REGISTER", "DETECT_DUPLICATE", "REJECT", "MARKED_AS_DUPLICATE", "ARCHIVE", "PRINT_CERTIFICATE", "REQUEST_CORRECTION", "REJECT_CORRECTION", "APPROVE_CORRECTION", "READ", "ASSIGN", "UNASSIGN"]>;
840
+ status: z.ZodEnum<["Requested", "Accepted", "Rejected"]>;
574
841
  }>, "strip", z.ZodTypeAny, {
575
- type: ActionType;
576
- data: Record<string, string | number | boolean | {
842
+ type: "DECLARE" | "REGISTER" | "VALIDATE" | "DELETE" | "CREATE" | "NOTIFY" | "DETECT_DUPLICATE" | "REJECT" | "MARKED_AS_DUPLICATE" | "ARCHIVE" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "REJECT_CORRECTION" | "APPROVE_CORRECTION" | "READ" | "ASSIGN" | "UNASSIGN";
843
+ status: "Rejected" | "Requested" | "Accepted";
844
+ transactionId: string;
845
+ declaration: Record<string, string | number | boolean | {
577
846
  type: string;
578
847
  filename: string;
579
848
  originalFilename: string;
580
849
  } | {
581
850
  country: string;
582
851
  district: string;
852
+ addressType: "DOMESTIC";
583
853
  province: string;
584
854
  urbanOrRural: "URBAN";
585
855
  number?: string | null | undefined;
@@ -590,24 +860,35 @@ export declare const DraftInput: z.ZodObject<z.objectUtil.extendShape<{
590
860
  } | {
591
861
  country: string;
592
862
  district: string;
863
+ addressType: "DOMESTIC";
593
864
  province: string;
594
865
  urbanOrRural: "RURAL";
595
866
  village?: string | null | undefined;
867
+ } | {
868
+ country: string;
869
+ state: string;
870
+ addressType: "INTERNATIONAL";
871
+ district2: string;
872
+ cityOrTown?: string | null | undefined;
873
+ addressLine1?: string | null | undefined;
874
+ addressLine2?: string | null | undefined;
875
+ addressLine3?: string | null | undefined;
876
+ postcodeOrZip?: string | null | undefined;
596
877
  } | {
597
878
  type: string;
598
879
  option: string;
599
880
  filename: string;
600
881
  originalFilename: string;
601
- }[]>;
602
- eventId: string;
603
- transactionId: string;
604
- metadata?: Record<string, string | number | boolean | {
882
+ }[] | [string, string] | undefined>;
883
+ eventId: string & z.BRAND<"UUID">;
884
+ annotation?: Record<string, string | number | boolean | {
605
885
  type: string;
606
886
  filename: string;
607
887
  originalFilename: string;
608
888
  } | {
609
889
  country: string;
610
890
  district: string;
891
+ addressType: "DOMESTIC";
611
892
  province: string;
612
893
  urbanOrRural: "URBAN";
613
894
  number?: string | null | undefined;
@@ -618,24 +899,41 @@ export declare const DraftInput: z.ZodObject<z.objectUtil.extendShape<{
618
899
  } | {
619
900
  country: string;
620
901
  district: string;
902
+ addressType: "DOMESTIC";
621
903
  province: string;
622
904
  urbanOrRural: "RURAL";
623
905
  village?: string | null | undefined;
906
+ } | {
907
+ country: string;
908
+ state: string;
909
+ addressType: "INTERNATIONAL";
910
+ district2: string;
911
+ cityOrTown?: string | null | undefined;
912
+ addressLine1?: string | null | undefined;
913
+ addressLine2?: string | null | undefined;
914
+ addressLine3?: string | null | undefined;
915
+ postcodeOrZip?: string | null | undefined;
624
916
  } | {
625
917
  type: string;
626
918
  option: string;
627
919
  filename: string;
628
920
  originalFilename: string;
629
- }[]> | undefined;
921
+ }[] | [string, string] | undefined> | undefined;
922
+ originalActionId?: (string & z.BRAND<"UUID">) | undefined;
923
+ keepAssignment?: boolean | undefined;
630
924
  }, {
631
- type: ActionType;
632
- data: Record<string, string | number | boolean | {
925
+ type: "DECLARE" | "REGISTER" | "VALIDATE" | "DELETE" | "CREATE" | "NOTIFY" | "DETECT_DUPLICATE" | "REJECT" | "MARKED_AS_DUPLICATE" | "ARCHIVE" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "REJECT_CORRECTION" | "APPROVE_CORRECTION" | "READ" | "ASSIGN" | "UNASSIGN";
926
+ status: "Rejected" | "Requested" | "Accepted";
927
+ transactionId: string;
928
+ eventId: string;
929
+ declaration?: Record<string, string | number | boolean | {
633
930
  type: string;
634
931
  filename: string;
635
932
  originalFilename: string;
636
933
  } | {
637
934
  country: string;
638
935
  district: string;
936
+ addressType: "DOMESTIC";
639
937
  province: string;
640
938
  urbanOrRural: "URBAN";
641
939
  number?: string | null | undefined;
@@ -646,24 +944,34 @@ export declare const DraftInput: z.ZodObject<z.objectUtil.extendShape<{
646
944
  } | {
647
945
  country: string;
648
946
  district: string;
947
+ addressType: "DOMESTIC";
649
948
  province: string;
650
949
  urbanOrRural: "RURAL";
651
950
  village?: string | null | undefined;
951
+ } | {
952
+ country: string;
953
+ state: string;
954
+ addressType: "INTERNATIONAL";
955
+ district2: string;
956
+ cityOrTown?: string | null | undefined;
957
+ addressLine1?: string | null | undefined;
958
+ addressLine2?: string | null | undefined;
959
+ addressLine3?: string | null | undefined;
960
+ postcodeOrZip?: string | null | undefined;
652
961
  } | {
653
962
  type: string;
654
963
  option: string;
655
964
  filename: string;
656
965
  originalFilename: string;
657
- }[]>;
658
- eventId: string;
659
- transactionId: string;
660
- metadata?: Record<string, string | number | boolean | {
966
+ }[] | [string, string] | undefined> | undefined;
967
+ annotation?: Record<string, string | number | boolean | {
661
968
  type: string;
662
969
  filename: string;
663
970
  originalFilename: string;
664
971
  } | {
665
972
  country: string;
666
973
  district: string;
974
+ addressType: "DOMESTIC";
667
975
  province: string;
668
976
  urbanOrRural: "URBAN";
669
977
  number?: string | null | undefined;
@@ -674,15 +982,28 @@ export declare const DraftInput: z.ZodObject<z.objectUtil.extendShape<{
674
982
  } | {
675
983
  country: string;
676
984
  district: string;
985
+ addressType: "DOMESTIC";
677
986
  province: string;
678
987
  urbanOrRural: "RURAL";
679
988
  village?: string | null | undefined;
989
+ } | {
990
+ country: string;
991
+ state: string;
992
+ addressType: "INTERNATIONAL";
993
+ district2: string;
994
+ cityOrTown?: string | null | undefined;
995
+ addressLine1?: string | null | undefined;
996
+ addressLine2?: string | null | undefined;
997
+ addressLine3?: string | null | undefined;
998
+ postcodeOrZip?: string | null | undefined;
680
999
  } | {
681
1000
  type: string;
682
1001
  option: string;
683
1002
  filename: string;
684
1003
  originalFilename: string;
685
- }[]> | undefined;
1004
+ }[] | [string, string] | undefined> | undefined;
1005
+ originalActionId?: string | undefined;
1006
+ keepAssignment?: boolean | undefined;
686
1007
  }>;
687
1008
  export type Draft = z.infer<typeof Draft>;
688
1009
  export type DraftInput = z.infer<typeof DraftInput>;