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