@opencrvs/toolkit 2.1.0-rc.f383722 → 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.
- package/dist/application-config/index.js +200 -190
- package/dist/commons/api/router.d.ts +7 -111
- package/dist/commons/conditionals/conditionals.d.ts +6 -6
- package/dist/commons/conditionals/validate.d.ts +2 -1
- package/dist/commons/events/ActionConfig.d.ts +21 -0
- package/dist/commons/events/ActionDocument.d.ts +1 -7
- package/dist/commons/events/ActionStatus.d.ts +14 -0
- package/dist/commons/events/AdvancedSearchConfig.d.ts +6 -6
- package/dist/commons/events/AuditLog.d.ts +0 -37
- package/dist/commons/events/CountryConfigQueryInput.d.ts +18 -0
- package/dist/commons/events/EventIndex.d.ts +7 -26
- package/dist/commons/events/EventMetadata.d.ts +1 -0
- package/dist/commons/events/FieldConfig.d.ts +6 -6
- package/dist/commons/events/FieldTypeMapping.d.ts +19 -19
- package/dist/commons/events/Flag.d.ts +48 -0
- package/dist/commons/events/WorkqueueConfig.d.ts +27 -12
- package/dist/commons/events/index.d.ts +0 -1
- package/dist/commons/events/locations.d.ts +3 -100
- package/dist/commons/events/mocks.test.utils.d.ts +2 -16
- package/dist/commons/events/test.utils.d.ts +5 -5
- package/dist/conditionals/index.js +303 -56
- package/dist/environment/logger.d.ts +3 -12
- package/dist/environment/logger.d.ts.map +1 -1
- package/dist/events/index.js +3278 -3333
- package/dist/notification/index.js +1492 -996
- package/dist/scopes/index.d.ts +276 -28
- package/dist/scopes/index.js +304 -56
- package/opencrvs-toolkit-2.1.0-rc.f85d99c.tgz +0 -0
- package/package.json +3 -4
- package/tsconfig.tsbuildinfo +1 -1
- package/.nx/cache/file-map.json +0 -360
- package/.nx/cache/project-graph.json +0 -6
- package/dist/commons/events/locationPayloads.d.ts +0 -95
- package/opencrvs-toolkit-2.1.0-rc.f383722.tgz +0 -0
|
@@ -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";
|
|
@@ -45,7 +45,6 @@ export * from './field';
|
|
|
45
45
|
export * from './Flag';
|
|
46
46
|
export * from './event';
|
|
47
47
|
export * from './locations';
|
|
48
|
-
export * from './locationPayloads';
|
|
49
48
|
export { UUID } from '../uuid';
|
|
50
49
|
export { DocumentPath } from '../documents';
|
|
51
50
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -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
|
-
|
|
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,66 +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
|
-
/**
|
|
115
|
-
* Whether the entity holds the given externalId with active status at the
|
|
116
|
-
* anchor date or at any point after it. Used for point-in-time uniqueness of
|
|
117
|
-
* external codes: a new holder starting at `anchor` collides when an existing
|
|
118
|
-
* holder is (or is scheduled to be) active with the code from then on.
|
|
119
|
-
*/
|
|
120
|
-
export declare function hasActiveExternalIdOnOrAfter(versions: LocationVersion[], externalId: string, anchor: string): boolean;
|
|
121
31
|
type WrapArrayPreserveNullish<V> = V extends readonly any[] ? V : NonNullable<V>[] | Extract<V, null | undefined>;
|
|
122
32
|
/**
|
|
123
33
|
* For type T, convert fields K to arrays. If field is string, convert to string[].
|
|
@@ -169,14 +79,7 @@ export declare function getAdministrativeAreaHierarchy(administrativeAreaId: str
|
|
|
169
79
|
name: string;
|
|
170
80
|
externalId?: string | null | undefined;
|
|
171
81
|
parentId: (string & z.$brand<"UUID">) | null;
|
|
172
|
-
|
|
173
|
-
versions: {
|
|
174
|
-
versionId: string & z.$brand<"UUID">;
|
|
175
|
-
effectiveFrom: string;
|
|
176
|
-
name: string;
|
|
177
|
-
externalId?: string | null | undefined;
|
|
178
|
-
status: "active" | "inactive";
|
|
179
|
-
}[];
|
|
82
|
+
validUntil: string | null;
|
|
180
83
|
}[];
|
|
181
84
|
/**
|
|
182
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
|
-
|
|
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 {
|
|
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:
|
|
52
|
-
locations:
|
|
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:
|
|
60
|
-
locations:
|
|
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): {
|