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