@opencrvs/toolkit 1.9.4-rc.c49b2d5 → 1.9.4-rc.d2521c7
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 +11879 -4260
- 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 +1547 -1805
- package/dist/notification/index.d.ts.map +1 -1
- package/dist/notification/index.js +1414 -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,32 @@ 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
|
-
|
|
1690
|
-
|
|
1613
|
+
maxImageSize: import_zod15.z.object({ width: import_zod15.z.number(), height: import_zod15.z.number() }).optional(),
|
|
1614
|
+
style: import_zod15.z.object({
|
|
1615
|
+
width: import_zod15.z.enum(["full", "auto"]).optional().describe(
|
|
1691
1616
|
"Whether the file upload button should take the full width of the container or not"
|
|
1692
1617
|
)
|
|
1693
1618
|
}).optional(),
|
|
@@ -1696,34 +1621,34 @@ var File = BaseField.extend({
|
|
|
1696
1621
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1697
1622
|
})
|
|
1698
1623
|
}).describe("File upload");
|
|
1699
|
-
var SelectOption =
|
|
1700
|
-
value:
|
|
1701
|
-
label:
|
|
1624
|
+
var SelectOption = import_zod15.z.object({
|
|
1625
|
+
value: import_zod15.z.string().describe("The value of the option"),
|
|
1626
|
+
label: import_zod15.z.union([import_zod15.z.string(), TranslationConfig]).describe("The label of the option")
|
|
1702
1627
|
});
|
|
1703
1628
|
var RadioGroup = BaseField.extend({
|
|
1704
|
-
type:
|
|
1629
|
+
type: import_zod15.z.literal(FieldType.RADIO_GROUP),
|
|
1705
1630
|
defaultValue: TextValue.optional(),
|
|
1706
|
-
options:
|
|
1707
|
-
configuration:
|
|
1708
|
-
styles:
|
|
1709
|
-
size:
|
|
1631
|
+
options: import_zod15.z.array(SelectOption).describe("A list of options"),
|
|
1632
|
+
configuration: import_zod15.z.object({
|
|
1633
|
+
styles: import_zod15.z.object({
|
|
1634
|
+
size: import_zod15.z.enum(["NORMAL", "LARGE"]).optional()
|
|
1710
1635
|
}).optional()
|
|
1711
1636
|
}).optional()
|
|
1712
1637
|
}).describe("Grouped radio options");
|
|
1713
1638
|
var BulletList = BaseField.extend({
|
|
1714
|
-
type:
|
|
1639
|
+
type: import_zod15.z.literal(FieldType.BULLET_LIST),
|
|
1715
1640
|
defaultValue: TextValue.optional(),
|
|
1716
|
-
items:
|
|
1717
|
-
configuration:
|
|
1718
|
-
styles:
|
|
1641
|
+
items: import_zod15.z.array(TranslationConfig).describe("A list of items"),
|
|
1642
|
+
configuration: import_zod15.z.object({
|
|
1643
|
+
styles: import_zod15.z.object({
|
|
1719
1644
|
fontVariant: HtmlFontVariant.optional()
|
|
1720
1645
|
}).optional()
|
|
1721
1646
|
}).default({})
|
|
1722
1647
|
}).describe("A list of bullet points");
|
|
1723
1648
|
var Select = BaseField.extend({
|
|
1724
|
-
type:
|
|
1649
|
+
type: import_zod15.z.literal(FieldType.SELECT),
|
|
1725
1650
|
defaultValue: TextValue.optional(),
|
|
1726
|
-
options:
|
|
1651
|
+
options: import_zod15.z.array(SelectOption).describe("A list of options"),
|
|
1727
1652
|
noOptionsMessage: TranslationConfig.optional().describe(
|
|
1728
1653
|
`
|
|
1729
1654
|
A translation configuration object used to display a message when no options are available.
|
|
@@ -1735,34 +1660,34 @@ var Select = BaseField.extend({
|
|
|
1735
1660
|
`
|
|
1736
1661
|
)
|
|
1737
1662
|
}).describe("Select input");
|
|
1738
|
-
var SelectDateRangeOption =
|
|
1663
|
+
var SelectDateRangeOption = import_zod15.z.object({
|
|
1739
1664
|
value: SelectDateRangeValue.describe("The value of the option"),
|
|
1740
1665
|
label: TranslationConfig.describe("The label of the option")
|
|
1741
1666
|
});
|
|
1742
1667
|
var SelectDateRangeField = BaseField.extend({
|
|
1743
|
-
type:
|
|
1668
|
+
type: import_zod15.z.literal(FieldType.SELECT_DATE_RANGE),
|
|
1744
1669
|
defaultValue: SelectDateRangeValue.optional(),
|
|
1745
|
-
options:
|
|
1670
|
+
options: import_zod15.z.array(SelectDateRangeOption).describe("A list of options")
|
|
1746
1671
|
}).describe("Select input with date range options");
|
|
1747
|
-
var NameConfig =
|
|
1748
|
-
firstname:
|
|
1749
|
-
middlename:
|
|
1750
|
-
surname:
|
|
1672
|
+
var NameConfig = import_zod15.z.object({
|
|
1673
|
+
firstname: import_zod15.z.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
1674
|
+
middlename: import_zod15.z.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
1675
|
+
surname: import_zod15.z.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional()
|
|
1751
1676
|
});
|
|
1752
1677
|
var NameField = BaseField.extend({
|
|
1753
|
-
type:
|
|
1754
|
-
defaultValue:
|
|
1678
|
+
type: import_zod15.z.literal(FieldType.NAME),
|
|
1679
|
+
defaultValue: import_zod15.z.object({
|
|
1755
1680
|
firstname: NonEmptyTextValue.optional(),
|
|
1756
1681
|
middlename: NonEmptyTextValue.optional(),
|
|
1757
1682
|
surname: NonEmptyTextValue.optional()
|
|
1758
1683
|
}).optional(),
|
|
1759
|
-
configuration:
|
|
1684
|
+
configuration: import_zod15.z.object({
|
|
1760
1685
|
name: NameConfig.default({
|
|
1761
1686
|
firstname: { required: true },
|
|
1762
1687
|
surname: { required: true }
|
|
1763
1688
|
}).optional(),
|
|
1764
|
-
order:
|
|
1765
|
-
maxLength:
|
|
1689
|
+
order: import_zod15.z.array(import_zod15.z.enum(["firstname", "middlename", "surname"])).optional(),
|
|
1690
|
+
maxLength: import_zod15.z.number().optional().describe("Maximum length of the text"),
|
|
1766
1691
|
prefix: TranslationConfig.optional(),
|
|
1767
1692
|
postfix: TranslationConfig.optional()
|
|
1768
1693
|
}).default({
|
|
@@ -1774,142 +1699,143 @@ var NameField = BaseField.extend({
|
|
|
1774
1699
|
}).describe("Name input field");
|
|
1775
1700
|
var PhoneField = BaseField.extend({
|
|
1776
1701
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1777
|
-
type:
|
|
1702
|
+
type: import_zod15.z.literal(FieldType.PHONE)
|
|
1778
1703
|
}).describe("Phone input field");
|
|
1779
1704
|
var IdField = BaseField.extend({
|
|
1780
1705
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1781
|
-
type:
|
|
1706
|
+
type: import_zod15.z.literal(FieldType.ID)
|
|
1782
1707
|
}).describe("ID input field");
|
|
1783
1708
|
var Checkbox = BaseField.extend({
|
|
1784
|
-
type:
|
|
1709
|
+
type: import_zod15.z.literal(FieldType.CHECKBOX),
|
|
1785
1710
|
defaultValue: CheckboxFieldValue.default(false)
|
|
1786
1711
|
}).describe("Boolean checkbox field");
|
|
1787
1712
|
var Country = BaseField.extend({
|
|
1788
|
-
type:
|
|
1713
|
+
type: import_zod15.z.literal(FieldType.COUNTRY),
|
|
1789
1714
|
defaultValue: NonEmptyTextValue.optional()
|
|
1790
1715
|
}).describe("Country select field");
|
|
1791
|
-
var AdministrativeAreas =
|
|
1716
|
+
var AdministrativeAreas = import_zod15.z.enum([
|
|
1792
1717
|
"ADMIN_STRUCTURE",
|
|
1793
1718
|
"HEALTH_FACILITY",
|
|
1794
1719
|
"CRVS_OFFICE"
|
|
1795
1720
|
]);
|
|
1796
|
-
var AdministrativeAreaConfiguration =
|
|
1797
|
-
partOf:
|
|
1798
|
-
$declaration:
|
|
1721
|
+
var AdministrativeAreaConfiguration = import_zod15.z.object({
|
|
1722
|
+
partOf: import_zod15.z.object({
|
|
1723
|
+
$declaration: import_zod15.z.string()
|
|
1799
1724
|
}).optional().describe("Parent location"),
|
|
1800
1725
|
type: AdministrativeAreas
|
|
1801
1726
|
}).describe("Administrative area options");
|
|
1802
1727
|
var AdministrativeArea = BaseField.extend({
|
|
1803
|
-
type:
|
|
1728
|
+
type: import_zod15.z.literal(FieldType.ADMINISTRATIVE_AREA),
|
|
1804
1729
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1805
1730
|
configuration: AdministrativeAreaConfiguration
|
|
1806
1731
|
}).describe("Administrative area input field e.g. facility, office");
|
|
1807
1732
|
var LocationInput = BaseField.extend({
|
|
1808
|
-
type:
|
|
1733
|
+
type: import_zod15.z.literal(FieldType.LOCATION),
|
|
1809
1734
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1810
|
-
configuration:
|
|
1811
|
-
searchableResource:
|
|
1735
|
+
configuration: import_zod15.z.object({
|
|
1736
|
+
searchableResource: import_zod15.z.array(import_zod15.z.enum(["locations", "facilities", "offices"]))
|
|
1812
1737
|
})
|
|
1813
1738
|
}).describe("Input field for a location");
|
|
1814
1739
|
var FileUploadWithOptions = BaseField.extend({
|
|
1815
|
-
type:
|
|
1816
|
-
options:
|
|
1740
|
+
type: import_zod15.z.literal(FieldType.FILE_WITH_OPTIONS),
|
|
1741
|
+
options: import_zod15.z.array(SelectOption).describe("A list of options"),
|
|
1817
1742
|
defaultValue: FileFieldWithOptionValue.optional(),
|
|
1818
|
-
configuration:
|
|
1819
|
-
maxFileSize:
|
|
1743
|
+
configuration: import_zod15.z.object({
|
|
1744
|
+
maxFileSize: import_zod15.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1745
|
+
maxImageSize: import_zod15.z.object({ width: import_zod15.z.number(), height: import_zod15.z.number() }).optional(),
|
|
1820
1746
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
|
1821
1747
|
}).default({
|
|
1822
1748
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1823
1749
|
})
|
|
1824
1750
|
});
|
|
1825
1751
|
var Facility = BaseField.extend({
|
|
1826
|
-
type:
|
|
1752
|
+
type: import_zod15.z.literal(FieldType.FACILITY),
|
|
1827
1753
|
defaultValue: NonEmptyTextValue.optional()
|
|
1828
1754
|
}).describe("Input field for a facility");
|
|
1829
1755
|
var Office = BaseField.extend({
|
|
1830
|
-
type:
|
|
1756
|
+
type: import_zod15.z.literal(FieldType.OFFICE),
|
|
1831
1757
|
defaultValue: NonEmptyTextValue.optional()
|
|
1832
1758
|
}).describe("Input field for an office");
|
|
1833
1759
|
var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
|
|
1834
|
-
administrativeArea:
|
|
1760
|
+
administrativeArea: import_zod15.z.union([UUID, SerializedUserField]).optional()
|
|
1835
1761
|
});
|
|
1836
1762
|
var Address = BaseField.extend({
|
|
1837
|
-
type:
|
|
1838
|
-
configuration:
|
|
1839
|
-
lineSeparator:
|
|
1840
|
-
fields:
|
|
1841
|
-
administrativeLevels:
|
|
1842
|
-
streetAddressForm:
|
|
1843
|
-
|
|
1844
|
-
id:
|
|
1763
|
+
type: import_zod15.z.literal(FieldType.ADDRESS),
|
|
1764
|
+
configuration: import_zod15.z.object({
|
|
1765
|
+
lineSeparator: import_zod15.z.string().optional(),
|
|
1766
|
+
fields: import_zod15.z.array(import_zod15.z.enum(["country", "administrativeArea"])).optional(),
|
|
1767
|
+
administrativeLevels: import_zod15.z.array(import_zod15.z.string()).optional(),
|
|
1768
|
+
streetAddressForm: import_zod15.z.array(
|
|
1769
|
+
import_zod15.z.object({
|
|
1770
|
+
id: import_zod15.z.string(),
|
|
1845
1771
|
required: requiredSchema,
|
|
1846
1772
|
label: TranslationConfig,
|
|
1847
|
-
type:
|
|
1848
|
-
conditionals:
|
|
1773
|
+
type: import_zod15.z.literal(FieldType.TEXT),
|
|
1774
|
+
conditionals: import_zod15.z.array(FieldConditional).default([]).optional(),
|
|
1849
1775
|
parent: FieldReference.optional()
|
|
1850
1776
|
})
|
|
1851
1777
|
).optional()
|
|
1852
1778
|
}).optional(),
|
|
1853
1779
|
defaultValue: DefaultAddressFieldValue.optional()
|
|
1854
1780
|
}).describe("Address input field \u2013 a combination of location and text fields");
|
|
1855
|
-
var StaticDataEntry =
|
|
1856
|
-
id:
|
|
1781
|
+
var StaticDataEntry = import_zod15.z.object({
|
|
1782
|
+
id: import_zod15.z.string().describe("ID for the data entry."),
|
|
1857
1783
|
label: TranslationConfig,
|
|
1858
|
-
value: TranslationConfig.or(
|
|
1784
|
+
value: TranslationConfig.or(import_zod15.z.string()).or(FieldReference)
|
|
1859
1785
|
}).describe("Static data entry");
|
|
1860
|
-
var DataEntry =
|
|
1786
|
+
var DataEntry = import_zod15.z.union([StaticDataEntry, import_zod15.z.object({ fieldId: import_zod15.z.string() })]).describe(
|
|
1861
1787
|
"Data entry can be either a static data entry, or a reference to another field in the current form or the declaration."
|
|
1862
1788
|
);
|
|
1863
1789
|
var DataField = BaseField.extend({
|
|
1864
|
-
type:
|
|
1865
|
-
configuration:
|
|
1790
|
+
type: import_zod15.z.literal(FieldType.DATA),
|
|
1791
|
+
configuration: import_zod15.z.object({
|
|
1866
1792
|
subtitle: TranslationConfig.optional(),
|
|
1867
|
-
data:
|
|
1793
|
+
data: import_zod15.z.array(DataEntry)
|
|
1868
1794
|
})
|
|
1869
1795
|
}).describe("Data field for displaying read-only data");
|
|
1870
1796
|
var ButtonField = BaseField.extend({
|
|
1871
|
-
type:
|
|
1797
|
+
type: import_zod15.z.literal(FieldType.BUTTON),
|
|
1872
1798
|
defaultValue: ButtonFieldValue.optional(),
|
|
1873
|
-
configuration:
|
|
1874
|
-
icon:
|
|
1799
|
+
configuration: import_zod15.z.object({
|
|
1800
|
+
icon: import_zod15.z.string().optional().describe(
|
|
1875
1801
|
"Icon for the button. You can find icons from OpenCRVS UI-Kit."
|
|
1876
1802
|
),
|
|
1877
|
-
loading:
|
|
1803
|
+
loading: import_zod15.z.boolean().optional().describe("Whether the button is in a loading state and shows a spinner"),
|
|
1878
1804
|
text: TranslationConfig.describe("Text to display on the button")
|
|
1879
1805
|
})
|
|
1880
1806
|
}).describe("Generic button without any built-in functionality");
|
|
1881
1807
|
var AlphaPrintButton = BaseField.extend({
|
|
1882
|
-
type:
|
|
1883
|
-
configuration:
|
|
1884
|
-
template:
|
|
1808
|
+
type: import_zod15.z.literal(FieldType.ALPHA_PRINT_BUTTON),
|
|
1809
|
+
configuration: import_zod15.z.object({
|
|
1810
|
+
template: import_zod15.z.string().describe("Template ID from countryconfig templates to use for printing"),
|
|
1885
1811
|
buttonLabel: TranslationConfig.optional().describe(
|
|
1886
1812
|
"Label for the print button"
|
|
1887
1813
|
)
|
|
1888
1814
|
})
|
|
1889
1815
|
}).describe("Print button field for printing certificates");
|
|
1890
1816
|
var HttpField = BaseField.extend({
|
|
1891
|
-
type:
|
|
1817
|
+
type: import_zod15.z.literal(FieldType.HTTP),
|
|
1892
1818
|
defaultValue: HttpFieldValue.optional(),
|
|
1893
|
-
configuration:
|
|
1819
|
+
configuration: import_zod15.z.object({
|
|
1894
1820
|
trigger: FieldReference,
|
|
1895
|
-
url:
|
|
1896
|
-
method:
|
|
1897
|
-
headers:
|
|
1898
|
-
body:
|
|
1899
|
-
errorValue:
|
|
1900
|
-
params:
|
|
1901
|
-
timeout:
|
|
1821
|
+
url: import_zod15.z.string().describe("URL to send the HTTP request to"),
|
|
1822
|
+
method: import_zod15.z.enum(["GET", "POST", "PUT", "DELETE"]),
|
|
1823
|
+
headers: import_zod15.z.record(import_zod15.z.string()).optional(),
|
|
1824
|
+
body: import_zod15.z.record(import_zod15.z.any()).optional(),
|
|
1825
|
+
errorValue: import_zod15.z.any().optional().describe("Value to set if the request fails"),
|
|
1826
|
+
params: import_zod15.z.record(import_zod15.z.string(), import_zod15.z.union([import_zod15.z.string(), FieldReference])).optional(),
|
|
1827
|
+
timeout: import_zod15.z.number().default(15e3).describe("Request timeout in milliseconds")
|
|
1902
1828
|
})
|
|
1903
1829
|
}).describe("HTTP request function triggered by a button click or other event");
|
|
1904
1830
|
var SearchField = HttpField.extend({
|
|
1905
|
-
type:
|
|
1831
|
+
type: import_zod15.z.literal(FieldType.SEARCH),
|
|
1906
1832
|
configuration: SearchQuery.pick({
|
|
1907
1833
|
query: true,
|
|
1908
1834
|
limit: true,
|
|
1909
1835
|
offset: true
|
|
1910
1836
|
}).extend({
|
|
1911
1837
|
validation: ValidationConfig,
|
|
1912
|
-
indicators:
|
|
1838
|
+
indicators: import_zod15.z.object({
|
|
1913
1839
|
loading: TranslationConfig.optional().describe(
|
|
1914
1840
|
"Text to display while the search is in progress"
|
|
1915
1841
|
),
|
|
@@ -1924,7 +1850,7 @@ var SearchField = HttpField.extend({
|
|
|
1924
1850
|
),
|
|
1925
1851
|
confirmButton: TranslationConfig.optional(),
|
|
1926
1852
|
clearButton: TranslationConfig.optional(),
|
|
1927
|
-
clearModal:
|
|
1853
|
+
clearModal: import_zod15.z.object({
|
|
1928
1854
|
title: TranslationConfig.optional(),
|
|
1929
1855
|
description: TranslationConfig.optional(),
|
|
1930
1856
|
cancel: TranslationConfig.optional(),
|
|
@@ -1935,17 +1861,17 @@ var SearchField = HttpField.extend({
|
|
|
1935
1861
|
})
|
|
1936
1862
|
});
|
|
1937
1863
|
var LinkButtonField = BaseField.extend({
|
|
1938
|
-
type:
|
|
1939
|
-
configuration:
|
|
1940
|
-
url:
|
|
1864
|
+
type: import_zod15.z.literal(FieldType.LINK_BUTTON),
|
|
1865
|
+
configuration: import_zod15.z.object({
|
|
1866
|
+
url: import_zod15.z.string().describe("URL to open"),
|
|
1941
1867
|
text: TranslationConfig.describe("Text to display on the button"),
|
|
1942
|
-
icon:
|
|
1868
|
+
icon: import_zod15.z.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit.")
|
|
1943
1869
|
})
|
|
1944
1870
|
}).describe("Button that opens a link");
|
|
1945
1871
|
var VerificationStatus = BaseField.extend({
|
|
1946
|
-
type:
|
|
1872
|
+
type: import_zod15.z.literal(FieldType.VERIFICATION_STATUS),
|
|
1947
1873
|
defaultValue: VerificationStatusValue.optional(),
|
|
1948
|
-
configuration:
|
|
1874
|
+
configuration: import_zod15.z.object({
|
|
1949
1875
|
status: TranslationConfig.describe("Text to display on the status pill."),
|
|
1950
1876
|
description: TranslationConfig.describe(
|
|
1951
1877
|
"Explaining text on the banner in form."
|
|
@@ -1953,55 +1879,38 @@ var VerificationStatus = BaseField.extend({
|
|
|
1953
1879
|
})
|
|
1954
1880
|
});
|
|
1955
1881
|
var QueryParamReaderField = BaseField.extend({
|
|
1956
|
-
type:
|
|
1957
|
-
configuration:
|
|
1958
|
-
pickParams:
|
|
1882
|
+
type: import_zod15.z.literal(FieldType.QUERY_PARAM_READER),
|
|
1883
|
+
configuration: import_zod15.z.object({
|
|
1884
|
+
pickParams: import_zod15.z.array(import_zod15.z.string()).describe("List of query parameters to read from the URL")
|
|
1959
1885
|
})
|
|
1960
1886
|
}).describe(
|
|
1961
1887
|
"A field that maps URL query params into form values and clears them afterward"
|
|
1962
1888
|
);
|
|
1963
1889
|
var QrReaderField = BaseField.extend({
|
|
1964
|
-
type:
|
|
1890
|
+
type: import_zod15.z.literal(FieldType.QR_READER),
|
|
1965
1891
|
defaultValue: QrReaderFieldValue.optional(),
|
|
1966
|
-
configuration:
|
|
1967
|
-
validator:
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
})
|
|
1892
|
+
configuration: import_zod15.z.object({
|
|
1893
|
+
validator: import_zod15.z.custom(
|
|
1894
|
+
(val) => typeof val === "object" && val !== null
|
|
1895
|
+
)
|
|
1971
1896
|
}).optional()
|
|
1972
|
-
}).meta({
|
|
1973
|
-
description: "Configuration for QR code reader field, including optional JSON Schema validator.",
|
|
1974
|
-
id: "QrReaderField"
|
|
1975
1897
|
});
|
|
1976
1898
|
var IdReaderField = BaseField.extend({
|
|
1977
|
-
type:
|
|
1899
|
+
type: import_zod15.z.literal(FieldType.ID_READER),
|
|
1978
1900
|
defaultValue: IdReaderFieldValue.optional(),
|
|
1979
|
-
methods:
|
|
1980
|
-
|
|
1901
|
+
methods: import_zod15.z.array(
|
|
1902
|
+
import_zod15.z.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
|
|
1981
1903
|
)
|
|
1982
1904
|
});
|
|
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
1905
|
var LoaderField = BaseField.extend({
|
|
1990
|
-
type:
|
|
1991
|
-
configuration:
|
|
1906
|
+
type: import_zod15.z.literal(FieldType.LOADER),
|
|
1907
|
+
configuration: import_zod15.z.object({
|
|
1992
1908
|
text: TranslationConfig.describe("Display text above the loading spinner")
|
|
1993
1909
|
})
|
|
1994
1910
|
}).describe(
|
|
1995
1911
|
"A non-interactive field that indicates an in progress operation in form"
|
|
1996
1912
|
);
|
|
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", [
|
|
1913
|
+
var FieldConfig = import_zod15.z.discriminatedUnion("type", [
|
|
2005
1914
|
Address,
|
|
2006
1915
|
TextField,
|
|
2007
1916
|
NumberField,
|
|
@@ -2040,81 +1949,83 @@ var FieldConfig = z16.discriminatedUnion("type", [
|
|
|
2040
1949
|
IdReaderField,
|
|
2041
1950
|
QueryParamReaderField,
|
|
2042
1951
|
LoaderField,
|
|
2043
|
-
SearchField
|
|
2044
|
-
|
|
2045
|
-
HiddenField
|
|
2046
|
-
]).meta({
|
|
1952
|
+
SearchField
|
|
1953
|
+
]).openapi({
|
|
2047
1954
|
description: "Form field configuration",
|
|
2048
|
-
|
|
1955
|
+
ref: "FieldConfig"
|
|
2049
1956
|
});
|
|
2050
|
-
var AnyFileField =
|
|
1957
|
+
var AnyFileField = import_zod15.z.discriminatedUnion("type", [
|
|
2051
1958
|
SignatureField,
|
|
2052
1959
|
File,
|
|
2053
1960
|
FileUploadWithOptions
|
|
2054
1961
|
]);
|
|
2055
1962
|
|
|
2056
1963
|
// ../commons/src/events/FormConfig.ts
|
|
2057
|
-
var
|
|
1964
|
+
var import_zod17 = require("zod");
|
|
2058
1965
|
|
|
2059
1966
|
// ../commons/src/events/PageConfig.ts
|
|
2060
|
-
var
|
|
2061
|
-
var
|
|
2062
|
-
|
|
2063
|
-
|
|
1967
|
+
var import_zod16 = require("zod");
|
|
1968
|
+
var import_zod_openapi7 = require("zod-openapi");
|
|
1969
|
+
(0, import_zod_openapi7.extendZodWithOpenApi)(import_zod16.z);
|
|
1970
|
+
var PageTypes = import_zod16.z.enum(["FORM", "VERIFICATION"]);
|
|
1971
|
+
var PageConfigBase = import_zod16.z.object({
|
|
1972
|
+
id: import_zod16.z.string().describe("Unique identifier for the page"),
|
|
2064
1973
|
title: TranslationConfig.describe("Header title of the page"),
|
|
2065
|
-
requireCompletionToContinue:
|
|
1974
|
+
requireCompletionToContinue: import_zod16.z.boolean().default(false).describe(
|
|
2066
1975
|
"If true, all required fields must be filled before continuing to the next page"
|
|
2067
1976
|
),
|
|
2068
|
-
fields:
|
|
1977
|
+
fields: import_zod16.z.array(FieldConfig).describe("Fields to be rendered on the page"),
|
|
2069
1978
|
conditional: Conditional.optional().describe(
|
|
2070
1979
|
"Page will be shown if condition is met. If conditional is not defined, the page will be always shown."
|
|
2071
1980
|
)
|
|
2072
|
-
}).
|
|
1981
|
+
}).openapi({
|
|
2073
1982
|
description: "Form page configuration",
|
|
2074
|
-
|
|
1983
|
+
ref: "FormPageConfig"
|
|
2075
1984
|
});
|
|
2076
1985
|
var FormPageConfig = PageConfigBase.extend({
|
|
2077
|
-
type:
|
|
1986
|
+
type: import_zod16.z.literal(PageTypes.enum.FORM).default(PageTypes.enum.FORM)
|
|
2078
1987
|
});
|
|
2079
|
-
var VerificationActionConfig =
|
|
2080
|
-
verify:
|
|
2081
|
-
cancel:
|
|
1988
|
+
var VerificationActionConfig = import_zod16.z.object({
|
|
1989
|
+
verify: import_zod16.z.object({ label: TranslationConfig }),
|
|
1990
|
+
cancel: import_zod16.z.object({
|
|
2082
1991
|
label: TranslationConfig,
|
|
2083
|
-
confirmation:
|
|
1992
|
+
confirmation: import_zod16.z.object({
|
|
2084
1993
|
title: TranslationConfig,
|
|
2085
1994
|
body: TranslationConfig
|
|
2086
1995
|
})
|
|
2087
1996
|
})
|
|
2088
|
-
}).describe("Actions available on the verification page").
|
|
1997
|
+
}).describe("Actions available on the verification page").openapi({
|
|
2089
1998
|
description: "Verification action configuration",
|
|
2090
|
-
|
|
1999
|
+
ref: "VerificationActionConfig"
|
|
2091
2000
|
});
|
|
2092
2001
|
var VerificationPageConfig = FormPageConfig.extend({
|
|
2093
|
-
type:
|
|
2002
|
+
type: import_zod16.z.literal(PageTypes.enum.VERIFICATION),
|
|
2094
2003
|
actions: VerificationActionConfig
|
|
2095
2004
|
});
|
|
2096
|
-
var PageConfig =
|
|
2005
|
+
var PageConfig = import_zod16.z.discriminatedUnion("type", [
|
|
2097
2006
|
FormPageConfig,
|
|
2098
2007
|
VerificationPageConfig
|
|
2099
2008
|
]);
|
|
2100
2009
|
|
|
2101
2010
|
// ../commons/src/events/FormConfig.ts
|
|
2102
|
-
var DeclarationFormConfig =
|
|
2011
|
+
var DeclarationFormConfig = import_zod17.z.object({
|
|
2103
2012
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2104
|
-
pages:
|
|
2013
|
+
pages: import_zod17.z.array(FormPageConfig)
|
|
2105
2014
|
}).describe("Configuration of the declaration form.");
|
|
2106
|
-
var ActionFormConfig =
|
|
2015
|
+
var ActionFormConfig = import_zod17.z.object({
|
|
2107
2016
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2108
|
-
pages:
|
|
2017
|
+
pages: import_zod17.z.array(PageConfig)
|
|
2109
2018
|
}).describe(
|
|
2110
2019
|
"Configuration of the form used for system actions beyond declaration, supporting a wider range of page types."
|
|
2111
2020
|
);
|
|
2112
|
-
var FormConfig =
|
|
2021
|
+
var FormConfig = import_zod17.z.union([DeclarationFormConfig, ActionFormConfig]);
|
|
2113
2022
|
|
|
2114
2023
|
// ../commons/src/events/DeduplicationConfig.ts
|
|
2115
|
-
var
|
|
2116
|
-
var
|
|
2117
|
-
|
|
2024
|
+
var import_zod18 = require("zod");
|
|
2025
|
+
var import_zod_openapi8 = require("zod-openapi");
|
|
2026
|
+
(0, import_zod_openapi8.extendZodWithOpenApi)(import_zod18.z);
|
|
2027
|
+
var FieldReference2 = import_zod18.z.string();
|
|
2028
|
+
var Matcher = import_zod18.z.object({
|
|
2118
2029
|
/**
|
|
2119
2030
|
* Reference to the field used in matching.
|
|
2120
2031
|
*
|
|
@@ -2122,68 +2033,68 @@ var Matcher = z19.object({
|
|
|
2122
2033
|
* be used as the origin date to calculate the distance from.
|
|
2123
2034
|
*/
|
|
2124
2035
|
fieldId: FieldReference2,
|
|
2125
|
-
options:
|
|
2126
|
-
boost:
|
|
2036
|
+
options: import_zod18.z.object({
|
|
2037
|
+
boost: import_zod18.z.number().optional()
|
|
2127
2038
|
}).optional().default({
|
|
2128
2039
|
boost: 1
|
|
2129
2040
|
})
|
|
2130
2041
|
});
|
|
2131
2042
|
var FuzzyMatcher = Matcher.extend({
|
|
2132
|
-
type:
|
|
2133
|
-
options:
|
|
2043
|
+
type: import_zod18.z.literal("fuzzy"),
|
|
2044
|
+
options: import_zod18.z.object({
|
|
2134
2045
|
/**
|
|
2135
2046
|
* Names of length 3 or less characters = 0 edits allowed
|
|
2136
2047
|
* Names of length 4 - 6 characters = 1 edit allowed
|
|
2137
2048
|
* Names of length >7 characters = 2 edits allowed
|
|
2138
2049
|
*/
|
|
2139
|
-
fuzziness:
|
|
2140
|
-
boost:
|
|
2050
|
+
fuzziness: import_zod18.z.union([import_zod18.z.string(), import_zod18.z.number()]).optional().default("AUTO:4,7"),
|
|
2051
|
+
boost: import_zod18.z.number().optional().default(1)
|
|
2141
2052
|
}).optional().default({
|
|
2142
2053
|
fuzziness: "AUTO:4,7",
|
|
2143
2054
|
boost: 1
|
|
2144
2055
|
})
|
|
2145
2056
|
});
|
|
2146
2057
|
var StrictMatcher = Matcher.extend({
|
|
2147
|
-
type:
|
|
2148
|
-
options:
|
|
2149
|
-
boost:
|
|
2058
|
+
type: import_zod18.z.literal("strict"),
|
|
2059
|
+
options: import_zod18.z.object({
|
|
2060
|
+
boost: import_zod18.z.number().optional().default(1),
|
|
2150
2061
|
/**
|
|
2151
2062
|
* The constant value to be present in the field for both records
|
|
2152
2063
|
*/
|
|
2153
|
-
value:
|
|
2064
|
+
value: import_zod18.z.string().optional()
|
|
2154
2065
|
}).optional().default({
|
|
2155
2066
|
boost: 1
|
|
2156
2067
|
})
|
|
2157
2068
|
});
|
|
2158
2069
|
var DateRangeMatcher = Matcher.extend({
|
|
2159
|
-
type:
|
|
2160
|
-
options:
|
|
2070
|
+
type: import_zod18.z.literal("dateRange"),
|
|
2071
|
+
options: import_zod18.z.object({
|
|
2161
2072
|
/**
|
|
2162
2073
|
* The distance pivot in days. Distance from the origin (the value of
|
|
2163
2074
|
* fieldId) at which relevance scores receive half of the boost value
|
|
2164
2075
|
*/
|
|
2165
|
-
pivot:
|
|
2166
|
-
days:
|
|
2167
|
-
boost:
|
|
2076
|
+
pivot: import_zod18.z.number().optional(),
|
|
2077
|
+
days: import_zod18.z.number(),
|
|
2078
|
+
boost: import_zod18.z.number().optional().default(1)
|
|
2168
2079
|
})
|
|
2169
2080
|
});
|
|
2170
|
-
var Not =
|
|
2171
|
-
type:
|
|
2081
|
+
var Not = import_zod18.z.object({
|
|
2082
|
+
type: import_zod18.z.literal("not"),
|
|
2172
2083
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2173
|
-
clause:
|
|
2084
|
+
clause: import_zod18.z.lazy(() => Clause)
|
|
2174
2085
|
});
|
|
2175
|
-
var And =
|
|
2176
|
-
type:
|
|
2086
|
+
var And = import_zod18.z.object({
|
|
2087
|
+
type: import_zod18.z.literal("and"),
|
|
2177
2088
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2178
|
-
clauses:
|
|
2089
|
+
clauses: import_zod18.z.lazy(() => Clause.array())
|
|
2179
2090
|
});
|
|
2180
|
-
var Or =
|
|
2181
|
-
type:
|
|
2091
|
+
var Or = import_zod18.z.object({
|
|
2092
|
+
type: import_zod18.z.literal("or"),
|
|
2182
2093
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2183
|
-
clauses:
|
|
2094
|
+
clauses: import_zod18.z.lazy(() => Clause.array())
|
|
2184
2095
|
});
|
|
2185
|
-
var Clause =
|
|
2186
|
-
() =>
|
|
2096
|
+
var Clause = import_zod18.z.lazy(
|
|
2097
|
+
() => import_zod18.z.discriminatedUnion("type", [
|
|
2187
2098
|
Not,
|
|
2188
2099
|
And,
|
|
2189
2100
|
Or,
|
|
@@ -2191,298 +2102,193 @@ var Clause = z19.lazy(
|
|
|
2191
2102
|
StrictMatcher,
|
|
2192
2103
|
DateRangeMatcher
|
|
2193
2104
|
])
|
|
2194
|
-
).
|
|
2195
|
-
|
|
2105
|
+
).openapi({
|
|
2106
|
+
ref: "Clause"
|
|
2196
2107
|
});
|
|
2197
|
-
var DeduplicationConfig =
|
|
2198
|
-
id:
|
|
2108
|
+
var DeduplicationConfig = import_zod18.z.object({
|
|
2109
|
+
id: import_zod18.z.string(),
|
|
2199
2110
|
label: TranslationConfig,
|
|
2200
2111
|
query: Clause
|
|
2201
2112
|
});
|
|
2202
2113
|
|
|
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
2114
|
// ../commons/src/events/ActionConfig.ts
|
|
2310
|
-
var
|
|
2115
|
+
var import_zod_openapi9 = require("zod-openapi");
|
|
2116
|
+
(0, import_zod_openapi9.extendZodWithOpenApi)(import_zod19.z);
|
|
2117
|
+
var DeclarationReviewConfig = import_zod19.z.object({
|
|
2311
2118
|
title: TranslationConfig.describe("Title of the review page"),
|
|
2312
|
-
fields:
|
|
2119
|
+
fields: import_zod19.z.array(FieldConfig).describe("Fields displayed on the review page for annotations.")
|
|
2313
2120
|
}).describe(
|
|
2314
2121
|
"Configuration of the declaration review page for collecting event-related metadata."
|
|
2315
2122
|
);
|
|
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.")
|
|
2123
|
+
var ActionConfigBase = import_zod19.z.object({
|
|
2124
|
+
label: TranslationConfig.describe("Human readable description of the action")
|
|
2324
2125
|
});
|
|
2325
2126
|
var DeclarationActionBase = ActionConfigBase.extend({
|
|
2127
|
+
review: DeclarationReviewConfig,
|
|
2326
2128
|
deduplication: DeduplicationConfig.optional()
|
|
2327
2129
|
});
|
|
2328
|
-
var ReadActionConfig = ActionConfigBase.
|
|
2329
|
-
|
|
2330
|
-
type:
|
|
2130
|
+
var ReadActionConfig = ActionConfigBase.merge(
|
|
2131
|
+
import_zod19.z.object({
|
|
2132
|
+
type: import_zod19.z.literal(ActionType.READ),
|
|
2331
2133
|
review: DeclarationReviewConfig.describe(
|
|
2332
2134
|
"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
2135
|
)
|
|
2343
|
-
})
|
|
2136
|
+
})
|
|
2344
2137
|
);
|
|
2345
|
-
var
|
|
2346
|
-
|
|
2347
|
-
type:
|
|
2348
|
-
})
|
|
2138
|
+
var DeclareConfig = DeclarationActionBase.merge(
|
|
2139
|
+
import_zod19.z.object({
|
|
2140
|
+
type: import_zod19.z.literal(ActionType.DECLARE)
|
|
2141
|
+
})
|
|
2349
2142
|
);
|
|
2350
|
-
var
|
|
2351
|
-
|
|
2352
|
-
type:
|
|
2353
|
-
})
|
|
2143
|
+
var ValidateConfig = DeclarationActionBase.merge(
|
|
2144
|
+
import_zod19.z.object({
|
|
2145
|
+
type: import_zod19.z.literal(ActionType.VALIDATE)
|
|
2146
|
+
})
|
|
2147
|
+
);
|
|
2148
|
+
var RegisterConfig = DeclarationActionBase.merge(
|
|
2149
|
+
import_zod19.z.object({
|
|
2150
|
+
type: import_zod19.z.literal(ActionType.REGISTER)
|
|
2151
|
+
})
|
|
2152
|
+
);
|
|
2153
|
+
var RejectDeclarationConfig = ActionConfigBase.merge(
|
|
2154
|
+
import_zod19.z.object({
|
|
2155
|
+
type: import_zod19.z.literal(ActionType.REJECT)
|
|
2156
|
+
})
|
|
2157
|
+
);
|
|
2158
|
+
var ArchiveConfig = ActionConfigBase.merge(
|
|
2159
|
+
import_zod19.z.object({
|
|
2160
|
+
type: import_zod19.z.literal(ActionType.ARCHIVE)
|
|
2161
|
+
})
|
|
2354
2162
|
);
|
|
2355
|
-
var
|
|
2356
|
-
|
|
2357
|
-
type:
|
|
2358
|
-
})
|
|
2163
|
+
var DeleteConfig = ActionConfigBase.merge(
|
|
2164
|
+
import_zod19.z.object({
|
|
2165
|
+
type: import_zod19.z.literal(ActionType.DELETE)
|
|
2166
|
+
})
|
|
2359
2167
|
);
|
|
2360
|
-
var PrintCertificateActionConfig = ActionConfigBase.
|
|
2361
|
-
|
|
2362
|
-
type:
|
|
2168
|
+
var PrintCertificateActionConfig = ActionConfigBase.merge(
|
|
2169
|
+
import_zod19.z.object({
|
|
2170
|
+
type: import_zod19.z.literal(ActionType.PRINT_CERTIFICATE),
|
|
2363
2171
|
printForm: ActionFormConfig
|
|
2364
|
-
})
|
|
2172
|
+
})
|
|
2365
2173
|
);
|
|
2366
|
-
var RequestCorrectionConfig = ActionConfigBase.
|
|
2367
|
-
|
|
2368
|
-
type:
|
|
2174
|
+
var RequestCorrectionConfig = ActionConfigBase.merge(
|
|
2175
|
+
import_zod19.z.object({
|
|
2176
|
+
type: import_zod19.z.literal(ActionType.REQUEST_CORRECTION),
|
|
2369
2177
|
correctionForm: ActionFormConfig
|
|
2370
|
-
})
|
|
2178
|
+
})
|
|
2371
2179
|
);
|
|
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
|
-
)
|
|
2180
|
+
var RejectCorrectionConfig = ActionConfigBase.merge(
|
|
2181
|
+
import_zod19.z.object({
|
|
2182
|
+
type: import_zod19.z.literal(ActionType.REJECT_CORRECTION)
|
|
2383
2183
|
})
|
|
2384
2184
|
);
|
|
2385
|
-
var
|
|
2185
|
+
var ApproveCorrectionConfig = ActionConfigBase.merge(
|
|
2186
|
+
import_zod19.z.object({
|
|
2187
|
+
type: import_zod19.z.literal(ActionType.APPROVE_CORRECTION)
|
|
2188
|
+
})
|
|
2189
|
+
);
|
|
2190
|
+
var ActionConfig = import_zod19.z.discriminatedUnion("type", [
|
|
2386
2191
|
/*
|
|
2387
2192
|
* OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
|
|
2388
2193
|
* and treat them as "models" instead of duplicating the data structure in each endpoint.
|
|
2389
2194
|
*/
|
|
2390
|
-
ReadActionConfig.
|
|
2391
|
-
DeclareConfig.
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2195
|
+
ReadActionConfig.openapi({ ref: "ReadActionConfig" }),
|
|
2196
|
+
DeclareConfig.openapi({ ref: "DeclareActionConfig" }),
|
|
2197
|
+
ValidateConfig.openapi({ ref: "ValidateActionConfig" }),
|
|
2198
|
+
RejectDeclarationConfig.openapi({ ref: "RejectDeclarationActionConfig" }),
|
|
2199
|
+
ArchiveConfig.openapi({ ref: "ArchiveActionConfig" }),
|
|
2200
|
+
RegisterConfig.openapi({ ref: "RegisterActionConfig" }),
|
|
2201
|
+
DeleteConfig.openapi({ ref: "DeleteActionConfig" }),
|
|
2202
|
+
PrintCertificateActionConfig.openapi({
|
|
2203
|
+
ref: "PrintCertificateActionConfig"
|
|
2396
2204
|
}),
|
|
2397
|
-
RequestCorrectionConfig.
|
|
2398
|
-
|
|
2399
|
-
|
|
2205
|
+
RequestCorrectionConfig.openapi({ ref: "RequestCorrectionActionConfig" }),
|
|
2206
|
+
RejectCorrectionConfig.openapi({ ref: "RejectCorrectionActionConfig" }),
|
|
2207
|
+
ApproveCorrectionConfig.openapi({ ref: "ApproveCorrectionActionConfig" })
|
|
2400
2208
|
]).describe(
|
|
2401
2209
|
"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", [
|
|
2210
|
+
).openapi({ ref: "ActionConfig" });
|
|
2211
|
+
var DeclarationActionConfig = import_zod19.z.discriminatedUnion("type", [
|
|
2407
2212
|
DeclareConfig,
|
|
2213
|
+
ValidateConfig,
|
|
2408
2214
|
RegisterConfig
|
|
2409
2215
|
]);
|
|
2410
2216
|
|
|
2411
2217
|
// ../commons/src/events/offline/CertificateConfig.ts
|
|
2412
|
-
var
|
|
2413
|
-
var FontFamily =
|
|
2414
|
-
normal:
|
|
2415
|
-
bold:
|
|
2416
|
-
italics:
|
|
2417
|
-
bolditalics:
|
|
2218
|
+
var import_zod20 = require("zod");
|
|
2219
|
+
var FontFamily = import_zod20.z.object({
|
|
2220
|
+
normal: import_zod20.z.string(),
|
|
2221
|
+
bold: import_zod20.z.string(),
|
|
2222
|
+
italics: import_zod20.z.string(),
|
|
2223
|
+
bolditalics: import_zod20.z.string()
|
|
2418
2224
|
});
|
|
2419
|
-
var CertificateConfig =
|
|
2420
|
-
id:
|
|
2421
|
-
event:
|
|
2422
|
-
isV2Template:
|
|
2225
|
+
var CertificateConfig = import_zod20.z.object({
|
|
2226
|
+
id: import_zod20.z.string(),
|
|
2227
|
+
event: import_zod20.z.string(),
|
|
2228
|
+
isV2Template: import_zod20.z.boolean().optional(),
|
|
2423
2229
|
label: TranslationConfig,
|
|
2424
|
-
isDefault:
|
|
2425
|
-
fee:
|
|
2426
|
-
onTime:
|
|
2427
|
-
late:
|
|
2428
|
-
delayed:
|
|
2230
|
+
isDefault: import_zod20.z.boolean(),
|
|
2231
|
+
fee: import_zod20.z.object({
|
|
2232
|
+
onTime: import_zod20.z.number(),
|
|
2233
|
+
late: import_zod20.z.number(),
|
|
2234
|
+
delayed: import_zod20.z.number()
|
|
2429
2235
|
}),
|
|
2430
|
-
svgUrl:
|
|
2431
|
-
fonts:
|
|
2432
|
-
conditionals:
|
|
2236
|
+
svgUrl: import_zod20.z.string(),
|
|
2237
|
+
fonts: import_zod20.z.record(FontFamily).optional(),
|
|
2238
|
+
conditionals: import_zod20.z.array(ShowConditional).optional()
|
|
2433
2239
|
});
|
|
2434
2240
|
var CertificateTemplateConfig = CertificateConfig.extend({
|
|
2435
|
-
hash:
|
|
2436
|
-
svg:
|
|
2241
|
+
hash: import_zod20.z.string().optional(),
|
|
2242
|
+
svg: import_zod20.z.string()
|
|
2437
2243
|
});
|
|
2438
2244
|
|
|
2439
2245
|
// ../commons/src/events/offline/LanguageConfig.ts
|
|
2440
|
-
var
|
|
2441
|
-
var LanguageConfig =
|
|
2442
|
-
lang:
|
|
2246
|
+
var import_zod21 = require("zod");
|
|
2247
|
+
var LanguageConfig = import_zod21.z.object({
|
|
2248
|
+
lang: import_zod21.z.string(),
|
|
2443
2249
|
/**
|
|
2444
2250
|
* client.csv contents
|
|
2445
2251
|
*/
|
|
2446
|
-
messages:
|
|
2252
|
+
messages: import_zod21.z.record(import_zod21.z.string())
|
|
2447
2253
|
});
|
|
2448
2254
|
|
|
2449
2255
|
// ../commons/src/events/EventConfig.ts
|
|
2450
|
-
var
|
|
2256
|
+
var import_zod26 = require("zod");
|
|
2451
2257
|
|
|
2452
2258
|
// ../commons/src/events/SummaryConfig.ts
|
|
2453
|
-
var
|
|
2454
|
-
var BaseField2 =
|
|
2259
|
+
var import_zod22 = require("zod");
|
|
2260
|
+
var BaseField2 = import_zod22.z.object({
|
|
2455
2261
|
emptyValueMessage: TranslationConfig.optional().describe(
|
|
2456
2262
|
"Default message displayed when the field value is empty."
|
|
2457
2263
|
),
|
|
2458
|
-
conditionals:
|
|
2264
|
+
conditionals: import_zod22.z.array(ShowConditional).default([]).optional()
|
|
2459
2265
|
});
|
|
2460
2266
|
var ReferenceField = BaseField2.extend({
|
|
2461
|
-
fieldId:
|
|
2267
|
+
fieldId: import_zod22.z.string(),
|
|
2462
2268
|
label: TranslationConfig.optional().describe(
|
|
2463
2269
|
"Overrides the default label from the referenced field when provided."
|
|
2464
2270
|
)
|
|
2465
2271
|
}).describe("Field referencing existing event data by field ID.");
|
|
2466
2272
|
var Field = BaseField2.extend({
|
|
2467
|
-
id:
|
|
2273
|
+
id: import_zod22.z.string().describe("Identifier of the summary field."),
|
|
2468
2274
|
value: TranslationConfig.describe(
|
|
2469
2275
|
'Field value template supporting variables from configuration and EventMetadata (e.g. "{informant.phoneNo} {informant.email}").'
|
|
2470
2276
|
),
|
|
2471
2277
|
label: TranslationConfig
|
|
2472
2278
|
}).describe("Custom field defined for the summary view.");
|
|
2473
|
-
var SummaryConfig =
|
|
2474
|
-
fields:
|
|
2279
|
+
var SummaryConfig = import_zod22.z.object({
|
|
2280
|
+
fields: import_zod22.z.array(import_zod22.z.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
|
|
2475
2281
|
}).describe("Configuration of the event summary section.");
|
|
2476
2282
|
|
|
2477
2283
|
// ../commons/src/events/AdvancedSearchConfig.ts
|
|
2478
|
-
var
|
|
2479
|
-
var MatchType =
|
|
2480
|
-
var BaseField3 =
|
|
2481
|
-
config:
|
|
2284
|
+
var import_zod23 = require("zod");
|
|
2285
|
+
var MatchType = import_zod23.z.enum(["fuzzy", "exact", "range", "within"]);
|
|
2286
|
+
var BaseField3 = import_zod23.z.object({
|
|
2287
|
+
config: import_zod23.z.object({
|
|
2482
2288
|
type: MatchType.describe(
|
|
2483
2289
|
"Determines the search type of field. How to match value."
|
|
2484
2290
|
),
|
|
2485
|
-
searchFields:
|
|
2291
|
+
searchFields: import_zod23.z.array(import_zod23.z.string()).optional().describe(
|
|
2486
2292
|
`
|
|
2487
2293
|
Defines multiple form fields that should be searched when this field has a value.
|
|
2488
2294
|
All specified fields will be combined using OR logic.
|
|
@@ -2492,7 +2298,7 @@ var BaseField3 = z25.object({
|
|
|
2492
2298
|
`
|
|
2493
2299
|
)
|
|
2494
2300
|
}),
|
|
2495
|
-
type:
|
|
2301
|
+
type: import_zod23.z.nativeEnum(FieldType).optional().describe(
|
|
2496
2302
|
`
|
|
2497
2303
|
Explicitly specify the field type for searchFields.
|
|
2498
2304
|
This is required when searchFields is defined, to show the correct control in the UI.
|
|
@@ -2506,7 +2312,7 @@ var BaseField3 = z25.object({
|
|
|
2506
2312
|
This is required when searchFields is defined.
|
|
2507
2313
|
`
|
|
2508
2314
|
),
|
|
2509
|
-
options:
|
|
2315
|
+
options: import_zod23.z.array(SelectOption).optional(),
|
|
2510
2316
|
searchCriteriaLabelPrefix: TranslationConfig.optional().describe(
|
|
2511
2317
|
`
|
|
2512
2318
|
This property determines whether to add a prefix (such as "Child" or "Applicant") before the field label
|
|
@@ -2527,7 +2333,7 @@ var BaseField3 = z25.object({
|
|
|
2527
2333
|
in the country-config > event.advancedSearch configuration. For example: field("child.dob", { searchCriteriaLabelPrefix: TranslationConfig }).
|
|
2528
2334
|
`
|
|
2529
2335
|
),
|
|
2530
|
-
conditionals:
|
|
2336
|
+
conditionals: import_zod23.z.array(FieldConditional).default([]).optional().describe(
|
|
2531
2337
|
`
|
|
2532
2338
|
In advanced search, we sometimes need to override the default field visibility conditionals.
|
|
2533
2339
|
|
|
@@ -2541,61 +2347,59 @@ var BaseField3 = z25.object({
|
|
|
2541
2347
|
are always rendered in the advanced search form.
|
|
2542
2348
|
`
|
|
2543
2349
|
),
|
|
2544
|
-
validations:
|
|
2350
|
+
validations: import_zod23.z.array(ValidationConfig).default([]).optional().describe(
|
|
2545
2351
|
`Option for overriding the field validations specifically for advanced search form.`
|
|
2546
2352
|
)
|
|
2547
2353
|
});
|
|
2548
|
-
var SearchQueryParams =
|
|
2549
|
-
eventType:
|
|
2354
|
+
var SearchQueryParams = import_zod23.z.object({
|
|
2355
|
+
eventType: import_zod23.z.string().optional().describe(
|
|
2550
2356
|
"Defines type of event so that when redirecting to Advanced Search page, appropriate tab can be selected"
|
|
2551
2357
|
)
|
|
2552
2358
|
}).catchall(FieldValue);
|
|
2553
2359
|
var FieldConfigSchema = BaseField3.extend({
|
|
2554
|
-
fieldId:
|
|
2555
|
-
fieldType:
|
|
2360
|
+
fieldId: import_zod23.z.string(),
|
|
2361
|
+
fieldType: import_zod23.z.literal("field")
|
|
2556
2362
|
});
|
|
2557
|
-
var EventFieldIdInput =
|
|
2363
|
+
var EventFieldIdInput = import_zod23.z.enum([
|
|
2558
2364
|
"trackingId",
|
|
2559
2365
|
"status",
|
|
2560
2366
|
"legalStatuses.REGISTERED.acceptedAt",
|
|
2561
2367
|
"legalStatuses.REGISTERED.createdAtLocation",
|
|
2562
|
-
"legalStatuses.REGISTERED.registrationNumber",
|
|
2563
2368
|
"updatedAt"
|
|
2564
2369
|
]);
|
|
2565
2370
|
var METADATA_FIELD_PREFIX = "event.";
|
|
2566
|
-
var EventFieldId =
|
|
2371
|
+
var EventFieldId = import_zod23.z.enum([
|
|
2567
2372
|
`${METADATA_FIELD_PREFIX}trackingId`,
|
|
2568
2373
|
`${METADATA_FIELD_PREFIX}status`,
|
|
2569
2374
|
`${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.acceptedAt`,
|
|
2570
2375
|
`${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.createdAtLocation`,
|
|
2571
|
-
`${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.registrationNumber`,
|
|
2572
2376
|
`${METADATA_FIELD_PREFIX}updatedAt`
|
|
2573
2377
|
]);
|
|
2574
2378
|
var EventFieldConfigSchema = BaseField3.extend({
|
|
2575
2379
|
fieldId: EventFieldId,
|
|
2576
|
-
fieldType:
|
|
2380
|
+
fieldType: import_zod23.z.literal("event")
|
|
2577
2381
|
});
|
|
2578
|
-
var AdvancedSearchField =
|
|
2382
|
+
var AdvancedSearchField = import_zod23.z.discriminatedUnion("fieldType", [FieldConfigSchema, EventFieldConfigSchema]).superRefine((data, ctx) => {
|
|
2579
2383
|
if (data.config.searchFields && data.config.searchFields.length > 0) {
|
|
2580
2384
|
if (!data.label) {
|
|
2581
2385
|
ctx.addIssue({
|
|
2582
|
-
code:
|
|
2386
|
+
code: import_zod23.z.ZodIssueCode.custom,
|
|
2583
2387
|
message: "label is required when config.searchFields is defined.",
|
|
2584
2388
|
path: ["label"]
|
|
2585
2389
|
});
|
|
2586
2390
|
}
|
|
2587
2391
|
if (!data.type) {
|
|
2588
2392
|
ctx.addIssue({
|
|
2589
|
-
code:
|
|
2393
|
+
code: import_zod23.z.ZodIssueCode.custom,
|
|
2590
2394
|
message: "type is required when config.searchFields is defined.",
|
|
2591
2395
|
path: ["type"]
|
|
2592
2396
|
});
|
|
2593
2397
|
}
|
|
2594
2398
|
}
|
|
2595
2399
|
});
|
|
2596
|
-
var AdvancedSearchConfig =
|
|
2400
|
+
var AdvancedSearchConfig = import_zod23.z.object({
|
|
2597
2401
|
title: TranslationConfig.describe("Advanced search tab title"),
|
|
2598
|
-
fields:
|
|
2402
|
+
fields: import_zod23.z.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
|
|
2599
2403
|
});
|
|
2600
2404
|
|
|
2601
2405
|
// ../commons/src/events/utils.ts
|
|
@@ -2604,11 +2408,11 @@ var import_lodash = require("lodash");
|
|
|
2604
2408
|
// ../commons/src/conditionals/validate.ts
|
|
2605
2409
|
var import__ = __toESM(require("ajv/dist/2019"));
|
|
2606
2410
|
var import_ajv_formats = __toESM(require("ajv-formats"));
|
|
2607
|
-
var
|
|
2411
|
+
var import_zod25 = require("zod");
|
|
2608
2412
|
var import_date_fns = require("date-fns");
|
|
2609
2413
|
|
|
2610
2414
|
// ../commons/src/events/DynamicFieldValue.ts
|
|
2611
|
-
var
|
|
2415
|
+
var import_zod24 = require("zod");
|
|
2612
2416
|
|
|
2613
2417
|
// ../commons/src/conditionals/validate.ts
|
|
2614
2418
|
var ajv = new import__.default({
|
|
@@ -2617,9 +2421,9 @@ var ajv = new import__.default({
|
|
|
2617
2421
|
strict: false
|
|
2618
2422
|
// Allow minContains and other newer features
|
|
2619
2423
|
});
|
|
2620
|
-
var DataContext =
|
|
2621
|
-
rootData:
|
|
2622
|
-
$leafAdminStructureLocationIds:
|
|
2424
|
+
var DataContext = import_zod25.z.object({
|
|
2425
|
+
rootData: import_zod25.z.object({
|
|
2426
|
+
$leafAdminStructureLocationIds: import_zod25.z.array(import_zod25.z.object({ id: UUID }))
|
|
2623
2427
|
})
|
|
2624
2428
|
});
|
|
2625
2429
|
function resolveDataPath(rootData, dataPath, instancePath) {
|
|
@@ -2696,12 +2500,12 @@ ajv.addKeyword({
|
|
|
2696
2500
|
});
|
|
2697
2501
|
|
|
2698
2502
|
// ../commons/src/utils.ts
|
|
2699
|
-
var
|
|
2700
|
-
var FullNameV1 =
|
|
2701
|
-
|
|
2702
|
-
use:
|
|
2703
|
-
family:
|
|
2704
|
-
given:
|
|
2503
|
+
var z26 = __toESM(require("zod"));
|
|
2504
|
+
var FullNameV1 = z26.array(
|
|
2505
|
+
z26.object({
|
|
2506
|
+
use: z26.string(),
|
|
2507
|
+
family: z26.string(),
|
|
2508
|
+
given: z26.array(z26.string())
|
|
2705
2509
|
})
|
|
2706
2510
|
);
|
|
2707
2511
|
function omitKeyDeep(obj, keyToRemove) {
|
|
@@ -2722,6 +2526,9 @@ function omitKeyDeep(obj, keyToRemove) {
|
|
|
2722
2526
|
|
|
2723
2527
|
// ../commons/src/events/utils.ts
|
|
2724
2528
|
var import_date_fns2 = require("date-fns");
|
|
2529
|
+
function isDeclarationActionConfig(action) {
|
|
2530
|
+
return DeclarationActions.safeParse(action.type).success;
|
|
2531
|
+
}
|
|
2725
2532
|
function getDeclarationFields(configuration) {
|
|
2726
2533
|
return configuration.declaration.pages.flatMap(({ fields }) => fields);
|
|
2727
2534
|
}
|
|
@@ -2732,7 +2539,7 @@ var getActionAnnotationFields = (actionConfig) => {
|
|
|
2732
2539
|
if (actionConfig.type === ActionType.PRINT_CERTIFICATE) {
|
|
2733
2540
|
return actionConfig.printForm.pages.flatMap(({ fields }) => fields);
|
|
2734
2541
|
}
|
|
2735
|
-
if (
|
|
2542
|
+
if (isDeclarationActionConfig(actionConfig)) {
|
|
2736
2543
|
return actionConfig.review.fields;
|
|
2737
2544
|
}
|
|
2738
2545
|
return [];
|
|
@@ -2753,16 +2560,15 @@ var EXCLUDED_ACTIONS = [
|
|
|
2753
2560
|
];
|
|
2754
2561
|
|
|
2755
2562
|
// ../commons/src/events/EventConfig.ts
|
|
2756
|
-
var
|
|
2757
|
-
|
|
2563
|
+
var import_zod_openapi10 = require("zod-openapi");
|
|
2564
|
+
(0, import_zod_openapi10.extendZodWithOpenApi)(import_zod26.z);
|
|
2565
|
+
var EventConfig = import_zod26.z.object({
|
|
2566
|
+
id: import_zod26.z.string().describe(
|
|
2758
2567
|
'Machine-readable identifier of the event (e.g. "birth", "death").'
|
|
2759
2568
|
),
|
|
2760
2569
|
dateOfEvent: FieldReference.optional().describe(
|
|
2761
2570
|
"Reference to the field capturing the date of the event (e.g. date of birth). Defaults to the event creation date if unspecified."
|
|
2762
2571
|
),
|
|
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
2572
|
title: TranslationConfig.describe(
|
|
2767
2573
|
'Title template for the singular event, supporting variables (e.g. "{applicant.name.firstname} {applicant.name.surname}").'
|
|
2768
2574
|
),
|
|
@@ -2775,17 +2581,14 @@ var EventConfig = z29.object({
|
|
|
2775
2581
|
label: TranslationConfig.describe(
|
|
2776
2582
|
"Human-readable label for the event type."
|
|
2777
2583
|
),
|
|
2778
|
-
actions:
|
|
2584
|
+
actions: import_zod26.z.array(ActionConfig).describe(
|
|
2779
2585
|
"Configuration of system-defined actions associated with the event."
|
|
2780
2586
|
),
|
|
2781
2587
|
declaration: DeclarationFormConfig.describe(
|
|
2782
2588
|
"Configuration of the form used to gather event data."
|
|
2783
2589
|
),
|
|
2784
|
-
advancedSearch:
|
|
2590
|
+
advancedSearch: import_zod26.z.array(AdvancedSearchConfig).optional().default([]).describe(
|
|
2785
2591
|
"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
2592
|
)
|
|
2790
2593
|
}).superRefine((event2, ctx) => {
|
|
2791
2594
|
const allFields = findAllFields(event2);
|
|
@@ -2837,37 +2640,8 @@ var EventConfig = z29.object({
|
|
|
2837
2640
|
});
|
|
2838
2641
|
}
|
|
2839
2642
|
}
|
|
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"
|
|
2643
|
+
}).openapi({
|
|
2644
|
+
ref: "EventConfig"
|
|
2871
2645
|
}).describe("Configuration defining an event type.");
|
|
2872
2646
|
|
|
2873
2647
|
// ../commons/src/events/EventConfigInput.ts
|
|
@@ -2876,7 +2650,7 @@ var defineActionForm = (actionForm) => ActionFormConfig.parse(actionForm);
|
|
|
2876
2650
|
var defineFormPage = (formPage) => FormPageConfig.parse(formPage);
|
|
2877
2651
|
|
|
2878
2652
|
// ../commons/src/events/WorkqueueConfig.ts
|
|
2879
|
-
var
|
|
2653
|
+
var import_zod30 = require("zod");
|
|
2880
2654
|
|
|
2881
2655
|
// ../commons/src/conditionals/conditionals.ts
|
|
2882
2656
|
var objectHash = __toESM(require("object-hash"));
|
|
@@ -2914,7 +2688,7 @@ function not(condition) {
|
|
|
2914
2688
|
required: []
|
|
2915
2689
|
});
|
|
2916
2690
|
}
|
|
2917
|
-
function
|
|
2691
|
+
function never() {
|
|
2918
2692
|
return not(alwaysTrue());
|
|
2919
2693
|
}
|
|
2920
2694
|
function jsonFieldPath(field3) {
|
|
@@ -3623,17 +3397,17 @@ var event = Object.assign(eventFn, {
|
|
|
3623
3397
|
});
|
|
3624
3398
|
|
|
3625
3399
|
// ../commons/src/events/WorkqueueColumnConfig.ts
|
|
3626
|
-
var
|
|
3400
|
+
var import_zod27 = require("zod");
|
|
3627
3401
|
var WorkqueueColumnKeysArray = [
|
|
3628
3402
|
...EventMetadataKeysArray,
|
|
3629
3403
|
"title",
|
|
3630
3404
|
"outbox"
|
|
3631
3405
|
];
|
|
3632
|
-
var WorkqueueColumnKeys =
|
|
3633
|
-
var WorkqueueColumnValue =
|
|
3406
|
+
var WorkqueueColumnKeys = import_zod27.z.enum(WorkqueueColumnKeysArray);
|
|
3407
|
+
var WorkqueueColumnValue = import_zod27.z.object({
|
|
3634
3408
|
$event: WorkqueueColumnKeys
|
|
3635
3409
|
});
|
|
3636
|
-
var WorkqueueColumn =
|
|
3410
|
+
var WorkqueueColumn = import_zod27.z.object({
|
|
3637
3411
|
label: TranslationConfig,
|
|
3638
3412
|
value: WorkqueueColumnValue
|
|
3639
3413
|
});
|
|
@@ -3644,54 +3418,158 @@ function defineWorkqueuesColumns(workqueueColumns) {
|
|
|
3644
3418
|
}
|
|
3645
3419
|
|
|
3646
3420
|
// ../commons/src/events/CountryConfigQueryInput.ts
|
|
3647
|
-
var
|
|
3648
|
-
var SerializableExact =
|
|
3649
|
-
type:
|
|
3650
|
-
term:
|
|
3421
|
+
var import_zod28 = require("zod");
|
|
3422
|
+
var SerializableExact = import_zod28.z.object({
|
|
3423
|
+
type: import_zod28.z.literal("exact"),
|
|
3424
|
+
term: import_zod28.z.union([import_zod28.z.string(), SerializedUserField])
|
|
3651
3425
|
});
|
|
3652
|
-
var SerializableWithin =
|
|
3653
|
-
type:
|
|
3654
|
-
location:
|
|
3426
|
+
var SerializableWithin = import_zod28.z.object({
|
|
3427
|
+
type: import_zod28.z.literal("within"),
|
|
3428
|
+
location: import_zod28.z.union([import_zod28.z.string(), SerializedUserField])
|
|
3655
3429
|
});
|
|
3656
|
-
var SerializedQueryExpression =
|
|
3657
|
-
eventType:
|
|
3658
|
-
status:
|
|
3659
|
-
createdAt:
|
|
3660
|
-
updatedAt:
|
|
3661
|
-
"legalStatuses.REGISTERED.createdAt":
|
|
3662
|
-
"legalStatuses.REGISTERED.createdAtLocation":
|
|
3663
|
-
|
|
3430
|
+
var SerializedQueryExpression = import_zod28.z.object({
|
|
3431
|
+
eventType: import_zod28.z.string(),
|
|
3432
|
+
status: import_zod28.z.optional(import_zod28.z.union([AnyOfStatus, ExactStatus])),
|
|
3433
|
+
createdAt: import_zod28.z.optional(DateCondition),
|
|
3434
|
+
updatedAt: import_zod28.z.optional(DateCondition),
|
|
3435
|
+
"legalStatuses.REGISTERED.createdAt": import_zod28.z.optional(DateCondition),
|
|
3436
|
+
"legalStatuses.REGISTERED.createdAtLocation": import_zod28.z.optional(
|
|
3437
|
+
import_zod28.z.union([Within, Exact])
|
|
3664
3438
|
),
|
|
3665
|
-
"legalStatuses.REGISTERED.registrationNumber":
|
|
3666
|
-
createdAtLocation:
|
|
3667
|
-
|
|
3439
|
+
"legalStatuses.REGISTERED.registrationNumber": import_zod28.z.optional(Exact),
|
|
3440
|
+
createdAtLocation: import_zod28.z.optional(
|
|
3441
|
+
import_zod28.z.union([SerializableWithin, SerializableExact])
|
|
3668
3442
|
),
|
|
3669
|
-
updatedAtLocation:
|
|
3670
|
-
|
|
3443
|
+
updatedAtLocation: import_zod28.z.optional(
|
|
3444
|
+
import_zod28.z.union([SerializableWithin, SerializableExact])
|
|
3671
3445
|
),
|
|
3672
|
-
assignedTo:
|
|
3673
|
-
createdBy:
|
|
3446
|
+
assignedTo: import_zod28.z.optional(SerializableExact),
|
|
3447
|
+
createdBy: import_zod28.z.optional(SerializableExact),
|
|
3674
3448
|
createdByUserType: ExactUserType,
|
|
3675
|
-
updatedBy:
|
|
3676
|
-
trackingId:
|
|
3677
|
-
flags:
|
|
3449
|
+
updatedBy: import_zod28.z.optional(SerializableExact),
|
|
3450
|
+
trackingId: import_zod28.z.optional(Exact),
|
|
3451
|
+
flags: import_zod28.z.optional(ContainsFlags),
|
|
3678
3452
|
data: QueryInput
|
|
3679
3453
|
}).partial();
|
|
3680
|
-
var Or2 =
|
|
3681
|
-
type:
|
|
3682
|
-
clauses:
|
|
3454
|
+
var Or2 = import_zod28.z.object({
|
|
3455
|
+
type: import_zod28.z.literal("or"),
|
|
3456
|
+
clauses: import_zod28.z.array(SerializedQueryExpression)
|
|
3683
3457
|
});
|
|
3684
|
-
var And2 =
|
|
3685
|
-
type:
|
|
3686
|
-
clauses:
|
|
3458
|
+
var And2 = import_zod28.z.object({
|
|
3459
|
+
type: import_zod28.z.literal("and"),
|
|
3460
|
+
clauses: import_zod28.z.array(SerializedQueryExpression)
|
|
3687
3461
|
});
|
|
3688
|
-
var CountryConfigQueryType =
|
|
3689
|
-
var CountryConfigQueryInputType =
|
|
3462
|
+
var CountryConfigQueryType = import_zod28.z.discriminatedUnion("type", [And2, Or2]);
|
|
3463
|
+
var CountryConfigQueryInputType = import_zod28.z.union([
|
|
3690
3464
|
SerializedQueryExpression,
|
|
3691
3465
|
And2,
|
|
3692
3466
|
Or2
|
|
3693
3467
|
]);
|
|
3694
3468
|
|
|
3469
|
+
// ../commons/src/icons.ts
|
|
3470
|
+
var import_zod29 = require("zod");
|
|
3471
|
+
var AvailableIcons = import_zod29.z.enum([
|
|
3472
|
+
"Archived",
|
|
3473
|
+
"Assigned",
|
|
3474
|
+
"Certified",
|
|
3475
|
+
"Close",
|
|
3476
|
+
"Collapse",
|
|
3477
|
+
"Draft",
|
|
3478
|
+
"DuplicateYellow",
|
|
3479
|
+
"Expand",
|
|
3480
|
+
"ExternalValidate",
|
|
3481
|
+
"FilledCheck",
|
|
3482
|
+
"InReview",
|
|
3483
|
+
"Offline",
|
|
3484
|
+
"Registered",
|
|
3485
|
+
"RequiresUpdates",
|
|
3486
|
+
"Sent",
|
|
3487
|
+
"Validated",
|
|
3488
|
+
"WaitingApproval",
|
|
3489
|
+
"ChartActivity",
|
|
3490
|
+
"Activity",
|
|
3491
|
+
"Archive",
|
|
3492
|
+
"ArchiveTray",
|
|
3493
|
+
"ArrowLeft",
|
|
3494
|
+
"ArrowRight",
|
|
3495
|
+
"Buildings",
|
|
3496
|
+
"Circle",
|
|
3497
|
+
"CaretDown",
|
|
3498
|
+
"CaretLeft",
|
|
3499
|
+
"CaretRight",
|
|
3500
|
+
"ChartBar",
|
|
3501
|
+
"ChartLine",
|
|
3502
|
+
"ChatCircle",
|
|
3503
|
+
"CheckSquare",
|
|
3504
|
+
"Compass",
|
|
3505
|
+
"Check",
|
|
3506
|
+
"Copy",
|
|
3507
|
+
"Database",
|
|
3508
|
+
"DotsThreeVertical",
|
|
3509
|
+
"ArrowCounterClockwise",
|
|
3510
|
+
"MagnifyingGlassMinus",
|
|
3511
|
+
"MagnifyingGlassPlus",
|
|
3512
|
+
"Export",
|
|
3513
|
+
"Eye",
|
|
3514
|
+
"EyeSlash",
|
|
3515
|
+
"Envelope",
|
|
3516
|
+
"File",
|
|
3517
|
+
"FileSearch",
|
|
3518
|
+
"FileMinus",
|
|
3519
|
+
"FilePlus",
|
|
3520
|
+
"FileText",
|
|
3521
|
+
"FileX",
|
|
3522
|
+
"Handshake",
|
|
3523
|
+
"Gear",
|
|
3524
|
+
"GitBranch",
|
|
3525
|
+
"IdentificationCard",
|
|
3526
|
+
"List",
|
|
3527
|
+
"ListBullets",
|
|
3528
|
+
"Lock",
|
|
3529
|
+
"MagnifyingGlass",
|
|
3530
|
+
"MapPin",
|
|
3531
|
+
"Medal",
|
|
3532
|
+
"NotePencil",
|
|
3533
|
+
"Paperclip",
|
|
3534
|
+
"PaperPlaneTilt",
|
|
3535
|
+
"Pen",
|
|
3536
|
+
"Pencil",
|
|
3537
|
+
"PencilSimpleLine",
|
|
3538
|
+
"Phone",
|
|
3539
|
+
"Plus",
|
|
3540
|
+
"Printer",
|
|
3541
|
+
"SignOut",
|
|
3542
|
+
"Star",
|
|
3543
|
+
"Target",
|
|
3544
|
+
"TextT",
|
|
3545
|
+
"Trash",
|
|
3546
|
+
"UploadSimple",
|
|
3547
|
+
"User",
|
|
3548
|
+
"UserPlus",
|
|
3549
|
+
"Users",
|
|
3550
|
+
"WarningCircle",
|
|
3551
|
+
"X",
|
|
3552
|
+
"CircleWavyCheck",
|
|
3553
|
+
"CircleWavyQuestion",
|
|
3554
|
+
"ArchiveBox",
|
|
3555
|
+
"ArrowCircleDown",
|
|
3556
|
+
"FileArrowUp",
|
|
3557
|
+
"FileDotted",
|
|
3558
|
+
"Files",
|
|
3559
|
+
"PencilLine",
|
|
3560
|
+
"PencilCircle",
|
|
3561
|
+
"UserCircle",
|
|
3562
|
+
"Clock",
|
|
3563
|
+
"QrCode",
|
|
3564
|
+
"Webcam",
|
|
3565
|
+
"Sun",
|
|
3566
|
+
"DeviceTabletCamera",
|
|
3567
|
+
"Globe",
|
|
3568
|
+
"Fingerprint",
|
|
3569
|
+
"PushPin",
|
|
3570
|
+
"Timer"
|
|
3571
|
+
]);
|
|
3572
|
+
|
|
3695
3573
|
// ../commons/src/events/WorkqueueConfig.ts
|
|
3696
3574
|
var mandatoryColumns = defineWorkqueuesColumns([
|
|
3697
3575
|
{
|
|
@@ -3711,24 +3589,23 @@ var mandatoryColumns = defineWorkqueuesColumns([
|
|
|
3711
3589
|
value: event.field("updatedAt")
|
|
3712
3590
|
}
|
|
3713
3591
|
]);
|
|
3714
|
-
var WorkqueueActionsWithDefault =
|
|
3592
|
+
var WorkqueueActionsWithDefault = import_zod30.z.enum([
|
|
3715
3593
|
...workqueueActions.options,
|
|
3716
|
-
"DEFAULT"
|
|
3717
|
-
ActionType.READ
|
|
3594
|
+
"DEFAULT"
|
|
3718
3595
|
]);
|
|
3719
|
-
var WorkqueueConfig =
|
|
3720
|
-
slug:
|
|
3596
|
+
var WorkqueueConfig = import_zod30.z.object({
|
|
3597
|
+
slug: import_zod30.z.string().describe("Determines the url of the workqueue."),
|
|
3721
3598
|
name: TranslationConfig.describe(
|
|
3722
3599
|
"Title of the workflow (both in navigation and on the page)"
|
|
3723
3600
|
),
|
|
3724
3601
|
query: CountryConfigQueryType,
|
|
3725
|
-
actions:
|
|
3726
|
-
|
|
3602
|
+
actions: import_zod30.z.array(
|
|
3603
|
+
import_zod30.z.object({
|
|
3727
3604
|
type: WorkqueueActionsWithDefault,
|
|
3728
|
-
conditionals:
|
|
3605
|
+
conditionals: import_zod30.z.array(Conditional).optional()
|
|
3729
3606
|
})
|
|
3730
3607
|
),
|
|
3731
|
-
columns:
|
|
3608
|
+
columns: import_zod30.z.array(WorkqueueColumn).default(mandatoryColumns),
|
|
3732
3609
|
icon: AvailableIcons,
|
|
3733
3610
|
emptyMessage: TranslationConfig.optional()
|
|
3734
3611
|
}).describe("Configuration for workqueue.");
|
|
@@ -3736,26 +3613,26 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
|
|
|
3736
3613
|
query: true,
|
|
3737
3614
|
columns: true
|
|
3738
3615
|
});
|
|
3739
|
-
var WorkqueueConfigInput =
|
|
3740
|
-
slug:
|
|
3616
|
+
var WorkqueueConfigInput = import_zod30.z.object({
|
|
3617
|
+
slug: import_zod30.z.string().describe("Determines the url of the workqueue."),
|
|
3741
3618
|
name: TranslationConfig.describe(
|
|
3742
3619
|
"Title of the workflow (both in navigation and on the page)"
|
|
3743
3620
|
),
|
|
3744
3621
|
query: CountryConfigQueryInputType,
|
|
3745
|
-
actions:
|
|
3746
|
-
|
|
3622
|
+
actions: import_zod30.z.array(
|
|
3623
|
+
import_zod30.z.object({
|
|
3747
3624
|
type: WorkqueueActionsWithDefault,
|
|
3748
|
-
conditionals:
|
|
3625
|
+
conditionals: import_zod30.z.array(Conditional).optional()
|
|
3749
3626
|
})
|
|
3750
3627
|
),
|
|
3751
|
-
columns:
|
|
3628
|
+
columns: import_zod30.z.array(WorkqueueColumn).default(mandatoryColumns),
|
|
3752
3629
|
icon: AvailableIcons,
|
|
3753
3630
|
emptyMessage: TranslationConfig.optional()
|
|
3754
3631
|
});
|
|
3755
|
-
var WorkqueueCountInput =
|
|
3756
|
-
|
|
3632
|
+
var WorkqueueCountInput = import_zod30.z.array(
|
|
3633
|
+
import_zod30.z.object({ slug: import_zod30.z.string(), query: QueryType })
|
|
3757
3634
|
);
|
|
3758
|
-
var WorkqueueCountOutput =
|
|
3635
|
+
var WorkqueueCountOutput = import_zod30.z.record(import_zod30.z.string(), import_zod30.z.number());
|
|
3759
3636
|
|
|
3760
3637
|
// ../commons/src/events/workqueueDefaultColumns.ts
|
|
3761
3638
|
var defaultWorkqueueColumns = [
|
|
@@ -3778,40 +3655,47 @@ var defaultWorkqueueColumns = [
|
|
|
3778
3655
|
];
|
|
3779
3656
|
|
|
3780
3657
|
// ../commons/src/events/Draft.ts
|
|
3781
|
-
var
|
|
3658
|
+
var import_zod32 = require("zod");
|
|
3782
3659
|
|
|
3783
3660
|
// ../commons/src/events/ActionInput.ts
|
|
3784
|
-
var
|
|
3785
|
-
var
|
|
3661
|
+
var import_zod31 = require("zod");
|
|
3662
|
+
var import_zod_openapi11 = require("zod-openapi");
|
|
3663
|
+
(0, import_zod_openapi11.extendZodWithOpenApi)(import_zod31.z);
|
|
3664
|
+
var BaseActionInput = import_zod31.z.object({
|
|
3786
3665
|
eventId: UUID,
|
|
3787
|
-
transactionId:
|
|
3666
|
+
transactionId: import_zod31.z.string(),
|
|
3788
3667
|
declaration: ActionUpdate.default({}),
|
|
3789
3668
|
annotation: ActionUpdate.optional(),
|
|
3790
3669
|
originalActionId: UUID.optional(),
|
|
3791
3670
|
// should not be part of base action.
|
|
3792
|
-
keepAssignment:
|
|
3671
|
+
keepAssignment: import_zod31.z.boolean().optional(),
|
|
3793
3672
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
3794
3673
|
createdAtLocation: CreatedAtLocation.describe(
|
|
3795
3674
|
"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
3675
|
)
|
|
3797
3676
|
});
|
|
3798
|
-
var CreateActionInput = BaseActionInput.
|
|
3799
|
-
|
|
3800
|
-
type:
|
|
3677
|
+
var CreateActionInput = BaseActionInput.merge(
|
|
3678
|
+
import_zod31.z.object({
|
|
3679
|
+
type: import_zod31.z.literal(ActionType.CREATE).default(ActionType.CREATE),
|
|
3801
3680
|
createdAtLocation: CreatedAtLocation
|
|
3802
|
-
})
|
|
3681
|
+
})
|
|
3803
3682
|
);
|
|
3804
|
-
var RegisterActionInput = BaseActionInput.
|
|
3805
|
-
|
|
3806
|
-
type:
|
|
3807
|
-
registrationNumber:
|
|
3808
|
-
})
|
|
3683
|
+
var RegisterActionInput = BaseActionInput.merge(
|
|
3684
|
+
import_zod31.z.object({
|
|
3685
|
+
type: import_zod31.z.literal(ActionType.REGISTER).default(ActionType.REGISTER),
|
|
3686
|
+
registrationNumber: import_zod31.z.string().optional()
|
|
3687
|
+
})
|
|
3688
|
+
).strict();
|
|
3689
|
+
var ValidateActionInput = BaseActionInput.merge(
|
|
3690
|
+
import_zod31.z.object({
|
|
3691
|
+
type: import_zod31.z.literal(ActionType.VALIDATE).default(ActionType.VALIDATE)
|
|
3692
|
+
})
|
|
3809
3693
|
);
|
|
3810
|
-
var NotifyActionInput = BaseActionInput.
|
|
3811
|
-
|
|
3812
|
-
type:
|
|
3813
|
-
})
|
|
3814
|
-
).
|
|
3694
|
+
var NotifyActionInput = BaseActionInput.merge(
|
|
3695
|
+
import_zod31.z.object({
|
|
3696
|
+
type: import_zod31.z.literal(ActionType.NOTIFY).default(ActionType.NOTIFY)
|
|
3697
|
+
})
|
|
3698
|
+
).openapi({
|
|
3815
3699
|
default: {
|
|
3816
3700
|
eventId: "<event-id-here>",
|
|
3817
3701
|
transactionId: getUUID(),
|
|
@@ -3820,150 +3704,135 @@ var NotifyActionInput = BaseActionInput.extend(
|
|
|
3820
3704
|
type: ActionType.NOTIFY
|
|
3821
3705
|
}
|
|
3822
3706
|
});
|
|
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
|
|
3707
|
+
var DeclareActionInput = BaseActionInput.merge(
|
|
3708
|
+
import_zod31.z.object({
|
|
3709
|
+
type: import_zod31.z.literal(ActionType.DECLARE).default(ActionType.DECLARE)
|
|
3710
|
+
})
|
|
3835
3711
|
);
|
|
3836
|
-
var PrintCertificateActionInput = BaseActionInput.
|
|
3837
|
-
|
|
3838
|
-
type:
|
|
3712
|
+
var PrintCertificateActionInput = BaseActionInput.merge(
|
|
3713
|
+
import_zod31.z.object({
|
|
3714
|
+
type: import_zod31.z.literal(ActionType.PRINT_CERTIFICATE).default(ActionType.PRINT_CERTIFICATE),
|
|
3839
3715
|
content: PrintContent.optional()
|
|
3840
|
-
})
|
|
3716
|
+
})
|
|
3841
3717
|
);
|
|
3842
|
-
var RejectDeclarationActionInput = BaseActionInput.
|
|
3843
|
-
|
|
3844
|
-
type:
|
|
3718
|
+
var RejectDeclarationActionInput = BaseActionInput.merge(
|
|
3719
|
+
import_zod31.z.object({
|
|
3720
|
+
type: import_zod31.z.literal(ActionType.REJECT).default(ActionType.REJECT),
|
|
3845
3721
|
content: ReasonContent
|
|
3846
|
-
})
|
|
3722
|
+
})
|
|
3847
3723
|
);
|
|
3848
|
-
var DuplicateDetectedActionInput = BaseActionInput.
|
|
3849
|
-
|
|
3850
|
-
type:
|
|
3851
|
-
content:
|
|
3852
|
-
duplicates:
|
|
3724
|
+
var DuplicateDetectedActionInput = BaseActionInput.merge(
|
|
3725
|
+
import_zod31.z.object({
|
|
3726
|
+
type: import_zod31.z.literal(ActionType.DUPLICATE_DETECTED).default(ActionType.DUPLICATE_DETECTED),
|
|
3727
|
+
content: import_zod31.z.object({
|
|
3728
|
+
duplicates: import_zod31.z.array(PotentialDuplicate)
|
|
3853
3729
|
})
|
|
3854
|
-
})
|
|
3730
|
+
})
|
|
3855
3731
|
);
|
|
3856
|
-
var MarkAsDuplicateActionInput = BaseActionInput.
|
|
3857
|
-
|
|
3858
|
-
type:
|
|
3859
|
-
content:
|
|
3732
|
+
var MarkAsDuplicateActionInput = BaseActionInput.merge(
|
|
3733
|
+
import_zod31.z.object({
|
|
3734
|
+
type: import_zod31.z.literal(ActionType.MARK_AS_DUPLICATE).default(ActionType.MARK_AS_DUPLICATE),
|
|
3735
|
+
content: import_zod31.z.object({
|
|
3860
3736
|
duplicateOf: UUID
|
|
3861
3737
|
}).optional()
|
|
3862
|
-
})
|
|
3738
|
+
})
|
|
3863
3739
|
);
|
|
3864
|
-
var MarkNotDuplicateActionInput = BaseActionInput.
|
|
3865
|
-
|
|
3866
|
-
type:
|
|
3867
|
-
})
|
|
3740
|
+
var MarkNotDuplicateActionInput = BaseActionInput.merge(
|
|
3741
|
+
import_zod31.z.object({
|
|
3742
|
+
type: import_zod31.z.literal(ActionType.MARK_AS_NOT_DUPLICATE).default(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
3743
|
+
})
|
|
3868
3744
|
);
|
|
3869
|
-
var ArchiveActionInput = BaseActionInput.
|
|
3870
|
-
|
|
3871
|
-
type:
|
|
3745
|
+
var ArchiveActionInput = BaseActionInput.merge(
|
|
3746
|
+
import_zod31.z.object({
|
|
3747
|
+
type: import_zod31.z.literal(ActionType.ARCHIVE).default(ActionType.ARCHIVE),
|
|
3872
3748
|
content: ReasonContent
|
|
3873
|
-
})
|
|
3749
|
+
})
|
|
3874
3750
|
);
|
|
3875
|
-
var AssignActionInput = BaseActionInput.
|
|
3876
|
-
|
|
3877
|
-
type:
|
|
3878
|
-
assignedTo:
|
|
3879
|
-
})
|
|
3751
|
+
var AssignActionInput = BaseActionInput.merge(
|
|
3752
|
+
import_zod31.z.object({
|
|
3753
|
+
type: import_zod31.z.literal(ActionType.ASSIGN),
|
|
3754
|
+
assignedTo: import_zod31.z.string()
|
|
3755
|
+
})
|
|
3880
3756
|
);
|
|
3881
|
-
var UnassignActionInput = BaseActionInput.
|
|
3882
|
-
|
|
3883
|
-
type:
|
|
3884
|
-
assignedTo:
|
|
3885
|
-
})
|
|
3757
|
+
var UnassignActionInput = BaseActionInput.merge(
|
|
3758
|
+
import_zod31.z.object({
|
|
3759
|
+
type: import_zod31.z.literal(ActionType.UNASSIGN).default(ActionType.UNASSIGN),
|
|
3760
|
+
assignedTo: import_zod31.z.literal(null).default(null)
|
|
3761
|
+
})
|
|
3886
3762
|
);
|
|
3887
|
-
var RequestCorrectionActionInput = BaseActionInput.
|
|
3888
|
-
|
|
3889
|
-
type:
|
|
3890
|
-
})
|
|
3763
|
+
var RequestCorrectionActionInput = BaseActionInput.merge(
|
|
3764
|
+
import_zod31.z.object({
|
|
3765
|
+
type: import_zod31.z.literal(ActionType.REQUEST_CORRECTION).default(ActionType.REQUEST_CORRECTION)
|
|
3766
|
+
})
|
|
3891
3767
|
);
|
|
3892
|
-
var RejectCorrectionActionInput = BaseActionInput.
|
|
3893
|
-
|
|
3894
|
-
requestId:
|
|
3895
|
-
type:
|
|
3768
|
+
var RejectCorrectionActionInput = BaseActionInput.merge(
|
|
3769
|
+
import_zod31.z.object({
|
|
3770
|
+
requestId: import_zod31.z.string(),
|
|
3771
|
+
type: import_zod31.z.literal(ActionType.REJECT_CORRECTION).default(ActionType.REJECT_CORRECTION),
|
|
3896
3772
|
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
|
|
3773
|
+
})
|
|
3904
3774
|
);
|
|
3905
|
-
var
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3775
|
+
var ApproveCorrectionActionInput = BaseActionInput.merge(
|
|
3776
|
+
import_zod31.z.object({
|
|
3777
|
+
requestId: import_zod31.z.string(),
|
|
3778
|
+
type: import_zod31.z.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
|
|
3779
|
+
})
|
|
3909
3780
|
);
|
|
3910
|
-
var
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
customActionType: z33.string().describe("Name of the custom action.")
|
|
3915
|
-
}).shape
|
|
3781
|
+
var ReadActionInput = BaseActionInput.merge(
|
|
3782
|
+
import_zod31.z.object({
|
|
3783
|
+
type: import_zod31.z.literal(ActionType.READ).default(ActionType.READ)
|
|
3784
|
+
})
|
|
3916
3785
|
);
|
|
3917
|
-
var
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3786
|
+
var DeleteActionInput = import_zod31.z.object({ eventId: UUID });
|
|
3787
|
+
var ActionInput = import_zod31.z.discriminatedUnion("type", [
|
|
3788
|
+
CreateActionInput.openapi({ ref: "CreateActionInput" }),
|
|
3789
|
+
ValidateActionInput.openapi({ ref: "ValidateActionInput" }),
|
|
3790
|
+
RegisterActionInput.openapi({ ref: "RegisterActionInput" }),
|
|
3791
|
+
NotifyActionInput.openapi({ ref: "NotifyActionInput" }),
|
|
3792
|
+
DeclareActionInput.openapi({ ref: "DeclareActionInput" }),
|
|
3793
|
+
RejectDeclarationActionInput.openapi({
|
|
3794
|
+
ref: "RejectDeclarationActionInput"
|
|
3924
3795
|
}),
|
|
3925
|
-
DuplicateDetectedActionInput.
|
|
3926
|
-
|
|
3796
|
+
DuplicateDetectedActionInput.openapi({
|
|
3797
|
+
ref: "DuplicateDetectedActionInput"
|
|
3927
3798
|
}),
|
|
3928
|
-
MarkAsDuplicateActionInput.
|
|
3929
|
-
|
|
3799
|
+
MarkAsDuplicateActionInput.openapi({
|
|
3800
|
+
ref: "MarkAsDuplicateActionInput"
|
|
3930
3801
|
}),
|
|
3931
|
-
MarkNotDuplicateActionInput.
|
|
3932
|
-
|
|
3802
|
+
MarkNotDuplicateActionInput.openapi({
|
|
3803
|
+
ref: "MarkNotDuplicateActionInput"
|
|
3933
3804
|
}),
|
|
3934
|
-
ArchiveActionInput.
|
|
3935
|
-
AssignActionInput.
|
|
3936
|
-
UnassignActionInput.
|
|
3937
|
-
PrintCertificateActionInput.
|
|
3938
|
-
RequestCorrectionActionInput.
|
|
3939
|
-
|
|
3805
|
+
ArchiveActionInput.openapi({ ref: "ArchiveActionInput" }),
|
|
3806
|
+
AssignActionInput.openapi({ ref: "AssignActionInput" }),
|
|
3807
|
+
UnassignActionInput.openapi({ ref: "UnassignActionInput" }),
|
|
3808
|
+
PrintCertificateActionInput.openapi({ ref: "PrintCertificateActionInput" }),
|
|
3809
|
+
RequestCorrectionActionInput.openapi({
|
|
3810
|
+
ref: "RequestCorrectionActionInput"
|
|
3940
3811
|
}),
|
|
3941
|
-
RejectCorrectionActionInput.
|
|
3942
|
-
ApproveCorrectionActionInput.
|
|
3943
|
-
|
|
3812
|
+
RejectCorrectionActionInput.openapi({ ref: "RejectCorrectionActionInput" }),
|
|
3813
|
+
ApproveCorrectionActionInput.openapi({
|
|
3814
|
+
ref: "ApproveCorrectionActionInput"
|
|
3944
3815
|
}),
|
|
3945
|
-
ReadActionInput.
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
]).meta({
|
|
3949
|
-
id: "ActionInput"
|
|
3816
|
+
ReadActionInput.openapi({ ref: "ReadActionInput" })
|
|
3817
|
+
]).openapi({
|
|
3818
|
+
ref: "ActionInput"
|
|
3950
3819
|
});
|
|
3951
3820
|
|
|
3952
3821
|
// ../commons/src/events/Draft.ts
|
|
3953
|
-
var Draft =
|
|
3822
|
+
var Draft = import_zod32.z.object({
|
|
3954
3823
|
id: UUID,
|
|
3955
3824
|
eventId: UUID,
|
|
3956
|
-
transactionId:
|
|
3957
|
-
createdAt:
|
|
3825
|
+
transactionId: import_zod32.z.string(),
|
|
3826
|
+
createdAt: import_zod32.z.string().datetime(),
|
|
3958
3827
|
action: ActionBase.extend({
|
|
3959
|
-
type: ActionTypes.exclude([ActionTypes.
|
|
3828
|
+
type: ActionTypes.exclude([ActionTypes.Enum.DELETE])
|
|
3960
3829
|
}).omit({ id: true, createdAtLocation: true })
|
|
3961
3830
|
}).describe(
|
|
3962
3831
|
"A temporary storage for an action. Stored with details of the event, creator and creation time."
|
|
3963
3832
|
);
|
|
3964
3833
|
var DraftInput = BaseActionInput.extend({
|
|
3965
|
-
type: ActionTypes.exclude([ActionTypes.
|
|
3966
|
-
status:
|
|
3834
|
+
type: ActionTypes.exclude([ActionTypes.Enum.DELETE]),
|
|
3835
|
+
status: import_zod32.z.enum([
|
|
3967
3836
|
ActionStatus.Requested,
|
|
3968
3837
|
ActionStatus.Accepted,
|
|
3969
3838
|
ActionStatus.Rejected
|
|
@@ -3971,30 +3840,32 @@ var DraftInput = BaseActionInput.extend({
|
|
|
3971
3840
|
});
|
|
3972
3841
|
|
|
3973
3842
|
// ../commons/src/events/EventInput.ts
|
|
3974
|
-
var
|
|
3843
|
+
var import_zod33 = require("zod");
|
|
3975
3844
|
var import_uuid10 = require("uuid");
|
|
3976
|
-
var EventInput =
|
|
3977
|
-
transactionId:
|
|
3978
|
-
type:
|
|
3979
|
-
}).
|
|
3845
|
+
var EventInput = import_zod33.z.object({
|
|
3846
|
+
transactionId: import_zod33.z.string(),
|
|
3847
|
+
type: import_zod33.z.string()
|
|
3848
|
+
}).openapi({ default: { transactionId: (0, import_uuid10.v4)(), type: "birth" } });
|
|
3980
3849
|
|
|
3981
3850
|
// ../commons/src/events/EventDocument.ts
|
|
3982
|
-
var
|
|
3983
|
-
var
|
|
3851
|
+
var import_zod34 = require("zod");
|
|
3852
|
+
var import_zod_openapi12 = require("zod-openapi");
|
|
3853
|
+
(0, import_zod_openapi12.extendZodWithOpenApi)(import_zod34.z);
|
|
3854
|
+
var EventDocument = import_zod34.z.object({
|
|
3984
3855
|
id: UUID.describe("Unique identifier of the event."),
|
|
3985
|
-
type:
|
|
3986
|
-
createdAt:
|
|
3987
|
-
updatedAt:
|
|
3856
|
+
type: import_zod34.z.string().describe("Type of the event (e.g. birth, death, marriage)."),
|
|
3857
|
+
createdAt: import_zod34.z.string().datetime().describe("Timestamp indicating when the event was created."),
|
|
3858
|
+
updatedAt: import_zod34.z.string().datetime().describe(
|
|
3988
3859
|
"Timestamp of the last update, excluding changes from actions."
|
|
3989
3860
|
),
|
|
3990
|
-
actions:
|
|
3991
|
-
trackingId:
|
|
3861
|
+
actions: import_zod34.z.array(Action).describe("Ordered list of actions associated with the event."),
|
|
3862
|
+
trackingId: import_zod34.z.string().describe(
|
|
3992
3863
|
"System-generated tracking identifier used to look up the event."
|
|
3993
3864
|
)
|
|
3994
|
-
}).
|
|
3865
|
+
}).openapi({ ref: "EventDocument" });
|
|
3995
3866
|
|
|
3996
3867
|
// ../commons/src/events/state/index.ts
|
|
3997
|
-
var
|
|
3868
|
+
var import_lodash3 = require("lodash");
|
|
3998
3869
|
|
|
3999
3870
|
// ../commons/src/events/state/utils.ts
|
|
4000
3871
|
var import_lodash2 = require("lodash");
|
|
@@ -4002,18 +3873,14 @@ var updateActions = ActionTypes.extract([
|
|
|
4002
3873
|
ActionType.CREATE,
|
|
4003
3874
|
ActionType.NOTIFY,
|
|
4004
3875
|
ActionType.DECLARE,
|
|
3876
|
+
ActionType.VALIDATE,
|
|
4005
3877
|
ActionType.REGISTER,
|
|
4006
3878
|
ActionType.REJECT,
|
|
4007
3879
|
ActionType.ARCHIVE,
|
|
4008
3880
|
ActionType.PRINT_CERTIFICATE,
|
|
4009
|
-
ActionType.REQUEST_CORRECTION
|
|
4010
|
-
ActionType.CUSTOM
|
|
3881
|
+
ActionType.REQUEST_CORRECTION
|
|
4011
3882
|
]);
|
|
4012
3883
|
|
|
4013
|
-
// ../commons/src/events/state/flags.ts
|
|
4014
|
-
var import_lodash3 = require("lodash");
|
|
4015
|
-
var import_date_fns3 = require("date-fns");
|
|
4016
|
-
|
|
4017
3884
|
// ../commons/src/events/defineConfig.ts
|
|
4018
3885
|
var defineConfig = (config) => {
|
|
4019
3886
|
const input = EventConfig.parse(config);
|
|
@@ -4021,7 +3888,7 @@ var defineConfig = (config) => {
|
|
|
4021
3888
|
};
|
|
4022
3889
|
|
|
4023
3890
|
// ../commons/src/events/test.utils.ts
|
|
4024
|
-
var
|
|
3891
|
+
var import_lodash4 = require("lodash");
|
|
4025
3892
|
var import_date_fns4 = require("date-fns");
|
|
4026
3893
|
|
|
4027
3894
|
// ../commons/src/field-config/field-configuration.ts
|
|
@@ -4043,6 +3910,7 @@ function field(fieldId, options = {}) {
|
|
|
4043
3910
|
}
|
|
4044
3911
|
|
|
4045
3912
|
// ../commons/src/fixtures/forms.ts
|
|
3913
|
+
var import_date_fns3 = require("date-fns");
|
|
4046
3914
|
var PRINT_CERTIFICATE_FORM = defineActionForm({
|
|
4047
3915
|
label: {
|
|
4048
3916
|
id: "event.tennis-club-membership.action.certificate.form.label",
|
|
@@ -4842,7 +4710,7 @@ var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
|
|
|
4842
4710
|
conditionals: [
|
|
4843
4711
|
{
|
|
4844
4712
|
type: ConditionalType.DISPLAY_ON_REVIEW,
|
|
4845
|
-
conditional:
|
|
4713
|
+
conditional: never()
|
|
4846
4714
|
}
|
|
4847
4715
|
]
|
|
4848
4716
|
},
|
|
@@ -5225,16 +5093,119 @@ var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
|
|
|
5225
5093
|
}
|
|
5226
5094
|
}
|
|
5227
5095
|
],
|
|
5228
|
-
conditional: not(
|
|
5096
|
+
conditional: not(never())
|
|
5229
5097
|
// Intentional always-true page conditional to exercise interactions between page-level and field-level conditionals in tests
|
|
5230
5098
|
}
|
|
5231
5099
|
]
|
|
5232
5100
|
});
|
|
5101
|
+
var statusOptions = [
|
|
5102
|
+
{
|
|
5103
|
+
value: "ALL",
|
|
5104
|
+
label: {
|
|
5105
|
+
defaultMessage: "Any status",
|
|
5106
|
+
description: "Option for form field: status of record",
|
|
5107
|
+
id: "advancedSearch.form.recordStatusAny"
|
|
5108
|
+
}
|
|
5109
|
+
},
|
|
5110
|
+
{
|
|
5111
|
+
value: EventStatus.enum.CREATED,
|
|
5112
|
+
label: {
|
|
5113
|
+
defaultMessage: "Draft",
|
|
5114
|
+
description: "Option for form field: status of record",
|
|
5115
|
+
id: "advancedSearch.form.recordStatusCreated"
|
|
5116
|
+
}
|
|
5117
|
+
},
|
|
5118
|
+
{
|
|
5119
|
+
value: EventStatus.enum.NOTIFIED,
|
|
5120
|
+
label: {
|
|
5121
|
+
defaultMessage: "Notified",
|
|
5122
|
+
description: "Option for form field: status of record",
|
|
5123
|
+
id: "advancedSearch.form.recordStatusNotified"
|
|
5124
|
+
}
|
|
5125
|
+
},
|
|
5126
|
+
{
|
|
5127
|
+
value: EventStatus.enum.DECLARED,
|
|
5128
|
+
label: {
|
|
5129
|
+
defaultMessage: "Declared",
|
|
5130
|
+
description: "Option for form field: status of record",
|
|
5131
|
+
id: "advancedSearch.form.recordStatusDeclared"
|
|
5132
|
+
}
|
|
5133
|
+
},
|
|
5134
|
+
{
|
|
5135
|
+
value: EventStatus.enum.VALIDATED,
|
|
5136
|
+
label: {
|
|
5137
|
+
defaultMessage: "Validated",
|
|
5138
|
+
description: "Option for form field: status of record",
|
|
5139
|
+
id: "advancedSearch.form.recordStatusValidated"
|
|
5140
|
+
}
|
|
5141
|
+
},
|
|
5142
|
+
{
|
|
5143
|
+
value: EventStatus.enum.REGISTERED,
|
|
5144
|
+
label: {
|
|
5145
|
+
defaultMessage: "Registered",
|
|
5146
|
+
description: "Option for form field: status of record",
|
|
5147
|
+
id: "advancedSearch.form.recordStatusRegistered"
|
|
5148
|
+
}
|
|
5149
|
+
},
|
|
5150
|
+
{
|
|
5151
|
+
value: EventStatus.enum.ARCHIVED,
|
|
5152
|
+
label: {
|
|
5153
|
+
defaultMessage: "Archived",
|
|
5154
|
+
description: "Option for form field: status of record",
|
|
5155
|
+
id: "advancedSearch.form.recordStatusArchived"
|
|
5156
|
+
}
|
|
5157
|
+
}
|
|
5158
|
+
];
|
|
5159
|
+
var timePeriodOptions = [
|
|
5160
|
+
{
|
|
5161
|
+
label: {
|
|
5162
|
+
defaultMessage: "Last 7 days",
|
|
5163
|
+
description: "Label for option of time period select: last 7 days",
|
|
5164
|
+
id: "form.section.label.timePeriodLast7Days"
|
|
5165
|
+
},
|
|
5166
|
+
value: `${(0, import_date_fns3.format)((0, import_date_fns3.subDays)(/* @__PURE__ */ new Date(), 7), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
|
|
5167
|
+
/* @__PURE__ */ new Date(),
|
|
5168
|
+
"yyyy-MM-dd"
|
|
5169
|
+
)}`
|
|
5170
|
+
},
|
|
5171
|
+
{
|
|
5172
|
+
label: {
|
|
5173
|
+
defaultMessage: "Last 30 days",
|
|
5174
|
+
description: "Label for option of time period select: last 30 days",
|
|
5175
|
+
id: "form.section.label.timePeriodLast30Days"
|
|
5176
|
+
},
|
|
5177
|
+
value: `${(0, import_date_fns3.format)((0, import_date_fns3.subMonths)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
|
|
5178
|
+
/* @__PURE__ */ new Date(),
|
|
5179
|
+
"yyyy-MM-dd"
|
|
5180
|
+
)}`
|
|
5181
|
+
},
|
|
5182
|
+
{
|
|
5183
|
+
label: {
|
|
5184
|
+
defaultMessage: "Last 90 days",
|
|
5185
|
+
description: "Label for option of time period select: last 90 days",
|
|
5186
|
+
id: "form.section.label.timePeriodLast90Days"
|
|
5187
|
+
},
|
|
5188
|
+
value: `${(0, import_date_fns3.format)((0, import_date_fns3.subQuarters)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
|
|
5189
|
+
/* @__PURE__ */ new Date(),
|
|
5190
|
+
"yyyy-MM-dd"
|
|
5191
|
+
)}`
|
|
5192
|
+
},
|
|
5193
|
+
{
|
|
5194
|
+
label: {
|
|
5195
|
+
defaultMessage: "Last year",
|
|
5196
|
+
description: "Label for option of time period select: last year",
|
|
5197
|
+
id: "form.section.label.timePeriodLastYear"
|
|
5198
|
+
},
|
|
5199
|
+
value: `${(0, import_date_fns3.format)((0, import_date_fns3.subYears)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
|
|
5200
|
+
/* @__PURE__ */ new Date(),
|
|
5201
|
+
"yyyy-MM-dd"
|
|
5202
|
+
)}`
|
|
5203
|
+
}
|
|
5204
|
+
];
|
|
5233
5205
|
|
|
5234
5206
|
// ../commons/src/fixtures/tennis-club-membership-event.ts
|
|
5235
5207
|
var tennisClubMembershipEvent = defineConfig({
|
|
5236
5208
|
id: TENNIS_CLUB_MEMBERSHIP,
|
|
5237
|
-
declaration: TENNIS_CLUB_DECLARATION_FORM,
|
|
5238
5209
|
label: {
|
|
5239
5210
|
defaultMessage: "Tennis club membership application",
|
|
5240
5211
|
description: "This is what this event is referred as in the system",
|
|
@@ -5285,12 +5256,13 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5285
5256
|
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5286
5257
|
},
|
|
5287
5258
|
{
|
|
5288
|
-
type: ActionType.
|
|
5259
|
+
type: ActionType.VALIDATE,
|
|
5289
5260
|
label: {
|
|
5290
|
-
defaultMessage: "
|
|
5261
|
+
defaultMessage: "Validate",
|
|
5291
5262
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5292
|
-
id: "event.tennis-club-membership.action.
|
|
5293
|
-
}
|
|
5263
|
+
id: "event.tennis-club-membership.action.validate.label"
|
|
5264
|
+
},
|
|
5265
|
+
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5294
5266
|
},
|
|
5295
5267
|
{
|
|
5296
5268
|
type: ActionType.REGISTER,
|
|
@@ -5298,7 +5270,8 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5298
5270
|
defaultMessage: "Register",
|
|
5299
5271
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5300
5272
|
id: "event.tennis-club-membership.action.register.label"
|
|
5301
|
-
}
|
|
5273
|
+
},
|
|
5274
|
+
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5302
5275
|
},
|
|
5303
5276
|
{
|
|
5304
5277
|
type: ActionType.REQUEST_CORRECTION,
|
|
@@ -5501,6 +5474,14 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5501
5474
|
]
|
|
5502
5475
|
}
|
|
5503
5476
|
},
|
|
5477
|
+
{
|
|
5478
|
+
type: ActionType.APPROVE_CORRECTION,
|
|
5479
|
+
label: {
|
|
5480
|
+
defaultMessage: "Approve correction",
|
|
5481
|
+
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5482
|
+
id: "event.tennis-club-membership.action.correction.approve.label"
|
|
5483
|
+
}
|
|
5484
|
+
},
|
|
5504
5485
|
{
|
|
5505
5486
|
type: ActionType.PRINT_CERTIFICATE,
|
|
5506
5487
|
label: {
|
|
@@ -5509,6 +5490,22 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5509
5490
|
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5510
5491
|
},
|
|
5511
5492
|
printForm: PRINT_CERTIFICATE_FORM
|
|
5493
|
+
},
|
|
5494
|
+
{
|
|
5495
|
+
type: ActionType.ARCHIVE,
|
|
5496
|
+
label: {
|
|
5497
|
+
id: "event.tennis-club-membership.action.archive.label",
|
|
5498
|
+
defaultMessage: "Archive",
|
|
5499
|
+
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5500
|
+
}
|
|
5501
|
+
},
|
|
5502
|
+
{
|
|
5503
|
+
type: ActionType.REJECT,
|
|
5504
|
+
label: {
|
|
5505
|
+
id: "event.tennis-club-membership.action.reject.label",
|
|
5506
|
+
defaultMessage: "Reject",
|
|
5507
|
+
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5508
|
+
}
|
|
5512
5509
|
}
|
|
5513
5510
|
],
|
|
5514
5511
|
advancedSearch: [
|
|
@@ -5545,7 +5542,8 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5545
5542
|
},
|
|
5546
5543
|
fields: [field("recommender.name").fuzzy()]
|
|
5547
5544
|
}
|
|
5548
|
-
]
|
|
5545
|
+
],
|
|
5546
|
+
declaration: TENNIS_CLUB_DECLARATION_FORM
|
|
5549
5547
|
});
|
|
5550
5548
|
|
|
5551
5549
|
// ../commons/src/fixtures/football-club-membership-event.ts
|
|
@@ -5613,13 +5611,23 @@ var footballClubMembershipEvent = defineConfig({
|
|
|
5613
5611
|
},
|
|
5614
5612
|
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5615
5613
|
},
|
|
5614
|
+
{
|
|
5615
|
+
type: ActionType.VALIDATE,
|
|
5616
|
+
label: {
|
|
5617
|
+
defaultMessage: "Validate",
|
|
5618
|
+
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5619
|
+
id: "event.football-club-membership.action.validate.label"
|
|
5620
|
+
},
|
|
5621
|
+
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5622
|
+
},
|
|
5616
5623
|
{
|
|
5617
5624
|
type: ActionType.REGISTER,
|
|
5618
5625
|
label: {
|
|
5619
5626
|
defaultMessage: "Register",
|
|
5620
5627
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5621
5628
|
id: "event.football-club-membership.action.register.label"
|
|
5622
|
-
}
|
|
5629
|
+
},
|
|
5630
|
+
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5623
5631
|
},
|
|
5624
5632
|
{
|
|
5625
5633
|
type: ActionType.REQUEST_CORRECTION,
|
|
@@ -5825,6 +5833,14 @@ var footballClubMembershipEvent = defineConfig({
|
|
|
5825
5833
|
]
|
|
5826
5834
|
}
|
|
5827
5835
|
},
|
|
5836
|
+
{
|
|
5837
|
+
type: ActionType.APPROVE_CORRECTION,
|
|
5838
|
+
label: {
|
|
5839
|
+
defaultMessage: "Approve correction",
|
|
5840
|
+
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5841
|
+
id: "event.football-club-membership.action.correction.approve.label"
|
|
5842
|
+
}
|
|
5843
|
+
},
|
|
5828
5844
|
{
|
|
5829
5845
|
type: ActionType.PRINT_CERTIFICATE,
|
|
5830
5846
|
label: {
|
|
@@ -5833,6 +5849,22 @@ var footballClubMembershipEvent = defineConfig({
|
|
|
5833
5849
|
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5834
5850
|
},
|
|
5835
5851
|
printForm: PRINT_CERTIFICATE_FORM
|
|
5852
|
+
},
|
|
5853
|
+
{
|
|
5854
|
+
type: ActionType.ARCHIVE,
|
|
5855
|
+
label: {
|
|
5856
|
+
id: "event.football-club-membership.action.archive.label",
|
|
5857
|
+
defaultMessage: "Archive",
|
|
5858
|
+
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5859
|
+
}
|
|
5860
|
+
},
|
|
5861
|
+
{
|
|
5862
|
+
type: ActionType.REJECT,
|
|
5863
|
+
label: {
|
|
5864
|
+
id: "event.football-club-membership.action.reject.label",
|
|
5865
|
+
defaultMessage: "Reject",
|
|
5866
|
+
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5867
|
+
}
|
|
5836
5868
|
}
|
|
5837
5869
|
],
|
|
5838
5870
|
advancedSearch: [
|
|
@@ -5932,7 +5964,7 @@ var libraryMembershipEvent = defineConfig({
|
|
|
5932
5964
|
declaration: libraryMembershipForm
|
|
5933
5965
|
});
|
|
5934
5966
|
|
|
5935
|
-
// ../commons/src/fixtures/
|
|
5967
|
+
// ../commons/src/fixtures/v2-birth-event.ts
|
|
5936
5968
|
function generateTranslationConfig(message) {
|
|
5937
5969
|
return {
|
|
5938
5970
|
defaultMessage: message,
|
|
@@ -5961,61 +5993,6 @@ var child = defineFormPage({
|
|
|
5961
5993
|
secured: true,
|
|
5962
5994
|
validation: [],
|
|
5963
5995
|
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
5996
|
}
|
|
6020
5997
|
]
|
|
6021
5998
|
});
|
|
@@ -6092,7 +6069,7 @@ var mother = defineFormPage({
|
|
|
6092
6069
|
}
|
|
6093
6070
|
]
|
|
6094
6071
|
});
|
|
6095
|
-
var
|
|
6072
|
+
var BIRTH_DECLARATION_REVIEW = {
|
|
6096
6073
|
title: generateTranslationConfig(
|
|
6097
6074
|
"{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
6075
|
),
|
|
@@ -6112,12 +6089,12 @@ var CHILD_ONBOARDING_DECLARATION_REVIEW = {
|
|
|
6112
6089
|
}
|
|
6113
6090
|
]
|
|
6114
6091
|
};
|
|
6115
|
-
var
|
|
6092
|
+
var BIRTH_DECLARATION_FORM = defineDeclarationForm({
|
|
6116
6093
|
label: generateTranslationConfig("Birth decalration form"),
|
|
6117
6094
|
pages: [child, mother]
|
|
6118
6095
|
});
|
|
6119
|
-
var
|
|
6120
|
-
id:
|
|
6096
|
+
var v2BirthEvent = defineConfig({
|
|
6097
|
+
id: BIRTH_EVENT,
|
|
6121
6098
|
title: generateTranslationConfig(
|
|
6122
6099
|
"{child.name.firstname} {child.name.surname}"
|
|
6123
6100
|
),
|
|
@@ -6125,21 +6102,27 @@ var ChildOnboardingEvent = defineConfig({
|
|
|
6125
6102
|
summary: {
|
|
6126
6103
|
fields: []
|
|
6127
6104
|
},
|
|
6128
|
-
declaration:
|
|
6105
|
+
declaration: BIRTH_DECLARATION_FORM,
|
|
6129
6106
|
actions: [
|
|
6130
6107
|
{
|
|
6131
6108
|
type: ActionType.READ,
|
|
6132
6109
|
label: generateTranslationConfig("Read"),
|
|
6133
|
-
review:
|
|
6110
|
+
review: BIRTH_DECLARATION_REVIEW
|
|
6134
6111
|
},
|
|
6135
6112
|
{
|
|
6136
6113
|
type: ActionType.DECLARE,
|
|
6137
6114
|
label: generateTranslationConfig("Declare"),
|
|
6138
|
-
review:
|
|
6115
|
+
review: BIRTH_DECLARATION_REVIEW
|
|
6116
|
+
},
|
|
6117
|
+
{
|
|
6118
|
+
type: ActionType.VALIDATE,
|
|
6119
|
+
label: generateTranslationConfig("Validate"),
|
|
6120
|
+
review: BIRTH_DECLARATION_REVIEW
|
|
6139
6121
|
},
|
|
6140
6122
|
{
|
|
6141
6123
|
type: ActionType.REGISTER,
|
|
6142
|
-
label: generateTranslationConfig("Register")
|
|
6124
|
+
label: generateTranslationConfig("Register"),
|
|
6125
|
+
review: BIRTH_DECLARATION_REVIEW
|
|
6143
6126
|
}
|
|
6144
6127
|
],
|
|
6145
6128
|
advancedSearch: []
|
|
@@ -6227,7 +6210,7 @@ var PRINT_DIGITAL_ID_CERTIFICATE_FORM = defineActionForm({
|
|
|
6227
6210
|
conditionals: [
|
|
6228
6211
|
{
|
|
6229
6212
|
type: ConditionalType.ENABLE,
|
|
6230
|
-
conditional:
|
|
6213
|
+
conditional: never()
|
|
6231
6214
|
},
|
|
6232
6215
|
{
|
|
6233
6216
|
type: ConditionalType.SHOW,
|
|
@@ -6254,7 +6237,7 @@ var PRINT_DIGITAL_ID_CERTIFICATE_FORM = defineActionForm({
|
|
|
6254
6237
|
conditionals: [
|
|
6255
6238
|
{
|
|
6256
6239
|
type: ConditionalType.ENABLE,
|
|
6257
|
-
conditional:
|
|
6240
|
+
conditional: never()
|
|
6258
6241
|
},
|
|
6259
6242
|
{
|
|
6260
6243
|
type: ConditionalType.SHOW,
|
|
@@ -6282,7 +6265,7 @@ var PRINT_DIGITAL_ID_CERTIFICATE_FORM = defineActionForm({
|
|
|
6282
6265
|
conditionals: [
|
|
6283
6266
|
{
|
|
6284
6267
|
type: ConditionalType.ENABLE,
|
|
6285
|
-
conditional:
|
|
6268
|
+
conditional: never()
|
|
6286
6269
|
}
|
|
6287
6270
|
],
|
|
6288
6271
|
value: field("identity.http-fetch").get("data.certificateId")
|
|
@@ -6360,8 +6343,8 @@ var digitalIdentityEvent = defineConfig({
|
|
|
6360
6343
|
});
|
|
6361
6344
|
|
|
6362
6345
|
// ../commons/src/events/test.utils.ts
|
|
6363
|
-
var
|
|
6364
|
-
var TestUserRole =
|
|
6346
|
+
var import_zod35 = require("zod");
|
|
6347
|
+
var TestUserRole = import_zod35.z.enum([
|
|
6365
6348
|
"FIELD_AGENT",
|
|
6366
6349
|
"LOCAL_REGISTRAR",
|
|
6367
6350
|
"LOCAL_SYSTEM_ADMIN",
|
|
@@ -6372,14 +6355,18 @@ var TestUserRole = z37.enum([
|
|
|
6372
6355
|
]);
|
|
6373
6356
|
|
|
6374
6357
|
// ../commons/src/events/scopes.ts
|
|
6375
|
-
var
|
|
6358
|
+
var import_lodash5 = require("lodash");
|
|
6376
6359
|
var ACTION_SCOPE_MAP = {
|
|
6377
6360
|
[ActionType.READ]: ["record.read"],
|
|
6378
6361
|
[ActionType.CREATE]: ["record.create"],
|
|
6379
6362
|
[ActionType.NOTIFY]: ["record.notify"],
|
|
6380
|
-
[ActionType.DECLARE]: [
|
|
6381
|
-
|
|
6363
|
+
[ActionType.DECLARE]: [
|
|
6364
|
+
"record.declare",
|
|
6365
|
+
"record.declared.validate",
|
|
6366
|
+
"record.register"
|
|
6367
|
+
],
|
|
6382
6368
|
[ActionType.DELETE]: ["record.declare"],
|
|
6369
|
+
[ActionType.VALIDATE]: ["record.declared.validate", "record.register"],
|
|
6383
6370
|
[ActionType.REGISTER]: ["record.register"],
|
|
6384
6371
|
[ActionType.PRINT_CERTIFICATE]: ["record.registered.print-certified-copies"],
|
|
6385
6372
|
[ActionType.REQUEST_CORRECTION]: [
|
|
@@ -6397,8 +6384,7 @@ var ACTION_SCOPE_MAP = {
|
|
|
6397
6384
|
[ActionType.REJECT]: ["record.declared.reject"],
|
|
6398
6385
|
[ActionType.ASSIGN]: null,
|
|
6399
6386
|
[ActionType.UNASSIGN]: null,
|
|
6400
|
-
[ActionType.DUPLICATE_DETECTED]: []
|
|
6401
|
-
[ActionType.CUSTOM]: []
|
|
6387
|
+
[ActionType.DUPLICATE_DETECTED]: []
|
|
6402
6388
|
};
|
|
6403
6389
|
|
|
6404
6390
|
// ../commons/src/events/state/availableActions.ts
|
|
@@ -6407,25 +6393,28 @@ var AVAILABLE_ACTIONS_BY_EVENT_STATUS = {
|
|
|
6407
6393
|
ActionType.READ,
|
|
6408
6394
|
ActionType.DECLARE,
|
|
6409
6395
|
ActionType.NOTIFY,
|
|
6410
|
-
ActionType.DELETE
|
|
6411
|
-
ActionType.CUSTOM
|
|
6396
|
+
ActionType.DELETE
|
|
6412
6397
|
],
|
|
6413
6398
|
[EventStatus.enum.NOTIFIED]: [
|
|
6414
6399
|
ActionType.READ,
|
|
6415
6400
|
ActionType.DECLARE,
|
|
6416
6401
|
ActionType.MARK_AS_DUPLICATE,
|
|
6417
6402
|
ActionType.ARCHIVE,
|
|
6418
|
-
ActionType.REJECT
|
|
6419
|
-
ActionType.CUSTOM
|
|
6403
|
+
ActionType.REJECT
|
|
6420
6404
|
],
|
|
6421
6405
|
[EventStatus.enum.DECLARED]: [
|
|
6406
|
+
ActionType.READ,
|
|
6407
|
+
ActionType.VALIDATE,
|
|
6408
|
+
ActionType.MARK_AS_DUPLICATE,
|
|
6409
|
+
ActionType.ARCHIVE,
|
|
6410
|
+
ActionType.REJECT
|
|
6411
|
+
],
|
|
6412
|
+
[EventStatus.enum.VALIDATED]: [
|
|
6422
6413
|
ActionType.READ,
|
|
6423
6414
|
ActionType.REGISTER,
|
|
6424
6415
|
ActionType.MARK_AS_DUPLICATE,
|
|
6425
6416
|
ActionType.ARCHIVE,
|
|
6426
|
-
ActionType.REJECT
|
|
6427
|
-
ActionType.CUSTOM,
|
|
6428
|
-
ActionType.EDIT
|
|
6417
|
+
ActionType.REJECT
|
|
6429
6418
|
],
|
|
6430
6419
|
[EventStatus.enum.REGISTERED]: [
|
|
6431
6420
|
ActionType.READ,
|
|
@@ -6433,14 +6422,12 @@ var AVAILABLE_ACTIONS_BY_EVENT_STATUS = {
|
|
|
6433
6422
|
ActionType.REQUEST_CORRECTION,
|
|
6434
6423
|
ActionType.APPROVE_CORRECTION,
|
|
6435
6424
|
ActionType.REJECT_CORRECTION,
|
|
6436
|
-
ActionType.CUSTOM,
|
|
6437
6425
|
ClientSpecificAction.REVIEW_CORRECTION_REQUEST
|
|
6438
6426
|
],
|
|
6439
6427
|
[EventStatus.enum.ARCHIVED]: [
|
|
6440
6428
|
ActionType.READ,
|
|
6441
6429
|
ActionType.ASSIGN,
|
|
6442
|
-
ActionType.UNASSIGN
|
|
6443
|
-
ActionType.CUSTOM
|
|
6430
|
+
ActionType.UNASSIGN
|
|
6444
6431
|
]
|
|
6445
6432
|
};
|
|
6446
6433
|
var ACTION_FILTERS = {
|
|
@@ -6450,32 +6437,32 @@ var ACTION_FILTERS = {
|
|
|
6450
6437
|
[ActionType.APPROVE_CORRECTION]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6451
6438
|
[ActionType.REJECT_CORRECTION]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6452
6439
|
[ActionType.MARK_AS_DUPLICATE]: (flags) => flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6453
|
-
[ActionType.
|
|
6440
|
+
[ActionType.VALIDATE]: (flags) => !flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6454
6441
|
[ActionType.REGISTER]: (flags) => !flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6455
6442
|
[ActionType.REJECT]: (flags) => !flags.includes(InherentFlags.REJECTED) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6456
6443
|
[ActionType.ARCHIVE]: (flags) => !flags.some((flag) => flag.endsWith(":requested"))
|
|
6457
6444
|
};
|
|
6458
6445
|
|
|
6459
6446
|
// ../commons/src/events/FileUtils.ts
|
|
6460
|
-
var
|
|
6447
|
+
var import_lodash6 = require("lodash");
|
|
6461
6448
|
|
|
6462
6449
|
// ../commons/src/events/locations.ts
|
|
6463
|
-
var
|
|
6464
|
-
var LocationType =
|
|
6450
|
+
var import_zod36 = require("zod");
|
|
6451
|
+
var LocationType = import_zod36.z.enum([
|
|
6465
6452
|
"ADMIN_STRUCTURE",
|
|
6466
6453
|
"CRVS_OFFICE",
|
|
6467
6454
|
"HEALTH_FACILITY"
|
|
6468
6455
|
]);
|
|
6469
|
-
var Location =
|
|
6456
|
+
var Location = import_zod36.z.object({
|
|
6470
6457
|
id: UUID,
|
|
6471
|
-
name:
|
|
6458
|
+
name: import_zod36.z.string(),
|
|
6472
6459
|
parentId: UUID.nullable(),
|
|
6473
|
-
validUntil:
|
|
6460
|
+
validUntil: import_zod36.z.string().datetime().nullable(),
|
|
6474
6461
|
locationType: LocationType.nullable()
|
|
6475
6462
|
});
|
|
6476
6463
|
|
|
6477
6464
|
// ../commons/src/notification/UserNotifications.ts
|
|
6478
|
-
var
|
|
6465
|
+
var import_zod37 = require("zod");
|
|
6479
6466
|
var TriggerEvent = {
|
|
6480
6467
|
USER_CREATED: "user-created",
|
|
6481
6468
|
USER_UPDATED: "user-updated",
|
|
@@ -6487,50 +6474,50 @@ var TriggerEvent = {
|
|
|
6487
6474
|
CHANGE_PHONE_NUMBER: "change-phone-number",
|
|
6488
6475
|
CHANGE_EMAIL_ADDRESS: "change-email-address"
|
|
6489
6476
|
};
|
|
6490
|
-
var Recipient =
|
|
6477
|
+
var Recipient = import_zod37.z.object({
|
|
6491
6478
|
name: NameFieldValue.optional(),
|
|
6492
|
-
mobile:
|
|
6493
|
-
email:
|
|
6494
|
-
bcc:
|
|
6479
|
+
mobile: import_zod37.z.string().optional(),
|
|
6480
|
+
email: import_zod37.z.string().optional(),
|
|
6481
|
+
bcc: import_zod37.z.array(import_zod37.z.string()).optional()
|
|
6495
6482
|
});
|
|
6496
|
-
var BasePayload =
|
|
6483
|
+
var BasePayload = import_zod37.z.object({
|
|
6497
6484
|
recipient: Recipient
|
|
6498
6485
|
});
|
|
6499
6486
|
var TriggerPayload = {
|
|
6500
6487
|
[TriggerEvent.USER_CREATED]: BasePayload.extend({
|
|
6501
|
-
username:
|
|
6502
|
-
temporaryPassword:
|
|
6488
|
+
username: import_zod37.z.string(),
|
|
6489
|
+
temporaryPassword: import_zod37.z.string()
|
|
6503
6490
|
}),
|
|
6504
6491
|
[TriggerEvent.USER_UPDATED]: BasePayload.extend({
|
|
6505
|
-
oldUsername:
|
|
6506
|
-
newUsername:
|
|
6492
|
+
oldUsername: import_zod37.z.string(),
|
|
6493
|
+
newUsername: import_zod37.z.string()
|
|
6507
6494
|
}),
|
|
6508
6495
|
[TriggerEvent.USERNAME_REMINDER]: BasePayload.extend({
|
|
6509
|
-
username:
|
|
6496
|
+
username: import_zod37.z.string()
|
|
6510
6497
|
}),
|
|
6511
6498
|
[TriggerEvent.RESET_PASSWORD]: BasePayload.extend({
|
|
6512
|
-
code:
|
|
6499
|
+
code: import_zod37.z.string()
|
|
6513
6500
|
}),
|
|
6514
6501
|
[TriggerEvent.RESET_PASSWORD_BY_ADMIN]: BasePayload.extend({
|
|
6515
|
-
temporaryPassword:
|
|
6516
|
-
admin:
|
|
6517
|
-
id:
|
|
6502
|
+
temporaryPassword: import_zod37.z.string(),
|
|
6503
|
+
admin: import_zod37.z.object({
|
|
6504
|
+
id: import_zod37.z.string(),
|
|
6518
6505
|
name: NameFieldValue,
|
|
6519
|
-
role:
|
|
6506
|
+
role: import_zod37.z.string()
|
|
6520
6507
|
})
|
|
6521
6508
|
}),
|
|
6522
6509
|
[TriggerEvent.TWO_FA]: BasePayload.extend({
|
|
6523
|
-
code:
|
|
6510
|
+
code: import_zod37.z.string()
|
|
6524
6511
|
}),
|
|
6525
6512
|
[TriggerEvent.ALL_USER_NOTIFICATION]: BasePayload.extend({
|
|
6526
|
-
subject:
|
|
6527
|
-
body:
|
|
6513
|
+
subject: import_zod37.z.string(),
|
|
6514
|
+
body: import_zod37.z.string()
|
|
6528
6515
|
}),
|
|
6529
6516
|
[TriggerEvent.CHANGE_PHONE_NUMBER]: BasePayload.extend({
|
|
6530
|
-
code:
|
|
6517
|
+
code: import_zod37.z.string()
|
|
6531
6518
|
}),
|
|
6532
6519
|
[TriggerEvent.CHANGE_EMAIL_ADDRESS]: BasePayload.extend({
|
|
6533
|
-
code:
|
|
6520
|
+
code: import_zod37.z.string()
|
|
6534
6521
|
})
|
|
6535
6522
|
};
|
|
6536
6523
|
async function triggerUserEventNotification({
|
|
@@ -6552,6 +6539,3 @@ function parseUserEventTrigger(event2, body) {
|
|
|
6552
6539
|
const schema = TriggerPayload[event2];
|
|
6553
6540
|
return schema.parse(body);
|
|
6554
6541
|
}
|
|
6555
|
-
|
|
6556
|
-
// src/notification/index.ts
|
|
6557
|
-
z40.globalRegistry.clear();
|