@opencrvs/toolkit 2.1.0 → 2.2.0-rc.9042a13

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 (59) hide show
  1. package/build.sh +2 -2
  2. package/create-countryconfig/package.json +1 -1
  3. package/dist/application-config/index.js +29 -2
  4. package/dist/authentication/index.js +14 -1
  5. package/dist/cli.js +294 -1967
  6. package/dist/commons/api/router.d.ts +1370 -73
  7. package/dist/commons/conditionals/conditionals.d.ts +3 -3
  8. package/dist/commons/events/ActionConfig.d.ts +133 -0
  9. package/dist/commons/events/ActionDocument.d.ts +88 -0
  10. package/dist/commons/events/ActionInput.d.ts +52 -0
  11. package/dist/commons/events/ActionType.d.ts +11 -1
  12. package/dist/commons/events/AdvancedSearchConfig.d.ts +12 -0
  13. package/dist/commons/events/AuditLog.d.ts +4 -0
  14. package/dist/commons/events/CountryConfigQueryInput.d.ts +132 -0
  15. package/dist/commons/events/Draft.d.ts +2 -0
  16. package/dist/commons/events/EventConfig.d.ts +26 -6
  17. package/dist/commons/events/EventDocument.d.ts +88 -0
  18. package/dist/commons/events/EventIndex.d.ts +20 -0
  19. package/dist/commons/events/EventMetadata.d.ts +23 -0
  20. package/dist/commons/events/EventStatus.d.ts +1 -0
  21. package/dist/commons/events/FieldConfig.d.ts +10 -0
  22. package/dist/commons/events/WorkqueueConfig.d.ts +154 -10
  23. package/dist/commons/events/eventConfigValidation.d.ts +17 -1
  24. package/dist/commons/events/scopes.d.ts +2 -0
  25. package/dist/commons/events/state/index.d.ts +10 -2
  26. package/dist/commons/events/state/utils.d.ts +11 -1
  27. package/dist/commons/events/test.utils.d.ts +28 -1
  28. package/dist/commons/events/utils.d.ts +43 -15
  29. package/dist/conditionals/index.js +14 -1
  30. package/dist/environment/derived-variables.d.ts +18 -0
  31. package/dist/environment/derived-variables.d.ts.map +1 -1
  32. package/dist/environment/derived-variables.js +22 -1
  33. package/dist/environment/setup-environment.d.ts.map +1 -1
  34. package/dist/environment/setup-environment.js +29 -10
  35. package/dist/events/index.js +293 -66
  36. package/dist/migrations/add-translations.d.ts +15 -0
  37. package/dist/migrations/add-translations.d.ts.map +1 -0
  38. package/dist/migrations/{v2.1/add-translations.js → add-translations.js} +16 -14
  39. package/dist/migrations/v2.1/index.js +35 -2155
  40. package/dist/migrations/v2.1/migrate-infrastructure-to-assets.d.ts +3 -0
  41. package/dist/migrations/v2.1/migrate-infrastructure-to-assets.d.ts.map +1 -1
  42. package/dist/migrations/v2.1/upgrade-tilt.d.ts +3 -0
  43. package/dist/migrations/v2.1/upgrade-tilt.d.ts.map +1 -1
  44. package/dist/migrations/v2.2/index.d.ts +6 -0
  45. package/dist/migrations/v2.2/index.d.ts.map +1 -0
  46. package/dist/migrations/v2.2/index.js +456 -0
  47. package/dist/migrations/v2.2/read-declaration-through-helper.d.ts +39 -0
  48. package/dist/migrations/v2.2/read-declaration-through-helper.d.ts.map +1 -0
  49. package/dist/migrations/v2.2/read-declaration-through-helper.js +257 -0
  50. package/dist/notification/index.js +271 -86
  51. package/dist/scopes/index.d.ts +29 -6
  52. package/dist/scopes/index.js +14 -1
  53. package/dist/templates/charts-values/traefik/values.yaml +2 -3
  54. package/opencrvs-toolkit-2.2.0-rc.9042a13.tgz +0 -0
  55. package/package.json +1 -1
  56. package/tsconfig.build.tsbuildinfo +1 -1
  57. package/dist/migrations/v2.1/add-translations.d.ts +0 -9
  58. package/dist/migrations/v2.1/add-translations.d.ts.map +0 -1
  59. package/opencrvs-toolkit-2.1.0.tgz +0 -0
@@ -27,6 +27,7 @@ export declare const WorkqueueConfig: z.ZodObject<{
27
27
  DECLARED: "DECLARED";
28
28
  NOTIFIED: "NOTIFIED";
29
29
  REGISTERED: "REGISTERED";
30
+ REVOKED: "REVOKED";
30
31
  }>>;
31
32
  }, z.core.$strip>, z.ZodObject<{
32
33
  type: z.ZodLiteral<"exact">;
@@ -36,6 +37,7 @@ export declare const WorkqueueConfig: z.ZodObject<{
36
37
  DECLARED: "DECLARED";
37
38
  NOTIFIED: "NOTIFIED";
38
39
  REGISTERED: "REGISTERED";
40
+ REVOKED: "REVOKED";
39
41
  }>;
40
42
  }, z.core.$strip>]>>>;
41
43
  createdAt: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
@@ -138,6 +140,26 @@ export declare const WorkqueueConfig: z.ZodObject<{
138
140
  type: z.ZodLiteral<"exact">;
139
141
  term: z.ZodString;
140
142
  }, z.core.$strip>>>;
143
+ 'legalStatuses.REVOKED.createdAtLocation': z.ZodOptional<z.ZodOptional<z.ZodObject<{
144
+ type: z.ZodLiteral<"within">;
145
+ location: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
146
+ $userField: z.ZodEnum<{
147
+ administrativeAreaId: "administrativeAreaId";
148
+ avatar: "avatar";
149
+ device: "device";
150
+ firstname: "firstname";
151
+ fullHonorificName: "fullHonorificName";
152
+ id: "id";
153
+ middlename: "middlename";
154
+ name: "name";
155
+ primaryOfficeId: "primaryOfficeId";
156
+ role: "role";
157
+ signature: "signature";
158
+ surname: "surname";
159
+ }>;
160
+ $location: z.ZodOptional<z.ZodString>;
161
+ }, z.core.$strip>]>;
162
+ }, z.core.$strip>>>;
141
163
  createdAtLocation: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
142
164
  type: z.ZodLiteral<"within">;
143
165
  location: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
@@ -344,6 +366,7 @@ export declare const WorkqueueConfig: z.ZodObject<{
344
366
  DECLARED: "DECLARED";
345
367
  NOTIFIED: "NOTIFIED";
346
368
  REGISTERED: "REGISTERED";
369
+ REVOKED: "REVOKED";
347
370
  }>>;
348
371
  }, z.core.$strip>, z.ZodObject<{
349
372
  type: z.ZodLiteral<"exact">;
@@ -353,6 +376,7 @@ export declare const WorkqueueConfig: z.ZodObject<{
353
376
  DECLARED: "DECLARED";
354
377
  NOTIFIED: "NOTIFIED";
355
378
  REGISTERED: "REGISTERED";
379
+ REVOKED: "REVOKED";
356
380
  }>;
357
381
  }, z.core.$strip>]>>>;
358
382
  createdAt: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
@@ -455,6 +479,26 @@ export declare const WorkqueueConfig: z.ZodObject<{
455
479
  type: z.ZodLiteral<"exact">;
456
480
  term: z.ZodString;
457
481
  }, z.core.$strip>>>;
482
+ 'legalStatuses.REVOKED.createdAtLocation': z.ZodOptional<z.ZodOptional<z.ZodObject<{
483
+ type: z.ZodLiteral<"within">;
484
+ location: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
485
+ $userField: z.ZodEnum<{
486
+ administrativeAreaId: "administrativeAreaId";
487
+ avatar: "avatar";
488
+ device: "device";
489
+ firstname: "firstname";
490
+ fullHonorificName: "fullHonorificName";
491
+ id: "id";
492
+ middlename: "middlename";
493
+ name: "name";
494
+ primaryOfficeId: "primaryOfficeId";
495
+ role: "role";
496
+ signature: "signature";
497
+ surname: "surname";
498
+ }>;
499
+ $location: z.ZodOptional<z.ZodString>;
500
+ }, z.core.$strip>]>;
501
+ }, z.core.$strip>>>;
458
502
  createdAtLocation: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
459
503
  type: z.ZodLiteral<"within">;
460
504
  location: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
@@ -660,8 +704,10 @@ export declare const WorkqueueConfig: z.ZodObject<{
660
704
  PRINT_CERTIFICATE: "PRINT_CERTIFICATE";
661
705
  READ: "READ";
662
706
  REGISTER: "REGISTER";
707
+ REINSTATE_REGISTRATION: "REINSTATE_REGISTRATION";
663
708
  REJECT: "REJECT";
664
709
  REQUEST_CORRECTION: "REQUEST_CORRECTION";
710
+ REVOKE_REGISTRATION: "REVOKE_REGISTRATION";
665
711
  UNARCHIVE: "UNARCHIVE";
666
712
  }>;
667
713
  }, z.core.$strip>>;
@@ -812,8 +858,10 @@ export declare const WorkqueueConfigWithoutQuery: z.ZodObject<{
812
858
  PRINT_CERTIFICATE: "PRINT_CERTIFICATE";
813
859
  READ: "READ";
814
860
  REGISTER: "REGISTER";
861
+ REINSTATE_REGISTRATION: "REINSTATE_REGISTRATION";
815
862
  REJECT: "REJECT";
816
863
  REQUEST_CORRECTION: "REQUEST_CORRECTION";
864
+ REVOKE_REGISTRATION: "REVOKE_REGISTRATION";
817
865
  UNARCHIVE: "UNARCHIVE";
818
866
  }>;
819
867
  }, z.core.$strip>>;
@@ -938,8 +986,10 @@ export declare const WorkqueueConfigInput: z.ZodObject<{
938
986
  PRINT_CERTIFICATE: "PRINT_CERTIFICATE";
939
987
  READ: "READ";
940
988
  REGISTER: "REGISTER";
989
+ REINSTATE_REGISTRATION: "REINSTATE_REGISTRATION";
941
990
  REJECT: "REJECT";
942
991
  REQUEST_CORRECTION: "REQUEST_CORRECTION";
992
+ REVOKE_REGISTRATION: "REVOKE_REGISTRATION";
943
993
  UNARCHIVE: "UNARCHIVE";
944
994
  }>;
945
995
  }, z.core.$strip>>;
@@ -1086,6 +1136,7 @@ export declare const WorkqueueConfigInput: z.ZodObject<{
1086
1136
  DECLARED: "DECLARED";
1087
1137
  NOTIFIED: "NOTIFIED";
1088
1138
  REGISTERED: "REGISTERED";
1139
+ REVOKED: "REVOKED";
1089
1140
  }>>;
1090
1141
  }, z.core.$strip>, z.ZodObject<{
1091
1142
  type: z.ZodLiteral<"exact">;
@@ -1095,6 +1146,7 @@ export declare const WorkqueueConfigInput: z.ZodObject<{
1095
1146
  DECLARED: "DECLARED";
1096
1147
  NOTIFIED: "NOTIFIED";
1097
1148
  REGISTERED: "REGISTERED";
1149
+ REVOKED: "REVOKED";
1098
1150
  }>;
1099
1151
  }, z.core.$strip>]>>>;
1100
1152
  createdAt: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
@@ -1197,6 +1249,26 @@ export declare const WorkqueueConfigInput: z.ZodObject<{
1197
1249
  type: z.ZodLiteral<"exact">;
1198
1250
  term: z.ZodString;
1199
1251
  }, z.core.$strip>>>;
1252
+ 'legalStatuses.REVOKED.createdAtLocation': z.ZodOptional<z.ZodOptional<z.ZodObject<{
1253
+ type: z.ZodLiteral<"within">;
1254
+ location: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1255
+ $userField: z.ZodEnum<{
1256
+ administrativeAreaId: "administrativeAreaId";
1257
+ avatar: "avatar";
1258
+ device: "device";
1259
+ firstname: "firstname";
1260
+ fullHonorificName: "fullHonorificName";
1261
+ id: "id";
1262
+ middlename: "middlename";
1263
+ name: "name";
1264
+ primaryOfficeId: "primaryOfficeId";
1265
+ role: "role";
1266
+ signature: "signature";
1267
+ surname: "surname";
1268
+ }>;
1269
+ $location: z.ZodOptional<z.ZodString>;
1270
+ }, z.core.$strip>]>;
1271
+ }, z.core.$strip>>>;
1200
1272
  createdAtLocation: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
1201
1273
  type: z.ZodLiteral<"within">;
1202
1274
  location: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
@@ -1402,6 +1474,7 @@ export declare const WorkqueueConfigInput: z.ZodObject<{
1402
1474
  DECLARED: "DECLARED";
1403
1475
  NOTIFIED: "NOTIFIED";
1404
1476
  REGISTERED: "REGISTERED";
1477
+ REVOKED: "REVOKED";
1405
1478
  }>>;
1406
1479
  }, z.core.$strip>, z.ZodObject<{
1407
1480
  type: z.ZodLiteral<"exact">;
@@ -1411,6 +1484,7 @@ export declare const WorkqueueConfigInput: z.ZodObject<{
1411
1484
  DECLARED: "DECLARED";
1412
1485
  NOTIFIED: "NOTIFIED";
1413
1486
  REGISTERED: "REGISTERED";
1487
+ REVOKED: "REVOKED";
1414
1488
  }>;
1415
1489
  }, z.core.$strip>]>>>;
1416
1490
  createdAt: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
@@ -1513,6 +1587,26 @@ export declare const WorkqueueConfigInput: z.ZodObject<{
1513
1587
  type: z.ZodLiteral<"exact">;
1514
1588
  term: z.ZodString;
1515
1589
  }, z.core.$strip>>>;
1590
+ 'legalStatuses.REVOKED.createdAtLocation': z.ZodOptional<z.ZodOptional<z.ZodObject<{
1591
+ type: z.ZodLiteral<"within">;
1592
+ location: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1593
+ $userField: z.ZodEnum<{
1594
+ administrativeAreaId: "administrativeAreaId";
1595
+ avatar: "avatar";
1596
+ device: "device";
1597
+ firstname: "firstname";
1598
+ fullHonorificName: "fullHonorificName";
1599
+ id: "id";
1600
+ middlename: "middlename";
1601
+ name: "name";
1602
+ primaryOfficeId: "primaryOfficeId";
1603
+ role: "role";
1604
+ signature: "signature";
1605
+ surname: "surname";
1606
+ }>;
1607
+ $location: z.ZodOptional<z.ZodString>;
1608
+ }, z.core.$strip>]>;
1609
+ }, z.core.$strip>>>;
1516
1610
  createdAtLocation: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
1517
1611
  type: z.ZodLiteral<"within">;
1518
1612
  location: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
@@ -1719,6 +1813,7 @@ export declare const WorkqueueConfigInput: z.ZodObject<{
1719
1813
  DECLARED: "DECLARED";
1720
1814
  NOTIFIED: "NOTIFIED";
1721
1815
  REGISTERED: "REGISTERED";
1816
+ REVOKED: "REVOKED";
1722
1817
  }>>;
1723
1818
  }, z.core.$strip>, z.ZodObject<{
1724
1819
  type: z.ZodLiteral<"exact">;
@@ -1728,6 +1823,7 @@ export declare const WorkqueueConfigInput: z.ZodObject<{
1728
1823
  DECLARED: "DECLARED";
1729
1824
  NOTIFIED: "NOTIFIED";
1730
1825
  REGISTERED: "REGISTERED";
1826
+ REVOKED: "REVOKED";
1731
1827
  }>;
1732
1828
  }, z.core.$strip>]>>>;
1733
1829
  createdAt: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
@@ -1830,6 +1926,26 @@ export declare const WorkqueueConfigInput: z.ZodObject<{
1830
1926
  type: z.ZodLiteral<"exact">;
1831
1927
  term: z.ZodString;
1832
1928
  }, z.core.$strip>>>;
1929
+ 'legalStatuses.REVOKED.createdAtLocation': z.ZodOptional<z.ZodOptional<z.ZodObject<{
1930
+ type: z.ZodLiteral<"within">;
1931
+ location: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1932
+ $userField: z.ZodEnum<{
1933
+ administrativeAreaId: "administrativeAreaId";
1934
+ avatar: "avatar";
1935
+ device: "device";
1936
+ firstname: "firstname";
1937
+ fullHonorificName: "fullHonorificName";
1938
+ id: "id";
1939
+ middlename: "middlename";
1940
+ name: "name";
1941
+ primaryOfficeId: "primaryOfficeId";
1942
+ role: "role";
1943
+ signature: "signature";
1944
+ surname: "surname";
1945
+ }>;
1946
+ $location: z.ZodOptional<z.ZodString>;
1947
+ }, z.core.$strip>]>;
1948
+ }, z.core.$strip>>>;
1833
1949
  createdAtLocation: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
1834
1950
  type: z.ZodLiteral<"within">;
1835
1951
  location: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
@@ -2042,10 +2158,10 @@ export declare function defineWorkqueue(workqueueInput: WorkqueueConfigInput): {
2042
2158
  eventType?: string | undefined;
2043
2159
  status?: {
2044
2160
  type: "exact";
2045
- term: "ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED";
2161
+ term: "ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED" | "REVOKED";
2046
2162
  } | {
2047
2163
  type: "anyOf";
2048
- terms: ("ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED")[];
2164
+ terms: ("ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED" | "REVOKED")[];
2049
2165
  } | undefined;
2050
2166
  createdAt?: {
2051
2167
  type: "range";
@@ -2106,6 +2222,13 @@ export declare function defineWorkqueue(workqueueInput: WorkqueueConfigInput): {
2106
2222
  type: "exact";
2107
2223
  term: string;
2108
2224
  } | undefined;
2225
+ 'legalStatuses.REVOKED.createdAtLocation'?: {
2226
+ type: "within";
2227
+ location: string | {
2228
+ $userField: "administrativeAreaId" | "avatar" | "device" | "firstname" | "fullHonorificName" | "id" | "middlename" | "name" | "primaryOfficeId" | "role" | "signature" | "surname";
2229
+ $location?: string | undefined;
2230
+ };
2231
+ } | undefined;
2109
2232
  createdAtLocation?: {
2110
2233
  type: "within";
2111
2234
  location: string | {
@@ -2181,10 +2304,10 @@ export declare function defineWorkqueue(workqueueInput: WorkqueueConfigInput): {
2181
2304
  eventType?: string | undefined;
2182
2305
  status?: {
2183
2306
  type: "exact";
2184
- term: "ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED";
2307
+ term: "ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED" | "REVOKED";
2185
2308
  } | {
2186
2309
  type: "anyOf";
2187
- terms: ("ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED")[];
2310
+ terms: ("ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED" | "REVOKED")[];
2188
2311
  } | undefined;
2189
2312
  createdAt?: {
2190
2313
  type: "range";
@@ -2245,6 +2368,13 @@ export declare function defineWorkqueue(workqueueInput: WorkqueueConfigInput): {
2245
2368
  type: "exact";
2246
2369
  term: string;
2247
2370
  } | undefined;
2371
+ 'legalStatuses.REVOKED.createdAtLocation'?: {
2372
+ type: "within";
2373
+ location: string | {
2374
+ $userField: "administrativeAreaId" | "avatar" | "device" | "firstname" | "fullHonorificName" | "id" | "middlename" | "name" | "primaryOfficeId" | "role" | "signature" | "surname";
2375
+ $location?: string | undefined;
2376
+ };
2377
+ } | undefined;
2248
2378
  createdAtLocation?: {
2249
2379
  type: "within";
2250
2380
  location: string | {
@@ -2316,7 +2446,7 @@ export declare function defineWorkqueue(workqueueInput: WorkqueueConfigInput): {
2316
2446
  }[];
2317
2447
  };
2318
2448
  action?: {
2319
- type: "ARCHIVE" | "DECLARE" | "DELETE" | "EDIT" | "MARK_AS_DUPLICATE" | "PRINT_CERTIFICATE" | "READ" | "REGISTER" | "REJECT" | "REQUEST_CORRECTION" | "UNARCHIVE";
2449
+ type: "ARCHIVE" | "DECLARE" | "DELETE" | "EDIT" | "MARK_AS_DUPLICATE" | "PRINT_CERTIFICATE" | "READ" | "REGISTER" | "REINSTATE_REGISTRATION" | "REJECT" | "REQUEST_CORRECTION" | "REVOKE_REGISTRATION" | "UNARCHIVE";
2320
2450
  } | undefined;
2321
2451
  columns: {
2322
2452
  label: {
@@ -2353,10 +2483,10 @@ export declare function defineWorkqueues(workqueues: WorkqueueConfigInputWithV19
2353
2483
  eventType?: string | undefined;
2354
2484
  status?: {
2355
2485
  type: "exact";
2356
- term: "ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED";
2486
+ term: "ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED" | "REVOKED";
2357
2487
  } | {
2358
2488
  type: "anyOf";
2359
- terms: ("ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED")[];
2489
+ terms: ("ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED" | "REVOKED")[];
2360
2490
  } | undefined;
2361
2491
  createdAt?: {
2362
2492
  type: "range";
@@ -2417,6 +2547,13 @@ export declare function defineWorkqueues(workqueues: WorkqueueConfigInputWithV19
2417
2547
  type: "exact";
2418
2548
  term: string;
2419
2549
  } | undefined;
2550
+ 'legalStatuses.REVOKED.createdAtLocation'?: {
2551
+ type: "within";
2552
+ location: string | {
2553
+ $userField: "administrativeAreaId" | "avatar" | "device" | "firstname" | "fullHonorificName" | "id" | "middlename" | "name" | "primaryOfficeId" | "role" | "signature" | "surname";
2554
+ $location?: string | undefined;
2555
+ };
2556
+ } | undefined;
2420
2557
  createdAtLocation?: {
2421
2558
  type: "within";
2422
2559
  location: string | {
@@ -2492,10 +2629,10 @@ export declare function defineWorkqueues(workqueues: WorkqueueConfigInputWithV19
2492
2629
  eventType?: string | undefined;
2493
2630
  status?: {
2494
2631
  type: "exact";
2495
- term: "ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED";
2632
+ term: "ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED" | "REVOKED";
2496
2633
  } | {
2497
2634
  type: "anyOf";
2498
- terms: ("ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED")[];
2635
+ terms: ("ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED" | "REVOKED")[];
2499
2636
  } | undefined;
2500
2637
  createdAt?: {
2501
2638
  type: "range";
@@ -2556,6 +2693,13 @@ export declare function defineWorkqueues(workqueues: WorkqueueConfigInputWithV19
2556
2693
  type: "exact";
2557
2694
  term: string;
2558
2695
  } | undefined;
2696
+ 'legalStatuses.REVOKED.createdAtLocation'?: {
2697
+ type: "within";
2698
+ location: string | {
2699
+ $userField: "administrativeAreaId" | "avatar" | "device" | "firstname" | "fullHonorificName" | "id" | "middlename" | "name" | "primaryOfficeId" | "role" | "signature" | "surname";
2700
+ $location?: string | undefined;
2701
+ };
2702
+ } | undefined;
2559
2703
  createdAtLocation?: {
2560
2704
  type: "within";
2561
2705
  location: string | {
@@ -2627,7 +2771,7 @@ export declare function defineWorkqueues(workqueues: WorkqueueConfigInputWithV19
2627
2771
  }[];
2628
2772
  };
2629
2773
  action?: {
2630
- type: "ARCHIVE" | "DECLARE" | "DELETE" | "EDIT" | "MARK_AS_DUPLICATE" | "PRINT_CERTIFICATE" | "READ" | "REGISTER" | "REJECT" | "REQUEST_CORRECTION" | "UNARCHIVE";
2774
+ type: "ARCHIVE" | "DECLARE" | "DELETE" | "EDIT" | "MARK_AS_DUPLICATE" | "PRINT_CERTIFICATE" | "READ" | "REGISTER" | "REINSTATE_REGISTRATION" | "REJECT" | "REQUEST_CORRECTION" | "REVOKE_REGISTRATION" | "UNARCHIVE";
2631
2775
  } | undefined;
2632
2776
  columns: {
2633
2777
  label: {
@@ -1,8 +1,24 @@
1
1
  import * as z from 'zod/v4';
2
- import { EventConfig } from './EventConfig';
2
+ import { EventConfig, EventConfigInput } from './EventConfig';
3
3
  export declare function validateAdvancedSearchConfig(event: EventConfig, ctx: z.RefinementCtx<EventConfig>): void;
4
4
  export declare function validateDateOfEvent(event: EventConfig, ctx: z.RefinementCtx<EventConfig>): void;
5
5
  export declare function validatePlaceOfEvent(event: EventConfig, ctx: z.RefinementCtx<EventConfig>): void;
6
6
  export declare function validateActionFlags(event: EventConfig, ctx: z.RefinementCtx<EventConfig>): void;
7
7
  export declare function validateActionOrder(event: EventConfig, ctx: z.RefinementCtx<EventConfig>): void;
8
+ /**
9
+ * Runs on both the `defineConfig` input and the parsed `EventConfig`.
10
+ *
11
+ * @returns whether the event has exactly one DECLARE action.
12
+ */
13
+ export declare function validateExactlyOneDeclareAction<T extends {
14
+ id: string;
15
+ actions: Array<{
16
+ type: string;
17
+ }>;
18
+ }>(event: T, ctx: z.RefinementCtx<T>): boolean;
19
+ /**
20
+ * `declaration` must be given exactly once: at the top level (kept for backwards
21
+ * compatibility) or on the DECLARE action.
22
+ */
23
+ export declare function validateDeclarationGivenExactlyOnce(config: EventConfigInput, ctx: z.RefinementCtx<EventConfigInput>): void;
8
24
  //# sourceMappingURL=eventConfigValidation.d.ts.map
@@ -17,6 +17,8 @@ export declare const ACTION_SCOPE_MAP: {
17
17
  REVIEW_CORRECTION_REQUEST: "record.correct"[];
18
18
  REJECT_CORRECTION: "record.correct"[];
19
19
  APPROVE_CORRECTION: "record.correct"[];
20
+ REVOKE_REGISTRATION: "record.revoke-registration"[];
21
+ REINSTATE_REGISTRATION: "record.reinstate-registration"[];
20
22
  MARK_AS_DUPLICATE: "record.review-duplicates"[];
21
23
  MARK_AS_NOT_DUPLICATE: "record.review-duplicates"[];
22
24
  ARCHIVE: "record.archive"[];
@@ -7,7 +7,7 @@ import { Draft } from '../Draft';
7
7
  import { EventConfig } from '../EventConfig';
8
8
  import { UUID } from '../../uuid';
9
9
  import { DocumentPath } from '../../documents';
10
- export declare function getStatusFromActions(actions: Array<Action>): "ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED";
10
+ export declare function getStatusFromActions(actions: Array<Action>): "ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED" | "REVOKED";
11
11
  export declare function getAssignedUserFromActions(actions: Array<ActionDocument>): string | null;
12
12
  type NonNullableDeep<T> = T extends [unknown, ...unknown[]] ? {
13
13
  [K in keyof T]: NonNullableDeep<NonNullable<T[K]>>;
@@ -63,7 +63,7 @@ export declare function applyDeclarationToEventIndex(eventIndex: EventIndex, dec
63
63
  export declare function applyDraftToEventIndex(eventIndex: EventIndex, draft: Draft, eventConfiguration: EventConfig): {
64
64
  id: string & import("zod").$brand<"UUID">;
65
65
  type: string;
66
- status: "ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED";
66
+ status: "ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED" | "REVOKED";
67
67
  legalStatuses: {
68
68
  NOTIFIED?: {
69
69
  createdAt: string;
@@ -90,6 +90,14 @@ export declare function applyDraftToEventIndex(eventIndex: EventIndex, draft: Dr
90
90
  createdByRole?: string | undefined;
91
91
  registrationNumber: string;
92
92
  } | null | undefined;
93
+ REVOKED?: {
94
+ createdAt: string;
95
+ createdBy: string;
96
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
97
+ createdByUserType?: "system" | "user" | null | undefined;
98
+ acceptedAt: string;
99
+ createdByRole?: string | undefined;
100
+ } | null | undefined;
93
101
  };
94
102
  createdAt: string;
95
103
  dateOfEvent?: string | null | undefined;
@@ -1,4 +1,5 @@
1
1
  import { Action } from '../ActionDocument';
2
+ import { EventStatus } from '../EventMetadata';
2
3
  /**
3
4
  * Returns the creation metadata of the last update action (Requested or Accepted).
4
5
  * Requested actions are included so that async flows (202) correctly reflect the
@@ -29,7 +30,7 @@ export declare function getActionUpdateMetadata(actions: Action[]): Pick<{
29
30
  * @returns the legal statuses of the event. Event is considered legal if it has been accepted.
30
31
  * @see EventIndex for the description of the returned object.
31
32
  */
32
- export declare function getLegalStatuses(actions: Action[]): {
33
+ export declare function getLegalStatuses(actions: Action[], status: EventStatus): {
33
34
  NOTIFIED: {
34
35
  createdAt: string;
35
36
  createdBy: string;
@@ -57,5 +58,14 @@ export declare function getLegalStatuses(actions: Action[]): {
57
58
  createdByRole: string | undefined;
58
59
  registrationNumber: string | null | undefined;
59
60
  } | null;
61
+ REVOKED: {
62
+ createdAt: string;
63
+ createdBy: string;
64
+ createdByUserType: "system" | "user";
65
+ createdAtLocation: (string & import("zod").$brand<"UUID">) | null | undefined;
66
+ acceptedAt: string;
67
+ createdByRole: string | undefined;
68
+ registrationNumber: string | null | undefined;
69
+ } | null;
60
70
  };
61
71
  //# sourceMappingURL=utils.d.ts.map
@@ -1,7 +1,7 @@
1
1
  import { UUID } from '../uuid';
2
2
  import { ActionDocument, ActionUpdate } from './ActionDocument';
3
3
  import { ValidatorContext } from '../conditionals/validate';
4
- import { ApproveCorrectionActionInput, ArchiveActionInput, AssignActionInput, DeclareActionInput, EditActionInput, MarkAsDuplicateActionInput, MarkNotDuplicateActionInput, NotifyActionInput, RegisterActionInput, RejectCorrectionActionInput, RejectDeclarationActionInput, RequestCorrectionActionInput, UnarchiveActionInput, UnassignActionInput } from './ActionInput';
4
+ import { ApproveCorrectionActionInput, ArchiveActionInput, AssignActionInput, DeclareActionInput, EditActionInput, MarkAsDuplicateActionInput, MarkNotDuplicateActionInput, NotifyActionInput, RegisterActionInput, RejectCorrectionActionInput, RejectDeclarationActionInput, RequestCorrectionActionInput, UnarchiveActionInput, UnassignActionInput, RevokeRegistrationActionInput, ReinstateRegistrationActionInput } from './ActionInput';
5
5
  import { ActionType } from './ActionType';
6
6
  import { Draft } from './Draft';
7
7
  import { EventConfig, EventConfigInput } from './EventConfig';
@@ -10,6 +10,7 @@ import { EventIndex } from './EventIndex';
10
10
  import { EventInput } from './EventInput';
11
11
  import { TranslationConfig } from './TranslationConfig';
12
12
  import { FieldConfig } from './FieldConfig';
13
+ import { DeclarationFormConfig } from './FormConfig';
13
14
  import { LocationVersion, SetLocationPayload, SetAdministrativeAreaPayload, ClientAdministrativeArea } from './locations';
14
15
  import { WorkqueueConfig } from './WorkqueueConfig';
15
16
  import * as z from 'zod/v4';
@@ -158,6 +159,28 @@ export declare function eventPayloadGenerator(rng: () => number, configuration?:
158
159
  annotation: {};
159
160
  eventId: string;
160
161
  };
162
+ revokeRegistration: (eventId: string, input?: Partial<Pick<RevokeRegistrationActionInput, 'transactionId' | 'annotation' | 'keepAssignment' | 'keepAssignmentIfRejected' | 'keepAssignmentIfAccepted' | 'waitFor'>>) => {
163
+ keepAssignment?: boolean | undefined;
164
+ keepAssignmentIfAccepted?: boolean | undefined;
165
+ keepAssignmentIfRejected?: boolean | undefined;
166
+ waitFor?: boolean | undefined;
167
+ type: "REVOKE_REGISTRATION";
168
+ transactionId: string;
169
+ declaration: {};
170
+ annotation: {};
171
+ eventId: string;
172
+ };
173
+ reinstateRegistration: (eventId: string, input?: Partial<Pick<ReinstateRegistrationActionInput, 'transactionId' | 'annotation' | 'keepAssignment' | 'keepAssignmentIfRejected' | 'keepAssignmentIfAccepted' | 'waitFor'>>) => {
174
+ keepAssignment?: boolean | undefined;
175
+ keepAssignmentIfAccepted?: boolean | undefined;
176
+ keepAssignmentIfRejected?: boolean | undefined;
177
+ waitFor?: boolean | undefined;
178
+ type: "REINSTATE_REGISTRATION";
179
+ transactionId: string;
180
+ declaration: {};
181
+ annotation: {};
182
+ eventId: string;
183
+ };
161
184
  reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, 'transactionId' | 'annotation' | 'keepAssignment' | 'keepAssignmentIfAccepted' | 'keepAssignmentIfRejected' | 'waitFor'>>) => {
162
185
  keepAssignment?: boolean | undefined;
163
186
  keepAssignmentIfAccepted?: boolean | undefined;
@@ -328,6 +351,10 @@ export declare const generateEventConfig: ({ id, fields, placeOfEventId, dateOfE
328
351
  /** Extra actions appended to the default READ + DECLARE pair, e.g. a REQUEST_CORRECTION action with its own correctionForm. */
329
352
  actions?: EventConfigInput['actions'];
330
353
  }) => EventConfig;
354
+ /**
355
+ * @returns a copy of the configuration with the DECLARE action's declaration replaced.
356
+ */
357
+ export declare function withDeclaration(configuration: EventConfig, declaration: DeclarationFormConfig): EventConfig;
331
358
  /**
332
359
  * Get the leaf administrative area IDs from a list of administrative areas.
333
360
  *
@@ -12,20 +12,6 @@ import { FormConfig } from './FormConfig';
12
12
  import { PlainDate, SelectDateRangeValue } from './FieldValue';
13
13
  import { EventIndex } from './EventIndex';
14
14
  export declare function ageToDate(age: number, asOfDate: PlainDate): string & import("zod").$brand<"PlainDate">;
15
- export declare function getDeclarationFields(configuration: EventConfig): FieldConfig[];
16
- export declare function getDeclarationPages(configuration: EventConfig): {
17
- id: string;
18
- title: {
19
- id: string;
20
- defaultMessage: string;
21
- description: string;
22
- };
23
- requireCompletionToContinue: boolean;
24
- showClearButton?: boolean | undefined;
25
- fields: FieldConfig[];
26
- conditional?: any;
27
- type: "FORM";
28
- }[];
29
15
  export declare function getDeclaration(configuration: EventConfig): {
30
16
  label: {
31
17
  id: string;
@@ -46,6 +32,20 @@ export declare function getDeclaration(configuration: EventConfig): {
46
32
  type: "FORM";
47
33
  }[];
48
34
  };
35
+ export declare function getDeclarationPages(configuration: EventConfig): {
36
+ id: string;
37
+ title: {
38
+ id: string;
39
+ defaultMessage: string;
40
+ description: string;
41
+ };
42
+ requireCompletionToContinue: boolean;
43
+ showClearButton?: boolean | undefined;
44
+ fields: FieldConfig[];
45
+ conditional?: any;
46
+ type: "FORM";
47
+ }[];
48
+ export declare function getDeclarationFields(configuration: EventConfig): FieldConfig[];
49
49
  export declare function isActionConfigType(type: ActionType): type is ActionConfigTypes;
50
50
  export declare function getActionConfig({ eventConfiguration, actionType, customActionType }: {
51
51
  eventConfiguration: EventConfig;
@@ -277,6 +277,34 @@ export declare function findLastAssignmentAction(actions: Action[]): {
277
277
  status: "Accepted" | "Rejected" | "Requested";
278
278
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
279
279
  type: "UNARCHIVE";
280
+ } | {
281
+ id: string & import("zod").$brand<"UUID">;
282
+ transactionId: string;
283
+ createdByUserType: "system" | "user";
284
+ createdAt: string;
285
+ createdBy: string;
286
+ createdByRole?: string | undefined;
287
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
288
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
289
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
290
+ annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
291
+ status: "Accepted" | "Rejected" | "Requested";
292
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
293
+ type: "REVOKE_REGISTRATION";
294
+ } | {
295
+ id: string & import("zod").$brand<"UUID">;
296
+ transactionId: string;
297
+ createdByUserType: "system" | "user";
298
+ createdAt: string;
299
+ createdBy: string;
300
+ createdByRole?: string | undefined;
301
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
302
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
303
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
304
+ annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
305
+ status: "Accepted" | "Rejected" | "Requested";
306
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
307
+ type: "REINSTATE_REGISTRATION";
280
308
  } | {
281
309
  id: string & import("zod").$brand<"UUID">;
282
310
  transactionId: string;
@@ -472,7 +500,7 @@ export declare function findLastAssignmentAction(actions: Action[]): {
472
500
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
473
501
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
474
502
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
475
- type: "APPROVE_CORRECTION" | "ARCHIVE" | "CUSTOM" | "DECLARE" | "EDIT" | "NOTIFY" | "PRINT_CERTIFICATE" | "REGISTER" | "REJECT" | "REJECT_CORRECTION" | "REQUEST_CORRECTION" | "UNARCHIVE";
503
+ type: "APPROVE_CORRECTION" | "ARCHIVE" | "CUSTOM" | "DECLARE" | "EDIT" | "NOTIFY" | "PRINT_CERTIFICATE" | "REGISTER" | "REINSTATE_REGISTRATION" | "REJECT" | "REJECT_CORRECTION" | "REQUEST_CORRECTION" | "REVOKE_REGISTRATION" | "UNARCHIVE";
476
504
  status: "Rejected";
477
505
  } | undefined;
478
506
  /**