@opencrvs/toolkit 1.9.4-rc.0e695b2 → 1.9.4-rc.469f912
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 +2440 -28495
- 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 +1552 -23416
- package/dist/commons/events/ActionDocument.d.ts +1856 -803
- package/dist/commons/events/ActionInput.d.ts +1073 -277
- package/dist/commons/events/ActionType.d.ts +9 -86
- package/dist/commons/events/AdvancedSearchConfig.d.ts +1238 -228
- package/dist/commons/events/CompositeFieldValue.d.ts +176 -27
- 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 -931
- 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 +2120 -18663
- package/dist/commons/events/EventConfigInput.d.ts +1 -1
- package/dist/commons/events/EventDocument.d.ts +1332 -320
- package/dist/commons/events/EventIndex.d.ts +967 -197
- package/dist/commons/events/EventInput.d.ts +8 -2
- package/dist/commons/events/EventMetadata.d.ts +346 -106
- package/dist/commons/events/FieldConfig.d.ts +11774 -4259
- package/dist/commons/events/FieldType.d.ts +4 -20
- package/dist/commons/events/FieldTypeMapping.d.ts +813 -181
- package/dist/commons/events/FieldValue.d.ts +356 -83
- package/dist/commons/events/FormConfig.d.ts +721 -13140
- package/dist/commons/events/PageConfig.d.ts +319 -8780
- package/dist/commons/events/SummaryConfig.d.ts +161 -14
- package/dist/commons/events/TemplateConfig.d.ts +3 -3
- package/dist/commons/events/TranslationConfig.d.ts +2 -2
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +37 -74
- package/dist/commons/events/WorkqueueConfig.d.ts +7080 -1615
- package/dist/commons/events/deduplication.d.ts +3 -3
- package/dist/commons/events/defineConfig.d.ts +163 -25639
- package/dist/commons/events/event.d.ts +4 -4
- 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 +4 -5
- 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 -23
- package/dist/commons/events/state/utils.d.ts +112 -130
- package/dist/commons/events/test.utils.d.ts +8 -17
- package/dist/commons/events/transactions.d.ts +1 -1
- package/dist/commons/events/utils.d.ts +373 -51350
- 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 +1545 -1805
- package/dist/notification/index.d.ts.map +1 -1
- package/dist/notification/index.js +1412 -1430
- package/dist/scopes/index.d.ts +132 -167
- package/dist/scopes/index.d.ts.map +1 -1
- package/dist/scopes/index.js +94 -133
- package/package.json +5 -5
- package/dist/commons/events/Flag.d.ts +0 -70
|
@@ -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",
|
|
@@ -77,8 +78,8 @@ var ActionType = {
|
|
|
77
78
|
NOTIFY: "NOTIFY",
|
|
78
79
|
// Declaration actions
|
|
79
80
|
DECLARE: "DECLARE",
|
|
81
|
+
VALIDATE: "VALIDATE",
|
|
80
82
|
REGISTER: "REGISTER",
|
|
81
|
-
EDIT: "EDIT",
|
|
82
83
|
// Declaration system actions. Non-configurable.
|
|
83
84
|
DUPLICATE_DETECTED: "DUPLICATE_DETECTED",
|
|
84
85
|
REJECT: "REJECT",
|
|
@@ -94,29 +95,26 @@ 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,
|
|
103
102
|
ActionType.DECLARE,
|
|
104
|
-
ActionType.
|
|
103
|
+
ActionType.VALIDATE,
|
|
105
104
|
ActionType.REGISTER,
|
|
106
105
|
ActionType.REJECT,
|
|
107
106
|
ActionType.ARCHIVE,
|
|
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",
|
|
118
116
|
"DECLARE",
|
|
119
|
-
"
|
|
117
|
+
"VALIDATE",
|
|
120
118
|
"REGISTER",
|
|
121
119
|
"DUPLICATE_DETECTED",
|
|
122
120
|
"REJECT",
|
|
@@ -129,15 +127,14 @@ 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"
|
|
137
134
|
};
|
|
138
135
|
var declarationActionValues = [
|
|
139
136
|
ActionTypes.enum.DECLARE,
|
|
140
|
-
ActionTypes.enum.
|
|
137
|
+
ActionTypes.enum.VALIDATE,
|
|
141
138
|
ActionTypes.enum.REGISTER,
|
|
142
139
|
ActionTypes.enum.NOTIFY,
|
|
143
140
|
ActionTypes.enum.DUPLICATE_DETECTED
|
|
@@ -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",
|
|
@@ -266,21 +264,9 @@ var FieldType = {
|
|
|
266
264
|
QUERY_PARAM_READER: "QUERY_PARAM_READER",
|
|
267
265
|
QR_READER: "QR_READER",
|
|
268
266
|
ID_READER: "ID_READER",
|
|
269
|
-
LOADER: "LOADER"
|
|
270
|
-
ALPHA_HIDDEN: "ALPHA_HIDDEN",
|
|
271
|
-
/**
|
|
272
|
-
* @internal
|
|
273
|
-
* @experimental
|
|
274
|
-
*
|
|
275
|
-
* Internal API used by the OpenCRVS core team for experimentation.
|
|
276
|
-
*
|
|
277
|
-
* This component is not part of the public, stable API.
|
|
278
|
-
* Its shape, behavior, or existence may change at any time or be removed
|
|
279
|
-
* entirely without notice.
|
|
280
|
-
*/
|
|
281
|
-
_EXPERIMENTAL_CUSTOM: "CUSTOM"
|
|
267
|
+
LOADER: "LOADER"
|
|
282
268
|
};
|
|
283
|
-
var FileFieldType =
|
|
269
|
+
var FileFieldType = import_zod4.z.enum([
|
|
284
270
|
FieldType.FILE,
|
|
285
271
|
FieldType.FILE_WITH_OPTIONS,
|
|
286
272
|
FieldType.SIGNATURE
|
|
@@ -303,147 +289,146 @@ var FieldTypesToHideInReview = [
|
|
|
303
289
|
FieldType.LOADER,
|
|
304
290
|
FieldType.HTTP,
|
|
305
291
|
FieldType.QUERY_PARAM_READER,
|
|
306
|
-
FieldType.DATA
|
|
307
|
-
FieldType.ALPHA_HIDDEN
|
|
292
|
+
FieldType.DATA
|
|
308
293
|
];
|
|
309
294
|
|
|
310
295
|
// ../commons/src/events/FieldValue.ts
|
|
311
|
-
var
|
|
296
|
+
var import_zod7 = require("zod");
|
|
312
297
|
|
|
313
298
|
// ../commons/src/documents.ts
|
|
314
|
-
var
|
|
315
|
-
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(
|
|
316
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"
|
|
317
304
|
);
|
|
318
|
-
var FullDocumentPath =
|
|
305
|
+
var FullDocumentPath = import_zod5.z.string().transform((val) => val.startsWith("/") ? val : `/${val}`).openapi({ effectType: "input", type: "string" }).describe(
|
|
319
306
|
"A full absolute path with bucket name, starting from the root of the S3 server, /bucket-name/document-id.jpg"
|
|
320
307
|
);
|
|
321
|
-
var DocumentPath =
|
|
308
|
+
var DocumentPath = import_zod5.z.string().brand("DocumentPath").describe(
|
|
322
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"
|
|
323
310
|
);
|
|
324
311
|
|
|
325
312
|
// ../commons/src/events/CompositeFieldValue.ts
|
|
326
|
-
var
|
|
313
|
+
var import_zod6 = require("zod");
|
|
327
314
|
var AddressType = {
|
|
328
315
|
DOMESTIC: "DOMESTIC",
|
|
329
316
|
INTERNATIONAL: "INTERNATIONAL"
|
|
330
317
|
};
|
|
331
|
-
var FileFieldValue =
|
|
318
|
+
var FileFieldValue = import_zod6.z.object({
|
|
332
319
|
path: FullDocumentPath,
|
|
333
|
-
originalFilename:
|
|
334
|
-
type:
|
|
320
|
+
originalFilename: import_zod6.z.string(),
|
|
321
|
+
type: import_zod6.z.string()
|
|
335
322
|
});
|
|
336
|
-
var NameFieldValue =
|
|
337
|
-
firstname:
|
|
338
|
-
surname:
|
|
339
|
-
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()
|
|
340
327
|
});
|
|
341
|
-
var NameFieldUpdateValue =
|
|
342
|
-
firstname:
|
|
343
|
-
surname:
|
|
344
|
-
middlename:
|
|
345
|
-
}).or(
|
|
346
|
-
var StreetLevelDetailsValue =
|
|
347
|
-
var StreetLevelDetailsUpdateValue =
|
|
348
|
-
var BaseAddressFieldValue =
|
|
349
|
-
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(),
|
|
350
337
|
streetLevelDetails: StreetLevelDetailsValue
|
|
351
338
|
});
|
|
352
|
-
var BaseAddressFieldUpdateValue =
|
|
353
|
-
country:
|
|
339
|
+
var BaseAddressFieldUpdateValue = import_zod6.z.object({
|
|
340
|
+
country: import_zod6.z.string().nullish(),
|
|
354
341
|
streetLevelDetails: StreetLevelDetailsUpdateValue
|
|
355
342
|
});
|
|
356
343
|
var DomesticAddressFieldValue = BaseAddressFieldValue.extend({
|
|
357
|
-
addressType:
|
|
358
|
-
administrativeArea:
|
|
344
|
+
addressType: import_zod6.z.literal(AddressType.DOMESTIC),
|
|
345
|
+
administrativeArea: import_zod6.z.string().uuid()
|
|
359
346
|
});
|
|
360
347
|
var InternationalAddressFieldValue = BaseAddressFieldValue.extend({
|
|
361
|
-
addressType:
|
|
348
|
+
addressType: import_zod6.z.literal(AddressType.INTERNATIONAL)
|
|
362
349
|
});
|
|
363
|
-
var AddressFieldValue =
|
|
350
|
+
var AddressFieldValue = import_zod6.z.discriminatedUnion("addressType", [
|
|
364
351
|
DomesticAddressFieldValue,
|
|
365
352
|
InternationalAddressFieldValue
|
|
366
353
|
]);
|
|
367
354
|
var DomesticAddressUpdateFieldValue = BaseAddressFieldUpdateValue.extend({
|
|
368
|
-
addressType:
|
|
369
|
-
administrativeArea:
|
|
355
|
+
addressType: import_zod6.z.literal(AddressType.DOMESTIC),
|
|
356
|
+
administrativeArea: import_zod6.z.string().uuid().nullish()
|
|
370
357
|
/* Leaf level admin structure */
|
|
371
358
|
});
|
|
372
359
|
var InternationalAddressUpdateFieldValue = BaseAddressFieldUpdateValue.extend(
|
|
373
360
|
{
|
|
374
|
-
addressType:
|
|
361
|
+
addressType: import_zod6.z.literal(AddressType.INTERNATIONAL)
|
|
375
362
|
}
|
|
376
363
|
);
|
|
377
|
-
var AddressFieldUpdateValue =
|
|
364
|
+
var AddressFieldUpdateValue = import_zod6.z.discriminatedUnion("addressType", [
|
|
378
365
|
DomesticAddressUpdateFieldValue,
|
|
379
366
|
InternationalAddressUpdateFieldValue
|
|
380
367
|
]).nullish();
|
|
381
|
-
var FileFieldValueWithOption =
|
|
368
|
+
var FileFieldValueWithOption = import_zod6.z.object({
|
|
382
369
|
path: FullDocumentPath,
|
|
383
|
-
originalFilename:
|
|
384
|
-
type:
|
|
385
|
-
option:
|
|
370
|
+
originalFilename: import_zod6.z.string(),
|
|
371
|
+
type: import_zod6.z.string(),
|
|
372
|
+
option: import_zod6.z.string()
|
|
386
373
|
});
|
|
387
|
-
var FileFieldWithOptionValue =
|
|
388
|
-
var HttpFieldValue =
|
|
389
|
-
loading:
|
|
390
|
-
error:
|
|
391
|
-
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()
|
|
392
379
|
});
|
|
393
|
-
var HttpFieldUpdateValue =
|
|
394
|
-
loading:
|
|
395
|
-
error:
|
|
396
|
-
data:
|
|
397
|
-
}).or(
|
|
398
|
-
var QueryParamReaderFieldValue =
|
|
399
|
-
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())
|
|
400
387
|
}).nullish();
|
|
401
|
-
var QueryParamReaderFieldUpdateValue =
|
|
402
|
-
data:
|
|
388
|
+
var QueryParamReaderFieldUpdateValue = import_zod6.z.object({
|
|
389
|
+
data: import_zod6.z.record(import_zod6.z.string(), import_zod6.z.string())
|
|
403
390
|
});
|
|
404
|
-
var ReadDataValue =
|
|
405
|
-
data:
|
|
391
|
+
var ReadDataValue = import_zod6.z.object({
|
|
392
|
+
data: import_zod6.z.any()
|
|
406
393
|
});
|
|
407
394
|
var QrReaderFieldValue = ReadDataValue;
|
|
408
395
|
var IdReaderFieldValue = ReadDataValue;
|
|
409
|
-
var CustomFieldValue = z6.unknown().brand("CustomFieldValue");
|
|
410
396
|
|
|
411
397
|
// ../commons/src/events/FieldValue.ts
|
|
412
|
-
var TextValue =
|
|
413
|
-
var HiddenFieldValue = z7.string();
|
|
398
|
+
var TextValue = import_zod7.z.string();
|
|
414
399
|
var NonEmptyTextValue = TextValue.min(1);
|
|
415
|
-
var DateValue =
|
|
416
|
-
var AgeValue =
|
|
417
|
-
age:
|
|
418
|
-
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()
|
|
419
404
|
});
|
|
420
405
|
var AgeUpdateValue = AgeValue.optional().nullable();
|
|
421
|
-
var TimeValue =
|
|
422
|
-
var DatetimeValue =
|
|
423
|
-
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([
|
|
424
409
|
"last7Days",
|
|
425
410
|
"last30Days",
|
|
426
411
|
"last90Days",
|
|
427
412
|
"last365Days"
|
|
428
413
|
]);
|
|
429
|
-
var DateRangeFieldValue =
|
|
414
|
+
var DateRangeFieldValue = import_zod7.z.object({
|
|
430
415
|
start: DateValue,
|
|
431
416
|
end: DateValue
|
|
432
417
|
}).or(DateValue).describe(
|
|
433
418
|
"Date range with start and end dates in the format YYYY-MM-DD. Inclusive start, exclusive end."
|
|
434
419
|
);
|
|
435
|
-
var EmailValue =
|
|
436
|
-
var CheckboxFieldValue =
|
|
437
|
-
var NumberFieldValue =
|
|
438
|
-
var SignatureFieldValue =
|
|
439
|
-
var ButtonFieldValue =
|
|
440
|
-
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([
|
|
441
426
|
"verified",
|
|
442
427
|
"authenticated",
|
|
443
428
|
"failed",
|
|
444
429
|
"pending"
|
|
445
430
|
]);
|
|
446
|
-
var FieldValuesWithoutDataField =
|
|
431
|
+
var FieldValuesWithoutDataField = import_zod7.z.union([
|
|
447
432
|
AddressFieldValue,
|
|
448
433
|
TextValue,
|
|
449
434
|
DateValue,
|
|
@@ -462,13 +447,12 @@ var FieldValuesWithoutDataField = z7.union([
|
|
|
462
447
|
VerificationStatusValue,
|
|
463
448
|
QueryParamReaderFieldValue,
|
|
464
449
|
QrReaderFieldValue,
|
|
465
|
-
IdReaderFieldValue
|
|
466
|
-
CustomFieldValue
|
|
450
|
+
IdReaderFieldValue
|
|
467
451
|
]);
|
|
468
|
-
var DataFieldValue =
|
|
469
|
-
data:
|
|
452
|
+
var DataFieldValue = import_zod7.z.object({
|
|
453
|
+
data: import_zod7.z.record(import_zod7.z.string(), FieldValuesWithoutDataField)
|
|
470
454
|
}).nullish();
|
|
471
|
-
var FieldValue =
|
|
455
|
+
var FieldValue = import_zod7.z.union([
|
|
472
456
|
FieldValuesWithoutDataField,
|
|
473
457
|
DataFieldValue
|
|
474
458
|
]);
|
|
@@ -488,38 +472,22 @@ var PRIORITY_ORDER = [
|
|
|
488
472
|
"DataFieldValue"
|
|
489
473
|
];
|
|
490
474
|
function schemaPriority(schema) {
|
|
491
|
-
const name = schema.description;
|
|
492
|
-
if (!name) {
|
|
493
|
-
return 9999;
|
|
494
|
-
}
|
|
475
|
+
const name = schema._def?.description;
|
|
495
476
|
const idx = PRIORITY_ORDER.indexOf(name);
|
|
496
477
|
return idx === -1 ? 9999 : idx;
|
|
497
478
|
}
|
|
498
479
|
function safeUnion(schemas) {
|
|
499
|
-
return
|
|
480
|
+
return import_zod7.z.custom((val) => {
|
|
500
481
|
const successful = schemas.filter((s) => s.safeParse(val).success);
|
|
501
482
|
if (successful.length === 1) {
|
|
502
|
-
return;
|
|
483
|
+
return true;
|
|
503
484
|
}
|
|
504
485
|
if (successful.length === 0) {
|
|
505
|
-
|
|
506
|
-
code: "invalid_type",
|
|
507
|
-
expected: "custom",
|
|
508
|
-
message: "Value does not match any schema"
|
|
509
|
-
});
|
|
510
|
-
return;
|
|
486
|
+
return false;
|
|
511
487
|
}
|
|
512
488
|
successful.sort((a, b) => schemaPriority(a) - schemaPriority(b));
|
|
513
489
|
const best = successful[0];
|
|
514
|
-
|
|
515
|
-
ctx.addIssue({
|
|
516
|
-
expected: "custom",
|
|
517
|
-
code: "invalid_type",
|
|
518
|
-
message: "Value did not match the best schema"
|
|
519
|
-
});
|
|
520
|
-
}
|
|
521
|
-
}).meta({
|
|
522
|
-
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;
|
|
523
491
|
});
|
|
524
492
|
}
|
|
525
493
|
var FieldUpdateValue = safeUnion([
|
|
@@ -537,23 +505,24 @@ var FieldUpdateValue = safeUnion([
|
|
|
537
505
|
DataFieldValue.describe("DataFieldValue"),
|
|
538
506
|
NameFieldUpdateValue.describe("NameFieldUpdateValue"),
|
|
539
507
|
HttpFieldUpdateValue.describe("HttpFieldUpdateValue"),
|
|
540
|
-
QueryParamReaderFieldUpdateValue.describe("QueryParamReaderFieldUpdateValue")
|
|
541
|
-
CustomFieldValue.describe("CustomFieldValue"),
|
|
542
|
-
HiddenFieldValue.describe("HiddenFieldValue")
|
|
508
|
+
QueryParamReaderFieldUpdateValue.describe("QueryParamReaderFieldUpdateValue")
|
|
543
509
|
]);
|
|
544
510
|
|
|
511
|
+
// ../commons/src/events/FieldConfig.ts
|
|
512
|
+
var import_zod_openapi6 = require("zod-openapi");
|
|
513
|
+
|
|
545
514
|
// ../commons/src/uuid.ts
|
|
546
515
|
var import_uuid = require("uuid");
|
|
547
|
-
var
|
|
548
|
-
var UUID =
|
|
516
|
+
var import_zod8 = require("zod");
|
|
517
|
+
var UUID = import_zod8.z.string().uuid().brand("UUID");
|
|
549
518
|
function getUUID() {
|
|
550
519
|
return (0, import_uuid.v4)();
|
|
551
520
|
}
|
|
552
521
|
|
|
553
522
|
// ../commons/src/events/serializers/user/serializer.ts
|
|
554
|
-
var
|
|
555
|
-
var SerializedUserField =
|
|
556
|
-
$userField:
|
|
523
|
+
var import_zod9 = require("zod");
|
|
524
|
+
var SerializedUserField = import_zod9.z.object({
|
|
525
|
+
$userField: import_zod9.z.enum([
|
|
557
526
|
"id",
|
|
558
527
|
"name",
|
|
559
528
|
"role",
|
|
@@ -561,7 +530,7 @@ var SerializedUserField = z9.object({
|
|
|
561
530
|
"avatar",
|
|
562
531
|
"primaryOfficeId"
|
|
563
532
|
]),
|
|
564
|
-
$location:
|
|
533
|
+
$location: import_zod9.z.string().optional()
|
|
565
534
|
});
|
|
566
535
|
function userSerializer(userField) {
|
|
567
536
|
return {
|
|
@@ -581,23 +550,24 @@ function userSerializer(userField) {
|
|
|
581
550
|
}
|
|
582
551
|
|
|
583
552
|
// ../commons/src/events/EventIndex.ts
|
|
584
|
-
var
|
|
553
|
+
var import_zod14 = require("zod");
|
|
585
554
|
|
|
586
555
|
// ../commons/src/events/EventMetadata.ts
|
|
587
|
-
var
|
|
556
|
+
var import_zod13 = require("zod");
|
|
588
557
|
|
|
589
558
|
// ../commons/src/events/ActionDocument.ts
|
|
590
|
-
var
|
|
559
|
+
var import_zod12 = require("zod");
|
|
560
|
+
var import_zod_openapi4 = require("zod-openapi");
|
|
591
561
|
|
|
592
562
|
// ../commons/src/events/CreatedAtLocation.ts
|
|
593
563
|
var CreatedAtLocation = UUID.nullish();
|
|
594
564
|
|
|
595
565
|
// ../commons/src/authentication.ts
|
|
596
566
|
var import_jwt_decode = __toESM(require("jwt-decode"));
|
|
597
|
-
var
|
|
567
|
+
var import_zod11 = require("zod");
|
|
598
568
|
|
|
599
569
|
// ../commons/src/scopes.ts
|
|
600
|
-
var
|
|
570
|
+
var import_zod10 = require("zod");
|
|
601
571
|
var SCOPES = {
|
|
602
572
|
// TODO v1.8 legacy scopes
|
|
603
573
|
BYPASSRATELIMIT: "bypassratelimit",
|
|
@@ -676,91 +646,91 @@ var SCOPES = {
|
|
|
676
646
|
// data seeding
|
|
677
647
|
USER_DATA_SEEDING: "user.data-seeding"
|
|
678
648
|
};
|
|
679
|
-
var LegacyScopes =
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
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)
|
|
684
654
|
]);
|
|
685
|
-
var IntegrationScopes =
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
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)
|
|
690
660
|
]);
|
|
691
|
-
var InternalOperationsScopes =
|
|
692
|
-
|
|
693
|
-
|
|
661
|
+
var InternalOperationsScopes = import_zod10.z.union([
|
|
662
|
+
import_zod10.z.literal(SCOPES.RECORD_REINDEX),
|
|
663
|
+
import_zod10.z.literal(SCOPES.RECORD_IMPORT)
|
|
694
664
|
]);
|
|
695
|
-
var DeclareScopes =
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
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)
|
|
704
674
|
]);
|
|
705
|
-
var UnassignScope =
|
|
706
|
-
var ValidateScopes =
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
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)
|
|
713
683
|
]);
|
|
714
|
-
var RegisterScope =
|
|
715
|
-
var CorrectionScopes =
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
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)
|
|
720
690
|
]);
|
|
721
|
-
var SearchScopes =
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
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)
|
|
728
698
|
]);
|
|
729
|
-
var AuditScopes =
|
|
730
|
-
var PerformanceScopes =
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
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)
|
|
734
704
|
]);
|
|
735
|
-
var OrganisationScopes =
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
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)
|
|
739
709
|
]);
|
|
740
|
-
var UserScopes =
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
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)
|
|
749
719
|
]);
|
|
750
|
-
var ConfigScope =
|
|
751
|
-
var DataSeedingScope =
|
|
752
|
-
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([
|
|
753
723
|
LegacyScopes,
|
|
754
724
|
IntegrationScopes,
|
|
755
725
|
UnassignScope,
|
|
756
726
|
DeclareScopes,
|
|
757
727
|
ValidateScopes,
|
|
758
728
|
RegisterScope,
|
|
759
|
-
|
|
729
|
+
import_zod10.z.literal(SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES),
|
|
760
730
|
CorrectionScopes,
|
|
761
731
|
SearchScopes,
|
|
762
732
|
AuditScopes,
|
|
763
|
-
|
|
733
|
+
import_zod10.z.literal(SCOPES.PROFILE_ELECTRONIC_SIGNATURE),
|
|
764
734
|
PerformanceScopes,
|
|
765
735
|
OrganisationScopes,
|
|
766
736
|
UserScopes,
|
|
@@ -769,38 +739,38 @@ var LiteralScopes = z10.union([
|
|
|
769
739
|
InternalOperationsScopes
|
|
770
740
|
]);
|
|
771
741
|
var rawConfigurableScopeRegex = /^([a-zA-Z][a-zA-Z0-9.-]*(?:\.[a-zA-Z0-9.-]+)*)\[((?:\w+=[\w.-]+(?:\|[\w.-]+)*)(?:,[\w]+=[\w.-]+(?:\|[\w.-]+)*)*)\]$/;
|
|
772
|
-
var rawConfigurableScope =
|
|
773
|
-
var CreateUserScope =
|
|
774
|
-
type:
|
|
775
|
-
options:
|
|
776
|
-
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())
|
|
777
747
|
})
|
|
778
748
|
});
|
|
779
|
-
var EditUserScope =
|
|
780
|
-
type:
|
|
781
|
-
options:
|
|
782
|
-
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())
|
|
783
753
|
})
|
|
784
754
|
});
|
|
785
|
-
var WorkqueueScope =
|
|
786
|
-
type:
|
|
787
|
-
options:
|
|
788
|
-
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())
|
|
789
759
|
})
|
|
790
760
|
});
|
|
791
|
-
var SearchScope =
|
|
792
|
-
type:
|
|
793
|
-
options:
|
|
794
|
-
event:
|
|
795
|
-
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)
|
|
796
766
|
})
|
|
797
767
|
});
|
|
798
|
-
var RecordScopeType =
|
|
768
|
+
var RecordScopeType = import_zod10.z.enum([
|
|
799
769
|
"record.create",
|
|
800
770
|
"record.read",
|
|
801
771
|
"record.declare",
|
|
802
772
|
"record.notify",
|
|
803
|
-
"record.declared.
|
|
773
|
+
"record.declared.validate",
|
|
804
774
|
"record.declared.reject",
|
|
805
775
|
"record.declared.archive",
|
|
806
776
|
"record.declared.review-duplicates",
|
|
@@ -810,40 +780,27 @@ var RecordScopeType = z10.enum([
|
|
|
810
780
|
"record.registered.correct",
|
|
811
781
|
"record.unassign-others"
|
|
812
782
|
]);
|
|
813
|
-
var RecordScope =
|
|
783
|
+
var RecordScope = import_zod10.z.object({
|
|
814
784
|
type: RecordScopeType,
|
|
815
|
-
options:
|
|
816
|
-
event:
|
|
785
|
+
options: import_zod10.z.object({
|
|
786
|
+
event: import_zod10.z.array(import_zod10.z.string()).describe("Event type, e.g. birth, death")
|
|
817
787
|
})
|
|
818
788
|
}).describe(
|
|
819
789
|
"Scopes used to check user's permission to perform actions on a record."
|
|
820
790
|
);
|
|
821
|
-
var
|
|
822
|
-
type: z10.literal("record.custom-action"),
|
|
823
|
-
options: z10.object({
|
|
824
|
-
event: z10.array(z10.string()).describe("Allowed event type, e.g. birth, death"),
|
|
825
|
-
customActionType: z10.array(z10.string()).describe("Allowed custom action types")
|
|
826
|
-
})
|
|
827
|
-
});
|
|
828
|
-
var ConfigurableRawScopes = z10.discriminatedUnion("type", [
|
|
791
|
+
var ConfigurableRawScopes = import_zod10.z.discriminatedUnion("type", [
|
|
829
792
|
SearchScope,
|
|
830
793
|
CreateUserScope,
|
|
831
794
|
EditUserScope,
|
|
832
795
|
WorkqueueScope,
|
|
833
|
-
RecordScope
|
|
834
|
-
CustomActionScope
|
|
835
|
-
]);
|
|
836
|
-
var ConfigurableActionScopes = z10.discriminatedUnion("type", [
|
|
837
|
-
// @TODO - Record scope holds non-action scopes as well e.g., `record.read`
|
|
838
|
-
RecordScope,
|
|
839
|
-
CustomActionScope
|
|
796
|
+
RecordScope
|
|
840
797
|
]);
|
|
841
798
|
var scopes = Object.values(SCOPES);
|
|
842
|
-
var ActionScopes =
|
|
799
|
+
var ActionScopes = import_zod10.z.union([
|
|
843
800
|
DeclareScopes,
|
|
844
801
|
ValidateScopes,
|
|
845
802
|
RegisterScope,
|
|
846
|
-
|
|
803
|
+
import_zod10.z.literal(SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES),
|
|
847
804
|
CorrectionScopes
|
|
848
805
|
]);
|
|
849
806
|
|
|
@@ -977,14 +934,15 @@ var DEFAULT_ROLES_DEFINITION = [
|
|
|
977
934
|
]
|
|
978
935
|
}
|
|
979
936
|
];
|
|
980
|
-
var TokenUserType =
|
|
981
|
-
var TokenWithBearer =
|
|
937
|
+
var TokenUserType = import_zod11.z.enum(["user", "system"]);
|
|
938
|
+
var TokenWithBearer = import_zod11.z.string().regex(/^Bearer\s/);
|
|
982
939
|
|
|
983
940
|
// ../commons/src/events/ActionDocument.ts
|
|
984
|
-
|
|
941
|
+
(0, import_zod_openapi4.extendZodWithOpenApi)(import_zod12.z);
|
|
942
|
+
var ActionUpdate = import_zod12.z.record(import_zod12.z.string(), FieldUpdateValue).describe(
|
|
985
943
|
"Record of field-level changes made by an action. Supports partial updates and nullable values."
|
|
986
944
|
);
|
|
987
|
-
var EventState =
|
|
945
|
+
var EventState = import_zod12.z.record(import_zod12.z.string(), FieldValue).describe(
|
|
988
946
|
"Aggregate representation of event data after all actions have been applied, with all updates consolidated and null values removed."
|
|
989
947
|
);
|
|
990
948
|
var ActionStatus = {
|
|
@@ -992,16 +950,16 @@ var ActionStatus = {
|
|
|
992
950
|
Accepted: "Accepted",
|
|
993
951
|
Rejected: "Rejected"
|
|
994
952
|
};
|
|
995
|
-
var ActionBase =
|
|
953
|
+
var ActionBase = import_zod12.z.object({
|
|
996
954
|
id: UUID.describe("Unique identifier of the action."),
|
|
997
|
-
transactionId:
|
|
955
|
+
transactionId: import_zod12.z.string().describe("Unique identifier of the transaction."),
|
|
998
956
|
createdByUserType: TokenUserType.describe(
|
|
999
957
|
"Indicates whether the action was created by a human-user or by a system-user."
|
|
1000
958
|
),
|
|
1001
|
-
createdAt:
|
|
1002
|
-
createdBy:
|
|
1003
|
-
createdByRole:
|
|
1004
|
-
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."),
|
|
1005
963
|
createdAtLocation: CreatedAtLocation.describe(
|
|
1006
964
|
"Reference to the location of the user who created the action."
|
|
1007
965
|
),
|
|
@@ -1009,7 +967,7 @@ var ActionBase = z12.object({
|
|
|
1009
967
|
"Declaration data defined by the ActionConfig. Supports partial updates."
|
|
1010
968
|
),
|
|
1011
969
|
annotation: ActionUpdate.optional().nullable().describe("Action-specific metadata used to annotate the event."),
|
|
1012
|
-
status:
|
|
970
|
+
status: import_zod12.z.enum([
|
|
1013
971
|
ActionStatus.Requested,
|
|
1014
972
|
ActionStatus.Accepted,
|
|
1015
973
|
ActionStatus.Rejected
|
|
@@ -1020,182 +978,172 @@ var ActionBase = z12.object({
|
|
|
1020
978
|
"Reference to the original action asynchronously accepted or rejected by a third-party integration."
|
|
1021
979
|
)
|
|
1022
980
|
});
|
|
1023
|
-
var AssignedAction = ActionBase.
|
|
1024
|
-
|
|
1025
|
-
type:
|
|
1026
|
-
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.")
|
|
1027
985
|
// TODO move into 'content' property
|
|
1028
|
-
})
|
|
986
|
+
})
|
|
1029
987
|
);
|
|
1030
|
-
var UnassignedAction = ActionBase.
|
|
1031
|
-
|
|
1032
|
-
type:
|
|
1033
|
-
})
|
|
988
|
+
var UnassignedAction = ActionBase.merge(
|
|
989
|
+
import_zod12.z.object({
|
|
990
|
+
type: import_zod12.z.literal(ActionType.UNASSIGN)
|
|
991
|
+
})
|
|
1034
992
|
);
|
|
1035
|
-
var RegisterAction = ActionBase.
|
|
1036
|
-
|
|
1037
|
-
type:
|
|
1038
|
-
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(
|
|
1039
997
|
"Registration number of the event. Always present for accepted registrations."
|
|
1040
998
|
)
|
|
1041
999
|
// TODO move into 'content' property
|
|
1042
|
-
})
|
|
1000
|
+
})
|
|
1001
|
+
);
|
|
1002
|
+
var DeclareAction = ActionBase.merge(
|
|
1003
|
+
import_zod12.z.object({
|
|
1004
|
+
type: import_zod12.z.literal(ActionType.DECLARE)
|
|
1005
|
+
})
|
|
1043
1006
|
);
|
|
1044
|
-
var
|
|
1045
|
-
|
|
1046
|
-
type:
|
|
1047
|
-
})
|
|
1007
|
+
var ValidateAction = ActionBase.merge(
|
|
1008
|
+
import_zod12.z.object({
|
|
1009
|
+
type: import_zod12.z.literal(ActionType.VALIDATE)
|
|
1010
|
+
})
|
|
1048
1011
|
);
|
|
1049
|
-
var ReasonContent =
|
|
1050
|
-
reason:
|
|
1012
|
+
var ReasonContent = import_zod12.z.object({
|
|
1013
|
+
reason: import_zod12.z.string().min(1, { message: "Message cannot be empty" }).describe(
|
|
1051
1014
|
"Message describing the reason for rejecting or archiving the event."
|
|
1052
1015
|
)
|
|
1053
1016
|
});
|
|
1054
|
-
var RejectAction = ActionBase.
|
|
1055
|
-
|
|
1056
|
-
type:
|
|
1017
|
+
var RejectAction = ActionBase.merge(
|
|
1018
|
+
import_zod12.z.object({
|
|
1019
|
+
type: import_zod12.z.literal(ActionType.REJECT),
|
|
1057
1020
|
content: ReasonContent
|
|
1058
|
-
})
|
|
1021
|
+
})
|
|
1059
1022
|
);
|
|
1060
|
-
var PotentialDuplicate =
|
|
1023
|
+
var PotentialDuplicate = import_zod12.z.object({
|
|
1061
1024
|
id: UUID,
|
|
1062
|
-
trackingId:
|
|
1025
|
+
trackingId: import_zod12.z.string()
|
|
1063
1026
|
});
|
|
1064
|
-
var DuplicateDetectedAction = ActionBase.
|
|
1065
|
-
|
|
1066
|
-
type:
|
|
1067
|
-
content:
|
|
1068
|
-
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)
|
|
1069
1032
|
})
|
|
1070
|
-
})
|
|
1033
|
+
})
|
|
1071
1034
|
);
|
|
1072
|
-
var MarkNotDuplicateAction = ActionBase.
|
|
1073
|
-
|
|
1074
|
-
type:
|
|
1075
|
-
})
|
|
1035
|
+
var MarkNotDuplicateAction = ActionBase.merge(
|
|
1036
|
+
import_zod12.z.object({
|
|
1037
|
+
type: import_zod12.z.literal(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
1038
|
+
})
|
|
1076
1039
|
);
|
|
1077
|
-
var MarkAsDuplicateAction = ActionBase.
|
|
1078
|
-
|
|
1079
|
-
type:
|
|
1080
|
-
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({
|
|
1081
1044
|
duplicateOf: UUID
|
|
1082
1045
|
}).optional()
|
|
1083
|
-
})
|
|
1046
|
+
})
|
|
1084
1047
|
);
|
|
1085
|
-
var ArchiveAction = ActionBase.
|
|
1086
|
-
|
|
1087
|
-
type:
|
|
1048
|
+
var ArchiveAction = ActionBase.merge(
|
|
1049
|
+
import_zod12.z.object({
|
|
1050
|
+
type: import_zod12.z.literal(ActionType.ARCHIVE),
|
|
1088
1051
|
content: ReasonContent
|
|
1089
|
-
})
|
|
1090
|
-
);
|
|
1091
|
-
var CreatedAction = ActionBase.extend(
|
|
1092
|
-
z12.object({
|
|
1093
|
-
type: z12.literal(ActionType.CREATE)
|
|
1094
|
-
}).shape
|
|
1052
|
+
})
|
|
1095
1053
|
);
|
|
1096
|
-
var
|
|
1097
|
-
|
|
1098
|
-
type:
|
|
1099
|
-
})
|
|
1054
|
+
var CreatedAction = ActionBase.merge(
|
|
1055
|
+
import_zod12.z.object({
|
|
1056
|
+
type: import_zod12.z.literal(ActionType.CREATE)
|
|
1057
|
+
})
|
|
1100
1058
|
);
|
|
1101
|
-
var
|
|
1102
|
-
|
|
1103
|
-
type:
|
|
1104
|
-
|
|
1105
|
-
comment: z12.string().describe("Comment for the edit action.").optional()
|
|
1106
|
-
})
|
|
1107
|
-
}).shape
|
|
1059
|
+
var NotifiedAction = ActionBase.merge(
|
|
1060
|
+
import_zod12.z.object({
|
|
1061
|
+
type: import_zod12.z.literal(ActionType.NOTIFY)
|
|
1062
|
+
})
|
|
1108
1063
|
);
|
|
1109
|
-
var PrintContent =
|
|
1110
|
-
templateId:
|
|
1064
|
+
var PrintContent = import_zod12.z.object({
|
|
1065
|
+
templateId: import_zod12.z.string().optional()
|
|
1111
1066
|
});
|
|
1112
|
-
var PrintCertificateAction = ActionBase.
|
|
1113
|
-
|
|
1114
|
-
type:
|
|
1067
|
+
var PrintCertificateAction = ActionBase.merge(
|
|
1068
|
+
import_zod12.z.object({
|
|
1069
|
+
type: import_zod12.z.literal(ActionType.PRINT_CERTIFICATE),
|
|
1115
1070
|
content: PrintContent.optional().nullable()
|
|
1116
|
-
})
|
|
1071
|
+
})
|
|
1117
1072
|
);
|
|
1118
|
-
var RequestedCorrectionAction = ActionBase.
|
|
1119
|
-
|
|
1120
|
-
type:
|
|
1121
|
-
})
|
|
1073
|
+
var RequestedCorrectionAction = ActionBase.merge(
|
|
1074
|
+
import_zod12.z.object({
|
|
1075
|
+
type: import_zod12.z.literal(ActionType.REQUEST_CORRECTION)
|
|
1076
|
+
})
|
|
1122
1077
|
);
|
|
1123
|
-
var ApprovedCorrectionAction = ActionBase.
|
|
1124
|
-
|
|
1125
|
-
type:
|
|
1126
|
-
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()
|
|
1127
1082
|
// TODO move into 'content' property
|
|
1128
|
-
})
|
|
1083
|
+
})
|
|
1129
1084
|
);
|
|
1130
|
-
var RejectedCorrectionAction = ActionBase.
|
|
1131
|
-
|
|
1132
|
-
type:
|
|
1133
|
-
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(),
|
|
1134
1089
|
// TODO move into 'content' property
|
|
1135
1090
|
content: ReasonContent
|
|
1136
|
-
})
|
|
1137
|
-
);
|
|
1138
|
-
var ReadAction = ActionBase.extend(
|
|
1139
|
-
z12.object({
|
|
1140
|
-
type: z12.literal(ActionType.READ)
|
|
1141
|
-
}).shape
|
|
1091
|
+
})
|
|
1142
1092
|
);
|
|
1143
|
-
var
|
|
1144
|
-
|
|
1145
|
-
type:
|
|
1146
|
-
customActionType: z12.string()
|
|
1093
|
+
var ReadAction = ActionBase.merge(
|
|
1094
|
+
import_zod12.z.object({
|
|
1095
|
+
type: import_zod12.z.literal(ActionType.READ)
|
|
1147
1096
|
})
|
|
1148
1097
|
);
|
|
1149
|
-
var ActionDocument =
|
|
1150
|
-
CreatedAction.
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
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"
|
|
1170
1118
|
});
|
|
1171
1119
|
var AsyncRejectActionDocument = ActionBase.omit({
|
|
1172
1120
|
declaration: true,
|
|
1173
1121
|
annotation: true
|
|
1174
|
-
}).
|
|
1175
|
-
|
|
1176
|
-
type:
|
|
1177
|
-
status:
|
|
1178
|
-
})
|
|
1122
|
+
}).merge(
|
|
1123
|
+
import_zod12.z.object({
|
|
1124
|
+
type: import_zod12.z.enum(ConfirmableActions),
|
|
1125
|
+
status: import_zod12.z.literal(ActionStatus.Rejected)
|
|
1126
|
+
})
|
|
1179
1127
|
);
|
|
1180
|
-
var Action =
|
|
1128
|
+
var Action = import_zod12.z.union([ActionDocument, AsyncRejectActionDocument]);
|
|
1181
1129
|
|
|
1182
|
-
// ../commons/src/events/
|
|
1183
|
-
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
|
+
]);
|
|
1184
1139
|
var InherentFlags = {
|
|
1185
1140
|
PENDING_CERTIFICATION: "pending-certification",
|
|
1186
1141
|
INCOMPLETE: "incomplete",
|
|
1187
1142
|
REJECTED: "rejected",
|
|
1188
1143
|
CORRECTION_REQUESTED: "correction-requested",
|
|
1189
|
-
POTENTIAL_DUPLICATE: "potential-duplicate"
|
|
1190
|
-
/**
|
|
1191
|
-
* This flag is set by the Edit-action and removed after the declaration or registration.
|
|
1192
|
-
* A record should never stay with the EDIT_IN_PROGRESS flag, since it should always be declared or registered right after.
|
|
1193
|
-
*
|
|
1194
|
-
* We only use this flag to determine that a NOTIFY, DECLARE or REGISTER action is allowed next.
|
|
1195
|
-
*/
|
|
1196
|
-
EDIT_IN_PROGRESS: "edit-in-progress"
|
|
1144
|
+
POTENTIAL_DUPLICATE: "potential-duplicate"
|
|
1197
1145
|
};
|
|
1198
|
-
var ActionFlag =
|
|
1146
|
+
var ActionFlag = import_zod13.z.string().regex(
|
|
1199
1147
|
new RegExp(
|
|
1200
1148
|
`^(${Object.values(ActionType).join("|").toLowerCase()}):(${Object.values(
|
|
1201
1149
|
ActionStatus
|
|
@@ -1203,90 +1151,59 @@ var ActionFlag = z13.string().regex(
|
|
|
1203
1151
|
),
|
|
1204
1152
|
"Flag must be in the format ActionType:ActionStatus (lowerCase)"
|
|
1205
1153
|
);
|
|
1206
|
-
var
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
).
|
|
1210
|
-
|
|
1211
|
-
message: "Custom flag cannot match the ActionFlag pattern (ActionType:ActionStatus)."
|
|
1212
|
-
}).describe("Custom flag identifier defined by the country config.");
|
|
1213
|
-
var Flag = ActionFlag.or(z13.enum(InherentFlags)).or(CustomFlag);
|
|
1214
|
-
var FlagConfig = z13.object({
|
|
1215
|
-
id: CustomFlag,
|
|
1216
|
-
requiresAction: z13.boolean().describe(
|
|
1217
|
-
"Indicates if this flag expects an action to be performed to be cleared."
|
|
1218
|
-
),
|
|
1219
|
-
label: TranslationConfig.describe("Human readable label of the flag.")
|
|
1220
|
-
});
|
|
1221
|
-
var ActionFlagConfig = z13.object({
|
|
1222
|
-
id: Flag,
|
|
1223
|
-
operation: z13.enum(["add", "remove"]).describe("Operation to perform on the flag."),
|
|
1224
|
-
conditional: Conditional.optional().describe(
|
|
1225
|
-
"When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
|
|
1226
|
-
)
|
|
1227
|
-
});
|
|
1228
|
-
|
|
1229
|
-
// ../commons/src/events/EventMetadata.ts
|
|
1230
|
-
var EventStatus = z14.enum([
|
|
1231
|
-
"CREATED",
|
|
1232
|
-
"NOTIFIED",
|
|
1233
|
-
"DECLARED",
|
|
1234
|
-
"REGISTERED",
|
|
1235
|
-
"ARCHIVED"
|
|
1236
|
-
]);
|
|
1237
|
-
var ZodDate = z14.iso.date();
|
|
1238
|
-
var ActionCreationMetadata = z14.object({
|
|
1239
|
-
createdAt: z14.iso.datetime().describe("The timestamp when the action request was created."),
|
|
1240
|
-
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."),
|
|
1241
1159
|
createdAtLocation: CreatedAtLocation.describe(
|
|
1242
1160
|
"Location of the user who created the action request."
|
|
1243
1161
|
),
|
|
1244
|
-
createdByUserType:
|
|
1245
|
-
acceptedAt:
|
|
1246
|
-
createdByRole:
|
|
1247
|
-
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.")
|
|
1248
1166
|
});
|
|
1249
1167
|
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
1250
|
-
registrationNumber:
|
|
1168
|
+
registrationNumber: import_zod13.z.string().describe(
|
|
1251
1169
|
"Registration number of the event. Always present for accepted registrations."
|
|
1252
1170
|
)
|
|
1253
1171
|
});
|
|
1254
|
-
var LegalStatuses =
|
|
1172
|
+
var LegalStatuses = import_zod13.z.object({
|
|
1255
1173
|
[EventStatus.enum.DECLARED]: ActionCreationMetadata.nullish(),
|
|
1256
1174
|
[EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish()
|
|
1257
1175
|
});
|
|
1258
|
-
var EventMetadata =
|
|
1176
|
+
var EventMetadata = import_zod13.z.object({
|
|
1259
1177
|
id: UUID,
|
|
1260
|
-
type:
|
|
1178
|
+
type: import_zod13.z.string().describe("The type of event, such as birth, death, or marriage."),
|
|
1261
1179
|
status: EventStatus,
|
|
1262
1180
|
legalStatuses: LegalStatuses.describe(
|
|
1263
1181
|
"Metadata related to the legal registration of the event, such as who registered it and when."
|
|
1264
1182
|
),
|
|
1265
|
-
createdAt:
|
|
1183
|
+
createdAt: import_zod13.z.string().datetime().describe("The timestamp when the event was first created and saved."),
|
|
1266
1184
|
dateOfEvent: ZodDate.nullish(),
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
updatedByUserRole: z14.string().describe("Role of the user who last changed the status."),
|
|
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."),
|
|
1271
1188
|
createdAtLocation: CreatedAtLocation.describe(
|
|
1272
1189
|
"Location of the user who created the event."
|
|
1273
1190
|
),
|
|
1274
|
-
createdBySignature:
|
|
1191
|
+
createdBySignature: import_zod13.z.string().nullish().describe("Signature of the user who created the event."),
|
|
1275
1192
|
updatedAtLocation: UUID.nullish().describe(
|
|
1276
1193
|
"Location of the user who last changed the status."
|
|
1277
1194
|
),
|
|
1278
|
-
updatedAt:
|
|
1195
|
+
updatedAt: import_zod13.z.string().datetime().describe(
|
|
1279
1196
|
"Timestamp of the most recent *accepted* status change. Possibly 3rd party update, if action is validation asynchronously."
|
|
1280
1197
|
),
|
|
1281
|
-
assignedTo:
|
|
1282
|
-
updatedBy:
|
|
1283
|
-
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(
|
|
1284
1201
|
"System-generated tracking ID used by informants or registrars to look up the event."
|
|
1285
1202
|
),
|
|
1286
|
-
potentialDuplicates:
|
|
1203
|
+
potentialDuplicates: import_zod13.z.array(PotentialDuplicate).describe(
|
|
1287
1204
|
"List of event IDs and their tracking IDs that this event could be a duplicate of."
|
|
1288
1205
|
),
|
|
1289
|
-
flags:
|
|
1206
|
+
flags: import_zod13.z.array(Flag)
|
|
1290
1207
|
});
|
|
1291
1208
|
var EventMetadataKeysArray = [
|
|
1292
1209
|
"id",
|
|
@@ -1294,7 +1211,6 @@ var EventMetadataKeysArray = [
|
|
|
1294
1211
|
"status",
|
|
1295
1212
|
"createdAt",
|
|
1296
1213
|
"dateOfEvent",
|
|
1297
|
-
"placeOfEvent",
|
|
1298
1214
|
"createdBy",
|
|
1299
1215
|
"createdByUserType",
|
|
1300
1216
|
"updatedByUserRole",
|
|
@@ -1307,128 +1223,130 @@ var EventMetadataKeysArray = [
|
|
|
1307
1223
|
"legalStatuses",
|
|
1308
1224
|
"flags"
|
|
1309
1225
|
];
|
|
1310
|
-
var EventMetadataKeys =
|
|
1226
|
+
var EventMetadataKeys = import_zod13.z.enum(EventMetadataKeysArray);
|
|
1311
1227
|
|
|
1312
1228
|
// ../commons/src/events/EventIndex.ts
|
|
1229
|
+
var import_zod_openapi5 = require("zod-openapi");
|
|
1230
|
+
(0, import_zod_openapi5.extendZodWithOpenApi)(import_zod14.z);
|
|
1313
1231
|
var EventIndex = EventMetadata.extend({
|
|
1314
1232
|
declaration: EventState
|
|
1315
|
-
}).
|
|
1316
|
-
|
|
1233
|
+
}).openapi({
|
|
1234
|
+
ref: "EventIndex"
|
|
1317
1235
|
});
|
|
1318
|
-
var EventSearchIndex =
|
|
1319
|
-
|
|
1320
|
-
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()
|
|
1321
1239
|
// Ensures "type" (event-id) exists and is a string
|
|
1322
1240
|
})
|
|
1323
|
-
).
|
|
1324
|
-
|
|
1241
|
+
).openapi({
|
|
1242
|
+
ref: "EventSearchIndex"
|
|
1325
1243
|
});
|
|
1326
|
-
var Fuzzy =
|
|
1327
|
-
|
|
1244
|
+
var Fuzzy = import_zod14.z.object({ type: import_zod14.z.literal("fuzzy"), term: import_zod14.z.string() }).openapi({
|
|
1245
|
+
ref: "Fuzzy"
|
|
1328
1246
|
});
|
|
1329
|
-
var Exact =
|
|
1330
|
-
|
|
1247
|
+
var Exact = import_zod14.z.object({ type: import_zod14.z.literal("exact"), term: import_zod14.z.string() }).openapi({
|
|
1248
|
+
ref: "Exact"
|
|
1331
1249
|
});
|
|
1332
|
-
var ExactStatus =
|
|
1333
|
-
type:
|
|
1250
|
+
var ExactStatus = import_zod14.z.object({
|
|
1251
|
+
type: import_zod14.z.literal("exact"),
|
|
1334
1252
|
term: EventStatus
|
|
1335
|
-
}).
|
|
1336
|
-
|
|
1253
|
+
}).openapi({
|
|
1254
|
+
ref: "ExactStatus"
|
|
1337
1255
|
});
|
|
1338
|
-
var ExactUserType =
|
|
1339
|
-
type:
|
|
1256
|
+
var ExactUserType = import_zod14.z.object({
|
|
1257
|
+
type: import_zod14.z.literal("exact"),
|
|
1340
1258
|
term: TokenUserType
|
|
1341
|
-
}).
|
|
1342
|
-
|
|
1259
|
+
}).openapi({
|
|
1260
|
+
ref: "ExactUserType"
|
|
1343
1261
|
});
|
|
1344
|
-
var AnyOf =
|
|
1345
|
-
type:
|
|
1346
|
-
terms:
|
|
1347
|
-
}).
|
|
1348
|
-
|
|
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"
|
|
1349
1267
|
});
|
|
1350
|
-
var AnyOfStatus =
|
|
1351
|
-
type:
|
|
1352
|
-
terms:
|
|
1353
|
-
}).
|
|
1354
|
-
|
|
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"
|
|
1355
1273
|
});
|
|
1356
|
-
var Range =
|
|
1357
|
-
type:
|
|
1358
|
-
gte:
|
|
1359
|
-
lte:
|
|
1360
|
-
}).
|
|
1361
|
-
|
|
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"
|
|
1362
1280
|
});
|
|
1363
|
-
var ContainsFlags =
|
|
1364
|
-
anyOf:
|
|
1365
|
-
noneOf:
|
|
1366
|
-
}).
|
|
1367
|
-
|
|
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"
|
|
1368
1286
|
});
|
|
1369
|
-
var Within =
|
|
1370
|
-
|
|
1287
|
+
var Within = import_zod14.z.object({ type: import_zod14.z.literal("within"), location: import_zod14.z.string() }).openapi({
|
|
1288
|
+
ref: "Within"
|
|
1371
1289
|
});
|
|
1372
|
-
var RangeDate =
|
|
1373
|
-
type:
|
|
1374
|
-
gte:
|
|
1375
|
-
lte:
|
|
1376
|
-
}).
|
|
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" });
|
|
1377
1295
|
var ExactDate = Exact.extend({
|
|
1378
|
-
term:
|
|
1379
|
-
}).
|
|
1380
|
-
|
|
1296
|
+
term: import_zod14.z.string().date().or(import_zod14.z.string().datetime())
|
|
1297
|
+
}).openapi({
|
|
1298
|
+
ref: "ExactDate"
|
|
1381
1299
|
});
|
|
1382
|
-
var TimePeriod =
|
|
1383
|
-
type:
|
|
1300
|
+
var TimePeriod = import_zod14.z.object({
|
|
1301
|
+
type: import_zod14.z.literal("timePeriod"),
|
|
1384
1302
|
term: SelectDateRangeValue
|
|
1385
|
-
}).
|
|
1386
|
-
|
|
1303
|
+
}).openapi({
|
|
1304
|
+
ref: "TimePeriod"
|
|
1387
1305
|
});
|
|
1388
|
-
var DateCondition =
|
|
1389
|
-
|
|
1306
|
+
var DateCondition = import_zod14.z.union([ExactDate, RangeDate, TimePeriod]).openapi({
|
|
1307
|
+
ref: "DateCondition"
|
|
1390
1308
|
});
|
|
1391
|
-
var QueryInput =
|
|
1392
|
-
() =>
|
|
1393
|
-
|
|
1394
|
-
|
|
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)
|
|
1395
1313
|
])
|
|
1396
|
-
).
|
|
1397
|
-
|
|
1314
|
+
).openapi({
|
|
1315
|
+
ref: "QueryInput"
|
|
1398
1316
|
});
|
|
1399
|
-
var QueryExpression =
|
|
1400
|
-
id:
|
|
1401
|
-
eventType:
|
|
1402
|
-
status:
|
|
1403
|
-
createdAt:
|
|
1404
|
-
updatedAt:
|
|
1405
|
-
"legalStatuses.REGISTERED.acceptedAt":
|
|
1406
|
-
"legalStatuses.DECLARED.createdAtLocation":
|
|
1407
|
-
|
|
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])
|
|
1408
1326
|
),
|
|
1409
|
-
"legalStatuses.REGISTERED.createdAtLocation":
|
|
1410
|
-
|
|
1327
|
+
"legalStatuses.REGISTERED.createdAtLocation": import_zod14.z.optional(
|
|
1328
|
+
import_zod14.z.union([Within, Exact])
|
|
1411
1329
|
),
|
|
1412
|
-
"legalStatuses.REGISTERED.registrationNumber":
|
|
1413
|
-
createdAtLocation:
|
|
1414
|
-
updatedAtLocation:
|
|
1415
|
-
assignedTo:
|
|
1416
|
-
createdByUserType:
|
|
1417
|
-
createdBy:
|
|
1418
|
-
updatedBy:
|
|
1419
|
-
trackingId:
|
|
1420
|
-
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),
|
|
1421
1339
|
// @todo: The type for this comes out as "any"
|
|
1422
1340
|
data: QueryInput
|
|
1423
1341
|
}).partial().refine((obj) => Object.values(obj).some((val) => val !== void 0), {
|
|
1424
|
-
|
|
1425
|
-
}).
|
|
1426
|
-
|
|
1342
|
+
message: "At least one query field must be specified."
|
|
1343
|
+
}).openapi({
|
|
1344
|
+
ref: "QueryExpression"
|
|
1427
1345
|
});
|
|
1428
|
-
var QueryType =
|
|
1429
|
-
() =>
|
|
1430
|
-
type:
|
|
1431
|
-
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({
|
|
1432
1350
|
default: [
|
|
1433
1351
|
{
|
|
1434
1352
|
eventType: TENNIS_CLUB_MEMBERSHIP,
|
|
@@ -1446,8 +1364,8 @@ var QueryType = import_v4.z.lazy(
|
|
|
1446
1364
|
]
|
|
1447
1365
|
})
|
|
1448
1366
|
})
|
|
1449
|
-
).
|
|
1450
|
-
|
|
1367
|
+
).openapi({
|
|
1368
|
+
ref: "QueryType"
|
|
1451
1369
|
});
|
|
1452
1370
|
function parseStringifiedQueryField(val) {
|
|
1453
1371
|
if (typeof val === "string") {
|
|
@@ -1455,8 +1373,8 @@ function parseStringifiedQueryField(val) {
|
|
|
1455
1373
|
}
|
|
1456
1374
|
return val;
|
|
1457
1375
|
}
|
|
1458
|
-
var SearchQuery =
|
|
1459
|
-
query:
|
|
1376
|
+
var SearchQuery = import_zod14.z.object({
|
|
1377
|
+
query: import_zod14.z.preprocess(parseStringifiedQueryField, QueryType).openapi({
|
|
1460
1378
|
default: {
|
|
1461
1379
|
type: "and",
|
|
1462
1380
|
clauses: [
|
|
@@ -1476,184 +1394,190 @@ var SearchQuery = import_v4.z.object({
|
|
|
1476
1394
|
]
|
|
1477
1395
|
}
|
|
1478
1396
|
}),
|
|
1479
|
-
limit:
|
|
1480
|
-
offset:
|
|
1481
|
-
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(
|
|
1482
1400
|
parseStringifiedQueryField,
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
field:
|
|
1486
|
-
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")
|
|
1487
1405
|
})
|
|
1488
1406
|
)
|
|
1489
1407
|
).optional()
|
|
1490
|
-
}).
|
|
1491
|
-
|
|
1408
|
+
}).openapi({
|
|
1409
|
+
ref: "SearchQuery"
|
|
1492
1410
|
});
|
|
1493
1411
|
|
|
1494
1412
|
// ../commons/src/events/FieldConfig.ts
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
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({
|
|
1504
1428
|
$$field: FieldId,
|
|
1505
|
-
$$subfield:
|
|
1429
|
+
$$subfield: import_zod15.z.array(import_zod15.z.string()).optional().describe(
|
|
1506
1430
|
'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
|
|
1507
1431
|
)
|
|
1508
1432
|
}).describe("Reference to a field by its ID");
|
|
1509
|
-
var ValidationConfig =
|
|
1433
|
+
var ValidationConfig = import_zod15.z.object({
|
|
1510
1434
|
validator: Conditional,
|
|
1511
1435
|
message: TranslationConfig
|
|
1512
1436
|
});
|
|
1513
|
-
var requiredSchema =
|
|
1514
|
-
|
|
1515
|
-
|
|
1437
|
+
var requiredSchema = import_zod15.z.union([
|
|
1438
|
+
import_zod15.z.boolean(),
|
|
1439
|
+
import_zod15.z.object({
|
|
1516
1440
|
message: TranslationConfig.describe("Custom required validation message")
|
|
1517
1441
|
})
|
|
1518
1442
|
]).default(false).optional();
|
|
1519
|
-
var BaseField =
|
|
1443
|
+
var BaseField = import_zod15.z.object({
|
|
1520
1444
|
id: FieldId.describe("Unique identifier of the field."),
|
|
1521
1445
|
label: TranslationConfig.describe("Human-readable label of the field."),
|
|
1522
|
-
parent: FieldReference.or(
|
|
1446
|
+
parent: FieldReference.or(import_zod15.z.array(FieldReference)).optional().describe(
|
|
1523
1447
|
"Reference to the parent field or fields. When a parent field changes, this field is reset."
|
|
1524
1448
|
),
|
|
1525
1449
|
required: requiredSchema.describe(
|
|
1526
1450
|
"Indicates whether the field is mandatory."
|
|
1527
1451
|
),
|
|
1528
|
-
conditionals:
|
|
1452
|
+
conditionals: import_zod15.z.array(FieldConditional).default([]).optional().describe(
|
|
1529
1453
|
"Conditions determining when the field is shown or enabled. By default, the field is always shown and enabled."
|
|
1530
1454
|
),
|
|
1531
|
-
secured:
|
|
1455
|
+
secured: import_zod15.z.boolean().default(false).optional().describe(
|
|
1532
1456
|
"Indicates whether the field is secured. Secured fields are not indexed for search and are only visible when explicitly assigned."
|
|
1533
1457
|
),
|
|
1534
1458
|
placeholder: TranslationConfig.optional(),
|
|
1535
|
-
validation:
|
|
1459
|
+
validation: import_zod15.z.array(ValidationConfig).default([]).optional().describe("Additional validation rules applied to the field."),
|
|
1536
1460
|
helperText: TranslationConfig.optional(),
|
|
1537
|
-
hideLabel:
|
|
1538
|
-
uncorrectable:
|
|
1461
|
+
hideLabel: import_zod15.z.boolean().default(false).optional(),
|
|
1462
|
+
uncorrectable: import_zod15.z.boolean().default(false).optional().describe(
|
|
1539
1463
|
"Indicates whether the field can be modified during record correction."
|
|
1540
1464
|
),
|
|
1541
|
-
value: FieldReference.or(
|
|
1465
|
+
value: FieldReference.or(import_zod15.z.array(FieldReference)).optional().describe(
|
|
1542
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."
|
|
1543
1467
|
),
|
|
1544
|
-
analytics:
|
|
1468
|
+
analytics: import_zod15.z.boolean().default(false).optional().describe(
|
|
1545
1469
|
"Indicates whether the field is included in analytics. When enabled, its value becomes available in the analytics dashboard."
|
|
1546
1470
|
)
|
|
1547
1471
|
}).describe("Common properties shared across all field types.");
|
|
1548
1472
|
var Divider = BaseField.extend({
|
|
1549
|
-
type:
|
|
1473
|
+
type: import_zod15.z.literal(FieldType.DIVIDER)
|
|
1550
1474
|
});
|
|
1551
1475
|
var TextField = BaseField.extend({
|
|
1552
|
-
type:
|
|
1476
|
+
type: import_zod15.z.literal(FieldType.TEXT),
|
|
1553
1477
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1554
|
-
configuration:
|
|
1555
|
-
maxLength:
|
|
1556
|
-
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(),
|
|
1557
1481
|
prefix: TranslationConfig.optional(),
|
|
1558
1482
|
postfix: TranslationConfig.optional()
|
|
1559
1483
|
}).default({ type: "text" }).optional()
|
|
1560
1484
|
}).describe("Text input");
|
|
1561
1485
|
var NumberField = BaseField.extend({
|
|
1562
|
-
type:
|
|
1486
|
+
type: import_zod15.z.literal(FieldType.NUMBER),
|
|
1563
1487
|
defaultValue: NumberFieldValue.optional(),
|
|
1564
|
-
configuration:
|
|
1565
|
-
min:
|
|
1566
|
-
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"),
|
|
1567
1491
|
prefix: TranslationConfig.optional(),
|
|
1568
1492
|
postfix: TranslationConfig.optional()
|
|
1569
1493
|
}).optional()
|
|
1570
1494
|
}).describe("Number input");
|
|
1571
1495
|
var TextAreaField = BaseField.extend({
|
|
1572
|
-
type:
|
|
1496
|
+
type: import_zod15.z.literal(FieldType.TEXTAREA),
|
|
1573
1497
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1574
|
-
configuration:
|
|
1575
|
-
maxLength:
|
|
1576
|
-
rows:
|
|
1577
|
-
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"),
|
|
1578
1502
|
prefix: TranslationConfig.optional(),
|
|
1579
1503
|
postfix: TranslationConfig.optional()
|
|
1580
1504
|
}).default({ rows: 4 }).optional()
|
|
1581
1505
|
}).describe("Multiline text input");
|
|
1582
|
-
var ImageMimeType =
|
|
1506
|
+
var ImageMimeType = import_zod15.z.enum([
|
|
1583
1507
|
"image/png",
|
|
1584
1508
|
"image/jpg",
|
|
1585
1509
|
"image/jpeg",
|
|
1586
1510
|
"image/svg+xml"
|
|
1587
1511
|
]);
|
|
1588
|
-
var DocumentMimeType =
|
|
1512
|
+
var DocumentMimeType = import_zod15.z.enum([
|
|
1589
1513
|
"application/pdf",
|
|
1590
1514
|
"application/msword",
|
|
1591
1515
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
1592
1516
|
"application/vnd.oasis.opendocument.text"
|
|
1593
1517
|
]);
|
|
1594
|
-
var MimeType =
|
|
1518
|
+
var MimeType = import_zod15.z.enum([
|
|
1595
1519
|
...ImageMimeType.options,
|
|
1596
1520
|
...DocumentMimeType.options
|
|
1597
1521
|
]);
|
|
1598
1522
|
var DEFAULT_MAX_FILE_SIZE_BYTES = 5 * 1024 * 1024;
|
|
1599
1523
|
var SignatureField = BaseField.extend({
|
|
1600
|
-
type:
|
|
1524
|
+
type: import_zod15.z.literal(FieldType.SIGNATURE),
|
|
1601
1525
|
signaturePromptLabel: TranslationConfig.describe(
|
|
1602
1526
|
"Title of the signature modal"
|
|
1603
1527
|
),
|
|
1604
1528
|
defaultValue: SignatureFieldValue.optional(),
|
|
1605
|
-
configuration:
|
|
1606
|
-
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),
|
|
1607
1531
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
|
1608
1532
|
}).default({
|
|
1609
1533
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1610
1534
|
})
|
|
1611
1535
|
}).describe("Signature input field");
|
|
1612
1536
|
var EmailField = BaseField.extend({
|
|
1613
|
-
type:
|
|
1614
|
-
configuration:
|
|
1615
|
-
maxLength:
|
|
1616
|
-
}).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(),
|
|
1617
1541
|
defaultValue: NonEmptyTextValue.optional()
|
|
1618
1542
|
});
|
|
1619
1543
|
var DateField = BaseField.extend({
|
|
1620
|
-
type:
|
|
1544
|
+
type: import_zod15.z.literal(FieldType.DATE),
|
|
1621
1545
|
defaultValue: DateValue.optional(),
|
|
1622
|
-
configuration:
|
|
1546
|
+
configuration: import_zod15.z.object({
|
|
1623
1547
|
notice: TranslationConfig.describe(
|
|
1624
1548
|
"Text to display above the date input"
|
|
1625
1549
|
).optional()
|
|
1626
1550
|
}).optional()
|
|
1627
1551
|
}).describe("A single date input (yyyy-MM-dd)");
|
|
1628
1552
|
var AgeField = BaseField.extend({
|
|
1629
|
-
type:
|
|
1553
|
+
type: import_zod15.z.literal(FieldType.AGE),
|
|
1630
1554
|
defaultValue: NumberFieldValue.optional(),
|
|
1631
|
-
configuration:
|
|
1555
|
+
configuration: import_zod15.z.object({
|
|
1632
1556
|
asOfDate: FieldReference,
|
|
1633
1557
|
prefix: TranslationConfig.optional(),
|
|
1634
1558
|
postfix: TranslationConfig.optional()
|
|
1635
1559
|
})
|
|
1636
1560
|
}).describe("An age input field which uses the current date as the asOfDate");
|
|
1637
1561
|
var TimeField = BaseField.extend({
|
|
1638
|
-
type:
|
|
1562
|
+
type: import_zod15.z.literal(FieldType.TIME),
|
|
1639
1563
|
defaultValue: TimeValue.optional(),
|
|
1640
|
-
configuration:
|
|
1641
|
-
use12HourFormat:
|
|
1564
|
+
configuration: import_zod15.z.object({
|
|
1565
|
+
use12HourFormat: import_zod15.z.boolean().optional().describe("Whether to use 12-hour format"),
|
|
1642
1566
|
notice: TranslationConfig.describe(
|
|
1643
1567
|
"Text to display above the time input"
|
|
1644
1568
|
).optional()
|
|
1645
1569
|
}).optional()
|
|
1646
1570
|
}).describe("A single date input (HH-mm)");
|
|
1647
1571
|
var DateRangeField = BaseField.extend({
|
|
1648
|
-
type:
|
|
1572
|
+
type: import_zod15.z.literal(FieldType.DATE_RANGE),
|
|
1649
1573
|
defaultValue: DateRangeFieldValue.optional(),
|
|
1650
|
-
configuration:
|
|
1574
|
+
configuration: import_zod15.z.object({
|
|
1651
1575
|
notice: TranslationConfig.describe(
|
|
1652
1576
|
"Text to display above the date input"
|
|
1653
1577
|
).optional()
|
|
1654
1578
|
}).optional()
|
|
1655
1579
|
}).describe("A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })");
|
|
1656
|
-
var HtmlFontVariant =
|
|
1580
|
+
var HtmlFontVariant = import_zod15.z.enum([
|
|
1657
1581
|
"reg12",
|
|
1658
1582
|
"reg14",
|
|
1659
1583
|
"reg16",
|
|
@@ -1663,31 +1587,31 @@ var HtmlFontVariant = z16.enum([
|
|
|
1663
1587
|
"h2",
|
|
1664
1588
|
"h1"
|
|
1665
1589
|
]);
|
|
1666
|
-
var ParagraphConfiguration =
|
|
1667
|
-
styles:
|
|
1590
|
+
var ParagraphConfiguration = import_zod15.z.object({
|
|
1591
|
+
styles: import_zod15.z.object({
|
|
1668
1592
|
fontVariant: HtmlFontVariant.optional().describe(
|
|
1669
1593
|
"Font variant to use for the paragraph text"
|
|
1670
1594
|
),
|
|
1671
|
-
hint:
|
|
1595
|
+
hint: import_zod15.z.boolean().optional().describe("When true, paragraph is styled as a hint with grey color")
|
|
1672
1596
|
}).optional()
|
|
1673
1597
|
}).default({});
|
|
1674
1598
|
var Paragraph = BaseField.extend({
|
|
1675
|
-
type:
|
|
1599
|
+
type: import_zod15.z.literal(FieldType.PARAGRAPH),
|
|
1676
1600
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1677
1601
|
configuration: ParagraphConfiguration
|
|
1678
1602
|
}).describe("A read-only HTML <p> paragraph");
|
|
1679
1603
|
var PageHeader = BaseField.extend({
|
|
1680
|
-
type:
|
|
1604
|
+
type: import_zod15.z.literal(FieldType.PAGE_HEADER),
|
|
1681
1605
|
defaultValue: NonEmptyTextValue.optional()
|
|
1682
1606
|
}).describe("A read-only header component for form pages");
|
|
1683
1607
|
var File = BaseField.extend({
|
|
1684
|
-
type:
|
|
1608
|
+
type: import_zod15.z.literal(FieldType.FILE),
|
|
1685
1609
|
defaultValue: FileFieldValue.optional(),
|
|
1686
|
-
configuration:
|
|
1687
|
-
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),
|
|
1688
1612
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature"),
|
|
1689
|
-
style:
|
|
1690
|
-
width:
|
|
1613
|
+
style: import_zod15.z.object({
|
|
1614
|
+
width: import_zod15.z.enum(["full", "auto"]).optional().describe(
|
|
1691
1615
|
"Whether the file upload button should take the full width of the container or not"
|
|
1692
1616
|
)
|
|
1693
1617
|
}).optional(),
|
|
@@ -1696,34 +1620,34 @@ var File = BaseField.extend({
|
|
|
1696
1620
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1697
1621
|
})
|
|
1698
1622
|
}).describe("File upload");
|
|
1699
|
-
var SelectOption =
|
|
1700
|
-
value:
|
|
1701
|
-
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")
|
|
1702
1626
|
});
|
|
1703
1627
|
var RadioGroup = BaseField.extend({
|
|
1704
|
-
type:
|
|
1628
|
+
type: import_zod15.z.literal(FieldType.RADIO_GROUP),
|
|
1705
1629
|
defaultValue: TextValue.optional(),
|
|
1706
|
-
options:
|
|
1707
|
-
configuration:
|
|
1708
|
-
styles:
|
|
1709
|
-
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()
|
|
1710
1634
|
}).optional()
|
|
1711
1635
|
}).optional()
|
|
1712
1636
|
}).describe("Grouped radio options");
|
|
1713
1637
|
var BulletList = BaseField.extend({
|
|
1714
|
-
type:
|
|
1638
|
+
type: import_zod15.z.literal(FieldType.BULLET_LIST),
|
|
1715
1639
|
defaultValue: TextValue.optional(),
|
|
1716
|
-
items:
|
|
1717
|
-
configuration:
|
|
1718
|
-
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({
|
|
1719
1643
|
fontVariant: HtmlFontVariant.optional()
|
|
1720
1644
|
}).optional()
|
|
1721
1645
|
}).default({})
|
|
1722
1646
|
}).describe("A list of bullet points");
|
|
1723
1647
|
var Select = BaseField.extend({
|
|
1724
|
-
type:
|
|
1648
|
+
type: import_zod15.z.literal(FieldType.SELECT),
|
|
1725
1649
|
defaultValue: TextValue.optional(),
|
|
1726
|
-
options:
|
|
1650
|
+
options: import_zod15.z.array(SelectOption).describe("A list of options"),
|
|
1727
1651
|
noOptionsMessage: TranslationConfig.optional().describe(
|
|
1728
1652
|
`
|
|
1729
1653
|
A translation configuration object used to display a message when no options are available.
|
|
@@ -1735,34 +1659,34 @@ var Select = BaseField.extend({
|
|
|
1735
1659
|
`
|
|
1736
1660
|
)
|
|
1737
1661
|
}).describe("Select input");
|
|
1738
|
-
var SelectDateRangeOption =
|
|
1662
|
+
var SelectDateRangeOption = import_zod15.z.object({
|
|
1739
1663
|
value: SelectDateRangeValue.describe("The value of the option"),
|
|
1740
1664
|
label: TranslationConfig.describe("The label of the option")
|
|
1741
1665
|
});
|
|
1742
1666
|
var SelectDateRangeField = BaseField.extend({
|
|
1743
|
-
type:
|
|
1667
|
+
type: import_zod15.z.literal(FieldType.SELECT_DATE_RANGE),
|
|
1744
1668
|
defaultValue: SelectDateRangeValue.optional(),
|
|
1745
|
-
options:
|
|
1669
|
+
options: import_zod15.z.array(SelectDateRangeOption).describe("A list of options")
|
|
1746
1670
|
}).describe("Select input with date range options");
|
|
1747
|
-
var NameConfig =
|
|
1748
|
-
firstname:
|
|
1749
|
-
middlename:
|
|
1750
|
-
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()
|
|
1751
1675
|
});
|
|
1752
1676
|
var NameField = BaseField.extend({
|
|
1753
|
-
type:
|
|
1754
|
-
defaultValue:
|
|
1677
|
+
type: import_zod15.z.literal(FieldType.NAME),
|
|
1678
|
+
defaultValue: import_zod15.z.object({
|
|
1755
1679
|
firstname: NonEmptyTextValue.optional(),
|
|
1756
1680
|
middlename: NonEmptyTextValue.optional(),
|
|
1757
1681
|
surname: NonEmptyTextValue.optional()
|
|
1758
1682
|
}).optional(),
|
|
1759
|
-
configuration:
|
|
1683
|
+
configuration: import_zod15.z.object({
|
|
1760
1684
|
name: NameConfig.default({
|
|
1761
1685
|
firstname: { required: true },
|
|
1762
1686
|
surname: { required: true }
|
|
1763
1687
|
}).optional(),
|
|
1764
|
-
order:
|
|
1765
|
-
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"),
|
|
1766
1690
|
prefix: TranslationConfig.optional(),
|
|
1767
1691
|
postfix: TranslationConfig.optional()
|
|
1768
1692
|
}).default({
|
|
@@ -1774,142 +1698,142 @@ var NameField = BaseField.extend({
|
|
|
1774
1698
|
}).describe("Name input field");
|
|
1775
1699
|
var PhoneField = BaseField.extend({
|
|
1776
1700
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1777
|
-
type:
|
|
1701
|
+
type: import_zod15.z.literal(FieldType.PHONE)
|
|
1778
1702
|
}).describe("Phone input field");
|
|
1779
1703
|
var IdField = BaseField.extend({
|
|
1780
1704
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1781
|
-
type:
|
|
1705
|
+
type: import_zod15.z.literal(FieldType.ID)
|
|
1782
1706
|
}).describe("ID input field");
|
|
1783
1707
|
var Checkbox = BaseField.extend({
|
|
1784
|
-
type:
|
|
1708
|
+
type: import_zod15.z.literal(FieldType.CHECKBOX),
|
|
1785
1709
|
defaultValue: CheckboxFieldValue.default(false)
|
|
1786
1710
|
}).describe("Boolean checkbox field");
|
|
1787
1711
|
var Country = BaseField.extend({
|
|
1788
|
-
type:
|
|
1712
|
+
type: import_zod15.z.literal(FieldType.COUNTRY),
|
|
1789
1713
|
defaultValue: NonEmptyTextValue.optional()
|
|
1790
1714
|
}).describe("Country select field");
|
|
1791
|
-
var AdministrativeAreas =
|
|
1715
|
+
var AdministrativeAreas = import_zod15.z.enum([
|
|
1792
1716
|
"ADMIN_STRUCTURE",
|
|
1793
1717
|
"HEALTH_FACILITY",
|
|
1794
1718
|
"CRVS_OFFICE"
|
|
1795
1719
|
]);
|
|
1796
|
-
var AdministrativeAreaConfiguration =
|
|
1797
|
-
partOf:
|
|
1798
|
-
$declaration:
|
|
1720
|
+
var AdministrativeAreaConfiguration = import_zod15.z.object({
|
|
1721
|
+
partOf: import_zod15.z.object({
|
|
1722
|
+
$declaration: import_zod15.z.string()
|
|
1799
1723
|
}).optional().describe("Parent location"),
|
|
1800
1724
|
type: AdministrativeAreas
|
|
1801
1725
|
}).describe("Administrative area options");
|
|
1802
1726
|
var AdministrativeArea = BaseField.extend({
|
|
1803
|
-
type:
|
|
1727
|
+
type: import_zod15.z.literal(FieldType.ADMINISTRATIVE_AREA),
|
|
1804
1728
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1805
1729
|
configuration: AdministrativeAreaConfiguration
|
|
1806
1730
|
}).describe("Administrative area input field e.g. facility, office");
|
|
1807
1731
|
var LocationInput = BaseField.extend({
|
|
1808
|
-
type:
|
|
1732
|
+
type: import_zod15.z.literal(FieldType.LOCATION),
|
|
1809
1733
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1810
|
-
configuration:
|
|
1811
|
-
searchableResource:
|
|
1734
|
+
configuration: import_zod15.z.object({
|
|
1735
|
+
searchableResource: import_zod15.z.array(import_zod15.z.enum(["locations", "facilities", "offices"]))
|
|
1812
1736
|
})
|
|
1813
1737
|
}).describe("Input field for a location");
|
|
1814
1738
|
var FileUploadWithOptions = BaseField.extend({
|
|
1815
|
-
type:
|
|
1816
|
-
options:
|
|
1739
|
+
type: import_zod15.z.literal(FieldType.FILE_WITH_OPTIONS),
|
|
1740
|
+
options: import_zod15.z.array(SelectOption).describe("A list of options"),
|
|
1817
1741
|
defaultValue: FileFieldWithOptionValue.optional(),
|
|
1818
|
-
configuration:
|
|
1819
|
-
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),
|
|
1820
1744
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
|
1821
1745
|
}).default({
|
|
1822
1746
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1823
1747
|
})
|
|
1824
1748
|
});
|
|
1825
1749
|
var Facility = BaseField.extend({
|
|
1826
|
-
type:
|
|
1750
|
+
type: import_zod15.z.literal(FieldType.FACILITY),
|
|
1827
1751
|
defaultValue: NonEmptyTextValue.optional()
|
|
1828
1752
|
}).describe("Input field for a facility");
|
|
1829
1753
|
var Office = BaseField.extend({
|
|
1830
|
-
type:
|
|
1754
|
+
type: import_zod15.z.literal(FieldType.OFFICE),
|
|
1831
1755
|
defaultValue: NonEmptyTextValue.optional()
|
|
1832
1756
|
}).describe("Input field for an office");
|
|
1833
1757
|
var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
|
|
1834
|
-
administrativeArea:
|
|
1758
|
+
administrativeArea: import_zod15.z.union([UUID, SerializedUserField]).optional()
|
|
1835
1759
|
});
|
|
1836
1760
|
var Address = BaseField.extend({
|
|
1837
|
-
type:
|
|
1838
|
-
configuration:
|
|
1839
|
-
lineSeparator:
|
|
1840
|
-
fields:
|
|
1841
|
-
administrativeLevels:
|
|
1842
|
-
streetAddressForm:
|
|
1843
|
-
|
|
1844
|
-
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(),
|
|
1845
1769
|
required: requiredSchema,
|
|
1846
1770
|
label: TranslationConfig,
|
|
1847
|
-
type:
|
|
1848
|
-
conditionals:
|
|
1771
|
+
type: import_zod15.z.literal(FieldType.TEXT),
|
|
1772
|
+
conditionals: import_zod15.z.array(FieldConditional).default([]).optional(),
|
|
1849
1773
|
parent: FieldReference.optional()
|
|
1850
1774
|
})
|
|
1851
1775
|
).optional()
|
|
1852
1776
|
}).optional(),
|
|
1853
1777
|
defaultValue: DefaultAddressFieldValue.optional()
|
|
1854
1778
|
}).describe("Address input field \u2013 a combination of location and text fields");
|
|
1855
|
-
var StaticDataEntry =
|
|
1856
|
-
id:
|
|
1779
|
+
var StaticDataEntry = import_zod15.z.object({
|
|
1780
|
+
id: import_zod15.z.string().describe("ID for the data entry."),
|
|
1857
1781
|
label: TranslationConfig,
|
|
1858
|
-
value: TranslationConfig.or(
|
|
1782
|
+
value: TranslationConfig.or(import_zod15.z.string()).or(FieldReference)
|
|
1859
1783
|
}).describe("Static data entry");
|
|
1860
|
-
var DataEntry =
|
|
1784
|
+
var DataEntry = import_zod15.z.union([StaticDataEntry, import_zod15.z.object({ fieldId: import_zod15.z.string() })]).describe(
|
|
1861
1785
|
"Data entry can be either a static data entry, or a reference to another field in the current form or the declaration."
|
|
1862
1786
|
);
|
|
1863
1787
|
var DataField = BaseField.extend({
|
|
1864
|
-
type:
|
|
1865
|
-
configuration:
|
|
1788
|
+
type: import_zod15.z.literal(FieldType.DATA),
|
|
1789
|
+
configuration: import_zod15.z.object({
|
|
1866
1790
|
subtitle: TranslationConfig.optional(),
|
|
1867
|
-
data:
|
|
1791
|
+
data: import_zod15.z.array(DataEntry)
|
|
1868
1792
|
})
|
|
1869
1793
|
}).describe("Data field for displaying read-only data");
|
|
1870
1794
|
var ButtonField = BaseField.extend({
|
|
1871
|
-
type:
|
|
1795
|
+
type: import_zod15.z.literal(FieldType.BUTTON),
|
|
1872
1796
|
defaultValue: ButtonFieldValue.optional(),
|
|
1873
|
-
configuration:
|
|
1874
|
-
icon:
|
|
1797
|
+
configuration: import_zod15.z.object({
|
|
1798
|
+
icon: import_zod15.z.string().optional().describe(
|
|
1875
1799
|
"Icon for the button. You can find icons from OpenCRVS UI-Kit."
|
|
1876
1800
|
),
|
|
1877
|
-
loading:
|
|
1801
|
+
loading: import_zod15.z.boolean().optional().describe("Whether the button is in a loading state and shows a spinner"),
|
|
1878
1802
|
text: TranslationConfig.describe("Text to display on the button")
|
|
1879
1803
|
})
|
|
1880
1804
|
}).describe("Generic button without any built-in functionality");
|
|
1881
1805
|
var AlphaPrintButton = BaseField.extend({
|
|
1882
|
-
type:
|
|
1883
|
-
configuration:
|
|
1884
|
-
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"),
|
|
1885
1809
|
buttonLabel: TranslationConfig.optional().describe(
|
|
1886
1810
|
"Label for the print button"
|
|
1887
1811
|
)
|
|
1888
1812
|
})
|
|
1889
1813
|
}).describe("Print button field for printing certificates");
|
|
1890
1814
|
var HttpField = BaseField.extend({
|
|
1891
|
-
type:
|
|
1815
|
+
type: import_zod15.z.literal(FieldType.HTTP),
|
|
1892
1816
|
defaultValue: HttpFieldValue.optional(),
|
|
1893
|
-
configuration:
|
|
1817
|
+
configuration: import_zod15.z.object({
|
|
1894
1818
|
trigger: FieldReference,
|
|
1895
|
-
url:
|
|
1896
|
-
method:
|
|
1897
|
-
headers:
|
|
1898
|
-
body:
|
|
1899
|
-
errorValue:
|
|
1900
|
-
params:
|
|
1901
|
-
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")
|
|
1902
1826
|
})
|
|
1903
1827
|
}).describe("HTTP request function triggered by a button click or other event");
|
|
1904
1828
|
var SearchField = HttpField.extend({
|
|
1905
|
-
type:
|
|
1829
|
+
type: import_zod15.z.literal(FieldType.SEARCH),
|
|
1906
1830
|
configuration: SearchQuery.pick({
|
|
1907
1831
|
query: true,
|
|
1908
1832
|
limit: true,
|
|
1909
1833
|
offset: true
|
|
1910
1834
|
}).extend({
|
|
1911
1835
|
validation: ValidationConfig,
|
|
1912
|
-
indicators:
|
|
1836
|
+
indicators: import_zod15.z.object({
|
|
1913
1837
|
loading: TranslationConfig.optional().describe(
|
|
1914
1838
|
"Text to display while the search is in progress"
|
|
1915
1839
|
),
|
|
@@ -1924,7 +1848,7 @@ var SearchField = HttpField.extend({
|
|
|
1924
1848
|
),
|
|
1925
1849
|
confirmButton: TranslationConfig.optional(),
|
|
1926
1850
|
clearButton: TranslationConfig.optional(),
|
|
1927
|
-
clearModal:
|
|
1851
|
+
clearModal: import_zod15.z.object({
|
|
1928
1852
|
title: TranslationConfig.optional(),
|
|
1929
1853
|
description: TranslationConfig.optional(),
|
|
1930
1854
|
cancel: TranslationConfig.optional(),
|
|
@@ -1935,17 +1859,17 @@ var SearchField = HttpField.extend({
|
|
|
1935
1859
|
})
|
|
1936
1860
|
});
|
|
1937
1861
|
var LinkButtonField = BaseField.extend({
|
|
1938
|
-
type:
|
|
1939
|
-
configuration:
|
|
1940
|
-
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"),
|
|
1941
1865
|
text: TranslationConfig.describe("Text to display on the button"),
|
|
1942
|
-
icon:
|
|
1866
|
+
icon: import_zod15.z.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit.")
|
|
1943
1867
|
})
|
|
1944
1868
|
}).describe("Button that opens a link");
|
|
1945
1869
|
var VerificationStatus = BaseField.extend({
|
|
1946
|
-
type:
|
|
1870
|
+
type: import_zod15.z.literal(FieldType.VERIFICATION_STATUS),
|
|
1947
1871
|
defaultValue: VerificationStatusValue.optional(),
|
|
1948
|
-
configuration:
|
|
1872
|
+
configuration: import_zod15.z.object({
|
|
1949
1873
|
status: TranslationConfig.describe("Text to display on the status pill."),
|
|
1950
1874
|
description: TranslationConfig.describe(
|
|
1951
1875
|
"Explaining text on the banner in form."
|
|
@@ -1953,55 +1877,38 @@ var VerificationStatus = BaseField.extend({
|
|
|
1953
1877
|
})
|
|
1954
1878
|
});
|
|
1955
1879
|
var QueryParamReaderField = BaseField.extend({
|
|
1956
|
-
type:
|
|
1957
|
-
configuration:
|
|
1958
|
-
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")
|
|
1959
1883
|
})
|
|
1960
1884
|
}).describe(
|
|
1961
1885
|
"A field that maps URL query params into form values and clears them afterward"
|
|
1962
1886
|
);
|
|
1963
1887
|
var QrReaderField = BaseField.extend({
|
|
1964
|
-
type:
|
|
1888
|
+
type: import_zod15.z.literal(FieldType.QR_READER),
|
|
1965
1889
|
defaultValue: QrReaderFieldValue.optional(),
|
|
1966
|
-
configuration:
|
|
1967
|
-
validator:
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
})
|
|
1890
|
+
configuration: import_zod15.z.object({
|
|
1891
|
+
validator: import_zod15.z.custom(
|
|
1892
|
+
(val) => typeof val === "object" && val !== null
|
|
1893
|
+
)
|
|
1971
1894
|
}).optional()
|
|
1972
|
-
}).meta({
|
|
1973
|
-
description: "Configuration for QR code reader field, including optional JSON Schema validator.",
|
|
1974
|
-
id: "QrReaderField"
|
|
1975
1895
|
});
|
|
1976
1896
|
var IdReaderField = BaseField.extend({
|
|
1977
|
-
type:
|
|
1897
|
+
type: import_zod15.z.literal(FieldType.ID_READER),
|
|
1978
1898
|
defaultValue: IdReaderFieldValue.optional(),
|
|
1979
|
-
methods:
|
|
1980
|
-
|
|
1899
|
+
methods: import_zod15.z.array(
|
|
1900
|
+
import_zod15.z.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
|
|
1981
1901
|
)
|
|
1982
1902
|
});
|
|
1983
|
-
var CustomField = BaseField.extend({
|
|
1984
|
-
type: z16.literal(FieldType._EXPERIMENTAL_CUSTOM),
|
|
1985
|
-
defaultValue: CustomFieldValue.optional(),
|
|
1986
|
-
src: z16.string().describe("Module source path for the custom field component"),
|
|
1987
|
-
configuration: z16.unknown().optional()
|
|
1988
|
-
});
|
|
1989
1903
|
var LoaderField = BaseField.extend({
|
|
1990
|
-
type:
|
|
1991
|
-
configuration:
|
|
1904
|
+
type: import_zod15.z.literal(FieldType.LOADER),
|
|
1905
|
+
configuration: import_zod15.z.object({
|
|
1992
1906
|
text: TranslationConfig.describe("Display text above the loading spinner")
|
|
1993
1907
|
})
|
|
1994
1908
|
}).describe(
|
|
1995
1909
|
"A non-interactive field that indicates an in progress operation in form"
|
|
1996
1910
|
);
|
|
1997
|
-
var
|
|
1998
|
-
type: z16.literal(FieldType.ALPHA_HIDDEN),
|
|
1999
|
-
required: z16.boolean().default(false).optional(),
|
|
2000
|
-
defaultValue: TextValue.optional()
|
|
2001
|
-
}).describe(
|
|
2002
|
-
"A non-interactive, hidden field that only hold a value in the form"
|
|
2003
|
-
);
|
|
2004
|
-
var FieldConfig = z16.discriminatedUnion("type", [
|
|
1911
|
+
var FieldConfig = import_zod15.z.discriminatedUnion("type", [
|
|
2005
1912
|
Address,
|
|
2006
1913
|
TextField,
|
|
2007
1914
|
NumberField,
|
|
@@ -2040,81 +1947,83 @@ var FieldConfig = z16.discriminatedUnion("type", [
|
|
|
2040
1947
|
IdReaderField,
|
|
2041
1948
|
QueryParamReaderField,
|
|
2042
1949
|
LoaderField,
|
|
2043
|
-
SearchField
|
|
2044
|
-
|
|
2045
|
-
HiddenField
|
|
2046
|
-
]).meta({
|
|
1950
|
+
SearchField
|
|
1951
|
+
]).openapi({
|
|
2047
1952
|
description: "Form field configuration",
|
|
2048
|
-
|
|
1953
|
+
ref: "FieldConfig"
|
|
2049
1954
|
});
|
|
2050
|
-
var AnyFileField =
|
|
1955
|
+
var AnyFileField = import_zod15.z.discriminatedUnion("type", [
|
|
2051
1956
|
SignatureField,
|
|
2052
1957
|
File,
|
|
2053
1958
|
FileUploadWithOptions
|
|
2054
1959
|
]);
|
|
2055
1960
|
|
|
2056
1961
|
// ../commons/src/events/FormConfig.ts
|
|
2057
|
-
var
|
|
1962
|
+
var import_zod17 = require("zod");
|
|
2058
1963
|
|
|
2059
1964
|
// ../commons/src/events/PageConfig.ts
|
|
2060
|
-
var
|
|
2061
|
-
var
|
|
2062
|
-
|
|
2063
|
-
|
|
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"),
|
|
2064
1971
|
title: TranslationConfig.describe("Header title of the page"),
|
|
2065
|
-
requireCompletionToContinue:
|
|
1972
|
+
requireCompletionToContinue: import_zod16.z.boolean().default(false).describe(
|
|
2066
1973
|
"If true, all required fields must be filled before continuing to the next page"
|
|
2067
1974
|
),
|
|
2068
|
-
fields:
|
|
1975
|
+
fields: import_zod16.z.array(FieldConfig).describe("Fields to be rendered on the page"),
|
|
2069
1976
|
conditional: Conditional.optional().describe(
|
|
2070
1977
|
"Page will be shown if condition is met. If conditional is not defined, the page will be always shown."
|
|
2071
1978
|
)
|
|
2072
|
-
}).
|
|
1979
|
+
}).openapi({
|
|
2073
1980
|
description: "Form page configuration",
|
|
2074
|
-
|
|
1981
|
+
ref: "FormPageConfig"
|
|
2075
1982
|
});
|
|
2076
1983
|
var FormPageConfig = PageConfigBase.extend({
|
|
2077
|
-
type:
|
|
1984
|
+
type: import_zod16.z.literal(PageTypes.enum.FORM).default(PageTypes.enum.FORM)
|
|
2078
1985
|
});
|
|
2079
|
-
var VerificationActionConfig =
|
|
2080
|
-
verify:
|
|
2081
|
-
cancel:
|
|
1986
|
+
var VerificationActionConfig = import_zod16.z.object({
|
|
1987
|
+
verify: import_zod16.z.object({ label: TranslationConfig }),
|
|
1988
|
+
cancel: import_zod16.z.object({
|
|
2082
1989
|
label: TranslationConfig,
|
|
2083
|
-
confirmation:
|
|
1990
|
+
confirmation: import_zod16.z.object({
|
|
2084
1991
|
title: TranslationConfig,
|
|
2085
1992
|
body: TranslationConfig
|
|
2086
1993
|
})
|
|
2087
1994
|
})
|
|
2088
|
-
}).describe("Actions available on the verification page").
|
|
1995
|
+
}).describe("Actions available on the verification page").openapi({
|
|
2089
1996
|
description: "Verification action configuration",
|
|
2090
|
-
|
|
1997
|
+
ref: "VerificationActionConfig"
|
|
2091
1998
|
});
|
|
2092
1999
|
var VerificationPageConfig = FormPageConfig.extend({
|
|
2093
|
-
type:
|
|
2000
|
+
type: import_zod16.z.literal(PageTypes.enum.VERIFICATION),
|
|
2094
2001
|
actions: VerificationActionConfig
|
|
2095
2002
|
});
|
|
2096
|
-
var PageConfig =
|
|
2003
|
+
var PageConfig = import_zod16.z.discriminatedUnion("type", [
|
|
2097
2004
|
FormPageConfig,
|
|
2098
2005
|
VerificationPageConfig
|
|
2099
2006
|
]);
|
|
2100
2007
|
|
|
2101
2008
|
// ../commons/src/events/FormConfig.ts
|
|
2102
|
-
var DeclarationFormConfig =
|
|
2009
|
+
var DeclarationFormConfig = import_zod17.z.object({
|
|
2103
2010
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2104
|
-
pages:
|
|
2011
|
+
pages: import_zod17.z.array(FormPageConfig)
|
|
2105
2012
|
}).describe("Configuration of the declaration form.");
|
|
2106
|
-
var ActionFormConfig =
|
|
2013
|
+
var ActionFormConfig = import_zod17.z.object({
|
|
2107
2014
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2108
|
-
pages:
|
|
2015
|
+
pages: import_zod17.z.array(PageConfig)
|
|
2109
2016
|
}).describe(
|
|
2110
2017
|
"Configuration of the form used for system actions beyond declaration, supporting a wider range of page types."
|
|
2111
2018
|
);
|
|
2112
|
-
var FormConfig =
|
|
2019
|
+
var FormConfig = import_zod17.z.union([DeclarationFormConfig, ActionFormConfig]);
|
|
2113
2020
|
|
|
2114
2021
|
// ../commons/src/events/DeduplicationConfig.ts
|
|
2115
|
-
var
|
|
2116
|
-
var
|
|
2117
|
-
|
|
2022
|
+
var import_zod18 = require("zod");
|
|
2023
|
+
var import_zod_openapi8 = require("zod-openapi");
|
|
2024
|
+
(0, import_zod_openapi8.extendZodWithOpenApi)(import_zod18.z);
|
|
2025
|
+
var FieldReference2 = import_zod18.z.string();
|
|
2026
|
+
var Matcher = import_zod18.z.object({
|
|
2118
2027
|
/**
|
|
2119
2028
|
* Reference to the field used in matching.
|
|
2120
2029
|
*
|
|
@@ -2122,68 +2031,68 @@ var Matcher = z19.object({
|
|
|
2122
2031
|
* be used as the origin date to calculate the distance from.
|
|
2123
2032
|
*/
|
|
2124
2033
|
fieldId: FieldReference2,
|
|
2125
|
-
options:
|
|
2126
|
-
boost:
|
|
2034
|
+
options: import_zod18.z.object({
|
|
2035
|
+
boost: import_zod18.z.number().optional()
|
|
2127
2036
|
}).optional().default({
|
|
2128
2037
|
boost: 1
|
|
2129
2038
|
})
|
|
2130
2039
|
});
|
|
2131
2040
|
var FuzzyMatcher = Matcher.extend({
|
|
2132
|
-
type:
|
|
2133
|
-
options:
|
|
2041
|
+
type: import_zod18.z.literal("fuzzy"),
|
|
2042
|
+
options: import_zod18.z.object({
|
|
2134
2043
|
/**
|
|
2135
2044
|
* Names of length 3 or less characters = 0 edits allowed
|
|
2136
2045
|
* Names of length 4 - 6 characters = 1 edit allowed
|
|
2137
2046
|
* Names of length >7 characters = 2 edits allowed
|
|
2138
2047
|
*/
|
|
2139
|
-
fuzziness:
|
|
2140
|
-
boost:
|
|
2048
|
+
fuzziness: import_zod18.z.union([import_zod18.z.string(), import_zod18.z.number()]).optional().default("AUTO:4,7"),
|
|
2049
|
+
boost: import_zod18.z.number().optional().default(1)
|
|
2141
2050
|
}).optional().default({
|
|
2142
2051
|
fuzziness: "AUTO:4,7",
|
|
2143
2052
|
boost: 1
|
|
2144
2053
|
})
|
|
2145
2054
|
});
|
|
2146
2055
|
var StrictMatcher = Matcher.extend({
|
|
2147
|
-
type:
|
|
2148
|
-
options:
|
|
2149
|
-
boost:
|
|
2056
|
+
type: import_zod18.z.literal("strict"),
|
|
2057
|
+
options: import_zod18.z.object({
|
|
2058
|
+
boost: import_zod18.z.number().optional().default(1),
|
|
2150
2059
|
/**
|
|
2151
2060
|
* The constant value to be present in the field for both records
|
|
2152
2061
|
*/
|
|
2153
|
-
value:
|
|
2062
|
+
value: import_zod18.z.string().optional()
|
|
2154
2063
|
}).optional().default({
|
|
2155
2064
|
boost: 1
|
|
2156
2065
|
})
|
|
2157
2066
|
});
|
|
2158
2067
|
var DateRangeMatcher = Matcher.extend({
|
|
2159
|
-
type:
|
|
2160
|
-
options:
|
|
2068
|
+
type: import_zod18.z.literal("dateRange"),
|
|
2069
|
+
options: import_zod18.z.object({
|
|
2161
2070
|
/**
|
|
2162
2071
|
* The distance pivot in days. Distance from the origin (the value of
|
|
2163
2072
|
* fieldId) at which relevance scores receive half of the boost value
|
|
2164
2073
|
*/
|
|
2165
|
-
pivot:
|
|
2166
|
-
days:
|
|
2167
|
-
boost:
|
|
2074
|
+
pivot: import_zod18.z.number().optional(),
|
|
2075
|
+
days: import_zod18.z.number(),
|
|
2076
|
+
boost: import_zod18.z.number().optional().default(1)
|
|
2168
2077
|
})
|
|
2169
2078
|
});
|
|
2170
|
-
var Not =
|
|
2171
|
-
type:
|
|
2079
|
+
var Not = import_zod18.z.object({
|
|
2080
|
+
type: import_zod18.z.literal("not"),
|
|
2172
2081
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2173
|
-
clause:
|
|
2082
|
+
clause: import_zod18.z.lazy(() => Clause)
|
|
2174
2083
|
});
|
|
2175
|
-
var And =
|
|
2176
|
-
type:
|
|
2084
|
+
var And = import_zod18.z.object({
|
|
2085
|
+
type: import_zod18.z.literal("and"),
|
|
2177
2086
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2178
|
-
clauses:
|
|
2087
|
+
clauses: import_zod18.z.lazy(() => Clause.array())
|
|
2179
2088
|
});
|
|
2180
|
-
var Or =
|
|
2181
|
-
type:
|
|
2089
|
+
var Or = import_zod18.z.object({
|
|
2090
|
+
type: import_zod18.z.literal("or"),
|
|
2182
2091
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2183
|
-
clauses:
|
|
2092
|
+
clauses: import_zod18.z.lazy(() => Clause.array())
|
|
2184
2093
|
});
|
|
2185
|
-
var Clause =
|
|
2186
|
-
() =>
|
|
2094
|
+
var Clause = import_zod18.z.lazy(
|
|
2095
|
+
() => import_zod18.z.discriminatedUnion("type", [
|
|
2187
2096
|
Not,
|
|
2188
2097
|
And,
|
|
2189
2098
|
Or,
|
|
@@ -2191,298 +2100,193 @@ var Clause = z19.lazy(
|
|
|
2191
2100
|
StrictMatcher,
|
|
2192
2101
|
DateRangeMatcher
|
|
2193
2102
|
])
|
|
2194
|
-
).
|
|
2195
|
-
|
|
2103
|
+
).openapi({
|
|
2104
|
+
ref: "Clause"
|
|
2196
2105
|
});
|
|
2197
|
-
var DeduplicationConfig =
|
|
2198
|
-
id:
|
|
2106
|
+
var DeduplicationConfig = import_zod18.z.object({
|
|
2107
|
+
id: import_zod18.z.string(),
|
|
2199
2108
|
label: TranslationConfig,
|
|
2200
2109
|
query: Clause
|
|
2201
2110
|
});
|
|
2202
2111
|
|
|
2203
|
-
// ../commons/src/icons.ts
|
|
2204
|
-
var z20 = __toESM(require("zod/v4"));
|
|
2205
|
-
var AvailableIcons = z20.enum([
|
|
2206
|
-
"Archived",
|
|
2207
|
-
"Assigned",
|
|
2208
|
-
"Certified",
|
|
2209
|
-
"Close",
|
|
2210
|
-
"Collapse",
|
|
2211
|
-
"Draft",
|
|
2212
|
-
"DuplicateYellow",
|
|
2213
|
-
"Expand",
|
|
2214
|
-
"ExternalValidate",
|
|
2215
|
-
"FilledCheck",
|
|
2216
|
-
"InReview",
|
|
2217
|
-
"Offline",
|
|
2218
|
-
"Registered",
|
|
2219
|
-
"RequiresUpdates",
|
|
2220
|
-
"Sent",
|
|
2221
|
-
"Validated",
|
|
2222
|
-
"WaitingApproval",
|
|
2223
|
-
"ChartActivity",
|
|
2224
|
-
"Activity",
|
|
2225
|
-
"Archive",
|
|
2226
|
-
"ArchiveTray",
|
|
2227
|
-
"ArrowLeft",
|
|
2228
|
-
"ArrowRight",
|
|
2229
|
-
"Buildings",
|
|
2230
|
-
"Circle",
|
|
2231
|
-
"CaretDown",
|
|
2232
|
-
"CaretLeft",
|
|
2233
|
-
"CaretRight",
|
|
2234
|
-
"ChartBar",
|
|
2235
|
-
"ChartLine",
|
|
2236
|
-
"ChatCircle",
|
|
2237
|
-
"CheckSquare",
|
|
2238
|
-
"Compass",
|
|
2239
|
-
"Check",
|
|
2240
|
-
"Copy",
|
|
2241
|
-
"Database",
|
|
2242
|
-
"DotsThreeVertical",
|
|
2243
|
-
"ArrowCounterClockwise",
|
|
2244
|
-
"MagnifyingGlassMinus",
|
|
2245
|
-
"MagnifyingGlassPlus",
|
|
2246
|
-
"Export",
|
|
2247
|
-
"Eye",
|
|
2248
|
-
"EyeSlash",
|
|
2249
|
-
"Envelope",
|
|
2250
|
-
"File",
|
|
2251
|
-
"FileSearch",
|
|
2252
|
-
"FileMinus",
|
|
2253
|
-
"FilePlus",
|
|
2254
|
-
"FileText",
|
|
2255
|
-
"FileX",
|
|
2256
|
-
"Handshake",
|
|
2257
|
-
"Gear",
|
|
2258
|
-
"GitBranch",
|
|
2259
|
-
"IdentificationCard",
|
|
2260
|
-
"List",
|
|
2261
|
-
"ListBullets",
|
|
2262
|
-
"Lock",
|
|
2263
|
-
"MagnifyingGlass",
|
|
2264
|
-
"MapPin",
|
|
2265
|
-
"Medal",
|
|
2266
|
-
"NotePencil",
|
|
2267
|
-
"Paperclip",
|
|
2268
|
-
"PaperPlaneTilt",
|
|
2269
|
-
"Pen",
|
|
2270
|
-
"Pencil",
|
|
2271
|
-
"PencilSimpleLine",
|
|
2272
|
-
"Phone",
|
|
2273
|
-
"Plus",
|
|
2274
|
-
"Printer",
|
|
2275
|
-
"SignOut",
|
|
2276
|
-
"Stamp",
|
|
2277
|
-
"Star",
|
|
2278
|
-
"Target",
|
|
2279
|
-
"TextT",
|
|
2280
|
-
"Trash",
|
|
2281
|
-
"UploadSimple",
|
|
2282
|
-
"User",
|
|
2283
|
-
"UserPlus",
|
|
2284
|
-
"Users",
|
|
2285
|
-
"WarningCircle",
|
|
2286
|
-
"X",
|
|
2287
|
-
"ChatText",
|
|
2288
|
-
"CircleWavyCheck",
|
|
2289
|
-
"CircleWavyQuestion",
|
|
2290
|
-
"ArchiveBox",
|
|
2291
|
-
"ArrowCircleDown",
|
|
2292
|
-
"FileArrowUp",
|
|
2293
|
-
"FileDotted",
|
|
2294
|
-
"Files",
|
|
2295
|
-
"PencilLine",
|
|
2296
|
-
"PencilCircle",
|
|
2297
|
-
"UserCircle",
|
|
2298
|
-
"Clock",
|
|
2299
|
-
"QrCode",
|
|
2300
|
-
"Webcam",
|
|
2301
|
-
"Sun",
|
|
2302
|
-
"DeviceTabletCamera",
|
|
2303
|
-
"Globe",
|
|
2304
|
-
"Fingerprint",
|
|
2305
|
-
"PushPin",
|
|
2306
|
-
"Timer"
|
|
2307
|
-
]);
|
|
2308
|
-
|
|
2309
2112
|
// ../commons/src/events/ActionConfig.ts
|
|
2310
|
-
var
|
|
2113
|
+
var import_zod_openapi9 = require("zod-openapi");
|
|
2114
|
+
(0, import_zod_openapi9.extendZodWithOpenApi)(import_zod19.z);
|
|
2115
|
+
var DeclarationReviewConfig = import_zod19.z.object({
|
|
2311
2116
|
title: TranslationConfig.describe("Title of the review page"),
|
|
2312
|
-
fields:
|
|
2117
|
+
fields: import_zod19.z.array(FieldConfig).describe("Fields displayed on the review page for annotations.")
|
|
2313
2118
|
}).describe(
|
|
2314
2119
|
"Configuration of the declaration review page for collecting event-related metadata."
|
|
2315
2120
|
);
|
|
2316
|
-
var ActionConfigBase =
|
|
2317
|
-
label: TranslationConfig.describe("Human readable description of the action")
|
|
2318
|
-
flags: z21.array(ActionFlagConfig).optional().default([]).describe("Flag actions which are executed when the action is performed."),
|
|
2319
|
-
supportingCopy: TranslationConfig.optional().describe(
|
|
2320
|
-
"Text displayed on the confirmation"
|
|
2321
|
-
),
|
|
2322
|
-
icon: AvailableIcons.describe("Icon representing the action").optional(),
|
|
2323
|
-
conditionals: z21.array(ActionConditional).optional().describe("Conditionals which can disable or hide actions.")
|
|
2121
|
+
var ActionConfigBase = import_zod19.z.object({
|
|
2122
|
+
label: TranslationConfig.describe("Human readable description of the action")
|
|
2324
2123
|
});
|
|
2325
2124
|
var DeclarationActionBase = ActionConfigBase.extend({
|
|
2125
|
+
review: DeclarationReviewConfig,
|
|
2326
2126
|
deduplication: DeduplicationConfig.optional()
|
|
2327
2127
|
});
|
|
2328
|
-
var ReadActionConfig = ActionConfigBase.
|
|
2329
|
-
|
|
2330
|
-
type:
|
|
2128
|
+
var ReadActionConfig = ActionConfigBase.merge(
|
|
2129
|
+
import_zod19.z.object({
|
|
2130
|
+
type: import_zod19.z.literal(ActionType.READ),
|
|
2331
2131
|
review: DeclarationReviewConfig.describe(
|
|
2332
2132
|
"Configuration of the review page for read-only view."
|
|
2333
|
-
),
|
|
2334
|
-
conditionals: z21.never().optional().describe("Read-action can not be disabled or hidden with conditionals.")
|
|
2335
|
-
}).shape
|
|
2336
|
-
);
|
|
2337
|
-
var DeclareConfig = DeclarationActionBase.extend(
|
|
2338
|
-
z21.object({
|
|
2339
|
-
type: z21.literal(ActionType.DECLARE),
|
|
2340
|
-
review: DeclarationReviewConfig.describe(
|
|
2341
|
-
"Configuration of the review page fields."
|
|
2342
2133
|
)
|
|
2343
|
-
})
|
|
2134
|
+
})
|
|
2344
2135
|
);
|
|
2345
|
-
var
|
|
2346
|
-
|
|
2347
|
-
type:
|
|
2348
|
-
})
|
|
2136
|
+
var DeclareConfig = DeclarationActionBase.merge(
|
|
2137
|
+
import_zod19.z.object({
|
|
2138
|
+
type: import_zod19.z.literal(ActionType.DECLARE)
|
|
2139
|
+
})
|
|
2349
2140
|
);
|
|
2350
|
-
var
|
|
2351
|
-
|
|
2352
|
-
type:
|
|
2353
|
-
})
|
|
2141
|
+
var ValidateConfig = DeclarationActionBase.merge(
|
|
2142
|
+
import_zod19.z.object({
|
|
2143
|
+
type: import_zod19.z.literal(ActionType.VALIDATE)
|
|
2144
|
+
})
|
|
2145
|
+
);
|
|
2146
|
+
var RegisterConfig = DeclarationActionBase.merge(
|
|
2147
|
+
import_zod19.z.object({
|
|
2148
|
+
type: import_zod19.z.literal(ActionType.REGISTER)
|
|
2149
|
+
})
|
|
2150
|
+
);
|
|
2151
|
+
var RejectDeclarationConfig = ActionConfigBase.merge(
|
|
2152
|
+
import_zod19.z.object({
|
|
2153
|
+
type: import_zod19.z.literal(ActionType.REJECT)
|
|
2154
|
+
})
|
|
2155
|
+
);
|
|
2156
|
+
var ArchiveConfig = ActionConfigBase.merge(
|
|
2157
|
+
import_zod19.z.object({
|
|
2158
|
+
type: import_zod19.z.literal(ActionType.ARCHIVE)
|
|
2159
|
+
})
|
|
2354
2160
|
);
|
|
2355
|
-
var
|
|
2356
|
-
|
|
2357
|
-
type:
|
|
2358
|
-
})
|
|
2161
|
+
var DeleteConfig = ActionConfigBase.merge(
|
|
2162
|
+
import_zod19.z.object({
|
|
2163
|
+
type: import_zod19.z.literal(ActionType.DELETE)
|
|
2164
|
+
})
|
|
2359
2165
|
);
|
|
2360
|
-
var PrintCertificateActionConfig = ActionConfigBase.
|
|
2361
|
-
|
|
2362
|
-
type:
|
|
2166
|
+
var PrintCertificateActionConfig = ActionConfigBase.merge(
|
|
2167
|
+
import_zod19.z.object({
|
|
2168
|
+
type: import_zod19.z.literal(ActionType.PRINT_CERTIFICATE),
|
|
2363
2169
|
printForm: ActionFormConfig
|
|
2364
|
-
})
|
|
2170
|
+
})
|
|
2365
2171
|
);
|
|
2366
|
-
var RequestCorrectionConfig = ActionConfigBase.
|
|
2367
|
-
|
|
2368
|
-
type:
|
|
2172
|
+
var RequestCorrectionConfig = ActionConfigBase.merge(
|
|
2173
|
+
import_zod19.z.object({
|
|
2174
|
+
type: import_zod19.z.literal(ActionType.REQUEST_CORRECTION),
|
|
2369
2175
|
correctionForm: ActionFormConfig
|
|
2370
|
-
})
|
|
2176
|
+
})
|
|
2371
2177
|
);
|
|
2372
|
-
var
|
|
2373
|
-
|
|
2374
|
-
type:
|
|
2375
|
-
customActionType: z21.string().describe("Type identifier of the custom action."),
|
|
2376
|
-
/** Custom action form configuration supports a simple array of field configs, which should be rendered on the action modal. In the future, we might add support for pages etc. */
|
|
2377
|
-
form: z21.array(FieldConfig).describe(
|
|
2378
|
-
"Form configuration for the custom action. The form configured here will be used on the custom action confirmation modal."
|
|
2379
|
-
),
|
|
2380
|
-
auditHistoryLabel: TranslationConfig.describe(
|
|
2381
|
-
'The label to show in audit history for this action. For example "Approved".'
|
|
2382
|
-
)
|
|
2178
|
+
var RejectCorrectionConfig = ActionConfigBase.merge(
|
|
2179
|
+
import_zod19.z.object({
|
|
2180
|
+
type: import_zod19.z.literal(ActionType.REJECT_CORRECTION)
|
|
2383
2181
|
})
|
|
2384
2182
|
);
|
|
2385
|
-
var
|
|
2183
|
+
var ApproveCorrectionConfig = ActionConfigBase.merge(
|
|
2184
|
+
import_zod19.z.object({
|
|
2185
|
+
type: import_zod19.z.literal(ActionType.APPROVE_CORRECTION)
|
|
2186
|
+
})
|
|
2187
|
+
);
|
|
2188
|
+
var ActionConfig = import_zod19.z.discriminatedUnion("type", [
|
|
2386
2189
|
/*
|
|
2387
2190
|
* OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
|
|
2388
2191
|
* and treat them as "models" instead of duplicating the data structure in each endpoint.
|
|
2389
2192
|
*/
|
|
2390
|
-
ReadActionConfig.
|
|
2391
|
-
DeclareConfig.
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2193
|
+
ReadActionConfig.openapi({ ref: "ReadActionConfig" }),
|
|
2194
|
+
DeclareConfig.openapi({ ref: "DeclareActionConfig" }),
|
|
2195
|
+
ValidateConfig.openapi({ ref: "ValidateActionConfig" }),
|
|
2196
|
+
RejectDeclarationConfig.openapi({ ref: "RejectDeclarationActionConfig" }),
|
|
2197
|
+
ArchiveConfig.openapi({ ref: "ArchiveActionConfig" }),
|
|
2198
|
+
RegisterConfig.openapi({ ref: "RegisterActionConfig" }),
|
|
2199
|
+
DeleteConfig.openapi({ ref: "DeleteActionConfig" }),
|
|
2200
|
+
PrintCertificateActionConfig.openapi({
|
|
2201
|
+
ref: "PrintCertificateActionConfig"
|
|
2396
2202
|
}),
|
|
2397
|
-
RequestCorrectionConfig.
|
|
2398
|
-
|
|
2399
|
-
|
|
2203
|
+
RequestCorrectionConfig.openapi({ ref: "RequestCorrectionActionConfig" }),
|
|
2204
|
+
RejectCorrectionConfig.openapi({ ref: "RejectCorrectionActionConfig" }),
|
|
2205
|
+
ApproveCorrectionConfig.openapi({ ref: "ApproveCorrectionActionConfig" })
|
|
2400
2206
|
]).describe(
|
|
2401
2207
|
"Configuration of an action available for an event. Data collected depends on the action type and is accessible through the annotation property in ActionDocument."
|
|
2402
|
-
).
|
|
2403
|
-
var
|
|
2404
|
-
ActionConfig.options.map((opt) => opt.shape.type.value)
|
|
2405
|
-
);
|
|
2406
|
-
var DeclarationActionConfig = z21.discriminatedUnion("type", [
|
|
2208
|
+
).openapi({ ref: "ActionConfig" });
|
|
2209
|
+
var DeclarationActionConfig = import_zod19.z.discriminatedUnion("type", [
|
|
2407
2210
|
DeclareConfig,
|
|
2211
|
+
ValidateConfig,
|
|
2408
2212
|
RegisterConfig
|
|
2409
2213
|
]);
|
|
2410
2214
|
|
|
2411
2215
|
// ../commons/src/events/offline/CertificateConfig.ts
|
|
2412
|
-
var
|
|
2413
|
-
var FontFamily =
|
|
2414
|
-
normal:
|
|
2415
|
-
bold:
|
|
2416
|
-
italics:
|
|
2417
|
-
bolditalics:
|
|
2216
|
+
var import_zod20 = require("zod");
|
|
2217
|
+
var FontFamily = import_zod20.z.object({
|
|
2218
|
+
normal: import_zod20.z.string(),
|
|
2219
|
+
bold: import_zod20.z.string(),
|
|
2220
|
+
italics: import_zod20.z.string(),
|
|
2221
|
+
bolditalics: import_zod20.z.string()
|
|
2418
2222
|
});
|
|
2419
|
-
var CertificateConfig =
|
|
2420
|
-
id:
|
|
2421
|
-
event:
|
|
2422
|
-
isV2Template:
|
|
2223
|
+
var CertificateConfig = import_zod20.z.object({
|
|
2224
|
+
id: import_zod20.z.string(),
|
|
2225
|
+
event: import_zod20.z.string(),
|
|
2226
|
+
isV2Template: import_zod20.z.boolean().optional(),
|
|
2423
2227
|
label: TranslationConfig,
|
|
2424
|
-
isDefault:
|
|
2425
|
-
fee:
|
|
2426
|
-
onTime:
|
|
2427
|
-
late:
|
|
2428
|
-
delayed:
|
|
2228
|
+
isDefault: import_zod20.z.boolean(),
|
|
2229
|
+
fee: import_zod20.z.object({
|
|
2230
|
+
onTime: import_zod20.z.number(),
|
|
2231
|
+
late: import_zod20.z.number(),
|
|
2232
|
+
delayed: import_zod20.z.number()
|
|
2429
2233
|
}),
|
|
2430
|
-
svgUrl:
|
|
2431
|
-
fonts:
|
|
2432
|
-
conditionals:
|
|
2234
|
+
svgUrl: import_zod20.z.string(),
|
|
2235
|
+
fonts: import_zod20.z.record(FontFamily).optional(),
|
|
2236
|
+
conditionals: import_zod20.z.array(ShowConditional).optional()
|
|
2433
2237
|
});
|
|
2434
2238
|
var CertificateTemplateConfig = CertificateConfig.extend({
|
|
2435
|
-
hash:
|
|
2436
|
-
svg:
|
|
2239
|
+
hash: import_zod20.z.string().optional(),
|
|
2240
|
+
svg: import_zod20.z.string()
|
|
2437
2241
|
});
|
|
2438
2242
|
|
|
2439
2243
|
// ../commons/src/events/offline/LanguageConfig.ts
|
|
2440
|
-
var
|
|
2441
|
-
var LanguageConfig =
|
|
2442
|
-
lang:
|
|
2244
|
+
var import_zod21 = require("zod");
|
|
2245
|
+
var LanguageConfig = import_zod21.z.object({
|
|
2246
|
+
lang: import_zod21.z.string(),
|
|
2443
2247
|
/**
|
|
2444
2248
|
* client.csv contents
|
|
2445
2249
|
*/
|
|
2446
|
-
messages:
|
|
2250
|
+
messages: import_zod21.z.record(import_zod21.z.string())
|
|
2447
2251
|
});
|
|
2448
2252
|
|
|
2449
2253
|
// ../commons/src/events/EventConfig.ts
|
|
2450
|
-
var
|
|
2254
|
+
var import_zod26 = require("zod");
|
|
2451
2255
|
|
|
2452
2256
|
// ../commons/src/events/SummaryConfig.ts
|
|
2453
|
-
var
|
|
2454
|
-
var BaseField2 =
|
|
2257
|
+
var import_zod22 = require("zod");
|
|
2258
|
+
var BaseField2 = import_zod22.z.object({
|
|
2455
2259
|
emptyValueMessage: TranslationConfig.optional().describe(
|
|
2456
2260
|
"Default message displayed when the field value is empty."
|
|
2457
2261
|
),
|
|
2458
|
-
conditionals:
|
|
2262
|
+
conditionals: import_zod22.z.array(ShowConditional).default([]).optional()
|
|
2459
2263
|
});
|
|
2460
2264
|
var ReferenceField = BaseField2.extend({
|
|
2461
|
-
fieldId:
|
|
2265
|
+
fieldId: import_zod22.z.string(),
|
|
2462
2266
|
label: TranslationConfig.optional().describe(
|
|
2463
2267
|
"Overrides the default label from the referenced field when provided."
|
|
2464
2268
|
)
|
|
2465
2269
|
}).describe("Field referencing existing event data by field ID.");
|
|
2466
2270
|
var Field = BaseField2.extend({
|
|
2467
|
-
id:
|
|
2271
|
+
id: import_zod22.z.string().describe("Identifier of the summary field."),
|
|
2468
2272
|
value: TranslationConfig.describe(
|
|
2469
2273
|
'Field value template supporting variables from configuration and EventMetadata (e.g. "{informant.phoneNo} {informant.email}").'
|
|
2470
2274
|
),
|
|
2471
2275
|
label: TranslationConfig
|
|
2472
2276
|
}).describe("Custom field defined for the summary view.");
|
|
2473
|
-
var SummaryConfig =
|
|
2474
|
-
fields:
|
|
2277
|
+
var SummaryConfig = import_zod22.z.object({
|
|
2278
|
+
fields: import_zod22.z.array(import_zod22.z.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
|
|
2475
2279
|
}).describe("Configuration of the event summary section.");
|
|
2476
2280
|
|
|
2477
2281
|
// ../commons/src/events/AdvancedSearchConfig.ts
|
|
2478
|
-
var
|
|
2479
|
-
var MatchType =
|
|
2480
|
-
var BaseField3 =
|
|
2481
|
-
config:
|
|
2282
|
+
var import_zod23 = require("zod");
|
|
2283
|
+
var MatchType = import_zod23.z.enum(["fuzzy", "exact", "range", "within"]);
|
|
2284
|
+
var BaseField3 = import_zod23.z.object({
|
|
2285
|
+
config: import_zod23.z.object({
|
|
2482
2286
|
type: MatchType.describe(
|
|
2483
2287
|
"Determines the search type of field. How to match value."
|
|
2484
2288
|
),
|
|
2485
|
-
searchFields:
|
|
2289
|
+
searchFields: import_zod23.z.array(import_zod23.z.string()).optional().describe(
|
|
2486
2290
|
`
|
|
2487
2291
|
Defines multiple form fields that should be searched when this field has a value.
|
|
2488
2292
|
All specified fields will be combined using OR logic.
|
|
@@ -2492,7 +2296,7 @@ var BaseField3 = z25.object({
|
|
|
2492
2296
|
`
|
|
2493
2297
|
)
|
|
2494
2298
|
}),
|
|
2495
|
-
type:
|
|
2299
|
+
type: import_zod23.z.nativeEnum(FieldType).optional().describe(
|
|
2496
2300
|
`
|
|
2497
2301
|
Explicitly specify the field type for searchFields.
|
|
2498
2302
|
This is required when searchFields is defined, to show the correct control in the UI.
|
|
@@ -2506,7 +2310,7 @@ var BaseField3 = z25.object({
|
|
|
2506
2310
|
This is required when searchFields is defined.
|
|
2507
2311
|
`
|
|
2508
2312
|
),
|
|
2509
|
-
options:
|
|
2313
|
+
options: import_zod23.z.array(SelectOption).optional(),
|
|
2510
2314
|
searchCriteriaLabelPrefix: TranslationConfig.optional().describe(
|
|
2511
2315
|
`
|
|
2512
2316
|
This property determines whether to add a prefix (such as "Child" or "Applicant") before the field label
|
|
@@ -2527,7 +2331,7 @@ var BaseField3 = z25.object({
|
|
|
2527
2331
|
in the country-config > event.advancedSearch configuration. For example: field("child.dob", { searchCriteriaLabelPrefix: TranslationConfig }).
|
|
2528
2332
|
`
|
|
2529
2333
|
),
|
|
2530
|
-
conditionals:
|
|
2334
|
+
conditionals: import_zod23.z.array(FieldConditional).default([]).optional().describe(
|
|
2531
2335
|
`
|
|
2532
2336
|
In advanced search, we sometimes need to override the default field visibility conditionals.
|
|
2533
2337
|
|
|
@@ -2541,61 +2345,59 @@ var BaseField3 = z25.object({
|
|
|
2541
2345
|
are always rendered in the advanced search form.
|
|
2542
2346
|
`
|
|
2543
2347
|
),
|
|
2544
|
-
validations:
|
|
2348
|
+
validations: import_zod23.z.array(ValidationConfig).default([]).optional().describe(
|
|
2545
2349
|
`Option for overriding the field validations specifically for advanced search form.`
|
|
2546
2350
|
)
|
|
2547
2351
|
});
|
|
2548
|
-
var SearchQueryParams =
|
|
2549
|
-
eventType:
|
|
2352
|
+
var SearchQueryParams = import_zod23.z.object({
|
|
2353
|
+
eventType: import_zod23.z.string().optional().describe(
|
|
2550
2354
|
"Defines type of event so that when redirecting to Advanced Search page, appropriate tab can be selected"
|
|
2551
2355
|
)
|
|
2552
2356
|
}).catchall(FieldValue);
|
|
2553
2357
|
var FieldConfigSchema = BaseField3.extend({
|
|
2554
|
-
fieldId:
|
|
2555
|
-
fieldType:
|
|
2358
|
+
fieldId: import_zod23.z.string(),
|
|
2359
|
+
fieldType: import_zod23.z.literal("field")
|
|
2556
2360
|
});
|
|
2557
|
-
var EventFieldIdInput =
|
|
2361
|
+
var EventFieldIdInput = import_zod23.z.enum([
|
|
2558
2362
|
"trackingId",
|
|
2559
2363
|
"status",
|
|
2560
2364
|
"legalStatuses.REGISTERED.acceptedAt",
|
|
2561
2365
|
"legalStatuses.REGISTERED.createdAtLocation",
|
|
2562
|
-
"legalStatuses.REGISTERED.registrationNumber",
|
|
2563
2366
|
"updatedAt"
|
|
2564
2367
|
]);
|
|
2565
2368
|
var METADATA_FIELD_PREFIX = "event.";
|
|
2566
|
-
var EventFieldId =
|
|
2369
|
+
var EventFieldId = import_zod23.z.enum([
|
|
2567
2370
|
`${METADATA_FIELD_PREFIX}trackingId`,
|
|
2568
2371
|
`${METADATA_FIELD_PREFIX}status`,
|
|
2569
2372
|
`${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.acceptedAt`,
|
|
2570
2373
|
`${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.createdAtLocation`,
|
|
2571
|
-
`${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.registrationNumber`,
|
|
2572
2374
|
`${METADATA_FIELD_PREFIX}updatedAt`
|
|
2573
2375
|
]);
|
|
2574
2376
|
var EventFieldConfigSchema = BaseField3.extend({
|
|
2575
2377
|
fieldId: EventFieldId,
|
|
2576
|
-
fieldType:
|
|
2378
|
+
fieldType: import_zod23.z.literal("event")
|
|
2577
2379
|
});
|
|
2578
|
-
var AdvancedSearchField =
|
|
2380
|
+
var AdvancedSearchField = import_zod23.z.discriminatedUnion("fieldType", [FieldConfigSchema, EventFieldConfigSchema]).superRefine((data, ctx) => {
|
|
2579
2381
|
if (data.config.searchFields && data.config.searchFields.length > 0) {
|
|
2580
2382
|
if (!data.label) {
|
|
2581
2383
|
ctx.addIssue({
|
|
2582
|
-
code:
|
|
2384
|
+
code: import_zod23.z.ZodIssueCode.custom,
|
|
2583
2385
|
message: "label is required when config.searchFields is defined.",
|
|
2584
2386
|
path: ["label"]
|
|
2585
2387
|
});
|
|
2586
2388
|
}
|
|
2587
2389
|
if (!data.type) {
|
|
2588
2390
|
ctx.addIssue({
|
|
2589
|
-
code:
|
|
2391
|
+
code: import_zod23.z.ZodIssueCode.custom,
|
|
2590
2392
|
message: "type is required when config.searchFields is defined.",
|
|
2591
2393
|
path: ["type"]
|
|
2592
2394
|
});
|
|
2593
2395
|
}
|
|
2594
2396
|
}
|
|
2595
2397
|
});
|
|
2596
|
-
var AdvancedSearchConfig =
|
|
2398
|
+
var AdvancedSearchConfig = import_zod23.z.object({
|
|
2597
2399
|
title: TranslationConfig.describe("Advanced search tab title"),
|
|
2598
|
-
fields:
|
|
2400
|
+
fields: import_zod23.z.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
|
|
2599
2401
|
});
|
|
2600
2402
|
|
|
2601
2403
|
// ../commons/src/events/utils.ts
|
|
@@ -2604,11 +2406,11 @@ var import_lodash = require("lodash");
|
|
|
2604
2406
|
// ../commons/src/conditionals/validate.ts
|
|
2605
2407
|
var import__ = __toESM(require("ajv/dist/2019"));
|
|
2606
2408
|
var import_ajv_formats = __toESM(require("ajv-formats"));
|
|
2607
|
-
var
|
|
2409
|
+
var import_zod25 = require("zod");
|
|
2608
2410
|
var import_date_fns = require("date-fns");
|
|
2609
2411
|
|
|
2610
2412
|
// ../commons/src/events/DynamicFieldValue.ts
|
|
2611
|
-
var
|
|
2413
|
+
var import_zod24 = require("zod");
|
|
2612
2414
|
|
|
2613
2415
|
// ../commons/src/conditionals/validate.ts
|
|
2614
2416
|
var ajv = new import__.default({
|
|
@@ -2617,9 +2419,9 @@ var ajv = new import__.default({
|
|
|
2617
2419
|
strict: false
|
|
2618
2420
|
// Allow minContains and other newer features
|
|
2619
2421
|
});
|
|
2620
|
-
var DataContext =
|
|
2621
|
-
rootData:
|
|
2622
|
-
$leafAdminStructureLocationIds:
|
|
2422
|
+
var DataContext = import_zod25.z.object({
|
|
2423
|
+
rootData: import_zod25.z.object({
|
|
2424
|
+
$leafAdminStructureLocationIds: import_zod25.z.array(import_zod25.z.object({ id: UUID }))
|
|
2623
2425
|
})
|
|
2624
2426
|
});
|
|
2625
2427
|
function resolveDataPath(rootData, dataPath, instancePath) {
|
|
@@ -2696,12 +2498,12 @@ ajv.addKeyword({
|
|
|
2696
2498
|
});
|
|
2697
2499
|
|
|
2698
2500
|
// ../commons/src/utils.ts
|
|
2699
|
-
var
|
|
2700
|
-
var FullNameV1 =
|
|
2701
|
-
|
|
2702
|
-
use:
|
|
2703
|
-
family:
|
|
2704
|
-
given:
|
|
2501
|
+
var z26 = __toESM(require("zod"));
|
|
2502
|
+
var FullNameV1 = z26.array(
|
|
2503
|
+
z26.object({
|
|
2504
|
+
use: z26.string(),
|
|
2505
|
+
family: z26.string(),
|
|
2506
|
+
given: z26.array(z26.string())
|
|
2705
2507
|
})
|
|
2706
2508
|
);
|
|
2707
2509
|
function omitKeyDeep(obj, keyToRemove) {
|
|
@@ -2722,6 +2524,9 @@ function omitKeyDeep(obj, keyToRemove) {
|
|
|
2722
2524
|
|
|
2723
2525
|
// ../commons/src/events/utils.ts
|
|
2724
2526
|
var import_date_fns2 = require("date-fns");
|
|
2527
|
+
function isDeclarationActionConfig(action) {
|
|
2528
|
+
return DeclarationActions.safeParse(action.type).success;
|
|
2529
|
+
}
|
|
2725
2530
|
function getDeclarationFields(configuration) {
|
|
2726
2531
|
return configuration.declaration.pages.flatMap(({ fields }) => fields);
|
|
2727
2532
|
}
|
|
@@ -2732,7 +2537,7 @@ var getActionAnnotationFields = (actionConfig) => {
|
|
|
2732
2537
|
if (actionConfig.type === ActionType.PRINT_CERTIFICATE) {
|
|
2733
2538
|
return actionConfig.printForm.pages.flatMap(({ fields }) => fields);
|
|
2734
2539
|
}
|
|
2735
|
-
if (
|
|
2540
|
+
if (isDeclarationActionConfig(actionConfig)) {
|
|
2736
2541
|
return actionConfig.review.fields;
|
|
2737
2542
|
}
|
|
2738
2543
|
return [];
|
|
@@ -2753,16 +2558,15 @@ var EXCLUDED_ACTIONS = [
|
|
|
2753
2558
|
];
|
|
2754
2559
|
|
|
2755
2560
|
// ../commons/src/events/EventConfig.ts
|
|
2756
|
-
var
|
|
2757
|
-
|
|
2561
|
+
var import_zod_openapi10 = require("zod-openapi");
|
|
2562
|
+
(0, import_zod_openapi10.extendZodWithOpenApi)(import_zod26.z);
|
|
2563
|
+
var EventConfig = import_zod26.z.object({
|
|
2564
|
+
id: import_zod26.z.string().describe(
|
|
2758
2565
|
'Machine-readable identifier of the event (e.g. "birth", "death").'
|
|
2759
2566
|
),
|
|
2760
2567
|
dateOfEvent: FieldReference.optional().describe(
|
|
2761
2568
|
"Reference to the field capturing the date of the event (e.g. date of birth). Defaults to the event creation date if unspecified."
|
|
2762
2569
|
),
|
|
2763
|
-
placeOfEvent: FieldReference.optional().describe(
|
|
2764
|
-
"Reference to the field capturing the place of the event (e.g. place of birth). Defaults to the meta.createdAtLocation if unspecified."
|
|
2765
|
-
),
|
|
2766
2570
|
title: TranslationConfig.describe(
|
|
2767
2571
|
'Title template for the singular event, supporting variables (e.g. "{applicant.name.firstname} {applicant.name.surname}").'
|
|
2768
2572
|
),
|
|
@@ -2775,17 +2579,14 @@ var EventConfig = z29.object({
|
|
|
2775
2579
|
label: TranslationConfig.describe(
|
|
2776
2580
|
"Human-readable label for the event type."
|
|
2777
2581
|
),
|
|
2778
|
-
actions:
|
|
2582
|
+
actions: import_zod26.z.array(ActionConfig).describe(
|
|
2779
2583
|
"Configuration of system-defined actions associated with the event."
|
|
2780
2584
|
),
|
|
2781
2585
|
declaration: DeclarationFormConfig.describe(
|
|
2782
2586
|
"Configuration of the form used to gather event data."
|
|
2783
2587
|
),
|
|
2784
|
-
advancedSearch:
|
|
2588
|
+
advancedSearch: import_zod26.z.array(AdvancedSearchConfig).optional().default([]).describe(
|
|
2785
2589
|
"Configuration of fields available in the advanced search feature."
|
|
2786
|
-
),
|
|
2787
|
-
flags: z29.array(FlagConfig).optional().default([]).describe(
|
|
2788
|
-
"Configuration of flags associated with the actions of this event type."
|
|
2789
2590
|
)
|
|
2790
2591
|
}).superRefine((event2, ctx) => {
|
|
2791
2592
|
const allFields = findAllFields(event2);
|
|
@@ -2837,37 +2638,8 @@ var EventConfig = z29.object({
|
|
|
2837
2638
|
});
|
|
2838
2639
|
}
|
|
2839
2640
|
}
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
({ id }) => id === event2.placeOfEvent?.$$field
|
|
2843
|
-
);
|
|
2844
|
-
if (!eventPlaceFieldId) {
|
|
2845
|
-
ctx.addIssue({
|
|
2846
|
-
code: "custom",
|
|
2847
|
-
message: `Place of event field id must match a field id in the event.declaration fields.
|
|
2848
|
-
Invalid place of event field ID for event ${event2.id}: ${event2.placeOfEvent.$$field}`,
|
|
2849
|
-
path: ["placeOfEvent"]
|
|
2850
|
-
});
|
|
2851
|
-
}
|
|
2852
|
-
}
|
|
2853
|
-
const isInherentFlag = (value) => Object.values(InherentFlags).includes(value);
|
|
2854
|
-
const configuredFlagIds = event2.flags.map((flag) => flag.id);
|
|
2855
|
-
const actionFlagIds = event2.actions.flatMap(
|
|
2856
|
-
(action) => action.flags.map((flag) => flag.id)
|
|
2857
|
-
);
|
|
2858
|
-
for (const actionFlagId of actionFlagIds) {
|
|
2859
|
-
const isConfigured = configuredFlagIds.includes(actionFlagId);
|
|
2860
|
-
const isInherent = isInherentFlag(actionFlagId);
|
|
2861
|
-
if (!isConfigured && !isInherent) {
|
|
2862
|
-
ctx.addIssue({
|
|
2863
|
-
code: "custom",
|
|
2864
|
-
message: `Action flag id must match an inherent flag or a configured flag in the flags array. Invalid action flag ID for event '${event2.id}': '${actionFlagId}'`,
|
|
2865
|
-
path: ["actions"]
|
|
2866
|
-
});
|
|
2867
|
-
}
|
|
2868
|
-
}
|
|
2869
|
-
}).meta({
|
|
2870
|
-
id: "EventConfig"
|
|
2641
|
+
}).openapi({
|
|
2642
|
+
ref: "EventConfig"
|
|
2871
2643
|
}).describe("Configuration defining an event type.");
|
|
2872
2644
|
|
|
2873
2645
|
// ../commons/src/events/EventConfigInput.ts
|
|
@@ -2876,7 +2648,7 @@ var defineActionForm = (actionForm) => ActionFormConfig.parse(actionForm);
|
|
|
2876
2648
|
var defineFormPage = (formPage) => FormPageConfig.parse(formPage);
|
|
2877
2649
|
|
|
2878
2650
|
// ../commons/src/events/WorkqueueConfig.ts
|
|
2879
|
-
var
|
|
2651
|
+
var import_zod30 = require("zod");
|
|
2880
2652
|
|
|
2881
2653
|
// ../commons/src/conditionals/conditionals.ts
|
|
2882
2654
|
var objectHash = __toESM(require("object-hash"));
|
|
@@ -2914,7 +2686,7 @@ function not(condition) {
|
|
|
2914
2686
|
required: []
|
|
2915
2687
|
});
|
|
2916
2688
|
}
|
|
2917
|
-
function
|
|
2689
|
+
function never() {
|
|
2918
2690
|
return not(alwaysTrue());
|
|
2919
2691
|
}
|
|
2920
2692
|
function jsonFieldPath(field3) {
|
|
@@ -3623,17 +3395,17 @@ var event = Object.assign(eventFn, {
|
|
|
3623
3395
|
});
|
|
3624
3396
|
|
|
3625
3397
|
// ../commons/src/events/WorkqueueColumnConfig.ts
|
|
3626
|
-
var
|
|
3398
|
+
var import_zod27 = require("zod");
|
|
3627
3399
|
var WorkqueueColumnKeysArray = [
|
|
3628
3400
|
...EventMetadataKeysArray,
|
|
3629
3401
|
"title",
|
|
3630
3402
|
"outbox"
|
|
3631
3403
|
];
|
|
3632
|
-
var WorkqueueColumnKeys =
|
|
3633
|
-
var WorkqueueColumnValue =
|
|
3404
|
+
var WorkqueueColumnKeys = import_zod27.z.enum(WorkqueueColumnKeysArray);
|
|
3405
|
+
var WorkqueueColumnValue = import_zod27.z.object({
|
|
3634
3406
|
$event: WorkqueueColumnKeys
|
|
3635
3407
|
});
|
|
3636
|
-
var WorkqueueColumn =
|
|
3408
|
+
var WorkqueueColumn = import_zod27.z.object({
|
|
3637
3409
|
label: TranslationConfig,
|
|
3638
3410
|
value: WorkqueueColumnValue
|
|
3639
3411
|
});
|
|
@@ -3644,54 +3416,158 @@ function defineWorkqueuesColumns(workqueueColumns) {
|
|
|
3644
3416
|
}
|
|
3645
3417
|
|
|
3646
3418
|
// ../commons/src/events/CountryConfigQueryInput.ts
|
|
3647
|
-
var
|
|
3648
|
-
var SerializableExact =
|
|
3649
|
-
type:
|
|
3650
|
-
term:
|
|
3419
|
+
var import_zod28 = require("zod");
|
|
3420
|
+
var SerializableExact = import_zod28.z.object({
|
|
3421
|
+
type: import_zod28.z.literal("exact"),
|
|
3422
|
+
term: import_zod28.z.union([import_zod28.z.string(), SerializedUserField])
|
|
3651
3423
|
});
|
|
3652
|
-
var SerializableWithin =
|
|
3653
|
-
type:
|
|
3654
|
-
location:
|
|
3424
|
+
var SerializableWithin = import_zod28.z.object({
|
|
3425
|
+
type: import_zod28.z.literal("within"),
|
|
3426
|
+
location: import_zod28.z.union([import_zod28.z.string(), SerializedUserField])
|
|
3655
3427
|
});
|
|
3656
|
-
var SerializedQueryExpression =
|
|
3657
|
-
eventType:
|
|
3658
|
-
status:
|
|
3659
|
-
createdAt:
|
|
3660
|
-
updatedAt:
|
|
3661
|
-
"legalStatuses.REGISTERED.createdAt":
|
|
3662
|
-
"legalStatuses.REGISTERED.createdAtLocation":
|
|
3663
|
-
|
|
3428
|
+
var SerializedQueryExpression = import_zod28.z.object({
|
|
3429
|
+
eventType: import_zod28.z.string(),
|
|
3430
|
+
status: import_zod28.z.optional(import_zod28.z.union([AnyOfStatus, ExactStatus])),
|
|
3431
|
+
createdAt: import_zod28.z.optional(DateCondition),
|
|
3432
|
+
updatedAt: import_zod28.z.optional(DateCondition),
|
|
3433
|
+
"legalStatuses.REGISTERED.createdAt": import_zod28.z.optional(DateCondition),
|
|
3434
|
+
"legalStatuses.REGISTERED.createdAtLocation": import_zod28.z.optional(
|
|
3435
|
+
import_zod28.z.union([Within, Exact])
|
|
3664
3436
|
),
|
|
3665
|
-
"legalStatuses.REGISTERED.registrationNumber":
|
|
3666
|
-
createdAtLocation:
|
|
3667
|
-
|
|
3437
|
+
"legalStatuses.REGISTERED.registrationNumber": import_zod28.z.optional(Exact),
|
|
3438
|
+
createdAtLocation: import_zod28.z.optional(
|
|
3439
|
+
import_zod28.z.union([SerializableWithin, SerializableExact])
|
|
3668
3440
|
),
|
|
3669
|
-
updatedAtLocation:
|
|
3670
|
-
|
|
3441
|
+
updatedAtLocation: import_zod28.z.optional(
|
|
3442
|
+
import_zod28.z.union([SerializableWithin, SerializableExact])
|
|
3671
3443
|
),
|
|
3672
|
-
assignedTo:
|
|
3673
|
-
createdBy:
|
|
3444
|
+
assignedTo: import_zod28.z.optional(SerializableExact),
|
|
3445
|
+
createdBy: import_zod28.z.optional(SerializableExact),
|
|
3674
3446
|
createdByUserType: ExactUserType,
|
|
3675
|
-
updatedBy:
|
|
3676
|
-
trackingId:
|
|
3677
|
-
flags:
|
|
3447
|
+
updatedBy: import_zod28.z.optional(SerializableExact),
|
|
3448
|
+
trackingId: import_zod28.z.optional(Exact),
|
|
3449
|
+
flags: import_zod28.z.optional(ContainsFlags),
|
|
3678
3450
|
data: QueryInput
|
|
3679
3451
|
}).partial();
|
|
3680
|
-
var Or2 =
|
|
3681
|
-
type:
|
|
3682
|
-
clauses:
|
|
3452
|
+
var Or2 = import_zod28.z.object({
|
|
3453
|
+
type: import_zod28.z.literal("or"),
|
|
3454
|
+
clauses: import_zod28.z.array(SerializedQueryExpression)
|
|
3683
3455
|
});
|
|
3684
|
-
var And2 =
|
|
3685
|
-
type:
|
|
3686
|
-
clauses:
|
|
3456
|
+
var And2 = import_zod28.z.object({
|
|
3457
|
+
type: import_zod28.z.literal("and"),
|
|
3458
|
+
clauses: import_zod28.z.array(SerializedQueryExpression)
|
|
3687
3459
|
});
|
|
3688
|
-
var CountryConfigQueryType =
|
|
3689
|
-
var CountryConfigQueryInputType =
|
|
3460
|
+
var CountryConfigQueryType = import_zod28.z.discriminatedUnion("type", [And2, Or2]);
|
|
3461
|
+
var CountryConfigQueryInputType = import_zod28.z.union([
|
|
3690
3462
|
SerializedQueryExpression,
|
|
3691
3463
|
And2,
|
|
3692
3464
|
Or2
|
|
3693
3465
|
]);
|
|
3694
3466
|
|
|
3467
|
+
// ../commons/src/icons.ts
|
|
3468
|
+
var import_zod29 = require("zod");
|
|
3469
|
+
var AvailableIcons = import_zod29.z.enum([
|
|
3470
|
+
"Archived",
|
|
3471
|
+
"Assigned",
|
|
3472
|
+
"Certified",
|
|
3473
|
+
"Close",
|
|
3474
|
+
"Collapse",
|
|
3475
|
+
"Draft",
|
|
3476
|
+
"DuplicateYellow",
|
|
3477
|
+
"Expand",
|
|
3478
|
+
"ExternalValidate",
|
|
3479
|
+
"FilledCheck",
|
|
3480
|
+
"InReview",
|
|
3481
|
+
"Offline",
|
|
3482
|
+
"Registered",
|
|
3483
|
+
"RequiresUpdates",
|
|
3484
|
+
"Sent",
|
|
3485
|
+
"Validated",
|
|
3486
|
+
"WaitingApproval",
|
|
3487
|
+
"ChartActivity",
|
|
3488
|
+
"Activity",
|
|
3489
|
+
"Archive",
|
|
3490
|
+
"ArchiveTray",
|
|
3491
|
+
"ArrowLeft",
|
|
3492
|
+
"ArrowRight",
|
|
3493
|
+
"Buildings",
|
|
3494
|
+
"Circle",
|
|
3495
|
+
"CaretDown",
|
|
3496
|
+
"CaretLeft",
|
|
3497
|
+
"CaretRight",
|
|
3498
|
+
"ChartBar",
|
|
3499
|
+
"ChartLine",
|
|
3500
|
+
"ChatCircle",
|
|
3501
|
+
"CheckSquare",
|
|
3502
|
+
"Compass",
|
|
3503
|
+
"Check",
|
|
3504
|
+
"Copy",
|
|
3505
|
+
"Database",
|
|
3506
|
+
"DotsThreeVertical",
|
|
3507
|
+
"ArrowCounterClockwise",
|
|
3508
|
+
"MagnifyingGlassMinus",
|
|
3509
|
+
"MagnifyingGlassPlus",
|
|
3510
|
+
"Export",
|
|
3511
|
+
"Eye",
|
|
3512
|
+
"EyeSlash",
|
|
3513
|
+
"Envelope",
|
|
3514
|
+
"File",
|
|
3515
|
+
"FileSearch",
|
|
3516
|
+
"FileMinus",
|
|
3517
|
+
"FilePlus",
|
|
3518
|
+
"FileText",
|
|
3519
|
+
"FileX",
|
|
3520
|
+
"Handshake",
|
|
3521
|
+
"Gear",
|
|
3522
|
+
"GitBranch",
|
|
3523
|
+
"IdentificationCard",
|
|
3524
|
+
"List",
|
|
3525
|
+
"ListBullets",
|
|
3526
|
+
"Lock",
|
|
3527
|
+
"MagnifyingGlass",
|
|
3528
|
+
"MapPin",
|
|
3529
|
+
"Medal",
|
|
3530
|
+
"NotePencil",
|
|
3531
|
+
"Paperclip",
|
|
3532
|
+
"PaperPlaneTilt",
|
|
3533
|
+
"Pen",
|
|
3534
|
+
"Pencil",
|
|
3535
|
+
"PencilSimpleLine",
|
|
3536
|
+
"Phone",
|
|
3537
|
+
"Plus",
|
|
3538
|
+
"Printer",
|
|
3539
|
+
"SignOut",
|
|
3540
|
+
"Star",
|
|
3541
|
+
"Target",
|
|
3542
|
+
"TextT",
|
|
3543
|
+
"Trash",
|
|
3544
|
+
"UploadSimple",
|
|
3545
|
+
"User",
|
|
3546
|
+
"UserPlus",
|
|
3547
|
+
"Users",
|
|
3548
|
+
"WarningCircle",
|
|
3549
|
+
"X",
|
|
3550
|
+
"CircleWavyCheck",
|
|
3551
|
+
"CircleWavyQuestion",
|
|
3552
|
+
"ArchiveBox",
|
|
3553
|
+
"ArrowCircleDown",
|
|
3554
|
+
"FileArrowUp",
|
|
3555
|
+
"FileDotted",
|
|
3556
|
+
"Files",
|
|
3557
|
+
"PencilLine",
|
|
3558
|
+
"PencilCircle",
|
|
3559
|
+
"UserCircle",
|
|
3560
|
+
"Clock",
|
|
3561
|
+
"QrCode",
|
|
3562
|
+
"Webcam",
|
|
3563
|
+
"Sun",
|
|
3564
|
+
"DeviceTabletCamera",
|
|
3565
|
+
"Globe",
|
|
3566
|
+
"Fingerprint",
|
|
3567
|
+
"PushPin",
|
|
3568
|
+
"Timer"
|
|
3569
|
+
]);
|
|
3570
|
+
|
|
3695
3571
|
// ../commons/src/events/WorkqueueConfig.ts
|
|
3696
3572
|
var mandatoryColumns = defineWorkqueuesColumns([
|
|
3697
3573
|
{
|
|
@@ -3711,24 +3587,23 @@ var mandatoryColumns = defineWorkqueuesColumns([
|
|
|
3711
3587
|
value: event.field("updatedAt")
|
|
3712
3588
|
}
|
|
3713
3589
|
]);
|
|
3714
|
-
var WorkqueueActionsWithDefault =
|
|
3590
|
+
var WorkqueueActionsWithDefault = import_zod30.z.enum([
|
|
3715
3591
|
...workqueueActions.options,
|
|
3716
|
-
"DEFAULT"
|
|
3717
|
-
ActionType.READ
|
|
3592
|
+
"DEFAULT"
|
|
3718
3593
|
]);
|
|
3719
|
-
var WorkqueueConfig =
|
|
3720
|
-
slug:
|
|
3594
|
+
var WorkqueueConfig = import_zod30.z.object({
|
|
3595
|
+
slug: import_zod30.z.string().describe("Determines the url of the workqueue."),
|
|
3721
3596
|
name: TranslationConfig.describe(
|
|
3722
3597
|
"Title of the workflow (both in navigation and on the page)"
|
|
3723
3598
|
),
|
|
3724
3599
|
query: CountryConfigQueryType,
|
|
3725
|
-
actions:
|
|
3726
|
-
|
|
3600
|
+
actions: import_zod30.z.array(
|
|
3601
|
+
import_zod30.z.object({
|
|
3727
3602
|
type: WorkqueueActionsWithDefault,
|
|
3728
|
-
conditionals:
|
|
3603
|
+
conditionals: import_zod30.z.array(Conditional).optional()
|
|
3729
3604
|
})
|
|
3730
3605
|
),
|
|
3731
|
-
columns:
|
|
3606
|
+
columns: import_zod30.z.array(WorkqueueColumn).default(mandatoryColumns),
|
|
3732
3607
|
icon: AvailableIcons,
|
|
3733
3608
|
emptyMessage: TranslationConfig.optional()
|
|
3734
3609
|
}).describe("Configuration for workqueue.");
|
|
@@ -3736,26 +3611,26 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
|
|
|
3736
3611
|
query: true,
|
|
3737
3612
|
columns: true
|
|
3738
3613
|
});
|
|
3739
|
-
var WorkqueueConfigInput =
|
|
3740
|
-
slug:
|
|
3614
|
+
var WorkqueueConfigInput = import_zod30.z.object({
|
|
3615
|
+
slug: import_zod30.z.string().describe("Determines the url of the workqueue."),
|
|
3741
3616
|
name: TranslationConfig.describe(
|
|
3742
3617
|
"Title of the workflow (both in navigation and on the page)"
|
|
3743
3618
|
),
|
|
3744
3619
|
query: CountryConfigQueryInputType,
|
|
3745
|
-
actions:
|
|
3746
|
-
|
|
3620
|
+
actions: import_zod30.z.array(
|
|
3621
|
+
import_zod30.z.object({
|
|
3747
3622
|
type: WorkqueueActionsWithDefault,
|
|
3748
|
-
conditionals:
|
|
3623
|
+
conditionals: import_zod30.z.array(Conditional).optional()
|
|
3749
3624
|
})
|
|
3750
3625
|
),
|
|
3751
|
-
columns:
|
|
3626
|
+
columns: import_zod30.z.array(WorkqueueColumn).default(mandatoryColumns),
|
|
3752
3627
|
icon: AvailableIcons,
|
|
3753
3628
|
emptyMessage: TranslationConfig.optional()
|
|
3754
3629
|
});
|
|
3755
|
-
var WorkqueueCountInput =
|
|
3756
|
-
|
|
3630
|
+
var WorkqueueCountInput = import_zod30.z.array(
|
|
3631
|
+
import_zod30.z.object({ slug: import_zod30.z.string(), query: QueryType })
|
|
3757
3632
|
);
|
|
3758
|
-
var WorkqueueCountOutput =
|
|
3633
|
+
var WorkqueueCountOutput = import_zod30.z.record(import_zod30.z.string(), import_zod30.z.number());
|
|
3759
3634
|
|
|
3760
3635
|
// ../commons/src/events/workqueueDefaultColumns.ts
|
|
3761
3636
|
var defaultWorkqueueColumns = [
|
|
@@ -3778,40 +3653,47 @@ var defaultWorkqueueColumns = [
|
|
|
3778
3653
|
];
|
|
3779
3654
|
|
|
3780
3655
|
// ../commons/src/events/Draft.ts
|
|
3781
|
-
var
|
|
3656
|
+
var import_zod32 = require("zod");
|
|
3782
3657
|
|
|
3783
3658
|
// ../commons/src/events/ActionInput.ts
|
|
3784
|
-
var
|
|
3785
|
-
var
|
|
3659
|
+
var import_zod31 = require("zod");
|
|
3660
|
+
var import_zod_openapi11 = require("zod-openapi");
|
|
3661
|
+
(0, import_zod_openapi11.extendZodWithOpenApi)(import_zod31.z);
|
|
3662
|
+
var BaseActionInput = import_zod31.z.object({
|
|
3786
3663
|
eventId: UUID,
|
|
3787
|
-
transactionId:
|
|
3664
|
+
transactionId: import_zod31.z.string(),
|
|
3788
3665
|
declaration: ActionUpdate.default({}),
|
|
3789
3666
|
annotation: ActionUpdate.optional(),
|
|
3790
3667
|
originalActionId: UUID.optional(),
|
|
3791
3668
|
// should not be part of base action.
|
|
3792
|
-
keepAssignment:
|
|
3669
|
+
keepAssignment: import_zod31.z.boolean().optional(),
|
|
3793
3670
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
3794
3671
|
createdAtLocation: CreatedAtLocation.describe(
|
|
3795
3672
|
"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."
|
|
3796
3673
|
)
|
|
3797
3674
|
});
|
|
3798
|
-
var CreateActionInput = BaseActionInput.
|
|
3799
|
-
|
|
3800
|
-
type:
|
|
3675
|
+
var CreateActionInput = BaseActionInput.merge(
|
|
3676
|
+
import_zod31.z.object({
|
|
3677
|
+
type: import_zod31.z.literal(ActionType.CREATE).default(ActionType.CREATE),
|
|
3801
3678
|
createdAtLocation: CreatedAtLocation
|
|
3802
|
-
})
|
|
3679
|
+
})
|
|
3803
3680
|
);
|
|
3804
|
-
var RegisterActionInput = BaseActionInput.
|
|
3805
|
-
|
|
3806
|
-
type:
|
|
3807
|
-
registrationNumber:
|
|
3808
|
-
})
|
|
3681
|
+
var RegisterActionInput = BaseActionInput.merge(
|
|
3682
|
+
import_zod31.z.object({
|
|
3683
|
+
type: import_zod31.z.literal(ActionType.REGISTER).default(ActionType.REGISTER),
|
|
3684
|
+
registrationNumber: import_zod31.z.string().optional()
|
|
3685
|
+
})
|
|
3686
|
+
).strict();
|
|
3687
|
+
var ValidateActionInput = BaseActionInput.merge(
|
|
3688
|
+
import_zod31.z.object({
|
|
3689
|
+
type: import_zod31.z.literal(ActionType.VALIDATE).default(ActionType.VALIDATE)
|
|
3690
|
+
})
|
|
3809
3691
|
);
|
|
3810
|
-
var NotifyActionInput = BaseActionInput.
|
|
3811
|
-
|
|
3812
|
-
type:
|
|
3813
|
-
})
|
|
3814
|
-
).
|
|
3692
|
+
var NotifyActionInput = BaseActionInput.merge(
|
|
3693
|
+
import_zod31.z.object({
|
|
3694
|
+
type: import_zod31.z.literal(ActionType.NOTIFY).default(ActionType.NOTIFY)
|
|
3695
|
+
})
|
|
3696
|
+
).openapi({
|
|
3815
3697
|
default: {
|
|
3816
3698
|
eventId: "<event-id-here>",
|
|
3817
3699
|
transactionId: getUUID(),
|
|
@@ -3820,150 +3702,135 @@ var NotifyActionInput = BaseActionInput.extend(
|
|
|
3820
3702
|
type: ActionType.NOTIFY
|
|
3821
3703
|
}
|
|
3822
3704
|
});
|
|
3823
|
-
var DeclareActionInput = BaseActionInput.
|
|
3824
|
-
|
|
3825
|
-
type:
|
|
3826
|
-
})
|
|
3827
|
-
);
|
|
3828
|
-
var EditActionInput = BaseActionInput.extend(
|
|
3829
|
-
z33.object({
|
|
3830
|
-
type: z33.literal(ActionType.EDIT).default(ActionType.EDIT),
|
|
3831
|
-
content: z33.object({
|
|
3832
|
-
comment: z33.string().describe("Comment for the edit action.").optional()
|
|
3833
|
-
})
|
|
3834
|
-
}).shape
|
|
3705
|
+
var DeclareActionInput = BaseActionInput.merge(
|
|
3706
|
+
import_zod31.z.object({
|
|
3707
|
+
type: import_zod31.z.literal(ActionType.DECLARE).default(ActionType.DECLARE)
|
|
3708
|
+
})
|
|
3835
3709
|
);
|
|
3836
|
-
var PrintCertificateActionInput = BaseActionInput.
|
|
3837
|
-
|
|
3838
|
-
type:
|
|
3710
|
+
var PrintCertificateActionInput = BaseActionInput.merge(
|
|
3711
|
+
import_zod31.z.object({
|
|
3712
|
+
type: import_zod31.z.literal(ActionType.PRINT_CERTIFICATE).default(ActionType.PRINT_CERTIFICATE),
|
|
3839
3713
|
content: PrintContent.optional()
|
|
3840
|
-
})
|
|
3714
|
+
})
|
|
3841
3715
|
);
|
|
3842
|
-
var RejectDeclarationActionInput = BaseActionInput.
|
|
3843
|
-
|
|
3844
|
-
type:
|
|
3716
|
+
var RejectDeclarationActionInput = BaseActionInput.merge(
|
|
3717
|
+
import_zod31.z.object({
|
|
3718
|
+
type: import_zod31.z.literal(ActionType.REJECT).default(ActionType.REJECT),
|
|
3845
3719
|
content: ReasonContent
|
|
3846
|
-
})
|
|
3720
|
+
})
|
|
3847
3721
|
);
|
|
3848
|
-
var DuplicateDetectedActionInput = BaseActionInput.
|
|
3849
|
-
|
|
3850
|
-
type:
|
|
3851
|
-
content:
|
|
3852
|
-
duplicates:
|
|
3722
|
+
var DuplicateDetectedActionInput = BaseActionInput.merge(
|
|
3723
|
+
import_zod31.z.object({
|
|
3724
|
+
type: import_zod31.z.literal(ActionType.DUPLICATE_DETECTED).default(ActionType.DUPLICATE_DETECTED),
|
|
3725
|
+
content: import_zod31.z.object({
|
|
3726
|
+
duplicates: import_zod31.z.array(PotentialDuplicate)
|
|
3853
3727
|
})
|
|
3854
|
-
})
|
|
3728
|
+
})
|
|
3855
3729
|
);
|
|
3856
|
-
var MarkAsDuplicateActionInput = BaseActionInput.
|
|
3857
|
-
|
|
3858
|
-
type:
|
|
3859
|
-
content:
|
|
3730
|
+
var MarkAsDuplicateActionInput = BaseActionInput.merge(
|
|
3731
|
+
import_zod31.z.object({
|
|
3732
|
+
type: import_zod31.z.literal(ActionType.MARK_AS_DUPLICATE).default(ActionType.MARK_AS_DUPLICATE),
|
|
3733
|
+
content: import_zod31.z.object({
|
|
3860
3734
|
duplicateOf: UUID
|
|
3861
3735
|
}).optional()
|
|
3862
|
-
})
|
|
3736
|
+
})
|
|
3863
3737
|
);
|
|
3864
|
-
var MarkNotDuplicateActionInput = BaseActionInput.
|
|
3865
|
-
|
|
3866
|
-
type:
|
|
3867
|
-
})
|
|
3738
|
+
var MarkNotDuplicateActionInput = BaseActionInput.merge(
|
|
3739
|
+
import_zod31.z.object({
|
|
3740
|
+
type: import_zod31.z.literal(ActionType.MARK_AS_NOT_DUPLICATE).default(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
3741
|
+
})
|
|
3868
3742
|
);
|
|
3869
|
-
var ArchiveActionInput = BaseActionInput.
|
|
3870
|
-
|
|
3871
|
-
type:
|
|
3743
|
+
var ArchiveActionInput = BaseActionInput.merge(
|
|
3744
|
+
import_zod31.z.object({
|
|
3745
|
+
type: import_zod31.z.literal(ActionType.ARCHIVE).default(ActionType.ARCHIVE),
|
|
3872
3746
|
content: ReasonContent
|
|
3873
|
-
})
|
|
3747
|
+
})
|
|
3874
3748
|
);
|
|
3875
|
-
var AssignActionInput = BaseActionInput.
|
|
3876
|
-
|
|
3877
|
-
type:
|
|
3878
|
-
assignedTo:
|
|
3879
|
-
})
|
|
3749
|
+
var AssignActionInput = BaseActionInput.merge(
|
|
3750
|
+
import_zod31.z.object({
|
|
3751
|
+
type: import_zod31.z.literal(ActionType.ASSIGN),
|
|
3752
|
+
assignedTo: import_zod31.z.string()
|
|
3753
|
+
})
|
|
3880
3754
|
);
|
|
3881
|
-
var UnassignActionInput = BaseActionInput.
|
|
3882
|
-
|
|
3883
|
-
type:
|
|
3884
|
-
assignedTo:
|
|
3885
|
-
})
|
|
3755
|
+
var UnassignActionInput = BaseActionInput.merge(
|
|
3756
|
+
import_zod31.z.object({
|
|
3757
|
+
type: import_zod31.z.literal(ActionType.UNASSIGN).default(ActionType.UNASSIGN),
|
|
3758
|
+
assignedTo: import_zod31.z.literal(null).default(null)
|
|
3759
|
+
})
|
|
3886
3760
|
);
|
|
3887
|
-
var RequestCorrectionActionInput = BaseActionInput.
|
|
3888
|
-
|
|
3889
|
-
type:
|
|
3890
|
-
})
|
|
3761
|
+
var RequestCorrectionActionInput = BaseActionInput.merge(
|
|
3762
|
+
import_zod31.z.object({
|
|
3763
|
+
type: import_zod31.z.literal(ActionType.REQUEST_CORRECTION).default(ActionType.REQUEST_CORRECTION)
|
|
3764
|
+
})
|
|
3891
3765
|
);
|
|
3892
|
-
var RejectCorrectionActionInput = BaseActionInput.
|
|
3893
|
-
|
|
3894
|
-
requestId:
|
|
3895
|
-
type:
|
|
3766
|
+
var RejectCorrectionActionInput = BaseActionInput.merge(
|
|
3767
|
+
import_zod31.z.object({
|
|
3768
|
+
requestId: import_zod31.z.string(),
|
|
3769
|
+
type: import_zod31.z.literal(ActionType.REJECT_CORRECTION).default(ActionType.REJECT_CORRECTION),
|
|
3896
3770
|
content: ReasonContent
|
|
3897
|
-
})
|
|
3898
|
-
);
|
|
3899
|
-
var ApproveCorrectionActionInput = BaseActionInput.extend(
|
|
3900
|
-
z33.object({
|
|
3901
|
-
requestId: z33.string(),
|
|
3902
|
-
type: z33.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
|
|
3903
|
-
}).shape
|
|
3771
|
+
})
|
|
3904
3772
|
);
|
|
3905
|
-
var
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3773
|
+
var ApproveCorrectionActionInput = BaseActionInput.merge(
|
|
3774
|
+
import_zod31.z.object({
|
|
3775
|
+
requestId: import_zod31.z.string(),
|
|
3776
|
+
type: import_zod31.z.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
|
|
3777
|
+
})
|
|
3909
3778
|
);
|
|
3910
|
-
var
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
customActionType: z33.string().describe("Name of the custom action.")
|
|
3915
|
-
}).shape
|
|
3779
|
+
var ReadActionInput = BaseActionInput.merge(
|
|
3780
|
+
import_zod31.z.object({
|
|
3781
|
+
type: import_zod31.z.literal(ActionType.READ).default(ActionType.READ)
|
|
3782
|
+
})
|
|
3916
3783
|
);
|
|
3917
|
-
var
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3784
|
+
var DeleteActionInput = import_zod31.z.object({ eventId: UUID });
|
|
3785
|
+
var ActionInput = import_zod31.z.discriminatedUnion("type", [
|
|
3786
|
+
CreateActionInput.openapi({ ref: "CreateActionInput" }),
|
|
3787
|
+
ValidateActionInput.openapi({ ref: "ValidateActionInput" }),
|
|
3788
|
+
RegisterActionInput.openapi({ ref: "RegisterActionInput" }),
|
|
3789
|
+
NotifyActionInput.openapi({ ref: "NotifyActionInput" }),
|
|
3790
|
+
DeclareActionInput.openapi({ ref: "DeclareActionInput" }),
|
|
3791
|
+
RejectDeclarationActionInput.openapi({
|
|
3792
|
+
ref: "RejectDeclarationActionInput"
|
|
3924
3793
|
}),
|
|
3925
|
-
DuplicateDetectedActionInput.
|
|
3926
|
-
|
|
3794
|
+
DuplicateDetectedActionInput.openapi({
|
|
3795
|
+
ref: "DuplicateDetectedActionInput"
|
|
3927
3796
|
}),
|
|
3928
|
-
MarkAsDuplicateActionInput.
|
|
3929
|
-
|
|
3797
|
+
MarkAsDuplicateActionInput.openapi({
|
|
3798
|
+
ref: "MarkAsDuplicateActionInput"
|
|
3930
3799
|
}),
|
|
3931
|
-
MarkNotDuplicateActionInput.
|
|
3932
|
-
|
|
3800
|
+
MarkNotDuplicateActionInput.openapi({
|
|
3801
|
+
ref: "MarkNotDuplicateActionInput"
|
|
3933
3802
|
}),
|
|
3934
|
-
ArchiveActionInput.
|
|
3935
|
-
AssignActionInput.
|
|
3936
|
-
UnassignActionInput.
|
|
3937
|
-
PrintCertificateActionInput.
|
|
3938
|
-
RequestCorrectionActionInput.
|
|
3939
|
-
|
|
3803
|
+
ArchiveActionInput.openapi({ ref: "ArchiveActionInput" }),
|
|
3804
|
+
AssignActionInput.openapi({ ref: "AssignActionInput" }),
|
|
3805
|
+
UnassignActionInput.openapi({ ref: "UnassignActionInput" }),
|
|
3806
|
+
PrintCertificateActionInput.openapi({ ref: "PrintCertificateActionInput" }),
|
|
3807
|
+
RequestCorrectionActionInput.openapi({
|
|
3808
|
+
ref: "RequestCorrectionActionInput"
|
|
3940
3809
|
}),
|
|
3941
|
-
RejectCorrectionActionInput.
|
|
3942
|
-
ApproveCorrectionActionInput.
|
|
3943
|
-
|
|
3810
|
+
RejectCorrectionActionInput.openapi({ ref: "RejectCorrectionActionInput" }),
|
|
3811
|
+
ApproveCorrectionActionInput.openapi({
|
|
3812
|
+
ref: "ApproveCorrectionActionInput"
|
|
3944
3813
|
}),
|
|
3945
|
-
ReadActionInput.
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
]).meta({
|
|
3949
|
-
id: "ActionInput"
|
|
3814
|
+
ReadActionInput.openapi({ ref: "ReadActionInput" })
|
|
3815
|
+
]).openapi({
|
|
3816
|
+
ref: "ActionInput"
|
|
3950
3817
|
});
|
|
3951
3818
|
|
|
3952
3819
|
// ../commons/src/events/Draft.ts
|
|
3953
|
-
var Draft =
|
|
3820
|
+
var Draft = import_zod32.z.object({
|
|
3954
3821
|
id: UUID,
|
|
3955
3822
|
eventId: UUID,
|
|
3956
|
-
transactionId:
|
|
3957
|
-
createdAt:
|
|
3823
|
+
transactionId: import_zod32.z.string(),
|
|
3824
|
+
createdAt: import_zod32.z.string().datetime(),
|
|
3958
3825
|
action: ActionBase.extend({
|
|
3959
|
-
type: ActionTypes.exclude([ActionTypes.
|
|
3826
|
+
type: ActionTypes.exclude([ActionTypes.Enum.DELETE])
|
|
3960
3827
|
}).omit({ id: true, createdAtLocation: true })
|
|
3961
3828
|
}).describe(
|
|
3962
3829
|
"A temporary storage for an action. Stored with details of the event, creator and creation time."
|
|
3963
3830
|
);
|
|
3964
3831
|
var DraftInput = BaseActionInput.extend({
|
|
3965
|
-
type: ActionTypes.exclude([ActionTypes.
|
|
3966
|
-
status:
|
|
3832
|
+
type: ActionTypes.exclude([ActionTypes.Enum.DELETE]),
|
|
3833
|
+
status: import_zod32.z.enum([
|
|
3967
3834
|
ActionStatus.Requested,
|
|
3968
3835
|
ActionStatus.Accepted,
|
|
3969
3836
|
ActionStatus.Rejected
|
|
@@ -3971,30 +3838,32 @@ var DraftInput = BaseActionInput.extend({
|
|
|
3971
3838
|
});
|
|
3972
3839
|
|
|
3973
3840
|
// ../commons/src/events/EventInput.ts
|
|
3974
|
-
var
|
|
3841
|
+
var import_zod33 = require("zod");
|
|
3975
3842
|
var import_uuid10 = require("uuid");
|
|
3976
|
-
var EventInput =
|
|
3977
|
-
transactionId:
|
|
3978
|
-
type:
|
|
3979
|
-
}).
|
|
3843
|
+
var EventInput = import_zod33.z.object({
|
|
3844
|
+
transactionId: import_zod33.z.string(),
|
|
3845
|
+
type: import_zod33.z.string()
|
|
3846
|
+
}).openapi({ default: { transactionId: (0, import_uuid10.v4)(), type: "birth" } });
|
|
3980
3847
|
|
|
3981
3848
|
// ../commons/src/events/EventDocument.ts
|
|
3982
|
-
var
|
|
3983
|
-
var
|
|
3849
|
+
var import_zod34 = require("zod");
|
|
3850
|
+
var import_zod_openapi12 = require("zod-openapi");
|
|
3851
|
+
(0, import_zod_openapi12.extendZodWithOpenApi)(import_zod34.z);
|
|
3852
|
+
var EventDocument = import_zod34.z.object({
|
|
3984
3853
|
id: UUID.describe("Unique identifier of the event."),
|
|
3985
|
-
type:
|
|
3986
|
-
createdAt:
|
|
3987
|
-
updatedAt:
|
|
3854
|
+
type: import_zod34.z.string().describe("Type of the event (e.g. birth, death, marriage)."),
|
|
3855
|
+
createdAt: import_zod34.z.string().datetime().describe("Timestamp indicating when the event was created."),
|
|
3856
|
+
updatedAt: import_zod34.z.string().datetime().describe(
|
|
3988
3857
|
"Timestamp of the last update, excluding changes from actions."
|
|
3989
3858
|
),
|
|
3990
|
-
actions:
|
|
3991
|
-
trackingId:
|
|
3859
|
+
actions: import_zod34.z.array(Action).describe("Ordered list of actions associated with the event."),
|
|
3860
|
+
trackingId: import_zod34.z.string().describe(
|
|
3992
3861
|
"System-generated tracking identifier used to look up the event."
|
|
3993
3862
|
)
|
|
3994
|
-
}).
|
|
3863
|
+
}).openapi({ ref: "EventDocument" });
|
|
3995
3864
|
|
|
3996
3865
|
// ../commons/src/events/state/index.ts
|
|
3997
|
-
var
|
|
3866
|
+
var import_lodash3 = require("lodash");
|
|
3998
3867
|
|
|
3999
3868
|
// ../commons/src/events/state/utils.ts
|
|
4000
3869
|
var import_lodash2 = require("lodash");
|
|
@@ -4002,18 +3871,14 @@ var updateActions = ActionTypes.extract([
|
|
|
4002
3871
|
ActionType.CREATE,
|
|
4003
3872
|
ActionType.NOTIFY,
|
|
4004
3873
|
ActionType.DECLARE,
|
|
3874
|
+
ActionType.VALIDATE,
|
|
4005
3875
|
ActionType.REGISTER,
|
|
4006
3876
|
ActionType.REJECT,
|
|
4007
3877
|
ActionType.ARCHIVE,
|
|
4008
3878
|
ActionType.PRINT_CERTIFICATE,
|
|
4009
|
-
ActionType.REQUEST_CORRECTION
|
|
4010
|
-
ActionType.CUSTOM
|
|
3879
|
+
ActionType.REQUEST_CORRECTION
|
|
4011
3880
|
]);
|
|
4012
3881
|
|
|
4013
|
-
// ../commons/src/events/state/flags.ts
|
|
4014
|
-
var import_lodash3 = require("lodash");
|
|
4015
|
-
var import_date_fns3 = require("date-fns");
|
|
4016
|
-
|
|
4017
3882
|
// ../commons/src/events/defineConfig.ts
|
|
4018
3883
|
var defineConfig = (config) => {
|
|
4019
3884
|
const input = EventConfig.parse(config);
|
|
@@ -4021,7 +3886,7 @@ var defineConfig = (config) => {
|
|
|
4021
3886
|
};
|
|
4022
3887
|
|
|
4023
3888
|
// ../commons/src/events/test.utils.ts
|
|
4024
|
-
var
|
|
3889
|
+
var import_lodash4 = require("lodash");
|
|
4025
3890
|
var import_date_fns4 = require("date-fns");
|
|
4026
3891
|
|
|
4027
3892
|
// ../commons/src/field-config/field-configuration.ts
|
|
@@ -4043,6 +3908,7 @@ function field(fieldId, options = {}) {
|
|
|
4043
3908
|
}
|
|
4044
3909
|
|
|
4045
3910
|
// ../commons/src/fixtures/forms.ts
|
|
3911
|
+
var import_date_fns3 = require("date-fns");
|
|
4046
3912
|
var PRINT_CERTIFICATE_FORM = defineActionForm({
|
|
4047
3913
|
label: {
|
|
4048
3914
|
id: "event.tennis-club-membership.action.certificate.form.label",
|
|
@@ -4842,7 +4708,7 @@ var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
|
|
|
4842
4708
|
conditionals: [
|
|
4843
4709
|
{
|
|
4844
4710
|
type: ConditionalType.DISPLAY_ON_REVIEW,
|
|
4845
|
-
conditional:
|
|
4711
|
+
conditional: never()
|
|
4846
4712
|
}
|
|
4847
4713
|
]
|
|
4848
4714
|
},
|
|
@@ -5225,16 +5091,119 @@ var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
|
|
|
5225
5091
|
}
|
|
5226
5092
|
}
|
|
5227
5093
|
],
|
|
5228
|
-
conditional: not(
|
|
5094
|
+
conditional: not(never())
|
|
5229
5095
|
// Intentional always-true page conditional to exercise interactions between page-level and field-level conditionals in tests
|
|
5230
5096
|
}
|
|
5231
5097
|
]
|
|
5232
5098
|
});
|
|
5099
|
+
var statusOptions = [
|
|
5100
|
+
{
|
|
5101
|
+
value: "ALL",
|
|
5102
|
+
label: {
|
|
5103
|
+
defaultMessage: "Any status",
|
|
5104
|
+
description: "Option for form field: status of record",
|
|
5105
|
+
id: "advancedSearch.form.recordStatusAny"
|
|
5106
|
+
}
|
|
5107
|
+
},
|
|
5108
|
+
{
|
|
5109
|
+
value: EventStatus.enum.CREATED,
|
|
5110
|
+
label: {
|
|
5111
|
+
defaultMessage: "Draft",
|
|
5112
|
+
description: "Option for form field: status of record",
|
|
5113
|
+
id: "advancedSearch.form.recordStatusCreated"
|
|
5114
|
+
}
|
|
5115
|
+
},
|
|
5116
|
+
{
|
|
5117
|
+
value: EventStatus.enum.NOTIFIED,
|
|
5118
|
+
label: {
|
|
5119
|
+
defaultMessage: "Notified",
|
|
5120
|
+
description: "Option for form field: status of record",
|
|
5121
|
+
id: "advancedSearch.form.recordStatusNotified"
|
|
5122
|
+
}
|
|
5123
|
+
},
|
|
5124
|
+
{
|
|
5125
|
+
value: EventStatus.enum.DECLARED,
|
|
5126
|
+
label: {
|
|
5127
|
+
defaultMessage: "Declared",
|
|
5128
|
+
description: "Option for form field: status of record",
|
|
5129
|
+
id: "advancedSearch.form.recordStatusDeclared"
|
|
5130
|
+
}
|
|
5131
|
+
},
|
|
5132
|
+
{
|
|
5133
|
+
value: EventStatus.enum.VALIDATED,
|
|
5134
|
+
label: {
|
|
5135
|
+
defaultMessage: "Validated",
|
|
5136
|
+
description: "Option for form field: status of record",
|
|
5137
|
+
id: "advancedSearch.form.recordStatusValidated"
|
|
5138
|
+
}
|
|
5139
|
+
},
|
|
5140
|
+
{
|
|
5141
|
+
value: EventStatus.enum.REGISTERED,
|
|
5142
|
+
label: {
|
|
5143
|
+
defaultMessage: "Registered",
|
|
5144
|
+
description: "Option for form field: status of record",
|
|
5145
|
+
id: "advancedSearch.form.recordStatusRegistered"
|
|
5146
|
+
}
|
|
5147
|
+
},
|
|
5148
|
+
{
|
|
5149
|
+
value: EventStatus.enum.ARCHIVED,
|
|
5150
|
+
label: {
|
|
5151
|
+
defaultMessage: "Archived",
|
|
5152
|
+
description: "Option for form field: status of record",
|
|
5153
|
+
id: "advancedSearch.form.recordStatusArchived"
|
|
5154
|
+
}
|
|
5155
|
+
}
|
|
5156
|
+
];
|
|
5157
|
+
var timePeriodOptions = [
|
|
5158
|
+
{
|
|
5159
|
+
label: {
|
|
5160
|
+
defaultMessage: "Last 7 days",
|
|
5161
|
+
description: "Label for option of time period select: last 7 days",
|
|
5162
|
+
id: "form.section.label.timePeriodLast7Days"
|
|
5163
|
+
},
|
|
5164
|
+
value: `${(0, import_date_fns3.format)((0, import_date_fns3.subDays)(/* @__PURE__ */ new Date(), 7), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
|
|
5165
|
+
/* @__PURE__ */ new Date(),
|
|
5166
|
+
"yyyy-MM-dd"
|
|
5167
|
+
)}`
|
|
5168
|
+
},
|
|
5169
|
+
{
|
|
5170
|
+
label: {
|
|
5171
|
+
defaultMessage: "Last 30 days",
|
|
5172
|
+
description: "Label for option of time period select: last 30 days",
|
|
5173
|
+
id: "form.section.label.timePeriodLast30Days"
|
|
5174
|
+
},
|
|
5175
|
+
value: `${(0, import_date_fns3.format)((0, import_date_fns3.subMonths)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
|
|
5176
|
+
/* @__PURE__ */ new Date(),
|
|
5177
|
+
"yyyy-MM-dd"
|
|
5178
|
+
)}`
|
|
5179
|
+
},
|
|
5180
|
+
{
|
|
5181
|
+
label: {
|
|
5182
|
+
defaultMessage: "Last 90 days",
|
|
5183
|
+
description: "Label for option of time period select: last 90 days",
|
|
5184
|
+
id: "form.section.label.timePeriodLast90Days"
|
|
5185
|
+
},
|
|
5186
|
+
value: `${(0, import_date_fns3.format)((0, import_date_fns3.subQuarters)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
|
|
5187
|
+
/* @__PURE__ */ new Date(),
|
|
5188
|
+
"yyyy-MM-dd"
|
|
5189
|
+
)}`
|
|
5190
|
+
},
|
|
5191
|
+
{
|
|
5192
|
+
label: {
|
|
5193
|
+
defaultMessage: "Last year",
|
|
5194
|
+
description: "Label for option of time period select: last year",
|
|
5195
|
+
id: "form.section.label.timePeriodLastYear"
|
|
5196
|
+
},
|
|
5197
|
+
value: `${(0, import_date_fns3.format)((0, import_date_fns3.subYears)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
|
|
5198
|
+
/* @__PURE__ */ new Date(),
|
|
5199
|
+
"yyyy-MM-dd"
|
|
5200
|
+
)}`
|
|
5201
|
+
}
|
|
5202
|
+
];
|
|
5233
5203
|
|
|
5234
5204
|
// ../commons/src/fixtures/tennis-club-membership-event.ts
|
|
5235
5205
|
var tennisClubMembershipEvent = defineConfig({
|
|
5236
5206
|
id: TENNIS_CLUB_MEMBERSHIP,
|
|
5237
|
-
declaration: TENNIS_CLUB_DECLARATION_FORM,
|
|
5238
5207
|
label: {
|
|
5239
5208
|
defaultMessage: "Tennis club membership application",
|
|
5240
5209
|
description: "This is what this event is referred as in the system",
|
|
@@ -5285,12 +5254,13 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5285
5254
|
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5286
5255
|
},
|
|
5287
5256
|
{
|
|
5288
|
-
type: ActionType.
|
|
5257
|
+
type: ActionType.VALIDATE,
|
|
5289
5258
|
label: {
|
|
5290
|
-
defaultMessage: "
|
|
5259
|
+
defaultMessage: "Validate",
|
|
5291
5260
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5292
|
-
id: "event.tennis-club-membership.action.
|
|
5293
|
-
}
|
|
5261
|
+
id: "event.tennis-club-membership.action.validate.label"
|
|
5262
|
+
},
|
|
5263
|
+
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5294
5264
|
},
|
|
5295
5265
|
{
|
|
5296
5266
|
type: ActionType.REGISTER,
|
|
@@ -5298,7 +5268,8 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5298
5268
|
defaultMessage: "Register",
|
|
5299
5269
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5300
5270
|
id: "event.tennis-club-membership.action.register.label"
|
|
5301
|
-
}
|
|
5271
|
+
},
|
|
5272
|
+
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5302
5273
|
},
|
|
5303
5274
|
{
|
|
5304
5275
|
type: ActionType.REQUEST_CORRECTION,
|
|
@@ -5501,6 +5472,14 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5501
5472
|
]
|
|
5502
5473
|
}
|
|
5503
5474
|
},
|
|
5475
|
+
{
|
|
5476
|
+
type: ActionType.APPROVE_CORRECTION,
|
|
5477
|
+
label: {
|
|
5478
|
+
defaultMessage: "Approve correction",
|
|
5479
|
+
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5480
|
+
id: "event.tennis-club-membership.action.correction.approve.label"
|
|
5481
|
+
}
|
|
5482
|
+
},
|
|
5504
5483
|
{
|
|
5505
5484
|
type: ActionType.PRINT_CERTIFICATE,
|
|
5506
5485
|
label: {
|
|
@@ -5509,6 +5488,22 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5509
5488
|
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5510
5489
|
},
|
|
5511
5490
|
printForm: PRINT_CERTIFICATE_FORM
|
|
5491
|
+
},
|
|
5492
|
+
{
|
|
5493
|
+
type: ActionType.ARCHIVE,
|
|
5494
|
+
label: {
|
|
5495
|
+
id: "event.tennis-club-membership.action.archive.label",
|
|
5496
|
+
defaultMessage: "Archive",
|
|
5497
|
+
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5498
|
+
}
|
|
5499
|
+
},
|
|
5500
|
+
{
|
|
5501
|
+
type: ActionType.REJECT,
|
|
5502
|
+
label: {
|
|
5503
|
+
id: "event.tennis-club-membership.action.reject.label",
|
|
5504
|
+
defaultMessage: "Reject",
|
|
5505
|
+
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5506
|
+
}
|
|
5512
5507
|
}
|
|
5513
5508
|
],
|
|
5514
5509
|
advancedSearch: [
|
|
@@ -5545,7 +5540,8 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5545
5540
|
},
|
|
5546
5541
|
fields: [field("recommender.name").fuzzy()]
|
|
5547
5542
|
}
|
|
5548
|
-
]
|
|
5543
|
+
],
|
|
5544
|
+
declaration: TENNIS_CLUB_DECLARATION_FORM
|
|
5549
5545
|
});
|
|
5550
5546
|
|
|
5551
5547
|
// ../commons/src/fixtures/football-club-membership-event.ts
|
|
@@ -5613,13 +5609,23 @@ var footballClubMembershipEvent = defineConfig({
|
|
|
5613
5609
|
},
|
|
5614
5610
|
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5615
5611
|
},
|
|
5612
|
+
{
|
|
5613
|
+
type: ActionType.VALIDATE,
|
|
5614
|
+
label: {
|
|
5615
|
+
defaultMessage: "Validate",
|
|
5616
|
+
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5617
|
+
id: "event.football-club-membership.action.validate.label"
|
|
5618
|
+
},
|
|
5619
|
+
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5620
|
+
},
|
|
5616
5621
|
{
|
|
5617
5622
|
type: ActionType.REGISTER,
|
|
5618
5623
|
label: {
|
|
5619
5624
|
defaultMessage: "Register",
|
|
5620
5625
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5621
5626
|
id: "event.football-club-membership.action.register.label"
|
|
5622
|
-
}
|
|
5627
|
+
},
|
|
5628
|
+
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5623
5629
|
},
|
|
5624
5630
|
{
|
|
5625
5631
|
type: ActionType.REQUEST_CORRECTION,
|
|
@@ -5825,6 +5831,14 @@ var footballClubMembershipEvent = defineConfig({
|
|
|
5825
5831
|
]
|
|
5826
5832
|
}
|
|
5827
5833
|
},
|
|
5834
|
+
{
|
|
5835
|
+
type: ActionType.APPROVE_CORRECTION,
|
|
5836
|
+
label: {
|
|
5837
|
+
defaultMessage: "Approve correction",
|
|
5838
|
+
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5839
|
+
id: "event.football-club-membership.action.correction.approve.label"
|
|
5840
|
+
}
|
|
5841
|
+
},
|
|
5828
5842
|
{
|
|
5829
5843
|
type: ActionType.PRINT_CERTIFICATE,
|
|
5830
5844
|
label: {
|
|
@@ -5833,6 +5847,22 @@ var footballClubMembershipEvent = defineConfig({
|
|
|
5833
5847
|
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5834
5848
|
},
|
|
5835
5849
|
printForm: PRINT_CERTIFICATE_FORM
|
|
5850
|
+
},
|
|
5851
|
+
{
|
|
5852
|
+
type: ActionType.ARCHIVE,
|
|
5853
|
+
label: {
|
|
5854
|
+
id: "event.football-club-membership.action.archive.label",
|
|
5855
|
+
defaultMessage: "Archive",
|
|
5856
|
+
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5857
|
+
}
|
|
5858
|
+
},
|
|
5859
|
+
{
|
|
5860
|
+
type: ActionType.REJECT,
|
|
5861
|
+
label: {
|
|
5862
|
+
id: "event.football-club-membership.action.reject.label",
|
|
5863
|
+
defaultMessage: "Reject",
|
|
5864
|
+
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5865
|
+
}
|
|
5836
5866
|
}
|
|
5837
5867
|
],
|
|
5838
5868
|
advancedSearch: [
|
|
@@ -5932,7 +5962,7 @@ var libraryMembershipEvent = defineConfig({
|
|
|
5932
5962
|
declaration: libraryMembershipForm
|
|
5933
5963
|
});
|
|
5934
5964
|
|
|
5935
|
-
// ../commons/src/fixtures/
|
|
5965
|
+
// ../commons/src/fixtures/v2-birth-event.ts
|
|
5936
5966
|
function generateTranslationConfig(message) {
|
|
5937
5967
|
return {
|
|
5938
5968
|
defaultMessage: message,
|
|
@@ -5961,61 +5991,6 @@ var child = defineFormPage({
|
|
|
5961
5991
|
secured: true,
|
|
5962
5992
|
validation: [],
|
|
5963
5993
|
label: generateTranslationConfig("Date of birth")
|
|
5964
|
-
},
|
|
5965
|
-
{
|
|
5966
|
-
id: "child.placeOfBirth",
|
|
5967
|
-
analytics: true,
|
|
5968
|
-
type: FieldType.SELECT,
|
|
5969
|
-
required: true,
|
|
5970
|
-
secured: true,
|
|
5971
|
-
label: {
|
|
5972
|
-
defaultMessage: "Place of delivery",
|
|
5973
|
-
description: "This is the label for the field",
|
|
5974
|
-
id: "event.birth.action.declare.form.section.child.field.placeOfBirth.label"
|
|
5975
|
-
},
|
|
5976
|
-
options: [
|
|
5977
|
-
{
|
|
5978
|
-
value: "child.placeOfBirth-SELECT-2",
|
|
5979
|
-
label: generateTranslationConfig("Health Institution")
|
|
5980
|
-
},
|
|
5981
|
-
{
|
|
5982
|
-
value: "PRIVATE_HOME",
|
|
5983
|
-
label: generateTranslationConfig("Residential address")
|
|
5984
|
-
}
|
|
5985
|
-
]
|
|
5986
|
-
},
|
|
5987
|
-
{
|
|
5988
|
-
id: "child.birthLocation",
|
|
5989
|
-
analytics: true,
|
|
5990
|
-
type: "FACILITY",
|
|
5991
|
-
required: true,
|
|
5992
|
-
secured: true,
|
|
5993
|
-
label: generateTranslationConfig("Health Institution"),
|
|
5994
|
-
conditionals: [
|
|
5995
|
-
{
|
|
5996
|
-
type: "SHOW",
|
|
5997
|
-
conditional: field("child.placeOfBirth").isEqualTo(
|
|
5998
|
-
"child.placeOfBirth-SELECT-2"
|
|
5999
|
-
)
|
|
6000
|
-
}
|
|
6001
|
-
]
|
|
6002
|
-
},
|
|
6003
|
-
{
|
|
6004
|
-
id: "child.birthLocation.privateHome",
|
|
6005
|
-
analytics: true,
|
|
6006
|
-
type: FieldType.ADDRESS,
|
|
6007
|
-
secured: true,
|
|
6008
|
-
hideLabel: true,
|
|
6009
|
-
label: generateTranslationConfig("Child's address"),
|
|
6010
|
-
conditionals: [
|
|
6011
|
-
{
|
|
6012
|
-
type: "SHOW",
|
|
6013
|
-
conditional: field("child.placeOfBirth").isEqualTo("PRIVATE_HOME")
|
|
6014
|
-
}
|
|
6015
|
-
],
|
|
6016
|
-
configuration: {
|
|
6017
|
-
streetAddressForm: []
|
|
6018
|
-
}
|
|
6019
5994
|
}
|
|
6020
5995
|
]
|
|
6021
5996
|
});
|
|
@@ -6092,7 +6067,7 @@ var mother = defineFormPage({
|
|
|
6092
6067
|
}
|
|
6093
6068
|
]
|
|
6094
6069
|
});
|
|
6095
|
-
var
|
|
6070
|
+
var BIRTH_DECLARATION_REVIEW = {
|
|
6096
6071
|
title: generateTranslationConfig(
|
|
6097
6072
|
"{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}}}}}"
|
|
6098
6073
|
),
|
|
@@ -6112,12 +6087,12 @@ var CHILD_ONBOARDING_DECLARATION_REVIEW = {
|
|
|
6112
6087
|
}
|
|
6113
6088
|
]
|
|
6114
6089
|
};
|
|
6115
|
-
var
|
|
6090
|
+
var BIRTH_DECLARATION_FORM = defineDeclarationForm({
|
|
6116
6091
|
label: generateTranslationConfig("Birth decalration form"),
|
|
6117
6092
|
pages: [child, mother]
|
|
6118
6093
|
});
|
|
6119
|
-
var
|
|
6120
|
-
id:
|
|
6094
|
+
var v2BirthEvent = defineConfig({
|
|
6095
|
+
id: BIRTH_EVENT,
|
|
6121
6096
|
title: generateTranslationConfig(
|
|
6122
6097
|
"{child.name.firstname} {child.name.surname}"
|
|
6123
6098
|
),
|
|
@@ -6125,21 +6100,27 @@ var ChildOnboardingEvent = defineConfig({
|
|
|
6125
6100
|
summary: {
|
|
6126
6101
|
fields: []
|
|
6127
6102
|
},
|
|
6128
|
-
declaration:
|
|
6103
|
+
declaration: BIRTH_DECLARATION_FORM,
|
|
6129
6104
|
actions: [
|
|
6130
6105
|
{
|
|
6131
6106
|
type: ActionType.READ,
|
|
6132
6107
|
label: generateTranslationConfig("Read"),
|
|
6133
|
-
review:
|
|
6108
|
+
review: BIRTH_DECLARATION_REVIEW
|
|
6134
6109
|
},
|
|
6135
6110
|
{
|
|
6136
6111
|
type: ActionType.DECLARE,
|
|
6137
6112
|
label: generateTranslationConfig("Declare"),
|
|
6138
|
-
review:
|
|
6113
|
+
review: BIRTH_DECLARATION_REVIEW
|
|
6114
|
+
},
|
|
6115
|
+
{
|
|
6116
|
+
type: ActionType.VALIDATE,
|
|
6117
|
+
label: generateTranslationConfig("Validate"),
|
|
6118
|
+
review: BIRTH_DECLARATION_REVIEW
|
|
6139
6119
|
},
|
|
6140
6120
|
{
|
|
6141
6121
|
type: ActionType.REGISTER,
|
|
6142
|
-
label: generateTranslationConfig("Register")
|
|
6122
|
+
label: generateTranslationConfig("Register"),
|
|
6123
|
+
review: BIRTH_DECLARATION_REVIEW
|
|
6143
6124
|
}
|
|
6144
6125
|
],
|
|
6145
6126
|
advancedSearch: []
|
|
@@ -6227,7 +6208,7 @@ var PRINT_DIGITAL_ID_CERTIFICATE_FORM = defineActionForm({
|
|
|
6227
6208
|
conditionals: [
|
|
6228
6209
|
{
|
|
6229
6210
|
type: ConditionalType.ENABLE,
|
|
6230
|
-
conditional:
|
|
6211
|
+
conditional: never()
|
|
6231
6212
|
},
|
|
6232
6213
|
{
|
|
6233
6214
|
type: ConditionalType.SHOW,
|
|
@@ -6254,7 +6235,7 @@ var PRINT_DIGITAL_ID_CERTIFICATE_FORM = defineActionForm({
|
|
|
6254
6235
|
conditionals: [
|
|
6255
6236
|
{
|
|
6256
6237
|
type: ConditionalType.ENABLE,
|
|
6257
|
-
conditional:
|
|
6238
|
+
conditional: never()
|
|
6258
6239
|
},
|
|
6259
6240
|
{
|
|
6260
6241
|
type: ConditionalType.SHOW,
|
|
@@ -6282,7 +6263,7 @@ var PRINT_DIGITAL_ID_CERTIFICATE_FORM = defineActionForm({
|
|
|
6282
6263
|
conditionals: [
|
|
6283
6264
|
{
|
|
6284
6265
|
type: ConditionalType.ENABLE,
|
|
6285
|
-
conditional:
|
|
6266
|
+
conditional: never()
|
|
6286
6267
|
}
|
|
6287
6268
|
],
|
|
6288
6269
|
value: field("identity.http-fetch").get("data.certificateId")
|
|
@@ -6360,8 +6341,8 @@ var digitalIdentityEvent = defineConfig({
|
|
|
6360
6341
|
});
|
|
6361
6342
|
|
|
6362
6343
|
// ../commons/src/events/test.utils.ts
|
|
6363
|
-
var
|
|
6364
|
-
var TestUserRole =
|
|
6344
|
+
var import_zod35 = require("zod");
|
|
6345
|
+
var TestUserRole = import_zod35.z.enum([
|
|
6365
6346
|
"FIELD_AGENT",
|
|
6366
6347
|
"LOCAL_REGISTRAR",
|
|
6367
6348
|
"LOCAL_SYSTEM_ADMIN",
|
|
@@ -6372,14 +6353,18 @@ var TestUserRole = z37.enum([
|
|
|
6372
6353
|
]);
|
|
6373
6354
|
|
|
6374
6355
|
// ../commons/src/events/scopes.ts
|
|
6375
|
-
var
|
|
6356
|
+
var import_lodash5 = require("lodash");
|
|
6376
6357
|
var ACTION_SCOPE_MAP = {
|
|
6377
6358
|
[ActionType.READ]: ["record.read"],
|
|
6378
6359
|
[ActionType.CREATE]: ["record.create"],
|
|
6379
6360
|
[ActionType.NOTIFY]: ["record.notify"],
|
|
6380
|
-
[ActionType.DECLARE]: [
|
|
6381
|
-
|
|
6361
|
+
[ActionType.DECLARE]: [
|
|
6362
|
+
"record.declare",
|
|
6363
|
+
"record.declared.validate",
|
|
6364
|
+
"record.register"
|
|
6365
|
+
],
|
|
6382
6366
|
[ActionType.DELETE]: ["record.declare"],
|
|
6367
|
+
[ActionType.VALIDATE]: ["record.declared.validate", "record.register"],
|
|
6383
6368
|
[ActionType.REGISTER]: ["record.register"],
|
|
6384
6369
|
[ActionType.PRINT_CERTIFICATE]: ["record.registered.print-certified-copies"],
|
|
6385
6370
|
[ActionType.REQUEST_CORRECTION]: [
|
|
@@ -6397,8 +6382,7 @@ var ACTION_SCOPE_MAP = {
|
|
|
6397
6382
|
[ActionType.REJECT]: ["record.declared.reject"],
|
|
6398
6383
|
[ActionType.ASSIGN]: null,
|
|
6399
6384
|
[ActionType.UNASSIGN]: null,
|
|
6400
|
-
[ActionType.DUPLICATE_DETECTED]: []
|
|
6401
|
-
[ActionType.CUSTOM]: []
|
|
6385
|
+
[ActionType.DUPLICATE_DETECTED]: []
|
|
6402
6386
|
};
|
|
6403
6387
|
|
|
6404
6388
|
// ../commons/src/events/state/availableActions.ts
|
|
@@ -6407,25 +6391,28 @@ var AVAILABLE_ACTIONS_BY_EVENT_STATUS = {
|
|
|
6407
6391
|
ActionType.READ,
|
|
6408
6392
|
ActionType.DECLARE,
|
|
6409
6393
|
ActionType.NOTIFY,
|
|
6410
|
-
ActionType.DELETE
|
|
6411
|
-
ActionType.CUSTOM
|
|
6394
|
+
ActionType.DELETE
|
|
6412
6395
|
],
|
|
6413
6396
|
[EventStatus.enum.NOTIFIED]: [
|
|
6414
6397
|
ActionType.READ,
|
|
6415
6398
|
ActionType.DECLARE,
|
|
6416
6399
|
ActionType.MARK_AS_DUPLICATE,
|
|
6417
6400
|
ActionType.ARCHIVE,
|
|
6418
|
-
ActionType.REJECT
|
|
6419
|
-
ActionType.CUSTOM
|
|
6401
|
+
ActionType.REJECT
|
|
6420
6402
|
],
|
|
6421
6403
|
[EventStatus.enum.DECLARED]: [
|
|
6404
|
+
ActionType.READ,
|
|
6405
|
+
ActionType.VALIDATE,
|
|
6406
|
+
ActionType.MARK_AS_DUPLICATE,
|
|
6407
|
+
ActionType.ARCHIVE,
|
|
6408
|
+
ActionType.REJECT
|
|
6409
|
+
],
|
|
6410
|
+
[EventStatus.enum.VALIDATED]: [
|
|
6422
6411
|
ActionType.READ,
|
|
6423
6412
|
ActionType.REGISTER,
|
|
6424
6413
|
ActionType.MARK_AS_DUPLICATE,
|
|
6425
6414
|
ActionType.ARCHIVE,
|
|
6426
|
-
ActionType.REJECT
|
|
6427
|
-
ActionType.CUSTOM,
|
|
6428
|
-
ActionType.EDIT
|
|
6415
|
+
ActionType.REJECT
|
|
6429
6416
|
],
|
|
6430
6417
|
[EventStatus.enum.REGISTERED]: [
|
|
6431
6418
|
ActionType.READ,
|
|
@@ -6433,14 +6420,12 @@ var AVAILABLE_ACTIONS_BY_EVENT_STATUS = {
|
|
|
6433
6420
|
ActionType.REQUEST_CORRECTION,
|
|
6434
6421
|
ActionType.APPROVE_CORRECTION,
|
|
6435
6422
|
ActionType.REJECT_CORRECTION,
|
|
6436
|
-
ActionType.CUSTOM,
|
|
6437
6423
|
ClientSpecificAction.REVIEW_CORRECTION_REQUEST
|
|
6438
6424
|
],
|
|
6439
6425
|
[EventStatus.enum.ARCHIVED]: [
|
|
6440
6426
|
ActionType.READ,
|
|
6441
6427
|
ActionType.ASSIGN,
|
|
6442
|
-
ActionType.UNASSIGN
|
|
6443
|
-
ActionType.CUSTOM
|
|
6428
|
+
ActionType.UNASSIGN
|
|
6444
6429
|
]
|
|
6445
6430
|
};
|
|
6446
6431
|
var ACTION_FILTERS = {
|
|
@@ -6450,32 +6435,32 @@ var ACTION_FILTERS = {
|
|
|
6450
6435
|
[ActionType.APPROVE_CORRECTION]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6451
6436
|
[ActionType.REJECT_CORRECTION]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6452
6437
|
[ActionType.MARK_AS_DUPLICATE]: (flags) => flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6453
|
-
[ActionType.
|
|
6438
|
+
[ActionType.VALIDATE]: (flags) => !flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6454
6439
|
[ActionType.REGISTER]: (flags) => !flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6455
6440
|
[ActionType.REJECT]: (flags) => !flags.includes(InherentFlags.REJECTED) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6456
6441
|
[ActionType.ARCHIVE]: (flags) => !flags.some((flag) => flag.endsWith(":requested"))
|
|
6457
6442
|
};
|
|
6458
6443
|
|
|
6459
6444
|
// ../commons/src/events/FileUtils.ts
|
|
6460
|
-
var
|
|
6445
|
+
var import_lodash6 = require("lodash");
|
|
6461
6446
|
|
|
6462
6447
|
// ../commons/src/events/locations.ts
|
|
6463
|
-
var
|
|
6464
|
-
var LocationType =
|
|
6448
|
+
var import_zod36 = require("zod");
|
|
6449
|
+
var LocationType = import_zod36.z.enum([
|
|
6465
6450
|
"ADMIN_STRUCTURE",
|
|
6466
6451
|
"CRVS_OFFICE",
|
|
6467
6452
|
"HEALTH_FACILITY"
|
|
6468
6453
|
]);
|
|
6469
|
-
var Location =
|
|
6454
|
+
var Location = import_zod36.z.object({
|
|
6470
6455
|
id: UUID,
|
|
6471
|
-
name:
|
|
6456
|
+
name: import_zod36.z.string(),
|
|
6472
6457
|
parentId: UUID.nullable(),
|
|
6473
|
-
validUntil:
|
|
6458
|
+
validUntil: import_zod36.z.string().datetime().nullable(),
|
|
6474
6459
|
locationType: LocationType.nullable()
|
|
6475
6460
|
});
|
|
6476
6461
|
|
|
6477
6462
|
// ../commons/src/notification/UserNotifications.ts
|
|
6478
|
-
var
|
|
6463
|
+
var import_zod37 = require("zod");
|
|
6479
6464
|
var TriggerEvent = {
|
|
6480
6465
|
USER_CREATED: "user-created",
|
|
6481
6466
|
USER_UPDATED: "user-updated",
|
|
@@ -6487,50 +6472,50 @@ var TriggerEvent = {
|
|
|
6487
6472
|
CHANGE_PHONE_NUMBER: "change-phone-number",
|
|
6488
6473
|
CHANGE_EMAIL_ADDRESS: "change-email-address"
|
|
6489
6474
|
};
|
|
6490
|
-
var Recipient =
|
|
6475
|
+
var Recipient = import_zod37.z.object({
|
|
6491
6476
|
name: NameFieldValue.optional(),
|
|
6492
|
-
mobile:
|
|
6493
|
-
email:
|
|
6494
|
-
bcc:
|
|
6477
|
+
mobile: import_zod37.z.string().optional(),
|
|
6478
|
+
email: import_zod37.z.string().optional(),
|
|
6479
|
+
bcc: import_zod37.z.array(import_zod37.z.string()).optional()
|
|
6495
6480
|
});
|
|
6496
|
-
var BasePayload =
|
|
6481
|
+
var BasePayload = import_zod37.z.object({
|
|
6497
6482
|
recipient: Recipient
|
|
6498
6483
|
});
|
|
6499
6484
|
var TriggerPayload = {
|
|
6500
6485
|
[TriggerEvent.USER_CREATED]: BasePayload.extend({
|
|
6501
|
-
username:
|
|
6502
|
-
temporaryPassword:
|
|
6486
|
+
username: import_zod37.z.string(),
|
|
6487
|
+
temporaryPassword: import_zod37.z.string()
|
|
6503
6488
|
}),
|
|
6504
6489
|
[TriggerEvent.USER_UPDATED]: BasePayload.extend({
|
|
6505
|
-
oldUsername:
|
|
6506
|
-
newUsername:
|
|
6490
|
+
oldUsername: import_zod37.z.string(),
|
|
6491
|
+
newUsername: import_zod37.z.string()
|
|
6507
6492
|
}),
|
|
6508
6493
|
[TriggerEvent.USERNAME_REMINDER]: BasePayload.extend({
|
|
6509
|
-
username:
|
|
6494
|
+
username: import_zod37.z.string()
|
|
6510
6495
|
}),
|
|
6511
6496
|
[TriggerEvent.RESET_PASSWORD]: BasePayload.extend({
|
|
6512
|
-
code:
|
|
6497
|
+
code: import_zod37.z.string()
|
|
6513
6498
|
}),
|
|
6514
6499
|
[TriggerEvent.RESET_PASSWORD_BY_ADMIN]: BasePayload.extend({
|
|
6515
|
-
temporaryPassword:
|
|
6516
|
-
admin:
|
|
6517
|
-
id:
|
|
6500
|
+
temporaryPassword: import_zod37.z.string(),
|
|
6501
|
+
admin: import_zod37.z.object({
|
|
6502
|
+
id: import_zod37.z.string(),
|
|
6518
6503
|
name: NameFieldValue,
|
|
6519
|
-
role:
|
|
6504
|
+
role: import_zod37.z.string()
|
|
6520
6505
|
})
|
|
6521
6506
|
}),
|
|
6522
6507
|
[TriggerEvent.TWO_FA]: BasePayload.extend({
|
|
6523
|
-
code:
|
|
6508
|
+
code: import_zod37.z.string()
|
|
6524
6509
|
}),
|
|
6525
6510
|
[TriggerEvent.ALL_USER_NOTIFICATION]: BasePayload.extend({
|
|
6526
|
-
subject:
|
|
6527
|
-
body:
|
|
6511
|
+
subject: import_zod37.z.string(),
|
|
6512
|
+
body: import_zod37.z.string()
|
|
6528
6513
|
}),
|
|
6529
6514
|
[TriggerEvent.CHANGE_PHONE_NUMBER]: BasePayload.extend({
|
|
6530
|
-
code:
|
|
6515
|
+
code: import_zod37.z.string()
|
|
6531
6516
|
}),
|
|
6532
6517
|
[TriggerEvent.CHANGE_EMAIL_ADDRESS]: BasePayload.extend({
|
|
6533
|
-
code:
|
|
6518
|
+
code: import_zod37.z.string()
|
|
6534
6519
|
})
|
|
6535
6520
|
};
|
|
6536
6521
|
async function triggerUserEventNotification({
|
|
@@ -6552,6 +6537,3 @@ function parseUserEventTrigger(event2, body) {
|
|
|
6552
6537
|
const schema = TriggerPayload[event2];
|
|
6553
6538
|
return schema.parse(body);
|
|
6554
6539
|
}
|
|
6555
|
-
|
|
6556
|
-
// src/notification/index.ts
|
|
6557
|
-
z40.globalRegistry.clear();
|