@opencrvs/toolkit 1.9.5-rc.4d0fc4f → 1.9.5-rc.4d15ac5
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 +28427 -2165
- package/dist/commons/conditionals/conditionals.d.ts +10 -1
- package/dist/commons/conditionals/validate.d.ts +11 -4
- package/dist/commons/events/ActionConfig.d.ts +24236 -1552
- package/dist/commons/events/ActionDocument.d.ts +803 -1856
- package/dist/commons/events/ActionInput.d.ts +277 -1073
- package/dist/commons/events/ActionType.d.ts +86 -9
- package/dist/commons/events/AdvancedSearchConfig.d.ts +228 -1244
- package/dist/commons/events/CompositeFieldValue.d.ts +27 -198
- package/dist/commons/events/Conditional.d.ts +26 -38
- package/dist/commons/events/Constants.d.ts +1 -1
- package/dist/commons/events/CountryConfigQueryInput.d.ts +1195 -4211
- package/dist/commons/events/CreatedAtLocation.d.ts +1 -1
- package/dist/commons/events/DeduplicationConfig.d.ts +15 -150
- package/dist/commons/events/Draft.d.ts +70 -105
- package/dist/commons/events/DynamicFieldValue.d.ts +7 -91
- package/dist/commons/events/EventConfig.d.ts +19320 -2122
- package/dist/commons/events/EventConfigInput.d.ts +1 -1
- package/dist/commons/events/EventDocument.d.ts +320 -1332
- package/dist/commons/events/EventIndex.d.ts +193 -975
- package/dist/commons/events/EventInput.d.ts +2 -8
- package/dist/commons/events/EventMetadata.d.ts +106 -346
- package/dist/commons/events/FieldConfig.d.ts +4422 -12299
- package/dist/commons/events/FieldType.d.ts +20 -5
- package/dist/commons/events/FieldTypeMapping.d.ts +180 -897
- package/dist/commons/events/FieldValue.d.ts +84 -405
- package/dist/commons/events/Flag.d.ts +70 -0
- package/dist/commons/events/FormConfig.d.ts +13632 -721
- package/dist/commons/events/PageConfig.d.ts +9108 -319
- package/dist/commons/events/SummaryConfig.d.ts +14 -161
- package/dist/commons/events/TemplateConfig.d.ts +2 -3
- package/dist/commons/events/TranslationConfig.d.ts +2 -2
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +74 -37
- package/dist/commons/events/WorkqueueConfig.d.ts +1874 -7174
- package/dist/commons/events/deduplication.d.ts +3 -3
- package/dist/commons/events/defineConfig.d.ts +25818 -149
- package/dist/commons/events/eventConfigValidation.d.ts +8 -0
- package/dist/commons/events/index.d.ts +1 -0
- package/dist/commons/events/locations.d.ts +16 -19
- package/dist/commons/events/scopes.d.ts +5 -4
- package/dist/commons/events/state/availableActions.d.ts +2 -1
- package/dist/commons/events/state/flags.d.ts +21 -3
- package/dist/commons/events/state/index.d.ts +23 -19
- package/dist/commons/events/state/utils.d.ts +130 -112
- package/dist/commons/events/test.utils.d.ts +17 -8
- package/dist/commons/events/transactions.d.ts +1 -1
- package/dist/commons/events/utils.d.ts +51718 -368
- package/dist/commons/notification/UserNotifications.d.ts +55 -636
- package/dist/conditionals/index.d.ts.map +1 -1
- package/dist/conditionals/index.js +42 -8
- package/dist/events/deduplication.d.ts +3 -3
- package/dist/events/index.js +1906 -1661
- package/dist/notification/index.d.ts.map +1 -1
- package/dist/notification/index.js +1578 -1559
- package/dist/scopes/index.d.ts +167 -132
- package/dist/scopes/index.d.ts.map +1 -1
- package/dist/scopes/index.js +133 -94
- package/package.json +5 -5
|
@@ -38,6 +38,7 @@ __export(notification_exports, {
|
|
|
38
38
|
triggerUserEventNotification: () => triggerUserEventNotification
|
|
39
39
|
});
|
|
40
40
|
module.exports = __toCommonJS(notification_exports);
|
|
41
|
+
var z40 = __toESM(require("zod/v4"));
|
|
41
42
|
|
|
42
43
|
// ../commons/src/url.ts
|
|
43
44
|
function joinUrl(base, path) {
|
|
@@ -47,30 +48,28 @@ function joinUrl(base, path) {
|
|
|
47
48
|
|
|
48
49
|
// ../commons/src/events/Constants.ts
|
|
49
50
|
var TENNIS_CLUB_MEMBERSHIP = "tennis-club-membership";
|
|
50
|
-
var
|
|
51
|
+
var CHILD_ONBOARDING_EVENT = "child-onboarding";
|
|
51
52
|
|
|
52
53
|
// ../commons/src/events/ActionConfig.ts
|
|
53
|
-
var
|
|
54
|
+
var z21 = __toESM(require("zod/v4"));
|
|
54
55
|
|
|
55
56
|
// ../commons/src/events/TranslationConfig.ts
|
|
56
|
-
var
|
|
57
|
-
var
|
|
58
|
-
|
|
59
|
-
var TranslationConfig = import_zod.z.object({
|
|
60
|
-
id: import_zod.z.string().describe(
|
|
57
|
+
var z = __toESM(require("zod/v4"));
|
|
58
|
+
var TranslationConfig = z.object({
|
|
59
|
+
id: z.string().describe(
|
|
61
60
|
"The identifier of the translation referred in translation CSV files"
|
|
62
61
|
),
|
|
63
|
-
defaultMessage:
|
|
64
|
-
description:
|
|
62
|
+
defaultMessage: z.string().describe("Default translation message"),
|
|
63
|
+
description: z.string().describe(
|
|
65
64
|
"Describe the translation for a translator to be able to identify it."
|
|
66
65
|
)
|
|
67
|
-
}).
|
|
66
|
+
}).meta({
|
|
68
67
|
description: "Translation configuration",
|
|
69
|
-
|
|
68
|
+
id: "TranslationConfig"
|
|
70
69
|
});
|
|
71
70
|
|
|
72
71
|
// ../commons/src/events/ActionType.ts
|
|
73
|
-
var
|
|
72
|
+
var z2 = __toESM(require("zod/v4"));
|
|
74
73
|
var ActionType = {
|
|
75
74
|
// Pre-declaration actions
|
|
76
75
|
DELETE: "DELETE",
|
|
@@ -78,8 +77,8 @@ var ActionType = {
|
|
|
78
77
|
NOTIFY: "NOTIFY",
|
|
79
78
|
// Declaration actions
|
|
80
79
|
DECLARE: "DECLARE",
|
|
81
|
-
VALIDATE: "VALIDATE",
|
|
82
80
|
REGISTER: "REGISTER",
|
|
81
|
+
EDIT: "EDIT",
|
|
83
82
|
// Declaration system actions. Non-configurable.
|
|
84
83
|
DUPLICATE_DETECTED: "DUPLICATE_DETECTED",
|
|
85
84
|
REJECT: "REJECT",
|
|
@@ -95,26 +94,29 @@ var ActionType = {
|
|
|
95
94
|
// General actions
|
|
96
95
|
READ: "READ",
|
|
97
96
|
ASSIGN: "ASSIGN",
|
|
98
|
-
UNASSIGN: "UNASSIGN"
|
|
97
|
+
UNASSIGN: "UNASSIGN",
|
|
98
|
+
// Custom action
|
|
99
|
+
CUSTOM: "CUSTOM"
|
|
99
100
|
};
|
|
100
101
|
var ConfirmableActions = [
|
|
101
102
|
ActionType.NOTIFY,
|
|
102
103
|
ActionType.DECLARE,
|
|
103
|
-
ActionType.
|
|
104
|
+
ActionType.EDIT,
|
|
104
105
|
ActionType.REGISTER,
|
|
105
106
|
ActionType.REJECT,
|
|
106
107
|
ActionType.ARCHIVE,
|
|
107
108
|
ActionType.PRINT_CERTIFICATE,
|
|
108
109
|
ActionType.REQUEST_CORRECTION,
|
|
109
110
|
ActionType.APPROVE_CORRECTION,
|
|
110
|
-
ActionType.REJECT_CORRECTION
|
|
111
|
+
ActionType.REJECT_CORRECTION,
|
|
112
|
+
ActionType.CUSTOM
|
|
111
113
|
];
|
|
112
|
-
var ActionTypes =
|
|
114
|
+
var ActionTypes = z2.enum([
|
|
113
115
|
"DELETE",
|
|
114
116
|
"CREATE",
|
|
115
117
|
"NOTIFY",
|
|
116
118
|
"DECLARE",
|
|
117
|
-
"
|
|
119
|
+
"EDIT",
|
|
118
120
|
"REGISTER",
|
|
119
121
|
"DUPLICATE_DETECTED",
|
|
120
122
|
"REJECT",
|
|
@@ -127,14 +129,15 @@ var ActionTypes = import_zod2.z.enum([
|
|
|
127
129
|
"APPROVE_CORRECTION",
|
|
128
130
|
"READ",
|
|
129
131
|
"ASSIGN",
|
|
130
|
-
"UNASSIGN"
|
|
132
|
+
"UNASSIGN",
|
|
133
|
+
"CUSTOM"
|
|
131
134
|
]);
|
|
132
135
|
var ClientSpecificAction = {
|
|
133
136
|
REVIEW_CORRECTION_REQUEST: "REVIEW_CORRECTION_REQUEST"
|
|
134
137
|
};
|
|
135
138
|
var declarationActionValues = [
|
|
136
139
|
ActionTypes.enum.DECLARE,
|
|
137
|
-
ActionTypes.enum.
|
|
140
|
+
ActionTypes.enum.EDIT,
|
|
138
141
|
ActionTypes.enum.REGISTER,
|
|
139
142
|
ActionTypes.enum.NOTIFY,
|
|
140
143
|
ActionTypes.enum.DUPLICATE_DETECTED
|
|
@@ -155,13 +158,14 @@ var writeActions = ActionTypes.exclude([
|
|
|
155
158
|
ActionType.UNASSIGN
|
|
156
159
|
]);
|
|
157
160
|
var workqueueActions = ActionTypes.exclude([
|
|
161
|
+
ActionType.READ,
|
|
158
162
|
ActionType.CREATE,
|
|
159
163
|
ActionType.NOTIFY,
|
|
160
164
|
ActionType.DUPLICATE_DETECTED,
|
|
161
|
-
ActionType.REJECT,
|
|
162
165
|
ActionType.MARK_AS_NOT_DUPLICATE,
|
|
163
166
|
ActionType.REJECT_CORRECTION,
|
|
164
|
-
ActionType.APPROVE_CORRECTION
|
|
167
|
+
ActionType.APPROVE_CORRECTION,
|
|
168
|
+
ActionType.CUSTOM
|
|
165
169
|
]);
|
|
166
170
|
var META_ACTIONS = [
|
|
167
171
|
ActionType.ASSIGN,
|
|
@@ -170,59 +174,57 @@ var META_ACTIONS = [
|
|
|
170
174
|
];
|
|
171
175
|
|
|
172
176
|
// ../commons/src/events/FieldConfig.ts
|
|
173
|
-
var
|
|
177
|
+
var z16 = __toESM(require("zod/v4"));
|
|
174
178
|
|
|
175
179
|
// ../commons/src/events/Conditional.ts
|
|
176
|
-
var
|
|
177
|
-
var
|
|
178
|
-
(0, import_zod_openapi2.extendZodWithOpenApi)(import_zod3.z);
|
|
179
|
-
var Conditional = import_zod3.z.custom((val) => typeof val === "object" && val !== null).openapi({
|
|
180
|
+
var z3 = __toESM(require("zod/v4"));
|
|
181
|
+
var Conditional = z3.any().describe("JSONSchema").meta({
|
|
180
182
|
description: "JSON schema conditional configuration",
|
|
181
|
-
|
|
183
|
+
id: "Conditional"
|
|
182
184
|
});
|
|
183
185
|
var ConditionalType = {
|
|
184
186
|
SHOW: "SHOW",
|
|
185
187
|
ENABLE: "ENABLE",
|
|
186
188
|
DISPLAY_ON_REVIEW: "DISPLAY_ON_REVIEW"
|
|
187
189
|
};
|
|
188
|
-
var ShowConditional =
|
|
189
|
-
type:
|
|
190
|
+
var ShowConditional = z3.object({
|
|
191
|
+
type: z3.literal(ConditionalType.SHOW),
|
|
190
192
|
conditional: Conditional
|
|
191
193
|
}).describe(
|
|
192
194
|
"If 'SHOW' conditional is defined, the component is shown to the user only if the condition is met"
|
|
193
195
|
);
|
|
194
|
-
var EnableConditional =
|
|
195
|
-
type:
|
|
196
|
+
var EnableConditional = z3.object({
|
|
197
|
+
type: z3.literal(ConditionalType.ENABLE),
|
|
196
198
|
conditional: Conditional
|
|
197
199
|
}).describe(
|
|
198
200
|
"If 'ENABLE' conditional is defined, the component is enabled only if the condition is met"
|
|
199
201
|
);
|
|
200
|
-
var ActionConditional =
|
|
202
|
+
var ActionConditional = z3.discriminatedUnion("type", [
|
|
201
203
|
// Action can be shown / hidden
|
|
202
204
|
ShowConditional,
|
|
203
205
|
// Action can be shown to the user in the list but as disabled
|
|
204
206
|
EnableConditional
|
|
205
207
|
]);
|
|
206
|
-
var DisplayOnReviewConditional =
|
|
207
|
-
type:
|
|
208
|
+
var DisplayOnReviewConditional = z3.object({
|
|
209
|
+
type: z3.literal(ConditionalType.DISPLAY_ON_REVIEW),
|
|
208
210
|
conditional: Conditional
|
|
209
211
|
}).describe(
|
|
210
212
|
"If 'DISPLAY_ON_REVIEW' conditional is defined, the component is shown on the review page only if both the 'DISPLAY_ON_REVIEW' and 'SHOW' conditions are met. This should only be used for fields within declaration forms, as they are the only ones with review pages."
|
|
211
213
|
);
|
|
212
|
-
var FieldConditional =
|
|
214
|
+
var FieldConditional = z3.discriminatedUnion("type", [
|
|
213
215
|
// Field input can be shown / hidden
|
|
214
216
|
ShowConditional,
|
|
215
217
|
// Field input can be shown to the user but as disabled
|
|
216
218
|
EnableConditional,
|
|
217
219
|
// Field output can be shown / hidden on the review page
|
|
218
220
|
DisplayOnReviewConditional
|
|
219
|
-
]).
|
|
221
|
+
]).meta({
|
|
220
222
|
description: "Field conditional configuration",
|
|
221
|
-
|
|
223
|
+
id: "FieldConditional"
|
|
222
224
|
});
|
|
223
225
|
|
|
224
226
|
// ../commons/src/events/FieldType.ts
|
|
225
|
-
var
|
|
227
|
+
var z4 = __toESM(require("zod/v4"));
|
|
226
228
|
var FieldType = {
|
|
227
229
|
NAME: "NAME",
|
|
228
230
|
PHONE: "PHONE",
|
|
@@ -230,7 +232,6 @@ var FieldType = {
|
|
|
230
232
|
ADDRESS: "ADDRESS",
|
|
231
233
|
TEXT: "TEXT",
|
|
232
234
|
NUMBER: "NUMBER",
|
|
233
|
-
NUMBER_WITH_UNIT: "NUMBER_WITH_UNIT",
|
|
234
235
|
TEXTAREA: "TEXTAREA",
|
|
235
236
|
EMAIL: "EMAIL",
|
|
236
237
|
DATE: "DATE",
|
|
@@ -265,9 +266,21 @@ var FieldType = {
|
|
|
265
266
|
QUERY_PARAM_READER: "QUERY_PARAM_READER",
|
|
266
267
|
QR_READER: "QR_READER",
|
|
267
268
|
ID_READER: "ID_READER",
|
|
268
|
-
LOADER: "LOADER"
|
|
269
|
+
LOADER: "LOADER",
|
|
270
|
+
ALPHA_HIDDEN: "ALPHA_HIDDEN",
|
|
271
|
+
/**
|
|
272
|
+
* @internal
|
|
273
|
+
* @experimental
|
|
274
|
+
*
|
|
275
|
+
* Internal API used by the OpenCRVS core team for experimentation.
|
|
276
|
+
*
|
|
277
|
+
* This component is not part of the public, stable API.
|
|
278
|
+
* Its shape, behavior, or existence may change at any time or be removed
|
|
279
|
+
* entirely without notice.
|
|
280
|
+
*/
|
|
281
|
+
_EXPERIMENTAL_CUSTOM: "CUSTOM"
|
|
269
282
|
};
|
|
270
|
-
var FileFieldType =
|
|
283
|
+
var FileFieldType = z4.enum([
|
|
271
284
|
FieldType.FILE,
|
|
272
285
|
FieldType.FILE_WITH_OPTIONS,
|
|
273
286
|
FieldType.SIGNATURE
|
|
@@ -291,154 +304,147 @@ var FieldTypesToHideInReview = [
|
|
|
291
304
|
FieldType.LOADER,
|
|
292
305
|
FieldType.HTTP,
|
|
293
306
|
FieldType.QUERY_PARAM_READER,
|
|
294
|
-
FieldType.DATA
|
|
307
|
+
FieldType.DATA,
|
|
308
|
+
FieldType.ALPHA_HIDDEN
|
|
295
309
|
];
|
|
296
310
|
|
|
297
311
|
// ../commons/src/events/FieldValue.ts
|
|
298
|
-
var
|
|
312
|
+
var z7 = __toESM(require("zod/v4"));
|
|
299
313
|
|
|
300
314
|
// ../commons/src/documents.ts
|
|
301
|
-
var
|
|
302
|
-
var
|
|
303
|
-
(0, import_zod_openapi3.extendZodWithOpenApi)(import_zod5.z);
|
|
304
|
-
var FullDocumentUrl = import_zod5.z.string().brand("FullDocumentUrl").describe(
|
|
315
|
+
var z5 = __toESM(require("zod/v4"));
|
|
316
|
+
var FullDocumentUrl = z5.string().brand("FullDocumentUrl").describe(
|
|
305
317
|
"A full url with protocol, host, bucket name, starting from the root of the S3 server, https://minio.opencrvs.com/bucket-name/document-id.jpg"
|
|
306
318
|
);
|
|
307
|
-
var FullDocumentPath =
|
|
319
|
+
var FullDocumentPath = z5.string().overwrite((val) => val.startsWith("/") ? val : `/${val}`).meta({ effectType: "input", type: "string" }).describe(
|
|
308
320
|
"A full absolute path with bucket name, starting from the root of the S3 server, /bucket-name/document-id.jpg"
|
|
309
321
|
);
|
|
310
|
-
var DocumentPath =
|
|
322
|
+
var DocumentPath = z5.string().brand("DocumentPath").describe(
|
|
311
323
|
"A full identifier starting from the root of the S3 bucket, e.g. /document-id.jpg or /directory/document-id.jpg but never /bucket-name/document-id.jpg"
|
|
312
324
|
);
|
|
313
325
|
|
|
314
326
|
// ../commons/src/events/CompositeFieldValue.ts
|
|
315
|
-
var
|
|
327
|
+
var z6 = __toESM(require("zod/v4"));
|
|
316
328
|
var AddressType = {
|
|
317
329
|
DOMESTIC: "DOMESTIC",
|
|
318
330
|
INTERNATIONAL: "INTERNATIONAL"
|
|
319
331
|
};
|
|
320
|
-
var FileFieldValue =
|
|
332
|
+
var FileFieldValue = z6.object({
|
|
321
333
|
path: FullDocumentPath,
|
|
322
|
-
originalFilename:
|
|
323
|
-
type:
|
|
334
|
+
originalFilename: z6.string(),
|
|
335
|
+
type: z6.string()
|
|
324
336
|
});
|
|
325
|
-
var NameFieldValue =
|
|
326
|
-
firstname:
|
|
327
|
-
surname:
|
|
328
|
-
middlename:
|
|
337
|
+
var NameFieldValue = z6.object({
|
|
338
|
+
firstname: z6.string(),
|
|
339
|
+
surname: z6.string(),
|
|
340
|
+
middlename: z6.string().optional()
|
|
329
341
|
});
|
|
330
|
-
var NameFieldUpdateValue =
|
|
331
|
-
firstname:
|
|
332
|
-
surname:
|
|
333
|
-
middlename:
|
|
334
|
-
}).or(
|
|
335
|
-
var StreetLevelDetailsValue =
|
|
336
|
-
var StreetLevelDetailsUpdateValue =
|
|
337
|
-
var BaseAddressFieldValue =
|
|
338
|
-
country:
|
|
342
|
+
var NameFieldUpdateValue = z6.object({
|
|
343
|
+
firstname: z6.string().nullish(),
|
|
344
|
+
surname: z6.string().nullish(),
|
|
345
|
+
middlename: z6.string().nullish()
|
|
346
|
+
}).or(z6.null()).or(z6.undefined());
|
|
347
|
+
var StreetLevelDetailsValue = z6.record(z6.string(), z6.string()).optional();
|
|
348
|
+
var StreetLevelDetailsUpdateValue = z6.record(z6.string(), z6.string().nullable()).nullish();
|
|
349
|
+
var BaseAddressFieldValue = z6.object({
|
|
350
|
+
country: z6.string(),
|
|
339
351
|
streetLevelDetails: StreetLevelDetailsValue
|
|
340
352
|
});
|
|
341
|
-
var BaseAddressFieldUpdateValue =
|
|
342
|
-
country:
|
|
353
|
+
var BaseAddressFieldUpdateValue = z6.object({
|
|
354
|
+
country: z6.string().nullish(),
|
|
343
355
|
streetLevelDetails: StreetLevelDetailsUpdateValue
|
|
344
356
|
});
|
|
345
357
|
var DomesticAddressFieldValue = BaseAddressFieldValue.extend({
|
|
346
|
-
addressType:
|
|
347
|
-
administrativeArea:
|
|
358
|
+
addressType: z6.literal(AddressType.DOMESTIC),
|
|
359
|
+
administrativeArea: z6.string().uuid()
|
|
348
360
|
});
|
|
349
361
|
var InternationalAddressFieldValue = BaseAddressFieldValue.extend({
|
|
350
|
-
addressType:
|
|
362
|
+
addressType: z6.literal(AddressType.INTERNATIONAL)
|
|
351
363
|
});
|
|
352
|
-
var AddressFieldValue =
|
|
364
|
+
var AddressFieldValue = z6.discriminatedUnion("addressType", [
|
|
353
365
|
DomesticAddressFieldValue,
|
|
354
366
|
InternationalAddressFieldValue
|
|
355
367
|
]);
|
|
356
368
|
var DomesticAddressUpdateFieldValue = BaseAddressFieldUpdateValue.extend({
|
|
357
|
-
addressType:
|
|
358
|
-
administrativeArea:
|
|
369
|
+
addressType: z6.literal(AddressType.DOMESTIC),
|
|
370
|
+
administrativeArea: z6.string().uuid().nullish()
|
|
359
371
|
/* Leaf level admin structure */
|
|
360
372
|
});
|
|
361
373
|
var InternationalAddressUpdateFieldValue = BaseAddressFieldUpdateValue.extend(
|
|
362
374
|
{
|
|
363
|
-
addressType:
|
|
375
|
+
addressType: z6.literal(AddressType.INTERNATIONAL)
|
|
364
376
|
}
|
|
365
377
|
);
|
|
366
|
-
var AddressFieldUpdateValue =
|
|
378
|
+
var AddressFieldUpdateValue = z6.discriminatedUnion("addressType", [
|
|
367
379
|
DomesticAddressUpdateFieldValue,
|
|
368
380
|
InternationalAddressUpdateFieldValue
|
|
369
381
|
]).nullish();
|
|
370
|
-
var FileFieldValueWithOption =
|
|
382
|
+
var FileFieldValueWithOption = z6.object({
|
|
371
383
|
path: FullDocumentPath,
|
|
372
|
-
originalFilename:
|
|
373
|
-
type:
|
|
374
|
-
option:
|
|
384
|
+
originalFilename: z6.string(),
|
|
385
|
+
type: z6.string(),
|
|
386
|
+
option: z6.string()
|
|
375
387
|
});
|
|
376
|
-
var FileFieldWithOptionValue =
|
|
377
|
-
var HttpFieldValue =
|
|
378
|
-
loading:
|
|
379
|
-
error:
|
|
380
|
-
data:
|
|
388
|
+
var FileFieldWithOptionValue = z6.array(FileFieldValueWithOption);
|
|
389
|
+
var HttpFieldValue = z6.object({
|
|
390
|
+
loading: z6.boolean(),
|
|
391
|
+
error: z6.object({ statusCode: z6.number(), message: z6.string() }).nullish(),
|
|
392
|
+
data: z6.any()
|
|
381
393
|
});
|
|
382
|
-
var HttpFieldUpdateValue =
|
|
383
|
-
loading:
|
|
384
|
-
error:
|
|
385
|
-
data:
|
|
386
|
-
}).or(
|
|
387
|
-
var QueryParamReaderFieldValue =
|
|
388
|
-
data:
|
|
394
|
+
var HttpFieldUpdateValue = z6.object({
|
|
395
|
+
loading: z6.boolean().nullish(),
|
|
396
|
+
error: z6.object({ statusCode: z6.number(), message: z6.string() }).nullish(),
|
|
397
|
+
data: z6.any().nullish()
|
|
398
|
+
}).or(z6.null()).or(z6.undefined());
|
|
399
|
+
var QueryParamReaderFieldValue = z6.object({
|
|
400
|
+
data: z6.record(z6.string(), z6.string())
|
|
389
401
|
}).nullish();
|
|
390
|
-
var QueryParamReaderFieldUpdateValue =
|
|
391
|
-
data:
|
|
402
|
+
var QueryParamReaderFieldUpdateValue = z6.object({
|
|
403
|
+
data: z6.record(z6.string(), z6.string())
|
|
392
404
|
});
|
|
393
|
-
var ReadDataValue =
|
|
394
|
-
data:
|
|
405
|
+
var ReadDataValue = z6.object({
|
|
406
|
+
data: z6.any()
|
|
395
407
|
});
|
|
396
408
|
var QrReaderFieldValue = ReadDataValue;
|
|
397
409
|
var IdReaderFieldValue = ReadDataValue;
|
|
398
|
-
var
|
|
399
|
-
numericValue: import_zod6.z.number(),
|
|
400
|
-
unit: import_zod6.z.string()
|
|
401
|
-
});
|
|
402
|
-
var NumberWithUnitFieldUpdateValue = import_zod6.z.object({
|
|
403
|
-
numericValue: import_zod6.z.number().optional(),
|
|
404
|
-
unit: import_zod6.z.string().optional()
|
|
405
|
-
});
|
|
410
|
+
var CustomFieldValue = z6.unknown().brand("CustomFieldValue");
|
|
406
411
|
|
|
407
412
|
// ../commons/src/events/FieldValue.ts
|
|
408
|
-
var TextValue =
|
|
413
|
+
var TextValue = z7.string();
|
|
414
|
+
var HiddenFieldValue = z7.string();
|
|
409
415
|
var NonEmptyTextValue = TextValue.min(1);
|
|
410
|
-
var DateValue =
|
|
411
|
-
var AgeValue =
|
|
412
|
-
age:
|
|
413
|
-
asOfDateRef:
|
|
416
|
+
var DateValue = z7.iso.date().describe("Date in the format YYYY-MM-DD");
|
|
417
|
+
var AgeValue = z7.object({
|
|
418
|
+
age: z7.number(),
|
|
419
|
+
asOfDateRef: z7.string()
|
|
414
420
|
});
|
|
415
421
|
var AgeUpdateValue = AgeValue.optional().nullable();
|
|
416
|
-
var TimeValue =
|
|
417
|
-
var DatetimeValue =
|
|
418
|
-
var SelectDateRangeValue =
|
|
422
|
+
var TimeValue = z7.string().regex(/^([01][0-9]|2[0-3]):[0-5][0-9]$/);
|
|
423
|
+
var DatetimeValue = z7.iso.datetime();
|
|
424
|
+
var SelectDateRangeValue = z7.enum([
|
|
419
425
|
"last7Days",
|
|
420
426
|
"last30Days",
|
|
421
427
|
"last90Days",
|
|
422
428
|
"last365Days"
|
|
423
429
|
]);
|
|
424
|
-
var DateRangeFieldValue =
|
|
430
|
+
var DateRangeFieldValue = z7.object({
|
|
425
431
|
start: DateValue,
|
|
426
432
|
end: DateValue
|
|
427
433
|
}).or(DateValue).describe(
|
|
428
434
|
"Date range with start and end dates in the format YYYY-MM-DD. Inclusive start, exclusive end."
|
|
429
435
|
);
|
|
430
|
-
var EmailValue =
|
|
431
|
-
var CheckboxFieldValue =
|
|
432
|
-
var NumberFieldValue =
|
|
433
|
-
var SignatureFieldValue =
|
|
434
|
-
var ButtonFieldValue =
|
|
435
|
-
var VerificationStatusValue =
|
|
436
|
+
var EmailValue = z7.email();
|
|
437
|
+
var CheckboxFieldValue = z7.boolean();
|
|
438
|
+
var NumberFieldValue = z7.number();
|
|
439
|
+
var SignatureFieldValue = z7.string();
|
|
440
|
+
var ButtonFieldValue = z7.number();
|
|
441
|
+
var VerificationStatusValue = z7.enum([
|
|
436
442
|
"verified",
|
|
437
443
|
"authenticated",
|
|
438
444
|
"failed",
|
|
439
445
|
"pending"
|
|
440
446
|
]);
|
|
441
|
-
var FieldValuesWithoutDataField =
|
|
447
|
+
var FieldValuesWithoutDataField = z7.union([
|
|
442
448
|
AddressFieldValue,
|
|
443
449
|
TextValue,
|
|
444
450
|
DateValue,
|
|
@@ -458,13 +464,12 @@ var FieldValuesWithoutDataField = import_zod7.z.union([
|
|
|
458
464
|
QueryParamReaderFieldValue,
|
|
459
465
|
QrReaderFieldValue,
|
|
460
466
|
IdReaderFieldValue,
|
|
461
|
-
|
|
462
|
-
NumberWithUnitFieldUpdateValue
|
|
467
|
+
CustomFieldValue
|
|
463
468
|
]);
|
|
464
|
-
var DataFieldValue =
|
|
465
|
-
data:
|
|
469
|
+
var DataFieldValue = z7.object({
|
|
470
|
+
data: z7.record(z7.string(), FieldValuesWithoutDataField)
|
|
466
471
|
}).nullish();
|
|
467
|
-
var FieldValue =
|
|
472
|
+
var FieldValue = z7.union([
|
|
468
473
|
FieldValuesWithoutDataField,
|
|
469
474
|
DataFieldValue
|
|
470
475
|
]);
|
|
@@ -479,28 +484,43 @@ var PRIORITY_ORDER = [
|
|
|
479
484
|
"SelectDateRangeValue",
|
|
480
485
|
"CheckboxFieldValue",
|
|
481
486
|
"NumberFieldValue",
|
|
482
|
-
"NumberWithUnitFieldUpdateValue",
|
|
483
487
|
"FileFieldValue",
|
|
484
488
|
"FileFieldWithOptionValue",
|
|
485
489
|
"DataFieldValue"
|
|
486
490
|
];
|
|
487
491
|
function schemaPriority(schema) {
|
|
488
|
-
const name = schema.
|
|
492
|
+
const name = schema.description;
|
|
493
|
+
if (!name) {
|
|
494
|
+
return 9999;
|
|
495
|
+
}
|
|
489
496
|
const idx = PRIORITY_ORDER.indexOf(name);
|
|
490
497
|
return idx === -1 ? 9999 : idx;
|
|
491
498
|
}
|
|
492
499
|
function safeUnion(schemas) {
|
|
493
|
-
return
|
|
500
|
+
return z7.any().superRefine((val, ctx) => {
|
|
494
501
|
const successful = schemas.filter((s) => s.safeParse(val).success);
|
|
495
502
|
if (successful.length === 1) {
|
|
496
|
-
return
|
|
503
|
+
return;
|
|
497
504
|
}
|
|
498
505
|
if (successful.length === 0) {
|
|
499
|
-
|
|
506
|
+
ctx.addIssue({
|
|
507
|
+
code: "invalid_type",
|
|
508
|
+
expected: "custom",
|
|
509
|
+
message: "Value does not match any schema"
|
|
510
|
+
});
|
|
511
|
+
return;
|
|
500
512
|
}
|
|
501
513
|
successful.sort((a, b) => schemaPriority(a) - schemaPriority(b));
|
|
502
514
|
const best = successful[0];
|
|
503
|
-
|
|
515
|
+
if (!best.safeParse(val).success) {
|
|
516
|
+
ctx.addIssue({
|
|
517
|
+
expected: "custom",
|
|
518
|
+
code: "invalid_type",
|
|
519
|
+
message: "Value did not match the best schema"
|
|
520
|
+
});
|
|
521
|
+
}
|
|
522
|
+
}).meta({
|
|
523
|
+
description: "Value that matches exactly one of the possible schema types (TextValue, DateValue, DateRangeFieldValue). The best matching schema is chosen by priority."
|
|
504
524
|
});
|
|
505
525
|
}
|
|
506
526
|
var FieldUpdateValue = safeUnion([
|
|
@@ -513,30 +533,28 @@ var FieldUpdateValue = safeUnion([
|
|
|
513
533
|
SelectDateRangeValue.describe("SelectDateRangeValue"),
|
|
514
534
|
CheckboxFieldValue.describe("CheckboxFieldValue"),
|
|
515
535
|
NumberFieldValue.describe("NumberFieldValue"),
|
|
516
|
-
NumberWithUnitFieldUpdateValue.describe("NumberWithUnitFieldUpdateValue"),
|
|
517
536
|
FileFieldValue.describe("FileFieldValue"),
|
|
518
537
|
FileFieldWithOptionValue.describe("FileFieldWithOptionValue"),
|
|
519
538
|
DataFieldValue.describe("DataFieldValue"),
|
|
520
539
|
NameFieldUpdateValue.describe("NameFieldUpdateValue"),
|
|
521
540
|
HttpFieldUpdateValue.describe("HttpFieldUpdateValue"),
|
|
522
|
-
QueryParamReaderFieldUpdateValue.describe("QueryParamReaderFieldUpdateValue")
|
|
541
|
+
QueryParamReaderFieldUpdateValue.describe("QueryParamReaderFieldUpdateValue"),
|
|
542
|
+
CustomFieldValue.describe("CustomFieldValue"),
|
|
543
|
+
HiddenFieldValue.describe("HiddenFieldValue")
|
|
523
544
|
]);
|
|
524
545
|
|
|
525
|
-
// ../commons/src/events/FieldConfig.ts
|
|
526
|
-
var import_zod_openapi6 = require("zod-openapi");
|
|
527
|
-
|
|
528
546
|
// ../commons/src/uuid.ts
|
|
529
547
|
var import_uuid = require("uuid");
|
|
530
|
-
var
|
|
531
|
-
var UUID =
|
|
548
|
+
var z8 = __toESM(require("zod/v4"));
|
|
549
|
+
var UUID = z8.uuid().brand("UUID");
|
|
532
550
|
function getUUID() {
|
|
533
551
|
return (0, import_uuid.v4)();
|
|
534
552
|
}
|
|
535
553
|
|
|
536
554
|
// ../commons/src/events/serializers/user/serializer.ts
|
|
537
|
-
var
|
|
538
|
-
var SerializedUserField =
|
|
539
|
-
$userField:
|
|
555
|
+
var z9 = __toESM(require("zod/v4"));
|
|
556
|
+
var SerializedUserField = z9.object({
|
|
557
|
+
$userField: z9.enum([
|
|
540
558
|
"id",
|
|
541
559
|
"name",
|
|
542
560
|
"role",
|
|
@@ -545,11 +563,12 @@ var SerializedUserField = import_zod9.z.object({
|
|
|
545
563
|
"firstname",
|
|
546
564
|
"middlename",
|
|
547
565
|
"surname",
|
|
548
|
-
"
|
|
549
|
-
"
|
|
550
|
-
"primaryOfficeId"
|
|
566
|
+
"signature",
|
|
567
|
+
"avatar",
|
|
568
|
+
"primaryOfficeId",
|
|
569
|
+
"administrativeAreaId"
|
|
551
570
|
]),
|
|
552
|
-
$location:
|
|
571
|
+
$location: z9.string().optional()
|
|
553
572
|
});
|
|
554
573
|
function userSerializer(userField) {
|
|
555
574
|
return {
|
|
@@ -569,24 +588,23 @@ function userSerializer(userField) {
|
|
|
569
588
|
}
|
|
570
589
|
|
|
571
590
|
// ../commons/src/events/EventIndex.ts
|
|
572
|
-
var
|
|
591
|
+
var import_v4 = require("zod/v4");
|
|
573
592
|
|
|
574
593
|
// ../commons/src/events/EventMetadata.ts
|
|
575
|
-
var
|
|
594
|
+
var z14 = __toESM(require("zod/v4"));
|
|
576
595
|
|
|
577
596
|
// ../commons/src/events/ActionDocument.ts
|
|
578
|
-
var
|
|
579
|
-
var import_zod_openapi4 = require("zod-openapi");
|
|
597
|
+
var z12 = __toESM(require("zod/v4"));
|
|
580
598
|
|
|
581
599
|
// ../commons/src/events/CreatedAtLocation.ts
|
|
582
600
|
var CreatedAtLocation = UUID.nullish();
|
|
583
601
|
|
|
584
602
|
// ../commons/src/authentication.ts
|
|
585
603
|
var import_jwt_decode = __toESM(require("jwt-decode"));
|
|
586
|
-
var
|
|
604
|
+
var z11 = __toESM(require("zod/v4"));
|
|
587
605
|
|
|
588
606
|
// ../commons/src/scopes.ts
|
|
589
|
-
var
|
|
607
|
+
var z10 = __toESM(require("zod/v4"));
|
|
590
608
|
var SCOPES = {
|
|
591
609
|
// TODO v1.8 legacy scopes
|
|
592
610
|
BYPASSRATELIMIT: "bypassratelimit",
|
|
@@ -665,91 +683,91 @@ var SCOPES = {
|
|
|
665
683
|
// data seeding
|
|
666
684
|
USER_DATA_SEEDING: "user.data-seeding"
|
|
667
685
|
};
|
|
668
|
-
var LegacyScopes =
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
686
|
+
var LegacyScopes = z10.union([
|
|
687
|
+
z10.literal(SCOPES.BYPASSRATELIMIT),
|
|
688
|
+
z10.literal(SCOPES.REGISTER),
|
|
689
|
+
z10.literal(SCOPES.DEMO),
|
|
690
|
+
z10.literal(SCOPES.CONFIG)
|
|
673
691
|
]);
|
|
674
|
-
var IntegrationScopes =
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
692
|
+
var IntegrationScopes = z10.union([
|
|
693
|
+
z10.literal(SCOPES.WEBHOOK),
|
|
694
|
+
z10.literal(SCOPES.NATIONALID),
|
|
695
|
+
z10.literal(SCOPES.NOTIFICATION_API),
|
|
696
|
+
z10.literal(SCOPES.RECORDSEARCH)
|
|
679
697
|
]);
|
|
680
|
-
var InternalOperationsScopes =
|
|
681
|
-
|
|
682
|
-
|
|
698
|
+
var InternalOperationsScopes = z10.union([
|
|
699
|
+
z10.literal(SCOPES.RECORD_REINDEX),
|
|
700
|
+
z10.literal(SCOPES.RECORD_IMPORT)
|
|
683
701
|
]);
|
|
684
|
-
var DeclareScopes =
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
702
|
+
var DeclareScopes = z10.union([
|
|
703
|
+
z10.literal(SCOPES.RECORD_DECLARE_BIRTH),
|
|
704
|
+
z10.literal(SCOPES.RECORD_DECLARE_BIRTH_MY_JURISDICTION),
|
|
705
|
+
z10.literal(SCOPES.RECORD_DECLARE_DEATH),
|
|
706
|
+
z10.literal(SCOPES.RECORD_DECLARE_DEATH_MY_JURISDICTION),
|
|
707
|
+
z10.literal(SCOPES.RECORD_DECLARE_MARRIAGE),
|
|
708
|
+
z10.literal(SCOPES.RECORD_DECLARE_MARRIAGE_MY_JURISDICTION),
|
|
709
|
+
z10.literal(SCOPES.RECORD_SUBMIT_INCOMPLETE),
|
|
710
|
+
z10.literal(SCOPES.RECORD_SUBMIT_FOR_REVIEW)
|
|
693
711
|
]);
|
|
694
|
-
var UnassignScope =
|
|
695
|
-
var ValidateScopes =
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
712
|
+
var UnassignScope = z10.literal(SCOPES.RECORD_UNASSIGN_OTHERS);
|
|
713
|
+
var ValidateScopes = z10.union([
|
|
714
|
+
z10.literal(SCOPES.RECORD_SUBMIT_FOR_APPROVAL),
|
|
715
|
+
z10.literal(SCOPES.RECORD_SUBMIT_FOR_UPDATES),
|
|
716
|
+
z10.literal(SCOPES.RECORD_DECLARATION_EDIT),
|
|
717
|
+
z10.literal(SCOPES.RECORD_REVIEW_DUPLICATES),
|
|
718
|
+
z10.literal(SCOPES.RECORD_DECLARATION_ARCHIVE),
|
|
719
|
+
z10.literal(SCOPES.RECORD_DECLARATION_REINSTATE)
|
|
702
720
|
]);
|
|
703
|
-
var RegisterScope =
|
|
704
|
-
var CorrectionScopes =
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
721
|
+
var RegisterScope = z10.literal(SCOPES.RECORD_REGISTER);
|
|
722
|
+
var CorrectionScopes = z10.union([
|
|
723
|
+
z10.literal(SCOPES.RECORD_REGISTRATION_REQUEST_CORRECTION),
|
|
724
|
+
z10.literal(SCOPES.RECORD_REGISTRATION_CORRECT),
|
|
725
|
+
z10.literal(SCOPES.RECORD_CONFIRM_REGISTRATION),
|
|
726
|
+
z10.literal(SCOPES.RECORD_REJECT_REGISTRATION)
|
|
709
727
|
]);
|
|
710
|
-
var SearchScopes =
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
728
|
+
var SearchScopes = z10.union([
|
|
729
|
+
z10.literal(SCOPES.SEARCH_BIRTH_MY_JURISDICTION),
|
|
730
|
+
z10.literal(SCOPES.SEARCH_BIRTH),
|
|
731
|
+
z10.literal(SCOPES.SEARCH_DEATH_MY_JURISDICTION),
|
|
732
|
+
z10.literal(SCOPES.SEARCH_DEATH),
|
|
733
|
+
z10.literal(SCOPES.SEARCH_MARRIAGE_MY_JURISDICTION),
|
|
734
|
+
z10.literal(SCOPES.SEARCH_MARRIAGE)
|
|
717
735
|
]);
|
|
718
|
-
var AuditScopes =
|
|
719
|
-
var PerformanceScopes =
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
736
|
+
var AuditScopes = z10.literal(SCOPES.RECORD_READ);
|
|
737
|
+
var PerformanceScopes = z10.union([
|
|
738
|
+
z10.literal(SCOPES.PERFORMANCE_READ),
|
|
739
|
+
z10.literal(SCOPES.PERFORMANCE_READ_DASHBOARDS),
|
|
740
|
+
z10.literal(SCOPES.PERFORMANCE_EXPORT_VITAL_STATISTICS)
|
|
723
741
|
]);
|
|
724
|
-
var OrganisationScopes =
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
742
|
+
var OrganisationScopes = z10.union([
|
|
743
|
+
z10.literal(SCOPES.ORGANISATION_READ_LOCATIONS),
|
|
744
|
+
z10.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_OFFICE),
|
|
745
|
+
z10.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_JURISDICTION)
|
|
728
746
|
]);
|
|
729
|
-
var UserScopes =
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
747
|
+
var UserScopes = z10.union([
|
|
748
|
+
z10.literal(SCOPES.USER_READ),
|
|
749
|
+
z10.literal(SCOPES.USER_READ_MY_OFFICE),
|
|
750
|
+
z10.literal(SCOPES.USER_READ_MY_JURISDICTION),
|
|
751
|
+
z10.literal(SCOPES.USER_READ_ONLY_MY_AUDIT),
|
|
752
|
+
z10.literal(SCOPES.USER_CREATE),
|
|
753
|
+
z10.literal(SCOPES.USER_CREATE_MY_JURISDICTION),
|
|
754
|
+
z10.literal(SCOPES.USER_UPDATE),
|
|
755
|
+
z10.literal(SCOPES.USER_UPDATE_MY_JURISDICTION)
|
|
738
756
|
]);
|
|
739
|
-
var ConfigScope =
|
|
740
|
-
var DataSeedingScope =
|
|
741
|
-
var LiteralScopes =
|
|
757
|
+
var ConfigScope = z10.literal(SCOPES.CONFIG_UPDATE_ALL);
|
|
758
|
+
var DataSeedingScope = z10.literal(SCOPES.USER_DATA_SEEDING);
|
|
759
|
+
var LiteralScopes = z10.union([
|
|
742
760
|
LegacyScopes,
|
|
743
761
|
IntegrationScopes,
|
|
744
762
|
UnassignScope,
|
|
745
763
|
DeclareScopes,
|
|
746
764
|
ValidateScopes,
|
|
747
765
|
RegisterScope,
|
|
748
|
-
|
|
766
|
+
z10.literal(SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES),
|
|
749
767
|
CorrectionScopes,
|
|
750
768
|
SearchScopes,
|
|
751
769
|
AuditScopes,
|
|
752
|
-
|
|
770
|
+
z10.literal(SCOPES.PROFILE_ELECTRONIC_SIGNATURE),
|
|
753
771
|
PerformanceScopes,
|
|
754
772
|
OrganisationScopes,
|
|
755
773
|
UserScopes,
|
|
@@ -758,38 +776,38 @@ var LiteralScopes = import_zod10.z.union([
|
|
|
758
776
|
InternalOperationsScopes
|
|
759
777
|
]);
|
|
760
778
|
var rawConfigurableScopeRegex = /^([a-zA-Z][a-zA-Z0-9.-]*(?:\.[a-zA-Z0-9.-]+)*)\[((?:\w+=[\w.-]+(?:\|[\w.-]+)*)(?:,[\w]+=[\w.-]+(?:\|[\w.-]+)*)*)\]$/;
|
|
761
|
-
var rawConfigurableScope =
|
|
762
|
-
var CreateUserScope =
|
|
763
|
-
type:
|
|
764
|
-
options:
|
|
765
|
-
role:
|
|
779
|
+
var rawConfigurableScope = z10.string().regex(rawConfigurableScopeRegex);
|
|
780
|
+
var CreateUserScope = z10.object({
|
|
781
|
+
type: z10.literal("user.create"),
|
|
782
|
+
options: z10.object({
|
|
783
|
+
role: z10.array(z10.string())
|
|
766
784
|
})
|
|
767
785
|
});
|
|
768
|
-
var EditUserScope =
|
|
769
|
-
type:
|
|
770
|
-
options:
|
|
771
|
-
role:
|
|
786
|
+
var EditUserScope = z10.object({
|
|
787
|
+
type: z10.literal("user.edit"),
|
|
788
|
+
options: z10.object({
|
|
789
|
+
role: z10.array(z10.string())
|
|
772
790
|
})
|
|
773
791
|
});
|
|
774
|
-
var WorkqueueScope =
|
|
775
|
-
type:
|
|
776
|
-
options:
|
|
777
|
-
id:
|
|
792
|
+
var WorkqueueScope = z10.object({
|
|
793
|
+
type: z10.literal("workqueue"),
|
|
794
|
+
options: z10.object({
|
|
795
|
+
id: z10.array(z10.string())
|
|
778
796
|
})
|
|
779
797
|
});
|
|
780
|
-
var SearchScope =
|
|
781
|
-
type:
|
|
782
|
-
options:
|
|
783
|
-
event:
|
|
784
|
-
access:
|
|
798
|
+
var SearchScope = z10.object({
|
|
799
|
+
type: z10.literal("search"),
|
|
800
|
+
options: z10.object({
|
|
801
|
+
event: z10.array(z10.string()).length(1),
|
|
802
|
+
access: z10.array(z10.enum(["my-jurisdiction", "all"])).length(1)
|
|
785
803
|
})
|
|
786
804
|
});
|
|
787
|
-
var RecordScopeType =
|
|
805
|
+
var RecordScopeType = z10.enum([
|
|
788
806
|
"record.create",
|
|
789
807
|
"record.read",
|
|
790
808
|
"record.declare",
|
|
791
809
|
"record.notify",
|
|
792
|
-
"record.declared.
|
|
810
|
+
"record.declared.edit",
|
|
793
811
|
"record.declared.reject",
|
|
794
812
|
"record.declared.archive",
|
|
795
813
|
"record.declared.review-duplicates",
|
|
@@ -799,27 +817,40 @@ var RecordScopeType = import_zod10.z.enum([
|
|
|
799
817
|
"record.registered.correct",
|
|
800
818
|
"record.unassign-others"
|
|
801
819
|
]);
|
|
802
|
-
var RecordScope =
|
|
820
|
+
var RecordScope = z10.object({
|
|
803
821
|
type: RecordScopeType,
|
|
804
|
-
options:
|
|
805
|
-
event:
|
|
822
|
+
options: z10.object({
|
|
823
|
+
event: z10.array(z10.string()).describe("Event type, e.g. birth, death")
|
|
806
824
|
})
|
|
807
825
|
}).describe(
|
|
808
826
|
"Scopes used to check user's permission to perform actions on a record."
|
|
809
827
|
);
|
|
810
|
-
var
|
|
828
|
+
var CustomActionScope = z10.object({
|
|
829
|
+
type: z10.literal("record.custom-action"),
|
|
830
|
+
options: z10.object({
|
|
831
|
+
event: z10.array(z10.string()).describe("Allowed event type, e.g. birth, death"),
|
|
832
|
+
customActionType: z10.array(z10.string()).describe("Allowed custom action types")
|
|
833
|
+
})
|
|
834
|
+
});
|
|
835
|
+
var ConfigurableRawScopes = z10.discriminatedUnion("type", [
|
|
811
836
|
SearchScope,
|
|
812
837
|
CreateUserScope,
|
|
813
838
|
EditUserScope,
|
|
814
839
|
WorkqueueScope,
|
|
815
|
-
RecordScope
|
|
840
|
+
RecordScope,
|
|
841
|
+
CustomActionScope
|
|
842
|
+
]);
|
|
843
|
+
var ConfigurableActionScopes = z10.discriminatedUnion("type", [
|
|
844
|
+
// @TODO - Record scope holds non-action scopes as well e.g., `record.read`
|
|
845
|
+
RecordScope,
|
|
846
|
+
CustomActionScope
|
|
816
847
|
]);
|
|
817
848
|
var scopes = Object.values(SCOPES);
|
|
818
|
-
var ActionScopes =
|
|
849
|
+
var ActionScopes = z10.union([
|
|
819
850
|
DeclareScopes,
|
|
820
851
|
ValidateScopes,
|
|
821
852
|
RegisterScope,
|
|
822
|
-
|
|
853
|
+
z10.literal(SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES),
|
|
823
854
|
CorrectionScopes
|
|
824
855
|
]);
|
|
825
856
|
|
|
@@ -953,15 +984,14 @@ var DEFAULT_ROLES_DEFINITION = [
|
|
|
953
984
|
]
|
|
954
985
|
}
|
|
955
986
|
];
|
|
956
|
-
var TokenUserType =
|
|
957
|
-
var TokenWithBearer =
|
|
987
|
+
var TokenUserType = z11.enum(["user", "system"]);
|
|
988
|
+
var TokenWithBearer = z11.string().regex(/^Bearer\s/);
|
|
958
989
|
|
|
959
990
|
// ../commons/src/events/ActionDocument.ts
|
|
960
|
-
(
|
|
961
|
-
var ActionUpdate = import_zod12.z.record(import_zod12.z.string(), FieldUpdateValue).describe(
|
|
991
|
+
var ActionUpdate = z12.record(z12.string(), FieldUpdateValue).describe(
|
|
962
992
|
"Record of field-level changes made by an action. Supports partial updates and nullable values."
|
|
963
993
|
);
|
|
964
|
-
var EventState =
|
|
994
|
+
var EventState = z12.record(z12.string(), FieldValue).describe(
|
|
965
995
|
"Aggregate representation of event data after all actions have been applied, with all updates consolidated and null values removed."
|
|
966
996
|
);
|
|
967
997
|
var ActionStatus = {
|
|
@@ -969,16 +999,16 @@ var ActionStatus = {
|
|
|
969
999
|
Accepted: "Accepted",
|
|
970
1000
|
Rejected: "Rejected"
|
|
971
1001
|
};
|
|
972
|
-
var ActionBase =
|
|
1002
|
+
var ActionBase = z12.object({
|
|
973
1003
|
id: UUID.describe("Unique identifier of the action."),
|
|
974
|
-
transactionId:
|
|
1004
|
+
transactionId: z12.string().describe("Unique identifier of the transaction."),
|
|
975
1005
|
createdByUserType: TokenUserType.describe(
|
|
976
1006
|
"Indicates whether the action was created by a human-user or by a system-user."
|
|
977
1007
|
),
|
|
978
|
-
createdAt:
|
|
979
|
-
createdBy:
|
|
980
|
-
createdByRole:
|
|
981
|
-
createdBySignature:
|
|
1008
|
+
createdAt: z12.string().datetime().describe("Timestamp indicating when the action was created."),
|
|
1009
|
+
createdBy: z12.string().describe("Identifier of the user who created the action."),
|
|
1010
|
+
createdByRole: z12.string().describe("Role of the user who created the action."),
|
|
1011
|
+
createdBySignature: z12.string().nullish().describe("Reference to the signature of the user who created the action."),
|
|
982
1012
|
createdAtLocation: CreatedAtLocation.describe(
|
|
983
1013
|
"Reference to the location of the user who created the action."
|
|
984
1014
|
),
|
|
@@ -986,7 +1016,7 @@ var ActionBase = import_zod12.z.object({
|
|
|
986
1016
|
"Declaration data defined by the ActionConfig. Supports partial updates."
|
|
987
1017
|
),
|
|
988
1018
|
annotation: ActionUpdate.optional().nullable().describe("Action-specific metadata used to annotate the event."),
|
|
989
|
-
status:
|
|
1019
|
+
status: z12.enum([
|
|
990
1020
|
ActionStatus.Requested,
|
|
991
1021
|
ActionStatus.Accepted,
|
|
992
1022
|
ActionStatus.Rejected
|
|
@@ -997,172 +1027,182 @@ var ActionBase = import_zod12.z.object({
|
|
|
997
1027
|
"Reference to the original action asynchronously accepted or rejected by a third-party integration."
|
|
998
1028
|
)
|
|
999
1029
|
});
|
|
1000
|
-
var AssignedAction = ActionBase.
|
|
1001
|
-
|
|
1002
|
-
type:
|
|
1003
|
-
assignedTo:
|
|
1030
|
+
var AssignedAction = ActionBase.extend(
|
|
1031
|
+
z12.object({
|
|
1032
|
+
type: z12.literal(ActionType.ASSIGN),
|
|
1033
|
+
assignedTo: z12.string().describe("Identifier of the user to whom the action is assigned.")
|
|
1004
1034
|
// TODO move into 'content' property
|
|
1005
|
-
})
|
|
1035
|
+
}).shape
|
|
1006
1036
|
);
|
|
1007
|
-
var UnassignedAction = ActionBase.
|
|
1008
|
-
|
|
1009
|
-
type:
|
|
1010
|
-
})
|
|
1037
|
+
var UnassignedAction = ActionBase.extend(
|
|
1038
|
+
z12.object({
|
|
1039
|
+
type: z12.literal(ActionType.UNASSIGN)
|
|
1040
|
+
}).shape
|
|
1011
1041
|
);
|
|
1012
|
-
var RegisterAction = ActionBase.
|
|
1013
|
-
|
|
1014
|
-
type:
|
|
1015
|
-
registrationNumber:
|
|
1042
|
+
var RegisterAction = ActionBase.extend(
|
|
1043
|
+
z12.object({
|
|
1044
|
+
type: z12.literal(ActionType.REGISTER),
|
|
1045
|
+
registrationNumber: z12.string().optional().describe(
|
|
1016
1046
|
"Registration number of the event. Always present for accepted registrations."
|
|
1017
1047
|
)
|
|
1018
1048
|
// TODO move into 'content' property
|
|
1019
|
-
})
|
|
1049
|
+
}).shape
|
|
1020
1050
|
);
|
|
1021
|
-
var DeclareAction = ActionBase.
|
|
1022
|
-
|
|
1023
|
-
type:
|
|
1024
|
-
})
|
|
1025
|
-
);
|
|
1026
|
-
var ValidateAction = ActionBase.merge(
|
|
1027
|
-
import_zod12.z.object({
|
|
1028
|
-
type: import_zod12.z.literal(ActionType.VALIDATE)
|
|
1029
|
-
})
|
|
1051
|
+
var DeclareAction = ActionBase.extend(
|
|
1052
|
+
z12.object({
|
|
1053
|
+
type: z12.literal(ActionType.DECLARE)
|
|
1054
|
+
}).shape
|
|
1030
1055
|
);
|
|
1031
|
-
var ReasonContent =
|
|
1032
|
-
reason:
|
|
1056
|
+
var ReasonContent = z12.object({
|
|
1057
|
+
reason: z12.string().min(1, { error: "Message cannot be empty" }).describe(
|
|
1033
1058
|
"Message describing the reason for rejecting or archiving the event."
|
|
1034
1059
|
)
|
|
1035
1060
|
});
|
|
1036
|
-
var RejectAction = ActionBase.
|
|
1037
|
-
|
|
1038
|
-
type:
|
|
1061
|
+
var RejectAction = ActionBase.extend(
|
|
1062
|
+
z12.object({
|
|
1063
|
+
type: z12.literal(ActionType.REJECT),
|
|
1039
1064
|
content: ReasonContent
|
|
1040
|
-
})
|
|
1065
|
+
}).shape
|
|
1041
1066
|
);
|
|
1042
|
-
var PotentialDuplicate =
|
|
1067
|
+
var PotentialDuplicate = z12.object({
|
|
1043
1068
|
id: UUID,
|
|
1044
|
-
trackingId:
|
|
1069
|
+
trackingId: z12.string()
|
|
1045
1070
|
});
|
|
1046
|
-
var DuplicateDetectedAction = ActionBase.
|
|
1047
|
-
|
|
1048
|
-
type:
|
|
1049
|
-
content:
|
|
1050
|
-
duplicates:
|
|
1071
|
+
var DuplicateDetectedAction = ActionBase.extend(
|
|
1072
|
+
z12.object({
|
|
1073
|
+
type: z12.literal(ActionType.DUPLICATE_DETECTED),
|
|
1074
|
+
content: z12.object({
|
|
1075
|
+
duplicates: z12.array(PotentialDuplicate)
|
|
1051
1076
|
})
|
|
1052
|
-
})
|
|
1077
|
+
}).shape
|
|
1053
1078
|
);
|
|
1054
|
-
var MarkNotDuplicateAction = ActionBase.
|
|
1055
|
-
|
|
1056
|
-
type:
|
|
1057
|
-
})
|
|
1079
|
+
var MarkNotDuplicateAction = ActionBase.extend(
|
|
1080
|
+
z12.object({
|
|
1081
|
+
type: z12.literal(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
1082
|
+
}).shape
|
|
1058
1083
|
);
|
|
1059
|
-
var MarkAsDuplicateAction = ActionBase.
|
|
1060
|
-
|
|
1061
|
-
type:
|
|
1062
|
-
content:
|
|
1084
|
+
var MarkAsDuplicateAction = ActionBase.extend(
|
|
1085
|
+
z12.object({
|
|
1086
|
+
type: z12.literal(ActionType.MARK_AS_DUPLICATE),
|
|
1087
|
+
content: z12.object({
|
|
1063
1088
|
duplicateOf: UUID
|
|
1064
1089
|
}).optional()
|
|
1065
|
-
})
|
|
1090
|
+
}).shape
|
|
1066
1091
|
);
|
|
1067
|
-
var ArchiveAction = ActionBase.
|
|
1068
|
-
|
|
1069
|
-
type:
|
|
1092
|
+
var ArchiveAction = ActionBase.extend(
|
|
1093
|
+
z12.object({
|
|
1094
|
+
type: z12.literal(ActionType.ARCHIVE),
|
|
1070
1095
|
content: ReasonContent
|
|
1071
|
-
})
|
|
1096
|
+
}).shape
|
|
1072
1097
|
);
|
|
1073
|
-
var CreatedAction = ActionBase.
|
|
1074
|
-
|
|
1075
|
-
type:
|
|
1076
|
-
})
|
|
1098
|
+
var CreatedAction = ActionBase.extend(
|
|
1099
|
+
z12.object({
|
|
1100
|
+
type: z12.literal(ActionType.CREATE)
|
|
1101
|
+
}).shape
|
|
1077
1102
|
);
|
|
1078
|
-
var NotifiedAction = ActionBase.
|
|
1079
|
-
|
|
1080
|
-
type:
|
|
1081
|
-
})
|
|
1103
|
+
var NotifiedAction = ActionBase.extend(
|
|
1104
|
+
z12.object({
|
|
1105
|
+
type: z12.literal(ActionType.NOTIFY)
|
|
1106
|
+
}).shape
|
|
1082
1107
|
);
|
|
1083
|
-
var
|
|
1084
|
-
|
|
1108
|
+
var EditAction = ActionBase.extend(
|
|
1109
|
+
z12.object({
|
|
1110
|
+
type: z12.literal(ActionType.EDIT),
|
|
1111
|
+
content: z12.object({
|
|
1112
|
+
comment: z12.string().describe("Comment for the edit action.").optional()
|
|
1113
|
+
})
|
|
1114
|
+
}).shape
|
|
1115
|
+
);
|
|
1116
|
+
var PrintContent = z12.object({
|
|
1117
|
+
templateId: z12.string().optional()
|
|
1085
1118
|
});
|
|
1086
|
-
var PrintCertificateAction = ActionBase.
|
|
1087
|
-
|
|
1088
|
-
type:
|
|
1119
|
+
var PrintCertificateAction = ActionBase.extend(
|
|
1120
|
+
z12.object({
|
|
1121
|
+
type: z12.literal(ActionType.PRINT_CERTIFICATE),
|
|
1089
1122
|
content: PrintContent.optional().nullable()
|
|
1090
|
-
})
|
|
1123
|
+
}).shape
|
|
1091
1124
|
);
|
|
1092
|
-
var RequestedCorrectionAction = ActionBase.
|
|
1093
|
-
|
|
1094
|
-
type:
|
|
1095
|
-
})
|
|
1125
|
+
var RequestedCorrectionAction = ActionBase.extend(
|
|
1126
|
+
z12.object({
|
|
1127
|
+
type: z12.literal(ActionType.REQUEST_CORRECTION)
|
|
1128
|
+
}).shape
|
|
1096
1129
|
);
|
|
1097
|
-
var ApprovedCorrectionAction = ActionBase.
|
|
1098
|
-
|
|
1099
|
-
type:
|
|
1100
|
-
requestId:
|
|
1130
|
+
var ApprovedCorrectionAction = ActionBase.extend(
|
|
1131
|
+
z12.object({
|
|
1132
|
+
type: z12.literal(ActionType.APPROVE_CORRECTION),
|
|
1133
|
+
requestId: z12.string()
|
|
1101
1134
|
// TODO move into 'content' property
|
|
1102
|
-
})
|
|
1135
|
+
}).shape
|
|
1103
1136
|
);
|
|
1104
|
-
var RejectedCorrectionAction = ActionBase.
|
|
1105
|
-
|
|
1106
|
-
type:
|
|
1107
|
-
requestId:
|
|
1137
|
+
var RejectedCorrectionAction = ActionBase.extend(
|
|
1138
|
+
z12.object({
|
|
1139
|
+
type: z12.literal(ActionType.REJECT_CORRECTION),
|
|
1140
|
+
requestId: z12.string(),
|
|
1108
1141
|
// TODO move into 'content' property
|
|
1109
1142
|
content: ReasonContent
|
|
1110
|
-
})
|
|
1143
|
+
}).shape
|
|
1144
|
+
);
|
|
1145
|
+
var ReadAction = ActionBase.extend(
|
|
1146
|
+
z12.object({
|
|
1147
|
+
type: z12.literal(ActionType.READ)
|
|
1148
|
+
}).shape
|
|
1111
1149
|
);
|
|
1112
|
-
var
|
|
1113
|
-
|
|
1114
|
-
type:
|
|
1150
|
+
var CustomAction = ActionBase.merge(
|
|
1151
|
+
z12.object({
|
|
1152
|
+
type: z12.literal(ActionType.CUSTOM),
|
|
1153
|
+
customActionType: z12.string()
|
|
1115
1154
|
})
|
|
1116
1155
|
);
|
|
1117
|
-
var ActionDocument =
|
|
1118
|
-
CreatedAction.
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1156
|
+
var ActionDocument = z12.discriminatedUnion("type", [
|
|
1157
|
+
CreatedAction.meta({ id: "CreatedAction" }),
|
|
1158
|
+
RejectAction.meta({ id: "RejectAction" }),
|
|
1159
|
+
DuplicateDetectedAction.meta({ id: "DuplicateDetectedAction" }),
|
|
1160
|
+
MarkNotDuplicateAction.meta({ id: "MarkNotDuplicateAction" }),
|
|
1161
|
+
MarkAsDuplicateAction.meta({ id: "MarkAsDuplicateAction" }),
|
|
1162
|
+
ArchiveAction.meta({ id: "ArchiveAction" }),
|
|
1163
|
+
NotifiedAction.meta({ id: "NotifiedAction" }),
|
|
1164
|
+
RegisterAction.meta({ id: "RegisterAction" }),
|
|
1165
|
+
DeclareAction.meta({ id: "DeclareAction" }),
|
|
1166
|
+
AssignedAction.meta({ id: "AssignedAction" }),
|
|
1167
|
+
RequestedCorrectionAction.meta({ id: "RequestedCorrectionAction" }),
|
|
1168
|
+
ApprovedCorrectionAction.meta({ id: "ApprovedCorrectionAction" }),
|
|
1169
|
+
RejectedCorrectionAction.meta({ id: "RejectedCorrectionAction" }),
|
|
1170
|
+
UnassignedAction.meta({ id: "UnassignedAction" }),
|
|
1171
|
+
PrintCertificateAction.meta({ id: "PrintCertificateAction" }),
|
|
1172
|
+
ReadAction.meta({ id: "ReadAction" }),
|
|
1173
|
+
EditAction.meta({ id: "EditAction" }),
|
|
1174
|
+
CustomAction.meta({ id: "CustomAction" })
|
|
1175
|
+
]).meta({
|
|
1176
|
+
id: "ActionDocument"
|
|
1137
1177
|
});
|
|
1138
1178
|
var AsyncRejectActionDocument = ActionBase.omit({
|
|
1139
1179
|
declaration: true,
|
|
1140
1180
|
annotation: true
|
|
1141
|
-
}).
|
|
1142
|
-
|
|
1143
|
-
type:
|
|
1144
|
-
status:
|
|
1145
|
-
})
|
|
1181
|
+
}).extend(
|
|
1182
|
+
z12.object({
|
|
1183
|
+
type: z12.enum(ConfirmableActions),
|
|
1184
|
+
status: z12.literal(ActionStatus.Rejected)
|
|
1185
|
+
}).shape
|
|
1146
1186
|
);
|
|
1147
|
-
var Action =
|
|
1187
|
+
var Action = z12.union([ActionDocument, AsyncRejectActionDocument]);
|
|
1148
1188
|
|
|
1149
|
-
// ../commons/src/events/
|
|
1150
|
-
var
|
|
1151
|
-
"CREATED",
|
|
1152
|
-
"NOTIFIED",
|
|
1153
|
-
"DECLARED",
|
|
1154
|
-
"VALIDATED",
|
|
1155
|
-
"REGISTERED",
|
|
1156
|
-
"ARCHIVED"
|
|
1157
|
-
]);
|
|
1189
|
+
// ../commons/src/events/Flag.ts
|
|
1190
|
+
var z13 = __toESM(require("zod/v4"));
|
|
1158
1191
|
var InherentFlags = {
|
|
1159
1192
|
PENDING_CERTIFICATION: "pending-certification",
|
|
1160
1193
|
INCOMPLETE: "incomplete",
|
|
1161
1194
|
REJECTED: "rejected",
|
|
1162
1195
|
CORRECTION_REQUESTED: "correction-requested",
|
|
1163
|
-
POTENTIAL_DUPLICATE: "potential-duplicate"
|
|
1196
|
+
POTENTIAL_DUPLICATE: "potential-duplicate",
|
|
1197
|
+
/**
|
|
1198
|
+
* This flag is set by the Edit-action and removed after the declaration or registration.
|
|
1199
|
+
* A record should never stay with the EDIT_IN_PROGRESS flag, since it should always be declared or registered right after.
|
|
1200
|
+
*
|
|
1201
|
+
* We only use this flag to determine that a NOTIFY, DECLARE or REGISTER action is allowed next.
|
|
1202
|
+
*/
|
|
1203
|
+
EDIT_IN_PROGRESS: "edit-in-progress"
|
|
1164
1204
|
};
|
|
1165
|
-
var ActionFlag =
|
|
1205
|
+
var ActionFlag = z13.string().regex(
|
|
1166
1206
|
new RegExp(
|
|
1167
1207
|
`^(${Object.values(ActionType).join("|").toLowerCase()}):(${Object.values(
|
|
1168
1208
|
ActionStatus
|
|
@@ -1170,59 +1210,90 @@ var ActionFlag = import_zod13.z.string().regex(
|
|
|
1170
1210
|
),
|
|
1171
1211
|
"Flag must be in the format ActionType:ActionStatus (lowerCase)"
|
|
1172
1212
|
);
|
|
1173
|
-
var
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1213
|
+
var CustomFlag = z13.string().refine((val) => !Object.values(InherentFlags).includes(val), {
|
|
1214
|
+
message: `Custom flag cannot be one of the inherent flags: ${Object.values(
|
|
1215
|
+
InherentFlags
|
|
1216
|
+
).join(", ")}`
|
|
1217
|
+
}).refine((val) => !ActionFlag.safeParse(val).success, {
|
|
1218
|
+
message: "Custom flag cannot match the ActionFlag pattern (ActionType:ActionStatus)."
|
|
1219
|
+
}).describe("Custom flag identifier defined by the country config.");
|
|
1220
|
+
var Flag = ActionFlag.or(z13.enum(InherentFlags)).or(CustomFlag);
|
|
1221
|
+
var FlagConfig = z13.object({
|
|
1222
|
+
id: CustomFlag,
|
|
1223
|
+
requiresAction: z13.boolean().describe(
|
|
1224
|
+
"Indicates if this flag expects an action to be performed to be cleared."
|
|
1225
|
+
),
|
|
1226
|
+
label: TranslationConfig.describe("Human readable label of the flag.")
|
|
1227
|
+
});
|
|
1228
|
+
var ActionFlagConfig = z13.object({
|
|
1229
|
+
id: Flag,
|
|
1230
|
+
operation: z13.enum(["add", "remove"]).describe("Operation to perform on the flag."),
|
|
1231
|
+
conditional: Conditional.optional().describe(
|
|
1232
|
+
"When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
|
|
1233
|
+
)
|
|
1234
|
+
});
|
|
1235
|
+
|
|
1236
|
+
// ../commons/src/events/EventMetadata.ts
|
|
1237
|
+
var EventStatus = z14.enum([
|
|
1238
|
+
"CREATED",
|
|
1239
|
+
"NOTIFIED",
|
|
1240
|
+
"DECLARED",
|
|
1241
|
+
"REGISTERED",
|
|
1242
|
+
"ARCHIVED"
|
|
1243
|
+
]);
|
|
1244
|
+
var ZodDate = z14.iso.date();
|
|
1245
|
+
var ActionCreationMetadata = z14.object({
|
|
1246
|
+
createdAt: z14.iso.datetime().describe("The timestamp when the action request was created."),
|
|
1247
|
+
createdBy: z14.string().describe("ID of the user who created the action request."),
|
|
1178
1248
|
createdAtLocation: CreatedAtLocation.describe(
|
|
1179
1249
|
"Location of the user who created the action request."
|
|
1180
1250
|
),
|
|
1181
|
-
createdByUserType:
|
|
1182
|
-
acceptedAt:
|
|
1183
|
-
createdByRole:
|
|
1184
|
-
createdBySignature:
|
|
1251
|
+
createdByUserType: z14.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1252
|
+
acceptedAt: z14.iso.datetime().describe("Timestamp when the action request was accepted."),
|
|
1253
|
+
createdByRole: z14.string().describe("Role of the user at the time of action request creation."),
|
|
1254
|
+
createdBySignature: z14.string().nullish().describe("Signature of the user who created the action request.")
|
|
1185
1255
|
});
|
|
1186
1256
|
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
1187
|
-
registrationNumber:
|
|
1257
|
+
registrationNumber: z14.string().describe(
|
|
1188
1258
|
"Registration number of the event. Always present for accepted registrations."
|
|
1189
1259
|
)
|
|
1190
1260
|
});
|
|
1191
|
-
var LegalStatuses =
|
|
1261
|
+
var LegalStatuses = z14.object({
|
|
1192
1262
|
[EventStatus.enum.DECLARED]: ActionCreationMetadata.nullish(),
|
|
1193
1263
|
[EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish()
|
|
1194
1264
|
});
|
|
1195
|
-
var EventMetadata =
|
|
1265
|
+
var EventMetadata = z14.object({
|
|
1196
1266
|
id: UUID,
|
|
1197
|
-
type:
|
|
1267
|
+
type: z14.string().describe("The type of event, such as birth, death, or marriage."),
|
|
1198
1268
|
status: EventStatus,
|
|
1199
1269
|
legalStatuses: LegalStatuses.describe(
|
|
1200
1270
|
"Metadata related to the legal registration of the event, such as who registered it and when."
|
|
1201
1271
|
),
|
|
1202
|
-
createdAt:
|
|
1272
|
+
createdAt: z14.iso.datetime().describe("The timestamp when the event was first created and saved."),
|
|
1203
1273
|
dateOfEvent: ZodDate.nullish(),
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1274
|
+
placeOfEvent: CreatedAtLocation,
|
|
1275
|
+
createdBy: z14.string().describe("ID of the user who created the event."),
|
|
1276
|
+
createdByUserType: z14.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1277
|
+
updatedByUserRole: z14.string().describe("Role of the user who last changed the status."),
|
|
1207
1278
|
createdAtLocation: CreatedAtLocation.describe(
|
|
1208
1279
|
"Location of the user who created the event."
|
|
1209
1280
|
),
|
|
1210
|
-
createdBySignature:
|
|
1281
|
+
createdBySignature: z14.string().nullish().describe("Signature of the user who created the event."),
|
|
1211
1282
|
updatedAtLocation: UUID.nullish().describe(
|
|
1212
1283
|
"Location of the user who last changed the status."
|
|
1213
1284
|
),
|
|
1214
|
-
updatedAt:
|
|
1285
|
+
updatedAt: z14.iso.datetime().describe(
|
|
1215
1286
|
"Timestamp of the most recent *accepted* status change. Possibly 3rd party update, if action is validation asynchronously."
|
|
1216
1287
|
),
|
|
1217
|
-
assignedTo:
|
|
1218
|
-
updatedBy:
|
|
1219
|
-
trackingId:
|
|
1288
|
+
assignedTo: z14.string().nullish().describe("ID of the user currently assigned to the event."),
|
|
1289
|
+
updatedBy: z14.string().nullish().describe("ID of the user who last changed the status."),
|
|
1290
|
+
trackingId: z14.string().describe(
|
|
1220
1291
|
"System-generated tracking ID used by informants or registrars to look up the event."
|
|
1221
1292
|
),
|
|
1222
|
-
potentialDuplicates:
|
|
1293
|
+
potentialDuplicates: z14.array(PotentialDuplicate).describe(
|
|
1223
1294
|
"List of event IDs and their tracking IDs that this event could be a duplicate of."
|
|
1224
1295
|
),
|
|
1225
|
-
flags:
|
|
1296
|
+
flags: z14.array(Flag)
|
|
1226
1297
|
});
|
|
1227
1298
|
var EventMetadataKeysArray = [
|
|
1228
1299
|
"id",
|
|
@@ -1230,6 +1301,7 @@ var EventMetadataKeysArray = [
|
|
|
1230
1301
|
"status",
|
|
1231
1302
|
"createdAt",
|
|
1232
1303
|
"dateOfEvent",
|
|
1304
|
+
"placeOfEvent",
|
|
1233
1305
|
"createdBy",
|
|
1234
1306
|
"createdByUserType",
|
|
1235
1307
|
"updatedByUserRole",
|
|
@@ -1242,130 +1314,124 @@ var EventMetadataKeysArray = [
|
|
|
1242
1314
|
"legalStatuses",
|
|
1243
1315
|
"flags"
|
|
1244
1316
|
];
|
|
1245
|
-
var EventMetadataKeys =
|
|
1317
|
+
var EventMetadataKeys = z14.enum(EventMetadataKeysArray);
|
|
1246
1318
|
|
|
1247
1319
|
// ../commons/src/events/EventIndex.ts
|
|
1248
|
-
var import_zod_openapi5 = require("zod-openapi");
|
|
1249
|
-
(0, import_zod_openapi5.extendZodWithOpenApi)(import_zod14.z);
|
|
1250
1320
|
var EventIndex = EventMetadata.extend({
|
|
1251
1321
|
declaration: EventState
|
|
1252
|
-
}).
|
|
1253
|
-
|
|
1322
|
+
}).meta({
|
|
1323
|
+
id: "EventIndex"
|
|
1254
1324
|
});
|
|
1255
|
-
var EventSearchIndex =
|
|
1256
|
-
|
|
1257
|
-
type:
|
|
1325
|
+
var EventSearchIndex = import_v4.z.record(import_v4.z.string(), import_v4.z.any()).and(
|
|
1326
|
+
import_v4.z.object({
|
|
1327
|
+
type: import_v4.z.string()
|
|
1258
1328
|
// Ensures "type" (event-id) exists and is a string
|
|
1259
1329
|
})
|
|
1260
|
-
).
|
|
1261
|
-
|
|
1330
|
+
).meta({
|
|
1331
|
+
id: "EventSearchIndex"
|
|
1262
1332
|
});
|
|
1263
|
-
var Fuzzy =
|
|
1264
|
-
|
|
1333
|
+
var Fuzzy = import_v4.z.object({ type: import_v4.z.literal("fuzzy"), term: import_v4.z.string() }).meta({
|
|
1334
|
+
id: "Fuzzy"
|
|
1265
1335
|
});
|
|
1266
|
-
var Exact =
|
|
1267
|
-
|
|
1336
|
+
var Exact = import_v4.z.object({ type: import_v4.z.literal("exact"), term: import_v4.z.string() }).meta({
|
|
1337
|
+
id: "Exact"
|
|
1268
1338
|
});
|
|
1269
|
-
var ExactStatus =
|
|
1270
|
-
type:
|
|
1339
|
+
var ExactStatus = import_v4.z.object({
|
|
1340
|
+
type: import_v4.z.literal("exact"),
|
|
1271
1341
|
term: EventStatus
|
|
1272
|
-
}).
|
|
1273
|
-
|
|
1342
|
+
}).meta({
|
|
1343
|
+
id: "ExactStatus"
|
|
1274
1344
|
});
|
|
1275
|
-
var ExactUserType =
|
|
1276
|
-
type:
|
|
1345
|
+
var ExactUserType = import_v4.z.object({
|
|
1346
|
+
type: import_v4.z.literal("exact"),
|
|
1277
1347
|
term: TokenUserType
|
|
1278
|
-
}).
|
|
1279
|
-
|
|
1348
|
+
}).meta({
|
|
1349
|
+
id: "ExactUserType"
|
|
1280
1350
|
});
|
|
1281
|
-
var AnyOf =
|
|
1282
|
-
type:
|
|
1283
|
-
terms:
|
|
1284
|
-
}).
|
|
1285
|
-
|
|
1351
|
+
var AnyOf = import_v4.z.object({
|
|
1352
|
+
type: import_v4.z.literal("anyOf"),
|
|
1353
|
+
terms: import_v4.z.array(import_v4.z.string())
|
|
1354
|
+
}).meta({
|
|
1355
|
+
id: "AnyOf"
|
|
1286
1356
|
});
|
|
1287
|
-
var AnyOfStatus =
|
|
1288
|
-
type:
|
|
1289
|
-
terms:
|
|
1290
|
-
}).
|
|
1291
|
-
|
|
1357
|
+
var AnyOfStatus = import_v4.z.object({
|
|
1358
|
+
type: import_v4.z.literal("anyOf"),
|
|
1359
|
+
terms: import_v4.z.array(EventStatus)
|
|
1360
|
+
}).meta({
|
|
1361
|
+
id: "AnyOfStatus"
|
|
1292
1362
|
});
|
|
1293
|
-
var Range =
|
|
1294
|
-
type:
|
|
1295
|
-
gte:
|
|
1296
|
-
lte:
|
|
1297
|
-
}).
|
|
1298
|
-
|
|
1363
|
+
var Range = import_v4.z.object({
|
|
1364
|
+
type: import_v4.z.literal("range"),
|
|
1365
|
+
gte: import_v4.z.string(),
|
|
1366
|
+
lte: import_v4.z.string()
|
|
1367
|
+
}).meta({
|
|
1368
|
+
id: "Range"
|
|
1299
1369
|
});
|
|
1300
|
-
var ContainsFlags =
|
|
1301
|
-
anyOf:
|
|
1302
|
-
noneOf:
|
|
1303
|
-
}).
|
|
1304
|
-
|
|
1370
|
+
var ContainsFlags = import_v4.z.object({
|
|
1371
|
+
anyOf: import_v4.z.array(Flag).optional(),
|
|
1372
|
+
noneOf: import_v4.z.array(Flag).optional()
|
|
1373
|
+
}).meta({
|
|
1374
|
+
id: "ContainsFlags"
|
|
1305
1375
|
});
|
|
1306
|
-
var Within =
|
|
1307
|
-
|
|
1376
|
+
var Within = import_v4.z.object({ type: import_v4.z.literal("within"), location: import_v4.z.string() }).meta({
|
|
1377
|
+
id: "Within"
|
|
1308
1378
|
});
|
|
1309
|
-
var RangeDate =
|
|
1310
|
-
type:
|
|
1311
|
-
gte:
|
|
1312
|
-
lte:
|
|
1313
|
-
}).
|
|
1379
|
+
var RangeDate = import_v4.z.object({
|
|
1380
|
+
type: import_v4.z.literal("range"),
|
|
1381
|
+
gte: import_v4.z.iso.date().or(import_v4.z.iso.datetime()),
|
|
1382
|
+
lte: import_v4.z.iso.date().or(import_v4.z.iso.datetime())
|
|
1383
|
+
}).meta({ id: "RangeDate" });
|
|
1314
1384
|
var ExactDate = Exact.extend({
|
|
1315
|
-
term:
|
|
1316
|
-
}).
|
|
1317
|
-
|
|
1385
|
+
term: import_v4.z.iso.date().or(import_v4.z.iso.datetime())
|
|
1386
|
+
}).meta({
|
|
1387
|
+
id: "ExactDate"
|
|
1318
1388
|
});
|
|
1319
|
-
var TimePeriod =
|
|
1320
|
-
type:
|
|
1389
|
+
var TimePeriod = import_v4.z.object({
|
|
1390
|
+
type: import_v4.z.literal("timePeriod"),
|
|
1321
1391
|
term: SelectDateRangeValue
|
|
1322
|
-
}).
|
|
1323
|
-
|
|
1392
|
+
}).meta({
|
|
1393
|
+
id: "TimePeriod"
|
|
1324
1394
|
});
|
|
1325
|
-
var DateCondition =
|
|
1326
|
-
|
|
1395
|
+
var DateCondition = import_v4.z.union([ExactDate, RangeDate, TimePeriod]).meta({
|
|
1396
|
+
id: "DateCondition"
|
|
1327
1397
|
});
|
|
1328
|
-
var QueryInput =
|
|
1329
|
-
() =>
|
|
1330
|
-
|
|
1331
|
-
|
|
1398
|
+
var QueryInput = import_v4.z.lazy(
|
|
1399
|
+
() => import_v4.z.union([
|
|
1400
|
+
import_v4.z.discriminatedUnion("type", [Fuzzy, Exact, Range, Within, AnyOf]),
|
|
1401
|
+
import_v4.z.record(import_v4.z.string(), QueryInput)
|
|
1332
1402
|
])
|
|
1333
|
-
).
|
|
1334
|
-
|
|
1403
|
+
).meta({
|
|
1404
|
+
id: "QueryInput"
|
|
1335
1405
|
});
|
|
1336
|
-
var QueryExpression =
|
|
1337
|
-
id:
|
|
1338
|
-
eventType:
|
|
1339
|
-
status:
|
|
1340
|
-
createdAt:
|
|
1341
|
-
updatedAt:
|
|
1342
|
-
"legalStatuses.REGISTERED.acceptedAt":
|
|
1343
|
-
"legalStatuses.DECLARED.createdAtLocation":
|
|
1344
|
-
|
|
1345
|
-
),
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
),
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
createdBy: import_zod14.z.optional(Exact),
|
|
1355
|
-
updatedBy: import_zod14.z.optional(Exact),
|
|
1356
|
-
trackingId: import_zod14.z.optional(Exact),
|
|
1357
|
-
flags: import_zod14.z.optional(ContainsFlags),
|
|
1406
|
+
var QueryExpression = import_v4.z.object({
|
|
1407
|
+
id: import_v4.z.optional(import_v4.z.string()),
|
|
1408
|
+
eventType: import_v4.z.string(),
|
|
1409
|
+
status: import_v4.z.optional(import_v4.z.union([AnyOfStatus, ExactStatus])),
|
|
1410
|
+
createdAt: import_v4.z.optional(DateCondition),
|
|
1411
|
+
updatedAt: import_v4.z.optional(DateCondition),
|
|
1412
|
+
"legalStatuses.REGISTERED.acceptedAt": import_v4.z.optional(DateCondition),
|
|
1413
|
+
"legalStatuses.DECLARED.createdAtLocation": import_v4.z.optional(Within).nullable(),
|
|
1414
|
+
"legalStatuses.REGISTERED.createdAtLocation": import_v4.z.optional(Within).nullable(),
|
|
1415
|
+
"legalStatuses.REGISTERED.registrationNumber": import_v4.z.optional(Exact),
|
|
1416
|
+
createdAtLocation: import_v4.z.optional(Within),
|
|
1417
|
+
updatedAtLocation: import_v4.z.optional(Within),
|
|
1418
|
+
assignedTo: import_v4.z.optional(Exact),
|
|
1419
|
+
createdByUserType: import_v4.z.optional(ExactUserType),
|
|
1420
|
+
createdBy: import_v4.z.optional(Exact),
|
|
1421
|
+
updatedBy: import_v4.z.optional(Exact),
|
|
1422
|
+
trackingId: import_v4.z.optional(Exact),
|
|
1423
|
+
flags: import_v4.z.optional(ContainsFlags),
|
|
1358
1424
|
// @todo: The type for this comes out as "any"
|
|
1359
1425
|
data: QueryInput
|
|
1360
1426
|
}).partial().refine((obj) => Object.values(obj).some((val) => val !== void 0), {
|
|
1361
|
-
|
|
1362
|
-
}).
|
|
1363
|
-
|
|
1427
|
+
error: "At least one query field must be specified."
|
|
1428
|
+
}).meta({
|
|
1429
|
+
id: "QueryExpression"
|
|
1364
1430
|
});
|
|
1365
|
-
var QueryType =
|
|
1366
|
-
() =>
|
|
1367
|
-
type:
|
|
1368
|
-
clauses:
|
|
1431
|
+
var QueryType = import_v4.z.lazy(
|
|
1432
|
+
() => import_v4.z.object({
|
|
1433
|
+
type: import_v4.z.literal("and").or(import_v4.z.literal("or")).meta({ default: "and" }),
|
|
1434
|
+
clauses: import_v4.z.array(import_v4.z.union([QueryExpression, QueryType])).nonempty("At least one clause is required.").meta({
|
|
1369
1435
|
default: [
|
|
1370
1436
|
{
|
|
1371
1437
|
eventType: TENNIS_CLUB_MEMBERSHIP,
|
|
@@ -1383,8 +1449,8 @@ var QueryType = import_zod14.z.lazy(
|
|
|
1383
1449
|
]
|
|
1384
1450
|
})
|
|
1385
1451
|
})
|
|
1386
|
-
).
|
|
1387
|
-
|
|
1452
|
+
).meta({
|
|
1453
|
+
id: "QueryType"
|
|
1388
1454
|
});
|
|
1389
1455
|
function parseStringifiedQueryField(val) {
|
|
1390
1456
|
if (typeof val === "string") {
|
|
@@ -1392,8 +1458,8 @@ function parseStringifiedQueryField(val) {
|
|
|
1392
1458
|
}
|
|
1393
1459
|
return val;
|
|
1394
1460
|
}
|
|
1395
|
-
var SearchQuery =
|
|
1396
|
-
query:
|
|
1461
|
+
var SearchQuery = import_v4.z.object({
|
|
1462
|
+
query: import_v4.z.preprocess(parseStringifiedQueryField, QueryType).meta({
|
|
1397
1463
|
default: {
|
|
1398
1464
|
type: "and",
|
|
1399
1465
|
clauses: [
|
|
@@ -1413,190 +1479,184 @@ var SearchQuery = import_zod14.z.object({
|
|
|
1413
1479
|
]
|
|
1414
1480
|
}
|
|
1415
1481
|
}),
|
|
1416
|
-
limit:
|
|
1417
|
-
offset:
|
|
1418
|
-
sort:
|
|
1482
|
+
limit: import_v4.z.number().optional().default(100),
|
|
1483
|
+
offset: import_v4.z.number().optional().default(0),
|
|
1484
|
+
sort: import_v4.z.preprocess(
|
|
1419
1485
|
parseStringifiedQueryField,
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
field:
|
|
1423
|
-
direction:
|
|
1486
|
+
import_v4.z.array(
|
|
1487
|
+
import_v4.z.object({
|
|
1488
|
+
field: import_v4.z.string(),
|
|
1489
|
+
direction: import_v4.z.enum(["asc", "desc"]).default("asc")
|
|
1424
1490
|
})
|
|
1425
1491
|
)
|
|
1426
1492
|
).optional()
|
|
1427
|
-
}).
|
|
1428
|
-
|
|
1493
|
+
}).meta({
|
|
1494
|
+
id: "SearchQuery"
|
|
1429
1495
|
});
|
|
1430
1496
|
|
|
1431
1497
|
// ../commons/src/events/FieldConfig.ts
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
(val) => !val.includes("_"),
|
|
1442
|
-
(val) => ({
|
|
1443
|
-
message: `id: '${val}' must not contain underscores '_'`
|
|
1444
|
-
})
|
|
1445
|
-
).describe("Unique identifier for the field");
|
|
1446
|
-
var FieldReference = import_zod15.z.object({
|
|
1498
|
+
var FieldId = z16.string().superRefine((val, ctx) => {
|
|
1499
|
+
if (val.includes("_")) {
|
|
1500
|
+
ctx.addIssue({
|
|
1501
|
+
code: z16.ZodIssueCode.custom,
|
|
1502
|
+
message: `id: '${val}' must not contain underscores '_'`
|
|
1503
|
+
});
|
|
1504
|
+
}
|
|
1505
|
+
}).describe("Unique identifier for the field");
|
|
1506
|
+
var FieldReference = z16.object({
|
|
1447
1507
|
$$field: FieldId,
|
|
1448
|
-
$$subfield:
|
|
1508
|
+
$$subfield: z16.array(z16.string()).optional().describe(
|
|
1449
1509
|
'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
|
|
1450
1510
|
)
|
|
1451
1511
|
}).describe("Reference to a field by its ID");
|
|
1452
|
-
var ValidationConfig =
|
|
1512
|
+
var ValidationConfig = z16.object({
|
|
1453
1513
|
validator: Conditional,
|
|
1454
1514
|
message: TranslationConfig
|
|
1455
1515
|
});
|
|
1456
|
-
var requiredSchema =
|
|
1457
|
-
|
|
1458
|
-
|
|
1516
|
+
var requiredSchema = z16.union([
|
|
1517
|
+
z16.boolean(),
|
|
1518
|
+
z16.object({
|
|
1459
1519
|
message: TranslationConfig.describe("Custom required validation message")
|
|
1460
1520
|
})
|
|
1461
1521
|
]).default(false).optional();
|
|
1462
|
-
var BaseField =
|
|
1522
|
+
var BaseField = z16.object({
|
|
1463
1523
|
id: FieldId.describe("Unique identifier of the field."),
|
|
1464
1524
|
label: TranslationConfig.describe("Human-readable label of the field."),
|
|
1465
|
-
parent: FieldReference.or(
|
|
1525
|
+
parent: FieldReference.or(z16.array(FieldReference)).optional().describe(
|
|
1466
1526
|
"Reference to the parent field or fields. When a parent field changes, this field is reset."
|
|
1467
1527
|
),
|
|
1468
1528
|
required: requiredSchema.describe(
|
|
1469
1529
|
"Indicates whether the field is mandatory."
|
|
1470
1530
|
),
|
|
1471
|
-
conditionals:
|
|
1531
|
+
conditionals: z16.array(FieldConditional).default([]).optional().describe(
|
|
1472
1532
|
"Conditions determining when the field is shown or enabled. By default, the field is always shown and enabled."
|
|
1473
1533
|
),
|
|
1474
|
-
secured:
|
|
1534
|
+
secured: z16.boolean().default(false).optional().describe(
|
|
1475
1535
|
"Indicates whether the field is secured. Secured fields are not indexed for search and are only visible when explicitly assigned."
|
|
1476
1536
|
),
|
|
1477
1537
|
placeholder: TranslationConfig.optional(),
|
|
1478
|
-
validation:
|
|
1538
|
+
validation: z16.array(ValidationConfig).default([]).optional().describe("Additional validation rules applied to the field."),
|
|
1479
1539
|
helperText: TranslationConfig.optional(),
|
|
1480
|
-
hideLabel:
|
|
1481
|
-
uncorrectable:
|
|
1540
|
+
hideLabel: z16.boolean().default(false).optional(),
|
|
1541
|
+
uncorrectable: z16.boolean().default(false).optional().describe(
|
|
1482
1542
|
"Indicates whether the field can be modified during record correction."
|
|
1483
1543
|
),
|
|
1484
|
-
value: FieldReference.or(
|
|
1544
|
+
value: FieldReference.or(z16.array(FieldReference)).optional().describe(
|
|
1485
1545
|
"Reference to the source field or fields. When a value is defined, it is copied from the parent field when changed. If multiple references are provided, the first truthy value is used."
|
|
1486
1546
|
),
|
|
1487
|
-
analytics:
|
|
1547
|
+
analytics: z16.boolean().default(false).optional().describe(
|
|
1488
1548
|
"Indicates whether the field is included in analytics. When enabled, its value becomes available in the analytics dashboard."
|
|
1489
1549
|
)
|
|
1490
1550
|
}).describe("Common properties shared across all field types.");
|
|
1491
1551
|
var Divider = BaseField.extend({
|
|
1492
|
-
type:
|
|
1552
|
+
type: z16.literal(FieldType.DIVIDER)
|
|
1493
1553
|
});
|
|
1494
1554
|
var TextField = BaseField.extend({
|
|
1495
|
-
type:
|
|
1496
|
-
defaultValue:
|
|
1497
|
-
configuration:
|
|
1498
|
-
maxLength:
|
|
1499
|
-
type:
|
|
1555
|
+
type: z16.literal(FieldType.TEXT),
|
|
1556
|
+
defaultValue: z16.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1557
|
+
configuration: z16.object({
|
|
1558
|
+
maxLength: z16.number().optional().describe("Maximum length of the text"),
|
|
1559
|
+
type: z16.enum(["text", "password"]).optional(),
|
|
1500
1560
|
prefix: TranslationConfig.optional(),
|
|
1501
1561
|
postfix: TranslationConfig.optional()
|
|
1502
1562
|
}).default({ type: "text" }).optional()
|
|
1503
1563
|
}).describe("Text input");
|
|
1504
1564
|
var NumberField = BaseField.extend({
|
|
1505
|
-
type:
|
|
1565
|
+
type: z16.literal(FieldType.NUMBER),
|
|
1506
1566
|
defaultValue: NumberFieldValue.optional(),
|
|
1507
|
-
configuration:
|
|
1508
|
-
min:
|
|
1509
|
-
max:
|
|
1567
|
+
configuration: z16.object({
|
|
1568
|
+
min: z16.number().optional().describe("Minimum value"),
|
|
1569
|
+
max: z16.number().optional().describe("Maximum value"),
|
|
1510
1570
|
prefix: TranslationConfig.optional(),
|
|
1511
1571
|
postfix: TranslationConfig.optional()
|
|
1512
1572
|
}).optional()
|
|
1513
1573
|
}).describe("Number input");
|
|
1514
1574
|
var TextAreaField = BaseField.extend({
|
|
1515
|
-
type:
|
|
1575
|
+
type: z16.literal(FieldType.TEXTAREA),
|
|
1516
1576
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1517
|
-
configuration:
|
|
1518
|
-
maxLength:
|
|
1519
|
-
rows:
|
|
1520
|
-
cols:
|
|
1577
|
+
configuration: z16.object({
|
|
1578
|
+
maxLength: z16.number().optional().describe("Maximum length of the text"),
|
|
1579
|
+
rows: z16.number().optional().describe("Number of visible text lines"),
|
|
1580
|
+
cols: z16.number().optional().describe("Number of visible columns"),
|
|
1521
1581
|
prefix: TranslationConfig.optional(),
|
|
1522
1582
|
postfix: TranslationConfig.optional()
|
|
1523
1583
|
}).default({ rows: 4 }).optional()
|
|
1524
1584
|
}).describe("Multiline text input");
|
|
1525
|
-
var ImageMimeType =
|
|
1585
|
+
var ImageMimeType = z16.enum([
|
|
1526
1586
|
"image/png",
|
|
1527
1587
|
"image/jpg",
|
|
1528
1588
|
"image/jpeg",
|
|
1529
1589
|
"image/svg+xml"
|
|
1530
1590
|
]);
|
|
1531
|
-
var DocumentMimeType =
|
|
1591
|
+
var DocumentMimeType = z16.enum([
|
|
1532
1592
|
"application/pdf",
|
|
1533
1593
|
"application/msword",
|
|
1534
1594
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
1535
1595
|
"application/vnd.oasis.opendocument.text"
|
|
1536
1596
|
]);
|
|
1537
|
-
var MimeType =
|
|
1597
|
+
var MimeType = z16.enum([
|
|
1538
1598
|
...ImageMimeType.options,
|
|
1539
1599
|
...DocumentMimeType.options
|
|
1540
1600
|
]);
|
|
1541
1601
|
var DEFAULT_MAX_FILE_SIZE_BYTES = 5 * 1024 * 1024;
|
|
1542
1602
|
var SignatureField = BaseField.extend({
|
|
1543
|
-
type:
|
|
1603
|
+
type: z16.literal(FieldType.SIGNATURE),
|
|
1544
1604
|
signaturePromptLabel: TranslationConfig.describe(
|
|
1545
1605
|
"Title of the signature modal"
|
|
1546
1606
|
),
|
|
1547
1607
|
defaultValue: SignatureFieldValue.optional(),
|
|
1548
|
-
configuration:
|
|
1549
|
-
maxFileSize:
|
|
1608
|
+
configuration: z16.object({
|
|
1609
|
+
maxFileSize: z16.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1550
1610
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
|
1551
1611
|
}).default({
|
|
1552
1612
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1553
1613
|
})
|
|
1554
1614
|
}).describe("Signature input field");
|
|
1555
1615
|
var EmailField = BaseField.extend({
|
|
1556
|
-
type:
|
|
1557
|
-
configuration:
|
|
1558
|
-
maxLength:
|
|
1559
|
-
}).default({ maxLength:
|
|
1616
|
+
type: z16.literal(FieldType.EMAIL),
|
|
1617
|
+
configuration: z16.object({
|
|
1618
|
+
maxLength: z16.number().optional().describe("Maximum length of the text")
|
|
1619
|
+
}).default({ maxLength: 255 }).optional(),
|
|
1560
1620
|
defaultValue: NonEmptyTextValue.optional()
|
|
1561
1621
|
});
|
|
1562
1622
|
var DateField = BaseField.extend({
|
|
1563
|
-
type:
|
|
1623
|
+
type: z16.literal(FieldType.DATE),
|
|
1564
1624
|
defaultValue: DateValue.optional(),
|
|
1565
|
-
configuration:
|
|
1625
|
+
configuration: z16.object({
|
|
1566
1626
|
notice: TranslationConfig.describe(
|
|
1567
1627
|
"Text to display above the date input"
|
|
1568
1628
|
).optional()
|
|
1569
1629
|
}).optional()
|
|
1570
1630
|
}).describe("A single date input (yyyy-MM-dd)");
|
|
1571
1631
|
var AgeField = BaseField.extend({
|
|
1572
|
-
type:
|
|
1632
|
+
type: z16.literal(FieldType.AGE),
|
|
1573
1633
|
defaultValue: NumberFieldValue.optional(),
|
|
1574
|
-
configuration:
|
|
1634
|
+
configuration: z16.object({
|
|
1575
1635
|
asOfDate: FieldReference,
|
|
1576
1636
|
prefix: TranslationConfig.optional(),
|
|
1577
1637
|
postfix: TranslationConfig.optional()
|
|
1578
1638
|
})
|
|
1579
1639
|
}).describe("An age input field which uses the current date as the asOfDate");
|
|
1580
1640
|
var TimeField = BaseField.extend({
|
|
1581
|
-
type:
|
|
1641
|
+
type: z16.literal(FieldType.TIME),
|
|
1582
1642
|
defaultValue: TimeValue.optional(),
|
|
1583
|
-
configuration:
|
|
1584
|
-
use12HourFormat:
|
|
1643
|
+
configuration: z16.object({
|
|
1644
|
+
use12HourFormat: z16.boolean().optional().describe("Whether to use 12-hour format"),
|
|
1585
1645
|
notice: TranslationConfig.describe(
|
|
1586
1646
|
"Text to display above the time input"
|
|
1587
1647
|
).optional()
|
|
1588
1648
|
}).optional()
|
|
1589
1649
|
}).describe("A single date input (HH-mm)");
|
|
1590
1650
|
var DateRangeField = BaseField.extend({
|
|
1591
|
-
type:
|
|
1651
|
+
type: z16.literal(FieldType.DATE_RANGE),
|
|
1592
1652
|
defaultValue: DateRangeFieldValue.optional(),
|
|
1593
|
-
configuration:
|
|
1653
|
+
configuration: z16.object({
|
|
1594
1654
|
notice: TranslationConfig.describe(
|
|
1595
1655
|
"Text to display above the date input"
|
|
1596
1656
|
).optional()
|
|
1597
1657
|
}).optional()
|
|
1598
1658
|
}).describe("A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })");
|
|
1599
|
-
var HtmlFontVariant =
|
|
1659
|
+
var HtmlFontVariant = z16.enum([
|
|
1600
1660
|
"reg12",
|
|
1601
1661
|
"reg14",
|
|
1602
1662
|
"reg16",
|
|
@@ -1606,34 +1666,34 @@ var HtmlFontVariant = import_zod15.z.enum([
|
|
|
1606
1666
|
"h2",
|
|
1607
1667
|
"h1"
|
|
1608
1668
|
]);
|
|
1609
|
-
var ParagraphConfiguration =
|
|
1610
|
-
styles:
|
|
1669
|
+
var ParagraphConfiguration = z16.object({
|
|
1670
|
+
styles: z16.object({
|
|
1611
1671
|
fontVariant: HtmlFontVariant.optional().describe(
|
|
1612
1672
|
"Font variant to use for the paragraph text"
|
|
1613
1673
|
),
|
|
1614
|
-
hint:
|
|
1674
|
+
hint: z16.boolean().optional().describe("When true, paragraph is styled as a hint with grey color")
|
|
1615
1675
|
}).optional()
|
|
1616
1676
|
}).default({});
|
|
1617
1677
|
var Paragraph = BaseField.extend({
|
|
1618
|
-
type:
|
|
1678
|
+
type: z16.literal(FieldType.PARAGRAPH),
|
|
1619
1679
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1620
1680
|
configuration: ParagraphConfiguration
|
|
1621
1681
|
}).describe("A read-only HTML <p> paragraph");
|
|
1622
1682
|
var PageHeader = BaseField.extend({
|
|
1623
|
-
type:
|
|
1683
|
+
type: z16.literal(FieldType.PAGE_HEADER),
|
|
1624
1684
|
defaultValue: NonEmptyTextValue.optional()
|
|
1625
1685
|
}).describe("A read-only header component for form pages");
|
|
1626
1686
|
var File = BaseField.extend({
|
|
1627
|
-
type:
|
|
1687
|
+
type: z16.literal(FieldType.FILE),
|
|
1628
1688
|
defaultValue: FileFieldValue.optional(),
|
|
1629
|
-
configuration:
|
|
1630
|
-
maxFileSize:
|
|
1689
|
+
configuration: z16.object({
|
|
1690
|
+
maxFileSize: z16.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1631
1691
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature"),
|
|
1632
|
-
maxImageSize:
|
|
1633
|
-
targetSize:
|
|
1692
|
+
maxImageSize: z16.object({
|
|
1693
|
+
targetSize: z16.object({ width: z16.number(), height: z16.number() })
|
|
1634
1694
|
}).optional(),
|
|
1635
|
-
style:
|
|
1636
|
-
width:
|
|
1695
|
+
style: z16.object({
|
|
1696
|
+
width: z16.enum(["full", "auto"]).optional().describe(
|
|
1637
1697
|
"Whether the file upload button should take the full width of the container or not"
|
|
1638
1698
|
)
|
|
1639
1699
|
}).optional(),
|
|
@@ -1642,46 +1702,34 @@ var File = BaseField.extend({
|
|
|
1642
1702
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1643
1703
|
})
|
|
1644
1704
|
}).describe("File upload");
|
|
1645
|
-
var SelectOption =
|
|
1646
|
-
value:
|
|
1647
|
-
label:
|
|
1705
|
+
var SelectOption = z16.object({
|
|
1706
|
+
value: z16.string().describe("The value of the option"),
|
|
1707
|
+
label: z16.union([z16.string(), TranslationConfig]).describe("The label of the option")
|
|
1648
1708
|
});
|
|
1649
|
-
var NumberWithUnitField = BaseField.extend({
|
|
1650
|
-
type: import_zod15.z.literal(FieldType.NUMBER_WITH_UNIT),
|
|
1651
|
-
defaultValue: NumberWithUnitFieldValue.optional(),
|
|
1652
|
-
options: import_zod15.z.array(SelectOption).describe("A list of options for the unit select"),
|
|
1653
|
-
configuration: import_zod15.z.object({
|
|
1654
|
-
min: import_zod15.z.number().optional().describe("Minimum value of the number field"),
|
|
1655
|
-
max: import_zod15.z.number().optional().describe("Maximum value of the number field"),
|
|
1656
|
-
numberFieldPlaceholder: TranslationConfig.optional().describe(
|
|
1657
|
-
"Placeholder for the number field"
|
|
1658
|
-
)
|
|
1659
|
-
}).optional()
|
|
1660
|
-
}).describe("Number with unit input");
|
|
1661
1709
|
var RadioGroup = BaseField.extend({
|
|
1662
|
-
type:
|
|
1710
|
+
type: z16.literal(FieldType.RADIO_GROUP),
|
|
1663
1711
|
defaultValue: TextValue.optional(),
|
|
1664
|
-
options:
|
|
1665
|
-
configuration:
|
|
1666
|
-
styles:
|
|
1667
|
-
size:
|
|
1712
|
+
options: z16.array(SelectOption).describe("A list of options"),
|
|
1713
|
+
configuration: z16.object({
|
|
1714
|
+
styles: z16.object({
|
|
1715
|
+
size: z16.enum(["NORMAL", "LARGE"]).optional()
|
|
1668
1716
|
}).optional()
|
|
1669
1717
|
}).optional()
|
|
1670
1718
|
}).describe("Grouped radio options");
|
|
1671
1719
|
var BulletList = BaseField.extend({
|
|
1672
|
-
type:
|
|
1720
|
+
type: z16.literal(FieldType.BULLET_LIST),
|
|
1673
1721
|
defaultValue: TextValue.optional(),
|
|
1674
|
-
items:
|
|
1675
|
-
configuration:
|
|
1676
|
-
styles:
|
|
1722
|
+
items: z16.array(TranslationConfig).describe("A list of items"),
|
|
1723
|
+
configuration: z16.object({
|
|
1724
|
+
styles: z16.object({
|
|
1677
1725
|
fontVariant: HtmlFontVariant.optional()
|
|
1678
1726
|
}).optional()
|
|
1679
1727
|
}).default({})
|
|
1680
1728
|
}).describe("A list of bullet points");
|
|
1681
1729
|
var Select = BaseField.extend({
|
|
1682
|
-
type:
|
|
1730
|
+
type: z16.literal(FieldType.SELECT),
|
|
1683
1731
|
defaultValue: TextValue.optional(),
|
|
1684
|
-
options:
|
|
1732
|
+
options: z16.array(SelectOption).describe("A list of options"),
|
|
1685
1733
|
noOptionsMessage: TranslationConfig.optional().describe(
|
|
1686
1734
|
`
|
|
1687
1735
|
A translation configuration object used to display a message when no options are available.
|
|
@@ -1693,34 +1741,34 @@ var Select = BaseField.extend({
|
|
|
1693
1741
|
`
|
|
1694
1742
|
)
|
|
1695
1743
|
}).describe("Select input");
|
|
1696
|
-
var SelectDateRangeOption =
|
|
1744
|
+
var SelectDateRangeOption = z16.object({
|
|
1697
1745
|
value: SelectDateRangeValue.describe("The value of the option"),
|
|
1698
1746
|
label: TranslationConfig.describe("The label of the option")
|
|
1699
1747
|
});
|
|
1700
1748
|
var SelectDateRangeField = BaseField.extend({
|
|
1701
|
-
type:
|
|
1749
|
+
type: z16.literal(FieldType.SELECT_DATE_RANGE),
|
|
1702
1750
|
defaultValue: SelectDateRangeValue.optional(),
|
|
1703
|
-
options:
|
|
1751
|
+
options: z16.array(SelectDateRangeOption).describe("A list of options")
|
|
1704
1752
|
}).describe("Select input with date range options");
|
|
1705
|
-
var NameConfig =
|
|
1706
|
-
firstname:
|
|
1707
|
-
middlename:
|
|
1708
|
-
surname:
|
|
1753
|
+
var NameConfig = z16.object({
|
|
1754
|
+
firstname: z16.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
1755
|
+
middlename: z16.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
1756
|
+
surname: z16.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional()
|
|
1709
1757
|
});
|
|
1710
1758
|
var NameField = BaseField.extend({
|
|
1711
|
-
type:
|
|
1712
|
-
defaultValue:
|
|
1759
|
+
type: z16.literal(FieldType.NAME),
|
|
1760
|
+
defaultValue: z16.object({
|
|
1713
1761
|
firstname: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
1714
1762
|
middlename: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
1715
1763
|
surname: SerializedUserField.or(NonEmptyTextValue).optional()
|
|
1716
1764
|
}).optional(),
|
|
1717
|
-
configuration:
|
|
1765
|
+
configuration: z16.object({
|
|
1718
1766
|
name: NameConfig.default({
|
|
1719
1767
|
firstname: { required: true },
|
|
1720
1768
|
surname: { required: true }
|
|
1721
1769
|
}).optional(),
|
|
1722
|
-
order:
|
|
1723
|
-
maxLength:
|
|
1770
|
+
order: z16.array(z16.enum(["firstname", "middlename", "surname"])).optional(),
|
|
1771
|
+
maxLength: z16.number().optional().describe("Maximum length of the text"),
|
|
1724
1772
|
prefix: TranslationConfig.optional(),
|
|
1725
1773
|
postfix: TranslationConfig.optional()
|
|
1726
1774
|
}).default({
|
|
@@ -1732,51 +1780,51 @@ var NameField = BaseField.extend({
|
|
|
1732
1780
|
}).describe("Name input field");
|
|
1733
1781
|
var PhoneField = BaseField.extend({
|
|
1734
1782
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1735
|
-
type:
|
|
1783
|
+
type: z16.literal(FieldType.PHONE)
|
|
1736
1784
|
}).describe("Phone input field");
|
|
1737
1785
|
var IdField = BaseField.extend({
|
|
1738
1786
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1739
|
-
type:
|
|
1787
|
+
type: z16.literal(FieldType.ID)
|
|
1740
1788
|
}).describe("ID input field");
|
|
1741
1789
|
var Checkbox = BaseField.extend({
|
|
1742
|
-
type:
|
|
1790
|
+
type: z16.literal(FieldType.CHECKBOX),
|
|
1743
1791
|
defaultValue: CheckboxFieldValue.default(false)
|
|
1744
1792
|
}).describe("Boolean checkbox field");
|
|
1745
1793
|
var Country = BaseField.extend({
|
|
1746
|
-
type:
|
|
1794
|
+
type: z16.literal(FieldType.COUNTRY),
|
|
1747
1795
|
defaultValue: NonEmptyTextValue.optional()
|
|
1748
1796
|
}).describe("Country select field");
|
|
1749
|
-
var AdministrativeAreas =
|
|
1797
|
+
var AdministrativeAreas = z16.enum([
|
|
1750
1798
|
"ADMIN_STRUCTURE",
|
|
1751
1799
|
"HEALTH_FACILITY",
|
|
1752
1800
|
"CRVS_OFFICE"
|
|
1753
1801
|
]);
|
|
1754
|
-
var AdministrativeAreaConfiguration =
|
|
1755
|
-
partOf:
|
|
1756
|
-
$declaration:
|
|
1802
|
+
var AdministrativeAreaConfiguration = z16.object({
|
|
1803
|
+
partOf: z16.object({
|
|
1804
|
+
$declaration: z16.string()
|
|
1757
1805
|
}).optional().describe("Parent location"),
|
|
1758
1806
|
type: AdministrativeAreas
|
|
1759
1807
|
}).describe("Administrative area options");
|
|
1760
1808
|
var AdministrativeArea = BaseField.extend({
|
|
1761
|
-
type:
|
|
1809
|
+
type: z16.literal(FieldType.ADMINISTRATIVE_AREA),
|
|
1762
1810
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1763
1811
|
configuration: AdministrativeAreaConfiguration
|
|
1764
1812
|
}).describe("Administrative area input field e.g. facility, office");
|
|
1765
1813
|
var LocationInput = BaseField.extend({
|
|
1766
|
-
type:
|
|
1814
|
+
type: z16.literal(FieldType.LOCATION),
|
|
1767
1815
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1768
|
-
configuration:
|
|
1769
|
-
searchableResource:
|
|
1816
|
+
configuration: z16.object({
|
|
1817
|
+
searchableResource: z16.array(z16.enum(["locations", "facilities", "offices"]))
|
|
1770
1818
|
})
|
|
1771
1819
|
}).describe("Input field for a location");
|
|
1772
1820
|
var FileUploadWithOptions = BaseField.extend({
|
|
1773
|
-
type:
|
|
1774
|
-
options:
|
|
1821
|
+
type: z16.literal(FieldType.FILE_WITH_OPTIONS),
|
|
1822
|
+
options: z16.array(SelectOption).describe("A list of options"),
|
|
1775
1823
|
defaultValue: FileFieldWithOptionValue.optional(),
|
|
1776
|
-
configuration:
|
|
1777
|
-
maxFileSize:
|
|
1778
|
-
maxImageSize:
|
|
1779
|
-
targetSize:
|
|
1824
|
+
configuration: z16.object({
|
|
1825
|
+
maxFileSize: z16.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1826
|
+
maxImageSize: z16.object({
|
|
1827
|
+
targetSize: z16.object({ width: z16.number(), height: z16.number() })
|
|
1780
1828
|
}).optional(),
|
|
1781
1829
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
|
1782
1830
|
}).default({
|
|
@@ -1784,93 +1832,93 @@ var FileUploadWithOptions = BaseField.extend({
|
|
|
1784
1832
|
})
|
|
1785
1833
|
});
|
|
1786
1834
|
var Facility = BaseField.extend({
|
|
1787
|
-
type:
|
|
1835
|
+
type: z16.literal(FieldType.FACILITY),
|
|
1788
1836
|
defaultValue: NonEmptyTextValue.optional()
|
|
1789
1837
|
}).describe("Input field for a facility");
|
|
1790
1838
|
var Office = BaseField.extend({
|
|
1791
|
-
type:
|
|
1839
|
+
type: z16.literal(FieldType.OFFICE),
|
|
1792
1840
|
defaultValue: NonEmptyTextValue.optional()
|
|
1793
1841
|
}).describe("Input field for an office");
|
|
1794
1842
|
var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
|
|
1795
|
-
administrativeArea:
|
|
1843
|
+
administrativeArea: z16.union([UUID, SerializedUserField]).optional()
|
|
1796
1844
|
});
|
|
1797
1845
|
var Address = BaseField.extend({
|
|
1798
|
-
type:
|
|
1799
|
-
configuration:
|
|
1800
|
-
lineSeparator:
|
|
1801
|
-
fields:
|
|
1802
|
-
administrativeLevels:
|
|
1803
|
-
streetAddressForm:
|
|
1804
|
-
|
|
1805
|
-
id:
|
|
1846
|
+
type: z16.literal(FieldType.ADDRESS),
|
|
1847
|
+
configuration: z16.object({
|
|
1848
|
+
lineSeparator: z16.string().optional(),
|
|
1849
|
+
fields: z16.array(z16.enum(["country", "administrativeArea"])).optional(),
|
|
1850
|
+
administrativeLevels: z16.array(z16.string()).optional(),
|
|
1851
|
+
streetAddressForm: z16.array(
|
|
1852
|
+
z16.object({
|
|
1853
|
+
id: z16.string(),
|
|
1806
1854
|
required: requiredSchema,
|
|
1807
1855
|
label: TranslationConfig,
|
|
1808
|
-
type:
|
|
1809
|
-
conditionals:
|
|
1856
|
+
type: z16.literal(FieldType.TEXT),
|
|
1857
|
+
conditionals: z16.array(FieldConditional).default([]).optional(),
|
|
1810
1858
|
parent: FieldReference.optional()
|
|
1811
1859
|
})
|
|
1812
1860
|
).optional()
|
|
1813
1861
|
}).optional(),
|
|
1814
1862
|
defaultValue: DefaultAddressFieldValue.optional()
|
|
1815
1863
|
}).describe("Address input field \u2013 a combination of location and text fields");
|
|
1816
|
-
var StaticDataEntry =
|
|
1817
|
-
id:
|
|
1864
|
+
var StaticDataEntry = z16.object({
|
|
1865
|
+
id: z16.string().describe("ID for the data entry."),
|
|
1818
1866
|
label: TranslationConfig,
|
|
1819
|
-
value: TranslationConfig.or(
|
|
1867
|
+
value: TranslationConfig.or(z16.string()).or(FieldReference)
|
|
1820
1868
|
}).describe("Static data entry");
|
|
1821
|
-
var DataEntry =
|
|
1869
|
+
var DataEntry = z16.union([StaticDataEntry, z16.object({ fieldId: z16.string() })]).describe(
|
|
1822
1870
|
"Data entry can be either a static data entry, or a reference to another field in the current form or the declaration."
|
|
1823
1871
|
);
|
|
1824
1872
|
var DataField = BaseField.extend({
|
|
1825
|
-
type:
|
|
1826
|
-
configuration:
|
|
1873
|
+
type: z16.literal(FieldType.DATA),
|
|
1874
|
+
configuration: z16.object({
|
|
1827
1875
|
subtitle: TranslationConfig.optional(),
|
|
1828
|
-
data:
|
|
1876
|
+
data: z16.array(DataEntry)
|
|
1829
1877
|
})
|
|
1830
1878
|
}).describe("Data field for displaying read-only data");
|
|
1831
1879
|
var ButtonField = BaseField.extend({
|
|
1832
|
-
type:
|
|
1880
|
+
type: z16.literal(FieldType.BUTTON),
|
|
1833
1881
|
defaultValue: ButtonFieldValue.optional(),
|
|
1834
|
-
configuration:
|
|
1835
|
-
icon:
|
|
1882
|
+
configuration: z16.object({
|
|
1883
|
+
icon: z16.string().optional().describe(
|
|
1836
1884
|
"Icon for the button. You can find icons from OpenCRVS UI-Kit."
|
|
1837
1885
|
),
|
|
1838
|
-
loading:
|
|
1886
|
+
loading: z16.boolean().optional().describe("Whether the button is in a loading state and shows a spinner"),
|
|
1839
1887
|
text: TranslationConfig.describe("Text to display on the button")
|
|
1840
1888
|
})
|
|
1841
1889
|
}).describe("Generic button without any built-in functionality");
|
|
1842
1890
|
var AlphaPrintButton = BaseField.extend({
|
|
1843
|
-
type:
|
|
1844
|
-
configuration:
|
|
1845
|
-
template:
|
|
1891
|
+
type: z16.literal(FieldType.ALPHA_PRINT_BUTTON),
|
|
1892
|
+
configuration: z16.object({
|
|
1893
|
+
template: z16.string().describe("Template ID from countryconfig templates to use for printing"),
|
|
1846
1894
|
buttonLabel: TranslationConfig.optional().describe(
|
|
1847
1895
|
"Label for the print button"
|
|
1848
1896
|
)
|
|
1849
1897
|
})
|
|
1850
1898
|
}).describe("Print button field for printing certificates");
|
|
1851
1899
|
var HttpField = BaseField.extend({
|
|
1852
|
-
type:
|
|
1900
|
+
type: z16.literal(FieldType.HTTP),
|
|
1853
1901
|
defaultValue: HttpFieldValue.optional(),
|
|
1854
|
-
configuration:
|
|
1902
|
+
configuration: z16.object({
|
|
1855
1903
|
trigger: FieldReference,
|
|
1856
|
-
url:
|
|
1857
|
-
method:
|
|
1858
|
-
headers:
|
|
1859
|
-
body:
|
|
1860
|
-
errorValue:
|
|
1861
|
-
params:
|
|
1862
|
-
timeout:
|
|
1904
|
+
url: z16.string().describe("URL to send the HTTP request to"),
|
|
1905
|
+
method: z16.enum(["GET", "POST", "PUT", "DELETE"]),
|
|
1906
|
+
headers: z16.record(z16.string(), z16.string()).optional(),
|
|
1907
|
+
body: z16.record(z16.string(), z16.any()).optional(),
|
|
1908
|
+
errorValue: z16.any().optional().describe("Value to set if the request fails"),
|
|
1909
|
+
params: z16.record(z16.string(), z16.union([z16.string(), FieldReference])).optional(),
|
|
1910
|
+
timeout: z16.number().default(15e3).describe("Request timeout in milliseconds")
|
|
1863
1911
|
})
|
|
1864
1912
|
}).describe("HTTP request function triggered by a button click or other event");
|
|
1865
1913
|
var SearchField = HttpField.extend({
|
|
1866
|
-
type:
|
|
1914
|
+
type: z16.literal(FieldType.SEARCH),
|
|
1867
1915
|
configuration: SearchQuery.pick({
|
|
1868
1916
|
query: true,
|
|
1869
1917
|
limit: true,
|
|
1870
1918
|
offset: true
|
|
1871
1919
|
}).extend({
|
|
1872
1920
|
validation: ValidationConfig,
|
|
1873
|
-
indicators:
|
|
1921
|
+
indicators: z16.object({
|
|
1874
1922
|
loading: TranslationConfig.optional().describe(
|
|
1875
1923
|
"Text to display while the search is in progress"
|
|
1876
1924
|
),
|
|
@@ -1885,7 +1933,7 @@ var SearchField = HttpField.extend({
|
|
|
1885
1933
|
),
|
|
1886
1934
|
confirmButton: TranslationConfig.optional(),
|
|
1887
1935
|
clearButton: TranslationConfig.optional(),
|
|
1888
|
-
clearModal:
|
|
1936
|
+
clearModal: z16.object({
|
|
1889
1937
|
title: TranslationConfig.optional(),
|
|
1890
1938
|
description: TranslationConfig.optional(),
|
|
1891
1939
|
cancel: TranslationConfig.optional(),
|
|
@@ -1896,17 +1944,17 @@ var SearchField = HttpField.extend({
|
|
|
1896
1944
|
})
|
|
1897
1945
|
});
|
|
1898
1946
|
var LinkButtonField = BaseField.extend({
|
|
1899
|
-
type:
|
|
1900
|
-
configuration:
|
|
1901
|
-
url:
|
|
1947
|
+
type: z16.literal(FieldType.LINK_BUTTON),
|
|
1948
|
+
configuration: z16.object({
|
|
1949
|
+
url: z16.string().describe("URL to open"),
|
|
1902
1950
|
text: TranslationConfig.describe("Text to display on the button"),
|
|
1903
|
-
icon:
|
|
1951
|
+
icon: z16.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit.")
|
|
1904
1952
|
})
|
|
1905
1953
|
}).describe("Button that opens a link");
|
|
1906
1954
|
var VerificationStatus = BaseField.extend({
|
|
1907
|
-
type:
|
|
1955
|
+
type: z16.literal(FieldType.VERIFICATION_STATUS),
|
|
1908
1956
|
defaultValue: VerificationStatusValue.optional(),
|
|
1909
|
-
configuration:
|
|
1957
|
+
configuration: z16.object({
|
|
1910
1958
|
status: TranslationConfig.describe("Text to display on the status pill."),
|
|
1911
1959
|
description: TranslationConfig.describe(
|
|
1912
1960
|
"Explaining text on the banner in form."
|
|
@@ -1914,42 +1962,58 @@ var VerificationStatus = BaseField.extend({
|
|
|
1914
1962
|
})
|
|
1915
1963
|
});
|
|
1916
1964
|
var QueryParamReaderField = BaseField.extend({
|
|
1917
|
-
type:
|
|
1918
|
-
configuration:
|
|
1919
|
-
pickParams:
|
|
1965
|
+
type: z16.literal(FieldType.QUERY_PARAM_READER),
|
|
1966
|
+
configuration: z16.object({
|
|
1967
|
+
pickParams: z16.array(z16.string()).describe("List of query parameters to read from the URL")
|
|
1920
1968
|
})
|
|
1921
1969
|
}).describe(
|
|
1922
1970
|
"A field that maps URL query params into form values and clears them afterward"
|
|
1923
1971
|
);
|
|
1924
1972
|
var QrReaderField = BaseField.extend({
|
|
1925
|
-
type:
|
|
1973
|
+
type: z16.literal(FieldType.QR_READER),
|
|
1926
1974
|
defaultValue: QrReaderFieldValue.optional(),
|
|
1927
|
-
configuration:
|
|
1928
|
-
validator:
|
|
1929
|
-
|
|
1930
|
-
|
|
1975
|
+
configuration: z16.object({
|
|
1976
|
+
validator: z16.any().meta({
|
|
1977
|
+
description: "JSON Schema to validate the scanned QR code data against before populating the form fields.",
|
|
1978
|
+
id: "QrReaderFieldValidator"
|
|
1979
|
+
})
|
|
1931
1980
|
}).optional()
|
|
1981
|
+
}).meta({
|
|
1982
|
+
description: "Configuration for QR code reader field, including optional JSON Schema validator.",
|
|
1983
|
+
id: "QrReaderField"
|
|
1932
1984
|
});
|
|
1933
1985
|
var IdReaderField = BaseField.extend({
|
|
1934
|
-
type:
|
|
1986
|
+
type: z16.literal(FieldType.ID_READER),
|
|
1935
1987
|
defaultValue: IdReaderFieldValue.optional(),
|
|
1936
|
-
methods:
|
|
1937
|
-
|
|
1988
|
+
methods: z16.array(
|
|
1989
|
+
z16.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
|
|
1938
1990
|
)
|
|
1939
1991
|
});
|
|
1992
|
+
var CustomField = BaseField.extend({
|
|
1993
|
+
type: z16.literal(FieldType._EXPERIMENTAL_CUSTOM),
|
|
1994
|
+
defaultValue: CustomFieldValue.optional(),
|
|
1995
|
+
src: z16.string().describe("Module source path for the custom field component"),
|
|
1996
|
+
configuration: z16.unknown().optional()
|
|
1997
|
+
});
|
|
1940
1998
|
var LoaderField = BaseField.extend({
|
|
1941
|
-
type:
|
|
1942
|
-
configuration:
|
|
1999
|
+
type: z16.literal(FieldType.LOADER),
|
|
2000
|
+
configuration: z16.object({
|
|
1943
2001
|
text: TranslationConfig.describe("Display text above the loading spinner")
|
|
1944
2002
|
})
|
|
1945
2003
|
}).describe(
|
|
1946
2004
|
"A non-interactive field that indicates an in progress operation in form"
|
|
1947
2005
|
);
|
|
1948
|
-
var
|
|
2006
|
+
var HiddenField = BaseField.extend({
|
|
2007
|
+
type: z16.literal(FieldType.ALPHA_HIDDEN),
|
|
2008
|
+
required: z16.boolean().default(false).optional(),
|
|
2009
|
+
defaultValue: TextValue.optional()
|
|
2010
|
+
}).describe(
|
|
2011
|
+
"A non-interactive, hidden field that only hold a value in the form"
|
|
2012
|
+
);
|
|
2013
|
+
var FieldConfig = z16.discriminatedUnion("type", [
|
|
1949
2014
|
Address,
|
|
1950
2015
|
TextField,
|
|
1951
2016
|
NumberField,
|
|
1952
|
-
NumberWithUnitField,
|
|
1953
2017
|
TextAreaField,
|
|
1954
2018
|
AgeField,
|
|
1955
2019
|
DateField,
|
|
@@ -1985,83 +2049,81 @@ var FieldConfig = import_zod15.z.discriminatedUnion("type", [
|
|
|
1985
2049
|
IdReaderField,
|
|
1986
2050
|
QueryParamReaderField,
|
|
1987
2051
|
LoaderField,
|
|
1988
|
-
SearchField
|
|
1989
|
-
|
|
2052
|
+
SearchField,
|
|
2053
|
+
CustomField,
|
|
2054
|
+
HiddenField
|
|
2055
|
+
]).meta({
|
|
1990
2056
|
description: "Form field configuration",
|
|
1991
|
-
|
|
2057
|
+
id: "FieldConfig"
|
|
1992
2058
|
});
|
|
1993
|
-
var AnyFileField =
|
|
2059
|
+
var AnyFileField = z16.discriminatedUnion("type", [
|
|
1994
2060
|
SignatureField,
|
|
1995
2061
|
File,
|
|
1996
2062
|
FileUploadWithOptions
|
|
1997
2063
|
]);
|
|
1998
2064
|
|
|
1999
2065
|
// ../commons/src/events/FormConfig.ts
|
|
2000
|
-
var
|
|
2066
|
+
var z18 = __toESM(require("zod/v4"));
|
|
2001
2067
|
|
|
2002
2068
|
// ../commons/src/events/PageConfig.ts
|
|
2003
|
-
var
|
|
2004
|
-
var
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
var PageConfigBase = import_zod16.z.object({
|
|
2008
|
-
id: import_zod16.z.string().describe("Unique identifier for the page"),
|
|
2069
|
+
var z17 = __toESM(require("zod/v4"));
|
|
2070
|
+
var PageTypes = z17.enum(["FORM", "VERIFICATION"]);
|
|
2071
|
+
var PageConfigBase = z17.object({
|
|
2072
|
+
id: z17.string().describe("Unique identifier for the page"),
|
|
2009
2073
|
title: TranslationConfig.describe("Header title of the page"),
|
|
2010
|
-
requireCompletionToContinue:
|
|
2074
|
+
requireCompletionToContinue: z17.boolean().default(false).describe(
|
|
2011
2075
|
"If true, all required fields must be filled before continuing to the next page"
|
|
2012
2076
|
),
|
|
2013
|
-
fields:
|
|
2077
|
+
fields: z17.array(FieldConfig).describe("Fields to be rendered on the page"),
|
|
2014
2078
|
conditional: Conditional.optional().describe(
|
|
2015
2079
|
"Page will be shown if condition is met. If conditional is not defined, the page will be always shown."
|
|
2016
2080
|
)
|
|
2017
|
-
}).
|
|
2081
|
+
}).meta({
|
|
2018
2082
|
description: "Form page configuration",
|
|
2019
|
-
|
|
2083
|
+
id: "FormPageConfig"
|
|
2020
2084
|
});
|
|
2021
2085
|
var FormPageConfig = PageConfigBase.extend({
|
|
2022
|
-
type:
|
|
2086
|
+
type: z17.literal(PageTypes.enum.FORM).default(PageTypes.enum.FORM)
|
|
2023
2087
|
});
|
|
2024
|
-
var VerificationActionConfig =
|
|
2025
|
-
verify:
|
|
2026
|
-
cancel:
|
|
2088
|
+
var VerificationActionConfig = z17.object({
|
|
2089
|
+
verify: z17.object({ label: TranslationConfig }),
|
|
2090
|
+
cancel: z17.object({
|
|
2027
2091
|
label: TranslationConfig,
|
|
2028
|
-
confirmation:
|
|
2092
|
+
confirmation: z17.object({
|
|
2029
2093
|
title: TranslationConfig,
|
|
2030
2094
|
body: TranslationConfig
|
|
2031
2095
|
})
|
|
2032
2096
|
})
|
|
2033
|
-
}).describe("Actions available on the verification page").
|
|
2097
|
+
}).describe("Actions available on the verification page").meta({
|
|
2034
2098
|
description: "Verification action configuration",
|
|
2035
|
-
|
|
2099
|
+
id: "VerificationActionConfig"
|
|
2036
2100
|
});
|
|
2037
2101
|
var VerificationPageConfig = FormPageConfig.extend({
|
|
2038
|
-
type:
|
|
2102
|
+
type: z17.literal(PageTypes.enum.VERIFICATION),
|
|
2039
2103
|
actions: VerificationActionConfig
|
|
2040
2104
|
});
|
|
2041
|
-
var PageConfig =
|
|
2105
|
+
var PageConfig = z17.discriminatedUnion("type", [
|
|
2042
2106
|
FormPageConfig,
|
|
2043
2107
|
VerificationPageConfig
|
|
2044
2108
|
]);
|
|
2045
2109
|
|
|
2046
2110
|
// ../commons/src/events/FormConfig.ts
|
|
2047
|
-
var DeclarationFormConfig =
|
|
2111
|
+
var DeclarationFormConfig = z18.object({
|
|
2048
2112
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2049
|
-
pages:
|
|
2113
|
+
pages: z18.array(FormPageConfig)
|
|
2050
2114
|
}).describe("Configuration of the declaration form.");
|
|
2051
|
-
var ActionFormConfig =
|
|
2115
|
+
var ActionFormConfig = z18.object({
|
|
2052
2116
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2053
|
-
pages:
|
|
2117
|
+
pages: z18.array(PageConfig)
|
|
2054
2118
|
}).describe(
|
|
2055
2119
|
"Configuration of the form used for system actions beyond declaration, supporting a wider range of page types."
|
|
2056
2120
|
);
|
|
2057
|
-
var FormConfig =
|
|
2121
|
+
var FormConfig = z18.union([DeclarationFormConfig, ActionFormConfig]);
|
|
2058
2122
|
|
|
2059
2123
|
// ../commons/src/events/DeduplicationConfig.ts
|
|
2060
|
-
var
|
|
2061
|
-
var
|
|
2062
|
-
|
|
2063
|
-
var FieldReference2 = import_zod18.z.string();
|
|
2064
|
-
var Matcher = import_zod18.z.object({
|
|
2124
|
+
var z19 = __toESM(require("zod/v4"));
|
|
2125
|
+
var FieldReference2 = z19.string();
|
|
2126
|
+
var Matcher = z19.object({
|
|
2065
2127
|
/**
|
|
2066
2128
|
* Reference to the field used in matching.
|
|
2067
2129
|
*
|
|
@@ -2069,68 +2131,68 @@ var Matcher = import_zod18.z.object({
|
|
|
2069
2131
|
* be used as the origin date to calculate the distance from.
|
|
2070
2132
|
*/
|
|
2071
2133
|
fieldId: FieldReference2,
|
|
2072
|
-
options:
|
|
2073
|
-
boost:
|
|
2134
|
+
options: z19.object({
|
|
2135
|
+
boost: z19.number().optional()
|
|
2074
2136
|
}).optional().default({
|
|
2075
2137
|
boost: 1
|
|
2076
2138
|
})
|
|
2077
2139
|
});
|
|
2078
2140
|
var FuzzyMatcher = Matcher.extend({
|
|
2079
|
-
type:
|
|
2080
|
-
options:
|
|
2141
|
+
type: z19.literal("fuzzy"),
|
|
2142
|
+
options: z19.object({
|
|
2081
2143
|
/**
|
|
2082
2144
|
* Names of length 3 or less characters = 0 edits allowed
|
|
2083
2145
|
* Names of length 4 - 6 characters = 1 edit allowed
|
|
2084
2146
|
* Names of length >7 characters = 2 edits allowed
|
|
2085
2147
|
*/
|
|
2086
|
-
fuzziness:
|
|
2087
|
-
boost:
|
|
2148
|
+
fuzziness: z19.union([z19.string(), z19.number()]).optional().default("AUTO:4,7"),
|
|
2149
|
+
boost: z19.number().optional().default(1)
|
|
2088
2150
|
}).optional().default({
|
|
2089
2151
|
fuzziness: "AUTO:4,7",
|
|
2090
2152
|
boost: 1
|
|
2091
2153
|
})
|
|
2092
2154
|
});
|
|
2093
2155
|
var StrictMatcher = Matcher.extend({
|
|
2094
|
-
type:
|
|
2095
|
-
options:
|
|
2096
|
-
boost:
|
|
2156
|
+
type: z19.literal("strict"),
|
|
2157
|
+
options: z19.object({
|
|
2158
|
+
boost: z19.number().optional().default(1),
|
|
2097
2159
|
/**
|
|
2098
2160
|
* The constant value to be present in the field for both records
|
|
2099
2161
|
*/
|
|
2100
|
-
value:
|
|
2162
|
+
value: z19.string().optional()
|
|
2101
2163
|
}).optional().default({
|
|
2102
2164
|
boost: 1
|
|
2103
2165
|
})
|
|
2104
2166
|
});
|
|
2105
2167
|
var DateRangeMatcher = Matcher.extend({
|
|
2106
|
-
type:
|
|
2107
|
-
options:
|
|
2168
|
+
type: z19.literal("dateRange"),
|
|
2169
|
+
options: z19.object({
|
|
2108
2170
|
/**
|
|
2109
2171
|
* The distance pivot in days. Distance from the origin (the value of
|
|
2110
2172
|
* fieldId) at which relevance scores receive half of the boost value
|
|
2111
2173
|
*/
|
|
2112
|
-
pivot:
|
|
2113
|
-
days:
|
|
2114
|
-
boost:
|
|
2174
|
+
pivot: z19.number().optional(),
|
|
2175
|
+
days: z19.number(),
|
|
2176
|
+
boost: z19.number().optional().default(1)
|
|
2115
2177
|
})
|
|
2116
2178
|
});
|
|
2117
|
-
var Not =
|
|
2118
|
-
type:
|
|
2179
|
+
var Not = z19.object({
|
|
2180
|
+
type: z19.literal("not"),
|
|
2119
2181
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2120
|
-
clause:
|
|
2182
|
+
clause: z19.lazy(() => Clause)
|
|
2121
2183
|
});
|
|
2122
|
-
var And =
|
|
2123
|
-
type:
|
|
2184
|
+
var And = z19.object({
|
|
2185
|
+
type: z19.literal("and"),
|
|
2124
2186
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2125
|
-
clauses:
|
|
2187
|
+
clauses: z19.lazy(() => Clause.array())
|
|
2126
2188
|
});
|
|
2127
|
-
var Or =
|
|
2128
|
-
type:
|
|
2189
|
+
var Or = z19.object({
|
|
2190
|
+
type: z19.literal("or"),
|
|
2129
2191
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2130
|
-
clauses:
|
|
2192
|
+
clauses: z19.lazy(() => Clause.array())
|
|
2131
2193
|
});
|
|
2132
|
-
var Clause =
|
|
2133
|
-
() =>
|
|
2194
|
+
var Clause = z19.lazy(
|
|
2195
|
+
() => z19.discriminatedUnion("type", [
|
|
2134
2196
|
Not,
|
|
2135
2197
|
And,
|
|
2136
2198
|
Or,
|
|
@@ -2138,193 +2200,298 @@ var Clause = import_zod18.z.lazy(
|
|
|
2138
2200
|
StrictMatcher,
|
|
2139
2201
|
DateRangeMatcher
|
|
2140
2202
|
])
|
|
2141
|
-
).
|
|
2142
|
-
|
|
2203
|
+
).meta({
|
|
2204
|
+
id: "Clause"
|
|
2143
2205
|
});
|
|
2144
|
-
var DeduplicationConfig =
|
|
2145
|
-
id:
|
|
2206
|
+
var DeduplicationConfig = z19.object({
|
|
2207
|
+
id: z19.string(),
|
|
2146
2208
|
label: TranslationConfig,
|
|
2147
2209
|
query: Clause
|
|
2148
2210
|
});
|
|
2149
2211
|
|
|
2212
|
+
// ../commons/src/icons.ts
|
|
2213
|
+
var z20 = __toESM(require("zod/v4"));
|
|
2214
|
+
var AvailableIcons = z20.enum([
|
|
2215
|
+
"Archived",
|
|
2216
|
+
"Assigned",
|
|
2217
|
+
"Certified",
|
|
2218
|
+
"Close",
|
|
2219
|
+
"Collapse",
|
|
2220
|
+
"Draft",
|
|
2221
|
+
"DuplicateYellow",
|
|
2222
|
+
"Expand",
|
|
2223
|
+
"ExternalValidate",
|
|
2224
|
+
"FilledCheck",
|
|
2225
|
+
"InReview",
|
|
2226
|
+
"Offline",
|
|
2227
|
+
"Registered",
|
|
2228
|
+
"RequiresUpdates",
|
|
2229
|
+
"Sent",
|
|
2230
|
+
"Validated",
|
|
2231
|
+
"WaitingApproval",
|
|
2232
|
+
"ChartActivity",
|
|
2233
|
+
"Activity",
|
|
2234
|
+
"Archive",
|
|
2235
|
+
"ArchiveTray",
|
|
2236
|
+
"ArrowLeft",
|
|
2237
|
+
"ArrowRight",
|
|
2238
|
+
"Buildings",
|
|
2239
|
+
"Circle",
|
|
2240
|
+
"CaretDown",
|
|
2241
|
+
"CaretLeft",
|
|
2242
|
+
"CaretRight",
|
|
2243
|
+
"ChartBar",
|
|
2244
|
+
"ChartLine",
|
|
2245
|
+
"ChatCircle",
|
|
2246
|
+
"CheckSquare",
|
|
2247
|
+
"Compass",
|
|
2248
|
+
"Check",
|
|
2249
|
+
"Copy",
|
|
2250
|
+
"Database",
|
|
2251
|
+
"DotsThreeVertical",
|
|
2252
|
+
"ArrowCounterClockwise",
|
|
2253
|
+
"MagnifyingGlassMinus",
|
|
2254
|
+
"MagnifyingGlassPlus",
|
|
2255
|
+
"Export",
|
|
2256
|
+
"Eye",
|
|
2257
|
+
"EyeSlash",
|
|
2258
|
+
"Envelope",
|
|
2259
|
+
"File",
|
|
2260
|
+
"FileSearch",
|
|
2261
|
+
"FileMinus",
|
|
2262
|
+
"FilePlus",
|
|
2263
|
+
"FileText",
|
|
2264
|
+
"FileX",
|
|
2265
|
+
"Handshake",
|
|
2266
|
+
"Gear",
|
|
2267
|
+
"GitBranch",
|
|
2268
|
+
"IdentificationCard",
|
|
2269
|
+
"List",
|
|
2270
|
+
"ListBullets",
|
|
2271
|
+
"Lock",
|
|
2272
|
+
"MagnifyingGlass",
|
|
2273
|
+
"MapPin",
|
|
2274
|
+
"Medal",
|
|
2275
|
+
"NotePencil",
|
|
2276
|
+
"Paperclip",
|
|
2277
|
+
"PaperPlaneTilt",
|
|
2278
|
+
"Pen",
|
|
2279
|
+
"Pencil",
|
|
2280
|
+
"PencilSimpleLine",
|
|
2281
|
+
"Phone",
|
|
2282
|
+
"Plus",
|
|
2283
|
+
"Printer",
|
|
2284
|
+
"SignOut",
|
|
2285
|
+
"Stamp",
|
|
2286
|
+
"Star",
|
|
2287
|
+
"Target",
|
|
2288
|
+
"TextT",
|
|
2289
|
+
"Trash",
|
|
2290
|
+
"UploadSimple",
|
|
2291
|
+
"User",
|
|
2292
|
+
"UserPlus",
|
|
2293
|
+
"Users",
|
|
2294
|
+
"WarningCircle",
|
|
2295
|
+
"X",
|
|
2296
|
+
"ChatText",
|
|
2297
|
+
"CircleWavyCheck",
|
|
2298
|
+
"CircleWavyQuestion",
|
|
2299
|
+
"ArchiveBox",
|
|
2300
|
+
"ArrowCircleDown",
|
|
2301
|
+
"FileArrowUp",
|
|
2302
|
+
"FileDotted",
|
|
2303
|
+
"Files",
|
|
2304
|
+
"PencilLine",
|
|
2305
|
+
"PencilCircle",
|
|
2306
|
+
"UserCircle",
|
|
2307
|
+
"Clock",
|
|
2308
|
+
"QrCode",
|
|
2309
|
+
"Webcam",
|
|
2310
|
+
"Sun",
|
|
2311
|
+
"DeviceTabletCamera",
|
|
2312
|
+
"Globe",
|
|
2313
|
+
"Fingerprint",
|
|
2314
|
+
"PushPin",
|
|
2315
|
+
"Timer"
|
|
2316
|
+
]);
|
|
2317
|
+
|
|
2150
2318
|
// ../commons/src/events/ActionConfig.ts
|
|
2151
|
-
var
|
|
2152
|
-
(0, import_zod_openapi9.extendZodWithOpenApi)(import_zod19.z);
|
|
2153
|
-
var DeclarationReviewConfig = import_zod19.z.object({
|
|
2319
|
+
var DeclarationReviewConfig = z21.object({
|
|
2154
2320
|
title: TranslationConfig.describe("Title of the review page"),
|
|
2155
|
-
fields:
|
|
2321
|
+
fields: z21.array(FieldConfig).describe("Fields displayed on the review page for annotations.")
|
|
2156
2322
|
}).describe(
|
|
2157
2323
|
"Configuration of the declaration review page for collecting event-related metadata."
|
|
2158
2324
|
);
|
|
2159
|
-
var ActionConfigBase =
|
|
2160
|
-
label: TranslationConfig.describe("Human readable description of the action")
|
|
2325
|
+
var ActionConfigBase = z21.object({
|
|
2326
|
+
label: TranslationConfig.describe("Human readable description of the action"),
|
|
2327
|
+
flags: z21.array(ActionFlagConfig).optional().default([]).describe("Flag actions which are executed when the action is performed."),
|
|
2328
|
+
supportingCopy: TranslationConfig.optional().describe(
|
|
2329
|
+
"Text displayed on the confirmation"
|
|
2330
|
+
),
|
|
2331
|
+
icon: AvailableIcons.describe("Icon representing the action").optional(),
|
|
2332
|
+
conditionals: z21.array(ActionConditional).optional().describe("Conditionals which can disable or hide actions.")
|
|
2161
2333
|
});
|
|
2162
2334
|
var DeclarationActionBase = ActionConfigBase.extend({
|
|
2163
|
-
review: DeclarationReviewConfig,
|
|
2164
2335
|
deduplication: DeduplicationConfig.optional()
|
|
2165
2336
|
});
|
|
2166
|
-
var ReadActionConfig = ActionConfigBase.
|
|
2167
|
-
|
|
2168
|
-
type:
|
|
2337
|
+
var ReadActionConfig = ActionConfigBase.extend(
|
|
2338
|
+
z21.object({
|
|
2339
|
+
type: z21.literal(ActionType.READ),
|
|
2169
2340
|
review: DeclarationReviewConfig.describe(
|
|
2170
2341
|
"Configuration of the review page for read-only view."
|
|
2171
|
-
)
|
|
2172
|
-
|
|
2173
|
-
)
|
|
2174
|
-
var DeclareConfig = DeclarationActionBase.merge(
|
|
2175
|
-
import_zod19.z.object({
|
|
2176
|
-
type: import_zod19.z.literal(ActionType.DECLARE)
|
|
2177
|
-
})
|
|
2178
|
-
);
|
|
2179
|
-
var ValidateConfig = DeclarationActionBase.merge(
|
|
2180
|
-
import_zod19.z.object({
|
|
2181
|
-
type: import_zod19.z.literal(ActionType.VALIDATE)
|
|
2182
|
-
})
|
|
2342
|
+
),
|
|
2343
|
+
conditionals: z21.never().optional().describe("Read-action can not be disabled or hidden with conditionals.")
|
|
2344
|
+
}).shape
|
|
2183
2345
|
);
|
|
2184
|
-
var
|
|
2185
|
-
|
|
2186
|
-
type:
|
|
2187
|
-
|
|
2346
|
+
var DeclareConfig = DeclarationActionBase.extend(
|
|
2347
|
+
z21.object({
|
|
2348
|
+
type: z21.literal(ActionType.DECLARE),
|
|
2349
|
+
review: DeclarationReviewConfig.describe(
|
|
2350
|
+
"Configuration of the review page fields."
|
|
2351
|
+
)
|
|
2352
|
+
}).shape
|
|
2188
2353
|
);
|
|
2189
|
-
var
|
|
2190
|
-
|
|
2191
|
-
type:
|
|
2192
|
-
})
|
|
2354
|
+
var EditActionConfig = ActionConfigBase.extend(
|
|
2355
|
+
z21.object({
|
|
2356
|
+
type: z21.literal(ActionType.EDIT)
|
|
2357
|
+
}).shape
|
|
2193
2358
|
);
|
|
2194
|
-
var
|
|
2195
|
-
|
|
2196
|
-
type:
|
|
2197
|
-
})
|
|
2359
|
+
var RejectConfig = ActionConfigBase.extend(
|
|
2360
|
+
z21.object({
|
|
2361
|
+
type: z21.literal(ActionType.REJECT)
|
|
2362
|
+
}).shape
|
|
2198
2363
|
);
|
|
2199
|
-
var
|
|
2200
|
-
|
|
2201
|
-
type:
|
|
2202
|
-
})
|
|
2364
|
+
var RegisterConfig = DeclarationActionBase.extend(
|
|
2365
|
+
z21.object({
|
|
2366
|
+
type: z21.literal(ActionType.REGISTER)
|
|
2367
|
+
}).shape
|
|
2203
2368
|
);
|
|
2204
|
-
var PrintCertificateActionConfig = ActionConfigBase.
|
|
2205
|
-
|
|
2206
|
-
type:
|
|
2369
|
+
var PrintCertificateActionConfig = ActionConfigBase.extend(
|
|
2370
|
+
z21.object({
|
|
2371
|
+
type: z21.literal(ActionType.PRINT_CERTIFICATE),
|
|
2207
2372
|
printForm: ActionFormConfig
|
|
2208
|
-
})
|
|
2373
|
+
}).shape
|
|
2209
2374
|
);
|
|
2210
|
-
var RequestCorrectionConfig = ActionConfigBase.
|
|
2211
|
-
|
|
2212
|
-
type:
|
|
2375
|
+
var RequestCorrectionConfig = ActionConfigBase.extend(
|
|
2376
|
+
z21.object({
|
|
2377
|
+
type: z21.literal(ActionType.REQUEST_CORRECTION),
|
|
2213
2378
|
correctionForm: ActionFormConfig
|
|
2214
|
-
})
|
|
2215
|
-
);
|
|
2216
|
-
var RejectCorrectionConfig = ActionConfigBase.merge(
|
|
2217
|
-
import_zod19.z.object({
|
|
2218
|
-
type: import_zod19.z.literal(ActionType.REJECT_CORRECTION)
|
|
2219
|
-
})
|
|
2379
|
+
}).shape
|
|
2220
2380
|
);
|
|
2221
|
-
var
|
|
2222
|
-
|
|
2223
|
-
type:
|
|
2381
|
+
var CustomActionConfig = ActionConfigBase.merge(
|
|
2382
|
+
z21.object({
|
|
2383
|
+
type: z21.literal(ActionType.CUSTOM),
|
|
2384
|
+
customActionType: z21.string().describe("Type identifier of the custom action."),
|
|
2385
|
+
/** Custom action form configuration supports a simple array of field configs, which should be rendered on the action modal. In the future, we might add support for pages etc. */
|
|
2386
|
+
form: z21.array(FieldConfig).describe(
|
|
2387
|
+
"Form configuration for the custom action. The form configured here will be used on the custom action confirmation modal."
|
|
2388
|
+
),
|
|
2389
|
+
auditHistoryLabel: TranslationConfig.describe(
|
|
2390
|
+
'The label to show in audit history for this action. For example "Approved".'
|
|
2391
|
+
)
|
|
2224
2392
|
})
|
|
2225
2393
|
);
|
|
2226
|
-
var ActionConfig =
|
|
2394
|
+
var ActionConfig = z21.discriminatedUnion("type", [
|
|
2227
2395
|
/*
|
|
2228
2396
|
* OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
|
|
2229
2397
|
* and treat them as "models" instead of duplicating the data structure in each endpoint.
|
|
2230
2398
|
*/
|
|
2231
|
-
ReadActionConfig.
|
|
2232
|
-
DeclareConfig.
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
DeleteConfig.openapi({ ref: "DeleteActionConfig" }),
|
|
2238
|
-
PrintCertificateActionConfig.openapi({
|
|
2239
|
-
ref: "PrintCertificateActionConfig"
|
|
2399
|
+
ReadActionConfig.meta({ id: "ReadActionConfig" }),
|
|
2400
|
+
DeclareConfig.meta({ id: "DeclareActionConfig" }),
|
|
2401
|
+
RejectConfig.meta({ id: "RejectActionConfig" }),
|
|
2402
|
+
RegisterConfig.meta({ id: "RegisterActionConfig" }),
|
|
2403
|
+
PrintCertificateActionConfig.meta({
|
|
2404
|
+
id: "PrintCertificateActionConfig"
|
|
2240
2405
|
}),
|
|
2241
|
-
RequestCorrectionConfig.
|
|
2242
|
-
|
|
2243
|
-
|
|
2406
|
+
RequestCorrectionConfig.meta({ id: "RequestCorrectionActionConfig" }),
|
|
2407
|
+
EditActionConfig.meta({ id: "EditActionConfig" }),
|
|
2408
|
+
CustomActionConfig.meta({ id: "CustomActionConfig" })
|
|
2244
2409
|
]).describe(
|
|
2245
2410
|
"Configuration of an action available for an event. Data collected depends on the action type and is accessible through the annotation property in ActionDocument."
|
|
2246
|
-
).
|
|
2247
|
-
var
|
|
2411
|
+
).meta({ id: "ActionConfig" });
|
|
2412
|
+
var actionConfigTypes = new Set(
|
|
2413
|
+
ActionConfig.options.map((opt) => opt.shape.type.value)
|
|
2414
|
+
);
|
|
2415
|
+
var DeclarationActionConfig = z21.discriminatedUnion("type", [
|
|
2248
2416
|
DeclareConfig,
|
|
2249
|
-
ValidateConfig,
|
|
2250
2417
|
RegisterConfig
|
|
2251
2418
|
]);
|
|
2252
2419
|
|
|
2253
2420
|
// ../commons/src/events/offline/CertificateConfig.ts
|
|
2254
|
-
var
|
|
2255
|
-
var FontFamily =
|
|
2256
|
-
normal:
|
|
2257
|
-
bold:
|
|
2258
|
-
italics:
|
|
2259
|
-
bolditalics:
|
|
2421
|
+
var z22 = __toESM(require("zod/v4"));
|
|
2422
|
+
var FontFamily = z22.object({
|
|
2423
|
+
normal: z22.string(),
|
|
2424
|
+
bold: z22.string(),
|
|
2425
|
+
italics: z22.string(),
|
|
2426
|
+
bolditalics: z22.string()
|
|
2260
2427
|
});
|
|
2261
|
-
var CertificateConfig =
|
|
2262
|
-
id:
|
|
2263
|
-
event:
|
|
2264
|
-
isV2Template:
|
|
2428
|
+
var CertificateConfig = z22.object({
|
|
2429
|
+
id: z22.string(),
|
|
2430
|
+
event: z22.string(),
|
|
2431
|
+
isV2Template: z22.boolean().optional(),
|
|
2265
2432
|
label: TranslationConfig,
|
|
2266
|
-
isDefault:
|
|
2267
|
-
fee:
|
|
2268
|
-
onTime:
|
|
2269
|
-
late:
|
|
2270
|
-
delayed:
|
|
2433
|
+
isDefault: z22.boolean(),
|
|
2434
|
+
fee: z22.object({
|
|
2435
|
+
onTime: z22.number(),
|
|
2436
|
+
late: z22.number(),
|
|
2437
|
+
delayed: z22.number()
|
|
2271
2438
|
}),
|
|
2272
|
-
svgUrl:
|
|
2273
|
-
fonts:
|
|
2274
|
-
conditionals:
|
|
2439
|
+
svgUrl: z22.string(),
|
|
2440
|
+
fonts: z22.record(z22.string(), FontFamily).optional(),
|
|
2441
|
+
conditionals: z22.array(ShowConditional).optional()
|
|
2275
2442
|
});
|
|
2276
2443
|
var CertificateTemplateConfig = CertificateConfig.extend({
|
|
2277
|
-
hash:
|
|
2278
|
-
svg:
|
|
2444
|
+
hash: z22.string().optional(),
|
|
2445
|
+
svg: z22.string()
|
|
2279
2446
|
});
|
|
2280
2447
|
|
|
2281
2448
|
// ../commons/src/events/offline/LanguageConfig.ts
|
|
2282
|
-
var
|
|
2283
|
-
var LanguageConfig =
|
|
2284
|
-
lang:
|
|
2449
|
+
var z23 = __toESM(require("zod/v4"));
|
|
2450
|
+
var LanguageConfig = z23.object({
|
|
2451
|
+
lang: z23.string(),
|
|
2285
2452
|
/**
|
|
2286
2453
|
* client.csv contents
|
|
2287
2454
|
*/
|
|
2288
|
-
messages:
|
|
2455
|
+
messages: z23.record(z23.string(), z23.string())
|
|
2289
2456
|
});
|
|
2290
2457
|
|
|
2291
2458
|
// ../commons/src/events/EventConfig.ts
|
|
2292
|
-
var
|
|
2459
|
+
var z29 = __toESM(require("zod/v4"));
|
|
2293
2460
|
|
|
2294
2461
|
// ../commons/src/events/SummaryConfig.ts
|
|
2295
|
-
var
|
|
2296
|
-
var BaseField2 =
|
|
2462
|
+
var z24 = __toESM(require("zod/v4"));
|
|
2463
|
+
var BaseField2 = z24.object({
|
|
2297
2464
|
emptyValueMessage: TranslationConfig.optional().describe(
|
|
2298
2465
|
"Default message displayed when the field value is empty."
|
|
2299
2466
|
),
|
|
2300
|
-
conditionals:
|
|
2467
|
+
conditionals: z24.array(ShowConditional).default([]).optional()
|
|
2301
2468
|
});
|
|
2302
2469
|
var ReferenceField = BaseField2.extend({
|
|
2303
|
-
fieldId:
|
|
2470
|
+
fieldId: z24.string(),
|
|
2304
2471
|
label: TranslationConfig.optional().describe(
|
|
2305
2472
|
"Overrides the default label from the referenced field when provided."
|
|
2306
2473
|
)
|
|
2307
2474
|
}).describe("Field referencing existing event data by field ID.");
|
|
2308
2475
|
var Field = BaseField2.extend({
|
|
2309
|
-
id:
|
|
2476
|
+
id: z24.string().describe("Identifier of the summary field."),
|
|
2310
2477
|
value: TranslationConfig.describe(
|
|
2311
2478
|
'Field value template supporting variables from configuration and EventMetadata (e.g. "{informant.phoneNo} {informant.email}").'
|
|
2312
2479
|
),
|
|
2313
2480
|
label: TranslationConfig
|
|
2314
2481
|
}).describe("Custom field defined for the summary view.");
|
|
2315
|
-
var SummaryConfig =
|
|
2316
|
-
fields:
|
|
2482
|
+
var SummaryConfig = z24.object({
|
|
2483
|
+
fields: z24.array(z24.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
|
|
2317
2484
|
}).describe("Configuration of the event summary section.");
|
|
2318
2485
|
|
|
2319
2486
|
// ../commons/src/events/AdvancedSearchConfig.ts
|
|
2320
|
-
var
|
|
2321
|
-
var MatchType =
|
|
2322
|
-
var BaseField3 =
|
|
2323
|
-
config:
|
|
2487
|
+
var z25 = __toESM(require("zod/v4"));
|
|
2488
|
+
var MatchType = z25.enum(["fuzzy", "exact", "range", "within"]);
|
|
2489
|
+
var BaseField3 = z25.object({
|
|
2490
|
+
config: z25.object({
|
|
2324
2491
|
type: MatchType.describe(
|
|
2325
2492
|
"Determines the search type of field. How to match value."
|
|
2326
2493
|
),
|
|
2327
|
-
searchFields:
|
|
2494
|
+
searchFields: z25.array(z25.string()).optional().describe(
|
|
2328
2495
|
`
|
|
2329
2496
|
Defines multiple form fields that should be searched when this field has a value.
|
|
2330
2497
|
All specified fields will be combined using OR logic.
|
|
@@ -2334,7 +2501,7 @@ var BaseField3 = import_zod23.z.object({
|
|
|
2334
2501
|
`
|
|
2335
2502
|
)
|
|
2336
2503
|
}),
|
|
2337
|
-
type:
|
|
2504
|
+
type: z25.nativeEnum(FieldType).optional().describe(
|
|
2338
2505
|
`
|
|
2339
2506
|
Explicitly specify the field type for searchFields.
|
|
2340
2507
|
This is required when searchFields is defined, to show the correct control in the UI.
|
|
@@ -2348,7 +2515,7 @@ var BaseField3 = import_zod23.z.object({
|
|
|
2348
2515
|
This is required when searchFields is defined.
|
|
2349
2516
|
`
|
|
2350
2517
|
),
|
|
2351
|
-
options:
|
|
2518
|
+
options: z25.array(SelectOption).optional(),
|
|
2352
2519
|
searchCriteriaLabelPrefix: TranslationConfig.optional().describe(
|
|
2353
2520
|
`
|
|
2354
2521
|
This property determines whether to add a prefix (such as "Child" or "Applicant") before the field label
|
|
@@ -2369,7 +2536,7 @@ var BaseField3 = import_zod23.z.object({
|
|
|
2369
2536
|
in the country-config > event.advancedSearch configuration. For example: field("child.dob", { searchCriteriaLabelPrefix: TranslationConfig }).
|
|
2370
2537
|
`
|
|
2371
2538
|
),
|
|
2372
|
-
conditionals:
|
|
2539
|
+
conditionals: z25.array(FieldConditional).optional().describe(
|
|
2373
2540
|
`
|
|
2374
2541
|
In advanced search, we sometimes need to override the default field visibility conditionals.
|
|
2375
2542
|
|
|
@@ -2383,20 +2550,20 @@ var BaseField3 = import_zod23.z.object({
|
|
|
2383
2550
|
are always rendered in the advanced search form.
|
|
2384
2551
|
`
|
|
2385
2552
|
),
|
|
2386
|
-
validations:
|
|
2553
|
+
validations: z25.array(ValidationConfig).optional().describe(
|
|
2387
2554
|
`Option for overriding the field validations specifically for advanced search form.`
|
|
2388
2555
|
)
|
|
2389
2556
|
});
|
|
2390
|
-
var SearchQueryParams =
|
|
2391
|
-
eventType:
|
|
2557
|
+
var SearchQueryParams = z25.object({
|
|
2558
|
+
eventType: z25.string().optional().describe(
|
|
2392
2559
|
"Defines type of event so that when redirecting to Advanced Search page, appropriate tab can be selected"
|
|
2393
2560
|
)
|
|
2394
2561
|
}).catchall(FieldValue);
|
|
2395
2562
|
var FieldConfigSchema = BaseField3.extend({
|
|
2396
|
-
fieldId:
|
|
2397
|
-
fieldType:
|
|
2563
|
+
fieldId: z25.string(),
|
|
2564
|
+
fieldType: z25.literal("field")
|
|
2398
2565
|
});
|
|
2399
|
-
var EventFieldIdInput =
|
|
2566
|
+
var EventFieldIdInput = z25.enum([
|
|
2400
2567
|
"trackingId",
|
|
2401
2568
|
"status",
|
|
2402
2569
|
"legalStatuses.REGISTERED.acceptedAt",
|
|
@@ -2405,7 +2572,7 @@ var EventFieldIdInput = import_zod23.z.enum([
|
|
|
2405
2572
|
"updatedAt"
|
|
2406
2573
|
]);
|
|
2407
2574
|
var METADATA_FIELD_PREFIX = "event.";
|
|
2408
|
-
var EventFieldId =
|
|
2575
|
+
var EventFieldId = z25.enum([
|
|
2409
2576
|
`${METADATA_FIELD_PREFIX}trackingId`,
|
|
2410
2577
|
`${METADATA_FIELD_PREFIX}status`,
|
|
2411
2578
|
`${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.acceptedAt`,
|
|
@@ -2415,29 +2582,29 @@ var EventFieldId = import_zod23.z.enum([
|
|
|
2415
2582
|
]);
|
|
2416
2583
|
var EventFieldConfigSchema = BaseField3.extend({
|
|
2417
2584
|
fieldId: EventFieldId,
|
|
2418
|
-
fieldType:
|
|
2585
|
+
fieldType: z25.literal("event")
|
|
2419
2586
|
});
|
|
2420
|
-
var AdvancedSearchField =
|
|
2587
|
+
var AdvancedSearchField = z25.discriminatedUnion("fieldType", [FieldConfigSchema, EventFieldConfigSchema]).superRefine((data, ctx) => {
|
|
2421
2588
|
if (data.config.searchFields && data.config.searchFields.length > 0) {
|
|
2422
2589
|
if (!data.label) {
|
|
2423
2590
|
ctx.addIssue({
|
|
2424
|
-
code:
|
|
2591
|
+
code: z25.ZodIssueCode.custom,
|
|
2425
2592
|
message: "label is required when config.searchFields is defined.",
|
|
2426
2593
|
path: ["label"]
|
|
2427
2594
|
});
|
|
2428
2595
|
}
|
|
2429
2596
|
if (!data.type) {
|
|
2430
2597
|
ctx.addIssue({
|
|
2431
|
-
code:
|
|
2598
|
+
code: z25.ZodIssueCode.custom,
|
|
2432
2599
|
message: "type is required when config.searchFields is defined.",
|
|
2433
2600
|
path: ["type"]
|
|
2434
2601
|
});
|
|
2435
2602
|
}
|
|
2436
2603
|
}
|
|
2437
2604
|
});
|
|
2438
|
-
var AdvancedSearchConfig =
|
|
2605
|
+
var AdvancedSearchConfig = z25.object({
|
|
2439
2606
|
title: TranslationConfig.describe("Advanced search tab title"),
|
|
2440
|
-
fields:
|
|
2607
|
+
fields: z25.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
|
|
2441
2608
|
});
|
|
2442
2609
|
|
|
2443
2610
|
// ../commons/src/events/utils.ts
|
|
@@ -2446,11 +2613,11 @@ var import_lodash = require("lodash");
|
|
|
2446
2613
|
// ../commons/src/conditionals/validate.ts
|
|
2447
2614
|
var import__ = __toESM(require("ajv/dist/2019"));
|
|
2448
2615
|
var import_ajv_formats = __toESM(require("ajv-formats"));
|
|
2449
|
-
var
|
|
2616
|
+
var z27 = __toESM(require("zod/v4"));
|
|
2450
2617
|
var import_date_fns = require("date-fns");
|
|
2451
2618
|
|
|
2452
2619
|
// ../commons/src/events/DynamicFieldValue.ts
|
|
2453
|
-
var
|
|
2620
|
+
var z26 = __toESM(require("zod/v4"));
|
|
2454
2621
|
|
|
2455
2622
|
// ../commons/src/conditionals/validate.ts
|
|
2456
2623
|
var ajv = new import__.default({
|
|
@@ -2459,9 +2626,9 @@ var ajv = new import__.default({
|
|
|
2459
2626
|
strict: false
|
|
2460
2627
|
// Allow minContains and other newer features
|
|
2461
2628
|
});
|
|
2462
|
-
var DataContext =
|
|
2463
|
-
rootData:
|
|
2464
|
-
$leafAdminStructureLocationIds:
|
|
2629
|
+
var DataContext = z27.object({
|
|
2630
|
+
rootData: z27.object({
|
|
2631
|
+
$leafAdminStructureLocationIds: z27.array(z27.object({ id: UUID }))
|
|
2465
2632
|
})
|
|
2466
2633
|
});
|
|
2467
2634
|
function resolveDataPath(rootData, dataPath, instancePath) {
|
|
@@ -2538,12 +2705,12 @@ ajv.addKeyword({
|
|
|
2538
2705
|
});
|
|
2539
2706
|
|
|
2540
2707
|
// ../commons/src/utils.ts
|
|
2541
|
-
var
|
|
2542
|
-
var FullNameV1 =
|
|
2543
|
-
|
|
2544
|
-
use:
|
|
2545
|
-
family:
|
|
2546
|
-
given:
|
|
2708
|
+
var z28 = __toESM(require("zod/v4"));
|
|
2709
|
+
var FullNameV1 = z28.array(
|
|
2710
|
+
z28.object({
|
|
2711
|
+
use: z28.string(),
|
|
2712
|
+
family: z28.string(),
|
|
2713
|
+
given: z28.array(z28.string())
|
|
2547
2714
|
})
|
|
2548
2715
|
);
|
|
2549
2716
|
function omitKeyDeep(obj, keyToRemove) {
|
|
@@ -2564,9 +2731,6 @@ function omitKeyDeep(obj, keyToRemove) {
|
|
|
2564
2731
|
|
|
2565
2732
|
// ../commons/src/events/utils.ts
|
|
2566
2733
|
var import_date_fns2 = require("date-fns");
|
|
2567
|
-
function isDeclarationActionConfig(action) {
|
|
2568
|
-
return DeclarationActions.safeParse(action.type).success;
|
|
2569
|
-
}
|
|
2570
2734
|
function getDeclarationFields(configuration) {
|
|
2571
2735
|
return configuration.declaration.pages.flatMap(({ fields }) => fields);
|
|
2572
2736
|
}
|
|
@@ -2577,7 +2741,7 @@ var getActionAnnotationFields = (actionConfig) => {
|
|
|
2577
2741
|
if (actionConfig.type === ActionType.PRINT_CERTIFICATE) {
|
|
2578
2742
|
return actionConfig.printForm.pages.flatMap(({ fields }) => fields);
|
|
2579
2743
|
}
|
|
2580
|
-
if (
|
|
2744
|
+
if ("review" in actionConfig) {
|
|
2581
2745
|
return actionConfig.review.fields;
|
|
2582
2746
|
}
|
|
2583
2747
|
return [];
|
|
@@ -2597,38 +2761,8 @@ var EXCLUDED_ACTIONS = [
|
|
|
2597
2761
|
ActionType.REJECT_CORRECTION
|
|
2598
2762
|
];
|
|
2599
2763
|
|
|
2600
|
-
// ../commons/src/events/
|
|
2601
|
-
|
|
2602
|
-
(0, import_zod_openapi10.extendZodWithOpenApi)(import_zod26.z);
|
|
2603
|
-
var EventConfig = import_zod26.z.object({
|
|
2604
|
-
id: import_zod26.z.string().describe(
|
|
2605
|
-
'Machine-readable identifier of the event (e.g. "birth", "death").'
|
|
2606
|
-
),
|
|
2607
|
-
dateOfEvent: FieldReference.optional().describe(
|
|
2608
|
-
"Reference to the field capturing the date of the event (e.g. date of birth). Defaults to the event creation date if unspecified."
|
|
2609
|
-
),
|
|
2610
|
-
title: TranslationConfig.describe(
|
|
2611
|
-
'Title template for the singular event, supporting variables (e.g. "{applicant.name.firstname} {applicant.name.surname}").'
|
|
2612
|
-
),
|
|
2613
|
-
fallbackTitle: TranslationConfig.optional().describe(
|
|
2614
|
-
"Fallback title shown when the main title resolves to an empty value."
|
|
2615
|
-
),
|
|
2616
|
-
summary: SummaryConfig.describe(
|
|
2617
|
-
"Summary information displayed in the event overview."
|
|
2618
|
-
),
|
|
2619
|
-
label: TranslationConfig.describe(
|
|
2620
|
-
"Human-readable label for the event type."
|
|
2621
|
-
),
|
|
2622
|
-
actions: import_zod26.z.array(ActionConfig).describe(
|
|
2623
|
-
"Configuration of system-defined actions associated with the event."
|
|
2624
|
-
),
|
|
2625
|
-
declaration: DeclarationFormConfig.describe(
|
|
2626
|
-
"Configuration of the form used to gather event data."
|
|
2627
|
-
),
|
|
2628
|
-
advancedSearch: import_zod26.z.array(AdvancedSearchConfig).optional().default([]).describe(
|
|
2629
|
-
"Configuration of fields available in the advanced search feature."
|
|
2630
|
-
)
|
|
2631
|
-
}).superRefine((event2, ctx) => {
|
|
2764
|
+
// ../commons/src/events/eventConfigValidation.ts
|
|
2765
|
+
function validateAdvancedSearchConfig(event2, ctx) {
|
|
2632
2766
|
const allFields = findAllFields(event2);
|
|
2633
2767
|
const fieldIds = allFields.map((field3) => field3.id);
|
|
2634
2768
|
const advancedSearchFields = event2.advancedSearch.flatMap(
|
|
@@ -2655,10 +2789,12 @@ var EventConfig = import_zod26.z.object({
|
|
|
2655
2789
|
ctx.addIssue({
|
|
2656
2790
|
code: "custom",
|
|
2657
2791
|
message: `Advanced search id must match a field id of form fields or pre-defined metadata fields.
|
|
2658
|
-
|
|
2792
|
+
Invalid AdvancedSearch field IDs for event ${event2.id}: ${invalidFields.map((f) => f.fieldId).join(", ")}`,
|
|
2659
2793
|
path: ["advancedSearch"]
|
|
2660
2794
|
});
|
|
2661
2795
|
}
|
|
2796
|
+
}
|
|
2797
|
+
function validateDateOfEvent(event2, ctx) {
|
|
2662
2798
|
if (event2.dateOfEvent) {
|
|
2663
2799
|
const eventDateFieldId = getDeclarationFields(event2).find(
|
|
2664
2800
|
({ id }) => id === event2.dateOfEvent?.$$field
|
|
@@ -2667,7 +2803,7 @@ var EventConfig = import_zod26.z.object({
|
|
|
2667
2803
|
ctx.addIssue({
|
|
2668
2804
|
code: "custom",
|
|
2669
2805
|
message: `Date of event field id must match a field id in fields array.
|
|
2670
|
-
|
|
2806
|
+
Invalid date of event field ID for event ${event2.id}: ${event2.dateOfEvent.$$field}`,
|
|
2671
2807
|
path: ["dateOfEvent"]
|
|
2672
2808
|
});
|
|
2673
2809
|
} else if (eventDateFieldId.type !== FieldType.DATE) {
|
|
@@ -2678,8 +2814,105 @@ var EventConfig = import_zod26.z.object({
|
|
|
2678
2814
|
});
|
|
2679
2815
|
}
|
|
2680
2816
|
}
|
|
2681
|
-
}
|
|
2682
|
-
|
|
2817
|
+
}
|
|
2818
|
+
function validatePlaceOfEvent(event2, ctx) {
|
|
2819
|
+
if (event2.placeOfEvent) {
|
|
2820
|
+
const eventPlaceFieldId = getDeclarationFields(event2).find(
|
|
2821
|
+
({ id }) => id === event2.placeOfEvent?.$$field
|
|
2822
|
+
);
|
|
2823
|
+
if (!eventPlaceFieldId) {
|
|
2824
|
+
ctx.addIssue({
|
|
2825
|
+
code: "custom",
|
|
2826
|
+
message: `Place of event field id must match a field id in the event.declaration fields.
|
|
2827
|
+
Invalid place of event field ID for event ${event2.id}: ${event2.placeOfEvent.$$field}`,
|
|
2828
|
+
path: ["placeOfEvent"]
|
|
2829
|
+
});
|
|
2830
|
+
}
|
|
2831
|
+
}
|
|
2832
|
+
}
|
|
2833
|
+
function validateActionFlags(event2, ctx) {
|
|
2834
|
+
const isInherentFlag = (value) => Object.values(InherentFlags).includes(value);
|
|
2835
|
+
const configuredFlagIds = event2.flags.map((flag) => flag.id);
|
|
2836
|
+
const actionFlagIds = event2.actions.flatMap(
|
|
2837
|
+
(action) => action.flags.map((flag) => flag.id)
|
|
2838
|
+
);
|
|
2839
|
+
for (const actionFlagId of actionFlagIds) {
|
|
2840
|
+
const isConfigured = configuredFlagIds.includes(actionFlagId);
|
|
2841
|
+
const isInherent = isInherentFlag(actionFlagId);
|
|
2842
|
+
if (!isConfigured && !isInherent) {
|
|
2843
|
+
ctx.addIssue({
|
|
2844
|
+
code: "custom",
|
|
2845
|
+
message: `Action flag id must match an inherent flag or a configured flag in the flags array. Invalid action flag ID for event '${event2.id}': '${actionFlagId}'`,
|
|
2846
|
+
path: ["actions"]
|
|
2847
|
+
});
|
|
2848
|
+
}
|
|
2849
|
+
}
|
|
2850
|
+
}
|
|
2851
|
+
function validateActionOrder(event2, ctx) {
|
|
2852
|
+
if (event2.actionOrder) {
|
|
2853
|
+
const customActionTypes = event2.actions.filter((action) => action.type === ActionType.CUSTOM).map((action) => action.customActionType);
|
|
2854
|
+
const validActionTypes = [
|
|
2855
|
+
...workqueueActions.options,
|
|
2856
|
+
...customActionTypes
|
|
2857
|
+
];
|
|
2858
|
+
for (const actionType of event2.actionOrder) {
|
|
2859
|
+
if (!validActionTypes.includes(actionType)) {
|
|
2860
|
+
ctx.addIssue({
|
|
2861
|
+
code: "custom",
|
|
2862
|
+
message: `Invalid action type in action order: ${actionType}`,
|
|
2863
|
+
path: ["actionOrder"]
|
|
2864
|
+
});
|
|
2865
|
+
}
|
|
2866
|
+
}
|
|
2867
|
+
}
|
|
2868
|
+
}
|
|
2869
|
+
|
|
2870
|
+
// ../commons/src/events/EventConfig.ts
|
|
2871
|
+
var EventConfig = z29.object({
|
|
2872
|
+
id: z29.string().describe(
|
|
2873
|
+
'Machine-readable identifier of the event (e.g. "birth", "death").'
|
|
2874
|
+
),
|
|
2875
|
+
dateOfEvent: FieldReference.optional().describe(
|
|
2876
|
+
"Reference to the field capturing the date of the event (e.g. date of birth). Defaults to the event creation date if unspecified."
|
|
2877
|
+
),
|
|
2878
|
+
placeOfEvent: FieldReference.optional().describe(
|
|
2879
|
+
"Reference to the field capturing the place of the event (e.g. place of birth). Defaults to the meta.createdAtLocation if unspecified."
|
|
2880
|
+
),
|
|
2881
|
+
title: TranslationConfig.describe(
|
|
2882
|
+
'Title template for the singular event, supporting variables (e.g. "{applicant.name.firstname} {applicant.name.surname}").'
|
|
2883
|
+
),
|
|
2884
|
+
fallbackTitle: TranslationConfig.optional().describe(
|
|
2885
|
+
"Fallback title shown when the main title resolves to an empty value."
|
|
2886
|
+
),
|
|
2887
|
+
summary: SummaryConfig.describe(
|
|
2888
|
+
"Summary information displayed in the event overview."
|
|
2889
|
+
),
|
|
2890
|
+
label: TranslationConfig.describe(
|
|
2891
|
+
"Human-readable label for the event type."
|
|
2892
|
+
),
|
|
2893
|
+
actions: z29.array(ActionConfig).describe(
|
|
2894
|
+
"Configuration of system-defined actions associated with the event."
|
|
2895
|
+
),
|
|
2896
|
+
actionOrder: z29.array(z29.string()).optional().describe(
|
|
2897
|
+
"Order of actions in the action menu. Use either the action type for core actions or the customActionType for custom actions."
|
|
2898
|
+
),
|
|
2899
|
+
declaration: DeclarationFormConfig.describe(
|
|
2900
|
+
"Configuration of the form used to gather event data."
|
|
2901
|
+
),
|
|
2902
|
+
advancedSearch: z29.array(AdvancedSearchConfig).optional().default([]).describe(
|
|
2903
|
+
"Configuration of fields available in the advanced search feature."
|
|
2904
|
+
),
|
|
2905
|
+
flags: z29.array(FlagConfig).optional().default([]).describe(
|
|
2906
|
+
"Configuration of flags associated with the actions of this event type."
|
|
2907
|
+
)
|
|
2908
|
+
}).superRefine((event2, ctx) => {
|
|
2909
|
+
validateAdvancedSearchConfig(event2, ctx);
|
|
2910
|
+
validateDateOfEvent(event2, ctx);
|
|
2911
|
+
validatePlaceOfEvent(event2, ctx);
|
|
2912
|
+
validateActionFlags(event2, ctx);
|
|
2913
|
+
validateActionOrder(event2, ctx);
|
|
2914
|
+
}).meta({
|
|
2915
|
+
id: "EventConfig"
|
|
2683
2916
|
}).describe("Configuration defining an event type.");
|
|
2684
2917
|
|
|
2685
2918
|
// ../commons/src/events/EventConfigInput.ts
|
|
@@ -2688,7 +2921,7 @@ var defineActionForm = (actionForm) => ActionFormConfig.parse(actionForm);
|
|
|
2688
2921
|
var defineFormPage = (formPage) => FormPageConfig.parse(formPage);
|
|
2689
2922
|
|
|
2690
2923
|
// ../commons/src/events/WorkqueueConfig.ts
|
|
2691
|
-
var
|
|
2924
|
+
var z32 = __toESM(require("zod/v4"));
|
|
2692
2925
|
|
|
2693
2926
|
// ../commons/src/conditionals/conditionals.ts
|
|
2694
2927
|
var objectHash = __toESM(require("object-hash"));
|
|
@@ -2726,7 +2959,7 @@ function not(condition) {
|
|
|
2726
2959
|
required: []
|
|
2727
2960
|
});
|
|
2728
2961
|
}
|
|
2729
|
-
function
|
|
2962
|
+
function never2() {
|
|
2730
2963
|
return not(alwaysTrue());
|
|
2731
2964
|
}
|
|
2732
2965
|
function jsonFieldPath(field3) {
|
|
@@ -3381,231 +3614,122 @@ var event = Object.assign(eventFn, {
|
|
|
3381
3614
|
type: "object",
|
|
3382
3615
|
properties: actionProperties,
|
|
3383
3616
|
required: requiredFields
|
|
3384
|
-
},
|
|
3385
|
-
[countType]: count
|
|
3386
|
-
}
|
|
3387
|
-
},
|
|
3388
|
-
required: ["actions"]
|
|
3389
|
-
}
|
|
3390
|
-
},
|
|
3391
|
-
required: ["$event"]
|
|
3392
|
-
});
|
|
3393
|
-
};
|
|
3394
|
-
const withMinMax = (additionalFields) => {
|
|
3395
|
-
return {
|
|
3396
|
-
/**
|
|
3397
|
-
* Creates a conditional that checks if the event contains a specific action type
|
|
3398
|
-
* with a minimum count of occurrences.
|
|
3399
|
-
*
|
|
3400
|
-
* @param minCount - The minimum number of actions required.
|
|
3401
|
-
*/
|
|
3402
|
-
minCount: (minCount) => createCountConditional("minContains", minCount, additionalFields),
|
|
3403
|
-
/**
|
|
3404
|
-
* Builds a conditional that sets a maximum count for the number of actions.
|
|
3405
|
-
* This is useful for limiting the number of actions of a specific type in a single event.
|
|
3406
|
-
*/
|
|
3407
|
-
maxCount: (maxCount) => createCountConditional("maxContains", maxCount, additionalFields)
|
|
3408
|
-
};
|
|
3409
|
-
};
|
|
3410
|
-
const chainableMethods = {
|
|
3411
|
-
/**
|
|
3412
|
-
* Adds additional field constraints to the action matching.
|
|
3413
|
-
*
|
|
3414
|
-
* @param fields - Object containing additional fields to match on the action.
|
|
3415
|
-
*/
|
|
3416
|
-
withFields: (fields) => withMinMax(fields),
|
|
3417
|
-
/**
|
|
3418
|
-
* Adds template ID constraint to the action matching.
|
|
3419
|
-
* This is a convenience method that adds content.templateId to the fields.
|
|
3420
|
-
*
|
|
3421
|
-
* @param id - The template ID to match against.
|
|
3422
|
-
*/
|
|
3423
|
-
withTemplate: (id) => withMinMax({
|
|
3424
|
-
content: { templateId: id }
|
|
3425
|
-
}),
|
|
3426
|
-
...withMinMax()
|
|
3427
|
-
};
|
|
3428
|
-
return { ...basicConditional, ...chainableMethods };
|
|
3429
|
-
},
|
|
3430
|
-
field(field3) {
|
|
3431
|
-
return {
|
|
3432
|
-
$event: field3
|
|
3433
|
-
};
|
|
3434
|
-
}
|
|
3435
|
-
});
|
|
3436
|
-
|
|
3437
|
-
// ../commons/src/events/WorkqueueColumnConfig.ts
|
|
3438
|
-
var
|
|
3439
|
-
var WorkqueueColumnKeysArray = [
|
|
3440
|
-
...EventMetadataKeysArray,
|
|
3441
|
-
"title",
|
|
3442
|
-
"outbox"
|
|
3443
|
-
];
|
|
3444
|
-
var WorkqueueColumnKeys =
|
|
3445
|
-
var WorkqueueColumnValue =
|
|
3446
|
-
$event: WorkqueueColumnKeys
|
|
3447
|
-
});
|
|
3448
|
-
var WorkqueueColumn =
|
|
3449
|
-
label: TranslationConfig,
|
|
3450
|
-
value: WorkqueueColumnValue
|
|
3451
|
-
});
|
|
3452
|
-
function defineWorkqueuesColumns(workqueueColumns) {
|
|
3453
|
-
return workqueueColumns.map(
|
|
3454
|
-
(workqueueColumn) => WorkqueueColumn.parse(workqueueColumn)
|
|
3455
|
-
);
|
|
3456
|
-
}
|
|
3457
|
-
|
|
3458
|
-
// ../commons/src/events/CountryConfigQueryInput.ts
|
|
3459
|
-
var
|
|
3460
|
-
var SerializableExact =
|
|
3461
|
-
type:
|
|
3462
|
-
term:
|
|
3463
|
-
});
|
|
3464
|
-
var SerializableWithin =
|
|
3465
|
-
type:
|
|
3466
|
-
location:
|
|
3467
|
-
});
|
|
3468
|
-
var SerializedQueryExpression =
|
|
3469
|
-
eventType:
|
|
3470
|
-
status:
|
|
3471
|
-
createdAt:
|
|
3472
|
-
updatedAt:
|
|
3473
|
-
"legalStatuses.REGISTERED.createdAt":
|
|
3474
|
-
"legalStatuses.
|
|
3475
|
-
|
|
3476
|
-
),
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
),
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
),
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
var
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
var CountryConfigQueryType = import_zod28.z.discriminatedUnion("type", [And2, Or2]);
|
|
3501
|
-
var CountryConfigQueryInputType = import_zod28.z.union([
|
|
3502
|
-
SerializedQueryExpression,
|
|
3503
|
-
And2,
|
|
3504
|
-
Or2
|
|
3505
|
-
]);
|
|
3506
|
-
|
|
3507
|
-
// ../commons/src/icons.ts
|
|
3508
|
-
var import_zod29 = require("zod");
|
|
3509
|
-
var AvailableIcons = import_zod29.z.enum([
|
|
3510
|
-
"Archived",
|
|
3511
|
-
"Assigned",
|
|
3512
|
-
"Certified",
|
|
3513
|
-
"Close",
|
|
3514
|
-
"Collapse",
|
|
3515
|
-
"Draft",
|
|
3516
|
-
"DuplicateYellow",
|
|
3517
|
-
"Expand",
|
|
3518
|
-
"ExternalValidate",
|
|
3519
|
-
"FilledCheck",
|
|
3520
|
-
"InReview",
|
|
3521
|
-
"Offline",
|
|
3522
|
-
"Registered",
|
|
3523
|
-
"RequiresUpdates",
|
|
3524
|
-
"Sent",
|
|
3525
|
-
"Validated",
|
|
3526
|
-
"WaitingApproval",
|
|
3527
|
-
"ChartActivity",
|
|
3528
|
-
"Activity",
|
|
3529
|
-
"Archive",
|
|
3530
|
-
"ArchiveTray",
|
|
3531
|
-
"ArrowLeft",
|
|
3532
|
-
"ArrowRight",
|
|
3533
|
-
"Buildings",
|
|
3534
|
-
"Circle",
|
|
3535
|
-
"CaretDown",
|
|
3536
|
-
"CaretLeft",
|
|
3537
|
-
"CaretRight",
|
|
3538
|
-
"ChartBar",
|
|
3539
|
-
"ChartLine",
|
|
3540
|
-
"ChatCircle",
|
|
3541
|
-
"CheckSquare",
|
|
3542
|
-
"Compass",
|
|
3543
|
-
"Check",
|
|
3544
|
-
"Copy",
|
|
3545
|
-
"Database",
|
|
3546
|
-
"DotsThreeVertical",
|
|
3547
|
-
"ArrowCounterClockwise",
|
|
3548
|
-
"MagnifyingGlassMinus",
|
|
3549
|
-
"MagnifyingGlassPlus",
|
|
3550
|
-
"Export",
|
|
3551
|
-
"Eye",
|
|
3552
|
-
"EyeSlash",
|
|
3553
|
-
"Envelope",
|
|
3554
|
-
"File",
|
|
3555
|
-
"FileSearch",
|
|
3556
|
-
"FileMinus",
|
|
3557
|
-
"FilePlus",
|
|
3558
|
-
"FileText",
|
|
3559
|
-
"FileX",
|
|
3560
|
-
"Handshake",
|
|
3561
|
-
"Gear",
|
|
3562
|
-
"GitBranch",
|
|
3563
|
-
"IdentificationCard",
|
|
3564
|
-
"List",
|
|
3565
|
-
"ListBullets",
|
|
3566
|
-
"Lock",
|
|
3567
|
-
"MagnifyingGlass",
|
|
3568
|
-
"MapPin",
|
|
3569
|
-
"Medal",
|
|
3570
|
-
"NotePencil",
|
|
3571
|
-
"Paperclip",
|
|
3572
|
-
"PaperPlaneTilt",
|
|
3573
|
-
"Pen",
|
|
3574
|
-
"Pencil",
|
|
3575
|
-
"PencilSimpleLine",
|
|
3576
|
-
"Phone",
|
|
3577
|
-
"Plus",
|
|
3578
|
-
"Printer",
|
|
3579
|
-
"SignOut",
|
|
3580
|
-
"Star",
|
|
3581
|
-
"Target",
|
|
3582
|
-
"TextT",
|
|
3583
|
-
"Trash",
|
|
3584
|
-
"UploadSimple",
|
|
3585
|
-
"User",
|
|
3586
|
-
"UserPlus",
|
|
3587
|
-
"Users",
|
|
3588
|
-
"WarningCircle",
|
|
3589
|
-
"X",
|
|
3590
|
-
"CircleWavyCheck",
|
|
3591
|
-
"CircleWavyQuestion",
|
|
3592
|
-
"ArchiveBox",
|
|
3593
|
-
"ArrowCircleDown",
|
|
3594
|
-
"FileArrowUp",
|
|
3595
|
-
"FileDotted",
|
|
3596
|
-
"Files",
|
|
3597
|
-
"PencilLine",
|
|
3598
|
-
"PencilCircle",
|
|
3599
|
-
"UserCircle",
|
|
3600
|
-
"Clock",
|
|
3601
|
-
"QrCode",
|
|
3602
|
-
"Webcam",
|
|
3603
|
-
"Sun",
|
|
3604
|
-
"DeviceTabletCamera",
|
|
3605
|
-
"Globe",
|
|
3606
|
-
"Fingerprint",
|
|
3607
|
-
"PushPin",
|
|
3608
|
-
"Timer"
|
|
3617
|
+
},
|
|
3618
|
+
[countType]: count
|
|
3619
|
+
}
|
|
3620
|
+
},
|
|
3621
|
+
required: ["actions"]
|
|
3622
|
+
}
|
|
3623
|
+
},
|
|
3624
|
+
required: ["$event"]
|
|
3625
|
+
});
|
|
3626
|
+
};
|
|
3627
|
+
const withMinMax = (additionalFields) => {
|
|
3628
|
+
return {
|
|
3629
|
+
/**
|
|
3630
|
+
* Creates a conditional that checks if the event contains a specific action type
|
|
3631
|
+
* with a minimum count of occurrences.
|
|
3632
|
+
*
|
|
3633
|
+
* @param minCount - The minimum number of actions required.
|
|
3634
|
+
*/
|
|
3635
|
+
minCount: (minCount) => createCountConditional("minContains", minCount, additionalFields),
|
|
3636
|
+
/**
|
|
3637
|
+
* Builds a conditional that sets a maximum count for the number of actions.
|
|
3638
|
+
* This is useful for limiting the number of actions of a specific type in a single event.
|
|
3639
|
+
*/
|
|
3640
|
+
maxCount: (maxCount) => createCountConditional("maxContains", maxCount, additionalFields)
|
|
3641
|
+
};
|
|
3642
|
+
};
|
|
3643
|
+
const chainableMethods = {
|
|
3644
|
+
/**
|
|
3645
|
+
* Adds additional field constraints to the action matching.
|
|
3646
|
+
*
|
|
3647
|
+
* @param fields - Object containing additional fields to match on the action.
|
|
3648
|
+
*/
|
|
3649
|
+
withFields: (fields) => withMinMax(fields),
|
|
3650
|
+
/**
|
|
3651
|
+
* Adds template ID constraint to the action matching.
|
|
3652
|
+
* This is a convenience method that adds content.templateId to the fields.
|
|
3653
|
+
*
|
|
3654
|
+
* @param id - The template ID to match against.
|
|
3655
|
+
*/
|
|
3656
|
+
withTemplate: (id) => withMinMax({
|
|
3657
|
+
content: { templateId: id }
|
|
3658
|
+
}),
|
|
3659
|
+
...withMinMax()
|
|
3660
|
+
};
|
|
3661
|
+
return { ...basicConditional, ...chainableMethods };
|
|
3662
|
+
},
|
|
3663
|
+
field(field3) {
|
|
3664
|
+
return {
|
|
3665
|
+
$event: field3
|
|
3666
|
+
};
|
|
3667
|
+
}
|
|
3668
|
+
});
|
|
3669
|
+
|
|
3670
|
+
// ../commons/src/events/WorkqueueColumnConfig.ts
|
|
3671
|
+
var z30 = __toESM(require("zod/v4"));
|
|
3672
|
+
var WorkqueueColumnKeysArray = [
|
|
3673
|
+
...EventMetadataKeysArray,
|
|
3674
|
+
"title",
|
|
3675
|
+
"outbox"
|
|
3676
|
+
];
|
|
3677
|
+
var WorkqueueColumnKeys = z30.enum(WorkqueueColumnKeysArray);
|
|
3678
|
+
var WorkqueueColumnValue = z30.object({
|
|
3679
|
+
$event: WorkqueueColumnKeys
|
|
3680
|
+
});
|
|
3681
|
+
var WorkqueueColumn = z30.object({
|
|
3682
|
+
label: TranslationConfig,
|
|
3683
|
+
value: WorkqueueColumnValue
|
|
3684
|
+
});
|
|
3685
|
+
function defineWorkqueuesColumns(workqueueColumns) {
|
|
3686
|
+
return workqueueColumns.map(
|
|
3687
|
+
(workqueueColumn) => WorkqueueColumn.parse(workqueueColumn)
|
|
3688
|
+
);
|
|
3689
|
+
}
|
|
3690
|
+
|
|
3691
|
+
// ../commons/src/events/CountryConfigQueryInput.ts
|
|
3692
|
+
var z31 = __toESM(require("zod/v4"));
|
|
3693
|
+
var SerializableExact = z31.object({
|
|
3694
|
+
type: z31.literal("exact"),
|
|
3695
|
+
term: z31.union([z31.string(), SerializedUserField])
|
|
3696
|
+
});
|
|
3697
|
+
var SerializableWithin = z31.object({
|
|
3698
|
+
type: z31.literal("within"),
|
|
3699
|
+
location: z31.union([z31.string(), SerializedUserField])
|
|
3700
|
+
});
|
|
3701
|
+
var SerializedQueryExpression = z31.object({
|
|
3702
|
+
eventType: z31.string(),
|
|
3703
|
+
status: z31.optional(z31.union([AnyOfStatus, ExactStatus])),
|
|
3704
|
+
createdAt: z31.optional(DateCondition),
|
|
3705
|
+
updatedAt: z31.optional(DateCondition),
|
|
3706
|
+
"legalStatuses.REGISTERED.createdAt": z31.optional(DateCondition),
|
|
3707
|
+
"legalStatuses.DECLARED.createdAtLocation": z31.optional(SerializableWithin),
|
|
3708
|
+
"legalStatuses.REGISTERED.createdAtLocation": z31.optional(SerializableWithin),
|
|
3709
|
+
"legalStatuses.REGISTERED.registrationNumber": z31.optional(Exact),
|
|
3710
|
+
createdAtLocation: z31.optional(SerializableWithin),
|
|
3711
|
+
updatedAtLocation: z31.optional(SerializableWithin),
|
|
3712
|
+
assignedTo: z31.optional(SerializableExact),
|
|
3713
|
+
createdBy: z31.optional(SerializableExact),
|
|
3714
|
+
createdByUserType: ExactUserType,
|
|
3715
|
+
updatedBy: z31.optional(SerializableExact),
|
|
3716
|
+
trackingId: z31.optional(Exact),
|
|
3717
|
+
flags: z31.optional(ContainsFlags),
|
|
3718
|
+
data: QueryInput
|
|
3719
|
+
}).partial();
|
|
3720
|
+
var Or2 = z31.object({
|
|
3721
|
+
type: z31.literal("or"),
|
|
3722
|
+
clauses: z31.array(SerializedQueryExpression)
|
|
3723
|
+
});
|
|
3724
|
+
var And2 = z31.object({
|
|
3725
|
+
type: z31.literal("and"),
|
|
3726
|
+
clauses: z31.array(SerializedQueryExpression)
|
|
3727
|
+
});
|
|
3728
|
+
var CountryConfigQueryType = z31.discriminatedUnion("type", [And2, Or2]);
|
|
3729
|
+
var CountryConfigQueryInputType = z31.union([
|
|
3730
|
+
SerializedQueryExpression,
|
|
3731
|
+
And2,
|
|
3732
|
+
Or2
|
|
3609
3733
|
]);
|
|
3610
3734
|
|
|
3611
3735
|
// ../commons/src/events/WorkqueueConfig.ts
|
|
@@ -3627,23 +3751,24 @@ var mandatoryColumns = defineWorkqueuesColumns([
|
|
|
3627
3751
|
value: event.field("updatedAt")
|
|
3628
3752
|
}
|
|
3629
3753
|
]);
|
|
3630
|
-
var WorkqueueActionsWithDefault =
|
|
3754
|
+
var WorkqueueActionsWithDefault = z32.enum([
|
|
3631
3755
|
...workqueueActions.options,
|
|
3632
|
-
"DEFAULT"
|
|
3756
|
+
"DEFAULT",
|
|
3757
|
+
ActionType.READ
|
|
3633
3758
|
]);
|
|
3634
|
-
var WorkqueueConfig =
|
|
3635
|
-
slug:
|
|
3759
|
+
var WorkqueueConfig = z32.object({
|
|
3760
|
+
slug: z32.string().describe("Determines the url of the workqueue."),
|
|
3636
3761
|
name: TranslationConfig.describe(
|
|
3637
3762
|
"Title of the workflow (both in navigation and on the page)"
|
|
3638
3763
|
),
|
|
3639
3764
|
query: CountryConfigQueryType,
|
|
3640
|
-
actions:
|
|
3641
|
-
|
|
3765
|
+
actions: z32.array(
|
|
3766
|
+
z32.object({
|
|
3642
3767
|
type: WorkqueueActionsWithDefault,
|
|
3643
|
-
conditionals:
|
|
3768
|
+
conditionals: z32.array(Conditional).optional()
|
|
3644
3769
|
})
|
|
3645
3770
|
),
|
|
3646
|
-
columns:
|
|
3771
|
+
columns: z32.array(WorkqueueColumn).default(mandatoryColumns),
|
|
3647
3772
|
icon: AvailableIcons,
|
|
3648
3773
|
emptyMessage: TranslationConfig.optional()
|
|
3649
3774
|
}).describe("Configuration for workqueue.");
|
|
@@ -3651,26 +3776,26 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
|
|
|
3651
3776
|
query: true,
|
|
3652
3777
|
columns: true
|
|
3653
3778
|
});
|
|
3654
|
-
var WorkqueueConfigInput =
|
|
3655
|
-
slug:
|
|
3779
|
+
var WorkqueueConfigInput = z32.object({
|
|
3780
|
+
slug: z32.string().describe("Determines the url of the workqueue."),
|
|
3656
3781
|
name: TranslationConfig.describe(
|
|
3657
3782
|
"Title of the workflow (both in navigation and on the page)"
|
|
3658
3783
|
),
|
|
3659
3784
|
query: CountryConfigQueryInputType,
|
|
3660
|
-
actions:
|
|
3661
|
-
|
|
3785
|
+
actions: z32.array(
|
|
3786
|
+
z32.object({
|
|
3662
3787
|
type: WorkqueueActionsWithDefault,
|
|
3663
|
-
conditionals:
|
|
3788
|
+
conditionals: z32.array(Conditional).optional()
|
|
3664
3789
|
})
|
|
3665
3790
|
),
|
|
3666
|
-
columns:
|
|
3791
|
+
columns: z32.array(WorkqueueColumn).default(mandatoryColumns),
|
|
3667
3792
|
icon: AvailableIcons,
|
|
3668
3793
|
emptyMessage: TranslationConfig.optional()
|
|
3669
3794
|
});
|
|
3670
|
-
var WorkqueueCountInput =
|
|
3671
|
-
|
|
3795
|
+
var WorkqueueCountInput = z32.array(
|
|
3796
|
+
z32.object({ slug: z32.string(), query: QueryType })
|
|
3672
3797
|
);
|
|
3673
|
-
var WorkqueueCountOutput =
|
|
3798
|
+
var WorkqueueCountOutput = z32.record(z32.string(), z32.number());
|
|
3674
3799
|
|
|
3675
3800
|
// ../commons/src/events/workqueueDefaultColumns.ts
|
|
3676
3801
|
var defaultWorkqueueColumns = [
|
|
@@ -3693,47 +3818,40 @@ var defaultWorkqueueColumns = [
|
|
|
3693
3818
|
];
|
|
3694
3819
|
|
|
3695
3820
|
// ../commons/src/events/Draft.ts
|
|
3696
|
-
var
|
|
3821
|
+
var z34 = __toESM(require("zod/v4"));
|
|
3697
3822
|
|
|
3698
3823
|
// ../commons/src/events/ActionInput.ts
|
|
3699
|
-
var
|
|
3700
|
-
var
|
|
3701
|
-
(0, import_zod_openapi11.extendZodWithOpenApi)(import_zod31.z);
|
|
3702
|
-
var BaseActionInput = import_zod31.z.object({
|
|
3824
|
+
var z33 = __toESM(require("zod/v4"));
|
|
3825
|
+
var BaseActionInput = z33.object({
|
|
3703
3826
|
eventId: UUID,
|
|
3704
|
-
transactionId:
|
|
3827
|
+
transactionId: z33.string(),
|
|
3705
3828
|
declaration: ActionUpdate.default({}),
|
|
3706
3829
|
annotation: ActionUpdate.optional(),
|
|
3707
3830
|
originalActionId: UUID.optional(),
|
|
3708
3831
|
// should not be part of base action.
|
|
3709
|
-
keepAssignment:
|
|
3832
|
+
keepAssignment: z33.boolean().optional(),
|
|
3710
3833
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
3711
3834
|
createdAtLocation: CreatedAtLocation.describe(
|
|
3712
3835
|
"A valid office location ID. This is required for system users performing actions. The provided location must be a leaf-location, i.e. it must not have any children locations."
|
|
3713
3836
|
)
|
|
3714
3837
|
});
|
|
3715
|
-
var CreateActionInput = BaseActionInput.
|
|
3716
|
-
|
|
3717
|
-
type:
|
|
3838
|
+
var CreateActionInput = BaseActionInput.extend(
|
|
3839
|
+
z33.object({
|
|
3840
|
+
type: z33.literal(ActionType.CREATE).default(ActionType.CREATE),
|
|
3718
3841
|
createdAtLocation: CreatedAtLocation
|
|
3719
|
-
})
|
|
3842
|
+
}).shape
|
|
3720
3843
|
);
|
|
3721
|
-
var RegisterActionInput = BaseActionInput.
|
|
3722
|
-
|
|
3723
|
-
type:
|
|
3724
|
-
registrationNumber:
|
|
3725
|
-
})
|
|
3726
|
-
).strict();
|
|
3727
|
-
var ValidateActionInput = BaseActionInput.merge(
|
|
3728
|
-
import_zod31.z.object({
|
|
3729
|
-
type: import_zod31.z.literal(ActionType.VALIDATE).default(ActionType.VALIDATE)
|
|
3730
|
-
})
|
|
3844
|
+
var RegisterActionInput = BaseActionInput.extend(
|
|
3845
|
+
z33.strictObject({
|
|
3846
|
+
type: z33.literal(ActionType.REGISTER).default(ActionType.REGISTER),
|
|
3847
|
+
registrationNumber: z33.string().optional()
|
|
3848
|
+
}).shape
|
|
3731
3849
|
);
|
|
3732
|
-
var NotifyActionInput = BaseActionInput.
|
|
3733
|
-
|
|
3734
|
-
type:
|
|
3735
|
-
})
|
|
3736
|
-
).
|
|
3850
|
+
var NotifyActionInput = BaseActionInput.extend(
|
|
3851
|
+
z33.object({
|
|
3852
|
+
type: z33.literal(ActionType.NOTIFY).default(ActionType.NOTIFY)
|
|
3853
|
+
}).shape
|
|
3854
|
+
).meta({
|
|
3737
3855
|
default: {
|
|
3738
3856
|
eventId: "<event-id-here>",
|
|
3739
3857
|
transactionId: getUUID(),
|
|
@@ -3742,135 +3860,150 @@ var NotifyActionInput = BaseActionInput.merge(
|
|
|
3742
3860
|
type: ActionType.NOTIFY
|
|
3743
3861
|
}
|
|
3744
3862
|
});
|
|
3745
|
-
var DeclareActionInput = BaseActionInput.
|
|
3746
|
-
|
|
3747
|
-
type:
|
|
3748
|
-
})
|
|
3863
|
+
var DeclareActionInput = BaseActionInput.extend(
|
|
3864
|
+
z33.object({
|
|
3865
|
+
type: z33.literal(ActionType.DECLARE).default(ActionType.DECLARE)
|
|
3866
|
+
}).shape
|
|
3867
|
+
);
|
|
3868
|
+
var EditActionInput = BaseActionInput.extend(
|
|
3869
|
+
z33.object({
|
|
3870
|
+
type: z33.literal(ActionType.EDIT).default(ActionType.EDIT),
|
|
3871
|
+
content: z33.object({
|
|
3872
|
+
comment: z33.string().describe("Comment for the edit action.").optional()
|
|
3873
|
+
})
|
|
3874
|
+
}).shape
|
|
3749
3875
|
);
|
|
3750
|
-
var PrintCertificateActionInput = BaseActionInput.
|
|
3751
|
-
|
|
3752
|
-
type:
|
|
3876
|
+
var PrintCertificateActionInput = BaseActionInput.extend(
|
|
3877
|
+
z33.object({
|
|
3878
|
+
type: z33.literal(ActionType.PRINT_CERTIFICATE).default(ActionType.PRINT_CERTIFICATE),
|
|
3753
3879
|
content: PrintContent.optional()
|
|
3754
|
-
})
|
|
3880
|
+
}).shape
|
|
3755
3881
|
);
|
|
3756
|
-
var RejectDeclarationActionInput = BaseActionInput.
|
|
3757
|
-
|
|
3758
|
-
type:
|
|
3882
|
+
var RejectDeclarationActionInput = BaseActionInput.extend(
|
|
3883
|
+
z33.object({
|
|
3884
|
+
type: z33.literal(ActionType.REJECT).default(ActionType.REJECT),
|
|
3759
3885
|
content: ReasonContent
|
|
3760
|
-
})
|
|
3886
|
+
}).shape
|
|
3761
3887
|
);
|
|
3762
|
-
var DuplicateDetectedActionInput = BaseActionInput.
|
|
3763
|
-
|
|
3764
|
-
type:
|
|
3765
|
-
content:
|
|
3766
|
-
duplicates:
|
|
3888
|
+
var DuplicateDetectedActionInput = BaseActionInput.extend(
|
|
3889
|
+
z33.object({
|
|
3890
|
+
type: z33.literal(ActionType.DUPLICATE_DETECTED).default(ActionType.DUPLICATE_DETECTED),
|
|
3891
|
+
content: z33.object({
|
|
3892
|
+
duplicates: z33.array(PotentialDuplicate)
|
|
3767
3893
|
})
|
|
3768
|
-
})
|
|
3894
|
+
}).shape
|
|
3769
3895
|
);
|
|
3770
|
-
var MarkAsDuplicateActionInput = BaseActionInput.
|
|
3771
|
-
|
|
3772
|
-
type:
|
|
3773
|
-
content:
|
|
3896
|
+
var MarkAsDuplicateActionInput = BaseActionInput.extend(
|
|
3897
|
+
z33.object({
|
|
3898
|
+
type: z33.literal(ActionType.MARK_AS_DUPLICATE).default(ActionType.MARK_AS_DUPLICATE),
|
|
3899
|
+
content: z33.object({
|
|
3774
3900
|
duplicateOf: UUID
|
|
3775
3901
|
}).optional()
|
|
3776
|
-
})
|
|
3902
|
+
}).shape
|
|
3777
3903
|
);
|
|
3778
|
-
var MarkNotDuplicateActionInput = BaseActionInput.
|
|
3779
|
-
|
|
3780
|
-
type:
|
|
3781
|
-
})
|
|
3904
|
+
var MarkNotDuplicateActionInput = BaseActionInput.extend(
|
|
3905
|
+
z33.object({
|
|
3906
|
+
type: z33.literal(ActionType.MARK_AS_NOT_DUPLICATE).default(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
3907
|
+
}).shape
|
|
3782
3908
|
);
|
|
3783
|
-
var ArchiveActionInput = BaseActionInput.
|
|
3784
|
-
|
|
3785
|
-
type:
|
|
3909
|
+
var ArchiveActionInput = BaseActionInput.extend(
|
|
3910
|
+
z33.object({
|
|
3911
|
+
type: z33.literal(ActionType.ARCHIVE).default(ActionType.ARCHIVE),
|
|
3786
3912
|
content: ReasonContent
|
|
3787
|
-
})
|
|
3913
|
+
}).shape
|
|
3788
3914
|
);
|
|
3789
|
-
var AssignActionInput = BaseActionInput.
|
|
3790
|
-
|
|
3791
|
-
type:
|
|
3792
|
-
assignedTo:
|
|
3793
|
-
})
|
|
3915
|
+
var AssignActionInput = BaseActionInput.extend(
|
|
3916
|
+
z33.object({
|
|
3917
|
+
type: z33.literal(ActionType.ASSIGN),
|
|
3918
|
+
assignedTo: z33.string()
|
|
3919
|
+
}).shape
|
|
3794
3920
|
);
|
|
3795
|
-
var UnassignActionInput = BaseActionInput.
|
|
3796
|
-
|
|
3797
|
-
type:
|
|
3798
|
-
assignedTo:
|
|
3799
|
-
})
|
|
3921
|
+
var UnassignActionInput = BaseActionInput.extend(
|
|
3922
|
+
z33.object({
|
|
3923
|
+
type: z33.literal(ActionType.UNASSIGN).default(ActionType.UNASSIGN),
|
|
3924
|
+
assignedTo: z33.literal(null).default(null)
|
|
3925
|
+
}).shape
|
|
3800
3926
|
);
|
|
3801
|
-
var RequestCorrectionActionInput = BaseActionInput.
|
|
3802
|
-
|
|
3803
|
-
type:
|
|
3804
|
-
})
|
|
3927
|
+
var RequestCorrectionActionInput = BaseActionInput.extend(
|
|
3928
|
+
z33.object({
|
|
3929
|
+
type: z33.literal(ActionType.REQUEST_CORRECTION).default(ActionType.REQUEST_CORRECTION)
|
|
3930
|
+
}).shape
|
|
3805
3931
|
);
|
|
3806
|
-
var RejectCorrectionActionInput = BaseActionInput.
|
|
3807
|
-
|
|
3808
|
-
requestId:
|
|
3809
|
-
type:
|
|
3932
|
+
var RejectCorrectionActionInput = BaseActionInput.extend(
|
|
3933
|
+
z33.object({
|
|
3934
|
+
requestId: z33.string(),
|
|
3935
|
+
type: z33.literal(ActionType.REJECT_CORRECTION).default(ActionType.REJECT_CORRECTION),
|
|
3810
3936
|
content: ReasonContent
|
|
3811
|
-
})
|
|
3937
|
+
}).shape
|
|
3812
3938
|
);
|
|
3813
|
-
var ApproveCorrectionActionInput = BaseActionInput.
|
|
3814
|
-
|
|
3815
|
-
requestId:
|
|
3816
|
-
type:
|
|
3817
|
-
})
|
|
3939
|
+
var ApproveCorrectionActionInput = BaseActionInput.extend(
|
|
3940
|
+
z33.object({
|
|
3941
|
+
requestId: z33.string(),
|
|
3942
|
+
type: z33.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
|
|
3943
|
+
}).shape
|
|
3818
3944
|
);
|
|
3819
|
-
var ReadActionInput = BaseActionInput.
|
|
3820
|
-
|
|
3821
|
-
type:
|
|
3822
|
-
})
|
|
3945
|
+
var ReadActionInput = BaseActionInput.extend(
|
|
3946
|
+
z33.object({
|
|
3947
|
+
type: z33.literal(ActionType.READ).default(ActionType.READ)
|
|
3948
|
+
}).shape
|
|
3949
|
+
);
|
|
3950
|
+
var DeleteActionInput = z33.object({ eventId: UUID });
|
|
3951
|
+
var CustomActionInput = BaseActionInput.extend(
|
|
3952
|
+
z33.object({
|
|
3953
|
+
type: z33.literal(ActionType.CUSTOM).default(ActionType.CUSTOM),
|
|
3954
|
+
customActionType: z33.string().describe("Name of the custom action.")
|
|
3955
|
+
}).shape
|
|
3823
3956
|
);
|
|
3824
|
-
var
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
RejectDeclarationActionInput.openapi({
|
|
3832
|
-
ref: "RejectDeclarationActionInput"
|
|
3957
|
+
var ActionInput = z33.discriminatedUnion("type", [
|
|
3958
|
+
CreateActionInput.meta({ id: "CreateActionInput" }),
|
|
3959
|
+
RegisterActionInput.meta({ id: "RegisterActionInput" }),
|
|
3960
|
+
NotifyActionInput.meta({ id: "NotifyActionInput" }),
|
|
3961
|
+
DeclareActionInput.meta({ id: "DeclareActionInput" }),
|
|
3962
|
+
RejectDeclarationActionInput.meta({
|
|
3963
|
+
id: "RejectDeclarationActionInput"
|
|
3833
3964
|
}),
|
|
3834
|
-
DuplicateDetectedActionInput.
|
|
3835
|
-
|
|
3965
|
+
DuplicateDetectedActionInput.meta({
|
|
3966
|
+
id: "DuplicateDetectedActionInput"
|
|
3836
3967
|
}),
|
|
3837
|
-
MarkAsDuplicateActionInput.
|
|
3838
|
-
|
|
3968
|
+
MarkAsDuplicateActionInput.meta({
|
|
3969
|
+
id: "MarkAsDuplicateActionInput"
|
|
3839
3970
|
}),
|
|
3840
|
-
MarkNotDuplicateActionInput.
|
|
3841
|
-
|
|
3971
|
+
MarkNotDuplicateActionInput.meta({
|
|
3972
|
+
id: "MarkNotDuplicateActionInput"
|
|
3842
3973
|
}),
|
|
3843
|
-
ArchiveActionInput.
|
|
3844
|
-
AssignActionInput.
|
|
3845
|
-
UnassignActionInput.
|
|
3846
|
-
PrintCertificateActionInput.
|
|
3847
|
-
RequestCorrectionActionInput.
|
|
3848
|
-
|
|
3974
|
+
ArchiveActionInput.meta({ id: "ArchiveActionInput" }),
|
|
3975
|
+
AssignActionInput.meta({ id: "AssignActionInput" }),
|
|
3976
|
+
UnassignActionInput.meta({ id: "UnassignActionInput" }),
|
|
3977
|
+
PrintCertificateActionInput.meta({ id: "PrintCertificateActionInput" }),
|
|
3978
|
+
RequestCorrectionActionInput.meta({
|
|
3979
|
+
id: "RequestCorrectionActionInput"
|
|
3849
3980
|
}),
|
|
3850
|
-
RejectCorrectionActionInput.
|
|
3851
|
-
ApproveCorrectionActionInput.
|
|
3852
|
-
|
|
3981
|
+
RejectCorrectionActionInput.meta({ id: "RejectCorrectionActionInput" }),
|
|
3982
|
+
ApproveCorrectionActionInput.meta({
|
|
3983
|
+
id: "ApproveCorrectionActionInput"
|
|
3853
3984
|
}),
|
|
3854
|
-
ReadActionInput.
|
|
3855
|
-
|
|
3856
|
-
|
|
3985
|
+
ReadActionInput.meta({ id: "ReadActionInput" }),
|
|
3986
|
+
CustomActionInput.meta({ id: "CustomActionInput" }),
|
|
3987
|
+
EditActionInput.meta({ id: "EditActionInput" })
|
|
3988
|
+
]).meta({
|
|
3989
|
+
id: "ActionInput"
|
|
3857
3990
|
});
|
|
3858
3991
|
|
|
3859
3992
|
// ../commons/src/events/Draft.ts
|
|
3860
|
-
var Draft =
|
|
3993
|
+
var Draft = z34.object({
|
|
3861
3994
|
id: UUID,
|
|
3862
3995
|
eventId: UUID,
|
|
3863
|
-
transactionId:
|
|
3864
|
-
createdAt:
|
|
3996
|
+
transactionId: z34.string(),
|
|
3997
|
+
createdAt: z34.string().datetime(),
|
|
3865
3998
|
action: ActionBase.extend({
|
|
3866
|
-
type: ActionTypes.exclude([ActionTypes.
|
|
3999
|
+
type: ActionTypes.exclude([ActionTypes.enum.DELETE])
|
|
3867
4000
|
}).omit({ id: true, createdAtLocation: true })
|
|
3868
4001
|
}).describe(
|
|
3869
4002
|
"A temporary storage for an action. Stored with details of the event, creator and creation time."
|
|
3870
4003
|
);
|
|
3871
4004
|
var DraftInput = BaseActionInput.extend({
|
|
3872
|
-
type: ActionTypes.exclude([ActionTypes.
|
|
3873
|
-
status:
|
|
4005
|
+
type: ActionTypes.exclude([ActionTypes.enum.DELETE]),
|
|
4006
|
+
status: z34.enum([
|
|
3874
4007
|
ActionStatus.Requested,
|
|
3875
4008
|
ActionStatus.Accepted,
|
|
3876
4009
|
ActionStatus.Rejected
|
|
@@ -3878,32 +4011,30 @@ var DraftInput = BaseActionInput.extend({
|
|
|
3878
4011
|
});
|
|
3879
4012
|
|
|
3880
4013
|
// ../commons/src/events/EventInput.ts
|
|
3881
|
-
var
|
|
4014
|
+
var z35 = __toESM(require("zod/v4"));
|
|
3882
4015
|
var import_uuid10 = require("uuid");
|
|
3883
|
-
var EventInput =
|
|
3884
|
-
transactionId:
|
|
3885
|
-
type:
|
|
3886
|
-
}).
|
|
4016
|
+
var EventInput = z35.object({
|
|
4017
|
+
transactionId: z35.string(),
|
|
4018
|
+
type: z35.string()
|
|
4019
|
+
}).meta({ default: { transactionId: (0, import_uuid10.v4)(), type: "birth" } });
|
|
3887
4020
|
|
|
3888
4021
|
// ../commons/src/events/EventDocument.ts
|
|
3889
|
-
var
|
|
3890
|
-
var
|
|
3891
|
-
(0, import_zod_openapi12.extendZodWithOpenApi)(import_zod34.z);
|
|
3892
|
-
var EventDocument = import_zod34.z.object({
|
|
4022
|
+
var z36 = __toESM(require("zod/v4"));
|
|
4023
|
+
var EventDocument = z36.object({
|
|
3893
4024
|
id: UUID.describe("Unique identifier of the event."),
|
|
3894
|
-
type:
|
|
3895
|
-
createdAt:
|
|
3896
|
-
updatedAt:
|
|
4025
|
+
type: z36.string().describe("Type of the event (e.g. birth, death, marriage)."),
|
|
4026
|
+
createdAt: z36.string().datetime().describe("Timestamp indicating when the event was created."),
|
|
4027
|
+
updatedAt: z36.string().datetime().describe(
|
|
3897
4028
|
"Timestamp of the last update, excluding changes from actions."
|
|
3898
4029
|
),
|
|
3899
|
-
actions:
|
|
3900
|
-
trackingId:
|
|
4030
|
+
actions: z36.array(Action).describe("Ordered list of actions associated with the event."),
|
|
4031
|
+
trackingId: z36.string().describe(
|
|
3901
4032
|
"System-generated tracking identifier used to look up the event."
|
|
3902
4033
|
)
|
|
3903
|
-
}).
|
|
4034
|
+
}).meta({ id: "EventDocument" });
|
|
3904
4035
|
|
|
3905
4036
|
// ../commons/src/events/state/index.ts
|
|
3906
|
-
var
|
|
4037
|
+
var import_lodash4 = require("lodash");
|
|
3907
4038
|
|
|
3908
4039
|
// ../commons/src/events/state/utils.ts
|
|
3909
4040
|
var import_lodash2 = require("lodash");
|
|
@@ -3911,14 +4042,18 @@ var updateActions = ActionTypes.extract([
|
|
|
3911
4042
|
ActionType.CREATE,
|
|
3912
4043
|
ActionType.NOTIFY,
|
|
3913
4044
|
ActionType.DECLARE,
|
|
3914
|
-
ActionType.VALIDATE,
|
|
3915
4045
|
ActionType.REGISTER,
|
|
3916
4046
|
ActionType.REJECT,
|
|
3917
4047
|
ActionType.ARCHIVE,
|
|
3918
4048
|
ActionType.PRINT_CERTIFICATE,
|
|
3919
|
-
ActionType.REQUEST_CORRECTION
|
|
4049
|
+
ActionType.REQUEST_CORRECTION,
|
|
4050
|
+
ActionType.CUSTOM
|
|
3920
4051
|
]);
|
|
3921
4052
|
|
|
4053
|
+
// ../commons/src/events/state/flags.ts
|
|
4054
|
+
var import_lodash3 = require("lodash");
|
|
4055
|
+
var import_date_fns3 = require("date-fns");
|
|
4056
|
+
|
|
3922
4057
|
// ../commons/src/events/defineConfig.ts
|
|
3923
4058
|
var defineConfig = (config) => {
|
|
3924
4059
|
const input = EventConfig.parse(config);
|
|
@@ -3926,7 +4061,7 @@ var defineConfig = (config) => {
|
|
|
3926
4061
|
};
|
|
3927
4062
|
|
|
3928
4063
|
// ../commons/src/events/test.utils.ts
|
|
3929
|
-
var
|
|
4064
|
+
var import_lodash5 = require("lodash");
|
|
3930
4065
|
var import_date_fns4 = require("date-fns");
|
|
3931
4066
|
|
|
3932
4067
|
// ../commons/src/field-config/field-configuration.ts
|
|
@@ -3948,7 +4083,6 @@ function field(fieldId, options = {}) {
|
|
|
3948
4083
|
}
|
|
3949
4084
|
|
|
3950
4085
|
// ../commons/src/fixtures/forms.ts
|
|
3951
|
-
var import_date_fns3 = require("date-fns");
|
|
3952
4086
|
var PRINT_CERTIFICATE_FORM = defineActionForm({
|
|
3953
4087
|
label: {
|
|
3954
4088
|
id: "event.tennis-club-membership.action.certificate.form.label",
|
|
@@ -4748,7 +4882,7 @@ var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
|
|
|
4748
4882
|
conditionals: [
|
|
4749
4883
|
{
|
|
4750
4884
|
type: ConditionalType.DISPLAY_ON_REVIEW,
|
|
4751
|
-
conditional:
|
|
4885
|
+
conditional: never2()
|
|
4752
4886
|
}
|
|
4753
4887
|
]
|
|
4754
4888
|
},
|
|
@@ -5131,119 +5265,16 @@ var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
|
|
|
5131
5265
|
}
|
|
5132
5266
|
}
|
|
5133
5267
|
],
|
|
5134
|
-
conditional: not(
|
|
5268
|
+
conditional: not(never2())
|
|
5135
5269
|
// Intentional always-true page conditional to exercise interactions between page-level and field-level conditionals in tests
|
|
5136
5270
|
}
|
|
5137
5271
|
]
|
|
5138
5272
|
});
|
|
5139
|
-
var statusOptions = [
|
|
5140
|
-
{
|
|
5141
|
-
value: "ALL",
|
|
5142
|
-
label: {
|
|
5143
|
-
defaultMessage: "Any status",
|
|
5144
|
-
description: "Option for form field: status of record",
|
|
5145
|
-
id: "advancedSearch.form.recordStatusAny"
|
|
5146
|
-
}
|
|
5147
|
-
},
|
|
5148
|
-
{
|
|
5149
|
-
value: EventStatus.enum.CREATED,
|
|
5150
|
-
label: {
|
|
5151
|
-
defaultMessage: "Draft",
|
|
5152
|
-
description: "Option for form field: status of record",
|
|
5153
|
-
id: "advancedSearch.form.recordStatusCreated"
|
|
5154
|
-
}
|
|
5155
|
-
},
|
|
5156
|
-
{
|
|
5157
|
-
value: EventStatus.enum.NOTIFIED,
|
|
5158
|
-
label: {
|
|
5159
|
-
defaultMessage: "Notified",
|
|
5160
|
-
description: "Option for form field: status of record",
|
|
5161
|
-
id: "advancedSearch.form.recordStatusNotified"
|
|
5162
|
-
}
|
|
5163
|
-
},
|
|
5164
|
-
{
|
|
5165
|
-
value: EventStatus.enum.DECLARED,
|
|
5166
|
-
label: {
|
|
5167
|
-
defaultMessage: "Declared",
|
|
5168
|
-
description: "Option for form field: status of record",
|
|
5169
|
-
id: "advancedSearch.form.recordStatusDeclared"
|
|
5170
|
-
}
|
|
5171
|
-
},
|
|
5172
|
-
{
|
|
5173
|
-
value: EventStatus.enum.VALIDATED,
|
|
5174
|
-
label: {
|
|
5175
|
-
defaultMessage: "Validated",
|
|
5176
|
-
description: "Option for form field: status of record",
|
|
5177
|
-
id: "advancedSearch.form.recordStatusValidated"
|
|
5178
|
-
}
|
|
5179
|
-
},
|
|
5180
|
-
{
|
|
5181
|
-
value: EventStatus.enum.REGISTERED,
|
|
5182
|
-
label: {
|
|
5183
|
-
defaultMessage: "Registered",
|
|
5184
|
-
description: "Option for form field: status of record",
|
|
5185
|
-
id: "advancedSearch.form.recordStatusRegistered"
|
|
5186
|
-
}
|
|
5187
|
-
},
|
|
5188
|
-
{
|
|
5189
|
-
value: EventStatus.enum.ARCHIVED,
|
|
5190
|
-
label: {
|
|
5191
|
-
defaultMessage: "Archived",
|
|
5192
|
-
description: "Option for form field: status of record",
|
|
5193
|
-
id: "advancedSearch.form.recordStatusArchived"
|
|
5194
|
-
}
|
|
5195
|
-
}
|
|
5196
|
-
];
|
|
5197
|
-
var timePeriodOptions = [
|
|
5198
|
-
{
|
|
5199
|
-
label: {
|
|
5200
|
-
defaultMessage: "Last 7 days",
|
|
5201
|
-
description: "Label for option of time period select: last 7 days",
|
|
5202
|
-
id: "form.section.label.timePeriodLast7Days"
|
|
5203
|
-
},
|
|
5204
|
-
value: `${(0, import_date_fns3.format)((0, import_date_fns3.subDays)(/* @__PURE__ */ new Date(), 7), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
|
|
5205
|
-
/* @__PURE__ */ new Date(),
|
|
5206
|
-
"yyyy-MM-dd"
|
|
5207
|
-
)}`
|
|
5208
|
-
},
|
|
5209
|
-
{
|
|
5210
|
-
label: {
|
|
5211
|
-
defaultMessage: "Last 30 days",
|
|
5212
|
-
description: "Label for option of time period select: last 30 days",
|
|
5213
|
-
id: "form.section.label.timePeriodLast30Days"
|
|
5214
|
-
},
|
|
5215
|
-
value: `${(0, import_date_fns3.format)((0, import_date_fns3.subMonths)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
|
|
5216
|
-
/* @__PURE__ */ new Date(),
|
|
5217
|
-
"yyyy-MM-dd"
|
|
5218
|
-
)}`
|
|
5219
|
-
},
|
|
5220
|
-
{
|
|
5221
|
-
label: {
|
|
5222
|
-
defaultMessage: "Last 90 days",
|
|
5223
|
-
description: "Label for option of time period select: last 90 days",
|
|
5224
|
-
id: "form.section.label.timePeriodLast90Days"
|
|
5225
|
-
},
|
|
5226
|
-
value: `${(0, import_date_fns3.format)((0, import_date_fns3.subQuarters)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
|
|
5227
|
-
/* @__PURE__ */ new Date(),
|
|
5228
|
-
"yyyy-MM-dd"
|
|
5229
|
-
)}`
|
|
5230
|
-
},
|
|
5231
|
-
{
|
|
5232
|
-
label: {
|
|
5233
|
-
defaultMessage: "Last year",
|
|
5234
|
-
description: "Label for option of time period select: last year",
|
|
5235
|
-
id: "form.section.label.timePeriodLastYear"
|
|
5236
|
-
},
|
|
5237
|
-
value: `${(0, import_date_fns3.format)((0, import_date_fns3.subYears)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
|
|
5238
|
-
/* @__PURE__ */ new Date(),
|
|
5239
|
-
"yyyy-MM-dd"
|
|
5240
|
-
)}`
|
|
5241
|
-
}
|
|
5242
|
-
];
|
|
5243
5273
|
|
|
5244
5274
|
// ../commons/src/fixtures/tennis-club-membership-event.ts
|
|
5245
5275
|
var tennisClubMembershipEvent = defineConfig({
|
|
5246
5276
|
id: TENNIS_CLUB_MEMBERSHIP,
|
|
5277
|
+
declaration: TENNIS_CLUB_DECLARATION_FORM,
|
|
5247
5278
|
label: {
|
|
5248
5279
|
defaultMessage: "Tennis club membership application",
|
|
5249
5280
|
description: "This is what this event is referred as in the system",
|
|
@@ -5294,13 +5325,12 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5294
5325
|
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5295
5326
|
},
|
|
5296
5327
|
{
|
|
5297
|
-
type: ActionType.
|
|
5328
|
+
type: ActionType.REJECT,
|
|
5298
5329
|
label: {
|
|
5299
|
-
defaultMessage: "
|
|
5330
|
+
defaultMessage: "Reject",
|
|
5300
5331
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5301
|
-
id: "event.tennis-club-membership.action.
|
|
5302
|
-
}
|
|
5303
|
-
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5332
|
+
id: "event.tennis-club-membership.action.reject.label"
|
|
5333
|
+
}
|
|
5304
5334
|
},
|
|
5305
5335
|
{
|
|
5306
5336
|
type: ActionType.REGISTER,
|
|
@@ -5308,8 +5338,7 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5308
5338
|
defaultMessage: "Register",
|
|
5309
5339
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5310
5340
|
id: "event.tennis-club-membership.action.register.label"
|
|
5311
|
-
}
|
|
5312
|
-
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5341
|
+
}
|
|
5313
5342
|
},
|
|
5314
5343
|
{
|
|
5315
5344
|
type: ActionType.REQUEST_CORRECTION,
|
|
@@ -5512,14 +5541,6 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5512
5541
|
]
|
|
5513
5542
|
}
|
|
5514
5543
|
},
|
|
5515
|
-
{
|
|
5516
|
-
type: ActionType.APPROVE_CORRECTION,
|
|
5517
|
-
label: {
|
|
5518
|
-
defaultMessage: "Approve correction",
|
|
5519
|
-
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5520
|
-
id: "event.tennis-club-membership.action.correction.approve.label"
|
|
5521
|
-
}
|
|
5522
|
-
},
|
|
5523
5544
|
{
|
|
5524
5545
|
type: ActionType.PRINT_CERTIFICATE,
|
|
5525
5546
|
label: {
|
|
@@ -5528,22 +5549,6 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5528
5549
|
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5529
5550
|
},
|
|
5530
5551
|
printForm: PRINT_CERTIFICATE_FORM
|
|
5531
|
-
},
|
|
5532
|
-
{
|
|
5533
|
-
type: ActionType.ARCHIVE,
|
|
5534
|
-
label: {
|
|
5535
|
-
id: "event.tennis-club-membership.action.archive.label",
|
|
5536
|
-
defaultMessage: "Archive",
|
|
5537
|
-
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5538
|
-
}
|
|
5539
|
-
},
|
|
5540
|
-
{
|
|
5541
|
-
type: ActionType.REJECT,
|
|
5542
|
-
label: {
|
|
5543
|
-
id: "event.tennis-club-membership.action.reject.label",
|
|
5544
|
-
defaultMessage: "Reject",
|
|
5545
|
-
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5546
|
-
}
|
|
5547
5552
|
}
|
|
5548
5553
|
],
|
|
5549
5554
|
advancedSearch: [
|
|
@@ -5580,8 +5585,7 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5580
5585
|
},
|
|
5581
5586
|
fields: [field("recommender.name").fuzzy()]
|
|
5582
5587
|
}
|
|
5583
|
-
]
|
|
5584
|
-
declaration: TENNIS_CLUB_DECLARATION_FORM
|
|
5588
|
+
]
|
|
5585
5589
|
});
|
|
5586
5590
|
|
|
5587
5591
|
// ../commons/src/fixtures/football-club-membership-event.ts
|
|
@@ -5649,23 +5653,13 @@ var footballClubMembershipEvent = defineConfig({
|
|
|
5649
5653
|
},
|
|
5650
5654
|
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5651
5655
|
},
|
|
5652
|
-
{
|
|
5653
|
-
type: ActionType.VALIDATE,
|
|
5654
|
-
label: {
|
|
5655
|
-
defaultMessage: "Validate",
|
|
5656
|
-
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5657
|
-
id: "event.football-club-membership.action.validate.label"
|
|
5658
|
-
},
|
|
5659
|
-
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5660
|
-
},
|
|
5661
5656
|
{
|
|
5662
5657
|
type: ActionType.REGISTER,
|
|
5663
5658
|
label: {
|
|
5664
5659
|
defaultMessage: "Register",
|
|
5665
5660
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5666
5661
|
id: "event.football-club-membership.action.register.label"
|
|
5667
|
-
}
|
|
5668
|
-
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5662
|
+
}
|
|
5669
5663
|
},
|
|
5670
5664
|
{
|
|
5671
5665
|
type: ActionType.REQUEST_CORRECTION,
|
|
@@ -5871,14 +5865,6 @@ var footballClubMembershipEvent = defineConfig({
|
|
|
5871
5865
|
]
|
|
5872
5866
|
}
|
|
5873
5867
|
},
|
|
5874
|
-
{
|
|
5875
|
-
type: ActionType.APPROVE_CORRECTION,
|
|
5876
|
-
label: {
|
|
5877
|
-
defaultMessage: "Approve correction",
|
|
5878
|
-
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5879
|
-
id: "event.football-club-membership.action.correction.approve.label"
|
|
5880
|
-
}
|
|
5881
|
-
},
|
|
5882
5868
|
{
|
|
5883
5869
|
type: ActionType.PRINT_CERTIFICATE,
|
|
5884
5870
|
label: {
|
|
@@ -5887,22 +5873,6 @@ var footballClubMembershipEvent = defineConfig({
|
|
|
5887
5873
|
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5888
5874
|
},
|
|
5889
5875
|
printForm: PRINT_CERTIFICATE_FORM
|
|
5890
|
-
},
|
|
5891
|
-
{
|
|
5892
|
-
type: ActionType.ARCHIVE,
|
|
5893
|
-
label: {
|
|
5894
|
-
id: "event.football-club-membership.action.archive.label",
|
|
5895
|
-
defaultMessage: "Archive",
|
|
5896
|
-
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5897
|
-
}
|
|
5898
|
-
},
|
|
5899
|
-
{
|
|
5900
|
-
type: ActionType.REJECT,
|
|
5901
|
-
label: {
|
|
5902
|
-
id: "event.football-club-membership.action.reject.label",
|
|
5903
|
-
defaultMessage: "Reject",
|
|
5904
|
-
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5905
|
-
}
|
|
5906
5876
|
}
|
|
5907
5877
|
],
|
|
5908
5878
|
advancedSearch: [
|
|
@@ -6002,7 +5972,7 @@ var libraryMembershipEvent = defineConfig({
|
|
|
6002
5972
|
declaration: libraryMembershipForm
|
|
6003
5973
|
});
|
|
6004
5974
|
|
|
6005
|
-
// ../commons/src/fixtures/
|
|
5975
|
+
// ../commons/src/fixtures/child-onboarding-event.ts
|
|
6006
5976
|
function generateTranslationConfig(message) {
|
|
6007
5977
|
return {
|
|
6008
5978
|
defaultMessage: message,
|
|
@@ -6031,6 +6001,61 @@ var child = defineFormPage({
|
|
|
6031
6001
|
secured: true,
|
|
6032
6002
|
validation: [],
|
|
6033
6003
|
label: generateTranslationConfig("Date of birth")
|
|
6004
|
+
},
|
|
6005
|
+
{
|
|
6006
|
+
id: "child.placeOfBirth",
|
|
6007
|
+
analytics: true,
|
|
6008
|
+
type: FieldType.SELECT,
|
|
6009
|
+
required: true,
|
|
6010
|
+
secured: true,
|
|
6011
|
+
label: {
|
|
6012
|
+
defaultMessage: "Place of delivery",
|
|
6013
|
+
description: "This is the label for the field",
|
|
6014
|
+
id: "event.birth.action.declare.form.section.child.field.placeOfBirth.label"
|
|
6015
|
+
},
|
|
6016
|
+
options: [
|
|
6017
|
+
{
|
|
6018
|
+
value: "child.placeOfBirth-SELECT-2",
|
|
6019
|
+
label: generateTranslationConfig("Health Institution")
|
|
6020
|
+
},
|
|
6021
|
+
{
|
|
6022
|
+
value: "PRIVATE_HOME",
|
|
6023
|
+
label: generateTranslationConfig("Residential address")
|
|
6024
|
+
}
|
|
6025
|
+
]
|
|
6026
|
+
},
|
|
6027
|
+
{
|
|
6028
|
+
id: "child.birthLocation",
|
|
6029
|
+
analytics: true,
|
|
6030
|
+
type: "FACILITY",
|
|
6031
|
+
required: true,
|
|
6032
|
+
secured: true,
|
|
6033
|
+
label: generateTranslationConfig("Health Institution"),
|
|
6034
|
+
conditionals: [
|
|
6035
|
+
{
|
|
6036
|
+
type: "SHOW",
|
|
6037
|
+
conditional: field("child.placeOfBirth").isEqualTo(
|
|
6038
|
+
"child.placeOfBirth-SELECT-2"
|
|
6039
|
+
)
|
|
6040
|
+
}
|
|
6041
|
+
]
|
|
6042
|
+
},
|
|
6043
|
+
{
|
|
6044
|
+
id: "child.birthLocation.privateHome",
|
|
6045
|
+
analytics: true,
|
|
6046
|
+
type: FieldType.ADDRESS,
|
|
6047
|
+
secured: true,
|
|
6048
|
+
hideLabel: true,
|
|
6049
|
+
label: generateTranslationConfig("Child's address"),
|
|
6050
|
+
conditionals: [
|
|
6051
|
+
{
|
|
6052
|
+
type: "SHOW",
|
|
6053
|
+
conditional: field("child.placeOfBirth").isEqualTo("PRIVATE_HOME")
|
|
6054
|
+
}
|
|
6055
|
+
],
|
|
6056
|
+
configuration: {
|
|
6057
|
+
streetAddressForm: []
|
|
6058
|
+
}
|
|
6034
6059
|
}
|
|
6035
6060
|
]
|
|
6036
6061
|
});
|
|
@@ -6107,7 +6132,7 @@ var mother = defineFormPage({
|
|
|
6107
6132
|
}
|
|
6108
6133
|
]
|
|
6109
6134
|
});
|
|
6110
|
-
var
|
|
6135
|
+
var CHILD_ONBOARDING_DECLARATION_REVIEW = {
|
|
6111
6136
|
title: generateTranslationConfig(
|
|
6112
6137
|
"{child.name.firstname, select, __EMPTY__ {Birth declaration} other {{child.name.surname, select, __EMPTY__ {Birth declaration for {child.name.firstname}} other {Birth declaration for {child.name.firstname} {child.name.surname}}}}}"
|
|
6113
6138
|
),
|
|
@@ -6127,12 +6152,12 @@ var BIRTH_DECLARATION_REVIEW = {
|
|
|
6127
6152
|
}
|
|
6128
6153
|
]
|
|
6129
6154
|
};
|
|
6130
|
-
var
|
|
6155
|
+
var CHILD_ONBOARDING_DECLARATION_FORM = defineDeclarationForm({
|
|
6131
6156
|
label: generateTranslationConfig("Birth decalration form"),
|
|
6132
6157
|
pages: [child, mother]
|
|
6133
6158
|
});
|
|
6134
|
-
var
|
|
6135
|
-
id:
|
|
6159
|
+
var ChildOnboardingEvent = defineConfig({
|
|
6160
|
+
id: CHILD_ONBOARDING_EVENT,
|
|
6136
6161
|
title: generateTranslationConfig(
|
|
6137
6162
|
"{child.name.firstname} {child.name.surname}"
|
|
6138
6163
|
),
|
|
@@ -6140,27 +6165,21 @@ var v2BirthEvent = defineConfig({
|
|
|
6140
6165
|
summary: {
|
|
6141
6166
|
fields: []
|
|
6142
6167
|
},
|
|
6143
|
-
declaration:
|
|
6168
|
+
declaration: CHILD_ONBOARDING_DECLARATION_FORM,
|
|
6144
6169
|
actions: [
|
|
6145
6170
|
{
|
|
6146
6171
|
type: ActionType.READ,
|
|
6147
6172
|
label: generateTranslationConfig("Read"),
|
|
6148
|
-
review:
|
|
6173
|
+
review: CHILD_ONBOARDING_DECLARATION_REVIEW
|
|
6149
6174
|
},
|
|
6150
6175
|
{
|
|
6151
6176
|
type: ActionType.DECLARE,
|
|
6152
6177
|
label: generateTranslationConfig("Declare"),
|
|
6153
|
-
review:
|
|
6154
|
-
},
|
|
6155
|
-
{
|
|
6156
|
-
type: ActionType.VALIDATE,
|
|
6157
|
-
label: generateTranslationConfig("Validate"),
|
|
6158
|
-
review: BIRTH_DECLARATION_REVIEW
|
|
6178
|
+
review: CHILD_ONBOARDING_DECLARATION_REVIEW
|
|
6159
6179
|
},
|
|
6160
6180
|
{
|
|
6161
6181
|
type: ActionType.REGISTER,
|
|
6162
|
-
label: generateTranslationConfig("Register")
|
|
6163
|
-
review: BIRTH_DECLARATION_REVIEW
|
|
6182
|
+
label: generateTranslationConfig("Register")
|
|
6164
6183
|
}
|
|
6165
6184
|
],
|
|
6166
6185
|
advancedSearch: []
|
|
@@ -6248,7 +6267,7 @@ var PRINT_DIGITAL_ID_CERTIFICATE_FORM = defineActionForm({
|
|
|
6248
6267
|
conditionals: [
|
|
6249
6268
|
{
|
|
6250
6269
|
type: ConditionalType.ENABLE,
|
|
6251
|
-
conditional:
|
|
6270
|
+
conditional: never2()
|
|
6252
6271
|
},
|
|
6253
6272
|
{
|
|
6254
6273
|
type: ConditionalType.SHOW,
|
|
@@ -6275,7 +6294,7 @@ var PRINT_DIGITAL_ID_CERTIFICATE_FORM = defineActionForm({
|
|
|
6275
6294
|
conditionals: [
|
|
6276
6295
|
{
|
|
6277
6296
|
type: ConditionalType.ENABLE,
|
|
6278
|
-
conditional:
|
|
6297
|
+
conditional: never2()
|
|
6279
6298
|
},
|
|
6280
6299
|
{
|
|
6281
6300
|
type: ConditionalType.SHOW,
|
|
@@ -6303,7 +6322,7 @@ var PRINT_DIGITAL_ID_CERTIFICATE_FORM = defineActionForm({
|
|
|
6303
6322
|
conditionals: [
|
|
6304
6323
|
{
|
|
6305
6324
|
type: ConditionalType.ENABLE,
|
|
6306
|
-
conditional:
|
|
6325
|
+
conditional: never2()
|
|
6307
6326
|
}
|
|
6308
6327
|
],
|
|
6309
6328
|
value: field("identity.http-fetch").get("data.certificateId")
|
|
@@ -6381,8 +6400,8 @@ var digitalIdentityEvent = defineConfig({
|
|
|
6381
6400
|
});
|
|
6382
6401
|
|
|
6383
6402
|
// ../commons/src/events/test.utils.ts
|
|
6384
|
-
var
|
|
6385
|
-
var TestUserRole =
|
|
6403
|
+
var z37 = __toESM(require("zod/v4"));
|
|
6404
|
+
var TestUserRole = z37.enum([
|
|
6386
6405
|
"FIELD_AGENT",
|
|
6387
6406
|
"LOCAL_REGISTRAR",
|
|
6388
6407
|
"LOCAL_SYSTEM_ADMIN",
|
|
@@ -6393,18 +6412,14 @@ var TestUserRole = import_zod35.z.enum([
|
|
|
6393
6412
|
]);
|
|
6394
6413
|
|
|
6395
6414
|
// ../commons/src/events/scopes.ts
|
|
6396
|
-
var
|
|
6415
|
+
var import_lodash6 = require("lodash");
|
|
6397
6416
|
var ACTION_SCOPE_MAP = {
|
|
6398
6417
|
[ActionType.READ]: ["record.read"],
|
|
6399
6418
|
[ActionType.CREATE]: ["record.create"],
|
|
6400
6419
|
[ActionType.NOTIFY]: ["record.notify"],
|
|
6401
|
-
[ActionType.DECLARE]: [
|
|
6402
|
-
|
|
6403
|
-
"record.declared.validate",
|
|
6404
|
-
"record.register"
|
|
6405
|
-
],
|
|
6420
|
+
[ActionType.DECLARE]: ["record.declare", "record.register"],
|
|
6421
|
+
[ActionType.EDIT]: ["record.declared.edit"],
|
|
6406
6422
|
[ActionType.DELETE]: ["record.declare"],
|
|
6407
|
-
[ActionType.VALIDATE]: ["record.declared.validate", "record.register"],
|
|
6408
6423
|
[ActionType.REGISTER]: ["record.register"],
|
|
6409
6424
|
[ActionType.PRINT_CERTIFICATE]: ["record.registered.print-certified-copies"],
|
|
6410
6425
|
[ActionType.REQUEST_CORRECTION]: [
|
|
@@ -6422,7 +6437,8 @@ var ACTION_SCOPE_MAP = {
|
|
|
6422
6437
|
[ActionType.REJECT]: ["record.declared.reject"],
|
|
6423
6438
|
[ActionType.ASSIGN]: null,
|
|
6424
6439
|
[ActionType.UNASSIGN]: null,
|
|
6425
|
-
[ActionType.DUPLICATE_DETECTED]: []
|
|
6440
|
+
[ActionType.DUPLICATE_DETECTED]: [],
|
|
6441
|
+
[ActionType.CUSTOM]: []
|
|
6426
6442
|
};
|
|
6427
6443
|
|
|
6428
6444
|
// ../commons/src/events/state/availableActions.ts
|
|
@@ -6431,28 +6447,25 @@ var AVAILABLE_ACTIONS_BY_EVENT_STATUS = {
|
|
|
6431
6447
|
ActionType.READ,
|
|
6432
6448
|
ActionType.DECLARE,
|
|
6433
6449
|
ActionType.NOTIFY,
|
|
6434
|
-
ActionType.DELETE
|
|
6450
|
+
ActionType.DELETE,
|
|
6451
|
+
ActionType.CUSTOM
|
|
6435
6452
|
],
|
|
6436
6453
|
[EventStatus.enum.NOTIFIED]: [
|
|
6437
6454
|
ActionType.READ,
|
|
6438
6455
|
ActionType.DECLARE,
|
|
6439
6456
|
ActionType.MARK_AS_DUPLICATE,
|
|
6440
6457
|
ActionType.ARCHIVE,
|
|
6441
|
-
ActionType.REJECT
|
|
6458
|
+
ActionType.REJECT,
|
|
6459
|
+
ActionType.CUSTOM
|
|
6442
6460
|
],
|
|
6443
6461
|
[EventStatus.enum.DECLARED]: [
|
|
6444
|
-
ActionType.READ,
|
|
6445
|
-
ActionType.VALIDATE,
|
|
6446
|
-
ActionType.MARK_AS_DUPLICATE,
|
|
6447
|
-
ActionType.ARCHIVE,
|
|
6448
|
-
ActionType.REJECT
|
|
6449
|
-
],
|
|
6450
|
-
[EventStatus.enum.VALIDATED]: [
|
|
6451
6462
|
ActionType.READ,
|
|
6452
6463
|
ActionType.REGISTER,
|
|
6453
6464
|
ActionType.MARK_AS_DUPLICATE,
|
|
6454
6465
|
ActionType.ARCHIVE,
|
|
6455
|
-
ActionType.REJECT
|
|
6466
|
+
ActionType.REJECT,
|
|
6467
|
+
ActionType.CUSTOM,
|
|
6468
|
+
ActionType.EDIT
|
|
6456
6469
|
],
|
|
6457
6470
|
[EventStatus.enum.REGISTERED]: [
|
|
6458
6471
|
ActionType.READ,
|
|
@@ -6460,12 +6473,14 @@ var AVAILABLE_ACTIONS_BY_EVENT_STATUS = {
|
|
|
6460
6473
|
ActionType.REQUEST_CORRECTION,
|
|
6461
6474
|
ActionType.APPROVE_CORRECTION,
|
|
6462
6475
|
ActionType.REJECT_CORRECTION,
|
|
6476
|
+
ActionType.CUSTOM,
|
|
6463
6477
|
ClientSpecificAction.REVIEW_CORRECTION_REQUEST
|
|
6464
6478
|
],
|
|
6465
6479
|
[EventStatus.enum.ARCHIVED]: [
|
|
6466
6480
|
ActionType.READ,
|
|
6467
6481
|
ActionType.ASSIGN,
|
|
6468
|
-
ActionType.UNASSIGN
|
|
6482
|
+
ActionType.UNASSIGN,
|
|
6483
|
+
ActionType.CUSTOM
|
|
6469
6484
|
]
|
|
6470
6485
|
};
|
|
6471
6486
|
var ACTION_FILTERS = {
|
|
@@ -6475,32 +6490,33 @@ var ACTION_FILTERS = {
|
|
|
6475
6490
|
[ActionType.APPROVE_CORRECTION]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6476
6491
|
[ActionType.REJECT_CORRECTION]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6477
6492
|
[ActionType.MARK_AS_DUPLICATE]: (flags) => flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6478
|
-
[ActionType.
|
|
6493
|
+
[ActionType.EDIT]: (flags) => !flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6479
6494
|
[ActionType.REGISTER]: (flags) => !flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6480
6495
|
[ActionType.REJECT]: (flags) => !flags.includes(InherentFlags.REJECTED) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6481
6496
|
[ActionType.ARCHIVE]: (flags) => !flags.some((flag) => flag.endsWith(":requested"))
|
|
6482
6497
|
};
|
|
6483
6498
|
|
|
6484
6499
|
// ../commons/src/events/FileUtils.ts
|
|
6485
|
-
var
|
|
6500
|
+
var import_lodash7 = require("lodash");
|
|
6486
6501
|
|
|
6487
6502
|
// ../commons/src/events/locations.ts
|
|
6488
|
-
var
|
|
6489
|
-
var LocationType =
|
|
6503
|
+
var z38 = __toESM(require("zod/v4"));
|
|
6504
|
+
var LocationType = z38.enum([
|
|
6490
6505
|
"ADMIN_STRUCTURE",
|
|
6491
6506
|
"CRVS_OFFICE",
|
|
6492
6507
|
"HEALTH_FACILITY"
|
|
6493
6508
|
]);
|
|
6494
|
-
var Location =
|
|
6509
|
+
var Location = z38.object({
|
|
6495
6510
|
id: UUID,
|
|
6496
|
-
name:
|
|
6511
|
+
name: z38.string(),
|
|
6512
|
+
externalId: z38.string().nullable(),
|
|
6497
6513
|
parentId: UUID.nullable(),
|
|
6498
|
-
validUntil:
|
|
6514
|
+
validUntil: z38.iso.datetime().nullable(),
|
|
6499
6515
|
locationType: LocationType.nullable()
|
|
6500
6516
|
});
|
|
6501
6517
|
|
|
6502
6518
|
// ../commons/src/notification/UserNotifications.ts
|
|
6503
|
-
var
|
|
6519
|
+
var z39 = __toESM(require("zod/v4"));
|
|
6504
6520
|
var TriggerEvent = {
|
|
6505
6521
|
USER_CREATED: "user-created",
|
|
6506
6522
|
USER_UPDATED: "user-updated",
|
|
@@ -6512,50 +6528,50 @@ var TriggerEvent = {
|
|
|
6512
6528
|
CHANGE_PHONE_NUMBER: "change-phone-number",
|
|
6513
6529
|
CHANGE_EMAIL_ADDRESS: "change-email-address"
|
|
6514
6530
|
};
|
|
6515
|
-
var Recipient =
|
|
6531
|
+
var Recipient = z39.object({
|
|
6516
6532
|
name: NameFieldValue.optional(),
|
|
6517
|
-
mobile:
|
|
6518
|
-
email:
|
|
6519
|
-
bcc:
|
|
6533
|
+
mobile: z39.string().optional(),
|
|
6534
|
+
email: z39.string().optional(),
|
|
6535
|
+
bcc: z39.array(z39.string()).optional()
|
|
6520
6536
|
});
|
|
6521
|
-
var BasePayload =
|
|
6537
|
+
var BasePayload = z39.object({
|
|
6522
6538
|
recipient: Recipient
|
|
6523
6539
|
});
|
|
6524
6540
|
var TriggerPayload = {
|
|
6525
6541
|
[TriggerEvent.USER_CREATED]: BasePayload.extend({
|
|
6526
|
-
username:
|
|
6527
|
-
temporaryPassword:
|
|
6542
|
+
username: z39.string(),
|
|
6543
|
+
temporaryPassword: z39.string()
|
|
6528
6544
|
}),
|
|
6529
6545
|
[TriggerEvent.USER_UPDATED]: BasePayload.extend({
|
|
6530
|
-
oldUsername:
|
|
6531
|
-
newUsername:
|
|
6546
|
+
oldUsername: z39.string(),
|
|
6547
|
+
newUsername: z39.string()
|
|
6532
6548
|
}),
|
|
6533
6549
|
[TriggerEvent.USERNAME_REMINDER]: BasePayload.extend({
|
|
6534
|
-
username:
|
|
6550
|
+
username: z39.string()
|
|
6535
6551
|
}),
|
|
6536
6552
|
[TriggerEvent.RESET_PASSWORD]: BasePayload.extend({
|
|
6537
|
-
code:
|
|
6553
|
+
code: z39.string()
|
|
6538
6554
|
}),
|
|
6539
6555
|
[TriggerEvent.RESET_PASSWORD_BY_ADMIN]: BasePayload.extend({
|
|
6540
|
-
temporaryPassword:
|
|
6541
|
-
admin:
|
|
6542
|
-
id:
|
|
6556
|
+
temporaryPassword: z39.string(),
|
|
6557
|
+
admin: z39.object({
|
|
6558
|
+
id: z39.string(),
|
|
6543
6559
|
name: NameFieldValue,
|
|
6544
|
-
role:
|
|
6560
|
+
role: z39.string()
|
|
6545
6561
|
})
|
|
6546
6562
|
}),
|
|
6547
6563
|
[TriggerEvent.TWO_FA]: BasePayload.extend({
|
|
6548
|
-
code:
|
|
6564
|
+
code: z39.string()
|
|
6549
6565
|
}),
|
|
6550
6566
|
[TriggerEvent.ALL_USER_NOTIFICATION]: BasePayload.extend({
|
|
6551
|
-
subject:
|
|
6552
|
-
body:
|
|
6567
|
+
subject: z39.string(),
|
|
6568
|
+
body: z39.string()
|
|
6553
6569
|
}),
|
|
6554
6570
|
[TriggerEvent.CHANGE_PHONE_NUMBER]: BasePayload.extend({
|
|
6555
|
-
code:
|
|
6571
|
+
code: z39.string()
|
|
6556
6572
|
}),
|
|
6557
6573
|
[TriggerEvent.CHANGE_EMAIL_ADDRESS]: BasePayload.extend({
|
|
6558
|
-
code:
|
|
6574
|
+
code: z39.string()
|
|
6559
6575
|
})
|
|
6560
6576
|
};
|
|
6561
6577
|
async function triggerUserEventNotification({
|
|
@@ -6577,3 +6593,6 @@ function parseUserEventTrigger(event2, body) {
|
|
|
6577
6593
|
const schema = TriggerPayload[event2];
|
|
6578
6594
|
return schema.parse(body);
|
|
6579
6595
|
}
|
|
6596
|
+
|
|
6597
|
+
// src/notification/index.ts
|
|
6598
|
+
z40.globalRegistry.clear();
|