@opencrvs/toolkit 2.1.0-rc.bebba5a → 2.1.0-rc.bfdbd70
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/commons/api/router.d.ts +5 -27
- package/dist/commons/events/locations.d.ts +3 -96
- package/dist/commons/events/mocks.test.utils.d.ts +2 -18
- package/dist/commons/events/test.utils.d.ts +5 -5
- package/dist/events/index.js +52 -62
- package/dist/notification/index.js +52 -48
- package/opencrvs-toolkit-2.1.0-rc.bfdbd70.tgz +0 -0
- package/package.json +2 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/opencrvs-toolkit-2.1.0-rc.bebba5a.tgz +0 -0
|
@@ -8351,16 +8351,8 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
8351
8351
|
name: string;
|
|
8352
8352
|
externalId?: string | null | undefined;
|
|
8353
8353
|
administrativeAreaId: (string & import("zod").$brand<"UUID">) | null;
|
|
8354
|
+
validUntil: string | null;
|
|
8354
8355
|
locationType: string | null;
|
|
8355
|
-
status: "active" | "inactive";
|
|
8356
|
-
effectiveFrom: string;
|
|
8357
|
-
versions: {
|
|
8358
|
-
versionId: string & import("zod").$brand<"UUID">;
|
|
8359
|
-
effectiveFrom: string;
|
|
8360
|
-
name: string;
|
|
8361
|
-
externalId?: string | null | undefined;
|
|
8362
|
-
status: "active" | "inactive";
|
|
8363
|
-
}[];
|
|
8364
8356
|
}[];
|
|
8365
8357
|
meta: object;
|
|
8366
8358
|
}>;
|
|
@@ -8370,6 +8362,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
8370
8362
|
name: string;
|
|
8371
8363
|
externalId?: string | null | undefined;
|
|
8372
8364
|
administrativeAreaId: string | null;
|
|
8365
|
+
validUntil: string | null;
|
|
8373
8366
|
locationType: string | null;
|
|
8374
8367
|
}[];
|
|
8375
8368
|
output: void;
|
|
@@ -8384,16 +8377,8 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
8384
8377
|
name: string;
|
|
8385
8378
|
externalId?: string | null | undefined;
|
|
8386
8379
|
administrativeAreaId: (string & import("zod").$brand<"UUID">) | null;
|
|
8380
|
+
validUntil: string | null;
|
|
8387
8381
|
locationType: string | null;
|
|
8388
|
-
status: "active" | "inactive";
|
|
8389
|
-
effectiveFrom: string;
|
|
8390
|
-
versions: {
|
|
8391
|
-
versionId: string & import("zod").$brand<"UUID">;
|
|
8392
|
-
effectiveFrom: string;
|
|
8393
|
-
name: string;
|
|
8394
|
-
externalId?: string | null | undefined;
|
|
8395
|
-
status: "active" | "inactive";
|
|
8396
|
-
}[];
|
|
8397
8382
|
};
|
|
8398
8383
|
meta: import("trpc-to-openapi").OpenApiMeta;
|
|
8399
8384
|
}>;
|
|
@@ -8801,15 +8786,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
8801
8786
|
name: string;
|
|
8802
8787
|
externalId?: string | null | undefined;
|
|
8803
8788
|
parentId: (string & import("zod").$brand<"UUID">) | null;
|
|
8804
|
-
|
|
8805
|
-
effectiveFrom: string;
|
|
8806
|
-
versions: {
|
|
8807
|
-
versionId: string & import("zod").$brand<"UUID">;
|
|
8808
|
-
effectiveFrom: string;
|
|
8809
|
-
name: string;
|
|
8810
|
-
externalId?: string | null | undefined;
|
|
8811
|
-
status: "active" | "inactive";
|
|
8812
|
-
}[];
|
|
8789
|
+
validUntil: string | null;
|
|
8813
8790
|
}[];
|
|
8814
8791
|
meta: import("trpc-to-openapi").OpenApiMeta;
|
|
8815
8792
|
}>;
|
|
@@ -8819,6 +8796,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
8819
8796
|
name: string;
|
|
8820
8797
|
externalId?: string | null | undefined;
|
|
8821
8798
|
parentId: string | null;
|
|
8799
|
+
validUntil: string | null;
|
|
8822
8800
|
}[];
|
|
8823
8801
|
output: void;
|
|
8824
8802
|
meta: object;
|
|
@@ -11,47 +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
|
-
effectiveFrom: z.ZodISODate;
|
|
45
|
-
versions: z.ZodArray<z.ZodObject<{
|
|
46
|
-
versionId: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
|
|
47
|
-
effectiveFrom: z.ZodISODate;
|
|
48
|
-
name: z.ZodString;
|
|
49
|
-
externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
50
|
-
status: z.ZodEnum<{
|
|
51
|
-
active: "active";
|
|
52
|
-
inactive: "inactive";
|
|
53
|
-
}>;
|
|
54
|
-
}, z.core.$strip>>;
|
|
19
|
+
validUntil: z.ZodNullable<z.ZodISODateTime>;
|
|
55
20
|
}, z.core.$strip>;
|
|
56
21
|
export type AdministrativeArea = z.infer<typeof AdministrativeArea>;
|
|
57
22
|
export declare const Location: z.ZodObject<{
|
|
@@ -59,60 +24,10 @@ export declare const Location: z.ZodObject<{
|
|
|
59
24
|
name: z.ZodString;
|
|
60
25
|
externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
61
26
|
administrativeAreaId: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
27
|
+
validUntil: z.ZodNullable<z.ZodISODateTime>;
|
|
62
28
|
locationType: z.ZodNullable<z.ZodString>;
|
|
63
|
-
status: z.ZodEnum<{
|
|
64
|
-
active: "active";
|
|
65
|
-
inactive: "inactive";
|
|
66
|
-
}>;
|
|
67
|
-
effectiveFrom: z.ZodISODate;
|
|
68
|
-
versions: z.ZodArray<z.ZodObject<{
|
|
69
|
-
versionId: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
|
|
70
|
-
effectiveFrom: z.ZodISODate;
|
|
71
|
-
name: z.ZodString;
|
|
72
|
-
externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
73
|
-
status: z.ZodEnum<{
|
|
74
|
-
active: "active";
|
|
75
|
-
inactive: "inactive";
|
|
76
|
-
}>;
|
|
77
|
-
}, z.core.$strip>>;
|
|
78
29
|
}, z.core.$strip>;
|
|
79
30
|
export type Location = z.infer<typeof Location>;
|
|
80
|
-
/**
|
|
81
|
-
* Input payload for the locations `set` mutation. Carries only the seedable
|
|
82
|
-
* identity and hierarchy fields — version history is managed by the server.
|
|
83
|
-
*/
|
|
84
|
-
export declare const SetLocationPayload: z.ZodObject<{
|
|
85
|
-
id: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
|
|
86
|
-
name: z.ZodString;
|
|
87
|
-
externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
88
|
-
administrativeAreaId: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
89
|
-
locationType: z.ZodNullable<z.ZodString>;
|
|
90
|
-
}, z.core.$strip>;
|
|
91
|
-
export type SetLocationPayload = z.infer<typeof SetLocationPayload>;
|
|
92
|
-
/**
|
|
93
|
-
* Input payload for the administrative areas `set` mutation. Carries only the
|
|
94
|
-
* seedable identity and hierarchy fields — version history is managed by the
|
|
95
|
-
* server.
|
|
96
|
-
*/
|
|
97
|
-
export declare const SetAdministrativeAreaPayload: z.ZodObject<{
|
|
98
|
-
id: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
|
|
99
|
-
name: z.ZodString;
|
|
100
|
-
externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
101
|
-
parentId: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
102
|
-
}, z.core.$strip>;
|
|
103
|
-
export type SetAdministrativeAreaPayload = z.infer<typeof SetAdministrativeAreaPayload>;
|
|
104
|
-
/**
|
|
105
|
-
* Resolves the version in effect at the given anchor date.
|
|
106
|
-
*
|
|
107
|
-
* Returns the element with the greatest `effectiveFrom` that is less than or
|
|
108
|
-
* equal to `anchor`, falling back to the earliest element when the anchor
|
|
109
|
-
* precedes all versions. Assumes `versions` is sorted ascending by
|
|
110
|
-
* `effectiveFrom`. Both `effectiveFrom` and `anchor` are 'YYYY-MM-DD' strings,
|
|
111
|
-
* so plain string comparison is correct.
|
|
112
|
-
*/
|
|
113
|
-
export declare function resolveVersion<T extends {
|
|
114
|
-
effectiveFrom: string;
|
|
115
|
-
}>(versions: T[], anchor: string): T;
|
|
116
31
|
type WrapArrayPreserveNullish<V> = V extends readonly any[] ? V : NonNullable<V>[] | Extract<V, null | undefined>;
|
|
117
32
|
/**
|
|
118
33
|
* For type T, convert fields K to arrays. If field is string, convert to string[].
|
|
@@ -164,15 +79,7 @@ export declare function getAdministrativeAreaHierarchy(administrativeAreaId: str
|
|
|
164
79
|
name: string;
|
|
165
80
|
externalId?: string | null | undefined;
|
|
166
81
|
parentId: (string & z.$brand<"UUID">) | null;
|
|
167
|
-
|
|
168
|
-
effectiveFrom: string;
|
|
169
|
-
versions: {
|
|
170
|
-
versionId: string & z.$brand<"UUID">;
|
|
171
|
-
effectiveFrom: string;
|
|
172
|
-
name: string;
|
|
173
|
-
externalId?: string | null | undefined;
|
|
174
|
-
status: "active" | "inactive";
|
|
175
|
-
}[];
|
|
82
|
+
validUntil: string | null;
|
|
176
83
|
}[];
|
|
177
84
|
/**
|
|
178
85
|
* Resolves a location or administrative area UUID into a root-first hierarchy of UUIDs.
|
|
@@ -6,30 +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
|
-
effectiveFrom: string;
|
|
12
|
-
versions: {
|
|
13
|
-
versionId: string & import("zod").$brand<"UUID">;
|
|
14
|
-
effectiveFrom: string;
|
|
15
|
-
name: string;
|
|
16
|
-
externalId?: string | null | undefined;
|
|
17
|
-
status: "active" | "inactive";
|
|
18
|
-
}[];
|
|
19
11
|
}>;
|
|
20
12
|
export declare const V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP: Map<string & import("zod").$brand<"UUID">, {
|
|
21
13
|
id: string & import("zod").$brand<"UUID">;
|
|
22
14
|
name: string;
|
|
23
15
|
externalId?: string | null | undefined;
|
|
24
16
|
parentId: (string & import("zod").$brand<"UUID">) | null;
|
|
25
|
-
|
|
26
|
-
effectiveFrom: string;
|
|
27
|
-
versions: {
|
|
28
|
-
versionId: string & import("zod").$brand<"UUID">;
|
|
29
|
-
effectiveFrom: string;
|
|
30
|
-
name: string;
|
|
31
|
-
externalId?: string | null | undefined;
|
|
32
|
-
status: "active" | "inactive";
|
|
33
|
-
}[];
|
|
17
|
+
validUntil: string | null;
|
|
34
18
|
}>;
|
|
35
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): {
|