@opencrvs/toolkit 2.1.0-rc.d078d1a → 2.1.0-rc.d1b9774
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/README.md +1 -0
- package/build.sh +9 -1
- package/create-countryconfig/index.js +284 -62
- package/create-countryconfig/node_modules/.bin/degit +21 -0
- package/create-countryconfig/package.json +4 -1
- package/dist/application-config/index.js +265 -209
- package/dist/authentication/index.d.ts +67 -0
- package/dist/authentication/index.d.ts.map +1 -0
- package/dist/authentication/index.js +750 -0
- package/dist/cli.js +1744 -104
- package/dist/commons/api/router.d.ts +599 -69
- package/dist/commons/conditionals/conditionals.d.ts +6 -6
- package/dist/commons/conditionals/validate.d.ts +13 -11
- package/dist/commons/events/ActionDocument.d.ts +4 -4
- package/dist/commons/events/ActionInput.d.ts +4 -4
- package/dist/commons/events/AdvancedSearchConfig.d.ts +12 -0
- package/dist/commons/events/AuditLog.d.ts +110 -0
- package/dist/commons/events/EventDocument.d.ts +470 -2
- package/dist/commons/events/EventIndex.d.ts +2 -2
- package/dist/commons/events/EventMetadata.d.ts +1 -11
- package/dist/commons/events/EventStatus.d.ts +19 -0
- package/dist/commons/events/FieldConfig.d.ts +78 -53
- package/dist/commons/events/FieldTypeMapping.d.ts +12 -12
- package/dist/commons/events/FieldValue.d.ts +2 -2
- package/dist/commons/events/PlainDate.d.ts +8 -0
- package/dist/commons/events/SummaryConfig.d.ts +249 -0
- package/dist/commons/events/locations.d.ts +158 -26
- package/dist/commons/events/mocks.test.utils.d.ts +30 -0
- package/dist/commons/events/test.utils.d.ts +8 -4
- package/dist/commons/events/utils.d.ts +2 -2
- package/dist/commons/notification/UserNotifications.d.ts +28 -13
- package/dist/commons/notification/dispatch.d.ts +10 -0
- package/dist/commons/notification/index.d.ts +1 -0
- package/dist/conditionals/index.js +79 -57
- package/dist/csv.d.ts +25 -0
- package/dist/csv.d.ts.map +1 -0
- package/dist/csv.js +120 -0
- package/dist/environment/index.d.ts +1 -0
- package/dist/environment/index.d.ts.map +1 -1
- package/dist/environment/index.js +10 -0
- package/dist/environment/logger.d.ts +15 -3
- package/dist/environment/logger.d.ts.map +1 -1
- package/dist/environment/paths.d.ts +7 -0
- package/dist/environment/paths.d.ts.map +1 -0
- package/dist/environment/paths.js +72 -0
- package/dist/environment/questions.d.ts.map +1 -1
- package/dist/environment/questions.js +20 -14
- package/dist/environment/setup-environment.js +3 -2
- package/dist/environment/templates.d.ts.map +1 -1
- package/dist/environment/templates.js +2 -1
- package/dist/environment/update-workflows.d.ts.map +1 -1
- package/dist/environment/update-workflows.js +17 -5
- package/dist/environment/upgrade.d.ts +2 -0
- package/dist/environment/upgrade.d.ts.map +1 -0
- package/dist/environment/upgrade.js +82 -0
- package/dist/environment/users.js +11 -13
- package/dist/events/index.js +1079 -843
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts +2 -2
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
- package/dist/migrations/v2.0/checkout-upstream-files.js +2 -2
- package/dist/migrations/v2.1/add-recovery-link-notifications.d.ts +3 -0
- package/dist/migrations/v2.1/add-recovery-link-notifications.d.ts.map +1 -0
- package/dist/migrations/v2.1/add-recovery-link-notifications.js +511 -0
- package/dist/migrations/v2.1/add-translations.d.ts +9 -0
- package/dist/migrations/v2.1/add-translations.d.ts.map +1 -0
- package/dist/migrations/v2.1/add-translations.js +213 -0
- package/dist/migrations/v2.1/enable-telemetry.d.ts +3 -0
- package/dist/migrations/v2.1/enable-telemetry.d.ts.map +1 -0
- package/dist/migrations/v2.1/enable-telemetry.js +438 -0
- package/dist/migrations/v2.1/index.d.ts.map +1 -1
- package/dist/migrations/v2.1/index.js +1058 -0
- package/dist/notification/index.js +1149 -1419
- package/dist/scopes/index.d.ts +102 -32
- package/dist/scopes/index.js +79 -57
- package/dist/telemetry/index.d.ts +45 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +39 -0
- package/dist/templates/charts-values/opencrvs-services/values.yaml +4 -3
- package/dist/templates/charts-values/opentelemetry/values.yaml +95 -0
- package/dist/templates/charts-values/traefik/values.yaml +23 -9
- package/dist/templates/inventory/inventory.template.yml +1 -3
- package/dist/translations/check.d.ts +19 -0
- package/dist/translations/check.d.ts.map +1 -0
- package/dist/translations/check.js +127 -0
- package/dist/verify/endpoints.d.ts +2 -0
- package/dist/verify/endpoints.d.ts.map +1 -0
- package/dist/verify/endpoints.js +345 -0
- package/opencrvs-toolkit-2.1.0-rc.d1b9774.tgz +0 -0
- package/package.json +12 -7
- package/tsconfig.build.json +11 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.json +3 -0
- package/dist/templates/inventory/production.example.yml +0 -77
- package/dist/templates/inventory/qa.example.yml +0 -48
- package/opencrvs-toolkit-2.1.0-rc.d078d1a.tgz +0 -0
- package/tsconfig.tsbuildinfo +0 -1
|
@@ -9,6 +9,14 @@ import { z } from 'zod';
|
|
|
9
9
|
*/
|
|
10
10
|
export declare const PlainDate: z.core.$ZodBranded<z.ZodString, "PlainDate", "out">;
|
|
11
11
|
export type PlainDate = z.infer<typeof PlainDate>;
|
|
12
|
+
/**
|
|
13
|
+
* Extracts the plain calendar date from an ISO 8601 datetime (or passes an
|
|
14
|
+
* already-plain YYYY-MM-DD through) as a {@link PlainDate}. This is the single
|
|
15
|
+
* conversion from a timestamp to a location-resolution anchor — comparing
|
|
16
|
+
* plain dates as strings, with no timezone conversion. Assumes a valid ISO /
|
|
17
|
+
* YYYY-MM-DD input, as produced by the event metadata and date fields.
|
|
18
|
+
*/
|
|
19
|
+
export declare function toPlainDate(dateTime: string): PlainDate;
|
|
12
20
|
/**
|
|
13
21
|
* Converts a {@link PlainDate} (YYYY-MM-DD) to a local `Date` at midnight.
|
|
14
22
|
*
|
|
@@ -1,5 +1,254 @@
|
|
|
1
1
|
import * as z from 'zod/v4';
|
|
2
|
+
export declare const InfoBox: z.ZodObject<{
|
|
3
|
+
type: z.ZodEnum<{
|
|
4
|
+
info: "info";
|
|
5
|
+
negative: "negative";
|
|
6
|
+
positive: "positive";
|
|
7
|
+
warning: "warning";
|
|
8
|
+
}>;
|
|
9
|
+
background: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
10
|
+
tinted: "tinted";
|
|
11
|
+
white: "white";
|
|
12
|
+
}>>>;
|
|
13
|
+
icon: z.ZodOptional<z.ZodEnum<{
|
|
14
|
+
Activity: "Activity";
|
|
15
|
+
Archive: "Archive";
|
|
16
|
+
ArchiveBox: "ArchiveBox";
|
|
17
|
+
ArchiveTray: "ArchiveTray";
|
|
18
|
+
Archived: "Archived";
|
|
19
|
+
ArrowCircleDown: "ArrowCircleDown";
|
|
20
|
+
ArrowCounterClockwise: "ArrowCounterClockwise";
|
|
21
|
+
ArrowLeft: "ArrowLeft";
|
|
22
|
+
ArrowRight: "ArrowRight";
|
|
23
|
+
Assigned: "Assigned";
|
|
24
|
+
Briefcase: "Briefcase";
|
|
25
|
+
Buildings: "Buildings";
|
|
26
|
+
CaretDown: "CaretDown";
|
|
27
|
+
CaretLeft: "CaretLeft";
|
|
28
|
+
CaretRight: "CaretRight";
|
|
29
|
+
Certified: "Certified";
|
|
30
|
+
ChartActivity: "ChartActivity";
|
|
31
|
+
ChartBar: "ChartBar";
|
|
32
|
+
ChartLine: "ChartLine";
|
|
33
|
+
ChatCircle: "ChatCircle";
|
|
34
|
+
ChatText: "ChatText";
|
|
35
|
+
Check: "Check";
|
|
36
|
+
CheckSquare: "CheckSquare";
|
|
37
|
+
Circle: "Circle";
|
|
38
|
+
CircleWavyCheck: "CircleWavyCheck";
|
|
39
|
+
CircleWavyQuestion: "CircleWavyQuestion";
|
|
40
|
+
Clock: "Clock";
|
|
41
|
+
Close: "Close";
|
|
42
|
+
Collapse: "Collapse";
|
|
43
|
+
Compass: "Compass";
|
|
44
|
+
Copy: "Copy";
|
|
45
|
+
Database: "Database";
|
|
46
|
+
DeviceTabletCamera: "DeviceTabletCamera";
|
|
47
|
+
DotsThreeVertical: "DotsThreeVertical";
|
|
48
|
+
Draft: "Draft";
|
|
49
|
+
DuplicateYellow: "DuplicateYellow";
|
|
50
|
+
Envelope: "Envelope";
|
|
51
|
+
Expand: "Expand";
|
|
52
|
+
Export: "Export";
|
|
53
|
+
ExternalValidate: "ExternalValidate";
|
|
54
|
+
Eye: "Eye";
|
|
55
|
+
EyeSlash: "EyeSlash";
|
|
56
|
+
File: "File";
|
|
57
|
+
FileArrowUp: "FileArrowUp";
|
|
58
|
+
FileDotted: "FileDotted";
|
|
59
|
+
FileLock: "FileLock";
|
|
60
|
+
FileMinus: "FileMinus";
|
|
61
|
+
FilePlus: "FilePlus";
|
|
62
|
+
FileSearch: "FileSearch";
|
|
63
|
+
FileText: "FileText";
|
|
64
|
+
FileX: "FileX";
|
|
65
|
+
Files: "Files";
|
|
66
|
+
FilledCheck: "FilledCheck";
|
|
67
|
+
Fingerprint: "Fingerprint";
|
|
68
|
+
Gear: "Gear";
|
|
69
|
+
GitBranch: "GitBranch";
|
|
70
|
+
Globe: "Globe";
|
|
71
|
+
Handshake: "Handshake";
|
|
72
|
+
IdentificationCard: "IdentificationCard";
|
|
73
|
+
InReview: "InReview";
|
|
74
|
+
List: "List";
|
|
75
|
+
ListBullets: "ListBullets";
|
|
76
|
+
Lock: "Lock";
|
|
77
|
+
MagnifyingGlass: "MagnifyingGlass";
|
|
78
|
+
MagnifyingGlassMinus: "MagnifyingGlassMinus";
|
|
79
|
+
MagnifyingGlassPlus: "MagnifyingGlassPlus";
|
|
80
|
+
MapPin: "MapPin";
|
|
81
|
+
Medal: "Medal";
|
|
82
|
+
NotePencil: "NotePencil";
|
|
83
|
+
Offline: "Offline";
|
|
84
|
+
PaperPlaneTilt: "PaperPlaneTilt";
|
|
85
|
+
Paperclip: "Paperclip";
|
|
86
|
+
Pen: "Pen";
|
|
87
|
+
PenNib: "PenNib";
|
|
88
|
+
Pencil: "Pencil";
|
|
89
|
+
PencilCircle: "PencilCircle";
|
|
90
|
+
PencilLine: "PencilLine";
|
|
91
|
+
PencilSimpleLine: "PencilSimpleLine";
|
|
92
|
+
Phone: "Phone";
|
|
93
|
+
Plus: "Plus";
|
|
94
|
+
Printer: "Printer";
|
|
95
|
+
PushPin: "PushPin";
|
|
96
|
+
QrCode: "QrCode";
|
|
97
|
+
Registered: "Registered";
|
|
98
|
+
RequiresUpdates: "RequiresUpdates";
|
|
99
|
+
Sent: "Sent";
|
|
100
|
+
SignOut: "SignOut";
|
|
101
|
+
Stamp: "Stamp";
|
|
102
|
+
Star: "Star";
|
|
103
|
+
Sun: "Sun";
|
|
104
|
+
Target: "Target";
|
|
105
|
+
TextT: "TextT";
|
|
106
|
+
Timer: "Timer";
|
|
107
|
+
Trash: "Trash";
|
|
108
|
+
UploadSimple: "UploadSimple";
|
|
109
|
+
User: "User";
|
|
110
|
+
UserCircle: "UserCircle";
|
|
111
|
+
UserPlus: "UserPlus";
|
|
112
|
+
Users: "Users";
|
|
113
|
+
Validated: "Validated";
|
|
114
|
+
WaitingApproval: "WaitingApproval";
|
|
115
|
+
WarningCircle: "WarningCircle";
|
|
116
|
+
Webcam: "Webcam";
|
|
117
|
+
X: "X";
|
|
118
|
+
}>>;
|
|
119
|
+
heading: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
|
|
120
|
+
description: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>>;
|
|
121
|
+
conditionals: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
122
|
+
type: z.ZodLiteral<"SHOW">;
|
|
123
|
+
conditional: z.ZodAny;
|
|
124
|
+
}, z.core.$strip>>>>;
|
|
125
|
+
}, z.core.$strip>;
|
|
126
|
+
export type InfoBox = z.infer<typeof InfoBox>;
|
|
2
127
|
export declare const SummaryConfig: z.ZodObject<{
|
|
128
|
+
banners: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
129
|
+
type: z.ZodEnum<{
|
|
130
|
+
info: "info";
|
|
131
|
+
negative: "negative";
|
|
132
|
+
positive: "positive";
|
|
133
|
+
warning: "warning";
|
|
134
|
+
}>;
|
|
135
|
+
background: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
136
|
+
tinted: "tinted";
|
|
137
|
+
white: "white";
|
|
138
|
+
}>>>;
|
|
139
|
+
icon: z.ZodOptional<z.ZodEnum<{
|
|
140
|
+
Activity: "Activity";
|
|
141
|
+
Archive: "Archive";
|
|
142
|
+
ArchiveBox: "ArchiveBox";
|
|
143
|
+
ArchiveTray: "ArchiveTray";
|
|
144
|
+
Archived: "Archived";
|
|
145
|
+
ArrowCircleDown: "ArrowCircleDown";
|
|
146
|
+
ArrowCounterClockwise: "ArrowCounterClockwise";
|
|
147
|
+
ArrowLeft: "ArrowLeft";
|
|
148
|
+
ArrowRight: "ArrowRight";
|
|
149
|
+
Assigned: "Assigned";
|
|
150
|
+
Briefcase: "Briefcase";
|
|
151
|
+
Buildings: "Buildings";
|
|
152
|
+
CaretDown: "CaretDown";
|
|
153
|
+
CaretLeft: "CaretLeft";
|
|
154
|
+
CaretRight: "CaretRight";
|
|
155
|
+
Certified: "Certified";
|
|
156
|
+
ChartActivity: "ChartActivity";
|
|
157
|
+
ChartBar: "ChartBar";
|
|
158
|
+
ChartLine: "ChartLine";
|
|
159
|
+
ChatCircle: "ChatCircle";
|
|
160
|
+
ChatText: "ChatText";
|
|
161
|
+
Check: "Check";
|
|
162
|
+
CheckSquare: "CheckSquare";
|
|
163
|
+
Circle: "Circle";
|
|
164
|
+
CircleWavyCheck: "CircleWavyCheck";
|
|
165
|
+
CircleWavyQuestion: "CircleWavyQuestion";
|
|
166
|
+
Clock: "Clock";
|
|
167
|
+
Close: "Close";
|
|
168
|
+
Collapse: "Collapse";
|
|
169
|
+
Compass: "Compass";
|
|
170
|
+
Copy: "Copy";
|
|
171
|
+
Database: "Database";
|
|
172
|
+
DeviceTabletCamera: "DeviceTabletCamera";
|
|
173
|
+
DotsThreeVertical: "DotsThreeVertical";
|
|
174
|
+
Draft: "Draft";
|
|
175
|
+
DuplicateYellow: "DuplicateYellow";
|
|
176
|
+
Envelope: "Envelope";
|
|
177
|
+
Expand: "Expand";
|
|
178
|
+
Export: "Export";
|
|
179
|
+
ExternalValidate: "ExternalValidate";
|
|
180
|
+
Eye: "Eye";
|
|
181
|
+
EyeSlash: "EyeSlash";
|
|
182
|
+
File: "File";
|
|
183
|
+
FileArrowUp: "FileArrowUp";
|
|
184
|
+
FileDotted: "FileDotted";
|
|
185
|
+
FileLock: "FileLock";
|
|
186
|
+
FileMinus: "FileMinus";
|
|
187
|
+
FilePlus: "FilePlus";
|
|
188
|
+
FileSearch: "FileSearch";
|
|
189
|
+
FileText: "FileText";
|
|
190
|
+
FileX: "FileX";
|
|
191
|
+
Files: "Files";
|
|
192
|
+
FilledCheck: "FilledCheck";
|
|
193
|
+
Fingerprint: "Fingerprint";
|
|
194
|
+
Gear: "Gear";
|
|
195
|
+
GitBranch: "GitBranch";
|
|
196
|
+
Globe: "Globe";
|
|
197
|
+
Handshake: "Handshake";
|
|
198
|
+
IdentificationCard: "IdentificationCard";
|
|
199
|
+
InReview: "InReview";
|
|
200
|
+
List: "List";
|
|
201
|
+
ListBullets: "ListBullets";
|
|
202
|
+
Lock: "Lock";
|
|
203
|
+
MagnifyingGlass: "MagnifyingGlass";
|
|
204
|
+
MagnifyingGlassMinus: "MagnifyingGlassMinus";
|
|
205
|
+
MagnifyingGlassPlus: "MagnifyingGlassPlus";
|
|
206
|
+
MapPin: "MapPin";
|
|
207
|
+
Medal: "Medal";
|
|
208
|
+
NotePencil: "NotePencil";
|
|
209
|
+
Offline: "Offline";
|
|
210
|
+
PaperPlaneTilt: "PaperPlaneTilt";
|
|
211
|
+
Paperclip: "Paperclip";
|
|
212
|
+
Pen: "Pen";
|
|
213
|
+
PenNib: "PenNib";
|
|
214
|
+
Pencil: "Pencil";
|
|
215
|
+
PencilCircle: "PencilCircle";
|
|
216
|
+
PencilLine: "PencilLine";
|
|
217
|
+
PencilSimpleLine: "PencilSimpleLine";
|
|
218
|
+
Phone: "Phone";
|
|
219
|
+
Plus: "Plus";
|
|
220
|
+
Printer: "Printer";
|
|
221
|
+
PushPin: "PushPin";
|
|
222
|
+
QrCode: "QrCode";
|
|
223
|
+
Registered: "Registered";
|
|
224
|
+
RequiresUpdates: "RequiresUpdates";
|
|
225
|
+
Sent: "Sent";
|
|
226
|
+
SignOut: "SignOut";
|
|
227
|
+
Stamp: "Stamp";
|
|
228
|
+
Star: "Star";
|
|
229
|
+
Sun: "Sun";
|
|
230
|
+
Target: "Target";
|
|
231
|
+
TextT: "TextT";
|
|
232
|
+
Timer: "Timer";
|
|
233
|
+
Trash: "Trash";
|
|
234
|
+
UploadSimple: "UploadSimple";
|
|
235
|
+
User: "User";
|
|
236
|
+
UserCircle: "UserCircle";
|
|
237
|
+
UserPlus: "UserPlus";
|
|
238
|
+
Users: "Users";
|
|
239
|
+
Validated: "Validated";
|
|
240
|
+
WaitingApproval: "WaitingApproval";
|
|
241
|
+
WarningCircle: "WarningCircle";
|
|
242
|
+
Webcam: "Webcam";
|
|
243
|
+
X: "X";
|
|
244
|
+
}>>;
|
|
245
|
+
heading: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
|
|
246
|
+
description: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>>;
|
|
247
|
+
conditionals: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
248
|
+
type: z.ZodLiteral<"SHOW">;
|
|
249
|
+
conditional: z.ZodAny;
|
|
250
|
+
}, z.core.$strip>>>>;
|
|
251
|
+
}, z.core.$strip>>>>;
|
|
3
252
|
fields: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
4
253
|
emptyValueMessage: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>>;
|
|
5
254
|
conditionals: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { UUID } from '../uuid';
|
|
2
2
|
import * as z from 'zod/v4';
|
|
3
|
+
import { PlainDate } from './PlainDate';
|
|
3
4
|
import { EventIndex } from './EventIndex';
|
|
4
5
|
import { ActionCreationMetadata, RegistrationCreationMetadata } from './EventMetadata';
|
|
5
6
|
import { RecordScopeV2, UserScopeV2 } from '../scopes';
|
|
@@ -17,9 +18,11 @@ export declare const LocationStatus: z.ZodEnum<{
|
|
|
17
18
|
}>;
|
|
18
19
|
export type LocationStatus = z.infer<typeof LocationStatus>;
|
|
19
20
|
/**
|
|
20
|
-
* A single element of the
|
|
21
|
-
*
|
|
22
|
-
*
|
|
21
|
+
* A single element of the `versions` history of a location or administrative
|
|
22
|
+
* area. Versions are sorted ascending by `effectiveFrom` ('0001-01-01' is used
|
|
23
|
+
* as the beginning-of-time sentinel). Updates only ever append, but a
|
|
24
|
+
* not-yet-effective version can be withdrawn and seeding replaces a history
|
|
25
|
+
* wholesale, so the array is not append-only.
|
|
23
26
|
*/
|
|
24
27
|
export declare const LocationVersion: z.ZodObject<{
|
|
25
28
|
versionId: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
|
|
@@ -76,8 +79,79 @@ export declare const Location: z.ZodObject<{
|
|
|
76
79
|
}, z.core.$strip>;
|
|
77
80
|
export type Location = z.infer<typeof Location>;
|
|
78
81
|
/**
|
|
79
|
-
*
|
|
80
|
-
*
|
|
82
|
+
* TEMPORARY — client-side view of {@link AdministrativeArea} with the
|
|
83
|
+
* server-flattened `name`, `status` and `externalId` removed, leaving exactly
|
|
84
|
+
* identity + versions. Every name/status read is thereby forced through the
|
|
85
|
+
* anchored resolution utilities ({@link resolveVersion}, {@link resolvePath})
|
|
86
|
+
* at compile time. Delete this type when the contract migration removes the
|
|
87
|
+
* flat fields from the server schema, at which point the wire type itself
|
|
88
|
+
* becomes identity + versions.
|
|
89
|
+
*/
|
|
90
|
+
export declare const ClientAdministrativeArea: z.ZodObject<{
|
|
91
|
+
id: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
|
|
92
|
+
parentId: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
93
|
+
versions: z.ZodArray<z.ZodObject<{
|
|
94
|
+
versionId: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
|
|
95
|
+
effectiveFrom: z.ZodISODate;
|
|
96
|
+
name: z.ZodString;
|
|
97
|
+
externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
98
|
+
status: z.ZodEnum<{
|
|
99
|
+
active: "active";
|
|
100
|
+
inactive: "inactive";
|
|
101
|
+
}>;
|
|
102
|
+
}, z.core.$strip>>;
|
|
103
|
+
}, z.core.$strip>;
|
|
104
|
+
export type ClientAdministrativeArea = z.infer<typeof ClientAdministrativeArea>;
|
|
105
|
+
/**
|
|
106
|
+
* TEMPORARY — client-side view of {@link Location} with the server-flattened
|
|
107
|
+
* `name`, `status` and `externalId` removed, leaving exactly identity +
|
|
108
|
+
* versions. See {@link ClientAdministrativeArea} for the full rationale and
|
|
109
|
+
* deletion condition.
|
|
110
|
+
*/
|
|
111
|
+
export declare const ClientLocation: z.ZodObject<{
|
|
112
|
+
id: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
|
|
113
|
+
administrativeAreaId: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
114
|
+
locationType: z.ZodNullable<z.ZodString>;
|
|
115
|
+
versions: z.ZodArray<z.ZodObject<{
|
|
116
|
+
versionId: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
|
|
117
|
+
effectiveFrom: z.ZodISODate;
|
|
118
|
+
name: z.ZodString;
|
|
119
|
+
externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
120
|
+
status: z.ZodEnum<{
|
|
121
|
+
active: "active";
|
|
122
|
+
inactive: "inactive";
|
|
123
|
+
}>;
|
|
124
|
+
}, z.core.$strip>>;
|
|
125
|
+
}, z.core.$strip>;
|
|
126
|
+
export type ClientLocation = z.infer<typeof ClientLocation>;
|
|
127
|
+
/**
|
|
128
|
+
* Strips the server-flattened fields from a location as it enters the
|
|
129
|
+
* client's cached maps. The wire format keeps the flat fields for
|
|
130
|
+
* compatibility; the cache must not, or devices would keep rendering names
|
|
131
|
+
* flattened before a future-dated version takes effect.
|
|
132
|
+
*/
|
|
133
|
+
export declare function toClientLocation(location: Location): ClientLocation;
|
|
134
|
+
/** See {@link toClientLocation}. */
|
|
135
|
+
export declare function toClientAdministrativeArea(area: AdministrativeArea): ClientAdministrativeArea;
|
|
136
|
+
export declare const SeededLocationVersions: z.ZodArray<z.ZodObject<{
|
|
137
|
+
versionId: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
|
|
138
|
+
effectiveFrom: z.ZodISODate;
|
|
139
|
+
name: z.ZodString;
|
|
140
|
+
externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
141
|
+
status: z.ZodEnum<{
|
|
142
|
+
active: "active";
|
|
143
|
+
inactive: "inactive";
|
|
144
|
+
}>;
|
|
145
|
+
}, z.core.$strip>>;
|
|
146
|
+
export type SeededLocationVersions = z.infer<typeof SeededLocationVersions>;
|
|
147
|
+
/**
|
|
148
|
+
* Input payload for the locations `set` mutation. Carries the seedable
|
|
149
|
+
* identity and hierarchy fields, plus an optional pre-built history.
|
|
150
|
+
*
|
|
151
|
+
* Last-write-wins on history: a repeated seed of the same row replaces its
|
|
152
|
+
* stored `versions`, so a caller that means to keep one has to send it every
|
|
153
|
+
* time. Seeding is only reachable while system initialisation is incomplete,
|
|
154
|
+
* so this replaces what an earlier seed attempt wrote, never a live history.
|
|
81
155
|
*/
|
|
82
156
|
export declare const SetLocationPayload: z.ZodObject<{
|
|
83
157
|
id: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
|
|
@@ -85,18 +159,38 @@ export declare const SetLocationPayload: z.ZodObject<{
|
|
|
85
159
|
externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
86
160
|
administrativeAreaId: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
87
161
|
locationType: z.ZodNullable<z.ZodString>;
|
|
162
|
+
versions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
163
|
+
versionId: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
|
|
164
|
+
effectiveFrom: z.ZodISODate;
|
|
165
|
+
name: z.ZodString;
|
|
166
|
+
externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
167
|
+
status: z.ZodEnum<{
|
|
168
|
+
active: "active";
|
|
169
|
+
inactive: "inactive";
|
|
170
|
+
}>;
|
|
171
|
+
}, z.core.$strip>>>;
|
|
88
172
|
}, z.core.$strip>;
|
|
89
173
|
export type SetLocationPayload = z.infer<typeof SetLocationPayload>;
|
|
90
174
|
/**
|
|
91
|
-
* Input payload for the administrative areas `set` mutation.
|
|
92
|
-
*
|
|
93
|
-
*
|
|
175
|
+
* Input payload for the administrative areas `set` mutation. Twin of
|
|
176
|
+
* {@link SetLocationPayload}, including the optional pre-built `versions`
|
|
177
|
+
* history and the same semantics for omitting it.
|
|
94
178
|
*/
|
|
95
179
|
export declare const SetAdministrativeAreaPayload: z.ZodObject<{
|
|
96
180
|
id: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
|
|
97
181
|
name: z.ZodString;
|
|
98
182
|
externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
99
183
|
parentId: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
184
|
+
versions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
185
|
+
versionId: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
|
|
186
|
+
effectiveFrom: z.ZodISODate;
|
|
187
|
+
name: z.ZodString;
|
|
188
|
+
externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
189
|
+
status: z.ZodEnum<{
|
|
190
|
+
active: "active";
|
|
191
|
+
inactive: "inactive";
|
|
192
|
+
}>;
|
|
193
|
+
}, z.core.$strip>>>;
|
|
100
194
|
}, z.core.$strip>;
|
|
101
195
|
export type SetAdministrativeAreaPayload = z.infer<typeof SetAdministrativeAreaPayload>;
|
|
102
196
|
/**
|
|
@@ -111,6 +205,17 @@ export type SetAdministrativeAreaPayload = z.infer<typeof SetAdministrativeAreaP
|
|
|
111
205
|
export declare function resolveVersion<T extends {
|
|
112
206
|
effectiveFrom: string;
|
|
113
207
|
}>(versions: T[], anchor: string): T;
|
|
208
|
+
/**
|
|
209
|
+
* Whether the entity is selectable at `anchor`: it must already have a
|
|
210
|
+
* version effective by then, and the version that resolves at `anchor` must
|
|
211
|
+
* be active. `resolveVersion` alone is not enough for this — when `anchor`
|
|
212
|
+
* precedes every version it falls back to the earliest one, which would
|
|
213
|
+
* otherwise make a location created after `anchor` look selectable.
|
|
214
|
+
*/
|
|
215
|
+
export declare function isSelectableAtAnchor<T extends {
|
|
216
|
+
effectiveFrom: string;
|
|
217
|
+
status: string;
|
|
218
|
+
}>(versions: T[], anchor: string): boolean;
|
|
114
219
|
/**
|
|
115
220
|
* Whether the entity holds the given externalId with active status at the
|
|
116
221
|
* anchor date or at any point after it. Used for point-in-time uniqueness of
|
|
@@ -142,7 +247,7 @@ export type EventIndexWithAdministrativeHierarchy = Omit<ToArrayFields<EventInde
|
|
|
142
247
|
* Return false early to break out of checks as soon as possible - if any option is not satisfied, the scope does not allow access to the event, so no need to check further options.
|
|
143
248
|
*
|
|
144
249
|
*/
|
|
145
|
-
export declare function canAccessEventWithScope(event:
|
|
250
|
+
export declare function canAccessEventWithScope(event: EventIndexWithAdministrativeHierarchy, scope: RecordScopeV2, user: UserContext | SystemContext, customActionType?: string): boolean;
|
|
146
251
|
export type UserWithResolvedHierarchy = {
|
|
147
252
|
role: string;
|
|
148
253
|
administrativeHierarchy: UUID[];
|
|
@@ -163,21 +268,11 @@ export declare function canAccessOtherUserWithScopes({ scopes, userToAccess, use
|
|
|
163
268
|
*
|
|
164
269
|
* One of the scopes must allow access for the event to be accessible.
|
|
165
270
|
*/
|
|
166
|
-
export declare function userCanAccessEventWithScopes(event:
|
|
167
|
-
export declare function getAdministrativeAreaHierarchy
|
|
168
|
-
id:
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
parentId: (string & z.$brand<"UUID">) | null;
|
|
172
|
-
status: "active" | "inactive";
|
|
173
|
-
versions: {
|
|
174
|
-
versionId: string & z.$brand<"UUID">;
|
|
175
|
-
effectiveFrom: string;
|
|
176
|
-
name: string;
|
|
177
|
-
externalId?: string | null | undefined;
|
|
178
|
-
status: "active" | "inactive";
|
|
179
|
-
}[];
|
|
180
|
-
}[];
|
|
271
|
+
export declare function userCanAccessEventWithScopes(event: EventIndexWithAdministrativeHierarchy, scopes: RecordScopeV2[], user: UserContext | SystemContext, customActionType?: string): boolean;
|
|
272
|
+
export declare function getAdministrativeAreaHierarchy<A extends {
|
|
273
|
+
id: UUID;
|
|
274
|
+
parentId: UUID | null;
|
|
275
|
+
}>(administrativeAreaId: string | undefined | null, administrativeAreas: Map<UUID, A>): A[];
|
|
181
276
|
/**
|
|
182
277
|
* Resolves a location or administrative area UUID into a root-first hierarchy of UUIDs.
|
|
183
278
|
*
|
|
@@ -189,8 +284,45 @@ export declare function getAdministrativeAreaHierarchy(administrativeAreaId: str
|
|
|
189
284
|
* so the result is reversed to match the root-first convention used by the server.
|
|
190
285
|
*/
|
|
191
286
|
export declare function getLocationHierarchy(selectedId: UUID, context: {
|
|
192
|
-
administrativeAreas: Map<UUID,
|
|
193
|
-
|
|
287
|
+
administrativeAreas: Map<UUID, {
|
|
288
|
+
id: UUID;
|
|
289
|
+
parentId: UUID | null;
|
|
290
|
+
}>;
|
|
291
|
+
locations: Map<UUID, {
|
|
292
|
+
id: UUID;
|
|
293
|
+
administrativeAreaId: UUID | null;
|
|
294
|
+
}>;
|
|
194
295
|
}): UUID[];
|
|
296
|
+
/**
|
|
297
|
+
* A node of an anchored hierarchy path: the identity id plus the name and
|
|
298
|
+
* status in effect at the anchor date.
|
|
299
|
+
*/
|
|
300
|
+
export type ResolvedPathNode = {
|
|
301
|
+
id: UUID;
|
|
302
|
+
name: string;
|
|
303
|
+
status: LocationStatus;
|
|
304
|
+
};
|
|
305
|
+
/**
|
|
306
|
+
* Resolves a location or administrative area id into its root-first
|
|
307
|
+
* hierarchy path — leaf included — with every node's name and status
|
|
308
|
+
* resolved at the anchor date.
|
|
309
|
+
*
|
|
310
|
+
* The parent chain is identity-level and fixed for life, so the chain is
|
|
311
|
+
* constant and only each node's name/status varies with the anchor. Status is
|
|
312
|
+
* returned for callers that filter on it; an inactive node still resolves to
|
|
313
|
+
* its name. Returns an empty array for an unknown id.
|
|
314
|
+
*/
|
|
315
|
+
export declare function resolvePath(locationId: UUID, anchor: PlainDate, context: {
|
|
316
|
+
administrativeAreas: Map<UUID, {
|
|
317
|
+
id: UUID;
|
|
318
|
+
parentId: UUID | null;
|
|
319
|
+
versions: LocationVersion[];
|
|
320
|
+
}>;
|
|
321
|
+
locations: Map<UUID, {
|
|
322
|
+
id: UUID;
|
|
323
|
+
administrativeAreaId: UUID | null;
|
|
324
|
+
versions: LocationVersion[];
|
|
325
|
+
}>;
|
|
326
|
+
}): ResolvedPathNode[];
|
|
195
327
|
export {};
|
|
196
328
|
//# sourceMappingURL=locations.d.ts.map
|
|
@@ -30,4 +30,34 @@ export declare const V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP: Map<string & impo
|
|
|
30
30
|
status: "active" | "inactive";
|
|
31
31
|
}[];
|
|
32
32
|
}>;
|
|
33
|
+
/**
|
|
34
|
+
* Stripped view of {@link V2_DEFAULT_MOCK_LOCATIONS_MAP} matching what the
|
|
35
|
+
* client's cached location map actually holds at runtime (identity +
|
|
36
|
+
* versions only). Use this — not the wire-format map above — wherever a test
|
|
37
|
+
* stands in for `useLocations().getLocations.useSuspenseQuery()`.
|
|
38
|
+
*/
|
|
39
|
+
export declare const V2_DEFAULT_MOCK_CLIENT_LOCATIONS_MAP: Map<string & import("zod").$brand<"UUID">, {
|
|
40
|
+
id: string & import("zod").$brand<"UUID">;
|
|
41
|
+
administrativeAreaId: (string & import("zod").$brand<"UUID">) | null;
|
|
42
|
+
locationType: string | null;
|
|
43
|
+
versions: {
|
|
44
|
+
versionId: string & import("zod").$brand<"UUID">;
|
|
45
|
+
effectiveFrom: string;
|
|
46
|
+
name: string;
|
|
47
|
+
externalId?: string | null | undefined;
|
|
48
|
+
status: "active" | "inactive";
|
|
49
|
+
}[];
|
|
50
|
+
}>;
|
|
51
|
+
/** See {@link V2_DEFAULT_MOCK_CLIENT_LOCATIONS_MAP}. */
|
|
52
|
+
export declare const V2_DEFAULT_MOCK_CLIENT_ADMINISTRATIVE_AREAS_MAP: Map<string & import("zod").$brand<"UUID">, {
|
|
53
|
+
id: string & import("zod").$brand<"UUID">;
|
|
54
|
+
parentId: (string & import("zod").$brand<"UUID">) | null;
|
|
55
|
+
versions: {
|
|
56
|
+
versionId: string & import("zod").$brand<"UUID">;
|
|
57
|
+
effectiveFrom: string;
|
|
58
|
+
name: string;
|
|
59
|
+
externalId?: string | null | undefined;
|
|
60
|
+
status: "active" | "inactive";
|
|
61
|
+
}[];
|
|
62
|
+
}>;
|
|
33
63
|
//# 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 { LocationVersion, SetLocationPayload, SetAdministrativeAreaPayload } from './locations';
|
|
13
13
|
import { WorkqueueConfig } from './WorkqueueConfig';
|
|
14
14
|
import * as z from 'zod/v4';
|
|
15
15
|
import { DocumentPath } from '../documents';
|
|
@@ -43,6 +43,13 @@ export declare function generateUuid(rng?: () => number): UUID;
|
|
|
43
43
|
export declare function generateTrackingId(rng: () => number): string;
|
|
44
44
|
export declare function generateRegistrationNumber(rng: () => number): string;
|
|
45
45
|
export declare function generateRandomSignature(rng: () => number): DocumentPath;
|
|
46
|
+
/**
|
|
47
|
+
* Builds one element of a location / administrative area `versions` history.
|
|
48
|
+
* Every field is defaulted so a call names only what its assertion is about —
|
|
49
|
+
* an `effectiveFrom`, a `name`, or an explicit `versionId` when the test needs
|
|
50
|
+
* to control version identity.
|
|
51
|
+
*/
|
|
52
|
+
export declare function locationVersion(overrides?: Partial<LocationVersion>, rng?: () => number): LocationVersion;
|
|
46
53
|
export declare function fieldConfigsToActionPayload(fields: FieldConfig[], rng: () => number,
|
|
47
54
|
/**
|
|
48
55
|
* Given hierarchy, ensures that related fields (e.g. location and administrative area) have valid values based on the hierarchy.
|
|
@@ -124,9 +131,6 @@ export declare function eventPayloadGenerator(rng: () => number, configuration?:
|
|
|
124
131
|
declaration: {};
|
|
125
132
|
annotation: {};
|
|
126
133
|
eventId: string;
|
|
127
|
-
content: {
|
|
128
|
-
reason: string;
|
|
129
|
-
};
|
|
130
134
|
};
|
|
131
135
|
unarchive: (eventId: string, input?: Partial<Pick<UnarchiveActionInput, 'transactionId' | 'declaration' | 'keepAssignment'>>) => {
|
|
132
136
|
keepAssignment?: boolean | undefined;
|
|
@@ -255,9 +255,9 @@ export declare function findLastAssignmentAction(actions: Action[]): {
|
|
|
255
255
|
status: "Accepted" | "Rejected" | "Requested";
|
|
256
256
|
originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
|
|
257
257
|
type: "ARCHIVE";
|
|
258
|
-
content
|
|
258
|
+
content?: {
|
|
259
259
|
reason: string;
|
|
260
|
-
};
|
|
260
|
+
} | undefined;
|
|
261
261
|
} | {
|
|
262
262
|
id: string & import("zod").$brand<"UUID">;
|
|
263
263
|
transactionId: string;
|
|
@@ -5,6 +5,8 @@ export declare const TriggerEvent: {
|
|
|
5
5
|
readonly USERNAME_REMINDER: 'username-reminder';
|
|
6
6
|
readonly RESET_PASSWORD: 'reset-password';
|
|
7
7
|
readonly RESET_PASSWORD_BY_ADMIN: 'reset-password-by-admin';
|
|
8
|
+
readonly PASSWORD_RESET_LINK: 'password-reset-link';
|
|
9
|
+
readonly USERNAME_REMINDER_LINK: 'username-reminder-link';
|
|
8
10
|
readonly RESEND_INVITE: 'resend-invite';
|
|
9
11
|
readonly TWO_FA: '2fa';
|
|
10
12
|
readonly ALL_USER_NOTIFICATION: 'all-user-notification';
|
|
@@ -113,6 +115,32 @@ export declare const TriggerPayload: {
|
|
|
113
115
|
role: z.ZodString;
|
|
114
116
|
}, z.core.$strip>;
|
|
115
117
|
}, z.core.$strip>;
|
|
118
|
+
readonly "password-reset-link": z.ZodObject<{
|
|
119
|
+
recipient: z.ZodObject<{
|
|
120
|
+
name: z.ZodOptional<z.ZodObject<{
|
|
121
|
+
firstname: z.ZodString;
|
|
122
|
+
surname: z.ZodString;
|
|
123
|
+
middlename: z.ZodOptional<z.ZodString>;
|
|
124
|
+
}, z.core.$strip>>;
|
|
125
|
+
mobile: z.ZodOptional<z.ZodString>;
|
|
126
|
+
email: z.ZodOptional<z.ZodString>;
|
|
127
|
+
bcc: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
128
|
+
}, z.core.$strip>;
|
|
129
|
+
token: z.ZodString;
|
|
130
|
+
}, z.core.$strip>;
|
|
131
|
+
readonly "username-reminder-link": z.ZodObject<{
|
|
132
|
+
recipient: z.ZodObject<{
|
|
133
|
+
name: z.ZodOptional<z.ZodObject<{
|
|
134
|
+
firstname: z.ZodString;
|
|
135
|
+
surname: z.ZodString;
|
|
136
|
+
middlename: z.ZodOptional<z.ZodString>;
|
|
137
|
+
}, z.core.$strip>>;
|
|
138
|
+
mobile: z.ZodOptional<z.ZodString>;
|
|
139
|
+
email: z.ZodOptional<z.ZodString>;
|
|
140
|
+
bcc: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
141
|
+
}, z.core.$strip>;
|
|
142
|
+
token: z.ZodString;
|
|
143
|
+
}, z.core.$strip>;
|
|
116
144
|
readonly "resend-invite": z.ZodObject<{
|
|
117
145
|
recipient: z.ZodObject<{
|
|
118
146
|
name: z.ZodOptional<z.ZodObject<{
|
|
@@ -184,18 +212,5 @@ export declare const TriggerPayload: {
|
|
|
184
212
|
export type TriggerPayload = {
|
|
185
213
|
[K in TriggerEvent]: z.infer<(typeof TriggerPayload)[K]>;
|
|
186
214
|
};
|
|
187
|
-
export declare function triggerUserEventNotification(args: {
|
|
188
|
-
event: typeof TriggerEvent.ALL_USER_NOTIFICATION;
|
|
189
|
-
payload: TriggerPayload[typeof TriggerEvent.ALL_USER_NOTIFICATION];
|
|
190
|
-
countryConfigUrl: string;
|
|
191
|
-
}): Promise<Response>;
|
|
192
|
-
export declare function triggerUserEventNotification<T extends Exclude<TriggerEvent, typeof TriggerEvent.ALL_USER_NOTIFICATION>>(args: {
|
|
193
|
-
event: T;
|
|
194
|
-
payload: TriggerPayload[T];
|
|
195
|
-
countryConfigUrl: string;
|
|
196
|
-
authHeader: {
|
|
197
|
-
Authorization: string;
|
|
198
|
-
};
|
|
199
|
-
}): Promise<Response>;
|
|
200
215
|
export declare function parseUserEventTrigger<T extends TriggerEvent>(event: T, body: unknown): TriggerPayload[T];
|
|
201
216
|
//# sourceMappingURL=UserNotifications.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TriggerEvent, TriggerPayload } from './UserNotifications';
|
|
2
|
+
export declare function triggerUserEventNotification<T extends TriggerEvent>({ event, payload, countryConfigUrl, authHeader }: {
|
|
3
|
+
event: T;
|
|
4
|
+
payload: TriggerPayload[T];
|
|
5
|
+
countryConfigUrl: string;
|
|
6
|
+
authHeader: {
|
|
7
|
+
Authorization: string;
|
|
8
|
+
};
|
|
9
|
+
}): Promise<Response>;
|
|
10
|
+
//# sourceMappingURL=dispatch.d.ts.map
|