@opencrvs/toolkit 2.1.0-rc.f5f3da9 → 2.1.0-rc.f85d99c

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 (44) hide show
  1. package/README.md +0 -1
  2. package/dist/application-config/index.js +200 -189
  3. package/dist/cli.js +77 -217
  4. package/dist/commons/api/router.d.ts +7 -26
  5. package/dist/commons/conditionals/conditionals.d.ts +3 -3
  6. package/dist/commons/conditionals/validate.d.ts +2 -1
  7. package/dist/commons/events/ActionConfig.d.ts +21 -0
  8. package/dist/commons/events/ActionDocument.d.ts +1 -7
  9. package/dist/commons/events/ActionStatus.d.ts +14 -0
  10. package/dist/commons/events/AdvancedSearchConfig.d.ts +6 -0
  11. package/dist/commons/events/CountryConfigQueryInput.d.ts +18 -0
  12. package/dist/commons/events/EventIndex.d.ts +5 -24
  13. package/dist/commons/events/EventMetadata.d.ts +1 -0
  14. package/dist/commons/events/FieldConfig.d.ts +5 -0
  15. package/dist/commons/events/FieldTypeMapping.d.ts +19 -19
  16. package/dist/commons/events/Flag.d.ts +48 -0
  17. package/dist/commons/events/WorkqueueConfig.d.ts +27 -12
  18. package/dist/commons/events/locations.d.ts +3 -93
  19. package/dist/commons/events/mocks.test.utils.d.ts +2 -16
  20. package/dist/commons/events/test.utils.d.ts +5 -5
  21. package/dist/conditionals/index.js +303 -55
  22. package/dist/environment/index.d.ts +0 -1
  23. package/dist/environment/index.d.ts.map +1 -1
  24. package/dist/environment/index.js +0 -10
  25. package/dist/environment/setup-environment.js +1 -2
  26. package/dist/environment/templates.d.ts.map +1 -1
  27. package/dist/environment/templates.js +1 -2
  28. package/dist/environment/update-workflows.d.ts.map +1 -1
  29. package/dist/environment/update-workflows.js +3 -4
  30. package/dist/environment/users.js +13 -11
  31. package/dist/events/index.js +3255 -3222
  32. package/dist/notification/index.js +1477 -907
  33. package/dist/scopes/index.d.ts +250 -0
  34. package/dist/scopes/index.js +304 -55
  35. package/opencrvs-toolkit-2.1.0-rc.f85d99c.tgz +0 -0
  36. package/package.json +1 -1
  37. package/tsconfig.tsbuildinfo +1 -1
  38. package/dist/environment/paths.d.ts +0 -13
  39. package/dist/environment/paths.d.ts.map +0 -1
  40. package/dist/environment/paths.js +0 -94
  41. package/dist/environment/upgrade.d.ts +0 -2
  42. package/dist/environment/upgrade.d.ts.map +0 -1
  43. package/dist/environment/upgrade.js +0 -100
  44. package/opencrvs-toolkit-2.1.0-rc.f5f3da9.tgz +0 -0
@@ -11,6 +11,7 @@ export declare const InherentFlags: {
11
11
  * We only use this flag to determine that a NOTIFY, DECLARE or REGISTER action is allowed next.
12
12
  */
13
13
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
14
+ readonly SEALED: 'sealed';
14
15
  };
15
16
  export type InherentFlags = (typeof InherentFlags)[keyof typeof InherentFlags];
16
17
  export declare const ActionFlag: z.ZodString;
@@ -30,8 +31,54 @@ export declare const Flag: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEnum<{
30
31
  * We only use this flag to determine that a NOTIFY, DECLARE or REGISTER action is allowed next.
31
32
  */
32
33
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
34
+ readonly SEALED: 'sealed';
33
35
  }>]>, z.ZodString]>;
34
36
  export type Flag = z.infer<typeof Flag>;
37
+ export declare const ContainsFlags: z.ZodObject<{
38
+ anyOf: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEnum<{
39
+ readonly INCOMPLETE: 'incomplete';
40
+ readonly REJECTED: 'rejected';
41
+ readonly CORRECTION_REQUESTED: 'correction-requested';
42
+ readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
43
+ /**
44
+ * This flag is set by the Edit-action and removed after the declaration or registration.
45
+ * A record should never stay with the EDIT_IN_PROGRESS flag, since it should always be declared or registered right after.
46
+ *
47
+ * We only use this flag to determine that a NOTIFY, DECLARE or REGISTER action is allowed next.
48
+ */
49
+ readonly EDIT_IN_PROGRESS: 'edit-in-progress';
50
+ readonly SEALED: 'sealed';
51
+ }>]>, z.ZodString]>>>;
52
+ noneOf: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEnum<{
53
+ readonly INCOMPLETE: 'incomplete';
54
+ readonly REJECTED: 'rejected';
55
+ readonly CORRECTION_REQUESTED: 'correction-requested';
56
+ readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
57
+ /**
58
+ * This flag is set by the Edit-action and removed after the declaration or registration.
59
+ * A record should never stay with the EDIT_IN_PROGRESS flag, since it should always be declared or registered right after.
60
+ *
61
+ * We only use this flag to determine that a NOTIFY, DECLARE or REGISTER action is allowed next.
62
+ */
63
+ readonly EDIT_IN_PROGRESS: 'edit-in-progress';
64
+ readonly SEALED: 'sealed';
65
+ }>]>, z.ZodString]>>>;
66
+ allOf: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEnum<{
67
+ readonly INCOMPLETE: 'incomplete';
68
+ readonly REJECTED: 'rejected';
69
+ readonly CORRECTION_REQUESTED: 'correction-requested';
70
+ readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
71
+ /**
72
+ * This flag is set by the Edit-action and removed after the declaration or registration.
73
+ * A record should never stay with the EDIT_IN_PROGRESS flag, since it should always be declared or registered right after.
74
+ *
75
+ * We only use this flag to determine that a NOTIFY, DECLARE or REGISTER action is allowed next.
76
+ */
77
+ readonly EDIT_IN_PROGRESS: 'edit-in-progress';
78
+ readonly SEALED: 'sealed';
79
+ }>]>, z.ZodString]>>>;
80
+ }, z.core.$strip>;
81
+ export type ContainsFlags = z.infer<typeof ContainsFlags>;
35
82
  /**
36
83
  * Configuration of a custom flag that can be associated with a certain event type.
37
84
  */
@@ -57,6 +104,7 @@ export declare const ActionFlagConfig: z.ZodObject<{
57
104
  * We only use this flag to determine that a NOTIFY, DECLARE or REGISTER action is allowed next.
58
105
  */
59
106
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
107
+ readonly SEALED: 'sealed';
60
108
  }>]>, z.ZodString]>;
61
109
  operation: z.ZodEnum<{
62
110
  add: "add";
@@ -314,6 +314,7 @@ export declare const WorkqueueConfig: z.ZodObject<{
314
314
  readonly CORRECTION_REQUESTED: 'correction-requested';
315
315
  readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
316
316
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
317
+ readonly SEALED: 'sealed';
317
318
  }>]>, z.ZodString]>>>;
318
319
  noneOf: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEnum<{
319
320
  readonly INCOMPLETE: 'incomplete';
@@ -321,6 +322,7 @@ export declare const WorkqueueConfig: z.ZodObject<{
321
322
  readonly CORRECTION_REQUESTED: 'correction-requested';
322
323
  readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
323
324
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
325
+ readonly SEALED: 'sealed';
324
326
  }>]>, z.ZodString]>>>;
325
327
  allOf: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEnum<{
326
328
  readonly INCOMPLETE: 'incomplete';
@@ -328,6 +330,7 @@ export declare const WorkqueueConfig: z.ZodObject<{
328
330
  readonly CORRECTION_REQUESTED: 'correction-requested';
329
331
  readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
330
332
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
333
+ readonly SEALED: 'sealed';
331
334
  }>]>, z.ZodString]>>>;
332
335
  }, z.core.$strip>>>;
333
336
  data: z.ZodOptional<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
@@ -631,6 +634,7 @@ export declare const WorkqueueConfig: z.ZodObject<{
631
634
  readonly CORRECTION_REQUESTED: 'correction-requested';
632
635
  readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
633
636
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
637
+ readonly SEALED: 'sealed';
634
638
  }>]>, z.ZodString]>>>;
635
639
  noneOf: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEnum<{
636
640
  readonly INCOMPLETE: 'incomplete';
@@ -638,6 +642,7 @@ export declare const WorkqueueConfig: z.ZodObject<{
638
642
  readonly CORRECTION_REQUESTED: 'correction-requested';
639
643
  readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
640
644
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
645
+ readonly SEALED: 'sealed';
641
646
  }>]>, z.ZodString]>>>;
642
647
  allOf: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEnum<{
643
648
  readonly INCOMPLETE: 'incomplete';
@@ -645,6 +650,7 @@ export declare const WorkqueueConfig: z.ZodObject<{
645
650
  readonly CORRECTION_REQUESTED: 'correction-requested';
646
651
  readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
647
652
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
653
+ readonly SEALED: 'sealed';
648
654
  }>]>, z.ZodString]>>>;
649
655
  }, z.core.$strip>>>;
650
656
  data: z.ZodOptional<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
@@ -1370,6 +1376,7 @@ export declare const WorkqueueConfigInput: z.ZodObject<{
1370
1376
  readonly CORRECTION_REQUESTED: 'correction-requested';
1371
1377
  readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
1372
1378
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
1379
+ readonly SEALED: 'sealed';
1373
1380
  }>]>, z.ZodString]>>>;
1374
1381
  noneOf: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEnum<{
1375
1382
  readonly INCOMPLETE: 'incomplete';
@@ -1377,6 +1384,7 @@ export declare const WorkqueueConfigInput: z.ZodObject<{
1377
1384
  readonly CORRECTION_REQUESTED: 'correction-requested';
1378
1385
  readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
1379
1386
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
1387
+ readonly SEALED: 'sealed';
1380
1388
  }>]>, z.ZodString]>>>;
1381
1389
  allOf: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEnum<{
1382
1390
  readonly INCOMPLETE: 'incomplete';
@@ -1384,6 +1392,7 @@ export declare const WorkqueueConfigInput: z.ZodObject<{
1384
1392
  readonly CORRECTION_REQUESTED: 'correction-requested';
1385
1393
  readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
1386
1394
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
1395
+ readonly SEALED: 'sealed';
1387
1396
  }>]>, z.ZodString]>>>;
1388
1397
  }, z.core.$strip>>>;
1389
1398
  data: z.ZodOptional<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
@@ -1686,6 +1695,7 @@ export declare const WorkqueueConfigInput: z.ZodObject<{
1686
1695
  readonly CORRECTION_REQUESTED: 'correction-requested';
1687
1696
  readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
1688
1697
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
1698
+ readonly SEALED: 'sealed';
1689
1699
  }>]>, z.ZodString]>>>;
1690
1700
  noneOf: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEnum<{
1691
1701
  readonly INCOMPLETE: 'incomplete';
@@ -1693,6 +1703,7 @@ export declare const WorkqueueConfigInput: z.ZodObject<{
1693
1703
  readonly CORRECTION_REQUESTED: 'correction-requested';
1694
1704
  readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
1695
1705
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
1706
+ readonly SEALED: 'sealed';
1696
1707
  }>]>, z.ZodString]>>>;
1697
1708
  allOf: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEnum<{
1698
1709
  readonly INCOMPLETE: 'incomplete';
@@ -1700,6 +1711,7 @@ export declare const WorkqueueConfigInput: z.ZodObject<{
1700
1711
  readonly CORRECTION_REQUESTED: 'correction-requested';
1701
1712
  readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
1702
1713
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
1714
+ readonly SEALED: 'sealed';
1703
1715
  }>]>, z.ZodString]>>>;
1704
1716
  }, z.core.$strip>>>;
1705
1717
  data: z.ZodOptional<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
@@ -2003,6 +2015,7 @@ export declare const WorkqueueConfigInput: z.ZodObject<{
2003
2015
  readonly CORRECTION_REQUESTED: 'correction-requested';
2004
2016
  readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
2005
2017
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
2018
+ readonly SEALED: 'sealed';
2006
2019
  }>]>, z.ZodString]>>>;
2007
2020
  noneOf: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEnum<{
2008
2021
  readonly INCOMPLETE: 'incomplete';
@@ -2010,6 +2023,7 @@ export declare const WorkqueueConfigInput: z.ZodObject<{
2010
2023
  readonly CORRECTION_REQUESTED: 'correction-requested';
2011
2024
  readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
2012
2025
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
2026
+ readonly SEALED: 'sealed';
2013
2027
  }>]>, z.ZodString]>>>;
2014
2028
  allOf: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEnum<{
2015
2029
  readonly INCOMPLETE: 'incomplete';
@@ -2017,6 +2031,7 @@ export declare const WorkqueueConfigInput: z.ZodObject<{
2017
2031
  readonly CORRECTION_REQUESTED: 'correction-requested';
2018
2032
  readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
2019
2033
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
2034
+ readonly SEALED: 'sealed';
2020
2035
  }>]>, z.ZodString]>>>;
2021
2036
  }, z.core.$strip>>>;
2022
2037
  data: z.ZodOptional<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
@@ -2038,11 +2053,11 @@ export declare function defineWorkqueue(workqueueInput: WorkqueueConfigInput): {
2038
2053
  clauses: {
2039
2054
  eventType?: string | undefined;
2040
2055
  status?: {
2041
- type: "anyOf";
2042
- terms: ("ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED")[];
2043
- } | {
2044
2056
  type: "exact";
2045
2057
  term: "ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED";
2058
+ } | {
2059
+ type: "anyOf";
2060
+ terms: ("ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED")[];
2046
2061
  } | undefined;
2047
2062
  createdAt?: {
2048
2063
  type: "range";
@@ -2177,11 +2192,11 @@ export declare function defineWorkqueue(workqueueInput: WorkqueueConfigInput): {
2177
2192
  clauses: {
2178
2193
  eventType?: string | undefined;
2179
2194
  status?: {
2180
- type: "anyOf";
2181
- terms: ("ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED")[];
2182
- } | {
2183
2195
  type: "exact";
2184
2196
  term: "ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED";
2197
+ } | {
2198
+ type: "anyOf";
2199
+ terms: ("ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED")[];
2185
2200
  } | undefined;
2186
2201
  createdAt?: {
2187
2202
  type: "range";
@@ -2349,11 +2364,11 @@ export declare function defineWorkqueues(workqueues: WorkqueueConfigInputWithV19
2349
2364
  clauses: {
2350
2365
  eventType?: string | undefined;
2351
2366
  status?: {
2352
- type: "anyOf";
2353
- terms: ("ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED")[];
2354
- } | {
2355
2367
  type: "exact";
2356
2368
  term: "ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED";
2369
+ } | {
2370
+ type: "anyOf";
2371
+ terms: ("ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED")[];
2357
2372
  } | undefined;
2358
2373
  createdAt?: {
2359
2374
  type: "range";
@@ -2488,11 +2503,11 @@ export declare function defineWorkqueues(workqueues: WorkqueueConfigInputWithV19
2488
2503
  clauses: {
2489
2504
  eventType?: string | undefined;
2490
2505
  status?: {
2491
- type: "anyOf";
2492
- terms: ("ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED")[];
2493
- } | {
2494
2506
  type: "exact";
2495
2507
  term: "ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED";
2508
+ } | {
2509
+ type: "anyOf";
2510
+ terms: ("ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED")[];
2496
2511
  } | undefined;
2497
2512
  createdAt?: {
2498
2513
  type: "range";
@@ -11,46 +11,12 @@ export declare const LocationTypeV1: z.ZodEnum<{
11
11
  HEALTH_FACILITY: "HEALTH_FACILITY";
12
12
  }>;
13
13
  export type LocationTypeV1 = z.infer<typeof LocationTypeV1>;
14
- export declare const LocationStatus: z.ZodEnum<{
15
- active: "active";
16
- inactive: "inactive";
17
- }>;
18
- export type LocationStatus = z.infer<typeof LocationStatus>;
19
- /**
20
- * A single element of the append-only `versions` history of a location or
21
- * administrative area. Versions are sorted ascending by `effectiveFrom`
22
- * ('0001-01-01' is used as the beginning-of-time sentinel).
23
- */
24
- export declare const LocationVersion: z.ZodObject<{
25
- versionId: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
26
- effectiveFrom: z.ZodISODate;
27
- name: z.ZodString;
28
- externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
29
- status: z.ZodEnum<{
30
- active: "active";
31
- inactive: "inactive";
32
- }>;
33
- }, z.core.$strip>;
34
- export type LocationVersion = z.infer<typeof LocationVersion>;
35
14
  export declare const AdministrativeArea: z.ZodObject<{
36
15
  id: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
37
16
  name: z.ZodString;
38
17
  externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
39
18
  parentId: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
40
- status: z.ZodEnum<{
41
- active: "active";
42
- inactive: "inactive";
43
- }>;
44
- versions: z.ZodArray<z.ZodObject<{
45
- versionId: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
46
- effectiveFrom: z.ZodISODate;
47
- name: z.ZodString;
48
- externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
49
- status: z.ZodEnum<{
50
- active: "active";
51
- inactive: "inactive";
52
- }>;
53
- }, z.core.$strip>>;
19
+ validUntil: z.ZodNullable<z.ZodISODateTime>;
54
20
  }, z.core.$strip>;
55
21
  export type AdministrativeArea = z.infer<typeof AdministrativeArea>;
56
22
  export declare const Location: z.ZodObject<{
@@ -58,59 +24,10 @@ export declare const Location: z.ZodObject<{
58
24
  name: z.ZodString;
59
25
  externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
60
26
  administrativeAreaId: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
27
+ validUntil: z.ZodNullable<z.ZodISODateTime>;
61
28
  locationType: z.ZodNullable<z.ZodString>;
62
- status: z.ZodEnum<{
63
- active: "active";
64
- inactive: "inactive";
65
- }>;
66
- versions: z.ZodArray<z.ZodObject<{
67
- versionId: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
68
- effectiveFrom: z.ZodISODate;
69
- name: z.ZodString;
70
- externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
71
- status: z.ZodEnum<{
72
- active: "active";
73
- inactive: "inactive";
74
- }>;
75
- }, z.core.$strip>>;
76
29
  }, z.core.$strip>;
77
30
  export type Location = z.infer<typeof Location>;
78
- /**
79
- * Input payload for the locations `set` mutation. Carries only the seedable
80
- * identity and hierarchy fields — version history is managed by the server.
81
- */
82
- export declare const SetLocationPayload: z.ZodObject<{
83
- id: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
84
- name: z.ZodString;
85
- externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
86
- administrativeAreaId: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
87
- locationType: z.ZodNullable<z.ZodString>;
88
- }, z.core.$strip>;
89
- export type SetLocationPayload = z.infer<typeof SetLocationPayload>;
90
- /**
91
- * Input payload for the administrative areas `set` mutation. Carries only the
92
- * seedable identity and hierarchy fields — version history is managed by the
93
- * server.
94
- */
95
- export declare const SetAdministrativeAreaPayload: z.ZodObject<{
96
- id: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
97
- name: z.ZodString;
98
- externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
99
- parentId: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
100
- }, z.core.$strip>;
101
- export type SetAdministrativeAreaPayload = z.infer<typeof SetAdministrativeAreaPayload>;
102
- /**
103
- * Resolves the version in effect at the given anchor date.
104
- *
105
- * Returns the element with the greatest `effectiveFrom` that is less than or
106
- * equal to `anchor`, falling back to the earliest element when the anchor
107
- * precedes all versions. Assumes `versions` is sorted ascending by
108
- * `effectiveFrom`. Both `effectiveFrom` and `anchor` are 'YYYY-MM-DD' strings,
109
- * so plain string comparison is correct.
110
- */
111
- export declare function resolveVersion<T extends {
112
- effectiveFrom: string;
113
- }>(versions: T[], anchor: string): T;
114
31
  type WrapArrayPreserveNullish<V> = V extends readonly any[] ? V : NonNullable<V>[] | Extract<V, null | undefined>;
115
32
  /**
116
33
  * For type T, convert fields K to arrays. If field is string, convert to string[].
@@ -162,14 +79,7 @@ export declare function getAdministrativeAreaHierarchy(administrativeAreaId: str
162
79
  name: string;
163
80
  externalId?: string | null | undefined;
164
81
  parentId: (string & z.$brand<"UUID">) | null;
165
- status: "active" | "inactive";
166
- versions: {
167
- versionId: string & z.$brand<"UUID">;
168
- effectiveFrom: string;
169
- name: string;
170
- externalId?: string | null | undefined;
171
- status: "active" | "inactive";
172
- }[];
82
+ validUntil: string | null;
173
83
  }[];
174
84
  /**
175
85
  * Resolves a location or administrative area UUID into a root-first hierarchy of UUIDs.
@@ -6,28 +6,14 @@ export declare const V2_DEFAULT_MOCK_LOCATIONS_MAP: Map<string & import("zod").$
6
6
  name: string;
7
7
  externalId?: string | null | undefined;
8
8
  administrativeAreaId: (string & import("zod").$brand<"UUID">) | null;
9
+ validUntil: string | null;
9
10
  locationType: string | null;
10
- status: "active" | "inactive";
11
- versions: {
12
- versionId: string & import("zod").$brand<"UUID">;
13
- effectiveFrom: string;
14
- name: string;
15
- externalId?: string | null | undefined;
16
- status: "active" | "inactive";
17
- }[];
18
11
  }>;
19
12
  export declare const V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP: Map<string & import("zod").$brand<"UUID">, {
20
13
  id: string & import("zod").$brand<"UUID">;
21
14
  name: string;
22
15
  externalId?: string | null | undefined;
23
16
  parentId: (string & import("zod").$brand<"UUID">) | null;
24
- status: "active" | "inactive";
25
- versions: {
26
- versionId: string & import("zod").$brand<"UUID">;
27
- effectiveFrom: string;
28
- name: string;
29
- externalId?: string | null | undefined;
30
- status: "active" | "inactive";
31
- }[];
17
+ validUntil: string | null;
32
18
  }>;
33
19
  //# sourceMappingURL=mocks.test.utils.d.ts.map
@@ -9,7 +9,7 @@ import { EventIndex } from './EventIndex';
9
9
  import { EventInput } from './EventInput';
10
10
  import { TranslationConfig } from './TranslationConfig';
11
11
  import { FieldConfig } from './FieldConfig';
12
- import { SetLocationPayload, SetAdministrativeAreaPayload } from './locations';
12
+ import { Location, AdministrativeArea } from './locations';
13
13
  import { WorkqueueConfig } from './WorkqueueConfig';
14
14
  import * as z from 'zod/v4';
15
15
  import { DocumentPath } from '../documents';
@@ -48,16 +48,16 @@ export declare function fieldConfigsToActionPayload(fields: FieldConfig[], rng:
48
48
  * Given hierarchy, ensures that related fields (e.g. location and administrative area) have valid values based on the hierarchy.
49
49
  */
50
50
  administrativeHierarchy?: {
51
- administrativeAreas: SetAdministrativeAreaPayload[];
52
- locations: SetLocationPayload[];
51
+ administrativeAreas: AdministrativeArea[];
52
+ locations: Location[];
53
53
  }): ActionUpdate;
54
54
  export declare function generateActionDeclarationInput(configuration: EventConfig, action: ActionType, rng: () => number, overrides?: ActionUpdate,
55
55
  /**
56
56
  * Given hierarchy, ensures that related fields (e.g. location and administrative area) have valid values based on the hierarchy.
57
57
  */
58
58
  administrativeHierarchy?: {
59
- administrativeAreas: SetAdministrativeAreaPayload[];
60
- locations: SetLocationPayload[];
59
+ administrativeAreas: AdministrativeArea[];
60
+ locations: Location[];
61
61
  }): ActionUpdate;
62
62
  export declare function generateActionDuplicateDeclarationInput(...args: Parameters<typeof generateActionDeclarationInput>): ReturnType<typeof generateActionDeclarationInput>;
63
63
  export declare function eventPayloadGenerator(rng: () => number, configuration?: EventConfig): {