@opencrvs/toolkit 2.1.0-rc.f85d99c → 2.1.0-rc.f90c283
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 +189 -200
- package/dist/commons/api/router.d.ts +26 -7
- package/dist/commons/conditionals/conditionals.d.ts +3 -3
- package/dist/commons/conditionals/validate.d.ts +1 -2
- package/dist/commons/events/ActionConfig.d.ts +0 -21
- package/dist/commons/events/ActionDocument.d.ts +7 -1
- package/dist/commons/events/AdvancedSearchConfig.d.ts +0 -6
- package/dist/commons/events/CountryConfigQueryInput.d.ts +0 -18
- package/dist/commons/events/EventIndex.d.ts +24 -5
- package/dist/commons/events/EventMetadata.d.ts +0 -1
- package/dist/commons/events/FieldConfig.d.ts +0 -5
- package/dist/commons/events/FieldTypeMapping.d.ts +19 -19
- package/dist/commons/events/Flag.d.ts +0 -48
- package/dist/commons/events/WorkqueueConfig.d.ts +12 -27
- package/dist/commons/events/locations.d.ts +93 -3
- package/dist/commons/events/mocks.test.utils.d.ts +16 -2
- package/dist/commons/events/test.utils.d.ts +5 -5
- package/dist/conditionals/index.js +55 -303
- package/dist/events/index.js +2733 -2766
- package/dist/notification/index.js +989 -1559
- package/dist/scopes/index.d.ts +0 -250
- package/dist/scopes/index.js +55 -304
- package/opencrvs-toolkit-2.1.0-rc.f90c283.tgz +0 -0
- package/package.json +1 -1
- package/dist/commons/events/ActionStatus.d.ts +0 -14
- package/opencrvs-toolkit-2.1.0-rc.f85d99c.tgz +0 -0
|
@@ -32,8 +32,8 @@ export declare function mapFieldTypeToZod(field: FieldConfig, actionType?: Actio
|
|
|
32
32
|
age: z.ZodNumber;
|
|
33
33
|
asOfDateRef: z.ZodString;
|
|
34
34
|
}, z.core.$strip> | z.ZodObject<{
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
numericValue: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
37
37
|
}, z.core.$strip> | z.ZodObject<{
|
|
38
38
|
path: z.core.$ZodBranded<z.ZodString, "DocumentPath", "out">;
|
|
39
39
|
originalFilename: z.ZodString;
|
|
@@ -44,8 +44,8 @@ export declare function mapFieldTypeToZod(field: FieldConfig, actionType?: Actio
|
|
|
44
44
|
numericValue: z.ZodNumber;
|
|
45
45
|
unit: z.ZodString;
|
|
46
46
|
}, z.core.$strip> | z.ZodObject<{
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
label: z.ZodString;
|
|
48
|
+
value: z.ZodString;
|
|
49
49
|
}, z.core.$strip> | z.ZodObject<{
|
|
50
50
|
data: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
51
51
|
}, z.core.$strip> | z.ZodObject<{
|
|
@@ -68,8 +68,8 @@ export declare function mapFieldTypeToZod(field: FieldConfig, actionType?: Actio
|
|
|
68
68
|
age: z.ZodNumber;
|
|
69
69
|
asOfDateRef: z.ZodString;
|
|
70
70
|
}, z.core.$strip>>> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
numericValue: z.ZodOptional<z.ZodNumber>;
|
|
72
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
73
73
|
}, z.core.$strip>>> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
74
74
|
path: z.core.$ZodBranded<z.ZodString, "DocumentPath", "out">;
|
|
75
75
|
originalFilename: z.ZodString;
|
|
@@ -80,8 +80,8 @@ export declare function mapFieldTypeToZod(field: FieldConfig, actionType?: Actio
|
|
|
80
80
|
numericValue: z.ZodNumber;
|
|
81
81
|
unit: z.ZodString;
|
|
82
82
|
}, z.core.$strip>>> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
label: z.ZodString;
|
|
84
|
+
value: z.ZodString;
|
|
85
85
|
}, z.core.$strip>>> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
86
86
|
data: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
87
87
|
country: z.ZodString;
|
|
@@ -243,15 +243,6 @@ export declare function mapFieldTypeToZod(field: FieldConfig, actionType?: Actio
|
|
|
243
243
|
}, z.core.$strip>>>;
|
|
244
244
|
data: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
|
|
245
245
|
}, z.core.$strip>, z.ZodNull]>, z.ZodUndefined]>>> | z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUnknown, "CustomFieldValue", "out">>> | z.ZodString | z.ZodType<{
|
|
246
|
-
country: string;
|
|
247
|
-
streetLevelDetails?: Record<string, string> | undefined;
|
|
248
|
-
addressType: "DOMESTIC";
|
|
249
|
-
administrativeArea: string;
|
|
250
|
-
} | {
|
|
251
|
-
country: string;
|
|
252
|
-
streetLevelDetails?: Record<string, string> | undefined;
|
|
253
|
-
addressType: "INTERNATIONAL";
|
|
254
|
-
} | {
|
|
255
246
|
country?: string | null | undefined;
|
|
256
247
|
streetLevelDetails?: Record<string, string | null> | null | undefined;
|
|
257
248
|
addressType: "DOMESTIC";
|
|
@@ -260,7 +251,7 @@ export declare function mapFieldTypeToZod(field: FieldConfig, actionType?: Actio
|
|
|
260
251
|
country?: string | null | undefined;
|
|
261
252
|
streetLevelDetails?: Record<string, string | null> | null | undefined;
|
|
262
253
|
addressType: "INTERNATIONAL";
|
|
263
|
-
} |
|
|
254
|
+
} | {
|
|
264
255
|
country: string;
|
|
265
256
|
streetLevelDetails?: Record<string, string> | undefined;
|
|
266
257
|
addressType: "DOMESTIC";
|
|
@@ -269,7 +260,7 @@ export declare function mapFieldTypeToZod(field: FieldConfig, actionType?: Actio
|
|
|
269
260
|
country: string;
|
|
270
261
|
streetLevelDetails?: Record<string, string> | undefined;
|
|
271
262
|
addressType: "INTERNATIONAL";
|
|
272
|
-
} | {
|
|
263
|
+
} | null | undefined, unknown, z.core.$ZodTypeInternals<{
|
|
273
264
|
country?: string | null | undefined;
|
|
274
265
|
streetLevelDetails?: Record<string, string | null> | null | undefined;
|
|
275
266
|
addressType: "DOMESTIC";
|
|
@@ -278,6 +269,15 @@ export declare function mapFieldTypeToZod(field: FieldConfig, actionType?: Actio
|
|
|
278
269
|
country?: string | null | undefined;
|
|
279
270
|
streetLevelDetails?: Record<string, string | null> | null | undefined;
|
|
280
271
|
addressType: "INTERNATIONAL";
|
|
272
|
+
} | {
|
|
273
|
+
country: string;
|
|
274
|
+
streetLevelDetails?: Record<string, string> | undefined;
|
|
275
|
+
addressType: "DOMESTIC";
|
|
276
|
+
administrativeArea: string;
|
|
277
|
+
} | {
|
|
278
|
+
country: string;
|
|
279
|
+
streetLevelDetails?: Record<string, string> | undefined;
|
|
280
|
+
addressType: "INTERNATIONAL";
|
|
281
281
|
} | null | undefined, unknown>> | z.ZodUnion<[z.ZodObject<{
|
|
282
282
|
start: z.core.$ZodBranded<z.ZodString, "PlainDate", "out">;
|
|
283
283
|
end: z.core.$ZodBranded<z.ZodString, "PlainDate", "out">;
|
|
@@ -11,7 +11,6 @@ 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';
|
|
15
14
|
};
|
|
16
15
|
export type InherentFlags = (typeof InherentFlags)[keyof typeof InherentFlags];
|
|
17
16
|
export declare const ActionFlag: z.ZodString;
|
|
@@ -31,54 +30,8 @@ export declare const Flag: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEnum<{
|
|
|
31
30
|
* We only use this flag to determine that a NOTIFY, DECLARE or REGISTER action is allowed next.
|
|
32
31
|
*/
|
|
33
32
|
readonly EDIT_IN_PROGRESS: 'edit-in-progress';
|
|
34
|
-
readonly SEALED: 'sealed';
|
|
35
33
|
}>]>, z.ZodString]>;
|
|
36
34
|
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>;
|
|
82
35
|
/**
|
|
83
36
|
* Configuration of a custom flag that can be associated with a certain event type.
|
|
84
37
|
*/
|
|
@@ -104,7 +57,6 @@ export declare const ActionFlagConfig: z.ZodObject<{
|
|
|
104
57
|
* We only use this flag to determine that a NOTIFY, DECLARE or REGISTER action is allowed next.
|
|
105
58
|
*/
|
|
106
59
|
readonly EDIT_IN_PROGRESS: 'edit-in-progress';
|
|
107
|
-
readonly SEALED: 'sealed';
|
|
108
60
|
}>]>, z.ZodString]>;
|
|
109
61
|
operation: z.ZodEnum<{
|
|
110
62
|
add: "add";
|
|
@@ -314,7 +314,6 @@ 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';
|
|
318
317
|
}>]>, z.ZodString]>>>;
|
|
319
318
|
noneOf: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEnum<{
|
|
320
319
|
readonly INCOMPLETE: 'incomplete';
|
|
@@ -322,7 +321,6 @@ export declare const WorkqueueConfig: z.ZodObject<{
|
|
|
322
321
|
readonly CORRECTION_REQUESTED: 'correction-requested';
|
|
323
322
|
readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
|
|
324
323
|
readonly EDIT_IN_PROGRESS: 'edit-in-progress';
|
|
325
|
-
readonly SEALED: 'sealed';
|
|
326
324
|
}>]>, z.ZodString]>>>;
|
|
327
325
|
allOf: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEnum<{
|
|
328
326
|
readonly INCOMPLETE: 'incomplete';
|
|
@@ -330,7 +328,6 @@ export declare const WorkqueueConfig: z.ZodObject<{
|
|
|
330
328
|
readonly CORRECTION_REQUESTED: 'correction-requested';
|
|
331
329
|
readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
|
|
332
330
|
readonly EDIT_IN_PROGRESS: 'edit-in-progress';
|
|
333
|
-
readonly SEALED: 'sealed';
|
|
334
331
|
}>]>, z.ZodString]>>>;
|
|
335
332
|
}, z.core.$strip>>>;
|
|
336
333
|
data: z.ZodOptional<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
@@ -634,7 +631,6 @@ export declare const WorkqueueConfig: z.ZodObject<{
|
|
|
634
631
|
readonly CORRECTION_REQUESTED: 'correction-requested';
|
|
635
632
|
readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
|
|
636
633
|
readonly EDIT_IN_PROGRESS: 'edit-in-progress';
|
|
637
|
-
readonly SEALED: 'sealed';
|
|
638
634
|
}>]>, z.ZodString]>>>;
|
|
639
635
|
noneOf: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEnum<{
|
|
640
636
|
readonly INCOMPLETE: 'incomplete';
|
|
@@ -642,7 +638,6 @@ export declare const WorkqueueConfig: z.ZodObject<{
|
|
|
642
638
|
readonly CORRECTION_REQUESTED: 'correction-requested';
|
|
643
639
|
readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
|
|
644
640
|
readonly EDIT_IN_PROGRESS: 'edit-in-progress';
|
|
645
|
-
readonly SEALED: 'sealed';
|
|
646
641
|
}>]>, z.ZodString]>>>;
|
|
647
642
|
allOf: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEnum<{
|
|
648
643
|
readonly INCOMPLETE: 'incomplete';
|
|
@@ -650,7 +645,6 @@ export declare const WorkqueueConfig: z.ZodObject<{
|
|
|
650
645
|
readonly CORRECTION_REQUESTED: 'correction-requested';
|
|
651
646
|
readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
|
|
652
647
|
readonly EDIT_IN_PROGRESS: 'edit-in-progress';
|
|
653
|
-
readonly SEALED: 'sealed';
|
|
654
648
|
}>]>, z.ZodString]>>>;
|
|
655
649
|
}, z.core.$strip>>>;
|
|
656
650
|
data: z.ZodOptional<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
@@ -1376,7 +1370,6 @@ export declare const WorkqueueConfigInput: z.ZodObject<{
|
|
|
1376
1370
|
readonly CORRECTION_REQUESTED: 'correction-requested';
|
|
1377
1371
|
readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
|
|
1378
1372
|
readonly EDIT_IN_PROGRESS: 'edit-in-progress';
|
|
1379
|
-
readonly SEALED: 'sealed';
|
|
1380
1373
|
}>]>, z.ZodString]>>>;
|
|
1381
1374
|
noneOf: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEnum<{
|
|
1382
1375
|
readonly INCOMPLETE: 'incomplete';
|
|
@@ -1384,7 +1377,6 @@ export declare const WorkqueueConfigInput: z.ZodObject<{
|
|
|
1384
1377
|
readonly CORRECTION_REQUESTED: 'correction-requested';
|
|
1385
1378
|
readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
|
|
1386
1379
|
readonly EDIT_IN_PROGRESS: 'edit-in-progress';
|
|
1387
|
-
readonly SEALED: 'sealed';
|
|
1388
1380
|
}>]>, z.ZodString]>>>;
|
|
1389
1381
|
allOf: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEnum<{
|
|
1390
1382
|
readonly INCOMPLETE: 'incomplete';
|
|
@@ -1392,7 +1384,6 @@ export declare const WorkqueueConfigInput: z.ZodObject<{
|
|
|
1392
1384
|
readonly CORRECTION_REQUESTED: 'correction-requested';
|
|
1393
1385
|
readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
|
|
1394
1386
|
readonly EDIT_IN_PROGRESS: 'edit-in-progress';
|
|
1395
|
-
readonly SEALED: 'sealed';
|
|
1396
1387
|
}>]>, z.ZodString]>>>;
|
|
1397
1388
|
}, z.core.$strip>>>;
|
|
1398
1389
|
data: z.ZodOptional<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
@@ -1695,7 +1686,6 @@ export declare const WorkqueueConfigInput: z.ZodObject<{
|
|
|
1695
1686
|
readonly CORRECTION_REQUESTED: 'correction-requested';
|
|
1696
1687
|
readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
|
|
1697
1688
|
readonly EDIT_IN_PROGRESS: 'edit-in-progress';
|
|
1698
|
-
readonly SEALED: 'sealed';
|
|
1699
1689
|
}>]>, z.ZodString]>>>;
|
|
1700
1690
|
noneOf: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEnum<{
|
|
1701
1691
|
readonly INCOMPLETE: 'incomplete';
|
|
@@ -1703,7 +1693,6 @@ export declare const WorkqueueConfigInput: z.ZodObject<{
|
|
|
1703
1693
|
readonly CORRECTION_REQUESTED: 'correction-requested';
|
|
1704
1694
|
readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
|
|
1705
1695
|
readonly EDIT_IN_PROGRESS: 'edit-in-progress';
|
|
1706
|
-
readonly SEALED: 'sealed';
|
|
1707
1696
|
}>]>, z.ZodString]>>>;
|
|
1708
1697
|
allOf: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEnum<{
|
|
1709
1698
|
readonly INCOMPLETE: 'incomplete';
|
|
@@ -1711,7 +1700,6 @@ export declare const WorkqueueConfigInput: z.ZodObject<{
|
|
|
1711
1700
|
readonly CORRECTION_REQUESTED: 'correction-requested';
|
|
1712
1701
|
readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
|
|
1713
1702
|
readonly EDIT_IN_PROGRESS: 'edit-in-progress';
|
|
1714
|
-
readonly SEALED: 'sealed';
|
|
1715
1703
|
}>]>, z.ZodString]>>>;
|
|
1716
1704
|
}, z.core.$strip>>>;
|
|
1717
1705
|
data: z.ZodOptional<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
@@ -2015,7 +2003,6 @@ export declare const WorkqueueConfigInput: z.ZodObject<{
|
|
|
2015
2003
|
readonly CORRECTION_REQUESTED: 'correction-requested';
|
|
2016
2004
|
readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
|
|
2017
2005
|
readonly EDIT_IN_PROGRESS: 'edit-in-progress';
|
|
2018
|
-
readonly SEALED: 'sealed';
|
|
2019
2006
|
}>]>, z.ZodString]>>>;
|
|
2020
2007
|
noneOf: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEnum<{
|
|
2021
2008
|
readonly INCOMPLETE: 'incomplete';
|
|
@@ -2023,7 +2010,6 @@ export declare const WorkqueueConfigInput: z.ZodObject<{
|
|
|
2023
2010
|
readonly CORRECTION_REQUESTED: 'correction-requested';
|
|
2024
2011
|
readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
|
|
2025
2012
|
readonly EDIT_IN_PROGRESS: 'edit-in-progress';
|
|
2026
|
-
readonly SEALED: 'sealed';
|
|
2027
2013
|
}>]>, z.ZodString]>>>;
|
|
2028
2014
|
allOf: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEnum<{
|
|
2029
2015
|
readonly INCOMPLETE: 'incomplete';
|
|
@@ -2031,7 +2017,6 @@ export declare const WorkqueueConfigInput: z.ZodObject<{
|
|
|
2031
2017
|
readonly CORRECTION_REQUESTED: 'correction-requested';
|
|
2032
2018
|
readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
|
|
2033
2019
|
readonly EDIT_IN_PROGRESS: 'edit-in-progress';
|
|
2034
|
-
readonly SEALED: 'sealed';
|
|
2035
2020
|
}>]>, z.ZodString]>>>;
|
|
2036
2021
|
}, z.core.$strip>>>;
|
|
2037
2022
|
data: z.ZodOptional<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
@@ -2053,11 +2038,11 @@ export declare function defineWorkqueue(workqueueInput: WorkqueueConfigInput): {
|
|
|
2053
2038
|
clauses: {
|
|
2054
2039
|
eventType?: string | undefined;
|
|
2055
2040
|
status?: {
|
|
2056
|
-
type: "exact";
|
|
2057
|
-
term: "ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED";
|
|
2058
|
-
} | {
|
|
2059
2041
|
type: "anyOf";
|
|
2060
2042
|
terms: ("ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED")[];
|
|
2043
|
+
} | {
|
|
2044
|
+
type: "exact";
|
|
2045
|
+
term: "ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED";
|
|
2061
2046
|
} | undefined;
|
|
2062
2047
|
createdAt?: {
|
|
2063
2048
|
type: "range";
|
|
@@ -2192,11 +2177,11 @@ export declare function defineWorkqueue(workqueueInput: WorkqueueConfigInput): {
|
|
|
2192
2177
|
clauses: {
|
|
2193
2178
|
eventType?: string | undefined;
|
|
2194
2179
|
status?: {
|
|
2195
|
-
type: "exact";
|
|
2196
|
-
term: "ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED";
|
|
2197
|
-
} | {
|
|
2198
2180
|
type: "anyOf";
|
|
2199
2181
|
terms: ("ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED")[];
|
|
2182
|
+
} | {
|
|
2183
|
+
type: "exact";
|
|
2184
|
+
term: "ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED";
|
|
2200
2185
|
} | undefined;
|
|
2201
2186
|
createdAt?: {
|
|
2202
2187
|
type: "range";
|
|
@@ -2364,11 +2349,11 @@ export declare function defineWorkqueues(workqueues: WorkqueueConfigInputWithV19
|
|
|
2364
2349
|
clauses: {
|
|
2365
2350
|
eventType?: string | undefined;
|
|
2366
2351
|
status?: {
|
|
2367
|
-
type: "exact";
|
|
2368
|
-
term: "ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED";
|
|
2369
|
-
} | {
|
|
2370
2352
|
type: "anyOf";
|
|
2371
2353
|
terms: ("ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED")[];
|
|
2354
|
+
} | {
|
|
2355
|
+
type: "exact";
|
|
2356
|
+
term: "ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED";
|
|
2372
2357
|
} | undefined;
|
|
2373
2358
|
createdAt?: {
|
|
2374
2359
|
type: "range";
|
|
@@ -2503,11 +2488,11 @@ export declare function defineWorkqueues(workqueues: WorkqueueConfigInputWithV19
|
|
|
2503
2488
|
clauses: {
|
|
2504
2489
|
eventType?: string | undefined;
|
|
2505
2490
|
status?: {
|
|
2506
|
-
type: "exact";
|
|
2507
|
-
term: "ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED";
|
|
2508
|
-
} | {
|
|
2509
2491
|
type: "anyOf";
|
|
2510
2492
|
terms: ("ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED")[];
|
|
2493
|
+
} | {
|
|
2494
|
+
type: "exact";
|
|
2495
|
+
term: "ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED";
|
|
2511
2496
|
} | undefined;
|
|
2512
2497
|
createdAt?: {
|
|
2513
2498
|
type: "range";
|
|
@@ -11,12 +11,46 @@ 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>;
|
|
14
35
|
export declare const AdministrativeArea: z.ZodObject<{
|
|
15
36
|
id: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
|
|
16
37
|
name: z.ZodString;
|
|
17
38
|
externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
18
39
|
parentId: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
19
|
-
|
|
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>>;
|
|
20
54
|
}, z.core.$strip>;
|
|
21
55
|
export type AdministrativeArea = z.infer<typeof AdministrativeArea>;
|
|
22
56
|
export declare const Location: z.ZodObject<{
|
|
@@ -24,10 +58,59 @@ export declare const Location: z.ZodObject<{
|
|
|
24
58
|
name: z.ZodString;
|
|
25
59
|
externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
26
60
|
administrativeAreaId: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
27
|
-
validUntil: z.ZodNullable<z.ZodISODateTime>;
|
|
28
61
|
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>>;
|
|
29
76
|
}, z.core.$strip>;
|
|
30
77
|
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;
|
|
31
114
|
type WrapArrayPreserveNullish<V> = V extends readonly any[] ? V : NonNullable<V>[] | Extract<V, null | undefined>;
|
|
32
115
|
/**
|
|
33
116
|
* For type T, convert fields K to arrays. If field is string, convert to string[].
|
|
@@ -79,7 +162,14 @@ export declare function getAdministrativeAreaHierarchy(administrativeAreaId: str
|
|
|
79
162
|
name: string;
|
|
80
163
|
externalId?: string | null | undefined;
|
|
81
164
|
parentId: (string & z.$brand<"UUID">) | null;
|
|
82
|
-
|
|
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
|
+
}[];
|
|
83
173
|
}[];
|
|
84
174
|
/**
|
|
85
175
|
* Resolves a location or administrative area UUID into a root-first hierarchy of UUIDs.
|
|
@@ -6,14 +6,28 @@ 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;
|
|
10
9
|
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
|
+
}[];
|
|
11
18
|
}>;
|
|
12
19
|
export declare const V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP: Map<string & import("zod").$brand<"UUID">, {
|
|
13
20
|
id: string & import("zod").$brand<"UUID">;
|
|
14
21
|
name: string;
|
|
15
22
|
externalId?: string | null | undefined;
|
|
16
23
|
parentId: (string & import("zod").$brand<"UUID">) | null;
|
|
17
|
-
|
|
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
|
+
}[];
|
|
18
32
|
}>;
|
|
19
33
|
//# 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 { SetLocationPayload, SetAdministrativeAreaPayload } 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: SetAdministrativeAreaPayload[];
|
|
52
|
+
locations: SetLocationPayload[];
|
|
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: SetAdministrativeAreaPayload[];
|
|
60
|
+
locations: SetLocationPayload[];
|
|
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): {
|