@opencrvs/toolkit 2.1.0-rc.4fe3086 → 2.1.0-rc.50fdb5f

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/README.md +1 -0
  2. package/create-countryconfig/index.js +114 -66
  3. package/create-countryconfig/node_modules/.bin/degit +21 -0
  4. package/create-countryconfig/package.json +4 -1
  5. package/dist/application-config/index.js +227 -196
  6. package/dist/cli.js +174 -58
  7. package/dist/commons/api/router.d.ts +193 -20
  8. package/dist/commons/conditionals/conditionals.d.ts +3 -3
  9. package/dist/commons/conditionals/validate.d.ts +11 -4
  10. package/dist/commons/events/ActionDocument.d.ts +1 -7
  11. package/dist/commons/events/ActionStatus.d.ts +14 -0
  12. package/dist/commons/events/AdvancedSearchConfig.d.ts +6 -0
  13. package/dist/commons/events/AuditLog.d.ts +110 -0
  14. package/dist/commons/events/EventConfig.d.ts +3 -0
  15. package/dist/commons/events/EventIndex.d.ts +3 -26
  16. package/dist/commons/events/FieldConfig.d.ts +65 -53
  17. package/dist/commons/events/FieldTypeMapping.d.ts +19 -19
  18. package/dist/commons/events/FieldValue.d.ts +2 -2
  19. package/dist/commons/events/Flag.d.ts +42 -0
  20. package/dist/commons/events/PlainDate.d.ts +8 -0
  21. package/dist/commons/events/SummaryConfig.d.ts +249 -0
  22. package/dist/commons/events/WorkqueueConfig.d.ts +17 -14
  23. package/dist/commons/events/event.d.ts +12 -0
  24. package/dist/commons/events/locations.d.ts +99 -16
  25. package/dist/commons/events/mocks.test.utils.d.ts +30 -0
  26. package/dist/conditionals/index.js +302 -55
  27. package/dist/environment/index.d.ts +1 -0
  28. package/dist/environment/index.d.ts.map +1 -1
  29. package/dist/environment/index.js +10 -0
  30. package/dist/environment/logger.d.ts +12 -3
  31. package/dist/environment/logger.d.ts.map +1 -1
  32. package/dist/environment/paths.d.ts +7 -0
  33. package/dist/environment/paths.d.ts.map +1 -0
  34. package/dist/environment/paths.js +72 -0
  35. package/dist/environment/setup-environment.js +2 -1
  36. package/dist/environment/templates.d.ts.map +1 -1
  37. package/dist/environment/templates.js +2 -1
  38. package/dist/environment/update-workflows.d.ts.map +1 -1
  39. package/dist/environment/update-workflows.js +17 -5
  40. package/dist/environment/upgrade.d.ts +2 -0
  41. package/dist/environment/upgrade.d.ts.map +1 -0
  42. package/dist/environment/upgrade.js +82 -0
  43. package/dist/environment/users.js +11 -13
  44. package/dist/events/index.js +3493 -3250
  45. package/dist/migrations/v2.0/checkout-upstream-files.d.ts +2 -2
  46. package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
  47. package/dist/migrations/v2.0/checkout-upstream-files.js +2 -2
  48. package/dist/notification/index.js +1806 -1050
  49. package/dist/scopes/index.d.ts +248 -25
  50. package/dist/scopes/index.js +303 -55
  51. package/dist/templates/charts-values/opencrvs-services/values.yaml +4 -3
  52. package/dist/templates/charts-values/opentelemetry/values.yaml +73 -0
  53. package/opencrvs-toolkit-2.1.0-rc.50fdb5f.tgz +0 -0
  54. package/package.json +5 -5
  55. package/tsconfig.tsbuildinfo +1 -1
  56. package/opencrvs-toolkit-2.1.0-rc.4fe3086.tgz +0 -0
@@ -32,6 +32,48 @@ export declare const Flag: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEnum<{
32
32
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
33
33
  }>]>, z.ZodString]>;
34
34
  export type Flag = z.infer<typeof Flag>;
35
+ export declare const ContainsFlags: z.ZodObject<{
36
+ anyOf: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEnum<{
37
+ readonly INCOMPLETE: 'incomplete';
38
+ readonly REJECTED: 'rejected';
39
+ readonly CORRECTION_REQUESTED: 'correction-requested';
40
+ readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
41
+ /**
42
+ * This flag is set by the Edit-action and removed after the declaration or registration.
43
+ * A record should never stay with the EDIT_IN_PROGRESS flag, since it should always be declared or registered right after.
44
+ *
45
+ * We only use this flag to determine that a NOTIFY, DECLARE or REGISTER action is allowed next.
46
+ */
47
+ readonly EDIT_IN_PROGRESS: 'edit-in-progress';
48
+ }>]>, z.ZodString]>>>;
49
+ noneOf: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEnum<{
50
+ readonly INCOMPLETE: 'incomplete';
51
+ readonly REJECTED: 'rejected';
52
+ readonly CORRECTION_REQUESTED: 'correction-requested';
53
+ readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
54
+ /**
55
+ * This flag is set by the Edit-action and removed after the declaration or registration.
56
+ * A record should never stay with the EDIT_IN_PROGRESS flag, since it should always be declared or registered right after.
57
+ *
58
+ * We only use this flag to determine that a NOTIFY, DECLARE or REGISTER action is allowed next.
59
+ */
60
+ readonly EDIT_IN_PROGRESS: 'edit-in-progress';
61
+ }>]>, z.ZodString]>>>;
62
+ allOf: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEnum<{
63
+ readonly INCOMPLETE: 'incomplete';
64
+ readonly REJECTED: 'rejected';
65
+ readonly CORRECTION_REQUESTED: 'correction-requested';
66
+ readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
67
+ /**
68
+ * This flag is set by the Edit-action and removed after the declaration or registration.
69
+ * A record should never stay with the EDIT_IN_PROGRESS flag, since it should always be declared or registered right after.
70
+ *
71
+ * We only use this flag to determine that a NOTIFY, DECLARE or REGISTER action is allowed next.
72
+ */
73
+ readonly EDIT_IN_PROGRESS: 'edit-in-progress';
74
+ }>]>, z.ZodString]>>>;
75
+ }, z.core.$strip>;
76
+ export type ContainsFlags = z.infer<typeof ContainsFlags>;
35
77
  /**
36
78
  * Configuration of a custom flag that can be associated with a certain event type.
37
79
  */
@@ -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<{
@@ -737,6 +737,7 @@ export declare const WorkqueueConfig: z.ZodObject<{
737
737
  File: "File";
738
738
  FileArrowUp: "FileArrowUp";
739
739
  FileDotted: "FileDotted";
740
+ FileLock: "FileLock";
740
741
  FileMinus: "FileMinus";
741
742
  FilePlus: "FilePlus";
742
743
  FileSearch: "FileSearch";
@@ -862,6 +863,7 @@ export declare const WorkqueueConfigWithoutQuery: z.ZodObject<{
862
863
  File: "File";
863
864
  FileArrowUp: "FileArrowUp";
864
865
  FileDotted: "FileDotted";
866
+ FileLock: "FileLock";
865
867
  FileMinus: "FileMinus";
866
868
  FilePlus: "FilePlus";
867
869
  FileSearch: "FileSearch";
@@ -1013,6 +1015,7 @@ export declare const WorkqueueConfigInput: z.ZodObject<{
1013
1015
  File: "File";
1014
1016
  FileArrowUp: "FileArrowUp";
1015
1017
  FileDotted: "FileDotted";
1018
+ FileLock: "FileLock";
1016
1019
  FileMinus: "FileMinus";
1017
1020
  FilePlus: "FilePlus";
1018
1021
  FileSearch: "FileSearch";
@@ -2038,11 +2041,11 @@ export declare function defineWorkqueue(workqueueInput: WorkqueueConfigInput): {
2038
2041
  clauses: {
2039
2042
  eventType?: string | undefined;
2040
2043
  status?: {
2041
- type: "anyOf";
2042
- terms: ("ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED")[];
2043
- } | {
2044
2044
  type: "exact";
2045
2045
  term: "ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED";
2046
+ } | {
2047
+ type: "anyOf";
2048
+ terms: ("ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED")[];
2046
2049
  } | undefined;
2047
2050
  createdAt?: {
2048
2051
  type: "range";
@@ -2177,11 +2180,11 @@ export declare function defineWorkqueue(workqueueInput: WorkqueueConfigInput): {
2177
2180
  clauses: {
2178
2181
  eventType?: string | undefined;
2179
2182
  status?: {
2180
- type: "anyOf";
2181
- terms: ("ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED")[];
2182
- } | {
2183
2183
  type: "exact";
2184
2184
  term: "ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED";
2185
+ } | {
2186
+ type: "anyOf";
2187
+ terms: ("ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED")[];
2185
2188
  } | undefined;
2186
2189
  createdAt?: {
2187
2190
  type: "range";
@@ -2325,7 +2328,7 @@ export declare function defineWorkqueue(workqueueInput: WorkqueueConfigInput): {
2325
2328
  $event: "assignedTo" | "createdAt" | "createdAtLocation" | "createdBy" | "createdByUserType" | "dateOfEvent" | "flags" | "id" | "legalStatuses" | "outbox" | "placeOfEvent" | "status" | "title" | "trackingId" | "type" | "updatedAt" | "updatedAtLocation" | "updatedBy" | "updatedByUserRole";
2326
2329
  };
2327
2330
  }[];
2328
- icon: "Activity" | "Archive" | "ArchiveBox" | "ArchiveTray" | "Archived" | "ArrowCircleDown" | "ArrowCounterClockwise" | "ArrowLeft" | "ArrowRight" | "Assigned" | "Briefcase" | "Buildings" | "CaretDown" | "CaretLeft" | "CaretRight" | "Certified" | "ChartActivity" | "ChartBar" | "ChartLine" | "ChatCircle" | "ChatText" | "Check" | "CheckSquare" | "Circle" | "CircleWavyCheck" | "CircleWavyQuestion" | "Clock" | "Close" | "Collapse" | "Compass" | "Copy" | "Database" | "DeviceTabletCamera" | "DotsThreeVertical" | "Draft" | "DuplicateYellow" | "Envelope" | "Expand" | "Export" | "ExternalValidate" | "Eye" | "EyeSlash" | "File" | "FileArrowUp" | "FileDotted" | "FileMinus" | "FilePlus" | "FileSearch" | "FileText" | "FileX" | "Files" | "FilledCheck" | "Fingerprint" | "Gear" | "GitBranch" | "Globe" | "Handshake" | "IdentificationCard" | "InReview" | "List" | "ListBullets" | "Lock" | "MagnifyingGlass" | "MagnifyingGlassMinus" | "MagnifyingGlassPlus" | "MapPin" | "Medal" | "NotePencil" | "Offline" | "PaperPlaneTilt" | "Paperclip" | "Pen" | "PenNib" | "Pencil" | "PencilCircle" | "PencilLine" | "PencilSimpleLine" | "Phone" | "Plus" | "Printer" | "PushPin" | "QrCode" | "Registered" | "RequiresUpdates" | "Sent" | "SignOut" | "Stamp" | "Star" | "Sun" | "Target" | "TextT" | "Timer" | "Trash" | "UploadSimple" | "User" | "UserCircle" | "UserPlus" | "Users" | "Validated" | "WaitingApproval" | "WarningCircle" | "Webcam" | "X";
2331
+ icon: "Activity" | "Archive" | "ArchiveBox" | "ArchiveTray" | "Archived" | "ArrowCircleDown" | "ArrowCounterClockwise" | "ArrowLeft" | "ArrowRight" | "Assigned" | "Briefcase" | "Buildings" | "CaretDown" | "CaretLeft" | "CaretRight" | "Certified" | "ChartActivity" | "ChartBar" | "ChartLine" | "ChatCircle" | "ChatText" | "Check" | "CheckSquare" | "Circle" | "CircleWavyCheck" | "CircleWavyQuestion" | "Clock" | "Close" | "Collapse" | "Compass" | "Copy" | "Database" | "DeviceTabletCamera" | "DotsThreeVertical" | "Draft" | "DuplicateYellow" | "Envelope" | "Expand" | "Export" | "ExternalValidate" | "Eye" | "EyeSlash" | "File" | "FileArrowUp" | "FileDotted" | "FileLock" | "FileMinus" | "FilePlus" | "FileSearch" | "FileText" | "FileX" | "Files" | "FilledCheck" | "Fingerprint" | "Gear" | "GitBranch" | "Globe" | "Handshake" | "IdentificationCard" | "InReview" | "List" | "ListBullets" | "Lock" | "MagnifyingGlass" | "MagnifyingGlassMinus" | "MagnifyingGlassPlus" | "MapPin" | "Medal" | "NotePencil" | "Offline" | "PaperPlaneTilt" | "Paperclip" | "Pen" | "PenNib" | "Pencil" | "PencilCircle" | "PencilLine" | "PencilSimpleLine" | "Phone" | "Plus" | "Printer" | "PushPin" | "QrCode" | "Registered" | "RequiresUpdates" | "Sent" | "SignOut" | "Stamp" | "Star" | "Sun" | "Target" | "TextT" | "Timer" | "Trash" | "UploadSimple" | "User" | "UserCircle" | "UserPlus" | "Users" | "Validated" | "WaitingApproval" | "WarningCircle" | "Webcam" | "X";
2329
2332
  emptyMessage?: {
2330
2333
  id: string;
2331
2334
  defaultMessage: string;
@@ -2349,11 +2352,11 @@ export declare function defineWorkqueues(workqueues: WorkqueueConfigInputWithV19
2349
2352
  clauses: {
2350
2353
  eventType?: string | undefined;
2351
2354
  status?: {
2352
- type: "anyOf";
2353
- terms: ("ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED")[];
2354
- } | {
2355
2355
  type: "exact";
2356
2356
  term: "ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED";
2357
+ } | {
2358
+ type: "anyOf";
2359
+ terms: ("ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED")[];
2357
2360
  } | undefined;
2358
2361
  createdAt?: {
2359
2362
  type: "range";
@@ -2488,11 +2491,11 @@ export declare function defineWorkqueues(workqueues: WorkqueueConfigInputWithV19
2488
2491
  clauses: {
2489
2492
  eventType?: string | undefined;
2490
2493
  status?: {
2491
- type: "anyOf";
2492
- terms: ("ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED")[];
2493
- } | {
2494
2494
  type: "exact";
2495
2495
  term: "ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED";
2496
+ } | {
2497
+ type: "anyOf";
2498
+ terms: ("ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED")[];
2496
2499
  } | undefined;
2497
2500
  createdAt?: {
2498
2501
  type: "range";
@@ -2636,7 +2639,7 @@ export declare function defineWorkqueues(workqueues: WorkqueueConfigInputWithV19
2636
2639
  $event: "assignedTo" | "createdAt" | "createdAtLocation" | "createdBy" | "createdByUserType" | "dateOfEvent" | "flags" | "id" | "legalStatuses" | "outbox" | "placeOfEvent" | "status" | "title" | "trackingId" | "type" | "updatedAt" | "updatedAtLocation" | "updatedBy" | "updatedByUserRole";
2637
2640
  };
2638
2641
  }[];
2639
- icon: "Activity" | "Archive" | "ArchiveBox" | "ArchiveTray" | "Archived" | "ArrowCircleDown" | "ArrowCounterClockwise" | "ArrowLeft" | "ArrowRight" | "Assigned" | "Briefcase" | "Buildings" | "CaretDown" | "CaretLeft" | "CaretRight" | "Certified" | "ChartActivity" | "ChartBar" | "ChartLine" | "ChatCircle" | "ChatText" | "Check" | "CheckSquare" | "Circle" | "CircleWavyCheck" | "CircleWavyQuestion" | "Clock" | "Close" | "Collapse" | "Compass" | "Copy" | "Database" | "DeviceTabletCamera" | "DotsThreeVertical" | "Draft" | "DuplicateYellow" | "Envelope" | "Expand" | "Export" | "ExternalValidate" | "Eye" | "EyeSlash" | "File" | "FileArrowUp" | "FileDotted" | "FileMinus" | "FilePlus" | "FileSearch" | "FileText" | "FileX" | "Files" | "FilledCheck" | "Fingerprint" | "Gear" | "GitBranch" | "Globe" | "Handshake" | "IdentificationCard" | "InReview" | "List" | "ListBullets" | "Lock" | "MagnifyingGlass" | "MagnifyingGlassMinus" | "MagnifyingGlassPlus" | "MapPin" | "Medal" | "NotePencil" | "Offline" | "PaperPlaneTilt" | "Paperclip" | "Pen" | "PenNib" | "Pencil" | "PencilCircle" | "PencilLine" | "PencilSimpleLine" | "Phone" | "Plus" | "Printer" | "PushPin" | "QrCode" | "Registered" | "RequiresUpdates" | "Sent" | "SignOut" | "Stamp" | "Star" | "Sun" | "Target" | "TextT" | "Timer" | "Trash" | "UploadSimple" | "User" | "UserCircle" | "UserPlus" | "Users" | "Validated" | "WaitingApproval" | "WarningCircle" | "Webcam" | "X";
2642
+ icon: "Activity" | "Archive" | "ArchiveBox" | "ArchiveTray" | "Archived" | "ArrowCircleDown" | "ArrowCounterClockwise" | "ArrowLeft" | "ArrowRight" | "Assigned" | "Briefcase" | "Buildings" | "CaretDown" | "CaretLeft" | "CaretRight" | "Certified" | "ChartActivity" | "ChartBar" | "ChartLine" | "ChatCircle" | "ChatText" | "Check" | "CheckSquare" | "Circle" | "CircleWavyCheck" | "CircleWavyQuestion" | "Clock" | "Close" | "Collapse" | "Compass" | "Copy" | "Database" | "DeviceTabletCamera" | "DotsThreeVertical" | "Draft" | "DuplicateYellow" | "Envelope" | "Expand" | "Export" | "ExternalValidate" | "Eye" | "EyeSlash" | "File" | "FileArrowUp" | "FileDotted" | "FileLock" | "FileMinus" | "FilePlus" | "FileSearch" | "FileText" | "FileX" | "Files" | "FilledCheck" | "Fingerprint" | "Gear" | "GitBranch" | "Globe" | "Handshake" | "IdentificationCard" | "InReview" | "List" | "ListBullets" | "Lock" | "MagnifyingGlass" | "MagnifyingGlassMinus" | "MagnifyingGlassPlus" | "MapPin" | "Medal" | "NotePencil" | "Offline" | "PaperPlaneTilt" | "Paperclip" | "Pen" | "PenNib" | "Pencil" | "PencilCircle" | "PencilLine" | "PencilSimpleLine" | "Phone" | "Plus" | "Printer" | "PushPin" | "QrCode" | "Registered" | "RequiresUpdates" | "Sent" | "SignOut" | "Stamp" | "Star" | "Sun" | "Target" | "TextT" | "Timer" | "Trash" | "UploadSimple" | "User" | "UserCircle" | "UserPlus" | "Users" | "Validated" | "WaitingApproval" | "WarningCircle" | "Webcam" | "X";
2640
2643
  emptyMessage?: {
2641
2644
  id: string;
2642
2645
  defaultMessage: string;
@@ -1,6 +1,8 @@
1
1
  import { NonSearchableEventMetadataTimeFieldIdInput, AdvancedSearchConfig } from '../event-config/event-configuration';
2
2
  import { ActionType } from './ActionType';
3
3
  import { EventFieldIdInput } from './AdvancedSearchConfig';
4
+ import { EventStatus } from './EventMetadata';
5
+ import { Flag } from './Flag';
4
6
  import { WorkqueueColumnKeys, WorkqueueColumnValue } from './WorkqueueColumnConfig';
5
7
  /**
6
8
  * Creates a function that acts like a callable + static method container.
@@ -75,6 +77,16 @@ declare const event: typeof eventFn & {
75
77
  };
76
78
  };
77
79
  field(field: WorkqueueColumnKeys): WorkqueueColumnValue;
80
+ /**
81
+ * Checks if the event currently has the given status.
82
+ * @param eventStatus - The status to check for.
83
+ */
84
+ hasStatus: (eventStatus: EventStatus) => import("../conditionals/conditionals").JSONSchema;
85
+ /**
86
+ * Checks if the event currently carries the given flag.
87
+ * @param flagValue - The flag to check for.
88
+ */
89
+ hasFlag: (flagValue: Flag) => import("../conditionals/conditionals").JSONSchema;
78
90
  };
79
91
  export { event };
80
92
  //# sourceMappingURL=event.d.ts.map
@@ -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';
@@ -75,6 +76,61 @@ export declare const Location: z.ZodObject<{
75
76
  }, z.core.$strip>>;
76
77
  }, z.core.$strip>;
77
78
  export type Location = z.infer<typeof Location>;
79
+ /**
80
+ * TEMPORARY — client-side view of {@link AdministrativeArea} with the
81
+ * server-flattened `name`, `status` and `externalId` removed, leaving exactly
82
+ * identity + versions. Every name/status read is thereby forced through the
83
+ * anchored resolution utilities ({@link resolveVersion}, {@link resolvePath})
84
+ * at compile time. Delete this type when the contract migration removes the
85
+ * flat fields from the server schema, at which point the wire type itself
86
+ * becomes identity + versions.
87
+ */
88
+ export declare const ClientAdministrativeArea: z.ZodObject<{
89
+ id: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
90
+ parentId: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
91
+ versions: z.ZodArray<z.ZodObject<{
92
+ versionId: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
93
+ effectiveFrom: z.ZodISODate;
94
+ name: z.ZodString;
95
+ externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
96
+ status: z.ZodEnum<{
97
+ active: "active";
98
+ inactive: "inactive";
99
+ }>;
100
+ }, z.core.$strip>>;
101
+ }, z.core.$strip>;
102
+ export type ClientAdministrativeArea = z.infer<typeof ClientAdministrativeArea>;
103
+ /**
104
+ * TEMPORARY — client-side view of {@link Location} with the server-flattened
105
+ * `name`, `status` and `externalId` removed, leaving exactly identity +
106
+ * versions. See {@link ClientAdministrativeArea} for the full rationale and
107
+ * deletion condition.
108
+ */
109
+ export declare const ClientLocation: z.ZodObject<{
110
+ id: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
111
+ administrativeAreaId: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
112
+ locationType: z.ZodNullable<z.ZodString>;
113
+ versions: z.ZodArray<z.ZodObject<{
114
+ versionId: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
115
+ effectiveFrom: z.ZodISODate;
116
+ name: z.ZodString;
117
+ externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
118
+ status: z.ZodEnum<{
119
+ active: "active";
120
+ inactive: "inactive";
121
+ }>;
122
+ }, z.core.$strip>>;
123
+ }, z.core.$strip>;
124
+ export type ClientLocation = z.infer<typeof ClientLocation>;
125
+ /**
126
+ * Strips the server-flattened fields from a location as it enters the
127
+ * client's cached maps. The wire format keeps the flat fields for
128
+ * compatibility; the cache must not, or devices would keep rendering names
129
+ * flattened before a future-dated version takes effect.
130
+ */
131
+ export declare function toClientLocation(location: Location): ClientLocation;
132
+ /** See {@link toClientLocation}. */
133
+ export declare function toClientAdministrativeArea(area: AdministrativeArea): ClientAdministrativeArea;
78
134
  /**
79
135
  * Input payload for the locations `set` mutation. Carries only the seedable
80
136
  * identity and hierarchy fields — version history is managed by the server.
@@ -164,20 +220,10 @@ export declare function canAccessOtherUserWithScopes({ scopes, userToAccess, use
164
220
  * One of the scopes must allow access for the event to be accessible.
165
221
  */
166
222
  export declare function userCanAccessEventWithScopes(event: Partial<EventIndexWithAdministrativeHierarchy>, scopes: RecordScopeV2[], user: UserContext | SystemContext, customActionType?: string): boolean;
167
- export declare function getAdministrativeAreaHierarchy(administrativeAreaId: string | undefined | null, administrativeAreas: Map<UUID, AdministrativeArea>): {
168
- id: string & z.$brand<"UUID">;
169
- name: string;
170
- externalId?: string | null | undefined;
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
- }[];
223
+ export declare function getAdministrativeAreaHierarchy<A extends {
224
+ id: UUID;
225
+ parentId: UUID | null;
226
+ }>(administrativeAreaId: string | undefined | null, administrativeAreas: Map<UUID, A>): A[];
181
227
  /**
182
228
  * Resolves a location or administrative area UUID into a root-first hierarchy of UUIDs.
183
229
  *
@@ -189,8 +235,45 @@ export declare function getAdministrativeAreaHierarchy(administrativeAreaId: str
189
235
  * so the result is reversed to match the root-first convention used by the server.
190
236
  */
191
237
  export declare function getLocationHierarchy(selectedId: UUID, context: {
192
- administrativeAreas: Map<UUID, AdministrativeArea>;
193
- locations: Map<UUID, Location>;
238
+ administrativeAreas: Map<UUID, {
239
+ id: UUID;
240
+ parentId: UUID | null;
241
+ }>;
242
+ locations: Map<UUID, {
243
+ id: UUID;
244
+ administrativeAreaId: UUID | null;
245
+ }>;
194
246
  }): UUID[];
247
+ /**
248
+ * A node of an anchored hierarchy path: the identity id plus the name and
249
+ * status in effect at the anchor date.
250
+ */
251
+ export type ResolvedPathNode = {
252
+ id: UUID;
253
+ name: string;
254
+ status: LocationStatus;
255
+ };
256
+ /**
257
+ * Resolves a location or administrative area id into its root-first
258
+ * hierarchy path — leaf included — with every node's name and status
259
+ * resolved at the anchor date.
260
+ *
261
+ * The parent chain is identity-level and fixed for life, so the chain is
262
+ * constant and only each node's name/status varies with the anchor. Status is
263
+ * returned for callers that filter on it; an inactive node still resolves to
264
+ * its name. Returns an empty array for an unknown id.
265
+ */
266
+ export declare function resolvePath(locationId: UUID, anchor: PlainDate, context: {
267
+ administrativeAreas: Map<UUID, {
268
+ id: UUID;
269
+ parentId: UUID | null;
270
+ versions: LocationVersion[];
271
+ }>;
272
+ locations: Map<UUID, {
273
+ id: UUID;
274
+ administrativeAreaId: UUID | null;
275
+ versions: LocationVersion[];
276
+ }>;
277
+ }): ResolvedPathNode[];
195
278
  export {};
196
279
  //# 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