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