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