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