@opencrvs/toolkit 1.9.5-rc.d427762 → 1.9.5-rc.d647588
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 +28486 -2165
- package/dist/commons/conditionals/conditionals.d.ts +10 -1
- package/dist/commons/conditionals/validate.d.ts +11 -4
- package/dist/commons/events/ActionConfig.d.ts +24380 -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 -4211
- package/dist/commons/events/CreatedAtLocation.d.ts +1 -1
- package/dist/commons/events/DeduplicationConfig.d.ts +15 -150
- package/dist/commons/events/Draft.d.ts +70 -105
- package/dist/commons/events/DynamicFieldValue.d.ts +7 -91
- package/dist/commons/events/EventConfig.d.ts +19459 -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 -975
- package/dist/commons/events/EventInput.d.ts +2 -8
- package/dist/commons/events/EventMetadata.d.ts +106 -346
- package/dist/commons/events/FieldConfig.d.ts +4442 -11853
- package/dist/commons/events/FieldType.d.ts +20 -4
- package/dist/commons/events/FieldTypeMapping.d.ts +181 -813
- package/dist/commons/events/FieldValue.d.ts +83 -356
- package/dist/commons/events/Flag.d.ts +70 -0
- package/dist/commons/events/FormConfig.d.ts +13632 -721
- package/dist/commons/events/PageConfig.d.ts +9108 -319
- package/dist/commons/events/SummaryConfig.d.ts +14 -161
- package/dist/commons/events/TemplateConfig.d.ts +2 -3
- package/dist/commons/events/TranslationConfig.d.ts +2 -2
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +74 -37
- package/dist/commons/events/WorkqueueConfig.d.ts +1874 -7174
- package/dist/commons/events/deduplication.d.ts +3 -3
- package/dist/commons/events/defineConfig.d.ts +25876 -148
- package/dist/commons/events/event.d.ts +4 -4
- package/dist/commons/events/eventConfigValidation.d.ts +8 -0
- package/dist/commons/events/index.d.ts +1 -0
- package/dist/commons/events/locations.d.ts +16 -19
- package/dist/commons/events/scopes.d.ts +5 -4
- package/dist/commons/events/state/availableActions.d.ts +2 -1
- package/dist/commons/events/state/flags.d.ts +21 -3
- package/dist/commons/events/state/index.d.ts +23 -19
- package/dist/commons/events/state/utils.d.ts +130 -112
- package/dist/commons/events/test.utils.d.ts +17 -8
- package/dist/commons/events/transactions.d.ts +1 -1
- package/dist/commons/events/utils.d.ts +51783 -362
- package/dist/commons/notification/UserNotifications.d.ts +55 -636
- package/dist/conditionals/index.d.ts.map +1 -1
- package/dist/conditionals/index.js +42 -8
- package/dist/events/deduplication.d.ts +3 -3
- package/dist/events/index.js +1938 -1616
- package/dist/notification/index.d.ts.map +1 -1
- package/dist/notification/index.js +1610 -1529
- 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,182 @@ 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
1192
|
PENDING_CERTIFICATION: "pending-certification",
|
|
1147
1193
|
INCOMPLETE: "incomplete",
|
|
1148
1194
|
REJECTED: "rejected",
|
|
1149
1195
|
CORRECTION_REQUESTED: "correction-requested",
|
|
1150
|
-
POTENTIAL_DUPLICATE: "potential-duplicate"
|
|
1196
|
+
POTENTIAL_DUPLICATE: "potential-duplicate",
|
|
1197
|
+
/**
|
|
1198
|
+
* This flag is set by the Edit-action and removed after the declaration or registration.
|
|
1199
|
+
* A record should never stay with the EDIT_IN_PROGRESS flag, since it should always be declared or registered right after.
|
|
1200
|
+
*
|
|
1201
|
+
* We only use this flag to determine that a NOTIFY, DECLARE or REGISTER action is allowed next.
|
|
1202
|
+
*/
|
|
1203
|
+
EDIT_IN_PROGRESS: "edit-in-progress"
|
|
1151
1204
|
};
|
|
1152
|
-
var ActionFlag =
|
|
1205
|
+
var ActionFlag = z13.string().regex(
|
|
1153
1206
|
new RegExp(
|
|
1154
1207
|
`^(${Object.values(ActionType).join("|").toLowerCase()}):(${Object.values(
|
|
1155
1208
|
ActionStatus
|
|
@@ -1157,59 +1210,90 @@ var ActionFlag = import_zod13.z.string().regex(
|
|
|
1157
1210
|
),
|
|
1158
1211
|
"Flag must be in the format ActionType:ActionStatus (lowerCase)"
|
|
1159
1212
|
);
|
|
1160
|
-
var
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1213
|
+
var CustomFlag = z13.string().refine((val) => !Object.values(InherentFlags).includes(val), {
|
|
1214
|
+
message: `Custom flag cannot be one of the inherent flags: ${Object.values(
|
|
1215
|
+
InherentFlags
|
|
1216
|
+
).join(", ")}`
|
|
1217
|
+
}).refine((val) => !ActionFlag.safeParse(val).success, {
|
|
1218
|
+
message: "Custom flag cannot match the ActionFlag pattern (ActionType:ActionStatus)."
|
|
1219
|
+
}).describe("Custom flag identifier defined by the country config.");
|
|
1220
|
+
var Flag = ActionFlag.or(z13.enum(InherentFlags)).or(CustomFlag);
|
|
1221
|
+
var FlagConfig = z13.object({
|
|
1222
|
+
id: CustomFlag,
|
|
1223
|
+
requiresAction: z13.boolean().describe(
|
|
1224
|
+
"Indicates if this flag expects an action to be performed to be cleared."
|
|
1225
|
+
),
|
|
1226
|
+
label: TranslationConfig.describe("Human readable label of the flag.")
|
|
1227
|
+
});
|
|
1228
|
+
var ActionFlagConfig = z13.object({
|
|
1229
|
+
id: Flag,
|
|
1230
|
+
operation: z13.enum(["add", "remove"]).describe("Operation to perform on the flag."),
|
|
1231
|
+
conditional: Conditional.optional().describe(
|
|
1232
|
+
"When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
|
|
1233
|
+
)
|
|
1234
|
+
});
|
|
1235
|
+
|
|
1236
|
+
// ../commons/src/events/EventMetadata.ts
|
|
1237
|
+
var EventStatus = z14.enum([
|
|
1238
|
+
"CREATED",
|
|
1239
|
+
"NOTIFIED",
|
|
1240
|
+
"DECLARED",
|
|
1241
|
+
"REGISTERED",
|
|
1242
|
+
"ARCHIVED"
|
|
1243
|
+
]);
|
|
1244
|
+
var ZodDate = z14.iso.date();
|
|
1245
|
+
var ActionCreationMetadata = z14.object({
|
|
1246
|
+
createdAt: z14.iso.datetime().describe("The timestamp when the action request was created."),
|
|
1247
|
+
createdBy: z14.string().describe("ID of the user who created the action request."),
|
|
1165
1248
|
createdAtLocation: CreatedAtLocation.describe(
|
|
1166
1249
|
"Location of the user who created the action request."
|
|
1167
1250
|
),
|
|
1168
|
-
createdByUserType:
|
|
1169
|
-
acceptedAt:
|
|
1170
|
-
createdByRole:
|
|
1171
|
-
createdBySignature:
|
|
1251
|
+
createdByUserType: z14.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1252
|
+
acceptedAt: z14.iso.datetime().describe("Timestamp when the action request was accepted."),
|
|
1253
|
+
createdByRole: z14.string().describe("Role of the user at the time of action request creation."),
|
|
1254
|
+
createdBySignature: z14.string().nullish().describe("Signature of the user who created the action request.")
|
|
1172
1255
|
});
|
|
1173
1256
|
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
1174
|
-
registrationNumber:
|
|
1257
|
+
registrationNumber: z14.string().describe(
|
|
1175
1258
|
"Registration number of the event. Always present for accepted registrations."
|
|
1176
1259
|
)
|
|
1177
1260
|
});
|
|
1178
|
-
var LegalStatuses =
|
|
1261
|
+
var LegalStatuses = z14.object({
|
|
1179
1262
|
[EventStatus.enum.DECLARED]: ActionCreationMetadata.nullish(),
|
|
1180
1263
|
[EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish()
|
|
1181
1264
|
});
|
|
1182
|
-
var EventMetadata =
|
|
1265
|
+
var EventMetadata = z14.object({
|
|
1183
1266
|
id: UUID,
|
|
1184
|
-
type:
|
|
1267
|
+
type: z14.string().describe("The type of event, such as birth, death, or marriage."),
|
|
1185
1268
|
status: EventStatus,
|
|
1186
1269
|
legalStatuses: LegalStatuses.describe(
|
|
1187
1270
|
"Metadata related to the legal registration of the event, such as who registered it and when."
|
|
1188
1271
|
),
|
|
1189
|
-
createdAt:
|
|
1272
|
+
createdAt: z14.iso.datetime().describe("The timestamp when the event was first created and saved."),
|
|
1190
1273
|
dateOfEvent: ZodDate.nullish(),
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1274
|
+
placeOfEvent: CreatedAtLocation,
|
|
1275
|
+
createdBy: z14.string().describe("ID of the user who created the event."),
|
|
1276
|
+
createdByUserType: z14.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1277
|
+
updatedByUserRole: z14.string().describe("Role of the user who last changed the status."),
|
|
1194
1278
|
createdAtLocation: CreatedAtLocation.describe(
|
|
1195
1279
|
"Location of the user who created the event."
|
|
1196
1280
|
),
|
|
1197
|
-
createdBySignature:
|
|
1281
|
+
createdBySignature: z14.string().nullish().describe("Signature of the user who created the event."),
|
|
1198
1282
|
updatedAtLocation: UUID.nullish().describe(
|
|
1199
1283
|
"Location of the user who last changed the status."
|
|
1200
1284
|
),
|
|
1201
|
-
updatedAt:
|
|
1285
|
+
updatedAt: z14.iso.datetime().describe(
|
|
1202
1286
|
"Timestamp of the most recent *accepted* status change. Possibly 3rd party update, if action is validation asynchronously."
|
|
1203
1287
|
),
|
|
1204
|
-
assignedTo:
|
|
1205
|
-
updatedBy:
|
|
1206
|
-
trackingId:
|
|
1288
|
+
assignedTo: z14.string().nullish().describe("ID of the user currently assigned to the event."),
|
|
1289
|
+
updatedBy: z14.string().nullish().describe("ID of the user who last changed the status."),
|
|
1290
|
+
trackingId: z14.string().describe(
|
|
1207
1291
|
"System-generated tracking ID used by informants or registrars to look up the event."
|
|
1208
1292
|
),
|
|
1209
|
-
potentialDuplicates:
|
|
1293
|
+
potentialDuplicates: z14.array(PotentialDuplicate).describe(
|
|
1210
1294
|
"List of event IDs and their tracking IDs that this event could be a duplicate of."
|
|
1211
1295
|
),
|
|
1212
|
-
flags:
|
|
1296
|
+
flags: z14.array(Flag)
|
|
1213
1297
|
});
|
|
1214
1298
|
var EventMetadataKeysArray = [
|
|
1215
1299
|
"id",
|
|
@@ -1217,6 +1301,7 @@ var EventMetadataKeysArray = [
|
|
|
1217
1301
|
"status",
|
|
1218
1302
|
"createdAt",
|
|
1219
1303
|
"dateOfEvent",
|
|
1304
|
+
"placeOfEvent",
|
|
1220
1305
|
"createdBy",
|
|
1221
1306
|
"createdByUserType",
|
|
1222
1307
|
"updatedByUserRole",
|
|
@@ -1229,130 +1314,124 @@ var EventMetadataKeysArray = [
|
|
|
1229
1314
|
"legalStatuses",
|
|
1230
1315
|
"flags"
|
|
1231
1316
|
];
|
|
1232
|
-
var EventMetadataKeys =
|
|
1317
|
+
var EventMetadataKeys = z14.enum(EventMetadataKeysArray);
|
|
1233
1318
|
|
|
1234
1319
|
// ../commons/src/events/EventIndex.ts
|
|
1235
|
-
var import_zod_openapi5 = require("zod-openapi");
|
|
1236
|
-
(0, import_zod_openapi5.extendZodWithOpenApi)(import_zod14.z);
|
|
1237
1320
|
var EventIndex = EventMetadata.extend({
|
|
1238
1321
|
declaration: EventState
|
|
1239
|
-
}).
|
|
1240
|
-
|
|
1322
|
+
}).meta({
|
|
1323
|
+
id: "EventIndex"
|
|
1241
1324
|
});
|
|
1242
|
-
var EventSearchIndex =
|
|
1243
|
-
|
|
1244
|
-
type:
|
|
1325
|
+
var EventSearchIndex = import_v4.z.record(import_v4.z.string(), import_v4.z.any()).and(
|
|
1326
|
+
import_v4.z.object({
|
|
1327
|
+
type: import_v4.z.string()
|
|
1245
1328
|
// Ensures "type" (event-id) exists and is a string
|
|
1246
1329
|
})
|
|
1247
|
-
).
|
|
1248
|
-
|
|
1330
|
+
).meta({
|
|
1331
|
+
id: "EventSearchIndex"
|
|
1249
1332
|
});
|
|
1250
|
-
var Fuzzy =
|
|
1251
|
-
|
|
1333
|
+
var Fuzzy = import_v4.z.object({ type: import_v4.z.literal("fuzzy"), term: import_v4.z.string() }).meta({
|
|
1334
|
+
id: "Fuzzy"
|
|
1252
1335
|
});
|
|
1253
|
-
var Exact =
|
|
1254
|
-
|
|
1336
|
+
var Exact = import_v4.z.object({ type: import_v4.z.literal("exact"), term: import_v4.z.string() }).meta({
|
|
1337
|
+
id: "Exact"
|
|
1255
1338
|
});
|
|
1256
|
-
var ExactStatus =
|
|
1257
|
-
type:
|
|
1339
|
+
var ExactStatus = import_v4.z.object({
|
|
1340
|
+
type: import_v4.z.literal("exact"),
|
|
1258
1341
|
term: EventStatus
|
|
1259
|
-
}).
|
|
1260
|
-
|
|
1342
|
+
}).meta({
|
|
1343
|
+
id: "ExactStatus"
|
|
1261
1344
|
});
|
|
1262
|
-
var ExactUserType =
|
|
1263
|
-
type:
|
|
1345
|
+
var ExactUserType = import_v4.z.object({
|
|
1346
|
+
type: import_v4.z.literal("exact"),
|
|
1264
1347
|
term: TokenUserType
|
|
1265
|
-
}).
|
|
1266
|
-
|
|
1348
|
+
}).meta({
|
|
1349
|
+
id: "ExactUserType"
|
|
1267
1350
|
});
|
|
1268
|
-
var AnyOf =
|
|
1269
|
-
type:
|
|
1270
|
-
terms:
|
|
1271
|
-
}).
|
|
1272
|
-
|
|
1351
|
+
var AnyOf = import_v4.z.object({
|
|
1352
|
+
type: import_v4.z.literal("anyOf"),
|
|
1353
|
+
terms: import_v4.z.array(import_v4.z.string())
|
|
1354
|
+
}).meta({
|
|
1355
|
+
id: "AnyOf"
|
|
1273
1356
|
});
|
|
1274
|
-
var AnyOfStatus =
|
|
1275
|
-
type:
|
|
1276
|
-
terms:
|
|
1277
|
-
}).
|
|
1278
|
-
|
|
1357
|
+
var AnyOfStatus = import_v4.z.object({
|
|
1358
|
+
type: import_v4.z.literal("anyOf"),
|
|
1359
|
+
terms: import_v4.z.array(EventStatus)
|
|
1360
|
+
}).meta({
|
|
1361
|
+
id: "AnyOfStatus"
|
|
1279
1362
|
});
|
|
1280
|
-
var Range =
|
|
1281
|
-
type:
|
|
1282
|
-
gte:
|
|
1283
|
-
lte:
|
|
1284
|
-
}).
|
|
1285
|
-
|
|
1363
|
+
var Range = import_v4.z.object({
|
|
1364
|
+
type: import_v4.z.literal("range"),
|
|
1365
|
+
gte: import_v4.z.string(),
|
|
1366
|
+
lte: import_v4.z.string()
|
|
1367
|
+
}).meta({
|
|
1368
|
+
id: "Range"
|
|
1286
1369
|
});
|
|
1287
|
-
var ContainsFlags =
|
|
1288
|
-
anyOf:
|
|
1289
|
-
noneOf:
|
|
1290
|
-
}).
|
|
1291
|
-
|
|
1370
|
+
var ContainsFlags = import_v4.z.object({
|
|
1371
|
+
anyOf: import_v4.z.array(Flag).optional(),
|
|
1372
|
+
noneOf: import_v4.z.array(Flag).optional()
|
|
1373
|
+
}).meta({
|
|
1374
|
+
id: "ContainsFlags"
|
|
1292
1375
|
});
|
|
1293
|
-
var Within =
|
|
1294
|
-
|
|
1376
|
+
var Within = import_v4.z.object({ type: import_v4.z.literal("within"), location: import_v4.z.string() }).meta({
|
|
1377
|
+
id: "Within"
|
|
1295
1378
|
});
|
|
1296
|
-
var RangeDate =
|
|
1297
|
-
type:
|
|
1298
|
-
gte:
|
|
1299
|
-
lte:
|
|
1300
|
-
}).
|
|
1379
|
+
var RangeDate = import_v4.z.object({
|
|
1380
|
+
type: import_v4.z.literal("range"),
|
|
1381
|
+
gte: import_v4.z.iso.date().or(import_v4.z.iso.datetime()),
|
|
1382
|
+
lte: import_v4.z.iso.date().or(import_v4.z.iso.datetime())
|
|
1383
|
+
}).meta({ id: "RangeDate" });
|
|
1301
1384
|
var ExactDate = Exact.extend({
|
|
1302
|
-
term:
|
|
1303
|
-
}).
|
|
1304
|
-
|
|
1385
|
+
term: import_v4.z.iso.date().or(import_v4.z.iso.datetime())
|
|
1386
|
+
}).meta({
|
|
1387
|
+
id: "ExactDate"
|
|
1305
1388
|
});
|
|
1306
|
-
var TimePeriod =
|
|
1307
|
-
type:
|
|
1389
|
+
var TimePeriod = import_v4.z.object({
|
|
1390
|
+
type: import_v4.z.literal("timePeriod"),
|
|
1308
1391
|
term: SelectDateRangeValue
|
|
1309
|
-
}).
|
|
1310
|
-
|
|
1392
|
+
}).meta({
|
|
1393
|
+
id: "TimePeriod"
|
|
1311
1394
|
});
|
|
1312
|
-
var DateCondition =
|
|
1313
|
-
|
|
1395
|
+
var DateCondition = import_v4.z.union([ExactDate, RangeDate, TimePeriod]).meta({
|
|
1396
|
+
id: "DateCondition"
|
|
1314
1397
|
});
|
|
1315
|
-
var QueryInput =
|
|
1316
|
-
() =>
|
|
1317
|
-
|
|
1318
|
-
|
|
1398
|
+
var QueryInput = import_v4.z.lazy(
|
|
1399
|
+
() => import_v4.z.union([
|
|
1400
|
+
import_v4.z.discriminatedUnion("type", [Fuzzy, Exact, Range, Within, AnyOf]),
|
|
1401
|
+
import_v4.z.record(import_v4.z.string(), QueryInput)
|
|
1319
1402
|
])
|
|
1320
|
-
).
|
|
1321
|
-
|
|
1403
|
+
).meta({
|
|
1404
|
+
id: "QueryInput"
|
|
1322
1405
|
});
|
|
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),
|
|
1406
|
+
var QueryExpression = import_v4.z.object({
|
|
1407
|
+
id: import_v4.z.optional(import_v4.z.string()),
|
|
1408
|
+
eventType: import_v4.z.string(),
|
|
1409
|
+
status: import_v4.z.optional(import_v4.z.union([AnyOfStatus, ExactStatus])),
|
|
1410
|
+
createdAt: import_v4.z.optional(DateCondition),
|
|
1411
|
+
updatedAt: import_v4.z.optional(DateCondition),
|
|
1412
|
+
"legalStatuses.REGISTERED.acceptedAt": import_v4.z.optional(DateCondition),
|
|
1413
|
+
"legalStatuses.DECLARED.createdAtLocation": import_v4.z.optional(Within).nullable(),
|
|
1414
|
+
"legalStatuses.REGISTERED.createdAtLocation": import_v4.z.optional(Within).nullable(),
|
|
1415
|
+
"legalStatuses.REGISTERED.registrationNumber": import_v4.z.optional(Exact),
|
|
1416
|
+
createdAtLocation: import_v4.z.optional(Within),
|
|
1417
|
+
updatedAtLocation: import_v4.z.optional(Within),
|
|
1418
|
+
assignedTo: import_v4.z.optional(Exact),
|
|
1419
|
+
createdByUserType: import_v4.z.optional(ExactUserType),
|
|
1420
|
+
createdBy: import_v4.z.optional(Exact),
|
|
1421
|
+
updatedBy: import_v4.z.optional(Exact),
|
|
1422
|
+
trackingId: import_v4.z.optional(Exact),
|
|
1423
|
+
flags: import_v4.z.optional(ContainsFlags),
|
|
1345
1424
|
// @todo: The type for this comes out as "any"
|
|
1346
1425
|
data: QueryInput
|
|
1347
1426
|
}).partial().refine((obj) => Object.values(obj).some((val) => val !== void 0), {
|
|
1348
|
-
|
|
1349
|
-
}).
|
|
1350
|
-
|
|
1427
|
+
error: "At least one query field must be specified."
|
|
1428
|
+
}).meta({
|
|
1429
|
+
id: "QueryExpression"
|
|
1351
1430
|
});
|
|
1352
|
-
var QueryType =
|
|
1353
|
-
() =>
|
|
1354
|
-
type:
|
|
1355
|
-
clauses:
|
|
1431
|
+
var QueryType = import_v4.z.lazy(
|
|
1432
|
+
() => import_v4.z.object({
|
|
1433
|
+
type: import_v4.z.literal("and").or(import_v4.z.literal("or")).meta({ default: "and" }),
|
|
1434
|
+
clauses: import_v4.z.array(import_v4.z.union([QueryExpression, QueryType])).nonempty("At least one clause is required.").meta({
|
|
1356
1435
|
default: [
|
|
1357
1436
|
{
|
|
1358
1437
|
eventType: TENNIS_CLUB_MEMBERSHIP,
|
|
@@ -1370,8 +1449,8 @@ var QueryType = import_zod14.z.lazy(
|
|
|
1370
1449
|
]
|
|
1371
1450
|
})
|
|
1372
1451
|
})
|
|
1373
|
-
).
|
|
1374
|
-
|
|
1452
|
+
).meta({
|
|
1453
|
+
id: "QueryType"
|
|
1375
1454
|
});
|
|
1376
1455
|
function parseStringifiedQueryField(val) {
|
|
1377
1456
|
if (typeof val === "string") {
|
|
@@ -1379,8 +1458,8 @@ function parseStringifiedQueryField(val) {
|
|
|
1379
1458
|
}
|
|
1380
1459
|
return val;
|
|
1381
1460
|
}
|
|
1382
|
-
var SearchQuery =
|
|
1383
|
-
query:
|
|
1461
|
+
var SearchQuery = import_v4.z.object({
|
|
1462
|
+
query: import_v4.z.preprocess(parseStringifiedQueryField, QueryType).meta({
|
|
1384
1463
|
default: {
|
|
1385
1464
|
type: "and",
|
|
1386
1465
|
clauses: [
|
|
@@ -1400,190 +1479,184 @@ var SearchQuery = import_zod14.z.object({
|
|
|
1400
1479
|
]
|
|
1401
1480
|
}
|
|
1402
1481
|
}),
|
|
1403
|
-
limit:
|
|
1404
|
-
offset:
|
|
1405
|
-
sort:
|
|
1482
|
+
limit: import_v4.z.number().optional().default(100),
|
|
1483
|
+
offset: import_v4.z.number().optional().default(0),
|
|
1484
|
+
sort: import_v4.z.preprocess(
|
|
1406
1485
|
parseStringifiedQueryField,
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
field:
|
|
1410
|
-
direction:
|
|
1486
|
+
import_v4.z.array(
|
|
1487
|
+
import_v4.z.object({
|
|
1488
|
+
field: import_v4.z.string(),
|
|
1489
|
+
direction: import_v4.z.enum(["asc", "desc"]).default("asc")
|
|
1411
1490
|
})
|
|
1412
1491
|
)
|
|
1413
1492
|
).optional()
|
|
1414
|
-
}).
|
|
1415
|
-
|
|
1493
|
+
}).meta({
|
|
1494
|
+
id: "SearchQuery"
|
|
1416
1495
|
});
|
|
1417
1496
|
|
|
1418
1497
|
// ../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({
|
|
1498
|
+
var FieldId = z16.string().superRefine((val, ctx) => {
|
|
1499
|
+
if (val.includes("_")) {
|
|
1500
|
+
ctx.addIssue({
|
|
1501
|
+
code: z16.ZodIssueCode.custom,
|
|
1502
|
+
message: `id: '${val}' must not contain underscores '_'`
|
|
1503
|
+
});
|
|
1504
|
+
}
|
|
1505
|
+
}).describe("Unique identifier for the field");
|
|
1506
|
+
var FieldReference = z16.object({
|
|
1434
1507
|
$$field: FieldId,
|
|
1435
|
-
$$subfield:
|
|
1508
|
+
$$subfield: z16.array(z16.string()).optional().describe(
|
|
1436
1509
|
'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
|
|
1437
1510
|
)
|
|
1438
1511
|
}).describe("Reference to a field by its ID");
|
|
1439
|
-
var ValidationConfig =
|
|
1512
|
+
var ValidationConfig = z16.object({
|
|
1440
1513
|
validator: Conditional,
|
|
1441
1514
|
message: TranslationConfig
|
|
1442
1515
|
});
|
|
1443
|
-
var requiredSchema =
|
|
1444
|
-
|
|
1445
|
-
|
|
1516
|
+
var requiredSchema = z16.union([
|
|
1517
|
+
z16.boolean(),
|
|
1518
|
+
z16.object({
|
|
1446
1519
|
message: TranslationConfig.describe("Custom required validation message")
|
|
1447
1520
|
})
|
|
1448
1521
|
]).default(false).optional();
|
|
1449
|
-
var BaseField =
|
|
1522
|
+
var BaseField = z16.object({
|
|
1450
1523
|
id: FieldId.describe("Unique identifier of the field."),
|
|
1451
1524
|
label: TranslationConfig.describe("Human-readable label of the field."),
|
|
1452
|
-
parent: FieldReference.or(
|
|
1525
|
+
parent: FieldReference.or(z16.array(FieldReference)).optional().describe(
|
|
1453
1526
|
"Reference to the parent field or fields. When a parent field changes, this field is reset."
|
|
1454
1527
|
),
|
|
1455
1528
|
required: requiredSchema.describe(
|
|
1456
1529
|
"Indicates whether the field is mandatory."
|
|
1457
1530
|
),
|
|
1458
|
-
conditionals:
|
|
1531
|
+
conditionals: z16.array(FieldConditional).default([]).optional().describe(
|
|
1459
1532
|
"Conditions determining when the field is shown or enabled. By default, the field is always shown and enabled."
|
|
1460
1533
|
),
|
|
1461
|
-
secured:
|
|
1534
|
+
secured: z16.boolean().default(false).optional().describe(
|
|
1462
1535
|
"Indicates whether the field is secured. Secured fields are not indexed for search and are only visible when explicitly assigned."
|
|
1463
1536
|
),
|
|
1464
1537
|
placeholder: TranslationConfig.optional(),
|
|
1465
|
-
validation:
|
|
1538
|
+
validation: z16.array(ValidationConfig).default([]).optional().describe("Additional validation rules applied to the field."),
|
|
1466
1539
|
helperText: TranslationConfig.optional(),
|
|
1467
|
-
hideLabel:
|
|
1468
|
-
uncorrectable:
|
|
1540
|
+
hideLabel: z16.boolean().default(false).optional(),
|
|
1541
|
+
uncorrectable: z16.boolean().default(false).optional().describe(
|
|
1469
1542
|
"Indicates whether the field can be modified during record correction."
|
|
1470
1543
|
),
|
|
1471
|
-
value: FieldReference.or(
|
|
1544
|
+
value: FieldReference.or(z16.array(FieldReference)).optional().describe(
|
|
1472
1545
|
"Reference to the source field or fields. When a value is defined, it is copied from the parent field when changed. If multiple references are provided, the first truthy value is used."
|
|
1473
1546
|
),
|
|
1474
|
-
analytics:
|
|
1547
|
+
analytics: z16.boolean().default(false).optional().describe(
|
|
1475
1548
|
"Indicates whether the field is included in analytics. When enabled, its value becomes available in the analytics dashboard."
|
|
1476
1549
|
)
|
|
1477
1550
|
}).describe("Common properties shared across all field types.");
|
|
1478
1551
|
var Divider = BaseField.extend({
|
|
1479
|
-
type:
|
|
1552
|
+
type: z16.literal(FieldType.DIVIDER)
|
|
1480
1553
|
});
|
|
1481
1554
|
var TextField = BaseField.extend({
|
|
1482
|
-
type:
|
|
1483
|
-
defaultValue:
|
|
1484
|
-
configuration:
|
|
1485
|
-
maxLength:
|
|
1486
|
-
type:
|
|
1555
|
+
type: z16.literal(FieldType.TEXT),
|
|
1556
|
+
defaultValue: z16.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1557
|
+
configuration: z16.object({
|
|
1558
|
+
maxLength: z16.number().optional().describe("Maximum length of the text"),
|
|
1559
|
+
type: z16.enum(["text", "password"]).optional(),
|
|
1487
1560
|
prefix: TranslationConfig.optional(),
|
|
1488
1561
|
postfix: TranslationConfig.optional()
|
|
1489
1562
|
}).default({ type: "text" }).optional()
|
|
1490
1563
|
}).describe("Text input");
|
|
1491
1564
|
var NumberField = BaseField.extend({
|
|
1492
|
-
type:
|
|
1565
|
+
type: z16.literal(FieldType.NUMBER),
|
|
1493
1566
|
defaultValue: NumberFieldValue.optional(),
|
|
1494
|
-
configuration:
|
|
1495
|
-
min:
|
|
1496
|
-
max:
|
|
1567
|
+
configuration: z16.object({
|
|
1568
|
+
min: z16.number().optional().describe("Minimum value"),
|
|
1569
|
+
max: z16.number().optional().describe("Maximum value"),
|
|
1497
1570
|
prefix: TranslationConfig.optional(),
|
|
1498
1571
|
postfix: TranslationConfig.optional()
|
|
1499
1572
|
}).optional()
|
|
1500
1573
|
}).describe("Number input");
|
|
1501
1574
|
var TextAreaField = BaseField.extend({
|
|
1502
|
-
type:
|
|
1575
|
+
type: z16.literal(FieldType.TEXTAREA),
|
|
1503
1576
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1504
|
-
configuration:
|
|
1505
|
-
maxLength:
|
|
1506
|
-
rows:
|
|
1507
|
-
cols:
|
|
1577
|
+
configuration: z16.object({
|
|
1578
|
+
maxLength: z16.number().optional().describe("Maximum length of the text"),
|
|
1579
|
+
rows: z16.number().optional().describe("Number of visible text lines"),
|
|
1580
|
+
cols: z16.number().optional().describe("Number of visible columns"),
|
|
1508
1581
|
prefix: TranslationConfig.optional(),
|
|
1509
1582
|
postfix: TranslationConfig.optional()
|
|
1510
1583
|
}).default({ rows: 4 }).optional()
|
|
1511
1584
|
}).describe("Multiline text input");
|
|
1512
|
-
var ImageMimeType =
|
|
1585
|
+
var ImageMimeType = z16.enum([
|
|
1513
1586
|
"image/png",
|
|
1514
1587
|
"image/jpg",
|
|
1515
1588
|
"image/jpeg",
|
|
1516
1589
|
"image/svg+xml"
|
|
1517
1590
|
]);
|
|
1518
|
-
var DocumentMimeType =
|
|
1591
|
+
var DocumentMimeType = z16.enum([
|
|
1519
1592
|
"application/pdf",
|
|
1520
1593
|
"application/msword",
|
|
1521
1594
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
1522
1595
|
"application/vnd.oasis.opendocument.text"
|
|
1523
1596
|
]);
|
|
1524
|
-
var MimeType =
|
|
1597
|
+
var MimeType = z16.enum([
|
|
1525
1598
|
...ImageMimeType.options,
|
|
1526
1599
|
...DocumentMimeType.options
|
|
1527
1600
|
]);
|
|
1528
1601
|
var DEFAULT_MAX_FILE_SIZE_BYTES = 5 * 1024 * 1024;
|
|
1529
1602
|
var SignatureField = BaseField.extend({
|
|
1530
|
-
type:
|
|
1603
|
+
type: z16.literal(FieldType.SIGNATURE),
|
|
1531
1604
|
signaturePromptLabel: TranslationConfig.describe(
|
|
1532
1605
|
"Title of the signature modal"
|
|
1533
1606
|
),
|
|
1534
1607
|
defaultValue: SignatureFieldValue.optional(),
|
|
1535
|
-
configuration:
|
|
1536
|
-
maxFileSize:
|
|
1608
|
+
configuration: z16.object({
|
|
1609
|
+
maxFileSize: z16.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1537
1610
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
|
1538
1611
|
}).default({
|
|
1539
1612
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1540
1613
|
})
|
|
1541
1614
|
}).describe("Signature input field");
|
|
1542
1615
|
var EmailField = BaseField.extend({
|
|
1543
|
-
type:
|
|
1544
|
-
configuration:
|
|
1545
|
-
maxLength:
|
|
1546
|
-
}).default({ maxLength:
|
|
1616
|
+
type: z16.literal(FieldType.EMAIL),
|
|
1617
|
+
configuration: z16.object({
|
|
1618
|
+
maxLength: z16.number().optional().describe("Maximum length of the text")
|
|
1619
|
+
}).default({ maxLength: 255 }).optional(),
|
|
1547
1620
|
defaultValue: NonEmptyTextValue.optional()
|
|
1548
1621
|
});
|
|
1549
1622
|
var DateField = BaseField.extend({
|
|
1550
|
-
type:
|
|
1623
|
+
type: z16.literal(FieldType.DATE),
|
|
1551
1624
|
defaultValue: DateValue.optional(),
|
|
1552
|
-
configuration:
|
|
1625
|
+
configuration: z16.object({
|
|
1553
1626
|
notice: TranslationConfig.describe(
|
|
1554
1627
|
"Text to display above the date input"
|
|
1555
1628
|
).optional()
|
|
1556
1629
|
}).optional()
|
|
1557
1630
|
}).describe("A single date input (yyyy-MM-dd)");
|
|
1558
1631
|
var AgeField = BaseField.extend({
|
|
1559
|
-
type:
|
|
1632
|
+
type: z16.literal(FieldType.AGE),
|
|
1560
1633
|
defaultValue: NumberFieldValue.optional(),
|
|
1561
|
-
configuration:
|
|
1634
|
+
configuration: z16.object({
|
|
1562
1635
|
asOfDate: FieldReference,
|
|
1563
1636
|
prefix: TranslationConfig.optional(),
|
|
1564
1637
|
postfix: TranslationConfig.optional()
|
|
1565
1638
|
})
|
|
1566
1639
|
}).describe("An age input field which uses the current date as the asOfDate");
|
|
1567
1640
|
var TimeField = BaseField.extend({
|
|
1568
|
-
type:
|
|
1641
|
+
type: z16.literal(FieldType.TIME),
|
|
1569
1642
|
defaultValue: TimeValue.optional(),
|
|
1570
|
-
configuration:
|
|
1571
|
-
use12HourFormat:
|
|
1643
|
+
configuration: z16.object({
|
|
1644
|
+
use12HourFormat: z16.boolean().optional().describe("Whether to use 12-hour format"),
|
|
1572
1645
|
notice: TranslationConfig.describe(
|
|
1573
1646
|
"Text to display above the time input"
|
|
1574
1647
|
).optional()
|
|
1575
1648
|
}).optional()
|
|
1576
1649
|
}).describe("A single date input (HH-mm)");
|
|
1577
1650
|
var DateRangeField = BaseField.extend({
|
|
1578
|
-
type:
|
|
1651
|
+
type: z16.literal(FieldType.DATE_RANGE),
|
|
1579
1652
|
defaultValue: DateRangeFieldValue.optional(),
|
|
1580
|
-
configuration:
|
|
1653
|
+
configuration: z16.object({
|
|
1581
1654
|
notice: TranslationConfig.describe(
|
|
1582
1655
|
"Text to display above the date input"
|
|
1583
1656
|
).optional()
|
|
1584
1657
|
}).optional()
|
|
1585
1658
|
}).describe("A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })");
|
|
1586
|
-
var HtmlFontVariant =
|
|
1659
|
+
var HtmlFontVariant = z16.enum([
|
|
1587
1660
|
"reg12",
|
|
1588
1661
|
"reg14",
|
|
1589
1662
|
"reg16",
|
|
@@ -1593,31 +1666,34 @@ var HtmlFontVariant = import_zod15.z.enum([
|
|
|
1593
1666
|
"h2",
|
|
1594
1667
|
"h1"
|
|
1595
1668
|
]);
|
|
1596
|
-
var ParagraphConfiguration =
|
|
1597
|
-
styles:
|
|
1669
|
+
var ParagraphConfiguration = z16.object({
|
|
1670
|
+
styles: z16.object({
|
|
1598
1671
|
fontVariant: HtmlFontVariant.optional().describe(
|
|
1599
1672
|
"Font variant to use for the paragraph text"
|
|
1600
1673
|
),
|
|
1601
|
-
hint:
|
|
1674
|
+
hint: z16.boolean().optional().describe("When true, paragraph is styled as a hint with grey color")
|
|
1602
1675
|
}).optional()
|
|
1603
1676
|
}).default({});
|
|
1604
1677
|
var Paragraph = BaseField.extend({
|
|
1605
|
-
type:
|
|
1678
|
+
type: z16.literal(FieldType.PARAGRAPH),
|
|
1606
1679
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1607
1680
|
configuration: ParagraphConfiguration
|
|
1608
1681
|
}).describe("A read-only HTML <p> paragraph");
|
|
1609
1682
|
var PageHeader = BaseField.extend({
|
|
1610
|
-
type:
|
|
1683
|
+
type: z16.literal(FieldType.PAGE_HEADER),
|
|
1611
1684
|
defaultValue: NonEmptyTextValue.optional()
|
|
1612
1685
|
}).describe("A read-only header component for form pages");
|
|
1613
1686
|
var File = BaseField.extend({
|
|
1614
|
-
type:
|
|
1687
|
+
type: z16.literal(FieldType.FILE),
|
|
1615
1688
|
defaultValue: FileFieldValue.optional(),
|
|
1616
|
-
configuration:
|
|
1617
|
-
maxFileSize:
|
|
1689
|
+
configuration: z16.object({
|
|
1690
|
+
maxFileSize: z16.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1618
1691
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature"),
|
|
1619
|
-
|
|
1620
|
-
width:
|
|
1692
|
+
maxImageSize: z16.object({
|
|
1693
|
+
targetSize: z16.object({ width: z16.number(), height: z16.number() })
|
|
1694
|
+
}).optional(),
|
|
1695
|
+
style: z16.object({
|
|
1696
|
+
width: z16.enum(["full", "auto"]).optional().describe(
|
|
1621
1697
|
"Whether the file upload button should take the full width of the container or not"
|
|
1622
1698
|
)
|
|
1623
1699
|
}).optional(),
|
|
@@ -1626,34 +1702,34 @@ var File = BaseField.extend({
|
|
|
1626
1702
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1627
1703
|
})
|
|
1628
1704
|
}).describe("File upload");
|
|
1629
|
-
var SelectOption =
|
|
1630
|
-
value:
|
|
1631
|
-
label:
|
|
1705
|
+
var SelectOption = z16.object({
|
|
1706
|
+
value: z16.string().describe("The value of the option"),
|
|
1707
|
+
label: z16.union([z16.string(), TranslationConfig]).describe("The label of the option")
|
|
1632
1708
|
});
|
|
1633
1709
|
var RadioGroup = BaseField.extend({
|
|
1634
|
-
type:
|
|
1710
|
+
type: z16.literal(FieldType.RADIO_GROUP),
|
|
1635
1711
|
defaultValue: TextValue.optional(),
|
|
1636
|
-
options:
|
|
1637
|
-
configuration:
|
|
1638
|
-
styles:
|
|
1639
|
-
size:
|
|
1712
|
+
options: z16.array(SelectOption).describe("A list of options"),
|
|
1713
|
+
configuration: z16.object({
|
|
1714
|
+
styles: z16.object({
|
|
1715
|
+
size: z16.enum(["NORMAL", "LARGE"]).optional()
|
|
1640
1716
|
}).optional()
|
|
1641
1717
|
}).optional()
|
|
1642
1718
|
}).describe("Grouped radio options");
|
|
1643
1719
|
var BulletList = BaseField.extend({
|
|
1644
|
-
type:
|
|
1720
|
+
type: z16.literal(FieldType.BULLET_LIST),
|
|
1645
1721
|
defaultValue: TextValue.optional(),
|
|
1646
|
-
items:
|
|
1647
|
-
configuration:
|
|
1648
|
-
styles:
|
|
1722
|
+
items: z16.array(TranslationConfig).describe("A list of items"),
|
|
1723
|
+
configuration: z16.object({
|
|
1724
|
+
styles: z16.object({
|
|
1649
1725
|
fontVariant: HtmlFontVariant.optional()
|
|
1650
1726
|
}).optional()
|
|
1651
1727
|
}).default({})
|
|
1652
1728
|
}).describe("A list of bullet points");
|
|
1653
1729
|
var Select = BaseField.extend({
|
|
1654
|
-
type:
|
|
1730
|
+
type: z16.literal(FieldType.SELECT),
|
|
1655
1731
|
defaultValue: TextValue.optional(),
|
|
1656
|
-
options:
|
|
1732
|
+
options: z16.array(SelectOption).describe("A list of options"),
|
|
1657
1733
|
noOptionsMessage: TranslationConfig.optional().describe(
|
|
1658
1734
|
`
|
|
1659
1735
|
A translation configuration object used to display a message when no options are available.
|
|
@@ -1665,34 +1741,34 @@ var Select = BaseField.extend({
|
|
|
1665
1741
|
`
|
|
1666
1742
|
)
|
|
1667
1743
|
}).describe("Select input");
|
|
1668
|
-
var SelectDateRangeOption =
|
|
1744
|
+
var SelectDateRangeOption = z16.object({
|
|
1669
1745
|
value: SelectDateRangeValue.describe("The value of the option"),
|
|
1670
1746
|
label: TranslationConfig.describe("The label of the option")
|
|
1671
1747
|
});
|
|
1672
1748
|
var SelectDateRangeField = BaseField.extend({
|
|
1673
|
-
type:
|
|
1749
|
+
type: z16.literal(FieldType.SELECT_DATE_RANGE),
|
|
1674
1750
|
defaultValue: SelectDateRangeValue.optional(),
|
|
1675
|
-
options:
|
|
1751
|
+
options: z16.array(SelectDateRangeOption).describe("A list of options")
|
|
1676
1752
|
}).describe("Select input with date range options");
|
|
1677
|
-
var NameConfig =
|
|
1678
|
-
firstname:
|
|
1679
|
-
middlename:
|
|
1680
|
-
surname:
|
|
1753
|
+
var NameConfig = z16.object({
|
|
1754
|
+
firstname: z16.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
1755
|
+
middlename: z16.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
1756
|
+
surname: z16.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional()
|
|
1681
1757
|
});
|
|
1682
1758
|
var NameField = BaseField.extend({
|
|
1683
|
-
type:
|
|
1684
|
-
defaultValue:
|
|
1759
|
+
type: z16.literal(FieldType.NAME),
|
|
1760
|
+
defaultValue: z16.object({
|
|
1685
1761
|
firstname: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
1686
1762
|
middlename: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
1687
1763
|
surname: SerializedUserField.or(NonEmptyTextValue).optional()
|
|
1688
1764
|
}).optional(),
|
|
1689
|
-
configuration:
|
|
1765
|
+
configuration: z16.object({
|
|
1690
1766
|
name: NameConfig.default({
|
|
1691
1767
|
firstname: { required: true },
|
|
1692
1768
|
surname: { required: true }
|
|
1693
1769
|
}).optional(),
|
|
1694
|
-
order:
|
|
1695
|
-
maxLength:
|
|
1770
|
+
order: z16.array(z16.enum(["firstname", "middlename", "surname"])).optional(),
|
|
1771
|
+
maxLength: z16.number().optional().describe("Maximum length of the text"),
|
|
1696
1772
|
prefix: TranslationConfig.optional(),
|
|
1697
1773
|
postfix: TranslationConfig.optional()
|
|
1698
1774
|
}).default({
|
|
@@ -1704,142 +1780,145 @@ var NameField = BaseField.extend({
|
|
|
1704
1780
|
}).describe("Name input field");
|
|
1705
1781
|
var PhoneField = BaseField.extend({
|
|
1706
1782
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1707
|
-
type:
|
|
1783
|
+
type: z16.literal(FieldType.PHONE)
|
|
1708
1784
|
}).describe("Phone input field");
|
|
1709
1785
|
var IdField = BaseField.extend({
|
|
1710
1786
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1711
|
-
type:
|
|
1787
|
+
type: z16.literal(FieldType.ID)
|
|
1712
1788
|
}).describe("ID input field");
|
|
1713
1789
|
var Checkbox = BaseField.extend({
|
|
1714
|
-
type:
|
|
1790
|
+
type: z16.literal(FieldType.CHECKBOX),
|
|
1715
1791
|
defaultValue: CheckboxFieldValue.default(false)
|
|
1716
1792
|
}).describe("Boolean checkbox field");
|
|
1717
1793
|
var Country = BaseField.extend({
|
|
1718
|
-
type:
|
|
1794
|
+
type: z16.literal(FieldType.COUNTRY),
|
|
1719
1795
|
defaultValue: NonEmptyTextValue.optional()
|
|
1720
1796
|
}).describe("Country select field");
|
|
1721
|
-
var AdministrativeAreas =
|
|
1797
|
+
var AdministrativeAreas = z16.enum([
|
|
1722
1798
|
"ADMIN_STRUCTURE",
|
|
1723
1799
|
"HEALTH_FACILITY",
|
|
1724
1800
|
"CRVS_OFFICE"
|
|
1725
1801
|
]);
|
|
1726
|
-
var AdministrativeAreaConfiguration =
|
|
1727
|
-
partOf:
|
|
1728
|
-
$declaration:
|
|
1802
|
+
var AdministrativeAreaConfiguration = z16.object({
|
|
1803
|
+
partOf: z16.object({
|
|
1804
|
+
$declaration: z16.string()
|
|
1729
1805
|
}).optional().describe("Parent location"),
|
|
1730
1806
|
type: AdministrativeAreas
|
|
1731
1807
|
}).describe("Administrative area options");
|
|
1732
1808
|
var AdministrativeArea = BaseField.extend({
|
|
1733
|
-
type:
|
|
1809
|
+
type: z16.literal(FieldType.ADMINISTRATIVE_AREA),
|
|
1734
1810
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1735
1811
|
configuration: AdministrativeAreaConfiguration
|
|
1736
1812
|
}).describe("Administrative area input field e.g. facility, office");
|
|
1737
1813
|
var LocationInput = BaseField.extend({
|
|
1738
|
-
type:
|
|
1814
|
+
type: z16.literal(FieldType.LOCATION),
|
|
1739
1815
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1740
|
-
configuration:
|
|
1741
|
-
searchableResource:
|
|
1816
|
+
configuration: z16.object({
|
|
1817
|
+
searchableResource: z16.array(z16.enum(["locations", "facilities", "offices"]))
|
|
1742
1818
|
})
|
|
1743
1819
|
}).describe("Input field for a location");
|
|
1744
1820
|
var FileUploadWithOptions = BaseField.extend({
|
|
1745
|
-
type:
|
|
1746
|
-
options:
|
|
1821
|
+
type: z16.literal(FieldType.FILE_WITH_OPTIONS),
|
|
1822
|
+
options: z16.array(SelectOption).describe("A list of options"),
|
|
1747
1823
|
defaultValue: FileFieldWithOptionValue.optional(),
|
|
1748
|
-
configuration:
|
|
1749
|
-
maxFileSize:
|
|
1824
|
+
configuration: z16.object({
|
|
1825
|
+
maxFileSize: z16.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1826
|
+
maxImageSize: z16.object({
|
|
1827
|
+
targetSize: z16.object({ width: z16.number(), height: z16.number() })
|
|
1828
|
+
}).optional(),
|
|
1750
1829
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
|
1751
1830
|
}).default({
|
|
1752
1831
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1753
1832
|
})
|
|
1754
1833
|
});
|
|
1755
1834
|
var Facility = BaseField.extend({
|
|
1756
|
-
type:
|
|
1835
|
+
type: z16.literal(FieldType.FACILITY),
|
|
1757
1836
|
defaultValue: NonEmptyTextValue.optional()
|
|
1758
1837
|
}).describe("Input field for a facility");
|
|
1759
1838
|
var Office = BaseField.extend({
|
|
1760
|
-
type:
|
|
1839
|
+
type: z16.literal(FieldType.OFFICE),
|
|
1761
1840
|
defaultValue: NonEmptyTextValue.optional()
|
|
1762
1841
|
}).describe("Input field for an office");
|
|
1763
1842
|
var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
|
|
1764
|
-
administrativeArea:
|
|
1843
|
+
administrativeArea: z16.union([UUID, SerializedUserField]).optional()
|
|
1765
1844
|
});
|
|
1766
1845
|
var Address = BaseField.extend({
|
|
1767
|
-
type:
|
|
1768
|
-
configuration:
|
|
1769
|
-
lineSeparator:
|
|
1770
|
-
fields:
|
|
1771
|
-
administrativeLevels:
|
|
1772
|
-
streetAddressForm:
|
|
1773
|
-
|
|
1774
|
-
id:
|
|
1846
|
+
type: z16.literal(FieldType.ADDRESS),
|
|
1847
|
+
configuration: z16.object({
|
|
1848
|
+
lineSeparator: z16.string().optional(),
|
|
1849
|
+
fields: z16.array(z16.enum(["country", "administrativeArea"])).optional(),
|
|
1850
|
+
administrativeLevels: z16.array(z16.string()).optional(),
|
|
1851
|
+
streetAddressForm: z16.array(
|
|
1852
|
+
z16.object({
|
|
1853
|
+
id: z16.string(),
|
|
1775
1854
|
required: requiredSchema,
|
|
1776
1855
|
label: TranslationConfig,
|
|
1777
|
-
type:
|
|
1778
|
-
conditionals:
|
|
1856
|
+
type: z16.literal(FieldType.TEXT),
|
|
1857
|
+
conditionals: z16.array(FieldConditional).default([]).optional(),
|
|
1779
1858
|
parent: FieldReference.optional()
|
|
1780
1859
|
})
|
|
1781
1860
|
).optional()
|
|
1782
1861
|
}).optional(),
|
|
1783
1862
|
defaultValue: DefaultAddressFieldValue.optional()
|
|
1784
1863
|
}).describe("Address input field \u2013 a combination of location and text fields");
|
|
1785
|
-
var StaticDataEntry =
|
|
1786
|
-
id:
|
|
1864
|
+
var StaticDataEntry = z16.object({
|
|
1865
|
+
id: z16.string().describe("ID for the data entry."),
|
|
1787
1866
|
label: TranslationConfig,
|
|
1788
|
-
value: TranslationConfig.or(
|
|
1867
|
+
value: TranslationConfig.or(z16.string()).or(FieldReference)
|
|
1789
1868
|
}).describe("Static data entry");
|
|
1790
|
-
var DataEntry =
|
|
1869
|
+
var DataEntry = z16.union([StaticDataEntry, z16.object({ fieldId: z16.string() })]).describe(
|
|
1791
1870
|
"Data entry can be either a static data entry, or a reference to another field in the current form or the declaration."
|
|
1792
1871
|
);
|
|
1793
1872
|
var DataField = BaseField.extend({
|
|
1794
|
-
type:
|
|
1795
|
-
configuration:
|
|
1873
|
+
type: z16.literal(FieldType.DATA),
|
|
1874
|
+
configuration: z16.object({
|
|
1796
1875
|
subtitle: TranslationConfig.optional(),
|
|
1797
|
-
data:
|
|
1876
|
+
data: z16.array(DataEntry)
|
|
1798
1877
|
})
|
|
1799
1878
|
}).describe("Data field for displaying read-only data");
|
|
1800
1879
|
var ButtonField = BaseField.extend({
|
|
1801
|
-
type:
|
|
1880
|
+
type: z16.literal(FieldType.BUTTON),
|
|
1802
1881
|
defaultValue: ButtonFieldValue.optional(),
|
|
1803
|
-
configuration:
|
|
1804
|
-
icon:
|
|
1882
|
+
configuration: z16.object({
|
|
1883
|
+
icon: z16.string().optional().describe(
|
|
1805
1884
|
"Icon for the button. You can find icons from OpenCRVS UI-Kit."
|
|
1806
1885
|
),
|
|
1807
|
-
loading:
|
|
1886
|
+
loading: z16.boolean().optional().describe("Whether the button is in a loading state and shows a spinner"),
|
|
1808
1887
|
text: TranslationConfig.describe("Text to display on the button")
|
|
1809
1888
|
})
|
|
1810
1889
|
}).describe("Generic button without any built-in functionality");
|
|
1811
1890
|
var AlphaPrintButton = BaseField.extend({
|
|
1812
|
-
type:
|
|
1813
|
-
configuration:
|
|
1814
|
-
template:
|
|
1891
|
+
type: z16.literal(FieldType.ALPHA_PRINT_BUTTON),
|
|
1892
|
+
configuration: z16.object({
|
|
1893
|
+
template: z16.string().describe("Template ID from countryconfig templates to use for printing"),
|
|
1815
1894
|
buttonLabel: TranslationConfig.optional().describe(
|
|
1816
1895
|
"Label for the print button"
|
|
1817
1896
|
)
|
|
1818
1897
|
})
|
|
1819
1898
|
}).describe("Print button field for printing certificates");
|
|
1820
1899
|
var HttpField = BaseField.extend({
|
|
1821
|
-
type:
|
|
1900
|
+
type: z16.literal(FieldType.HTTP),
|
|
1822
1901
|
defaultValue: HttpFieldValue.optional(),
|
|
1823
|
-
configuration:
|
|
1902
|
+
configuration: z16.object({
|
|
1824
1903
|
trigger: FieldReference,
|
|
1825
|
-
url:
|
|
1826
|
-
method:
|
|
1827
|
-
headers:
|
|
1828
|
-
body:
|
|
1829
|
-
errorValue:
|
|
1830
|
-
params:
|
|
1831
|
-
timeout:
|
|
1904
|
+
url: z16.string().describe("URL to send the HTTP request to"),
|
|
1905
|
+
method: z16.enum(["GET", "POST", "PUT", "DELETE"]),
|
|
1906
|
+
headers: z16.record(z16.string(), z16.string()).optional(),
|
|
1907
|
+
body: z16.record(z16.string(), z16.any()).optional(),
|
|
1908
|
+
errorValue: z16.any().optional().describe("Value to set if the request fails"),
|
|
1909
|
+
params: z16.record(z16.string(), z16.union([z16.string(), FieldReference])).optional(),
|
|
1910
|
+
timeout: z16.number().default(15e3).describe("Request timeout in milliseconds")
|
|
1832
1911
|
})
|
|
1833
1912
|
}).describe("HTTP request function triggered by a button click or other event");
|
|
1834
1913
|
var SearchField = HttpField.extend({
|
|
1835
|
-
type:
|
|
1914
|
+
type: z16.literal(FieldType.SEARCH),
|
|
1836
1915
|
configuration: SearchQuery.pick({
|
|
1837
1916
|
query: true,
|
|
1838
1917
|
limit: true,
|
|
1839
1918
|
offset: true
|
|
1840
1919
|
}).extend({
|
|
1841
1920
|
validation: ValidationConfig,
|
|
1842
|
-
indicators:
|
|
1921
|
+
indicators: z16.object({
|
|
1843
1922
|
loading: TranslationConfig.optional().describe(
|
|
1844
1923
|
"Text to display while the search is in progress"
|
|
1845
1924
|
),
|
|
@@ -1854,7 +1933,7 @@ var SearchField = HttpField.extend({
|
|
|
1854
1933
|
),
|
|
1855
1934
|
confirmButton: TranslationConfig.optional(),
|
|
1856
1935
|
clearButton: TranslationConfig.optional(),
|
|
1857
|
-
clearModal:
|
|
1936
|
+
clearModal: z16.object({
|
|
1858
1937
|
title: TranslationConfig.optional(),
|
|
1859
1938
|
description: TranslationConfig.optional(),
|
|
1860
1939
|
cancel: TranslationConfig.optional(),
|
|
@@ -1865,17 +1944,17 @@ var SearchField = HttpField.extend({
|
|
|
1865
1944
|
})
|
|
1866
1945
|
});
|
|
1867
1946
|
var LinkButtonField = BaseField.extend({
|
|
1868
|
-
type:
|
|
1869
|
-
configuration:
|
|
1870
|
-
url:
|
|
1947
|
+
type: z16.literal(FieldType.LINK_BUTTON),
|
|
1948
|
+
configuration: z16.object({
|
|
1949
|
+
url: z16.string().describe("URL to open"),
|
|
1871
1950
|
text: TranslationConfig.describe("Text to display on the button"),
|
|
1872
|
-
icon:
|
|
1951
|
+
icon: z16.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit.")
|
|
1873
1952
|
})
|
|
1874
1953
|
}).describe("Button that opens a link");
|
|
1875
1954
|
var VerificationStatus = BaseField.extend({
|
|
1876
|
-
type:
|
|
1955
|
+
type: z16.literal(FieldType.VERIFICATION_STATUS),
|
|
1877
1956
|
defaultValue: VerificationStatusValue.optional(),
|
|
1878
|
-
configuration:
|
|
1957
|
+
configuration: z16.object({
|
|
1879
1958
|
status: TranslationConfig.describe("Text to display on the status pill."),
|
|
1880
1959
|
description: TranslationConfig.describe(
|
|
1881
1960
|
"Explaining text on the banner in form."
|
|
@@ -1883,38 +1962,55 @@ var VerificationStatus = BaseField.extend({
|
|
|
1883
1962
|
})
|
|
1884
1963
|
});
|
|
1885
1964
|
var QueryParamReaderField = BaseField.extend({
|
|
1886
|
-
type:
|
|
1887
|
-
configuration:
|
|
1888
|
-
pickParams:
|
|
1965
|
+
type: z16.literal(FieldType.QUERY_PARAM_READER),
|
|
1966
|
+
configuration: z16.object({
|
|
1967
|
+
pickParams: z16.array(z16.string()).describe("List of query parameters to read from the URL")
|
|
1889
1968
|
})
|
|
1890
1969
|
}).describe(
|
|
1891
1970
|
"A field that maps URL query params into form values and clears them afterward"
|
|
1892
1971
|
);
|
|
1893
1972
|
var QrReaderField = BaseField.extend({
|
|
1894
|
-
type:
|
|
1973
|
+
type: z16.literal(FieldType.QR_READER),
|
|
1895
1974
|
defaultValue: QrReaderFieldValue.optional(),
|
|
1896
|
-
configuration:
|
|
1897
|
-
validator:
|
|
1898
|
-
|
|
1899
|
-
|
|
1975
|
+
configuration: z16.object({
|
|
1976
|
+
validator: z16.any().meta({
|
|
1977
|
+
description: "JSON Schema to validate the scanned QR code data against before populating the form fields.",
|
|
1978
|
+
id: "QrReaderFieldValidator"
|
|
1979
|
+
})
|
|
1900
1980
|
}).optional()
|
|
1981
|
+
}).meta({
|
|
1982
|
+
description: "Configuration for QR code reader field, including optional JSON Schema validator.",
|
|
1983
|
+
id: "QrReaderField"
|
|
1901
1984
|
});
|
|
1902
1985
|
var IdReaderField = BaseField.extend({
|
|
1903
|
-
type:
|
|
1986
|
+
type: z16.literal(FieldType.ID_READER),
|
|
1904
1987
|
defaultValue: IdReaderFieldValue.optional(),
|
|
1905
|
-
methods:
|
|
1906
|
-
|
|
1988
|
+
methods: z16.array(
|
|
1989
|
+
z16.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
|
|
1907
1990
|
)
|
|
1908
1991
|
});
|
|
1992
|
+
var CustomField = BaseField.extend({
|
|
1993
|
+
type: z16.literal(FieldType._EXPERIMENTAL_CUSTOM),
|
|
1994
|
+
defaultValue: CustomFieldValue.optional(),
|
|
1995
|
+
src: z16.string().describe("Module source path for the custom field component"),
|
|
1996
|
+
configuration: z16.unknown().optional()
|
|
1997
|
+
});
|
|
1909
1998
|
var LoaderField = BaseField.extend({
|
|
1910
|
-
type:
|
|
1911
|
-
configuration:
|
|
1999
|
+
type: z16.literal(FieldType.LOADER),
|
|
2000
|
+
configuration: z16.object({
|
|
1912
2001
|
text: TranslationConfig.describe("Display text above the loading spinner")
|
|
1913
2002
|
})
|
|
1914
2003
|
}).describe(
|
|
1915
2004
|
"A non-interactive field that indicates an in progress operation in form"
|
|
1916
2005
|
);
|
|
1917
|
-
var
|
|
2006
|
+
var HiddenField = BaseField.extend({
|
|
2007
|
+
type: z16.literal(FieldType.ALPHA_HIDDEN),
|
|
2008
|
+
required: z16.boolean().default(false).optional(),
|
|
2009
|
+
defaultValue: TextValue.optional()
|
|
2010
|
+
}).describe(
|
|
2011
|
+
"A non-interactive, hidden field that only hold a value in the form"
|
|
2012
|
+
);
|
|
2013
|
+
var FieldConfig = z16.discriminatedUnion("type", [
|
|
1918
2014
|
Address,
|
|
1919
2015
|
TextField,
|
|
1920
2016
|
NumberField,
|
|
@@ -1953,83 +2049,81 @@ var FieldConfig = import_zod15.z.discriminatedUnion("type", [
|
|
|
1953
2049
|
IdReaderField,
|
|
1954
2050
|
QueryParamReaderField,
|
|
1955
2051
|
LoaderField,
|
|
1956
|
-
SearchField
|
|
1957
|
-
|
|
2052
|
+
SearchField,
|
|
2053
|
+
CustomField,
|
|
2054
|
+
HiddenField
|
|
2055
|
+
]).meta({
|
|
1958
2056
|
description: "Form field configuration",
|
|
1959
|
-
|
|
2057
|
+
id: "FieldConfig"
|
|
1960
2058
|
});
|
|
1961
|
-
var AnyFileField =
|
|
2059
|
+
var AnyFileField = z16.discriminatedUnion("type", [
|
|
1962
2060
|
SignatureField,
|
|
1963
2061
|
File,
|
|
1964
2062
|
FileUploadWithOptions
|
|
1965
2063
|
]);
|
|
1966
2064
|
|
|
1967
2065
|
// ../commons/src/events/FormConfig.ts
|
|
1968
|
-
var
|
|
2066
|
+
var z18 = __toESM(require("zod/v4"));
|
|
1969
2067
|
|
|
1970
2068
|
// ../commons/src/events/PageConfig.ts
|
|
1971
|
-
var
|
|
1972
|
-
var
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
var PageConfigBase = import_zod16.z.object({
|
|
1976
|
-
id: import_zod16.z.string().describe("Unique identifier for the page"),
|
|
2069
|
+
var z17 = __toESM(require("zod/v4"));
|
|
2070
|
+
var PageTypes = z17.enum(["FORM", "VERIFICATION"]);
|
|
2071
|
+
var PageConfigBase = z17.object({
|
|
2072
|
+
id: z17.string().describe("Unique identifier for the page"),
|
|
1977
2073
|
title: TranslationConfig.describe("Header title of the page"),
|
|
1978
|
-
requireCompletionToContinue:
|
|
2074
|
+
requireCompletionToContinue: z17.boolean().default(false).describe(
|
|
1979
2075
|
"If true, all required fields must be filled before continuing to the next page"
|
|
1980
2076
|
),
|
|
1981
|
-
fields:
|
|
2077
|
+
fields: z17.array(FieldConfig).describe("Fields to be rendered on the page"),
|
|
1982
2078
|
conditional: Conditional.optional().describe(
|
|
1983
2079
|
"Page will be shown if condition is met. If conditional is not defined, the page will be always shown."
|
|
1984
2080
|
)
|
|
1985
|
-
}).
|
|
2081
|
+
}).meta({
|
|
1986
2082
|
description: "Form page configuration",
|
|
1987
|
-
|
|
2083
|
+
id: "FormPageConfig"
|
|
1988
2084
|
});
|
|
1989
2085
|
var FormPageConfig = PageConfigBase.extend({
|
|
1990
|
-
type:
|
|
2086
|
+
type: z17.literal(PageTypes.enum.FORM).default(PageTypes.enum.FORM)
|
|
1991
2087
|
});
|
|
1992
|
-
var VerificationActionConfig =
|
|
1993
|
-
verify:
|
|
1994
|
-
cancel:
|
|
2088
|
+
var VerificationActionConfig = z17.object({
|
|
2089
|
+
verify: z17.object({ label: TranslationConfig }),
|
|
2090
|
+
cancel: z17.object({
|
|
1995
2091
|
label: TranslationConfig,
|
|
1996
|
-
confirmation:
|
|
2092
|
+
confirmation: z17.object({
|
|
1997
2093
|
title: TranslationConfig,
|
|
1998
2094
|
body: TranslationConfig
|
|
1999
2095
|
})
|
|
2000
2096
|
})
|
|
2001
|
-
}).describe("Actions available on the verification page").
|
|
2097
|
+
}).describe("Actions available on the verification page").meta({
|
|
2002
2098
|
description: "Verification action configuration",
|
|
2003
|
-
|
|
2099
|
+
id: "VerificationActionConfig"
|
|
2004
2100
|
});
|
|
2005
2101
|
var VerificationPageConfig = FormPageConfig.extend({
|
|
2006
|
-
type:
|
|
2102
|
+
type: z17.literal(PageTypes.enum.VERIFICATION),
|
|
2007
2103
|
actions: VerificationActionConfig
|
|
2008
2104
|
});
|
|
2009
|
-
var PageConfig =
|
|
2105
|
+
var PageConfig = z17.discriminatedUnion("type", [
|
|
2010
2106
|
FormPageConfig,
|
|
2011
2107
|
VerificationPageConfig
|
|
2012
2108
|
]);
|
|
2013
2109
|
|
|
2014
2110
|
// ../commons/src/events/FormConfig.ts
|
|
2015
|
-
var DeclarationFormConfig =
|
|
2111
|
+
var DeclarationFormConfig = z18.object({
|
|
2016
2112
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2017
|
-
pages:
|
|
2113
|
+
pages: z18.array(FormPageConfig)
|
|
2018
2114
|
}).describe("Configuration of the declaration form.");
|
|
2019
|
-
var ActionFormConfig =
|
|
2115
|
+
var ActionFormConfig = z18.object({
|
|
2020
2116
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2021
|
-
pages:
|
|
2117
|
+
pages: z18.array(PageConfig)
|
|
2022
2118
|
}).describe(
|
|
2023
2119
|
"Configuration of the form used for system actions beyond declaration, supporting a wider range of page types."
|
|
2024
2120
|
);
|
|
2025
|
-
var FormConfig =
|
|
2121
|
+
var FormConfig = z18.union([DeclarationFormConfig, ActionFormConfig]);
|
|
2026
2122
|
|
|
2027
2123
|
// ../commons/src/events/DeduplicationConfig.ts
|
|
2028
|
-
var
|
|
2029
|
-
var
|
|
2030
|
-
|
|
2031
|
-
var FieldReference2 = import_zod18.z.string();
|
|
2032
|
-
var Matcher = import_zod18.z.object({
|
|
2124
|
+
var z19 = __toESM(require("zod/v4"));
|
|
2125
|
+
var FieldReference2 = z19.string();
|
|
2126
|
+
var Matcher = z19.object({
|
|
2033
2127
|
/**
|
|
2034
2128
|
* Reference to the field used in matching.
|
|
2035
2129
|
*
|
|
@@ -2037,68 +2131,68 @@ var Matcher = import_zod18.z.object({
|
|
|
2037
2131
|
* be used as the origin date to calculate the distance from.
|
|
2038
2132
|
*/
|
|
2039
2133
|
fieldId: FieldReference2,
|
|
2040
|
-
options:
|
|
2041
|
-
boost:
|
|
2134
|
+
options: z19.object({
|
|
2135
|
+
boost: z19.number().optional()
|
|
2042
2136
|
}).optional().default({
|
|
2043
2137
|
boost: 1
|
|
2044
2138
|
})
|
|
2045
2139
|
});
|
|
2046
2140
|
var FuzzyMatcher = Matcher.extend({
|
|
2047
|
-
type:
|
|
2048
|
-
options:
|
|
2141
|
+
type: z19.literal("fuzzy"),
|
|
2142
|
+
options: z19.object({
|
|
2049
2143
|
/**
|
|
2050
2144
|
* Names of length 3 or less characters = 0 edits allowed
|
|
2051
2145
|
* Names of length 4 - 6 characters = 1 edit allowed
|
|
2052
2146
|
* Names of length >7 characters = 2 edits allowed
|
|
2053
2147
|
*/
|
|
2054
|
-
fuzziness:
|
|
2055
|
-
boost:
|
|
2148
|
+
fuzziness: z19.union([z19.string(), z19.number()]).optional().default("AUTO:4,7"),
|
|
2149
|
+
boost: z19.number().optional().default(1)
|
|
2056
2150
|
}).optional().default({
|
|
2057
2151
|
fuzziness: "AUTO:4,7",
|
|
2058
2152
|
boost: 1
|
|
2059
2153
|
})
|
|
2060
2154
|
});
|
|
2061
2155
|
var StrictMatcher = Matcher.extend({
|
|
2062
|
-
type:
|
|
2063
|
-
options:
|
|
2064
|
-
boost:
|
|
2156
|
+
type: z19.literal("strict"),
|
|
2157
|
+
options: z19.object({
|
|
2158
|
+
boost: z19.number().optional().default(1),
|
|
2065
2159
|
/**
|
|
2066
2160
|
* The constant value to be present in the field for both records
|
|
2067
2161
|
*/
|
|
2068
|
-
value:
|
|
2162
|
+
value: z19.string().optional()
|
|
2069
2163
|
}).optional().default({
|
|
2070
2164
|
boost: 1
|
|
2071
2165
|
})
|
|
2072
2166
|
});
|
|
2073
2167
|
var DateRangeMatcher = Matcher.extend({
|
|
2074
|
-
type:
|
|
2075
|
-
options:
|
|
2168
|
+
type: z19.literal("dateRange"),
|
|
2169
|
+
options: z19.object({
|
|
2076
2170
|
/**
|
|
2077
2171
|
* The distance pivot in days. Distance from the origin (the value of
|
|
2078
2172
|
* fieldId) at which relevance scores receive half of the boost value
|
|
2079
2173
|
*/
|
|
2080
|
-
pivot:
|
|
2081
|
-
days:
|
|
2082
|
-
boost:
|
|
2174
|
+
pivot: z19.number().optional(),
|
|
2175
|
+
days: z19.number(),
|
|
2176
|
+
boost: z19.number().optional().default(1)
|
|
2083
2177
|
})
|
|
2084
2178
|
});
|
|
2085
|
-
var Not =
|
|
2086
|
-
type:
|
|
2179
|
+
var Not = z19.object({
|
|
2180
|
+
type: z19.literal("not"),
|
|
2087
2181
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2088
|
-
clause:
|
|
2182
|
+
clause: z19.lazy(() => Clause)
|
|
2089
2183
|
});
|
|
2090
|
-
var And =
|
|
2091
|
-
type:
|
|
2184
|
+
var And = z19.object({
|
|
2185
|
+
type: z19.literal("and"),
|
|
2092
2186
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2093
|
-
clauses:
|
|
2187
|
+
clauses: z19.lazy(() => Clause.array())
|
|
2094
2188
|
});
|
|
2095
|
-
var Or =
|
|
2096
|
-
type:
|
|
2189
|
+
var Or = z19.object({
|
|
2190
|
+
type: z19.literal("or"),
|
|
2097
2191
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2098
|
-
clauses:
|
|
2192
|
+
clauses: z19.lazy(() => Clause.array())
|
|
2099
2193
|
});
|
|
2100
|
-
var Clause =
|
|
2101
|
-
() =>
|
|
2194
|
+
var Clause = z19.lazy(
|
|
2195
|
+
() => z19.discriminatedUnion("type", [
|
|
2102
2196
|
Not,
|
|
2103
2197
|
And,
|
|
2104
2198
|
Or,
|
|
@@ -2106,193 +2200,326 @@ var Clause = import_zod18.z.lazy(
|
|
|
2106
2200
|
StrictMatcher,
|
|
2107
2201
|
DateRangeMatcher
|
|
2108
2202
|
])
|
|
2109
|
-
).
|
|
2110
|
-
|
|
2203
|
+
).meta({
|
|
2204
|
+
id: "Clause"
|
|
2111
2205
|
});
|
|
2112
|
-
var DeduplicationConfig =
|
|
2113
|
-
id:
|
|
2206
|
+
var DeduplicationConfig = z19.object({
|
|
2207
|
+
id: z19.string(),
|
|
2114
2208
|
label: TranslationConfig,
|
|
2115
2209
|
query: Clause
|
|
2116
2210
|
});
|
|
2117
2211
|
|
|
2212
|
+
// ../commons/src/icons.ts
|
|
2213
|
+
var z20 = __toESM(require("zod/v4"));
|
|
2214
|
+
var AvailableIcons = z20.enum([
|
|
2215
|
+
"Archived",
|
|
2216
|
+
"Assigned",
|
|
2217
|
+
"Certified",
|
|
2218
|
+
"Close",
|
|
2219
|
+
"Collapse",
|
|
2220
|
+
"Draft",
|
|
2221
|
+
"DuplicateYellow",
|
|
2222
|
+
"Expand",
|
|
2223
|
+
"ExternalValidate",
|
|
2224
|
+
"FilledCheck",
|
|
2225
|
+
"InReview",
|
|
2226
|
+
"Offline",
|
|
2227
|
+
"Registered",
|
|
2228
|
+
"RequiresUpdates",
|
|
2229
|
+
"Sent",
|
|
2230
|
+
"Validated",
|
|
2231
|
+
"WaitingApproval",
|
|
2232
|
+
"ChartActivity",
|
|
2233
|
+
"Activity",
|
|
2234
|
+
"Archive",
|
|
2235
|
+
"ArchiveTray",
|
|
2236
|
+
"ArrowLeft",
|
|
2237
|
+
"ArrowRight",
|
|
2238
|
+
"Buildings",
|
|
2239
|
+
"Circle",
|
|
2240
|
+
"CaretDown",
|
|
2241
|
+
"CaretLeft",
|
|
2242
|
+
"CaretRight",
|
|
2243
|
+
"ChartBar",
|
|
2244
|
+
"ChartLine",
|
|
2245
|
+
"ChatCircle",
|
|
2246
|
+
"CheckSquare",
|
|
2247
|
+
"Compass",
|
|
2248
|
+
"Check",
|
|
2249
|
+
"Copy",
|
|
2250
|
+
"Database",
|
|
2251
|
+
"DotsThreeVertical",
|
|
2252
|
+
"ArrowCounterClockwise",
|
|
2253
|
+
"MagnifyingGlassMinus",
|
|
2254
|
+
"MagnifyingGlassPlus",
|
|
2255
|
+
"Export",
|
|
2256
|
+
"Eye",
|
|
2257
|
+
"EyeSlash",
|
|
2258
|
+
"Envelope",
|
|
2259
|
+
"File",
|
|
2260
|
+
"FileSearch",
|
|
2261
|
+
"FileMinus",
|
|
2262
|
+
"FilePlus",
|
|
2263
|
+
"FileText",
|
|
2264
|
+
"FileX",
|
|
2265
|
+
"Handshake",
|
|
2266
|
+
"Gear",
|
|
2267
|
+
"GitBranch",
|
|
2268
|
+
"IdentificationCard",
|
|
2269
|
+
"List",
|
|
2270
|
+
"ListBullets",
|
|
2271
|
+
"Lock",
|
|
2272
|
+
"MagnifyingGlass",
|
|
2273
|
+
"MapPin",
|
|
2274
|
+
"Medal",
|
|
2275
|
+
"NotePencil",
|
|
2276
|
+
"Paperclip",
|
|
2277
|
+
"PaperPlaneTilt",
|
|
2278
|
+
"Pen",
|
|
2279
|
+
"Pencil",
|
|
2280
|
+
"PencilSimpleLine",
|
|
2281
|
+
"Phone",
|
|
2282
|
+
"Plus",
|
|
2283
|
+
"Printer",
|
|
2284
|
+
"SignOut",
|
|
2285
|
+
"Stamp",
|
|
2286
|
+
"Star",
|
|
2287
|
+
"Target",
|
|
2288
|
+
"TextT",
|
|
2289
|
+
"Trash",
|
|
2290
|
+
"UploadSimple",
|
|
2291
|
+
"User",
|
|
2292
|
+
"UserPlus",
|
|
2293
|
+
"Users",
|
|
2294
|
+
"WarningCircle",
|
|
2295
|
+
"X",
|
|
2296
|
+
"ChatText",
|
|
2297
|
+
"CircleWavyCheck",
|
|
2298
|
+
"CircleWavyQuestion",
|
|
2299
|
+
"ArchiveBox",
|
|
2300
|
+
"ArrowCircleDown",
|
|
2301
|
+
"FileArrowUp",
|
|
2302
|
+
"FileDotted",
|
|
2303
|
+
"Files",
|
|
2304
|
+
"PencilLine",
|
|
2305
|
+
"PencilCircle",
|
|
2306
|
+
"UserCircle",
|
|
2307
|
+
"Clock",
|
|
2308
|
+
"QrCode",
|
|
2309
|
+
"Webcam",
|
|
2310
|
+
"Sun",
|
|
2311
|
+
"DeviceTabletCamera",
|
|
2312
|
+
"Globe",
|
|
2313
|
+
"Fingerprint",
|
|
2314
|
+
"PushPin",
|
|
2315
|
+
"Timer"
|
|
2316
|
+
]);
|
|
2317
|
+
|
|
2118
2318
|
// ../commons/src/events/ActionConfig.ts
|
|
2119
|
-
var
|
|
2120
|
-
(0, import_zod_openapi9.extendZodWithOpenApi)(import_zod19.z);
|
|
2121
|
-
var DeclarationReviewConfig = import_zod19.z.object({
|
|
2319
|
+
var DeclarationReviewConfig = z21.object({
|
|
2122
2320
|
title: TranslationConfig.describe("Title of the review page"),
|
|
2123
|
-
fields:
|
|
2321
|
+
fields: z21.array(FieldConfig).describe("Fields displayed on the review page for annotations.")
|
|
2124
2322
|
}).describe(
|
|
2125
2323
|
"Configuration of the declaration review page for collecting event-related metadata."
|
|
2126
2324
|
);
|
|
2127
|
-
var ActionConfigBase =
|
|
2128
|
-
label: TranslationConfig.describe("Human readable description of the action")
|
|
2325
|
+
var ActionConfigBase = z21.object({
|
|
2326
|
+
label: TranslationConfig.describe("Human readable description of the action"),
|
|
2327
|
+
flags: z21.array(ActionFlagConfig).optional().default([]).describe("Flag actions which are executed when the action is performed."),
|
|
2328
|
+
supportingCopy: TranslationConfig.optional().describe(
|
|
2329
|
+
"Text displayed on the confirmation dialog"
|
|
2330
|
+
),
|
|
2331
|
+
icon: AvailableIcons.describe("Icon representing the action").optional(),
|
|
2332
|
+
conditionals: z21.array(ActionConditional).optional().describe("Conditionals which can disable or hide actions.")
|
|
2129
2333
|
});
|
|
2130
2334
|
var DeclarationActionBase = ActionConfigBase.extend({
|
|
2131
|
-
review: DeclarationReviewConfig,
|
|
2132
2335
|
deduplication: DeduplicationConfig.optional()
|
|
2133
2336
|
});
|
|
2134
|
-
var ReadActionConfig = ActionConfigBase.
|
|
2135
|
-
|
|
2136
|
-
type:
|
|
2337
|
+
var ReadActionConfig = ActionConfigBase.extend(
|
|
2338
|
+
z21.object({
|
|
2339
|
+
type: z21.literal(ActionType.READ),
|
|
2137
2340
|
review: DeclarationReviewConfig.describe(
|
|
2138
2341
|
"Configuration of the review page for read-only view."
|
|
2139
|
-
)
|
|
2140
|
-
|
|
2141
|
-
)
|
|
2142
|
-
var DeclareConfig = DeclarationActionBase.merge(
|
|
2143
|
-
import_zod19.z.object({
|
|
2144
|
-
type: import_zod19.z.literal(ActionType.DECLARE)
|
|
2145
|
-
})
|
|
2342
|
+
),
|
|
2343
|
+
conditionals: z21.never().optional().describe("Read-action can not be disabled or hidden with conditionals.")
|
|
2344
|
+
}).shape
|
|
2146
2345
|
);
|
|
2147
|
-
var
|
|
2148
|
-
|
|
2149
|
-
type:
|
|
2150
|
-
|
|
2346
|
+
var DeclareConfig = DeclarationActionBase.extend(
|
|
2347
|
+
z21.object({
|
|
2348
|
+
type: z21.literal(ActionType.DECLARE),
|
|
2349
|
+
review: DeclarationReviewConfig.describe(
|
|
2350
|
+
"Configuration of the review page fields."
|
|
2351
|
+
),
|
|
2352
|
+
dialogCopy: z21.object({
|
|
2353
|
+
notify: TranslationConfig.describe(
|
|
2354
|
+
"Confirmation text for the notify action"
|
|
2355
|
+
),
|
|
2356
|
+
declare: TranslationConfig.describe(
|
|
2357
|
+
"Confirmation text for the declare action"
|
|
2358
|
+
),
|
|
2359
|
+
register: TranslationConfig.describe(
|
|
2360
|
+
"Confirmation text for the register action"
|
|
2361
|
+
)
|
|
2362
|
+
}).optional()
|
|
2363
|
+
}).shape
|
|
2151
2364
|
);
|
|
2152
|
-
var
|
|
2153
|
-
|
|
2154
|
-
type:
|
|
2155
|
-
})
|
|
2365
|
+
var ArchiveConfig = ActionConfigBase.extend(
|
|
2366
|
+
z21.object({
|
|
2367
|
+
type: z21.literal(ActionType.ARCHIVE)
|
|
2368
|
+
}).shape
|
|
2156
2369
|
);
|
|
2157
|
-
var
|
|
2158
|
-
|
|
2159
|
-
type:
|
|
2160
|
-
|
|
2370
|
+
var EditActionConfig = ActionConfigBase.extend(
|
|
2371
|
+
z21.object({
|
|
2372
|
+
type: z21.literal(ActionType.EDIT),
|
|
2373
|
+
dialogCopy: z21.object({
|
|
2374
|
+
notify: TranslationConfig.describe(
|
|
2375
|
+
"Confirmation text for the notify with edits action"
|
|
2376
|
+
),
|
|
2377
|
+
declare: TranslationConfig.describe(
|
|
2378
|
+
"Confirmation text for the declare with edits action"
|
|
2379
|
+
),
|
|
2380
|
+
register: TranslationConfig.describe(
|
|
2381
|
+
"Confirmation text for the register with edits action"
|
|
2382
|
+
)
|
|
2383
|
+
})
|
|
2384
|
+
}).shape
|
|
2161
2385
|
);
|
|
2162
|
-
var
|
|
2163
|
-
|
|
2164
|
-
type:
|
|
2165
|
-
})
|
|
2386
|
+
var RejectConfig = ActionConfigBase.extend(
|
|
2387
|
+
z21.object({
|
|
2388
|
+
type: z21.literal(ActionType.REJECT)
|
|
2389
|
+
}).shape
|
|
2166
2390
|
);
|
|
2167
|
-
var
|
|
2168
|
-
|
|
2169
|
-
type:
|
|
2170
|
-
})
|
|
2391
|
+
var RegisterConfig = DeclarationActionBase.extend(
|
|
2392
|
+
z21.object({
|
|
2393
|
+
type: z21.literal(ActionType.REGISTER)
|
|
2394
|
+
}).shape
|
|
2171
2395
|
);
|
|
2172
|
-
var PrintCertificateActionConfig = ActionConfigBase.
|
|
2173
|
-
|
|
2174
|
-
type:
|
|
2396
|
+
var PrintCertificateActionConfig = ActionConfigBase.extend(
|
|
2397
|
+
z21.object({
|
|
2398
|
+
type: z21.literal(ActionType.PRINT_CERTIFICATE),
|
|
2175
2399
|
printForm: ActionFormConfig
|
|
2176
|
-
})
|
|
2400
|
+
}).shape
|
|
2177
2401
|
);
|
|
2178
|
-
var RequestCorrectionConfig = ActionConfigBase.
|
|
2179
|
-
|
|
2180
|
-
type:
|
|
2402
|
+
var RequestCorrectionConfig = ActionConfigBase.extend(
|
|
2403
|
+
z21.object({
|
|
2404
|
+
type: z21.literal(ActionType.REQUEST_CORRECTION),
|
|
2181
2405
|
correctionForm: ActionFormConfig
|
|
2182
|
-
})
|
|
2406
|
+
}).shape
|
|
2183
2407
|
);
|
|
2184
|
-
var
|
|
2185
|
-
|
|
2186
|
-
type:
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2408
|
+
var CustomActionConfig = ActionConfigBase.merge(
|
|
2409
|
+
z21.object({
|
|
2410
|
+
type: z21.literal(ActionType.CUSTOM),
|
|
2411
|
+
customActionType: z21.string().describe("Type identifier of the custom action."),
|
|
2412
|
+
/** 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. */
|
|
2413
|
+
form: z21.array(FieldConfig).describe(
|
|
2414
|
+
"Form configuration for the custom action. The form configured here will be used on the custom action confirmation modal."
|
|
2415
|
+
),
|
|
2416
|
+
auditHistoryLabel: TranslationConfig.describe(
|
|
2417
|
+
'The label to show in audit history for this action. For example "Approved".'
|
|
2418
|
+
)
|
|
2192
2419
|
})
|
|
2193
2420
|
);
|
|
2194
|
-
var ActionConfig =
|
|
2421
|
+
var ActionConfig = z21.discriminatedUnion("type", [
|
|
2195
2422
|
/*
|
|
2196
2423
|
* OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
|
|
2197
2424
|
* and treat them as "models" instead of duplicating the data structure in each endpoint.
|
|
2198
2425
|
*/
|
|
2199
|
-
ReadActionConfig.
|
|
2200
|
-
DeclareConfig.
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
DeleteConfig.openapi({ ref: "DeleteActionConfig" }),
|
|
2206
|
-
PrintCertificateActionConfig.openapi({
|
|
2207
|
-
ref: "PrintCertificateActionConfig"
|
|
2426
|
+
ReadActionConfig.meta({ id: "ReadActionConfig" }),
|
|
2427
|
+
DeclareConfig.meta({ id: "DeclareActionConfig" }),
|
|
2428
|
+
RejectConfig.meta({ id: "RejectActionConfig" }),
|
|
2429
|
+
RegisterConfig.meta({ id: "RegisterActionConfig" }),
|
|
2430
|
+
PrintCertificateActionConfig.meta({
|
|
2431
|
+
id: "PrintCertificateActionConfig"
|
|
2208
2432
|
}),
|
|
2209
|
-
RequestCorrectionConfig.
|
|
2210
|
-
|
|
2211
|
-
|
|
2433
|
+
RequestCorrectionConfig.meta({ id: "RequestCorrectionActionConfig" }),
|
|
2434
|
+
EditActionConfig.meta({ id: "EditActionConfig" }),
|
|
2435
|
+
ArchiveConfig.meta({ id: "ArchiveActionConfig" }),
|
|
2436
|
+
CustomActionConfig.meta({ id: "CustomActionConfig" })
|
|
2212
2437
|
]).describe(
|
|
2213
2438
|
"Configuration of an action available for an event. Data collected depends on the action type and is accessible through the annotation property in ActionDocument."
|
|
2214
|
-
).
|
|
2215
|
-
var
|
|
2439
|
+
).meta({ id: "ActionConfig" });
|
|
2440
|
+
var actionConfigTypes = new Set(
|
|
2441
|
+
ActionConfig.options.map((opt) => opt.shape.type.value)
|
|
2442
|
+
);
|
|
2443
|
+
var DeclarationActionConfig = z21.discriminatedUnion("type", [
|
|
2216
2444
|
DeclareConfig,
|
|
2217
|
-
ValidateConfig,
|
|
2218
2445
|
RegisterConfig
|
|
2219
2446
|
]);
|
|
2220
2447
|
|
|
2221
2448
|
// ../commons/src/events/offline/CertificateConfig.ts
|
|
2222
|
-
var
|
|
2223
|
-
var FontFamily =
|
|
2224
|
-
normal:
|
|
2225
|
-
bold:
|
|
2226
|
-
italics:
|
|
2227
|
-
bolditalics:
|
|
2449
|
+
var z22 = __toESM(require("zod/v4"));
|
|
2450
|
+
var FontFamily = z22.object({
|
|
2451
|
+
normal: z22.string(),
|
|
2452
|
+
bold: z22.string(),
|
|
2453
|
+
italics: z22.string(),
|
|
2454
|
+
bolditalics: z22.string()
|
|
2228
2455
|
});
|
|
2229
|
-
var CertificateConfig =
|
|
2230
|
-
id:
|
|
2231
|
-
event:
|
|
2232
|
-
isV2Template:
|
|
2456
|
+
var CertificateConfig = z22.object({
|
|
2457
|
+
id: z22.string(),
|
|
2458
|
+
event: z22.string(),
|
|
2459
|
+
isV2Template: z22.boolean().optional(),
|
|
2233
2460
|
label: TranslationConfig,
|
|
2234
|
-
isDefault:
|
|
2235
|
-
fee:
|
|
2236
|
-
onTime:
|
|
2237
|
-
late:
|
|
2238
|
-
delayed:
|
|
2461
|
+
isDefault: z22.boolean(),
|
|
2462
|
+
fee: z22.object({
|
|
2463
|
+
onTime: z22.number(),
|
|
2464
|
+
late: z22.number(),
|
|
2465
|
+
delayed: z22.number()
|
|
2239
2466
|
}),
|
|
2240
|
-
svgUrl:
|
|
2241
|
-
fonts:
|
|
2242
|
-
conditionals:
|
|
2467
|
+
svgUrl: z22.string(),
|
|
2468
|
+
fonts: z22.record(z22.string(), FontFamily).optional(),
|
|
2469
|
+
conditionals: z22.array(ShowConditional).optional()
|
|
2243
2470
|
});
|
|
2244
2471
|
var CertificateTemplateConfig = CertificateConfig.extend({
|
|
2245
|
-
hash:
|
|
2246
|
-
svg:
|
|
2472
|
+
hash: z22.string().optional(),
|
|
2473
|
+
svg: z22.string()
|
|
2247
2474
|
});
|
|
2248
2475
|
|
|
2249
2476
|
// ../commons/src/events/offline/LanguageConfig.ts
|
|
2250
|
-
var
|
|
2251
|
-
var LanguageConfig =
|
|
2252
|
-
lang:
|
|
2477
|
+
var z23 = __toESM(require("zod/v4"));
|
|
2478
|
+
var LanguageConfig = z23.object({
|
|
2479
|
+
lang: z23.string(),
|
|
2253
2480
|
/**
|
|
2254
2481
|
* client.csv contents
|
|
2255
2482
|
*/
|
|
2256
|
-
messages:
|
|
2483
|
+
messages: z23.record(z23.string(), z23.string())
|
|
2257
2484
|
});
|
|
2258
2485
|
|
|
2259
2486
|
// ../commons/src/events/EventConfig.ts
|
|
2260
|
-
var
|
|
2487
|
+
var z29 = __toESM(require("zod/v4"));
|
|
2261
2488
|
|
|
2262
2489
|
// ../commons/src/events/SummaryConfig.ts
|
|
2263
|
-
var
|
|
2264
|
-
var BaseField2 =
|
|
2490
|
+
var z24 = __toESM(require("zod/v4"));
|
|
2491
|
+
var BaseField2 = z24.object({
|
|
2265
2492
|
emptyValueMessage: TranslationConfig.optional().describe(
|
|
2266
2493
|
"Default message displayed when the field value is empty."
|
|
2267
2494
|
),
|
|
2268
|
-
conditionals:
|
|
2495
|
+
conditionals: z24.array(ShowConditional).default([]).optional()
|
|
2269
2496
|
});
|
|
2270
2497
|
var ReferenceField = BaseField2.extend({
|
|
2271
|
-
fieldId:
|
|
2498
|
+
fieldId: z24.string(),
|
|
2272
2499
|
label: TranslationConfig.optional().describe(
|
|
2273
2500
|
"Overrides the default label from the referenced field when provided."
|
|
2274
2501
|
)
|
|
2275
2502
|
}).describe("Field referencing existing event data by field ID.");
|
|
2276
2503
|
var Field = BaseField2.extend({
|
|
2277
|
-
id:
|
|
2504
|
+
id: z24.string().describe("Identifier of the summary field."),
|
|
2278
2505
|
value: TranslationConfig.describe(
|
|
2279
2506
|
'Field value template supporting variables from configuration and EventMetadata (e.g. "{informant.phoneNo} {informant.email}").'
|
|
2280
2507
|
),
|
|
2281
2508
|
label: TranslationConfig
|
|
2282
2509
|
}).describe("Custom field defined for the summary view.");
|
|
2283
|
-
var SummaryConfig =
|
|
2284
|
-
fields:
|
|
2510
|
+
var SummaryConfig = z24.object({
|
|
2511
|
+
fields: z24.array(z24.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
|
|
2285
2512
|
}).describe("Configuration of the event summary section.");
|
|
2286
2513
|
|
|
2287
2514
|
// ../commons/src/events/AdvancedSearchConfig.ts
|
|
2288
|
-
var
|
|
2289
|
-
var MatchType =
|
|
2290
|
-
var BaseField3 =
|
|
2291
|
-
config:
|
|
2515
|
+
var z25 = __toESM(require("zod/v4"));
|
|
2516
|
+
var MatchType = z25.enum(["fuzzy", "exact", "range", "within"]);
|
|
2517
|
+
var BaseField3 = z25.object({
|
|
2518
|
+
config: z25.object({
|
|
2292
2519
|
type: MatchType.describe(
|
|
2293
2520
|
"Determines the search type of field. How to match value."
|
|
2294
2521
|
),
|
|
2295
|
-
searchFields:
|
|
2522
|
+
searchFields: z25.array(z25.string()).optional().describe(
|
|
2296
2523
|
`
|
|
2297
2524
|
Defines multiple form fields that should be searched when this field has a value.
|
|
2298
2525
|
All specified fields will be combined using OR logic.
|
|
@@ -2302,7 +2529,7 @@ var BaseField3 = import_zod23.z.object({
|
|
|
2302
2529
|
`
|
|
2303
2530
|
)
|
|
2304
2531
|
}),
|
|
2305
|
-
type:
|
|
2532
|
+
type: z25.nativeEnum(FieldType).optional().describe(
|
|
2306
2533
|
`
|
|
2307
2534
|
Explicitly specify the field type for searchFields.
|
|
2308
2535
|
This is required when searchFields is defined, to show the correct control in the UI.
|
|
@@ -2316,7 +2543,7 @@ var BaseField3 = import_zod23.z.object({
|
|
|
2316
2543
|
This is required when searchFields is defined.
|
|
2317
2544
|
`
|
|
2318
2545
|
),
|
|
2319
|
-
options:
|
|
2546
|
+
options: z25.array(SelectOption).optional(),
|
|
2320
2547
|
searchCriteriaLabelPrefix: TranslationConfig.optional().describe(
|
|
2321
2548
|
`
|
|
2322
2549
|
This property determines whether to add a prefix (such as "Child" or "Applicant") before the field label
|
|
@@ -2337,7 +2564,7 @@ var BaseField3 = import_zod23.z.object({
|
|
|
2337
2564
|
in the country-config > event.advancedSearch configuration. For example: field("child.dob", { searchCriteriaLabelPrefix: TranslationConfig }).
|
|
2338
2565
|
`
|
|
2339
2566
|
),
|
|
2340
|
-
conditionals:
|
|
2567
|
+
conditionals: z25.array(FieldConditional).optional().describe(
|
|
2341
2568
|
`
|
|
2342
2569
|
In advanced search, we sometimes need to override the default field visibility conditionals.
|
|
2343
2570
|
|
|
@@ -2351,59 +2578,61 @@ var BaseField3 = import_zod23.z.object({
|
|
|
2351
2578
|
are always rendered in the advanced search form.
|
|
2352
2579
|
`
|
|
2353
2580
|
),
|
|
2354
|
-
validations:
|
|
2581
|
+
validations: z25.array(ValidationConfig).optional().describe(
|
|
2355
2582
|
`Option for overriding the field validations specifically for advanced search form.`
|
|
2356
2583
|
)
|
|
2357
2584
|
});
|
|
2358
|
-
var SearchQueryParams =
|
|
2359
|
-
eventType:
|
|
2585
|
+
var SearchQueryParams = z25.object({
|
|
2586
|
+
eventType: z25.string().optional().describe(
|
|
2360
2587
|
"Defines type of event so that when redirecting to Advanced Search page, appropriate tab can be selected"
|
|
2361
2588
|
)
|
|
2362
2589
|
}).catchall(FieldValue);
|
|
2363
2590
|
var FieldConfigSchema = BaseField3.extend({
|
|
2364
|
-
fieldId:
|
|
2365
|
-
fieldType:
|
|
2591
|
+
fieldId: z25.string(),
|
|
2592
|
+
fieldType: z25.literal("field")
|
|
2366
2593
|
});
|
|
2367
|
-
var EventFieldIdInput =
|
|
2594
|
+
var EventFieldIdInput = z25.enum([
|
|
2368
2595
|
"trackingId",
|
|
2369
2596
|
"status",
|
|
2370
2597
|
"legalStatuses.REGISTERED.acceptedAt",
|
|
2371
2598
|
"legalStatuses.REGISTERED.createdAtLocation",
|
|
2599
|
+
"legalStatuses.REGISTERED.registrationNumber",
|
|
2372
2600
|
"updatedAt"
|
|
2373
2601
|
]);
|
|
2374
2602
|
var METADATA_FIELD_PREFIX = "event.";
|
|
2375
|
-
var EventFieldId =
|
|
2603
|
+
var EventFieldId = z25.enum([
|
|
2376
2604
|
`${METADATA_FIELD_PREFIX}trackingId`,
|
|
2377
2605
|
`${METADATA_FIELD_PREFIX}status`,
|
|
2378
2606
|
`${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.acceptedAt`,
|
|
2379
2607
|
`${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.createdAtLocation`,
|
|
2608
|
+
`${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.registrationNumber`,
|
|
2380
2609
|
`${METADATA_FIELD_PREFIX}updatedAt`
|
|
2381
2610
|
]);
|
|
2382
2611
|
var EventFieldConfigSchema = BaseField3.extend({
|
|
2383
2612
|
fieldId: EventFieldId,
|
|
2384
|
-
fieldType:
|
|
2613
|
+
fieldType: z25.literal("event")
|
|
2385
2614
|
});
|
|
2386
|
-
var AdvancedSearchField =
|
|
2615
|
+
var AdvancedSearchField = z25.discriminatedUnion("fieldType", [FieldConfigSchema, EventFieldConfigSchema]).superRefine((data, ctx) => {
|
|
2387
2616
|
if (data.config.searchFields && data.config.searchFields.length > 0) {
|
|
2388
2617
|
if (!data.label) {
|
|
2389
2618
|
ctx.addIssue({
|
|
2390
|
-
code:
|
|
2619
|
+
code: z25.ZodIssueCode.custom,
|
|
2391
2620
|
message: "label is required when config.searchFields is defined.",
|
|
2392
2621
|
path: ["label"]
|
|
2393
2622
|
});
|
|
2394
2623
|
}
|
|
2395
2624
|
if (!data.type) {
|
|
2396
2625
|
ctx.addIssue({
|
|
2397
|
-
code:
|
|
2626
|
+
code: z25.ZodIssueCode.custom,
|
|
2398
2627
|
message: "type is required when config.searchFields is defined.",
|
|
2399
2628
|
path: ["type"]
|
|
2400
2629
|
});
|
|
2401
2630
|
}
|
|
2402
2631
|
}
|
|
2403
2632
|
});
|
|
2404
|
-
var AdvancedSearchConfig =
|
|
2633
|
+
var AdvancedSearchConfig = z25.object({
|
|
2405
2634
|
title: TranslationConfig.describe("Advanced search tab title"),
|
|
2406
|
-
fields:
|
|
2635
|
+
fields: z25.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
|
|
2407
2636
|
});
|
|
2408
2637
|
|
|
2409
2638
|
// ../commons/src/events/utils.ts
|
|
@@ -2412,11 +2641,11 @@ var import_lodash = require("lodash");
|
|
|
2412
2641
|
// ../commons/src/conditionals/validate.ts
|
|
2413
2642
|
var import__ = __toESM(require("ajv/dist/2019"));
|
|
2414
2643
|
var import_ajv_formats = __toESM(require("ajv-formats"));
|
|
2415
|
-
var
|
|
2644
|
+
var z27 = __toESM(require("zod/v4"));
|
|
2416
2645
|
var import_date_fns = require("date-fns");
|
|
2417
2646
|
|
|
2418
2647
|
// ../commons/src/events/DynamicFieldValue.ts
|
|
2419
|
-
var
|
|
2648
|
+
var z26 = __toESM(require("zod/v4"));
|
|
2420
2649
|
|
|
2421
2650
|
// ../commons/src/conditionals/validate.ts
|
|
2422
2651
|
var ajv = new import__.default({
|
|
@@ -2425,9 +2654,9 @@ var ajv = new import__.default({
|
|
|
2425
2654
|
strict: false
|
|
2426
2655
|
// Allow minContains and other newer features
|
|
2427
2656
|
});
|
|
2428
|
-
var DataContext =
|
|
2429
|
-
rootData:
|
|
2430
|
-
$leafAdminStructureLocationIds:
|
|
2657
|
+
var DataContext = z27.object({
|
|
2658
|
+
rootData: z27.object({
|
|
2659
|
+
$leafAdminStructureLocationIds: z27.array(z27.object({ id: UUID }))
|
|
2431
2660
|
})
|
|
2432
2661
|
});
|
|
2433
2662
|
function resolveDataPath(rootData, dataPath, instancePath) {
|
|
@@ -2504,12 +2733,12 @@ ajv.addKeyword({
|
|
|
2504
2733
|
});
|
|
2505
2734
|
|
|
2506
2735
|
// ../commons/src/utils.ts
|
|
2507
|
-
var
|
|
2508
|
-
var FullNameV1 =
|
|
2509
|
-
|
|
2510
|
-
use:
|
|
2511
|
-
family:
|
|
2512
|
-
given:
|
|
2736
|
+
var z28 = __toESM(require("zod/v4"));
|
|
2737
|
+
var FullNameV1 = z28.array(
|
|
2738
|
+
z28.object({
|
|
2739
|
+
use: z28.string(),
|
|
2740
|
+
family: z28.string(),
|
|
2741
|
+
given: z28.array(z28.string())
|
|
2513
2742
|
})
|
|
2514
2743
|
);
|
|
2515
2744
|
function omitKeyDeep(obj, keyToRemove) {
|
|
@@ -2530,9 +2759,6 @@ function omitKeyDeep(obj, keyToRemove) {
|
|
|
2530
2759
|
|
|
2531
2760
|
// ../commons/src/events/utils.ts
|
|
2532
2761
|
var import_date_fns2 = require("date-fns");
|
|
2533
|
-
function isDeclarationActionConfig(action) {
|
|
2534
|
-
return DeclarationActions.safeParse(action.type).success;
|
|
2535
|
-
}
|
|
2536
2762
|
function getDeclarationFields(configuration) {
|
|
2537
2763
|
return configuration.declaration.pages.flatMap(({ fields }) => fields);
|
|
2538
2764
|
}
|
|
@@ -2543,7 +2769,7 @@ var getActionAnnotationFields = (actionConfig) => {
|
|
|
2543
2769
|
if (actionConfig.type === ActionType.PRINT_CERTIFICATE) {
|
|
2544
2770
|
return actionConfig.printForm.pages.flatMap(({ fields }) => fields);
|
|
2545
2771
|
}
|
|
2546
|
-
if (
|
|
2772
|
+
if ("review" in actionConfig) {
|
|
2547
2773
|
return actionConfig.review.fields;
|
|
2548
2774
|
}
|
|
2549
2775
|
return [];
|
|
@@ -2563,38 +2789,8 @@ var EXCLUDED_ACTIONS = [
|
|
|
2563
2789
|
ActionType.REJECT_CORRECTION
|
|
2564
2790
|
];
|
|
2565
2791
|
|
|
2566
|
-
// ../commons/src/events/
|
|
2567
|
-
|
|
2568
|
-
(0, import_zod_openapi10.extendZodWithOpenApi)(import_zod26.z);
|
|
2569
|
-
var EventConfig = import_zod26.z.object({
|
|
2570
|
-
id: import_zod26.z.string().describe(
|
|
2571
|
-
'Machine-readable identifier of the event (e.g. "birth", "death").'
|
|
2572
|
-
),
|
|
2573
|
-
dateOfEvent: FieldReference.optional().describe(
|
|
2574
|
-
"Reference to the field capturing the date of the event (e.g. date of birth). Defaults to the event creation date if unspecified."
|
|
2575
|
-
),
|
|
2576
|
-
title: TranslationConfig.describe(
|
|
2577
|
-
'Title template for the singular event, supporting variables (e.g. "{applicant.name.firstname} {applicant.name.surname}").'
|
|
2578
|
-
),
|
|
2579
|
-
fallbackTitle: TranslationConfig.optional().describe(
|
|
2580
|
-
"Fallback title shown when the main title resolves to an empty value."
|
|
2581
|
-
),
|
|
2582
|
-
summary: SummaryConfig.describe(
|
|
2583
|
-
"Summary information displayed in the event overview."
|
|
2584
|
-
),
|
|
2585
|
-
label: TranslationConfig.describe(
|
|
2586
|
-
"Human-readable label for the event type."
|
|
2587
|
-
),
|
|
2588
|
-
actions: import_zod26.z.array(ActionConfig).describe(
|
|
2589
|
-
"Configuration of system-defined actions associated with the event."
|
|
2590
|
-
),
|
|
2591
|
-
declaration: DeclarationFormConfig.describe(
|
|
2592
|
-
"Configuration of the form used to gather event data."
|
|
2593
|
-
),
|
|
2594
|
-
advancedSearch: import_zod26.z.array(AdvancedSearchConfig).optional().default([]).describe(
|
|
2595
|
-
"Configuration of fields available in the advanced search feature."
|
|
2596
|
-
)
|
|
2597
|
-
}).superRefine((event2, ctx) => {
|
|
2792
|
+
// ../commons/src/events/eventConfigValidation.ts
|
|
2793
|
+
function validateAdvancedSearchConfig(event2, ctx) {
|
|
2598
2794
|
const allFields = findAllFields(event2);
|
|
2599
2795
|
const fieldIds = allFields.map((field3) => field3.id);
|
|
2600
2796
|
const advancedSearchFields = event2.advancedSearch.flatMap(
|
|
@@ -2621,10 +2817,12 @@ var EventConfig = import_zod26.z.object({
|
|
|
2621
2817
|
ctx.addIssue({
|
|
2622
2818
|
code: "custom",
|
|
2623
2819
|
message: `Advanced search id must match a field id of form fields or pre-defined metadata fields.
|
|
2624
|
-
|
|
2820
|
+
Invalid AdvancedSearch field IDs for event ${event2.id}: ${invalidFields.map((f) => f.fieldId).join(", ")}`,
|
|
2625
2821
|
path: ["advancedSearch"]
|
|
2626
2822
|
});
|
|
2627
2823
|
}
|
|
2824
|
+
}
|
|
2825
|
+
function validateDateOfEvent(event2, ctx) {
|
|
2628
2826
|
if (event2.dateOfEvent) {
|
|
2629
2827
|
const eventDateFieldId = getDeclarationFields(event2).find(
|
|
2630
2828
|
({ id }) => id === event2.dateOfEvent?.$$field
|
|
@@ -2633,7 +2831,7 @@ var EventConfig = import_zod26.z.object({
|
|
|
2633
2831
|
ctx.addIssue({
|
|
2634
2832
|
code: "custom",
|
|
2635
2833
|
message: `Date of event field id must match a field id in fields array.
|
|
2636
|
-
|
|
2834
|
+
Invalid date of event field ID for event ${event2.id}: ${event2.dateOfEvent.$$field}`,
|
|
2637
2835
|
path: ["dateOfEvent"]
|
|
2638
2836
|
});
|
|
2639
2837
|
} else if (eventDateFieldId.type !== FieldType.DATE) {
|
|
@@ -2644,8 +2842,105 @@ var EventConfig = import_zod26.z.object({
|
|
|
2644
2842
|
});
|
|
2645
2843
|
}
|
|
2646
2844
|
}
|
|
2647
|
-
}
|
|
2648
|
-
|
|
2845
|
+
}
|
|
2846
|
+
function validatePlaceOfEvent(event2, ctx) {
|
|
2847
|
+
if (event2.placeOfEvent) {
|
|
2848
|
+
const eventPlaceFieldId = getDeclarationFields(event2).find(
|
|
2849
|
+
({ id }) => id === event2.placeOfEvent?.$$field
|
|
2850
|
+
);
|
|
2851
|
+
if (!eventPlaceFieldId) {
|
|
2852
|
+
ctx.addIssue({
|
|
2853
|
+
code: "custom",
|
|
2854
|
+
message: `Place of event field id must match a field id in the event.declaration fields.
|
|
2855
|
+
Invalid place of event field ID for event ${event2.id}: ${event2.placeOfEvent.$$field}`,
|
|
2856
|
+
path: ["placeOfEvent"]
|
|
2857
|
+
});
|
|
2858
|
+
}
|
|
2859
|
+
}
|
|
2860
|
+
}
|
|
2861
|
+
function validateActionFlags(event2, ctx) {
|
|
2862
|
+
const isInherentFlag = (value) => Object.values(InherentFlags).includes(value);
|
|
2863
|
+
const configuredFlagIds = event2.flags.map((flag) => flag.id);
|
|
2864
|
+
const actionFlagIds = event2.actions.flatMap(
|
|
2865
|
+
(action) => action.flags.map((flag) => flag.id)
|
|
2866
|
+
);
|
|
2867
|
+
for (const actionFlagId of actionFlagIds) {
|
|
2868
|
+
const isConfigured = configuredFlagIds.includes(actionFlagId);
|
|
2869
|
+
const isInherent = isInherentFlag(actionFlagId);
|
|
2870
|
+
if (!isConfigured && !isInherent) {
|
|
2871
|
+
ctx.addIssue({
|
|
2872
|
+
code: "custom",
|
|
2873
|
+
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}'`,
|
|
2874
|
+
path: ["actions"]
|
|
2875
|
+
});
|
|
2876
|
+
}
|
|
2877
|
+
}
|
|
2878
|
+
}
|
|
2879
|
+
function validateActionOrder(event2, ctx) {
|
|
2880
|
+
if (event2.actionOrder) {
|
|
2881
|
+
const customActionTypes = event2.actions.filter((action) => action.type === ActionType.CUSTOM).map((action) => action.customActionType);
|
|
2882
|
+
const validActionTypes = [
|
|
2883
|
+
...workqueueActions.options,
|
|
2884
|
+
...customActionTypes
|
|
2885
|
+
];
|
|
2886
|
+
for (const actionType of event2.actionOrder) {
|
|
2887
|
+
if (!validActionTypes.includes(actionType)) {
|
|
2888
|
+
ctx.addIssue({
|
|
2889
|
+
code: "custom",
|
|
2890
|
+
message: `Invalid action type in action order: ${actionType}`,
|
|
2891
|
+
path: ["actionOrder"]
|
|
2892
|
+
});
|
|
2893
|
+
}
|
|
2894
|
+
}
|
|
2895
|
+
}
|
|
2896
|
+
}
|
|
2897
|
+
|
|
2898
|
+
// ../commons/src/events/EventConfig.ts
|
|
2899
|
+
var EventConfig = z29.object({
|
|
2900
|
+
id: z29.string().describe(
|
|
2901
|
+
'Machine-readable identifier of the event (e.g. "birth", "death").'
|
|
2902
|
+
),
|
|
2903
|
+
dateOfEvent: FieldReference.optional().describe(
|
|
2904
|
+
"Reference to the field capturing the date of the event (e.g. date of birth). Defaults to the event creation date if unspecified."
|
|
2905
|
+
),
|
|
2906
|
+
placeOfEvent: FieldReference.optional().describe(
|
|
2907
|
+
"Reference to the field capturing the place of the event (e.g. place of birth). Defaults to the meta.createdAtLocation if unspecified."
|
|
2908
|
+
),
|
|
2909
|
+
title: TranslationConfig.describe(
|
|
2910
|
+
'Title template for the singular event, supporting variables (e.g. "{applicant.name.firstname} {applicant.name.surname}").'
|
|
2911
|
+
),
|
|
2912
|
+
fallbackTitle: TranslationConfig.optional().describe(
|
|
2913
|
+
"Fallback title shown when the main title resolves to an empty value."
|
|
2914
|
+
),
|
|
2915
|
+
summary: SummaryConfig.describe(
|
|
2916
|
+
"Summary information displayed in the event overview."
|
|
2917
|
+
),
|
|
2918
|
+
label: TranslationConfig.describe(
|
|
2919
|
+
"Human-readable label for the event type."
|
|
2920
|
+
),
|
|
2921
|
+
actions: z29.array(ActionConfig).describe(
|
|
2922
|
+
"Configuration of system-defined actions associated with the event."
|
|
2923
|
+
),
|
|
2924
|
+
actionOrder: z29.array(z29.string()).optional().describe(
|
|
2925
|
+
"Order of actions in the action menu. Use either the action type for core actions or the customActionType for custom actions."
|
|
2926
|
+
),
|
|
2927
|
+
declaration: DeclarationFormConfig.describe(
|
|
2928
|
+
"Configuration of the form used to gather event data."
|
|
2929
|
+
),
|
|
2930
|
+
advancedSearch: z29.array(AdvancedSearchConfig).optional().default([]).describe(
|
|
2931
|
+
"Configuration of fields available in the advanced search feature."
|
|
2932
|
+
),
|
|
2933
|
+
flags: z29.array(FlagConfig).optional().default([]).describe(
|
|
2934
|
+
"Configuration of flags associated with the actions of this event type."
|
|
2935
|
+
)
|
|
2936
|
+
}).superRefine((event2, ctx) => {
|
|
2937
|
+
validateAdvancedSearchConfig(event2, ctx);
|
|
2938
|
+
validateDateOfEvent(event2, ctx);
|
|
2939
|
+
validatePlaceOfEvent(event2, ctx);
|
|
2940
|
+
validateActionFlags(event2, ctx);
|
|
2941
|
+
validateActionOrder(event2, ctx);
|
|
2942
|
+
}).meta({
|
|
2943
|
+
id: "EventConfig"
|
|
2649
2944
|
}).describe("Configuration defining an event type.");
|
|
2650
2945
|
|
|
2651
2946
|
// ../commons/src/events/EventConfigInput.ts
|
|
@@ -2654,7 +2949,7 @@ var defineActionForm = (actionForm) => ActionFormConfig.parse(actionForm);
|
|
|
2654
2949
|
var defineFormPage = (formPage) => FormPageConfig.parse(formPage);
|
|
2655
2950
|
|
|
2656
2951
|
// ../commons/src/events/WorkqueueConfig.ts
|
|
2657
|
-
var
|
|
2952
|
+
var z32 = __toESM(require("zod/v4"));
|
|
2658
2953
|
|
|
2659
2954
|
// ../commons/src/conditionals/conditionals.ts
|
|
2660
2955
|
var objectHash = __toESM(require("object-hash"));
|
|
@@ -2692,7 +2987,7 @@ function not(condition) {
|
|
|
2692
2987
|
required: []
|
|
2693
2988
|
});
|
|
2694
2989
|
}
|
|
2695
|
-
function
|
|
2990
|
+
function never2() {
|
|
2696
2991
|
return not(alwaysTrue());
|
|
2697
2992
|
}
|
|
2698
2993
|
function jsonFieldPath(field3) {
|
|
@@ -3347,231 +3642,122 @@ var event = Object.assign(eventFn, {
|
|
|
3347
3642
|
type: "object",
|
|
3348
3643
|
properties: actionProperties,
|
|
3349
3644
|
required: requiredFields
|
|
3350
|
-
},
|
|
3351
|
-
[countType]: count
|
|
3352
|
-
}
|
|
3353
|
-
},
|
|
3354
|
-
required: ["actions"]
|
|
3355
|
-
}
|
|
3356
|
-
},
|
|
3357
|
-
required: ["$event"]
|
|
3358
|
-
});
|
|
3359
|
-
};
|
|
3360
|
-
const withMinMax = (additionalFields) => {
|
|
3361
|
-
return {
|
|
3362
|
-
/**
|
|
3363
|
-
* Creates a conditional that checks if the event contains a specific action type
|
|
3364
|
-
* with a minimum count of occurrences.
|
|
3365
|
-
*
|
|
3366
|
-
* @param minCount - The minimum number of actions required.
|
|
3367
|
-
*/
|
|
3368
|
-
minCount: (minCount) => createCountConditional("minContains", minCount, additionalFields),
|
|
3369
|
-
/**
|
|
3370
|
-
* Builds a conditional that sets a maximum count for the number of actions.
|
|
3371
|
-
* This is useful for limiting the number of actions of a specific type in a single event.
|
|
3372
|
-
*/
|
|
3373
|
-
maxCount: (maxCount) => createCountConditional("maxContains", maxCount, additionalFields)
|
|
3374
|
-
};
|
|
3375
|
-
};
|
|
3376
|
-
const chainableMethods = {
|
|
3377
|
-
/**
|
|
3378
|
-
* Adds additional field constraints to the action matching.
|
|
3379
|
-
*
|
|
3380
|
-
* @param fields - Object containing additional fields to match on the action.
|
|
3381
|
-
*/
|
|
3382
|
-
withFields: (fields) => withMinMax(fields),
|
|
3383
|
-
/**
|
|
3384
|
-
* Adds template ID constraint to the action matching.
|
|
3385
|
-
* This is a convenience method that adds content.templateId to the fields.
|
|
3386
|
-
*
|
|
3387
|
-
* @param id - The template ID to match against.
|
|
3388
|
-
*/
|
|
3389
|
-
withTemplate: (id) => withMinMax({
|
|
3390
|
-
content: { templateId: id }
|
|
3391
|
-
}),
|
|
3392
|
-
...withMinMax()
|
|
3393
|
-
};
|
|
3394
|
-
return { ...basicConditional, ...chainableMethods };
|
|
3395
|
-
},
|
|
3396
|
-
field(field3) {
|
|
3397
|
-
return {
|
|
3398
|
-
$event: field3
|
|
3399
|
-
};
|
|
3400
|
-
}
|
|
3401
|
-
});
|
|
3402
|
-
|
|
3403
|
-
// ../commons/src/events/WorkqueueColumnConfig.ts
|
|
3404
|
-
var
|
|
3405
|
-
var WorkqueueColumnKeysArray = [
|
|
3406
|
-
...EventMetadataKeysArray,
|
|
3407
|
-
"title",
|
|
3408
|
-
"outbox"
|
|
3409
|
-
];
|
|
3410
|
-
var WorkqueueColumnKeys =
|
|
3411
|
-
var WorkqueueColumnValue =
|
|
3412
|
-
$event: WorkqueueColumnKeys
|
|
3413
|
-
});
|
|
3414
|
-
var WorkqueueColumn =
|
|
3415
|
-
label: TranslationConfig,
|
|
3416
|
-
value: WorkqueueColumnValue
|
|
3417
|
-
});
|
|
3418
|
-
function defineWorkqueuesColumns(workqueueColumns) {
|
|
3419
|
-
return workqueueColumns.map(
|
|
3420
|
-
(workqueueColumn) => WorkqueueColumn.parse(workqueueColumn)
|
|
3421
|
-
);
|
|
3422
|
-
}
|
|
3423
|
-
|
|
3424
|
-
// ../commons/src/events/CountryConfigQueryInput.ts
|
|
3425
|
-
var
|
|
3426
|
-
var SerializableExact =
|
|
3427
|
-
type:
|
|
3428
|
-
term:
|
|
3429
|
-
});
|
|
3430
|
-
var SerializableWithin =
|
|
3431
|
-
type:
|
|
3432
|
-
location:
|
|
3433
|
-
});
|
|
3434
|
-
var SerializedQueryExpression =
|
|
3435
|
-
eventType:
|
|
3436
|
-
status:
|
|
3437
|
-
createdAt:
|
|
3438
|
-
updatedAt:
|
|
3439
|
-
"legalStatuses.REGISTERED.createdAt":
|
|
3440
|
-
"legalStatuses.
|
|
3441
|
-
|
|
3442
|
-
),
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
),
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
),
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
var
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
var CountryConfigQueryType = import_zod28.z.discriminatedUnion("type", [And2, Or2]);
|
|
3467
|
-
var CountryConfigQueryInputType = import_zod28.z.union([
|
|
3468
|
-
SerializedQueryExpression,
|
|
3469
|
-
And2,
|
|
3470
|
-
Or2
|
|
3471
|
-
]);
|
|
3472
|
-
|
|
3473
|
-
// ../commons/src/icons.ts
|
|
3474
|
-
var import_zod29 = require("zod");
|
|
3475
|
-
var AvailableIcons = import_zod29.z.enum([
|
|
3476
|
-
"Archived",
|
|
3477
|
-
"Assigned",
|
|
3478
|
-
"Certified",
|
|
3479
|
-
"Close",
|
|
3480
|
-
"Collapse",
|
|
3481
|
-
"Draft",
|
|
3482
|
-
"DuplicateYellow",
|
|
3483
|
-
"Expand",
|
|
3484
|
-
"ExternalValidate",
|
|
3485
|
-
"FilledCheck",
|
|
3486
|
-
"InReview",
|
|
3487
|
-
"Offline",
|
|
3488
|
-
"Registered",
|
|
3489
|
-
"RequiresUpdates",
|
|
3490
|
-
"Sent",
|
|
3491
|
-
"Validated",
|
|
3492
|
-
"WaitingApproval",
|
|
3493
|
-
"ChartActivity",
|
|
3494
|
-
"Activity",
|
|
3495
|
-
"Archive",
|
|
3496
|
-
"ArchiveTray",
|
|
3497
|
-
"ArrowLeft",
|
|
3498
|
-
"ArrowRight",
|
|
3499
|
-
"Buildings",
|
|
3500
|
-
"Circle",
|
|
3501
|
-
"CaretDown",
|
|
3502
|
-
"CaretLeft",
|
|
3503
|
-
"CaretRight",
|
|
3504
|
-
"ChartBar",
|
|
3505
|
-
"ChartLine",
|
|
3506
|
-
"ChatCircle",
|
|
3507
|
-
"CheckSquare",
|
|
3508
|
-
"Compass",
|
|
3509
|
-
"Check",
|
|
3510
|
-
"Copy",
|
|
3511
|
-
"Database",
|
|
3512
|
-
"DotsThreeVertical",
|
|
3513
|
-
"ArrowCounterClockwise",
|
|
3514
|
-
"MagnifyingGlassMinus",
|
|
3515
|
-
"MagnifyingGlassPlus",
|
|
3516
|
-
"Export",
|
|
3517
|
-
"Eye",
|
|
3518
|
-
"EyeSlash",
|
|
3519
|
-
"Envelope",
|
|
3520
|
-
"File",
|
|
3521
|
-
"FileSearch",
|
|
3522
|
-
"FileMinus",
|
|
3523
|
-
"FilePlus",
|
|
3524
|
-
"FileText",
|
|
3525
|
-
"FileX",
|
|
3526
|
-
"Handshake",
|
|
3527
|
-
"Gear",
|
|
3528
|
-
"GitBranch",
|
|
3529
|
-
"IdentificationCard",
|
|
3530
|
-
"List",
|
|
3531
|
-
"ListBullets",
|
|
3532
|
-
"Lock",
|
|
3533
|
-
"MagnifyingGlass",
|
|
3534
|
-
"MapPin",
|
|
3535
|
-
"Medal",
|
|
3536
|
-
"NotePencil",
|
|
3537
|
-
"Paperclip",
|
|
3538
|
-
"PaperPlaneTilt",
|
|
3539
|
-
"Pen",
|
|
3540
|
-
"Pencil",
|
|
3541
|
-
"PencilSimpleLine",
|
|
3542
|
-
"Phone",
|
|
3543
|
-
"Plus",
|
|
3544
|
-
"Printer",
|
|
3545
|
-
"SignOut",
|
|
3546
|
-
"Star",
|
|
3547
|
-
"Target",
|
|
3548
|
-
"TextT",
|
|
3549
|
-
"Trash",
|
|
3550
|
-
"UploadSimple",
|
|
3551
|
-
"User",
|
|
3552
|
-
"UserPlus",
|
|
3553
|
-
"Users",
|
|
3554
|
-
"WarningCircle",
|
|
3555
|
-
"X",
|
|
3556
|
-
"CircleWavyCheck",
|
|
3557
|
-
"CircleWavyQuestion",
|
|
3558
|
-
"ArchiveBox",
|
|
3559
|
-
"ArrowCircleDown",
|
|
3560
|
-
"FileArrowUp",
|
|
3561
|
-
"FileDotted",
|
|
3562
|
-
"Files",
|
|
3563
|
-
"PencilLine",
|
|
3564
|
-
"PencilCircle",
|
|
3565
|
-
"UserCircle",
|
|
3566
|
-
"Clock",
|
|
3567
|
-
"QrCode",
|
|
3568
|
-
"Webcam",
|
|
3569
|
-
"Sun",
|
|
3570
|
-
"DeviceTabletCamera",
|
|
3571
|
-
"Globe",
|
|
3572
|
-
"Fingerprint",
|
|
3573
|
-
"PushPin",
|
|
3574
|
-
"Timer"
|
|
3645
|
+
},
|
|
3646
|
+
[countType]: count
|
|
3647
|
+
}
|
|
3648
|
+
},
|
|
3649
|
+
required: ["actions"]
|
|
3650
|
+
}
|
|
3651
|
+
},
|
|
3652
|
+
required: ["$event"]
|
|
3653
|
+
});
|
|
3654
|
+
};
|
|
3655
|
+
const withMinMax = (additionalFields) => {
|
|
3656
|
+
return {
|
|
3657
|
+
/**
|
|
3658
|
+
* Creates a conditional that checks if the event contains a specific action type
|
|
3659
|
+
* with a minimum count of occurrences.
|
|
3660
|
+
*
|
|
3661
|
+
* @param minCount - The minimum number of actions required.
|
|
3662
|
+
*/
|
|
3663
|
+
minCount: (minCount) => createCountConditional("minContains", minCount, additionalFields),
|
|
3664
|
+
/**
|
|
3665
|
+
* Builds a conditional that sets a maximum count for the number of actions.
|
|
3666
|
+
* This is useful for limiting the number of actions of a specific type in a single event.
|
|
3667
|
+
*/
|
|
3668
|
+
maxCount: (maxCount) => createCountConditional("maxContains", maxCount, additionalFields)
|
|
3669
|
+
};
|
|
3670
|
+
};
|
|
3671
|
+
const chainableMethods = {
|
|
3672
|
+
/**
|
|
3673
|
+
* Adds additional field constraints to the action matching.
|
|
3674
|
+
*
|
|
3675
|
+
* @param fields - Object containing additional fields to match on the action.
|
|
3676
|
+
*/
|
|
3677
|
+
withFields: (fields) => withMinMax(fields),
|
|
3678
|
+
/**
|
|
3679
|
+
* Adds template ID constraint to the action matching.
|
|
3680
|
+
* This is a convenience method that adds content.templateId to the fields.
|
|
3681
|
+
*
|
|
3682
|
+
* @param id - The template ID to match against.
|
|
3683
|
+
*/
|
|
3684
|
+
withTemplate: (id) => withMinMax({
|
|
3685
|
+
content: { templateId: id }
|
|
3686
|
+
}),
|
|
3687
|
+
...withMinMax()
|
|
3688
|
+
};
|
|
3689
|
+
return { ...basicConditional, ...chainableMethods };
|
|
3690
|
+
},
|
|
3691
|
+
field(field3) {
|
|
3692
|
+
return {
|
|
3693
|
+
$event: field3
|
|
3694
|
+
};
|
|
3695
|
+
}
|
|
3696
|
+
});
|
|
3697
|
+
|
|
3698
|
+
// ../commons/src/events/WorkqueueColumnConfig.ts
|
|
3699
|
+
var z30 = __toESM(require("zod/v4"));
|
|
3700
|
+
var WorkqueueColumnKeysArray = [
|
|
3701
|
+
...EventMetadataKeysArray,
|
|
3702
|
+
"title",
|
|
3703
|
+
"outbox"
|
|
3704
|
+
];
|
|
3705
|
+
var WorkqueueColumnKeys = z30.enum(WorkqueueColumnKeysArray);
|
|
3706
|
+
var WorkqueueColumnValue = z30.object({
|
|
3707
|
+
$event: WorkqueueColumnKeys
|
|
3708
|
+
});
|
|
3709
|
+
var WorkqueueColumn = z30.object({
|
|
3710
|
+
label: TranslationConfig,
|
|
3711
|
+
value: WorkqueueColumnValue
|
|
3712
|
+
});
|
|
3713
|
+
function defineWorkqueuesColumns(workqueueColumns) {
|
|
3714
|
+
return workqueueColumns.map(
|
|
3715
|
+
(workqueueColumn) => WorkqueueColumn.parse(workqueueColumn)
|
|
3716
|
+
);
|
|
3717
|
+
}
|
|
3718
|
+
|
|
3719
|
+
// ../commons/src/events/CountryConfigQueryInput.ts
|
|
3720
|
+
var z31 = __toESM(require("zod/v4"));
|
|
3721
|
+
var SerializableExact = z31.object({
|
|
3722
|
+
type: z31.literal("exact"),
|
|
3723
|
+
term: z31.union([z31.string(), SerializedUserField])
|
|
3724
|
+
});
|
|
3725
|
+
var SerializableWithin = z31.object({
|
|
3726
|
+
type: z31.literal("within"),
|
|
3727
|
+
location: z31.union([z31.string(), SerializedUserField])
|
|
3728
|
+
});
|
|
3729
|
+
var SerializedQueryExpression = z31.object({
|
|
3730
|
+
eventType: z31.string(),
|
|
3731
|
+
status: z31.optional(z31.union([AnyOfStatus, ExactStatus])),
|
|
3732
|
+
createdAt: z31.optional(DateCondition),
|
|
3733
|
+
updatedAt: z31.optional(DateCondition),
|
|
3734
|
+
"legalStatuses.REGISTERED.createdAt": z31.optional(DateCondition),
|
|
3735
|
+
"legalStatuses.DECLARED.createdAtLocation": z31.optional(SerializableWithin),
|
|
3736
|
+
"legalStatuses.REGISTERED.createdAtLocation": z31.optional(SerializableWithin),
|
|
3737
|
+
"legalStatuses.REGISTERED.registrationNumber": z31.optional(Exact),
|
|
3738
|
+
createdAtLocation: z31.optional(SerializableWithin),
|
|
3739
|
+
updatedAtLocation: z31.optional(SerializableWithin),
|
|
3740
|
+
assignedTo: z31.optional(SerializableExact),
|
|
3741
|
+
createdBy: z31.optional(SerializableExact),
|
|
3742
|
+
createdByUserType: ExactUserType,
|
|
3743
|
+
updatedBy: z31.optional(SerializableExact),
|
|
3744
|
+
trackingId: z31.optional(Exact),
|
|
3745
|
+
flags: z31.optional(ContainsFlags),
|
|
3746
|
+
data: QueryInput
|
|
3747
|
+
}).partial();
|
|
3748
|
+
var Or2 = z31.object({
|
|
3749
|
+
type: z31.literal("or"),
|
|
3750
|
+
clauses: z31.array(SerializedQueryExpression)
|
|
3751
|
+
});
|
|
3752
|
+
var And2 = z31.object({
|
|
3753
|
+
type: z31.literal("and"),
|
|
3754
|
+
clauses: z31.array(SerializedQueryExpression)
|
|
3755
|
+
});
|
|
3756
|
+
var CountryConfigQueryType = z31.discriminatedUnion("type", [And2, Or2]);
|
|
3757
|
+
var CountryConfigQueryInputType = z31.union([
|
|
3758
|
+
SerializedQueryExpression,
|
|
3759
|
+
And2,
|
|
3760
|
+
Or2
|
|
3575
3761
|
]);
|
|
3576
3762
|
|
|
3577
3763
|
// ../commons/src/events/WorkqueueConfig.ts
|
|
@@ -3593,23 +3779,24 @@ var mandatoryColumns = defineWorkqueuesColumns([
|
|
|
3593
3779
|
value: event.field("updatedAt")
|
|
3594
3780
|
}
|
|
3595
3781
|
]);
|
|
3596
|
-
var WorkqueueActionsWithDefault =
|
|
3782
|
+
var WorkqueueActionsWithDefault = z32.enum([
|
|
3597
3783
|
...workqueueActions.options,
|
|
3598
|
-
"DEFAULT"
|
|
3784
|
+
"DEFAULT",
|
|
3785
|
+
ActionType.READ
|
|
3599
3786
|
]);
|
|
3600
|
-
var WorkqueueConfig =
|
|
3601
|
-
slug:
|
|
3787
|
+
var WorkqueueConfig = z32.object({
|
|
3788
|
+
slug: z32.string().describe("Determines the url of the workqueue."),
|
|
3602
3789
|
name: TranslationConfig.describe(
|
|
3603
3790
|
"Title of the workflow (both in navigation and on the page)"
|
|
3604
3791
|
),
|
|
3605
3792
|
query: CountryConfigQueryType,
|
|
3606
|
-
actions:
|
|
3607
|
-
|
|
3793
|
+
actions: z32.array(
|
|
3794
|
+
z32.object({
|
|
3608
3795
|
type: WorkqueueActionsWithDefault,
|
|
3609
|
-
conditionals:
|
|
3796
|
+
conditionals: z32.array(Conditional).optional()
|
|
3610
3797
|
})
|
|
3611
3798
|
),
|
|
3612
|
-
columns:
|
|
3799
|
+
columns: z32.array(WorkqueueColumn).default(mandatoryColumns),
|
|
3613
3800
|
icon: AvailableIcons,
|
|
3614
3801
|
emptyMessage: TranslationConfig.optional()
|
|
3615
3802
|
}).describe("Configuration for workqueue.");
|
|
@@ -3617,26 +3804,26 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
|
|
|
3617
3804
|
query: true,
|
|
3618
3805
|
columns: true
|
|
3619
3806
|
});
|
|
3620
|
-
var WorkqueueConfigInput =
|
|
3621
|
-
slug:
|
|
3807
|
+
var WorkqueueConfigInput = z32.object({
|
|
3808
|
+
slug: z32.string().describe("Determines the url of the workqueue."),
|
|
3622
3809
|
name: TranslationConfig.describe(
|
|
3623
3810
|
"Title of the workflow (both in navigation and on the page)"
|
|
3624
3811
|
),
|
|
3625
3812
|
query: CountryConfigQueryInputType,
|
|
3626
|
-
actions:
|
|
3627
|
-
|
|
3813
|
+
actions: z32.array(
|
|
3814
|
+
z32.object({
|
|
3628
3815
|
type: WorkqueueActionsWithDefault,
|
|
3629
|
-
conditionals:
|
|
3816
|
+
conditionals: z32.array(Conditional).optional()
|
|
3630
3817
|
})
|
|
3631
3818
|
),
|
|
3632
|
-
columns:
|
|
3819
|
+
columns: z32.array(WorkqueueColumn).default(mandatoryColumns),
|
|
3633
3820
|
icon: AvailableIcons,
|
|
3634
3821
|
emptyMessage: TranslationConfig.optional()
|
|
3635
3822
|
});
|
|
3636
|
-
var WorkqueueCountInput =
|
|
3637
|
-
|
|
3823
|
+
var WorkqueueCountInput = z32.array(
|
|
3824
|
+
z32.object({ slug: z32.string(), query: QueryType })
|
|
3638
3825
|
);
|
|
3639
|
-
var WorkqueueCountOutput =
|
|
3826
|
+
var WorkqueueCountOutput = z32.record(z32.string(), z32.number());
|
|
3640
3827
|
|
|
3641
3828
|
// ../commons/src/events/workqueueDefaultColumns.ts
|
|
3642
3829
|
var defaultWorkqueueColumns = [
|
|
@@ -3659,47 +3846,40 @@ var defaultWorkqueueColumns = [
|
|
|
3659
3846
|
];
|
|
3660
3847
|
|
|
3661
3848
|
// ../commons/src/events/Draft.ts
|
|
3662
|
-
var
|
|
3849
|
+
var z34 = __toESM(require("zod/v4"));
|
|
3663
3850
|
|
|
3664
3851
|
// ../commons/src/events/ActionInput.ts
|
|
3665
|
-
var
|
|
3666
|
-
var
|
|
3667
|
-
(0, import_zod_openapi11.extendZodWithOpenApi)(import_zod31.z);
|
|
3668
|
-
var BaseActionInput = import_zod31.z.object({
|
|
3852
|
+
var z33 = __toESM(require("zod/v4"));
|
|
3853
|
+
var BaseActionInput = z33.object({
|
|
3669
3854
|
eventId: UUID,
|
|
3670
|
-
transactionId:
|
|
3855
|
+
transactionId: z33.string(),
|
|
3671
3856
|
declaration: ActionUpdate.default({}),
|
|
3672
3857
|
annotation: ActionUpdate.optional(),
|
|
3673
3858
|
originalActionId: UUID.optional(),
|
|
3674
3859
|
// should not be part of base action.
|
|
3675
|
-
keepAssignment:
|
|
3860
|
+
keepAssignment: z33.boolean().optional(),
|
|
3676
3861
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
3677
3862
|
createdAtLocation: CreatedAtLocation.describe(
|
|
3678
3863
|
"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."
|
|
3679
3864
|
)
|
|
3680
3865
|
});
|
|
3681
|
-
var CreateActionInput = BaseActionInput.
|
|
3682
|
-
|
|
3683
|
-
type:
|
|
3866
|
+
var CreateActionInput = BaseActionInput.extend(
|
|
3867
|
+
z33.object({
|
|
3868
|
+
type: z33.literal(ActionType.CREATE).default(ActionType.CREATE),
|
|
3684
3869
|
createdAtLocation: CreatedAtLocation
|
|
3685
|
-
})
|
|
3870
|
+
}).shape
|
|
3686
3871
|
);
|
|
3687
|
-
var RegisterActionInput = BaseActionInput.
|
|
3688
|
-
|
|
3689
|
-
type:
|
|
3690
|
-
registrationNumber:
|
|
3691
|
-
})
|
|
3692
|
-
).strict();
|
|
3693
|
-
var ValidateActionInput = BaseActionInput.merge(
|
|
3694
|
-
import_zod31.z.object({
|
|
3695
|
-
type: import_zod31.z.literal(ActionType.VALIDATE).default(ActionType.VALIDATE)
|
|
3696
|
-
})
|
|
3872
|
+
var RegisterActionInput = BaseActionInput.extend(
|
|
3873
|
+
z33.strictObject({
|
|
3874
|
+
type: z33.literal(ActionType.REGISTER).default(ActionType.REGISTER),
|
|
3875
|
+
registrationNumber: z33.string().optional()
|
|
3876
|
+
}).shape
|
|
3697
3877
|
);
|
|
3698
|
-
var NotifyActionInput = BaseActionInput.
|
|
3699
|
-
|
|
3700
|
-
type:
|
|
3701
|
-
})
|
|
3702
|
-
).
|
|
3878
|
+
var NotifyActionInput = BaseActionInput.extend(
|
|
3879
|
+
z33.object({
|
|
3880
|
+
type: z33.literal(ActionType.NOTIFY).default(ActionType.NOTIFY)
|
|
3881
|
+
}).shape
|
|
3882
|
+
).meta({
|
|
3703
3883
|
default: {
|
|
3704
3884
|
eventId: "<event-id-here>",
|
|
3705
3885
|
transactionId: getUUID(),
|
|
@@ -3708,135 +3888,150 @@ var NotifyActionInput = BaseActionInput.merge(
|
|
|
3708
3888
|
type: ActionType.NOTIFY
|
|
3709
3889
|
}
|
|
3710
3890
|
});
|
|
3711
|
-
var DeclareActionInput = BaseActionInput.
|
|
3712
|
-
|
|
3713
|
-
type:
|
|
3714
|
-
})
|
|
3891
|
+
var DeclareActionInput = BaseActionInput.extend(
|
|
3892
|
+
z33.object({
|
|
3893
|
+
type: z33.literal(ActionType.DECLARE).default(ActionType.DECLARE)
|
|
3894
|
+
}).shape
|
|
3895
|
+
);
|
|
3896
|
+
var EditActionInput = BaseActionInput.extend(
|
|
3897
|
+
z33.object({
|
|
3898
|
+
type: z33.literal(ActionType.EDIT).default(ActionType.EDIT),
|
|
3899
|
+
content: z33.object({
|
|
3900
|
+
comment: z33.string().describe("Comment for the edit action.").optional()
|
|
3901
|
+
})
|
|
3902
|
+
}).shape
|
|
3715
3903
|
);
|
|
3716
|
-
var PrintCertificateActionInput = BaseActionInput.
|
|
3717
|
-
|
|
3718
|
-
type:
|
|
3904
|
+
var PrintCertificateActionInput = BaseActionInput.extend(
|
|
3905
|
+
z33.object({
|
|
3906
|
+
type: z33.literal(ActionType.PRINT_CERTIFICATE).default(ActionType.PRINT_CERTIFICATE),
|
|
3719
3907
|
content: PrintContent.optional()
|
|
3720
|
-
})
|
|
3908
|
+
}).shape
|
|
3721
3909
|
);
|
|
3722
|
-
var RejectDeclarationActionInput = BaseActionInput.
|
|
3723
|
-
|
|
3724
|
-
type:
|
|
3910
|
+
var RejectDeclarationActionInput = BaseActionInput.extend(
|
|
3911
|
+
z33.object({
|
|
3912
|
+
type: z33.literal(ActionType.REJECT).default(ActionType.REJECT),
|
|
3725
3913
|
content: ReasonContent
|
|
3726
|
-
})
|
|
3914
|
+
}).shape
|
|
3727
3915
|
);
|
|
3728
|
-
var DuplicateDetectedActionInput = BaseActionInput.
|
|
3729
|
-
|
|
3730
|
-
type:
|
|
3731
|
-
content:
|
|
3732
|
-
duplicates:
|
|
3916
|
+
var DuplicateDetectedActionInput = BaseActionInput.extend(
|
|
3917
|
+
z33.object({
|
|
3918
|
+
type: z33.literal(ActionType.DUPLICATE_DETECTED).default(ActionType.DUPLICATE_DETECTED),
|
|
3919
|
+
content: z33.object({
|
|
3920
|
+
duplicates: z33.array(PotentialDuplicate)
|
|
3733
3921
|
})
|
|
3734
|
-
})
|
|
3922
|
+
}).shape
|
|
3735
3923
|
);
|
|
3736
|
-
var MarkAsDuplicateActionInput = BaseActionInput.
|
|
3737
|
-
|
|
3738
|
-
type:
|
|
3739
|
-
content:
|
|
3924
|
+
var MarkAsDuplicateActionInput = BaseActionInput.extend(
|
|
3925
|
+
z33.object({
|
|
3926
|
+
type: z33.literal(ActionType.MARK_AS_DUPLICATE).default(ActionType.MARK_AS_DUPLICATE),
|
|
3927
|
+
content: z33.object({
|
|
3740
3928
|
duplicateOf: UUID
|
|
3741
3929
|
}).optional()
|
|
3742
|
-
})
|
|
3930
|
+
}).shape
|
|
3743
3931
|
);
|
|
3744
|
-
var MarkNotDuplicateActionInput = BaseActionInput.
|
|
3745
|
-
|
|
3746
|
-
type:
|
|
3747
|
-
})
|
|
3932
|
+
var MarkNotDuplicateActionInput = BaseActionInput.extend(
|
|
3933
|
+
z33.object({
|
|
3934
|
+
type: z33.literal(ActionType.MARK_AS_NOT_DUPLICATE).default(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
3935
|
+
}).shape
|
|
3748
3936
|
);
|
|
3749
|
-
var ArchiveActionInput = BaseActionInput.
|
|
3750
|
-
|
|
3751
|
-
type:
|
|
3937
|
+
var ArchiveActionInput = BaseActionInput.extend(
|
|
3938
|
+
z33.object({
|
|
3939
|
+
type: z33.literal(ActionType.ARCHIVE).default(ActionType.ARCHIVE),
|
|
3752
3940
|
content: ReasonContent
|
|
3753
|
-
})
|
|
3941
|
+
}).shape
|
|
3754
3942
|
);
|
|
3755
|
-
var AssignActionInput = BaseActionInput.
|
|
3756
|
-
|
|
3757
|
-
type:
|
|
3758
|
-
assignedTo:
|
|
3759
|
-
})
|
|
3943
|
+
var AssignActionInput = BaseActionInput.extend(
|
|
3944
|
+
z33.object({
|
|
3945
|
+
type: z33.literal(ActionType.ASSIGN),
|
|
3946
|
+
assignedTo: z33.string()
|
|
3947
|
+
}).shape
|
|
3760
3948
|
);
|
|
3761
|
-
var UnassignActionInput = BaseActionInput.
|
|
3762
|
-
|
|
3763
|
-
type:
|
|
3764
|
-
assignedTo:
|
|
3765
|
-
})
|
|
3949
|
+
var UnassignActionInput = BaseActionInput.extend(
|
|
3950
|
+
z33.object({
|
|
3951
|
+
type: z33.literal(ActionType.UNASSIGN).default(ActionType.UNASSIGN),
|
|
3952
|
+
assignedTo: z33.literal(null).default(null)
|
|
3953
|
+
}).shape
|
|
3766
3954
|
);
|
|
3767
|
-
var RequestCorrectionActionInput = BaseActionInput.
|
|
3768
|
-
|
|
3769
|
-
type:
|
|
3770
|
-
})
|
|
3955
|
+
var RequestCorrectionActionInput = BaseActionInput.extend(
|
|
3956
|
+
z33.object({
|
|
3957
|
+
type: z33.literal(ActionType.REQUEST_CORRECTION).default(ActionType.REQUEST_CORRECTION)
|
|
3958
|
+
}).shape
|
|
3771
3959
|
);
|
|
3772
|
-
var RejectCorrectionActionInput = BaseActionInput.
|
|
3773
|
-
|
|
3774
|
-
requestId:
|
|
3775
|
-
type:
|
|
3960
|
+
var RejectCorrectionActionInput = BaseActionInput.extend(
|
|
3961
|
+
z33.object({
|
|
3962
|
+
requestId: z33.string(),
|
|
3963
|
+
type: z33.literal(ActionType.REJECT_CORRECTION).default(ActionType.REJECT_CORRECTION),
|
|
3776
3964
|
content: ReasonContent
|
|
3777
|
-
})
|
|
3965
|
+
}).shape
|
|
3778
3966
|
);
|
|
3779
|
-
var ApproveCorrectionActionInput = BaseActionInput.
|
|
3780
|
-
|
|
3781
|
-
requestId:
|
|
3782
|
-
type:
|
|
3783
|
-
})
|
|
3967
|
+
var ApproveCorrectionActionInput = BaseActionInput.extend(
|
|
3968
|
+
z33.object({
|
|
3969
|
+
requestId: z33.string(),
|
|
3970
|
+
type: z33.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
|
|
3971
|
+
}).shape
|
|
3784
3972
|
);
|
|
3785
|
-
var ReadActionInput = BaseActionInput.
|
|
3786
|
-
|
|
3787
|
-
type:
|
|
3788
|
-
})
|
|
3973
|
+
var ReadActionInput = BaseActionInput.extend(
|
|
3974
|
+
z33.object({
|
|
3975
|
+
type: z33.literal(ActionType.READ).default(ActionType.READ)
|
|
3976
|
+
}).shape
|
|
3977
|
+
);
|
|
3978
|
+
var DeleteActionInput = z33.object({ eventId: UUID });
|
|
3979
|
+
var CustomActionInput = BaseActionInput.extend(
|
|
3980
|
+
z33.object({
|
|
3981
|
+
type: z33.literal(ActionType.CUSTOM).default(ActionType.CUSTOM),
|
|
3982
|
+
customActionType: z33.string().describe("Name of the custom action.")
|
|
3983
|
+
}).shape
|
|
3789
3984
|
);
|
|
3790
|
-
var
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
RejectDeclarationActionInput.openapi({
|
|
3798
|
-
ref: "RejectDeclarationActionInput"
|
|
3985
|
+
var ActionInput = z33.discriminatedUnion("type", [
|
|
3986
|
+
CreateActionInput.meta({ id: "CreateActionInput" }),
|
|
3987
|
+
RegisterActionInput.meta({ id: "RegisterActionInput" }),
|
|
3988
|
+
NotifyActionInput.meta({ id: "NotifyActionInput" }),
|
|
3989
|
+
DeclareActionInput.meta({ id: "DeclareActionInput" }),
|
|
3990
|
+
RejectDeclarationActionInput.meta({
|
|
3991
|
+
id: "RejectDeclarationActionInput"
|
|
3799
3992
|
}),
|
|
3800
|
-
DuplicateDetectedActionInput.
|
|
3801
|
-
|
|
3993
|
+
DuplicateDetectedActionInput.meta({
|
|
3994
|
+
id: "DuplicateDetectedActionInput"
|
|
3802
3995
|
}),
|
|
3803
|
-
MarkAsDuplicateActionInput.
|
|
3804
|
-
|
|
3996
|
+
MarkAsDuplicateActionInput.meta({
|
|
3997
|
+
id: "MarkAsDuplicateActionInput"
|
|
3805
3998
|
}),
|
|
3806
|
-
MarkNotDuplicateActionInput.
|
|
3807
|
-
|
|
3999
|
+
MarkNotDuplicateActionInput.meta({
|
|
4000
|
+
id: "MarkNotDuplicateActionInput"
|
|
3808
4001
|
}),
|
|
3809
|
-
ArchiveActionInput.
|
|
3810
|
-
AssignActionInput.
|
|
3811
|
-
UnassignActionInput.
|
|
3812
|
-
PrintCertificateActionInput.
|
|
3813
|
-
RequestCorrectionActionInput.
|
|
3814
|
-
|
|
4002
|
+
ArchiveActionInput.meta({ id: "ArchiveActionInput" }),
|
|
4003
|
+
AssignActionInput.meta({ id: "AssignActionInput" }),
|
|
4004
|
+
UnassignActionInput.meta({ id: "UnassignActionInput" }),
|
|
4005
|
+
PrintCertificateActionInput.meta({ id: "PrintCertificateActionInput" }),
|
|
4006
|
+
RequestCorrectionActionInput.meta({
|
|
4007
|
+
id: "RequestCorrectionActionInput"
|
|
3815
4008
|
}),
|
|
3816
|
-
RejectCorrectionActionInput.
|
|
3817
|
-
ApproveCorrectionActionInput.
|
|
3818
|
-
|
|
4009
|
+
RejectCorrectionActionInput.meta({ id: "RejectCorrectionActionInput" }),
|
|
4010
|
+
ApproveCorrectionActionInput.meta({
|
|
4011
|
+
id: "ApproveCorrectionActionInput"
|
|
3819
4012
|
}),
|
|
3820
|
-
ReadActionInput.
|
|
3821
|
-
|
|
3822
|
-
|
|
4013
|
+
ReadActionInput.meta({ id: "ReadActionInput" }),
|
|
4014
|
+
CustomActionInput.meta({ id: "CustomActionInput" }),
|
|
4015
|
+
EditActionInput.meta({ id: "EditActionInput" })
|
|
4016
|
+
]).meta({
|
|
4017
|
+
id: "ActionInput"
|
|
3823
4018
|
});
|
|
3824
4019
|
|
|
3825
4020
|
// ../commons/src/events/Draft.ts
|
|
3826
|
-
var Draft =
|
|
4021
|
+
var Draft = z34.object({
|
|
3827
4022
|
id: UUID,
|
|
3828
4023
|
eventId: UUID,
|
|
3829
|
-
transactionId:
|
|
3830
|
-
createdAt:
|
|
4024
|
+
transactionId: z34.string(),
|
|
4025
|
+
createdAt: z34.string().datetime(),
|
|
3831
4026
|
action: ActionBase.extend({
|
|
3832
|
-
type: ActionTypes.exclude([ActionTypes.
|
|
4027
|
+
type: ActionTypes.exclude([ActionTypes.enum.DELETE])
|
|
3833
4028
|
}).omit({ id: true, createdAtLocation: true })
|
|
3834
4029
|
}).describe(
|
|
3835
4030
|
"A temporary storage for an action. Stored with details of the event, creator and creation time."
|
|
3836
4031
|
);
|
|
3837
4032
|
var DraftInput = BaseActionInput.extend({
|
|
3838
|
-
type: ActionTypes.exclude([ActionTypes.
|
|
3839
|
-
status:
|
|
4033
|
+
type: ActionTypes.exclude([ActionTypes.enum.DELETE]),
|
|
4034
|
+
status: z34.enum([
|
|
3840
4035
|
ActionStatus.Requested,
|
|
3841
4036
|
ActionStatus.Accepted,
|
|
3842
4037
|
ActionStatus.Rejected
|
|
@@ -3844,32 +4039,30 @@ var DraftInput = BaseActionInput.extend({
|
|
|
3844
4039
|
});
|
|
3845
4040
|
|
|
3846
4041
|
// ../commons/src/events/EventInput.ts
|
|
3847
|
-
var
|
|
4042
|
+
var z35 = __toESM(require("zod/v4"));
|
|
3848
4043
|
var import_uuid10 = require("uuid");
|
|
3849
|
-
var EventInput =
|
|
3850
|
-
transactionId:
|
|
3851
|
-
type:
|
|
3852
|
-
}).
|
|
4044
|
+
var EventInput = z35.object({
|
|
4045
|
+
transactionId: z35.string(),
|
|
4046
|
+
type: z35.string()
|
|
4047
|
+
}).meta({ default: { transactionId: (0, import_uuid10.v4)(), type: "birth" } });
|
|
3853
4048
|
|
|
3854
4049
|
// ../commons/src/events/EventDocument.ts
|
|
3855
|
-
var
|
|
3856
|
-
var
|
|
3857
|
-
(0, import_zod_openapi12.extendZodWithOpenApi)(import_zod34.z);
|
|
3858
|
-
var EventDocument = import_zod34.z.object({
|
|
4050
|
+
var z36 = __toESM(require("zod/v4"));
|
|
4051
|
+
var EventDocument = z36.object({
|
|
3859
4052
|
id: UUID.describe("Unique identifier of the event."),
|
|
3860
|
-
type:
|
|
3861
|
-
createdAt:
|
|
3862
|
-
updatedAt:
|
|
4053
|
+
type: z36.string().describe("Type of the event (e.g. birth, death, marriage)."),
|
|
4054
|
+
createdAt: z36.string().datetime().describe("Timestamp indicating when the event was created."),
|
|
4055
|
+
updatedAt: z36.string().datetime().describe(
|
|
3863
4056
|
"Timestamp of the last update, excluding changes from actions."
|
|
3864
4057
|
),
|
|
3865
|
-
actions:
|
|
3866
|
-
trackingId:
|
|
4058
|
+
actions: z36.array(Action).describe("Ordered list of actions associated with the event."),
|
|
4059
|
+
trackingId: z36.string().describe(
|
|
3867
4060
|
"System-generated tracking identifier used to look up the event."
|
|
3868
4061
|
)
|
|
3869
|
-
}).
|
|
4062
|
+
}).meta({ id: "EventDocument" });
|
|
3870
4063
|
|
|
3871
4064
|
// ../commons/src/events/state/index.ts
|
|
3872
|
-
var
|
|
4065
|
+
var import_lodash4 = require("lodash");
|
|
3873
4066
|
|
|
3874
4067
|
// ../commons/src/events/state/utils.ts
|
|
3875
4068
|
var import_lodash2 = require("lodash");
|
|
@@ -3877,14 +4070,18 @@ var updateActions = ActionTypes.extract([
|
|
|
3877
4070
|
ActionType.CREATE,
|
|
3878
4071
|
ActionType.NOTIFY,
|
|
3879
4072
|
ActionType.DECLARE,
|
|
3880
|
-
ActionType.VALIDATE,
|
|
3881
4073
|
ActionType.REGISTER,
|
|
3882
4074
|
ActionType.REJECT,
|
|
3883
4075
|
ActionType.ARCHIVE,
|
|
3884
4076
|
ActionType.PRINT_CERTIFICATE,
|
|
3885
|
-
ActionType.REQUEST_CORRECTION
|
|
4077
|
+
ActionType.REQUEST_CORRECTION,
|
|
4078
|
+
ActionType.CUSTOM
|
|
3886
4079
|
]);
|
|
3887
4080
|
|
|
4081
|
+
// ../commons/src/events/state/flags.ts
|
|
4082
|
+
var import_lodash3 = require("lodash");
|
|
4083
|
+
var import_date_fns3 = require("date-fns");
|
|
4084
|
+
|
|
3888
4085
|
// ../commons/src/events/defineConfig.ts
|
|
3889
4086
|
var defineConfig = (config) => {
|
|
3890
4087
|
const input = EventConfig.parse(config);
|
|
@@ -3892,7 +4089,7 @@ var defineConfig = (config) => {
|
|
|
3892
4089
|
};
|
|
3893
4090
|
|
|
3894
4091
|
// ../commons/src/events/test.utils.ts
|
|
3895
|
-
var
|
|
4092
|
+
var import_lodash5 = require("lodash");
|
|
3896
4093
|
var import_date_fns4 = require("date-fns");
|
|
3897
4094
|
|
|
3898
4095
|
// ../commons/src/field-config/field-configuration.ts
|
|
@@ -3914,7 +4111,6 @@ function field(fieldId, options = {}) {
|
|
|
3914
4111
|
}
|
|
3915
4112
|
|
|
3916
4113
|
// ../commons/src/fixtures/forms.ts
|
|
3917
|
-
var import_date_fns3 = require("date-fns");
|
|
3918
4114
|
var PRINT_CERTIFICATE_FORM = defineActionForm({
|
|
3919
4115
|
label: {
|
|
3920
4116
|
id: "event.tennis-club-membership.action.certificate.form.label",
|
|
@@ -4714,7 +4910,7 @@ var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
|
|
|
4714
4910
|
conditionals: [
|
|
4715
4911
|
{
|
|
4716
4912
|
type: ConditionalType.DISPLAY_ON_REVIEW,
|
|
4717
|
-
conditional:
|
|
4913
|
+
conditional: never2()
|
|
4718
4914
|
}
|
|
4719
4915
|
]
|
|
4720
4916
|
},
|
|
@@ -5097,119 +5293,16 @@ var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
|
|
|
5097
5293
|
}
|
|
5098
5294
|
}
|
|
5099
5295
|
],
|
|
5100
|
-
conditional: not(
|
|
5296
|
+
conditional: not(never2())
|
|
5101
5297
|
// Intentional always-true page conditional to exercise interactions between page-level and field-level conditionals in tests
|
|
5102
5298
|
}
|
|
5103
5299
|
]
|
|
5104
5300
|
});
|
|
5105
|
-
var statusOptions = [
|
|
5106
|
-
{
|
|
5107
|
-
value: "ALL",
|
|
5108
|
-
label: {
|
|
5109
|
-
defaultMessage: "Any status",
|
|
5110
|
-
description: "Option for form field: status of record",
|
|
5111
|
-
id: "advancedSearch.form.recordStatusAny"
|
|
5112
|
-
}
|
|
5113
|
-
},
|
|
5114
|
-
{
|
|
5115
|
-
value: EventStatus.enum.CREATED,
|
|
5116
|
-
label: {
|
|
5117
|
-
defaultMessage: "Draft",
|
|
5118
|
-
description: "Option for form field: status of record",
|
|
5119
|
-
id: "advancedSearch.form.recordStatusCreated"
|
|
5120
|
-
}
|
|
5121
|
-
},
|
|
5122
|
-
{
|
|
5123
|
-
value: EventStatus.enum.NOTIFIED,
|
|
5124
|
-
label: {
|
|
5125
|
-
defaultMessage: "Notified",
|
|
5126
|
-
description: "Option for form field: status of record",
|
|
5127
|
-
id: "advancedSearch.form.recordStatusNotified"
|
|
5128
|
-
}
|
|
5129
|
-
},
|
|
5130
|
-
{
|
|
5131
|
-
value: EventStatus.enum.DECLARED,
|
|
5132
|
-
label: {
|
|
5133
|
-
defaultMessage: "Declared",
|
|
5134
|
-
description: "Option for form field: status of record",
|
|
5135
|
-
id: "advancedSearch.form.recordStatusDeclared"
|
|
5136
|
-
}
|
|
5137
|
-
},
|
|
5138
|
-
{
|
|
5139
|
-
value: EventStatus.enum.VALIDATED,
|
|
5140
|
-
label: {
|
|
5141
|
-
defaultMessage: "Validated",
|
|
5142
|
-
description: "Option for form field: status of record",
|
|
5143
|
-
id: "advancedSearch.form.recordStatusValidated"
|
|
5144
|
-
}
|
|
5145
|
-
},
|
|
5146
|
-
{
|
|
5147
|
-
value: EventStatus.enum.REGISTERED,
|
|
5148
|
-
label: {
|
|
5149
|
-
defaultMessage: "Registered",
|
|
5150
|
-
description: "Option for form field: status of record",
|
|
5151
|
-
id: "advancedSearch.form.recordStatusRegistered"
|
|
5152
|
-
}
|
|
5153
|
-
},
|
|
5154
|
-
{
|
|
5155
|
-
value: EventStatus.enum.ARCHIVED,
|
|
5156
|
-
label: {
|
|
5157
|
-
defaultMessage: "Archived",
|
|
5158
|
-
description: "Option for form field: status of record",
|
|
5159
|
-
id: "advancedSearch.form.recordStatusArchived"
|
|
5160
|
-
}
|
|
5161
|
-
}
|
|
5162
|
-
];
|
|
5163
|
-
var timePeriodOptions = [
|
|
5164
|
-
{
|
|
5165
|
-
label: {
|
|
5166
|
-
defaultMessage: "Last 7 days",
|
|
5167
|
-
description: "Label for option of time period select: last 7 days",
|
|
5168
|
-
id: "form.section.label.timePeriodLast7Days"
|
|
5169
|
-
},
|
|
5170
|
-
value: `${(0, import_date_fns3.format)((0, import_date_fns3.subDays)(/* @__PURE__ */ new Date(), 7), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
|
|
5171
|
-
/* @__PURE__ */ new Date(),
|
|
5172
|
-
"yyyy-MM-dd"
|
|
5173
|
-
)}`
|
|
5174
|
-
},
|
|
5175
|
-
{
|
|
5176
|
-
label: {
|
|
5177
|
-
defaultMessage: "Last 30 days",
|
|
5178
|
-
description: "Label for option of time period select: last 30 days",
|
|
5179
|
-
id: "form.section.label.timePeriodLast30Days"
|
|
5180
|
-
},
|
|
5181
|
-
value: `${(0, import_date_fns3.format)((0, import_date_fns3.subMonths)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
|
|
5182
|
-
/* @__PURE__ */ new Date(),
|
|
5183
|
-
"yyyy-MM-dd"
|
|
5184
|
-
)}`
|
|
5185
|
-
},
|
|
5186
|
-
{
|
|
5187
|
-
label: {
|
|
5188
|
-
defaultMessage: "Last 90 days",
|
|
5189
|
-
description: "Label for option of time period select: last 90 days",
|
|
5190
|
-
id: "form.section.label.timePeriodLast90Days"
|
|
5191
|
-
},
|
|
5192
|
-
value: `${(0, import_date_fns3.format)((0, import_date_fns3.subQuarters)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
|
|
5193
|
-
/* @__PURE__ */ new Date(),
|
|
5194
|
-
"yyyy-MM-dd"
|
|
5195
|
-
)}`
|
|
5196
|
-
},
|
|
5197
|
-
{
|
|
5198
|
-
label: {
|
|
5199
|
-
defaultMessage: "Last year",
|
|
5200
|
-
description: "Label for option of time period select: last year",
|
|
5201
|
-
id: "form.section.label.timePeriodLastYear"
|
|
5202
|
-
},
|
|
5203
|
-
value: `${(0, import_date_fns3.format)((0, import_date_fns3.subYears)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
|
|
5204
|
-
/* @__PURE__ */ new Date(),
|
|
5205
|
-
"yyyy-MM-dd"
|
|
5206
|
-
)}`
|
|
5207
|
-
}
|
|
5208
|
-
];
|
|
5209
5301
|
|
|
5210
5302
|
// ../commons/src/fixtures/tennis-club-membership-event.ts
|
|
5211
5303
|
var tennisClubMembershipEvent = defineConfig({
|
|
5212
5304
|
id: TENNIS_CLUB_MEMBERSHIP,
|
|
5305
|
+
declaration: TENNIS_CLUB_DECLARATION_FORM,
|
|
5213
5306
|
label: {
|
|
5214
5307
|
defaultMessage: "Tennis club membership application",
|
|
5215
5308
|
description: "This is what this event is referred as in the system",
|
|
@@ -5260,13 +5353,12 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5260
5353
|
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5261
5354
|
},
|
|
5262
5355
|
{
|
|
5263
|
-
type: ActionType.
|
|
5356
|
+
type: ActionType.REJECT,
|
|
5264
5357
|
label: {
|
|
5265
|
-
defaultMessage: "
|
|
5358
|
+
defaultMessage: "Reject",
|
|
5266
5359
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5267
|
-
id: "event.tennis-club-membership.action.
|
|
5268
|
-
}
|
|
5269
|
-
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5360
|
+
id: "event.tennis-club-membership.action.reject.label"
|
|
5361
|
+
}
|
|
5270
5362
|
},
|
|
5271
5363
|
{
|
|
5272
5364
|
type: ActionType.REGISTER,
|
|
@@ -5274,8 +5366,7 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5274
5366
|
defaultMessage: "Register",
|
|
5275
5367
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5276
5368
|
id: "event.tennis-club-membership.action.register.label"
|
|
5277
|
-
}
|
|
5278
|
-
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5369
|
+
}
|
|
5279
5370
|
},
|
|
5280
5371
|
{
|
|
5281
5372
|
type: ActionType.REQUEST_CORRECTION,
|
|
@@ -5478,14 +5569,6 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5478
5569
|
]
|
|
5479
5570
|
}
|
|
5480
5571
|
},
|
|
5481
|
-
{
|
|
5482
|
-
type: ActionType.APPROVE_CORRECTION,
|
|
5483
|
-
label: {
|
|
5484
|
-
defaultMessage: "Approve correction",
|
|
5485
|
-
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5486
|
-
id: "event.tennis-club-membership.action.correction.approve.label"
|
|
5487
|
-
}
|
|
5488
|
-
},
|
|
5489
5572
|
{
|
|
5490
5573
|
type: ActionType.PRINT_CERTIFICATE,
|
|
5491
5574
|
label: {
|
|
@@ -5494,22 +5577,6 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5494
5577
|
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5495
5578
|
},
|
|
5496
5579
|
printForm: PRINT_CERTIFICATE_FORM
|
|
5497
|
-
},
|
|
5498
|
-
{
|
|
5499
|
-
type: ActionType.ARCHIVE,
|
|
5500
|
-
label: {
|
|
5501
|
-
id: "event.tennis-club-membership.action.archive.label",
|
|
5502
|
-
defaultMessage: "Archive",
|
|
5503
|
-
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5504
|
-
}
|
|
5505
|
-
},
|
|
5506
|
-
{
|
|
5507
|
-
type: ActionType.REJECT,
|
|
5508
|
-
label: {
|
|
5509
|
-
id: "event.tennis-club-membership.action.reject.label",
|
|
5510
|
-
defaultMessage: "Reject",
|
|
5511
|
-
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5512
|
-
}
|
|
5513
5580
|
}
|
|
5514
5581
|
],
|
|
5515
5582
|
advancedSearch: [
|
|
@@ -5546,8 +5613,7 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5546
5613
|
},
|
|
5547
5614
|
fields: [field("recommender.name").fuzzy()]
|
|
5548
5615
|
}
|
|
5549
|
-
]
|
|
5550
|
-
declaration: TENNIS_CLUB_DECLARATION_FORM
|
|
5616
|
+
]
|
|
5551
5617
|
});
|
|
5552
5618
|
|
|
5553
5619
|
// ../commons/src/fixtures/football-club-membership-event.ts
|
|
@@ -5615,23 +5681,13 @@ var footballClubMembershipEvent = defineConfig({
|
|
|
5615
5681
|
},
|
|
5616
5682
|
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5617
5683
|
},
|
|
5618
|
-
{
|
|
5619
|
-
type: ActionType.VALIDATE,
|
|
5620
|
-
label: {
|
|
5621
|
-
defaultMessage: "Validate",
|
|
5622
|
-
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5623
|
-
id: "event.football-club-membership.action.validate.label"
|
|
5624
|
-
},
|
|
5625
|
-
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5626
|
-
},
|
|
5627
5684
|
{
|
|
5628
5685
|
type: ActionType.REGISTER,
|
|
5629
5686
|
label: {
|
|
5630
5687
|
defaultMessage: "Register",
|
|
5631
5688
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5632
5689
|
id: "event.football-club-membership.action.register.label"
|
|
5633
|
-
}
|
|
5634
|
-
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5690
|
+
}
|
|
5635
5691
|
},
|
|
5636
5692
|
{
|
|
5637
5693
|
type: ActionType.REQUEST_CORRECTION,
|
|
@@ -5837,14 +5893,6 @@ var footballClubMembershipEvent = defineConfig({
|
|
|
5837
5893
|
]
|
|
5838
5894
|
}
|
|
5839
5895
|
},
|
|
5840
|
-
{
|
|
5841
|
-
type: ActionType.APPROVE_CORRECTION,
|
|
5842
|
-
label: {
|
|
5843
|
-
defaultMessage: "Approve correction",
|
|
5844
|
-
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5845
|
-
id: "event.football-club-membership.action.correction.approve.label"
|
|
5846
|
-
}
|
|
5847
|
-
},
|
|
5848
5896
|
{
|
|
5849
5897
|
type: ActionType.PRINT_CERTIFICATE,
|
|
5850
5898
|
label: {
|
|
@@ -5853,22 +5901,6 @@ var footballClubMembershipEvent = defineConfig({
|
|
|
5853
5901
|
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5854
5902
|
},
|
|
5855
5903
|
printForm: PRINT_CERTIFICATE_FORM
|
|
5856
|
-
},
|
|
5857
|
-
{
|
|
5858
|
-
type: ActionType.ARCHIVE,
|
|
5859
|
-
label: {
|
|
5860
|
-
id: "event.football-club-membership.action.archive.label",
|
|
5861
|
-
defaultMessage: "Archive",
|
|
5862
|
-
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5863
|
-
}
|
|
5864
|
-
},
|
|
5865
|
-
{
|
|
5866
|
-
type: ActionType.REJECT,
|
|
5867
|
-
label: {
|
|
5868
|
-
id: "event.football-club-membership.action.reject.label",
|
|
5869
|
-
defaultMessage: "Reject",
|
|
5870
|
-
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5871
|
-
}
|
|
5872
5904
|
}
|
|
5873
5905
|
],
|
|
5874
5906
|
advancedSearch: [
|
|
@@ -5968,7 +6000,7 @@ var libraryMembershipEvent = defineConfig({
|
|
|
5968
6000
|
declaration: libraryMembershipForm
|
|
5969
6001
|
});
|
|
5970
6002
|
|
|
5971
|
-
// ../commons/src/fixtures/
|
|
6003
|
+
// ../commons/src/fixtures/child-onboarding-event.ts
|
|
5972
6004
|
function generateTranslationConfig(message) {
|
|
5973
6005
|
return {
|
|
5974
6006
|
defaultMessage: message,
|
|
@@ -5997,6 +6029,61 @@ var child = defineFormPage({
|
|
|
5997
6029
|
secured: true,
|
|
5998
6030
|
validation: [],
|
|
5999
6031
|
label: generateTranslationConfig("Date of birth")
|
|
6032
|
+
},
|
|
6033
|
+
{
|
|
6034
|
+
id: "child.placeOfBirth",
|
|
6035
|
+
analytics: true,
|
|
6036
|
+
type: FieldType.SELECT,
|
|
6037
|
+
required: true,
|
|
6038
|
+
secured: true,
|
|
6039
|
+
label: {
|
|
6040
|
+
defaultMessage: "Place of delivery",
|
|
6041
|
+
description: "This is the label for the field",
|
|
6042
|
+
id: "event.birth.action.declare.form.section.child.field.placeOfBirth.label"
|
|
6043
|
+
},
|
|
6044
|
+
options: [
|
|
6045
|
+
{
|
|
6046
|
+
value: "child.placeOfBirth-SELECT-2",
|
|
6047
|
+
label: generateTranslationConfig("Health Institution")
|
|
6048
|
+
},
|
|
6049
|
+
{
|
|
6050
|
+
value: "PRIVATE_HOME",
|
|
6051
|
+
label: generateTranslationConfig("Residential address")
|
|
6052
|
+
}
|
|
6053
|
+
]
|
|
6054
|
+
},
|
|
6055
|
+
{
|
|
6056
|
+
id: "child.birthLocation",
|
|
6057
|
+
analytics: true,
|
|
6058
|
+
type: "FACILITY",
|
|
6059
|
+
required: true,
|
|
6060
|
+
secured: true,
|
|
6061
|
+
label: generateTranslationConfig("Health Institution"),
|
|
6062
|
+
conditionals: [
|
|
6063
|
+
{
|
|
6064
|
+
type: "SHOW",
|
|
6065
|
+
conditional: field("child.placeOfBirth").isEqualTo(
|
|
6066
|
+
"child.placeOfBirth-SELECT-2"
|
|
6067
|
+
)
|
|
6068
|
+
}
|
|
6069
|
+
]
|
|
6070
|
+
},
|
|
6071
|
+
{
|
|
6072
|
+
id: "child.birthLocation.privateHome",
|
|
6073
|
+
analytics: true,
|
|
6074
|
+
type: FieldType.ADDRESS,
|
|
6075
|
+
secured: true,
|
|
6076
|
+
hideLabel: true,
|
|
6077
|
+
label: generateTranslationConfig("Child's address"),
|
|
6078
|
+
conditionals: [
|
|
6079
|
+
{
|
|
6080
|
+
type: "SHOW",
|
|
6081
|
+
conditional: field("child.placeOfBirth").isEqualTo("PRIVATE_HOME")
|
|
6082
|
+
}
|
|
6083
|
+
],
|
|
6084
|
+
configuration: {
|
|
6085
|
+
streetAddressForm: []
|
|
6086
|
+
}
|
|
6000
6087
|
}
|
|
6001
6088
|
]
|
|
6002
6089
|
});
|
|
@@ -6073,7 +6160,7 @@ var mother = defineFormPage({
|
|
|
6073
6160
|
}
|
|
6074
6161
|
]
|
|
6075
6162
|
});
|
|
6076
|
-
var
|
|
6163
|
+
var CHILD_ONBOARDING_DECLARATION_REVIEW = {
|
|
6077
6164
|
title: generateTranslationConfig(
|
|
6078
6165
|
"{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}}}}}"
|
|
6079
6166
|
),
|
|
@@ -6093,12 +6180,12 @@ var BIRTH_DECLARATION_REVIEW = {
|
|
|
6093
6180
|
}
|
|
6094
6181
|
]
|
|
6095
6182
|
};
|
|
6096
|
-
var
|
|
6183
|
+
var CHILD_ONBOARDING_DECLARATION_FORM = defineDeclarationForm({
|
|
6097
6184
|
label: generateTranslationConfig("Birth decalration form"),
|
|
6098
6185
|
pages: [child, mother]
|
|
6099
6186
|
});
|
|
6100
|
-
var
|
|
6101
|
-
id:
|
|
6187
|
+
var ChildOnboardingEvent = defineConfig({
|
|
6188
|
+
id: CHILD_ONBOARDING_EVENT,
|
|
6102
6189
|
title: generateTranslationConfig(
|
|
6103
6190
|
"{child.name.firstname} {child.name.surname}"
|
|
6104
6191
|
),
|
|
@@ -6106,27 +6193,21 @@ var v2BirthEvent = defineConfig({
|
|
|
6106
6193
|
summary: {
|
|
6107
6194
|
fields: []
|
|
6108
6195
|
},
|
|
6109
|
-
declaration:
|
|
6196
|
+
declaration: CHILD_ONBOARDING_DECLARATION_FORM,
|
|
6110
6197
|
actions: [
|
|
6111
6198
|
{
|
|
6112
6199
|
type: ActionType.READ,
|
|
6113
6200
|
label: generateTranslationConfig("Read"),
|
|
6114
|
-
review:
|
|
6201
|
+
review: CHILD_ONBOARDING_DECLARATION_REVIEW
|
|
6115
6202
|
},
|
|
6116
6203
|
{
|
|
6117
6204
|
type: ActionType.DECLARE,
|
|
6118
6205
|
label: generateTranslationConfig("Declare"),
|
|
6119
|
-
review:
|
|
6120
|
-
},
|
|
6121
|
-
{
|
|
6122
|
-
type: ActionType.VALIDATE,
|
|
6123
|
-
label: generateTranslationConfig("Validate"),
|
|
6124
|
-
review: BIRTH_DECLARATION_REVIEW
|
|
6206
|
+
review: CHILD_ONBOARDING_DECLARATION_REVIEW
|
|
6125
6207
|
},
|
|
6126
6208
|
{
|
|
6127
6209
|
type: ActionType.REGISTER,
|
|
6128
|
-
label: generateTranslationConfig("Register")
|
|
6129
|
-
review: BIRTH_DECLARATION_REVIEW
|
|
6210
|
+
label: generateTranslationConfig("Register")
|
|
6130
6211
|
}
|
|
6131
6212
|
],
|
|
6132
6213
|
advancedSearch: []
|
|
@@ -6214,7 +6295,7 @@ var PRINT_DIGITAL_ID_CERTIFICATE_FORM = defineActionForm({
|
|
|
6214
6295
|
conditionals: [
|
|
6215
6296
|
{
|
|
6216
6297
|
type: ConditionalType.ENABLE,
|
|
6217
|
-
conditional:
|
|
6298
|
+
conditional: never2()
|
|
6218
6299
|
},
|
|
6219
6300
|
{
|
|
6220
6301
|
type: ConditionalType.SHOW,
|
|
@@ -6241,7 +6322,7 @@ var PRINT_DIGITAL_ID_CERTIFICATE_FORM = defineActionForm({
|
|
|
6241
6322
|
conditionals: [
|
|
6242
6323
|
{
|
|
6243
6324
|
type: ConditionalType.ENABLE,
|
|
6244
|
-
conditional:
|
|
6325
|
+
conditional: never2()
|
|
6245
6326
|
},
|
|
6246
6327
|
{
|
|
6247
6328
|
type: ConditionalType.SHOW,
|
|
@@ -6269,7 +6350,7 @@ var PRINT_DIGITAL_ID_CERTIFICATE_FORM = defineActionForm({
|
|
|
6269
6350
|
conditionals: [
|
|
6270
6351
|
{
|
|
6271
6352
|
type: ConditionalType.ENABLE,
|
|
6272
|
-
conditional:
|
|
6353
|
+
conditional: never2()
|
|
6273
6354
|
}
|
|
6274
6355
|
],
|
|
6275
6356
|
value: field("identity.http-fetch").get("data.certificateId")
|
|
@@ -6347,8 +6428,8 @@ var digitalIdentityEvent = defineConfig({
|
|
|
6347
6428
|
});
|
|
6348
6429
|
|
|
6349
6430
|
// ../commons/src/events/test.utils.ts
|
|
6350
|
-
var
|
|
6351
|
-
var TestUserRole =
|
|
6431
|
+
var z37 = __toESM(require("zod/v4"));
|
|
6432
|
+
var TestUserRole = z37.enum([
|
|
6352
6433
|
"FIELD_AGENT",
|
|
6353
6434
|
"LOCAL_REGISTRAR",
|
|
6354
6435
|
"LOCAL_SYSTEM_ADMIN",
|
|
@@ -6359,18 +6440,14 @@ var TestUserRole = import_zod35.z.enum([
|
|
|
6359
6440
|
]);
|
|
6360
6441
|
|
|
6361
6442
|
// ../commons/src/events/scopes.ts
|
|
6362
|
-
var
|
|
6443
|
+
var import_lodash6 = require("lodash");
|
|
6363
6444
|
var ACTION_SCOPE_MAP = {
|
|
6364
6445
|
[ActionType.READ]: ["record.read"],
|
|
6365
6446
|
[ActionType.CREATE]: ["record.create"],
|
|
6366
6447
|
[ActionType.NOTIFY]: ["record.notify"],
|
|
6367
|
-
[ActionType.DECLARE]: [
|
|
6368
|
-
|
|
6369
|
-
"record.declared.validate",
|
|
6370
|
-
"record.register"
|
|
6371
|
-
],
|
|
6448
|
+
[ActionType.DECLARE]: ["record.declare", "record.register"],
|
|
6449
|
+
[ActionType.EDIT]: ["record.declared.edit"],
|
|
6372
6450
|
[ActionType.DELETE]: ["record.declare"],
|
|
6373
|
-
[ActionType.VALIDATE]: ["record.declared.validate", "record.register"],
|
|
6374
6451
|
[ActionType.REGISTER]: ["record.register"],
|
|
6375
6452
|
[ActionType.PRINT_CERTIFICATE]: ["record.registered.print-certified-copies"],
|
|
6376
6453
|
[ActionType.REQUEST_CORRECTION]: [
|
|
@@ -6388,7 +6465,8 @@ var ACTION_SCOPE_MAP = {
|
|
|
6388
6465
|
[ActionType.REJECT]: ["record.declared.reject"],
|
|
6389
6466
|
[ActionType.ASSIGN]: null,
|
|
6390
6467
|
[ActionType.UNASSIGN]: null,
|
|
6391
|
-
[ActionType.DUPLICATE_DETECTED]: []
|
|
6468
|
+
[ActionType.DUPLICATE_DETECTED]: [],
|
|
6469
|
+
[ActionType.CUSTOM]: []
|
|
6392
6470
|
};
|
|
6393
6471
|
|
|
6394
6472
|
// ../commons/src/events/state/availableActions.ts
|
|
@@ -6397,28 +6475,25 @@ var AVAILABLE_ACTIONS_BY_EVENT_STATUS = {
|
|
|
6397
6475
|
ActionType.READ,
|
|
6398
6476
|
ActionType.DECLARE,
|
|
6399
6477
|
ActionType.NOTIFY,
|
|
6400
|
-
ActionType.DELETE
|
|
6478
|
+
ActionType.DELETE,
|
|
6479
|
+
ActionType.CUSTOM
|
|
6401
6480
|
],
|
|
6402
6481
|
[EventStatus.enum.NOTIFIED]: [
|
|
6403
6482
|
ActionType.READ,
|
|
6404
6483
|
ActionType.DECLARE,
|
|
6405
6484
|
ActionType.MARK_AS_DUPLICATE,
|
|
6406
6485
|
ActionType.ARCHIVE,
|
|
6407
|
-
ActionType.REJECT
|
|
6486
|
+
ActionType.REJECT,
|
|
6487
|
+
ActionType.CUSTOM
|
|
6408
6488
|
],
|
|
6409
6489
|
[EventStatus.enum.DECLARED]: [
|
|
6410
|
-
ActionType.READ,
|
|
6411
|
-
ActionType.VALIDATE,
|
|
6412
|
-
ActionType.MARK_AS_DUPLICATE,
|
|
6413
|
-
ActionType.ARCHIVE,
|
|
6414
|
-
ActionType.REJECT
|
|
6415
|
-
],
|
|
6416
|
-
[EventStatus.enum.VALIDATED]: [
|
|
6417
6490
|
ActionType.READ,
|
|
6418
6491
|
ActionType.REGISTER,
|
|
6419
6492
|
ActionType.MARK_AS_DUPLICATE,
|
|
6420
6493
|
ActionType.ARCHIVE,
|
|
6421
|
-
ActionType.REJECT
|
|
6494
|
+
ActionType.REJECT,
|
|
6495
|
+
ActionType.CUSTOM,
|
|
6496
|
+
ActionType.EDIT
|
|
6422
6497
|
],
|
|
6423
6498
|
[EventStatus.enum.REGISTERED]: [
|
|
6424
6499
|
ActionType.READ,
|
|
@@ -6426,12 +6501,14 @@ var AVAILABLE_ACTIONS_BY_EVENT_STATUS = {
|
|
|
6426
6501
|
ActionType.REQUEST_CORRECTION,
|
|
6427
6502
|
ActionType.APPROVE_CORRECTION,
|
|
6428
6503
|
ActionType.REJECT_CORRECTION,
|
|
6504
|
+
ActionType.CUSTOM,
|
|
6429
6505
|
ClientSpecificAction.REVIEW_CORRECTION_REQUEST
|
|
6430
6506
|
],
|
|
6431
6507
|
[EventStatus.enum.ARCHIVED]: [
|
|
6432
6508
|
ActionType.READ,
|
|
6433
6509
|
ActionType.ASSIGN,
|
|
6434
|
-
ActionType.UNASSIGN
|
|
6510
|
+
ActionType.UNASSIGN,
|
|
6511
|
+
ActionType.CUSTOM
|
|
6435
6512
|
]
|
|
6436
6513
|
};
|
|
6437
6514
|
var ACTION_FILTERS = {
|
|
@@ -6441,32 +6518,33 @@ var ACTION_FILTERS = {
|
|
|
6441
6518
|
[ActionType.APPROVE_CORRECTION]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6442
6519
|
[ActionType.REJECT_CORRECTION]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6443
6520
|
[ActionType.MARK_AS_DUPLICATE]: (flags) => flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6444
|
-
[ActionType.
|
|
6521
|
+
[ActionType.EDIT]: (flags) => !flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6445
6522
|
[ActionType.REGISTER]: (flags) => !flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6446
6523
|
[ActionType.REJECT]: (flags) => !flags.includes(InherentFlags.REJECTED) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6447
6524
|
[ActionType.ARCHIVE]: (flags) => !flags.some((flag) => flag.endsWith(":requested"))
|
|
6448
6525
|
};
|
|
6449
6526
|
|
|
6450
6527
|
// ../commons/src/events/FileUtils.ts
|
|
6451
|
-
var
|
|
6528
|
+
var import_lodash7 = require("lodash");
|
|
6452
6529
|
|
|
6453
6530
|
// ../commons/src/events/locations.ts
|
|
6454
|
-
var
|
|
6455
|
-
var LocationType =
|
|
6531
|
+
var z38 = __toESM(require("zod/v4"));
|
|
6532
|
+
var LocationType = z38.enum([
|
|
6456
6533
|
"ADMIN_STRUCTURE",
|
|
6457
6534
|
"CRVS_OFFICE",
|
|
6458
6535
|
"HEALTH_FACILITY"
|
|
6459
6536
|
]);
|
|
6460
|
-
var Location =
|
|
6537
|
+
var Location = z38.object({
|
|
6461
6538
|
id: UUID,
|
|
6462
|
-
name:
|
|
6539
|
+
name: z38.string(),
|
|
6540
|
+
externalId: z38.string().nullable(),
|
|
6463
6541
|
parentId: UUID.nullable(),
|
|
6464
|
-
validUntil:
|
|
6542
|
+
validUntil: z38.iso.datetime().nullable(),
|
|
6465
6543
|
locationType: LocationType.nullable()
|
|
6466
6544
|
});
|
|
6467
6545
|
|
|
6468
6546
|
// ../commons/src/notification/UserNotifications.ts
|
|
6469
|
-
var
|
|
6547
|
+
var z39 = __toESM(require("zod/v4"));
|
|
6470
6548
|
var TriggerEvent = {
|
|
6471
6549
|
USER_CREATED: "user-created",
|
|
6472
6550
|
USER_UPDATED: "user-updated",
|
|
@@ -6478,50 +6556,50 @@ var TriggerEvent = {
|
|
|
6478
6556
|
CHANGE_PHONE_NUMBER: "change-phone-number",
|
|
6479
6557
|
CHANGE_EMAIL_ADDRESS: "change-email-address"
|
|
6480
6558
|
};
|
|
6481
|
-
var Recipient =
|
|
6559
|
+
var Recipient = z39.object({
|
|
6482
6560
|
name: NameFieldValue.optional(),
|
|
6483
|
-
mobile:
|
|
6484
|
-
email:
|
|
6485
|
-
bcc:
|
|
6561
|
+
mobile: z39.string().optional(),
|
|
6562
|
+
email: z39.string().optional(),
|
|
6563
|
+
bcc: z39.array(z39.string()).optional()
|
|
6486
6564
|
});
|
|
6487
|
-
var BasePayload =
|
|
6565
|
+
var BasePayload = z39.object({
|
|
6488
6566
|
recipient: Recipient
|
|
6489
6567
|
});
|
|
6490
6568
|
var TriggerPayload = {
|
|
6491
6569
|
[TriggerEvent.USER_CREATED]: BasePayload.extend({
|
|
6492
|
-
username:
|
|
6493
|
-
temporaryPassword:
|
|
6570
|
+
username: z39.string(),
|
|
6571
|
+
temporaryPassword: z39.string()
|
|
6494
6572
|
}),
|
|
6495
6573
|
[TriggerEvent.USER_UPDATED]: BasePayload.extend({
|
|
6496
|
-
oldUsername:
|
|
6497
|
-
newUsername:
|
|
6574
|
+
oldUsername: z39.string(),
|
|
6575
|
+
newUsername: z39.string()
|
|
6498
6576
|
}),
|
|
6499
6577
|
[TriggerEvent.USERNAME_REMINDER]: BasePayload.extend({
|
|
6500
|
-
username:
|
|
6578
|
+
username: z39.string()
|
|
6501
6579
|
}),
|
|
6502
6580
|
[TriggerEvent.RESET_PASSWORD]: BasePayload.extend({
|
|
6503
|
-
code:
|
|
6581
|
+
code: z39.string()
|
|
6504
6582
|
}),
|
|
6505
6583
|
[TriggerEvent.RESET_PASSWORD_BY_ADMIN]: BasePayload.extend({
|
|
6506
|
-
temporaryPassword:
|
|
6507
|
-
admin:
|
|
6508
|
-
id:
|
|
6584
|
+
temporaryPassword: z39.string(),
|
|
6585
|
+
admin: z39.object({
|
|
6586
|
+
id: z39.string(),
|
|
6509
6587
|
name: NameFieldValue,
|
|
6510
|
-
role:
|
|
6588
|
+
role: z39.string()
|
|
6511
6589
|
})
|
|
6512
6590
|
}),
|
|
6513
6591
|
[TriggerEvent.TWO_FA]: BasePayload.extend({
|
|
6514
|
-
code:
|
|
6592
|
+
code: z39.string()
|
|
6515
6593
|
}),
|
|
6516
6594
|
[TriggerEvent.ALL_USER_NOTIFICATION]: BasePayload.extend({
|
|
6517
|
-
subject:
|
|
6518
|
-
body:
|
|
6595
|
+
subject: z39.string(),
|
|
6596
|
+
body: z39.string()
|
|
6519
6597
|
}),
|
|
6520
6598
|
[TriggerEvent.CHANGE_PHONE_NUMBER]: BasePayload.extend({
|
|
6521
|
-
code:
|
|
6599
|
+
code: z39.string()
|
|
6522
6600
|
}),
|
|
6523
6601
|
[TriggerEvent.CHANGE_EMAIL_ADDRESS]: BasePayload.extend({
|
|
6524
|
-
code:
|
|
6602
|
+
code: z39.string()
|
|
6525
6603
|
})
|
|
6526
6604
|
};
|
|
6527
6605
|
async function triggerUserEventNotification({
|
|
@@ -6543,3 +6621,6 @@ function parseUserEventTrigger(event2, body) {
|
|
|
6543
6621
|
const schema = TriggerPayload[event2];
|
|
6544
6622
|
return schema.parse(body);
|
|
6545
6623
|
}
|
|
6624
|
+
|
|
6625
|
+
// src/notification/index.ts
|
|
6626
|
+
z40.globalRegistry.clear();
|