@opencrvs/toolkit 1.9.6-rc.466a584 → 1.9.6-rc.480ea6f
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 +29384 -2317
- package/dist/commons/conditionals/conditionals.d.ts +10 -1
- package/dist/commons/conditionals/validate.d.ts +11 -4
- package/dist/commons/events/ActionConfig.d.ts +24973 -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 +29 -190
- package/dist/commons/events/Conditional.d.ts +26 -38
- package/dist/commons/events/Constants.d.ts +1 -1
- package/dist/commons/events/CountryConfigQueryInput.d.ts +1195 -4223
- package/dist/commons/events/CreatedAtLocation.d.ts +1 -1
- package/dist/commons/events/DeduplicationConfig.d.ts +15 -150
- package/dist/commons/events/Draft.d.ts +70 -105
- package/dist/commons/events/DynamicFieldValue.d.ts +7 -91
- package/dist/commons/events/EventConfig.d.ts +19932 -2120
- package/dist/commons/events/EventConfigInput.d.ts +1 -1
- package/dist/commons/events/EventDocument.d.ts +320 -1332
- package/dist/commons/events/EventIndex.d.ts +193 -980
- package/dist/commons/events/EventInput.d.ts +2 -8
- package/dist/commons/events/EventMetadata.d.ts +106 -347
- package/dist/commons/events/FieldConfig.d.ts +4528 -12326
- package/dist/commons/events/FieldType.d.ts +20 -4
- package/dist/commons/events/FieldTypeMapping.d.ts +195 -881
- package/dist/commons/events/FieldValue.d.ts +88 -396
- package/dist/commons/events/Flag.d.ts +67 -0
- package/dist/commons/events/FormConfig.d.ts +13980 -721
- package/dist/commons/events/PageConfig.d.ts +9340 -319
- package/dist/commons/events/SummaryConfig.d.ts +14 -161
- package/dist/commons/events/TemplateConfig.d.ts +2 -5
- package/dist/commons/events/TranslationConfig.d.ts +2 -2
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +74 -37
- package/dist/commons/events/WorkqueueConfig.d.ts +1867 -7176
- package/dist/commons/events/deduplication.d.ts +3 -3
- package/dist/commons/events/defineConfig.d.ts +26563 -147
- package/dist/commons/events/eventConfigValidation.d.ts +8 -0
- package/dist/commons/events/index.d.ts +1 -0
- package/dist/commons/events/locations.d.ts +26 -19
- package/dist/commons/events/scopes.d.ts +5 -4
- package/dist/commons/events/state/availableActions.d.ts +0 -2
- package/dist/commons/events/state/flags.d.ts +21 -3
- package/dist/commons/events/state/index.d.ts +23 -19
- package/dist/commons/events/state/utils.d.ts +130 -112
- package/dist/commons/events/test.utils.d.ts +17 -8
- package/dist/commons/events/transactions.d.ts +1 -1
- package/dist/commons/events/utils.d.ts +53164 -367
- package/dist/commons/notification/UserNotifications.d.ts +55 -636
- package/dist/conditionals/index.d.ts.map +1 -1
- package/dist/conditionals/index.js +46 -16
- package/dist/events/deduplication.d.ts +3 -3
- package/dist/events/index.js +1992 -1728
- package/dist/notification/index.d.ts.map +1 -1
- package/dist/notification/index.js +1648 -1574
- 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 z41 = __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 z22 = __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 z17 = __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",
|
|
@@ -265,9 +267,21 @@ var FieldType = {
|
|
|
265
267
|
QUERY_PARAM_READER: "QUERY_PARAM_READER",
|
|
266
268
|
QR_READER: "QR_READER",
|
|
267
269
|
ID_READER: "ID_READER",
|
|
268
|
-
LOADER: "LOADER"
|
|
270
|
+
LOADER: "LOADER",
|
|
271
|
+
ALPHA_HIDDEN: "ALPHA_HIDDEN",
|
|
272
|
+
/**
|
|
273
|
+
* @internal
|
|
274
|
+
* @experimental
|
|
275
|
+
*
|
|
276
|
+
* Internal API used by the OpenCRVS core team for experimentation.
|
|
277
|
+
*
|
|
278
|
+
* This component is not part of the public, stable API.
|
|
279
|
+
* Its shape, behavior, or existence may change at any time or be removed
|
|
280
|
+
* entirely without notice.
|
|
281
|
+
*/
|
|
282
|
+
_EXPERIMENTAL_CUSTOM: "CUSTOM"
|
|
269
283
|
};
|
|
270
|
-
var FileFieldType =
|
|
284
|
+
var FileFieldType = z4.enum([
|
|
271
285
|
FieldType.FILE,
|
|
272
286
|
FieldType.FILE_WITH_OPTIONS,
|
|
273
287
|
FieldType.SIGNATURE
|
|
@@ -291,154 +305,155 @@ var FieldTypesToHideInReview = [
|
|
|
291
305
|
FieldType.LOADER,
|
|
292
306
|
FieldType.HTTP,
|
|
293
307
|
FieldType.QUERY_PARAM_READER,
|
|
294
|
-
FieldType.DATA
|
|
308
|
+
FieldType.DATA,
|
|
309
|
+
FieldType.ALPHA_HIDDEN
|
|
295
310
|
];
|
|
296
311
|
|
|
297
312
|
// ../commons/src/events/FieldValue.ts
|
|
298
|
-
var
|
|
313
|
+
var z7 = __toESM(require("zod/v4"));
|
|
299
314
|
|
|
300
315
|
// ../commons/src/documents.ts
|
|
301
|
-
var
|
|
302
|
-
var
|
|
303
|
-
(0, import_zod_openapi3.extendZodWithOpenApi)(import_zod5.z);
|
|
304
|
-
var FullDocumentUrl = import_zod5.z.string().brand("FullDocumentUrl").describe(
|
|
316
|
+
var z5 = __toESM(require("zod/v4"));
|
|
317
|
+
var FullDocumentUrl = z5.string().brand("FullDocumentUrl").describe(
|
|
305
318
|
"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"
|
|
306
319
|
);
|
|
307
|
-
var FullDocumentPath =
|
|
320
|
+
var FullDocumentPath = z5.string().overwrite((val) => val.startsWith("/") ? val : `/${val}`).meta({ effectType: "input", type: "string" }).describe(
|
|
308
321
|
"A full absolute path with bucket name, starting from the root of the S3 server, /bucket-name/document-id.jpg"
|
|
309
322
|
);
|
|
310
|
-
var DocumentPath =
|
|
323
|
+
var DocumentPath = z5.string().brand("DocumentPath").describe(
|
|
311
324
|
"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"
|
|
312
325
|
);
|
|
313
326
|
|
|
314
327
|
// ../commons/src/events/CompositeFieldValue.ts
|
|
315
|
-
var
|
|
328
|
+
var z6 = __toESM(require("zod/v4"));
|
|
316
329
|
var AddressType = {
|
|
317
330
|
DOMESTIC: "DOMESTIC",
|
|
318
331
|
INTERNATIONAL: "INTERNATIONAL"
|
|
319
332
|
};
|
|
320
|
-
var FileFieldValue =
|
|
333
|
+
var FileFieldValue = z6.object({
|
|
321
334
|
path: FullDocumentPath,
|
|
322
|
-
originalFilename:
|
|
323
|
-
type:
|
|
324
|
-
});
|
|
325
|
-
var NameFieldValue =
|
|
326
|
-
firstname:
|
|
327
|
-
surname:
|
|
328
|
-
middlename:
|
|
329
|
-
});
|
|
330
|
-
var NameFieldUpdateValue =
|
|
331
|
-
firstname:
|
|
332
|
-
surname:
|
|
333
|
-
middlename:
|
|
334
|
-
}).or(
|
|
335
|
-
var StreetLevelDetailsValue =
|
|
336
|
-
var StreetLevelDetailsUpdateValue =
|
|
337
|
-
var BaseAddressFieldValue =
|
|
338
|
-
country:
|
|
335
|
+
originalFilename: z6.string(),
|
|
336
|
+
type: z6.string()
|
|
337
|
+
});
|
|
338
|
+
var NameFieldValue = z6.object({
|
|
339
|
+
firstname: z6.string(),
|
|
340
|
+
surname: z6.string(),
|
|
341
|
+
middlename: z6.string().optional()
|
|
342
|
+
});
|
|
343
|
+
var NameFieldUpdateValue = z6.object({
|
|
344
|
+
firstname: z6.string().nullish(),
|
|
345
|
+
surname: z6.string().nullish(),
|
|
346
|
+
middlename: z6.string().nullish()
|
|
347
|
+
}).or(z6.null()).or(z6.undefined());
|
|
348
|
+
var StreetLevelDetailsValue = z6.record(z6.string(), z6.string()).optional();
|
|
349
|
+
var StreetLevelDetailsUpdateValue = z6.record(z6.string(), z6.string().nullable()).nullish();
|
|
350
|
+
var BaseAddressFieldValue = z6.object({
|
|
351
|
+
country: z6.string(),
|
|
339
352
|
streetLevelDetails: StreetLevelDetailsValue
|
|
340
353
|
});
|
|
341
|
-
var BaseAddressFieldUpdateValue =
|
|
342
|
-
country:
|
|
354
|
+
var BaseAddressFieldUpdateValue = z6.object({
|
|
355
|
+
country: z6.string().nullish(),
|
|
343
356
|
streetLevelDetails: StreetLevelDetailsUpdateValue
|
|
344
357
|
});
|
|
345
358
|
var DomesticAddressFieldValue = BaseAddressFieldValue.extend({
|
|
346
|
-
addressType:
|
|
347
|
-
administrativeArea:
|
|
359
|
+
addressType: z6.literal(AddressType.DOMESTIC),
|
|
360
|
+
administrativeArea: z6.string().uuid()
|
|
348
361
|
});
|
|
349
362
|
var InternationalAddressFieldValue = BaseAddressFieldValue.extend({
|
|
350
|
-
addressType:
|
|
363
|
+
addressType: z6.literal(AddressType.INTERNATIONAL)
|
|
351
364
|
});
|
|
352
|
-
var AddressFieldValue =
|
|
365
|
+
var AddressFieldValue = z6.discriminatedUnion("addressType", [
|
|
353
366
|
DomesticAddressFieldValue,
|
|
354
367
|
InternationalAddressFieldValue
|
|
355
368
|
]);
|
|
356
369
|
var DomesticAddressUpdateFieldValue = BaseAddressFieldUpdateValue.extend({
|
|
357
|
-
addressType:
|
|
358
|
-
administrativeArea:
|
|
370
|
+
addressType: z6.literal(AddressType.DOMESTIC),
|
|
371
|
+
administrativeArea: z6.string().uuid().nullish()
|
|
359
372
|
/* Leaf level admin structure */
|
|
360
373
|
});
|
|
361
374
|
var InternationalAddressUpdateFieldValue = BaseAddressFieldUpdateValue.extend(
|
|
362
375
|
{
|
|
363
|
-
addressType:
|
|
376
|
+
addressType: z6.literal(AddressType.INTERNATIONAL)
|
|
364
377
|
}
|
|
365
378
|
);
|
|
366
|
-
var AddressFieldUpdateValue =
|
|
379
|
+
var AddressFieldUpdateValue = z6.discriminatedUnion("addressType", [
|
|
367
380
|
DomesticAddressUpdateFieldValue,
|
|
368
381
|
InternationalAddressUpdateFieldValue
|
|
369
382
|
]).nullish();
|
|
370
|
-
var FileFieldValueWithOption =
|
|
383
|
+
var FileFieldValueWithOption = z6.object({
|
|
371
384
|
path: FullDocumentPath,
|
|
372
|
-
originalFilename:
|
|
373
|
-
type:
|
|
374
|
-
option:
|
|
375
|
-
});
|
|
376
|
-
var FileFieldWithOptionValue =
|
|
377
|
-
var HttpFieldValue =
|
|
378
|
-
loading:
|
|
379
|
-
error:
|
|
380
|
-
data:
|
|
381
|
-
});
|
|
382
|
-
var HttpFieldUpdateValue =
|
|
383
|
-
loading:
|
|
384
|
-
error:
|
|
385
|
-
data:
|
|
386
|
-
}).or(
|
|
387
|
-
var QueryParamReaderFieldValue =
|
|
388
|
-
data:
|
|
385
|
+
originalFilename: z6.string(),
|
|
386
|
+
type: z6.string(),
|
|
387
|
+
option: z6.string()
|
|
388
|
+
});
|
|
389
|
+
var FileFieldWithOptionValue = z6.array(FileFieldValueWithOption);
|
|
390
|
+
var HttpFieldValue = z6.object({
|
|
391
|
+
loading: z6.boolean(),
|
|
392
|
+
error: z6.object({ statusCode: z6.number(), message: z6.string() }).nullish(),
|
|
393
|
+
data: z6.any()
|
|
394
|
+
});
|
|
395
|
+
var HttpFieldUpdateValue = z6.object({
|
|
396
|
+
loading: z6.boolean().nullish(),
|
|
397
|
+
error: z6.object({ statusCode: z6.number(), message: z6.string() }).nullish(),
|
|
398
|
+
data: z6.any().nullish()
|
|
399
|
+
}).or(z6.null()).or(z6.undefined());
|
|
400
|
+
var QueryParamReaderFieldValue = z6.object({
|
|
401
|
+
data: z6.record(z6.string(), z6.string())
|
|
389
402
|
}).nullish();
|
|
390
|
-
var QueryParamReaderFieldUpdateValue =
|
|
391
|
-
data:
|
|
403
|
+
var QueryParamReaderFieldUpdateValue = z6.object({
|
|
404
|
+
data: z6.record(z6.string(), z6.string())
|
|
392
405
|
});
|
|
393
|
-
var ReadDataValue =
|
|
394
|
-
data:
|
|
406
|
+
var ReadDataValue = z6.object({
|
|
407
|
+
data: z6.any()
|
|
395
408
|
});
|
|
396
409
|
var QrReaderFieldValue = ReadDataValue;
|
|
397
410
|
var IdReaderFieldValue = ReadDataValue;
|
|
398
|
-
var NumberWithUnitFieldValue =
|
|
399
|
-
numericValue:
|
|
400
|
-
unit:
|
|
411
|
+
var NumberWithUnitFieldValue = z6.object({
|
|
412
|
+
numericValue: z6.number(),
|
|
413
|
+
unit: z6.string()
|
|
401
414
|
});
|
|
402
|
-
var NumberWithUnitFieldUpdateValue =
|
|
403
|
-
numericValue:
|
|
404
|
-
unit:
|
|
415
|
+
var NumberWithUnitFieldUpdateValue = z6.object({
|
|
416
|
+
numericValue: z6.number().optional(),
|
|
417
|
+
unit: z6.string().optional()
|
|
405
418
|
});
|
|
419
|
+
var CustomFieldValue = z6.unknown().brand("CustomFieldValue");
|
|
406
420
|
|
|
407
421
|
// ../commons/src/events/FieldValue.ts
|
|
408
|
-
var TextValue =
|
|
422
|
+
var TextValue = z7.string();
|
|
423
|
+
var HiddenFieldValue = z7.string();
|
|
409
424
|
var NonEmptyTextValue = TextValue.min(1);
|
|
410
|
-
var DateValue =
|
|
411
|
-
var AgeValue =
|
|
412
|
-
age:
|
|
413
|
-
asOfDateRef:
|
|
425
|
+
var DateValue = z7.iso.date().describe("Date in the format YYYY-MM-DD");
|
|
426
|
+
var AgeValue = z7.object({
|
|
427
|
+
age: z7.number(),
|
|
428
|
+
asOfDateRef: z7.string()
|
|
414
429
|
});
|
|
415
430
|
var AgeUpdateValue = AgeValue.optional().nullable();
|
|
416
|
-
var TimeValue =
|
|
417
|
-
var DatetimeValue =
|
|
418
|
-
var SelectDateRangeValue =
|
|
431
|
+
var TimeValue = z7.string().regex(/^([01][0-9]|2[0-3]):[0-5][0-9]$/);
|
|
432
|
+
var DatetimeValue = z7.iso.datetime();
|
|
433
|
+
var SelectDateRangeValue = z7.enum([
|
|
419
434
|
"last7Days",
|
|
420
435
|
"last30Days",
|
|
421
436
|
"last90Days",
|
|
422
437
|
"last365Days"
|
|
423
438
|
]);
|
|
424
|
-
var DateRangeFieldValue =
|
|
439
|
+
var DateRangeFieldValue = z7.object({
|
|
425
440
|
start: DateValue,
|
|
426
441
|
end: DateValue
|
|
427
442
|
}).or(DateValue).describe(
|
|
428
443
|
"Date range with start and end dates in the format YYYY-MM-DD. Inclusive start, exclusive end."
|
|
429
444
|
);
|
|
430
|
-
var EmailValue =
|
|
431
|
-
var CheckboxFieldValue =
|
|
432
|
-
var NumberFieldValue =
|
|
433
|
-
var SignatureFieldValue =
|
|
434
|
-
var ButtonFieldValue =
|
|
435
|
-
var VerificationStatusValue =
|
|
445
|
+
var EmailValue = z7.email();
|
|
446
|
+
var CheckboxFieldValue = z7.boolean();
|
|
447
|
+
var NumberFieldValue = z7.number();
|
|
448
|
+
var SignatureFieldValue = z7.string();
|
|
449
|
+
var ButtonFieldValue = z7.number();
|
|
450
|
+
var VerificationStatusValue = z7.enum([
|
|
436
451
|
"verified",
|
|
437
452
|
"authenticated",
|
|
438
453
|
"failed",
|
|
439
454
|
"pending"
|
|
440
455
|
]);
|
|
441
|
-
var FieldValuesWithoutDataField =
|
|
456
|
+
var FieldValuesWithoutDataField = z7.union([
|
|
442
457
|
AddressFieldValue,
|
|
443
458
|
TextValue,
|
|
444
459
|
DateValue,
|
|
@@ -459,12 +474,13 @@ var FieldValuesWithoutDataField = import_zod7.z.union([
|
|
|
459
474
|
QrReaderFieldValue,
|
|
460
475
|
IdReaderFieldValue,
|
|
461
476
|
NumberWithUnitFieldValue,
|
|
462
|
-
NumberWithUnitFieldUpdateValue
|
|
477
|
+
NumberWithUnitFieldUpdateValue,
|
|
478
|
+
CustomFieldValue
|
|
463
479
|
]);
|
|
464
|
-
var DataFieldValue =
|
|
465
|
-
data:
|
|
480
|
+
var DataFieldValue = z7.object({
|
|
481
|
+
data: z7.record(z7.string(), FieldValuesWithoutDataField)
|
|
466
482
|
}).nullish();
|
|
467
|
-
var FieldValue =
|
|
483
|
+
var FieldValue = z7.union([
|
|
468
484
|
FieldValuesWithoutDataField,
|
|
469
485
|
DataFieldValue
|
|
470
486
|
]);
|
|
@@ -485,22 +501,38 @@ var PRIORITY_ORDER = [
|
|
|
485
501
|
"DataFieldValue"
|
|
486
502
|
];
|
|
487
503
|
function schemaPriority(schema) {
|
|
488
|
-
const name = schema.
|
|
504
|
+
const name = schema.description;
|
|
505
|
+
if (!name) {
|
|
506
|
+
return 9999;
|
|
507
|
+
}
|
|
489
508
|
const idx = PRIORITY_ORDER.indexOf(name);
|
|
490
509
|
return idx === -1 ? 9999 : idx;
|
|
491
510
|
}
|
|
492
511
|
function safeUnion(schemas) {
|
|
493
|
-
return
|
|
512
|
+
return z7.any().superRefine((val, ctx) => {
|
|
494
513
|
const successful = schemas.filter((s) => s.safeParse(val).success);
|
|
495
514
|
if (successful.length === 1) {
|
|
496
|
-
return
|
|
515
|
+
return;
|
|
497
516
|
}
|
|
498
517
|
if (successful.length === 0) {
|
|
499
|
-
|
|
518
|
+
ctx.addIssue({
|
|
519
|
+
code: "invalid_type",
|
|
520
|
+
expected: "custom",
|
|
521
|
+
message: "Value does not match any schema"
|
|
522
|
+
});
|
|
523
|
+
return;
|
|
500
524
|
}
|
|
501
525
|
successful.sort((a, b) => schemaPriority(a) - schemaPriority(b));
|
|
502
526
|
const best = successful[0];
|
|
503
|
-
|
|
527
|
+
if (!best.safeParse(val).success) {
|
|
528
|
+
ctx.addIssue({
|
|
529
|
+
expected: "custom",
|
|
530
|
+
code: "invalid_type",
|
|
531
|
+
message: "Value did not match the best schema"
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
}).meta({
|
|
535
|
+
description: "Value that matches exactly one of the possible schema types (TextValue, DateValue, DateRangeFieldValue). The best matching schema is chosen by priority."
|
|
504
536
|
});
|
|
505
537
|
}
|
|
506
538
|
var FieldUpdateValue = safeUnion([
|
|
@@ -519,24 +551,23 @@ var FieldUpdateValue = safeUnion([
|
|
|
519
551
|
DataFieldValue.describe("DataFieldValue"),
|
|
520
552
|
NameFieldUpdateValue.describe("NameFieldUpdateValue"),
|
|
521
553
|
HttpFieldUpdateValue.describe("HttpFieldUpdateValue"),
|
|
522
|
-
QueryParamReaderFieldUpdateValue.describe("QueryParamReaderFieldUpdateValue")
|
|
554
|
+
QueryParamReaderFieldUpdateValue.describe("QueryParamReaderFieldUpdateValue"),
|
|
555
|
+
CustomFieldValue.describe("CustomFieldValue"),
|
|
556
|
+
HiddenFieldValue.describe("HiddenFieldValue")
|
|
523
557
|
]);
|
|
524
558
|
|
|
525
|
-
// ../commons/src/events/FieldConfig.ts
|
|
526
|
-
var import_zod_openapi6 = require("zod-openapi");
|
|
527
|
-
|
|
528
559
|
// ../commons/src/uuid.ts
|
|
529
560
|
var import_uuid = require("uuid");
|
|
530
|
-
var
|
|
531
|
-
var UUID =
|
|
561
|
+
var z8 = __toESM(require("zod/v4"));
|
|
562
|
+
var UUID = z8.uuid().brand("UUID");
|
|
532
563
|
function getUUID() {
|
|
533
564
|
return (0, import_uuid.v4)();
|
|
534
565
|
}
|
|
535
566
|
|
|
536
567
|
// ../commons/src/events/serializers/user/serializer.ts
|
|
537
|
-
var
|
|
538
|
-
var SerializedUserField =
|
|
539
|
-
$userField:
|
|
568
|
+
var z9 = __toESM(require("zod/v4"));
|
|
569
|
+
var SerializedUserField = z9.object({
|
|
570
|
+
$userField: z9.enum([
|
|
540
571
|
"id",
|
|
541
572
|
"name",
|
|
542
573
|
"role",
|
|
@@ -545,11 +576,12 @@ var SerializedUserField = import_zod9.z.object({
|
|
|
545
576
|
"firstname",
|
|
546
577
|
"middlename",
|
|
547
578
|
"surname",
|
|
548
|
-
"
|
|
549
|
-
"
|
|
550
|
-
"primaryOfficeId"
|
|
579
|
+
"signature",
|
|
580
|
+
"avatar",
|
|
581
|
+
"primaryOfficeId",
|
|
582
|
+
"administrativeAreaId"
|
|
551
583
|
]),
|
|
552
|
-
$location:
|
|
584
|
+
$location: z9.string().optional()
|
|
553
585
|
});
|
|
554
586
|
function userSerializer(userField) {
|
|
555
587
|
return {
|
|
@@ -569,24 +601,23 @@ function userSerializer(userField) {
|
|
|
569
601
|
}
|
|
570
602
|
|
|
571
603
|
// ../commons/src/events/EventIndex.ts
|
|
572
|
-
var
|
|
604
|
+
var import_v4 = require("zod/v4");
|
|
573
605
|
|
|
574
606
|
// ../commons/src/events/EventMetadata.ts
|
|
575
|
-
var
|
|
607
|
+
var z14 = __toESM(require("zod/v4"));
|
|
576
608
|
|
|
577
609
|
// ../commons/src/events/ActionDocument.ts
|
|
578
|
-
var
|
|
579
|
-
var import_zod_openapi4 = require("zod-openapi");
|
|
610
|
+
var z12 = __toESM(require("zod/v4"));
|
|
580
611
|
|
|
581
612
|
// ../commons/src/events/CreatedAtLocation.ts
|
|
582
613
|
var CreatedAtLocation = UUID.nullish();
|
|
583
614
|
|
|
584
615
|
// ../commons/src/authentication.ts
|
|
585
616
|
var import_jwt_decode = __toESM(require("jwt-decode"));
|
|
586
|
-
var
|
|
617
|
+
var z11 = __toESM(require("zod/v4"));
|
|
587
618
|
|
|
588
619
|
// ../commons/src/scopes.ts
|
|
589
|
-
var
|
|
620
|
+
var z10 = __toESM(require("zod/v4"));
|
|
590
621
|
var SCOPES = {
|
|
591
622
|
// TODO v1.8 legacy scopes
|
|
592
623
|
BYPASSRATELIMIT: "bypassratelimit",
|
|
@@ -665,91 +696,91 @@ var SCOPES = {
|
|
|
665
696
|
// data seeding
|
|
666
697
|
USER_DATA_SEEDING: "user.data-seeding"
|
|
667
698
|
};
|
|
668
|
-
var LegacyScopes =
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
699
|
+
var LegacyScopes = z10.union([
|
|
700
|
+
z10.literal(SCOPES.BYPASSRATELIMIT),
|
|
701
|
+
z10.literal(SCOPES.REGISTER),
|
|
702
|
+
z10.literal(SCOPES.DEMO),
|
|
703
|
+
z10.literal(SCOPES.CONFIG)
|
|
673
704
|
]);
|
|
674
|
-
var IntegrationScopes =
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
705
|
+
var IntegrationScopes = z10.union([
|
|
706
|
+
z10.literal(SCOPES.WEBHOOK),
|
|
707
|
+
z10.literal(SCOPES.NATIONALID),
|
|
708
|
+
z10.literal(SCOPES.NOTIFICATION_API),
|
|
709
|
+
z10.literal(SCOPES.RECORDSEARCH)
|
|
679
710
|
]);
|
|
680
|
-
var InternalOperationsScopes =
|
|
681
|
-
|
|
682
|
-
|
|
711
|
+
var InternalOperationsScopes = z10.union([
|
|
712
|
+
z10.literal(SCOPES.RECORD_REINDEX),
|
|
713
|
+
z10.literal(SCOPES.RECORD_IMPORT)
|
|
683
714
|
]);
|
|
684
|
-
var DeclareScopes =
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
715
|
+
var DeclareScopes = z10.union([
|
|
716
|
+
z10.literal(SCOPES.RECORD_DECLARE_BIRTH),
|
|
717
|
+
z10.literal(SCOPES.RECORD_DECLARE_BIRTH_MY_JURISDICTION),
|
|
718
|
+
z10.literal(SCOPES.RECORD_DECLARE_DEATH),
|
|
719
|
+
z10.literal(SCOPES.RECORD_DECLARE_DEATH_MY_JURISDICTION),
|
|
720
|
+
z10.literal(SCOPES.RECORD_DECLARE_MARRIAGE),
|
|
721
|
+
z10.literal(SCOPES.RECORD_DECLARE_MARRIAGE_MY_JURISDICTION),
|
|
722
|
+
z10.literal(SCOPES.RECORD_SUBMIT_INCOMPLETE),
|
|
723
|
+
z10.literal(SCOPES.RECORD_SUBMIT_FOR_REVIEW)
|
|
693
724
|
]);
|
|
694
|
-
var UnassignScope =
|
|
695
|
-
var ValidateScopes =
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
725
|
+
var UnassignScope = z10.literal(SCOPES.RECORD_UNASSIGN_OTHERS);
|
|
726
|
+
var ValidateScopes = z10.union([
|
|
727
|
+
z10.literal(SCOPES.RECORD_SUBMIT_FOR_APPROVAL),
|
|
728
|
+
z10.literal(SCOPES.RECORD_SUBMIT_FOR_UPDATES),
|
|
729
|
+
z10.literal(SCOPES.RECORD_DECLARATION_EDIT),
|
|
730
|
+
z10.literal(SCOPES.RECORD_REVIEW_DUPLICATES),
|
|
731
|
+
z10.literal(SCOPES.RECORD_DECLARATION_ARCHIVE),
|
|
732
|
+
z10.literal(SCOPES.RECORD_DECLARATION_REINSTATE)
|
|
702
733
|
]);
|
|
703
|
-
var RegisterScope =
|
|
704
|
-
var CorrectionScopes =
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
734
|
+
var RegisterScope = z10.literal(SCOPES.RECORD_REGISTER);
|
|
735
|
+
var CorrectionScopes = z10.union([
|
|
736
|
+
z10.literal(SCOPES.RECORD_REGISTRATION_REQUEST_CORRECTION),
|
|
737
|
+
z10.literal(SCOPES.RECORD_REGISTRATION_CORRECT),
|
|
738
|
+
z10.literal(SCOPES.RECORD_CONFIRM_REGISTRATION),
|
|
739
|
+
z10.literal(SCOPES.RECORD_REJECT_REGISTRATION)
|
|
709
740
|
]);
|
|
710
|
-
var SearchScopes =
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
741
|
+
var SearchScopes = z10.union([
|
|
742
|
+
z10.literal(SCOPES.SEARCH_BIRTH_MY_JURISDICTION),
|
|
743
|
+
z10.literal(SCOPES.SEARCH_BIRTH),
|
|
744
|
+
z10.literal(SCOPES.SEARCH_DEATH_MY_JURISDICTION),
|
|
745
|
+
z10.literal(SCOPES.SEARCH_DEATH),
|
|
746
|
+
z10.literal(SCOPES.SEARCH_MARRIAGE_MY_JURISDICTION),
|
|
747
|
+
z10.literal(SCOPES.SEARCH_MARRIAGE)
|
|
717
748
|
]);
|
|
718
|
-
var AuditScopes =
|
|
719
|
-
var PerformanceScopes =
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
749
|
+
var AuditScopes = z10.literal(SCOPES.RECORD_READ);
|
|
750
|
+
var PerformanceScopes = z10.union([
|
|
751
|
+
z10.literal(SCOPES.PERFORMANCE_READ),
|
|
752
|
+
z10.literal(SCOPES.PERFORMANCE_READ_DASHBOARDS),
|
|
753
|
+
z10.literal(SCOPES.PERFORMANCE_EXPORT_VITAL_STATISTICS)
|
|
723
754
|
]);
|
|
724
|
-
var OrganisationScopes =
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
755
|
+
var OrganisationScopes = z10.union([
|
|
756
|
+
z10.literal(SCOPES.ORGANISATION_READ_LOCATIONS),
|
|
757
|
+
z10.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_OFFICE),
|
|
758
|
+
z10.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_JURISDICTION)
|
|
728
759
|
]);
|
|
729
|
-
var UserScopes =
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
760
|
+
var UserScopes = z10.union([
|
|
761
|
+
z10.literal(SCOPES.USER_READ),
|
|
762
|
+
z10.literal(SCOPES.USER_READ_MY_OFFICE),
|
|
763
|
+
z10.literal(SCOPES.USER_READ_MY_JURISDICTION),
|
|
764
|
+
z10.literal(SCOPES.USER_READ_ONLY_MY_AUDIT),
|
|
765
|
+
z10.literal(SCOPES.USER_CREATE),
|
|
766
|
+
z10.literal(SCOPES.USER_CREATE_MY_JURISDICTION),
|
|
767
|
+
z10.literal(SCOPES.USER_UPDATE),
|
|
768
|
+
z10.literal(SCOPES.USER_UPDATE_MY_JURISDICTION)
|
|
738
769
|
]);
|
|
739
|
-
var ConfigScope =
|
|
740
|
-
var DataSeedingScope =
|
|
741
|
-
var LiteralScopes =
|
|
770
|
+
var ConfigScope = z10.literal(SCOPES.CONFIG_UPDATE_ALL);
|
|
771
|
+
var DataSeedingScope = z10.literal(SCOPES.USER_DATA_SEEDING);
|
|
772
|
+
var LiteralScopes = z10.union([
|
|
742
773
|
LegacyScopes,
|
|
743
774
|
IntegrationScopes,
|
|
744
775
|
UnassignScope,
|
|
745
776
|
DeclareScopes,
|
|
746
777
|
ValidateScopes,
|
|
747
778
|
RegisterScope,
|
|
748
|
-
|
|
779
|
+
z10.literal(SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES),
|
|
749
780
|
CorrectionScopes,
|
|
750
781
|
SearchScopes,
|
|
751
782
|
AuditScopes,
|
|
752
|
-
|
|
783
|
+
z10.literal(SCOPES.PROFILE_ELECTRONIC_SIGNATURE),
|
|
753
784
|
PerformanceScopes,
|
|
754
785
|
OrganisationScopes,
|
|
755
786
|
UserScopes,
|
|
@@ -758,38 +789,38 @@ var LiteralScopes = import_zod10.z.union([
|
|
|
758
789
|
InternalOperationsScopes
|
|
759
790
|
]);
|
|
760
791
|
var rawConfigurableScopeRegex = /^([a-zA-Z][a-zA-Z0-9.-]*(?:\.[a-zA-Z0-9.-]+)*)\[((?:\w+=[\w.-]+(?:\|[\w.-]+)*)(?:,[\w]+=[\w.-]+(?:\|[\w.-]+)*)*)\]$/;
|
|
761
|
-
var rawConfigurableScope =
|
|
762
|
-
var CreateUserScope =
|
|
763
|
-
type:
|
|
764
|
-
options:
|
|
765
|
-
role:
|
|
792
|
+
var rawConfigurableScope = z10.string().regex(rawConfigurableScopeRegex);
|
|
793
|
+
var CreateUserScope = z10.object({
|
|
794
|
+
type: z10.literal("user.create"),
|
|
795
|
+
options: z10.object({
|
|
796
|
+
role: z10.array(z10.string())
|
|
766
797
|
})
|
|
767
798
|
});
|
|
768
|
-
var EditUserScope =
|
|
769
|
-
type:
|
|
770
|
-
options:
|
|
771
|
-
role:
|
|
799
|
+
var EditUserScope = z10.object({
|
|
800
|
+
type: z10.literal("user.edit"),
|
|
801
|
+
options: z10.object({
|
|
802
|
+
role: z10.array(z10.string())
|
|
772
803
|
})
|
|
773
804
|
});
|
|
774
|
-
var WorkqueueScope =
|
|
775
|
-
type:
|
|
776
|
-
options:
|
|
777
|
-
id:
|
|
805
|
+
var WorkqueueScope = z10.object({
|
|
806
|
+
type: z10.literal("workqueue"),
|
|
807
|
+
options: z10.object({
|
|
808
|
+
id: z10.array(z10.string())
|
|
778
809
|
})
|
|
779
810
|
});
|
|
780
|
-
var SearchScope =
|
|
781
|
-
type:
|
|
782
|
-
options:
|
|
783
|
-
event:
|
|
784
|
-
access:
|
|
811
|
+
var SearchScope = z10.object({
|
|
812
|
+
type: z10.literal("search"),
|
|
813
|
+
options: z10.object({
|
|
814
|
+
event: z10.array(z10.string()).length(1),
|
|
815
|
+
access: z10.array(z10.enum(["my-jurisdiction", "all"])).length(1)
|
|
785
816
|
})
|
|
786
817
|
});
|
|
787
|
-
var RecordScopeType =
|
|
818
|
+
var RecordScopeType = z10.enum([
|
|
788
819
|
"record.create",
|
|
789
820
|
"record.read",
|
|
790
821
|
"record.declare",
|
|
791
822
|
"record.notify",
|
|
792
|
-
"record.declared.
|
|
823
|
+
"record.declared.edit",
|
|
793
824
|
"record.declared.reject",
|
|
794
825
|
"record.declared.archive",
|
|
795
826
|
"record.declared.review-duplicates",
|
|
@@ -799,27 +830,40 @@ var RecordScopeType = import_zod10.z.enum([
|
|
|
799
830
|
"record.registered.correct",
|
|
800
831
|
"record.unassign-others"
|
|
801
832
|
]);
|
|
802
|
-
var RecordScope =
|
|
833
|
+
var RecordScope = z10.object({
|
|
803
834
|
type: RecordScopeType,
|
|
804
|
-
options:
|
|
805
|
-
event:
|
|
835
|
+
options: z10.object({
|
|
836
|
+
event: z10.array(z10.string()).describe("Event type, e.g. birth, death")
|
|
806
837
|
})
|
|
807
838
|
}).describe(
|
|
808
839
|
"Scopes used to check user's permission to perform actions on a record."
|
|
809
840
|
);
|
|
810
|
-
var
|
|
841
|
+
var CustomActionScope = z10.object({
|
|
842
|
+
type: z10.literal("record.custom-action"),
|
|
843
|
+
options: z10.object({
|
|
844
|
+
event: z10.array(z10.string()).describe("Allowed event type, e.g. birth, death"),
|
|
845
|
+
customActionType: z10.array(z10.string()).describe("Allowed custom action types")
|
|
846
|
+
})
|
|
847
|
+
});
|
|
848
|
+
var ConfigurableRawScopes = z10.discriminatedUnion("type", [
|
|
811
849
|
SearchScope,
|
|
812
850
|
CreateUserScope,
|
|
813
851
|
EditUserScope,
|
|
814
852
|
WorkqueueScope,
|
|
815
|
-
RecordScope
|
|
853
|
+
RecordScope,
|
|
854
|
+
CustomActionScope
|
|
855
|
+
]);
|
|
856
|
+
var ConfigurableActionScopes = z10.discriminatedUnion("type", [
|
|
857
|
+
// @TODO - Record scope holds non-action scopes as well e.g., `record.read`
|
|
858
|
+
RecordScope,
|
|
859
|
+
CustomActionScope
|
|
816
860
|
]);
|
|
817
861
|
var scopes = Object.values(SCOPES);
|
|
818
|
-
var ActionScopes =
|
|
862
|
+
var ActionScopes = z10.union([
|
|
819
863
|
DeclareScopes,
|
|
820
864
|
ValidateScopes,
|
|
821
865
|
RegisterScope,
|
|
822
|
-
|
|
866
|
+
z10.literal(SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES),
|
|
823
867
|
CorrectionScopes
|
|
824
868
|
]);
|
|
825
869
|
|
|
@@ -953,15 +997,14 @@ var DEFAULT_ROLES_DEFINITION = [
|
|
|
953
997
|
]
|
|
954
998
|
}
|
|
955
999
|
];
|
|
956
|
-
var TokenUserType =
|
|
957
|
-
var TokenWithBearer =
|
|
1000
|
+
var TokenUserType = z11.enum(["user", "system"]);
|
|
1001
|
+
var TokenWithBearer = z11.string().regex(/^Bearer\s/);
|
|
958
1002
|
|
|
959
1003
|
// ../commons/src/events/ActionDocument.ts
|
|
960
|
-
(
|
|
961
|
-
var ActionUpdate = import_zod12.z.record(import_zod12.z.string(), FieldUpdateValue).describe(
|
|
1004
|
+
var ActionUpdate = z12.record(z12.string(), FieldUpdateValue).describe(
|
|
962
1005
|
"Record of field-level changes made by an action. Supports partial updates and nullable values."
|
|
963
1006
|
);
|
|
964
|
-
var EventState =
|
|
1007
|
+
var EventState = z12.record(z12.string(), FieldValue).describe(
|
|
965
1008
|
"Aggregate representation of event data after all actions have been applied, with all updates consolidated and null values removed."
|
|
966
1009
|
);
|
|
967
1010
|
var ActionStatus = {
|
|
@@ -969,16 +1012,16 @@ var ActionStatus = {
|
|
|
969
1012
|
Accepted: "Accepted",
|
|
970
1013
|
Rejected: "Rejected"
|
|
971
1014
|
};
|
|
972
|
-
var ActionBase =
|
|
1015
|
+
var ActionBase = z12.object({
|
|
973
1016
|
id: UUID.describe("Unique identifier of the action."),
|
|
974
|
-
transactionId:
|
|
1017
|
+
transactionId: z12.string().describe("Unique identifier of the transaction."),
|
|
975
1018
|
createdByUserType: TokenUserType.describe(
|
|
976
1019
|
"Indicates whether the action was created by a human-user or by a system-user."
|
|
977
1020
|
),
|
|
978
|
-
createdAt:
|
|
979
|
-
createdBy:
|
|
980
|
-
createdByRole:
|
|
981
|
-
createdBySignature:
|
|
1021
|
+
createdAt: z12.string().datetime().describe("Timestamp indicating when the action was created."),
|
|
1022
|
+
createdBy: z12.string().describe("Identifier of the user who created the action."),
|
|
1023
|
+
createdByRole: z12.string().describe("Role of the user who created the action."),
|
|
1024
|
+
createdBySignature: z12.string().nullish().describe("Reference to the signature of the user who created the action."),
|
|
982
1025
|
createdAtLocation: CreatedAtLocation.describe(
|
|
983
1026
|
"Reference to the location of the user who created the action."
|
|
984
1027
|
),
|
|
@@ -986,7 +1029,7 @@ var ActionBase = import_zod12.z.object({
|
|
|
986
1029
|
"Declaration data defined by the ActionConfig. Supports partial updates."
|
|
987
1030
|
),
|
|
988
1031
|
annotation: ActionUpdate.optional().nullable().describe("Action-specific metadata used to annotate the event."),
|
|
989
|
-
status:
|
|
1032
|
+
status: z12.enum([
|
|
990
1033
|
ActionStatus.Requested,
|
|
991
1034
|
ActionStatus.Accepted,
|
|
992
1035
|
ActionStatus.Rejected
|
|
@@ -997,172 +1040,181 @@ var ActionBase = import_zod12.z.object({
|
|
|
997
1040
|
"Reference to the original action asynchronously accepted or rejected by a third-party integration."
|
|
998
1041
|
)
|
|
999
1042
|
});
|
|
1000
|
-
var AssignedAction = ActionBase.
|
|
1001
|
-
|
|
1002
|
-
type:
|
|
1003
|
-
assignedTo:
|
|
1043
|
+
var AssignedAction = ActionBase.extend(
|
|
1044
|
+
z12.object({
|
|
1045
|
+
type: z12.literal(ActionType.ASSIGN),
|
|
1046
|
+
assignedTo: z12.string().describe("Identifier of the user to whom the action is assigned.")
|
|
1004
1047
|
// TODO move into 'content' property
|
|
1005
|
-
})
|
|
1048
|
+
}).shape
|
|
1006
1049
|
);
|
|
1007
|
-
var UnassignedAction = ActionBase.
|
|
1008
|
-
|
|
1009
|
-
type:
|
|
1010
|
-
})
|
|
1050
|
+
var UnassignedAction = ActionBase.extend(
|
|
1051
|
+
z12.object({
|
|
1052
|
+
type: z12.literal(ActionType.UNASSIGN)
|
|
1053
|
+
}).shape
|
|
1011
1054
|
);
|
|
1012
|
-
var RegisterAction = ActionBase.
|
|
1013
|
-
|
|
1014
|
-
type:
|
|
1015
|
-
registrationNumber:
|
|
1055
|
+
var RegisterAction = ActionBase.extend(
|
|
1056
|
+
z12.object({
|
|
1057
|
+
type: z12.literal(ActionType.REGISTER),
|
|
1058
|
+
registrationNumber: z12.string().optional().describe(
|
|
1016
1059
|
"Registration number of the event. Always present for accepted registrations."
|
|
1017
1060
|
)
|
|
1018
1061
|
// TODO move into 'content' property
|
|
1019
|
-
})
|
|
1062
|
+
}).shape
|
|
1020
1063
|
);
|
|
1021
|
-
var DeclareAction = ActionBase.
|
|
1022
|
-
|
|
1023
|
-
type:
|
|
1024
|
-
})
|
|
1025
|
-
);
|
|
1026
|
-
var ValidateAction = ActionBase.merge(
|
|
1027
|
-
import_zod12.z.object({
|
|
1028
|
-
type: import_zod12.z.literal(ActionType.VALIDATE)
|
|
1029
|
-
})
|
|
1064
|
+
var DeclareAction = ActionBase.extend(
|
|
1065
|
+
z12.object({
|
|
1066
|
+
type: z12.literal(ActionType.DECLARE)
|
|
1067
|
+
}).shape
|
|
1030
1068
|
);
|
|
1031
|
-
var ReasonContent =
|
|
1032
|
-
reason:
|
|
1069
|
+
var ReasonContent = z12.object({
|
|
1070
|
+
reason: z12.string().min(1, { error: "Message cannot be empty" }).describe(
|
|
1033
1071
|
"Message describing the reason for rejecting or archiving the event."
|
|
1034
1072
|
)
|
|
1035
1073
|
});
|
|
1036
|
-
var RejectAction = ActionBase.
|
|
1037
|
-
|
|
1038
|
-
type:
|
|
1074
|
+
var RejectAction = ActionBase.extend(
|
|
1075
|
+
z12.object({
|
|
1076
|
+
type: z12.literal(ActionType.REJECT),
|
|
1039
1077
|
content: ReasonContent
|
|
1040
|
-
})
|
|
1078
|
+
}).shape
|
|
1041
1079
|
);
|
|
1042
|
-
var PotentialDuplicate =
|
|
1080
|
+
var PotentialDuplicate = z12.object({
|
|
1043
1081
|
id: UUID,
|
|
1044
|
-
trackingId:
|
|
1082
|
+
trackingId: z12.string()
|
|
1045
1083
|
});
|
|
1046
|
-
var DuplicateDetectedAction = ActionBase.
|
|
1047
|
-
|
|
1048
|
-
type:
|
|
1049
|
-
content:
|
|
1050
|
-
duplicates:
|
|
1084
|
+
var DuplicateDetectedAction = ActionBase.extend(
|
|
1085
|
+
z12.object({
|
|
1086
|
+
type: z12.literal(ActionType.DUPLICATE_DETECTED),
|
|
1087
|
+
content: z12.object({
|
|
1088
|
+
duplicates: z12.array(PotentialDuplicate)
|
|
1051
1089
|
})
|
|
1052
|
-
})
|
|
1090
|
+
}).shape
|
|
1053
1091
|
);
|
|
1054
|
-
var MarkNotDuplicateAction = ActionBase.
|
|
1055
|
-
|
|
1056
|
-
type:
|
|
1057
|
-
})
|
|
1092
|
+
var MarkNotDuplicateAction = ActionBase.extend(
|
|
1093
|
+
z12.object({
|
|
1094
|
+
type: z12.literal(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
1095
|
+
}).shape
|
|
1058
1096
|
);
|
|
1059
|
-
var MarkAsDuplicateAction = ActionBase.
|
|
1060
|
-
|
|
1061
|
-
type:
|
|
1062
|
-
content:
|
|
1097
|
+
var MarkAsDuplicateAction = ActionBase.extend(
|
|
1098
|
+
z12.object({
|
|
1099
|
+
type: z12.literal(ActionType.MARK_AS_DUPLICATE),
|
|
1100
|
+
content: z12.object({
|
|
1063
1101
|
duplicateOf: UUID
|
|
1064
1102
|
}).optional()
|
|
1065
|
-
})
|
|
1103
|
+
}).shape
|
|
1066
1104
|
);
|
|
1067
|
-
var ArchiveAction = ActionBase.
|
|
1068
|
-
|
|
1069
|
-
type:
|
|
1105
|
+
var ArchiveAction = ActionBase.extend(
|
|
1106
|
+
z12.object({
|
|
1107
|
+
type: z12.literal(ActionType.ARCHIVE),
|
|
1070
1108
|
content: ReasonContent
|
|
1071
|
-
})
|
|
1109
|
+
}).shape
|
|
1072
1110
|
);
|
|
1073
|
-
var CreatedAction = ActionBase.
|
|
1074
|
-
|
|
1075
|
-
type:
|
|
1076
|
-
})
|
|
1111
|
+
var CreatedAction = ActionBase.extend(
|
|
1112
|
+
z12.object({
|
|
1113
|
+
type: z12.literal(ActionType.CREATE)
|
|
1114
|
+
}).shape
|
|
1077
1115
|
);
|
|
1078
|
-
var NotifiedAction = ActionBase.
|
|
1079
|
-
|
|
1080
|
-
type:
|
|
1081
|
-
})
|
|
1116
|
+
var NotifiedAction = ActionBase.extend(
|
|
1117
|
+
z12.object({
|
|
1118
|
+
type: z12.literal(ActionType.NOTIFY)
|
|
1119
|
+
}).shape
|
|
1120
|
+
);
|
|
1121
|
+
var EditAction = ActionBase.extend(
|
|
1122
|
+
z12.object({
|
|
1123
|
+
type: z12.literal(ActionType.EDIT),
|
|
1124
|
+
content: z12.object({
|
|
1125
|
+
comment: z12.string().describe("Comment for the edit action.").optional()
|
|
1126
|
+
})
|
|
1127
|
+
}).shape
|
|
1082
1128
|
);
|
|
1083
|
-
var PrintContent =
|
|
1084
|
-
templateId:
|
|
1129
|
+
var PrintContent = z12.object({
|
|
1130
|
+
templateId: z12.string().optional()
|
|
1085
1131
|
});
|
|
1086
|
-
var PrintCertificateAction = ActionBase.
|
|
1087
|
-
|
|
1088
|
-
type:
|
|
1132
|
+
var PrintCertificateAction = ActionBase.extend(
|
|
1133
|
+
z12.object({
|
|
1134
|
+
type: z12.literal(ActionType.PRINT_CERTIFICATE),
|
|
1089
1135
|
content: PrintContent.optional().nullable()
|
|
1090
|
-
})
|
|
1136
|
+
}).shape
|
|
1091
1137
|
);
|
|
1092
|
-
var RequestedCorrectionAction = ActionBase.
|
|
1093
|
-
|
|
1094
|
-
type:
|
|
1095
|
-
})
|
|
1138
|
+
var RequestedCorrectionAction = ActionBase.extend(
|
|
1139
|
+
z12.object({
|
|
1140
|
+
type: z12.literal(ActionType.REQUEST_CORRECTION)
|
|
1141
|
+
}).shape
|
|
1096
1142
|
);
|
|
1097
|
-
var ApprovedCorrectionAction = ActionBase.
|
|
1098
|
-
|
|
1099
|
-
type:
|
|
1100
|
-
requestId:
|
|
1143
|
+
var ApprovedCorrectionAction = ActionBase.extend(
|
|
1144
|
+
z12.object({
|
|
1145
|
+
type: z12.literal(ActionType.APPROVE_CORRECTION),
|
|
1146
|
+
requestId: z12.string()
|
|
1101
1147
|
// TODO move into 'content' property
|
|
1102
|
-
})
|
|
1148
|
+
}).shape
|
|
1103
1149
|
);
|
|
1104
|
-
var RejectedCorrectionAction = ActionBase.
|
|
1105
|
-
|
|
1106
|
-
type:
|
|
1107
|
-
requestId:
|
|
1150
|
+
var RejectedCorrectionAction = ActionBase.extend(
|
|
1151
|
+
z12.object({
|
|
1152
|
+
type: z12.literal(ActionType.REJECT_CORRECTION),
|
|
1153
|
+
requestId: z12.string(),
|
|
1108
1154
|
// TODO move into 'content' property
|
|
1109
1155
|
content: ReasonContent
|
|
1110
|
-
})
|
|
1156
|
+
}).shape
|
|
1157
|
+
);
|
|
1158
|
+
var ReadAction = ActionBase.extend(
|
|
1159
|
+
z12.object({
|
|
1160
|
+
type: z12.literal(ActionType.READ)
|
|
1161
|
+
}).shape
|
|
1111
1162
|
);
|
|
1112
|
-
var
|
|
1113
|
-
|
|
1114
|
-
type:
|
|
1163
|
+
var CustomAction = ActionBase.merge(
|
|
1164
|
+
z12.object({
|
|
1165
|
+
type: z12.literal(ActionType.CUSTOM),
|
|
1166
|
+
customActionType: z12.string()
|
|
1115
1167
|
})
|
|
1116
1168
|
);
|
|
1117
|
-
var ActionDocument =
|
|
1118
|
-
CreatedAction.
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1169
|
+
var ActionDocument = z12.discriminatedUnion("type", [
|
|
1170
|
+
CreatedAction.meta({ id: "CreatedAction" }),
|
|
1171
|
+
RejectAction.meta({ id: "RejectAction" }),
|
|
1172
|
+
DuplicateDetectedAction.meta({ id: "DuplicateDetectedAction" }),
|
|
1173
|
+
MarkNotDuplicateAction.meta({ id: "MarkNotDuplicateAction" }),
|
|
1174
|
+
MarkAsDuplicateAction.meta({ id: "MarkAsDuplicateAction" }),
|
|
1175
|
+
ArchiveAction.meta({ id: "ArchiveAction" }),
|
|
1176
|
+
NotifiedAction.meta({ id: "NotifiedAction" }),
|
|
1177
|
+
RegisterAction.meta({ id: "RegisterAction" }),
|
|
1178
|
+
DeclareAction.meta({ id: "DeclareAction" }),
|
|
1179
|
+
AssignedAction.meta({ id: "AssignedAction" }),
|
|
1180
|
+
RequestedCorrectionAction.meta({ id: "RequestedCorrectionAction" }),
|
|
1181
|
+
ApprovedCorrectionAction.meta({ id: "ApprovedCorrectionAction" }),
|
|
1182
|
+
RejectedCorrectionAction.meta({ id: "RejectedCorrectionAction" }),
|
|
1183
|
+
UnassignedAction.meta({ id: "UnassignedAction" }),
|
|
1184
|
+
PrintCertificateAction.meta({ id: "PrintCertificateAction" }),
|
|
1185
|
+
ReadAction.meta({ id: "ReadAction" }),
|
|
1186
|
+
EditAction.meta({ id: "EditAction" }),
|
|
1187
|
+
CustomAction.meta({ id: "CustomAction" })
|
|
1188
|
+
]).meta({
|
|
1189
|
+
id: "ActionDocument"
|
|
1137
1190
|
});
|
|
1138
1191
|
var AsyncRejectActionDocument = ActionBase.omit({
|
|
1139
1192
|
declaration: true,
|
|
1140
1193
|
annotation: true
|
|
1141
|
-
}).
|
|
1142
|
-
|
|
1143
|
-
type:
|
|
1144
|
-
status:
|
|
1145
|
-
})
|
|
1194
|
+
}).extend(
|
|
1195
|
+
z12.object({
|
|
1196
|
+
type: z12.enum(ConfirmableActions),
|
|
1197
|
+
status: z12.literal(ActionStatus.Rejected)
|
|
1198
|
+
}).shape
|
|
1146
1199
|
);
|
|
1147
|
-
var Action =
|
|
1200
|
+
var Action = z12.union([ActionDocument, AsyncRejectActionDocument]);
|
|
1148
1201
|
|
|
1149
|
-
// ../commons/src/events/
|
|
1150
|
-
var
|
|
1151
|
-
"CREATED",
|
|
1152
|
-
"NOTIFIED",
|
|
1153
|
-
"DECLARED",
|
|
1154
|
-
"VALIDATED",
|
|
1155
|
-
"REGISTERED",
|
|
1156
|
-
"ARCHIVED"
|
|
1157
|
-
]);
|
|
1202
|
+
// ../commons/src/events/Flag.ts
|
|
1203
|
+
var z13 = __toESM(require("zod/v4"));
|
|
1158
1204
|
var InherentFlags = {
|
|
1159
|
-
PENDING_CERTIFICATION: "pending-certification",
|
|
1160
1205
|
INCOMPLETE: "incomplete",
|
|
1161
1206
|
REJECTED: "rejected",
|
|
1162
1207
|
CORRECTION_REQUESTED: "correction-requested",
|
|
1163
|
-
POTENTIAL_DUPLICATE: "potential-duplicate"
|
|
1208
|
+
POTENTIAL_DUPLICATE: "potential-duplicate",
|
|
1209
|
+
/**
|
|
1210
|
+
* This flag is set by the Edit-action and removed after the declaration or registration.
|
|
1211
|
+
* A record should never stay with the EDIT_IN_PROGRESS flag, since it should always be declared or registered right after.
|
|
1212
|
+
*
|
|
1213
|
+
* We only use this flag to determine that a NOTIFY, DECLARE or REGISTER action is allowed next.
|
|
1214
|
+
*/
|
|
1215
|
+
EDIT_IN_PROGRESS: "edit-in-progress"
|
|
1164
1216
|
};
|
|
1165
|
-
var ActionFlag =
|
|
1217
|
+
var ActionFlag = z13.string().regex(
|
|
1166
1218
|
new RegExp(
|
|
1167
1219
|
`^(${Object.values(ActionType).join("|").toLowerCase()}):(${Object.values(
|
|
1168
1220
|
ActionStatus
|
|
@@ -1170,59 +1222,90 @@ var ActionFlag = import_zod13.z.string().regex(
|
|
|
1170
1222
|
),
|
|
1171
1223
|
"Flag must be in the format ActionType:ActionStatus (lowerCase)"
|
|
1172
1224
|
);
|
|
1173
|
-
var
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1225
|
+
var CustomFlag = z13.string().refine((val) => !Object.values(InherentFlags).includes(val), {
|
|
1226
|
+
message: `Custom flag cannot be one of the inherent flags: ${Object.values(
|
|
1227
|
+
InherentFlags
|
|
1228
|
+
).join(", ")}`
|
|
1229
|
+
}).refine((val) => !ActionFlag.safeParse(val).success, {
|
|
1230
|
+
message: "Custom flag cannot match the ActionFlag pattern (ActionType:ActionStatus)."
|
|
1231
|
+
}).describe("Custom flag identifier defined by the country config.");
|
|
1232
|
+
var Flag = ActionFlag.or(z13.enum(InherentFlags)).or(CustomFlag);
|
|
1233
|
+
var FlagConfig = z13.object({
|
|
1234
|
+
id: CustomFlag,
|
|
1235
|
+
requiresAction: z13.boolean().describe(
|
|
1236
|
+
"Indicates if this flag expects an action to be performed to be cleared."
|
|
1237
|
+
),
|
|
1238
|
+
label: TranslationConfig.describe("Human readable label of the flag.")
|
|
1239
|
+
});
|
|
1240
|
+
var ActionFlagConfig = z13.object({
|
|
1241
|
+
id: Flag,
|
|
1242
|
+
operation: z13.enum(["add", "remove"]).describe("Operation to perform on the flag."),
|
|
1243
|
+
conditional: Conditional.optional().describe(
|
|
1244
|
+
"When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
|
|
1245
|
+
)
|
|
1246
|
+
});
|
|
1247
|
+
|
|
1248
|
+
// ../commons/src/events/EventMetadata.ts
|
|
1249
|
+
var EventStatus = z14.enum([
|
|
1250
|
+
"CREATED",
|
|
1251
|
+
"NOTIFIED",
|
|
1252
|
+
"DECLARED",
|
|
1253
|
+
"REGISTERED",
|
|
1254
|
+
"ARCHIVED"
|
|
1255
|
+
]);
|
|
1256
|
+
var ZodDate = z14.iso.date();
|
|
1257
|
+
var ActionCreationMetadata = z14.object({
|
|
1258
|
+
createdAt: z14.iso.datetime().describe("The timestamp when the action request was created."),
|
|
1259
|
+
createdBy: z14.string().describe("ID of the user who created the action request."),
|
|
1178
1260
|
createdAtLocation: CreatedAtLocation.describe(
|
|
1179
1261
|
"Location of the user who created the action request."
|
|
1180
1262
|
),
|
|
1181
|
-
createdByUserType:
|
|
1182
|
-
acceptedAt:
|
|
1183
|
-
createdByRole:
|
|
1184
|
-
createdBySignature:
|
|
1263
|
+
createdByUserType: z14.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1264
|
+
acceptedAt: z14.iso.datetime().describe("Timestamp when the action request was accepted."),
|
|
1265
|
+
createdByRole: z14.string().describe("Role of the user at the time of action request creation."),
|
|
1266
|
+
createdBySignature: z14.string().nullish().describe("Signature of the user who created the action request.")
|
|
1185
1267
|
});
|
|
1186
1268
|
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
1187
|
-
registrationNumber:
|
|
1269
|
+
registrationNumber: z14.string().describe(
|
|
1188
1270
|
"Registration number of the event. Always present for accepted registrations."
|
|
1189
1271
|
)
|
|
1190
1272
|
});
|
|
1191
|
-
var LegalStatuses =
|
|
1273
|
+
var LegalStatuses = z14.object({
|
|
1192
1274
|
[EventStatus.enum.DECLARED]: ActionCreationMetadata.nullish(),
|
|
1193
1275
|
[EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish()
|
|
1194
1276
|
});
|
|
1195
|
-
var EventMetadata =
|
|
1277
|
+
var EventMetadata = z14.object({
|
|
1196
1278
|
id: UUID,
|
|
1197
|
-
type:
|
|
1279
|
+
type: z14.string().describe("The type of event, such as birth, death, or marriage."),
|
|
1198
1280
|
status: EventStatus,
|
|
1199
1281
|
legalStatuses: LegalStatuses.describe(
|
|
1200
1282
|
"Metadata related to the legal registration of the event, such as who registered it and when."
|
|
1201
1283
|
),
|
|
1202
|
-
createdAt:
|
|
1284
|
+
createdAt: z14.iso.datetime().describe("The timestamp when the event was first created and saved."),
|
|
1203
1285
|
dateOfEvent: ZodDate.nullish(),
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1286
|
+
placeOfEvent: CreatedAtLocation,
|
|
1287
|
+
createdBy: z14.string().describe("ID of the user who created the event."),
|
|
1288
|
+
createdByUserType: z14.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1289
|
+
updatedByUserRole: z14.string().describe("Role of the user who last changed the status."),
|
|
1207
1290
|
createdAtLocation: CreatedAtLocation.describe(
|
|
1208
1291
|
"Location of the user who created the event."
|
|
1209
1292
|
),
|
|
1210
|
-
createdBySignature:
|
|
1293
|
+
createdBySignature: z14.string().nullish().describe("Signature of the user who created the event."),
|
|
1211
1294
|
updatedAtLocation: UUID.nullish().describe(
|
|
1212
1295
|
"Location of the user who last changed the status."
|
|
1213
1296
|
),
|
|
1214
|
-
updatedAt:
|
|
1297
|
+
updatedAt: z14.iso.datetime().describe(
|
|
1215
1298
|
"Timestamp of the most recent *accepted* status change. Possibly 3rd party update, if action is validation asynchronously."
|
|
1216
1299
|
),
|
|
1217
|
-
assignedTo:
|
|
1218
|
-
updatedBy:
|
|
1219
|
-
trackingId:
|
|
1300
|
+
assignedTo: z14.string().nullish().describe("ID of the user currently assigned to the event."),
|
|
1301
|
+
updatedBy: z14.string().nullish().describe("ID of the user who last changed the status."),
|
|
1302
|
+
trackingId: z14.string().describe(
|
|
1220
1303
|
"System-generated tracking ID used by informants or registrars to look up the event."
|
|
1221
1304
|
),
|
|
1222
|
-
potentialDuplicates:
|
|
1305
|
+
potentialDuplicates: z14.array(PotentialDuplicate).describe(
|
|
1223
1306
|
"List of event IDs and their tracking IDs that this event could be a duplicate of."
|
|
1224
1307
|
),
|
|
1225
|
-
flags:
|
|
1308
|
+
flags: z14.array(Flag)
|
|
1226
1309
|
});
|
|
1227
1310
|
var EventMetadataKeysArray = [
|
|
1228
1311
|
"id",
|
|
@@ -1230,6 +1313,7 @@ var EventMetadataKeysArray = [
|
|
|
1230
1313
|
"status",
|
|
1231
1314
|
"createdAt",
|
|
1232
1315
|
"dateOfEvent",
|
|
1316
|
+
"placeOfEvent",
|
|
1233
1317
|
"createdBy",
|
|
1234
1318
|
"createdByUserType",
|
|
1235
1319
|
"updatedByUserRole",
|
|
@@ -1242,130 +1326,124 @@ var EventMetadataKeysArray = [
|
|
|
1242
1326
|
"legalStatuses",
|
|
1243
1327
|
"flags"
|
|
1244
1328
|
];
|
|
1245
|
-
var EventMetadataKeys =
|
|
1329
|
+
var EventMetadataKeys = z14.enum(EventMetadataKeysArray);
|
|
1246
1330
|
|
|
1247
1331
|
// ../commons/src/events/EventIndex.ts
|
|
1248
|
-
var import_zod_openapi5 = require("zod-openapi");
|
|
1249
|
-
(0, import_zod_openapi5.extendZodWithOpenApi)(import_zod14.z);
|
|
1250
1332
|
var EventIndex = EventMetadata.extend({
|
|
1251
1333
|
declaration: EventState
|
|
1252
|
-
}).
|
|
1253
|
-
|
|
1334
|
+
}).meta({
|
|
1335
|
+
id: "EventIndex"
|
|
1254
1336
|
});
|
|
1255
|
-
var EventSearchIndex =
|
|
1256
|
-
|
|
1257
|
-
type:
|
|
1337
|
+
var EventSearchIndex = import_v4.z.record(import_v4.z.string(), import_v4.z.any()).and(
|
|
1338
|
+
import_v4.z.object({
|
|
1339
|
+
type: import_v4.z.string()
|
|
1258
1340
|
// Ensures "type" (event-id) exists and is a string
|
|
1259
1341
|
})
|
|
1260
|
-
).
|
|
1261
|
-
|
|
1342
|
+
).meta({
|
|
1343
|
+
id: "EventSearchIndex"
|
|
1262
1344
|
});
|
|
1263
|
-
var Fuzzy =
|
|
1264
|
-
|
|
1345
|
+
var Fuzzy = import_v4.z.object({ type: import_v4.z.literal("fuzzy"), term: import_v4.z.string() }).meta({
|
|
1346
|
+
id: "Fuzzy"
|
|
1265
1347
|
});
|
|
1266
|
-
var Exact =
|
|
1267
|
-
|
|
1348
|
+
var Exact = import_v4.z.object({ type: import_v4.z.literal("exact"), term: import_v4.z.string() }).meta({
|
|
1349
|
+
id: "Exact"
|
|
1268
1350
|
});
|
|
1269
|
-
var ExactStatus =
|
|
1270
|
-
type:
|
|
1351
|
+
var ExactStatus = import_v4.z.object({
|
|
1352
|
+
type: import_v4.z.literal("exact"),
|
|
1271
1353
|
term: EventStatus
|
|
1272
|
-
}).
|
|
1273
|
-
|
|
1354
|
+
}).meta({
|
|
1355
|
+
id: "ExactStatus"
|
|
1274
1356
|
});
|
|
1275
|
-
var ExactUserType =
|
|
1276
|
-
type:
|
|
1357
|
+
var ExactUserType = import_v4.z.object({
|
|
1358
|
+
type: import_v4.z.literal("exact"),
|
|
1277
1359
|
term: TokenUserType
|
|
1278
|
-
}).
|
|
1279
|
-
|
|
1280
|
-
});
|
|
1281
|
-
var AnyOf =
|
|
1282
|
-
type:
|
|
1283
|
-
terms:
|
|
1284
|
-
}).
|
|
1285
|
-
|
|
1286
|
-
});
|
|
1287
|
-
var AnyOfStatus =
|
|
1288
|
-
type:
|
|
1289
|
-
terms:
|
|
1290
|
-
}).
|
|
1291
|
-
|
|
1292
|
-
});
|
|
1293
|
-
var Range =
|
|
1294
|
-
type:
|
|
1295
|
-
gte:
|
|
1296
|
-
lte:
|
|
1297
|
-
}).
|
|
1298
|
-
|
|
1299
|
-
});
|
|
1300
|
-
var ContainsFlags =
|
|
1301
|
-
anyOf:
|
|
1302
|
-
noneOf:
|
|
1303
|
-
}).
|
|
1304
|
-
|
|
1305
|
-
});
|
|
1306
|
-
var Within =
|
|
1307
|
-
|
|
1308
|
-
});
|
|
1309
|
-
var RangeDate =
|
|
1310
|
-
type:
|
|
1311
|
-
gte:
|
|
1312
|
-
lte:
|
|
1313
|
-
}).
|
|
1360
|
+
}).meta({
|
|
1361
|
+
id: "ExactUserType"
|
|
1362
|
+
});
|
|
1363
|
+
var AnyOf = import_v4.z.object({
|
|
1364
|
+
type: import_v4.z.literal("anyOf"),
|
|
1365
|
+
terms: import_v4.z.array(import_v4.z.string())
|
|
1366
|
+
}).meta({
|
|
1367
|
+
id: "AnyOf"
|
|
1368
|
+
});
|
|
1369
|
+
var AnyOfStatus = import_v4.z.object({
|
|
1370
|
+
type: import_v4.z.literal("anyOf"),
|
|
1371
|
+
terms: import_v4.z.array(EventStatus)
|
|
1372
|
+
}).meta({
|
|
1373
|
+
id: "AnyOfStatus"
|
|
1374
|
+
});
|
|
1375
|
+
var Range = import_v4.z.object({
|
|
1376
|
+
type: import_v4.z.literal("range"),
|
|
1377
|
+
gte: import_v4.z.string(),
|
|
1378
|
+
lte: import_v4.z.string()
|
|
1379
|
+
}).meta({
|
|
1380
|
+
id: "Range"
|
|
1381
|
+
});
|
|
1382
|
+
var ContainsFlags = import_v4.z.object({
|
|
1383
|
+
anyOf: import_v4.z.array(Flag).optional(),
|
|
1384
|
+
noneOf: import_v4.z.array(Flag).optional()
|
|
1385
|
+
}).meta({
|
|
1386
|
+
id: "ContainsFlags"
|
|
1387
|
+
});
|
|
1388
|
+
var Within = import_v4.z.object({ type: import_v4.z.literal("within"), location: import_v4.z.string() }).meta({
|
|
1389
|
+
id: "Within"
|
|
1390
|
+
});
|
|
1391
|
+
var RangeDate = import_v4.z.object({
|
|
1392
|
+
type: import_v4.z.literal("range"),
|
|
1393
|
+
gte: import_v4.z.iso.date().or(import_v4.z.iso.datetime()),
|
|
1394
|
+
lte: import_v4.z.iso.date().or(import_v4.z.iso.datetime())
|
|
1395
|
+
}).meta({ id: "RangeDate" });
|
|
1314
1396
|
var ExactDate = Exact.extend({
|
|
1315
|
-
term:
|
|
1316
|
-
}).
|
|
1317
|
-
|
|
1397
|
+
term: import_v4.z.iso.date().or(import_v4.z.iso.datetime())
|
|
1398
|
+
}).meta({
|
|
1399
|
+
id: "ExactDate"
|
|
1318
1400
|
});
|
|
1319
|
-
var TimePeriod =
|
|
1320
|
-
type:
|
|
1401
|
+
var TimePeriod = import_v4.z.object({
|
|
1402
|
+
type: import_v4.z.literal("timePeriod"),
|
|
1321
1403
|
term: SelectDateRangeValue
|
|
1322
|
-
}).
|
|
1323
|
-
|
|
1404
|
+
}).meta({
|
|
1405
|
+
id: "TimePeriod"
|
|
1324
1406
|
});
|
|
1325
|
-
var DateCondition =
|
|
1326
|
-
|
|
1407
|
+
var DateCondition = import_v4.z.union([ExactDate, RangeDate, TimePeriod]).meta({
|
|
1408
|
+
id: "DateCondition"
|
|
1327
1409
|
});
|
|
1328
|
-
var QueryInput =
|
|
1329
|
-
() =>
|
|
1330
|
-
|
|
1331
|
-
|
|
1410
|
+
var QueryInput = import_v4.z.lazy(
|
|
1411
|
+
() => import_v4.z.union([
|
|
1412
|
+
import_v4.z.discriminatedUnion("type", [Fuzzy, Exact, Range, Within, AnyOf]),
|
|
1413
|
+
import_v4.z.record(import_v4.z.string(), QueryInput)
|
|
1332
1414
|
])
|
|
1333
|
-
).
|
|
1334
|
-
|
|
1335
|
-
});
|
|
1336
|
-
var QueryExpression =
|
|
1337
|
-
id:
|
|
1338
|
-
eventType:
|
|
1339
|
-
status:
|
|
1340
|
-
createdAt:
|
|
1341
|
-
updatedAt:
|
|
1342
|
-
"legalStatuses.REGISTERED.acceptedAt":
|
|
1343
|
-
"legalStatuses.DECLARED.createdAtLocation":
|
|
1344
|
-
|
|
1345
|
-
),
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
),
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
createdBy: import_zod14.z.optional(Exact),
|
|
1355
|
-
updatedBy: import_zod14.z.optional(Exact),
|
|
1356
|
-
trackingId: import_zod14.z.optional(Exact),
|
|
1357
|
-
flags: import_zod14.z.optional(ContainsFlags),
|
|
1415
|
+
).meta({
|
|
1416
|
+
id: "QueryInput"
|
|
1417
|
+
});
|
|
1418
|
+
var QueryExpression = import_v4.z.object({
|
|
1419
|
+
id: import_v4.z.optional(import_v4.z.string()),
|
|
1420
|
+
eventType: import_v4.z.string(),
|
|
1421
|
+
status: import_v4.z.optional(import_v4.z.union([AnyOfStatus, ExactStatus])),
|
|
1422
|
+
createdAt: import_v4.z.optional(DateCondition),
|
|
1423
|
+
updatedAt: import_v4.z.optional(DateCondition),
|
|
1424
|
+
"legalStatuses.REGISTERED.acceptedAt": import_v4.z.optional(DateCondition),
|
|
1425
|
+
"legalStatuses.DECLARED.createdAtLocation": import_v4.z.optional(Within).nullable(),
|
|
1426
|
+
"legalStatuses.REGISTERED.createdAtLocation": import_v4.z.optional(Within).nullable(),
|
|
1427
|
+
"legalStatuses.REGISTERED.registrationNumber": import_v4.z.optional(Exact),
|
|
1428
|
+
createdAtLocation: import_v4.z.optional(Within),
|
|
1429
|
+
updatedAtLocation: import_v4.z.optional(Within),
|
|
1430
|
+
assignedTo: import_v4.z.optional(Exact),
|
|
1431
|
+
createdByUserType: import_v4.z.optional(ExactUserType),
|
|
1432
|
+
createdBy: import_v4.z.optional(Exact),
|
|
1433
|
+
updatedBy: import_v4.z.optional(Exact),
|
|
1434
|
+
trackingId: import_v4.z.optional(Exact),
|
|
1435
|
+
flags: import_v4.z.optional(ContainsFlags),
|
|
1358
1436
|
// @todo: The type for this comes out as "any"
|
|
1359
1437
|
data: QueryInput
|
|
1360
1438
|
}).partial().refine((obj) => Object.values(obj).some((val) => val !== void 0), {
|
|
1361
|
-
|
|
1362
|
-
}).
|
|
1363
|
-
|
|
1364
|
-
});
|
|
1365
|
-
var QueryType =
|
|
1366
|
-
() =>
|
|
1367
|
-
type:
|
|
1368
|
-
clauses:
|
|
1439
|
+
error: "At least one query field must be specified."
|
|
1440
|
+
}).meta({
|
|
1441
|
+
id: "QueryExpression"
|
|
1442
|
+
});
|
|
1443
|
+
var QueryType = import_v4.z.lazy(
|
|
1444
|
+
() => import_v4.z.object({
|
|
1445
|
+
type: import_v4.z.literal("and").or(import_v4.z.literal("or")).meta({ default: "and" }),
|
|
1446
|
+
clauses: import_v4.z.array(import_v4.z.union([QueryExpression, QueryType])).nonempty("At least one clause is required.").meta({
|
|
1369
1447
|
default: [
|
|
1370
1448
|
{
|
|
1371
1449
|
eventType: TENNIS_CLUB_MEMBERSHIP,
|
|
@@ -1383,8 +1461,8 @@ var QueryType = import_zod14.z.lazy(
|
|
|
1383
1461
|
]
|
|
1384
1462
|
})
|
|
1385
1463
|
})
|
|
1386
|
-
).
|
|
1387
|
-
|
|
1464
|
+
).meta({
|
|
1465
|
+
id: "QueryType"
|
|
1388
1466
|
});
|
|
1389
1467
|
function parseStringifiedQueryField(val) {
|
|
1390
1468
|
if (typeof val === "string") {
|
|
@@ -1392,8 +1470,8 @@ function parseStringifiedQueryField(val) {
|
|
|
1392
1470
|
}
|
|
1393
1471
|
return val;
|
|
1394
1472
|
}
|
|
1395
|
-
var SearchQuery =
|
|
1396
|
-
query:
|
|
1473
|
+
var SearchQuery = import_v4.z.object({
|
|
1474
|
+
query: import_v4.z.preprocess(parseStringifiedQueryField, QueryType).meta({
|
|
1397
1475
|
default: {
|
|
1398
1476
|
type: "and",
|
|
1399
1477
|
clauses: [
|
|
@@ -1413,207 +1491,193 @@ var SearchQuery = import_zod14.z.object({
|
|
|
1413
1491
|
]
|
|
1414
1492
|
}
|
|
1415
1493
|
}),
|
|
1416
|
-
limit:
|
|
1417
|
-
offset:
|
|
1418
|
-
sort:
|
|
1494
|
+
limit: import_v4.z.number().optional().default(100),
|
|
1495
|
+
offset: import_v4.z.number().optional().default(0),
|
|
1496
|
+
sort: import_v4.z.preprocess(
|
|
1419
1497
|
parseStringifiedQueryField,
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
field:
|
|
1423
|
-
direction:
|
|
1498
|
+
import_v4.z.array(
|
|
1499
|
+
import_v4.z.object({
|
|
1500
|
+
field: import_v4.z.string(),
|
|
1501
|
+
direction: import_v4.z.enum(["asc", "desc"]).default("asc")
|
|
1424
1502
|
})
|
|
1425
1503
|
)
|
|
1426
1504
|
).optional()
|
|
1427
|
-
}).
|
|
1428
|
-
|
|
1505
|
+
}).meta({
|
|
1506
|
+
id: "SearchQuery"
|
|
1429
1507
|
});
|
|
1430
1508
|
|
|
1431
1509
|
// ../commons/src/events/serializers/date/serializer.ts
|
|
1432
|
-
var
|
|
1433
|
-
var SerializedNowDateTime =
|
|
1434
|
-
$$
|
|
1435
|
-
$$time: import_zod15.z.literal("now").optional()
|
|
1510
|
+
var import_zod = require("zod");
|
|
1511
|
+
var SerializedNowDateTime = import_zod.z.object({
|
|
1512
|
+
$$now: import_zod.z.literal(true)
|
|
1436
1513
|
});
|
|
1437
1514
|
function todayDateTimeValueSerializer() {
|
|
1438
|
-
return {
|
|
1439
|
-
$$date: "now",
|
|
1440
|
-
$$time: "now"
|
|
1441
|
-
};
|
|
1515
|
+
return { $$now: true };
|
|
1442
1516
|
}
|
|
1443
1517
|
|
|
1444
1518
|
// ../commons/src/events/FieldConfig.ts
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
(val) => !val.includes("_"),
|
|
1455
|
-
(val) => ({
|
|
1456
|
-
message: `id: '${val}' must not contain underscores '_'`
|
|
1457
|
-
})
|
|
1458
|
-
).describe("Unique identifier for the field");
|
|
1459
|
-
var FieldReference = import_zod16.z.object({
|
|
1519
|
+
var FieldId = z17.string().superRefine((val, ctx) => {
|
|
1520
|
+
if (val.includes("_")) {
|
|
1521
|
+
ctx.addIssue({
|
|
1522
|
+
code: z17.ZodIssueCode.custom,
|
|
1523
|
+
message: `id: '${val}' must not contain underscores '_'`
|
|
1524
|
+
});
|
|
1525
|
+
}
|
|
1526
|
+
}).describe("Unique identifier for the field");
|
|
1527
|
+
var FieldReference = z17.object({
|
|
1460
1528
|
$$field: FieldId,
|
|
1461
|
-
$$subfield:
|
|
1529
|
+
$$subfield: z17.array(z17.string()).optional().describe(
|
|
1462
1530
|
'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
|
|
1463
1531
|
)
|
|
1464
1532
|
}).describe("Reference to a field by its ID");
|
|
1465
|
-
var ValidationConfig =
|
|
1533
|
+
var ValidationConfig = z17.object({
|
|
1466
1534
|
validator: Conditional,
|
|
1467
1535
|
message: TranslationConfig
|
|
1468
1536
|
});
|
|
1469
|
-
var requiredSchema =
|
|
1470
|
-
|
|
1471
|
-
|
|
1537
|
+
var requiredSchema = z17.union([
|
|
1538
|
+
z17.boolean(),
|
|
1539
|
+
z17.object({
|
|
1472
1540
|
message: TranslationConfig.describe("Custom required validation message")
|
|
1473
1541
|
})
|
|
1474
1542
|
]).default(false).optional();
|
|
1475
|
-
var BaseField =
|
|
1543
|
+
var BaseField = z17.object({
|
|
1476
1544
|
id: FieldId.describe("Unique identifier of the field."),
|
|
1477
1545
|
label: TranslationConfig.describe("Human-readable label of the field."),
|
|
1478
|
-
parent: FieldReference.or(
|
|
1546
|
+
parent: FieldReference.or(z17.array(FieldReference)).optional().describe(
|
|
1479
1547
|
"Reference to the parent field or fields. When a parent field changes, this field is reset."
|
|
1480
1548
|
),
|
|
1481
1549
|
required: requiredSchema.describe(
|
|
1482
1550
|
"Indicates whether the field is mandatory."
|
|
1483
1551
|
),
|
|
1484
|
-
conditionals:
|
|
1552
|
+
conditionals: z17.array(FieldConditional).default([]).optional().describe(
|
|
1485
1553
|
"Conditions determining when the field is shown or enabled. By default, the field is always shown and enabled."
|
|
1486
1554
|
),
|
|
1487
|
-
secured:
|
|
1555
|
+
secured: z17.boolean().default(false).optional().describe(
|
|
1488
1556
|
"Indicates whether the field is secured. Secured fields are not indexed for search and are only visible when explicitly assigned."
|
|
1489
1557
|
),
|
|
1490
1558
|
placeholder: TranslationConfig.optional(),
|
|
1491
|
-
validation:
|
|
1559
|
+
validation: z17.array(ValidationConfig).default([]).optional().describe("Additional validation rules applied to the field."),
|
|
1492
1560
|
helperText: TranslationConfig.optional(),
|
|
1493
|
-
hideLabel:
|
|
1494
|
-
uncorrectable:
|
|
1561
|
+
hideLabel: z17.boolean().default(false).optional(),
|
|
1562
|
+
uncorrectable: z17.boolean().default(false).optional().describe(
|
|
1495
1563
|
"Indicates whether the field can be modified during record correction."
|
|
1496
1564
|
),
|
|
1497
|
-
value: FieldReference.or(
|
|
1565
|
+
value: FieldReference.or(z17.array(FieldReference)).optional().describe(
|
|
1498
1566
|
"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."
|
|
1499
1567
|
),
|
|
1500
|
-
analytics:
|
|
1568
|
+
analytics: z17.boolean().default(false).optional().describe(
|
|
1501
1569
|
"Indicates whether the field is included in analytics. When enabled, its value becomes available in the analytics dashboard."
|
|
1502
1570
|
)
|
|
1503
1571
|
}).describe("Common properties shared across all field types.");
|
|
1504
1572
|
var Divider = BaseField.extend({
|
|
1505
|
-
type:
|
|
1573
|
+
type: z17.literal(FieldType.DIVIDER)
|
|
1506
1574
|
});
|
|
1507
1575
|
var TextField = BaseField.extend({
|
|
1508
|
-
type:
|
|
1509
|
-
defaultValue:
|
|
1510
|
-
configuration:
|
|
1511
|
-
maxLength:
|
|
1512
|
-
type:
|
|
1576
|
+
type: z17.literal(FieldType.TEXT),
|
|
1577
|
+
defaultValue: z17.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1578
|
+
configuration: z17.object({
|
|
1579
|
+
maxLength: z17.number().optional().describe("Maximum length of the text"),
|
|
1580
|
+
type: z17.enum(["text", "password"]).optional(),
|
|
1513
1581
|
prefix: TranslationConfig.optional(),
|
|
1514
1582
|
postfix: TranslationConfig.optional()
|
|
1515
1583
|
}).default({ type: "text" }).optional()
|
|
1516
1584
|
}).describe("Text input");
|
|
1517
1585
|
var NumberField = BaseField.extend({
|
|
1518
|
-
type:
|
|
1586
|
+
type: z17.literal(FieldType.NUMBER),
|
|
1519
1587
|
defaultValue: NumberFieldValue.optional(),
|
|
1520
|
-
configuration:
|
|
1521
|
-
min:
|
|
1522
|
-
max:
|
|
1588
|
+
configuration: z17.object({
|
|
1589
|
+
min: z17.number().optional().describe("Minimum value"),
|
|
1590
|
+
max: z17.number().optional().describe("Maximum value"),
|
|
1523
1591
|
prefix: TranslationConfig.optional(),
|
|
1524
1592
|
postfix: TranslationConfig.optional()
|
|
1525
1593
|
}).optional()
|
|
1526
1594
|
}).describe("Number input");
|
|
1527
1595
|
var TextAreaField = BaseField.extend({
|
|
1528
|
-
type:
|
|
1596
|
+
type: z17.literal(FieldType.TEXTAREA),
|
|
1529
1597
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1530
|
-
configuration:
|
|
1531
|
-
maxLength:
|
|
1532
|
-
rows:
|
|
1533
|
-
cols:
|
|
1598
|
+
configuration: z17.object({
|
|
1599
|
+
maxLength: z17.number().optional().describe("Maximum length of the text"),
|
|
1600
|
+
rows: z17.number().optional().describe("Number of visible text lines"),
|
|
1601
|
+
cols: z17.number().optional().describe("Number of visible columns"),
|
|
1534
1602
|
prefix: TranslationConfig.optional(),
|
|
1535
1603
|
postfix: TranslationConfig.optional()
|
|
1536
1604
|
}).default({ rows: 4 }).optional()
|
|
1537
1605
|
}).describe("Multiline text input");
|
|
1538
|
-
var ImageMimeType =
|
|
1606
|
+
var ImageMimeType = z17.enum([
|
|
1539
1607
|
"image/png",
|
|
1540
1608
|
"image/jpg",
|
|
1541
1609
|
"image/jpeg",
|
|
1542
1610
|
"image/svg+xml"
|
|
1543
1611
|
]);
|
|
1544
|
-
var DocumentMimeType =
|
|
1612
|
+
var DocumentMimeType = z17.enum([
|
|
1545
1613
|
"application/pdf",
|
|
1546
1614
|
"application/msword",
|
|
1547
1615
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
1548
1616
|
"application/vnd.oasis.opendocument.text"
|
|
1549
1617
|
]);
|
|
1550
|
-
var MimeType =
|
|
1618
|
+
var MimeType = z17.enum([
|
|
1551
1619
|
...ImageMimeType.options,
|
|
1552
1620
|
...DocumentMimeType.options
|
|
1553
1621
|
]);
|
|
1554
1622
|
var DEFAULT_MAX_FILE_SIZE_BYTES = 5 * 1024 * 1024;
|
|
1555
1623
|
var SignatureField = BaseField.extend({
|
|
1556
|
-
type:
|
|
1624
|
+
type: z17.literal(FieldType.SIGNATURE),
|
|
1557
1625
|
signaturePromptLabel: TranslationConfig.describe(
|
|
1558
1626
|
"Title of the signature modal"
|
|
1559
1627
|
),
|
|
1560
1628
|
defaultValue: SignatureFieldValue.optional(),
|
|
1561
|
-
configuration:
|
|
1562
|
-
maxFileSize:
|
|
1629
|
+
configuration: z17.object({
|
|
1630
|
+
maxFileSize: z17.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1563
1631
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
|
1564
1632
|
}).default({
|
|
1565
1633
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1566
1634
|
})
|
|
1567
1635
|
}).describe("Signature input field");
|
|
1568
1636
|
var EmailField = BaseField.extend({
|
|
1569
|
-
type:
|
|
1570
|
-
configuration:
|
|
1571
|
-
maxLength:
|
|
1572
|
-
}).default({ maxLength:
|
|
1637
|
+
type: z17.literal(FieldType.EMAIL),
|
|
1638
|
+
configuration: z17.object({
|
|
1639
|
+
maxLength: z17.number().optional().describe("Maximum length of the text")
|
|
1640
|
+
}).default({ maxLength: 255 }).optional(),
|
|
1573
1641
|
defaultValue: NonEmptyTextValue.optional()
|
|
1574
1642
|
});
|
|
1575
1643
|
var DateField = BaseField.extend({
|
|
1576
|
-
type:
|
|
1577
|
-
defaultValue: SerializedNowDateTime.
|
|
1578
|
-
|
|
1579
|
-
})).or(DateValue).optional().openapi({ effectType: "input", type: "object" }).describe("Default date value(yyyy-MM-dd)"),
|
|
1580
|
-
configuration: import_zod16.z.object({
|
|
1644
|
+
type: z17.literal(FieldType.DATE),
|
|
1645
|
+
defaultValue: SerializedNowDateTime.or(DateValue).optional().describe("Default date value(yyyy-MM-dd)"),
|
|
1646
|
+
configuration: z17.object({
|
|
1581
1647
|
notice: TranslationConfig.describe(
|
|
1582
1648
|
"Text to display above the date input"
|
|
1583
1649
|
).optional()
|
|
1584
1650
|
}).optional()
|
|
1585
1651
|
}).describe("A single date input (yyyy-MM-dd)");
|
|
1586
1652
|
var AgeField = BaseField.extend({
|
|
1587
|
-
type:
|
|
1653
|
+
type: z17.literal(FieldType.AGE),
|
|
1588
1654
|
defaultValue: NumberFieldValue.optional(),
|
|
1589
|
-
configuration:
|
|
1655
|
+
configuration: z17.object({
|
|
1590
1656
|
asOfDate: FieldReference,
|
|
1591
1657
|
prefix: TranslationConfig.optional(),
|
|
1592
1658
|
postfix: TranslationConfig.optional()
|
|
1593
1659
|
})
|
|
1594
1660
|
}).describe("An age input field which uses the current date as the asOfDate");
|
|
1595
1661
|
var TimeField = BaseField.extend({
|
|
1596
|
-
type:
|
|
1597
|
-
defaultValue: SerializedNowDateTime.
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
configuration: import_zod16.z.object({
|
|
1601
|
-
use12HourFormat: import_zod16.z.boolean().optional().describe("Whether to use 12-hour format"),
|
|
1662
|
+
type: z17.literal(FieldType.TIME),
|
|
1663
|
+
defaultValue: SerializedNowDateTime.or(TimeValue).optional().describe("Default time value (HH-mm)"),
|
|
1664
|
+
configuration: z17.object({
|
|
1665
|
+
use12HourFormat: z17.boolean().optional().describe("Whether to use 12-hour format"),
|
|
1602
1666
|
notice: TranslationConfig.describe(
|
|
1603
1667
|
"Text to display above the time input"
|
|
1604
1668
|
).optional()
|
|
1605
1669
|
}).optional()
|
|
1606
1670
|
}).describe("A single date input (HH-mm)");
|
|
1607
1671
|
var DateRangeField = BaseField.extend({
|
|
1608
|
-
type:
|
|
1672
|
+
type: z17.literal(FieldType.DATE_RANGE),
|
|
1609
1673
|
defaultValue: DateRangeFieldValue.optional(),
|
|
1610
|
-
configuration:
|
|
1674
|
+
configuration: z17.object({
|
|
1611
1675
|
notice: TranslationConfig.describe(
|
|
1612
1676
|
"Text to display above the date input"
|
|
1613
1677
|
).optional()
|
|
1614
1678
|
}).optional()
|
|
1615
1679
|
}).describe("A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })");
|
|
1616
|
-
var HtmlFontVariant =
|
|
1680
|
+
var HtmlFontVariant = z17.enum([
|
|
1617
1681
|
"reg12",
|
|
1618
1682
|
"reg14",
|
|
1619
1683
|
"reg16",
|
|
@@ -1623,34 +1687,34 @@ var HtmlFontVariant = import_zod16.z.enum([
|
|
|
1623
1687
|
"h2",
|
|
1624
1688
|
"h1"
|
|
1625
1689
|
]);
|
|
1626
|
-
var ParagraphConfiguration =
|
|
1627
|
-
styles:
|
|
1690
|
+
var ParagraphConfiguration = z17.object({
|
|
1691
|
+
styles: z17.object({
|
|
1628
1692
|
fontVariant: HtmlFontVariant.optional().describe(
|
|
1629
1693
|
"Font variant to use for the paragraph text"
|
|
1630
1694
|
),
|
|
1631
|
-
hint:
|
|
1695
|
+
hint: z17.boolean().optional().describe("When true, paragraph is styled as a hint with grey color")
|
|
1632
1696
|
}).optional()
|
|
1633
1697
|
}).default({});
|
|
1634
1698
|
var Paragraph = BaseField.extend({
|
|
1635
|
-
type:
|
|
1699
|
+
type: z17.literal(FieldType.PARAGRAPH),
|
|
1636
1700
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1637
1701
|
configuration: ParagraphConfiguration
|
|
1638
1702
|
}).describe("A read-only HTML <p> paragraph");
|
|
1639
1703
|
var PageHeader = BaseField.extend({
|
|
1640
|
-
type:
|
|
1704
|
+
type: z17.literal(FieldType.PAGE_HEADER),
|
|
1641
1705
|
defaultValue: NonEmptyTextValue.optional()
|
|
1642
1706
|
}).describe("A read-only header component for form pages");
|
|
1643
1707
|
var File = BaseField.extend({
|
|
1644
|
-
type:
|
|
1708
|
+
type: z17.literal(FieldType.FILE),
|
|
1645
1709
|
defaultValue: FileFieldValue.optional(),
|
|
1646
|
-
configuration:
|
|
1647
|
-
maxFileSize:
|
|
1710
|
+
configuration: z17.object({
|
|
1711
|
+
maxFileSize: z17.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1648
1712
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature"),
|
|
1649
|
-
maxImageSize:
|
|
1650
|
-
targetSize:
|
|
1713
|
+
maxImageSize: z17.object({
|
|
1714
|
+
targetSize: z17.object({ width: z17.number(), height: z17.number() })
|
|
1651
1715
|
}).optional(),
|
|
1652
|
-
style:
|
|
1653
|
-
width:
|
|
1716
|
+
style: z17.object({
|
|
1717
|
+
width: z17.enum(["full", "auto"]).optional().describe(
|
|
1654
1718
|
"Whether the file upload button should take the full width of the container or not"
|
|
1655
1719
|
)
|
|
1656
1720
|
}).optional(),
|
|
@@ -1659,46 +1723,46 @@ var File = BaseField.extend({
|
|
|
1659
1723
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1660
1724
|
})
|
|
1661
1725
|
}).describe("File upload");
|
|
1662
|
-
var SelectOption =
|
|
1663
|
-
value:
|
|
1664
|
-
label:
|
|
1726
|
+
var SelectOption = z17.object({
|
|
1727
|
+
value: z17.string().describe("The value of the option"),
|
|
1728
|
+
label: z17.union([z17.string(), TranslationConfig]).describe("The label of the option")
|
|
1665
1729
|
});
|
|
1666
1730
|
var NumberWithUnitField = BaseField.extend({
|
|
1667
|
-
type:
|
|
1731
|
+
type: z17.literal(FieldType.NUMBER_WITH_UNIT),
|
|
1668
1732
|
defaultValue: NumberWithUnitFieldValue.optional(),
|
|
1669
|
-
options:
|
|
1670
|
-
configuration:
|
|
1671
|
-
min:
|
|
1672
|
-
max:
|
|
1733
|
+
options: z17.array(SelectOption).describe("A list of options for the unit select"),
|
|
1734
|
+
configuration: z17.object({
|
|
1735
|
+
min: z17.number().optional().describe("Minimum value of the number field"),
|
|
1736
|
+
max: z17.number().optional().describe("Maximum value of the number field"),
|
|
1673
1737
|
numberFieldPlaceholder: TranslationConfig.optional().describe(
|
|
1674
1738
|
"Placeholder for the number field"
|
|
1675
1739
|
)
|
|
1676
1740
|
}).optional()
|
|
1677
1741
|
}).describe("Number with unit input");
|
|
1678
1742
|
var RadioGroup = BaseField.extend({
|
|
1679
|
-
type:
|
|
1743
|
+
type: z17.literal(FieldType.RADIO_GROUP),
|
|
1680
1744
|
defaultValue: TextValue.optional(),
|
|
1681
|
-
options:
|
|
1682
|
-
configuration:
|
|
1683
|
-
styles:
|
|
1684
|
-
size:
|
|
1745
|
+
options: z17.array(SelectOption).describe("A list of options"),
|
|
1746
|
+
configuration: z17.object({
|
|
1747
|
+
styles: z17.object({
|
|
1748
|
+
size: z17.enum(["NORMAL", "LARGE"]).optional()
|
|
1685
1749
|
}).optional()
|
|
1686
1750
|
}).optional()
|
|
1687
1751
|
}).describe("Grouped radio options");
|
|
1688
1752
|
var BulletList = BaseField.extend({
|
|
1689
|
-
type:
|
|
1753
|
+
type: z17.literal(FieldType.BULLET_LIST),
|
|
1690
1754
|
defaultValue: TextValue.optional(),
|
|
1691
|
-
items:
|
|
1692
|
-
configuration:
|
|
1693
|
-
styles:
|
|
1755
|
+
items: z17.array(TranslationConfig).describe("A list of items"),
|
|
1756
|
+
configuration: z17.object({
|
|
1757
|
+
styles: z17.object({
|
|
1694
1758
|
fontVariant: HtmlFontVariant.optional()
|
|
1695
1759
|
}).optional()
|
|
1696
1760
|
}).default({})
|
|
1697
1761
|
}).describe("A list of bullet points");
|
|
1698
1762
|
var Select = BaseField.extend({
|
|
1699
|
-
type:
|
|
1763
|
+
type: z17.literal(FieldType.SELECT),
|
|
1700
1764
|
defaultValue: TextValue.optional(),
|
|
1701
|
-
options:
|
|
1765
|
+
options: z17.array(SelectOption).describe("A list of options"),
|
|
1702
1766
|
noOptionsMessage: TranslationConfig.optional().describe(
|
|
1703
1767
|
`
|
|
1704
1768
|
A translation configuration object used to display a message when no options are available.
|
|
@@ -1710,34 +1774,34 @@ var Select = BaseField.extend({
|
|
|
1710
1774
|
`
|
|
1711
1775
|
)
|
|
1712
1776
|
}).describe("Select input");
|
|
1713
|
-
var SelectDateRangeOption =
|
|
1777
|
+
var SelectDateRangeOption = z17.object({
|
|
1714
1778
|
value: SelectDateRangeValue.describe("The value of the option"),
|
|
1715
1779
|
label: TranslationConfig.describe("The label of the option")
|
|
1716
1780
|
});
|
|
1717
1781
|
var SelectDateRangeField = BaseField.extend({
|
|
1718
|
-
type:
|
|
1782
|
+
type: z17.literal(FieldType.SELECT_DATE_RANGE),
|
|
1719
1783
|
defaultValue: SelectDateRangeValue.optional(),
|
|
1720
|
-
options:
|
|
1784
|
+
options: z17.array(SelectDateRangeOption).describe("A list of options")
|
|
1721
1785
|
}).describe("Select input with date range options");
|
|
1722
|
-
var NameConfig =
|
|
1723
|
-
firstname:
|
|
1724
|
-
middlename:
|
|
1725
|
-
surname:
|
|
1786
|
+
var NameConfig = z17.object({
|
|
1787
|
+
firstname: z17.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
1788
|
+
middlename: z17.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
1789
|
+
surname: z17.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional()
|
|
1726
1790
|
});
|
|
1727
1791
|
var NameField = BaseField.extend({
|
|
1728
|
-
type:
|
|
1729
|
-
defaultValue:
|
|
1792
|
+
type: z17.literal(FieldType.NAME),
|
|
1793
|
+
defaultValue: z17.object({
|
|
1730
1794
|
firstname: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
1731
1795
|
middlename: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
1732
1796
|
surname: SerializedUserField.or(NonEmptyTextValue).optional()
|
|
1733
1797
|
}).optional(),
|
|
1734
|
-
configuration:
|
|
1798
|
+
configuration: z17.object({
|
|
1735
1799
|
name: NameConfig.default({
|
|
1736
1800
|
firstname: { required: true },
|
|
1737
1801
|
surname: { required: true }
|
|
1738
1802
|
}).optional(),
|
|
1739
|
-
order:
|
|
1740
|
-
maxLength:
|
|
1803
|
+
order: z17.array(z17.enum(["firstname", "middlename", "surname"])).optional(),
|
|
1804
|
+
maxLength: z17.number().optional().describe("Maximum length of the text"),
|
|
1741
1805
|
prefix: TranslationConfig.optional(),
|
|
1742
1806
|
postfix: TranslationConfig.optional()
|
|
1743
1807
|
}).default({
|
|
@@ -1749,51 +1813,51 @@ var NameField = BaseField.extend({
|
|
|
1749
1813
|
}).describe("Name input field");
|
|
1750
1814
|
var PhoneField = BaseField.extend({
|
|
1751
1815
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1752
|
-
type:
|
|
1816
|
+
type: z17.literal(FieldType.PHONE)
|
|
1753
1817
|
}).describe("Phone input field");
|
|
1754
1818
|
var IdField = BaseField.extend({
|
|
1755
1819
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1756
|
-
type:
|
|
1820
|
+
type: z17.literal(FieldType.ID)
|
|
1757
1821
|
}).describe("ID input field");
|
|
1758
1822
|
var Checkbox = BaseField.extend({
|
|
1759
|
-
type:
|
|
1823
|
+
type: z17.literal(FieldType.CHECKBOX),
|
|
1760
1824
|
defaultValue: CheckboxFieldValue.default(false)
|
|
1761
1825
|
}).describe("Boolean checkbox field");
|
|
1762
1826
|
var Country = BaseField.extend({
|
|
1763
|
-
type:
|
|
1827
|
+
type: z17.literal(FieldType.COUNTRY),
|
|
1764
1828
|
defaultValue: NonEmptyTextValue.optional()
|
|
1765
1829
|
}).describe("Country select field");
|
|
1766
|
-
var AdministrativeAreas =
|
|
1830
|
+
var AdministrativeAreas = z17.enum([
|
|
1767
1831
|
"ADMIN_STRUCTURE",
|
|
1768
1832
|
"HEALTH_FACILITY",
|
|
1769
1833
|
"CRVS_OFFICE"
|
|
1770
1834
|
]);
|
|
1771
|
-
var AdministrativeAreaConfiguration =
|
|
1772
|
-
partOf:
|
|
1773
|
-
$declaration:
|
|
1835
|
+
var AdministrativeAreaConfiguration = z17.object({
|
|
1836
|
+
partOf: z17.object({
|
|
1837
|
+
$declaration: z17.string()
|
|
1774
1838
|
}).optional().describe("Parent location"),
|
|
1775
1839
|
type: AdministrativeAreas
|
|
1776
1840
|
}).describe("Administrative area options");
|
|
1777
|
-
var
|
|
1778
|
-
type:
|
|
1841
|
+
var AdministrativeAreaField = BaseField.extend({
|
|
1842
|
+
type: z17.literal(FieldType.ADMINISTRATIVE_AREA),
|
|
1779
1843
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1780
1844
|
configuration: AdministrativeAreaConfiguration
|
|
1781
1845
|
}).describe("Administrative area input field e.g. facility, office");
|
|
1782
1846
|
var LocationInput = BaseField.extend({
|
|
1783
|
-
type:
|
|
1847
|
+
type: z17.literal(FieldType.LOCATION),
|
|
1784
1848
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1785
|
-
configuration:
|
|
1786
|
-
searchableResource:
|
|
1849
|
+
configuration: z17.object({
|
|
1850
|
+
searchableResource: z17.array(z17.enum(["locations", "facilities", "offices"]))
|
|
1787
1851
|
})
|
|
1788
1852
|
}).describe("Input field for a location");
|
|
1789
1853
|
var FileUploadWithOptions = BaseField.extend({
|
|
1790
|
-
type:
|
|
1791
|
-
options:
|
|
1854
|
+
type: z17.literal(FieldType.FILE_WITH_OPTIONS),
|
|
1855
|
+
options: z17.array(SelectOption).describe("A list of options"),
|
|
1792
1856
|
defaultValue: FileFieldWithOptionValue.optional(),
|
|
1793
|
-
configuration:
|
|
1794
|
-
maxFileSize:
|
|
1795
|
-
maxImageSize:
|
|
1796
|
-
targetSize:
|
|
1857
|
+
configuration: z17.object({
|
|
1858
|
+
maxFileSize: z17.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1859
|
+
maxImageSize: z17.object({
|
|
1860
|
+
targetSize: z17.object({ width: z17.number(), height: z17.number() })
|
|
1797
1861
|
}).optional(),
|
|
1798
1862
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
|
1799
1863
|
}).default({
|
|
@@ -1801,93 +1865,93 @@ var FileUploadWithOptions = BaseField.extend({
|
|
|
1801
1865
|
})
|
|
1802
1866
|
});
|
|
1803
1867
|
var Facility = BaseField.extend({
|
|
1804
|
-
type:
|
|
1868
|
+
type: z17.literal(FieldType.FACILITY),
|
|
1805
1869
|
defaultValue: NonEmptyTextValue.optional()
|
|
1806
1870
|
}).describe("Input field for a facility");
|
|
1807
1871
|
var Office = BaseField.extend({
|
|
1808
|
-
type:
|
|
1872
|
+
type: z17.literal(FieldType.OFFICE),
|
|
1809
1873
|
defaultValue: NonEmptyTextValue.optional()
|
|
1810
1874
|
}).describe("Input field for an office");
|
|
1811
1875
|
var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
|
|
1812
|
-
administrativeArea:
|
|
1876
|
+
administrativeArea: z17.union([UUID, SerializedUserField]).optional()
|
|
1813
1877
|
});
|
|
1814
1878
|
var Address = BaseField.extend({
|
|
1815
|
-
type:
|
|
1816
|
-
configuration:
|
|
1817
|
-
lineSeparator:
|
|
1818
|
-
fields:
|
|
1819
|
-
administrativeLevels:
|
|
1820
|
-
streetAddressForm:
|
|
1821
|
-
|
|
1822
|
-
id:
|
|
1879
|
+
type: z17.literal(FieldType.ADDRESS),
|
|
1880
|
+
configuration: z17.object({
|
|
1881
|
+
lineSeparator: z17.string().optional(),
|
|
1882
|
+
fields: z17.array(z17.enum(["country", "administrativeArea"])).optional(),
|
|
1883
|
+
administrativeLevels: z17.array(z17.string()).optional(),
|
|
1884
|
+
streetAddressForm: z17.array(
|
|
1885
|
+
z17.object({
|
|
1886
|
+
id: z17.string(),
|
|
1823
1887
|
required: requiredSchema,
|
|
1824
1888
|
label: TranslationConfig,
|
|
1825
|
-
type:
|
|
1826
|
-
conditionals:
|
|
1889
|
+
type: z17.literal(FieldType.TEXT),
|
|
1890
|
+
conditionals: z17.array(FieldConditional).default([]).optional(),
|
|
1827
1891
|
parent: FieldReference.optional()
|
|
1828
1892
|
})
|
|
1829
1893
|
).optional()
|
|
1830
1894
|
}).optional(),
|
|
1831
1895
|
defaultValue: DefaultAddressFieldValue.optional()
|
|
1832
1896
|
}).describe("Address input field \u2013 a combination of location and text fields");
|
|
1833
|
-
var StaticDataEntry =
|
|
1834
|
-
id:
|
|
1897
|
+
var StaticDataEntry = z17.object({
|
|
1898
|
+
id: z17.string().describe("ID for the data entry."),
|
|
1835
1899
|
label: TranslationConfig,
|
|
1836
|
-
value: TranslationConfig.or(
|
|
1900
|
+
value: TranslationConfig.or(z17.string()).or(FieldReference)
|
|
1837
1901
|
}).describe("Static data entry");
|
|
1838
|
-
var DataEntry =
|
|
1902
|
+
var DataEntry = z17.union([StaticDataEntry, z17.object({ fieldId: z17.string() })]).describe(
|
|
1839
1903
|
"Data entry can be either a static data entry, or a reference to another field in the current form or the declaration."
|
|
1840
1904
|
);
|
|
1841
1905
|
var DataField = BaseField.extend({
|
|
1842
|
-
type:
|
|
1843
|
-
configuration:
|
|
1906
|
+
type: z17.literal(FieldType.DATA),
|
|
1907
|
+
configuration: z17.object({
|
|
1844
1908
|
subtitle: TranslationConfig.optional(),
|
|
1845
|
-
data:
|
|
1909
|
+
data: z17.array(DataEntry)
|
|
1846
1910
|
})
|
|
1847
1911
|
}).describe("Data field for displaying read-only data");
|
|
1848
1912
|
var ButtonField = BaseField.extend({
|
|
1849
|
-
type:
|
|
1913
|
+
type: z17.literal(FieldType.BUTTON),
|
|
1850
1914
|
defaultValue: ButtonFieldValue.optional(),
|
|
1851
|
-
configuration:
|
|
1852
|
-
icon:
|
|
1915
|
+
configuration: z17.object({
|
|
1916
|
+
icon: z17.string().optional().describe(
|
|
1853
1917
|
"Icon for the button. You can find icons from OpenCRVS UI-Kit."
|
|
1854
1918
|
),
|
|
1855
|
-
loading:
|
|
1919
|
+
loading: z17.boolean().optional().describe("Whether the button is in a loading state and shows a spinner"),
|
|
1856
1920
|
text: TranslationConfig.describe("Text to display on the button")
|
|
1857
1921
|
})
|
|
1858
1922
|
}).describe("Generic button without any built-in functionality");
|
|
1859
1923
|
var AlphaPrintButton = BaseField.extend({
|
|
1860
|
-
type:
|
|
1861
|
-
configuration:
|
|
1862
|
-
template:
|
|
1924
|
+
type: z17.literal(FieldType.ALPHA_PRINT_BUTTON),
|
|
1925
|
+
configuration: z17.object({
|
|
1926
|
+
template: z17.string().describe("Template ID from countryconfig templates to use for printing"),
|
|
1863
1927
|
buttonLabel: TranslationConfig.optional().describe(
|
|
1864
1928
|
"Label for the print button"
|
|
1865
1929
|
)
|
|
1866
1930
|
})
|
|
1867
1931
|
}).describe("Print button field for printing certificates");
|
|
1868
1932
|
var HttpField = BaseField.extend({
|
|
1869
|
-
type:
|
|
1933
|
+
type: z17.literal(FieldType.HTTP),
|
|
1870
1934
|
defaultValue: HttpFieldValue.optional(),
|
|
1871
|
-
configuration:
|
|
1935
|
+
configuration: z17.object({
|
|
1872
1936
|
trigger: FieldReference,
|
|
1873
|
-
url:
|
|
1874
|
-
method:
|
|
1875
|
-
headers:
|
|
1876
|
-
body:
|
|
1877
|
-
errorValue:
|
|
1878
|
-
params:
|
|
1879
|
-
timeout:
|
|
1937
|
+
url: z17.string().describe("URL to send the HTTP request to"),
|
|
1938
|
+
method: z17.enum(["GET", "POST", "PUT", "DELETE"]),
|
|
1939
|
+
headers: z17.record(z17.string(), z17.string()).optional(),
|
|
1940
|
+
body: z17.record(z17.string(), z17.any()).optional(),
|
|
1941
|
+
errorValue: z17.any().optional().describe("Value to set if the request fails"),
|
|
1942
|
+
params: z17.record(z17.string(), z17.union([z17.string(), FieldReference])).optional(),
|
|
1943
|
+
timeout: z17.number().default(15e3).describe("Request timeout in milliseconds")
|
|
1880
1944
|
})
|
|
1881
1945
|
}).describe("HTTP request function triggered by a button click or other event");
|
|
1882
1946
|
var SearchField = HttpField.extend({
|
|
1883
|
-
type:
|
|
1947
|
+
type: z17.literal(FieldType.SEARCH),
|
|
1884
1948
|
configuration: SearchQuery.pick({
|
|
1885
1949
|
query: true,
|
|
1886
1950
|
limit: true,
|
|
1887
1951
|
offset: true
|
|
1888
1952
|
}).extend({
|
|
1889
1953
|
validation: ValidationConfig,
|
|
1890
|
-
indicators:
|
|
1954
|
+
indicators: z17.object({
|
|
1891
1955
|
loading: TranslationConfig.optional().describe(
|
|
1892
1956
|
"Text to display while the search is in progress"
|
|
1893
1957
|
),
|
|
@@ -1902,7 +1966,7 @@ var SearchField = HttpField.extend({
|
|
|
1902
1966
|
),
|
|
1903
1967
|
confirmButton: TranslationConfig.optional(),
|
|
1904
1968
|
clearButton: TranslationConfig.optional(),
|
|
1905
|
-
clearModal:
|
|
1969
|
+
clearModal: z17.object({
|
|
1906
1970
|
title: TranslationConfig.optional(),
|
|
1907
1971
|
description: TranslationConfig.optional(),
|
|
1908
1972
|
cancel: TranslationConfig.optional(),
|
|
@@ -1913,17 +1977,17 @@ var SearchField = HttpField.extend({
|
|
|
1913
1977
|
})
|
|
1914
1978
|
});
|
|
1915
1979
|
var LinkButtonField = BaseField.extend({
|
|
1916
|
-
type:
|
|
1917
|
-
configuration:
|
|
1918
|
-
url:
|
|
1980
|
+
type: z17.literal(FieldType.LINK_BUTTON),
|
|
1981
|
+
configuration: z17.object({
|
|
1982
|
+
url: z17.string().describe("URL to open"),
|
|
1919
1983
|
text: TranslationConfig.describe("Text to display on the button"),
|
|
1920
|
-
icon:
|
|
1984
|
+
icon: z17.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit.")
|
|
1921
1985
|
})
|
|
1922
1986
|
}).describe("Button that opens a link");
|
|
1923
1987
|
var VerificationStatus = BaseField.extend({
|
|
1924
|
-
type:
|
|
1988
|
+
type: z17.literal(FieldType.VERIFICATION_STATUS),
|
|
1925
1989
|
defaultValue: VerificationStatusValue.optional(),
|
|
1926
|
-
configuration:
|
|
1990
|
+
configuration: z17.object({
|
|
1927
1991
|
status: TranslationConfig.describe("Text to display on the status pill."),
|
|
1928
1992
|
description: TranslationConfig.describe(
|
|
1929
1993
|
"Explaining text on the banner in form."
|
|
@@ -1931,38 +1995,55 @@ var VerificationStatus = BaseField.extend({
|
|
|
1931
1995
|
})
|
|
1932
1996
|
});
|
|
1933
1997
|
var QueryParamReaderField = BaseField.extend({
|
|
1934
|
-
type:
|
|
1935
|
-
configuration:
|
|
1936
|
-
pickParams:
|
|
1998
|
+
type: z17.literal(FieldType.QUERY_PARAM_READER),
|
|
1999
|
+
configuration: z17.object({
|
|
2000
|
+
pickParams: z17.array(z17.string()).describe("List of query parameters to read from the URL")
|
|
1937
2001
|
})
|
|
1938
2002
|
}).describe(
|
|
1939
2003
|
"A field that maps URL query params into form values and clears them afterward"
|
|
1940
2004
|
);
|
|
1941
2005
|
var QrReaderField = BaseField.extend({
|
|
1942
|
-
type:
|
|
2006
|
+
type: z17.literal(FieldType.QR_READER),
|
|
1943
2007
|
defaultValue: QrReaderFieldValue.optional(),
|
|
1944
|
-
configuration:
|
|
1945
|
-
validator:
|
|
1946
|
-
|
|
1947
|
-
|
|
2008
|
+
configuration: z17.object({
|
|
2009
|
+
validator: z17.any().meta({
|
|
2010
|
+
description: "JSON Schema to validate the scanned QR code data against before populating the form fields.",
|
|
2011
|
+
id: "QrReaderFieldValidator"
|
|
2012
|
+
})
|
|
1948
2013
|
}).optional()
|
|
2014
|
+
}).meta({
|
|
2015
|
+
description: "Configuration for QR code reader field, including optional JSON Schema validator.",
|
|
2016
|
+
id: "QrReaderField"
|
|
1949
2017
|
});
|
|
1950
2018
|
var IdReaderField = BaseField.extend({
|
|
1951
|
-
type:
|
|
2019
|
+
type: z17.literal(FieldType.ID_READER),
|
|
1952
2020
|
defaultValue: IdReaderFieldValue.optional(),
|
|
1953
|
-
methods:
|
|
1954
|
-
|
|
2021
|
+
methods: z17.array(
|
|
2022
|
+
z17.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
|
|
1955
2023
|
)
|
|
1956
2024
|
});
|
|
2025
|
+
var CustomField = BaseField.extend({
|
|
2026
|
+
type: z17.literal(FieldType._EXPERIMENTAL_CUSTOM),
|
|
2027
|
+
defaultValue: CustomFieldValue.optional(),
|
|
2028
|
+
src: z17.string().describe("Module source path for the custom field component"),
|
|
2029
|
+
configuration: z17.unknown().optional()
|
|
2030
|
+
});
|
|
1957
2031
|
var LoaderField = BaseField.extend({
|
|
1958
|
-
type:
|
|
1959
|
-
configuration:
|
|
2032
|
+
type: z17.literal(FieldType.LOADER),
|
|
2033
|
+
configuration: z17.object({
|
|
1960
2034
|
text: TranslationConfig.describe("Display text above the loading spinner")
|
|
1961
2035
|
})
|
|
1962
2036
|
}).describe(
|
|
1963
2037
|
"A non-interactive field that indicates an in progress operation in form"
|
|
1964
2038
|
);
|
|
1965
|
-
var
|
|
2039
|
+
var HiddenField = BaseField.extend({
|
|
2040
|
+
type: z17.literal(FieldType.ALPHA_HIDDEN),
|
|
2041
|
+
required: z17.boolean().default(false).optional(),
|
|
2042
|
+
defaultValue: TextValue.optional()
|
|
2043
|
+
}).describe(
|
|
2044
|
+
"A non-interactive, hidden field that only hold a value in the form"
|
|
2045
|
+
);
|
|
2046
|
+
var FieldConfig = z17.discriminatedUnion("type", [
|
|
1966
2047
|
Address,
|
|
1967
2048
|
TextField,
|
|
1968
2049
|
NumberField,
|
|
@@ -1984,7 +2065,7 @@ var FieldConfig = import_zod16.z.discriminatedUnion("type", [
|
|
|
1984
2065
|
Checkbox,
|
|
1985
2066
|
File,
|
|
1986
2067
|
Country,
|
|
1987
|
-
|
|
2068
|
+
AdministrativeAreaField,
|
|
1988
2069
|
Divider,
|
|
1989
2070
|
LocationInput,
|
|
1990
2071
|
Facility,
|
|
@@ -2002,83 +2083,81 @@ var FieldConfig = import_zod16.z.discriminatedUnion("type", [
|
|
|
2002
2083
|
IdReaderField,
|
|
2003
2084
|
QueryParamReaderField,
|
|
2004
2085
|
LoaderField,
|
|
2005
|
-
SearchField
|
|
2006
|
-
|
|
2086
|
+
SearchField,
|
|
2087
|
+
CustomField,
|
|
2088
|
+
HiddenField
|
|
2089
|
+
]).meta({
|
|
2007
2090
|
description: "Form field configuration",
|
|
2008
|
-
|
|
2091
|
+
id: "FieldConfig"
|
|
2009
2092
|
});
|
|
2010
|
-
var AnyFileField =
|
|
2093
|
+
var AnyFileField = z17.discriminatedUnion("type", [
|
|
2011
2094
|
SignatureField,
|
|
2012
2095
|
File,
|
|
2013
2096
|
FileUploadWithOptions
|
|
2014
2097
|
]);
|
|
2015
2098
|
|
|
2016
2099
|
// ../commons/src/events/FormConfig.ts
|
|
2017
|
-
var
|
|
2100
|
+
var z19 = __toESM(require("zod/v4"));
|
|
2018
2101
|
|
|
2019
2102
|
// ../commons/src/events/PageConfig.ts
|
|
2020
|
-
var
|
|
2021
|
-
var
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
var PageConfigBase = import_zod17.z.object({
|
|
2025
|
-
id: import_zod17.z.string().describe("Unique identifier for the page"),
|
|
2103
|
+
var z18 = __toESM(require("zod/v4"));
|
|
2104
|
+
var PageTypes = z18.enum(["FORM", "VERIFICATION"]);
|
|
2105
|
+
var PageConfigBase = z18.object({
|
|
2106
|
+
id: z18.string().describe("Unique identifier for the page"),
|
|
2026
2107
|
title: TranslationConfig.describe("Header title of the page"),
|
|
2027
|
-
requireCompletionToContinue:
|
|
2108
|
+
requireCompletionToContinue: z18.boolean().default(false).describe(
|
|
2028
2109
|
"If true, all required fields must be filled before continuing to the next page"
|
|
2029
2110
|
),
|
|
2030
|
-
fields:
|
|
2111
|
+
fields: z18.array(FieldConfig).describe("Fields to be rendered on the page"),
|
|
2031
2112
|
conditional: Conditional.optional().describe(
|
|
2032
2113
|
"Page will be shown if condition is met. If conditional is not defined, the page will be always shown."
|
|
2033
2114
|
)
|
|
2034
|
-
}).
|
|
2115
|
+
}).meta({
|
|
2035
2116
|
description: "Form page configuration",
|
|
2036
|
-
|
|
2117
|
+
id: "FormPageConfig"
|
|
2037
2118
|
});
|
|
2038
2119
|
var FormPageConfig = PageConfigBase.extend({
|
|
2039
|
-
type:
|
|
2120
|
+
type: z18.literal(PageTypes.enum.FORM).default(PageTypes.enum.FORM)
|
|
2040
2121
|
});
|
|
2041
|
-
var VerificationActionConfig =
|
|
2042
|
-
verify:
|
|
2043
|
-
cancel:
|
|
2122
|
+
var VerificationActionConfig = z18.object({
|
|
2123
|
+
verify: z18.object({ label: TranslationConfig }),
|
|
2124
|
+
cancel: z18.object({
|
|
2044
2125
|
label: TranslationConfig,
|
|
2045
|
-
confirmation:
|
|
2126
|
+
confirmation: z18.object({
|
|
2046
2127
|
title: TranslationConfig,
|
|
2047
2128
|
body: TranslationConfig
|
|
2048
2129
|
})
|
|
2049
2130
|
})
|
|
2050
|
-
}).describe("Actions available on the verification page").
|
|
2131
|
+
}).describe("Actions available on the verification page").meta({
|
|
2051
2132
|
description: "Verification action configuration",
|
|
2052
|
-
|
|
2133
|
+
id: "VerificationActionConfig"
|
|
2053
2134
|
});
|
|
2054
2135
|
var VerificationPageConfig = FormPageConfig.extend({
|
|
2055
|
-
type:
|
|
2136
|
+
type: z18.literal(PageTypes.enum.VERIFICATION),
|
|
2056
2137
|
actions: VerificationActionConfig
|
|
2057
2138
|
});
|
|
2058
|
-
var PageConfig =
|
|
2139
|
+
var PageConfig = z18.discriminatedUnion("type", [
|
|
2059
2140
|
FormPageConfig,
|
|
2060
2141
|
VerificationPageConfig
|
|
2061
2142
|
]);
|
|
2062
2143
|
|
|
2063
2144
|
// ../commons/src/events/FormConfig.ts
|
|
2064
|
-
var DeclarationFormConfig =
|
|
2145
|
+
var DeclarationFormConfig = z19.object({
|
|
2065
2146
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2066
|
-
pages:
|
|
2147
|
+
pages: z19.array(FormPageConfig)
|
|
2067
2148
|
}).describe("Configuration of the declaration form.");
|
|
2068
|
-
var ActionFormConfig =
|
|
2149
|
+
var ActionFormConfig = z19.object({
|
|
2069
2150
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2070
|
-
pages:
|
|
2151
|
+
pages: z19.array(PageConfig)
|
|
2071
2152
|
}).describe(
|
|
2072
2153
|
"Configuration of the form used for system actions beyond declaration, supporting a wider range of page types."
|
|
2073
2154
|
);
|
|
2074
|
-
var FormConfig =
|
|
2155
|
+
var FormConfig = z19.union([DeclarationFormConfig, ActionFormConfig]);
|
|
2075
2156
|
|
|
2076
2157
|
// ../commons/src/events/DeduplicationConfig.ts
|
|
2077
|
-
var
|
|
2078
|
-
var
|
|
2079
|
-
|
|
2080
|
-
var FieldReference2 = import_zod19.z.string();
|
|
2081
|
-
var Matcher = import_zod19.z.object({
|
|
2158
|
+
var z20 = __toESM(require("zod/v4"));
|
|
2159
|
+
var FieldReference2 = z20.string();
|
|
2160
|
+
var Matcher = z20.object({
|
|
2082
2161
|
/**
|
|
2083
2162
|
* Reference to the field used in matching.
|
|
2084
2163
|
*
|
|
@@ -2086,68 +2165,68 @@ var Matcher = import_zod19.z.object({
|
|
|
2086
2165
|
* be used as the origin date to calculate the distance from.
|
|
2087
2166
|
*/
|
|
2088
2167
|
fieldId: FieldReference2,
|
|
2089
|
-
options:
|
|
2090
|
-
boost:
|
|
2168
|
+
options: z20.object({
|
|
2169
|
+
boost: z20.number().optional()
|
|
2091
2170
|
}).optional().default({
|
|
2092
2171
|
boost: 1
|
|
2093
2172
|
})
|
|
2094
2173
|
});
|
|
2095
2174
|
var FuzzyMatcher = Matcher.extend({
|
|
2096
|
-
type:
|
|
2097
|
-
options:
|
|
2175
|
+
type: z20.literal("fuzzy"),
|
|
2176
|
+
options: z20.object({
|
|
2098
2177
|
/**
|
|
2099
2178
|
* Names of length 3 or less characters = 0 edits allowed
|
|
2100
2179
|
* Names of length 4 - 6 characters = 1 edit allowed
|
|
2101
2180
|
* Names of length >7 characters = 2 edits allowed
|
|
2102
2181
|
*/
|
|
2103
|
-
fuzziness:
|
|
2104
|
-
boost:
|
|
2182
|
+
fuzziness: z20.union([z20.string(), z20.number()]).optional().default("AUTO:4,7"),
|
|
2183
|
+
boost: z20.number().optional().default(1)
|
|
2105
2184
|
}).optional().default({
|
|
2106
2185
|
fuzziness: "AUTO:4,7",
|
|
2107
2186
|
boost: 1
|
|
2108
2187
|
})
|
|
2109
2188
|
});
|
|
2110
2189
|
var StrictMatcher = Matcher.extend({
|
|
2111
|
-
type:
|
|
2112
|
-
options:
|
|
2113
|
-
boost:
|
|
2190
|
+
type: z20.literal("strict"),
|
|
2191
|
+
options: z20.object({
|
|
2192
|
+
boost: z20.number().optional().default(1),
|
|
2114
2193
|
/**
|
|
2115
2194
|
* The constant value to be present in the field for both records
|
|
2116
2195
|
*/
|
|
2117
|
-
value:
|
|
2196
|
+
value: z20.string().optional()
|
|
2118
2197
|
}).optional().default({
|
|
2119
2198
|
boost: 1
|
|
2120
2199
|
})
|
|
2121
2200
|
});
|
|
2122
2201
|
var DateRangeMatcher = Matcher.extend({
|
|
2123
|
-
type:
|
|
2124
|
-
options:
|
|
2202
|
+
type: z20.literal("dateRange"),
|
|
2203
|
+
options: z20.object({
|
|
2125
2204
|
/**
|
|
2126
2205
|
* The distance pivot in days. Distance from the origin (the value of
|
|
2127
2206
|
* fieldId) at which relevance scores receive half of the boost value
|
|
2128
2207
|
*/
|
|
2129
|
-
pivot:
|
|
2130
|
-
days:
|
|
2131
|
-
boost:
|
|
2208
|
+
pivot: z20.number().optional(),
|
|
2209
|
+
days: z20.number(),
|
|
2210
|
+
boost: z20.number().optional().default(1)
|
|
2132
2211
|
})
|
|
2133
2212
|
});
|
|
2134
|
-
var Not =
|
|
2135
|
-
type:
|
|
2213
|
+
var Not = z20.object({
|
|
2214
|
+
type: z20.literal("not"),
|
|
2136
2215
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2137
|
-
clause:
|
|
2216
|
+
clause: z20.lazy(() => Clause)
|
|
2138
2217
|
});
|
|
2139
|
-
var And =
|
|
2140
|
-
type:
|
|
2218
|
+
var And = z20.object({
|
|
2219
|
+
type: z20.literal("and"),
|
|
2141
2220
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2142
|
-
clauses:
|
|
2221
|
+
clauses: z20.lazy(() => Clause.array())
|
|
2143
2222
|
});
|
|
2144
|
-
var Or =
|
|
2145
|
-
type:
|
|
2223
|
+
var Or = z20.object({
|
|
2224
|
+
type: z20.literal("or"),
|
|
2146
2225
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2147
|
-
clauses:
|
|
2226
|
+
clauses: z20.lazy(() => Clause.array())
|
|
2148
2227
|
});
|
|
2149
|
-
var Clause =
|
|
2150
|
-
() =>
|
|
2228
|
+
var Clause = z20.lazy(
|
|
2229
|
+
() => z20.discriminatedUnion("type", [
|
|
2151
2230
|
Not,
|
|
2152
2231
|
And,
|
|
2153
2232
|
Or,
|
|
@@ -2155,193 +2234,328 @@ var Clause = import_zod19.z.lazy(
|
|
|
2155
2234
|
StrictMatcher,
|
|
2156
2235
|
DateRangeMatcher
|
|
2157
2236
|
])
|
|
2158
|
-
).
|
|
2159
|
-
|
|
2237
|
+
).meta({
|
|
2238
|
+
id: "Clause"
|
|
2160
2239
|
});
|
|
2161
|
-
var DeduplicationConfig =
|
|
2162
|
-
id:
|
|
2240
|
+
var DeduplicationConfig = z20.object({
|
|
2241
|
+
id: z20.string(),
|
|
2163
2242
|
label: TranslationConfig,
|
|
2164
2243
|
query: Clause
|
|
2165
2244
|
});
|
|
2166
2245
|
|
|
2246
|
+
// ../commons/src/icons.ts
|
|
2247
|
+
var z21 = __toESM(require("zod/v4"));
|
|
2248
|
+
var AvailableIcons = z21.enum([
|
|
2249
|
+
"Archived",
|
|
2250
|
+
"Assigned",
|
|
2251
|
+
"Briefcase",
|
|
2252
|
+
"Certified",
|
|
2253
|
+
"Close",
|
|
2254
|
+
"Collapse",
|
|
2255
|
+
"Draft",
|
|
2256
|
+
"DuplicateYellow",
|
|
2257
|
+
"Expand",
|
|
2258
|
+
"ExternalValidate",
|
|
2259
|
+
"FilledCheck",
|
|
2260
|
+
"InReview",
|
|
2261
|
+
"Offline",
|
|
2262
|
+
"Registered",
|
|
2263
|
+
"RequiresUpdates",
|
|
2264
|
+
"Sent",
|
|
2265
|
+
"Validated",
|
|
2266
|
+
"WaitingApproval",
|
|
2267
|
+
"ChartActivity",
|
|
2268
|
+
"Activity",
|
|
2269
|
+
"Archive",
|
|
2270
|
+
"ArchiveTray",
|
|
2271
|
+
"ArrowLeft",
|
|
2272
|
+
"ArrowRight",
|
|
2273
|
+
"Buildings",
|
|
2274
|
+
"Circle",
|
|
2275
|
+
"CaretDown",
|
|
2276
|
+
"CaretLeft",
|
|
2277
|
+
"CaretRight",
|
|
2278
|
+
"ChartBar",
|
|
2279
|
+
"ChartLine",
|
|
2280
|
+
"ChatCircle",
|
|
2281
|
+
"CheckSquare",
|
|
2282
|
+
"Compass",
|
|
2283
|
+
"Check",
|
|
2284
|
+
"Copy",
|
|
2285
|
+
"Database",
|
|
2286
|
+
"DotsThreeVertical",
|
|
2287
|
+
"ArrowCounterClockwise",
|
|
2288
|
+
"MagnifyingGlassMinus",
|
|
2289
|
+
"MagnifyingGlassPlus",
|
|
2290
|
+
"Export",
|
|
2291
|
+
"Eye",
|
|
2292
|
+
"EyeSlash",
|
|
2293
|
+
"Envelope",
|
|
2294
|
+
"File",
|
|
2295
|
+
"FileSearch",
|
|
2296
|
+
"FileMinus",
|
|
2297
|
+
"FilePlus",
|
|
2298
|
+
"FileText",
|
|
2299
|
+
"FileX",
|
|
2300
|
+
"Handshake",
|
|
2301
|
+
"Gear",
|
|
2302
|
+
"GitBranch",
|
|
2303
|
+
"IdentificationCard",
|
|
2304
|
+
"List",
|
|
2305
|
+
"ListBullets",
|
|
2306
|
+
"Lock",
|
|
2307
|
+
"MagnifyingGlass",
|
|
2308
|
+
"MapPin",
|
|
2309
|
+
"Medal",
|
|
2310
|
+
"NotePencil",
|
|
2311
|
+
"Paperclip",
|
|
2312
|
+
"PaperPlaneTilt",
|
|
2313
|
+
"Pen",
|
|
2314
|
+
"PenNib",
|
|
2315
|
+
"Pencil",
|
|
2316
|
+
"PencilSimpleLine",
|
|
2317
|
+
"Phone",
|
|
2318
|
+
"Plus",
|
|
2319
|
+
"Printer",
|
|
2320
|
+
"SignOut",
|
|
2321
|
+
"Stamp",
|
|
2322
|
+
"Star",
|
|
2323
|
+
"Target",
|
|
2324
|
+
"TextT",
|
|
2325
|
+
"Trash",
|
|
2326
|
+
"UploadSimple",
|
|
2327
|
+
"User",
|
|
2328
|
+
"UserPlus",
|
|
2329
|
+
"Users",
|
|
2330
|
+
"WarningCircle",
|
|
2331
|
+
"X",
|
|
2332
|
+
"ChatText",
|
|
2333
|
+
"CircleWavyCheck",
|
|
2334
|
+
"CircleWavyQuestion",
|
|
2335
|
+
"ArchiveBox",
|
|
2336
|
+
"ArrowCircleDown",
|
|
2337
|
+
"FileArrowUp",
|
|
2338
|
+
"FileDotted",
|
|
2339
|
+
"Files",
|
|
2340
|
+
"PencilLine",
|
|
2341
|
+
"PencilCircle",
|
|
2342
|
+
"UserCircle",
|
|
2343
|
+
"Clock",
|
|
2344
|
+
"QrCode",
|
|
2345
|
+
"Webcam",
|
|
2346
|
+
"Sun",
|
|
2347
|
+
"DeviceTabletCamera",
|
|
2348
|
+
"Globe",
|
|
2349
|
+
"Fingerprint",
|
|
2350
|
+
"PushPin",
|
|
2351
|
+
"Timer"
|
|
2352
|
+
]);
|
|
2353
|
+
|
|
2167
2354
|
// ../commons/src/events/ActionConfig.ts
|
|
2168
|
-
var
|
|
2169
|
-
(0, import_zod_openapi9.extendZodWithOpenApi)(import_zod20.z);
|
|
2170
|
-
var DeclarationReviewConfig = import_zod20.z.object({
|
|
2355
|
+
var DeclarationReviewConfig = z22.object({
|
|
2171
2356
|
title: TranslationConfig.describe("Title of the review page"),
|
|
2172
|
-
fields:
|
|
2357
|
+
fields: z22.array(FieldConfig).describe("Fields displayed on the review page for annotations.")
|
|
2173
2358
|
}).describe(
|
|
2174
2359
|
"Configuration of the declaration review page for collecting event-related metadata."
|
|
2175
2360
|
);
|
|
2176
|
-
var ActionConfigBase =
|
|
2177
|
-
label: TranslationConfig.describe("Human readable description of the action")
|
|
2361
|
+
var ActionConfigBase = z22.object({
|
|
2362
|
+
label: TranslationConfig.describe("Human readable description of the action"),
|
|
2363
|
+
flags: z22.array(ActionFlagConfig).optional().default([]).describe("Flag actions which are executed when the action is performed."),
|
|
2364
|
+
supportingCopy: TranslationConfig.optional().describe(
|
|
2365
|
+
"Text displayed on the confirmation dialog"
|
|
2366
|
+
),
|
|
2367
|
+
icon: AvailableIcons.describe("Icon representing the action").optional(),
|
|
2368
|
+
conditionals: z22.array(ActionConditional).optional().describe("Conditionals which can disable or hide actions.")
|
|
2178
2369
|
});
|
|
2179
2370
|
var DeclarationActionBase = ActionConfigBase.extend({
|
|
2180
|
-
review: DeclarationReviewConfig,
|
|
2181
2371
|
deduplication: DeduplicationConfig.optional()
|
|
2182
2372
|
});
|
|
2183
|
-
var ReadActionConfig = ActionConfigBase.
|
|
2184
|
-
|
|
2185
|
-
type:
|
|
2373
|
+
var ReadActionConfig = ActionConfigBase.extend(
|
|
2374
|
+
z22.object({
|
|
2375
|
+
type: z22.literal(ActionType.READ),
|
|
2186
2376
|
review: DeclarationReviewConfig.describe(
|
|
2187
2377
|
"Configuration of the review page for read-only view."
|
|
2188
|
-
)
|
|
2189
|
-
|
|
2190
|
-
)
|
|
2191
|
-
var DeclareConfig = DeclarationActionBase.merge(
|
|
2192
|
-
import_zod20.z.object({
|
|
2193
|
-
type: import_zod20.z.literal(ActionType.DECLARE)
|
|
2194
|
-
})
|
|
2378
|
+
),
|
|
2379
|
+
conditionals: z22.never().optional().describe("Read-action can not be disabled or hidden with conditionals.")
|
|
2380
|
+
}).shape
|
|
2195
2381
|
);
|
|
2196
|
-
var
|
|
2197
|
-
|
|
2198
|
-
type:
|
|
2199
|
-
|
|
2382
|
+
var DeclareConfig = DeclarationActionBase.extend(
|
|
2383
|
+
z22.object({
|
|
2384
|
+
type: z22.literal(ActionType.DECLARE),
|
|
2385
|
+
review: DeclarationReviewConfig.describe(
|
|
2386
|
+
"Configuration of the review page fields."
|
|
2387
|
+
),
|
|
2388
|
+
dialogCopy: z22.object({
|
|
2389
|
+
notify: TranslationConfig.describe(
|
|
2390
|
+
"Confirmation text for the notify action"
|
|
2391
|
+
),
|
|
2392
|
+
declare: TranslationConfig.describe(
|
|
2393
|
+
"Confirmation text for the declare action"
|
|
2394
|
+
),
|
|
2395
|
+
register: TranslationConfig.describe(
|
|
2396
|
+
"Confirmation text for the register action"
|
|
2397
|
+
)
|
|
2398
|
+
}).optional()
|
|
2399
|
+
}).shape
|
|
2200
2400
|
);
|
|
2201
|
-
var
|
|
2202
|
-
|
|
2203
|
-
type:
|
|
2204
|
-
})
|
|
2401
|
+
var ArchiveConfig = ActionConfigBase.extend(
|
|
2402
|
+
z22.object({
|
|
2403
|
+
type: z22.literal(ActionType.ARCHIVE)
|
|
2404
|
+
}).shape
|
|
2205
2405
|
);
|
|
2206
|
-
var
|
|
2207
|
-
|
|
2208
|
-
type:
|
|
2209
|
-
|
|
2406
|
+
var EditActionConfig = ActionConfigBase.extend(
|
|
2407
|
+
z22.object({
|
|
2408
|
+
type: z22.literal(ActionType.EDIT),
|
|
2409
|
+
dialogCopy: z22.object({
|
|
2410
|
+
notify: TranslationConfig.describe(
|
|
2411
|
+
"Confirmation text for the notify with edits action"
|
|
2412
|
+
),
|
|
2413
|
+
declare: TranslationConfig.describe(
|
|
2414
|
+
"Confirmation text for the declare with edits action"
|
|
2415
|
+
),
|
|
2416
|
+
register: TranslationConfig.describe(
|
|
2417
|
+
"Confirmation text for the register with edits action"
|
|
2418
|
+
)
|
|
2419
|
+
})
|
|
2420
|
+
}).shape
|
|
2210
2421
|
);
|
|
2211
|
-
var
|
|
2212
|
-
|
|
2213
|
-
type:
|
|
2214
|
-
})
|
|
2422
|
+
var RejectConfig = ActionConfigBase.extend(
|
|
2423
|
+
z22.object({
|
|
2424
|
+
type: z22.literal(ActionType.REJECT)
|
|
2425
|
+
}).shape
|
|
2215
2426
|
);
|
|
2216
|
-
var
|
|
2217
|
-
|
|
2218
|
-
type:
|
|
2219
|
-
})
|
|
2427
|
+
var RegisterConfig = DeclarationActionBase.extend(
|
|
2428
|
+
z22.object({
|
|
2429
|
+
type: z22.literal(ActionType.REGISTER)
|
|
2430
|
+
}).shape
|
|
2220
2431
|
);
|
|
2221
|
-
var PrintCertificateActionConfig = ActionConfigBase.
|
|
2222
|
-
|
|
2223
|
-
type:
|
|
2432
|
+
var PrintCertificateActionConfig = ActionConfigBase.extend(
|
|
2433
|
+
z22.object({
|
|
2434
|
+
type: z22.literal(ActionType.PRINT_CERTIFICATE),
|
|
2224
2435
|
printForm: ActionFormConfig
|
|
2225
|
-
})
|
|
2436
|
+
}).shape
|
|
2226
2437
|
);
|
|
2227
|
-
var RequestCorrectionConfig = ActionConfigBase.
|
|
2228
|
-
|
|
2229
|
-
type:
|
|
2438
|
+
var RequestCorrectionConfig = ActionConfigBase.extend(
|
|
2439
|
+
z22.object({
|
|
2440
|
+
type: z22.literal(ActionType.REQUEST_CORRECTION),
|
|
2230
2441
|
correctionForm: ActionFormConfig
|
|
2231
|
-
})
|
|
2442
|
+
}).shape
|
|
2232
2443
|
);
|
|
2233
|
-
var
|
|
2234
|
-
|
|
2235
|
-
type:
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2444
|
+
var CustomActionConfig = ActionConfigBase.merge(
|
|
2445
|
+
z22.object({
|
|
2446
|
+
type: z22.literal(ActionType.CUSTOM),
|
|
2447
|
+
customActionType: z22.string().describe("Type identifier of the custom action."),
|
|
2448
|
+
/** 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. */
|
|
2449
|
+
form: z22.array(FieldConfig).describe(
|
|
2450
|
+
"Form configuration for the custom action. The form configured here will be used on the custom action confirmation modal."
|
|
2451
|
+
),
|
|
2452
|
+
auditHistoryLabel: TranslationConfig.describe(
|
|
2453
|
+
'The label to show in audit history for this action. For example "Approved".'
|
|
2454
|
+
)
|
|
2241
2455
|
})
|
|
2242
2456
|
);
|
|
2243
|
-
var ActionConfig =
|
|
2457
|
+
var ActionConfig = z22.discriminatedUnion("type", [
|
|
2244
2458
|
/*
|
|
2245
2459
|
* OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
|
|
2246
2460
|
* and treat them as "models" instead of duplicating the data structure in each endpoint.
|
|
2247
2461
|
*/
|
|
2248
|
-
ReadActionConfig.
|
|
2249
|
-
DeclareConfig.
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
DeleteConfig.openapi({ ref: "DeleteActionConfig" }),
|
|
2255
|
-
PrintCertificateActionConfig.openapi({
|
|
2256
|
-
ref: "PrintCertificateActionConfig"
|
|
2462
|
+
ReadActionConfig.meta({ id: "ReadActionConfig" }),
|
|
2463
|
+
DeclareConfig.meta({ id: "DeclareActionConfig" }),
|
|
2464
|
+
RejectConfig.meta({ id: "RejectActionConfig" }),
|
|
2465
|
+
RegisterConfig.meta({ id: "RegisterActionConfig" }),
|
|
2466
|
+
PrintCertificateActionConfig.meta({
|
|
2467
|
+
id: "PrintCertificateActionConfig"
|
|
2257
2468
|
}),
|
|
2258
|
-
RequestCorrectionConfig.
|
|
2259
|
-
|
|
2260
|
-
|
|
2469
|
+
RequestCorrectionConfig.meta({ id: "RequestCorrectionActionConfig" }),
|
|
2470
|
+
EditActionConfig.meta({ id: "EditActionConfig" }),
|
|
2471
|
+
ArchiveConfig.meta({ id: "ArchiveActionConfig" }),
|
|
2472
|
+
CustomActionConfig.meta({ id: "CustomActionConfig" })
|
|
2261
2473
|
]).describe(
|
|
2262
2474
|
"Configuration of an action available for an event. Data collected depends on the action type and is accessible through the annotation property in ActionDocument."
|
|
2263
|
-
).
|
|
2264
|
-
var
|
|
2475
|
+
).meta({ id: "ActionConfig" });
|
|
2476
|
+
var actionConfigTypes = new Set(
|
|
2477
|
+
ActionConfig.options.map((opt) => opt.shape.type.value)
|
|
2478
|
+
);
|
|
2479
|
+
var DeclarationActionConfig = z22.discriminatedUnion("type", [
|
|
2265
2480
|
DeclareConfig,
|
|
2266
|
-
ValidateConfig,
|
|
2267
2481
|
RegisterConfig
|
|
2268
2482
|
]);
|
|
2269
2483
|
|
|
2270
2484
|
// ../commons/src/events/offline/CertificateConfig.ts
|
|
2271
|
-
var
|
|
2272
|
-
var FontFamily =
|
|
2273
|
-
normal:
|
|
2274
|
-
bold:
|
|
2275
|
-
italics:
|
|
2276
|
-
bolditalics:
|
|
2277
|
-
});
|
|
2278
|
-
var CertificateConfig =
|
|
2279
|
-
id:
|
|
2280
|
-
event:
|
|
2281
|
-
isV2Template:
|
|
2485
|
+
var z23 = __toESM(require("zod/v4"));
|
|
2486
|
+
var FontFamily = z23.object({
|
|
2487
|
+
normal: z23.string(),
|
|
2488
|
+
bold: z23.string(),
|
|
2489
|
+
italics: z23.string(),
|
|
2490
|
+
bolditalics: z23.string()
|
|
2491
|
+
});
|
|
2492
|
+
var CertificateConfig = z23.object({
|
|
2493
|
+
id: z23.string(),
|
|
2494
|
+
event: z23.string(),
|
|
2495
|
+
isV2Template: z23.boolean().optional(),
|
|
2282
2496
|
label: TranslationConfig,
|
|
2283
|
-
isDefault:
|
|
2284
|
-
fee:
|
|
2285
|
-
onTime:
|
|
2286
|
-
late:
|
|
2287
|
-
delayed:
|
|
2497
|
+
isDefault: z23.boolean(),
|
|
2498
|
+
fee: z23.object({
|
|
2499
|
+
onTime: z23.number(),
|
|
2500
|
+
late: z23.number(),
|
|
2501
|
+
delayed: z23.number()
|
|
2288
2502
|
}),
|
|
2289
|
-
svgUrl:
|
|
2290
|
-
fonts:
|
|
2291
|
-
conditionals:
|
|
2503
|
+
svgUrl: z23.string(),
|
|
2504
|
+
fonts: z23.record(z23.string(), FontFamily).optional(),
|
|
2505
|
+
conditionals: z23.array(ShowConditional).optional()
|
|
2292
2506
|
});
|
|
2293
2507
|
var CertificateTemplateConfig = CertificateConfig.extend({
|
|
2294
|
-
hash:
|
|
2295
|
-
svg:
|
|
2508
|
+
hash: z23.string().optional(),
|
|
2509
|
+
svg: z23.string()
|
|
2296
2510
|
});
|
|
2297
2511
|
|
|
2298
2512
|
// ../commons/src/events/offline/LanguageConfig.ts
|
|
2299
|
-
var
|
|
2300
|
-
var LanguageConfig =
|
|
2301
|
-
lang:
|
|
2513
|
+
var z24 = __toESM(require("zod/v4"));
|
|
2514
|
+
var LanguageConfig = z24.object({
|
|
2515
|
+
lang: z24.string(),
|
|
2302
2516
|
/**
|
|
2303
2517
|
* client.csv contents
|
|
2304
2518
|
*/
|
|
2305
|
-
messages:
|
|
2519
|
+
messages: z24.record(z24.string(), z24.string())
|
|
2306
2520
|
});
|
|
2307
2521
|
|
|
2308
2522
|
// ../commons/src/events/EventConfig.ts
|
|
2309
|
-
var
|
|
2523
|
+
var z30 = __toESM(require("zod/v4"));
|
|
2310
2524
|
|
|
2311
2525
|
// ../commons/src/events/SummaryConfig.ts
|
|
2312
|
-
var
|
|
2313
|
-
var BaseField2 =
|
|
2526
|
+
var z25 = __toESM(require("zod/v4"));
|
|
2527
|
+
var BaseField2 = z25.object({
|
|
2314
2528
|
emptyValueMessage: TranslationConfig.optional().describe(
|
|
2315
2529
|
"Default message displayed when the field value is empty."
|
|
2316
2530
|
),
|
|
2317
|
-
conditionals:
|
|
2531
|
+
conditionals: z25.array(ShowConditional).default([]).optional()
|
|
2318
2532
|
});
|
|
2319
2533
|
var ReferenceField = BaseField2.extend({
|
|
2320
|
-
fieldId:
|
|
2534
|
+
fieldId: z25.string(),
|
|
2321
2535
|
label: TranslationConfig.optional().describe(
|
|
2322
2536
|
"Overrides the default label from the referenced field when provided."
|
|
2323
2537
|
)
|
|
2324
2538
|
}).describe("Field referencing existing event data by field ID.");
|
|
2325
2539
|
var Field = BaseField2.extend({
|
|
2326
|
-
id:
|
|
2540
|
+
id: z25.string().describe("Identifier of the summary field."),
|
|
2327
2541
|
value: TranslationConfig.describe(
|
|
2328
2542
|
'Field value template supporting variables from configuration and EventMetadata (e.g. "{informant.phoneNo} {informant.email}").'
|
|
2329
2543
|
),
|
|
2330
2544
|
label: TranslationConfig
|
|
2331
2545
|
}).describe("Custom field defined for the summary view.");
|
|
2332
|
-
var SummaryConfig =
|
|
2333
|
-
fields:
|
|
2546
|
+
var SummaryConfig = z25.object({
|
|
2547
|
+
fields: z25.array(z25.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
|
|
2334
2548
|
}).describe("Configuration of the event summary section.");
|
|
2335
2549
|
|
|
2336
2550
|
// ../commons/src/events/AdvancedSearchConfig.ts
|
|
2337
|
-
var
|
|
2338
|
-
var MatchType =
|
|
2339
|
-
var BaseField3 =
|
|
2340
|
-
config:
|
|
2551
|
+
var z26 = __toESM(require("zod/v4"));
|
|
2552
|
+
var MatchType = z26.enum(["fuzzy", "exact", "range", "within"]);
|
|
2553
|
+
var BaseField3 = z26.object({
|
|
2554
|
+
config: z26.object({
|
|
2341
2555
|
type: MatchType.describe(
|
|
2342
2556
|
"Determines the search type of field. How to match value."
|
|
2343
2557
|
),
|
|
2344
|
-
searchFields:
|
|
2558
|
+
searchFields: z26.array(z26.string()).optional().describe(
|
|
2345
2559
|
`
|
|
2346
2560
|
Defines multiple form fields that should be searched when this field has a value.
|
|
2347
2561
|
All specified fields will be combined using OR logic.
|
|
@@ -2351,7 +2565,7 @@ var BaseField3 = import_zod24.z.object({
|
|
|
2351
2565
|
`
|
|
2352
2566
|
)
|
|
2353
2567
|
}),
|
|
2354
|
-
type:
|
|
2568
|
+
type: z26.nativeEnum(FieldType).optional().describe(
|
|
2355
2569
|
`
|
|
2356
2570
|
Explicitly specify the field type for searchFields.
|
|
2357
2571
|
This is required when searchFields is defined, to show the correct control in the UI.
|
|
@@ -2365,7 +2579,7 @@ var BaseField3 = import_zod24.z.object({
|
|
|
2365
2579
|
This is required when searchFields is defined.
|
|
2366
2580
|
`
|
|
2367
2581
|
),
|
|
2368
|
-
options:
|
|
2582
|
+
options: z26.array(SelectOption).optional(),
|
|
2369
2583
|
searchCriteriaLabelPrefix: TranslationConfig.optional().describe(
|
|
2370
2584
|
`
|
|
2371
2585
|
This property determines whether to add a prefix (such as "Child" or "Applicant") before the field label
|
|
@@ -2386,7 +2600,7 @@ var BaseField3 = import_zod24.z.object({
|
|
|
2386
2600
|
in the country-config > event.advancedSearch configuration. For example: field("child.dob", { searchCriteriaLabelPrefix: TranslationConfig }).
|
|
2387
2601
|
`
|
|
2388
2602
|
),
|
|
2389
|
-
conditionals:
|
|
2603
|
+
conditionals: z26.array(FieldConditional).optional().describe(
|
|
2390
2604
|
`
|
|
2391
2605
|
In advanced search, we sometimes need to override the default field visibility conditionals.
|
|
2392
2606
|
|
|
@@ -2400,20 +2614,20 @@ var BaseField3 = import_zod24.z.object({
|
|
|
2400
2614
|
are always rendered in the advanced search form.
|
|
2401
2615
|
`
|
|
2402
2616
|
),
|
|
2403
|
-
validations:
|
|
2617
|
+
validations: z26.array(ValidationConfig).optional().describe(
|
|
2404
2618
|
`Option for overriding the field validations specifically for advanced search form.`
|
|
2405
2619
|
)
|
|
2406
2620
|
});
|
|
2407
|
-
var SearchQueryParams =
|
|
2408
|
-
eventType:
|
|
2621
|
+
var SearchQueryParams = z26.object({
|
|
2622
|
+
eventType: z26.string().optional().describe(
|
|
2409
2623
|
"Defines type of event so that when redirecting to Advanced Search page, appropriate tab can be selected"
|
|
2410
2624
|
)
|
|
2411
2625
|
}).catchall(FieldValue);
|
|
2412
2626
|
var FieldConfigSchema = BaseField3.extend({
|
|
2413
|
-
fieldId:
|
|
2414
|
-
fieldType:
|
|
2627
|
+
fieldId: z26.string(),
|
|
2628
|
+
fieldType: z26.literal("field")
|
|
2415
2629
|
});
|
|
2416
|
-
var EventFieldIdInput =
|
|
2630
|
+
var EventFieldIdInput = z26.enum([
|
|
2417
2631
|
"trackingId",
|
|
2418
2632
|
"status",
|
|
2419
2633
|
"legalStatuses.REGISTERED.acceptedAt",
|
|
@@ -2422,7 +2636,7 @@ var EventFieldIdInput = import_zod24.z.enum([
|
|
|
2422
2636
|
"updatedAt"
|
|
2423
2637
|
]);
|
|
2424
2638
|
var METADATA_FIELD_PREFIX = "event.";
|
|
2425
|
-
var EventFieldId =
|
|
2639
|
+
var EventFieldId = z26.enum([
|
|
2426
2640
|
`${METADATA_FIELD_PREFIX}trackingId`,
|
|
2427
2641
|
`${METADATA_FIELD_PREFIX}status`,
|
|
2428
2642
|
`${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.acceptedAt`,
|
|
@@ -2432,29 +2646,29 @@ var EventFieldId = import_zod24.z.enum([
|
|
|
2432
2646
|
]);
|
|
2433
2647
|
var EventFieldConfigSchema = BaseField3.extend({
|
|
2434
2648
|
fieldId: EventFieldId,
|
|
2435
|
-
fieldType:
|
|
2649
|
+
fieldType: z26.literal("event")
|
|
2436
2650
|
});
|
|
2437
|
-
var AdvancedSearchField =
|
|
2651
|
+
var AdvancedSearchField = z26.discriminatedUnion("fieldType", [FieldConfigSchema, EventFieldConfigSchema]).superRefine((data, ctx) => {
|
|
2438
2652
|
if (data.config.searchFields && data.config.searchFields.length > 0) {
|
|
2439
2653
|
if (!data.label) {
|
|
2440
2654
|
ctx.addIssue({
|
|
2441
|
-
code:
|
|
2655
|
+
code: z26.ZodIssueCode.custom,
|
|
2442
2656
|
message: "label is required when config.searchFields is defined.",
|
|
2443
2657
|
path: ["label"]
|
|
2444
2658
|
});
|
|
2445
2659
|
}
|
|
2446
2660
|
if (!data.type) {
|
|
2447
2661
|
ctx.addIssue({
|
|
2448
|
-
code:
|
|
2662
|
+
code: z26.ZodIssueCode.custom,
|
|
2449
2663
|
message: "type is required when config.searchFields is defined.",
|
|
2450
2664
|
path: ["type"]
|
|
2451
2665
|
});
|
|
2452
2666
|
}
|
|
2453
2667
|
}
|
|
2454
2668
|
});
|
|
2455
|
-
var AdvancedSearchConfig =
|
|
2669
|
+
var AdvancedSearchConfig = z26.object({
|
|
2456
2670
|
title: TranslationConfig.describe("Advanced search tab title"),
|
|
2457
|
-
fields:
|
|
2671
|
+
fields: z26.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
|
|
2458
2672
|
});
|
|
2459
2673
|
|
|
2460
2674
|
// ../commons/src/events/utils.ts
|
|
@@ -2463,11 +2677,11 @@ var import_lodash = require("lodash");
|
|
|
2463
2677
|
// ../commons/src/conditionals/validate.ts
|
|
2464
2678
|
var import__ = __toESM(require("ajv/dist/2019"));
|
|
2465
2679
|
var import_ajv_formats = __toESM(require("ajv-formats"));
|
|
2466
|
-
var
|
|
2680
|
+
var z28 = __toESM(require("zod/v4"));
|
|
2467
2681
|
var import_date_fns = require("date-fns");
|
|
2468
2682
|
|
|
2469
2683
|
// ../commons/src/events/DynamicFieldValue.ts
|
|
2470
|
-
var
|
|
2684
|
+
var z27 = __toESM(require("zod/v4"));
|
|
2471
2685
|
|
|
2472
2686
|
// ../commons/src/conditionals/validate.ts
|
|
2473
2687
|
var ajv = new import__.default({
|
|
@@ -2476,9 +2690,9 @@ var ajv = new import__.default({
|
|
|
2476
2690
|
strict: false
|
|
2477
2691
|
// Allow minContains and other newer features
|
|
2478
2692
|
});
|
|
2479
|
-
var DataContext =
|
|
2480
|
-
rootData:
|
|
2481
|
-
$leafAdminStructureLocationIds:
|
|
2693
|
+
var DataContext = z28.object({
|
|
2694
|
+
rootData: z28.object({
|
|
2695
|
+
$leafAdminStructureLocationIds: z28.array(z28.object({ id: UUID }))
|
|
2482
2696
|
})
|
|
2483
2697
|
});
|
|
2484
2698
|
function resolveDataPath(rootData, dataPath, instancePath) {
|
|
@@ -2555,12 +2769,12 @@ ajv.addKeyword({
|
|
|
2555
2769
|
});
|
|
2556
2770
|
|
|
2557
2771
|
// ../commons/src/utils.ts
|
|
2558
|
-
var
|
|
2559
|
-
var FullNameV1 =
|
|
2560
|
-
|
|
2561
|
-
use:
|
|
2562
|
-
family:
|
|
2563
|
-
given:
|
|
2772
|
+
var z29 = __toESM(require("zod/v4"));
|
|
2773
|
+
var FullNameV1 = z29.array(
|
|
2774
|
+
z29.object({
|
|
2775
|
+
use: z29.string(),
|
|
2776
|
+
family: z29.string(),
|
|
2777
|
+
given: z29.array(z29.string())
|
|
2564
2778
|
})
|
|
2565
2779
|
);
|
|
2566
2780
|
function omitKeyDeep(obj, keyToRemove) {
|
|
@@ -2581,9 +2795,6 @@ function omitKeyDeep(obj, keyToRemove) {
|
|
|
2581
2795
|
|
|
2582
2796
|
// ../commons/src/events/utils.ts
|
|
2583
2797
|
var import_date_fns2 = require("date-fns");
|
|
2584
|
-
function isDeclarationActionConfig(action) {
|
|
2585
|
-
return DeclarationActions.safeParse(action.type).success;
|
|
2586
|
-
}
|
|
2587
2798
|
function getDeclarationFields(configuration) {
|
|
2588
2799
|
return configuration.declaration.pages.flatMap(({ fields }) => fields);
|
|
2589
2800
|
}
|
|
@@ -2594,7 +2805,10 @@ var getActionAnnotationFields = (actionConfig) => {
|
|
|
2594
2805
|
if (actionConfig.type === ActionType.PRINT_CERTIFICATE) {
|
|
2595
2806
|
return actionConfig.printForm.pages.flatMap(({ fields }) => fields);
|
|
2596
2807
|
}
|
|
2597
|
-
if (
|
|
2808
|
+
if (actionConfig.type === ActionType.CUSTOM) {
|
|
2809
|
+
return actionConfig.form;
|
|
2810
|
+
}
|
|
2811
|
+
if ("review" in actionConfig) {
|
|
2598
2812
|
return actionConfig.review.fields;
|
|
2599
2813
|
}
|
|
2600
2814
|
return [];
|
|
@@ -2614,38 +2828,8 @@ var EXCLUDED_ACTIONS = [
|
|
|
2614
2828
|
ActionType.REJECT_CORRECTION
|
|
2615
2829
|
];
|
|
2616
2830
|
|
|
2617
|
-
// ../commons/src/events/
|
|
2618
|
-
|
|
2619
|
-
(0, import_zod_openapi10.extendZodWithOpenApi)(import_zod27.z);
|
|
2620
|
-
var EventConfig = import_zod27.z.object({
|
|
2621
|
-
id: import_zod27.z.string().describe(
|
|
2622
|
-
'Machine-readable identifier of the event (e.g. "birth", "death").'
|
|
2623
|
-
),
|
|
2624
|
-
dateOfEvent: FieldReference.optional().describe(
|
|
2625
|
-
"Reference to the field capturing the date of the event (e.g. date of birth). Defaults to the event creation date if unspecified."
|
|
2626
|
-
),
|
|
2627
|
-
title: TranslationConfig.describe(
|
|
2628
|
-
'Title template for the singular event, supporting variables (e.g. "{applicant.name.firstname} {applicant.name.surname}").'
|
|
2629
|
-
),
|
|
2630
|
-
fallbackTitle: TranslationConfig.optional().describe(
|
|
2631
|
-
"Fallback title shown when the main title resolves to an empty value."
|
|
2632
|
-
),
|
|
2633
|
-
summary: SummaryConfig.describe(
|
|
2634
|
-
"Summary information displayed in the event overview."
|
|
2635
|
-
),
|
|
2636
|
-
label: TranslationConfig.describe(
|
|
2637
|
-
"Human-readable label for the event type."
|
|
2638
|
-
),
|
|
2639
|
-
actions: import_zod27.z.array(ActionConfig).describe(
|
|
2640
|
-
"Configuration of system-defined actions associated with the event."
|
|
2641
|
-
),
|
|
2642
|
-
declaration: DeclarationFormConfig.describe(
|
|
2643
|
-
"Configuration of the form used to gather event data."
|
|
2644
|
-
),
|
|
2645
|
-
advancedSearch: import_zod27.z.array(AdvancedSearchConfig).optional().default([]).describe(
|
|
2646
|
-
"Configuration of fields available in the advanced search feature."
|
|
2647
|
-
)
|
|
2648
|
-
}).superRefine((event2, ctx) => {
|
|
2831
|
+
// ../commons/src/events/eventConfigValidation.ts
|
|
2832
|
+
function validateAdvancedSearchConfig(event2, ctx) {
|
|
2649
2833
|
const allFields = findAllFields(event2);
|
|
2650
2834
|
const fieldIds = allFields.map((field3) => field3.id);
|
|
2651
2835
|
const advancedSearchFields = event2.advancedSearch.flatMap(
|
|
@@ -2672,10 +2856,12 @@ var EventConfig = import_zod27.z.object({
|
|
|
2672
2856
|
ctx.addIssue({
|
|
2673
2857
|
code: "custom",
|
|
2674
2858
|
message: `Advanced search id must match a field id of form fields or pre-defined metadata fields.
|
|
2675
|
-
|
|
2859
|
+
Invalid AdvancedSearch field IDs for event ${event2.id}: ${invalidFields.map((f) => f.fieldId).join(", ")}`,
|
|
2676
2860
|
path: ["advancedSearch"]
|
|
2677
2861
|
});
|
|
2678
2862
|
}
|
|
2863
|
+
}
|
|
2864
|
+
function validateDateOfEvent(event2, ctx) {
|
|
2679
2865
|
if (event2.dateOfEvent) {
|
|
2680
2866
|
const eventDateFieldId = getDeclarationFields(event2).find(
|
|
2681
2867
|
({ id }) => id === event2.dateOfEvent?.$$field
|
|
@@ -2684,7 +2870,7 @@ var EventConfig = import_zod27.z.object({
|
|
|
2684
2870
|
ctx.addIssue({
|
|
2685
2871
|
code: "custom",
|
|
2686
2872
|
message: `Date of event field id must match a field id in fields array.
|
|
2687
|
-
|
|
2873
|
+
Invalid date of event field ID for event ${event2.id}: ${event2.dateOfEvent.$$field}`,
|
|
2688
2874
|
path: ["dateOfEvent"]
|
|
2689
2875
|
});
|
|
2690
2876
|
} else if (eventDateFieldId.type !== FieldType.DATE) {
|
|
@@ -2695,12 +2881,114 @@ var EventConfig = import_zod27.z.object({
|
|
|
2695
2881
|
});
|
|
2696
2882
|
}
|
|
2697
2883
|
}
|
|
2698
|
-
}
|
|
2699
|
-
|
|
2884
|
+
}
|
|
2885
|
+
function validatePlaceOfEvent(event2, ctx) {
|
|
2886
|
+
if (event2.placeOfEvent) {
|
|
2887
|
+
const eventPlaceFieldId = getDeclarationFields(event2).find(
|
|
2888
|
+
({ id }) => id === event2.placeOfEvent?.$$field
|
|
2889
|
+
);
|
|
2890
|
+
if (!eventPlaceFieldId) {
|
|
2891
|
+
ctx.addIssue({
|
|
2892
|
+
code: "custom",
|
|
2893
|
+
message: `Place of event field id must match a field id in the event.declaration fields.
|
|
2894
|
+
Invalid place of event field ID for event ${event2.id}: ${event2.placeOfEvent.$$field}`,
|
|
2895
|
+
path: ["placeOfEvent"]
|
|
2896
|
+
});
|
|
2897
|
+
}
|
|
2898
|
+
}
|
|
2899
|
+
}
|
|
2900
|
+
function validateActionFlags(event2, ctx) {
|
|
2901
|
+
const isInherentFlag = (value) => Object.values(InherentFlags).includes(value);
|
|
2902
|
+
const configuredFlagIds = event2.flags.map((flag) => flag.id);
|
|
2903
|
+
const actionFlagIds = event2.actions.flatMap(
|
|
2904
|
+
(action) => action.flags.map((flag) => flag.id)
|
|
2905
|
+
);
|
|
2906
|
+
for (const actionFlagId of actionFlagIds) {
|
|
2907
|
+
const isConfigured = configuredFlagIds.includes(actionFlagId);
|
|
2908
|
+
const isInherent = isInherentFlag(actionFlagId);
|
|
2909
|
+
if (!isConfigured && !isInherent) {
|
|
2910
|
+
ctx.addIssue({
|
|
2911
|
+
code: "custom",
|
|
2912
|
+
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}'`,
|
|
2913
|
+
path: ["actions"]
|
|
2914
|
+
});
|
|
2915
|
+
}
|
|
2916
|
+
}
|
|
2917
|
+
}
|
|
2918
|
+
function validateActionOrder(event2, ctx) {
|
|
2919
|
+
if (event2.actionOrder) {
|
|
2920
|
+
const customActionTypes = event2.actions.filter((action) => action.type === ActionType.CUSTOM).map((action) => action.customActionType);
|
|
2921
|
+
const validActionTypes = [
|
|
2922
|
+
...workqueueActions.options,
|
|
2923
|
+
...customActionTypes
|
|
2924
|
+
];
|
|
2925
|
+
for (const actionType of event2.actionOrder) {
|
|
2926
|
+
if (!validActionTypes.includes(actionType)) {
|
|
2927
|
+
ctx.addIssue({
|
|
2928
|
+
code: "custom",
|
|
2929
|
+
message: `Invalid action type in action order: ${actionType}`,
|
|
2930
|
+
path: ["actionOrder"]
|
|
2931
|
+
});
|
|
2932
|
+
}
|
|
2933
|
+
}
|
|
2934
|
+
}
|
|
2935
|
+
}
|
|
2936
|
+
|
|
2937
|
+
// ../commons/src/events/EventConfig.ts
|
|
2938
|
+
var EventConfig = z30.object({
|
|
2939
|
+
id: z30.string().describe(
|
|
2940
|
+
'Machine-readable identifier of the event (e.g. "birth", "death").'
|
|
2941
|
+
),
|
|
2942
|
+
dateOfEvent: FieldReference.optional().describe(
|
|
2943
|
+
"Reference to the field capturing the date of the event (e.g. date of birth). Defaults to the event creation date if unspecified."
|
|
2944
|
+
),
|
|
2945
|
+
placeOfEvent: FieldReference.optional().describe(
|
|
2946
|
+
"Reference to the field capturing the place of the event (e.g. place of birth). Defaults to the meta.createdAtLocation if unspecified."
|
|
2947
|
+
),
|
|
2948
|
+
title: TranslationConfig.describe(
|
|
2949
|
+
'Title template for the singular event, supporting variables (e.g. "{applicant.name.firstname} {applicant.name.surname}").'
|
|
2950
|
+
),
|
|
2951
|
+
fallbackTitle: TranslationConfig.optional().describe(
|
|
2952
|
+
"Fallback title shown when the main title resolves to an empty value."
|
|
2953
|
+
),
|
|
2954
|
+
summary: SummaryConfig.describe(
|
|
2955
|
+
"Summary information displayed in the event overview."
|
|
2956
|
+
),
|
|
2957
|
+
label: TranslationConfig.describe(
|
|
2958
|
+
"Human-readable label for the event type."
|
|
2959
|
+
),
|
|
2960
|
+
actions: z30.array(ActionConfig).describe(
|
|
2961
|
+
"Configuration of system-defined actions associated with the event."
|
|
2962
|
+
),
|
|
2963
|
+
actionOrder: z30.array(z30.string()).optional().describe(
|
|
2964
|
+
"Order of actions in the action menu. Use either the action type for core actions or the customActionType for custom actions."
|
|
2965
|
+
),
|
|
2966
|
+
declaration: DeclarationFormConfig.describe(
|
|
2967
|
+
"Configuration of the form used to gather event data."
|
|
2968
|
+
),
|
|
2969
|
+
advancedSearch: z30.array(AdvancedSearchConfig).optional().default([]).describe(
|
|
2970
|
+
"Configuration of fields available in the advanced search feature."
|
|
2971
|
+
),
|
|
2972
|
+
flags: z30.array(FlagConfig).optional().default([]).describe(
|
|
2973
|
+
"Configuration of flags associated with the actions of this event type."
|
|
2974
|
+
)
|
|
2975
|
+
}).superRefine((event2, ctx) => {
|
|
2976
|
+
validateAdvancedSearchConfig(event2, ctx);
|
|
2977
|
+
validateDateOfEvent(event2, ctx);
|
|
2978
|
+
validatePlaceOfEvent(event2, ctx);
|
|
2979
|
+
validateActionFlags(event2, ctx);
|
|
2980
|
+
validateActionOrder(event2, ctx);
|
|
2981
|
+
}).meta({
|
|
2982
|
+
id: "EventConfig"
|
|
2700
2983
|
}).describe("Configuration defining an event type.");
|
|
2701
2984
|
|
|
2985
|
+
// ../commons/src/events/EventConfigInput.ts
|
|
2986
|
+
var defineDeclarationForm = (form) => DeclarationFormConfig.parse(form);
|
|
2987
|
+
var defineActionForm = (actionForm) => ActionFormConfig.parse(actionForm);
|
|
2988
|
+
var defineFormPage = (formPage) => FormPageConfig.parse(formPage);
|
|
2989
|
+
|
|
2702
2990
|
// ../commons/src/events/WorkqueueConfig.ts
|
|
2703
|
-
var
|
|
2991
|
+
var z33 = __toESM(require("zod/v4"));
|
|
2704
2992
|
|
|
2705
2993
|
// ../commons/src/conditionals/conditionals.ts
|
|
2706
2994
|
var objectHash = __toESM(require("object-hash"));
|
|
@@ -2738,7 +3026,7 @@ function not(condition) {
|
|
|
2738
3026
|
required: []
|
|
2739
3027
|
});
|
|
2740
3028
|
}
|
|
2741
|
-
function
|
|
3029
|
+
function never2() {
|
|
2742
3030
|
return not(alwaysTrue());
|
|
2743
3031
|
}
|
|
2744
3032
|
function jsonFieldPath(field3) {
|
|
@@ -3417,208 +3705,99 @@ var event = Object.assign(eventFn, {
|
|
|
3417
3705
|
* Builds a conditional that sets a maximum count for the number of actions.
|
|
3418
3706
|
* This is useful for limiting the number of actions of a specific type in a single event.
|
|
3419
3707
|
*/
|
|
3420
|
-
maxCount: (maxCount) => createCountConditional("maxContains", maxCount, additionalFields)
|
|
3421
|
-
};
|
|
3422
|
-
};
|
|
3423
|
-
const chainableMethods = {
|
|
3424
|
-
/**
|
|
3425
|
-
* Adds additional field constraints to the action matching.
|
|
3426
|
-
*
|
|
3427
|
-
* @param fields - Object containing additional fields to match on the action.
|
|
3428
|
-
*/
|
|
3429
|
-
withFields: (fields) => withMinMax(fields),
|
|
3430
|
-
/**
|
|
3431
|
-
* Adds template ID constraint to the action matching.
|
|
3432
|
-
* This is a convenience method that adds content.templateId to the fields.
|
|
3433
|
-
*
|
|
3434
|
-
* @param id - The template ID to match against.
|
|
3435
|
-
*/
|
|
3436
|
-
withTemplate: (id) => withMinMax({
|
|
3437
|
-
content: { templateId: id }
|
|
3438
|
-
}),
|
|
3439
|
-
...withMinMax()
|
|
3440
|
-
};
|
|
3441
|
-
return { ...basicConditional, ...chainableMethods };
|
|
3442
|
-
},
|
|
3443
|
-
field(field3) {
|
|
3444
|
-
return {
|
|
3445
|
-
$event: field3
|
|
3446
|
-
};
|
|
3447
|
-
}
|
|
3448
|
-
});
|
|
3449
|
-
|
|
3450
|
-
// ../commons/src/events/WorkqueueColumnConfig.ts
|
|
3451
|
-
var
|
|
3452
|
-
var WorkqueueColumnKeysArray = [
|
|
3453
|
-
...EventMetadataKeysArray,
|
|
3454
|
-
"title",
|
|
3455
|
-
"outbox"
|
|
3456
|
-
];
|
|
3457
|
-
var WorkqueueColumnKeys =
|
|
3458
|
-
var WorkqueueColumnValue =
|
|
3459
|
-
$event: WorkqueueColumnKeys
|
|
3460
|
-
});
|
|
3461
|
-
var WorkqueueColumn =
|
|
3462
|
-
label: TranslationConfig,
|
|
3463
|
-
value: WorkqueueColumnValue
|
|
3464
|
-
});
|
|
3465
|
-
function defineWorkqueuesColumns(workqueueColumns) {
|
|
3466
|
-
return workqueueColumns.map(
|
|
3467
|
-
(workqueueColumn) => WorkqueueColumn.parse(workqueueColumn)
|
|
3468
|
-
);
|
|
3469
|
-
}
|
|
3470
|
-
|
|
3471
|
-
// ../commons/src/events/CountryConfigQueryInput.ts
|
|
3472
|
-
var
|
|
3473
|
-
var SerializableExact =
|
|
3474
|
-
type:
|
|
3475
|
-
term:
|
|
3476
|
-
});
|
|
3477
|
-
var SerializableWithin =
|
|
3478
|
-
type:
|
|
3479
|
-
location:
|
|
3480
|
-
});
|
|
3481
|
-
var SerializedQueryExpression =
|
|
3482
|
-
eventType:
|
|
3483
|
-
status:
|
|
3484
|
-
createdAt:
|
|
3485
|
-
updatedAt:
|
|
3486
|
-
"legalStatuses.REGISTERED.createdAt":
|
|
3487
|
-
"legalStatuses.
|
|
3488
|
-
|
|
3489
|
-
),
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
),
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
),
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
var
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
var CountryConfigQueryType = import_zod29.z.discriminatedUnion("type", [And2, Or2]);
|
|
3514
|
-
var CountryConfigQueryInputType = import_zod29.z.union([
|
|
3515
|
-
SerializedQueryExpression,
|
|
3516
|
-
And2,
|
|
3517
|
-
Or2
|
|
3518
|
-
]);
|
|
3519
|
-
|
|
3520
|
-
// ../commons/src/icons.ts
|
|
3521
|
-
var import_zod30 = require("zod");
|
|
3522
|
-
var AvailableIcons = import_zod30.z.enum([
|
|
3523
|
-
"Archived",
|
|
3524
|
-
"Assigned",
|
|
3525
|
-
"Certified",
|
|
3526
|
-
"Close",
|
|
3527
|
-
"Collapse",
|
|
3528
|
-
"Draft",
|
|
3529
|
-
"DuplicateYellow",
|
|
3530
|
-
"Expand",
|
|
3531
|
-
"ExternalValidate",
|
|
3532
|
-
"FilledCheck",
|
|
3533
|
-
"InReview",
|
|
3534
|
-
"Offline",
|
|
3535
|
-
"Registered",
|
|
3536
|
-
"RequiresUpdates",
|
|
3537
|
-
"Sent",
|
|
3538
|
-
"Validated",
|
|
3539
|
-
"WaitingApproval",
|
|
3540
|
-
"ChartActivity",
|
|
3541
|
-
"Activity",
|
|
3542
|
-
"Archive",
|
|
3543
|
-
"ArchiveTray",
|
|
3544
|
-
"ArrowLeft",
|
|
3545
|
-
"ArrowRight",
|
|
3546
|
-
"Buildings",
|
|
3547
|
-
"Circle",
|
|
3548
|
-
"CaretDown",
|
|
3549
|
-
"CaretLeft",
|
|
3550
|
-
"CaretRight",
|
|
3551
|
-
"ChartBar",
|
|
3552
|
-
"ChartLine",
|
|
3553
|
-
"ChatCircle",
|
|
3554
|
-
"CheckSquare",
|
|
3555
|
-
"Compass",
|
|
3556
|
-
"Check",
|
|
3557
|
-
"Copy",
|
|
3558
|
-
"Database",
|
|
3559
|
-
"DotsThreeVertical",
|
|
3560
|
-
"ArrowCounterClockwise",
|
|
3561
|
-
"MagnifyingGlassMinus",
|
|
3562
|
-
"MagnifyingGlassPlus",
|
|
3563
|
-
"Export",
|
|
3564
|
-
"Eye",
|
|
3565
|
-
"EyeSlash",
|
|
3566
|
-
"Envelope",
|
|
3567
|
-
"File",
|
|
3568
|
-
"FileSearch",
|
|
3569
|
-
"FileMinus",
|
|
3570
|
-
"FilePlus",
|
|
3571
|
-
"FileText",
|
|
3572
|
-
"FileX",
|
|
3573
|
-
"Handshake",
|
|
3574
|
-
"Gear",
|
|
3575
|
-
"GitBranch",
|
|
3576
|
-
"IdentificationCard",
|
|
3577
|
-
"List",
|
|
3578
|
-
"ListBullets",
|
|
3579
|
-
"Lock",
|
|
3580
|
-
"MagnifyingGlass",
|
|
3581
|
-
"MapPin",
|
|
3582
|
-
"Medal",
|
|
3583
|
-
"NotePencil",
|
|
3584
|
-
"Paperclip",
|
|
3585
|
-
"PaperPlaneTilt",
|
|
3586
|
-
"Pen",
|
|
3587
|
-
"Pencil",
|
|
3588
|
-
"PencilSimpleLine",
|
|
3589
|
-
"Phone",
|
|
3590
|
-
"Plus",
|
|
3591
|
-
"Printer",
|
|
3592
|
-
"SignOut",
|
|
3593
|
-
"Star",
|
|
3594
|
-
"Target",
|
|
3595
|
-
"TextT",
|
|
3596
|
-
"Trash",
|
|
3597
|
-
"UploadSimple",
|
|
3598
|
-
"User",
|
|
3599
|
-
"UserPlus",
|
|
3600
|
-
"Users",
|
|
3601
|
-
"WarningCircle",
|
|
3602
|
-
"X",
|
|
3603
|
-
"CircleWavyCheck",
|
|
3604
|
-
"CircleWavyQuestion",
|
|
3605
|
-
"ArchiveBox",
|
|
3606
|
-
"ArrowCircleDown",
|
|
3607
|
-
"FileArrowUp",
|
|
3608
|
-
"FileDotted",
|
|
3609
|
-
"Files",
|
|
3610
|
-
"PencilLine",
|
|
3611
|
-
"PencilCircle",
|
|
3612
|
-
"UserCircle",
|
|
3613
|
-
"Clock",
|
|
3614
|
-
"QrCode",
|
|
3615
|
-
"Webcam",
|
|
3616
|
-
"Sun",
|
|
3617
|
-
"DeviceTabletCamera",
|
|
3618
|
-
"Globe",
|
|
3619
|
-
"Fingerprint",
|
|
3620
|
-
"PushPin",
|
|
3621
|
-
"Timer"
|
|
3708
|
+
maxCount: (maxCount) => createCountConditional("maxContains", maxCount, additionalFields)
|
|
3709
|
+
};
|
|
3710
|
+
};
|
|
3711
|
+
const chainableMethods = {
|
|
3712
|
+
/**
|
|
3713
|
+
* Adds additional field constraints to the action matching.
|
|
3714
|
+
*
|
|
3715
|
+
* @param fields - Object containing additional fields to match on the action.
|
|
3716
|
+
*/
|
|
3717
|
+
withFields: (fields) => withMinMax(fields),
|
|
3718
|
+
/**
|
|
3719
|
+
* Adds template ID constraint to the action matching.
|
|
3720
|
+
* This is a convenience method that adds content.templateId to the fields.
|
|
3721
|
+
*
|
|
3722
|
+
* @param id - The template ID to match against.
|
|
3723
|
+
*/
|
|
3724
|
+
withTemplate: (id) => withMinMax({
|
|
3725
|
+
content: { templateId: id }
|
|
3726
|
+
}),
|
|
3727
|
+
...withMinMax()
|
|
3728
|
+
};
|
|
3729
|
+
return { ...basicConditional, ...chainableMethods };
|
|
3730
|
+
},
|
|
3731
|
+
field(field3) {
|
|
3732
|
+
return {
|
|
3733
|
+
$event: field3
|
|
3734
|
+
};
|
|
3735
|
+
}
|
|
3736
|
+
});
|
|
3737
|
+
|
|
3738
|
+
// ../commons/src/events/WorkqueueColumnConfig.ts
|
|
3739
|
+
var z31 = __toESM(require("zod/v4"));
|
|
3740
|
+
var WorkqueueColumnKeysArray = [
|
|
3741
|
+
...EventMetadataKeysArray,
|
|
3742
|
+
"title",
|
|
3743
|
+
"outbox"
|
|
3744
|
+
];
|
|
3745
|
+
var WorkqueueColumnKeys = z31.enum(WorkqueueColumnKeysArray);
|
|
3746
|
+
var WorkqueueColumnValue = z31.object({
|
|
3747
|
+
$event: WorkqueueColumnKeys
|
|
3748
|
+
});
|
|
3749
|
+
var WorkqueueColumn = z31.object({
|
|
3750
|
+
label: TranslationConfig,
|
|
3751
|
+
value: WorkqueueColumnValue
|
|
3752
|
+
});
|
|
3753
|
+
function defineWorkqueuesColumns(workqueueColumns) {
|
|
3754
|
+
return workqueueColumns.map(
|
|
3755
|
+
(workqueueColumn) => WorkqueueColumn.parse(workqueueColumn)
|
|
3756
|
+
);
|
|
3757
|
+
}
|
|
3758
|
+
|
|
3759
|
+
// ../commons/src/events/CountryConfigQueryInput.ts
|
|
3760
|
+
var z32 = __toESM(require("zod/v4"));
|
|
3761
|
+
var SerializableExact = z32.object({
|
|
3762
|
+
type: z32.literal("exact"),
|
|
3763
|
+
term: z32.union([z32.string(), SerializedUserField])
|
|
3764
|
+
});
|
|
3765
|
+
var SerializableWithin = z32.object({
|
|
3766
|
+
type: z32.literal("within"),
|
|
3767
|
+
location: z32.union([z32.string(), SerializedUserField])
|
|
3768
|
+
});
|
|
3769
|
+
var SerializedQueryExpression = z32.object({
|
|
3770
|
+
eventType: z32.string(),
|
|
3771
|
+
status: z32.optional(z32.union([AnyOfStatus, ExactStatus])),
|
|
3772
|
+
createdAt: z32.optional(DateCondition),
|
|
3773
|
+
updatedAt: z32.optional(DateCondition),
|
|
3774
|
+
"legalStatuses.REGISTERED.createdAt": z32.optional(DateCondition),
|
|
3775
|
+
"legalStatuses.DECLARED.createdAtLocation": z32.optional(SerializableWithin),
|
|
3776
|
+
"legalStatuses.REGISTERED.createdAtLocation": z32.optional(SerializableWithin),
|
|
3777
|
+
"legalStatuses.REGISTERED.registrationNumber": z32.optional(Exact),
|
|
3778
|
+
createdAtLocation: z32.optional(SerializableWithin),
|
|
3779
|
+
updatedAtLocation: z32.optional(SerializableWithin),
|
|
3780
|
+
assignedTo: z32.optional(SerializableExact),
|
|
3781
|
+
createdBy: z32.optional(SerializableExact),
|
|
3782
|
+
createdByUserType: ExactUserType,
|
|
3783
|
+
updatedBy: z32.optional(SerializableExact),
|
|
3784
|
+
trackingId: z32.optional(Exact),
|
|
3785
|
+
flags: z32.optional(ContainsFlags),
|
|
3786
|
+
data: QueryInput
|
|
3787
|
+
}).partial();
|
|
3788
|
+
var Or2 = z32.object({
|
|
3789
|
+
type: z32.literal("or"),
|
|
3790
|
+
clauses: z32.array(SerializedQueryExpression)
|
|
3791
|
+
});
|
|
3792
|
+
var And2 = z32.object({
|
|
3793
|
+
type: z32.literal("and"),
|
|
3794
|
+
clauses: z32.array(SerializedQueryExpression)
|
|
3795
|
+
});
|
|
3796
|
+
var CountryConfigQueryType = z32.discriminatedUnion("type", [And2, Or2]);
|
|
3797
|
+
var CountryConfigQueryInputType = z32.union([
|
|
3798
|
+
SerializedQueryExpression,
|
|
3799
|
+
And2,
|
|
3800
|
+
Or2
|
|
3622
3801
|
]);
|
|
3623
3802
|
|
|
3624
3803
|
// ../commons/src/events/WorkqueueConfig.ts
|
|
@@ -3640,23 +3819,21 @@ var mandatoryColumns = defineWorkqueuesColumns([
|
|
|
3640
3819
|
value: event.field("updatedAt")
|
|
3641
3820
|
}
|
|
3642
3821
|
]);
|
|
3643
|
-
var WorkqueueActionsWithDefault =
|
|
3822
|
+
var WorkqueueActionsWithDefault = z33.enum([
|
|
3644
3823
|
...workqueueActions.options,
|
|
3645
|
-
"DEFAULT"
|
|
3824
|
+
"DEFAULT",
|
|
3825
|
+
ActionType.READ
|
|
3646
3826
|
]);
|
|
3647
|
-
var WorkqueueConfig =
|
|
3648
|
-
slug:
|
|
3827
|
+
var WorkqueueConfig = z33.object({
|
|
3828
|
+
slug: z33.string().describe("Determines the url of the workqueue."),
|
|
3649
3829
|
name: TranslationConfig.describe(
|
|
3650
3830
|
"Title of the workflow (both in navigation and on the page)"
|
|
3651
3831
|
),
|
|
3652
3832
|
query: CountryConfigQueryType,
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
})
|
|
3658
|
-
),
|
|
3659
|
-
columns: import_zod31.z.array(WorkqueueColumn).default(mandatoryColumns),
|
|
3833
|
+
/** This action object used to contain a conditionals option, but it was not used anywhere.
|
|
3834
|
+
* It's also debatable whether it should be an array, or just a single action. */
|
|
3835
|
+
actions: z33.array(z33.object({ type: WorkqueueActionsWithDefault })).describe("Workqueue call-to-action button configuration."),
|
|
3836
|
+
columns: z33.array(WorkqueueColumn).default(mandatoryColumns),
|
|
3660
3837
|
icon: AvailableIcons,
|
|
3661
3838
|
emptyMessage: TranslationConfig.optional()
|
|
3662
3839
|
}).describe("Configuration for workqueue.");
|
|
@@ -3664,26 +3841,21 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
|
|
|
3664
3841
|
query: true,
|
|
3665
3842
|
columns: true
|
|
3666
3843
|
});
|
|
3667
|
-
var WorkqueueConfigInput =
|
|
3668
|
-
slug:
|
|
3844
|
+
var WorkqueueConfigInput = z33.object({
|
|
3845
|
+
slug: z33.string().describe("Determines the url of the workqueue."),
|
|
3669
3846
|
name: TranslationConfig.describe(
|
|
3670
3847
|
"Title of the workflow (both in navigation and on the page)"
|
|
3671
3848
|
),
|
|
3672
3849
|
query: CountryConfigQueryInputType,
|
|
3673
|
-
actions:
|
|
3674
|
-
|
|
3675
|
-
type: WorkqueueActionsWithDefault,
|
|
3676
|
-
conditionals: import_zod31.z.array(Conditional).optional()
|
|
3677
|
-
})
|
|
3678
|
-
),
|
|
3679
|
-
columns: import_zod31.z.array(WorkqueueColumn).default(mandatoryColumns),
|
|
3850
|
+
actions: z33.array(z33.object({ type: WorkqueueActionsWithDefault })).describe("Workqueue call-to-action button configuration."),
|
|
3851
|
+
columns: z33.array(WorkqueueColumn).default(mandatoryColumns),
|
|
3680
3852
|
icon: AvailableIcons,
|
|
3681
3853
|
emptyMessage: TranslationConfig.optional()
|
|
3682
3854
|
});
|
|
3683
|
-
var WorkqueueCountInput =
|
|
3684
|
-
|
|
3855
|
+
var WorkqueueCountInput = z33.array(
|
|
3856
|
+
z33.object({ slug: z33.string(), query: QueryType })
|
|
3685
3857
|
);
|
|
3686
|
-
var WorkqueueCountOutput =
|
|
3858
|
+
var WorkqueueCountOutput = z33.record(z33.string(), z33.number());
|
|
3687
3859
|
|
|
3688
3860
|
// ../commons/src/events/workqueueDefaultColumns.ts
|
|
3689
3861
|
var defaultWorkqueueColumns = [
|
|
@@ -3706,47 +3878,40 @@ var defaultWorkqueueColumns = [
|
|
|
3706
3878
|
];
|
|
3707
3879
|
|
|
3708
3880
|
// ../commons/src/events/Draft.ts
|
|
3709
|
-
var
|
|
3881
|
+
var z35 = __toESM(require("zod/v4"));
|
|
3710
3882
|
|
|
3711
3883
|
// ../commons/src/events/ActionInput.ts
|
|
3712
|
-
var
|
|
3713
|
-
var
|
|
3714
|
-
(0, import_zod_openapi11.extendZodWithOpenApi)(import_zod32.z);
|
|
3715
|
-
var BaseActionInput = import_zod32.z.object({
|
|
3884
|
+
var z34 = __toESM(require("zod/v4"));
|
|
3885
|
+
var BaseActionInput = z34.object({
|
|
3716
3886
|
eventId: UUID,
|
|
3717
|
-
transactionId:
|
|
3887
|
+
transactionId: z34.string(),
|
|
3718
3888
|
declaration: ActionUpdate.default({}),
|
|
3719
3889
|
annotation: ActionUpdate.optional(),
|
|
3720
3890
|
originalActionId: UUID.optional(),
|
|
3721
3891
|
// should not be part of base action.
|
|
3722
|
-
keepAssignment:
|
|
3892
|
+
keepAssignment: z34.boolean().optional(),
|
|
3723
3893
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
3724
3894
|
createdAtLocation: CreatedAtLocation.describe(
|
|
3725
3895
|
"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."
|
|
3726
3896
|
)
|
|
3727
3897
|
});
|
|
3728
|
-
var CreateActionInput = BaseActionInput.
|
|
3729
|
-
|
|
3730
|
-
type:
|
|
3898
|
+
var CreateActionInput = BaseActionInput.extend(
|
|
3899
|
+
z34.object({
|
|
3900
|
+
type: z34.literal(ActionType.CREATE).default(ActionType.CREATE),
|
|
3731
3901
|
createdAtLocation: CreatedAtLocation
|
|
3732
|
-
})
|
|
3902
|
+
}).shape
|
|
3733
3903
|
);
|
|
3734
|
-
var RegisterActionInput = BaseActionInput.
|
|
3735
|
-
|
|
3736
|
-
type:
|
|
3737
|
-
registrationNumber:
|
|
3738
|
-
})
|
|
3739
|
-
).strict();
|
|
3740
|
-
var ValidateActionInput = BaseActionInput.merge(
|
|
3741
|
-
import_zod32.z.object({
|
|
3742
|
-
type: import_zod32.z.literal(ActionType.VALIDATE).default(ActionType.VALIDATE)
|
|
3743
|
-
})
|
|
3904
|
+
var RegisterActionInput = BaseActionInput.extend(
|
|
3905
|
+
z34.strictObject({
|
|
3906
|
+
type: z34.literal(ActionType.REGISTER).default(ActionType.REGISTER),
|
|
3907
|
+
registrationNumber: z34.string().optional()
|
|
3908
|
+
}).shape
|
|
3744
3909
|
);
|
|
3745
|
-
var NotifyActionInput = BaseActionInput.
|
|
3746
|
-
|
|
3747
|
-
type:
|
|
3748
|
-
})
|
|
3749
|
-
).
|
|
3910
|
+
var NotifyActionInput = BaseActionInput.extend(
|
|
3911
|
+
z34.object({
|
|
3912
|
+
type: z34.literal(ActionType.NOTIFY).default(ActionType.NOTIFY)
|
|
3913
|
+
}).shape
|
|
3914
|
+
).meta({
|
|
3750
3915
|
default: {
|
|
3751
3916
|
eventId: "<event-id-here>",
|
|
3752
3917
|
transactionId: getUUID(),
|
|
@@ -3755,135 +3920,150 @@ var NotifyActionInput = BaseActionInput.merge(
|
|
|
3755
3920
|
type: ActionType.NOTIFY
|
|
3756
3921
|
}
|
|
3757
3922
|
});
|
|
3758
|
-
var DeclareActionInput = BaseActionInput.
|
|
3759
|
-
|
|
3760
|
-
type:
|
|
3761
|
-
})
|
|
3923
|
+
var DeclareActionInput = BaseActionInput.extend(
|
|
3924
|
+
z34.object({
|
|
3925
|
+
type: z34.literal(ActionType.DECLARE).default(ActionType.DECLARE)
|
|
3926
|
+
}).shape
|
|
3762
3927
|
);
|
|
3763
|
-
var
|
|
3764
|
-
|
|
3765
|
-
type:
|
|
3928
|
+
var EditActionInput = BaseActionInput.extend(
|
|
3929
|
+
z34.object({
|
|
3930
|
+
type: z34.literal(ActionType.EDIT).default(ActionType.EDIT),
|
|
3931
|
+
content: z34.object({
|
|
3932
|
+
comment: z34.string().describe("Comment for the edit action.").optional()
|
|
3933
|
+
})
|
|
3934
|
+
}).shape
|
|
3935
|
+
);
|
|
3936
|
+
var PrintCertificateActionInput = BaseActionInput.extend(
|
|
3937
|
+
z34.object({
|
|
3938
|
+
type: z34.literal(ActionType.PRINT_CERTIFICATE).default(ActionType.PRINT_CERTIFICATE),
|
|
3766
3939
|
content: PrintContent.optional()
|
|
3767
|
-
})
|
|
3940
|
+
}).shape
|
|
3768
3941
|
);
|
|
3769
|
-
var RejectDeclarationActionInput = BaseActionInput.
|
|
3770
|
-
|
|
3771
|
-
type:
|
|
3942
|
+
var RejectDeclarationActionInput = BaseActionInput.extend(
|
|
3943
|
+
z34.object({
|
|
3944
|
+
type: z34.literal(ActionType.REJECT).default(ActionType.REJECT),
|
|
3772
3945
|
content: ReasonContent
|
|
3773
|
-
})
|
|
3946
|
+
}).shape
|
|
3774
3947
|
);
|
|
3775
|
-
var DuplicateDetectedActionInput = BaseActionInput.
|
|
3776
|
-
|
|
3777
|
-
type:
|
|
3778
|
-
content:
|
|
3779
|
-
duplicates:
|
|
3948
|
+
var DuplicateDetectedActionInput = BaseActionInput.extend(
|
|
3949
|
+
z34.object({
|
|
3950
|
+
type: z34.literal(ActionType.DUPLICATE_DETECTED).default(ActionType.DUPLICATE_DETECTED),
|
|
3951
|
+
content: z34.object({
|
|
3952
|
+
duplicates: z34.array(PotentialDuplicate)
|
|
3780
3953
|
})
|
|
3781
|
-
})
|
|
3954
|
+
}).shape
|
|
3782
3955
|
);
|
|
3783
|
-
var MarkAsDuplicateActionInput = BaseActionInput.
|
|
3784
|
-
|
|
3785
|
-
type:
|
|
3786
|
-
content:
|
|
3956
|
+
var MarkAsDuplicateActionInput = BaseActionInput.extend(
|
|
3957
|
+
z34.object({
|
|
3958
|
+
type: z34.literal(ActionType.MARK_AS_DUPLICATE).default(ActionType.MARK_AS_DUPLICATE),
|
|
3959
|
+
content: z34.object({
|
|
3787
3960
|
duplicateOf: UUID
|
|
3788
3961
|
}).optional()
|
|
3789
|
-
})
|
|
3962
|
+
}).shape
|
|
3790
3963
|
);
|
|
3791
|
-
var MarkNotDuplicateActionInput = BaseActionInput.
|
|
3792
|
-
|
|
3793
|
-
type:
|
|
3794
|
-
})
|
|
3964
|
+
var MarkNotDuplicateActionInput = BaseActionInput.extend(
|
|
3965
|
+
z34.object({
|
|
3966
|
+
type: z34.literal(ActionType.MARK_AS_NOT_DUPLICATE).default(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
3967
|
+
}).shape
|
|
3795
3968
|
);
|
|
3796
|
-
var ArchiveActionInput = BaseActionInput.
|
|
3797
|
-
|
|
3798
|
-
type:
|
|
3969
|
+
var ArchiveActionInput = BaseActionInput.extend(
|
|
3970
|
+
z34.object({
|
|
3971
|
+
type: z34.literal(ActionType.ARCHIVE).default(ActionType.ARCHIVE),
|
|
3799
3972
|
content: ReasonContent
|
|
3800
|
-
})
|
|
3973
|
+
}).shape
|
|
3801
3974
|
);
|
|
3802
|
-
var AssignActionInput = BaseActionInput.
|
|
3803
|
-
|
|
3804
|
-
type:
|
|
3805
|
-
assignedTo:
|
|
3806
|
-
})
|
|
3975
|
+
var AssignActionInput = BaseActionInput.extend(
|
|
3976
|
+
z34.object({
|
|
3977
|
+
type: z34.literal(ActionType.ASSIGN),
|
|
3978
|
+
assignedTo: z34.string()
|
|
3979
|
+
}).shape
|
|
3807
3980
|
);
|
|
3808
|
-
var UnassignActionInput = BaseActionInput.
|
|
3809
|
-
|
|
3810
|
-
type:
|
|
3811
|
-
assignedTo:
|
|
3812
|
-
})
|
|
3981
|
+
var UnassignActionInput = BaseActionInput.extend(
|
|
3982
|
+
z34.object({
|
|
3983
|
+
type: z34.literal(ActionType.UNASSIGN).default(ActionType.UNASSIGN),
|
|
3984
|
+
assignedTo: z34.literal(null).default(null)
|
|
3985
|
+
}).shape
|
|
3813
3986
|
);
|
|
3814
|
-
var RequestCorrectionActionInput = BaseActionInput.
|
|
3815
|
-
|
|
3816
|
-
type:
|
|
3817
|
-
})
|
|
3987
|
+
var RequestCorrectionActionInput = BaseActionInput.extend(
|
|
3988
|
+
z34.object({
|
|
3989
|
+
type: z34.literal(ActionType.REQUEST_CORRECTION).default(ActionType.REQUEST_CORRECTION)
|
|
3990
|
+
}).shape
|
|
3818
3991
|
);
|
|
3819
|
-
var RejectCorrectionActionInput = BaseActionInput.
|
|
3820
|
-
|
|
3821
|
-
requestId:
|
|
3822
|
-
type:
|
|
3992
|
+
var RejectCorrectionActionInput = BaseActionInput.extend(
|
|
3993
|
+
z34.object({
|
|
3994
|
+
requestId: z34.string(),
|
|
3995
|
+
type: z34.literal(ActionType.REJECT_CORRECTION).default(ActionType.REJECT_CORRECTION),
|
|
3823
3996
|
content: ReasonContent
|
|
3824
|
-
})
|
|
3997
|
+
}).shape
|
|
3825
3998
|
);
|
|
3826
|
-
var ApproveCorrectionActionInput = BaseActionInput.
|
|
3827
|
-
|
|
3828
|
-
requestId:
|
|
3829
|
-
type:
|
|
3830
|
-
})
|
|
3999
|
+
var ApproveCorrectionActionInput = BaseActionInput.extend(
|
|
4000
|
+
z34.object({
|
|
4001
|
+
requestId: z34.string(),
|
|
4002
|
+
type: z34.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
|
|
4003
|
+
}).shape
|
|
3831
4004
|
);
|
|
3832
|
-
var ReadActionInput = BaseActionInput.
|
|
3833
|
-
|
|
3834
|
-
type:
|
|
3835
|
-
})
|
|
4005
|
+
var ReadActionInput = BaseActionInput.extend(
|
|
4006
|
+
z34.object({
|
|
4007
|
+
type: z34.literal(ActionType.READ).default(ActionType.READ)
|
|
4008
|
+
}).shape
|
|
3836
4009
|
);
|
|
3837
|
-
var DeleteActionInput =
|
|
3838
|
-
var
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
4010
|
+
var DeleteActionInput = z34.object({ eventId: UUID });
|
|
4011
|
+
var CustomActionInput = BaseActionInput.extend(
|
|
4012
|
+
z34.object({
|
|
4013
|
+
type: z34.literal(ActionType.CUSTOM).default(ActionType.CUSTOM),
|
|
4014
|
+
customActionType: z34.string().describe("Name of the custom action.")
|
|
4015
|
+
}).shape
|
|
4016
|
+
);
|
|
4017
|
+
var ActionInput = z34.discriminatedUnion("type", [
|
|
4018
|
+
CreateActionInput.meta({ id: "CreateActionInput" }),
|
|
4019
|
+
RegisterActionInput.meta({ id: "RegisterActionInput" }),
|
|
4020
|
+
NotifyActionInput.meta({ id: "NotifyActionInput" }),
|
|
4021
|
+
DeclareActionInput.meta({ id: "DeclareActionInput" }),
|
|
4022
|
+
RejectDeclarationActionInput.meta({
|
|
4023
|
+
id: "RejectDeclarationActionInput"
|
|
3846
4024
|
}),
|
|
3847
|
-
DuplicateDetectedActionInput.
|
|
3848
|
-
|
|
4025
|
+
DuplicateDetectedActionInput.meta({
|
|
4026
|
+
id: "DuplicateDetectedActionInput"
|
|
3849
4027
|
}),
|
|
3850
|
-
MarkAsDuplicateActionInput.
|
|
3851
|
-
|
|
4028
|
+
MarkAsDuplicateActionInput.meta({
|
|
4029
|
+
id: "MarkAsDuplicateActionInput"
|
|
3852
4030
|
}),
|
|
3853
|
-
MarkNotDuplicateActionInput.
|
|
3854
|
-
|
|
4031
|
+
MarkNotDuplicateActionInput.meta({
|
|
4032
|
+
id: "MarkNotDuplicateActionInput"
|
|
3855
4033
|
}),
|
|
3856
|
-
ArchiveActionInput.
|
|
3857
|
-
AssignActionInput.
|
|
3858
|
-
UnassignActionInput.
|
|
3859
|
-
PrintCertificateActionInput.
|
|
3860
|
-
RequestCorrectionActionInput.
|
|
3861
|
-
|
|
4034
|
+
ArchiveActionInput.meta({ id: "ArchiveActionInput" }),
|
|
4035
|
+
AssignActionInput.meta({ id: "AssignActionInput" }),
|
|
4036
|
+
UnassignActionInput.meta({ id: "UnassignActionInput" }),
|
|
4037
|
+
PrintCertificateActionInput.meta({ id: "PrintCertificateActionInput" }),
|
|
4038
|
+
RequestCorrectionActionInput.meta({
|
|
4039
|
+
id: "RequestCorrectionActionInput"
|
|
3862
4040
|
}),
|
|
3863
|
-
RejectCorrectionActionInput.
|
|
3864
|
-
ApproveCorrectionActionInput.
|
|
3865
|
-
|
|
4041
|
+
RejectCorrectionActionInput.meta({ id: "RejectCorrectionActionInput" }),
|
|
4042
|
+
ApproveCorrectionActionInput.meta({
|
|
4043
|
+
id: "ApproveCorrectionActionInput"
|
|
3866
4044
|
}),
|
|
3867
|
-
ReadActionInput.
|
|
3868
|
-
|
|
3869
|
-
|
|
4045
|
+
ReadActionInput.meta({ id: "ReadActionInput" }),
|
|
4046
|
+
CustomActionInput.meta({ id: "CustomActionInput" }),
|
|
4047
|
+
EditActionInput.meta({ id: "EditActionInput" })
|
|
4048
|
+
]).meta({
|
|
4049
|
+
id: "ActionInput"
|
|
3870
4050
|
});
|
|
3871
4051
|
|
|
3872
4052
|
// ../commons/src/events/Draft.ts
|
|
3873
|
-
var Draft =
|
|
4053
|
+
var Draft = z35.object({
|
|
3874
4054
|
id: UUID,
|
|
3875
4055
|
eventId: UUID,
|
|
3876
|
-
transactionId:
|
|
3877
|
-
createdAt:
|
|
4056
|
+
transactionId: z35.string(),
|
|
4057
|
+
createdAt: z35.string().datetime(),
|
|
3878
4058
|
action: ActionBase.extend({
|
|
3879
|
-
type: ActionTypes.exclude([ActionTypes.
|
|
4059
|
+
type: ActionTypes.exclude([ActionTypes.enum.DELETE])
|
|
3880
4060
|
}).omit({ id: true, createdAtLocation: true })
|
|
3881
4061
|
}).describe(
|
|
3882
4062
|
"A temporary storage for an action. Stored with details of the event, creator and creation time."
|
|
3883
4063
|
);
|
|
3884
4064
|
var DraftInput = BaseActionInput.extend({
|
|
3885
|
-
type: ActionTypes.exclude([ActionTypes.
|
|
3886
|
-
status:
|
|
4065
|
+
type: ActionTypes.exclude([ActionTypes.enum.DELETE]),
|
|
4066
|
+
status: z35.enum([
|
|
3887
4067
|
ActionStatus.Requested,
|
|
3888
4068
|
ActionStatus.Accepted,
|
|
3889
4069
|
ActionStatus.Rejected
|
|
@@ -3891,32 +4071,30 @@ var DraftInput = BaseActionInput.extend({
|
|
|
3891
4071
|
});
|
|
3892
4072
|
|
|
3893
4073
|
// ../commons/src/events/EventInput.ts
|
|
3894
|
-
var
|
|
4074
|
+
var z36 = __toESM(require("zod/v4"));
|
|
3895
4075
|
var import_uuid10 = require("uuid");
|
|
3896
|
-
var EventInput =
|
|
3897
|
-
transactionId:
|
|
3898
|
-
type:
|
|
3899
|
-
}).
|
|
4076
|
+
var EventInput = z36.object({
|
|
4077
|
+
transactionId: z36.string(),
|
|
4078
|
+
type: z36.string()
|
|
4079
|
+
}).meta({ default: { transactionId: (0, import_uuid10.v4)(), type: "birth" } });
|
|
3900
4080
|
|
|
3901
4081
|
// ../commons/src/events/EventDocument.ts
|
|
3902
|
-
var
|
|
3903
|
-
var
|
|
3904
|
-
(0, import_zod_openapi12.extendZodWithOpenApi)(import_zod35.z);
|
|
3905
|
-
var EventDocument = import_zod35.z.object({
|
|
4082
|
+
var z37 = __toESM(require("zod/v4"));
|
|
4083
|
+
var EventDocument = z37.object({
|
|
3906
4084
|
id: UUID.describe("Unique identifier of the event."),
|
|
3907
|
-
type:
|
|
3908
|
-
createdAt:
|
|
3909
|
-
updatedAt:
|
|
4085
|
+
type: z37.string().describe("Type of the event (e.g. birth, death, marriage)."),
|
|
4086
|
+
createdAt: z37.string().datetime().describe("Timestamp indicating when the event was created."),
|
|
4087
|
+
updatedAt: z37.string().datetime().describe(
|
|
3910
4088
|
"Timestamp of the last update, excluding changes from actions."
|
|
3911
4089
|
),
|
|
3912
|
-
actions:
|
|
3913
|
-
trackingId:
|
|
4090
|
+
actions: z37.array(Action).describe("Ordered list of actions associated with the event."),
|
|
4091
|
+
trackingId: z37.string().describe(
|
|
3914
4092
|
"System-generated tracking identifier used to look up the event."
|
|
3915
4093
|
)
|
|
3916
|
-
}).
|
|
4094
|
+
}).meta({ id: "EventDocument" });
|
|
3917
4095
|
|
|
3918
4096
|
// ../commons/src/events/state/index.ts
|
|
3919
|
-
var
|
|
4097
|
+
var import_lodash4 = require("lodash");
|
|
3920
4098
|
|
|
3921
4099
|
// ../commons/src/events/state/utils.ts
|
|
3922
4100
|
var import_lodash2 = require("lodash");
|
|
@@ -3924,14 +4102,18 @@ var updateActions = ActionTypes.extract([
|
|
|
3924
4102
|
ActionType.CREATE,
|
|
3925
4103
|
ActionType.NOTIFY,
|
|
3926
4104
|
ActionType.DECLARE,
|
|
3927
|
-
ActionType.VALIDATE,
|
|
3928
4105
|
ActionType.REGISTER,
|
|
3929
4106
|
ActionType.REJECT,
|
|
3930
4107
|
ActionType.ARCHIVE,
|
|
3931
4108
|
ActionType.PRINT_CERTIFICATE,
|
|
3932
|
-
ActionType.REQUEST_CORRECTION
|
|
4109
|
+
ActionType.REQUEST_CORRECTION,
|
|
4110
|
+
ActionType.CUSTOM
|
|
3933
4111
|
]);
|
|
3934
4112
|
|
|
4113
|
+
// ../commons/src/events/state/flags.ts
|
|
4114
|
+
var import_lodash3 = require("lodash");
|
|
4115
|
+
var import_date_fns3 = require("date-fns");
|
|
4116
|
+
|
|
3935
4117
|
// ../commons/src/events/defineConfig.ts
|
|
3936
4118
|
var defineConfig = (config) => {
|
|
3937
4119
|
const input = EventConfig.parse(config);
|
|
@@ -3939,7 +4121,7 @@ var defineConfig = (config) => {
|
|
|
3939
4121
|
};
|
|
3940
4122
|
|
|
3941
4123
|
// ../commons/src/events/test.utils.ts
|
|
3942
|
-
var
|
|
4124
|
+
var import_lodash5 = require("lodash");
|
|
3943
4125
|
var import_date_fns4 = require("date-fns");
|
|
3944
4126
|
|
|
3945
4127
|
// ../commons/src/field-config/field-configuration.ts
|
|
@@ -3961,8 +4143,7 @@ function field(fieldId, options = {}) {
|
|
|
3961
4143
|
}
|
|
3962
4144
|
|
|
3963
4145
|
// ../commons/src/fixtures/forms.ts
|
|
3964
|
-
var
|
|
3965
|
-
var PRINT_CERTIFICATE_FORM = {
|
|
4146
|
+
var PRINT_CERTIFICATE_FORM = defineActionForm({
|
|
3966
4147
|
label: {
|
|
3967
4148
|
id: "event.tennis-club-membership.action.certificate.form.label",
|
|
3968
4149
|
defaultMessage: "Tennis club membership certificate collector",
|
|
@@ -4618,7 +4799,7 @@ var PRINT_CERTIFICATE_FORM = {
|
|
|
4618
4799
|
}
|
|
4619
4800
|
}
|
|
4620
4801
|
]
|
|
4621
|
-
};
|
|
4802
|
+
});
|
|
4622
4803
|
var TENNIS_CLUB_DECLARATION_REVIEW = {
|
|
4623
4804
|
title: {
|
|
4624
4805
|
id: "event.tennis-club-membership.action.declare.form.review.title",
|
|
@@ -4663,7 +4844,7 @@ function isDomesticAddress() {
|
|
|
4663
4844
|
field("addressType").isEqualTo(AddressType.DOMESTIC)
|
|
4664
4845
|
);
|
|
4665
4846
|
}
|
|
4666
|
-
var TENNIS_CLUB_DECLARATION_FORM = {
|
|
4847
|
+
var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
|
|
4667
4848
|
label: {
|
|
4668
4849
|
id: "event.tennis-club-membership.action.declare.form.label",
|
|
4669
4850
|
defaultMessage: "Tennis club membership application",
|
|
@@ -4761,7 +4942,7 @@ var TENNIS_CLUB_DECLARATION_FORM = {
|
|
|
4761
4942
|
conditionals: [
|
|
4762
4943
|
{
|
|
4763
4944
|
type: ConditionalType.DISPLAY_ON_REVIEW,
|
|
4764
|
-
conditional:
|
|
4945
|
+
conditional: never2()
|
|
4765
4946
|
}
|
|
4766
4947
|
]
|
|
4767
4948
|
},
|
|
@@ -5144,119 +5325,16 @@ var TENNIS_CLUB_DECLARATION_FORM = {
|
|
|
5144
5325
|
}
|
|
5145
5326
|
}
|
|
5146
5327
|
],
|
|
5147
|
-
conditional: not(
|
|
5328
|
+
conditional: not(never2())
|
|
5148
5329
|
// Intentional always-true page conditional to exercise interactions between page-level and field-level conditionals in tests
|
|
5149
5330
|
}
|
|
5150
5331
|
]
|
|
5151
|
-
};
|
|
5152
|
-
var statusOptions = [
|
|
5153
|
-
{
|
|
5154
|
-
value: "ALL",
|
|
5155
|
-
label: {
|
|
5156
|
-
defaultMessage: "Any status",
|
|
5157
|
-
description: "Option for form field: status of record",
|
|
5158
|
-
id: "advancedSearch.form.recordStatusAny"
|
|
5159
|
-
}
|
|
5160
|
-
},
|
|
5161
|
-
{
|
|
5162
|
-
value: EventStatus.enum.CREATED,
|
|
5163
|
-
label: {
|
|
5164
|
-
defaultMessage: "Draft",
|
|
5165
|
-
description: "Option for form field: status of record",
|
|
5166
|
-
id: "advancedSearch.form.recordStatusCreated"
|
|
5167
|
-
}
|
|
5168
|
-
},
|
|
5169
|
-
{
|
|
5170
|
-
value: EventStatus.enum.NOTIFIED,
|
|
5171
|
-
label: {
|
|
5172
|
-
defaultMessage: "Notified",
|
|
5173
|
-
description: "Option for form field: status of record",
|
|
5174
|
-
id: "advancedSearch.form.recordStatusNotified"
|
|
5175
|
-
}
|
|
5176
|
-
},
|
|
5177
|
-
{
|
|
5178
|
-
value: EventStatus.enum.DECLARED,
|
|
5179
|
-
label: {
|
|
5180
|
-
defaultMessage: "Declared",
|
|
5181
|
-
description: "Option for form field: status of record",
|
|
5182
|
-
id: "advancedSearch.form.recordStatusDeclared"
|
|
5183
|
-
}
|
|
5184
|
-
},
|
|
5185
|
-
{
|
|
5186
|
-
value: EventStatus.enum.VALIDATED,
|
|
5187
|
-
label: {
|
|
5188
|
-
defaultMessage: "Validated",
|
|
5189
|
-
description: "Option for form field: status of record",
|
|
5190
|
-
id: "advancedSearch.form.recordStatusValidated"
|
|
5191
|
-
}
|
|
5192
|
-
},
|
|
5193
|
-
{
|
|
5194
|
-
value: EventStatus.enum.REGISTERED,
|
|
5195
|
-
label: {
|
|
5196
|
-
defaultMessage: "Registered",
|
|
5197
|
-
description: "Option for form field: status of record",
|
|
5198
|
-
id: "advancedSearch.form.recordStatusRegistered"
|
|
5199
|
-
}
|
|
5200
|
-
},
|
|
5201
|
-
{
|
|
5202
|
-
value: EventStatus.enum.ARCHIVED,
|
|
5203
|
-
label: {
|
|
5204
|
-
defaultMessage: "Archived",
|
|
5205
|
-
description: "Option for form field: status of record",
|
|
5206
|
-
id: "advancedSearch.form.recordStatusArchived"
|
|
5207
|
-
}
|
|
5208
|
-
}
|
|
5209
|
-
];
|
|
5210
|
-
var timePeriodOptions = [
|
|
5211
|
-
{
|
|
5212
|
-
label: {
|
|
5213
|
-
defaultMessage: "Last 7 days",
|
|
5214
|
-
description: "Label for option of time period select: last 7 days",
|
|
5215
|
-
id: "form.section.label.timePeriodLast7Days"
|
|
5216
|
-
},
|
|
5217
|
-
value: `${(0, import_date_fns3.format)((0, import_date_fns3.subDays)(/* @__PURE__ */ new Date(), 7), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
|
|
5218
|
-
/* @__PURE__ */ new Date(),
|
|
5219
|
-
"yyyy-MM-dd"
|
|
5220
|
-
)}`
|
|
5221
|
-
},
|
|
5222
|
-
{
|
|
5223
|
-
label: {
|
|
5224
|
-
defaultMessage: "Last 30 days",
|
|
5225
|
-
description: "Label for option of time period select: last 30 days",
|
|
5226
|
-
id: "form.section.label.timePeriodLast30Days"
|
|
5227
|
-
},
|
|
5228
|
-
value: `${(0, import_date_fns3.format)((0, import_date_fns3.subMonths)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
|
|
5229
|
-
/* @__PURE__ */ new Date(),
|
|
5230
|
-
"yyyy-MM-dd"
|
|
5231
|
-
)}`
|
|
5232
|
-
},
|
|
5233
|
-
{
|
|
5234
|
-
label: {
|
|
5235
|
-
defaultMessage: "Last 90 days",
|
|
5236
|
-
description: "Label for option of time period select: last 90 days",
|
|
5237
|
-
id: "form.section.label.timePeriodLast90Days"
|
|
5238
|
-
},
|
|
5239
|
-
value: `${(0, import_date_fns3.format)((0, import_date_fns3.subQuarters)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
|
|
5240
|
-
/* @__PURE__ */ new Date(),
|
|
5241
|
-
"yyyy-MM-dd"
|
|
5242
|
-
)}`
|
|
5243
|
-
},
|
|
5244
|
-
{
|
|
5245
|
-
label: {
|
|
5246
|
-
defaultMessage: "Last year",
|
|
5247
|
-
description: "Label for option of time period select: last year",
|
|
5248
|
-
id: "form.section.label.timePeriodLastYear"
|
|
5249
|
-
},
|
|
5250
|
-
value: `${(0, import_date_fns3.format)((0, import_date_fns3.subYears)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
|
|
5251
|
-
/* @__PURE__ */ new Date(),
|
|
5252
|
-
"yyyy-MM-dd"
|
|
5253
|
-
)}`
|
|
5254
|
-
}
|
|
5255
|
-
];
|
|
5332
|
+
});
|
|
5256
5333
|
|
|
5257
5334
|
// ../commons/src/fixtures/tennis-club-membership-event.ts
|
|
5258
5335
|
var tennisClubMembershipEvent = defineConfig({
|
|
5259
5336
|
id: TENNIS_CLUB_MEMBERSHIP,
|
|
5337
|
+
declaration: TENNIS_CLUB_DECLARATION_FORM,
|
|
5260
5338
|
label: {
|
|
5261
5339
|
defaultMessage: "Tennis club membership application",
|
|
5262
5340
|
description: "This is what this event is referred as in the system",
|
|
@@ -5307,13 +5385,12 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5307
5385
|
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5308
5386
|
},
|
|
5309
5387
|
{
|
|
5310
|
-
type: ActionType.
|
|
5388
|
+
type: ActionType.REJECT,
|
|
5311
5389
|
label: {
|
|
5312
|
-
defaultMessage: "
|
|
5390
|
+
defaultMessage: "Reject",
|
|
5313
5391
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5314
|
-
id: "event.tennis-club-membership.action.
|
|
5315
|
-
}
|
|
5316
|
-
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5392
|
+
id: "event.tennis-club-membership.action.reject.label"
|
|
5393
|
+
}
|
|
5317
5394
|
},
|
|
5318
5395
|
{
|
|
5319
5396
|
type: ActionType.REGISTER,
|
|
@@ -5321,8 +5398,7 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5321
5398
|
defaultMessage: "Register",
|
|
5322
5399
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5323
5400
|
id: "event.tennis-club-membership.action.register.label"
|
|
5324
|
-
}
|
|
5325
|
-
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5401
|
+
}
|
|
5326
5402
|
},
|
|
5327
5403
|
{
|
|
5328
5404
|
type: ActionType.REQUEST_CORRECTION,
|
|
@@ -5525,14 +5601,6 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5525
5601
|
]
|
|
5526
5602
|
}
|
|
5527
5603
|
},
|
|
5528
|
-
{
|
|
5529
|
-
type: ActionType.APPROVE_CORRECTION,
|
|
5530
|
-
label: {
|
|
5531
|
-
defaultMessage: "Approve correction",
|
|
5532
|
-
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5533
|
-
id: "event.tennis-club-membership.action.correction.approve.label"
|
|
5534
|
-
}
|
|
5535
|
-
},
|
|
5536
5604
|
{
|
|
5537
5605
|
type: ActionType.PRINT_CERTIFICATE,
|
|
5538
5606
|
label: {
|
|
@@ -5541,22 +5609,6 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5541
5609
|
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5542
5610
|
},
|
|
5543
5611
|
printForm: PRINT_CERTIFICATE_FORM
|
|
5544
|
-
},
|
|
5545
|
-
{
|
|
5546
|
-
type: ActionType.ARCHIVE,
|
|
5547
|
-
label: {
|
|
5548
|
-
id: "event.tennis-club-membership.action.archive.label",
|
|
5549
|
-
defaultMessage: "Archive",
|
|
5550
|
-
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5551
|
-
}
|
|
5552
|
-
},
|
|
5553
|
-
{
|
|
5554
|
-
type: ActionType.REJECT,
|
|
5555
|
-
label: {
|
|
5556
|
-
id: "event.tennis-club-membership.action.reject.label",
|
|
5557
|
-
defaultMessage: "Reject",
|
|
5558
|
-
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5559
|
-
}
|
|
5560
5612
|
}
|
|
5561
5613
|
],
|
|
5562
5614
|
advancedSearch: [
|
|
@@ -5593,8 +5645,7 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5593
5645
|
},
|
|
5594
5646
|
fields: [field("recommender.name").fuzzy()]
|
|
5595
5647
|
}
|
|
5596
|
-
]
|
|
5597
|
-
declaration: TENNIS_CLUB_DECLARATION_FORM
|
|
5648
|
+
]
|
|
5598
5649
|
});
|
|
5599
5650
|
|
|
5600
5651
|
// ../commons/src/fixtures/football-club-membership-event.ts
|
|
@@ -5662,23 +5713,13 @@ var footballClubMembershipEvent = defineConfig({
|
|
|
5662
5713
|
},
|
|
5663
5714
|
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5664
5715
|
},
|
|
5665
|
-
{
|
|
5666
|
-
type: ActionType.VALIDATE,
|
|
5667
|
-
label: {
|
|
5668
|
-
defaultMessage: "Validate",
|
|
5669
|
-
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5670
|
-
id: "event.football-club-membership.action.validate.label"
|
|
5671
|
-
},
|
|
5672
|
-
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5673
|
-
},
|
|
5674
5716
|
{
|
|
5675
5717
|
type: ActionType.REGISTER,
|
|
5676
5718
|
label: {
|
|
5677
5719
|
defaultMessage: "Register",
|
|
5678
5720
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5679
5721
|
id: "event.football-club-membership.action.register.label"
|
|
5680
|
-
}
|
|
5681
|
-
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5722
|
+
}
|
|
5682
5723
|
},
|
|
5683
5724
|
{
|
|
5684
5725
|
type: ActionType.REQUEST_CORRECTION,
|
|
@@ -5884,14 +5925,6 @@ var footballClubMembershipEvent = defineConfig({
|
|
|
5884
5925
|
]
|
|
5885
5926
|
}
|
|
5886
5927
|
},
|
|
5887
|
-
{
|
|
5888
|
-
type: ActionType.APPROVE_CORRECTION,
|
|
5889
|
-
label: {
|
|
5890
|
-
defaultMessage: "Approve correction",
|
|
5891
|
-
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5892
|
-
id: "event.football-club-membership.action.correction.approve.label"
|
|
5893
|
-
}
|
|
5894
|
-
},
|
|
5895
5928
|
{
|
|
5896
5929
|
type: ActionType.PRINT_CERTIFICATE,
|
|
5897
5930
|
label: {
|
|
@@ -5900,22 +5933,6 @@ var footballClubMembershipEvent = defineConfig({
|
|
|
5900
5933
|
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5901
5934
|
},
|
|
5902
5935
|
printForm: PRINT_CERTIFICATE_FORM
|
|
5903
|
-
},
|
|
5904
|
-
{
|
|
5905
|
-
type: ActionType.ARCHIVE,
|
|
5906
|
-
label: {
|
|
5907
|
-
id: "event.football-club-membership.action.archive.label",
|
|
5908
|
-
defaultMessage: "Archive",
|
|
5909
|
-
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5910
|
-
}
|
|
5911
|
-
},
|
|
5912
|
-
{
|
|
5913
|
-
type: ActionType.REJECT,
|
|
5914
|
-
label: {
|
|
5915
|
-
id: "event.football-club-membership.action.reject.label",
|
|
5916
|
-
defaultMessage: "Reject",
|
|
5917
|
-
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5918
|
-
}
|
|
5919
5936
|
}
|
|
5920
5937
|
],
|
|
5921
5938
|
advancedSearch: [
|
|
@@ -5957,7 +5974,7 @@ var footballClubMembershipEvent = defineConfig({
|
|
|
5957
5974
|
});
|
|
5958
5975
|
|
|
5959
5976
|
// ../commons/src/fixtures/library-membership-event.ts
|
|
5960
|
-
var libraryMembershipForm = {
|
|
5977
|
+
var libraryMembershipForm = defineDeclarationForm({
|
|
5961
5978
|
label: {
|
|
5962
5979
|
id: "event.library-membership.action.declare.form.label",
|
|
5963
5980
|
defaultMessage: "Library membership application",
|
|
@@ -5997,7 +6014,7 @@ var libraryMembershipForm = {
|
|
|
5997
6014
|
]
|
|
5998
6015
|
}
|
|
5999
6016
|
]
|
|
6000
|
-
};
|
|
6017
|
+
});
|
|
6001
6018
|
var libraryMembershipEvent = defineConfig({
|
|
6002
6019
|
id: "library-membership",
|
|
6003
6020
|
label: {
|
|
@@ -6015,7 +6032,7 @@ var libraryMembershipEvent = defineConfig({
|
|
|
6015
6032
|
declaration: libraryMembershipForm
|
|
6016
6033
|
});
|
|
6017
6034
|
|
|
6018
|
-
// ../commons/src/fixtures/
|
|
6035
|
+
// ../commons/src/fixtures/child-onboarding-event.ts
|
|
6019
6036
|
function generateTranslationConfig(message) {
|
|
6020
6037
|
return {
|
|
6021
6038
|
defaultMessage: message,
|
|
@@ -6023,7 +6040,7 @@ function generateTranslationConfig(message) {
|
|
|
6023
6040
|
id: message
|
|
6024
6041
|
};
|
|
6025
6042
|
}
|
|
6026
|
-
var child = {
|
|
6043
|
+
var child = defineFormPage({
|
|
6027
6044
|
id: "child",
|
|
6028
6045
|
type: PageTypes.enum.FORM,
|
|
6029
6046
|
title: generateTranslationConfig("Child's details"),
|
|
@@ -6044,10 +6061,65 @@ var child = {
|
|
|
6044
6061
|
secured: true,
|
|
6045
6062
|
validation: [],
|
|
6046
6063
|
label: generateTranslationConfig("Date of birth")
|
|
6064
|
+
},
|
|
6065
|
+
{
|
|
6066
|
+
id: "child.placeOfBirth",
|
|
6067
|
+
analytics: true,
|
|
6068
|
+
type: FieldType.SELECT,
|
|
6069
|
+
required: true,
|
|
6070
|
+
secured: true,
|
|
6071
|
+
label: {
|
|
6072
|
+
defaultMessage: "Place of delivery",
|
|
6073
|
+
description: "This is the label for the field",
|
|
6074
|
+
id: "event.birth.action.declare.form.section.child.field.placeOfBirth.label"
|
|
6075
|
+
},
|
|
6076
|
+
options: [
|
|
6077
|
+
{
|
|
6078
|
+
value: "child.placeOfBirth-SELECT-2",
|
|
6079
|
+
label: generateTranslationConfig("Health Institution")
|
|
6080
|
+
},
|
|
6081
|
+
{
|
|
6082
|
+
value: "PRIVATE_HOME",
|
|
6083
|
+
label: generateTranslationConfig("Residential address")
|
|
6084
|
+
}
|
|
6085
|
+
]
|
|
6086
|
+
},
|
|
6087
|
+
{
|
|
6088
|
+
id: "child.birthLocation",
|
|
6089
|
+
analytics: true,
|
|
6090
|
+
type: "FACILITY",
|
|
6091
|
+
required: true,
|
|
6092
|
+
secured: true,
|
|
6093
|
+
label: generateTranslationConfig("Health Institution"),
|
|
6094
|
+
conditionals: [
|
|
6095
|
+
{
|
|
6096
|
+
type: "SHOW",
|
|
6097
|
+
conditional: field("child.placeOfBirth").isEqualTo(
|
|
6098
|
+
"child.placeOfBirth-SELECT-2"
|
|
6099
|
+
)
|
|
6100
|
+
}
|
|
6101
|
+
]
|
|
6102
|
+
},
|
|
6103
|
+
{
|
|
6104
|
+
id: "child.birthLocation.privateHome",
|
|
6105
|
+
analytics: true,
|
|
6106
|
+
type: FieldType.ADDRESS,
|
|
6107
|
+
secured: true,
|
|
6108
|
+
hideLabel: true,
|
|
6109
|
+
label: generateTranslationConfig("Child's address"),
|
|
6110
|
+
conditionals: [
|
|
6111
|
+
{
|
|
6112
|
+
type: "SHOW",
|
|
6113
|
+
conditional: field("child.placeOfBirth").isEqualTo("PRIVATE_HOME")
|
|
6114
|
+
}
|
|
6115
|
+
],
|
|
6116
|
+
configuration: {
|
|
6117
|
+
streetAddressForm: []
|
|
6118
|
+
}
|
|
6047
6119
|
}
|
|
6048
6120
|
]
|
|
6049
|
-
};
|
|
6050
|
-
var mother = {
|
|
6121
|
+
});
|
|
6122
|
+
var mother = defineFormPage({
|
|
6051
6123
|
id: "mother",
|
|
6052
6124
|
type: PageTypes.enum.FORM,
|
|
6053
6125
|
title: generateTranslationConfig("Mother's details"),
|
|
@@ -6119,8 +6191,8 @@ var mother = {
|
|
|
6119
6191
|
validation: []
|
|
6120
6192
|
}
|
|
6121
6193
|
]
|
|
6122
|
-
};
|
|
6123
|
-
var
|
|
6194
|
+
});
|
|
6195
|
+
var CHILD_ONBOARDING_DECLARATION_REVIEW = {
|
|
6124
6196
|
title: generateTranslationConfig(
|
|
6125
6197
|
"{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}}}}}"
|
|
6126
6198
|
),
|
|
@@ -6140,12 +6212,12 @@ var BIRTH_DECLARATION_REVIEW = {
|
|
|
6140
6212
|
}
|
|
6141
6213
|
]
|
|
6142
6214
|
};
|
|
6143
|
-
var
|
|
6215
|
+
var CHILD_ONBOARDING_DECLARATION_FORM = defineDeclarationForm({
|
|
6144
6216
|
label: generateTranslationConfig("Birth decalration form"),
|
|
6145
6217
|
pages: [child, mother]
|
|
6146
|
-
};
|
|
6147
|
-
var
|
|
6148
|
-
id:
|
|
6218
|
+
});
|
|
6219
|
+
var ChildOnboardingEvent = defineConfig({
|
|
6220
|
+
id: CHILD_ONBOARDING_EVENT,
|
|
6149
6221
|
title: generateTranslationConfig(
|
|
6150
6222
|
"{child.name.firstname} {child.name.surname}"
|
|
6151
6223
|
),
|
|
@@ -6153,34 +6225,28 @@ var v2BirthEvent = defineConfig({
|
|
|
6153
6225
|
summary: {
|
|
6154
6226
|
fields: []
|
|
6155
6227
|
},
|
|
6156
|
-
declaration:
|
|
6228
|
+
declaration: CHILD_ONBOARDING_DECLARATION_FORM,
|
|
6157
6229
|
actions: [
|
|
6158
6230
|
{
|
|
6159
6231
|
type: ActionType.READ,
|
|
6160
6232
|
label: generateTranslationConfig("Read"),
|
|
6161
|
-
review:
|
|
6233
|
+
review: CHILD_ONBOARDING_DECLARATION_REVIEW
|
|
6162
6234
|
},
|
|
6163
6235
|
{
|
|
6164
6236
|
type: ActionType.DECLARE,
|
|
6165
6237
|
label: generateTranslationConfig("Declare"),
|
|
6166
|
-
review:
|
|
6167
|
-
},
|
|
6168
|
-
{
|
|
6169
|
-
type: ActionType.VALIDATE,
|
|
6170
|
-
label: generateTranslationConfig("Validate"),
|
|
6171
|
-
review: BIRTH_DECLARATION_REVIEW
|
|
6238
|
+
review: CHILD_ONBOARDING_DECLARATION_REVIEW
|
|
6172
6239
|
},
|
|
6173
6240
|
{
|
|
6174
6241
|
type: ActionType.REGISTER,
|
|
6175
|
-
label: generateTranslationConfig("Register")
|
|
6176
|
-
review: BIRTH_DECLARATION_REVIEW
|
|
6242
|
+
label: generateTranslationConfig("Register")
|
|
6177
6243
|
}
|
|
6178
6244
|
],
|
|
6179
6245
|
advancedSearch: []
|
|
6180
6246
|
});
|
|
6181
6247
|
|
|
6182
6248
|
// ../commons/src/fixtures/digital-identity-issuance-event.ts
|
|
6183
|
-
var PRINT_DIGITAL_ID_CERTIFICATE_FORM = {
|
|
6249
|
+
var PRINT_DIGITAL_ID_CERTIFICATE_FORM = defineActionForm({
|
|
6184
6250
|
label: {
|
|
6185
6251
|
id: "event.digital-identity.action.certificate.form.label",
|
|
6186
6252
|
defaultMessage: "Digital identity certificate printer",
|
|
@@ -6261,7 +6327,7 @@ var PRINT_DIGITAL_ID_CERTIFICATE_FORM = {
|
|
|
6261
6327
|
conditionals: [
|
|
6262
6328
|
{
|
|
6263
6329
|
type: ConditionalType.ENABLE,
|
|
6264
|
-
conditional:
|
|
6330
|
+
conditional: never2()
|
|
6265
6331
|
},
|
|
6266
6332
|
{
|
|
6267
6333
|
type: ConditionalType.SHOW,
|
|
@@ -6288,7 +6354,7 @@ var PRINT_DIGITAL_ID_CERTIFICATE_FORM = {
|
|
|
6288
6354
|
conditionals: [
|
|
6289
6355
|
{
|
|
6290
6356
|
type: ConditionalType.ENABLE,
|
|
6291
|
-
conditional:
|
|
6357
|
+
conditional: never2()
|
|
6292
6358
|
},
|
|
6293
6359
|
{
|
|
6294
6360
|
type: ConditionalType.SHOW,
|
|
@@ -6316,7 +6382,7 @@ var PRINT_DIGITAL_ID_CERTIFICATE_FORM = {
|
|
|
6316
6382
|
conditionals: [
|
|
6317
6383
|
{
|
|
6318
6384
|
type: ConditionalType.ENABLE,
|
|
6319
|
-
conditional:
|
|
6385
|
+
conditional: never2()
|
|
6320
6386
|
}
|
|
6321
6387
|
],
|
|
6322
6388
|
value: field("identity.http-fetch").get("data.certificateId")
|
|
@@ -6324,8 +6390,8 @@ var PRINT_DIGITAL_ID_CERTIFICATE_FORM = {
|
|
|
6324
6390
|
]
|
|
6325
6391
|
}
|
|
6326
6392
|
]
|
|
6327
|
-
};
|
|
6328
|
-
var digitalIdentityForm = {
|
|
6393
|
+
});
|
|
6394
|
+
var digitalIdentityForm = defineDeclarationForm({
|
|
6329
6395
|
label: {
|
|
6330
6396
|
id: "event.digital-identity.action.declare.form.label",
|
|
6331
6397
|
defaultMessage: "Digital identity issuance",
|
|
@@ -6365,7 +6431,7 @@ var digitalIdentityForm = {
|
|
|
6365
6431
|
]
|
|
6366
6432
|
}
|
|
6367
6433
|
]
|
|
6368
|
-
};
|
|
6434
|
+
});
|
|
6369
6435
|
var digitalIdentityEvent = defineConfig({
|
|
6370
6436
|
id: "digital-identity",
|
|
6371
6437
|
label: {
|
|
@@ -6394,8 +6460,8 @@ var digitalIdentityEvent = defineConfig({
|
|
|
6394
6460
|
});
|
|
6395
6461
|
|
|
6396
6462
|
// ../commons/src/events/test.utils.ts
|
|
6397
|
-
var
|
|
6398
|
-
var TestUserRole =
|
|
6463
|
+
var z38 = __toESM(require("zod/v4"));
|
|
6464
|
+
var TestUserRole = z38.enum([
|
|
6399
6465
|
"FIELD_AGENT",
|
|
6400
6466
|
"LOCAL_REGISTRAR",
|
|
6401
6467
|
"LOCAL_SYSTEM_ADMIN",
|
|
@@ -6406,18 +6472,14 @@ var TestUserRole = import_zod36.z.enum([
|
|
|
6406
6472
|
]);
|
|
6407
6473
|
|
|
6408
6474
|
// ../commons/src/events/scopes.ts
|
|
6409
|
-
var
|
|
6475
|
+
var import_lodash6 = require("lodash");
|
|
6410
6476
|
var ACTION_SCOPE_MAP = {
|
|
6411
6477
|
[ActionType.READ]: ["record.read"],
|
|
6412
6478
|
[ActionType.CREATE]: ["record.create"],
|
|
6413
6479
|
[ActionType.NOTIFY]: ["record.notify"],
|
|
6414
|
-
[ActionType.DECLARE]: [
|
|
6415
|
-
|
|
6416
|
-
"record.declared.validate",
|
|
6417
|
-
"record.register"
|
|
6418
|
-
],
|
|
6480
|
+
[ActionType.DECLARE]: ["record.declare", "record.register"],
|
|
6481
|
+
[ActionType.EDIT]: ["record.declared.edit"],
|
|
6419
6482
|
[ActionType.DELETE]: ["record.declare"],
|
|
6420
|
-
[ActionType.VALIDATE]: ["record.declared.validate", "record.register"],
|
|
6421
6483
|
[ActionType.REGISTER]: ["record.register"],
|
|
6422
6484
|
[ActionType.PRINT_CERTIFICATE]: ["record.registered.print-certified-copies"],
|
|
6423
6485
|
[ActionType.REQUEST_CORRECTION]: [
|
|
@@ -6435,7 +6497,8 @@ var ACTION_SCOPE_MAP = {
|
|
|
6435
6497
|
[ActionType.REJECT]: ["record.declared.reject"],
|
|
6436
6498
|
[ActionType.ASSIGN]: null,
|
|
6437
6499
|
[ActionType.UNASSIGN]: null,
|
|
6438
|
-
[ActionType.DUPLICATE_DETECTED]: []
|
|
6500
|
+
[ActionType.DUPLICATE_DETECTED]: [],
|
|
6501
|
+
[ActionType.CUSTOM]: []
|
|
6439
6502
|
};
|
|
6440
6503
|
|
|
6441
6504
|
// ../commons/src/events/state/availableActions.ts
|
|
@@ -6444,28 +6507,25 @@ var AVAILABLE_ACTIONS_BY_EVENT_STATUS = {
|
|
|
6444
6507
|
ActionType.READ,
|
|
6445
6508
|
ActionType.DECLARE,
|
|
6446
6509
|
ActionType.NOTIFY,
|
|
6447
|
-
ActionType.DELETE
|
|
6510
|
+
ActionType.DELETE,
|
|
6511
|
+
ActionType.CUSTOM
|
|
6448
6512
|
],
|
|
6449
6513
|
[EventStatus.enum.NOTIFIED]: [
|
|
6450
6514
|
ActionType.READ,
|
|
6451
|
-
ActionType.
|
|
6515
|
+
ActionType.EDIT,
|
|
6452
6516
|
ActionType.MARK_AS_DUPLICATE,
|
|
6453
6517
|
ActionType.ARCHIVE,
|
|
6454
|
-
ActionType.REJECT
|
|
6518
|
+
ActionType.REJECT,
|
|
6519
|
+
ActionType.CUSTOM
|
|
6455
6520
|
],
|
|
6456
6521
|
[EventStatus.enum.DECLARED]: [
|
|
6457
|
-
ActionType.READ,
|
|
6458
|
-
ActionType.VALIDATE,
|
|
6459
|
-
ActionType.MARK_AS_DUPLICATE,
|
|
6460
|
-
ActionType.ARCHIVE,
|
|
6461
|
-
ActionType.REJECT
|
|
6462
|
-
],
|
|
6463
|
-
[EventStatus.enum.VALIDATED]: [
|
|
6464
6522
|
ActionType.READ,
|
|
6465
6523
|
ActionType.REGISTER,
|
|
6466
6524
|
ActionType.MARK_AS_DUPLICATE,
|
|
6467
6525
|
ActionType.ARCHIVE,
|
|
6468
|
-
ActionType.REJECT
|
|
6526
|
+
ActionType.REJECT,
|
|
6527
|
+
ActionType.CUSTOM,
|
|
6528
|
+
ActionType.EDIT
|
|
6469
6529
|
],
|
|
6470
6530
|
[EventStatus.enum.REGISTERED]: [
|
|
6471
6531
|
ActionType.READ,
|
|
@@ -6473,12 +6533,14 @@ var AVAILABLE_ACTIONS_BY_EVENT_STATUS = {
|
|
|
6473
6533
|
ActionType.REQUEST_CORRECTION,
|
|
6474
6534
|
ActionType.APPROVE_CORRECTION,
|
|
6475
6535
|
ActionType.REJECT_CORRECTION,
|
|
6536
|
+
ActionType.CUSTOM,
|
|
6476
6537
|
ClientSpecificAction.REVIEW_CORRECTION_REQUEST
|
|
6477
6538
|
],
|
|
6478
6539
|
[EventStatus.enum.ARCHIVED]: [
|
|
6479
6540
|
ActionType.READ,
|
|
6480
6541
|
ActionType.ASSIGN,
|
|
6481
|
-
ActionType.UNASSIGN
|
|
6542
|
+
ActionType.UNASSIGN,
|
|
6543
|
+
ActionType.CUSTOM
|
|
6482
6544
|
]
|
|
6483
6545
|
};
|
|
6484
6546
|
var ACTION_FILTERS = {
|
|
@@ -6488,32 +6550,41 @@ var ACTION_FILTERS = {
|
|
|
6488
6550
|
[ActionType.APPROVE_CORRECTION]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6489
6551
|
[ActionType.REJECT_CORRECTION]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6490
6552
|
[ActionType.MARK_AS_DUPLICATE]: (flags) => flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6491
|
-
[ActionType.
|
|
6553
|
+
[ActionType.EDIT]: (flags) => !flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6492
6554
|
[ActionType.REGISTER]: (flags) => !flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6493
6555
|
[ActionType.REJECT]: (flags) => !flags.includes(InherentFlags.REJECTED) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6494
6556
|
[ActionType.ARCHIVE]: (flags) => !flags.some((flag) => flag.endsWith(":requested"))
|
|
6495
6557
|
};
|
|
6496
6558
|
|
|
6497
6559
|
// ../commons/src/events/FileUtils.ts
|
|
6498
|
-
var
|
|
6560
|
+
var import_lodash7 = require("lodash");
|
|
6499
6561
|
|
|
6500
6562
|
// ../commons/src/events/locations.ts
|
|
6501
|
-
var
|
|
6502
|
-
var
|
|
6563
|
+
var z39 = __toESM(require("zod/v4"));
|
|
6564
|
+
var LocationTypeV1 = z39.enum([
|
|
6503
6565
|
"ADMIN_STRUCTURE",
|
|
6504
6566
|
"CRVS_OFFICE",
|
|
6505
6567
|
"HEALTH_FACILITY"
|
|
6506
6568
|
]);
|
|
6507
|
-
var
|
|
6569
|
+
var LocationType = z39.enum(["CRVS_OFFICE", "HEALTH_FACILITY"]);
|
|
6570
|
+
var AdministrativeArea = z39.object({
|
|
6508
6571
|
id: UUID,
|
|
6509
|
-
name:
|
|
6572
|
+
name: z39.string(),
|
|
6573
|
+
externalId: z39.string().nullish(),
|
|
6510
6574
|
parentId: UUID.nullable(),
|
|
6511
|
-
validUntil:
|
|
6512
|
-
|
|
6575
|
+
validUntil: z39.iso.datetime().nullable()
|
|
6576
|
+
});
|
|
6577
|
+
var Location = z39.object({
|
|
6578
|
+
id: UUID,
|
|
6579
|
+
name: z39.string(),
|
|
6580
|
+
externalId: z39.string().nullish(),
|
|
6581
|
+
administrativeAreaId: UUID.nullable(),
|
|
6582
|
+
validUntil: z39.iso.datetime().nullable(),
|
|
6583
|
+
locationType: z39.string().nullable()
|
|
6513
6584
|
});
|
|
6514
6585
|
|
|
6515
6586
|
// ../commons/src/notification/UserNotifications.ts
|
|
6516
|
-
var
|
|
6587
|
+
var z40 = __toESM(require("zod/v4"));
|
|
6517
6588
|
var TriggerEvent = {
|
|
6518
6589
|
USER_CREATED: "user-created",
|
|
6519
6590
|
USER_UPDATED: "user-updated",
|
|
@@ -6525,50 +6596,50 @@ var TriggerEvent = {
|
|
|
6525
6596
|
CHANGE_PHONE_NUMBER: "change-phone-number",
|
|
6526
6597
|
CHANGE_EMAIL_ADDRESS: "change-email-address"
|
|
6527
6598
|
};
|
|
6528
|
-
var Recipient =
|
|
6599
|
+
var Recipient = z40.object({
|
|
6529
6600
|
name: NameFieldValue.optional(),
|
|
6530
|
-
mobile:
|
|
6531
|
-
email:
|
|
6532
|
-
bcc:
|
|
6601
|
+
mobile: z40.string().optional(),
|
|
6602
|
+
email: z40.string().optional(),
|
|
6603
|
+
bcc: z40.array(z40.string()).optional()
|
|
6533
6604
|
});
|
|
6534
|
-
var BasePayload =
|
|
6605
|
+
var BasePayload = z40.object({
|
|
6535
6606
|
recipient: Recipient
|
|
6536
6607
|
});
|
|
6537
6608
|
var TriggerPayload = {
|
|
6538
6609
|
[TriggerEvent.USER_CREATED]: BasePayload.extend({
|
|
6539
|
-
username:
|
|
6540
|
-
temporaryPassword:
|
|
6610
|
+
username: z40.string(),
|
|
6611
|
+
temporaryPassword: z40.string()
|
|
6541
6612
|
}),
|
|
6542
6613
|
[TriggerEvent.USER_UPDATED]: BasePayload.extend({
|
|
6543
|
-
oldUsername:
|
|
6544
|
-
newUsername:
|
|
6614
|
+
oldUsername: z40.string(),
|
|
6615
|
+
newUsername: z40.string()
|
|
6545
6616
|
}),
|
|
6546
6617
|
[TriggerEvent.USERNAME_REMINDER]: BasePayload.extend({
|
|
6547
|
-
username:
|
|
6618
|
+
username: z40.string()
|
|
6548
6619
|
}),
|
|
6549
6620
|
[TriggerEvent.RESET_PASSWORD]: BasePayload.extend({
|
|
6550
|
-
code:
|
|
6621
|
+
code: z40.string()
|
|
6551
6622
|
}),
|
|
6552
6623
|
[TriggerEvent.RESET_PASSWORD_BY_ADMIN]: BasePayload.extend({
|
|
6553
|
-
temporaryPassword:
|
|
6554
|
-
admin:
|
|
6555
|
-
id:
|
|
6624
|
+
temporaryPassword: z40.string(),
|
|
6625
|
+
admin: z40.object({
|
|
6626
|
+
id: z40.string(),
|
|
6556
6627
|
name: NameFieldValue,
|
|
6557
|
-
role:
|
|
6628
|
+
role: z40.string()
|
|
6558
6629
|
})
|
|
6559
6630
|
}),
|
|
6560
6631
|
[TriggerEvent.TWO_FA]: BasePayload.extend({
|
|
6561
|
-
code:
|
|
6632
|
+
code: z40.string()
|
|
6562
6633
|
}),
|
|
6563
6634
|
[TriggerEvent.ALL_USER_NOTIFICATION]: BasePayload.extend({
|
|
6564
|
-
subject:
|
|
6565
|
-
body:
|
|
6635
|
+
subject: z40.string(),
|
|
6636
|
+
body: z40.string()
|
|
6566
6637
|
}),
|
|
6567
6638
|
[TriggerEvent.CHANGE_PHONE_NUMBER]: BasePayload.extend({
|
|
6568
|
-
code:
|
|
6639
|
+
code: z40.string()
|
|
6569
6640
|
}),
|
|
6570
6641
|
[TriggerEvent.CHANGE_EMAIL_ADDRESS]: BasePayload.extend({
|
|
6571
|
-
code:
|
|
6642
|
+
code: z40.string()
|
|
6572
6643
|
})
|
|
6573
6644
|
};
|
|
6574
6645
|
async function triggerUserEventNotification({
|
|
@@ -6590,3 +6661,6 @@ function parseUserEventTrigger(event2, body) {
|
|
|
6590
6661
|
const schema = TriggerPayload[event2];
|
|
6591
6662
|
return schema.parse(body);
|
|
6592
6663
|
}
|
|
6664
|
+
|
|
6665
|
+
// src/notification/index.ts
|
|
6666
|
+
z41.globalRegistry.clear();
|