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