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