@opencrvs/toolkit 1.9.2-rc.c3822a1 → 1.9.2-rc.f6dcfa6
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 +1620 -26666
- package/dist/commons/conditionals/conditionals.d.ts +1 -10
- package/dist/commons/conditionals/validate.d.ts +4 -11
- package/dist/commons/events/ActionConfig.d.ts +1525 -21293
- package/dist/commons/events/ActionDocument.d.ts +1849 -764
- package/dist/commons/events/ActionInput.d.ts +1066 -264
- package/dist/commons/events/ActionType.d.ts +8 -85
- package/dist/commons/events/AdvancedSearchConfig.d.ts +1238 -211
- package/dist/commons/events/CompositeFieldValue.d.ts +176 -25
- package/dist/commons/events/Conditional.d.ts +38 -26
- package/dist/commons/events/Constants.d.ts +1 -1
- package/dist/commons/events/CountryConfigQueryInput.d.ts +4169 -919
- package/dist/commons/events/CreatedAtLocation.d.ts +1 -1
- package/dist/commons/events/DeduplicationConfig.d.ts +150 -15
- package/dist/commons/events/Draft.d.ts +105 -70
- package/dist/commons/events/DynamicFieldValue.d.ts +91 -7
- package/dist/commons/events/EventConfig.d.ts +2096 -17110
- package/dist/commons/events/EventConfigInput.d.ts +1 -1
- package/dist/commons/events/EventDocument.d.ts +1326 -311
- package/dist/commons/events/EventIndex.d.ts +967 -191
- package/dist/commons/events/EventInput.d.ts +8 -2
- package/dist/commons/events/EventMetadata.d.ts +345 -102
- package/dist/commons/events/FieldConfig.d.ts +11775 -4088
- package/dist/commons/events/FieldType.d.ts +2 -6
- package/dist/commons/events/FieldTypeMapping.d.ts +810 -164
- package/dist/commons/events/FieldValue.d.ts +354 -80
- package/dist/commons/events/FormConfig.d.ts +697 -12636
- package/dist/commons/events/PageConfig.d.ts +314 -8441
- package/dist/commons/events/SummaryConfig.d.ts +161 -14
- package/dist/commons/events/TranslationConfig.d.ts +2 -2
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +36 -70
- package/dist/commons/events/WorkqueueConfig.d.ts +7080 -1597
- package/dist/commons/events/deduplication.d.ts +3 -3
- package/dist/commons/events/defineConfig.d.ts +155 -24703
- package/dist/commons/events/index.d.ts +0 -1
- package/dist/commons/events/locations.d.ts +19 -15
- package/dist/commons/events/scopes.d.ts +0 -1
- package/dist/commons/events/state/availableActions.d.ts +1 -2
- package/dist/commons/events/state/flags.d.ts +3 -21
- package/dist/commons/events/state/index.d.ts +19 -17
- package/dist/commons/events/state/utils.d.ts +112 -127
- package/dist/commons/events/test.utils.d.ts +5 -11
- package/dist/commons/events/transactions.d.ts +1 -1
- package/dist/commons/events/utils.d.ts +359 -49444
- package/dist/commons/notification/UserNotifications.d.ts +636 -55
- package/dist/conditionals/index.d.ts.map +1 -1
- package/dist/conditionals/index.js +5 -38
- package/dist/events/deduplication.d.ts +3 -3
- package/dist/events/index.js +1360 -1502
- package/dist/notification/index.d.ts.map +1 -1
- package/dist/notification/index.js +1279 -1276
- package/dist/scopes/index.d.ts +136 -106
- package/dist/scopes/index.d.ts.map +1 -1
- package/dist/scopes/index.js +93 -116
- package/package.json +5 -5
- package/dist/commons/events/Flag.d.ts +0 -43
|
@@ -38,7 +38,6 @@ __export(notification_exports, {
|
|
|
38
38
|
triggerUserEventNotification: () => triggerUserEventNotification
|
|
39
39
|
});
|
|
40
40
|
module.exports = __toCommonJS(notification_exports);
|
|
41
|
-
var z40 = __toESM(require("zod/v4"));
|
|
42
41
|
|
|
43
42
|
// ../commons/src/url.ts
|
|
44
43
|
function joinUrl(base, path) {
|
|
@@ -48,28 +47,30 @@ function joinUrl(base, path) {
|
|
|
48
47
|
|
|
49
48
|
// ../commons/src/events/Constants.ts
|
|
50
49
|
var TENNIS_CLUB_MEMBERSHIP = "tennis-club-membership";
|
|
51
|
-
var
|
|
50
|
+
var BIRTH_EVENT = "birth";
|
|
52
51
|
|
|
53
52
|
// ../commons/src/events/ActionConfig.ts
|
|
54
|
-
var
|
|
53
|
+
var import_zod19 = require("zod");
|
|
55
54
|
|
|
56
55
|
// ../commons/src/events/TranslationConfig.ts
|
|
57
|
-
var
|
|
58
|
-
var
|
|
59
|
-
|
|
56
|
+
var import_zod = require("zod");
|
|
57
|
+
var import_zod_openapi = require("zod-openapi");
|
|
58
|
+
(0, import_zod_openapi.extendZodWithOpenApi)(import_zod.z);
|
|
59
|
+
var TranslationConfig = import_zod.z.object({
|
|
60
|
+
id: import_zod.z.string().describe(
|
|
60
61
|
"The identifier of the translation referred in translation CSV files"
|
|
61
62
|
),
|
|
62
|
-
defaultMessage: z.string().describe("Default translation message"),
|
|
63
|
-
description: z.string().describe(
|
|
63
|
+
defaultMessage: import_zod.z.string().describe("Default translation message"),
|
|
64
|
+
description: import_zod.z.string().describe(
|
|
64
65
|
"Describe the translation for a translator to be able to identify it."
|
|
65
66
|
)
|
|
66
|
-
}).
|
|
67
|
+
}).openapi({
|
|
67
68
|
description: "Translation configuration",
|
|
68
|
-
|
|
69
|
+
ref: "TranslationConfig"
|
|
69
70
|
});
|
|
70
71
|
|
|
71
72
|
// ../commons/src/events/ActionType.ts
|
|
72
|
-
var
|
|
73
|
+
var import_zod2 = require("zod");
|
|
73
74
|
var ActionType = {
|
|
74
75
|
// Pre-declaration actions
|
|
75
76
|
DELETE: "DELETE",
|
|
@@ -94,9 +95,7 @@ var ActionType = {
|
|
|
94
95
|
// General actions
|
|
95
96
|
READ: "READ",
|
|
96
97
|
ASSIGN: "ASSIGN",
|
|
97
|
-
UNASSIGN: "UNASSIGN"
|
|
98
|
-
// Custom action
|
|
99
|
-
CUSTOM: "CUSTOM"
|
|
98
|
+
UNASSIGN: "UNASSIGN"
|
|
100
99
|
};
|
|
101
100
|
var ConfirmableActions = [
|
|
102
101
|
ActionType.NOTIFY,
|
|
@@ -108,10 +107,9 @@ var ConfirmableActions = [
|
|
|
108
107
|
ActionType.PRINT_CERTIFICATE,
|
|
109
108
|
ActionType.REQUEST_CORRECTION,
|
|
110
109
|
ActionType.APPROVE_CORRECTION,
|
|
111
|
-
ActionType.REJECT_CORRECTION
|
|
112
|
-
ActionType.CUSTOM
|
|
110
|
+
ActionType.REJECT_CORRECTION
|
|
113
111
|
];
|
|
114
|
-
var ActionTypes =
|
|
112
|
+
var ActionTypes = import_zod2.z.enum([
|
|
115
113
|
"DELETE",
|
|
116
114
|
"CREATE",
|
|
117
115
|
"NOTIFY",
|
|
@@ -129,8 +127,7 @@ var ActionTypes = z2.enum([
|
|
|
129
127
|
"APPROVE_CORRECTION",
|
|
130
128
|
"READ",
|
|
131
129
|
"ASSIGN",
|
|
132
|
-
"UNASSIGN"
|
|
133
|
-
"CUSTOM"
|
|
130
|
+
"UNASSIGN"
|
|
134
131
|
]);
|
|
135
132
|
var ClientSpecificAction = {
|
|
136
133
|
REVIEW_CORRECTION_REQUEST: "REVIEW_CORRECTION_REQUEST"
|
|
@@ -158,14 +155,13 @@ var writeActions = ActionTypes.exclude([
|
|
|
158
155
|
ActionType.UNASSIGN
|
|
159
156
|
]);
|
|
160
157
|
var workqueueActions = ActionTypes.exclude([
|
|
161
|
-
ActionType.READ,
|
|
162
158
|
ActionType.CREATE,
|
|
163
159
|
ActionType.NOTIFY,
|
|
164
160
|
ActionType.DUPLICATE_DETECTED,
|
|
161
|
+
ActionType.REJECT,
|
|
165
162
|
ActionType.MARK_AS_NOT_DUPLICATE,
|
|
166
163
|
ActionType.REJECT_CORRECTION,
|
|
167
|
-
ActionType.APPROVE_CORRECTION
|
|
168
|
-
ActionType.CUSTOM
|
|
164
|
+
ActionType.APPROVE_CORRECTION
|
|
169
165
|
]);
|
|
170
166
|
var META_ACTIONS = [
|
|
171
167
|
ActionType.ASSIGN,
|
|
@@ -174,57 +170,59 @@ var META_ACTIONS = [
|
|
|
174
170
|
];
|
|
175
171
|
|
|
176
172
|
// ../commons/src/events/FieldConfig.ts
|
|
177
|
-
var
|
|
173
|
+
var import_zod15 = require("zod");
|
|
178
174
|
|
|
179
175
|
// ../commons/src/events/Conditional.ts
|
|
180
|
-
var
|
|
181
|
-
var
|
|
176
|
+
var import_zod3 = require("zod");
|
|
177
|
+
var import_zod_openapi2 = require("zod-openapi");
|
|
178
|
+
(0, import_zod_openapi2.extendZodWithOpenApi)(import_zod3.z);
|
|
179
|
+
var Conditional = import_zod3.z.custom((val) => typeof val === "object" && val !== null).openapi({
|
|
182
180
|
description: "JSON schema conditional configuration",
|
|
183
|
-
|
|
181
|
+
ref: "Conditional"
|
|
184
182
|
});
|
|
185
183
|
var ConditionalType = {
|
|
186
184
|
SHOW: "SHOW",
|
|
187
185
|
ENABLE: "ENABLE",
|
|
188
186
|
DISPLAY_ON_REVIEW: "DISPLAY_ON_REVIEW"
|
|
189
187
|
};
|
|
190
|
-
var ShowConditional =
|
|
191
|
-
type:
|
|
188
|
+
var ShowConditional = import_zod3.z.object({
|
|
189
|
+
type: import_zod3.z.literal(ConditionalType.SHOW),
|
|
192
190
|
conditional: Conditional
|
|
193
191
|
}).describe(
|
|
194
192
|
"If 'SHOW' conditional is defined, the component is shown to the user only if the condition is met"
|
|
195
193
|
);
|
|
196
|
-
var EnableConditional =
|
|
197
|
-
type:
|
|
194
|
+
var EnableConditional = import_zod3.z.object({
|
|
195
|
+
type: import_zod3.z.literal(ConditionalType.ENABLE),
|
|
198
196
|
conditional: Conditional
|
|
199
197
|
}).describe(
|
|
200
198
|
"If 'ENABLE' conditional is defined, the component is enabled only if the condition is met"
|
|
201
199
|
);
|
|
202
|
-
var ActionConditional =
|
|
200
|
+
var ActionConditional = import_zod3.z.discriminatedUnion("type", [
|
|
203
201
|
// Action can be shown / hidden
|
|
204
202
|
ShowConditional,
|
|
205
203
|
// Action can be shown to the user in the list but as disabled
|
|
206
204
|
EnableConditional
|
|
207
205
|
]);
|
|
208
|
-
var DisplayOnReviewConditional =
|
|
209
|
-
type:
|
|
206
|
+
var DisplayOnReviewConditional = import_zod3.z.object({
|
|
207
|
+
type: import_zod3.z.literal(ConditionalType.DISPLAY_ON_REVIEW),
|
|
210
208
|
conditional: Conditional
|
|
211
209
|
}).describe(
|
|
212
210
|
"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."
|
|
213
211
|
);
|
|
214
|
-
var FieldConditional =
|
|
212
|
+
var FieldConditional = import_zod3.z.discriminatedUnion("type", [
|
|
215
213
|
// Field input can be shown / hidden
|
|
216
214
|
ShowConditional,
|
|
217
215
|
// Field input can be shown to the user but as disabled
|
|
218
216
|
EnableConditional,
|
|
219
217
|
// Field output can be shown / hidden on the review page
|
|
220
218
|
DisplayOnReviewConditional
|
|
221
|
-
]).
|
|
219
|
+
]).openapi({
|
|
222
220
|
description: "Field conditional configuration",
|
|
223
|
-
|
|
221
|
+
ref: "FieldConditional"
|
|
224
222
|
});
|
|
225
223
|
|
|
226
224
|
// ../commons/src/events/FieldType.ts
|
|
227
|
-
var
|
|
225
|
+
var import_zod4 = require("zod");
|
|
228
226
|
var FieldType = {
|
|
229
227
|
NAME: "NAME",
|
|
230
228
|
PHONE: "PHONE",
|
|
@@ -268,7 +266,7 @@ var FieldType = {
|
|
|
268
266
|
ID_READER: "ID_READER",
|
|
269
267
|
LOADER: "LOADER"
|
|
270
268
|
};
|
|
271
|
-
var FileFieldType =
|
|
269
|
+
var FileFieldType = import_zod4.z.enum([
|
|
272
270
|
FieldType.FILE,
|
|
273
271
|
FieldType.FILE_WITH_OPTIONS,
|
|
274
272
|
FieldType.SIGNATURE
|
|
@@ -295,140 +293,142 @@ var FieldTypesToHideInReview = [
|
|
|
295
293
|
];
|
|
296
294
|
|
|
297
295
|
// ../commons/src/events/FieldValue.ts
|
|
298
|
-
var
|
|
296
|
+
var import_zod7 = require("zod");
|
|
299
297
|
|
|
300
298
|
// ../commons/src/documents.ts
|
|
301
|
-
var
|
|
302
|
-
var
|
|
299
|
+
var import_zod5 = require("zod");
|
|
300
|
+
var import_zod_openapi3 = require("zod-openapi");
|
|
301
|
+
(0, import_zod_openapi3.extendZodWithOpenApi)(import_zod5.z);
|
|
302
|
+
var FullDocumentUrl = import_zod5.z.string().brand("FullDocumentUrl").describe(
|
|
303
303
|
"A full url with protocol, host, bucket name, starting from the root of the S3 server, https://minio.opencrvs.com/bucket-name/document-id.jpg"
|
|
304
304
|
);
|
|
305
|
-
var FullDocumentPath =
|
|
305
|
+
var FullDocumentPath = import_zod5.z.string().transform((val) => val.startsWith("/") ? val : `/${val}`).openapi({ effectType: "input", type: "string" }).describe(
|
|
306
306
|
"A full absolute path with bucket name, starting from the root of the S3 server, /bucket-name/document-id.jpg"
|
|
307
307
|
);
|
|
308
|
-
var DocumentPath =
|
|
308
|
+
var DocumentPath = import_zod5.z.string().brand("DocumentPath").describe(
|
|
309
309
|
"A full identifier starting from the root of the S3 bucket, e.g. /document-id.jpg or /directory/document-id.jpg but never /bucket-name/document-id.jpg"
|
|
310
310
|
);
|
|
311
311
|
|
|
312
312
|
// ../commons/src/events/CompositeFieldValue.ts
|
|
313
|
-
var
|
|
313
|
+
var import_zod6 = require("zod");
|
|
314
314
|
var AddressType = {
|
|
315
315
|
DOMESTIC: "DOMESTIC",
|
|
316
316
|
INTERNATIONAL: "INTERNATIONAL"
|
|
317
317
|
};
|
|
318
|
-
var FileFieldValue =
|
|
318
|
+
var FileFieldValue = import_zod6.z.object({
|
|
319
319
|
path: FullDocumentPath,
|
|
320
|
-
originalFilename:
|
|
321
|
-
type:
|
|
320
|
+
originalFilename: import_zod6.z.string(),
|
|
321
|
+
type: import_zod6.z.string()
|
|
322
322
|
});
|
|
323
|
-
var NameFieldValue =
|
|
324
|
-
firstname:
|
|
325
|
-
surname:
|
|
326
|
-
middlename:
|
|
323
|
+
var NameFieldValue = import_zod6.z.object({
|
|
324
|
+
firstname: import_zod6.z.string(),
|
|
325
|
+
surname: import_zod6.z.string(),
|
|
326
|
+
middlename: import_zod6.z.string().optional()
|
|
327
327
|
});
|
|
328
|
-
var NameFieldUpdateValue =
|
|
329
|
-
firstname:
|
|
330
|
-
surname:
|
|
331
|
-
middlename:
|
|
332
|
-
}).or(
|
|
333
|
-
var StreetLevelDetailsValue =
|
|
334
|
-
var StreetLevelDetailsUpdateValue =
|
|
335
|
-
var BaseAddressFieldValue =
|
|
336
|
-
country:
|
|
328
|
+
var NameFieldUpdateValue = import_zod6.z.object({
|
|
329
|
+
firstname: import_zod6.z.string().nullish(),
|
|
330
|
+
surname: import_zod6.z.string().nullish(),
|
|
331
|
+
middlename: import_zod6.z.string().nullish()
|
|
332
|
+
}).or(import_zod6.z.null()).or(import_zod6.z.undefined());
|
|
333
|
+
var StreetLevelDetailsValue = import_zod6.z.record(import_zod6.z.string(), import_zod6.z.string()).optional();
|
|
334
|
+
var StreetLevelDetailsUpdateValue = import_zod6.z.record(import_zod6.z.string(), import_zod6.z.string().nullable()).nullish();
|
|
335
|
+
var BaseAddressFieldValue = import_zod6.z.object({
|
|
336
|
+
country: import_zod6.z.string(),
|
|
337
337
|
streetLevelDetails: StreetLevelDetailsValue
|
|
338
338
|
});
|
|
339
|
-
var BaseAddressFieldUpdateValue =
|
|
340
|
-
country:
|
|
339
|
+
var BaseAddressFieldUpdateValue = import_zod6.z.object({
|
|
340
|
+
country: import_zod6.z.string().nullish(),
|
|
341
341
|
streetLevelDetails: StreetLevelDetailsUpdateValue
|
|
342
342
|
});
|
|
343
343
|
var DomesticAddressFieldValue = BaseAddressFieldValue.extend({
|
|
344
|
-
addressType:
|
|
345
|
-
administrativeArea:
|
|
344
|
+
addressType: import_zod6.z.literal(AddressType.DOMESTIC),
|
|
345
|
+
administrativeArea: import_zod6.z.string().uuid()
|
|
346
346
|
});
|
|
347
347
|
var InternationalAddressFieldValue = BaseAddressFieldValue.extend({
|
|
348
|
-
addressType:
|
|
348
|
+
addressType: import_zod6.z.literal(AddressType.INTERNATIONAL)
|
|
349
349
|
});
|
|
350
|
-
var AddressFieldValue =
|
|
350
|
+
var AddressFieldValue = import_zod6.z.discriminatedUnion("addressType", [
|
|
351
351
|
DomesticAddressFieldValue,
|
|
352
352
|
InternationalAddressFieldValue
|
|
353
353
|
]);
|
|
354
354
|
var DomesticAddressUpdateFieldValue = BaseAddressFieldUpdateValue.extend({
|
|
355
|
-
addressType:
|
|
356
|
-
administrativeArea:
|
|
355
|
+
addressType: import_zod6.z.literal(AddressType.DOMESTIC),
|
|
356
|
+
administrativeArea: import_zod6.z.string().uuid().nullish()
|
|
357
357
|
/* Leaf level admin structure */
|
|
358
358
|
});
|
|
359
359
|
var InternationalAddressUpdateFieldValue = BaseAddressFieldUpdateValue.extend(
|
|
360
360
|
{
|
|
361
|
-
addressType:
|
|
361
|
+
addressType: import_zod6.z.literal(AddressType.INTERNATIONAL)
|
|
362
362
|
}
|
|
363
363
|
);
|
|
364
|
-
var AddressFieldUpdateValue =
|
|
364
|
+
var AddressFieldUpdateValue = import_zod6.z.discriminatedUnion("addressType", [
|
|
365
365
|
DomesticAddressUpdateFieldValue,
|
|
366
366
|
InternationalAddressUpdateFieldValue
|
|
367
367
|
]).nullish();
|
|
368
|
-
var FileFieldValueWithOption =
|
|
368
|
+
var FileFieldValueWithOption = import_zod6.z.object({
|
|
369
369
|
path: FullDocumentPath,
|
|
370
|
-
originalFilename:
|
|
371
|
-
type:
|
|
372
|
-
option:
|
|
370
|
+
originalFilename: import_zod6.z.string(),
|
|
371
|
+
type: import_zod6.z.string(),
|
|
372
|
+
option: import_zod6.z.string()
|
|
373
373
|
});
|
|
374
|
-
var FileFieldWithOptionValue =
|
|
375
|
-
var HttpFieldValue =
|
|
376
|
-
loading:
|
|
377
|
-
error:
|
|
378
|
-
data:
|
|
374
|
+
var FileFieldWithOptionValue = import_zod6.z.array(FileFieldValueWithOption);
|
|
375
|
+
var HttpFieldValue = import_zod6.z.object({
|
|
376
|
+
loading: import_zod6.z.boolean(),
|
|
377
|
+
error: import_zod6.z.object({ statusCode: import_zod6.z.number(), message: import_zod6.z.string() }).nullish(),
|
|
378
|
+
data: import_zod6.z.any()
|
|
379
379
|
});
|
|
380
|
-
var HttpFieldUpdateValue =
|
|
381
|
-
loading:
|
|
382
|
-
error:
|
|
383
|
-
data:
|
|
384
|
-
}).or(
|
|
385
|
-
var QueryParamReaderFieldValue =
|
|
386
|
-
data:
|
|
380
|
+
var HttpFieldUpdateValue = import_zod6.z.object({
|
|
381
|
+
loading: import_zod6.z.boolean().nullish(),
|
|
382
|
+
error: import_zod6.z.object({ statusCode: import_zod6.z.number(), message: import_zod6.z.string() }).nullish(),
|
|
383
|
+
data: import_zod6.z.any().nullish()
|
|
384
|
+
}).or(import_zod6.z.null()).or(import_zod6.z.undefined());
|
|
385
|
+
var QueryParamReaderFieldValue = import_zod6.z.object({
|
|
386
|
+
data: import_zod6.z.record(import_zod6.z.string(), import_zod6.z.string())
|
|
387
387
|
}).nullish();
|
|
388
|
-
var QueryParamReaderFieldUpdateValue =
|
|
389
|
-
data:
|
|
388
|
+
var QueryParamReaderFieldUpdateValue = import_zod6.z.object({
|
|
389
|
+
data: import_zod6.z.record(import_zod6.z.string(), import_zod6.z.string())
|
|
390
390
|
});
|
|
391
|
-
var ReadDataValue =
|
|
392
|
-
data:
|
|
391
|
+
var ReadDataValue = import_zod6.z.object({
|
|
392
|
+
data: import_zod6.z.any()
|
|
393
393
|
});
|
|
394
394
|
var QrReaderFieldValue = ReadDataValue;
|
|
395
395
|
var IdReaderFieldValue = ReadDataValue;
|
|
396
396
|
|
|
397
397
|
// ../commons/src/events/FieldValue.ts
|
|
398
|
-
var TextValue =
|
|
398
|
+
var TextValue = import_zod7.z.string();
|
|
399
399
|
var NonEmptyTextValue = TextValue.min(1);
|
|
400
|
-
var DateValue =
|
|
401
|
-
var AgeValue =
|
|
402
|
-
age:
|
|
403
|
-
asOfDateRef:
|
|
400
|
+
var DateValue = import_zod7.z.string().date().describe("Date in the format YYYY-MM-DD");
|
|
401
|
+
var AgeValue = import_zod7.z.object({
|
|
402
|
+
age: import_zod7.z.number(),
|
|
403
|
+
asOfDateRef: import_zod7.z.string()
|
|
404
404
|
});
|
|
405
405
|
var AgeUpdateValue = AgeValue.optional().nullable();
|
|
406
|
-
var TimeValue =
|
|
407
|
-
var DatetimeValue =
|
|
408
|
-
var SelectDateRangeValue =
|
|
406
|
+
var TimeValue = import_zod7.z.string().regex(/^([01][0-9]|2[0-3]):[0-5][0-9]$/);
|
|
407
|
+
var DatetimeValue = import_zod7.z.string().datetime();
|
|
408
|
+
var SelectDateRangeValue = import_zod7.z.enum([
|
|
409
409
|
"last7Days",
|
|
410
410
|
"last30Days",
|
|
411
411
|
"last90Days",
|
|
412
412
|
"last365Days"
|
|
413
413
|
]);
|
|
414
|
-
var DateRangeFieldValue =
|
|
414
|
+
var DateRangeFieldValue = import_zod7.z.object({
|
|
415
415
|
start: DateValue,
|
|
416
416
|
end: DateValue
|
|
417
417
|
}).or(DateValue).describe(
|
|
418
418
|
"Date range with start and end dates in the format YYYY-MM-DD. Inclusive start, exclusive end."
|
|
419
419
|
);
|
|
420
|
-
var EmailValue =
|
|
421
|
-
var CheckboxFieldValue =
|
|
422
|
-
var NumberFieldValue =
|
|
423
|
-
var SignatureFieldValue =
|
|
424
|
-
var ButtonFieldValue =
|
|
425
|
-
var VerificationStatusValue =
|
|
420
|
+
var EmailValue = import_zod7.z.string().email();
|
|
421
|
+
var CheckboxFieldValue = import_zod7.z.boolean();
|
|
422
|
+
var NumberFieldValue = import_zod7.z.number();
|
|
423
|
+
var SignatureFieldValue = import_zod7.z.string();
|
|
424
|
+
var ButtonFieldValue = import_zod7.z.number();
|
|
425
|
+
var VerificationStatusValue = import_zod7.z.enum([
|
|
426
426
|
"verified",
|
|
427
427
|
"authenticated",
|
|
428
428
|
"failed",
|
|
429
429
|
"pending"
|
|
430
430
|
]);
|
|
431
|
-
var FieldValuesWithoutDataField =
|
|
431
|
+
var FieldValuesWithoutDataField = import_zod7.z.union([
|
|
432
432
|
AddressFieldValue,
|
|
433
433
|
TextValue,
|
|
434
434
|
DateValue,
|
|
@@ -449,10 +449,10 @@ var FieldValuesWithoutDataField = z7.union([
|
|
|
449
449
|
QrReaderFieldValue,
|
|
450
450
|
IdReaderFieldValue
|
|
451
451
|
]);
|
|
452
|
-
var DataFieldValue =
|
|
453
|
-
data:
|
|
452
|
+
var DataFieldValue = import_zod7.z.object({
|
|
453
|
+
data: import_zod7.z.record(import_zod7.z.string(), FieldValuesWithoutDataField)
|
|
454
454
|
}).nullish();
|
|
455
|
-
var FieldValue =
|
|
455
|
+
var FieldValue = import_zod7.z.union([
|
|
456
456
|
FieldValuesWithoutDataField,
|
|
457
457
|
DataFieldValue
|
|
458
458
|
]);
|
|
@@ -472,38 +472,22 @@ var PRIORITY_ORDER = [
|
|
|
472
472
|
"DataFieldValue"
|
|
473
473
|
];
|
|
474
474
|
function schemaPriority(schema) {
|
|
475
|
-
const name = schema.description;
|
|
476
|
-
if (!name) {
|
|
477
|
-
return 9999;
|
|
478
|
-
}
|
|
475
|
+
const name = schema._def?.description;
|
|
479
476
|
const idx = PRIORITY_ORDER.indexOf(name);
|
|
480
477
|
return idx === -1 ? 9999 : idx;
|
|
481
478
|
}
|
|
482
479
|
function safeUnion(schemas) {
|
|
483
|
-
return
|
|
480
|
+
return import_zod7.z.custom((val) => {
|
|
484
481
|
const successful = schemas.filter((s) => s.safeParse(val).success);
|
|
485
482
|
if (successful.length === 1) {
|
|
486
|
-
return;
|
|
483
|
+
return true;
|
|
487
484
|
}
|
|
488
485
|
if (successful.length === 0) {
|
|
489
|
-
|
|
490
|
-
code: "invalid_type",
|
|
491
|
-
expected: "custom",
|
|
492
|
-
message: "Value does not match any schema"
|
|
493
|
-
});
|
|
494
|
-
return;
|
|
486
|
+
return false;
|
|
495
487
|
}
|
|
496
488
|
successful.sort((a, b) => schemaPriority(a) - schemaPriority(b));
|
|
497
489
|
const best = successful[0];
|
|
498
|
-
|
|
499
|
-
ctx.addIssue({
|
|
500
|
-
expected: "custom",
|
|
501
|
-
code: "invalid_type",
|
|
502
|
-
message: "Value did not match the best schema"
|
|
503
|
-
});
|
|
504
|
-
}
|
|
505
|
-
}).meta({
|
|
506
|
-
description: "Value that matches exactly one of the possible schema types (TextValue, DateValue, DateRangeFieldValue). The best matching schema is chosen by priority."
|
|
490
|
+
return best.safeParse(val).success;
|
|
507
491
|
});
|
|
508
492
|
}
|
|
509
493
|
var FieldUpdateValue = safeUnion([
|
|
@@ -524,18 +508,21 @@ var FieldUpdateValue = safeUnion([
|
|
|
524
508
|
QueryParamReaderFieldUpdateValue.describe("QueryParamReaderFieldUpdateValue")
|
|
525
509
|
]);
|
|
526
510
|
|
|
511
|
+
// ../commons/src/events/FieldConfig.ts
|
|
512
|
+
var import_zod_openapi6 = require("zod-openapi");
|
|
513
|
+
|
|
527
514
|
// ../commons/src/uuid.ts
|
|
528
515
|
var import_uuid = require("uuid");
|
|
529
|
-
var
|
|
530
|
-
var UUID =
|
|
516
|
+
var import_zod8 = require("zod");
|
|
517
|
+
var UUID = import_zod8.z.string().uuid().brand("UUID");
|
|
531
518
|
function getUUID() {
|
|
532
519
|
return (0, import_uuid.v4)();
|
|
533
520
|
}
|
|
534
521
|
|
|
535
522
|
// ../commons/src/events/serializers/user/serializer.ts
|
|
536
|
-
var
|
|
537
|
-
var SerializedUserField =
|
|
538
|
-
$userField:
|
|
523
|
+
var import_zod9 = require("zod");
|
|
524
|
+
var SerializedUserField = import_zod9.z.object({
|
|
525
|
+
$userField: import_zod9.z.enum([
|
|
539
526
|
"id",
|
|
540
527
|
"name",
|
|
541
528
|
"role",
|
|
@@ -543,7 +530,7 @@ var SerializedUserField = z9.object({
|
|
|
543
530
|
"avatar",
|
|
544
531
|
"primaryOfficeId"
|
|
545
532
|
]),
|
|
546
|
-
$location:
|
|
533
|
+
$location: import_zod9.z.string().optional()
|
|
547
534
|
});
|
|
548
535
|
function userSerializer(userField) {
|
|
549
536
|
return {
|
|
@@ -563,23 +550,24 @@ function userSerializer(userField) {
|
|
|
563
550
|
}
|
|
564
551
|
|
|
565
552
|
// ../commons/src/events/EventIndex.ts
|
|
566
|
-
var
|
|
553
|
+
var import_zod14 = require("zod");
|
|
567
554
|
|
|
568
555
|
// ../commons/src/events/EventMetadata.ts
|
|
569
|
-
var
|
|
556
|
+
var import_zod13 = require("zod");
|
|
570
557
|
|
|
571
558
|
// ../commons/src/events/ActionDocument.ts
|
|
572
|
-
var
|
|
559
|
+
var import_zod12 = require("zod");
|
|
560
|
+
var import_zod_openapi4 = require("zod-openapi");
|
|
573
561
|
|
|
574
562
|
// ../commons/src/events/CreatedAtLocation.ts
|
|
575
563
|
var CreatedAtLocation = UUID.nullish();
|
|
576
564
|
|
|
577
565
|
// ../commons/src/authentication.ts
|
|
578
566
|
var import_jwt_decode = __toESM(require("jwt-decode"));
|
|
579
|
-
var
|
|
567
|
+
var import_zod11 = require("zod");
|
|
580
568
|
|
|
581
569
|
// ../commons/src/scopes.ts
|
|
582
|
-
var
|
|
570
|
+
var import_zod10 = require("zod");
|
|
583
571
|
var SCOPES = {
|
|
584
572
|
// TODO v1.8 legacy scopes
|
|
585
573
|
BYPASSRATELIMIT: "bypassratelimit",
|
|
@@ -658,91 +646,91 @@ var SCOPES = {
|
|
|
658
646
|
// data seeding
|
|
659
647
|
USER_DATA_SEEDING: "user.data-seeding"
|
|
660
648
|
};
|
|
661
|
-
var LegacyScopes =
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
649
|
+
var LegacyScopes = import_zod10.z.union([
|
|
650
|
+
import_zod10.z.literal(SCOPES.BYPASSRATELIMIT),
|
|
651
|
+
import_zod10.z.literal(SCOPES.REGISTER),
|
|
652
|
+
import_zod10.z.literal(SCOPES.DEMO),
|
|
653
|
+
import_zod10.z.literal(SCOPES.CONFIG)
|
|
666
654
|
]);
|
|
667
|
-
var IntegrationScopes =
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
655
|
+
var IntegrationScopes = import_zod10.z.union([
|
|
656
|
+
import_zod10.z.literal(SCOPES.WEBHOOK),
|
|
657
|
+
import_zod10.z.literal(SCOPES.NATIONALID),
|
|
658
|
+
import_zod10.z.literal(SCOPES.NOTIFICATION_API),
|
|
659
|
+
import_zod10.z.literal(SCOPES.RECORDSEARCH)
|
|
672
660
|
]);
|
|
673
|
-
var InternalOperationsScopes =
|
|
674
|
-
|
|
675
|
-
|
|
661
|
+
var InternalOperationsScopes = import_zod10.z.union([
|
|
662
|
+
import_zod10.z.literal(SCOPES.RECORD_REINDEX),
|
|
663
|
+
import_zod10.z.literal(SCOPES.RECORD_IMPORT)
|
|
676
664
|
]);
|
|
677
|
-
var DeclareScopes =
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
665
|
+
var DeclareScopes = import_zod10.z.union([
|
|
666
|
+
import_zod10.z.literal(SCOPES.RECORD_DECLARE_BIRTH),
|
|
667
|
+
import_zod10.z.literal(SCOPES.RECORD_DECLARE_BIRTH_MY_JURISDICTION),
|
|
668
|
+
import_zod10.z.literal(SCOPES.RECORD_DECLARE_DEATH),
|
|
669
|
+
import_zod10.z.literal(SCOPES.RECORD_DECLARE_DEATH_MY_JURISDICTION),
|
|
670
|
+
import_zod10.z.literal(SCOPES.RECORD_DECLARE_MARRIAGE),
|
|
671
|
+
import_zod10.z.literal(SCOPES.RECORD_DECLARE_MARRIAGE_MY_JURISDICTION),
|
|
672
|
+
import_zod10.z.literal(SCOPES.RECORD_SUBMIT_INCOMPLETE),
|
|
673
|
+
import_zod10.z.literal(SCOPES.RECORD_SUBMIT_FOR_REVIEW)
|
|
686
674
|
]);
|
|
687
|
-
var UnassignScope =
|
|
688
|
-
var ValidateScopes =
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
675
|
+
var UnassignScope = import_zod10.z.literal(SCOPES.RECORD_UNASSIGN_OTHERS);
|
|
676
|
+
var ValidateScopes = import_zod10.z.union([
|
|
677
|
+
import_zod10.z.literal(SCOPES.RECORD_SUBMIT_FOR_APPROVAL),
|
|
678
|
+
import_zod10.z.literal(SCOPES.RECORD_SUBMIT_FOR_UPDATES),
|
|
679
|
+
import_zod10.z.literal(SCOPES.RECORD_DECLARATION_EDIT),
|
|
680
|
+
import_zod10.z.literal(SCOPES.RECORD_REVIEW_DUPLICATES),
|
|
681
|
+
import_zod10.z.literal(SCOPES.RECORD_DECLARATION_ARCHIVE),
|
|
682
|
+
import_zod10.z.literal(SCOPES.RECORD_DECLARATION_REINSTATE)
|
|
695
683
|
]);
|
|
696
|
-
var RegisterScope =
|
|
697
|
-
var CorrectionScopes =
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
684
|
+
var RegisterScope = import_zod10.z.literal(SCOPES.RECORD_REGISTER);
|
|
685
|
+
var CorrectionScopes = import_zod10.z.union([
|
|
686
|
+
import_zod10.z.literal(SCOPES.RECORD_REGISTRATION_REQUEST_CORRECTION),
|
|
687
|
+
import_zod10.z.literal(SCOPES.RECORD_REGISTRATION_CORRECT),
|
|
688
|
+
import_zod10.z.literal(SCOPES.RECORD_CONFIRM_REGISTRATION),
|
|
689
|
+
import_zod10.z.literal(SCOPES.RECORD_REJECT_REGISTRATION)
|
|
702
690
|
]);
|
|
703
|
-
var SearchScopes =
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
691
|
+
var SearchScopes = import_zod10.z.union([
|
|
692
|
+
import_zod10.z.literal(SCOPES.SEARCH_BIRTH_MY_JURISDICTION),
|
|
693
|
+
import_zod10.z.literal(SCOPES.SEARCH_BIRTH),
|
|
694
|
+
import_zod10.z.literal(SCOPES.SEARCH_DEATH_MY_JURISDICTION),
|
|
695
|
+
import_zod10.z.literal(SCOPES.SEARCH_DEATH),
|
|
696
|
+
import_zod10.z.literal(SCOPES.SEARCH_MARRIAGE_MY_JURISDICTION),
|
|
697
|
+
import_zod10.z.literal(SCOPES.SEARCH_MARRIAGE)
|
|
710
698
|
]);
|
|
711
|
-
var AuditScopes =
|
|
712
|
-
var PerformanceScopes =
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
699
|
+
var AuditScopes = import_zod10.z.literal(SCOPES.RECORD_READ);
|
|
700
|
+
var PerformanceScopes = import_zod10.z.union([
|
|
701
|
+
import_zod10.z.literal(SCOPES.PERFORMANCE_READ),
|
|
702
|
+
import_zod10.z.literal(SCOPES.PERFORMANCE_READ_DASHBOARDS),
|
|
703
|
+
import_zod10.z.literal(SCOPES.PERFORMANCE_EXPORT_VITAL_STATISTICS)
|
|
716
704
|
]);
|
|
717
|
-
var OrganisationScopes =
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
705
|
+
var OrganisationScopes = import_zod10.z.union([
|
|
706
|
+
import_zod10.z.literal(SCOPES.ORGANISATION_READ_LOCATIONS),
|
|
707
|
+
import_zod10.z.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_OFFICE),
|
|
708
|
+
import_zod10.z.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_JURISDICTION)
|
|
721
709
|
]);
|
|
722
|
-
var UserScopes =
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
710
|
+
var UserScopes = import_zod10.z.union([
|
|
711
|
+
import_zod10.z.literal(SCOPES.USER_READ),
|
|
712
|
+
import_zod10.z.literal(SCOPES.USER_READ_MY_OFFICE),
|
|
713
|
+
import_zod10.z.literal(SCOPES.USER_READ_MY_JURISDICTION),
|
|
714
|
+
import_zod10.z.literal(SCOPES.USER_READ_ONLY_MY_AUDIT),
|
|
715
|
+
import_zod10.z.literal(SCOPES.USER_CREATE),
|
|
716
|
+
import_zod10.z.literal(SCOPES.USER_CREATE_MY_JURISDICTION),
|
|
717
|
+
import_zod10.z.literal(SCOPES.USER_UPDATE),
|
|
718
|
+
import_zod10.z.literal(SCOPES.USER_UPDATE_MY_JURISDICTION)
|
|
731
719
|
]);
|
|
732
|
-
var ConfigScope =
|
|
733
|
-
var DataSeedingScope =
|
|
734
|
-
var LiteralScopes =
|
|
720
|
+
var ConfigScope = import_zod10.z.literal(SCOPES.CONFIG_UPDATE_ALL);
|
|
721
|
+
var DataSeedingScope = import_zod10.z.literal(SCOPES.USER_DATA_SEEDING);
|
|
722
|
+
var LiteralScopes = import_zod10.z.union([
|
|
735
723
|
LegacyScopes,
|
|
736
724
|
IntegrationScopes,
|
|
737
725
|
UnassignScope,
|
|
738
726
|
DeclareScopes,
|
|
739
727
|
ValidateScopes,
|
|
740
728
|
RegisterScope,
|
|
741
|
-
|
|
729
|
+
import_zod10.z.literal(SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES),
|
|
742
730
|
CorrectionScopes,
|
|
743
731
|
SearchScopes,
|
|
744
732
|
AuditScopes,
|
|
745
|
-
|
|
733
|
+
import_zod10.z.literal(SCOPES.PROFILE_ELECTRONIC_SIGNATURE),
|
|
746
734
|
PerformanceScopes,
|
|
747
735
|
OrganisationScopes,
|
|
748
736
|
UserScopes,
|
|
@@ -751,33 +739,33 @@ var LiteralScopes = z10.union([
|
|
|
751
739
|
InternalOperationsScopes
|
|
752
740
|
]);
|
|
753
741
|
var rawConfigurableScopeRegex = /^([a-zA-Z][a-zA-Z0-9.-]*(?:\.[a-zA-Z0-9.-]+)*)\[((?:\w+=[\w.-]+(?:\|[\w.-]+)*)(?:,[\w]+=[\w.-]+(?:\|[\w.-]+)*)*)\]$/;
|
|
754
|
-
var rawConfigurableScope =
|
|
755
|
-
var CreateUserScope =
|
|
756
|
-
type:
|
|
757
|
-
options:
|
|
758
|
-
role:
|
|
742
|
+
var rawConfigurableScope = import_zod10.z.string().regex(rawConfigurableScopeRegex);
|
|
743
|
+
var CreateUserScope = import_zod10.z.object({
|
|
744
|
+
type: import_zod10.z.literal("user.create"),
|
|
745
|
+
options: import_zod10.z.object({
|
|
746
|
+
role: import_zod10.z.array(import_zod10.z.string())
|
|
759
747
|
})
|
|
760
748
|
});
|
|
761
|
-
var EditUserScope =
|
|
762
|
-
type:
|
|
763
|
-
options:
|
|
764
|
-
role:
|
|
749
|
+
var EditUserScope = import_zod10.z.object({
|
|
750
|
+
type: import_zod10.z.literal("user.edit"),
|
|
751
|
+
options: import_zod10.z.object({
|
|
752
|
+
role: import_zod10.z.array(import_zod10.z.string())
|
|
765
753
|
})
|
|
766
754
|
});
|
|
767
|
-
var WorkqueueScope =
|
|
768
|
-
type:
|
|
769
|
-
options:
|
|
770
|
-
id:
|
|
755
|
+
var WorkqueueScope = import_zod10.z.object({
|
|
756
|
+
type: import_zod10.z.literal("workqueue"),
|
|
757
|
+
options: import_zod10.z.object({
|
|
758
|
+
id: import_zod10.z.array(import_zod10.z.string())
|
|
771
759
|
})
|
|
772
760
|
});
|
|
773
|
-
var SearchScope =
|
|
774
|
-
type:
|
|
775
|
-
options:
|
|
776
|
-
event:
|
|
777
|
-
access:
|
|
761
|
+
var SearchScope = import_zod10.z.object({
|
|
762
|
+
type: import_zod10.z.literal("search"),
|
|
763
|
+
options: import_zod10.z.object({
|
|
764
|
+
event: import_zod10.z.array(import_zod10.z.string()).length(1),
|
|
765
|
+
access: import_zod10.z.array(import_zod10.z.enum(["my-jurisdiction", "all"])).length(1)
|
|
778
766
|
})
|
|
779
767
|
});
|
|
780
|
-
var RecordScopeType =
|
|
768
|
+
var RecordScopeType = import_zod10.z.enum([
|
|
781
769
|
"record.create",
|
|
782
770
|
"record.read",
|
|
783
771
|
"record.declare",
|
|
@@ -792,35 +780,27 @@ var RecordScopeType = z10.enum([
|
|
|
792
780
|
"record.registered.correct",
|
|
793
781
|
"record.unassign-others"
|
|
794
782
|
]);
|
|
795
|
-
var RecordScope =
|
|
783
|
+
var RecordScope = import_zod10.z.object({
|
|
796
784
|
type: RecordScopeType,
|
|
797
|
-
options:
|
|
798
|
-
event:
|
|
785
|
+
options: import_zod10.z.object({
|
|
786
|
+
event: import_zod10.z.array(import_zod10.z.string()).describe("Event type, e.g. birth, death")
|
|
799
787
|
})
|
|
800
788
|
}).describe(
|
|
801
789
|
"Scopes used to check user's permission to perform actions on a record."
|
|
802
790
|
);
|
|
803
|
-
var
|
|
804
|
-
type: z10.literal("record.custom-action"),
|
|
805
|
-
options: z10.object({
|
|
806
|
-
event: z10.array(z10.string()).describe("Allowed event type, e.g. birth, death"),
|
|
807
|
-
customActionType: z10.array(z10.string()).describe("Allowed custom action types")
|
|
808
|
-
})
|
|
809
|
-
});
|
|
810
|
-
var ConfigurableRawScopes = z10.discriminatedUnion("type", [
|
|
791
|
+
var ConfigurableRawScopes = import_zod10.z.discriminatedUnion("type", [
|
|
811
792
|
SearchScope,
|
|
812
793
|
CreateUserScope,
|
|
813
794
|
EditUserScope,
|
|
814
795
|
WorkqueueScope,
|
|
815
|
-
RecordScope
|
|
816
|
-
CustomActionScope
|
|
796
|
+
RecordScope
|
|
817
797
|
]);
|
|
818
798
|
var scopes = Object.values(SCOPES);
|
|
819
|
-
var ActionScopes =
|
|
799
|
+
var ActionScopes = import_zod10.z.union([
|
|
820
800
|
DeclareScopes,
|
|
821
801
|
ValidateScopes,
|
|
822
802
|
RegisterScope,
|
|
823
|
-
|
|
803
|
+
import_zod10.z.literal(SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES),
|
|
824
804
|
CorrectionScopes
|
|
825
805
|
]);
|
|
826
806
|
|
|
@@ -954,14 +934,15 @@ var DEFAULT_ROLES_DEFINITION = [
|
|
|
954
934
|
]
|
|
955
935
|
}
|
|
956
936
|
];
|
|
957
|
-
var TokenUserType =
|
|
958
|
-
var TokenWithBearer =
|
|
937
|
+
var TokenUserType = import_zod11.z.enum(["user", "system"]);
|
|
938
|
+
var TokenWithBearer = import_zod11.z.string().regex(/^Bearer\s/);
|
|
959
939
|
|
|
960
940
|
// ../commons/src/events/ActionDocument.ts
|
|
961
|
-
|
|
941
|
+
(0, import_zod_openapi4.extendZodWithOpenApi)(import_zod12.z);
|
|
942
|
+
var ActionUpdate = import_zod12.z.record(import_zod12.z.string(), FieldUpdateValue).describe(
|
|
962
943
|
"Record of field-level changes made by an action. Supports partial updates and nullable values."
|
|
963
944
|
);
|
|
964
|
-
var EventState =
|
|
945
|
+
var EventState = import_zod12.z.record(import_zod12.z.string(), FieldValue).describe(
|
|
965
946
|
"Aggregate representation of event data after all actions have been applied, with all updates consolidated and null values removed."
|
|
966
947
|
);
|
|
967
948
|
var ActionStatus = {
|
|
@@ -969,16 +950,16 @@ var ActionStatus = {
|
|
|
969
950
|
Accepted: "Accepted",
|
|
970
951
|
Rejected: "Rejected"
|
|
971
952
|
};
|
|
972
|
-
var ActionBase =
|
|
953
|
+
var ActionBase = import_zod12.z.object({
|
|
973
954
|
id: UUID.describe("Unique identifier of the action."),
|
|
974
|
-
transactionId:
|
|
955
|
+
transactionId: import_zod12.z.string().describe("Unique identifier of the transaction."),
|
|
975
956
|
createdByUserType: TokenUserType.describe(
|
|
976
957
|
"Indicates whether the action was created by a human-user or by a system-user."
|
|
977
958
|
),
|
|
978
|
-
createdAt:
|
|
979
|
-
createdBy:
|
|
980
|
-
createdByRole:
|
|
981
|
-
createdBySignature:
|
|
959
|
+
createdAt: import_zod12.z.string().datetime().describe("Timestamp indicating when the action was created."),
|
|
960
|
+
createdBy: import_zod12.z.string().describe("Identifier of the user who created the action."),
|
|
961
|
+
createdByRole: import_zod12.z.string().describe("Role of the user who created the action."),
|
|
962
|
+
createdBySignature: import_zod12.z.string().nullish().describe("Reference to the signature of the user who created the action."),
|
|
982
963
|
createdAtLocation: CreatedAtLocation.describe(
|
|
983
964
|
"Reference to the location of the user who created the action."
|
|
984
965
|
),
|
|
@@ -986,7 +967,7 @@ var ActionBase = z12.object({
|
|
|
986
967
|
"Declaration data defined by the ActionConfig. Supports partial updates."
|
|
987
968
|
),
|
|
988
969
|
annotation: ActionUpdate.optional().nullable().describe("Action-specific metadata used to annotate the event."),
|
|
989
|
-
status:
|
|
970
|
+
status: import_zod12.z.enum([
|
|
990
971
|
ActionStatus.Requested,
|
|
991
972
|
ActionStatus.Accepted,
|
|
992
973
|
ActionStatus.Rejected
|
|
@@ -997,164 +978,164 @@ var ActionBase = z12.object({
|
|
|
997
978
|
"Reference to the original action asynchronously accepted or rejected by a third-party integration."
|
|
998
979
|
)
|
|
999
980
|
});
|
|
1000
|
-
var AssignedAction = ActionBase.
|
|
1001
|
-
|
|
1002
|
-
type:
|
|
1003
|
-
assignedTo:
|
|
981
|
+
var AssignedAction = ActionBase.merge(
|
|
982
|
+
import_zod12.z.object({
|
|
983
|
+
type: import_zod12.z.literal(ActionType.ASSIGN),
|
|
984
|
+
assignedTo: import_zod12.z.string().describe("Identifier of the user to whom the action is assigned.")
|
|
1004
985
|
// TODO move into 'content' property
|
|
1005
|
-
})
|
|
986
|
+
})
|
|
1006
987
|
);
|
|
1007
|
-
var UnassignedAction = ActionBase.
|
|
1008
|
-
|
|
1009
|
-
type:
|
|
1010
|
-
})
|
|
988
|
+
var UnassignedAction = ActionBase.merge(
|
|
989
|
+
import_zod12.z.object({
|
|
990
|
+
type: import_zod12.z.literal(ActionType.UNASSIGN)
|
|
991
|
+
})
|
|
1011
992
|
);
|
|
1012
|
-
var RegisterAction = ActionBase.
|
|
1013
|
-
|
|
1014
|
-
type:
|
|
1015
|
-
registrationNumber:
|
|
993
|
+
var RegisterAction = ActionBase.merge(
|
|
994
|
+
import_zod12.z.object({
|
|
995
|
+
type: import_zod12.z.literal(ActionType.REGISTER),
|
|
996
|
+
registrationNumber: import_zod12.z.string().optional().describe(
|
|
1016
997
|
"Registration number of the event. Always present for accepted registrations."
|
|
1017
998
|
)
|
|
1018
999
|
// TODO move into 'content' property
|
|
1019
|
-
})
|
|
1000
|
+
})
|
|
1020
1001
|
);
|
|
1021
|
-
var DeclareAction = ActionBase.
|
|
1022
|
-
|
|
1023
|
-
type:
|
|
1024
|
-
})
|
|
1002
|
+
var DeclareAction = ActionBase.merge(
|
|
1003
|
+
import_zod12.z.object({
|
|
1004
|
+
type: import_zod12.z.literal(ActionType.DECLARE)
|
|
1005
|
+
})
|
|
1025
1006
|
);
|
|
1026
|
-
var ValidateAction = ActionBase.
|
|
1027
|
-
|
|
1028
|
-
type:
|
|
1029
|
-
})
|
|
1007
|
+
var ValidateAction = ActionBase.merge(
|
|
1008
|
+
import_zod12.z.object({
|
|
1009
|
+
type: import_zod12.z.literal(ActionType.VALIDATE)
|
|
1010
|
+
})
|
|
1030
1011
|
);
|
|
1031
|
-
var ReasonContent =
|
|
1032
|
-
reason:
|
|
1012
|
+
var ReasonContent = import_zod12.z.object({
|
|
1013
|
+
reason: import_zod12.z.string().min(1, { message: "Message cannot be empty" }).describe(
|
|
1033
1014
|
"Message describing the reason for rejecting or archiving the event."
|
|
1034
1015
|
)
|
|
1035
1016
|
});
|
|
1036
|
-
var RejectAction = ActionBase.
|
|
1037
|
-
|
|
1038
|
-
type:
|
|
1017
|
+
var RejectAction = ActionBase.merge(
|
|
1018
|
+
import_zod12.z.object({
|
|
1019
|
+
type: import_zod12.z.literal(ActionType.REJECT),
|
|
1039
1020
|
content: ReasonContent
|
|
1040
|
-
})
|
|
1021
|
+
})
|
|
1041
1022
|
);
|
|
1042
|
-
var PotentialDuplicate =
|
|
1023
|
+
var PotentialDuplicate = import_zod12.z.object({
|
|
1043
1024
|
id: UUID,
|
|
1044
|
-
trackingId:
|
|
1025
|
+
trackingId: import_zod12.z.string()
|
|
1045
1026
|
});
|
|
1046
|
-
var DuplicateDetectedAction = ActionBase.
|
|
1047
|
-
|
|
1048
|
-
type:
|
|
1049
|
-
content:
|
|
1050
|
-
duplicates:
|
|
1027
|
+
var DuplicateDetectedAction = ActionBase.merge(
|
|
1028
|
+
import_zod12.z.object({
|
|
1029
|
+
type: import_zod12.z.literal(ActionType.DUPLICATE_DETECTED),
|
|
1030
|
+
content: import_zod12.z.object({
|
|
1031
|
+
duplicates: import_zod12.z.array(PotentialDuplicate)
|
|
1051
1032
|
})
|
|
1052
|
-
})
|
|
1033
|
+
})
|
|
1053
1034
|
);
|
|
1054
|
-
var MarkNotDuplicateAction = ActionBase.
|
|
1055
|
-
|
|
1056
|
-
type:
|
|
1057
|
-
})
|
|
1035
|
+
var MarkNotDuplicateAction = ActionBase.merge(
|
|
1036
|
+
import_zod12.z.object({
|
|
1037
|
+
type: import_zod12.z.literal(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
1038
|
+
})
|
|
1058
1039
|
);
|
|
1059
|
-
var MarkAsDuplicateAction = ActionBase.
|
|
1060
|
-
|
|
1061
|
-
type:
|
|
1062
|
-
content:
|
|
1040
|
+
var MarkAsDuplicateAction = ActionBase.merge(
|
|
1041
|
+
import_zod12.z.object({
|
|
1042
|
+
type: import_zod12.z.literal(ActionType.MARK_AS_DUPLICATE),
|
|
1043
|
+
content: import_zod12.z.object({
|
|
1063
1044
|
duplicateOf: UUID
|
|
1064
1045
|
}).optional()
|
|
1065
|
-
})
|
|
1046
|
+
})
|
|
1066
1047
|
);
|
|
1067
|
-
var ArchiveAction = ActionBase.
|
|
1068
|
-
|
|
1069
|
-
type:
|
|
1048
|
+
var ArchiveAction = ActionBase.merge(
|
|
1049
|
+
import_zod12.z.object({
|
|
1050
|
+
type: import_zod12.z.literal(ActionType.ARCHIVE),
|
|
1070
1051
|
content: ReasonContent
|
|
1071
|
-
})
|
|
1052
|
+
})
|
|
1072
1053
|
);
|
|
1073
|
-
var CreatedAction = ActionBase.
|
|
1074
|
-
|
|
1075
|
-
type:
|
|
1076
|
-
})
|
|
1054
|
+
var CreatedAction = ActionBase.merge(
|
|
1055
|
+
import_zod12.z.object({
|
|
1056
|
+
type: import_zod12.z.literal(ActionType.CREATE)
|
|
1057
|
+
})
|
|
1077
1058
|
);
|
|
1078
|
-
var NotifiedAction = ActionBase.
|
|
1079
|
-
|
|
1080
|
-
type:
|
|
1081
|
-
})
|
|
1059
|
+
var NotifiedAction = ActionBase.merge(
|
|
1060
|
+
import_zod12.z.object({
|
|
1061
|
+
type: import_zod12.z.literal(ActionType.NOTIFY)
|
|
1062
|
+
})
|
|
1082
1063
|
);
|
|
1083
|
-
var PrintContent =
|
|
1084
|
-
templateId:
|
|
1064
|
+
var PrintContent = import_zod12.z.object({
|
|
1065
|
+
templateId: import_zod12.z.string().optional()
|
|
1085
1066
|
});
|
|
1086
|
-
var PrintCertificateAction = ActionBase.
|
|
1087
|
-
|
|
1088
|
-
type:
|
|
1067
|
+
var PrintCertificateAction = ActionBase.merge(
|
|
1068
|
+
import_zod12.z.object({
|
|
1069
|
+
type: import_zod12.z.literal(ActionType.PRINT_CERTIFICATE),
|
|
1089
1070
|
content: PrintContent.optional().nullable()
|
|
1090
|
-
})
|
|
1071
|
+
})
|
|
1091
1072
|
);
|
|
1092
|
-
var RequestedCorrectionAction = ActionBase.
|
|
1093
|
-
|
|
1094
|
-
type:
|
|
1095
|
-
})
|
|
1073
|
+
var RequestedCorrectionAction = ActionBase.merge(
|
|
1074
|
+
import_zod12.z.object({
|
|
1075
|
+
type: import_zod12.z.literal(ActionType.REQUEST_CORRECTION)
|
|
1076
|
+
})
|
|
1096
1077
|
);
|
|
1097
|
-
var ApprovedCorrectionAction = ActionBase.
|
|
1098
|
-
|
|
1099
|
-
type:
|
|
1100
|
-
requestId:
|
|
1078
|
+
var ApprovedCorrectionAction = ActionBase.merge(
|
|
1079
|
+
import_zod12.z.object({
|
|
1080
|
+
type: import_zod12.z.literal(ActionType.APPROVE_CORRECTION),
|
|
1081
|
+
requestId: import_zod12.z.string()
|
|
1101
1082
|
// TODO move into 'content' property
|
|
1102
|
-
})
|
|
1083
|
+
})
|
|
1103
1084
|
);
|
|
1104
|
-
var RejectedCorrectionAction = ActionBase.
|
|
1105
|
-
|
|
1106
|
-
type:
|
|
1107
|
-
requestId:
|
|
1085
|
+
var RejectedCorrectionAction = ActionBase.merge(
|
|
1086
|
+
import_zod12.z.object({
|
|
1087
|
+
type: import_zod12.z.literal(ActionType.REJECT_CORRECTION),
|
|
1088
|
+
requestId: import_zod12.z.string(),
|
|
1108
1089
|
// TODO move into 'content' property
|
|
1109
1090
|
content: ReasonContent
|
|
1110
|
-
})
|
|
1111
|
-
);
|
|
1112
|
-
var ReadAction = ActionBase.extend(
|
|
1113
|
-
z12.object({
|
|
1114
|
-
type: z12.literal(ActionType.READ)
|
|
1115
|
-
}).shape
|
|
1091
|
+
})
|
|
1116
1092
|
);
|
|
1117
|
-
var
|
|
1118
|
-
|
|
1119
|
-
type:
|
|
1120
|
-
customActionType: z12.string()
|
|
1093
|
+
var ReadAction = ActionBase.merge(
|
|
1094
|
+
import_zod12.z.object({
|
|
1095
|
+
type: import_zod12.z.literal(ActionType.READ)
|
|
1121
1096
|
})
|
|
1122
1097
|
);
|
|
1123
|
-
var ActionDocument =
|
|
1124
|
-
CreatedAction.
|
|
1125
|
-
ValidateAction.
|
|
1126
|
-
RejectAction.
|
|
1127
|
-
DuplicateDetectedAction.
|
|
1128
|
-
MarkNotDuplicateAction.
|
|
1129
|
-
MarkAsDuplicateAction.
|
|
1130
|
-
ArchiveAction.
|
|
1131
|
-
NotifiedAction.
|
|
1132
|
-
RegisterAction.
|
|
1133
|
-
DeclareAction.
|
|
1134
|
-
AssignedAction.
|
|
1135
|
-
RequestedCorrectionAction.
|
|
1136
|
-
ApprovedCorrectionAction.
|
|
1137
|
-
RejectedCorrectionAction.
|
|
1138
|
-
UnassignedAction.
|
|
1139
|
-
PrintCertificateAction.
|
|
1140
|
-
ReadAction.
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
id: "ActionDocument"
|
|
1098
|
+
var ActionDocument = import_zod12.z.discriminatedUnion("type", [
|
|
1099
|
+
CreatedAction.openapi({ ref: "CreatedAction" }),
|
|
1100
|
+
ValidateAction.openapi({ ref: "ValidateAction" }),
|
|
1101
|
+
RejectAction.openapi({ ref: "RejectAction" }),
|
|
1102
|
+
DuplicateDetectedAction.openapi({ ref: "DuplicateDetectedAction" }),
|
|
1103
|
+
MarkNotDuplicateAction.openapi({ ref: "MarkNotDuplicateAction" }),
|
|
1104
|
+
MarkAsDuplicateAction.openapi({ ref: "MarkAsDuplicateAction" }),
|
|
1105
|
+
ArchiveAction.openapi({ ref: "ArchiveAction" }),
|
|
1106
|
+
NotifiedAction.openapi({ ref: "NotifiedAction" }),
|
|
1107
|
+
RegisterAction.openapi({ ref: "RegisterAction" }),
|
|
1108
|
+
DeclareAction.openapi({ ref: "DeclareAction" }),
|
|
1109
|
+
AssignedAction.openapi({ ref: "AssignedAction" }),
|
|
1110
|
+
RequestedCorrectionAction.openapi({ ref: "RequestedCorrectionAction" }),
|
|
1111
|
+
ApprovedCorrectionAction.openapi({ ref: "ApprovedCorrectionAction" }),
|
|
1112
|
+
RejectedCorrectionAction.openapi({ ref: "RejectedCorrectionAction" }),
|
|
1113
|
+
UnassignedAction.openapi({ ref: "UnassignedAction" }),
|
|
1114
|
+
PrintCertificateAction.openapi({ ref: "PrintCertificateAction" }),
|
|
1115
|
+
ReadAction.openapi({ ref: "ReadAction" })
|
|
1116
|
+
]).openapi({
|
|
1117
|
+
ref: "ActionDocument"
|
|
1144
1118
|
});
|
|
1145
1119
|
var AsyncRejectActionDocument = ActionBase.omit({
|
|
1146
1120
|
declaration: true,
|
|
1147
1121
|
annotation: true
|
|
1148
|
-
}).
|
|
1149
|
-
|
|
1150
|
-
type:
|
|
1151
|
-
status:
|
|
1152
|
-
})
|
|
1122
|
+
}).merge(
|
|
1123
|
+
import_zod12.z.object({
|
|
1124
|
+
type: import_zod12.z.enum(ConfirmableActions),
|
|
1125
|
+
status: import_zod12.z.literal(ActionStatus.Rejected)
|
|
1126
|
+
})
|
|
1153
1127
|
);
|
|
1154
|
-
var Action =
|
|
1128
|
+
var Action = import_zod12.z.union([ActionDocument, AsyncRejectActionDocument]);
|
|
1155
1129
|
|
|
1156
|
-
// ../commons/src/events/
|
|
1157
|
-
var
|
|
1130
|
+
// ../commons/src/events/EventMetadata.ts
|
|
1131
|
+
var EventStatus = import_zod13.z.enum([
|
|
1132
|
+
"CREATED",
|
|
1133
|
+
"NOTIFIED",
|
|
1134
|
+
"DECLARED",
|
|
1135
|
+
"VALIDATED",
|
|
1136
|
+
"REGISTERED",
|
|
1137
|
+
"ARCHIVED"
|
|
1138
|
+
]);
|
|
1158
1139
|
var InherentFlags = {
|
|
1159
1140
|
PENDING_CERTIFICATION: "pending-certification",
|
|
1160
1141
|
INCOMPLETE: "incomplete",
|
|
@@ -1162,7 +1143,7 @@ var InherentFlags = {
|
|
|
1162
1143
|
CORRECTION_REQUESTED: "correction-requested",
|
|
1163
1144
|
POTENTIAL_DUPLICATE: "potential-duplicate"
|
|
1164
1145
|
};
|
|
1165
|
-
var ActionFlag =
|
|
1146
|
+
var ActionFlag = import_zod13.z.string().regex(
|
|
1166
1147
|
new RegExp(
|
|
1167
1148
|
`^(${Object.values(ActionType).join("|").toLowerCase()}):(${Object.values(
|
|
1168
1149
|
ActionStatus
|
|
@@ -1170,89 +1151,59 @@ var ActionFlag = z13.string().regex(
|
|
|
1170
1151
|
),
|
|
1171
1152
|
"Flag must be in the format ActionType:ActionStatus (lowerCase)"
|
|
1172
1153
|
);
|
|
1173
|
-
var
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
).
|
|
1177
|
-
|
|
1178
|
-
message: "Custom flag cannot match the ActionFlag pattern (ActionType:ActionStatus)."
|
|
1179
|
-
}).describe("Custom flag identifier defined by the country config.");
|
|
1180
|
-
var Flag = ActionFlag.or(z13.enum(InherentFlags)).or(CustomFlag);
|
|
1181
|
-
var FlagConfig = z13.object({
|
|
1182
|
-
id: CustomFlag,
|
|
1183
|
-
requiresAction: z13.boolean().describe(
|
|
1184
|
-
"Indicates if this flag expects an action to be performed to be cleared."
|
|
1185
|
-
),
|
|
1186
|
-
label: TranslationConfig.describe("Human readable label of the flag.")
|
|
1187
|
-
});
|
|
1188
|
-
var ActionFlagConfig = z13.object({
|
|
1189
|
-
id: CustomFlag,
|
|
1190
|
-
operation: z13.enum(["add", "remove"]).describe("Operation to perform on the flag."),
|
|
1191
|
-
conditional: Conditional.optional().describe(
|
|
1192
|
-
"When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
|
|
1193
|
-
)
|
|
1194
|
-
});
|
|
1195
|
-
|
|
1196
|
-
// ../commons/src/events/EventMetadata.ts
|
|
1197
|
-
var EventStatus = z14.enum([
|
|
1198
|
-
"CREATED",
|
|
1199
|
-
"NOTIFIED",
|
|
1200
|
-
"DECLARED",
|
|
1201
|
-
"REGISTERED",
|
|
1202
|
-
"ARCHIVED"
|
|
1203
|
-
]);
|
|
1204
|
-
var ZodDate = z14.iso.date();
|
|
1205
|
-
var ActionCreationMetadata = z14.object({
|
|
1206
|
-
createdAt: z14.iso.datetime().describe("The timestamp when the action request was created."),
|
|
1207
|
-
createdBy: z14.string().describe("ID of the user who created the action request."),
|
|
1154
|
+
var Flag = ActionFlag.or(import_zod13.z.nativeEnum(InherentFlags));
|
|
1155
|
+
var ZodDate = import_zod13.z.string().date();
|
|
1156
|
+
var ActionCreationMetadata = import_zod13.z.object({
|
|
1157
|
+
createdAt: import_zod13.z.string().datetime().describe("The timestamp when the action request was created."),
|
|
1158
|
+
createdBy: import_zod13.z.string().describe("ID of the user who created the action request."),
|
|
1208
1159
|
createdAtLocation: CreatedAtLocation.describe(
|
|
1209
1160
|
"Location of the user who created the action request."
|
|
1210
1161
|
),
|
|
1211
|
-
createdByUserType:
|
|
1212
|
-
acceptedAt:
|
|
1213
|
-
createdByRole:
|
|
1214
|
-
createdBySignature:
|
|
1162
|
+
createdByUserType: import_zod13.z.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1163
|
+
acceptedAt: import_zod13.z.string().datetime().describe("Timestamp when the action request was accepted."),
|
|
1164
|
+
createdByRole: import_zod13.z.string().describe("Role of the user at the time of action request creation."),
|
|
1165
|
+
createdBySignature: import_zod13.z.string().nullish().describe("Signature of the user who created the action request.")
|
|
1215
1166
|
});
|
|
1216
1167
|
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
1217
|
-
registrationNumber:
|
|
1168
|
+
registrationNumber: import_zod13.z.string().describe(
|
|
1218
1169
|
"Registration number of the event. Always present for accepted registrations."
|
|
1219
1170
|
)
|
|
1220
1171
|
});
|
|
1221
|
-
var LegalStatuses =
|
|
1172
|
+
var LegalStatuses = import_zod13.z.object({
|
|
1222
1173
|
[EventStatus.enum.DECLARED]: ActionCreationMetadata.nullish(),
|
|
1223
1174
|
[EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish()
|
|
1224
1175
|
});
|
|
1225
|
-
var EventMetadata =
|
|
1176
|
+
var EventMetadata = import_zod13.z.object({
|
|
1226
1177
|
id: UUID,
|
|
1227
|
-
type:
|
|
1178
|
+
type: import_zod13.z.string().describe("The type of event, such as birth, death, or marriage."),
|
|
1228
1179
|
status: EventStatus,
|
|
1229
1180
|
legalStatuses: LegalStatuses.describe(
|
|
1230
1181
|
"Metadata related to the legal registration of the event, such as who registered it and when."
|
|
1231
1182
|
),
|
|
1232
|
-
createdAt:
|
|
1183
|
+
createdAt: import_zod13.z.string().datetime().describe("The timestamp when the event was first created and saved."),
|
|
1233
1184
|
dateOfEvent: ZodDate.nullish(),
|
|
1234
|
-
createdBy:
|
|
1235
|
-
createdByUserType:
|
|
1236
|
-
updatedByUserRole:
|
|
1185
|
+
createdBy: import_zod13.z.string().describe("ID of the user who created the event."),
|
|
1186
|
+
createdByUserType: import_zod13.z.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1187
|
+
updatedByUserRole: import_zod13.z.string().describe("Role of the user who last changed the status."),
|
|
1237
1188
|
createdAtLocation: CreatedAtLocation.describe(
|
|
1238
1189
|
"Location of the user who created the event."
|
|
1239
1190
|
),
|
|
1240
|
-
createdBySignature:
|
|
1191
|
+
createdBySignature: import_zod13.z.string().nullish().describe("Signature of the user who created the event."),
|
|
1241
1192
|
updatedAtLocation: UUID.nullish().describe(
|
|
1242
1193
|
"Location of the user who last changed the status."
|
|
1243
1194
|
),
|
|
1244
|
-
updatedAt:
|
|
1195
|
+
updatedAt: import_zod13.z.string().datetime().describe(
|
|
1245
1196
|
"Timestamp of the most recent *accepted* status change. Possibly 3rd party update, if action is validation asynchronously."
|
|
1246
1197
|
),
|
|
1247
|
-
assignedTo:
|
|
1248
|
-
updatedBy:
|
|
1249
|
-
trackingId:
|
|
1198
|
+
assignedTo: import_zod13.z.string().nullish().describe("ID of the user currently assigned to the event."),
|
|
1199
|
+
updatedBy: import_zod13.z.string().nullish().describe("ID of the user who last changed the status."),
|
|
1200
|
+
trackingId: import_zod13.z.string().describe(
|
|
1250
1201
|
"System-generated tracking ID used by informants or registrars to look up the event."
|
|
1251
1202
|
),
|
|
1252
|
-
potentialDuplicates:
|
|
1203
|
+
potentialDuplicates: import_zod13.z.array(PotentialDuplicate).describe(
|
|
1253
1204
|
"List of event IDs and their tracking IDs that this event could be a duplicate of."
|
|
1254
1205
|
),
|
|
1255
|
-
flags:
|
|
1206
|
+
flags: import_zod13.z.array(Flag)
|
|
1256
1207
|
});
|
|
1257
1208
|
var EventMetadataKeysArray = [
|
|
1258
1209
|
"id",
|
|
@@ -1272,128 +1223,130 @@ var EventMetadataKeysArray = [
|
|
|
1272
1223
|
"legalStatuses",
|
|
1273
1224
|
"flags"
|
|
1274
1225
|
];
|
|
1275
|
-
var EventMetadataKeys =
|
|
1226
|
+
var EventMetadataKeys = import_zod13.z.enum(EventMetadataKeysArray);
|
|
1276
1227
|
|
|
1277
1228
|
// ../commons/src/events/EventIndex.ts
|
|
1229
|
+
var import_zod_openapi5 = require("zod-openapi");
|
|
1230
|
+
(0, import_zod_openapi5.extendZodWithOpenApi)(import_zod14.z);
|
|
1278
1231
|
var EventIndex = EventMetadata.extend({
|
|
1279
1232
|
declaration: EventState
|
|
1280
|
-
}).
|
|
1281
|
-
|
|
1233
|
+
}).openapi({
|
|
1234
|
+
ref: "EventIndex"
|
|
1282
1235
|
});
|
|
1283
|
-
var EventSearchIndex =
|
|
1284
|
-
|
|
1285
|
-
type:
|
|
1236
|
+
var EventSearchIndex = import_zod14.z.record(import_zod14.z.string(), import_zod14.z.any()).and(
|
|
1237
|
+
import_zod14.z.object({
|
|
1238
|
+
type: import_zod14.z.string()
|
|
1286
1239
|
// Ensures "type" (event-id) exists and is a string
|
|
1287
1240
|
})
|
|
1288
|
-
).
|
|
1289
|
-
|
|
1241
|
+
).openapi({
|
|
1242
|
+
ref: "EventSearchIndex"
|
|
1290
1243
|
});
|
|
1291
|
-
var Fuzzy =
|
|
1292
|
-
|
|
1244
|
+
var Fuzzy = import_zod14.z.object({ type: import_zod14.z.literal("fuzzy"), term: import_zod14.z.string() }).openapi({
|
|
1245
|
+
ref: "Fuzzy"
|
|
1293
1246
|
});
|
|
1294
|
-
var Exact =
|
|
1295
|
-
|
|
1247
|
+
var Exact = import_zod14.z.object({ type: import_zod14.z.literal("exact"), term: import_zod14.z.string() }).openapi({
|
|
1248
|
+
ref: "Exact"
|
|
1296
1249
|
});
|
|
1297
|
-
var ExactStatus =
|
|
1298
|
-
type:
|
|
1250
|
+
var ExactStatus = import_zod14.z.object({
|
|
1251
|
+
type: import_zod14.z.literal("exact"),
|
|
1299
1252
|
term: EventStatus
|
|
1300
|
-
}).
|
|
1301
|
-
|
|
1253
|
+
}).openapi({
|
|
1254
|
+
ref: "ExactStatus"
|
|
1302
1255
|
});
|
|
1303
|
-
var ExactUserType =
|
|
1304
|
-
type:
|
|
1256
|
+
var ExactUserType = import_zod14.z.object({
|
|
1257
|
+
type: import_zod14.z.literal("exact"),
|
|
1305
1258
|
term: TokenUserType
|
|
1306
|
-
}).
|
|
1307
|
-
|
|
1259
|
+
}).openapi({
|
|
1260
|
+
ref: "ExactUserType"
|
|
1308
1261
|
});
|
|
1309
|
-
var AnyOf =
|
|
1310
|
-
type:
|
|
1311
|
-
terms:
|
|
1312
|
-
}).
|
|
1313
|
-
|
|
1262
|
+
var AnyOf = import_zod14.z.object({
|
|
1263
|
+
type: import_zod14.z.literal("anyOf"),
|
|
1264
|
+
terms: import_zod14.z.array(import_zod14.z.string())
|
|
1265
|
+
}).openapi({
|
|
1266
|
+
ref: "AnyOf"
|
|
1314
1267
|
});
|
|
1315
|
-
var AnyOfStatus =
|
|
1316
|
-
type:
|
|
1317
|
-
terms:
|
|
1318
|
-
}).
|
|
1319
|
-
|
|
1268
|
+
var AnyOfStatus = import_zod14.z.object({
|
|
1269
|
+
type: import_zod14.z.literal("anyOf"),
|
|
1270
|
+
terms: import_zod14.z.array(EventStatus)
|
|
1271
|
+
}).openapi({
|
|
1272
|
+
ref: "AnyOfStatus"
|
|
1320
1273
|
});
|
|
1321
|
-
var Range =
|
|
1322
|
-
type:
|
|
1323
|
-
gte:
|
|
1324
|
-
lte:
|
|
1325
|
-
}).
|
|
1326
|
-
|
|
1274
|
+
var Range = import_zod14.z.object({
|
|
1275
|
+
type: import_zod14.z.literal("range"),
|
|
1276
|
+
gte: import_zod14.z.string(),
|
|
1277
|
+
lte: import_zod14.z.string()
|
|
1278
|
+
}).openapi({
|
|
1279
|
+
ref: "Range"
|
|
1327
1280
|
});
|
|
1328
|
-
var ContainsFlags =
|
|
1329
|
-
anyOf:
|
|
1330
|
-
noneOf:
|
|
1331
|
-
}).
|
|
1332
|
-
|
|
1281
|
+
var ContainsFlags = import_zod14.z.object({
|
|
1282
|
+
anyOf: import_zod14.z.array(Flag).optional(),
|
|
1283
|
+
noneOf: import_zod14.z.array(Flag).optional()
|
|
1284
|
+
}).openapi({
|
|
1285
|
+
ref: "ContainsFlags"
|
|
1333
1286
|
});
|
|
1334
|
-
var Within =
|
|
1335
|
-
|
|
1287
|
+
var Within = import_zod14.z.object({ type: import_zod14.z.literal("within"), location: import_zod14.z.string() }).openapi({
|
|
1288
|
+
ref: "Within"
|
|
1336
1289
|
});
|
|
1337
|
-
var RangeDate =
|
|
1338
|
-
type:
|
|
1339
|
-
gte:
|
|
1340
|
-
lte:
|
|
1341
|
-
}).
|
|
1290
|
+
var RangeDate = import_zod14.z.object({
|
|
1291
|
+
type: import_zod14.z.literal("range"),
|
|
1292
|
+
gte: import_zod14.z.string().date().or(import_zod14.z.string().datetime()),
|
|
1293
|
+
lte: import_zod14.z.string().date().or(import_zod14.z.string().datetime())
|
|
1294
|
+
}).openapi({ ref: "RangeDate" });
|
|
1342
1295
|
var ExactDate = Exact.extend({
|
|
1343
|
-
term:
|
|
1344
|
-
}).
|
|
1345
|
-
|
|
1296
|
+
term: import_zod14.z.string().date().or(import_zod14.z.string().datetime())
|
|
1297
|
+
}).openapi({
|
|
1298
|
+
ref: "ExactDate"
|
|
1346
1299
|
});
|
|
1347
|
-
var TimePeriod =
|
|
1348
|
-
type:
|
|
1300
|
+
var TimePeriod = import_zod14.z.object({
|
|
1301
|
+
type: import_zod14.z.literal("timePeriod"),
|
|
1349
1302
|
term: SelectDateRangeValue
|
|
1350
|
-
}).
|
|
1351
|
-
|
|
1303
|
+
}).openapi({
|
|
1304
|
+
ref: "TimePeriod"
|
|
1352
1305
|
});
|
|
1353
|
-
var DateCondition =
|
|
1354
|
-
|
|
1306
|
+
var DateCondition = import_zod14.z.union([ExactDate, RangeDate, TimePeriod]).openapi({
|
|
1307
|
+
ref: "DateCondition"
|
|
1355
1308
|
});
|
|
1356
|
-
var QueryInput =
|
|
1357
|
-
() =>
|
|
1358
|
-
|
|
1359
|
-
|
|
1309
|
+
var QueryInput = import_zod14.z.lazy(
|
|
1310
|
+
() => import_zod14.z.union([
|
|
1311
|
+
import_zod14.z.discriminatedUnion("type", [Fuzzy, Exact, Range, Within, AnyOf]),
|
|
1312
|
+
import_zod14.z.record(import_zod14.z.string(), QueryInput)
|
|
1360
1313
|
])
|
|
1361
|
-
).
|
|
1362
|
-
|
|
1314
|
+
).openapi({
|
|
1315
|
+
ref: "QueryInput"
|
|
1363
1316
|
});
|
|
1364
|
-
var QueryExpression =
|
|
1365
|
-
id:
|
|
1366
|
-
eventType:
|
|
1367
|
-
status:
|
|
1368
|
-
createdAt:
|
|
1369
|
-
updatedAt:
|
|
1370
|
-
"legalStatuses.REGISTERED.acceptedAt":
|
|
1371
|
-
"legalStatuses.DECLARED.createdAtLocation":
|
|
1372
|
-
|
|
1317
|
+
var QueryExpression = import_zod14.z.object({
|
|
1318
|
+
id: import_zod14.z.optional(import_zod14.z.string()),
|
|
1319
|
+
eventType: import_zod14.z.string(),
|
|
1320
|
+
status: import_zod14.z.optional(import_zod14.z.union([AnyOfStatus, ExactStatus])),
|
|
1321
|
+
createdAt: import_zod14.z.optional(DateCondition),
|
|
1322
|
+
updatedAt: import_zod14.z.optional(DateCondition),
|
|
1323
|
+
"legalStatuses.REGISTERED.acceptedAt": import_zod14.z.optional(DateCondition),
|
|
1324
|
+
"legalStatuses.DECLARED.createdAtLocation": import_zod14.z.optional(
|
|
1325
|
+
import_zod14.z.union([Within, Exact])
|
|
1373
1326
|
),
|
|
1374
|
-
"legalStatuses.REGISTERED.createdAtLocation":
|
|
1375
|
-
|
|
1327
|
+
"legalStatuses.REGISTERED.createdAtLocation": import_zod14.z.optional(
|
|
1328
|
+
import_zod14.z.union([Within, Exact])
|
|
1376
1329
|
),
|
|
1377
|
-
"legalStatuses.REGISTERED.registrationNumber":
|
|
1378
|
-
createdAtLocation:
|
|
1379
|
-
updatedAtLocation:
|
|
1380
|
-
assignedTo:
|
|
1381
|
-
createdByUserType:
|
|
1382
|
-
createdBy:
|
|
1383
|
-
updatedBy:
|
|
1384
|
-
trackingId:
|
|
1385
|
-
flags:
|
|
1330
|
+
"legalStatuses.REGISTERED.registrationNumber": import_zod14.z.optional(Exact),
|
|
1331
|
+
createdAtLocation: import_zod14.z.optional(import_zod14.z.union([Within, Exact])),
|
|
1332
|
+
updatedAtLocation: import_zod14.z.optional(import_zod14.z.union([Within, Exact])),
|
|
1333
|
+
assignedTo: import_zod14.z.optional(Exact),
|
|
1334
|
+
createdByUserType: import_zod14.z.optional(ExactUserType),
|
|
1335
|
+
createdBy: import_zod14.z.optional(Exact),
|
|
1336
|
+
updatedBy: import_zod14.z.optional(Exact),
|
|
1337
|
+
trackingId: import_zod14.z.optional(Exact),
|
|
1338
|
+
flags: import_zod14.z.optional(ContainsFlags),
|
|
1386
1339
|
// @todo: The type for this comes out as "any"
|
|
1387
1340
|
data: QueryInput
|
|
1388
1341
|
}).partial().refine((obj) => Object.values(obj).some((val) => val !== void 0), {
|
|
1389
|
-
|
|
1390
|
-
}).
|
|
1391
|
-
|
|
1342
|
+
message: "At least one query field must be specified."
|
|
1343
|
+
}).openapi({
|
|
1344
|
+
ref: "QueryExpression"
|
|
1392
1345
|
});
|
|
1393
|
-
var QueryType =
|
|
1394
|
-
() =>
|
|
1395
|
-
type:
|
|
1396
|
-
clauses:
|
|
1346
|
+
var QueryType = import_zod14.z.lazy(
|
|
1347
|
+
() => import_zod14.z.object({
|
|
1348
|
+
type: import_zod14.z.literal("and").or(import_zod14.z.literal("or")).openapi({ default: "and" }),
|
|
1349
|
+
clauses: import_zod14.z.array(import_zod14.z.union([QueryExpression, QueryType])).nonempty("At least one clause is required.").openapi({
|
|
1397
1350
|
default: [
|
|
1398
1351
|
{
|
|
1399
1352
|
eventType: TENNIS_CLUB_MEMBERSHIP,
|
|
@@ -1411,8 +1364,8 @@ var QueryType = import_v4.z.lazy(
|
|
|
1411
1364
|
]
|
|
1412
1365
|
})
|
|
1413
1366
|
})
|
|
1414
|
-
).
|
|
1415
|
-
|
|
1367
|
+
).openapi({
|
|
1368
|
+
ref: "QueryType"
|
|
1416
1369
|
});
|
|
1417
1370
|
function parseStringifiedQueryField(val) {
|
|
1418
1371
|
if (typeof val === "string") {
|
|
@@ -1420,8 +1373,8 @@ function parseStringifiedQueryField(val) {
|
|
|
1420
1373
|
}
|
|
1421
1374
|
return val;
|
|
1422
1375
|
}
|
|
1423
|
-
var SearchQuery =
|
|
1424
|
-
query:
|
|
1376
|
+
var SearchQuery = import_zod14.z.object({
|
|
1377
|
+
query: import_zod14.z.preprocess(parseStringifiedQueryField, QueryType).openapi({
|
|
1425
1378
|
default: {
|
|
1426
1379
|
type: "and",
|
|
1427
1380
|
clauses: [
|
|
@@ -1441,184 +1394,190 @@ var SearchQuery = import_v4.z.object({
|
|
|
1441
1394
|
]
|
|
1442
1395
|
}
|
|
1443
1396
|
}),
|
|
1444
|
-
limit:
|
|
1445
|
-
offset:
|
|
1446
|
-
sort:
|
|
1397
|
+
limit: import_zod14.z.number().optional().default(100),
|
|
1398
|
+
offset: import_zod14.z.number().optional().default(0),
|
|
1399
|
+
sort: import_zod14.z.preprocess(
|
|
1447
1400
|
parseStringifiedQueryField,
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
field:
|
|
1451
|
-
direction:
|
|
1401
|
+
import_zod14.z.array(
|
|
1402
|
+
import_zod14.z.object({
|
|
1403
|
+
field: import_zod14.z.string(),
|
|
1404
|
+
direction: import_zod14.z.enum(["asc", "desc"]).default("asc")
|
|
1452
1405
|
})
|
|
1453
1406
|
)
|
|
1454
1407
|
).optional()
|
|
1455
|
-
}).
|
|
1456
|
-
|
|
1408
|
+
}).openapi({
|
|
1409
|
+
ref: "SearchQuery"
|
|
1457
1410
|
});
|
|
1458
1411
|
|
|
1459
1412
|
// ../commons/src/events/FieldConfig.ts
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1413
|
+
(0, import_zod_openapi6.extendZodWithOpenApi)(import_zod15.z);
|
|
1414
|
+
var FieldId = import_zod15.z.string().refine(
|
|
1415
|
+
/*
|
|
1416
|
+
* Disallow underscores '_' in field ids.
|
|
1417
|
+
* Why? Theres two reasons:
|
|
1418
|
+
* 1. We transform dots to underscores as separator in Formik field ids, so this avoids any issues with the Formik transformations.
|
|
1419
|
+
* 2. On Kysely-SQL queries, we use the CamelCasePlugin. This plugin transforms snake_case to camelCase also on nested (jsonb) object keys.
|
|
1420
|
+
* This could be disabled via 'maintainNestedObjectKeys: true', but this would also affect SQL queries which use e.g. json_agg() or to_jsonb() to aggregate results.
|
|
1421
|
+
*/
|
|
1422
|
+
(val) => !val.includes("_"),
|
|
1423
|
+
(val) => ({
|
|
1424
|
+
message: `id: '${val}' must not contain underscores '_'`
|
|
1425
|
+
})
|
|
1426
|
+
).describe("Unique identifier for the field");
|
|
1427
|
+
var FieldReference = import_zod15.z.object({
|
|
1469
1428
|
$$field: FieldId,
|
|
1470
|
-
$$subfield:
|
|
1429
|
+
$$subfield: import_zod15.z.array(import_zod15.z.string()).optional().describe(
|
|
1471
1430
|
'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
|
|
1472
1431
|
)
|
|
1473
1432
|
}).describe("Reference to a field by its ID");
|
|
1474
|
-
var ValidationConfig =
|
|
1433
|
+
var ValidationConfig = import_zod15.z.object({
|
|
1475
1434
|
validator: Conditional,
|
|
1476
1435
|
message: TranslationConfig
|
|
1477
1436
|
});
|
|
1478
|
-
var requiredSchema =
|
|
1479
|
-
|
|
1480
|
-
|
|
1437
|
+
var requiredSchema = import_zod15.z.union([
|
|
1438
|
+
import_zod15.z.boolean(),
|
|
1439
|
+
import_zod15.z.object({
|
|
1481
1440
|
message: TranslationConfig.describe("Custom required validation message")
|
|
1482
1441
|
})
|
|
1483
1442
|
]).default(false).optional();
|
|
1484
|
-
var BaseField =
|
|
1443
|
+
var BaseField = import_zod15.z.object({
|
|
1485
1444
|
id: FieldId.describe("Unique identifier of the field."),
|
|
1486
1445
|
label: TranslationConfig.describe("Human-readable label of the field."),
|
|
1487
|
-
parent: FieldReference.or(
|
|
1446
|
+
parent: FieldReference.or(import_zod15.z.array(FieldReference)).optional().describe(
|
|
1488
1447
|
"Reference to the parent field or fields. When a parent field changes, this field is reset."
|
|
1489
1448
|
),
|
|
1490
1449
|
required: requiredSchema.describe(
|
|
1491
1450
|
"Indicates whether the field is mandatory."
|
|
1492
1451
|
),
|
|
1493
|
-
conditionals:
|
|
1452
|
+
conditionals: import_zod15.z.array(FieldConditional).default([]).optional().describe(
|
|
1494
1453
|
"Conditions determining when the field is shown or enabled. By default, the field is always shown and enabled."
|
|
1495
1454
|
),
|
|
1496
|
-
secured:
|
|
1455
|
+
secured: import_zod15.z.boolean().default(false).optional().describe(
|
|
1497
1456
|
"Indicates whether the field is secured. Secured fields are not indexed for search and are only visible when explicitly assigned."
|
|
1498
1457
|
),
|
|
1499
1458
|
placeholder: TranslationConfig.optional(),
|
|
1500
|
-
validation:
|
|
1459
|
+
validation: import_zod15.z.array(ValidationConfig).default([]).optional().describe("Additional validation rules applied to the field."),
|
|
1501
1460
|
helperText: TranslationConfig.optional(),
|
|
1502
|
-
hideLabel:
|
|
1503
|
-
uncorrectable:
|
|
1461
|
+
hideLabel: import_zod15.z.boolean().default(false).optional(),
|
|
1462
|
+
uncorrectable: import_zod15.z.boolean().default(false).optional().describe(
|
|
1504
1463
|
"Indicates whether the field can be modified during record correction."
|
|
1505
1464
|
),
|
|
1506
|
-
value: FieldReference.or(
|
|
1465
|
+
value: FieldReference.or(import_zod15.z.array(FieldReference)).optional().describe(
|
|
1507
1466
|
"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."
|
|
1508
1467
|
),
|
|
1509
|
-
analytics:
|
|
1468
|
+
analytics: import_zod15.z.boolean().default(false).optional().describe(
|
|
1510
1469
|
"Indicates whether the field is included in analytics. When enabled, its value becomes available in the analytics dashboard."
|
|
1511
1470
|
)
|
|
1512
1471
|
}).describe("Common properties shared across all field types.");
|
|
1513
1472
|
var Divider = BaseField.extend({
|
|
1514
|
-
type:
|
|
1473
|
+
type: import_zod15.z.literal(FieldType.DIVIDER)
|
|
1515
1474
|
});
|
|
1516
1475
|
var TextField = BaseField.extend({
|
|
1517
|
-
type:
|
|
1476
|
+
type: import_zod15.z.literal(FieldType.TEXT),
|
|
1518
1477
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1519
|
-
configuration:
|
|
1520
|
-
maxLength:
|
|
1521
|
-
type:
|
|
1478
|
+
configuration: import_zod15.z.object({
|
|
1479
|
+
maxLength: import_zod15.z.number().optional().describe("Maximum length of the text"),
|
|
1480
|
+
type: import_zod15.z.enum(["text", "password"]).optional(),
|
|
1522
1481
|
prefix: TranslationConfig.optional(),
|
|
1523
1482
|
postfix: TranslationConfig.optional()
|
|
1524
1483
|
}).default({ type: "text" }).optional()
|
|
1525
1484
|
}).describe("Text input");
|
|
1526
1485
|
var NumberField = BaseField.extend({
|
|
1527
|
-
type:
|
|
1486
|
+
type: import_zod15.z.literal(FieldType.NUMBER),
|
|
1528
1487
|
defaultValue: NumberFieldValue.optional(),
|
|
1529
|
-
configuration:
|
|
1530
|
-
min:
|
|
1531
|
-
max:
|
|
1488
|
+
configuration: import_zod15.z.object({
|
|
1489
|
+
min: import_zod15.z.number().optional().describe("Minimum value"),
|
|
1490
|
+
max: import_zod15.z.number().optional().describe("Maximum value"),
|
|
1532
1491
|
prefix: TranslationConfig.optional(),
|
|
1533
1492
|
postfix: TranslationConfig.optional()
|
|
1534
1493
|
}).optional()
|
|
1535
1494
|
}).describe("Number input");
|
|
1536
1495
|
var TextAreaField = BaseField.extend({
|
|
1537
|
-
type:
|
|
1496
|
+
type: import_zod15.z.literal(FieldType.TEXTAREA),
|
|
1538
1497
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1539
|
-
configuration:
|
|
1540
|
-
maxLength:
|
|
1541
|
-
rows:
|
|
1542
|
-
cols:
|
|
1498
|
+
configuration: import_zod15.z.object({
|
|
1499
|
+
maxLength: import_zod15.z.number().optional().describe("Maximum length of the text"),
|
|
1500
|
+
rows: import_zod15.z.number().optional().describe("Number of visible text lines"),
|
|
1501
|
+
cols: import_zod15.z.number().optional().describe("Number of visible columns"),
|
|
1543
1502
|
prefix: TranslationConfig.optional(),
|
|
1544
1503
|
postfix: TranslationConfig.optional()
|
|
1545
1504
|
}).default({ rows: 4 }).optional()
|
|
1546
1505
|
}).describe("Multiline text input");
|
|
1547
|
-
var ImageMimeType =
|
|
1506
|
+
var ImageMimeType = import_zod15.z.enum([
|
|
1548
1507
|
"image/png",
|
|
1549
1508
|
"image/jpg",
|
|
1550
1509
|
"image/jpeg",
|
|
1551
1510
|
"image/svg+xml"
|
|
1552
1511
|
]);
|
|
1553
|
-
var DocumentMimeType =
|
|
1512
|
+
var DocumentMimeType = import_zod15.z.enum([
|
|
1554
1513
|
"application/pdf",
|
|
1555
1514
|
"application/msword",
|
|
1556
1515
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
1557
1516
|
"application/vnd.oasis.opendocument.text"
|
|
1558
1517
|
]);
|
|
1559
|
-
var MimeType =
|
|
1518
|
+
var MimeType = import_zod15.z.enum([
|
|
1560
1519
|
...ImageMimeType.options,
|
|
1561
1520
|
...DocumentMimeType.options
|
|
1562
1521
|
]);
|
|
1563
1522
|
var DEFAULT_MAX_FILE_SIZE_BYTES = 5 * 1024 * 1024;
|
|
1564
1523
|
var SignatureField = BaseField.extend({
|
|
1565
|
-
type:
|
|
1524
|
+
type: import_zod15.z.literal(FieldType.SIGNATURE),
|
|
1566
1525
|
signaturePromptLabel: TranslationConfig.describe(
|
|
1567
1526
|
"Title of the signature modal"
|
|
1568
1527
|
),
|
|
1569
1528
|
defaultValue: SignatureFieldValue.optional(),
|
|
1570
|
-
configuration:
|
|
1571
|
-
maxFileSize:
|
|
1529
|
+
configuration: import_zod15.z.object({
|
|
1530
|
+
maxFileSize: import_zod15.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1572
1531
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
|
1573
1532
|
}).default({
|
|
1574
1533
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1575
1534
|
})
|
|
1576
1535
|
}).describe("Signature input field");
|
|
1577
1536
|
var EmailField = BaseField.extend({
|
|
1578
|
-
type:
|
|
1579
|
-
configuration:
|
|
1580
|
-
maxLength:
|
|
1581
|
-
}).default({ maxLength:
|
|
1537
|
+
type: import_zod15.z.literal(FieldType.EMAIL),
|
|
1538
|
+
configuration: import_zod15.z.object({
|
|
1539
|
+
maxLength: import_zod15.z.number().optional().describe("Maximum length of the text")
|
|
1540
|
+
}).default({ maxLength: 10 }).optional(),
|
|
1582
1541
|
defaultValue: NonEmptyTextValue.optional()
|
|
1583
1542
|
});
|
|
1584
1543
|
var DateField = BaseField.extend({
|
|
1585
|
-
type:
|
|
1544
|
+
type: import_zod15.z.literal(FieldType.DATE),
|
|
1586
1545
|
defaultValue: DateValue.optional(),
|
|
1587
|
-
configuration:
|
|
1546
|
+
configuration: import_zod15.z.object({
|
|
1588
1547
|
notice: TranslationConfig.describe(
|
|
1589
1548
|
"Text to display above the date input"
|
|
1590
1549
|
).optional()
|
|
1591
1550
|
}).optional()
|
|
1592
1551
|
}).describe("A single date input (yyyy-MM-dd)");
|
|
1593
1552
|
var AgeField = BaseField.extend({
|
|
1594
|
-
type:
|
|
1553
|
+
type: import_zod15.z.literal(FieldType.AGE),
|
|
1595
1554
|
defaultValue: NumberFieldValue.optional(),
|
|
1596
|
-
configuration:
|
|
1555
|
+
configuration: import_zod15.z.object({
|
|
1597
1556
|
asOfDate: FieldReference,
|
|
1598
1557
|
prefix: TranslationConfig.optional(),
|
|
1599
1558
|
postfix: TranslationConfig.optional()
|
|
1600
1559
|
})
|
|
1601
1560
|
}).describe("An age input field which uses the current date as the asOfDate");
|
|
1602
1561
|
var TimeField = BaseField.extend({
|
|
1603
|
-
type:
|
|
1562
|
+
type: import_zod15.z.literal(FieldType.TIME),
|
|
1604
1563
|
defaultValue: TimeValue.optional(),
|
|
1605
|
-
configuration:
|
|
1606
|
-
use12HourFormat:
|
|
1564
|
+
configuration: import_zod15.z.object({
|
|
1565
|
+
use12HourFormat: import_zod15.z.boolean().optional().describe("Whether to use 12-hour format"),
|
|
1607
1566
|
notice: TranslationConfig.describe(
|
|
1608
1567
|
"Text to display above the time input"
|
|
1609
1568
|
).optional()
|
|
1610
1569
|
}).optional()
|
|
1611
1570
|
}).describe("A single date input (HH-mm)");
|
|
1612
1571
|
var DateRangeField = BaseField.extend({
|
|
1613
|
-
type:
|
|
1572
|
+
type: import_zod15.z.literal(FieldType.DATE_RANGE),
|
|
1614
1573
|
defaultValue: DateRangeFieldValue.optional(),
|
|
1615
|
-
configuration:
|
|
1574
|
+
configuration: import_zod15.z.object({
|
|
1616
1575
|
notice: TranslationConfig.describe(
|
|
1617
1576
|
"Text to display above the date input"
|
|
1618
1577
|
).optional()
|
|
1619
1578
|
}).optional()
|
|
1620
1579
|
}).describe("A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })");
|
|
1621
|
-
var HtmlFontVariant =
|
|
1580
|
+
var HtmlFontVariant = import_zod15.z.enum([
|
|
1622
1581
|
"reg12",
|
|
1623
1582
|
"reg14",
|
|
1624
1583
|
"reg16",
|
|
@@ -1628,31 +1587,31 @@ var HtmlFontVariant = z16.enum([
|
|
|
1628
1587
|
"h2",
|
|
1629
1588
|
"h1"
|
|
1630
1589
|
]);
|
|
1631
|
-
var ParagraphConfiguration =
|
|
1632
|
-
styles:
|
|
1590
|
+
var ParagraphConfiguration = import_zod15.z.object({
|
|
1591
|
+
styles: import_zod15.z.object({
|
|
1633
1592
|
fontVariant: HtmlFontVariant.optional().describe(
|
|
1634
1593
|
"Font variant to use for the paragraph text"
|
|
1635
1594
|
),
|
|
1636
|
-
hint:
|
|
1595
|
+
hint: import_zod15.z.boolean().optional().describe("When true, paragraph is styled as a hint with grey color")
|
|
1637
1596
|
}).optional()
|
|
1638
1597
|
}).default({});
|
|
1639
1598
|
var Paragraph = BaseField.extend({
|
|
1640
|
-
type:
|
|
1599
|
+
type: import_zod15.z.literal(FieldType.PARAGRAPH),
|
|
1641
1600
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1642
1601
|
configuration: ParagraphConfiguration
|
|
1643
1602
|
}).describe("A read-only HTML <p> paragraph");
|
|
1644
1603
|
var PageHeader = BaseField.extend({
|
|
1645
|
-
type:
|
|
1604
|
+
type: import_zod15.z.literal(FieldType.PAGE_HEADER),
|
|
1646
1605
|
defaultValue: NonEmptyTextValue.optional()
|
|
1647
1606
|
}).describe("A read-only header component for form pages");
|
|
1648
1607
|
var File = BaseField.extend({
|
|
1649
|
-
type:
|
|
1608
|
+
type: import_zod15.z.literal(FieldType.FILE),
|
|
1650
1609
|
defaultValue: FileFieldValue.optional(),
|
|
1651
|
-
configuration:
|
|
1652
|
-
maxFileSize:
|
|
1610
|
+
configuration: import_zod15.z.object({
|
|
1611
|
+
maxFileSize: import_zod15.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1653
1612
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature"),
|
|
1654
|
-
style:
|
|
1655
|
-
width:
|
|
1613
|
+
style: import_zod15.z.object({
|
|
1614
|
+
width: import_zod15.z.enum(["full", "auto"]).optional().describe(
|
|
1656
1615
|
"Whether the file upload button should take the full width of the container or not"
|
|
1657
1616
|
)
|
|
1658
1617
|
}).optional(),
|
|
@@ -1661,34 +1620,34 @@ var File = BaseField.extend({
|
|
|
1661
1620
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1662
1621
|
})
|
|
1663
1622
|
}).describe("File upload");
|
|
1664
|
-
var SelectOption =
|
|
1665
|
-
value:
|
|
1666
|
-
label:
|
|
1623
|
+
var SelectOption = import_zod15.z.object({
|
|
1624
|
+
value: import_zod15.z.string().describe("The value of the option"),
|
|
1625
|
+
label: import_zod15.z.union([import_zod15.z.string(), TranslationConfig]).describe("The label of the option")
|
|
1667
1626
|
});
|
|
1668
1627
|
var RadioGroup = BaseField.extend({
|
|
1669
|
-
type:
|
|
1628
|
+
type: import_zod15.z.literal(FieldType.RADIO_GROUP),
|
|
1670
1629
|
defaultValue: TextValue.optional(),
|
|
1671
|
-
options:
|
|
1672
|
-
configuration:
|
|
1673
|
-
styles:
|
|
1674
|
-
size:
|
|
1630
|
+
options: import_zod15.z.array(SelectOption).describe("A list of options"),
|
|
1631
|
+
configuration: import_zod15.z.object({
|
|
1632
|
+
styles: import_zod15.z.object({
|
|
1633
|
+
size: import_zod15.z.enum(["NORMAL", "LARGE"]).optional()
|
|
1675
1634
|
}).optional()
|
|
1676
1635
|
}).optional()
|
|
1677
1636
|
}).describe("Grouped radio options");
|
|
1678
1637
|
var BulletList = BaseField.extend({
|
|
1679
|
-
type:
|
|
1638
|
+
type: import_zod15.z.literal(FieldType.BULLET_LIST),
|
|
1680
1639
|
defaultValue: TextValue.optional(),
|
|
1681
|
-
items:
|
|
1682
|
-
configuration:
|
|
1683
|
-
styles:
|
|
1640
|
+
items: import_zod15.z.array(TranslationConfig).describe("A list of items"),
|
|
1641
|
+
configuration: import_zod15.z.object({
|
|
1642
|
+
styles: import_zod15.z.object({
|
|
1684
1643
|
fontVariant: HtmlFontVariant.optional()
|
|
1685
1644
|
}).optional()
|
|
1686
1645
|
}).default({})
|
|
1687
1646
|
}).describe("A list of bullet points");
|
|
1688
1647
|
var Select = BaseField.extend({
|
|
1689
|
-
type:
|
|
1648
|
+
type: import_zod15.z.literal(FieldType.SELECT),
|
|
1690
1649
|
defaultValue: TextValue.optional(),
|
|
1691
|
-
options:
|
|
1650
|
+
options: import_zod15.z.array(SelectOption).describe("A list of options"),
|
|
1692
1651
|
noOptionsMessage: TranslationConfig.optional().describe(
|
|
1693
1652
|
`
|
|
1694
1653
|
A translation configuration object used to display a message when no options are available.
|
|
@@ -1700,34 +1659,34 @@ var Select = BaseField.extend({
|
|
|
1700
1659
|
`
|
|
1701
1660
|
)
|
|
1702
1661
|
}).describe("Select input");
|
|
1703
|
-
var SelectDateRangeOption =
|
|
1662
|
+
var SelectDateRangeOption = import_zod15.z.object({
|
|
1704
1663
|
value: SelectDateRangeValue.describe("The value of the option"),
|
|
1705
1664
|
label: TranslationConfig.describe("The label of the option")
|
|
1706
1665
|
});
|
|
1707
1666
|
var SelectDateRangeField = BaseField.extend({
|
|
1708
|
-
type:
|
|
1667
|
+
type: import_zod15.z.literal(FieldType.SELECT_DATE_RANGE),
|
|
1709
1668
|
defaultValue: SelectDateRangeValue.optional(),
|
|
1710
|
-
options:
|
|
1669
|
+
options: import_zod15.z.array(SelectDateRangeOption).describe("A list of options")
|
|
1711
1670
|
}).describe("Select input with date range options");
|
|
1712
|
-
var NameConfig =
|
|
1713
|
-
firstname:
|
|
1714
|
-
middlename:
|
|
1715
|
-
surname:
|
|
1671
|
+
var NameConfig = import_zod15.z.object({
|
|
1672
|
+
firstname: import_zod15.z.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
1673
|
+
middlename: import_zod15.z.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
1674
|
+
surname: import_zod15.z.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional()
|
|
1716
1675
|
});
|
|
1717
1676
|
var NameField = BaseField.extend({
|
|
1718
|
-
type:
|
|
1719
|
-
defaultValue:
|
|
1677
|
+
type: import_zod15.z.literal(FieldType.NAME),
|
|
1678
|
+
defaultValue: import_zod15.z.object({
|
|
1720
1679
|
firstname: NonEmptyTextValue.optional(),
|
|
1721
1680
|
middlename: NonEmptyTextValue.optional(),
|
|
1722
1681
|
surname: NonEmptyTextValue.optional()
|
|
1723
1682
|
}).optional(),
|
|
1724
|
-
configuration:
|
|
1683
|
+
configuration: import_zod15.z.object({
|
|
1725
1684
|
name: NameConfig.default({
|
|
1726
1685
|
firstname: { required: true },
|
|
1727
1686
|
surname: { required: true }
|
|
1728
1687
|
}).optional(),
|
|
1729
|
-
order:
|
|
1730
|
-
maxLength:
|
|
1688
|
+
order: import_zod15.z.array(import_zod15.z.enum(["firstname", "middlename", "surname"])).optional(),
|
|
1689
|
+
maxLength: import_zod15.z.number().optional().describe("Maximum length of the text"),
|
|
1731
1690
|
prefix: TranslationConfig.optional(),
|
|
1732
1691
|
postfix: TranslationConfig.optional()
|
|
1733
1692
|
}).default({
|
|
@@ -1739,142 +1698,142 @@ var NameField = BaseField.extend({
|
|
|
1739
1698
|
}).describe("Name input field");
|
|
1740
1699
|
var PhoneField = BaseField.extend({
|
|
1741
1700
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1742
|
-
type:
|
|
1701
|
+
type: import_zod15.z.literal(FieldType.PHONE)
|
|
1743
1702
|
}).describe("Phone input field");
|
|
1744
1703
|
var IdField = BaseField.extend({
|
|
1745
1704
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1746
|
-
type:
|
|
1705
|
+
type: import_zod15.z.literal(FieldType.ID)
|
|
1747
1706
|
}).describe("ID input field");
|
|
1748
1707
|
var Checkbox = BaseField.extend({
|
|
1749
|
-
type:
|
|
1708
|
+
type: import_zod15.z.literal(FieldType.CHECKBOX),
|
|
1750
1709
|
defaultValue: CheckboxFieldValue.default(false)
|
|
1751
1710
|
}).describe("Boolean checkbox field");
|
|
1752
1711
|
var Country = BaseField.extend({
|
|
1753
|
-
type:
|
|
1712
|
+
type: import_zod15.z.literal(FieldType.COUNTRY),
|
|
1754
1713
|
defaultValue: NonEmptyTextValue.optional()
|
|
1755
1714
|
}).describe("Country select field");
|
|
1756
|
-
var AdministrativeAreas =
|
|
1715
|
+
var AdministrativeAreas = import_zod15.z.enum([
|
|
1757
1716
|
"ADMIN_STRUCTURE",
|
|
1758
1717
|
"HEALTH_FACILITY",
|
|
1759
1718
|
"CRVS_OFFICE"
|
|
1760
1719
|
]);
|
|
1761
|
-
var AdministrativeAreaConfiguration =
|
|
1762
|
-
partOf:
|
|
1763
|
-
$declaration:
|
|
1720
|
+
var AdministrativeAreaConfiguration = import_zod15.z.object({
|
|
1721
|
+
partOf: import_zod15.z.object({
|
|
1722
|
+
$declaration: import_zod15.z.string()
|
|
1764
1723
|
}).optional().describe("Parent location"),
|
|
1765
1724
|
type: AdministrativeAreas
|
|
1766
1725
|
}).describe("Administrative area options");
|
|
1767
1726
|
var AdministrativeArea = BaseField.extend({
|
|
1768
|
-
type:
|
|
1727
|
+
type: import_zod15.z.literal(FieldType.ADMINISTRATIVE_AREA),
|
|
1769
1728
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1770
1729
|
configuration: AdministrativeAreaConfiguration
|
|
1771
1730
|
}).describe("Administrative area input field e.g. facility, office");
|
|
1772
1731
|
var LocationInput = BaseField.extend({
|
|
1773
|
-
type:
|
|
1732
|
+
type: import_zod15.z.literal(FieldType.LOCATION),
|
|
1774
1733
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1775
|
-
configuration:
|
|
1776
|
-
searchableResource:
|
|
1734
|
+
configuration: import_zod15.z.object({
|
|
1735
|
+
searchableResource: import_zod15.z.array(import_zod15.z.enum(["locations", "facilities", "offices"]))
|
|
1777
1736
|
})
|
|
1778
1737
|
}).describe("Input field for a location");
|
|
1779
1738
|
var FileUploadWithOptions = BaseField.extend({
|
|
1780
|
-
type:
|
|
1781
|
-
options:
|
|
1739
|
+
type: import_zod15.z.literal(FieldType.FILE_WITH_OPTIONS),
|
|
1740
|
+
options: import_zod15.z.array(SelectOption).describe("A list of options"),
|
|
1782
1741
|
defaultValue: FileFieldWithOptionValue.optional(),
|
|
1783
|
-
configuration:
|
|
1784
|
-
maxFileSize:
|
|
1742
|
+
configuration: import_zod15.z.object({
|
|
1743
|
+
maxFileSize: import_zod15.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1785
1744
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
|
1786
1745
|
}).default({
|
|
1787
1746
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1788
1747
|
})
|
|
1789
1748
|
});
|
|
1790
1749
|
var Facility = BaseField.extend({
|
|
1791
|
-
type:
|
|
1750
|
+
type: import_zod15.z.literal(FieldType.FACILITY),
|
|
1792
1751
|
defaultValue: NonEmptyTextValue.optional()
|
|
1793
1752
|
}).describe("Input field for a facility");
|
|
1794
1753
|
var Office = BaseField.extend({
|
|
1795
|
-
type:
|
|
1754
|
+
type: import_zod15.z.literal(FieldType.OFFICE),
|
|
1796
1755
|
defaultValue: NonEmptyTextValue.optional()
|
|
1797
1756
|
}).describe("Input field for an office");
|
|
1798
1757
|
var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
|
|
1799
|
-
administrativeArea:
|
|
1758
|
+
administrativeArea: import_zod15.z.union([UUID, SerializedUserField]).optional()
|
|
1800
1759
|
});
|
|
1801
1760
|
var Address = BaseField.extend({
|
|
1802
|
-
type:
|
|
1803
|
-
configuration:
|
|
1804
|
-
lineSeparator:
|
|
1805
|
-
fields:
|
|
1806
|
-
administrativeLevels:
|
|
1807
|
-
streetAddressForm:
|
|
1808
|
-
|
|
1809
|
-
id:
|
|
1761
|
+
type: import_zod15.z.literal(FieldType.ADDRESS),
|
|
1762
|
+
configuration: import_zod15.z.object({
|
|
1763
|
+
lineSeparator: import_zod15.z.string().optional(),
|
|
1764
|
+
fields: import_zod15.z.array(import_zod15.z.enum(["country", "administrativeArea"])).optional(),
|
|
1765
|
+
administrativeLevels: import_zod15.z.array(import_zod15.z.string()).optional(),
|
|
1766
|
+
streetAddressForm: import_zod15.z.array(
|
|
1767
|
+
import_zod15.z.object({
|
|
1768
|
+
id: import_zod15.z.string(),
|
|
1810
1769
|
required: requiredSchema,
|
|
1811
1770
|
label: TranslationConfig,
|
|
1812
|
-
type:
|
|
1813
|
-
conditionals:
|
|
1771
|
+
type: import_zod15.z.literal(FieldType.TEXT),
|
|
1772
|
+
conditionals: import_zod15.z.array(FieldConditional).default([]).optional(),
|
|
1814
1773
|
parent: FieldReference.optional()
|
|
1815
1774
|
})
|
|
1816
1775
|
).optional()
|
|
1817
1776
|
}).optional(),
|
|
1818
1777
|
defaultValue: DefaultAddressFieldValue.optional()
|
|
1819
1778
|
}).describe("Address input field \u2013 a combination of location and text fields");
|
|
1820
|
-
var StaticDataEntry =
|
|
1821
|
-
id:
|
|
1779
|
+
var StaticDataEntry = import_zod15.z.object({
|
|
1780
|
+
id: import_zod15.z.string().describe("ID for the data entry."),
|
|
1822
1781
|
label: TranslationConfig,
|
|
1823
|
-
value: TranslationConfig.or(
|
|
1782
|
+
value: TranslationConfig.or(import_zod15.z.string()).or(FieldReference)
|
|
1824
1783
|
}).describe("Static data entry");
|
|
1825
|
-
var DataEntry =
|
|
1784
|
+
var DataEntry = import_zod15.z.union([StaticDataEntry, import_zod15.z.object({ fieldId: import_zod15.z.string() })]).describe(
|
|
1826
1785
|
"Data entry can be either a static data entry, or a reference to another field in the current form or the declaration."
|
|
1827
1786
|
);
|
|
1828
1787
|
var DataField = BaseField.extend({
|
|
1829
|
-
type:
|
|
1830
|
-
configuration:
|
|
1788
|
+
type: import_zod15.z.literal(FieldType.DATA),
|
|
1789
|
+
configuration: import_zod15.z.object({
|
|
1831
1790
|
subtitle: TranslationConfig.optional(),
|
|
1832
|
-
data:
|
|
1791
|
+
data: import_zod15.z.array(DataEntry)
|
|
1833
1792
|
})
|
|
1834
1793
|
}).describe("Data field for displaying read-only data");
|
|
1835
1794
|
var ButtonField = BaseField.extend({
|
|
1836
|
-
type:
|
|
1795
|
+
type: import_zod15.z.literal(FieldType.BUTTON),
|
|
1837
1796
|
defaultValue: ButtonFieldValue.optional(),
|
|
1838
|
-
configuration:
|
|
1839
|
-
icon:
|
|
1797
|
+
configuration: import_zod15.z.object({
|
|
1798
|
+
icon: import_zod15.z.string().optional().describe(
|
|
1840
1799
|
"Icon for the button. You can find icons from OpenCRVS UI-Kit."
|
|
1841
1800
|
),
|
|
1842
|
-
loading:
|
|
1801
|
+
loading: import_zod15.z.boolean().optional().describe("Whether the button is in a loading state and shows a spinner"),
|
|
1843
1802
|
text: TranslationConfig.describe("Text to display on the button")
|
|
1844
1803
|
})
|
|
1845
1804
|
}).describe("Generic button without any built-in functionality");
|
|
1846
1805
|
var AlphaPrintButton = BaseField.extend({
|
|
1847
|
-
type:
|
|
1848
|
-
configuration:
|
|
1849
|
-
template:
|
|
1806
|
+
type: import_zod15.z.literal(FieldType.ALPHA_PRINT_BUTTON),
|
|
1807
|
+
configuration: import_zod15.z.object({
|
|
1808
|
+
template: import_zod15.z.string().describe("Template ID from countryconfig templates to use for printing"),
|
|
1850
1809
|
buttonLabel: TranslationConfig.optional().describe(
|
|
1851
1810
|
"Label for the print button"
|
|
1852
1811
|
)
|
|
1853
1812
|
})
|
|
1854
1813
|
}).describe("Print button field for printing certificates");
|
|
1855
1814
|
var HttpField = BaseField.extend({
|
|
1856
|
-
type:
|
|
1815
|
+
type: import_zod15.z.literal(FieldType.HTTP),
|
|
1857
1816
|
defaultValue: HttpFieldValue.optional(),
|
|
1858
|
-
configuration:
|
|
1817
|
+
configuration: import_zod15.z.object({
|
|
1859
1818
|
trigger: FieldReference,
|
|
1860
|
-
url:
|
|
1861
|
-
method:
|
|
1862
|
-
headers:
|
|
1863
|
-
body:
|
|
1864
|
-
errorValue:
|
|
1865
|
-
params:
|
|
1866
|
-
timeout:
|
|
1819
|
+
url: import_zod15.z.string().describe("URL to send the HTTP request to"),
|
|
1820
|
+
method: import_zod15.z.enum(["GET", "POST", "PUT", "DELETE"]),
|
|
1821
|
+
headers: import_zod15.z.record(import_zod15.z.string()).optional(),
|
|
1822
|
+
body: import_zod15.z.record(import_zod15.z.any()).optional(),
|
|
1823
|
+
errorValue: import_zod15.z.any().optional().describe("Value to set if the request fails"),
|
|
1824
|
+
params: import_zod15.z.record(import_zod15.z.string(), import_zod15.z.union([import_zod15.z.string(), FieldReference])).optional(),
|
|
1825
|
+
timeout: import_zod15.z.number().default(15e3).describe("Request timeout in milliseconds")
|
|
1867
1826
|
})
|
|
1868
1827
|
}).describe("HTTP request function triggered by a button click or other event");
|
|
1869
1828
|
var SearchField = HttpField.extend({
|
|
1870
|
-
type:
|
|
1829
|
+
type: import_zod15.z.literal(FieldType.SEARCH),
|
|
1871
1830
|
configuration: SearchQuery.pick({
|
|
1872
1831
|
query: true,
|
|
1873
1832
|
limit: true,
|
|
1874
1833
|
offset: true
|
|
1875
1834
|
}).extend({
|
|
1876
1835
|
validation: ValidationConfig,
|
|
1877
|
-
indicators:
|
|
1836
|
+
indicators: import_zod15.z.object({
|
|
1878
1837
|
loading: TranslationConfig.optional().describe(
|
|
1879
1838
|
"Text to display while the search is in progress"
|
|
1880
1839
|
),
|
|
@@ -1889,7 +1848,7 @@ var SearchField = HttpField.extend({
|
|
|
1889
1848
|
),
|
|
1890
1849
|
confirmButton: TranslationConfig.optional(),
|
|
1891
1850
|
clearButton: TranslationConfig.optional(),
|
|
1892
|
-
clearModal:
|
|
1851
|
+
clearModal: import_zod15.z.object({
|
|
1893
1852
|
title: TranslationConfig.optional(),
|
|
1894
1853
|
description: TranslationConfig.optional(),
|
|
1895
1854
|
cancel: TranslationConfig.optional(),
|
|
@@ -1900,17 +1859,17 @@ var SearchField = HttpField.extend({
|
|
|
1900
1859
|
})
|
|
1901
1860
|
});
|
|
1902
1861
|
var LinkButtonField = BaseField.extend({
|
|
1903
|
-
type:
|
|
1904
|
-
configuration:
|
|
1905
|
-
url:
|
|
1862
|
+
type: import_zod15.z.literal(FieldType.LINK_BUTTON),
|
|
1863
|
+
configuration: import_zod15.z.object({
|
|
1864
|
+
url: import_zod15.z.string().describe("URL to open"),
|
|
1906
1865
|
text: TranslationConfig.describe("Text to display on the button"),
|
|
1907
|
-
icon:
|
|
1866
|
+
icon: import_zod15.z.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit.")
|
|
1908
1867
|
})
|
|
1909
1868
|
}).describe("Button that opens a link");
|
|
1910
1869
|
var VerificationStatus = BaseField.extend({
|
|
1911
|
-
type:
|
|
1870
|
+
type: import_zod15.z.literal(FieldType.VERIFICATION_STATUS),
|
|
1912
1871
|
defaultValue: VerificationStatusValue.optional(),
|
|
1913
|
-
configuration:
|
|
1872
|
+
configuration: import_zod15.z.object({
|
|
1914
1873
|
status: TranslationConfig.describe("Text to display on the status pill."),
|
|
1915
1874
|
description: TranslationConfig.describe(
|
|
1916
1875
|
"Explaining text on the banner in form."
|
|
@@ -1918,42 +1877,38 @@ var VerificationStatus = BaseField.extend({
|
|
|
1918
1877
|
})
|
|
1919
1878
|
});
|
|
1920
1879
|
var QueryParamReaderField = BaseField.extend({
|
|
1921
|
-
type:
|
|
1922
|
-
configuration:
|
|
1923
|
-
pickParams:
|
|
1880
|
+
type: import_zod15.z.literal(FieldType.QUERY_PARAM_READER),
|
|
1881
|
+
configuration: import_zod15.z.object({
|
|
1882
|
+
pickParams: import_zod15.z.array(import_zod15.z.string()).describe("List of query parameters to read from the URL")
|
|
1924
1883
|
})
|
|
1925
1884
|
}).describe(
|
|
1926
1885
|
"A field that maps URL query params into form values and clears them afterward"
|
|
1927
1886
|
);
|
|
1928
1887
|
var QrReaderField = BaseField.extend({
|
|
1929
|
-
type:
|
|
1888
|
+
type: import_zod15.z.literal(FieldType.QR_READER),
|
|
1930
1889
|
defaultValue: QrReaderFieldValue.optional(),
|
|
1931
|
-
configuration:
|
|
1932
|
-
validator:
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
})
|
|
1890
|
+
configuration: import_zod15.z.object({
|
|
1891
|
+
validator: import_zod15.z.custom(
|
|
1892
|
+
(val) => typeof val === "object" && val !== null
|
|
1893
|
+
)
|
|
1936
1894
|
}).optional()
|
|
1937
|
-
}).meta({
|
|
1938
|
-
description: "Configuration for QR code reader field, including optional JSON Schema validator.",
|
|
1939
|
-
id: "QrReaderField"
|
|
1940
1895
|
});
|
|
1941
1896
|
var IdReaderField = BaseField.extend({
|
|
1942
|
-
type:
|
|
1897
|
+
type: import_zod15.z.literal(FieldType.ID_READER),
|
|
1943
1898
|
defaultValue: IdReaderFieldValue.optional(),
|
|
1944
|
-
methods:
|
|
1945
|
-
|
|
1899
|
+
methods: import_zod15.z.array(
|
|
1900
|
+
import_zod15.z.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
|
|
1946
1901
|
)
|
|
1947
1902
|
});
|
|
1948
1903
|
var LoaderField = BaseField.extend({
|
|
1949
|
-
type:
|
|
1950
|
-
configuration:
|
|
1904
|
+
type: import_zod15.z.literal(FieldType.LOADER),
|
|
1905
|
+
configuration: import_zod15.z.object({
|
|
1951
1906
|
text: TranslationConfig.describe("Display text above the loading spinner")
|
|
1952
1907
|
})
|
|
1953
1908
|
}).describe(
|
|
1954
1909
|
"A non-interactive field that indicates an in progress operation in form"
|
|
1955
1910
|
);
|
|
1956
|
-
var FieldConfig =
|
|
1911
|
+
var FieldConfig = import_zod15.z.discriminatedUnion("type", [
|
|
1957
1912
|
Address,
|
|
1958
1913
|
TextField,
|
|
1959
1914
|
NumberField,
|
|
@@ -1993,75 +1948,79 @@ var FieldConfig = z16.discriminatedUnion("type", [
|
|
|
1993
1948
|
QueryParamReaderField,
|
|
1994
1949
|
LoaderField,
|
|
1995
1950
|
SearchField
|
|
1996
|
-
]).
|
|
1951
|
+
]).openapi({
|
|
1997
1952
|
description: "Form field configuration",
|
|
1998
|
-
|
|
1953
|
+
ref: "FieldConfig"
|
|
1999
1954
|
});
|
|
2000
|
-
var AnyFileField =
|
|
1955
|
+
var AnyFileField = import_zod15.z.discriminatedUnion("type", [
|
|
2001
1956
|
SignatureField,
|
|
2002
1957
|
File,
|
|
2003
1958
|
FileUploadWithOptions
|
|
2004
1959
|
]);
|
|
2005
1960
|
|
|
2006
1961
|
// ../commons/src/events/FormConfig.ts
|
|
2007
|
-
var
|
|
1962
|
+
var import_zod17 = require("zod");
|
|
2008
1963
|
|
|
2009
1964
|
// ../commons/src/events/PageConfig.ts
|
|
2010
|
-
var
|
|
2011
|
-
var
|
|
2012
|
-
|
|
2013
|
-
|
|
1965
|
+
var import_zod16 = require("zod");
|
|
1966
|
+
var import_zod_openapi7 = require("zod-openapi");
|
|
1967
|
+
(0, import_zod_openapi7.extendZodWithOpenApi)(import_zod16.z);
|
|
1968
|
+
var PageTypes = import_zod16.z.enum(["FORM", "VERIFICATION"]);
|
|
1969
|
+
var PageConfigBase = import_zod16.z.object({
|
|
1970
|
+
id: import_zod16.z.string().describe("Unique identifier for the page"),
|
|
2014
1971
|
title: TranslationConfig.describe("Header title of the page"),
|
|
2015
|
-
fields:
|
|
1972
|
+
fields: import_zod16.z.array(FieldConfig).describe("Fields to be rendered on the page"),
|
|
2016
1973
|
conditional: Conditional.optional().describe(
|
|
2017
1974
|
"Page will be shown if condition is met. If conditional is not defined, the page will be always shown."
|
|
2018
1975
|
)
|
|
2019
|
-
}).
|
|
1976
|
+
}).openapi({
|
|
2020
1977
|
description: "Form page configuration",
|
|
2021
|
-
|
|
1978
|
+
ref: "FormPageConfig"
|
|
2022
1979
|
});
|
|
2023
1980
|
var FormPageConfig = PageConfigBase.extend({
|
|
2024
|
-
type:
|
|
1981
|
+
type: import_zod16.z.literal(PageTypes.enum.FORM).default(PageTypes.enum.FORM)
|
|
2025
1982
|
});
|
|
2026
|
-
var VerificationActionConfig =
|
|
2027
|
-
verify:
|
|
2028
|
-
cancel:
|
|
1983
|
+
var VerificationActionConfig = import_zod16.z.object({
|
|
1984
|
+
verify: import_zod16.z.object({ label: TranslationConfig }),
|
|
1985
|
+
cancel: import_zod16.z.object({
|
|
2029
1986
|
label: TranslationConfig,
|
|
2030
|
-
confirmation:
|
|
1987
|
+
confirmation: import_zod16.z.object({
|
|
2031
1988
|
title: TranslationConfig,
|
|
2032
1989
|
body: TranslationConfig
|
|
2033
1990
|
})
|
|
2034
1991
|
})
|
|
2035
|
-
}).describe("Actions available on the verification page").
|
|
1992
|
+
}).describe("Actions available on the verification page").openapi({
|
|
2036
1993
|
description: "Verification action configuration",
|
|
2037
|
-
|
|
1994
|
+
ref: "VerificationActionConfig"
|
|
2038
1995
|
});
|
|
2039
1996
|
var VerificationPageConfig = FormPageConfig.extend({
|
|
2040
|
-
type:
|
|
1997
|
+
type: import_zod16.z.literal(PageTypes.enum.VERIFICATION),
|
|
2041
1998
|
actions: VerificationActionConfig
|
|
2042
1999
|
});
|
|
2043
|
-
var PageConfig =
|
|
2000
|
+
var PageConfig = import_zod16.z.discriminatedUnion("type", [
|
|
2044
2001
|
FormPageConfig,
|
|
2045
2002
|
VerificationPageConfig
|
|
2046
2003
|
]);
|
|
2047
2004
|
|
|
2048
2005
|
// ../commons/src/events/FormConfig.ts
|
|
2049
|
-
var DeclarationFormConfig =
|
|
2006
|
+
var DeclarationFormConfig = import_zod17.z.object({
|
|
2050
2007
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2051
|
-
pages:
|
|
2008
|
+
pages: import_zod17.z.array(FormPageConfig)
|
|
2052
2009
|
}).describe("Configuration of the declaration form.");
|
|
2053
|
-
var ActionFormConfig =
|
|
2010
|
+
var ActionFormConfig = import_zod17.z.object({
|
|
2054
2011
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2055
|
-
pages:
|
|
2012
|
+
pages: import_zod17.z.array(PageConfig)
|
|
2056
2013
|
}).describe(
|
|
2057
2014
|
"Configuration of the form used for system actions beyond declaration, supporting a wider range of page types."
|
|
2058
2015
|
);
|
|
2059
|
-
var FormConfig =
|
|
2016
|
+
var FormConfig = import_zod17.z.union([DeclarationFormConfig, ActionFormConfig]);
|
|
2060
2017
|
|
|
2061
2018
|
// ../commons/src/events/DeduplicationConfig.ts
|
|
2062
|
-
var
|
|
2063
|
-
var
|
|
2064
|
-
|
|
2019
|
+
var import_zod18 = require("zod");
|
|
2020
|
+
var import_zod_openapi8 = require("zod-openapi");
|
|
2021
|
+
(0, import_zod_openapi8.extendZodWithOpenApi)(import_zod18.z);
|
|
2022
|
+
var FieldReference2 = import_zod18.z.string();
|
|
2023
|
+
var Matcher = import_zod18.z.object({
|
|
2065
2024
|
/**
|
|
2066
2025
|
* Reference to the field used in matching.
|
|
2067
2026
|
*
|
|
@@ -2069,68 +2028,68 @@ var Matcher = z19.object({
|
|
|
2069
2028
|
* be used as the origin date to calculate the distance from.
|
|
2070
2029
|
*/
|
|
2071
2030
|
fieldId: FieldReference2,
|
|
2072
|
-
options:
|
|
2073
|
-
boost:
|
|
2031
|
+
options: import_zod18.z.object({
|
|
2032
|
+
boost: import_zod18.z.number().optional()
|
|
2074
2033
|
}).optional().default({
|
|
2075
2034
|
boost: 1
|
|
2076
2035
|
})
|
|
2077
2036
|
});
|
|
2078
2037
|
var FuzzyMatcher = Matcher.extend({
|
|
2079
|
-
type:
|
|
2080
|
-
options:
|
|
2038
|
+
type: import_zod18.z.literal("fuzzy"),
|
|
2039
|
+
options: import_zod18.z.object({
|
|
2081
2040
|
/**
|
|
2082
2041
|
* Names of length 3 or less characters = 0 edits allowed
|
|
2083
2042
|
* Names of length 4 - 6 characters = 1 edit allowed
|
|
2084
2043
|
* Names of length >7 characters = 2 edits allowed
|
|
2085
2044
|
*/
|
|
2086
|
-
fuzziness:
|
|
2087
|
-
boost:
|
|
2045
|
+
fuzziness: import_zod18.z.union([import_zod18.z.string(), import_zod18.z.number()]).optional().default("AUTO:4,7"),
|
|
2046
|
+
boost: import_zod18.z.number().optional().default(1)
|
|
2088
2047
|
}).optional().default({
|
|
2089
2048
|
fuzziness: "AUTO:4,7",
|
|
2090
2049
|
boost: 1
|
|
2091
2050
|
})
|
|
2092
2051
|
});
|
|
2093
2052
|
var StrictMatcher = Matcher.extend({
|
|
2094
|
-
type:
|
|
2095
|
-
options:
|
|
2096
|
-
boost:
|
|
2053
|
+
type: import_zod18.z.literal("strict"),
|
|
2054
|
+
options: import_zod18.z.object({
|
|
2055
|
+
boost: import_zod18.z.number().optional().default(1),
|
|
2097
2056
|
/**
|
|
2098
2057
|
* The constant value to be present in the field for both records
|
|
2099
2058
|
*/
|
|
2100
|
-
value:
|
|
2059
|
+
value: import_zod18.z.string().optional()
|
|
2101
2060
|
}).optional().default({
|
|
2102
2061
|
boost: 1
|
|
2103
2062
|
})
|
|
2104
2063
|
});
|
|
2105
2064
|
var DateRangeMatcher = Matcher.extend({
|
|
2106
|
-
type:
|
|
2107
|
-
options:
|
|
2065
|
+
type: import_zod18.z.literal("dateRange"),
|
|
2066
|
+
options: import_zod18.z.object({
|
|
2108
2067
|
/**
|
|
2109
2068
|
* The distance pivot in days. Distance from the origin (the value of
|
|
2110
2069
|
* fieldId) at which relevance scores receive half of the boost value
|
|
2111
2070
|
*/
|
|
2112
|
-
pivot:
|
|
2113
|
-
days:
|
|
2114
|
-
boost:
|
|
2071
|
+
pivot: import_zod18.z.number().optional(),
|
|
2072
|
+
days: import_zod18.z.number(),
|
|
2073
|
+
boost: import_zod18.z.number().optional().default(1)
|
|
2115
2074
|
})
|
|
2116
2075
|
});
|
|
2117
|
-
var Not =
|
|
2118
|
-
type:
|
|
2076
|
+
var Not = import_zod18.z.object({
|
|
2077
|
+
type: import_zod18.z.literal("not"),
|
|
2119
2078
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2120
|
-
clause:
|
|
2079
|
+
clause: import_zod18.z.lazy(() => Clause)
|
|
2121
2080
|
});
|
|
2122
|
-
var And =
|
|
2123
|
-
type:
|
|
2081
|
+
var And = import_zod18.z.object({
|
|
2082
|
+
type: import_zod18.z.literal("and"),
|
|
2124
2083
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2125
|
-
clauses:
|
|
2084
|
+
clauses: import_zod18.z.lazy(() => Clause.array())
|
|
2126
2085
|
});
|
|
2127
|
-
var Or =
|
|
2128
|
-
type:
|
|
2086
|
+
var Or = import_zod18.z.object({
|
|
2087
|
+
type: import_zod18.z.literal("or"),
|
|
2129
2088
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2130
|
-
clauses:
|
|
2089
|
+
clauses: import_zod18.z.lazy(() => Clause.array())
|
|
2131
2090
|
});
|
|
2132
|
-
var Clause =
|
|
2133
|
-
() =>
|
|
2091
|
+
var Clause = import_zod18.z.lazy(
|
|
2092
|
+
() => import_zod18.z.discriminatedUnion("type", [
|
|
2134
2093
|
Not,
|
|
2135
2094
|
And,
|
|
2136
2095
|
Or,
|
|
@@ -2138,192 +2097,193 @@ var Clause = z19.lazy(
|
|
|
2138
2097
|
StrictMatcher,
|
|
2139
2098
|
DateRangeMatcher
|
|
2140
2099
|
])
|
|
2141
|
-
).
|
|
2142
|
-
|
|
2100
|
+
).openapi({
|
|
2101
|
+
ref: "Clause"
|
|
2143
2102
|
});
|
|
2144
|
-
var DeduplicationConfig =
|
|
2145
|
-
id:
|
|
2103
|
+
var DeduplicationConfig = import_zod18.z.object({
|
|
2104
|
+
id: import_zod18.z.string(),
|
|
2146
2105
|
label: TranslationConfig,
|
|
2147
2106
|
query: Clause
|
|
2148
2107
|
});
|
|
2149
2108
|
|
|
2150
2109
|
// ../commons/src/events/ActionConfig.ts
|
|
2151
|
-
var
|
|
2110
|
+
var import_zod_openapi9 = require("zod-openapi");
|
|
2111
|
+
(0, import_zod_openapi9.extendZodWithOpenApi)(import_zod19.z);
|
|
2112
|
+
var DeclarationReviewConfig = import_zod19.z.object({
|
|
2152
2113
|
title: TranslationConfig.describe("Title of the review page"),
|
|
2153
|
-
fields:
|
|
2114
|
+
fields: import_zod19.z.array(FieldConfig).describe("Fields displayed on the review page for annotations.")
|
|
2154
2115
|
}).describe(
|
|
2155
2116
|
"Configuration of the declaration review page for collecting event-related metadata."
|
|
2156
2117
|
);
|
|
2157
|
-
var ActionConfigBase =
|
|
2158
|
-
label: TranslationConfig.describe("Human readable description of the action")
|
|
2159
|
-
flags: z20.array(ActionFlagConfig).optional().default([]).describe("Flag actions which are executed when the action is performed."),
|
|
2160
|
-
auditHistoryLabel: TranslationConfig.describe(
|
|
2161
|
-
'The label to show in audit history for this action. For example "Approved".'
|
|
2162
|
-
).optional(),
|
|
2163
|
-
supportingCopy: TranslationConfig.optional().describe(
|
|
2164
|
-
"Text displayed on the confirmation"
|
|
2165
|
-
),
|
|
2166
|
-
conditionals: z20.array(ActionConditional).optional().describe("Conditionals which can disable or hide actions.")
|
|
2118
|
+
var ActionConfigBase = import_zod19.z.object({
|
|
2119
|
+
label: TranslationConfig.describe("Human readable description of the action")
|
|
2167
2120
|
});
|
|
2168
2121
|
var DeclarationActionBase = ActionConfigBase.extend({
|
|
2122
|
+
review: DeclarationReviewConfig,
|
|
2169
2123
|
deduplication: DeduplicationConfig.optional()
|
|
2170
2124
|
});
|
|
2171
|
-
var ReadActionConfig = ActionConfigBase.
|
|
2172
|
-
|
|
2173
|
-
type:
|
|
2125
|
+
var ReadActionConfig = ActionConfigBase.merge(
|
|
2126
|
+
import_zod19.z.object({
|
|
2127
|
+
type: import_zod19.z.literal(ActionType.READ),
|
|
2174
2128
|
review: DeclarationReviewConfig.describe(
|
|
2175
2129
|
"Configuration of the review page for read-only view."
|
|
2176
|
-
),
|
|
2177
|
-
conditionals: z20.never().optional().describe("Read-action can not be disabled or hidden with conditionals.")
|
|
2178
|
-
}).shape
|
|
2179
|
-
);
|
|
2180
|
-
var DeclareConfig = DeclarationActionBase.extend(
|
|
2181
|
-
z20.object({
|
|
2182
|
-
type: z20.literal(ActionType.DECLARE),
|
|
2183
|
-
review: DeclarationReviewConfig.describe(
|
|
2184
|
-
"Configuration of the review page fields."
|
|
2185
2130
|
)
|
|
2186
|
-
})
|
|
2131
|
+
})
|
|
2132
|
+
);
|
|
2133
|
+
var DeclareConfig = DeclarationActionBase.merge(
|
|
2134
|
+
import_zod19.z.object({
|
|
2135
|
+
type: import_zod19.z.literal(ActionType.DECLARE)
|
|
2136
|
+
})
|
|
2187
2137
|
);
|
|
2188
|
-
var
|
|
2189
|
-
|
|
2190
|
-
type:
|
|
2191
|
-
})
|
|
2138
|
+
var ValidateConfig = DeclarationActionBase.merge(
|
|
2139
|
+
import_zod19.z.object({
|
|
2140
|
+
type: import_zod19.z.literal(ActionType.VALIDATE)
|
|
2141
|
+
})
|
|
2192
2142
|
);
|
|
2193
|
-
var
|
|
2194
|
-
|
|
2195
|
-
type:
|
|
2196
|
-
})
|
|
2143
|
+
var RegisterConfig = DeclarationActionBase.merge(
|
|
2144
|
+
import_zod19.z.object({
|
|
2145
|
+
type: import_zod19.z.literal(ActionType.REGISTER)
|
|
2146
|
+
})
|
|
2197
2147
|
);
|
|
2198
|
-
var
|
|
2199
|
-
|
|
2200
|
-
type:
|
|
2201
|
-
})
|
|
2148
|
+
var RejectDeclarationConfig = ActionConfigBase.merge(
|
|
2149
|
+
import_zod19.z.object({
|
|
2150
|
+
type: import_zod19.z.literal(ActionType.REJECT)
|
|
2151
|
+
})
|
|
2152
|
+
);
|
|
2153
|
+
var ArchiveConfig = ActionConfigBase.merge(
|
|
2154
|
+
import_zod19.z.object({
|
|
2155
|
+
type: import_zod19.z.literal(ActionType.ARCHIVE)
|
|
2156
|
+
})
|
|
2202
2157
|
);
|
|
2203
|
-
var
|
|
2204
|
-
|
|
2205
|
-
type:
|
|
2158
|
+
var DeleteConfig = ActionConfigBase.merge(
|
|
2159
|
+
import_zod19.z.object({
|
|
2160
|
+
type: import_zod19.z.literal(ActionType.DELETE)
|
|
2161
|
+
})
|
|
2162
|
+
);
|
|
2163
|
+
var PrintCertificateActionConfig = ActionConfigBase.merge(
|
|
2164
|
+
import_zod19.z.object({
|
|
2165
|
+
type: import_zod19.z.literal(ActionType.PRINT_CERTIFICATE),
|
|
2206
2166
|
printForm: ActionFormConfig
|
|
2207
|
-
})
|
|
2167
|
+
})
|
|
2208
2168
|
);
|
|
2209
|
-
var RequestCorrectionConfig = ActionConfigBase.
|
|
2210
|
-
|
|
2211
|
-
type:
|
|
2169
|
+
var RequestCorrectionConfig = ActionConfigBase.merge(
|
|
2170
|
+
import_zod19.z.object({
|
|
2171
|
+
type: import_zod19.z.literal(ActionType.REQUEST_CORRECTION),
|
|
2212
2172
|
correctionForm: ActionFormConfig
|
|
2213
|
-
})
|
|
2173
|
+
})
|
|
2214
2174
|
);
|
|
2215
|
-
var
|
|
2216
|
-
|
|
2217
|
-
type:
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
)
|
|
2175
|
+
var RejectCorrectionConfig = ActionConfigBase.merge(
|
|
2176
|
+
import_zod19.z.object({
|
|
2177
|
+
type: import_zod19.z.literal(ActionType.REJECT_CORRECTION)
|
|
2178
|
+
})
|
|
2179
|
+
);
|
|
2180
|
+
var ApproveCorrectionConfig = ActionConfigBase.merge(
|
|
2181
|
+
import_zod19.z.object({
|
|
2182
|
+
type: import_zod19.z.literal(ActionType.APPROVE_CORRECTION)
|
|
2223
2183
|
})
|
|
2224
2184
|
);
|
|
2225
|
-
var ActionConfig =
|
|
2185
|
+
var ActionConfig = import_zod19.z.discriminatedUnion("type", [
|
|
2226
2186
|
/*
|
|
2227
2187
|
* OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
|
|
2228
2188
|
* and treat them as "models" instead of duplicating the data structure in each endpoint.
|
|
2229
2189
|
*/
|
|
2230
|
-
ReadActionConfig.
|
|
2231
|
-
DeclareConfig.
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2190
|
+
ReadActionConfig.openapi({ ref: "ReadActionConfig" }),
|
|
2191
|
+
DeclareConfig.openapi({ ref: "DeclareActionConfig" }),
|
|
2192
|
+
ValidateConfig.openapi({ ref: "ValidateActionConfig" }),
|
|
2193
|
+
RejectDeclarationConfig.openapi({ ref: "RejectDeclarationActionConfig" }),
|
|
2194
|
+
ArchiveConfig.openapi({ ref: "ArchiveActionConfig" }),
|
|
2195
|
+
RegisterConfig.openapi({ ref: "RegisterActionConfig" }),
|
|
2196
|
+
DeleteConfig.openapi({ ref: "DeleteActionConfig" }),
|
|
2197
|
+
PrintCertificateActionConfig.openapi({
|
|
2198
|
+
ref: "PrintCertificateActionConfig"
|
|
2237
2199
|
}),
|
|
2238
|
-
RequestCorrectionConfig.
|
|
2239
|
-
|
|
2200
|
+
RequestCorrectionConfig.openapi({ ref: "RequestCorrectionActionConfig" }),
|
|
2201
|
+
RejectCorrectionConfig.openapi({ ref: "RejectCorrectionActionConfig" }),
|
|
2202
|
+
ApproveCorrectionConfig.openapi({ ref: "ApproveCorrectionActionConfig" })
|
|
2240
2203
|
]).describe(
|
|
2241
2204
|
"Configuration of an action available for an event. Data collected depends on the action type and is accessible through the annotation property in ActionDocument."
|
|
2242
|
-
).
|
|
2243
|
-
var
|
|
2244
|
-
ActionConfig.options.map((opt) => opt.shape.type.value)
|
|
2245
|
-
);
|
|
2246
|
-
var DeclarationActionConfig = z20.discriminatedUnion("type", [
|
|
2205
|
+
).openapi({ ref: "ActionConfig" });
|
|
2206
|
+
var DeclarationActionConfig = import_zod19.z.discriminatedUnion("type", [
|
|
2247
2207
|
DeclareConfig,
|
|
2248
2208
|
ValidateConfig,
|
|
2249
2209
|
RegisterConfig
|
|
2250
2210
|
]);
|
|
2251
2211
|
|
|
2252
2212
|
// ../commons/src/events/offline/CertificateConfig.ts
|
|
2253
|
-
var
|
|
2254
|
-
var FontFamily =
|
|
2255
|
-
normal:
|
|
2256
|
-
bold:
|
|
2257
|
-
italics:
|
|
2258
|
-
bolditalics:
|
|
2213
|
+
var import_zod20 = require("zod");
|
|
2214
|
+
var FontFamily = import_zod20.z.object({
|
|
2215
|
+
normal: import_zod20.z.string(),
|
|
2216
|
+
bold: import_zod20.z.string(),
|
|
2217
|
+
italics: import_zod20.z.string(),
|
|
2218
|
+
bolditalics: import_zod20.z.string()
|
|
2259
2219
|
});
|
|
2260
|
-
var CertificateConfig =
|
|
2261
|
-
id:
|
|
2262
|
-
event:
|
|
2263
|
-
isV2Template:
|
|
2220
|
+
var CertificateConfig = import_zod20.z.object({
|
|
2221
|
+
id: import_zod20.z.string(),
|
|
2222
|
+
event: import_zod20.z.string(),
|
|
2223
|
+
isV2Template: import_zod20.z.boolean().optional(),
|
|
2264
2224
|
label: TranslationConfig,
|
|
2265
|
-
isDefault:
|
|
2266
|
-
fee:
|
|
2267
|
-
onTime:
|
|
2268
|
-
late:
|
|
2269
|
-
delayed:
|
|
2225
|
+
isDefault: import_zod20.z.boolean(),
|
|
2226
|
+
fee: import_zod20.z.object({
|
|
2227
|
+
onTime: import_zod20.z.number(),
|
|
2228
|
+
late: import_zod20.z.number(),
|
|
2229
|
+
delayed: import_zod20.z.number()
|
|
2270
2230
|
}),
|
|
2271
|
-
svgUrl:
|
|
2272
|
-
fonts:
|
|
2273
|
-
conditionals:
|
|
2231
|
+
svgUrl: import_zod20.z.string(),
|
|
2232
|
+
fonts: import_zod20.z.record(FontFamily).optional(),
|
|
2233
|
+
conditionals: import_zod20.z.array(ShowConditional).optional()
|
|
2274
2234
|
});
|
|
2275
2235
|
var CertificateTemplateConfig = CertificateConfig.extend({
|
|
2276
|
-
hash:
|
|
2277
|
-
svg:
|
|
2236
|
+
hash: import_zod20.z.string().optional(),
|
|
2237
|
+
svg: import_zod20.z.string()
|
|
2278
2238
|
});
|
|
2279
2239
|
|
|
2280
2240
|
// ../commons/src/events/offline/LanguageConfig.ts
|
|
2281
|
-
var
|
|
2282
|
-
var LanguageConfig =
|
|
2283
|
-
lang:
|
|
2241
|
+
var import_zod21 = require("zod");
|
|
2242
|
+
var LanguageConfig = import_zod21.z.object({
|
|
2243
|
+
lang: import_zod21.z.string(),
|
|
2284
2244
|
/**
|
|
2285
2245
|
* client.csv contents
|
|
2286
2246
|
*/
|
|
2287
|
-
messages:
|
|
2247
|
+
messages: import_zod21.z.record(import_zod21.z.string())
|
|
2288
2248
|
});
|
|
2289
2249
|
|
|
2290
2250
|
// ../commons/src/events/EventConfig.ts
|
|
2291
|
-
var
|
|
2251
|
+
var import_zod26 = require("zod");
|
|
2292
2252
|
|
|
2293
2253
|
// ../commons/src/events/SummaryConfig.ts
|
|
2294
|
-
var
|
|
2295
|
-
var BaseField2 =
|
|
2254
|
+
var import_zod22 = require("zod");
|
|
2255
|
+
var BaseField2 = import_zod22.z.object({
|
|
2296
2256
|
emptyValueMessage: TranslationConfig.optional().describe(
|
|
2297
2257
|
"Default message displayed when the field value is empty."
|
|
2298
2258
|
),
|
|
2299
|
-
conditionals:
|
|
2259
|
+
conditionals: import_zod22.z.array(ShowConditional).default([]).optional()
|
|
2300
2260
|
});
|
|
2301
2261
|
var ReferenceField = BaseField2.extend({
|
|
2302
|
-
fieldId:
|
|
2262
|
+
fieldId: import_zod22.z.string(),
|
|
2303
2263
|
label: TranslationConfig.optional().describe(
|
|
2304
2264
|
"Overrides the default label from the referenced field when provided."
|
|
2305
2265
|
)
|
|
2306
2266
|
}).describe("Field referencing existing event data by field ID.");
|
|
2307
2267
|
var Field = BaseField2.extend({
|
|
2308
|
-
id:
|
|
2268
|
+
id: import_zod22.z.string().describe("Identifier of the summary field."),
|
|
2309
2269
|
value: TranslationConfig.describe(
|
|
2310
2270
|
'Field value template supporting variables from configuration and EventMetadata (e.g. "{informant.phoneNo} {informant.email}").'
|
|
2311
2271
|
),
|
|
2312
2272
|
label: TranslationConfig
|
|
2313
2273
|
}).describe("Custom field defined for the summary view.");
|
|
2314
|
-
var SummaryConfig =
|
|
2315
|
-
fields:
|
|
2274
|
+
var SummaryConfig = import_zod22.z.object({
|
|
2275
|
+
fields: import_zod22.z.array(import_zod22.z.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
|
|
2316
2276
|
}).describe("Configuration of the event summary section.");
|
|
2317
2277
|
|
|
2318
2278
|
// ../commons/src/events/AdvancedSearchConfig.ts
|
|
2319
|
-
var
|
|
2320
|
-
var MatchType =
|
|
2321
|
-
var BaseField3 =
|
|
2322
|
-
config:
|
|
2279
|
+
var import_zod23 = require("zod");
|
|
2280
|
+
var MatchType = import_zod23.z.enum(["fuzzy", "exact", "range", "within"]);
|
|
2281
|
+
var BaseField3 = import_zod23.z.object({
|
|
2282
|
+
config: import_zod23.z.object({
|
|
2323
2283
|
type: MatchType.describe(
|
|
2324
2284
|
"Determines the search type of field. How to match value."
|
|
2325
2285
|
),
|
|
2326
|
-
searchFields:
|
|
2286
|
+
searchFields: import_zod23.z.array(import_zod23.z.string()).optional().describe(
|
|
2327
2287
|
`
|
|
2328
2288
|
Defines multiple form fields that should be searched when this field has a value.
|
|
2329
2289
|
All specified fields will be combined using OR logic.
|
|
@@ -2333,7 +2293,7 @@ var BaseField3 = z24.object({
|
|
|
2333
2293
|
`
|
|
2334
2294
|
)
|
|
2335
2295
|
}),
|
|
2336
|
-
type:
|
|
2296
|
+
type: import_zod23.z.nativeEnum(FieldType).optional().describe(
|
|
2337
2297
|
`
|
|
2338
2298
|
Explicitly specify the field type for searchFields.
|
|
2339
2299
|
This is required when searchFields is defined, to show the correct control in the UI.
|
|
@@ -2347,7 +2307,7 @@ var BaseField3 = z24.object({
|
|
|
2347
2307
|
This is required when searchFields is defined.
|
|
2348
2308
|
`
|
|
2349
2309
|
),
|
|
2350
|
-
options:
|
|
2310
|
+
options: import_zod23.z.array(SelectOption).optional(),
|
|
2351
2311
|
searchCriteriaLabelPrefix: TranslationConfig.optional().describe(
|
|
2352
2312
|
`
|
|
2353
2313
|
This property determines whether to add a prefix (such as "Child" or "Applicant") before the field label
|
|
@@ -2368,7 +2328,7 @@ var BaseField3 = z24.object({
|
|
|
2368
2328
|
in the country-config > event.advancedSearch configuration. For example: field("child.dob", { searchCriteriaLabelPrefix: TranslationConfig }).
|
|
2369
2329
|
`
|
|
2370
2330
|
),
|
|
2371
|
-
conditionals:
|
|
2331
|
+
conditionals: import_zod23.z.array(FieldConditional).default([]).optional().describe(
|
|
2372
2332
|
`
|
|
2373
2333
|
In advanced search, we sometimes need to override the default field visibility conditionals.
|
|
2374
2334
|
|
|
@@ -2382,20 +2342,20 @@ var BaseField3 = z24.object({
|
|
|
2382
2342
|
are always rendered in the advanced search form.
|
|
2383
2343
|
`
|
|
2384
2344
|
),
|
|
2385
|
-
validations:
|
|
2345
|
+
validations: import_zod23.z.array(ValidationConfig).default([]).optional().describe(
|
|
2386
2346
|
`Option for overriding the field validations specifically for advanced search form.`
|
|
2387
2347
|
)
|
|
2388
2348
|
});
|
|
2389
|
-
var SearchQueryParams =
|
|
2390
|
-
eventType:
|
|
2349
|
+
var SearchQueryParams = import_zod23.z.object({
|
|
2350
|
+
eventType: import_zod23.z.string().optional().describe(
|
|
2391
2351
|
"Defines type of event so that when redirecting to Advanced Search page, appropriate tab can be selected"
|
|
2392
2352
|
)
|
|
2393
2353
|
}).catchall(FieldValue);
|
|
2394
2354
|
var FieldConfigSchema = BaseField3.extend({
|
|
2395
|
-
fieldId:
|
|
2396
|
-
fieldType:
|
|
2355
|
+
fieldId: import_zod23.z.string(),
|
|
2356
|
+
fieldType: import_zod23.z.literal("field")
|
|
2397
2357
|
});
|
|
2398
|
-
var EventFieldIdInput =
|
|
2358
|
+
var EventFieldIdInput = import_zod23.z.enum([
|
|
2399
2359
|
"trackingId",
|
|
2400
2360
|
"status",
|
|
2401
2361
|
"legalStatuses.REGISTERED.acceptedAt",
|
|
@@ -2403,7 +2363,7 @@ var EventFieldIdInput = z24.enum([
|
|
|
2403
2363
|
"updatedAt"
|
|
2404
2364
|
]);
|
|
2405
2365
|
var METADATA_FIELD_PREFIX = "event.";
|
|
2406
|
-
var EventFieldId =
|
|
2366
|
+
var EventFieldId = import_zod23.z.enum([
|
|
2407
2367
|
`${METADATA_FIELD_PREFIX}trackingId`,
|
|
2408
2368
|
`${METADATA_FIELD_PREFIX}status`,
|
|
2409
2369
|
`${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.acceptedAt`,
|
|
@@ -2412,29 +2372,29 @@ var EventFieldId = z24.enum([
|
|
|
2412
2372
|
]);
|
|
2413
2373
|
var EventFieldConfigSchema = BaseField3.extend({
|
|
2414
2374
|
fieldId: EventFieldId,
|
|
2415
|
-
fieldType:
|
|
2375
|
+
fieldType: import_zod23.z.literal("event")
|
|
2416
2376
|
});
|
|
2417
|
-
var AdvancedSearchField =
|
|
2377
|
+
var AdvancedSearchField = import_zod23.z.discriminatedUnion("fieldType", [FieldConfigSchema, EventFieldConfigSchema]).superRefine((data, ctx) => {
|
|
2418
2378
|
if (data.config.searchFields && data.config.searchFields.length > 0) {
|
|
2419
2379
|
if (!data.label) {
|
|
2420
2380
|
ctx.addIssue({
|
|
2421
|
-
code:
|
|
2381
|
+
code: import_zod23.z.ZodIssueCode.custom,
|
|
2422
2382
|
message: "label is required when config.searchFields is defined.",
|
|
2423
2383
|
path: ["label"]
|
|
2424
2384
|
});
|
|
2425
2385
|
}
|
|
2426
2386
|
if (!data.type) {
|
|
2427
2387
|
ctx.addIssue({
|
|
2428
|
-
code:
|
|
2388
|
+
code: import_zod23.z.ZodIssueCode.custom,
|
|
2429
2389
|
message: "type is required when config.searchFields is defined.",
|
|
2430
2390
|
path: ["type"]
|
|
2431
2391
|
});
|
|
2432
2392
|
}
|
|
2433
2393
|
}
|
|
2434
2394
|
});
|
|
2435
|
-
var AdvancedSearchConfig =
|
|
2395
|
+
var AdvancedSearchConfig = import_zod23.z.object({
|
|
2436
2396
|
title: TranslationConfig.describe("Advanced search tab title"),
|
|
2437
|
-
fields:
|
|
2397
|
+
fields: import_zod23.z.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
|
|
2438
2398
|
});
|
|
2439
2399
|
|
|
2440
2400
|
// ../commons/src/events/utils.ts
|
|
@@ -2443,11 +2403,11 @@ var import_lodash = require("lodash");
|
|
|
2443
2403
|
// ../commons/src/conditionals/validate.ts
|
|
2444
2404
|
var import__ = __toESM(require("ajv/dist/2019"));
|
|
2445
2405
|
var import_ajv_formats = __toESM(require("ajv-formats"));
|
|
2446
|
-
var
|
|
2406
|
+
var import_zod25 = require("zod");
|
|
2447
2407
|
var import_date_fns = require("date-fns");
|
|
2448
2408
|
|
|
2449
2409
|
// ../commons/src/events/DynamicFieldValue.ts
|
|
2450
|
-
var
|
|
2410
|
+
var import_zod24 = require("zod");
|
|
2451
2411
|
|
|
2452
2412
|
// ../commons/src/conditionals/validate.ts
|
|
2453
2413
|
var ajv = new import__.default({
|
|
@@ -2456,9 +2416,9 @@ var ajv = new import__.default({
|
|
|
2456
2416
|
strict: false
|
|
2457
2417
|
// Allow minContains and other newer features
|
|
2458
2418
|
});
|
|
2459
|
-
var DataContext =
|
|
2460
|
-
rootData:
|
|
2461
|
-
$leafAdminStructureLocationIds:
|
|
2419
|
+
var DataContext = import_zod25.z.object({
|
|
2420
|
+
rootData: import_zod25.z.object({
|
|
2421
|
+
$leafAdminStructureLocationIds: import_zod25.z.array(import_zod25.z.object({ id: UUID }))
|
|
2462
2422
|
})
|
|
2463
2423
|
});
|
|
2464
2424
|
(0, import_ajv_formats.default)(ajv);
|
|
@@ -2500,12 +2460,12 @@ ajv.addKeyword({
|
|
|
2500
2460
|
});
|
|
2501
2461
|
|
|
2502
2462
|
// ../commons/src/utils.ts
|
|
2503
|
-
var
|
|
2504
|
-
var FullNameV1 =
|
|
2505
|
-
|
|
2506
|
-
use:
|
|
2507
|
-
family:
|
|
2508
|
-
given:
|
|
2463
|
+
var z26 = __toESM(require("zod"));
|
|
2464
|
+
var FullNameV1 = z26.array(
|
|
2465
|
+
z26.object({
|
|
2466
|
+
use: z26.string(),
|
|
2467
|
+
family: z26.string(),
|
|
2468
|
+
given: z26.array(z26.string())
|
|
2509
2469
|
})
|
|
2510
2470
|
);
|
|
2511
2471
|
function omitKeyDeep(obj, keyToRemove) {
|
|
@@ -2526,6 +2486,9 @@ function omitKeyDeep(obj, keyToRemove) {
|
|
|
2526
2486
|
|
|
2527
2487
|
// ../commons/src/events/utils.ts
|
|
2528
2488
|
var import_date_fns2 = require("date-fns");
|
|
2489
|
+
function isDeclarationActionConfig(action) {
|
|
2490
|
+
return DeclarationActions.safeParse(action.type).success;
|
|
2491
|
+
}
|
|
2529
2492
|
function getDeclarationFields(configuration) {
|
|
2530
2493
|
return configuration.declaration.pages.flatMap(({ fields }) => fields);
|
|
2531
2494
|
}
|
|
@@ -2536,7 +2499,7 @@ var getActionAnnotationFields = (actionConfig) => {
|
|
|
2536
2499
|
if (actionConfig.type === ActionType.PRINT_CERTIFICATE) {
|
|
2537
2500
|
return actionConfig.printForm.pages.flatMap(({ fields }) => fields);
|
|
2538
2501
|
}
|
|
2539
|
-
if (
|
|
2502
|
+
if (isDeclarationActionConfig(actionConfig)) {
|
|
2540
2503
|
return actionConfig.review.fields;
|
|
2541
2504
|
}
|
|
2542
2505
|
return [];
|
|
@@ -2557,8 +2520,10 @@ var EXCLUDED_ACTIONS = [
|
|
|
2557
2520
|
];
|
|
2558
2521
|
|
|
2559
2522
|
// ../commons/src/events/EventConfig.ts
|
|
2560
|
-
var
|
|
2561
|
-
|
|
2523
|
+
var import_zod_openapi10 = require("zod-openapi");
|
|
2524
|
+
(0, import_zod_openapi10.extendZodWithOpenApi)(import_zod26.z);
|
|
2525
|
+
var EventConfig = import_zod26.z.object({
|
|
2526
|
+
id: import_zod26.z.string().describe(
|
|
2562
2527
|
'Machine-readable identifier of the event (e.g. "birth", "death").'
|
|
2563
2528
|
),
|
|
2564
2529
|
dateOfEvent: FieldReference.optional().describe(
|
|
@@ -2576,17 +2541,14 @@ var EventConfig = z28.object({
|
|
|
2576
2541
|
label: TranslationConfig.describe(
|
|
2577
2542
|
"Human-readable label for the event type."
|
|
2578
2543
|
),
|
|
2579
|
-
actions:
|
|
2544
|
+
actions: import_zod26.z.array(ActionConfig).describe(
|
|
2580
2545
|
"Configuration of system-defined actions associated with the event."
|
|
2581
2546
|
),
|
|
2582
2547
|
declaration: DeclarationFormConfig.describe(
|
|
2583
2548
|
"Configuration of the form used to gather event data."
|
|
2584
2549
|
),
|
|
2585
|
-
advancedSearch:
|
|
2550
|
+
advancedSearch: import_zod26.z.array(AdvancedSearchConfig).optional().default([]).describe(
|
|
2586
2551
|
"Configuration of fields available in the advanced search feature."
|
|
2587
|
-
),
|
|
2588
|
-
flags: z28.array(FlagConfig).optional().default([]).describe(
|
|
2589
|
-
"Configuration of flags associated with the actions of this event type."
|
|
2590
2552
|
)
|
|
2591
2553
|
}).superRefine((event2, ctx) => {
|
|
2592
2554
|
const allFields = findAllFields(event2);
|
|
@@ -2638,21 +2600,8 @@ var EventConfig = z28.object({
|
|
|
2638
2600
|
});
|
|
2639
2601
|
}
|
|
2640
2602
|
}
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
(action) => action.flags.map((flag2) => flag2.id)
|
|
2644
|
-
);
|
|
2645
|
-
for (const actionFlagId of actionFlagIds) {
|
|
2646
|
-
if (!configuredFlagIds.includes(actionFlagId)) {
|
|
2647
|
-
ctx.addIssue({
|
|
2648
|
-
code: "custom",
|
|
2649
|
-
message: `Action flag id must match a configured flag in the flags array. Invalid action flag ID for event '${event2.id}': '${actionFlagId}'`,
|
|
2650
|
-
path: ["actions"]
|
|
2651
|
-
});
|
|
2652
|
-
}
|
|
2653
|
-
}
|
|
2654
|
-
}).meta({
|
|
2655
|
-
id: "EventConfig"
|
|
2603
|
+
}).openapi({
|
|
2604
|
+
ref: "EventConfig"
|
|
2656
2605
|
}).describe("Configuration defining an event type.");
|
|
2657
2606
|
|
|
2658
2607
|
// ../commons/src/events/EventConfigInput.ts
|
|
@@ -2661,7 +2610,7 @@ var defineActionForm = (actionForm) => ActionFormConfig.parse(actionForm);
|
|
|
2661
2610
|
var defineFormPage = (formPage) => FormPageConfig.parse(formPage);
|
|
2662
2611
|
|
|
2663
2612
|
// ../commons/src/events/WorkqueueConfig.ts
|
|
2664
|
-
var
|
|
2613
|
+
var import_zod30 = require("zod");
|
|
2665
2614
|
|
|
2666
2615
|
// ../commons/src/conditionals/conditionals.ts
|
|
2667
2616
|
var objectHash = __toESM(require("object-hash"));
|
|
@@ -2699,7 +2648,7 @@ function not(condition) {
|
|
|
2699
2648
|
required: []
|
|
2700
2649
|
});
|
|
2701
2650
|
}
|
|
2702
|
-
function
|
|
2651
|
+
function never() {
|
|
2703
2652
|
return not(alwaysTrue());
|
|
2704
2653
|
}
|
|
2705
2654
|
function jsonFieldPath(field3) {
|
|
@@ -2841,21 +2790,6 @@ function defineComparison(field3, value, keyword) {
|
|
|
2841
2790
|
required: [field3.$$field]
|
|
2842
2791
|
});
|
|
2843
2792
|
}
|
|
2844
|
-
function flag(flagvalue) {
|
|
2845
|
-
return defineConditional({
|
|
2846
|
-
type: "object",
|
|
2847
|
-
properties: {
|
|
2848
|
-
$flags: {
|
|
2849
|
-
type: "array",
|
|
2850
|
-
contains: {
|
|
2851
|
-
type: "string",
|
|
2852
|
-
const: flagvalue
|
|
2853
|
-
}
|
|
2854
|
-
}
|
|
2855
|
-
},
|
|
2856
|
-
required: ["$flags"]
|
|
2857
|
-
});
|
|
2858
|
-
}
|
|
2859
2793
|
function createFieldConditionals(fieldId) {
|
|
2860
2794
|
const getDayRange = (field3, days, clause) => ({
|
|
2861
2795
|
type: "object",
|
|
@@ -3363,17 +3297,17 @@ var event = Object.assign(eventFn, {
|
|
|
3363
3297
|
});
|
|
3364
3298
|
|
|
3365
3299
|
// ../commons/src/events/WorkqueueColumnConfig.ts
|
|
3366
|
-
var
|
|
3300
|
+
var import_zod27 = require("zod");
|
|
3367
3301
|
var WorkqueueColumnKeysArray = [
|
|
3368
3302
|
...EventMetadataKeysArray,
|
|
3369
3303
|
"title",
|
|
3370
3304
|
"outbox"
|
|
3371
3305
|
];
|
|
3372
|
-
var WorkqueueColumnKeys =
|
|
3373
|
-
var WorkqueueColumnValue =
|
|
3306
|
+
var WorkqueueColumnKeys = import_zod27.z.enum(WorkqueueColumnKeysArray);
|
|
3307
|
+
var WorkqueueColumnValue = import_zod27.z.object({
|
|
3374
3308
|
$event: WorkqueueColumnKeys
|
|
3375
3309
|
});
|
|
3376
|
-
var WorkqueueColumn =
|
|
3310
|
+
var WorkqueueColumn = import_zod27.z.object({
|
|
3377
3311
|
label: TranslationConfig,
|
|
3378
3312
|
value: WorkqueueColumnValue
|
|
3379
3313
|
});
|
|
@@ -3384,57 +3318,57 @@ function defineWorkqueuesColumns(workqueueColumns) {
|
|
|
3384
3318
|
}
|
|
3385
3319
|
|
|
3386
3320
|
// ../commons/src/events/CountryConfigQueryInput.ts
|
|
3387
|
-
var
|
|
3388
|
-
var SerializableExact =
|
|
3389
|
-
type:
|
|
3390
|
-
term:
|
|
3321
|
+
var import_zod28 = require("zod");
|
|
3322
|
+
var SerializableExact = import_zod28.z.object({
|
|
3323
|
+
type: import_zod28.z.literal("exact"),
|
|
3324
|
+
term: import_zod28.z.union([import_zod28.z.string(), SerializedUserField])
|
|
3391
3325
|
});
|
|
3392
|
-
var SerializableWithin =
|
|
3393
|
-
type:
|
|
3394
|
-
location:
|
|
3326
|
+
var SerializableWithin = import_zod28.z.object({
|
|
3327
|
+
type: import_zod28.z.literal("within"),
|
|
3328
|
+
location: import_zod28.z.union([import_zod28.z.string(), SerializedUserField])
|
|
3395
3329
|
});
|
|
3396
|
-
var SerializedQueryExpression =
|
|
3397
|
-
eventType:
|
|
3398
|
-
status:
|
|
3399
|
-
createdAt:
|
|
3400
|
-
updatedAt:
|
|
3401
|
-
"legalStatuses.REGISTERED.createdAt":
|
|
3402
|
-
"legalStatuses.REGISTERED.createdAtLocation":
|
|
3403
|
-
|
|
3330
|
+
var SerializedQueryExpression = import_zod28.z.object({
|
|
3331
|
+
eventType: import_zod28.z.string(),
|
|
3332
|
+
status: import_zod28.z.optional(import_zod28.z.union([AnyOfStatus, ExactStatus])),
|
|
3333
|
+
createdAt: import_zod28.z.optional(DateCondition),
|
|
3334
|
+
updatedAt: import_zod28.z.optional(DateCondition),
|
|
3335
|
+
"legalStatuses.REGISTERED.createdAt": import_zod28.z.optional(DateCondition),
|
|
3336
|
+
"legalStatuses.REGISTERED.createdAtLocation": import_zod28.z.optional(
|
|
3337
|
+
import_zod28.z.union([Within, Exact])
|
|
3404
3338
|
),
|
|
3405
|
-
"legalStatuses.REGISTERED.registrationNumber":
|
|
3406
|
-
createdAtLocation:
|
|
3407
|
-
|
|
3339
|
+
"legalStatuses.REGISTERED.registrationNumber": import_zod28.z.optional(Exact),
|
|
3340
|
+
createdAtLocation: import_zod28.z.optional(
|
|
3341
|
+
import_zod28.z.union([SerializableWithin, SerializableExact])
|
|
3408
3342
|
),
|
|
3409
|
-
updatedAtLocation:
|
|
3410
|
-
|
|
3343
|
+
updatedAtLocation: import_zod28.z.optional(
|
|
3344
|
+
import_zod28.z.union([SerializableWithin, SerializableExact])
|
|
3411
3345
|
),
|
|
3412
|
-
assignedTo:
|
|
3413
|
-
createdBy:
|
|
3346
|
+
assignedTo: import_zod28.z.optional(SerializableExact),
|
|
3347
|
+
createdBy: import_zod28.z.optional(SerializableExact),
|
|
3414
3348
|
createdByUserType: ExactUserType,
|
|
3415
|
-
updatedBy:
|
|
3416
|
-
trackingId:
|
|
3417
|
-
flags:
|
|
3349
|
+
updatedBy: import_zod28.z.optional(SerializableExact),
|
|
3350
|
+
trackingId: import_zod28.z.optional(Exact),
|
|
3351
|
+
flags: import_zod28.z.optional(ContainsFlags),
|
|
3418
3352
|
data: QueryInput
|
|
3419
3353
|
}).partial();
|
|
3420
|
-
var Or2 =
|
|
3421
|
-
type:
|
|
3422
|
-
clauses:
|
|
3354
|
+
var Or2 = import_zod28.z.object({
|
|
3355
|
+
type: import_zod28.z.literal("or"),
|
|
3356
|
+
clauses: import_zod28.z.array(SerializedQueryExpression)
|
|
3423
3357
|
});
|
|
3424
|
-
var And2 =
|
|
3425
|
-
type:
|
|
3426
|
-
clauses:
|
|
3358
|
+
var And2 = import_zod28.z.object({
|
|
3359
|
+
type: import_zod28.z.literal("and"),
|
|
3360
|
+
clauses: import_zod28.z.array(SerializedQueryExpression)
|
|
3427
3361
|
});
|
|
3428
|
-
var CountryConfigQueryType =
|
|
3429
|
-
var CountryConfigQueryInputType =
|
|
3362
|
+
var CountryConfigQueryType = import_zod28.z.discriminatedUnion("type", [And2, Or2]);
|
|
3363
|
+
var CountryConfigQueryInputType = import_zod28.z.union([
|
|
3430
3364
|
SerializedQueryExpression,
|
|
3431
3365
|
And2,
|
|
3432
3366
|
Or2
|
|
3433
3367
|
]);
|
|
3434
3368
|
|
|
3435
3369
|
// ../commons/src/icons.ts
|
|
3436
|
-
var
|
|
3437
|
-
var AvailableIcons =
|
|
3370
|
+
var import_zod29 = require("zod");
|
|
3371
|
+
var AvailableIcons = import_zod29.z.enum([
|
|
3438
3372
|
"Archived",
|
|
3439
3373
|
"Assigned",
|
|
3440
3374
|
"Certified",
|
|
@@ -3555,24 +3489,23 @@ var mandatoryColumns = defineWorkqueuesColumns([
|
|
|
3555
3489
|
value: event.field("updatedAt")
|
|
3556
3490
|
}
|
|
3557
3491
|
]);
|
|
3558
|
-
var WorkqueueActionsWithDefault =
|
|
3492
|
+
var WorkqueueActionsWithDefault = import_zod30.z.enum([
|
|
3559
3493
|
...workqueueActions.options,
|
|
3560
|
-
"DEFAULT"
|
|
3561
|
-
ActionType.READ
|
|
3494
|
+
"DEFAULT"
|
|
3562
3495
|
]);
|
|
3563
|
-
var WorkqueueConfig =
|
|
3564
|
-
slug:
|
|
3496
|
+
var WorkqueueConfig = import_zod30.z.object({
|
|
3497
|
+
slug: import_zod30.z.string().describe("Determines the url of the workqueue."),
|
|
3565
3498
|
name: TranslationConfig.describe(
|
|
3566
3499
|
"Title of the workflow (both in navigation and on the page)"
|
|
3567
3500
|
),
|
|
3568
3501
|
query: CountryConfigQueryType,
|
|
3569
|
-
actions:
|
|
3570
|
-
|
|
3502
|
+
actions: import_zod30.z.array(
|
|
3503
|
+
import_zod30.z.object({
|
|
3571
3504
|
type: WorkqueueActionsWithDefault,
|
|
3572
|
-
conditionals:
|
|
3505
|
+
conditionals: import_zod30.z.array(Conditional).optional()
|
|
3573
3506
|
})
|
|
3574
3507
|
),
|
|
3575
|
-
columns:
|
|
3508
|
+
columns: import_zod30.z.array(WorkqueueColumn).default(mandatoryColumns),
|
|
3576
3509
|
icon: AvailableIcons,
|
|
3577
3510
|
emptyMessage: TranslationConfig.optional()
|
|
3578
3511
|
}).describe("Configuration for workqueue.");
|
|
@@ -3580,26 +3513,26 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
|
|
|
3580
3513
|
query: true,
|
|
3581
3514
|
columns: true
|
|
3582
3515
|
});
|
|
3583
|
-
var WorkqueueConfigInput =
|
|
3584
|
-
slug:
|
|
3516
|
+
var WorkqueueConfigInput = import_zod30.z.object({
|
|
3517
|
+
slug: import_zod30.z.string().describe("Determines the url of the workqueue."),
|
|
3585
3518
|
name: TranslationConfig.describe(
|
|
3586
3519
|
"Title of the workflow (both in navigation and on the page)"
|
|
3587
3520
|
),
|
|
3588
3521
|
query: CountryConfigQueryInputType,
|
|
3589
|
-
actions:
|
|
3590
|
-
|
|
3522
|
+
actions: import_zod30.z.array(
|
|
3523
|
+
import_zod30.z.object({
|
|
3591
3524
|
type: WorkqueueActionsWithDefault,
|
|
3592
|
-
conditionals:
|
|
3525
|
+
conditionals: import_zod30.z.array(Conditional).optional()
|
|
3593
3526
|
})
|
|
3594
3527
|
),
|
|
3595
|
-
columns:
|
|
3528
|
+
columns: import_zod30.z.array(WorkqueueColumn).default(mandatoryColumns),
|
|
3596
3529
|
icon: AvailableIcons,
|
|
3597
3530
|
emptyMessage: TranslationConfig.optional()
|
|
3598
3531
|
});
|
|
3599
|
-
var WorkqueueCountInput =
|
|
3600
|
-
|
|
3532
|
+
var WorkqueueCountInput = import_zod30.z.array(
|
|
3533
|
+
import_zod30.z.object({ slug: import_zod30.z.string(), query: QueryType })
|
|
3601
3534
|
);
|
|
3602
|
-
var WorkqueueCountOutput =
|
|
3535
|
+
var WorkqueueCountOutput = import_zod30.z.record(import_zod30.z.string(), import_zod30.z.number());
|
|
3603
3536
|
|
|
3604
3537
|
// ../commons/src/events/workqueueDefaultColumns.ts
|
|
3605
3538
|
var defaultWorkqueueColumns = [
|
|
@@ -3622,45 +3555,47 @@ var defaultWorkqueueColumns = [
|
|
|
3622
3555
|
];
|
|
3623
3556
|
|
|
3624
3557
|
// ../commons/src/events/Draft.ts
|
|
3625
|
-
var
|
|
3558
|
+
var import_zod32 = require("zod");
|
|
3626
3559
|
|
|
3627
3560
|
// ../commons/src/events/ActionInput.ts
|
|
3628
|
-
var
|
|
3629
|
-
var
|
|
3561
|
+
var import_zod31 = require("zod");
|
|
3562
|
+
var import_zod_openapi11 = require("zod-openapi");
|
|
3563
|
+
(0, import_zod_openapi11.extendZodWithOpenApi)(import_zod31.z);
|
|
3564
|
+
var BaseActionInput = import_zod31.z.object({
|
|
3630
3565
|
eventId: UUID,
|
|
3631
|
-
transactionId:
|
|
3566
|
+
transactionId: import_zod31.z.string(),
|
|
3632
3567
|
declaration: ActionUpdate.default({}),
|
|
3633
3568
|
annotation: ActionUpdate.optional(),
|
|
3634
3569
|
originalActionId: UUID.optional(),
|
|
3635
3570
|
// should not be part of base action.
|
|
3636
|
-
keepAssignment:
|
|
3571
|
+
keepAssignment: import_zod31.z.boolean().optional(),
|
|
3637
3572
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
3638
3573
|
createdAtLocation: CreatedAtLocation.describe(
|
|
3639
3574
|
"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."
|
|
3640
3575
|
)
|
|
3641
3576
|
});
|
|
3642
|
-
var CreateActionInput = BaseActionInput.
|
|
3643
|
-
|
|
3644
|
-
type:
|
|
3577
|
+
var CreateActionInput = BaseActionInput.merge(
|
|
3578
|
+
import_zod31.z.object({
|
|
3579
|
+
type: import_zod31.z.literal(ActionType.CREATE).default(ActionType.CREATE),
|
|
3645
3580
|
createdAtLocation: CreatedAtLocation
|
|
3646
|
-
})
|
|
3647
|
-
);
|
|
3648
|
-
var RegisterActionInput = BaseActionInput.extend(
|
|
3649
|
-
z33.strictObject({
|
|
3650
|
-
type: z33.literal(ActionType.REGISTER).default(ActionType.REGISTER),
|
|
3651
|
-
registrationNumber: z33.string().optional()
|
|
3652
|
-
}).shape
|
|
3581
|
+
})
|
|
3653
3582
|
);
|
|
3654
|
-
var
|
|
3655
|
-
|
|
3656
|
-
type:
|
|
3657
|
-
|
|
3583
|
+
var RegisterActionInput = BaseActionInput.merge(
|
|
3584
|
+
import_zod31.z.object({
|
|
3585
|
+
type: import_zod31.z.literal(ActionType.REGISTER).default(ActionType.REGISTER),
|
|
3586
|
+
registrationNumber: import_zod31.z.string().optional()
|
|
3587
|
+
})
|
|
3588
|
+
).strict();
|
|
3589
|
+
var ValidateActionInput = BaseActionInput.merge(
|
|
3590
|
+
import_zod31.z.object({
|
|
3591
|
+
type: import_zod31.z.literal(ActionType.VALIDATE).default(ActionType.VALIDATE)
|
|
3592
|
+
})
|
|
3658
3593
|
);
|
|
3659
|
-
var NotifyActionInput = BaseActionInput.
|
|
3660
|
-
|
|
3661
|
-
type:
|
|
3662
|
-
})
|
|
3663
|
-
).
|
|
3594
|
+
var NotifyActionInput = BaseActionInput.merge(
|
|
3595
|
+
import_zod31.z.object({
|
|
3596
|
+
type: import_zod31.z.literal(ActionType.NOTIFY).default(ActionType.NOTIFY)
|
|
3597
|
+
})
|
|
3598
|
+
).openapi({
|
|
3664
3599
|
default: {
|
|
3665
3600
|
eventId: "<event-id-here>",
|
|
3666
3601
|
transactionId: getUUID(),
|
|
@@ -3669,142 +3604,135 @@ var NotifyActionInput = BaseActionInput.extend(
|
|
|
3669
3604
|
type: ActionType.NOTIFY
|
|
3670
3605
|
}
|
|
3671
3606
|
});
|
|
3672
|
-
var DeclareActionInput = BaseActionInput.
|
|
3673
|
-
|
|
3674
|
-
type:
|
|
3675
|
-
})
|
|
3607
|
+
var DeclareActionInput = BaseActionInput.merge(
|
|
3608
|
+
import_zod31.z.object({
|
|
3609
|
+
type: import_zod31.z.literal(ActionType.DECLARE).default(ActionType.DECLARE)
|
|
3610
|
+
})
|
|
3676
3611
|
);
|
|
3677
|
-
var PrintCertificateActionInput = BaseActionInput.
|
|
3678
|
-
|
|
3679
|
-
type:
|
|
3612
|
+
var PrintCertificateActionInput = BaseActionInput.merge(
|
|
3613
|
+
import_zod31.z.object({
|
|
3614
|
+
type: import_zod31.z.literal(ActionType.PRINT_CERTIFICATE).default(ActionType.PRINT_CERTIFICATE),
|
|
3680
3615
|
content: PrintContent.optional()
|
|
3681
|
-
})
|
|
3616
|
+
})
|
|
3682
3617
|
);
|
|
3683
|
-
var RejectDeclarationActionInput = BaseActionInput.
|
|
3684
|
-
|
|
3685
|
-
type:
|
|
3618
|
+
var RejectDeclarationActionInput = BaseActionInput.merge(
|
|
3619
|
+
import_zod31.z.object({
|
|
3620
|
+
type: import_zod31.z.literal(ActionType.REJECT).default(ActionType.REJECT),
|
|
3686
3621
|
content: ReasonContent
|
|
3687
|
-
})
|
|
3622
|
+
})
|
|
3688
3623
|
);
|
|
3689
|
-
var DuplicateDetectedActionInput = BaseActionInput.
|
|
3690
|
-
|
|
3691
|
-
type:
|
|
3692
|
-
content:
|
|
3693
|
-
duplicates:
|
|
3624
|
+
var DuplicateDetectedActionInput = BaseActionInput.merge(
|
|
3625
|
+
import_zod31.z.object({
|
|
3626
|
+
type: import_zod31.z.literal(ActionType.DUPLICATE_DETECTED).default(ActionType.DUPLICATE_DETECTED),
|
|
3627
|
+
content: import_zod31.z.object({
|
|
3628
|
+
duplicates: import_zod31.z.array(PotentialDuplicate)
|
|
3694
3629
|
})
|
|
3695
|
-
})
|
|
3630
|
+
})
|
|
3696
3631
|
);
|
|
3697
|
-
var MarkAsDuplicateActionInput = BaseActionInput.
|
|
3698
|
-
|
|
3699
|
-
type:
|
|
3700
|
-
content:
|
|
3632
|
+
var MarkAsDuplicateActionInput = BaseActionInput.merge(
|
|
3633
|
+
import_zod31.z.object({
|
|
3634
|
+
type: import_zod31.z.literal(ActionType.MARK_AS_DUPLICATE).default(ActionType.MARK_AS_DUPLICATE),
|
|
3635
|
+
content: import_zod31.z.object({
|
|
3701
3636
|
duplicateOf: UUID
|
|
3702
3637
|
}).optional()
|
|
3703
|
-
})
|
|
3638
|
+
})
|
|
3704
3639
|
);
|
|
3705
|
-
var MarkNotDuplicateActionInput = BaseActionInput.
|
|
3706
|
-
|
|
3707
|
-
type:
|
|
3708
|
-
})
|
|
3640
|
+
var MarkNotDuplicateActionInput = BaseActionInput.merge(
|
|
3641
|
+
import_zod31.z.object({
|
|
3642
|
+
type: import_zod31.z.literal(ActionType.MARK_AS_NOT_DUPLICATE).default(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
3643
|
+
})
|
|
3709
3644
|
);
|
|
3710
|
-
var ArchiveActionInput = BaseActionInput.
|
|
3711
|
-
|
|
3712
|
-
type:
|
|
3645
|
+
var ArchiveActionInput = BaseActionInput.merge(
|
|
3646
|
+
import_zod31.z.object({
|
|
3647
|
+
type: import_zod31.z.literal(ActionType.ARCHIVE).default(ActionType.ARCHIVE),
|
|
3713
3648
|
content: ReasonContent
|
|
3714
|
-
})
|
|
3649
|
+
})
|
|
3715
3650
|
);
|
|
3716
|
-
var AssignActionInput = BaseActionInput.
|
|
3717
|
-
|
|
3718
|
-
type:
|
|
3719
|
-
assignedTo:
|
|
3720
|
-
})
|
|
3651
|
+
var AssignActionInput = BaseActionInput.merge(
|
|
3652
|
+
import_zod31.z.object({
|
|
3653
|
+
type: import_zod31.z.literal(ActionType.ASSIGN),
|
|
3654
|
+
assignedTo: import_zod31.z.string()
|
|
3655
|
+
})
|
|
3721
3656
|
);
|
|
3722
|
-
var UnassignActionInput = BaseActionInput.
|
|
3723
|
-
|
|
3724
|
-
type:
|
|
3725
|
-
assignedTo:
|
|
3726
|
-
})
|
|
3657
|
+
var UnassignActionInput = BaseActionInput.merge(
|
|
3658
|
+
import_zod31.z.object({
|
|
3659
|
+
type: import_zod31.z.literal(ActionType.UNASSIGN).default(ActionType.UNASSIGN),
|
|
3660
|
+
assignedTo: import_zod31.z.literal(null).default(null)
|
|
3661
|
+
})
|
|
3727
3662
|
);
|
|
3728
|
-
var RequestCorrectionActionInput = BaseActionInput.
|
|
3729
|
-
|
|
3730
|
-
type:
|
|
3731
|
-
})
|
|
3663
|
+
var RequestCorrectionActionInput = BaseActionInput.merge(
|
|
3664
|
+
import_zod31.z.object({
|
|
3665
|
+
type: import_zod31.z.literal(ActionType.REQUEST_CORRECTION).default(ActionType.REQUEST_CORRECTION)
|
|
3666
|
+
})
|
|
3732
3667
|
);
|
|
3733
|
-
var RejectCorrectionActionInput = BaseActionInput.
|
|
3734
|
-
|
|
3735
|
-
requestId:
|
|
3736
|
-
type:
|
|
3668
|
+
var RejectCorrectionActionInput = BaseActionInput.merge(
|
|
3669
|
+
import_zod31.z.object({
|
|
3670
|
+
requestId: import_zod31.z.string(),
|
|
3671
|
+
type: import_zod31.z.literal(ActionType.REJECT_CORRECTION).default(ActionType.REJECT_CORRECTION),
|
|
3737
3672
|
content: ReasonContent
|
|
3738
|
-
})
|
|
3739
|
-
);
|
|
3740
|
-
var ApproveCorrectionActionInput = BaseActionInput.extend(
|
|
3741
|
-
z33.object({
|
|
3742
|
-
requestId: z33.string(),
|
|
3743
|
-
type: z33.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
|
|
3744
|
-
}).shape
|
|
3673
|
+
})
|
|
3745
3674
|
);
|
|
3746
|
-
var
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3675
|
+
var ApproveCorrectionActionInput = BaseActionInput.merge(
|
|
3676
|
+
import_zod31.z.object({
|
|
3677
|
+
requestId: import_zod31.z.string(),
|
|
3678
|
+
type: import_zod31.z.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
|
|
3679
|
+
})
|
|
3750
3680
|
);
|
|
3751
|
-
var
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
customActionType: z33.string().describe("Name of the custom action.")
|
|
3756
|
-
}).shape
|
|
3681
|
+
var ReadActionInput = BaseActionInput.merge(
|
|
3682
|
+
import_zod31.z.object({
|
|
3683
|
+
type: import_zod31.z.literal(ActionType.READ).default(ActionType.READ)
|
|
3684
|
+
})
|
|
3757
3685
|
);
|
|
3758
|
-
var
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3686
|
+
var DeleteActionInput = import_zod31.z.object({ eventId: UUID });
|
|
3687
|
+
var ActionInput = import_zod31.z.discriminatedUnion("type", [
|
|
3688
|
+
CreateActionInput.openapi({ ref: "CreateActionInput" }),
|
|
3689
|
+
ValidateActionInput.openapi({ ref: "ValidateActionInput" }),
|
|
3690
|
+
RegisterActionInput.openapi({ ref: "RegisterActionInput" }),
|
|
3691
|
+
NotifyActionInput.openapi({ ref: "NotifyActionInput" }),
|
|
3692
|
+
DeclareActionInput.openapi({ ref: "DeclareActionInput" }),
|
|
3693
|
+
RejectDeclarationActionInput.openapi({
|
|
3694
|
+
ref: "RejectDeclarationActionInput"
|
|
3766
3695
|
}),
|
|
3767
|
-
DuplicateDetectedActionInput.
|
|
3768
|
-
|
|
3696
|
+
DuplicateDetectedActionInput.openapi({
|
|
3697
|
+
ref: "DuplicateDetectedActionInput"
|
|
3769
3698
|
}),
|
|
3770
|
-
MarkAsDuplicateActionInput.
|
|
3771
|
-
|
|
3699
|
+
MarkAsDuplicateActionInput.openapi({
|
|
3700
|
+
ref: "MarkAsDuplicateActionInput"
|
|
3772
3701
|
}),
|
|
3773
|
-
MarkNotDuplicateActionInput.
|
|
3774
|
-
|
|
3702
|
+
MarkNotDuplicateActionInput.openapi({
|
|
3703
|
+
ref: "MarkNotDuplicateActionInput"
|
|
3775
3704
|
}),
|
|
3776
|
-
ArchiveActionInput.
|
|
3777
|
-
AssignActionInput.
|
|
3778
|
-
UnassignActionInput.
|
|
3779
|
-
PrintCertificateActionInput.
|
|
3780
|
-
RequestCorrectionActionInput.
|
|
3781
|
-
|
|
3705
|
+
ArchiveActionInput.openapi({ ref: "ArchiveActionInput" }),
|
|
3706
|
+
AssignActionInput.openapi({ ref: "AssignActionInput" }),
|
|
3707
|
+
UnassignActionInput.openapi({ ref: "UnassignActionInput" }),
|
|
3708
|
+
PrintCertificateActionInput.openapi({ ref: "PrintCertificateActionInput" }),
|
|
3709
|
+
RequestCorrectionActionInput.openapi({
|
|
3710
|
+
ref: "RequestCorrectionActionInput"
|
|
3782
3711
|
}),
|
|
3783
|
-
RejectCorrectionActionInput.
|
|
3784
|
-
ApproveCorrectionActionInput.
|
|
3785
|
-
|
|
3712
|
+
RejectCorrectionActionInput.openapi({ ref: "RejectCorrectionActionInput" }),
|
|
3713
|
+
ApproveCorrectionActionInput.openapi({
|
|
3714
|
+
ref: "ApproveCorrectionActionInput"
|
|
3786
3715
|
}),
|
|
3787
|
-
ReadActionInput.
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
id: "ActionInput"
|
|
3716
|
+
ReadActionInput.openapi({ ref: "ReadActionInput" })
|
|
3717
|
+
]).openapi({
|
|
3718
|
+
ref: "ActionInput"
|
|
3791
3719
|
});
|
|
3792
3720
|
|
|
3793
3721
|
// ../commons/src/events/Draft.ts
|
|
3794
|
-
var Draft =
|
|
3722
|
+
var Draft = import_zod32.z.object({
|
|
3795
3723
|
id: UUID,
|
|
3796
3724
|
eventId: UUID,
|
|
3797
|
-
transactionId:
|
|
3798
|
-
createdAt:
|
|
3725
|
+
transactionId: import_zod32.z.string(),
|
|
3726
|
+
createdAt: import_zod32.z.string().datetime(),
|
|
3799
3727
|
action: ActionBase.extend({
|
|
3800
|
-
type: ActionTypes.exclude([ActionTypes.
|
|
3728
|
+
type: ActionTypes.exclude([ActionTypes.Enum.DELETE])
|
|
3801
3729
|
}).omit({ id: true, createdAtLocation: true })
|
|
3802
3730
|
}).describe(
|
|
3803
3731
|
"A temporary storage for an action. Stored with details of the event, creator and creation time."
|
|
3804
3732
|
);
|
|
3805
3733
|
var DraftInput = BaseActionInput.extend({
|
|
3806
|
-
type: ActionTypes.exclude([ActionTypes.
|
|
3807
|
-
status:
|
|
3734
|
+
type: ActionTypes.exclude([ActionTypes.Enum.DELETE]),
|
|
3735
|
+
status: import_zod32.z.enum([
|
|
3808
3736
|
ActionStatus.Requested,
|
|
3809
3737
|
ActionStatus.Accepted,
|
|
3810
3738
|
ActionStatus.Rejected
|
|
@@ -3812,30 +3740,32 @@ var DraftInput = BaseActionInput.extend({
|
|
|
3812
3740
|
});
|
|
3813
3741
|
|
|
3814
3742
|
// ../commons/src/events/EventInput.ts
|
|
3815
|
-
var
|
|
3743
|
+
var import_zod33 = require("zod");
|
|
3816
3744
|
var import_uuid10 = require("uuid");
|
|
3817
|
-
var EventInput =
|
|
3818
|
-
transactionId:
|
|
3819
|
-
type:
|
|
3820
|
-
}).
|
|
3745
|
+
var EventInput = import_zod33.z.object({
|
|
3746
|
+
transactionId: import_zod33.z.string(),
|
|
3747
|
+
type: import_zod33.z.string()
|
|
3748
|
+
}).openapi({ default: { transactionId: (0, import_uuid10.v4)(), type: "birth" } });
|
|
3821
3749
|
|
|
3822
3750
|
// ../commons/src/events/EventDocument.ts
|
|
3823
|
-
var
|
|
3824
|
-
var
|
|
3751
|
+
var import_zod34 = require("zod");
|
|
3752
|
+
var import_zod_openapi12 = require("zod-openapi");
|
|
3753
|
+
(0, import_zod_openapi12.extendZodWithOpenApi)(import_zod34.z);
|
|
3754
|
+
var EventDocument = import_zod34.z.object({
|
|
3825
3755
|
id: UUID.describe("Unique identifier of the event."),
|
|
3826
|
-
type:
|
|
3827
|
-
createdAt:
|
|
3828
|
-
updatedAt:
|
|
3756
|
+
type: import_zod34.z.string().describe("Type of the event (e.g. birth, death, marriage)."),
|
|
3757
|
+
createdAt: import_zod34.z.string().datetime().describe("Timestamp indicating when the event was created."),
|
|
3758
|
+
updatedAt: import_zod34.z.string().datetime().describe(
|
|
3829
3759
|
"Timestamp of the last update, excluding changes from actions."
|
|
3830
3760
|
),
|
|
3831
|
-
actions:
|
|
3832
|
-
trackingId:
|
|
3761
|
+
actions: import_zod34.z.array(Action).describe("Ordered list of actions associated with the event."),
|
|
3762
|
+
trackingId: import_zod34.z.string().describe(
|
|
3833
3763
|
"System-generated tracking identifier used to look up the event."
|
|
3834
3764
|
)
|
|
3835
|
-
}).
|
|
3765
|
+
}).openapi({ ref: "EventDocument" });
|
|
3836
3766
|
|
|
3837
3767
|
// ../commons/src/events/state/index.ts
|
|
3838
|
-
var
|
|
3768
|
+
var import_lodash3 = require("lodash");
|
|
3839
3769
|
|
|
3840
3770
|
// ../commons/src/events/state/utils.ts
|
|
3841
3771
|
var import_lodash2 = require("lodash");
|
|
@@ -3851,10 +3781,6 @@ var updateActions = ActionTypes.extract([
|
|
|
3851
3781
|
ActionType.REQUEST_CORRECTION
|
|
3852
3782
|
]);
|
|
3853
3783
|
|
|
3854
|
-
// ../commons/src/events/state/flags.ts
|
|
3855
|
-
var import_lodash3 = require("lodash");
|
|
3856
|
-
var import_date_fns3 = require("date-fns");
|
|
3857
|
-
|
|
3858
3784
|
// ../commons/src/events/defineConfig.ts
|
|
3859
3785
|
var defineConfig = (config) => {
|
|
3860
3786
|
const input = EventConfig.parse(config);
|
|
@@ -3862,7 +3788,7 @@ var defineConfig = (config) => {
|
|
|
3862
3788
|
};
|
|
3863
3789
|
|
|
3864
3790
|
// ../commons/src/events/test.utils.ts
|
|
3865
|
-
var
|
|
3791
|
+
var import_lodash4 = require("lodash");
|
|
3866
3792
|
var import_date_fns4 = require("date-fns");
|
|
3867
3793
|
|
|
3868
3794
|
// ../commons/src/field-config/field-configuration.ts
|
|
@@ -3884,6 +3810,7 @@ function field(fieldId, options = {}) {
|
|
|
3884
3810
|
}
|
|
3885
3811
|
|
|
3886
3812
|
// ../commons/src/fixtures/forms.ts
|
|
3813
|
+
var import_date_fns3 = require("date-fns");
|
|
3887
3814
|
var PRINT_CERTIFICATE_FORM = defineActionForm({
|
|
3888
3815
|
label: {
|
|
3889
3816
|
id: "event.tennis-club-membership.action.certificate.form.label",
|
|
@@ -4681,7 +4608,7 @@ var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
|
|
|
4681
4608
|
conditionals: [
|
|
4682
4609
|
{
|
|
4683
4610
|
type: ConditionalType.DISPLAY_ON_REVIEW,
|
|
4684
|
-
conditional:
|
|
4611
|
+
conditional: never()
|
|
4685
4612
|
}
|
|
4686
4613
|
]
|
|
4687
4614
|
},
|
|
@@ -5064,16 +4991,119 @@ var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
|
|
|
5064
4991
|
}
|
|
5065
4992
|
}
|
|
5066
4993
|
],
|
|
5067
|
-
conditional: not(
|
|
4994
|
+
conditional: not(never())
|
|
5068
4995
|
// Intentional always-true page conditional to exercise interactions between page-level and field-level conditionals in tests
|
|
5069
4996
|
}
|
|
5070
4997
|
]
|
|
5071
4998
|
});
|
|
4999
|
+
var statusOptions = [
|
|
5000
|
+
{
|
|
5001
|
+
value: "ALL",
|
|
5002
|
+
label: {
|
|
5003
|
+
defaultMessage: "Any status",
|
|
5004
|
+
description: "Option for form field: status of record",
|
|
5005
|
+
id: "advancedSearch.form.recordStatusAny"
|
|
5006
|
+
}
|
|
5007
|
+
},
|
|
5008
|
+
{
|
|
5009
|
+
value: EventStatus.enum.CREATED,
|
|
5010
|
+
label: {
|
|
5011
|
+
defaultMessage: "Draft",
|
|
5012
|
+
description: "Option for form field: status of record",
|
|
5013
|
+
id: "advancedSearch.form.recordStatusCreated"
|
|
5014
|
+
}
|
|
5015
|
+
},
|
|
5016
|
+
{
|
|
5017
|
+
value: EventStatus.enum.NOTIFIED,
|
|
5018
|
+
label: {
|
|
5019
|
+
defaultMessage: "Notified",
|
|
5020
|
+
description: "Option for form field: status of record",
|
|
5021
|
+
id: "advancedSearch.form.recordStatusNotified"
|
|
5022
|
+
}
|
|
5023
|
+
},
|
|
5024
|
+
{
|
|
5025
|
+
value: EventStatus.enum.DECLARED,
|
|
5026
|
+
label: {
|
|
5027
|
+
defaultMessage: "Declared",
|
|
5028
|
+
description: "Option for form field: status of record",
|
|
5029
|
+
id: "advancedSearch.form.recordStatusDeclared"
|
|
5030
|
+
}
|
|
5031
|
+
},
|
|
5032
|
+
{
|
|
5033
|
+
value: EventStatus.enum.VALIDATED,
|
|
5034
|
+
label: {
|
|
5035
|
+
defaultMessage: "Validated",
|
|
5036
|
+
description: "Option for form field: status of record",
|
|
5037
|
+
id: "advancedSearch.form.recordStatusValidated"
|
|
5038
|
+
}
|
|
5039
|
+
},
|
|
5040
|
+
{
|
|
5041
|
+
value: EventStatus.enum.REGISTERED,
|
|
5042
|
+
label: {
|
|
5043
|
+
defaultMessage: "Registered",
|
|
5044
|
+
description: "Option for form field: status of record",
|
|
5045
|
+
id: "advancedSearch.form.recordStatusRegistered"
|
|
5046
|
+
}
|
|
5047
|
+
},
|
|
5048
|
+
{
|
|
5049
|
+
value: EventStatus.enum.ARCHIVED,
|
|
5050
|
+
label: {
|
|
5051
|
+
defaultMessage: "Archived",
|
|
5052
|
+
description: "Option for form field: status of record",
|
|
5053
|
+
id: "advancedSearch.form.recordStatusArchived"
|
|
5054
|
+
}
|
|
5055
|
+
}
|
|
5056
|
+
];
|
|
5057
|
+
var timePeriodOptions = [
|
|
5058
|
+
{
|
|
5059
|
+
label: {
|
|
5060
|
+
defaultMessage: "Last 7 days",
|
|
5061
|
+
description: "Label for option of time period select: last 7 days",
|
|
5062
|
+
id: "form.section.label.timePeriodLast7Days"
|
|
5063
|
+
},
|
|
5064
|
+
value: `${(0, import_date_fns3.format)((0, import_date_fns3.subDays)(/* @__PURE__ */ new Date(), 7), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
|
|
5065
|
+
/* @__PURE__ */ new Date(),
|
|
5066
|
+
"yyyy-MM-dd"
|
|
5067
|
+
)}`
|
|
5068
|
+
},
|
|
5069
|
+
{
|
|
5070
|
+
label: {
|
|
5071
|
+
defaultMessage: "Last 30 days",
|
|
5072
|
+
description: "Label for option of time period select: last 30 days",
|
|
5073
|
+
id: "form.section.label.timePeriodLast30Days"
|
|
5074
|
+
},
|
|
5075
|
+
value: `${(0, import_date_fns3.format)((0, import_date_fns3.subMonths)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
|
|
5076
|
+
/* @__PURE__ */ new Date(),
|
|
5077
|
+
"yyyy-MM-dd"
|
|
5078
|
+
)}`
|
|
5079
|
+
},
|
|
5080
|
+
{
|
|
5081
|
+
label: {
|
|
5082
|
+
defaultMessage: "Last 90 days",
|
|
5083
|
+
description: "Label for option of time period select: last 90 days",
|
|
5084
|
+
id: "form.section.label.timePeriodLast90Days"
|
|
5085
|
+
},
|
|
5086
|
+
value: `${(0, import_date_fns3.format)((0, import_date_fns3.subQuarters)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
|
|
5087
|
+
/* @__PURE__ */ new Date(),
|
|
5088
|
+
"yyyy-MM-dd"
|
|
5089
|
+
)}`
|
|
5090
|
+
},
|
|
5091
|
+
{
|
|
5092
|
+
label: {
|
|
5093
|
+
defaultMessage: "Last year",
|
|
5094
|
+
description: "Label for option of time period select: last year",
|
|
5095
|
+
id: "form.section.label.timePeriodLastYear"
|
|
5096
|
+
},
|
|
5097
|
+
value: `${(0, import_date_fns3.format)((0, import_date_fns3.subYears)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
|
|
5098
|
+
/* @__PURE__ */ new Date(),
|
|
5099
|
+
"yyyy-MM-dd"
|
|
5100
|
+
)}`
|
|
5101
|
+
}
|
|
5102
|
+
];
|
|
5072
5103
|
|
|
5073
5104
|
// ../commons/src/fixtures/tennis-club-membership-event.ts
|
|
5074
5105
|
var tennisClubMembershipEvent = defineConfig({
|
|
5075
5106
|
id: TENNIS_CLUB_MEMBERSHIP,
|
|
5076
|
-
declaration: TENNIS_CLUB_DECLARATION_FORM,
|
|
5077
5107
|
label: {
|
|
5078
5108
|
defaultMessage: "Tennis club membership application",
|
|
5079
5109
|
description: "This is what this event is referred as in the system",
|
|
@@ -5104,17 +5134,6 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5104
5134
|
}
|
|
5105
5135
|
]
|
|
5106
5136
|
},
|
|
5107
|
-
flags: [
|
|
5108
|
-
{
|
|
5109
|
-
id: "validated",
|
|
5110
|
-
label: {
|
|
5111
|
-
id: "event.tennis-club-membership.flag.validated",
|
|
5112
|
-
defaultMessage: "Validated",
|
|
5113
|
-
description: "Flag label for validated"
|
|
5114
|
-
},
|
|
5115
|
-
requiresAction: true
|
|
5116
|
-
}
|
|
5117
|
-
],
|
|
5118
5137
|
actions: [
|
|
5119
5138
|
{
|
|
5120
5139
|
type: ActionType.READ,
|
|
@@ -5141,19 +5160,7 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5141
5160
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5142
5161
|
id: "event.tennis-club-membership.action.validate.label"
|
|
5143
5162
|
},
|
|
5144
|
-
|
|
5145
|
-
conditionals: [
|
|
5146
|
-
{ type: ConditionalType.SHOW, conditional: not(flag("validated")) }
|
|
5147
|
-
]
|
|
5148
|
-
},
|
|
5149
|
-
{
|
|
5150
|
-
type: ActionType.REJECT,
|
|
5151
|
-
label: {
|
|
5152
|
-
defaultMessage: "Reject",
|
|
5153
|
-
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5154
|
-
id: "event.tennis-club-membership.action.reject.label"
|
|
5155
|
-
},
|
|
5156
|
-
flags: [{ id: "validated", operation: "remove" }]
|
|
5163
|
+
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5157
5164
|
},
|
|
5158
5165
|
{
|
|
5159
5166
|
type: ActionType.REGISTER,
|
|
@@ -5161,7 +5168,8 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5161
5168
|
defaultMessage: "Register",
|
|
5162
5169
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5163
5170
|
id: "event.tennis-club-membership.action.register.label"
|
|
5164
|
-
}
|
|
5171
|
+
},
|
|
5172
|
+
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5165
5173
|
},
|
|
5166
5174
|
{
|
|
5167
5175
|
type: ActionType.REQUEST_CORRECTION,
|
|
@@ -5364,6 +5372,14 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5364
5372
|
]
|
|
5365
5373
|
}
|
|
5366
5374
|
},
|
|
5375
|
+
{
|
|
5376
|
+
type: ActionType.APPROVE_CORRECTION,
|
|
5377
|
+
label: {
|
|
5378
|
+
defaultMessage: "Approve correction",
|
|
5379
|
+
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5380
|
+
id: "event.tennis-club-membership.action.correction.approve.label"
|
|
5381
|
+
}
|
|
5382
|
+
},
|
|
5367
5383
|
{
|
|
5368
5384
|
type: ActionType.PRINT_CERTIFICATE,
|
|
5369
5385
|
label: {
|
|
@@ -5372,6 +5388,22 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5372
5388
|
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5373
5389
|
},
|
|
5374
5390
|
printForm: PRINT_CERTIFICATE_FORM
|
|
5391
|
+
},
|
|
5392
|
+
{
|
|
5393
|
+
type: ActionType.ARCHIVE,
|
|
5394
|
+
label: {
|
|
5395
|
+
id: "event.tennis-club-membership.action.archive.label",
|
|
5396
|
+
defaultMessage: "Archive",
|
|
5397
|
+
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5398
|
+
}
|
|
5399
|
+
},
|
|
5400
|
+
{
|
|
5401
|
+
type: ActionType.REJECT,
|
|
5402
|
+
label: {
|
|
5403
|
+
id: "event.tennis-club-membership.action.reject.label",
|
|
5404
|
+
defaultMessage: "Reject",
|
|
5405
|
+
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5406
|
+
}
|
|
5375
5407
|
}
|
|
5376
5408
|
],
|
|
5377
5409
|
advancedSearch: [
|
|
@@ -5408,7 +5440,8 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5408
5440
|
},
|
|
5409
5441
|
fields: [field("recommender.name").fuzzy()]
|
|
5410
5442
|
}
|
|
5411
|
-
]
|
|
5443
|
+
],
|
|
5444
|
+
declaration: TENNIS_CLUB_DECLARATION_FORM
|
|
5412
5445
|
});
|
|
5413
5446
|
|
|
5414
5447
|
// ../commons/src/fixtures/football-club-membership-event.ts
|
|
@@ -5482,7 +5515,8 @@ var footballClubMembershipEvent = defineConfig({
|
|
|
5482
5515
|
defaultMessage: "Validate",
|
|
5483
5516
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5484
5517
|
id: "event.football-club-membership.action.validate.label"
|
|
5485
|
-
}
|
|
5518
|
+
},
|
|
5519
|
+
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5486
5520
|
},
|
|
5487
5521
|
{
|
|
5488
5522
|
type: ActionType.REGISTER,
|
|
@@ -5490,7 +5524,8 @@ var footballClubMembershipEvent = defineConfig({
|
|
|
5490
5524
|
defaultMessage: "Register",
|
|
5491
5525
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5492
5526
|
id: "event.football-club-membership.action.register.label"
|
|
5493
|
-
}
|
|
5527
|
+
},
|
|
5528
|
+
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5494
5529
|
},
|
|
5495
5530
|
{
|
|
5496
5531
|
type: ActionType.REQUEST_CORRECTION,
|
|
@@ -5696,6 +5731,14 @@ var footballClubMembershipEvent = defineConfig({
|
|
|
5696
5731
|
]
|
|
5697
5732
|
}
|
|
5698
5733
|
},
|
|
5734
|
+
{
|
|
5735
|
+
type: ActionType.APPROVE_CORRECTION,
|
|
5736
|
+
label: {
|
|
5737
|
+
defaultMessage: "Approve correction",
|
|
5738
|
+
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5739
|
+
id: "event.football-club-membership.action.correction.approve.label"
|
|
5740
|
+
}
|
|
5741
|
+
},
|
|
5699
5742
|
{
|
|
5700
5743
|
type: ActionType.PRINT_CERTIFICATE,
|
|
5701
5744
|
label: {
|
|
@@ -5704,6 +5747,22 @@ var footballClubMembershipEvent = defineConfig({
|
|
|
5704
5747
|
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5705
5748
|
},
|
|
5706
5749
|
printForm: PRINT_CERTIFICATE_FORM
|
|
5750
|
+
},
|
|
5751
|
+
{
|
|
5752
|
+
type: ActionType.ARCHIVE,
|
|
5753
|
+
label: {
|
|
5754
|
+
id: "event.football-club-membership.action.archive.label",
|
|
5755
|
+
defaultMessage: "Archive",
|
|
5756
|
+
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5757
|
+
}
|
|
5758
|
+
},
|
|
5759
|
+
{
|
|
5760
|
+
type: ActionType.REJECT,
|
|
5761
|
+
label: {
|
|
5762
|
+
id: "event.football-club-membership.action.reject.label",
|
|
5763
|
+
defaultMessage: "Reject",
|
|
5764
|
+
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5765
|
+
}
|
|
5707
5766
|
}
|
|
5708
5767
|
],
|
|
5709
5768
|
advancedSearch: [
|
|
@@ -5803,7 +5862,7 @@ var libraryMembershipEvent = defineConfig({
|
|
|
5803
5862
|
declaration: libraryMembershipForm
|
|
5804
5863
|
});
|
|
5805
5864
|
|
|
5806
|
-
// ../commons/src/fixtures/
|
|
5865
|
+
// ../commons/src/fixtures/v2-birth-event.ts
|
|
5807
5866
|
function generateTranslationConfig(message) {
|
|
5808
5867
|
return {
|
|
5809
5868
|
defaultMessage: message,
|
|
@@ -5832,61 +5891,6 @@ var child = defineFormPage({
|
|
|
5832
5891
|
secured: true,
|
|
5833
5892
|
validation: [],
|
|
5834
5893
|
label: generateTranslationConfig("Date of birth")
|
|
5835
|
-
},
|
|
5836
|
-
{
|
|
5837
|
-
id: "child.placeOfBirth",
|
|
5838
|
-
analytics: true,
|
|
5839
|
-
type: FieldType.SELECT,
|
|
5840
|
-
required: true,
|
|
5841
|
-
secured: true,
|
|
5842
|
-
label: {
|
|
5843
|
-
defaultMessage: "Place of delivery",
|
|
5844
|
-
description: "This is the label for the field",
|
|
5845
|
-
id: "event.birth.action.declare.form.section.child.field.placeOfBirth.label"
|
|
5846
|
-
},
|
|
5847
|
-
options: [
|
|
5848
|
-
{
|
|
5849
|
-
value: "child.placeOfBirth-SELECT-2",
|
|
5850
|
-
label: generateTranslationConfig("Health Institution")
|
|
5851
|
-
},
|
|
5852
|
-
{
|
|
5853
|
-
value: "PRIVATE_HOME",
|
|
5854
|
-
label: generateTranslationConfig("Residential address")
|
|
5855
|
-
}
|
|
5856
|
-
]
|
|
5857
|
-
},
|
|
5858
|
-
{
|
|
5859
|
-
id: "child.birthLocation",
|
|
5860
|
-
analytics: true,
|
|
5861
|
-
type: "FACILITY",
|
|
5862
|
-
required: true,
|
|
5863
|
-
secured: true,
|
|
5864
|
-
label: generateTranslationConfig("Health Institution"),
|
|
5865
|
-
conditionals: [
|
|
5866
|
-
{
|
|
5867
|
-
type: "SHOW",
|
|
5868
|
-
conditional: field("child.placeOfBirth").isEqualTo(
|
|
5869
|
-
"child.placeOfBirth-SELECT-2"
|
|
5870
|
-
)
|
|
5871
|
-
}
|
|
5872
|
-
]
|
|
5873
|
-
},
|
|
5874
|
-
{
|
|
5875
|
-
id: "child.birthLocation.privateHome",
|
|
5876
|
-
analytics: true,
|
|
5877
|
-
type: FieldType.ADDRESS,
|
|
5878
|
-
secured: true,
|
|
5879
|
-
hideLabel: true,
|
|
5880
|
-
label: generateTranslationConfig("Child's address"),
|
|
5881
|
-
conditionals: [
|
|
5882
|
-
{
|
|
5883
|
-
type: "SHOW",
|
|
5884
|
-
conditional: field("child.placeOfBirth").isEqualTo("PRIVATE_HOME")
|
|
5885
|
-
}
|
|
5886
|
-
],
|
|
5887
|
-
configuration: {
|
|
5888
|
-
streetAddressForm: []
|
|
5889
|
-
}
|
|
5890
5894
|
}
|
|
5891
5895
|
]
|
|
5892
5896
|
});
|
|
@@ -5963,7 +5967,7 @@ var mother = defineFormPage({
|
|
|
5963
5967
|
}
|
|
5964
5968
|
]
|
|
5965
5969
|
});
|
|
5966
|
-
var
|
|
5970
|
+
var BIRTH_DECLARATION_REVIEW = {
|
|
5967
5971
|
title: generateTranslationConfig(
|
|
5968
5972
|
"{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}}}}}"
|
|
5969
5973
|
),
|
|
@@ -5983,12 +5987,12 @@ var CHILD_ONBOARDING_DECLARATION_REVIEW = {
|
|
|
5983
5987
|
}
|
|
5984
5988
|
]
|
|
5985
5989
|
};
|
|
5986
|
-
var
|
|
5990
|
+
var BIRTH_DECLARATION_FORM = defineDeclarationForm({
|
|
5987
5991
|
label: generateTranslationConfig("Birth decalration form"),
|
|
5988
5992
|
pages: [child, mother]
|
|
5989
5993
|
});
|
|
5990
|
-
var
|
|
5991
|
-
id:
|
|
5994
|
+
var v2BirthEvent = defineConfig({
|
|
5995
|
+
id: BIRTH_EVENT,
|
|
5992
5996
|
title: generateTranslationConfig(
|
|
5993
5997
|
"{child.name.firstname} {child.name.surname}"
|
|
5994
5998
|
),
|
|
@@ -5996,33 +6000,35 @@ var ChildOnboardingEvent = defineConfig({
|
|
|
5996
6000
|
summary: {
|
|
5997
6001
|
fields: []
|
|
5998
6002
|
},
|
|
5999
|
-
declaration:
|
|
6003
|
+
declaration: BIRTH_DECLARATION_FORM,
|
|
6000
6004
|
actions: [
|
|
6001
6005
|
{
|
|
6002
6006
|
type: ActionType.READ,
|
|
6003
6007
|
label: generateTranslationConfig("Read"),
|
|
6004
|
-
review:
|
|
6008
|
+
review: BIRTH_DECLARATION_REVIEW
|
|
6005
6009
|
},
|
|
6006
6010
|
{
|
|
6007
6011
|
type: ActionType.DECLARE,
|
|
6008
6012
|
label: generateTranslationConfig("Declare"),
|
|
6009
|
-
review:
|
|
6013
|
+
review: BIRTH_DECLARATION_REVIEW
|
|
6010
6014
|
},
|
|
6011
6015
|
{
|
|
6012
6016
|
type: ActionType.VALIDATE,
|
|
6013
|
-
label: generateTranslationConfig("Validate")
|
|
6017
|
+
label: generateTranslationConfig("Validate"),
|
|
6018
|
+
review: BIRTH_DECLARATION_REVIEW
|
|
6014
6019
|
},
|
|
6015
6020
|
{
|
|
6016
6021
|
type: ActionType.REGISTER,
|
|
6017
|
-
label: generateTranslationConfig("Register")
|
|
6022
|
+
label: generateTranslationConfig("Register"),
|
|
6023
|
+
review: BIRTH_DECLARATION_REVIEW
|
|
6018
6024
|
}
|
|
6019
6025
|
],
|
|
6020
6026
|
advancedSearch: []
|
|
6021
6027
|
});
|
|
6022
6028
|
|
|
6023
6029
|
// ../commons/src/events/test.utils.ts
|
|
6024
|
-
var
|
|
6025
|
-
var TestUserRole =
|
|
6030
|
+
var import_zod35 = require("zod");
|
|
6031
|
+
var TestUserRole = import_zod35.z.enum([
|
|
6026
6032
|
"FIELD_AGENT",
|
|
6027
6033
|
"LOCAL_REGISTRAR",
|
|
6028
6034
|
"LOCAL_SYSTEM_ADMIN",
|
|
@@ -6033,7 +6039,7 @@ var TestUserRole = z37.enum([
|
|
|
6033
6039
|
]);
|
|
6034
6040
|
|
|
6035
6041
|
// ../commons/src/events/scopes.ts
|
|
6036
|
-
var
|
|
6042
|
+
var import_lodash5 = require("lodash");
|
|
6037
6043
|
var ACTION_SCOPE_MAP = {
|
|
6038
6044
|
[ActionType.READ]: ["record.read"],
|
|
6039
6045
|
[ActionType.CREATE]: ["record.create"],
|
|
@@ -6062,8 +6068,7 @@ var ACTION_SCOPE_MAP = {
|
|
|
6062
6068
|
[ActionType.REJECT]: ["record.declared.reject"],
|
|
6063
6069
|
[ActionType.ASSIGN]: null,
|
|
6064
6070
|
[ActionType.UNASSIGN]: null,
|
|
6065
|
-
[ActionType.DUPLICATE_DETECTED]: []
|
|
6066
|
-
[ActionType.CUSTOM]: []
|
|
6071
|
+
[ActionType.DUPLICATE_DETECTED]: []
|
|
6067
6072
|
};
|
|
6068
6073
|
|
|
6069
6074
|
// ../commons/src/events/state/availableActions.ts
|
|
@@ -6072,25 +6077,28 @@ var AVAILABLE_ACTIONS_BY_EVENT_STATUS = {
|
|
|
6072
6077
|
ActionType.READ,
|
|
6073
6078
|
ActionType.DECLARE,
|
|
6074
6079
|
ActionType.NOTIFY,
|
|
6075
|
-
ActionType.DELETE
|
|
6076
|
-
ActionType.CUSTOM
|
|
6080
|
+
ActionType.DELETE
|
|
6077
6081
|
],
|
|
6078
6082
|
[EventStatus.enum.NOTIFIED]: [
|
|
6079
6083
|
ActionType.READ,
|
|
6080
6084
|
ActionType.DECLARE,
|
|
6081
6085
|
ActionType.MARK_AS_DUPLICATE,
|
|
6082
6086
|
ActionType.ARCHIVE,
|
|
6083
|
-
ActionType.REJECT
|
|
6084
|
-
ActionType.CUSTOM
|
|
6087
|
+
ActionType.REJECT
|
|
6085
6088
|
],
|
|
6086
6089
|
[EventStatus.enum.DECLARED]: [
|
|
6087
6090
|
ActionType.READ,
|
|
6088
6091
|
ActionType.VALIDATE,
|
|
6092
|
+
ActionType.MARK_AS_DUPLICATE,
|
|
6093
|
+
ActionType.ARCHIVE,
|
|
6094
|
+
ActionType.REJECT
|
|
6095
|
+
],
|
|
6096
|
+
[EventStatus.enum.VALIDATED]: [
|
|
6097
|
+
ActionType.READ,
|
|
6089
6098
|
ActionType.REGISTER,
|
|
6090
6099
|
ActionType.MARK_AS_DUPLICATE,
|
|
6091
6100
|
ActionType.ARCHIVE,
|
|
6092
|
-
ActionType.REJECT
|
|
6093
|
-
ActionType.CUSTOM
|
|
6101
|
+
ActionType.REJECT
|
|
6094
6102
|
],
|
|
6095
6103
|
[EventStatus.enum.REGISTERED]: [
|
|
6096
6104
|
ActionType.READ,
|
|
@@ -6098,49 +6106,47 @@ var AVAILABLE_ACTIONS_BY_EVENT_STATUS = {
|
|
|
6098
6106
|
ActionType.REQUEST_CORRECTION,
|
|
6099
6107
|
ActionType.APPROVE_CORRECTION,
|
|
6100
6108
|
ActionType.REJECT_CORRECTION,
|
|
6101
|
-
ActionType.CUSTOM,
|
|
6102
6109
|
ClientSpecificAction.REVIEW_CORRECTION_REQUEST
|
|
6103
6110
|
],
|
|
6104
6111
|
[EventStatus.enum.ARCHIVED]: [
|
|
6105
6112
|
ActionType.READ,
|
|
6106
6113
|
ActionType.ASSIGN,
|
|
6107
|
-
ActionType.UNASSIGN
|
|
6108
|
-
ActionType.CUSTOM
|
|
6114
|
+
ActionType.UNASSIGN
|
|
6109
6115
|
]
|
|
6110
6116
|
};
|
|
6111
6117
|
var ACTION_FILTERS = {
|
|
6112
|
-
[ActionType.PRINT_CERTIFICATE]: (flags) => !flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((
|
|
6113
|
-
[ActionType.REQUEST_CORRECTION]: (flags) => !flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((
|
|
6114
|
-
[ClientSpecificAction.REVIEW_CORRECTION_REQUEST]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((
|
|
6115
|
-
[ActionType.APPROVE_CORRECTION]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((
|
|
6116
|
-
[ActionType.REJECT_CORRECTION]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((
|
|
6117
|
-
[ActionType.MARK_AS_DUPLICATE]: (flags) => flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((
|
|
6118
|
-
[ActionType.VALIDATE]: (flags) => !flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((
|
|
6119
|
-
[ActionType.REGISTER]: (flags) => !flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((
|
|
6120
|
-
[ActionType.REJECT]: (flags) => !flags.includes(InherentFlags.REJECTED) && !flags.some((
|
|
6121
|
-
[ActionType.ARCHIVE]: (flags) => !flags.some((
|
|
6118
|
+
[ActionType.PRINT_CERTIFICATE]: (flags) => !flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6119
|
+
[ActionType.REQUEST_CORRECTION]: (flags) => !flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6120
|
+
[ClientSpecificAction.REVIEW_CORRECTION_REQUEST]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6121
|
+
[ActionType.APPROVE_CORRECTION]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6122
|
+
[ActionType.REJECT_CORRECTION]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6123
|
+
[ActionType.MARK_AS_DUPLICATE]: (flags) => flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6124
|
+
[ActionType.VALIDATE]: (flags) => !flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6125
|
+
[ActionType.REGISTER]: (flags) => !flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6126
|
+
[ActionType.REJECT]: (flags) => !flags.includes(InherentFlags.REJECTED) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6127
|
+
[ActionType.ARCHIVE]: (flags) => !flags.some((flag) => flag.endsWith(":requested"))
|
|
6122
6128
|
};
|
|
6123
6129
|
|
|
6124
6130
|
// ../commons/src/events/FileUtils.ts
|
|
6125
|
-
var
|
|
6131
|
+
var import_lodash6 = require("lodash");
|
|
6126
6132
|
|
|
6127
6133
|
// ../commons/src/events/locations.ts
|
|
6128
|
-
var
|
|
6129
|
-
var LocationType =
|
|
6134
|
+
var import_zod36 = require("zod");
|
|
6135
|
+
var LocationType = import_zod36.z.enum([
|
|
6130
6136
|
"ADMIN_STRUCTURE",
|
|
6131
6137
|
"CRVS_OFFICE",
|
|
6132
6138
|
"HEALTH_FACILITY"
|
|
6133
6139
|
]);
|
|
6134
|
-
var Location =
|
|
6140
|
+
var Location = import_zod36.z.object({
|
|
6135
6141
|
id: UUID,
|
|
6136
|
-
name:
|
|
6142
|
+
name: import_zod36.z.string(),
|
|
6137
6143
|
parentId: UUID.nullable(),
|
|
6138
|
-
validUntil:
|
|
6144
|
+
validUntil: import_zod36.z.string().datetime().nullable(),
|
|
6139
6145
|
locationType: LocationType.nullable()
|
|
6140
6146
|
});
|
|
6141
6147
|
|
|
6142
6148
|
// ../commons/src/notification/UserNotifications.ts
|
|
6143
|
-
var
|
|
6149
|
+
var import_zod37 = require("zod");
|
|
6144
6150
|
var TriggerEvent = {
|
|
6145
6151
|
USER_CREATED: "user-created",
|
|
6146
6152
|
USER_UPDATED: "user-updated",
|
|
@@ -6152,50 +6158,50 @@ var TriggerEvent = {
|
|
|
6152
6158
|
CHANGE_PHONE_NUMBER: "change-phone-number",
|
|
6153
6159
|
CHANGE_EMAIL_ADDRESS: "change-email-address"
|
|
6154
6160
|
};
|
|
6155
|
-
var Recipient =
|
|
6161
|
+
var Recipient = import_zod37.z.object({
|
|
6156
6162
|
name: NameFieldValue.optional(),
|
|
6157
|
-
mobile:
|
|
6158
|
-
email:
|
|
6159
|
-
bcc:
|
|
6163
|
+
mobile: import_zod37.z.string().optional(),
|
|
6164
|
+
email: import_zod37.z.string().optional(),
|
|
6165
|
+
bcc: import_zod37.z.array(import_zod37.z.string()).optional()
|
|
6160
6166
|
});
|
|
6161
|
-
var BasePayload =
|
|
6167
|
+
var BasePayload = import_zod37.z.object({
|
|
6162
6168
|
recipient: Recipient
|
|
6163
6169
|
});
|
|
6164
6170
|
var TriggerPayload = {
|
|
6165
6171
|
[TriggerEvent.USER_CREATED]: BasePayload.extend({
|
|
6166
|
-
username:
|
|
6167
|
-
temporaryPassword:
|
|
6172
|
+
username: import_zod37.z.string(),
|
|
6173
|
+
temporaryPassword: import_zod37.z.string()
|
|
6168
6174
|
}),
|
|
6169
6175
|
[TriggerEvent.USER_UPDATED]: BasePayload.extend({
|
|
6170
|
-
oldUsername:
|
|
6171
|
-
newUsername:
|
|
6176
|
+
oldUsername: import_zod37.z.string(),
|
|
6177
|
+
newUsername: import_zod37.z.string()
|
|
6172
6178
|
}),
|
|
6173
6179
|
[TriggerEvent.USERNAME_REMINDER]: BasePayload.extend({
|
|
6174
|
-
username:
|
|
6180
|
+
username: import_zod37.z.string()
|
|
6175
6181
|
}),
|
|
6176
6182
|
[TriggerEvent.RESET_PASSWORD]: BasePayload.extend({
|
|
6177
|
-
code:
|
|
6183
|
+
code: import_zod37.z.string()
|
|
6178
6184
|
}),
|
|
6179
6185
|
[TriggerEvent.RESET_PASSWORD_BY_ADMIN]: BasePayload.extend({
|
|
6180
|
-
temporaryPassword:
|
|
6181
|
-
admin:
|
|
6182
|
-
id:
|
|
6186
|
+
temporaryPassword: import_zod37.z.string(),
|
|
6187
|
+
admin: import_zod37.z.object({
|
|
6188
|
+
id: import_zod37.z.string(),
|
|
6183
6189
|
name: NameFieldValue,
|
|
6184
|
-
role:
|
|
6190
|
+
role: import_zod37.z.string()
|
|
6185
6191
|
})
|
|
6186
6192
|
}),
|
|
6187
6193
|
[TriggerEvent.TWO_FA]: BasePayload.extend({
|
|
6188
|
-
code:
|
|
6194
|
+
code: import_zod37.z.string()
|
|
6189
6195
|
}),
|
|
6190
6196
|
[TriggerEvent.ALL_USER_NOTIFICATION]: BasePayload.extend({
|
|
6191
|
-
subject:
|
|
6192
|
-
body:
|
|
6197
|
+
subject: import_zod37.z.string(),
|
|
6198
|
+
body: import_zod37.z.string()
|
|
6193
6199
|
}),
|
|
6194
6200
|
[TriggerEvent.CHANGE_PHONE_NUMBER]: BasePayload.extend({
|
|
6195
|
-
code:
|
|
6201
|
+
code: import_zod37.z.string()
|
|
6196
6202
|
}),
|
|
6197
6203
|
[TriggerEvent.CHANGE_EMAIL_ADDRESS]: BasePayload.extend({
|
|
6198
|
-
code:
|
|
6204
|
+
code: import_zod37.z.string()
|
|
6199
6205
|
})
|
|
6200
6206
|
};
|
|
6201
6207
|
async function triggerUserEventNotification({
|
|
@@ -6217,6 +6223,3 @@ function parseUserEventTrigger(event2, body) {
|
|
|
6217
6223
|
const schema = TriggerPayload[event2];
|
|
6218
6224
|
return schema.parse(body);
|
|
6219
6225
|
}
|
|
6220
|
-
|
|
6221
|
-
// src/notification/index.ts
|
|
6222
|
-
z40.globalRegistry.clear();
|