@opencrvs/toolkit 1.9.3-rc.da977ad → 1.9.3-rc.e47111c
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 +2428 -28200
- 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 +1547 -23121
- package/dist/commons/events/ActionDocument.d.ts +1849 -840
- package/dist/commons/events/ActionInput.d.ts +1066 -290
- package/dist/commons/events/ActionType.d.ts +8 -91
- package/dist/commons/events/AdvancedSearchConfig.d.ts +1244 -222
- package/dist/commons/events/CompositeFieldValue.d.ts +198 -25
- package/dist/commons/events/Conditional.d.ts +38 -26
- package/dist/commons/events/Constants.d.ts +1 -1
- package/dist/commons/events/CountryConfigQueryInput.d.ts +4169 -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 -72
- package/dist/commons/events/DynamicFieldValue.d.ts +91 -7
- package/dist/commons/events/EventConfig.d.ts +2122 -18321
- package/dist/commons/events/EventConfigInput.d.ts +1 -1
- package/dist/commons/events/EventDocument.d.ts +1326 -336
- 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 +12051 -4164
- package/dist/commons/events/FieldType.d.ts +5 -9
- package/dist/commons/events/FieldTypeMapping.d.ts +896 -172
- package/dist/commons/events/FieldValue.d.ts +405 -84
- package/dist/commons/events/FormConfig.d.ts +721 -12876
- package/dist/commons/events/PageConfig.d.ts +319 -8604
- 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 -1619
- package/dist/commons/events/deduplication.d.ts +3 -3
- package/dist/commons/events/defineConfig.d.ts +163 -25171
- 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 +1 -3
- 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 +110 -142
- package/dist/commons/events/test.utils.d.ts +6 -23
- package/dist/commons/events/transactions.d.ts +1 -1
- package/dist/commons/events/utils.d.ts +385 -50384
- 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 +1748 -1811
- package/dist/notification/index.d.ts.map +1 -1
- package/dist/notification/index.js +1662 -1496
- package/dist/scopes/index.d.ts +138 -138
- package/dist/scopes/index.d.ts.map +1 -1
- package/dist/scopes/index.js +93 -123
- 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",
|
|
@@ -79,7 +80,6 @@ var ActionType = {
|
|
|
79
80
|
DECLARE: "DECLARE",
|
|
80
81
|
VALIDATE: "VALIDATE",
|
|
81
82
|
REGISTER: "REGISTER",
|
|
82
|
-
EDIT: "EDIT",
|
|
83
83
|
// Declaration system actions. Non-configurable.
|
|
84
84
|
DUPLICATE_DETECTED: "DUPLICATE_DETECTED",
|
|
85
85
|
REJECT: "REJECT",
|
|
@@ -95,14 +95,11 @@ var ActionType = {
|
|
|
95
95
|
// General actions
|
|
96
96
|
READ: "READ",
|
|
97
97
|
ASSIGN: "ASSIGN",
|
|
98
|
-
UNASSIGN: "UNASSIGN"
|
|
99
|
-
// Custom action
|
|
100
|
-
CUSTOM: "CUSTOM"
|
|
98
|
+
UNASSIGN: "UNASSIGN"
|
|
101
99
|
};
|
|
102
100
|
var ConfirmableActions = [
|
|
103
101
|
ActionType.NOTIFY,
|
|
104
102
|
ActionType.DECLARE,
|
|
105
|
-
ActionType.EDIT,
|
|
106
103
|
ActionType.VALIDATE,
|
|
107
104
|
ActionType.REGISTER,
|
|
108
105
|
ActionType.REJECT,
|
|
@@ -110,15 +107,13 @@ var ConfirmableActions = [
|
|
|
110
107
|
ActionType.PRINT_CERTIFICATE,
|
|
111
108
|
ActionType.REQUEST_CORRECTION,
|
|
112
109
|
ActionType.APPROVE_CORRECTION,
|
|
113
|
-
ActionType.REJECT_CORRECTION
|
|
114
|
-
ActionType.CUSTOM
|
|
110
|
+
ActionType.REJECT_CORRECTION
|
|
115
111
|
];
|
|
116
|
-
var ActionTypes =
|
|
112
|
+
var ActionTypes = import_zod2.z.enum([
|
|
117
113
|
"DELETE",
|
|
118
114
|
"CREATE",
|
|
119
115
|
"NOTIFY",
|
|
120
116
|
"DECLARE",
|
|
121
|
-
"EDIT",
|
|
122
117
|
"VALIDATE",
|
|
123
118
|
"REGISTER",
|
|
124
119
|
"DUPLICATE_DETECTED",
|
|
@@ -132,15 +127,13 @@ var ActionTypes = z2.enum([
|
|
|
132
127
|
"APPROVE_CORRECTION",
|
|
133
128
|
"READ",
|
|
134
129
|
"ASSIGN",
|
|
135
|
-
"UNASSIGN"
|
|
136
|
-
"CUSTOM"
|
|
130
|
+
"UNASSIGN"
|
|
137
131
|
]);
|
|
138
132
|
var ClientSpecificAction = {
|
|
139
133
|
REVIEW_CORRECTION_REQUEST: "REVIEW_CORRECTION_REQUEST"
|
|
140
134
|
};
|
|
141
135
|
var declarationActionValues = [
|
|
142
136
|
ActionTypes.enum.DECLARE,
|
|
143
|
-
ActionTypes.enum.EDIT,
|
|
144
137
|
ActionTypes.enum.VALIDATE,
|
|
145
138
|
ActionTypes.enum.REGISTER,
|
|
146
139
|
ActionTypes.enum.NOTIFY,
|
|
@@ -162,14 +155,13 @@ var writeActions = ActionTypes.exclude([
|
|
|
162
155
|
ActionType.UNASSIGN
|
|
163
156
|
]);
|
|
164
157
|
var workqueueActions = ActionTypes.exclude([
|
|
165
|
-
ActionType.READ,
|
|
166
158
|
ActionType.CREATE,
|
|
167
159
|
ActionType.NOTIFY,
|
|
168
160
|
ActionType.DUPLICATE_DETECTED,
|
|
161
|
+
ActionType.REJECT,
|
|
169
162
|
ActionType.MARK_AS_NOT_DUPLICATE,
|
|
170
163
|
ActionType.REJECT_CORRECTION,
|
|
171
|
-
ActionType.APPROVE_CORRECTION
|
|
172
|
-
ActionType.CUSTOM
|
|
164
|
+
ActionType.APPROVE_CORRECTION
|
|
173
165
|
]);
|
|
174
166
|
var META_ACTIONS = [
|
|
175
167
|
ActionType.ASSIGN,
|
|
@@ -178,57 +170,59 @@ var META_ACTIONS = [
|
|
|
178
170
|
];
|
|
179
171
|
|
|
180
172
|
// ../commons/src/events/FieldConfig.ts
|
|
181
|
-
var
|
|
173
|
+
var import_zod15 = require("zod");
|
|
182
174
|
|
|
183
175
|
// ../commons/src/events/Conditional.ts
|
|
184
|
-
var
|
|
185
|
-
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({
|
|
186
180
|
description: "JSON schema conditional configuration",
|
|
187
|
-
|
|
181
|
+
ref: "Conditional"
|
|
188
182
|
});
|
|
189
183
|
var ConditionalType = {
|
|
190
184
|
SHOW: "SHOW",
|
|
191
185
|
ENABLE: "ENABLE",
|
|
192
186
|
DISPLAY_ON_REVIEW: "DISPLAY_ON_REVIEW"
|
|
193
187
|
};
|
|
194
|
-
var ShowConditional =
|
|
195
|
-
type:
|
|
188
|
+
var ShowConditional = import_zod3.z.object({
|
|
189
|
+
type: import_zod3.z.literal(ConditionalType.SHOW),
|
|
196
190
|
conditional: Conditional
|
|
197
191
|
}).describe(
|
|
198
192
|
"If 'SHOW' conditional is defined, the component is shown to the user only if the condition is met"
|
|
199
193
|
);
|
|
200
|
-
var EnableConditional =
|
|
201
|
-
type:
|
|
194
|
+
var EnableConditional = import_zod3.z.object({
|
|
195
|
+
type: import_zod3.z.literal(ConditionalType.ENABLE),
|
|
202
196
|
conditional: Conditional
|
|
203
197
|
}).describe(
|
|
204
198
|
"If 'ENABLE' conditional is defined, the component is enabled only if the condition is met"
|
|
205
199
|
);
|
|
206
|
-
var ActionConditional =
|
|
200
|
+
var ActionConditional = import_zod3.z.discriminatedUnion("type", [
|
|
207
201
|
// Action can be shown / hidden
|
|
208
202
|
ShowConditional,
|
|
209
203
|
// Action can be shown to the user in the list but as disabled
|
|
210
204
|
EnableConditional
|
|
211
205
|
]);
|
|
212
|
-
var DisplayOnReviewConditional =
|
|
213
|
-
type:
|
|
206
|
+
var DisplayOnReviewConditional = import_zod3.z.object({
|
|
207
|
+
type: import_zod3.z.literal(ConditionalType.DISPLAY_ON_REVIEW),
|
|
214
208
|
conditional: Conditional
|
|
215
209
|
}).describe(
|
|
216
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."
|
|
217
211
|
);
|
|
218
|
-
var FieldConditional =
|
|
212
|
+
var FieldConditional = import_zod3.z.discriminatedUnion("type", [
|
|
219
213
|
// Field input can be shown / hidden
|
|
220
214
|
ShowConditional,
|
|
221
215
|
// Field input can be shown to the user but as disabled
|
|
222
216
|
EnableConditional,
|
|
223
217
|
// Field output can be shown / hidden on the review page
|
|
224
218
|
DisplayOnReviewConditional
|
|
225
|
-
]).
|
|
219
|
+
]).openapi({
|
|
226
220
|
description: "Field conditional configuration",
|
|
227
|
-
|
|
221
|
+
ref: "FieldConditional"
|
|
228
222
|
});
|
|
229
223
|
|
|
230
224
|
// ../commons/src/events/FieldType.ts
|
|
231
|
-
var
|
|
225
|
+
var import_zod4 = require("zod");
|
|
232
226
|
var FieldType = {
|
|
233
227
|
NAME: "NAME",
|
|
234
228
|
PHONE: "PHONE",
|
|
@@ -236,6 +230,7 @@ var FieldType = {
|
|
|
236
230
|
ADDRESS: "ADDRESS",
|
|
237
231
|
TEXT: "TEXT",
|
|
238
232
|
NUMBER: "NUMBER",
|
|
233
|
+
NUMBER_WITH_UNIT: "NUMBER_WITH_UNIT",
|
|
239
234
|
TEXTAREA: "TEXTAREA",
|
|
240
235
|
EMAIL: "EMAIL",
|
|
241
236
|
DATE: "DATE",
|
|
@@ -270,10 +265,9 @@ var FieldType = {
|
|
|
270
265
|
QUERY_PARAM_READER: "QUERY_PARAM_READER",
|
|
271
266
|
QR_READER: "QR_READER",
|
|
272
267
|
ID_READER: "ID_READER",
|
|
273
|
-
LOADER: "LOADER"
|
|
274
|
-
ALPHA_HIDDEN: "ALPHA_HIDDEN"
|
|
268
|
+
LOADER: "LOADER"
|
|
275
269
|
};
|
|
276
|
-
var FileFieldType =
|
|
270
|
+
var FileFieldType = import_zod4.z.enum([
|
|
277
271
|
FieldType.FILE,
|
|
278
272
|
FieldType.FILE_WITH_OPTIONS,
|
|
279
273
|
FieldType.SIGNATURE
|
|
@@ -296,146 +290,154 @@ var FieldTypesToHideInReview = [
|
|
|
296
290
|
FieldType.LOADER,
|
|
297
291
|
FieldType.HTTP,
|
|
298
292
|
FieldType.QUERY_PARAM_READER,
|
|
299
|
-
FieldType.DATA
|
|
300
|
-
FieldType.ALPHA_HIDDEN
|
|
293
|
+
FieldType.DATA
|
|
301
294
|
];
|
|
302
295
|
|
|
303
296
|
// ../commons/src/events/FieldValue.ts
|
|
304
|
-
var
|
|
297
|
+
var import_zod7 = require("zod");
|
|
305
298
|
|
|
306
299
|
// ../commons/src/documents.ts
|
|
307
|
-
var
|
|
308
|
-
var
|
|
300
|
+
var import_zod5 = require("zod");
|
|
301
|
+
var import_zod_openapi3 = require("zod-openapi");
|
|
302
|
+
(0, import_zod_openapi3.extendZodWithOpenApi)(import_zod5.z);
|
|
303
|
+
var FullDocumentUrl = import_zod5.z.string().brand("FullDocumentUrl").describe(
|
|
309
304
|
"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"
|
|
310
305
|
);
|
|
311
|
-
var FullDocumentPath =
|
|
306
|
+
var FullDocumentPath = import_zod5.z.string().transform((val) => val.startsWith("/") ? val : `/${val}`).openapi({ effectType: "input", type: "string" }).describe(
|
|
312
307
|
"A full absolute path with bucket name, starting from the root of the S3 server, /bucket-name/document-id.jpg"
|
|
313
308
|
);
|
|
314
|
-
var DocumentPath =
|
|
309
|
+
var DocumentPath = import_zod5.z.string().brand("DocumentPath").describe(
|
|
315
310
|
"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"
|
|
316
311
|
);
|
|
317
312
|
|
|
318
313
|
// ../commons/src/events/CompositeFieldValue.ts
|
|
319
|
-
var
|
|
314
|
+
var import_zod6 = require("zod");
|
|
320
315
|
var AddressType = {
|
|
321
316
|
DOMESTIC: "DOMESTIC",
|
|
322
317
|
INTERNATIONAL: "INTERNATIONAL"
|
|
323
318
|
};
|
|
324
|
-
var FileFieldValue =
|
|
319
|
+
var FileFieldValue = import_zod6.z.object({
|
|
325
320
|
path: FullDocumentPath,
|
|
326
|
-
originalFilename:
|
|
327
|
-
type:
|
|
321
|
+
originalFilename: import_zod6.z.string(),
|
|
322
|
+
type: import_zod6.z.string()
|
|
328
323
|
});
|
|
329
|
-
var NameFieldValue =
|
|
330
|
-
firstname:
|
|
331
|
-
surname:
|
|
332
|
-
middlename:
|
|
324
|
+
var NameFieldValue = import_zod6.z.object({
|
|
325
|
+
firstname: import_zod6.z.string(),
|
|
326
|
+
surname: import_zod6.z.string(),
|
|
327
|
+
middlename: import_zod6.z.string().optional()
|
|
333
328
|
});
|
|
334
|
-
var NameFieldUpdateValue =
|
|
335
|
-
firstname:
|
|
336
|
-
surname:
|
|
337
|
-
middlename:
|
|
338
|
-
}).or(
|
|
339
|
-
var StreetLevelDetailsValue =
|
|
340
|
-
var StreetLevelDetailsUpdateValue =
|
|
341
|
-
var BaseAddressFieldValue =
|
|
342
|
-
country:
|
|
329
|
+
var NameFieldUpdateValue = import_zod6.z.object({
|
|
330
|
+
firstname: import_zod6.z.string().nullish(),
|
|
331
|
+
surname: import_zod6.z.string().nullish(),
|
|
332
|
+
middlename: import_zod6.z.string().nullish()
|
|
333
|
+
}).or(import_zod6.z.null()).or(import_zod6.z.undefined());
|
|
334
|
+
var StreetLevelDetailsValue = import_zod6.z.record(import_zod6.z.string(), import_zod6.z.string()).optional();
|
|
335
|
+
var StreetLevelDetailsUpdateValue = import_zod6.z.record(import_zod6.z.string(), import_zod6.z.string().nullable()).nullish();
|
|
336
|
+
var BaseAddressFieldValue = import_zod6.z.object({
|
|
337
|
+
country: import_zod6.z.string(),
|
|
343
338
|
streetLevelDetails: StreetLevelDetailsValue
|
|
344
339
|
});
|
|
345
|
-
var BaseAddressFieldUpdateValue =
|
|
346
|
-
country:
|
|
340
|
+
var BaseAddressFieldUpdateValue = import_zod6.z.object({
|
|
341
|
+
country: import_zod6.z.string().nullish(),
|
|
347
342
|
streetLevelDetails: StreetLevelDetailsUpdateValue
|
|
348
343
|
});
|
|
349
344
|
var DomesticAddressFieldValue = BaseAddressFieldValue.extend({
|
|
350
|
-
addressType:
|
|
351
|
-
administrativeArea:
|
|
345
|
+
addressType: import_zod6.z.literal(AddressType.DOMESTIC),
|
|
346
|
+
administrativeArea: import_zod6.z.string().uuid()
|
|
352
347
|
});
|
|
353
348
|
var InternationalAddressFieldValue = BaseAddressFieldValue.extend({
|
|
354
|
-
addressType:
|
|
349
|
+
addressType: import_zod6.z.literal(AddressType.INTERNATIONAL)
|
|
355
350
|
});
|
|
356
|
-
var AddressFieldValue =
|
|
351
|
+
var AddressFieldValue = import_zod6.z.discriminatedUnion("addressType", [
|
|
357
352
|
DomesticAddressFieldValue,
|
|
358
353
|
InternationalAddressFieldValue
|
|
359
354
|
]);
|
|
360
355
|
var DomesticAddressUpdateFieldValue = BaseAddressFieldUpdateValue.extend({
|
|
361
|
-
addressType:
|
|
362
|
-
administrativeArea:
|
|
356
|
+
addressType: import_zod6.z.literal(AddressType.DOMESTIC),
|
|
357
|
+
administrativeArea: import_zod6.z.string().uuid().nullish()
|
|
363
358
|
/* Leaf level admin structure */
|
|
364
359
|
});
|
|
365
360
|
var InternationalAddressUpdateFieldValue = BaseAddressFieldUpdateValue.extend(
|
|
366
361
|
{
|
|
367
|
-
addressType:
|
|
362
|
+
addressType: import_zod6.z.literal(AddressType.INTERNATIONAL)
|
|
368
363
|
}
|
|
369
364
|
);
|
|
370
|
-
var AddressFieldUpdateValue =
|
|
365
|
+
var AddressFieldUpdateValue = import_zod6.z.discriminatedUnion("addressType", [
|
|
371
366
|
DomesticAddressUpdateFieldValue,
|
|
372
367
|
InternationalAddressUpdateFieldValue
|
|
373
368
|
]).nullish();
|
|
374
|
-
var FileFieldValueWithOption =
|
|
369
|
+
var FileFieldValueWithOption = import_zod6.z.object({
|
|
375
370
|
path: FullDocumentPath,
|
|
376
|
-
originalFilename:
|
|
377
|
-
type:
|
|
378
|
-
option:
|
|
371
|
+
originalFilename: import_zod6.z.string(),
|
|
372
|
+
type: import_zod6.z.string(),
|
|
373
|
+
option: import_zod6.z.string()
|
|
379
374
|
});
|
|
380
|
-
var FileFieldWithOptionValue =
|
|
381
|
-
var HttpFieldValue =
|
|
382
|
-
loading:
|
|
383
|
-
error:
|
|
384
|
-
data:
|
|
375
|
+
var FileFieldWithOptionValue = import_zod6.z.array(FileFieldValueWithOption);
|
|
376
|
+
var HttpFieldValue = import_zod6.z.object({
|
|
377
|
+
loading: import_zod6.z.boolean(),
|
|
378
|
+
error: import_zod6.z.object({ statusCode: import_zod6.z.number(), message: import_zod6.z.string() }).nullish(),
|
|
379
|
+
data: import_zod6.z.any()
|
|
385
380
|
});
|
|
386
|
-
var HttpFieldUpdateValue =
|
|
387
|
-
loading:
|
|
388
|
-
error:
|
|
389
|
-
data:
|
|
390
|
-
}).or(
|
|
391
|
-
var QueryParamReaderFieldValue =
|
|
392
|
-
data:
|
|
381
|
+
var HttpFieldUpdateValue = import_zod6.z.object({
|
|
382
|
+
loading: import_zod6.z.boolean().nullish(),
|
|
383
|
+
error: import_zod6.z.object({ statusCode: import_zod6.z.number(), message: import_zod6.z.string() }).nullish(),
|
|
384
|
+
data: import_zod6.z.any().nullish()
|
|
385
|
+
}).or(import_zod6.z.null()).or(import_zod6.z.undefined());
|
|
386
|
+
var QueryParamReaderFieldValue = import_zod6.z.object({
|
|
387
|
+
data: import_zod6.z.record(import_zod6.z.string(), import_zod6.z.string())
|
|
393
388
|
}).nullish();
|
|
394
|
-
var QueryParamReaderFieldUpdateValue =
|
|
395
|
-
data:
|
|
389
|
+
var QueryParamReaderFieldUpdateValue = import_zod6.z.object({
|
|
390
|
+
data: import_zod6.z.record(import_zod6.z.string(), import_zod6.z.string())
|
|
396
391
|
});
|
|
397
|
-
var ReadDataValue =
|
|
398
|
-
data:
|
|
392
|
+
var ReadDataValue = import_zod6.z.object({
|
|
393
|
+
data: import_zod6.z.any()
|
|
399
394
|
});
|
|
400
395
|
var QrReaderFieldValue = ReadDataValue;
|
|
401
396
|
var IdReaderFieldValue = ReadDataValue;
|
|
397
|
+
var NumberWithUnitFieldValue = import_zod6.z.object({
|
|
398
|
+
numericValue: import_zod6.z.number(),
|
|
399
|
+
unit: import_zod6.z.string()
|
|
400
|
+
});
|
|
401
|
+
var NumberWithUnitFieldUpdateValue = import_zod6.z.object({
|
|
402
|
+
numericValue: import_zod6.z.number().optional(),
|
|
403
|
+
unit: import_zod6.z.string().optional()
|
|
404
|
+
});
|
|
402
405
|
|
|
403
406
|
// ../commons/src/events/FieldValue.ts
|
|
404
|
-
var TextValue =
|
|
405
|
-
var HiddenFieldValue = z7.string();
|
|
407
|
+
var TextValue = import_zod7.z.string();
|
|
406
408
|
var NonEmptyTextValue = TextValue.min(1);
|
|
407
|
-
var DateValue =
|
|
408
|
-
var AgeValue =
|
|
409
|
-
age:
|
|
410
|
-
asOfDateRef:
|
|
409
|
+
var DateValue = import_zod7.z.string().date().describe("Date in the format YYYY-MM-DD");
|
|
410
|
+
var AgeValue = import_zod7.z.object({
|
|
411
|
+
age: import_zod7.z.number(),
|
|
412
|
+
asOfDateRef: import_zod7.z.string()
|
|
411
413
|
});
|
|
412
414
|
var AgeUpdateValue = AgeValue.optional().nullable();
|
|
413
|
-
var TimeValue =
|
|
414
|
-
var DatetimeValue =
|
|
415
|
-
var SelectDateRangeValue =
|
|
415
|
+
var TimeValue = import_zod7.z.string().regex(/^([01][0-9]|2[0-3]):[0-5][0-9]$/);
|
|
416
|
+
var DatetimeValue = import_zod7.z.string().datetime();
|
|
417
|
+
var SelectDateRangeValue = import_zod7.z.enum([
|
|
416
418
|
"last7Days",
|
|
417
419
|
"last30Days",
|
|
418
420
|
"last90Days",
|
|
419
421
|
"last365Days"
|
|
420
422
|
]);
|
|
421
|
-
var DateRangeFieldValue =
|
|
423
|
+
var DateRangeFieldValue = import_zod7.z.object({
|
|
422
424
|
start: DateValue,
|
|
423
425
|
end: DateValue
|
|
424
426
|
}).or(DateValue).describe(
|
|
425
427
|
"Date range with start and end dates in the format YYYY-MM-DD. Inclusive start, exclusive end."
|
|
426
428
|
);
|
|
427
|
-
var EmailValue =
|
|
428
|
-
var CheckboxFieldValue =
|
|
429
|
-
var NumberFieldValue =
|
|
430
|
-
var SignatureFieldValue =
|
|
431
|
-
var ButtonFieldValue =
|
|
432
|
-
var VerificationStatusValue =
|
|
429
|
+
var EmailValue = import_zod7.z.string().email();
|
|
430
|
+
var CheckboxFieldValue = import_zod7.z.boolean();
|
|
431
|
+
var NumberFieldValue = import_zod7.z.number();
|
|
432
|
+
var SignatureFieldValue = import_zod7.z.string();
|
|
433
|
+
var ButtonFieldValue = import_zod7.z.number();
|
|
434
|
+
var VerificationStatusValue = import_zod7.z.enum([
|
|
433
435
|
"verified",
|
|
434
436
|
"authenticated",
|
|
435
437
|
"failed",
|
|
436
438
|
"pending"
|
|
437
439
|
]);
|
|
438
|
-
var FieldValuesWithoutDataField =
|
|
440
|
+
var FieldValuesWithoutDataField = import_zod7.z.union([
|
|
439
441
|
AddressFieldValue,
|
|
440
442
|
TextValue,
|
|
441
443
|
DateValue,
|
|
@@ -445,6 +447,8 @@ var FieldValuesWithoutDataField = z7.union([
|
|
|
445
447
|
SelectDateRangeValue,
|
|
446
448
|
CheckboxFieldValue,
|
|
447
449
|
NumberFieldValue,
|
|
450
|
+
NumberWithUnitFieldValue,
|
|
451
|
+
NumberWithUnitFieldUpdateValue,
|
|
448
452
|
FileFieldValue,
|
|
449
453
|
FileFieldWithOptionValue,
|
|
450
454
|
NameFieldValue,
|
|
@@ -456,10 +460,10 @@ var FieldValuesWithoutDataField = z7.union([
|
|
|
456
460
|
QrReaderFieldValue,
|
|
457
461
|
IdReaderFieldValue
|
|
458
462
|
]);
|
|
459
|
-
var DataFieldValue =
|
|
460
|
-
data:
|
|
463
|
+
var DataFieldValue = import_zod7.z.object({
|
|
464
|
+
data: import_zod7.z.record(import_zod7.z.string(), FieldValuesWithoutDataField)
|
|
461
465
|
}).nullish();
|
|
462
|
-
var FieldValue =
|
|
466
|
+
var FieldValue = import_zod7.z.union([
|
|
463
467
|
FieldValuesWithoutDataField,
|
|
464
468
|
DataFieldValue
|
|
465
469
|
]);
|
|
@@ -474,43 +478,28 @@ var PRIORITY_ORDER = [
|
|
|
474
478
|
"SelectDateRangeValue",
|
|
475
479
|
"CheckboxFieldValue",
|
|
476
480
|
"NumberFieldValue",
|
|
481
|
+
"NumberWithUnitFieldUpdateValue",
|
|
477
482
|
"FileFieldValue",
|
|
478
483
|
"FileFieldWithOptionValue",
|
|
479
484
|
"DataFieldValue"
|
|
480
485
|
];
|
|
481
486
|
function schemaPriority(schema) {
|
|
482
|
-
const name = schema.description;
|
|
483
|
-
if (!name) {
|
|
484
|
-
return 9999;
|
|
485
|
-
}
|
|
487
|
+
const name = schema._def?.description;
|
|
486
488
|
const idx = PRIORITY_ORDER.indexOf(name);
|
|
487
489
|
return idx === -1 ? 9999 : idx;
|
|
488
490
|
}
|
|
489
491
|
function safeUnion(schemas) {
|
|
490
|
-
return
|
|
492
|
+
return import_zod7.z.custom((val) => {
|
|
491
493
|
const successful = schemas.filter((s) => s.safeParse(val).success);
|
|
492
494
|
if (successful.length === 1) {
|
|
493
|
-
return;
|
|
495
|
+
return true;
|
|
494
496
|
}
|
|
495
497
|
if (successful.length === 0) {
|
|
496
|
-
|
|
497
|
-
code: "invalid_type",
|
|
498
|
-
expected: "custom",
|
|
499
|
-
message: "Value does not match any schema"
|
|
500
|
-
});
|
|
501
|
-
return;
|
|
498
|
+
return false;
|
|
502
499
|
}
|
|
503
500
|
successful.sort((a, b) => schemaPriority(a) - schemaPriority(b));
|
|
504
501
|
const best = successful[0];
|
|
505
|
-
|
|
506
|
-
ctx.addIssue({
|
|
507
|
-
expected: "custom",
|
|
508
|
-
code: "invalid_type",
|
|
509
|
-
message: "Value did not match the best schema"
|
|
510
|
-
});
|
|
511
|
-
}
|
|
512
|
-
}).meta({
|
|
513
|
-
description: "Value that matches exactly one of the possible schema types (TextValue, DateValue, DateRangeFieldValue). The best matching schema is chosen by priority."
|
|
502
|
+
return best.safeParse(val).success;
|
|
514
503
|
});
|
|
515
504
|
}
|
|
516
505
|
var FieldUpdateValue = safeUnion([
|
|
@@ -523,27 +512,30 @@ var FieldUpdateValue = safeUnion([
|
|
|
523
512
|
SelectDateRangeValue.describe("SelectDateRangeValue"),
|
|
524
513
|
CheckboxFieldValue.describe("CheckboxFieldValue"),
|
|
525
514
|
NumberFieldValue.describe("NumberFieldValue"),
|
|
515
|
+
NumberWithUnitFieldUpdateValue.describe("NumberWithUnitFieldUpdateValue"),
|
|
526
516
|
FileFieldValue.describe("FileFieldValue"),
|
|
527
517
|
FileFieldWithOptionValue.describe("FileFieldWithOptionValue"),
|
|
528
518
|
DataFieldValue.describe("DataFieldValue"),
|
|
529
519
|
NameFieldUpdateValue.describe("NameFieldUpdateValue"),
|
|
530
520
|
HttpFieldUpdateValue.describe("HttpFieldUpdateValue"),
|
|
531
|
-
QueryParamReaderFieldUpdateValue.describe("QueryParamReaderFieldUpdateValue")
|
|
532
|
-
HiddenFieldValue.describe("HiddenFieldValue")
|
|
521
|
+
QueryParamReaderFieldUpdateValue.describe("QueryParamReaderFieldUpdateValue")
|
|
533
522
|
]);
|
|
534
523
|
|
|
524
|
+
// ../commons/src/events/FieldConfig.ts
|
|
525
|
+
var import_zod_openapi6 = require("zod-openapi");
|
|
526
|
+
|
|
535
527
|
// ../commons/src/uuid.ts
|
|
536
528
|
var import_uuid = require("uuid");
|
|
537
|
-
var
|
|
538
|
-
var UUID =
|
|
529
|
+
var import_zod8 = require("zod");
|
|
530
|
+
var UUID = import_zod8.z.string().uuid().brand("UUID");
|
|
539
531
|
function getUUID() {
|
|
540
532
|
return (0, import_uuid.v4)();
|
|
541
533
|
}
|
|
542
534
|
|
|
543
535
|
// ../commons/src/events/serializers/user/serializer.ts
|
|
544
|
-
var
|
|
545
|
-
var SerializedUserField =
|
|
546
|
-
$userField:
|
|
536
|
+
var import_zod9 = require("zod");
|
|
537
|
+
var SerializedUserField = import_zod9.z.object({
|
|
538
|
+
$userField: import_zod9.z.enum([
|
|
547
539
|
"id",
|
|
548
540
|
"name",
|
|
549
541
|
"role",
|
|
@@ -551,7 +543,7 @@ var SerializedUserField = z9.object({
|
|
|
551
543
|
"avatar",
|
|
552
544
|
"primaryOfficeId"
|
|
553
545
|
]),
|
|
554
|
-
$location:
|
|
546
|
+
$location: import_zod9.z.string().optional()
|
|
555
547
|
});
|
|
556
548
|
function userSerializer(userField) {
|
|
557
549
|
return {
|
|
@@ -571,23 +563,24 @@ function userSerializer(userField) {
|
|
|
571
563
|
}
|
|
572
564
|
|
|
573
565
|
// ../commons/src/events/EventIndex.ts
|
|
574
|
-
var
|
|
566
|
+
var import_zod14 = require("zod");
|
|
575
567
|
|
|
576
568
|
// ../commons/src/events/EventMetadata.ts
|
|
577
|
-
var
|
|
569
|
+
var import_zod13 = require("zod");
|
|
578
570
|
|
|
579
571
|
// ../commons/src/events/ActionDocument.ts
|
|
580
|
-
var
|
|
572
|
+
var import_zod12 = require("zod");
|
|
573
|
+
var import_zod_openapi4 = require("zod-openapi");
|
|
581
574
|
|
|
582
575
|
// ../commons/src/events/CreatedAtLocation.ts
|
|
583
576
|
var CreatedAtLocation = UUID.nullish();
|
|
584
577
|
|
|
585
578
|
// ../commons/src/authentication.ts
|
|
586
579
|
var import_jwt_decode = __toESM(require("jwt-decode"));
|
|
587
|
-
var
|
|
580
|
+
var import_zod11 = require("zod");
|
|
588
581
|
|
|
589
582
|
// ../commons/src/scopes.ts
|
|
590
|
-
var
|
|
583
|
+
var import_zod10 = require("zod");
|
|
591
584
|
var SCOPES = {
|
|
592
585
|
// TODO v1.8 legacy scopes
|
|
593
586
|
BYPASSRATELIMIT: "bypassratelimit",
|
|
@@ -666,91 +659,91 @@ var SCOPES = {
|
|
|
666
659
|
// data seeding
|
|
667
660
|
USER_DATA_SEEDING: "user.data-seeding"
|
|
668
661
|
};
|
|
669
|
-
var LegacyScopes =
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
662
|
+
var LegacyScopes = import_zod10.z.union([
|
|
663
|
+
import_zod10.z.literal(SCOPES.BYPASSRATELIMIT),
|
|
664
|
+
import_zod10.z.literal(SCOPES.REGISTER),
|
|
665
|
+
import_zod10.z.literal(SCOPES.DEMO),
|
|
666
|
+
import_zod10.z.literal(SCOPES.CONFIG)
|
|
674
667
|
]);
|
|
675
|
-
var IntegrationScopes =
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
668
|
+
var IntegrationScopes = import_zod10.z.union([
|
|
669
|
+
import_zod10.z.literal(SCOPES.WEBHOOK),
|
|
670
|
+
import_zod10.z.literal(SCOPES.NATIONALID),
|
|
671
|
+
import_zod10.z.literal(SCOPES.NOTIFICATION_API),
|
|
672
|
+
import_zod10.z.literal(SCOPES.RECORDSEARCH)
|
|
680
673
|
]);
|
|
681
|
-
var InternalOperationsScopes =
|
|
682
|
-
|
|
683
|
-
|
|
674
|
+
var InternalOperationsScopes = import_zod10.z.union([
|
|
675
|
+
import_zod10.z.literal(SCOPES.RECORD_REINDEX),
|
|
676
|
+
import_zod10.z.literal(SCOPES.RECORD_IMPORT)
|
|
684
677
|
]);
|
|
685
|
-
var DeclareScopes =
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
678
|
+
var DeclareScopes = import_zod10.z.union([
|
|
679
|
+
import_zod10.z.literal(SCOPES.RECORD_DECLARE_BIRTH),
|
|
680
|
+
import_zod10.z.literal(SCOPES.RECORD_DECLARE_BIRTH_MY_JURISDICTION),
|
|
681
|
+
import_zod10.z.literal(SCOPES.RECORD_DECLARE_DEATH),
|
|
682
|
+
import_zod10.z.literal(SCOPES.RECORD_DECLARE_DEATH_MY_JURISDICTION),
|
|
683
|
+
import_zod10.z.literal(SCOPES.RECORD_DECLARE_MARRIAGE),
|
|
684
|
+
import_zod10.z.literal(SCOPES.RECORD_DECLARE_MARRIAGE_MY_JURISDICTION),
|
|
685
|
+
import_zod10.z.literal(SCOPES.RECORD_SUBMIT_INCOMPLETE),
|
|
686
|
+
import_zod10.z.literal(SCOPES.RECORD_SUBMIT_FOR_REVIEW)
|
|
694
687
|
]);
|
|
695
|
-
var UnassignScope =
|
|
696
|
-
var ValidateScopes =
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
688
|
+
var UnassignScope = import_zod10.z.literal(SCOPES.RECORD_UNASSIGN_OTHERS);
|
|
689
|
+
var ValidateScopes = import_zod10.z.union([
|
|
690
|
+
import_zod10.z.literal(SCOPES.RECORD_SUBMIT_FOR_APPROVAL),
|
|
691
|
+
import_zod10.z.literal(SCOPES.RECORD_SUBMIT_FOR_UPDATES),
|
|
692
|
+
import_zod10.z.literal(SCOPES.RECORD_DECLARATION_EDIT),
|
|
693
|
+
import_zod10.z.literal(SCOPES.RECORD_REVIEW_DUPLICATES),
|
|
694
|
+
import_zod10.z.literal(SCOPES.RECORD_DECLARATION_ARCHIVE),
|
|
695
|
+
import_zod10.z.literal(SCOPES.RECORD_DECLARATION_REINSTATE)
|
|
703
696
|
]);
|
|
704
|
-
var RegisterScope =
|
|
705
|
-
var CorrectionScopes =
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
697
|
+
var RegisterScope = import_zod10.z.literal(SCOPES.RECORD_REGISTER);
|
|
698
|
+
var CorrectionScopes = import_zod10.z.union([
|
|
699
|
+
import_zod10.z.literal(SCOPES.RECORD_REGISTRATION_REQUEST_CORRECTION),
|
|
700
|
+
import_zod10.z.literal(SCOPES.RECORD_REGISTRATION_CORRECT),
|
|
701
|
+
import_zod10.z.literal(SCOPES.RECORD_CONFIRM_REGISTRATION),
|
|
702
|
+
import_zod10.z.literal(SCOPES.RECORD_REJECT_REGISTRATION)
|
|
710
703
|
]);
|
|
711
|
-
var SearchScopes =
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
704
|
+
var SearchScopes = import_zod10.z.union([
|
|
705
|
+
import_zod10.z.literal(SCOPES.SEARCH_BIRTH_MY_JURISDICTION),
|
|
706
|
+
import_zod10.z.literal(SCOPES.SEARCH_BIRTH),
|
|
707
|
+
import_zod10.z.literal(SCOPES.SEARCH_DEATH_MY_JURISDICTION),
|
|
708
|
+
import_zod10.z.literal(SCOPES.SEARCH_DEATH),
|
|
709
|
+
import_zod10.z.literal(SCOPES.SEARCH_MARRIAGE_MY_JURISDICTION),
|
|
710
|
+
import_zod10.z.literal(SCOPES.SEARCH_MARRIAGE)
|
|
718
711
|
]);
|
|
719
|
-
var AuditScopes =
|
|
720
|
-
var PerformanceScopes =
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
712
|
+
var AuditScopes = import_zod10.z.literal(SCOPES.RECORD_READ);
|
|
713
|
+
var PerformanceScopes = import_zod10.z.union([
|
|
714
|
+
import_zod10.z.literal(SCOPES.PERFORMANCE_READ),
|
|
715
|
+
import_zod10.z.literal(SCOPES.PERFORMANCE_READ_DASHBOARDS),
|
|
716
|
+
import_zod10.z.literal(SCOPES.PERFORMANCE_EXPORT_VITAL_STATISTICS)
|
|
724
717
|
]);
|
|
725
|
-
var OrganisationScopes =
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
718
|
+
var OrganisationScopes = import_zod10.z.union([
|
|
719
|
+
import_zod10.z.literal(SCOPES.ORGANISATION_READ_LOCATIONS),
|
|
720
|
+
import_zod10.z.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_OFFICE),
|
|
721
|
+
import_zod10.z.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_JURISDICTION)
|
|
729
722
|
]);
|
|
730
|
-
var UserScopes =
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
723
|
+
var UserScopes = import_zod10.z.union([
|
|
724
|
+
import_zod10.z.literal(SCOPES.USER_READ),
|
|
725
|
+
import_zod10.z.literal(SCOPES.USER_READ_MY_OFFICE),
|
|
726
|
+
import_zod10.z.literal(SCOPES.USER_READ_MY_JURISDICTION),
|
|
727
|
+
import_zod10.z.literal(SCOPES.USER_READ_ONLY_MY_AUDIT),
|
|
728
|
+
import_zod10.z.literal(SCOPES.USER_CREATE),
|
|
729
|
+
import_zod10.z.literal(SCOPES.USER_CREATE_MY_JURISDICTION),
|
|
730
|
+
import_zod10.z.literal(SCOPES.USER_UPDATE),
|
|
731
|
+
import_zod10.z.literal(SCOPES.USER_UPDATE_MY_JURISDICTION)
|
|
739
732
|
]);
|
|
740
|
-
var ConfigScope =
|
|
741
|
-
var DataSeedingScope =
|
|
742
|
-
var LiteralScopes =
|
|
733
|
+
var ConfigScope = import_zod10.z.literal(SCOPES.CONFIG_UPDATE_ALL);
|
|
734
|
+
var DataSeedingScope = import_zod10.z.literal(SCOPES.USER_DATA_SEEDING);
|
|
735
|
+
var LiteralScopes = import_zod10.z.union([
|
|
743
736
|
LegacyScopes,
|
|
744
737
|
IntegrationScopes,
|
|
745
738
|
UnassignScope,
|
|
746
739
|
DeclareScopes,
|
|
747
740
|
ValidateScopes,
|
|
748
741
|
RegisterScope,
|
|
749
|
-
|
|
742
|
+
import_zod10.z.literal(SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES),
|
|
750
743
|
CorrectionScopes,
|
|
751
744
|
SearchScopes,
|
|
752
745
|
AuditScopes,
|
|
753
|
-
|
|
746
|
+
import_zod10.z.literal(SCOPES.PROFILE_ELECTRONIC_SIGNATURE),
|
|
754
747
|
PerformanceScopes,
|
|
755
748
|
OrganisationScopes,
|
|
756
749
|
UserScopes,
|
|
@@ -759,38 +752,37 @@ var LiteralScopes = z10.union([
|
|
|
759
752
|
InternalOperationsScopes
|
|
760
753
|
]);
|
|
761
754
|
var rawConfigurableScopeRegex = /^([a-zA-Z][a-zA-Z0-9.-]*(?:\.[a-zA-Z0-9.-]+)*)\[((?:\w+=[\w.-]+(?:\|[\w.-]+)*)(?:,[\w]+=[\w.-]+(?:\|[\w.-]+)*)*)\]$/;
|
|
762
|
-
var rawConfigurableScope =
|
|
763
|
-
var CreateUserScope =
|
|
764
|
-
type:
|
|
765
|
-
options:
|
|
766
|
-
role:
|
|
755
|
+
var rawConfigurableScope = import_zod10.z.string().regex(rawConfigurableScopeRegex);
|
|
756
|
+
var CreateUserScope = import_zod10.z.object({
|
|
757
|
+
type: import_zod10.z.literal("user.create"),
|
|
758
|
+
options: import_zod10.z.object({
|
|
759
|
+
role: import_zod10.z.array(import_zod10.z.string())
|
|
767
760
|
})
|
|
768
761
|
});
|
|
769
|
-
var EditUserScope =
|
|
770
|
-
type:
|
|
771
|
-
options:
|
|
772
|
-
role:
|
|
762
|
+
var EditUserScope = import_zod10.z.object({
|
|
763
|
+
type: import_zod10.z.literal("user.edit"),
|
|
764
|
+
options: import_zod10.z.object({
|
|
765
|
+
role: import_zod10.z.array(import_zod10.z.string())
|
|
773
766
|
})
|
|
774
767
|
});
|
|
775
|
-
var WorkqueueScope =
|
|
776
|
-
type:
|
|
777
|
-
options:
|
|
778
|
-
id:
|
|
768
|
+
var WorkqueueScope = import_zod10.z.object({
|
|
769
|
+
type: import_zod10.z.literal("workqueue"),
|
|
770
|
+
options: import_zod10.z.object({
|
|
771
|
+
id: import_zod10.z.array(import_zod10.z.string())
|
|
779
772
|
})
|
|
780
773
|
});
|
|
781
|
-
var SearchScope =
|
|
782
|
-
type:
|
|
783
|
-
options:
|
|
784
|
-
event:
|
|
785
|
-
access:
|
|
774
|
+
var SearchScope = import_zod10.z.object({
|
|
775
|
+
type: import_zod10.z.literal("search"),
|
|
776
|
+
options: import_zod10.z.object({
|
|
777
|
+
event: import_zod10.z.array(import_zod10.z.string()).length(1),
|
|
778
|
+
access: import_zod10.z.array(import_zod10.z.enum(["my-jurisdiction", "all"])).length(1)
|
|
786
779
|
})
|
|
787
780
|
});
|
|
788
|
-
var RecordScopeType =
|
|
781
|
+
var RecordScopeType = import_zod10.z.enum([
|
|
789
782
|
"record.create",
|
|
790
783
|
"record.read",
|
|
791
784
|
"record.declare",
|
|
792
785
|
"record.notify",
|
|
793
|
-
"record.declared.edit",
|
|
794
786
|
"record.declared.validate",
|
|
795
787
|
"record.declared.reject",
|
|
796
788
|
"record.declared.archive",
|
|
@@ -801,40 +793,27 @@ var RecordScopeType = z10.enum([
|
|
|
801
793
|
"record.registered.correct",
|
|
802
794
|
"record.unassign-others"
|
|
803
795
|
]);
|
|
804
|
-
var RecordScope =
|
|
796
|
+
var RecordScope = import_zod10.z.object({
|
|
805
797
|
type: RecordScopeType,
|
|
806
|
-
options:
|
|
807
|
-
event:
|
|
798
|
+
options: import_zod10.z.object({
|
|
799
|
+
event: import_zod10.z.array(import_zod10.z.string()).describe("Event type, e.g. birth, death")
|
|
808
800
|
})
|
|
809
801
|
}).describe(
|
|
810
802
|
"Scopes used to check user's permission to perform actions on a record."
|
|
811
803
|
);
|
|
812
|
-
var
|
|
813
|
-
type: z10.literal("record.custom-action"),
|
|
814
|
-
options: z10.object({
|
|
815
|
-
event: z10.array(z10.string()).describe("Allowed event type, e.g. birth, death"),
|
|
816
|
-
customActionType: z10.array(z10.string()).describe("Allowed custom action types")
|
|
817
|
-
})
|
|
818
|
-
});
|
|
819
|
-
var ConfigurableRawScopes = z10.discriminatedUnion("type", [
|
|
804
|
+
var ConfigurableRawScopes = import_zod10.z.discriminatedUnion("type", [
|
|
820
805
|
SearchScope,
|
|
821
806
|
CreateUserScope,
|
|
822
807
|
EditUserScope,
|
|
823
808
|
WorkqueueScope,
|
|
824
|
-
RecordScope
|
|
825
|
-
CustomActionScope
|
|
826
|
-
]);
|
|
827
|
-
var ConfigurableActionScopes = z10.discriminatedUnion("type", [
|
|
828
|
-
// @TODO - Record scope holds non-action scopes as well e.g., `record.read`
|
|
829
|
-
RecordScope,
|
|
830
|
-
CustomActionScope
|
|
809
|
+
RecordScope
|
|
831
810
|
]);
|
|
832
811
|
var scopes = Object.values(SCOPES);
|
|
833
|
-
var ActionScopes =
|
|
812
|
+
var ActionScopes = import_zod10.z.union([
|
|
834
813
|
DeclareScopes,
|
|
835
814
|
ValidateScopes,
|
|
836
815
|
RegisterScope,
|
|
837
|
-
|
|
816
|
+
import_zod10.z.literal(SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES),
|
|
838
817
|
CorrectionScopes
|
|
839
818
|
]);
|
|
840
819
|
|
|
@@ -968,14 +947,15 @@ var DEFAULT_ROLES_DEFINITION = [
|
|
|
968
947
|
]
|
|
969
948
|
}
|
|
970
949
|
];
|
|
971
|
-
var TokenUserType =
|
|
972
|
-
var TokenWithBearer =
|
|
950
|
+
var TokenUserType = import_zod11.z.enum(["user", "system"]);
|
|
951
|
+
var TokenWithBearer = import_zod11.z.string().regex(/^Bearer\s/);
|
|
973
952
|
|
|
974
953
|
// ../commons/src/events/ActionDocument.ts
|
|
975
|
-
|
|
954
|
+
(0, import_zod_openapi4.extendZodWithOpenApi)(import_zod12.z);
|
|
955
|
+
var ActionUpdate = import_zod12.z.record(import_zod12.z.string(), FieldUpdateValue).describe(
|
|
976
956
|
"Record of field-level changes made by an action. Supports partial updates and nullable values."
|
|
977
957
|
);
|
|
978
|
-
var EventState =
|
|
958
|
+
var EventState = import_zod12.z.record(import_zod12.z.string(), FieldValue).describe(
|
|
979
959
|
"Aggregate representation of event data after all actions have been applied, with all updates consolidated and null values removed."
|
|
980
960
|
);
|
|
981
961
|
var ActionStatus = {
|
|
@@ -983,16 +963,16 @@ var ActionStatus = {
|
|
|
983
963
|
Accepted: "Accepted",
|
|
984
964
|
Rejected: "Rejected"
|
|
985
965
|
};
|
|
986
|
-
var ActionBase =
|
|
966
|
+
var ActionBase = import_zod12.z.object({
|
|
987
967
|
id: UUID.describe("Unique identifier of the action."),
|
|
988
|
-
transactionId:
|
|
968
|
+
transactionId: import_zod12.z.string().describe("Unique identifier of the transaction."),
|
|
989
969
|
createdByUserType: TokenUserType.describe(
|
|
990
970
|
"Indicates whether the action was created by a human-user or by a system-user."
|
|
991
971
|
),
|
|
992
|
-
createdAt:
|
|
993
|
-
createdBy:
|
|
994
|
-
createdByRole:
|
|
995
|
-
createdBySignature:
|
|
972
|
+
createdAt: import_zod12.z.string().datetime().describe("Timestamp indicating when the action was created."),
|
|
973
|
+
createdBy: import_zod12.z.string().describe("Identifier of the user who created the action."),
|
|
974
|
+
createdByRole: import_zod12.z.string().describe("Role of the user who created the action."),
|
|
975
|
+
createdBySignature: import_zod12.z.string().nullish().describe("Reference to the signature of the user who created the action."),
|
|
996
976
|
createdAtLocation: CreatedAtLocation.describe(
|
|
997
977
|
"Reference to the location of the user who created the action."
|
|
998
978
|
),
|
|
@@ -1000,7 +980,7 @@ var ActionBase = z12.object({
|
|
|
1000
980
|
"Declaration data defined by the ActionConfig. Supports partial updates."
|
|
1001
981
|
),
|
|
1002
982
|
annotation: ActionUpdate.optional().nullable().describe("Action-specific metadata used to annotate the event."),
|
|
1003
|
-
status:
|
|
983
|
+
status: import_zod12.z.enum([
|
|
1004
984
|
ActionStatus.Requested,
|
|
1005
985
|
ActionStatus.Accepted,
|
|
1006
986
|
ActionStatus.Rejected
|
|
@@ -1011,188 +991,172 @@ var ActionBase = z12.object({
|
|
|
1011
991
|
"Reference to the original action asynchronously accepted or rejected by a third-party integration."
|
|
1012
992
|
)
|
|
1013
993
|
});
|
|
1014
|
-
var AssignedAction = ActionBase.
|
|
1015
|
-
|
|
1016
|
-
type:
|
|
1017
|
-
assignedTo:
|
|
994
|
+
var AssignedAction = ActionBase.merge(
|
|
995
|
+
import_zod12.z.object({
|
|
996
|
+
type: import_zod12.z.literal(ActionType.ASSIGN),
|
|
997
|
+
assignedTo: import_zod12.z.string().describe("Identifier of the user to whom the action is assigned.")
|
|
1018
998
|
// TODO move into 'content' property
|
|
1019
|
-
})
|
|
999
|
+
})
|
|
1020
1000
|
);
|
|
1021
|
-
var UnassignedAction = ActionBase.
|
|
1022
|
-
|
|
1023
|
-
type:
|
|
1024
|
-
})
|
|
1001
|
+
var UnassignedAction = ActionBase.merge(
|
|
1002
|
+
import_zod12.z.object({
|
|
1003
|
+
type: import_zod12.z.literal(ActionType.UNASSIGN)
|
|
1004
|
+
})
|
|
1025
1005
|
);
|
|
1026
|
-
var RegisterAction = ActionBase.
|
|
1027
|
-
|
|
1028
|
-
type:
|
|
1029
|
-
registrationNumber:
|
|
1006
|
+
var RegisterAction = ActionBase.merge(
|
|
1007
|
+
import_zod12.z.object({
|
|
1008
|
+
type: import_zod12.z.literal(ActionType.REGISTER),
|
|
1009
|
+
registrationNumber: import_zod12.z.string().optional().describe(
|
|
1030
1010
|
"Registration number of the event. Always present for accepted registrations."
|
|
1031
1011
|
)
|
|
1032
1012
|
// TODO move into 'content' property
|
|
1033
|
-
})
|
|
1013
|
+
})
|
|
1034
1014
|
);
|
|
1035
|
-
var DeclareAction = ActionBase.
|
|
1036
|
-
|
|
1037
|
-
type:
|
|
1038
|
-
})
|
|
1015
|
+
var DeclareAction = ActionBase.merge(
|
|
1016
|
+
import_zod12.z.object({
|
|
1017
|
+
type: import_zod12.z.literal(ActionType.DECLARE)
|
|
1018
|
+
})
|
|
1039
1019
|
);
|
|
1040
|
-
var ValidateAction = ActionBase.
|
|
1041
|
-
|
|
1042
|
-
type:
|
|
1043
|
-
})
|
|
1020
|
+
var ValidateAction = ActionBase.merge(
|
|
1021
|
+
import_zod12.z.object({
|
|
1022
|
+
type: import_zod12.z.literal(ActionType.VALIDATE)
|
|
1023
|
+
})
|
|
1044
1024
|
);
|
|
1045
|
-
var ReasonContent =
|
|
1046
|
-
reason:
|
|
1025
|
+
var ReasonContent = import_zod12.z.object({
|
|
1026
|
+
reason: import_zod12.z.string().min(1, { message: "Message cannot be empty" }).describe(
|
|
1047
1027
|
"Message describing the reason for rejecting or archiving the event."
|
|
1048
1028
|
)
|
|
1049
1029
|
});
|
|
1050
|
-
var RejectAction = ActionBase.
|
|
1051
|
-
|
|
1052
|
-
type:
|
|
1030
|
+
var RejectAction = ActionBase.merge(
|
|
1031
|
+
import_zod12.z.object({
|
|
1032
|
+
type: import_zod12.z.literal(ActionType.REJECT),
|
|
1053
1033
|
content: ReasonContent
|
|
1054
|
-
})
|
|
1034
|
+
})
|
|
1055
1035
|
);
|
|
1056
|
-
var PotentialDuplicate =
|
|
1036
|
+
var PotentialDuplicate = import_zod12.z.object({
|
|
1057
1037
|
id: UUID,
|
|
1058
|
-
trackingId:
|
|
1038
|
+
trackingId: import_zod12.z.string()
|
|
1059
1039
|
});
|
|
1060
|
-
var DuplicateDetectedAction = ActionBase.
|
|
1061
|
-
|
|
1062
|
-
type:
|
|
1063
|
-
content:
|
|
1064
|
-
duplicates:
|
|
1040
|
+
var DuplicateDetectedAction = ActionBase.merge(
|
|
1041
|
+
import_zod12.z.object({
|
|
1042
|
+
type: import_zod12.z.literal(ActionType.DUPLICATE_DETECTED),
|
|
1043
|
+
content: import_zod12.z.object({
|
|
1044
|
+
duplicates: import_zod12.z.array(PotentialDuplicate)
|
|
1065
1045
|
})
|
|
1066
|
-
})
|
|
1046
|
+
})
|
|
1067
1047
|
);
|
|
1068
|
-
var MarkNotDuplicateAction = ActionBase.
|
|
1069
|
-
|
|
1070
|
-
type:
|
|
1071
|
-
})
|
|
1048
|
+
var MarkNotDuplicateAction = ActionBase.merge(
|
|
1049
|
+
import_zod12.z.object({
|
|
1050
|
+
type: import_zod12.z.literal(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
1051
|
+
})
|
|
1072
1052
|
);
|
|
1073
|
-
var MarkAsDuplicateAction = ActionBase.
|
|
1074
|
-
|
|
1075
|
-
type:
|
|
1076
|
-
content:
|
|
1053
|
+
var MarkAsDuplicateAction = ActionBase.merge(
|
|
1054
|
+
import_zod12.z.object({
|
|
1055
|
+
type: import_zod12.z.literal(ActionType.MARK_AS_DUPLICATE),
|
|
1056
|
+
content: import_zod12.z.object({
|
|
1077
1057
|
duplicateOf: UUID
|
|
1078
1058
|
}).optional()
|
|
1079
|
-
})
|
|
1059
|
+
})
|
|
1080
1060
|
);
|
|
1081
|
-
var ArchiveAction = ActionBase.
|
|
1082
|
-
|
|
1083
|
-
type:
|
|
1061
|
+
var ArchiveAction = ActionBase.merge(
|
|
1062
|
+
import_zod12.z.object({
|
|
1063
|
+
type: import_zod12.z.literal(ActionType.ARCHIVE),
|
|
1084
1064
|
content: ReasonContent
|
|
1085
|
-
})
|
|
1086
|
-
);
|
|
1087
|
-
var CreatedAction = ActionBase.extend(
|
|
1088
|
-
z12.object({
|
|
1089
|
-
type: z12.literal(ActionType.CREATE)
|
|
1090
|
-
}).shape
|
|
1065
|
+
})
|
|
1091
1066
|
);
|
|
1092
|
-
var
|
|
1093
|
-
|
|
1094
|
-
type:
|
|
1095
|
-
})
|
|
1067
|
+
var CreatedAction = ActionBase.merge(
|
|
1068
|
+
import_zod12.z.object({
|
|
1069
|
+
type: import_zod12.z.literal(ActionType.CREATE)
|
|
1070
|
+
})
|
|
1096
1071
|
);
|
|
1097
|
-
var
|
|
1098
|
-
|
|
1099
|
-
type:
|
|
1100
|
-
|
|
1101
|
-
comment: z12.string().describe("Comment for the edit action.").optional()
|
|
1102
|
-
})
|
|
1103
|
-
}).shape
|
|
1072
|
+
var NotifiedAction = ActionBase.merge(
|
|
1073
|
+
import_zod12.z.object({
|
|
1074
|
+
type: import_zod12.z.literal(ActionType.NOTIFY)
|
|
1075
|
+
})
|
|
1104
1076
|
);
|
|
1105
|
-
var PrintContent =
|
|
1106
|
-
templateId:
|
|
1077
|
+
var PrintContent = import_zod12.z.object({
|
|
1078
|
+
templateId: import_zod12.z.string().optional()
|
|
1107
1079
|
});
|
|
1108
|
-
var PrintCertificateAction = ActionBase.
|
|
1109
|
-
|
|
1110
|
-
type:
|
|
1080
|
+
var PrintCertificateAction = ActionBase.merge(
|
|
1081
|
+
import_zod12.z.object({
|
|
1082
|
+
type: import_zod12.z.literal(ActionType.PRINT_CERTIFICATE),
|
|
1111
1083
|
content: PrintContent.optional().nullable()
|
|
1112
|
-
})
|
|
1084
|
+
})
|
|
1113
1085
|
);
|
|
1114
|
-
var RequestedCorrectionAction = ActionBase.
|
|
1115
|
-
|
|
1116
|
-
type:
|
|
1117
|
-
})
|
|
1086
|
+
var RequestedCorrectionAction = ActionBase.merge(
|
|
1087
|
+
import_zod12.z.object({
|
|
1088
|
+
type: import_zod12.z.literal(ActionType.REQUEST_CORRECTION)
|
|
1089
|
+
})
|
|
1118
1090
|
);
|
|
1119
|
-
var ApprovedCorrectionAction = ActionBase.
|
|
1120
|
-
|
|
1121
|
-
type:
|
|
1122
|
-
requestId:
|
|
1091
|
+
var ApprovedCorrectionAction = ActionBase.merge(
|
|
1092
|
+
import_zod12.z.object({
|
|
1093
|
+
type: import_zod12.z.literal(ActionType.APPROVE_CORRECTION),
|
|
1094
|
+
requestId: import_zod12.z.string()
|
|
1123
1095
|
// TODO move into 'content' property
|
|
1124
|
-
})
|
|
1096
|
+
})
|
|
1125
1097
|
);
|
|
1126
|
-
var RejectedCorrectionAction = ActionBase.
|
|
1127
|
-
|
|
1128
|
-
type:
|
|
1129
|
-
requestId:
|
|
1098
|
+
var RejectedCorrectionAction = ActionBase.merge(
|
|
1099
|
+
import_zod12.z.object({
|
|
1100
|
+
type: import_zod12.z.literal(ActionType.REJECT_CORRECTION),
|
|
1101
|
+
requestId: import_zod12.z.string(),
|
|
1130
1102
|
// TODO move into 'content' property
|
|
1131
1103
|
content: ReasonContent
|
|
1132
|
-
})
|
|
1133
|
-
);
|
|
1134
|
-
var ReadAction = ActionBase.extend(
|
|
1135
|
-
z12.object({
|
|
1136
|
-
type: z12.literal(ActionType.READ)
|
|
1137
|
-
}).shape
|
|
1104
|
+
})
|
|
1138
1105
|
);
|
|
1139
|
-
var
|
|
1140
|
-
|
|
1141
|
-
type:
|
|
1142
|
-
customActionType: z12.string()
|
|
1106
|
+
var ReadAction = ActionBase.merge(
|
|
1107
|
+
import_zod12.z.object({
|
|
1108
|
+
type: import_zod12.z.literal(ActionType.READ)
|
|
1143
1109
|
})
|
|
1144
1110
|
);
|
|
1145
|
-
var ActionDocument =
|
|
1146
|
-
CreatedAction.
|
|
1147
|
-
ValidateAction.
|
|
1148
|
-
RejectAction.
|
|
1149
|
-
DuplicateDetectedAction.
|
|
1150
|
-
MarkNotDuplicateAction.
|
|
1151
|
-
MarkAsDuplicateAction.
|
|
1152
|
-
ArchiveAction.
|
|
1153
|
-
NotifiedAction.
|
|
1154
|
-
RegisterAction.
|
|
1155
|
-
DeclareAction.
|
|
1156
|
-
AssignedAction.
|
|
1157
|
-
RequestedCorrectionAction.
|
|
1158
|
-
ApprovedCorrectionAction.
|
|
1159
|
-
RejectedCorrectionAction.
|
|
1160
|
-
UnassignedAction.
|
|
1161
|
-
PrintCertificateAction.
|
|
1162
|
-
ReadAction.
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
]).meta({
|
|
1166
|
-
id: "ActionDocument"
|
|
1111
|
+
var ActionDocument = import_zod12.z.discriminatedUnion("type", [
|
|
1112
|
+
CreatedAction.openapi({ ref: "CreatedAction" }),
|
|
1113
|
+
ValidateAction.openapi({ ref: "ValidateAction" }),
|
|
1114
|
+
RejectAction.openapi({ ref: "RejectAction" }),
|
|
1115
|
+
DuplicateDetectedAction.openapi({ ref: "DuplicateDetectedAction" }),
|
|
1116
|
+
MarkNotDuplicateAction.openapi({ ref: "MarkNotDuplicateAction" }),
|
|
1117
|
+
MarkAsDuplicateAction.openapi({ ref: "MarkAsDuplicateAction" }),
|
|
1118
|
+
ArchiveAction.openapi({ ref: "ArchiveAction" }),
|
|
1119
|
+
NotifiedAction.openapi({ ref: "NotifiedAction" }),
|
|
1120
|
+
RegisterAction.openapi({ ref: "RegisterAction" }),
|
|
1121
|
+
DeclareAction.openapi({ ref: "DeclareAction" }),
|
|
1122
|
+
AssignedAction.openapi({ ref: "AssignedAction" }),
|
|
1123
|
+
RequestedCorrectionAction.openapi({ ref: "RequestedCorrectionAction" }),
|
|
1124
|
+
ApprovedCorrectionAction.openapi({ ref: "ApprovedCorrectionAction" }),
|
|
1125
|
+
RejectedCorrectionAction.openapi({ ref: "RejectedCorrectionAction" }),
|
|
1126
|
+
UnassignedAction.openapi({ ref: "UnassignedAction" }),
|
|
1127
|
+
PrintCertificateAction.openapi({ ref: "PrintCertificateAction" }),
|
|
1128
|
+
ReadAction.openapi({ ref: "ReadAction" })
|
|
1129
|
+
]).openapi({
|
|
1130
|
+
ref: "ActionDocument"
|
|
1167
1131
|
});
|
|
1168
1132
|
var AsyncRejectActionDocument = ActionBase.omit({
|
|
1169
1133
|
declaration: true,
|
|
1170
1134
|
annotation: true
|
|
1171
|
-
}).
|
|
1172
|
-
|
|
1173
|
-
type:
|
|
1174
|
-
status:
|
|
1175
|
-
})
|
|
1135
|
+
}).merge(
|
|
1136
|
+
import_zod12.z.object({
|
|
1137
|
+
type: import_zod12.z.enum(ConfirmableActions),
|
|
1138
|
+
status: import_zod12.z.literal(ActionStatus.Rejected)
|
|
1139
|
+
})
|
|
1176
1140
|
);
|
|
1177
|
-
var Action =
|
|
1141
|
+
var Action = import_zod12.z.union([ActionDocument, AsyncRejectActionDocument]);
|
|
1178
1142
|
|
|
1179
|
-
// ../commons/src/events/
|
|
1180
|
-
var
|
|
1143
|
+
// ../commons/src/events/EventMetadata.ts
|
|
1144
|
+
var EventStatus = import_zod13.z.enum([
|
|
1145
|
+
"CREATED",
|
|
1146
|
+
"NOTIFIED",
|
|
1147
|
+
"DECLARED",
|
|
1148
|
+
"VALIDATED",
|
|
1149
|
+
"REGISTERED",
|
|
1150
|
+
"ARCHIVED"
|
|
1151
|
+
]);
|
|
1181
1152
|
var InherentFlags = {
|
|
1182
1153
|
PENDING_CERTIFICATION: "pending-certification",
|
|
1183
1154
|
INCOMPLETE: "incomplete",
|
|
1184
1155
|
REJECTED: "rejected",
|
|
1185
1156
|
CORRECTION_REQUESTED: "correction-requested",
|
|
1186
|
-
POTENTIAL_DUPLICATE: "potential-duplicate"
|
|
1187
|
-
/**
|
|
1188
|
-
* This flag is set by the Edit-action and removed after the declaration or registration.
|
|
1189
|
-
* A record should never stay with the EDIT_IN_PROGRESS flag, since it should always be declared or registered right after.
|
|
1190
|
-
*
|
|
1191
|
-
* We only use this flag to determine that a DECLARE or REGISTER action is allowed next.
|
|
1192
|
-
*/
|
|
1193
|
-
EDIT_IN_PROGRESS: "edit-in-progress"
|
|
1157
|
+
POTENTIAL_DUPLICATE: "potential-duplicate"
|
|
1194
1158
|
};
|
|
1195
|
-
var ActionFlag =
|
|
1159
|
+
var ActionFlag = import_zod13.z.string().regex(
|
|
1196
1160
|
new RegExp(
|
|
1197
1161
|
`^(${Object.values(ActionType).join("|").toLowerCase()}):(${Object.values(
|
|
1198
1162
|
ActionStatus
|
|
@@ -1200,90 +1164,59 @@ var ActionFlag = z13.string().regex(
|
|
|
1200
1164
|
),
|
|
1201
1165
|
"Flag must be in the format ActionType:ActionStatus (lowerCase)"
|
|
1202
1166
|
);
|
|
1203
|
-
var
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
).
|
|
1207
|
-
|
|
1208
|
-
message: "Custom flag cannot match the ActionFlag pattern (ActionType:ActionStatus)."
|
|
1209
|
-
}).describe("Custom flag identifier defined by the country config.");
|
|
1210
|
-
var Flag = ActionFlag.or(z13.enum(InherentFlags)).or(CustomFlag);
|
|
1211
|
-
var FlagConfig = z13.object({
|
|
1212
|
-
id: CustomFlag,
|
|
1213
|
-
requiresAction: z13.boolean().describe(
|
|
1214
|
-
"Indicates if this flag expects an action to be performed to be cleared."
|
|
1215
|
-
),
|
|
1216
|
-
label: TranslationConfig.describe("Human readable label of the flag.")
|
|
1217
|
-
});
|
|
1218
|
-
var ActionFlagConfig = z13.object({
|
|
1219
|
-
id: Flag,
|
|
1220
|
-
operation: z13.enum(["add", "remove"]).describe("Operation to perform on the flag."),
|
|
1221
|
-
conditional: Conditional.optional().describe(
|
|
1222
|
-
"When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
|
|
1223
|
-
)
|
|
1224
|
-
});
|
|
1225
|
-
|
|
1226
|
-
// ../commons/src/events/EventMetadata.ts
|
|
1227
|
-
var EventStatus = z14.enum([
|
|
1228
|
-
"CREATED",
|
|
1229
|
-
"NOTIFIED",
|
|
1230
|
-
"DECLARED",
|
|
1231
|
-
"REGISTERED",
|
|
1232
|
-
"ARCHIVED"
|
|
1233
|
-
]);
|
|
1234
|
-
var ZodDate = z14.iso.date();
|
|
1235
|
-
var ActionCreationMetadata = z14.object({
|
|
1236
|
-
createdAt: z14.iso.datetime().describe("The timestamp when the action request was created."),
|
|
1237
|
-
createdBy: z14.string().describe("ID of the user who created the action request."),
|
|
1167
|
+
var Flag = ActionFlag.or(import_zod13.z.nativeEnum(InherentFlags));
|
|
1168
|
+
var ZodDate = import_zod13.z.string().date();
|
|
1169
|
+
var ActionCreationMetadata = import_zod13.z.object({
|
|
1170
|
+
createdAt: import_zod13.z.string().datetime().describe("The timestamp when the action request was created."),
|
|
1171
|
+
createdBy: import_zod13.z.string().describe("ID of the user who created the action request."),
|
|
1238
1172
|
createdAtLocation: CreatedAtLocation.describe(
|
|
1239
1173
|
"Location of the user who created the action request."
|
|
1240
1174
|
),
|
|
1241
|
-
createdByUserType:
|
|
1242
|
-
acceptedAt:
|
|
1243
|
-
createdByRole:
|
|
1244
|
-
createdBySignature:
|
|
1175
|
+
createdByUserType: import_zod13.z.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1176
|
+
acceptedAt: import_zod13.z.string().datetime().describe("Timestamp when the action request was accepted."),
|
|
1177
|
+
createdByRole: import_zod13.z.string().describe("Role of the user at the time of action request creation."),
|
|
1178
|
+
createdBySignature: import_zod13.z.string().nullish().describe("Signature of the user who created the action request.")
|
|
1245
1179
|
});
|
|
1246
1180
|
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
1247
|
-
registrationNumber:
|
|
1181
|
+
registrationNumber: import_zod13.z.string().describe(
|
|
1248
1182
|
"Registration number of the event. Always present for accepted registrations."
|
|
1249
1183
|
)
|
|
1250
1184
|
});
|
|
1251
|
-
var LegalStatuses =
|
|
1185
|
+
var LegalStatuses = import_zod13.z.object({
|
|
1252
1186
|
[EventStatus.enum.DECLARED]: ActionCreationMetadata.nullish(),
|
|
1253
1187
|
[EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish()
|
|
1254
1188
|
});
|
|
1255
|
-
var EventMetadata =
|
|
1189
|
+
var EventMetadata = import_zod13.z.object({
|
|
1256
1190
|
id: UUID,
|
|
1257
|
-
type:
|
|
1191
|
+
type: import_zod13.z.string().describe("The type of event, such as birth, death, or marriage."),
|
|
1258
1192
|
status: EventStatus,
|
|
1259
1193
|
legalStatuses: LegalStatuses.describe(
|
|
1260
1194
|
"Metadata related to the legal registration of the event, such as who registered it and when."
|
|
1261
1195
|
),
|
|
1262
|
-
createdAt:
|
|
1196
|
+
createdAt: import_zod13.z.string().datetime().describe("The timestamp when the event was first created and saved."),
|
|
1263
1197
|
dateOfEvent: ZodDate.nullish(),
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
updatedByUserRole: z14.string().describe("Role of the user who last changed the status."),
|
|
1198
|
+
createdBy: import_zod13.z.string().describe("ID of the user who created the event."),
|
|
1199
|
+
createdByUserType: import_zod13.z.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1200
|
+
updatedByUserRole: import_zod13.z.string().describe("Role of the user who last changed the status."),
|
|
1268
1201
|
createdAtLocation: CreatedAtLocation.describe(
|
|
1269
1202
|
"Location of the user who created the event."
|
|
1270
1203
|
),
|
|
1271
|
-
createdBySignature:
|
|
1204
|
+
createdBySignature: import_zod13.z.string().nullish().describe("Signature of the user who created the event."),
|
|
1272
1205
|
updatedAtLocation: UUID.nullish().describe(
|
|
1273
1206
|
"Location of the user who last changed the status."
|
|
1274
1207
|
),
|
|
1275
|
-
updatedAt:
|
|
1208
|
+
updatedAt: import_zod13.z.string().datetime().describe(
|
|
1276
1209
|
"Timestamp of the most recent *accepted* status change. Possibly 3rd party update, if action is validation asynchronously."
|
|
1277
1210
|
),
|
|
1278
|
-
assignedTo:
|
|
1279
|
-
updatedBy:
|
|
1280
|
-
trackingId:
|
|
1211
|
+
assignedTo: import_zod13.z.string().nullish().describe("ID of the user currently assigned to the event."),
|
|
1212
|
+
updatedBy: import_zod13.z.string().nullish().describe("ID of the user who last changed the status."),
|
|
1213
|
+
trackingId: import_zod13.z.string().describe(
|
|
1281
1214
|
"System-generated tracking ID used by informants or registrars to look up the event."
|
|
1282
1215
|
),
|
|
1283
|
-
potentialDuplicates:
|
|
1216
|
+
potentialDuplicates: import_zod13.z.array(PotentialDuplicate).describe(
|
|
1284
1217
|
"List of event IDs and their tracking IDs that this event could be a duplicate of."
|
|
1285
1218
|
),
|
|
1286
|
-
flags:
|
|
1219
|
+
flags: import_zod13.z.array(Flag)
|
|
1287
1220
|
});
|
|
1288
1221
|
var EventMetadataKeysArray = [
|
|
1289
1222
|
"id",
|
|
@@ -1291,7 +1224,6 @@ var EventMetadataKeysArray = [
|
|
|
1291
1224
|
"status",
|
|
1292
1225
|
"createdAt",
|
|
1293
1226
|
"dateOfEvent",
|
|
1294
|
-
"placeOfEvent",
|
|
1295
1227
|
"createdBy",
|
|
1296
1228
|
"createdByUserType",
|
|
1297
1229
|
"updatedByUserRole",
|
|
@@ -1304,128 +1236,130 @@ var EventMetadataKeysArray = [
|
|
|
1304
1236
|
"legalStatuses",
|
|
1305
1237
|
"flags"
|
|
1306
1238
|
];
|
|
1307
|
-
var EventMetadataKeys =
|
|
1239
|
+
var EventMetadataKeys = import_zod13.z.enum(EventMetadataKeysArray);
|
|
1308
1240
|
|
|
1309
1241
|
// ../commons/src/events/EventIndex.ts
|
|
1242
|
+
var import_zod_openapi5 = require("zod-openapi");
|
|
1243
|
+
(0, import_zod_openapi5.extendZodWithOpenApi)(import_zod14.z);
|
|
1310
1244
|
var EventIndex = EventMetadata.extend({
|
|
1311
1245
|
declaration: EventState
|
|
1312
|
-
}).
|
|
1313
|
-
|
|
1246
|
+
}).openapi({
|
|
1247
|
+
ref: "EventIndex"
|
|
1314
1248
|
});
|
|
1315
|
-
var EventSearchIndex =
|
|
1316
|
-
|
|
1317
|
-
type:
|
|
1249
|
+
var EventSearchIndex = import_zod14.z.record(import_zod14.z.string(), import_zod14.z.any()).and(
|
|
1250
|
+
import_zod14.z.object({
|
|
1251
|
+
type: import_zod14.z.string()
|
|
1318
1252
|
// Ensures "type" (event-id) exists and is a string
|
|
1319
1253
|
})
|
|
1320
|
-
).
|
|
1321
|
-
|
|
1254
|
+
).openapi({
|
|
1255
|
+
ref: "EventSearchIndex"
|
|
1322
1256
|
});
|
|
1323
|
-
var Fuzzy =
|
|
1324
|
-
|
|
1257
|
+
var Fuzzy = import_zod14.z.object({ type: import_zod14.z.literal("fuzzy"), term: import_zod14.z.string() }).openapi({
|
|
1258
|
+
ref: "Fuzzy"
|
|
1325
1259
|
});
|
|
1326
|
-
var Exact =
|
|
1327
|
-
|
|
1260
|
+
var Exact = import_zod14.z.object({ type: import_zod14.z.literal("exact"), term: import_zod14.z.string() }).openapi({
|
|
1261
|
+
ref: "Exact"
|
|
1328
1262
|
});
|
|
1329
|
-
var ExactStatus =
|
|
1330
|
-
type:
|
|
1263
|
+
var ExactStatus = import_zod14.z.object({
|
|
1264
|
+
type: import_zod14.z.literal("exact"),
|
|
1331
1265
|
term: EventStatus
|
|
1332
|
-
}).
|
|
1333
|
-
|
|
1266
|
+
}).openapi({
|
|
1267
|
+
ref: "ExactStatus"
|
|
1334
1268
|
});
|
|
1335
|
-
var ExactUserType =
|
|
1336
|
-
type:
|
|
1269
|
+
var ExactUserType = import_zod14.z.object({
|
|
1270
|
+
type: import_zod14.z.literal("exact"),
|
|
1337
1271
|
term: TokenUserType
|
|
1338
|
-
}).
|
|
1339
|
-
|
|
1272
|
+
}).openapi({
|
|
1273
|
+
ref: "ExactUserType"
|
|
1340
1274
|
});
|
|
1341
|
-
var AnyOf =
|
|
1342
|
-
type:
|
|
1343
|
-
terms:
|
|
1344
|
-
}).
|
|
1345
|
-
|
|
1275
|
+
var AnyOf = import_zod14.z.object({
|
|
1276
|
+
type: import_zod14.z.literal("anyOf"),
|
|
1277
|
+
terms: import_zod14.z.array(import_zod14.z.string())
|
|
1278
|
+
}).openapi({
|
|
1279
|
+
ref: "AnyOf"
|
|
1346
1280
|
});
|
|
1347
|
-
var AnyOfStatus =
|
|
1348
|
-
type:
|
|
1349
|
-
terms:
|
|
1350
|
-
}).
|
|
1351
|
-
|
|
1281
|
+
var AnyOfStatus = import_zod14.z.object({
|
|
1282
|
+
type: import_zod14.z.literal("anyOf"),
|
|
1283
|
+
terms: import_zod14.z.array(EventStatus)
|
|
1284
|
+
}).openapi({
|
|
1285
|
+
ref: "AnyOfStatus"
|
|
1352
1286
|
});
|
|
1353
|
-
var Range =
|
|
1354
|
-
type:
|
|
1355
|
-
gte:
|
|
1356
|
-
lte:
|
|
1357
|
-
}).
|
|
1358
|
-
|
|
1287
|
+
var Range = import_zod14.z.object({
|
|
1288
|
+
type: import_zod14.z.literal("range"),
|
|
1289
|
+
gte: import_zod14.z.string(),
|
|
1290
|
+
lte: import_zod14.z.string()
|
|
1291
|
+
}).openapi({
|
|
1292
|
+
ref: "Range"
|
|
1359
1293
|
});
|
|
1360
|
-
var ContainsFlags =
|
|
1361
|
-
anyOf:
|
|
1362
|
-
noneOf:
|
|
1363
|
-
}).
|
|
1364
|
-
|
|
1294
|
+
var ContainsFlags = import_zod14.z.object({
|
|
1295
|
+
anyOf: import_zod14.z.array(Flag).optional(),
|
|
1296
|
+
noneOf: import_zod14.z.array(Flag).optional()
|
|
1297
|
+
}).openapi({
|
|
1298
|
+
ref: "ContainsFlags"
|
|
1365
1299
|
});
|
|
1366
|
-
var Within =
|
|
1367
|
-
|
|
1300
|
+
var Within = import_zod14.z.object({ type: import_zod14.z.literal("within"), location: import_zod14.z.string() }).openapi({
|
|
1301
|
+
ref: "Within"
|
|
1368
1302
|
});
|
|
1369
|
-
var RangeDate =
|
|
1370
|
-
type:
|
|
1371
|
-
gte:
|
|
1372
|
-
lte:
|
|
1373
|
-
}).
|
|
1303
|
+
var RangeDate = import_zod14.z.object({
|
|
1304
|
+
type: import_zod14.z.literal("range"),
|
|
1305
|
+
gte: import_zod14.z.string().date().or(import_zod14.z.string().datetime()),
|
|
1306
|
+
lte: import_zod14.z.string().date().or(import_zod14.z.string().datetime())
|
|
1307
|
+
}).openapi({ ref: "RangeDate" });
|
|
1374
1308
|
var ExactDate = Exact.extend({
|
|
1375
|
-
term:
|
|
1376
|
-
}).
|
|
1377
|
-
|
|
1309
|
+
term: import_zod14.z.string().date().or(import_zod14.z.string().datetime())
|
|
1310
|
+
}).openapi({
|
|
1311
|
+
ref: "ExactDate"
|
|
1378
1312
|
});
|
|
1379
|
-
var TimePeriod =
|
|
1380
|
-
type:
|
|
1313
|
+
var TimePeriod = import_zod14.z.object({
|
|
1314
|
+
type: import_zod14.z.literal("timePeriod"),
|
|
1381
1315
|
term: SelectDateRangeValue
|
|
1382
|
-
}).
|
|
1383
|
-
|
|
1316
|
+
}).openapi({
|
|
1317
|
+
ref: "TimePeriod"
|
|
1384
1318
|
});
|
|
1385
|
-
var DateCondition =
|
|
1386
|
-
|
|
1319
|
+
var DateCondition = import_zod14.z.union([ExactDate, RangeDate, TimePeriod]).openapi({
|
|
1320
|
+
ref: "DateCondition"
|
|
1387
1321
|
});
|
|
1388
|
-
var QueryInput =
|
|
1389
|
-
() =>
|
|
1390
|
-
|
|
1391
|
-
|
|
1322
|
+
var QueryInput = import_zod14.z.lazy(
|
|
1323
|
+
() => import_zod14.z.union([
|
|
1324
|
+
import_zod14.z.discriminatedUnion("type", [Fuzzy, Exact, Range, Within, AnyOf]),
|
|
1325
|
+
import_zod14.z.record(import_zod14.z.string(), QueryInput)
|
|
1392
1326
|
])
|
|
1393
|
-
).
|
|
1394
|
-
|
|
1327
|
+
).openapi({
|
|
1328
|
+
ref: "QueryInput"
|
|
1395
1329
|
});
|
|
1396
|
-
var QueryExpression =
|
|
1397
|
-
id:
|
|
1398
|
-
eventType:
|
|
1399
|
-
status:
|
|
1400
|
-
createdAt:
|
|
1401
|
-
updatedAt:
|
|
1402
|
-
"legalStatuses.REGISTERED.acceptedAt":
|
|
1403
|
-
"legalStatuses.DECLARED.createdAtLocation":
|
|
1404
|
-
|
|
1330
|
+
var QueryExpression = import_zod14.z.object({
|
|
1331
|
+
id: import_zod14.z.optional(import_zod14.z.string()),
|
|
1332
|
+
eventType: import_zod14.z.string(),
|
|
1333
|
+
status: import_zod14.z.optional(import_zod14.z.union([AnyOfStatus, ExactStatus])),
|
|
1334
|
+
createdAt: import_zod14.z.optional(DateCondition),
|
|
1335
|
+
updatedAt: import_zod14.z.optional(DateCondition),
|
|
1336
|
+
"legalStatuses.REGISTERED.acceptedAt": import_zod14.z.optional(DateCondition),
|
|
1337
|
+
"legalStatuses.DECLARED.createdAtLocation": import_zod14.z.optional(
|
|
1338
|
+
import_zod14.z.union([Within, Exact])
|
|
1405
1339
|
),
|
|
1406
|
-
"legalStatuses.REGISTERED.createdAtLocation":
|
|
1407
|
-
|
|
1340
|
+
"legalStatuses.REGISTERED.createdAtLocation": import_zod14.z.optional(
|
|
1341
|
+
import_zod14.z.union([Within, Exact])
|
|
1408
1342
|
),
|
|
1409
|
-
"legalStatuses.REGISTERED.registrationNumber":
|
|
1410
|
-
createdAtLocation:
|
|
1411
|
-
updatedAtLocation:
|
|
1412
|
-
assignedTo:
|
|
1413
|
-
createdByUserType:
|
|
1414
|
-
createdBy:
|
|
1415
|
-
updatedBy:
|
|
1416
|
-
trackingId:
|
|
1417
|
-
flags:
|
|
1343
|
+
"legalStatuses.REGISTERED.registrationNumber": import_zod14.z.optional(Exact),
|
|
1344
|
+
createdAtLocation: import_zod14.z.optional(import_zod14.z.union([Within, Exact])),
|
|
1345
|
+
updatedAtLocation: import_zod14.z.optional(import_zod14.z.union([Within, Exact])),
|
|
1346
|
+
assignedTo: import_zod14.z.optional(Exact),
|
|
1347
|
+
createdByUserType: import_zod14.z.optional(ExactUserType),
|
|
1348
|
+
createdBy: import_zod14.z.optional(Exact),
|
|
1349
|
+
updatedBy: import_zod14.z.optional(Exact),
|
|
1350
|
+
trackingId: import_zod14.z.optional(Exact),
|
|
1351
|
+
flags: import_zod14.z.optional(ContainsFlags),
|
|
1418
1352
|
// @todo: The type for this comes out as "any"
|
|
1419
1353
|
data: QueryInput
|
|
1420
1354
|
}).partial().refine((obj) => Object.values(obj).some((val) => val !== void 0), {
|
|
1421
|
-
|
|
1422
|
-
}).
|
|
1423
|
-
|
|
1355
|
+
message: "At least one query field must be specified."
|
|
1356
|
+
}).openapi({
|
|
1357
|
+
ref: "QueryExpression"
|
|
1424
1358
|
});
|
|
1425
|
-
var QueryType =
|
|
1426
|
-
() =>
|
|
1427
|
-
type:
|
|
1428
|
-
clauses:
|
|
1359
|
+
var QueryType = import_zod14.z.lazy(
|
|
1360
|
+
() => import_zod14.z.object({
|
|
1361
|
+
type: import_zod14.z.literal("and").or(import_zod14.z.literal("or")).openapi({ default: "and" }),
|
|
1362
|
+
clauses: import_zod14.z.array(import_zod14.z.union([QueryExpression, QueryType])).nonempty("At least one clause is required.").openapi({
|
|
1429
1363
|
default: [
|
|
1430
1364
|
{
|
|
1431
1365
|
eventType: TENNIS_CLUB_MEMBERSHIP,
|
|
@@ -1443,8 +1377,8 @@ var QueryType = import_v4.z.lazy(
|
|
|
1443
1377
|
]
|
|
1444
1378
|
})
|
|
1445
1379
|
})
|
|
1446
|
-
).
|
|
1447
|
-
|
|
1380
|
+
).openapi({
|
|
1381
|
+
ref: "QueryType"
|
|
1448
1382
|
});
|
|
1449
1383
|
function parseStringifiedQueryField(val) {
|
|
1450
1384
|
if (typeof val === "string") {
|
|
@@ -1452,8 +1386,8 @@ function parseStringifiedQueryField(val) {
|
|
|
1452
1386
|
}
|
|
1453
1387
|
return val;
|
|
1454
1388
|
}
|
|
1455
|
-
var SearchQuery =
|
|
1456
|
-
query:
|
|
1389
|
+
var SearchQuery = import_zod14.z.object({
|
|
1390
|
+
query: import_zod14.z.preprocess(parseStringifiedQueryField, QueryType).openapi({
|
|
1457
1391
|
default: {
|
|
1458
1392
|
type: "and",
|
|
1459
1393
|
clauses: [
|
|
@@ -1473,184 +1407,190 @@ var SearchQuery = import_v4.z.object({
|
|
|
1473
1407
|
]
|
|
1474
1408
|
}
|
|
1475
1409
|
}),
|
|
1476
|
-
limit:
|
|
1477
|
-
offset:
|
|
1478
|
-
sort:
|
|
1410
|
+
limit: import_zod14.z.number().optional().default(100),
|
|
1411
|
+
offset: import_zod14.z.number().optional().default(0),
|
|
1412
|
+
sort: import_zod14.z.preprocess(
|
|
1479
1413
|
parseStringifiedQueryField,
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
field:
|
|
1483
|
-
direction:
|
|
1414
|
+
import_zod14.z.array(
|
|
1415
|
+
import_zod14.z.object({
|
|
1416
|
+
field: import_zod14.z.string(),
|
|
1417
|
+
direction: import_zod14.z.enum(["asc", "desc"]).default("asc")
|
|
1484
1418
|
})
|
|
1485
1419
|
)
|
|
1486
1420
|
).optional()
|
|
1487
|
-
}).
|
|
1488
|
-
|
|
1421
|
+
}).openapi({
|
|
1422
|
+
ref: "SearchQuery"
|
|
1489
1423
|
});
|
|
1490
1424
|
|
|
1491
1425
|
// ../commons/src/events/FieldConfig.ts
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1426
|
+
(0, import_zod_openapi6.extendZodWithOpenApi)(import_zod15.z);
|
|
1427
|
+
var FieldId = import_zod15.z.string().refine(
|
|
1428
|
+
/*
|
|
1429
|
+
* Disallow underscores '_' in field ids.
|
|
1430
|
+
* Why? Theres two reasons:
|
|
1431
|
+
* 1. We transform dots to underscores as separator in Formik field ids, so this avoids any issues with the Formik transformations.
|
|
1432
|
+
* 2. On Kysely-SQL queries, we use the CamelCasePlugin. This plugin transforms snake_case to camelCase also on nested (jsonb) object keys.
|
|
1433
|
+
* 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.
|
|
1434
|
+
*/
|
|
1435
|
+
(val) => !val.includes("_"),
|
|
1436
|
+
(val) => ({
|
|
1437
|
+
message: `id: '${val}' must not contain underscores '_'`
|
|
1438
|
+
})
|
|
1439
|
+
).describe("Unique identifier for the field");
|
|
1440
|
+
var FieldReference = import_zod15.z.object({
|
|
1501
1441
|
$$field: FieldId,
|
|
1502
|
-
$$subfield:
|
|
1442
|
+
$$subfield: import_zod15.z.array(import_zod15.z.string()).optional().describe(
|
|
1503
1443
|
'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
|
|
1504
1444
|
)
|
|
1505
1445
|
}).describe("Reference to a field by its ID");
|
|
1506
|
-
var ValidationConfig =
|
|
1446
|
+
var ValidationConfig = import_zod15.z.object({
|
|
1507
1447
|
validator: Conditional,
|
|
1508
1448
|
message: TranslationConfig
|
|
1509
1449
|
});
|
|
1510
|
-
var requiredSchema =
|
|
1511
|
-
|
|
1512
|
-
|
|
1450
|
+
var requiredSchema = import_zod15.z.union([
|
|
1451
|
+
import_zod15.z.boolean(),
|
|
1452
|
+
import_zod15.z.object({
|
|
1513
1453
|
message: TranslationConfig.describe("Custom required validation message")
|
|
1514
1454
|
})
|
|
1515
1455
|
]).default(false).optional();
|
|
1516
|
-
var BaseField =
|
|
1456
|
+
var BaseField = import_zod15.z.object({
|
|
1517
1457
|
id: FieldId.describe("Unique identifier of the field."),
|
|
1518
1458
|
label: TranslationConfig.describe("Human-readable label of the field."),
|
|
1519
|
-
parent: FieldReference.or(
|
|
1459
|
+
parent: FieldReference.or(import_zod15.z.array(FieldReference)).optional().describe(
|
|
1520
1460
|
"Reference to the parent field or fields. When a parent field changes, this field is reset."
|
|
1521
1461
|
),
|
|
1522
1462
|
required: requiredSchema.describe(
|
|
1523
1463
|
"Indicates whether the field is mandatory."
|
|
1524
1464
|
),
|
|
1525
|
-
conditionals:
|
|
1465
|
+
conditionals: import_zod15.z.array(FieldConditional).default([]).optional().describe(
|
|
1526
1466
|
"Conditions determining when the field is shown or enabled. By default, the field is always shown and enabled."
|
|
1527
1467
|
),
|
|
1528
|
-
secured:
|
|
1468
|
+
secured: import_zod15.z.boolean().default(false).optional().describe(
|
|
1529
1469
|
"Indicates whether the field is secured. Secured fields are not indexed for search and are only visible when explicitly assigned."
|
|
1530
1470
|
),
|
|
1531
1471
|
placeholder: TranslationConfig.optional(),
|
|
1532
|
-
validation:
|
|
1472
|
+
validation: import_zod15.z.array(ValidationConfig).default([]).optional().describe("Additional validation rules applied to the field."),
|
|
1533
1473
|
helperText: TranslationConfig.optional(),
|
|
1534
|
-
hideLabel:
|
|
1535
|
-
uncorrectable:
|
|
1474
|
+
hideLabel: import_zod15.z.boolean().default(false).optional(),
|
|
1475
|
+
uncorrectable: import_zod15.z.boolean().default(false).optional().describe(
|
|
1536
1476
|
"Indicates whether the field can be modified during record correction."
|
|
1537
1477
|
),
|
|
1538
|
-
value: FieldReference.or(
|
|
1478
|
+
value: FieldReference.or(import_zod15.z.array(FieldReference)).optional().describe(
|
|
1539
1479
|
"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."
|
|
1540
1480
|
),
|
|
1541
|
-
analytics:
|
|
1481
|
+
analytics: import_zod15.z.boolean().default(false).optional().describe(
|
|
1542
1482
|
"Indicates whether the field is included in analytics. When enabled, its value becomes available in the analytics dashboard."
|
|
1543
1483
|
)
|
|
1544
1484
|
}).describe("Common properties shared across all field types.");
|
|
1545
1485
|
var Divider = BaseField.extend({
|
|
1546
|
-
type:
|
|
1486
|
+
type: import_zod15.z.literal(FieldType.DIVIDER)
|
|
1547
1487
|
});
|
|
1548
1488
|
var TextField = BaseField.extend({
|
|
1549
|
-
type:
|
|
1489
|
+
type: import_zod15.z.literal(FieldType.TEXT),
|
|
1550
1490
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1551
|
-
configuration:
|
|
1552
|
-
maxLength:
|
|
1553
|
-
type:
|
|
1491
|
+
configuration: import_zod15.z.object({
|
|
1492
|
+
maxLength: import_zod15.z.number().optional().describe("Maximum length of the text"),
|
|
1493
|
+
type: import_zod15.z.enum(["text", "password"]).optional(),
|
|
1554
1494
|
prefix: TranslationConfig.optional(),
|
|
1555
1495
|
postfix: TranslationConfig.optional()
|
|
1556
1496
|
}).default({ type: "text" }).optional()
|
|
1557
1497
|
}).describe("Text input");
|
|
1558
1498
|
var NumberField = BaseField.extend({
|
|
1559
|
-
type:
|
|
1499
|
+
type: import_zod15.z.literal(FieldType.NUMBER),
|
|
1560
1500
|
defaultValue: NumberFieldValue.optional(),
|
|
1561
|
-
configuration:
|
|
1562
|
-
min:
|
|
1563
|
-
max:
|
|
1501
|
+
configuration: import_zod15.z.object({
|
|
1502
|
+
min: import_zod15.z.number().optional().describe("Minimum value"),
|
|
1503
|
+
max: import_zod15.z.number().optional().describe("Maximum value"),
|
|
1564
1504
|
prefix: TranslationConfig.optional(),
|
|
1565
1505
|
postfix: TranslationConfig.optional()
|
|
1566
1506
|
}).optional()
|
|
1567
1507
|
}).describe("Number input");
|
|
1568
1508
|
var TextAreaField = BaseField.extend({
|
|
1569
|
-
type:
|
|
1509
|
+
type: import_zod15.z.literal(FieldType.TEXTAREA),
|
|
1570
1510
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1571
|
-
configuration:
|
|
1572
|
-
maxLength:
|
|
1573
|
-
rows:
|
|
1574
|
-
cols:
|
|
1511
|
+
configuration: import_zod15.z.object({
|
|
1512
|
+
maxLength: import_zod15.z.number().optional().describe("Maximum length of the text"),
|
|
1513
|
+
rows: import_zod15.z.number().optional().describe("Number of visible text lines"),
|
|
1514
|
+
cols: import_zod15.z.number().optional().describe("Number of visible columns"),
|
|
1575
1515
|
prefix: TranslationConfig.optional(),
|
|
1576
1516
|
postfix: TranslationConfig.optional()
|
|
1577
1517
|
}).default({ rows: 4 }).optional()
|
|
1578
1518
|
}).describe("Multiline text input");
|
|
1579
|
-
var ImageMimeType =
|
|
1519
|
+
var ImageMimeType = import_zod15.z.enum([
|
|
1580
1520
|
"image/png",
|
|
1581
1521
|
"image/jpg",
|
|
1582
1522
|
"image/jpeg",
|
|
1583
1523
|
"image/svg+xml"
|
|
1584
1524
|
]);
|
|
1585
|
-
var DocumentMimeType =
|
|
1525
|
+
var DocumentMimeType = import_zod15.z.enum([
|
|
1586
1526
|
"application/pdf",
|
|
1587
1527
|
"application/msword",
|
|
1588
1528
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
1589
1529
|
"application/vnd.oasis.opendocument.text"
|
|
1590
1530
|
]);
|
|
1591
|
-
var MimeType =
|
|
1531
|
+
var MimeType = import_zod15.z.enum([
|
|
1592
1532
|
...ImageMimeType.options,
|
|
1593
1533
|
...DocumentMimeType.options
|
|
1594
1534
|
]);
|
|
1595
1535
|
var DEFAULT_MAX_FILE_SIZE_BYTES = 5 * 1024 * 1024;
|
|
1596
1536
|
var SignatureField = BaseField.extend({
|
|
1597
|
-
type:
|
|
1537
|
+
type: import_zod15.z.literal(FieldType.SIGNATURE),
|
|
1598
1538
|
signaturePromptLabel: TranslationConfig.describe(
|
|
1599
1539
|
"Title of the signature modal"
|
|
1600
1540
|
),
|
|
1601
1541
|
defaultValue: SignatureFieldValue.optional(),
|
|
1602
|
-
configuration:
|
|
1603
|
-
maxFileSize:
|
|
1542
|
+
configuration: import_zod15.z.object({
|
|
1543
|
+
maxFileSize: import_zod15.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1604
1544
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
|
1605
1545
|
}).default({
|
|
1606
1546
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1607
1547
|
})
|
|
1608
1548
|
}).describe("Signature input field");
|
|
1609
1549
|
var EmailField = BaseField.extend({
|
|
1610
|
-
type:
|
|
1611
|
-
configuration:
|
|
1612
|
-
maxLength:
|
|
1613
|
-
}).default({ maxLength:
|
|
1550
|
+
type: import_zod15.z.literal(FieldType.EMAIL),
|
|
1551
|
+
configuration: import_zod15.z.object({
|
|
1552
|
+
maxLength: import_zod15.z.number().optional().describe("Maximum length of the text")
|
|
1553
|
+
}).default({ maxLength: 10 }).optional(),
|
|
1614
1554
|
defaultValue: NonEmptyTextValue.optional()
|
|
1615
1555
|
});
|
|
1616
1556
|
var DateField = BaseField.extend({
|
|
1617
|
-
type:
|
|
1557
|
+
type: import_zod15.z.literal(FieldType.DATE),
|
|
1618
1558
|
defaultValue: DateValue.optional(),
|
|
1619
|
-
configuration:
|
|
1559
|
+
configuration: import_zod15.z.object({
|
|
1620
1560
|
notice: TranslationConfig.describe(
|
|
1621
1561
|
"Text to display above the date input"
|
|
1622
1562
|
).optional()
|
|
1623
1563
|
}).optional()
|
|
1624
1564
|
}).describe("A single date input (yyyy-MM-dd)");
|
|
1625
1565
|
var AgeField = BaseField.extend({
|
|
1626
|
-
type:
|
|
1566
|
+
type: import_zod15.z.literal(FieldType.AGE),
|
|
1627
1567
|
defaultValue: NumberFieldValue.optional(),
|
|
1628
|
-
configuration:
|
|
1568
|
+
configuration: import_zod15.z.object({
|
|
1629
1569
|
asOfDate: FieldReference,
|
|
1630
1570
|
prefix: TranslationConfig.optional(),
|
|
1631
1571
|
postfix: TranslationConfig.optional()
|
|
1632
1572
|
})
|
|
1633
1573
|
}).describe("An age input field which uses the current date as the asOfDate");
|
|
1634
1574
|
var TimeField = BaseField.extend({
|
|
1635
|
-
type:
|
|
1575
|
+
type: import_zod15.z.literal(FieldType.TIME),
|
|
1636
1576
|
defaultValue: TimeValue.optional(),
|
|
1637
|
-
configuration:
|
|
1638
|
-
use12HourFormat:
|
|
1577
|
+
configuration: import_zod15.z.object({
|
|
1578
|
+
use12HourFormat: import_zod15.z.boolean().optional().describe("Whether to use 12-hour format"),
|
|
1639
1579
|
notice: TranslationConfig.describe(
|
|
1640
1580
|
"Text to display above the time input"
|
|
1641
1581
|
).optional()
|
|
1642
1582
|
}).optional()
|
|
1643
1583
|
}).describe("A single date input (HH-mm)");
|
|
1644
1584
|
var DateRangeField = BaseField.extend({
|
|
1645
|
-
type:
|
|
1585
|
+
type: import_zod15.z.literal(FieldType.DATE_RANGE),
|
|
1646
1586
|
defaultValue: DateRangeFieldValue.optional(),
|
|
1647
|
-
configuration:
|
|
1587
|
+
configuration: import_zod15.z.object({
|
|
1648
1588
|
notice: TranslationConfig.describe(
|
|
1649
1589
|
"Text to display above the date input"
|
|
1650
1590
|
).optional()
|
|
1651
1591
|
}).optional()
|
|
1652
1592
|
}).describe("A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })");
|
|
1653
|
-
var HtmlFontVariant =
|
|
1593
|
+
var HtmlFontVariant = import_zod15.z.enum([
|
|
1654
1594
|
"reg12",
|
|
1655
1595
|
"reg14",
|
|
1656
1596
|
"reg16",
|
|
@@ -1660,31 +1600,31 @@ var HtmlFontVariant = z16.enum([
|
|
|
1660
1600
|
"h2",
|
|
1661
1601
|
"h1"
|
|
1662
1602
|
]);
|
|
1663
|
-
var ParagraphConfiguration =
|
|
1664
|
-
styles:
|
|
1603
|
+
var ParagraphConfiguration = import_zod15.z.object({
|
|
1604
|
+
styles: import_zod15.z.object({
|
|
1665
1605
|
fontVariant: HtmlFontVariant.optional().describe(
|
|
1666
1606
|
"Font variant to use for the paragraph text"
|
|
1667
1607
|
),
|
|
1668
|
-
hint:
|
|
1608
|
+
hint: import_zod15.z.boolean().optional().describe("When true, paragraph is styled as a hint with grey color")
|
|
1669
1609
|
}).optional()
|
|
1670
1610
|
}).default({});
|
|
1671
1611
|
var Paragraph = BaseField.extend({
|
|
1672
|
-
type:
|
|
1612
|
+
type: import_zod15.z.literal(FieldType.PARAGRAPH),
|
|
1673
1613
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1674
1614
|
configuration: ParagraphConfiguration
|
|
1675
1615
|
}).describe("A read-only HTML <p> paragraph");
|
|
1676
1616
|
var PageHeader = BaseField.extend({
|
|
1677
|
-
type:
|
|
1617
|
+
type: import_zod15.z.literal(FieldType.PAGE_HEADER),
|
|
1678
1618
|
defaultValue: NonEmptyTextValue.optional()
|
|
1679
1619
|
}).describe("A read-only header component for form pages");
|
|
1680
1620
|
var File = BaseField.extend({
|
|
1681
|
-
type:
|
|
1621
|
+
type: import_zod15.z.literal(FieldType.FILE),
|
|
1682
1622
|
defaultValue: FileFieldValue.optional(),
|
|
1683
|
-
configuration:
|
|
1684
|
-
maxFileSize:
|
|
1623
|
+
configuration: import_zod15.z.object({
|
|
1624
|
+
maxFileSize: import_zod15.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1685
1625
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature"),
|
|
1686
|
-
style:
|
|
1687
|
-
width:
|
|
1626
|
+
style: import_zod15.z.object({
|
|
1627
|
+
width: import_zod15.z.enum(["full", "auto"]).optional().describe(
|
|
1688
1628
|
"Whether the file upload button should take the full width of the container or not"
|
|
1689
1629
|
)
|
|
1690
1630
|
}).optional(),
|
|
@@ -1693,34 +1633,46 @@ var File = BaseField.extend({
|
|
|
1693
1633
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1694
1634
|
})
|
|
1695
1635
|
}).describe("File upload");
|
|
1696
|
-
var SelectOption =
|
|
1697
|
-
value:
|
|
1698
|
-
label:
|
|
1636
|
+
var SelectOption = import_zod15.z.object({
|
|
1637
|
+
value: import_zod15.z.string().describe("The value of the option"),
|
|
1638
|
+
label: import_zod15.z.union([import_zod15.z.string(), TranslationConfig]).describe("The label of the option")
|
|
1699
1639
|
});
|
|
1640
|
+
var NumberWithUnitField = BaseField.extend({
|
|
1641
|
+
type: import_zod15.z.literal(FieldType.NUMBER_WITH_UNIT),
|
|
1642
|
+
defaultValue: NumberWithUnitFieldValue.optional(),
|
|
1643
|
+
options: import_zod15.z.array(SelectOption).describe("A list of options for the unit select"),
|
|
1644
|
+
configuration: import_zod15.z.object({
|
|
1645
|
+
min: import_zod15.z.number().optional().describe("Minimum value of the number field"),
|
|
1646
|
+
max: import_zod15.z.number().optional().describe("Maximum value of the number field"),
|
|
1647
|
+
numberFieldPlaceholder: TranslationConfig.optional().describe(
|
|
1648
|
+
"Placeholder for the number field"
|
|
1649
|
+
)
|
|
1650
|
+
}).optional()
|
|
1651
|
+
}).describe("Number with unit input");
|
|
1700
1652
|
var RadioGroup = BaseField.extend({
|
|
1701
|
-
type:
|
|
1653
|
+
type: import_zod15.z.literal(FieldType.RADIO_GROUP),
|
|
1702
1654
|
defaultValue: TextValue.optional(),
|
|
1703
|
-
options:
|
|
1704
|
-
configuration:
|
|
1705
|
-
styles:
|
|
1706
|
-
size:
|
|
1655
|
+
options: import_zod15.z.array(SelectOption).describe("A list of options"),
|
|
1656
|
+
configuration: import_zod15.z.object({
|
|
1657
|
+
styles: import_zod15.z.object({
|
|
1658
|
+
size: import_zod15.z.enum(["NORMAL", "LARGE"]).optional()
|
|
1707
1659
|
}).optional()
|
|
1708
1660
|
}).optional()
|
|
1709
1661
|
}).describe("Grouped radio options");
|
|
1710
1662
|
var BulletList = BaseField.extend({
|
|
1711
|
-
type:
|
|
1663
|
+
type: import_zod15.z.literal(FieldType.BULLET_LIST),
|
|
1712
1664
|
defaultValue: TextValue.optional(),
|
|
1713
|
-
items:
|
|
1714
|
-
configuration:
|
|
1715
|
-
styles:
|
|
1665
|
+
items: import_zod15.z.array(TranslationConfig).describe("A list of items"),
|
|
1666
|
+
configuration: import_zod15.z.object({
|
|
1667
|
+
styles: import_zod15.z.object({
|
|
1716
1668
|
fontVariant: HtmlFontVariant.optional()
|
|
1717
1669
|
}).optional()
|
|
1718
1670
|
}).default({})
|
|
1719
1671
|
}).describe("A list of bullet points");
|
|
1720
1672
|
var Select = BaseField.extend({
|
|
1721
|
-
type:
|
|
1673
|
+
type: import_zod15.z.literal(FieldType.SELECT),
|
|
1722
1674
|
defaultValue: TextValue.optional(),
|
|
1723
|
-
options:
|
|
1675
|
+
options: import_zod15.z.array(SelectOption).describe("A list of options"),
|
|
1724
1676
|
noOptionsMessage: TranslationConfig.optional().describe(
|
|
1725
1677
|
`
|
|
1726
1678
|
A translation configuration object used to display a message when no options are available.
|
|
@@ -1732,34 +1684,34 @@ var Select = BaseField.extend({
|
|
|
1732
1684
|
`
|
|
1733
1685
|
)
|
|
1734
1686
|
}).describe("Select input");
|
|
1735
|
-
var SelectDateRangeOption =
|
|
1687
|
+
var SelectDateRangeOption = import_zod15.z.object({
|
|
1736
1688
|
value: SelectDateRangeValue.describe("The value of the option"),
|
|
1737
1689
|
label: TranslationConfig.describe("The label of the option")
|
|
1738
1690
|
});
|
|
1739
1691
|
var SelectDateRangeField = BaseField.extend({
|
|
1740
|
-
type:
|
|
1692
|
+
type: import_zod15.z.literal(FieldType.SELECT_DATE_RANGE),
|
|
1741
1693
|
defaultValue: SelectDateRangeValue.optional(),
|
|
1742
|
-
options:
|
|
1694
|
+
options: import_zod15.z.array(SelectDateRangeOption).describe("A list of options")
|
|
1743
1695
|
}).describe("Select input with date range options");
|
|
1744
|
-
var NameConfig =
|
|
1745
|
-
firstname:
|
|
1746
|
-
middlename:
|
|
1747
|
-
surname:
|
|
1696
|
+
var NameConfig = import_zod15.z.object({
|
|
1697
|
+
firstname: import_zod15.z.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
1698
|
+
middlename: import_zod15.z.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
1699
|
+
surname: import_zod15.z.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional()
|
|
1748
1700
|
});
|
|
1749
1701
|
var NameField = BaseField.extend({
|
|
1750
|
-
type:
|
|
1751
|
-
defaultValue:
|
|
1702
|
+
type: import_zod15.z.literal(FieldType.NAME),
|
|
1703
|
+
defaultValue: import_zod15.z.object({
|
|
1752
1704
|
firstname: NonEmptyTextValue.optional(),
|
|
1753
1705
|
middlename: NonEmptyTextValue.optional(),
|
|
1754
1706
|
surname: NonEmptyTextValue.optional()
|
|
1755
1707
|
}).optional(),
|
|
1756
|
-
configuration:
|
|
1708
|
+
configuration: import_zod15.z.object({
|
|
1757
1709
|
name: NameConfig.default({
|
|
1758
1710
|
firstname: { required: true },
|
|
1759
1711
|
surname: { required: true }
|
|
1760
1712
|
}).optional(),
|
|
1761
|
-
order:
|
|
1762
|
-
maxLength:
|
|
1713
|
+
order: import_zod15.z.array(import_zod15.z.enum(["firstname", "middlename", "surname"])).optional(),
|
|
1714
|
+
maxLength: import_zod15.z.number().optional().describe("Maximum length of the text"),
|
|
1763
1715
|
prefix: TranslationConfig.optional(),
|
|
1764
1716
|
postfix: TranslationConfig.optional()
|
|
1765
1717
|
}).default({
|
|
@@ -1771,142 +1723,142 @@ var NameField = BaseField.extend({
|
|
|
1771
1723
|
}).describe("Name input field");
|
|
1772
1724
|
var PhoneField = BaseField.extend({
|
|
1773
1725
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1774
|
-
type:
|
|
1726
|
+
type: import_zod15.z.literal(FieldType.PHONE)
|
|
1775
1727
|
}).describe("Phone input field");
|
|
1776
1728
|
var IdField = BaseField.extend({
|
|
1777
1729
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1778
|
-
type:
|
|
1730
|
+
type: import_zod15.z.literal(FieldType.ID)
|
|
1779
1731
|
}).describe("ID input field");
|
|
1780
1732
|
var Checkbox = BaseField.extend({
|
|
1781
|
-
type:
|
|
1733
|
+
type: import_zod15.z.literal(FieldType.CHECKBOX),
|
|
1782
1734
|
defaultValue: CheckboxFieldValue.default(false)
|
|
1783
1735
|
}).describe("Boolean checkbox field");
|
|
1784
1736
|
var Country = BaseField.extend({
|
|
1785
|
-
type:
|
|
1737
|
+
type: import_zod15.z.literal(FieldType.COUNTRY),
|
|
1786
1738
|
defaultValue: NonEmptyTextValue.optional()
|
|
1787
1739
|
}).describe("Country select field");
|
|
1788
|
-
var AdministrativeAreas =
|
|
1740
|
+
var AdministrativeAreas = import_zod15.z.enum([
|
|
1789
1741
|
"ADMIN_STRUCTURE",
|
|
1790
1742
|
"HEALTH_FACILITY",
|
|
1791
1743
|
"CRVS_OFFICE"
|
|
1792
1744
|
]);
|
|
1793
|
-
var AdministrativeAreaConfiguration =
|
|
1794
|
-
partOf:
|
|
1795
|
-
$declaration:
|
|
1745
|
+
var AdministrativeAreaConfiguration = import_zod15.z.object({
|
|
1746
|
+
partOf: import_zod15.z.object({
|
|
1747
|
+
$declaration: import_zod15.z.string()
|
|
1796
1748
|
}).optional().describe("Parent location"),
|
|
1797
1749
|
type: AdministrativeAreas
|
|
1798
1750
|
}).describe("Administrative area options");
|
|
1799
1751
|
var AdministrativeArea = BaseField.extend({
|
|
1800
|
-
type:
|
|
1752
|
+
type: import_zod15.z.literal(FieldType.ADMINISTRATIVE_AREA),
|
|
1801
1753
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1802
1754
|
configuration: AdministrativeAreaConfiguration
|
|
1803
1755
|
}).describe("Administrative area input field e.g. facility, office");
|
|
1804
1756
|
var LocationInput = BaseField.extend({
|
|
1805
|
-
type:
|
|
1757
|
+
type: import_zod15.z.literal(FieldType.LOCATION),
|
|
1806
1758
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1807
|
-
configuration:
|
|
1808
|
-
searchableResource:
|
|
1759
|
+
configuration: import_zod15.z.object({
|
|
1760
|
+
searchableResource: import_zod15.z.array(import_zod15.z.enum(["locations", "facilities", "offices"]))
|
|
1809
1761
|
})
|
|
1810
1762
|
}).describe("Input field for a location");
|
|
1811
1763
|
var FileUploadWithOptions = BaseField.extend({
|
|
1812
|
-
type:
|
|
1813
|
-
options:
|
|
1764
|
+
type: import_zod15.z.literal(FieldType.FILE_WITH_OPTIONS),
|
|
1765
|
+
options: import_zod15.z.array(SelectOption).describe("A list of options"),
|
|
1814
1766
|
defaultValue: FileFieldWithOptionValue.optional(),
|
|
1815
|
-
configuration:
|
|
1816
|
-
maxFileSize:
|
|
1767
|
+
configuration: import_zod15.z.object({
|
|
1768
|
+
maxFileSize: import_zod15.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1817
1769
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
|
1818
1770
|
}).default({
|
|
1819
1771
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1820
1772
|
})
|
|
1821
1773
|
});
|
|
1822
1774
|
var Facility = BaseField.extend({
|
|
1823
|
-
type:
|
|
1775
|
+
type: import_zod15.z.literal(FieldType.FACILITY),
|
|
1824
1776
|
defaultValue: NonEmptyTextValue.optional()
|
|
1825
1777
|
}).describe("Input field for a facility");
|
|
1826
1778
|
var Office = BaseField.extend({
|
|
1827
|
-
type:
|
|
1779
|
+
type: import_zod15.z.literal(FieldType.OFFICE),
|
|
1828
1780
|
defaultValue: NonEmptyTextValue.optional()
|
|
1829
1781
|
}).describe("Input field for an office");
|
|
1830
1782
|
var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
|
|
1831
|
-
administrativeArea:
|
|
1783
|
+
administrativeArea: import_zod15.z.union([UUID, SerializedUserField]).optional()
|
|
1832
1784
|
});
|
|
1833
1785
|
var Address = BaseField.extend({
|
|
1834
|
-
type:
|
|
1835
|
-
configuration:
|
|
1836
|
-
lineSeparator:
|
|
1837
|
-
fields:
|
|
1838
|
-
administrativeLevels:
|
|
1839
|
-
streetAddressForm:
|
|
1840
|
-
|
|
1841
|
-
id:
|
|
1786
|
+
type: import_zod15.z.literal(FieldType.ADDRESS),
|
|
1787
|
+
configuration: import_zod15.z.object({
|
|
1788
|
+
lineSeparator: import_zod15.z.string().optional(),
|
|
1789
|
+
fields: import_zod15.z.array(import_zod15.z.enum(["country", "administrativeArea"])).optional(),
|
|
1790
|
+
administrativeLevels: import_zod15.z.array(import_zod15.z.string()).optional(),
|
|
1791
|
+
streetAddressForm: import_zod15.z.array(
|
|
1792
|
+
import_zod15.z.object({
|
|
1793
|
+
id: import_zod15.z.string(),
|
|
1842
1794
|
required: requiredSchema,
|
|
1843
1795
|
label: TranslationConfig,
|
|
1844
|
-
type:
|
|
1845
|
-
conditionals:
|
|
1796
|
+
type: import_zod15.z.literal(FieldType.TEXT),
|
|
1797
|
+
conditionals: import_zod15.z.array(FieldConditional).default([]).optional(),
|
|
1846
1798
|
parent: FieldReference.optional()
|
|
1847
1799
|
})
|
|
1848
1800
|
).optional()
|
|
1849
1801
|
}).optional(),
|
|
1850
1802
|
defaultValue: DefaultAddressFieldValue.optional()
|
|
1851
1803
|
}).describe("Address input field \u2013 a combination of location and text fields");
|
|
1852
|
-
var StaticDataEntry =
|
|
1853
|
-
id:
|
|
1804
|
+
var StaticDataEntry = import_zod15.z.object({
|
|
1805
|
+
id: import_zod15.z.string().describe("ID for the data entry."),
|
|
1854
1806
|
label: TranslationConfig,
|
|
1855
|
-
value: TranslationConfig.or(
|
|
1807
|
+
value: TranslationConfig.or(import_zod15.z.string()).or(FieldReference)
|
|
1856
1808
|
}).describe("Static data entry");
|
|
1857
|
-
var DataEntry =
|
|
1809
|
+
var DataEntry = import_zod15.z.union([StaticDataEntry, import_zod15.z.object({ fieldId: import_zod15.z.string() })]).describe(
|
|
1858
1810
|
"Data entry can be either a static data entry, or a reference to another field in the current form or the declaration."
|
|
1859
1811
|
);
|
|
1860
1812
|
var DataField = BaseField.extend({
|
|
1861
|
-
type:
|
|
1862
|
-
configuration:
|
|
1813
|
+
type: import_zod15.z.literal(FieldType.DATA),
|
|
1814
|
+
configuration: import_zod15.z.object({
|
|
1863
1815
|
subtitle: TranslationConfig.optional(),
|
|
1864
|
-
data:
|
|
1816
|
+
data: import_zod15.z.array(DataEntry)
|
|
1865
1817
|
})
|
|
1866
1818
|
}).describe("Data field for displaying read-only data");
|
|
1867
1819
|
var ButtonField = BaseField.extend({
|
|
1868
|
-
type:
|
|
1820
|
+
type: import_zod15.z.literal(FieldType.BUTTON),
|
|
1869
1821
|
defaultValue: ButtonFieldValue.optional(),
|
|
1870
|
-
configuration:
|
|
1871
|
-
icon:
|
|
1822
|
+
configuration: import_zod15.z.object({
|
|
1823
|
+
icon: import_zod15.z.string().optional().describe(
|
|
1872
1824
|
"Icon for the button. You can find icons from OpenCRVS UI-Kit."
|
|
1873
1825
|
),
|
|
1874
|
-
loading:
|
|
1826
|
+
loading: import_zod15.z.boolean().optional().describe("Whether the button is in a loading state and shows a spinner"),
|
|
1875
1827
|
text: TranslationConfig.describe("Text to display on the button")
|
|
1876
1828
|
})
|
|
1877
1829
|
}).describe("Generic button without any built-in functionality");
|
|
1878
1830
|
var AlphaPrintButton = BaseField.extend({
|
|
1879
|
-
type:
|
|
1880
|
-
configuration:
|
|
1881
|
-
template:
|
|
1831
|
+
type: import_zod15.z.literal(FieldType.ALPHA_PRINT_BUTTON),
|
|
1832
|
+
configuration: import_zod15.z.object({
|
|
1833
|
+
template: import_zod15.z.string().describe("Template ID from countryconfig templates to use for printing"),
|
|
1882
1834
|
buttonLabel: TranslationConfig.optional().describe(
|
|
1883
1835
|
"Label for the print button"
|
|
1884
1836
|
)
|
|
1885
1837
|
})
|
|
1886
1838
|
}).describe("Print button field for printing certificates");
|
|
1887
1839
|
var HttpField = BaseField.extend({
|
|
1888
|
-
type:
|
|
1840
|
+
type: import_zod15.z.literal(FieldType.HTTP),
|
|
1889
1841
|
defaultValue: HttpFieldValue.optional(),
|
|
1890
|
-
configuration:
|
|
1842
|
+
configuration: import_zod15.z.object({
|
|
1891
1843
|
trigger: FieldReference,
|
|
1892
|
-
url:
|
|
1893
|
-
method:
|
|
1894
|
-
headers:
|
|
1895
|
-
body:
|
|
1896
|
-
errorValue:
|
|
1897
|
-
params:
|
|
1898
|
-
timeout:
|
|
1844
|
+
url: import_zod15.z.string().describe("URL to send the HTTP request to"),
|
|
1845
|
+
method: import_zod15.z.enum(["GET", "POST", "PUT", "DELETE"]),
|
|
1846
|
+
headers: import_zod15.z.record(import_zod15.z.string()).optional(),
|
|
1847
|
+
body: import_zod15.z.record(import_zod15.z.any()).optional(),
|
|
1848
|
+
errorValue: import_zod15.z.any().optional().describe("Value to set if the request fails"),
|
|
1849
|
+
params: import_zod15.z.record(import_zod15.z.string(), import_zod15.z.union([import_zod15.z.string(), FieldReference])).optional(),
|
|
1850
|
+
timeout: import_zod15.z.number().default(15e3).describe("Request timeout in milliseconds")
|
|
1899
1851
|
})
|
|
1900
1852
|
}).describe("HTTP request function triggered by a button click or other event");
|
|
1901
1853
|
var SearchField = HttpField.extend({
|
|
1902
|
-
type:
|
|
1854
|
+
type: import_zod15.z.literal(FieldType.SEARCH),
|
|
1903
1855
|
configuration: SearchQuery.pick({
|
|
1904
1856
|
query: true,
|
|
1905
1857
|
limit: true,
|
|
1906
1858
|
offset: true
|
|
1907
1859
|
}).extend({
|
|
1908
1860
|
validation: ValidationConfig,
|
|
1909
|
-
indicators:
|
|
1861
|
+
indicators: import_zod15.z.object({
|
|
1910
1862
|
loading: TranslationConfig.optional().describe(
|
|
1911
1863
|
"Text to display while the search is in progress"
|
|
1912
1864
|
),
|
|
@@ -1921,7 +1873,7 @@ var SearchField = HttpField.extend({
|
|
|
1921
1873
|
),
|
|
1922
1874
|
confirmButton: TranslationConfig.optional(),
|
|
1923
1875
|
clearButton: TranslationConfig.optional(),
|
|
1924
|
-
clearModal:
|
|
1876
|
+
clearModal: import_zod15.z.object({
|
|
1925
1877
|
title: TranslationConfig.optional(),
|
|
1926
1878
|
description: TranslationConfig.optional(),
|
|
1927
1879
|
cancel: TranslationConfig.optional(),
|
|
@@ -1932,17 +1884,17 @@ var SearchField = HttpField.extend({
|
|
|
1932
1884
|
})
|
|
1933
1885
|
});
|
|
1934
1886
|
var LinkButtonField = BaseField.extend({
|
|
1935
|
-
type:
|
|
1936
|
-
configuration:
|
|
1937
|
-
url:
|
|
1887
|
+
type: import_zod15.z.literal(FieldType.LINK_BUTTON),
|
|
1888
|
+
configuration: import_zod15.z.object({
|
|
1889
|
+
url: import_zod15.z.string().describe("URL to open"),
|
|
1938
1890
|
text: TranslationConfig.describe("Text to display on the button"),
|
|
1939
|
-
icon:
|
|
1891
|
+
icon: import_zod15.z.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit.")
|
|
1940
1892
|
})
|
|
1941
1893
|
}).describe("Button that opens a link");
|
|
1942
1894
|
var VerificationStatus = BaseField.extend({
|
|
1943
|
-
type:
|
|
1895
|
+
type: import_zod15.z.literal(FieldType.VERIFICATION_STATUS),
|
|
1944
1896
|
defaultValue: VerificationStatusValue.optional(),
|
|
1945
|
-
configuration:
|
|
1897
|
+
configuration: import_zod15.z.object({
|
|
1946
1898
|
status: TranslationConfig.describe("Text to display on the status pill."),
|
|
1947
1899
|
description: TranslationConfig.describe(
|
|
1948
1900
|
"Explaining text on the banner in form."
|
|
@@ -1950,52 +1902,42 @@ var VerificationStatus = BaseField.extend({
|
|
|
1950
1902
|
})
|
|
1951
1903
|
});
|
|
1952
1904
|
var QueryParamReaderField = BaseField.extend({
|
|
1953
|
-
type:
|
|
1954
|
-
configuration:
|
|
1955
|
-
pickParams:
|
|
1905
|
+
type: import_zod15.z.literal(FieldType.QUERY_PARAM_READER),
|
|
1906
|
+
configuration: import_zod15.z.object({
|
|
1907
|
+
pickParams: import_zod15.z.array(import_zod15.z.string()).describe("List of query parameters to read from the URL")
|
|
1956
1908
|
})
|
|
1957
1909
|
}).describe(
|
|
1958
1910
|
"A field that maps URL query params into form values and clears them afterward"
|
|
1959
1911
|
);
|
|
1960
1912
|
var QrReaderField = BaseField.extend({
|
|
1961
|
-
type:
|
|
1913
|
+
type: import_zod15.z.literal(FieldType.QR_READER),
|
|
1962
1914
|
defaultValue: QrReaderFieldValue.optional(),
|
|
1963
|
-
configuration:
|
|
1964
|
-
validator:
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
})
|
|
1915
|
+
configuration: import_zod15.z.object({
|
|
1916
|
+
validator: import_zod15.z.custom(
|
|
1917
|
+
(val) => typeof val === "object" && val !== null
|
|
1918
|
+
)
|
|
1968
1919
|
}).optional()
|
|
1969
|
-
}).meta({
|
|
1970
|
-
description: "Configuration for QR code reader field, including optional JSON Schema validator.",
|
|
1971
|
-
id: "QrReaderField"
|
|
1972
1920
|
});
|
|
1973
1921
|
var IdReaderField = BaseField.extend({
|
|
1974
|
-
type:
|
|
1922
|
+
type: import_zod15.z.literal(FieldType.ID_READER),
|
|
1975
1923
|
defaultValue: IdReaderFieldValue.optional(),
|
|
1976
|
-
methods:
|
|
1977
|
-
|
|
1924
|
+
methods: import_zod15.z.array(
|
|
1925
|
+
import_zod15.z.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
|
|
1978
1926
|
)
|
|
1979
1927
|
});
|
|
1980
1928
|
var LoaderField = BaseField.extend({
|
|
1981
|
-
type:
|
|
1982
|
-
configuration:
|
|
1929
|
+
type: import_zod15.z.literal(FieldType.LOADER),
|
|
1930
|
+
configuration: import_zod15.z.object({
|
|
1983
1931
|
text: TranslationConfig.describe("Display text above the loading spinner")
|
|
1984
1932
|
})
|
|
1985
1933
|
}).describe(
|
|
1986
1934
|
"A non-interactive field that indicates an in progress operation in form"
|
|
1987
1935
|
);
|
|
1988
|
-
var
|
|
1989
|
-
type: z16.literal(FieldType.ALPHA_HIDDEN),
|
|
1990
|
-
required: z16.boolean().default(false).optional(),
|
|
1991
|
-
defaultValue: TextValue.optional()
|
|
1992
|
-
}).describe(
|
|
1993
|
-
"A non-interactive, hidden field that only hold a value in the form"
|
|
1994
|
-
);
|
|
1995
|
-
var FieldConfig = z16.discriminatedUnion("type", [
|
|
1936
|
+
var FieldConfig = import_zod15.z.discriminatedUnion("type", [
|
|
1996
1937
|
Address,
|
|
1997
1938
|
TextField,
|
|
1998
1939
|
NumberField,
|
|
1940
|
+
NumberWithUnitField,
|
|
1999
1941
|
TextAreaField,
|
|
2000
1942
|
AgeField,
|
|
2001
1943
|
DateField,
|
|
@@ -2031,80 +1973,83 @@ var FieldConfig = z16.discriminatedUnion("type", [
|
|
|
2031
1973
|
IdReaderField,
|
|
2032
1974
|
QueryParamReaderField,
|
|
2033
1975
|
LoaderField,
|
|
2034
|
-
SearchField
|
|
2035
|
-
|
|
2036
|
-
]).meta({
|
|
1976
|
+
SearchField
|
|
1977
|
+
]).openapi({
|
|
2037
1978
|
description: "Form field configuration",
|
|
2038
|
-
|
|
1979
|
+
ref: "FieldConfig"
|
|
2039
1980
|
});
|
|
2040
|
-
var AnyFileField =
|
|
1981
|
+
var AnyFileField = import_zod15.z.discriminatedUnion("type", [
|
|
2041
1982
|
SignatureField,
|
|
2042
1983
|
File,
|
|
2043
1984
|
FileUploadWithOptions
|
|
2044
1985
|
]);
|
|
2045
1986
|
|
|
2046
1987
|
// ../commons/src/events/FormConfig.ts
|
|
2047
|
-
var
|
|
1988
|
+
var import_zod17 = require("zod");
|
|
2048
1989
|
|
|
2049
1990
|
// ../commons/src/events/PageConfig.ts
|
|
2050
|
-
var
|
|
2051
|
-
var
|
|
2052
|
-
|
|
2053
|
-
|
|
1991
|
+
var import_zod16 = require("zod");
|
|
1992
|
+
var import_zod_openapi7 = require("zod-openapi");
|
|
1993
|
+
(0, import_zod_openapi7.extendZodWithOpenApi)(import_zod16.z);
|
|
1994
|
+
var PageTypes = import_zod16.z.enum(["FORM", "VERIFICATION"]);
|
|
1995
|
+
var PageConfigBase = import_zod16.z.object({
|
|
1996
|
+
id: import_zod16.z.string().describe("Unique identifier for the page"),
|
|
2054
1997
|
title: TranslationConfig.describe("Header title of the page"),
|
|
2055
|
-
requireCompletionToContinue:
|
|
1998
|
+
requireCompletionToContinue: import_zod16.z.boolean().default(false).describe(
|
|
2056
1999
|
"If true, all required fields must be filled before continuing to the next page"
|
|
2057
2000
|
),
|
|
2058
|
-
fields:
|
|
2001
|
+
fields: import_zod16.z.array(FieldConfig).describe("Fields to be rendered on the page"),
|
|
2059
2002
|
conditional: Conditional.optional().describe(
|
|
2060
2003
|
"Page will be shown if condition is met. If conditional is not defined, the page will be always shown."
|
|
2061
2004
|
)
|
|
2062
|
-
}).
|
|
2005
|
+
}).openapi({
|
|
2063
2006
|
description: "Form page configuration",
|
|
2064
|
-
|
|
2007
|
+
ref: "FormPageConfig"
|
|
2065
2008
|
});
|
|
2066
2009
|
var FormPageConfig = PageConfigBase.extend({
|
|
2067
|
-
type:
|
|
2010
|
+
type: import_zod16.z.literal(PageTypes.enum.FORM).default(PageTypes.enum.FORM)
|
|
2068
2011
|
});
|
|
2069
|
-
var VerificationActionConfig =
|
|
2070
|
-
verify:
|
|
2071
|
-
cancel:
|
|
2012
|
+
var VerificationActionConfig = import_zod16.z.object({
|
|
2013
|
+
verify: import_zod16.z.object({ label: TranslationConfig }),
|
|
2014
|
+
cancel: import_zod16.z.object({
|
|
2072
2015
|
label: TranslationConfig,
|
|
2073
|
-
confirmation:
|
|
2016
|
+
confirmation: import_zod16.z.object({
|
|
2074
2017
|
title: TranslationConfig,
|
|
2075
2018
|
body: TranslationConfig
|
|
2076
2019
|
})
|
|
2077
2020
|
})
|
|
2078
|
-
}).describe("Actions available on the verification page").
|
|
2021
|
+
}).describe("Actions available on the verification page").openapi({
|
|
2079
2022
|
description: "Verification action configuration",
|
|
2080
|
-
|
|
2023
|
+
ref: "VerificationActionConfig"
|
|
2081
2024
|
});
|
|
2082
2025
|
var VerificationPageConfig = FormPageConfig.extend({
|
|
2083
|
-
type:
|
|
2026
|
+
type: import_zod16.z.literal(PageTypes.enum.VERIFICATION),
|
|
2084
2027
|
actions: VerificationActionConfig
|
|
2085
2028
|
});
|
|
2086
|
-
var PageConfig =
|
|
2029
|
+
var PageConfig = import_zod16.z.discriminatedUnion("type", [
|
|
2087
2030
|
FormPageConfig,
|
|
2088
2031
|
VerificationPageConfig
|
|
2089
2032
|
]);
|
|
2090
2033
|
|
|
2091
2034
|
// ../commons/src/events/FormConfig.ts
|
|
2092
|
-
var DeclarationFormConfig =
|
|
2035
|
+
var DeclarationFormConfig = import_zod17.z.object({
|
|
2093
2036
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2094
|
-
pages:
|
|
2037
|
+
pages: import_zod17.z.array(FormPageConfig)
|
|
2095
2038
|
}).describe("Configuration of the declaration form.");
|
|
2096
|
-
var ActionFormConfig =
|
|
2039
|
+
var ActionFormConfig = import_zod17.z.object({
|
|
2097
2040
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2098
|
-
pages:
|
|
2041
|
+
pages: import_zod17.z.array(PageConfig)
|
|
2099
2042
|
}).describe(
|
|
2100
2043
|
"Configuration of the form used for system actions beyond declaration, supporting a wider range of page types."
|
|
2101
2044
|
);
|
|
2102
|
-
var FormConfig =
|
|
2045
|
+
var FormConfig = import_zod17.z.union([DeclarationFormConfig, ActionFormConfig]);
|
|
2103
2046
|
|
|
2104
2047
|
// ../commons/src/events/DeduplicationConfig.ts
|
|
2105
|
-
var
|
|
2106
|
-
var
|
|
2107
|
-
|
|
2048
|
+
var import_zod18 = require("zod");
|
|
2049
|
+
var import_zod_openapi8 = require("zod-openapi");
|
|
2050
|
+
(0, import_zod_openapi8.extendZodWithOpenApi)(import_zod18.z);
|
|
2051
|
+
var FieldReference2 = import_zod18.z.string();
|
|
2052
|
+
var Matcher = import_zod18.z.object({
|
|
2108
2053
|
/**
|
|
2109
2054
|
* Reference to the field used in matching.
|
|
2110
2055
|
*
|
|
@@ -2112,68 +2057,68 @@ var Matcher = z19.object({
|
|
|
2112
2057
|
* be used as the origin date to calculate the distance from.
|
|
2113
2058
|
*/
|
|
2114
2059
|
fieldId: FieldReference2,
|
|
2115
|
-
options:
|
|
2116
|
-
boost:
|
|
2060
|
+
options: import_zod18.z.object({
|
|
2061
|
+
boost: import_zod18.z.number().optional()
|
|
2117
2062
|
}).optional().default({
|
|
2118
2063
|
boost: 1
|
|
2119
2064
|
})
|
|
2120
2065
|
});
|
|
2121
2066
|
var FuzzyMatcher = Matcher.extend({
|
|
2122
|
-
type:
|
|
2123
|
-
options:
|
|
2067
|
+
type: import_zod18.z.literal("fuzzy"),
|
|
2068
|
+
options: import_zod18.z.object({
|
|
2124
2069
|
/**
|
|
2125
2070
|
* Names of length 3 or less characters = 0 edits allowed
|
|
2126
2071
|
* Names of length 4 - 6 characters = 1 edit allowed
|
|
2127
2072
|
* Names of length >7 characters = 2 edits allowed
|
|
2128
2073
|
*/
|
|
2129
|
-
fuzziness:
|
|
2130
|
-
boost:
|
|
2074
|
+
fuzziness: import_zod18.z.union([import_zod18.z.string(), import_zod18.z.number()]).optional().default("AUTO:4,7"),
|
|
2075
|
+
boost: import_zod18.z.number().optional().default(1)
|
|
2131
2076
|
}).optional().default({
|
|
2132
2077
|
fuzziness: "AUTO:4,7",
|
|
2133
2078
|
boost: 1
|
|
2134
2079
|
})
|
|
2135
2080
|
});
|
|
2136
2081
|
var StrictMatcher = Matcher.extend({
|
|
2137
|
-
type:
|
|
2138
|
-
options:
|
|
2139
|
-
boost:
|
|
2082
|
+
type: import_zod18.z.literal("strict"),
|
|
2083
|
+
options: import_zod18.z.object({
|
|
2084
|
+
boost: import_zod18.z.number().optional().default(1),
|
|
2140
2085
|
/**
|
|
2141
2086
|
* The constant value to be present in the field for both records
|
|
2142
2087
|
*/
|
|
2143
|
-
value:
|
|
2088
|
+
value: import_zod18.z.string().optional()
|
|
2144
2089
|
}).optional().default({
|
|
2145
2090
|
boost: 1
|
|
2146
2091
|
})
|
|
2147
2092
|
});
|
|
2148
2093
|
var DateRangeMatcher = Matcher.extend({
|
|
2149
|
-
type:
|
|
2150
|
-
options:
|
|
2094
|
+
type: import_zod18.z.literal("dateRange"),
|
|
2095
|
+
options: import_zod18.z.object({
|
|
2151
2096
|
/**
|
|
2152
2097
|
* The distance pivot in days. Distance from the origin (the value of
|
|
2153
2098
|
* fieldId) at which relevance scores receive half of the boost value
|
|
2154
2099
|
*/
|
|
2155
|
-
pivot:
|
|
2156
|
-
days:
|
|
2157
|
-
boost:
|
|
2100
|
+
pivot: import_zod18.z.number().optional(),
|
|
2101
|
+
days: import_zod18.z.number(),
|
|
2102
|
+
boost: import_zod18.z.number().optional().default(1)
|
|
2158
2103
|
})
|
|
2159
2104
|
});
|
|
2160
|
-
var Not =
|
|
2161
|
-
type:
|
|
2105
|
+
var Not = import_zod18.z.object({
|
|
2106
|
+
type: import_zod18.z.literal("not"),
|
|
2162
2107
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2163
|
-
clause:
|
|
2108
|
+
clause: import_zod18.z.lazy(() => Clause)
|
|
2164
2109
|
});
|
|
2165
|
-
var And =
|
|
2166
|
-
type:
|
|
2110
|
+
var And = import_zod18.z.object({
|
|
2111
|
+
type: import_zod18.z.literal("and"),
|
|
2167
2112
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2168
|
-
clauses:
|
|
2113
|
+
clauses: import_zod18.z.lazy(() => Clause.array())
|
|
2169
2114
|
});
|
|
2170
|
-
var Or =
|
|
2171
|
-
type:
|
|
2115
|
+
var Or = import_zod18.z.object({
|
|
2116
|
+
type: import_zod18.z.literal("or"),
|
|
2172
2117
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2173
|
-
clauses:
|
|
2118
|
+
clauses: import_zod18.z.lazy(() => Clause.array())
|
|
2174
2119
|
});
|
|
2175
|
-
var Clause =
|
|
2176
|
-
() =>
|
|
2120
|
+
var Clause = import_zod18.z.lazy(
|
|
2121
|
+
() => import_zod18.z.discriminatedUnion("type", [
|
|
2177
2122
|
Not,
|
|
2178
2123
|
And,
|
|
2179
2124
|
Or,
|
|
@@ -2181,299 +2126,193 @@ var Clause = z19.lazy(
|
|
|
2181
2126
|
StrictMatcher,
|
|
2182
2127
|
DateRangeMatcher
|
|
2183
2128
|
])
|
|
2184
|
-
).
|
|
2185
|
-
|
|
2129
|
+
).openapi({
|
|
2130
|
+
ref: "Clause"
|
|
2186
2131
|
});
|
|
2187
|
-
var DeduplicationConfig =
|
|
2188
|
-
id:
|
|
2132
|
+
var DeduplicationConfig = import_zod18.z.object({
|
|
2133
|
+
id: import_zod18.z.string(),
|
|
2189
2134
|
label: TranslationConfig,
|
|
2190
2135
|
query: Clause
|
|
2191
2136
|
});
|
|
2192
2137
|
|
|
2193
|
-
// ../commons/src/icons.ts
|
|
2194
|
-
var z20 = __toESM(require("zod/v4"));
|
|
2195
|
-
var AvailableIcons = z20.enum([
|
|
2196
|
-
"Archived",
|
|
2197
|
-
"Assigned",
|
|
2198
|
-
"Certified",
|
|
2199
|
-
"Close",
|
|
2200
|
-
"Collapse",
|
|
2201
|
-
"Draft",
|
|
2202
|
-
"DuplicateYellow",
|
|
2203
|
-
"Expand",
|
|
2204
|
-
"ExternalValidate",
|
|
2205
|
-
"FilledCheck",
|
|
2206
|
-
"InReview",
|
|
2207
|
-
"Offline",
|
|
2208
|
-
"Registered",
|
|
2209
|
-
"RequiresUpdates",
|
|
2210
|
-
"Sent",
|
|
2211
|
-
"Validated",
|
|
2212
|
-
"WaitingApproval",
|
|
2213
|
-
"ChartActivity",
|
|
2214
|
-
"Activity",
|
|
2215
|
-
"Archive",
|
|
2216
|
-
"ArchiveTray",
|
|
2217
|
-
"ArrowLeft",
|
|
2218
|
-
"ArrowRight",
|
|
2219
|
-
"Buildings",
|
|
2220
|
-
"Circle",
|
|
2221
|
-
"CaretDown",
|
|
2222
|
-
"CaretLeft",
|
|
2223
|
-
"CaretRight",
|
|
2224
|
-
"ChartBar",
|
|
2225
|
-
"ChartLine",
|
|
2226
|
-
"ChatCircle",
|
|
2227
|
-
"CheckSquare",
|
|
2228
|
-
"Compass",
|
|
2229
|
-
"Check",
|
|
2230
|
-
"Copy",
|
|
2231
|
-
"Database",
|
|
2232
|
-
"DotsThreeVertical",
|
|
2233
|
-
"ArrowCounterClockwise",
|
|
2234
|
-
"MagnifyingGlassMinus",
|
|
2235
|
-
"MagnifyingGlassPlus",
|
|
2236
|
-
"Export",
|
|
2237
|
-
"Eye",
|
|
2238
|
-
"EyeSlash",
|
|
2239
|
-
"Envelope",
|
|
2240
|
-
"File",
|
|
2241
|
-
"FileSearch",
|
|
2242
|
-
"FileMinus",
|
|
2243
|
-
"FilePlus",
|
|
2244
|
-
"FileText",
|
|
2245
|
-
"FileX",
|
|
2246
|
-
"Handshake",
|
|
2247
|
-
"Gear",
|
|
2248
|
-
"GitBranch",
|
|
2249
|
-
"IdentificationCard",
|
|
2250
|
-
"List",
|
|
2251
|
-
"ListBullets",
|
|
2252
|
-
"Lock",
|
|
2253
|
-
"MagnifyingGlass",
|
|
2254
|
-
"MapPin",
|
|
2255
|
-
"Medal",
|
|
2256
|
-
"NotePencil",
|
|
2257
|
-
"Paperclip",
|
|
2258
|
-
"PaperPlaneTilt",
|
|
2259
|
-
"Pen",
|
|
2260
|
-
"Pencil",
|
|
2261
|
-
"PencilSimpleLine",
|
|
2262
|
-
"Phone",
|
|
2263
|
-
"Plus",
|
|
2264
|
-
"Printer",
|
|
2265
|
-
"SignOut",
|
|
2266
|
-
"Stamp",
|
|
2267
|
-
"Star",
|
|
2268
|
-
"Target",
|
|
2269
|
-
"TextT",
|
|
2270
|
-
"Trash",
|
|
2271
|
-
"UploadSimple",
|
|
2272
|
-
"User",
|
|
2273
|
-
"UserPlus",
|
|
2274
|
-
"Users",
|
|
2275
|
-
"WarningCircle",
|
|
2276
|
-
"X",
|
|
2277
|
-
"ChatText",
|
|
2278
|
-
"CircleWavyCheck",
|
|
2279
|
-
"CircleWavyQuestion",
|
|
2280
|
-
"ArchiveBox",
|
|
2281
|
-
"ArrowCircleDown",
|
|
2282
|
-
"FileArrowUp",
|
|
2283
|
-
"FileDotted",
|
|
2284
|
-
"Files",
|
|
2285
|
-
"PencilLine",
|
|
2286
|
-
"PencilCircle",
|
|
2287
|
-
"UserCircle",
|
|
2288
|
-
"Clock",
|
|
2289
|
-
"QrCode",
|
|
2290
|
-
"Webcam",
|
|
2291
|
-
"Sun",
|
|
2292
|
-
"DeviceTabletCamera",
|
|
2293
|
-
"Globe",
|
|
2294
|
-
"Fingerprint",
|
|
2295
|
-
"PushPin",
|
|
2296
|
-
"Timer"
|
|
2297
|
-
]);
|
|
2298
|
-
|
|
2299
2138
|
// ../commons/src/events/ActionConfig.ts
|
|
2300
|
-
var
|
|
2139
|
+
var import_zod_openapi9 = require("zod-openapi");
|
|
2140
|
+
(0, import_zod_openapi9.extendZodWithOpenApi)(import_zod19.z);
|
|
2141
|
+
var DeclarationReviewConfig = import_zod19.z.object({
|
|
2301
2142
|
title: TranslationConfig.describe("Title of the review page"),
|
|
2302
|
-
fields:
|
|
2143
|
+
fields: import_zod19.z.array(FieldConfig).describe("Fields displayed on the review page for annotations.")
|
|
2303
2144
|
}).describe(
|
|
2304
2145
|
"Configuration of the declaration review page for collecting event-related metadata."
|
|
2305
2146
|
);
|
|
2306
|
-
var ActionConfigBase =
|
|
2307
|
-
label: TranslationConfig.describe("Human readable description of the action")
|
|
2308
|
-
flags: z21.array(ActionFlagConfig).optional().default([]).describe("Flag actions which are executed when the action is performed."),
|
|
2309
|
-
auditHistoryLabel: TranslationConfig.describe(
|
|
2310
|
-
'The label to show in audit history for this action. For example "Approved".'
|
|
2311
|
-
).optional(),
|
|
2312
|
-
supportingCopy: TranslationConfig.optional().describe(
|
|
2313
|
-
"Text displayed on the confirmation"
|
|
2314
|
-
),
|
|
2315
|
-
icon: AvailableIcons.describe("Icon representing the action").optional(),
|
|
2316
|
-
conditionals: z21.array(ActionConditional).optional().describe("Conditionals which can disable or hide actions.")
|
|
2147
|
+
var ActionConfigBase = import_zod19.z.object({
|
|
2148
|
+
label: TranslationConfig.describe("Human readable description of the action")
|
|
2317
2149
|
});
|
|
2318
2150
|
var DeclarationActionBase = ActionConfigBase.extend({
|
|
2151
|
+
review: DeclarationReviewConfig,
|
|
2319
2152
|
deduplication: DeduplicationConfig.optional()
|
|
2320
2153
|
});
|
|
2321
|
-
var ReadActionConfig = ActionConfigBase.
|
|
2322
|
-
|
|
2323
|
-
type:
|
|
2154
|
+
var ReadActionConfig = ActionConfigBase.merge(
|
|
2155
|
+
import_zod19.z.object({
|
|
2156
|
+
type: import_zod19.z.literal(ActionType.READ),
|
|
2324
2157
|
review: DeclarationReviewConfig.describe(
|
|
2325
2158
|
"Configuration of the review page for read-only view."
|
|
2326
|
-
),
|
|
2327
|
-
conditionals: z21.never().optional().describe("Read-action can not be disabled or hidden with conditionals.")
|
|
2328
|
-
}).shape
|
|
2329
|
-
);
|
|
2330
|
-
var DeclareConfig = DeclarationActionBase.extend(
|
|
2331
|
-
z21.object({
|
|
2332
|
-
type: z21.literal(ActionType.DECLARE),
|
|
2333
|
-
review: DeclarationReviewConfig.describe(
|
|
2334
|
-
"Configuration of the review page fields."
|
|
2335
2159
|
)
|
|
2336
|
-
})
|
|
2160
|
+
})
|
|
2161
|
+
);
|
|
2162
|
+
var DeclareConfig = DeclarationActionBase.merge(
|
|
2163
|
+
import_zod19.z.object({
|
|
2164
|
+
type: import_zod19.z.literal(ActionType.DECLARE)
|
|
2165
|
+
})
|
|
2337
2166
|
);
|
|
2338
|
-
var
|
|
2339
|
-
|
|
2340
|
-
type:
|
|
2341
|
-
})
|
|
2167
|
+
var ValidateConfig = DeclarationActionBase.merge(
|
|
2168
|
+
import_zod19.z.object({
|
|
2169
|
+
type: import_zod19.z.literal(ActionType.VALIDATE)
|
|
2170
|
+
})
|
|
2171
|
+
);
|
|
2172
|
+
var RegisterConfig = DeclarationActionBase.merge(
|
|
2173
|
+
import_zod19.z.object({
|
|
2174
|
+
type: import_zod19.z.literal(ActionType.REGISTER)
|
|
2175
|
+
})
|
|
2176
|
+
);
|
|
2177
|
+
var RejectDeclarationConfig = ActionConfigBase.merge(
|
|
2178
|
+
import_zod19.z.object({
|
|
2179
|
+
type: import_zod19.z.literal(ActionType.REJECT)
|
|
2180
|
+
})
|
|
2342
2181
|
);
|
|
2343
|
-
var
|
|
2344
|
-
|
|
2345
|
-
type:
|
|
2346
|
-
})
|
|
2182
|
+
var ArchiveConfig = ActionConfigBase.merge(
|
|
2183
|
+
import_zod19.z.object({
|
|
2184
|
+
type: import_zod19.z.literal(ActionType.ARCHIVE)
|
|
2185
|
+
})
|
|
2347
2186
|
);
|
|
2348
|
-
var
|
|
2349
|
-
|
|
2350
|
-
type:
|
|
2351
|
-
})
|
|
2187
|
+
var DeleteConfig = ActionConfigBase.merge(
|
|
2188
|
+
import_zod19.z.object({
|
|
2189
|
+
type: import_zod19.z.literal(ActionType.DELETE)
|
|
2190
|
+
})
|
|
2352
2191
|
);
|
|
2353
|
-
var PrintCertificateActionConfig = ActionConfigBase.
|
|
2354
|
-
|
|
2355
|
-
type:
|
|
2192
|
+
var PrintCertificateActionConfig = ActionConfigBase.merge(
|
|
2193
|
+
import_zod19.z.object({
|
|
2194
|
+
type: import_zod19.z.literal(ActionType.PRINT_CERTIFICATE),
|
|
2356
2195
|
printForm: ActionFormConfig
|
|
2357
|
-
})
|
|
2196
|
+
})
|
|
2358
2197
|
);
|
|
2359
|
-
var RequestCorrectionConfig = ActionConfigBase.
|
|
2360
|
-
|
|
2361
|
-
type:
|
|
2198
|
+
var RequestCorrectionConfig = ActionConfigBase.merge(
|
|
2199
|
+
import_zod19.z.object({
|
|
2200
|
+
type: import_zod19.z.literal(ActionType.REQUEST_CORRECTION),
|
|
2362
2201
|
correctionForm: ActionFormConfig
|
|
2363
|
-
})
|
|
2202
|
+
})
|
|
2364
2203
|
);
|
|
2365
|
-
var
|
|
2366
|
-
|
|
2367
|
-
type:
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
)
|
|
2204
|
+
var RejectCorrectionConfig = ActionConfigBase.merge(
|
|
2205
|
+
import_zod19.z.object({
|
|
2206
|
+
type: import_zod19.z.literal(ActionType.REJECT_CORRECTION)
|
|
2207
|
+
})
|
|
2208
|
+
);
|
|
2209
|
+
var ApproveCorrectionConfig = ActionConfigBase.merge(
|
|
2210
|
+
import_zod19.z.object({
|
|
2211
|
+
type: import_zod19.z.literal(ActionType.APPROVE_CORRECTION)
|
|
2373
2212
|
})
|
|
2374
2213
|
);
|
|
2375
|
-
var ActionConfig =
|
|
2214
|
+
var ActionConfig = import_zod19.z.discriminatedUnion("type", [
|
|
2376
2215
|
/*
|
|
2377
2216
|
* OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
|
|
2378
2217
|
* and treat them as "models" instead of duplicating the data structure in each endpoint.
|
|
2379
2218
|
*/
|
|
2380
|
-
ReadActionConfig.
|
|
2381
|
-
DeclareConfig.
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2219
|
+
ReadActionConfig.openapi({ ref: "ReadActionConfig" }),
|
|
2220
|
+
DeclareConfig.openapi({ ref: "DeclareActionConfig" }),
|
|
2221
|
+
ValidateConfig.openapi({ ref: "ValidateActionConfig" }),
|
|
2222
|
+
RejectDeclarationConfig.openapi({ ref: "RejectDeclarationActionConfig" }),
|
|
2223
|
+
ArchiveConfig.openapi({ ref: "ArchiveActionConfig" }),
|
|
2224
|
+
RegisterConfig.openapi({ ref: "RegisterActionConfig" }),
|
|
2225
|
+
DeleteConfig.openapi({ ref: "DeleteActionConfig" }),
|
|
2226
|
+
PrintCertificateActionConfig.openapi({
|
|
2227
|
+
ref: "PrintCertificateActionConfig"
|
|
2387
2228
|
}),
|
|
2388
|
-
RequestCorrectionConfig.
|
|
2389
|
-
|
|
2229
|
+
RequestCorrectionConfig.openapi({ ref: "RequestCorrectionActionConfig" }),
|
|
2230
|
+
RejectCorrectionConfig.openapi({ ref: "RejectCorrectionActionConfig" }),
|
|
2231
|
+
ApproveCorrectionConfig.openapi({ ref: "ApproveCorrectionActionConfig" })
|
|
2390
2232
|
]).describe(
|
|
2391
2233
|
"Configuration of an action available for an event. Data collected depends on the action type and is accessible through the annotation property in ActionDocument."
|
|
2392
|
-
).
|
|
2393
|
-
var
|
|
2394
|
-
ActionConfig.options.map((opt) => opt.shape.type.value)
|
|
2395
|
-
);
|
|
2396
|
-
var DeclarationActionConfig = z21.discriminatedUnion("type", [
|
|
2234
|
+
).openapi({ ref: "ActionConfig" });
|
|
2235
|
+
var DeclarationActionConfig = import_zod19.z.discriminatedUnion("type", [
|
|
2397
2236
|
DeclareConfig,
|
|
2398
2237
|
ValidateConfig,
|
|
2399
2238
|
RegisterConfig
|
|
2400
2239
|
]);
|
|
2401
2240
|
|
|
2402
2241
|
// ../commons/src/events/offline/CertificateConfig.ts
|
|
2403
|
-
var
|
|
2404
|
-
var FontFamily =
|
|
2405
|
-
normal:
|
|
2406
|
-
bold:
|
|
2407
|
-
italics:
|
|
2408
|
-
bolditalics:
|
|
2242
|
+
var import_zod20 = require("zod");
|
|
2243
|
+
var FontFamily = import_zod20.z.object({
|
|
2244
|
+
normal: import_zod20.z.string(),
|
|
2245
|
+
bold: import_zod20.z.string(),
|
|
2246
|
+
italics: import_zod20.z.string(),
|
|
2247
|
+
bolditalics: import_zod20.z.string()
|
|
2409
2248
|
});
|
|
2410
|
-
var CertificateConfig =
|
|
2411
|
-
id:
|
|
2412
|
-
event:
|
|
2413
|
-
isV2Template:
|
|
2249
|
+
var CertificateConfig = import_zod20.z.object({
|
|
2250
|
+
id: import_zod20.z.string(),
|
|
2251
|
+
event: import_zod20.z.string(),
|
|
2252
|
+
isV2Template: import_zod20.z.boolean().optional(),
|
|
2414
2253
|
label: TranslationConfig,
|
|
2415
|
-
isDefault:
|
|
2416
|
-
fee:
|
|
2417
|
-
onTime:
|
|
2418
|
-
late:
|
|
2419
|
-
delayed:
|
|
2254
|
+
isDefault: import_zod20.z.boolean(),
|
|
2255
|
+
fee: import_zod20.z.object({
|
|
2256
|
+
onTime: import_zod20.z.number(),
|
|
2257
|
+
late: import_zod20.z.number(),
|
|
2258
|
+
delayed: import_zod20.z.number()
|
|
2420
2259
|
}),
|
|
2421
|
-
svgUrl:
|
|
2422
|
-
fonts:
|
|
2423
|
-
conditionals:
|
|
2260
|
+
svgUrl: import_zod20.z.string(),
|
|
2261
|
+
fonts: import_zod20.z.record(FontFamily).optional(),
|
|
2262
|
+
conditionals: import_zod20.z.array(ShowConditional).optional()
|
|
2424
2263
|
});
|
|
2425
2264
|
var CertificateTemplateConfig = CertificateConfig.extend({
|
|
2426
|
-
hash:
|
|
2427
|
-
svg:
|
|
2265
|
+
hash: import_zod20.z.string().optional(),
|
|
2266
|
+
svg: import_zod20.z.string()
|
|
2428
2267
|
});
|
|
2429
2268
|
|
|
2430
2269
|
// ../commons/src/events/offline/LanguageConfig.ts
|
|
2431
|
-
var
|
|
2432
|
-
var LanguageConfig =
|
|
2433
|
-
lang:
|
|
2270
|
+
var import_zod21 = require("zod");
|
|
2271
|
+
var LanguageConfig = import_zod21.z.object({
|
|
2272
|
+
lang: import_zod21.z.string(),
|
|
2434
2273
|
/**
|
|
2435
2274
|
* client.csv contents
|
|
2436
2275
|
*/
|
|
2437
|
-
messages:
|
|
2276
|
+
messages: import_zod21.z.record(import_zod21.z.string())
|
|
2438
2277
|
});
|
|
2439
2278
|
|
|
2440
2279
|
// ../commons/src/events/EventConfig.ts
|
|
2441
|
-
var
|
|
2280
|
+
var import_zod26 = require("zod");
|
|
2442
2281
|
|
|
2443
2282
|
// ../commons/src/events/SummaryConfig.ts
|
|
2444
|
-
var
|
|
2445
|
-
var BaseField2 =
|
|
2283
|
+
var import_zod22 = require("zod");
|
|
2284
|
+
var BaseField2 = import_zod22.z.object({
|
|
2446
2285
|
emptyValueMessage: TranslationConfig.optional().describe(
|
|
2447
2286
|
"Default message displayed when the field value is empty."
|
|
2448
2287
|
),
|
|
2449
|
-
conditionals:
|
|
2288
|
+
conditionals: import_zod22.z.array(ShowConditional).default([]).optional()
|
|
2450
2289
|
});
|
|
2451
2290
|
var ReferenceField = BaseField2.extend({
|
|
2452
|
-
fieldId:
|
|
2291
|
+
fieldId: import_zod22.z.string(),
|
|
2453
2292
|
label: TranslationConfig.optional().describe(
|
|
2454
2293
|
"Overrides the default label from the referenced field when provided."
|
|
2455
2294
|
)
|
|
2456
2295
|
}).describe("Field referencing existing event data by field ID.");
|
|
2457
2296
|
var Field = BaseField2.extend({
|
|
2458
|
-
id:
|
|
2297
|
+
id: import_zod22.z.string().describe("Identifier of the summary field."),
|
|
2459
2298
|
value: TranslationConfig.describe(
|
|
2460
2299
|
'Field value template supporting variables from configuration and EventMetadata (e.g. "{informant.phoneNo} {informant.email}").'
|
|
2461
2300
|
),
|
|
2462
2301
|
label: TranslationConfig
|
|
2463
2302
|
}).describe("Custom field defined for the summary view.");
|
|
2464
|
-
var SummaryConfig =
|
|
2465
|
-
fields:
|
|
2303
|
+
var SummaryConfig = import_zod22.z.object({
|
|
2304
|
+
fields: import_zod22.z.array(import_zod22.z.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
|
|
2466
2305
|
}).describe("Configuration of the event summary section.");
|
|
2467
2306
|
|
|
2468
2307
|
// ../commons/src/events/AdvancedSearchConfig.ts
|
|
2469
|
-
var
|
|
2470
|
-
var MatchType =
|
|
2471
|
-
var BaseField3 =
|
|
2472
|
-
config:
|
|
2308
|
+
var import_zod23 = require("zod");
|
|
2309
|
+
var MatchType = import_zod23.z.enum(["fuzzy", "exact", "range", "within"]);
|
|
2310
|
+
var BaseField3 = import_zod23.z.object({
|
|
2311
|
+
config: import_zod23.z.object({
|
|
2473
2312
|
type: MatchType.describe(
|
|
2474
2313
|
"Determines the search type of field. How to match value."
|
|
2475
2314
|
),
|
|
2476
|
-
searchFields:
|
|
2315
|
+
searchFields: import_zod23.z.array(import_zod23.z.string()).optional().describe(
|
|
2477
2316
|
`
|
|
2478
2317
|
Defines multiple form fields that should be searched when this field has a value.
|
|
2479
2318
|
All specified fields will be combined using OR logic.
|
|
@@ -2483,7 +2322,7 @@ var BaseField3 = z25.object({
|
|
|
2483
2322
|
`
|
|
2484
2323
|
)
|
|
2485
2324
|
}),
|
|
2486
|
-
type:
|
|
2325
|
+
type: import_zod23.z.nativeEnum(FieldType).optional().describe(
|
|
2487
2326
|
`
|
|
2488
2327
|
Explicitly specify the field type for searchFields.
|
|
2489
2328
|
This is required when searchFields is defined, to show the correct control in the UI.
|
|
@@ -2497,7 +2336,7 @@ var BaseField3 = z25.object({
|
|
|
2497
2336
|
This is required when searchFields is defined.
|
|
2498
2337
|
`
|
|
2499
2338
|
),
|
|
2500
|
-
options:
|
|
2339
|
+
options: import_zod23.z.array(SelectOption).optional(),
|
|
2501
2340
|
searchCriteriaLabelPrefix: TranslationConfig.optional().describe(
|
|
2502
2341
|
`
|
|
2503
2342
|
This property determines whether to add a prefix (such as "Child" or "Applicant") before the field label
|
|
@@ -2518,7 +2357,7 @@ var BaseField3 = z25.object({
|
|
|
2518
2357
|
in the country-config > event.advancedSearch configuration. For example: field("child.dob", { searchCriteriaLabelPrefix: TranslationConfig }).
|
|
2519
2358
|
`
|
|
2520
2359
|
),
|
|
2521
|
-
conditionals:
|
|
2360
|
+
conditionals: import_zod23.z.array(FieldConditional).default([]).optional().describe(
|
|
2522
2361
|
`
|
|
2523
2362
|
In advanced search, we sometimes need to override the default field visibility conditionals.
|
|
2524
2363
|
|
|
@@ -2532,61 +2371,59 @@ var BaseField3 = z25.object({
|
|
|
2532
2371
|
are always rendered in the advanced search form.
|
|
2533
2372
|
`
|
|
2534
2373
|
),
|
|
2535
|
-
validations:
|
|
2374
|
+
validations: import_zod23.z.array(ValidationConfig).default([]).optional().describe(
|
|
2536
2375
|
`Option for overriding the field validations specifically for advanced search form.`
|
|
2537
2376
|
)
|
|
2538
2377
|
});
|
|
2539
|
-
var SearchQueryParams =
|
|
2540
|
-
eventType:
|
|
2378
|
+
var SearchQueryParams = import_zod23.z.object({
|
|
2379
|
+
eventType: import_zod23.z.string().optional().describe(
|
|
2541
2380
|
"Defines type of event so that when redirecting to Advanced Search page, appropriate tab can be selected"
|
|
2542
2381
|
)
|
|
2543
2382
|
}).catchall(FieldValue);
|
|
2544
2383
|
var FieldConfigSchema = BaseField3.extend({
|
|
2545
|
-
fieldId:
|
|
2546
|
-
fieldType:
|
|
2384
|
+
fieldId: import_zod23.z.string(),
|
|
2385
|
+
fieldType: import_zod23.z.literal("field")
|
|
2547
2386
|
});
|
|
2548
|
-
var EventFieldIdInput =
|
|
2387
|
+
var EventFieldIdInput = import_zod23.z.enum([
|
|
2549
2388
|
"trackingId",
|
|
2550
2389
|
"status",
|
|
2551
2390
|
"legalStatuses.REGISTERED.acceptedAt",
|
|
2552
2391
|
"legalStatuses.REGISTERED.createdAtLocation",
|
|
2553
|
-
"legalStatuses.REGISTERED.registrationNumber",
|
|
2554
2392
|
"updatedAt"
|
|
2555
2393
|
]);
|
|
2556
2394
|
var METADATA_FIELD_PREFIX = "event.";
|
|
2557
|
-
var EventFieldId =
|
|
2395
|
+
var EventFieldId = import_zod23.z.enum([
|
|
2558
2396
|
`${METADATA_FIELD_PREFIX}trackingId`,
|
|
2559
2397
|
`${METADATA_FIELD_PREFIX}status`,
|
|
2560
2398
|
`${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.acceptedAt`,
|
|
2561
2399
|
`${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.createdAtLocation`,
|
|
2562
|
-
`${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.registrationNumber`,
|
|
2563
2400
|
`${METADATA_FIELD_PREFIX}updatedAt`
|
|
2564
2401
|
]);
|
|
2565
2402
|
var EventFieldConfigSchema = BaseField3.extend({
|
|
2566
2403
|
fieldId: EventFieldId,
|
|
2567
|
-
fieldType:
|
|
2404
|
+
fieldType: import_zod23.z.literal("event")
|
|
2568
2405
|
});
|
|
2569
|
-
var AdvancedSearchField =
|
|
2406
|
+
var AdvancedSearchField = import_zod23.z.discriminatedUnion("fieldType", [FieldConfigSchema, EventFieldConfigSchema]).superRefine((data, ctx) => {
|
|
2570
2407
|
if (data.config.searchFields && data.config.searchFields.length > 0) {
|
|
2571
2408
|
if (!data.label) {
|
|
2572
2409
|
ctx.addIssue({
|
|
2573
|
-
code:
|
|
2410
|
+
code: import_zod23.z.ZodIssueCode.custom,
|
|
2574
2411
|
message: "label is required when config.searchFields is defined.",
|
|
2575
2412
|
path: ["label"]
|
|
2576
2413
|
});
|
|
2577
2414
|
}
|
|
2578
2415
|
if (!data.type) {
|
|
2579
2416
|
ctx.addIssue({
|
|
2580
|
-
code:
|
|
2417
|
+
code: import_zod23.z.ZodIssueCode.custom,
|
|
2581
2418
|
message: "type is required when config.searchFields is defined.",
|
|
2582
2419
|
path: ["type"]
|
|
2583
2420
|
});
|
|
2584
2421
|
}
|
|
2585
2422
|
}
|
|
2586
2423
|
});
|
|
2587
|
-
var AdvancedSearchConfig =
|
|
2424
|
+
var AdvancedSearchConfig = import_zod23.z.object({
|
|
2588
2425
|
title: TranslationConfig.describe("Advanced search tab title"),
|
|
2589
|
-
fields:
|
|
2426
|
+
fields: import_zod23.z.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
|
|
2590
2427
|
});
|
|
2591
2428
|
|
|
2592
2429
|
// ../commons/src/events/utils.ts
|
|
@@ -2595,11 +2432,11 @@ var import_lodash = require("lodash");
|
|
|
2595
2432
|
// ../commons/src/conditionals/validate.ts
|
|
2596
2433
|
var import__ = __toESM(require("ajv/dist/2019"));
|
|
2597
2434
|
var import_ajv_formats = __toESM(require("ajv-formats"));
|
|
2598
|
-
var
|
|
2435
|
+
var import_zod25 = require("zod");
|
|
2599
2436
|
var import_date_fns = require("date-fns");
|
|
2600
2437
|
|
|
2601
2438
|
// ../commons/src/events/DynamicFieldValue.ts
|
|
2602
|
-
var
|
|
2439
|
+
var import_zod24 = require("zod");
|
|
2603
2440
|
|
|
2604
2441
|
// ../commons/src/conditionals/validate.ts
|
|
2605
2442
|
var ajv = new import__.default({
|
|
@@ -2608,9 +2445,9 @@ var ajv = new import__.default({
|
|
|
2608
2445
|
strict: false
|
|
2609
2446
|
// Allow minContains and other newer features
|
|
2610
2447
|
});
|
|
2611
|
-
var DataContext =
|
|
2612
|
-
rootData:
|
|
2613
|
-
$leafAdminStructureLocationIds:
|
|
2448
|
+
var DataContext = import_zod25.z.object({
|
|
2449
|
+
rootData: import_zod25.z.object({
|
|
2450
|
+
$leafAdminStructureLocationIds: import_zod25.z.array(import_zod25.z.object({ id: UUID }))
|
|
2614
2451
|
})
|
|
2615
2452
|
});
|
|
2616
2453
|
function resolveDataPath(rootData, dataPath, instancePath) {
|
|
@@ -2687,12 +2524,12 @@ ajv.addKeyword({
|
|
|
2687
2524
|
});
|
|
2688
2525
|
|
|
2689
2526
|
// ../commons/src/utils.ts
|
|
2690
|
-
var
|
|
2691
|
-
var FullNameV1 =
|
|
2692
|
-
|
|
2693
|
-
use:
|
|
2694
|
-
family:
|
|
2695
|
-
given:
|
|
2527
|
+
var z26 = __toESM(require("zod"));
|
|
2528
|
+
var FullNameV1 = z26.array(
|
|
2529
|
+
z26.object({
|
|
2530
|
+
use: z26.string(),
|
|
2531
|
+
family: z26.string(),
|
|
2532
|
+
given: z26.array(z26.string())
|
|
2696
2533
|
})
|
|
2697
2534
|
);
|
|
2698
2535
|
function omitKeyDeep(obj, keyToRemove) {
|
|
@@ -2713,6 +2550,9 @@ function omitKeyDeep(obj, keyToRemove) {
|
|
|
2713
2550
|
|
|
2714
2551
|
// ../commons/src/events/utils.ts
|
|
2715
2552
|
var import_date_fns2 = require("date-fns");
|
|
2553
|
+
function isDeclarationActionConfig(action) {
|
|
2554
|
+
return DeclarationActions.safeParse(action.type).success;
|
|
2555
|
+
}
|
|
2716
2556
|
function getDeclarationFields(configuration) {
|
|
2717
2557
|
return configuration.declaration.pages.flatMap(({ fields }) => fields);
|
|
2718
2558
|
}
|
|
@@ -2723,7 +2563,7 @@ var getActionAnnotationFields = (actionConfig) => {
|
|
|
2723
2563
|
if (actionConfig.type === ActionType.PRINT_CERTIFICATE) {
|
|
2724
2564
|
return actionConfig.printForm.pages.flatMap(({ fields }) => fields);
|
|
2725
2565
|
}
|
|
2726
|
-
if (
|
|
2566
|
+
if (isDeclarationActionConfig(actionConfig)) {
|
|
2727
2567
|
return actionConfig.review.fields;
|
|
2728
2568
|
}
|
|
2729
2569
|
return [];
|
|
@@ -2744,16 +2584,15 @@ var EXCLUDED_ACTIONS = [
|
|
|
2744
2584
|
];
|
|
2745
2585
|
|
|
2746
2586
|
// ../commons/src/events/EventConfig.ts
|
|
2747
|
-
var
|
|
2748
|
-
|
|
2587
|
+
var import_zod_openapi10 = require("zod-openapi");
|
|
2588
|
+
(0, import_zod_openapi10.extendZodWithOpenApi)(import_zod26.z);
|
|
2589
|
+
var EventConfig = import_zod26.z.object({
|
|
2590
|
+
id: import_zod26.z.string().describe(
|
|
2749
2591
|
'Machine-readable identifier of the event (e.g. "birth", "death").'
|
|
2750
2592
|
),
|
|
2751
2593
|
dateOfEvent: FieldReference.optional().describe(
|
|
2752
2594
|
"Reference to the field capturing the date of the event (e.g. date of birth). Defaults to the event creation date if unspecified."
|
|
2753
2595
|
),
|
|
2754
|
-
placeOfEvent: FieldReference.optional().describe(
|
|
2755
|
-
"Reference to the field capturing the place of the event (e.g. place of birth). Defaults to the meta.createdAtLocation if unspecified."
|
|
2756
|
-
),
|
|
2757
2596
|
title: TranslationConfig.describe(
|
|
2758
2597
|
'Title template for the singular event, supporting variables (e.g. "{applicant.name.firstname} {applicant.name.surname}").'
|
|
2759
2598
|
),
|
|
@@ -2766,17 +2605,14 @@ var EventConfig = z29.object({
|
|
|
2766
2605
|
label: TranslationConfig.describe(
|
|
2767
2606
|
"Human-readable label for the event type."
|
|
2768
2607
|
),
|
|
2769
|
-
actions:
|
|
2608
|
+
actions: import_zod26.z.array(ActionConfig).describe(
|
|
2770
2609
|
"Configuration of system-defined actions associated with the event."
|
|
2771
2610
|
),
|
|
2772
2611
|
declaration: DeclarationFormConfig.describe(
|
|
2773
2612
|
"Configuration of the form used to gather event data."
|
|
2774
2613
|
),
|
|
2775
|
-
advancedSearch:
|
|
2614
|
+
advancedSearch: import_zod26.z.array(AdvancedSearchConfig).optional().default([]).describe(
|
|
2776
2615
|
"Configuration of fields available in the advanced search feature."
|
|
2777
|
-
),
|
|
2778
|
-
flags: z29.array(FlagConfig).optional().default([]).describe(
|
|
2779
|
-
"Configuration of flags associated with the actions of this event type."
|
|
2780
2616
|
)
|
|
2781
2617
|
}).superRefine((event2, ctx) => {
|
|
2782
2618
|
const allFields = findAllFields(event2);
|
|
@@ -2828,37 +2664,8 @@ var EventConfig = z29.object({
|
|
|
2828
2664
|
});
|
|
2829
2665
|
}
|
|
2830
2666
|
}
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
({ id }) => id === event2.placeOfEvent?.$$field
|
|
2834
|
-
);
|
|
2835
|
-
if (!eventPlaceFieldId) {
|
|
2836
|
-
ctx.addIssue({
|
|
2837
|
-
code: "custom",
|
|
2838
|
-
message: `Place of event field id must match a field id in the event.declaration fields.
|
|
2839
|
-
Invalid place of event field ID for event ${event2.id}: ${event2.placeOfEvent.$$field}`,
|
|
2840
|
-
path: ["placeOfEvent"]
|
|
2841
|
-
});
|
|
2842
|
-
}
|
|
2843
|
-
}
|
|
2844
|
-
const isInherentFlag = (value) => Object.values(InherentFlags).includes(value);
|
|
2845
|
-
const configuredFlagIds = event2.flags.map((flag2) => flag2.id);
|
|
2846
|
-
const actionFlagIds = event2.actions.flatMap(
|
|
2847
|
-
(action) => action.flags.map((flag2) => flag2.id)
|
|
2848
|
-
);
|
|
2849
|
-
for (const actionFlagId of actionFlagIds) {
|
|
2850
|
-
const isConfigured = configuredFlagIds.includes(actionFlagId);
|
|
2851
|
-
const isInherent = isInherentFlag(actionFlagId);
|
|
2852
|
-
if (!isConfigured && !isInherent) {
|
|
2853
|
-
ctx.addIssue({
|
|
2854
|
-
code: "custom",
|
|
2855
|
-
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}'`,
|
|
2856
|
-
path: ["actions"]
|
|
2857
|
-
});
|
|
2858
|
-
}
|
|
2859
|
-
}
|
|
2860
|
-
}).meta({
|
|
2861
|
-
id: "EventConfig"
|
|
2667
|
+
}).openapi({
|
|
2668
|
+
ref: "EventConfig"
|
|
2862
2669
|
}).describe("Configuration defining an event type.");
|
|
2863
2670
|
|
|
2864
2671
|
// ../commons/src/events/EventConfigInput.ts
|
|
@@ -2867,7 +2674,7 @@ var defineActionForm = (actionForm) => ActionFormConfig.parse(actionForm);
|
|
|
2867
2674
|
var defineFormPage = (formPage) => FormPageConfig.parse(formPage);
|
|
2868
2675
|
|
|
2869
2676
|
// ../commons/src/events/WorkqueueConfig.ts
|
|
2870
|
-
var
|
|
2677
|
+
var import_zod30 = require("zod");
|
|
2871
2678
|
|
|
2872
2679
|
// ../commons/src/conditionals/conditionals.ts
|
|
2873
2680
|
var objectHash = __toESM(require("object-hash"));
|
|
@@ -2905,7 +2712,7 @@ function not(condition) {
|
|
|
2905
2712
|
required: []
|
|
2906
2713
|
});
|
|
2907
2714
|
}
|
|
2908
|
-
function
|
|
2715
|
+
function never() {
|
|
2909
2716
|
return not(alwaysTrue());
|
|
2910
2717
|
}
|
|
2911
2718
|
function jsonFieldPath(field3) {
|
|
@@ -3075,21 +2882,6 @@ function defineComparison(field3, value, keyword) {
|
|
|
3075
2882
|
required: [field3.$$field]
|
|
3076
2883
|
});
|
|
3077
2884
|
}
|
|
3078
|
-
function flag(flagvalue) {
|
|
3079
|
-
return defineConditional({
|
|
3080
|
-
type: "object",
|
|
3081
|
-
properties: {
|
|
3082
|
-
$flags: {
|
|
3083
|
-
type: "array",
|
|
3084
|
-
contains: {
|
|
3085
|
-
type: "string",
|
|
3086
|
-
const: flagvalue
|
|
3087
|
-
}
|
|
3088
|
-
}
|
|
3089
|
-
},
|
|
3090
|
-
required: ["$flags"]
|
|
3091
|
-
});
|
|
3092
|
-
}
|
|
3093
2885
|
function createFieldConditionals(fieldId) {
|
|
3094
2886
|
const getDayRange = (field3, days, clause, referenceDate) => ({
|
|
3095
2887
|
type: "object",
|
|
@@ -3629,17 +3421,17 @@ var event = Object.assign(eventFn, {
|
|
|
3629
3421
|
});
|
|
3630
3422
|
|
|
3631
3423
|
// ../commons/src/events/WorkqueueColumnConfig.ts
|
|
3632
|
-
var
|
|
3424
|
+
var import_zod27 = require("zod");
|
|
3633
3425
|
var WorkqueueColumnKeysArray = [
|
|
3634
3426
|
...EventMetadataKeysArray,
|
|
3635
3427
|
"title",
|
|
3636
3428
|
"outbox"
|
|
3637
3429
|
];
|
|
3638
|
-
var WorkqueueColumnKeys =
|
|
3639
|
-
var WorkqueueColumnValue =
|
|
3430
|
+
var WorkqueueColumnKeys = import_zod27.z.enum(WorkqueueColumnKeysArray);
|
|
3431
|
+
var WorkqueueColumnValue = import_zod27.z.object({
|
|
3640
3432
|
$event: WorkqueueColumnKeys
|
|
3641
3433
|
});
|
|
3642
|
-
var WorkqueueColumn =
|
|
3434
|
+
var WorkqueueColumn = import_zod27.z.object({
|
|
3643
3435
|
label: TranslationConfig,
|
|
3644
3436
|
value: WorkqueueColumnValue
|
|
3645
3437
|
});
|
|
@@ -3650,118 +3442,221 @@ function defineWorkqueuesColumns(workqueueColumns) {
|
|
|
3650
3442
|
}
|
|
3651
3443
|
|
|
3652
3444
|
// ../commons/src/events/CountryConfigQueryInput.ts
|
|
3653
|
-
var
|
|
3654
|
-
var SerializableExact =
|
|
3655
|
-
type:
|
|
3656
|
-
term:
|
|
3445
|
+
var import_zod28 = require("zod");
|
|
3446
|
+
var SerializableExact = import_zod28.z.object({
|
|
3447
|
+
type: import_zod28.z.literal("exact"),
|
|
3448
|
+
term: import_zod28.z.union([import_zod28.z.string(), SerializedUserField])
|
|
3657
3449
|
});
|
|
3658
|
-
var SerializableWithin =
|
|
3659
|
-
type:
|
|
3660
|
-
location:
|
|
3450
|
+
var SerializableWithin = import_zod28.z.object({
|
|
3451
|
+
type: import_zod28.z.literal("within"),
|
|
3452
|
+
location: import_zod28.z.union([import_zod28.z.string(), SerializedUserField])
|
|
3661
3453
|
});
|
|
3662
|
-
var SerializedQueryExpression =
|
|
3663
|
-
eventType:
|
|
3664
|
-
status:
|
|
3665
|
-
createdAt:
|
|
3666
|
-
updatedAt:
|
|
3667
|
-
"legalStatuses.REGISTERED.createdAt":
|
|
3668
|
-
"legalStatuses.REGISTERED.createdAtLocation":
|
|
3669
|
-
|
|
3454
|
+
var SerializedQueryExpression = import_zod28.z.object({
|
|
3455
|
+
eventType: import_zod28.z.string(),
|
|
3456
|
+
status: import_zod28.z.optional(import_zod28.z.union([AnyOfStatus, ExactStatus])),
|
|
3457
|
+
createdAt: import_zod28.z.optional(DateCondition),
|
|
3458
|
+
updatedAt: import_zod28.z.optional(DateCondition),
|
|
3459
|
+
"legalStatuses.REGISTERED.createdAt": import_zod28.z.optional(DateCondition),
|
|
3460
|
+
"legalStatuses.REGISTERED.createdAtLocation": import_zod28.z.optional(
|
|
3461
|
+
import_zod28.z.union([Within, Exact])
|
|
3670
3462
|
),
|
|
3671
|
-
"legalStatuses.REGISTERED.registrationNumber":
|
|
3672
|
-
createdAtLocation:
|
|
3673
|
-
|
|
3463
|
+
"legalStatuses.REGISTERED.registrationNumber": import_zod28.z.optional(Exact),
|
|
3464
|
+
createdAtLocation: import_zod28.z.optional(
|
|
3465
|
+
import_zod28.z.union([SerializableWithin, SerializableExact])
|
|
3674
3466
|
),
|
|
3675
|
-
updatedAtLocation:
|
|
3676
|
-
|
|
3467
|
+
updatedAtLocation: import_zod28.z.optional(
|
|
3468
|
+
import_zod28.z.union([SerializableWithin, SerializableExact])
|
|
3677
3469
|
),
|
|
3678
|
-
assignedTo:
|
|
3679
|
-
createdBy:
|
|
3470
|
+
assignedTo: import_zod28.z.optional(SerializableExact),
|
|
3471
|
+
createdBy: import_zod28.z.optional(SerializableExact),
|
|
3680
3472
|
createdByUserType: ExactUserType,
|
|
3681
|
-
updatedBy:
|
|
3682
|
-
trackingId:
|
|
3683
|
-
flags:
|
|
3473
|
+
updatedBy: import_zod28.z.optional(SerializableExact),
|
|
3474
|
+
trackingId: import_zod28.z.optional(Exact),
|
|
3475
|
+
flags: import_zod28.z.optional(ContainsFlags),
|
|
3684
3476
|
data: QueryInput
|
|
3685
3477
|
}).partial();
|
|
3686
|
-
var Or2 =
|
|
3687
|
-
type:
|
|
3688
|
-
clauses:
|
|
3478
|
+
var Or2 = import_zod28.z.object({
|
|
3479
|
+
type: import_zod28.z.literal("or"),
|
|
3480
|
+
clauses: import_zod28.z.array(SerializedQueryExpression)
|
|
3689
3481
|
});
|
|
3690
|
-
var And2 =
|
|
3691
|
-
type:
|
|
3692
|
-
clauses:
|
|
3482
|
+
var And2 = import_zod28.z.object({
|
|
3483
|
+
type: import_zod28.z.literal("and"),
|
|
3484
|
+
clauses: import_zod28.z.array(SerializedQueryExpression)
|
|
3693
3485
|
});
|
|
3694
|
-
var CountryConfigQueryType =
|
|
3695
|
-
var CountryConfigQueryInputType =
|
|
3486
|
+
var CountryConfigQueryType = import_zod28.z.discriminatedUnion("type", [And2, Or2]);
|
|
3487
|
+
var CountryConfigQueryInputType = import_zod28.z.union([
|
|
3696
3488
|
SerializedQueryExpression,
|
|
3697
3489
|
And2,
|
|
3698
3490
|
Or2
|
|
3699
3491
|
]);
|
|
3700
3492
|
|
|
3701
|
-
// ../commons/src/
|
|
3702
|
-
var
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
"
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3493
|
+
// ../commons/src/icons.ts
|
|
3494
|
+
var import_zod29 = require("zod");
|
|
3495
|
+
var AvailableIcons = import_zod29.z.enum([
|
|
3496
|
+
"Archived",
|
|
3497
|
+
"Assigned",
|
|
3498
|
+
"Certified",
|
|
3499
|
+
"Close",
|
|
3500
|
+
"Collapse",
|
|
3501
|
+
"Draft",
|
|
3502
|
+
"DuplicateYellow",
|
|
3503
|
+
"Expand",
|
|
3504
|
+
"ExternalValidate",
|
|
3505
|
+
"FilledCheck",
|
|
3506
|
+
"InReview",
|
|
3507
|
+
"Offline",
|
|
3508
|
+
"Registered",
|
|
3509
|
+
"RequiresUpdates",
|
|
3510
|
+
"Sent",
|
|
3511
|
+
"Validated",
|
|
3512
|
+
"WaitingApproval",
|
|
3513
|
+
"ChartActivity",
|
|
3514
|
+
"Activity",
|
|
3515
|
+
"Archive",
|
|
3516
|
+
"ArchiveTray",
|
|
3517
|
+
"ArrowLeft",
|
|
3518
|
+
"ArrowRight",
|
|
3519
|
+
"Buildings",
|
|
3520
|
+
"Circle",
|
|
3521
|
+
"CaretDown",
|
|
3522
|
+
"CaretLeft",
|
|
3523
|
+
"CaretRight",
|
|
3524
|
+
"ChartBar",
|
|
3525
|
+
"ChartLine",
|
|
3526
|
+
"ChatCircle",
|
|
3527
|
+
"CheckSquare",
|
|
3528
|
+
"Compass",
|
|
3529
|
+
"Check",
|
|
3530
|
+
"Copy",
|
|
3531
|
+
"Database",
|
|
3532
|
+
"DotsThreeVertical",
|
|
3533
|
+
"ArrowCounterClockwise",
|
|
3534
|
+
"MagnifyingGlassMinus",
|
|
3535
|
+
"MagnifyingGlassPlus",
|
|
3536
|
+
"Export",
|
|
3537
|
+
"Eye",
|
|
3538
|
+
"EyeSlash",
|
|
3539
|
+
"Envelope",
|
|
3540
|
+
"File",
|
|
3541
|
+
"FileSearch",
|
|
3542
|
+
"FileMinus",
|
|
3543
|
+
"FilePlus",
|
|
3544
|
+
"FileText",
|
|
3545
|
+
"FileX",
|
|
3546
|
+
"Handshake",
|
|
3547
|
+
"Gear",
|
|
3548
|
+
"GitBranch",
|
|
3549
|
+
"IdentificationCard",
|
|
3550
|
+
"List",
|
|
3551
|
+
"ListBullets",
|
|
3552
|
+
"Lock",
|
|
3553
|
+
"MagnifyingGlass",
|
|
3554
|
+
"MapPin",
|
|
3555
|
+
"Medal",
|
|
3556
|
+
"NotePencil",
|
|
3557
|
+
"Paperclip",
|
|
3558
|
+
"PaperPlaneTilt",
|
|
3559
|
+
"Pen",
|
|
3560
|
+
"Pencil",
|
|
3561
|
+
"PencilSimpleLine",
|
|
3562
|
+
"Phone",
|
|
3563
|
+
"Plus",
|
|
3564
|
+
"Printer",
|
|
3565
|
+
"SignOut",
|
|
3566
|
+
"Star",
|
|
3567
|
+
"Target",
|
|
3568
|
+
"TextT",
|
|
3569
|
+
"Trash",
|
|
3570
|
+
"UploadSimple",
|
|
3571
|
+
"User",
|
|
3572
|
+
"UserPlus",
|
|
3573
|
+
"Users",
|
|
3574
|
+
"WarningCircle",
|
|
3575
|
+
"X",
|
|
3576
|
+
"CircleWavyCheck",
|
|
3577
|
+
"CircleWavyQuestion",
|
|
3578
|
+
"ArchiveBox",
|
|
3579
|
+
"ArrowCircleDown",
|
|
3580
|
+
"FileArrowUp",
|
|
3581
|
+
"FileDotted",
|
|
3582
|
+
"Files",
|
|
3583
|
+
"PencilLine",
|
|
3584
|
+
"PencilCircle",
|
|
3585
|
+
"UserCircle",
|
|
3586
|
+
"Clock",
|
|
3587
|
+
"QrCode",
|
|
3588
|
+
"Webcam",
|
|
3589
|
+
"Sun",
|
|
3590
|
+
"DeviceTabletCamera",
|
|
3591
|
+
"Globe",
|
|
3592
|
+
"Fingerprint",
|
|
3593
|
+
"PushPin",
|
|
3594
|
+
"Timer"
|
|
3595
|
+
]);
|
|
3596
|
+
|
|
3597
|
+
// ../commons/src/events/WorkqueueConfig.ts
|
|
3598
|
+
var mandatoryColumns = defineWorkqueuesColumns([
|
|
3599
|
+
{
|
|
3600
|
+
label: {
|
|
3601
|
+
id: "workqueues.dateOfEvent",
|
|
3602
|
+
defaultMessage: "Date of Event",
|
|
3603
|
+
description: "Label for workqueue column: dateOfEvent"
|
|
3604
|
+
},
|
|
3605
|
+
value: event.field("dateOfEvent")
|
|
3606
|
+
},
|
|
3607
|
+
{
|
|
3608
|
+
label: {
|
|
3609
|
+
defaultMessage: "Last updated",
|
|
3610
|
+
description: "This is the label for the workqueue column",
|
|
3611
|
+
id: "workqueue.default.column.modifiedAt"
|
|
3612
|
+
},
|
|
3613
|
+
value: event.field("updatedAt")
|
|
3614
|
+
}
|
|
3615
|
+
]);
|
|
3616
|
+
var WorkqueueActionsWithDefault = import_zod30.z.enum([
|
|
3617
|
+
...workqueueActions.options,
|
|
3618
|
+
"DEFAULT"
|
|
3619
|
+
]);
|
|
3620
|
+
var WorkqueueConfig = import_zod30.z.object({
|
|
3621
|
+
slug: import_zod30.z.string().describe("Determines the url of the workqueue."),
|
|
3622
|
+
name: TranslationConfig.describe(
|
|
3623
|
+
"Title of the workflow (both in navigation and on the page)"
|
|
3624
|
+
),
|
|
3625
|
+
query: CountryConfigQueryType,
|
|
3626
|
+
actions: import_zod30.z.array(
|
|
3627
|
+
import_zod30.z.object({
|
|
3628
|
+
type: WorkqueueActionsWithDefault,
|
|
3629
|
+
conditionals: import_zod30.z.array(Conditional).optional()
|
|
3630
|
+
})
|
|
3631
|
+
),
|
|
3632
|
+
columns: import_zod30.z.array(WorkqueueColumn).default(mandatoryColumns),
|
|
3633
|
+
icon: AvailableIcons,
|
|
3634
|
+
emptyMessage: TranslationConfig.optional()
|
|
3635
|
+
}).describe("Configuration for workqueue.");
|
|
3636
|
+
var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
|
|
3637
|
+
query: true,
|
|
3638
|
+
columns: true
|
|
3744
3639
|
});
|
|
3745
|
-
var WorkqueueConfigInput =
|
|
3746
|
-
slug:
|
|
3640
|
+
var WorkqueueConfigInput = import_zod30.z.object({
|
|
3641
|
+
slug: import_zod30.z.string().describe("Determines the url of the workqueue."),
|
|
3747
3642
|
name: TranslationConfig.describe(
|
|
3748
3643
|
"Title of the workflow (both in navigation and on the page)"
|
|
3749
3644
|
),
|
|
3750
3645
|
query: CountryConfigQueryInputType,
|
|
3751
|
-
actions:
|
|
3752
|
-
|
|
3646
|
+
actions: import_zod30.z.array(
|
|
3647
|
+
import_zod30.z.object({
|
|
3753
3648
|
type: WorkqueueActionsWithDefault,
|
|
3754
|
-
conditionals:
|
|
3649
|
+
conditionals: import_zod30.z.array(Conditional).optional()
|
|
3755
3650
|
})
|
|
3756
3651
|
),
|
|
3757
|
-
columns:
|
|
3652
|
+
columns: import_zod30.z.array(WorkqueueColumn).default(mandatoryColumns),
|
|
3758
3653
|
icon: AvailableIcons,
|
|
3759
3654
|
emptyMessage: TranslationConfig.optional()
|
|
3760
3655
|
});
|
|
3761
|
-
var WorkqueueCountInput =
|
|
3762
|
-
|
|
3656
|
+
var WorkqueueCountInput = import_zod30.z.array(
|
|
3657
|
+
import_zod30.z.object({ slug: import_zod30.z.string(), query: QueryType })
|
|
3763
3658
|
);
|
|
3764
|
-
var WorkqueueCountOutput =
|
|
3659
|
+
var WorkqueueCountOutput = import_zod30.z.record(import_zod30.z.string(), import_zod30.z.number());
|
|
3765
3660
|
|
|
3766
3661
|
// ../commons/src/events/workqueueDefaultColumns.ts
|
|
3767
3662
|
var defaultWorkqueueColumns = [
|
|
@@ -3784,45 +3679,47 @@ var defaultWorkqueueColumns = [
|
|
|
3784
3679
|
];
|
|
3785
3680
|
|
|
3786
3681
|
// ../commons/src/events/Draft.ts
|
|
3787
|
-
var
|
|
3682
|
+
var import_zod32 = require("zod");
|
|
3788
3683
|
|
|
3789
3684
|
// ../commons/src/events/ActionInput.ts
|
|
3790
|
-
var
|
|
3791
|
-
var
|
|
3685
|
+
var import_zod31 = require("zod");
|
|
3686
|
+
var import_zod_openapi11 = require("zod-openapi");
|
|
3687
|
+
(0, import_zod_openapi11.extendZodWithOpenApi)(import_zod31.z);
|
|
3688
|
+
var BaseActionInput = import_zod31.z.object({
|
|
3792
3689
|
eventId: UUID,
|
|
3793
|
-
transactionId:
|
|
3690
|
+
transactionId: import_zod31.z.string(),
|
|
3794
3691
|
declaration: ActionUpdate.default({}),
|
|
3795
3692
|
annotation: ActionUpdate.optional(),
|
|
3796
3693
|
originalActionId: UUID.optional(),
|
|
3797
3694
|
// should not be part of base action.
|
|
3798
|
-
keepAssignment:
|
|
3695
|
+
keepAssignment: import_zod31.z.boolean().optional(),
|
|
3799
3696
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
3800
3697
|
createdAtLocation: CreatedAtLocation.describe(
|
|
3801
3698
|
"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."
|
|
3802
3699
|
)
|
|
3803
3700
|
});
|
|
3804
|
-
var CreateActionInput = BaseActionInput.
|
|
3805
|
-
|
|
3806
|
-
type:
|
|
3701
|
+
var CreateActionInput = BaseActionInput.merge(
|
|
3702
|
+
import_zod31.z.object({
|
|
3703
|
+
type: import_zod31.z.literal(ActionType.CREATE).default(ActionType.CREATE),
|
|
3807
3704
|
createdAtLocation: CreatedAtLocation
|
|
3808
|
-
})
|
|
3809
|
-
);
|
|
3810
|
-
var RegisterActionInput = BaseActionInput.extend(
|
|
3811
|
-
z33.strictObject({
|
|
3812
|
-
type: z33.literal(ActionType.REGISTER).default(ActionType.REGISTER),
|
|
3813
|
-
registrationNumber: z33.string().optional()
|
|
3814
|
-
}).shape
|
|
3705
|
+
})
|
|
3815
3706
|
);
|
|
3816
|
-
var
|
|
3817
|
-
|
|
3818
|
-
type:
|
|
3819
|
-
|
|
3707
|
+
var RegisterActionInput = BaseActionInput.merge(
|
|
3708
|
+
import_zod31.z.object({
|
|
3709
|
+
type: import_zod31.z.literal(ActionType.REGISTER).default(ActionType.REGISTER),
|
|
3710
|
+
registrationNumber: import_zod31.z.string().optional()
|
|
3711
|
+
})
|
|
3712
|
+
).strict();
|
|
3713
|
+
var ValidateActionInput = BaseActionInput.merge(
|
|
3714
|
+
import_zod31.z.object({
|
|
3715
|
+
type: import_zod31.z.literal(ActionType.VALIDATE).default(ActionType.VALIDATE)
|
|
3716
|
+
})
|
|
3820
3717
|
);
|
|
3821
|
-
var NotifyActionInput = BaseActionInput.
|
|
3822
|
-
|
|
3823
|
-
type:
|
|
3824
|
-
})
|
|
3825
|
-
).
|
|
3718
|
+
var NotifyActionInput = BaseActionInput.merge(
|
|
3719
|
+
import_zod31.z.object({
|
|
3720
|
+
type: import_zod31.z.literal(ActionType.NOTIFY).default(ActionType.NOTIFY)
|
|
3721
|
+
})
|
|
3722
|
+
).openapi({
|
|
3826
3723
|
default: {
|
|
3827
3724
|
eventId: "<event-id-here>",
|
|
3828
3725
|
transactionId: getUUID(),
|
|
@@ -3831,151 +3728,135 @@ var NotifyActionInput = BaseActionInput.extend(
|
|
|
3831
3728
|
type: ActionType.NOTIFY
|
|
3832
3729
|
}
|
|
3833
3730
|
});
|
|
3834
|
-
var DeclareActionInput = BaseActionInput.
|
|
3835
|
-
|
|
3836
|
-
type:
|
|
3837
|
-
})
|
|
3838
|
-
);
|
|
3839
|
-
var EditActionInput = BaseActionInput.extend(
|
|
3840
|
-
z33.object({
|
|
3841
|
-
type: z33.literal(ActionType.EDIT).default(ActionType.EDIT),
|
|
3842
|
-
content: z33.object({
|
|
3843
|
-
comment: z33.string().describe("Comment for the edit action.").optional()
|
|
3844
|
-
})
|
|
3845
|
-
}).shape
|
|
3731
|
+
var DeclareActionInput = BaseActionInput.merge(
|
|
3732
|
+
import_zod31.z.object({
|
|
3733
|
+
type: import_zod31.z.literal(ActionType.DECLARE).default(ActionType.DECLARE)
|
|
3734
|
+
})
|
|
3846
3735
|
);
|
|
3847
|
-
var PrintCertificateActionInput = BaseActionInput.
|
|
3848
|
-
|
|
3849
|
-
type:
|
|
3736
|
+
var PrintCertificateActionInput = BaseActionInput.merge(
|
|
3737
|
+
import_zod31.z.object({
|
|
3738
|
+
type: import_zod31.z.literal(ActionType.PRINT_CERTIFICATE).default(ActionType.PRINT_CERTIFICATE),
|
|
3850
3739
|
content: PrintContent.optional()
|
|
3851
|
-
})
|
|
3740
|
+
})
|
|
3852
3741
|
);
|
|
3853
|
-
var RejectDeclarationActionInput = BaseActionInput.
|
|
3854
|
-
|
|
3855
|
-
type:
|
|
3742
|
+
var RejectDeclarationActionInput = BaseActionInput.merge(
|
|
3743
|
+
import_zod31.z.object({
|
|
3744
|
+
type: import_zod31.z.literal(ActionType.REJECT).default(ActionType.REJECT),
|
|
3856
3745
|
content: ReasonContent
|
|
3857
|
-
})
|
|
3746
|
+
})
|
|
3858
3747
|
);
|
|
3859
|
-
var DuplicateDetectedActionInput = BaseActionInput.
|
|
3860
|
-
|
|
3861
|
-
type:
|
|
3862
|
-
content:
|
|
3863
|
-
duplicates:
|
|
3748
|
+
var DuplicateDetectedActionInput = BaseActionInput.merge(
|
|
3749
|
+
import_zod31.z.object({
|
|
3750
|
+
type: import_zod31.z.literal(ActionType.DUPLICATE_DETECTED).default(ActionType.DUPLICATE_DETECTED),
|
|
3751
|
+
content: import_zod31.z.object({
|
|
3752
|
+
duplicates: import_zod31.z.array(PotentialDuplicate)
|
|
3864
3753
|
})
|
|
3865
|
-
})
|
|
3754
|
+
})
|
|
3866
3755
|
);
|
|
3867
|
-
var MarkAsDuplicateActionInput = BaseActionInput.
|
|
3868
|
-
|
|
3869
|
-
type:
|
|
3870
|
-
content:
|
|
3756
|
+
var MarkAsDuplicateActionInput = BaseActionInput.merge(
|
|
3757
|
+
import_zod31.z.object({
|
|
3758
|
+
type: import_zod31.z.literal(ActionType.MARK_AS_DUPLICATE).default(ActionType.MARK_AS_DUPLICATE),
|
|
3759
|
+
content: import_zod31.z.object({
|
|
3871
3760
|
duplicateOf: UUID
|
|
3872
3761
|
}).optional()
|
|
3873
|
-
})
|
|
3762
|
+
})
|
|
3874
3763
|
);
|
|
3875
|
-
var MarkNotDuplicateActionInput = BaseActionInput.
|
|
3876
|
-
|
|
3877
|
-
type:
|
|
3878
|
-
})
|
|
3764
|
+
var MarkNotDuplicateActionInput = BaseActionInput.merge(
|
|
3765
|
+
import_zod31.z.object({
|
|
3766
|
+
type: import_zod31.z.literal(ActionType.MARK_AS_NOT_DUPLICATE).default(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
3767
|
+
})
|
|
3879
3768
|
);
|
|
3880
|
-
var ArchiveActionInput = BaseActionInput.
|
|
3881
|
-
|
|
3882
|
-
type:
|
|
3769
|
+
var ArchiveActionInput = BaseActionInput.merge(
|
|
3770
|
+
import_zod31.z.object({
|
|
3771
|
+
type: import_zod31.z.literal(ActionType.ARCHIVE).default(ActionType.ARCHIVE),
|
|
3883
3772
|
content: ReasonContent
|
|
3884
|
-
})
|
|
3773
|
+
})
|
|
3885
3774
|
);
|
|
3886
|
-
var AssignActionInput = BaseActionInput.
|
|
3887
|
-
|
|
3888
|
-
type:
|
|
3889
|
-
assignedTo:
|
|
3890
|
-
})
|
|
3775
|
+
var AssignActionInput = BaseActionInput.merge(
|
|
3776
|
+
import_zod31.z.object({
|
|
3777
|
+
type: import_zod31.z.literal(ActionType.ASSIGN),
|
|
3778
|
+
assignedTo: import_zod31.z.string()
|
|
3779
|
+
})
|
|
3891
3780
|
);
|
|
3892
|
-
var UnassignActionInput = BaseActionInput.
|
|
3893
|
-
|
|
3894
|
-
type:
|
|
3895
|
-
assignedTo:
|
|
3896
|
-
})
|
|
3781
|
+
var UnassignActionInput = BaseActionInput.merge(
|
|
3782
|
+
import_zod31.z.object({
|
|
3783
|
+
type: import_zod31.z.literal(ActionType.UNASSIGN).default(ActionType.UNASSIGN),
|
|
3784
|
+
assignedTo: import_zod31.z.literal(null).default(null)
|
|
3785
|
+
})
|
|
3897
3786
|
);
|
|
3898
|
-
var RequestCorrectionActionInput = BaseActionInput.
|
|
3899
|
-
|
|
3900
|
-
type:
|
|
3901
|
-
})
|
|
3787
|
+
var RequestCorrectionActionInput = BaseActionInput.merge(
|
|
3788
|
+
import_zod31.z.object({
|
|
3789
|
+
type: import_zod31.z.literal(ActionType.REQUEST_CORRECTION).default(ActionType.REQUEST_CORRECTION)
|
|
3790
|
+
})
|
|
3902
3791
|
);
|
|
3903
|
-
var RejectCorrectionActionInput = BaseActionInput.
|
|
3904
|
-
|
|
3905
|
-
requestId:
|
|
3906
|
-
type:
|
|
3792
|
+
var RejectCorrectionActionInput = BaseActionInput.merge(
|
|
3793
|
+
import_zod31.z.object({
|
|
3794
|
+
requestId: import_zod31.z.string(),
|
|
3795
|
+
type: import_zod31.z.literal(ActionType.REJECT_CORRECTION).default(ActionType.REJECT_CORRECTION),
|
|
3907
3796
|
content: ReasonContent
|
|
3908
|
-
})
|
|
3909
|
-
);
|
|
3910
|
-
var ApproveCorrectionActionInput = BaseActionInput.extend(
|
|
3911
|
-
z33.object({
|
|
3912
|
-
requestId: z33.string(),
|
|
3913
|
-
type: z33.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
|
|
3914
|
-
}).shape
|
|
3797
|
+
})
|
|
3915
3798
|
);
|
|
3916
|
-
var
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3799
|
+
var ApproveCorrectionActionInput = BaseActionInput.merge(
|
|
3800
|
+
import_zod31.z.object({
|
|
3801
|
+
requestId: import_zod31.z.string(),
|
|
3802
|
+
type: import_zod31.z.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
|
|
3803
|
+
})
|
|
3920
3804
|
);
|
|
3921
|
-
var
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
customActionType: z33.string().describe("Name of the custom action.")
|
|
3926
|
-
}).shape
|
|
3805
|
+
var ReadActionInput = BaseActionInput.merge(
|
|
3806
|
+
import_zod31.z.object({
|
|
3807
|
+
type: import_zod31.z.literal(ActionType.READ).default(ActionType.READ)
|
|
3808
|
+
})
|
|
3927
3809
|
);
|
|
3928
|
-
var
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3810
|
+
var DeleteActionInput = import_zod31.z.object({ eventId: UUID });
|
|
3811
|
+
var ActionInput = import_zod31.z.discriminatedUnion("type", [
|
|
3812
|
+
CreateActionInput.openapi({ ref: "CreateActionInput" }),
|
|
3813
|
+
ValidateActionInput.openapi({ ref: "ValidateActionInput" }),
|
|
3814
|
+
RegisterActionInput.openapi({ ref: "RegisterActionInput" }),
|
|
3815
|
+
NotifyActionInput.openapi({ ref: "NotifyActionInput" }),
|
|
3816
|
+
DeclareActionInput.openapi({ ref: "DeclareActionInput" }),
|
|
3817
|
+
RejectDeclarationActionInput.openapi({
|
|
3818
|
+
ref: "RejectDeclarationActionInput"
|
|
3936
3819
|
}),
|
|
3937
|
-
DuplicateDetectedActionInput.
|
|
3938
|
-
|
|
3820
|
+
DuplicateDetectedActionInput.openapi({
|
|
3821
|
+
ref: "DuplicateDetectedActionInput"
|
|
3939
3822
|
}),
|
|
3940
|
-
MarkAsDuplicateActionInput.
|
|
3941
|
-
|
|
3823
|
+
MarkAsDuplicateActionInput.openapi({
|
|
3824
|
+
ref: "MarkAsDuplicateActionInput"
|
|
3942
3825
|
}),
|
|
3943
|
-
MarkNotDuplicateActionInput.
|
|
3944
|
-
|
|
3826
|
+
MarkNotDuplicateActionInput.openapi({
|
|
3827
|
+
ref: "MarkNotDuplicateActionInput"
|
|
3945
3828
|
}),
|
|
3946
|
-
ArchiveActionInput.
|
|
3947
|
-
AssignActionInput.
|
|
3948
|
-
UnassignActionInput.
|
|
3949
|
-
PrintCertificateActionInput.
|
|
3950
|
-
RequestCorrectionActionInput.
|
|
3951
|
-
|
|
3829
|
+
ArchiveActionInput.openapi({ ref: "ArchiveActionInput" }),
|
|
3830
|
+
AssignActionInput.openapi({ ref: "AssignActionInput" }),
|
|
3831
|
+
UnassignActionInput.openapi({ ref: "UnassignActionInput" }),
|
|
3832
|
+
PrintCertificateActionInput.openapi({ ref: "PrintCertificateActionInput" }),
|
|
3833
|
+
RequestCorrectionActionInput.openapi({
|
|
3834
|
+
ref: "RequestCorrectionActionInput"
|
|
3952
3835
|
}),
|
|
3953
|
-
RejectCorrectionActionInput.
|
|
3954
|
-
ApproveCorrectionActionInput.
|
|
3955
|
-
|
|
3836
|
+
RejectCorrectionActionInput.openapi({ ref: "RejectCorrectionActionInput" }),
|
|
3837
|
+
ApproveCorrectionActionInput.openapi({
|
|
3838
|
+
ref: "ApproveCorrectionActionInput"
|
|
3956
3839
|
}),
|
|
3957
|
-
ReadActionInput.
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
]).meta({
|
|
3961
|
-
id: "ActionInput"
|
|
3840
|
+
ReadActionInput.openapi({ ref: "ReadActionInput" })
|
|
3841
|
+
]).openapi({
|
|
3842
|
+
ref: "ActionInput"
|
|
3962
3843
|
});
|
|
3963
3844
|
|
|
3964
3845
|
// ../commons/src/events/Draft.ts
|
|
3965
|
-
var Draft =
|
|
3846
|
+
var Draft = import_zod32.z.object({
|
|
3966
3847
|
id: UUID,
|
|
3967
3848
|
eventId: UUID,
|
|
3968
|
-
transactionId:
|
|
3969
|
-
createdAt:
|
|
3849
|
+
transactionId: import_zod32.z.string(),
|
|
3850
|
+
createdAt: import_zod32.z.string().datetime(),
|
|
3970
3851
|
action: ActionBase.extend({
|
|
3971
|
-
type: ActionTypes.exclude([ActionTypes.
|
|
3852
|
+
type: ActionTypes.exclude([ActionTypes.Enum.DELETE])
|
|
3972
3853
|
}).omit({ id: true, createdAtLocation: true })
|
|
3973
3854
|
}).describe(
|
|
3974
3855
|
"A temporary storage for an action. Stored with details of the event, creator and creation time."
|
|
3975
3856
|
);
|
|
3976
3857
|
var DraftInput = BaseActionInput.extend({
|
|
3977
|
-
type: ActionTypes.exclude([ActionTypes.
|
|
3978
|
-
status:
|
|
3858
|
+
type: ActionTypes.exclude([ActionTypes.Enum.DELETE]),
|
|
3859
|
+
status: import_zod32.z.enum([
|
|
3979
3860
|
ActionStatus.Requested,
|
|
3980
3861
|
ActionStatus.Accepted,
|
|
3981
3862
|
ActionStatus.Rejected
|
|
@@ -3983,30 +3864,32 @@ var DraftInput = BaseActionInput.extend({
|
|
|
3983
3864
|
});
|
|
3984
3865
|
|
|
3985
3866
|
// ../commons/src/events/EventInput.ts
|
|
3986
|
-
var
|
|
3867
|
+
var import_zod33 = require("zod");
|
|
3987
3868
|
var import_uuid10 = require("uuid");
|
|
3988
|
-
var EventInput =
|
|
3989
|
-
transactionId:
|
|
3990
|
-
type:
|
|
3991
|
-
}).
|
|
3869
|
+
var EventInput = import_zod33.z.object({
|
|
3870
|
+
transactionId: import_zod33.z.string(),
|
|
3871
|
+
type: import_zod33.z.string()
|
|
3872
|
+
}).openapi({ default: { transactionId: (0, import_uuid10.v4)(), type: "birth" } });
|
|
3992
3873
|
|
|
3993
3874
|
// ../commons/src/events/EventDocument.ts
|
|
3994
|
-
var
|
|
3995
|
-
var
|
|
3875
|
+
var import_zod34 = require("zod");
|
|
3876
|
+
var import_zod_openapi12 = require("zod-openapi");
|
|
3877
|
+
(0, import_zod_openapi12.extendZodWithOpenApi)(import_zod34.z);
|
|
3878
|
+
var EventDocument = import_zod34.z.object({
|
|
3996
3879
|
id: UUID.describe("Unique identifier of the event."),
|
|
3997
|
-
type:
|
|
3998
|
-
createdAt:
|
|
3999
|
-
updatedAt:
|
|
3880
|
+
type: import_zod34.z.string().describe("Type of the event (e.g. birth, death, marriage)."),
|
|
3881
|
+
createdAt: import_zod34.z.string().datetime().describe("Timestamp indicating when the event was created."),
|
|
3882
|
+
updatedAt: import_zod34.z.string().datetime().describe(
|
|
4000
3883
|
"Timestamp of the last update, excluding changes from actions."
|
|
4001
3884
|
),
|
|
4002
|
-
actions:
|
|
4003
|
-
trackingId:
|
|
3885
|
+
actions: import_zod34.z.array(Action).describe("Ordered list of actions associated with the event."),
|
|
3886
|
+
trackingId: import_zod34.z.string().describe(
|
|
4004
3887
|
"System-generated tracking identifier used to look up the event."
|
|
4005
3888
|
)
|
|
4006
|
-
}).
|
|
3889
|
+
}).openapi({ ref: "EventDocument" });
|
|
4007
3890
|
|
|
4008
3891
|
// ../commons/src/events/state/index.ts
|
|
4009
|
-
var
|
|
3892
|
+
var import_lodash3 = require("lodash");
|
|
4010
3893
|
|
|
4011
3894
|
// ../commons/src/events/state/utils.ts
|
|
4012
3895
|
var import_lodash2 = require("lodash");
|
|
@@ -4019,14 +3902,9 @@ var updateActions = ActionTypes.extract([
|
|
|
4019
3902
|
ActionType.REJECT,
|
|
4020
3903
|
ActionType.ARCHIVE,
|
|
4021
3904
|
ActionType.PRINT_CERTIFICATE,
|
|
4022
|
-
ActionType.REQUEST_CORRECTION
|
|
4023
|
-
ActionType.CUSTOM
|
|
3905
|
+
ActionType.REQUEST_CORRECTION
|
|
4024
3906
|
]);
|
|
4025
3907
|
|
|
4026
|
-
// ../commons/src/events/state/flags.ts
|
|
4027
|
-
var import_lodash3 = require("lodash");
|
|
4028
|
-
var import_date_fns3 = require("date-fns");
|
|
4029
|
-
|
|
4030
3908
|
// ../commons/src/events/defineConfig.ts
|
|
4031
3909
|
var defineConfig = (config) => {
|
|
4032
3910
|
const input = EventConfig.parse(config);
|
|
@@ -4034,7 +3912,7 @@ var defineConfig = (config) => {
|
|
|
4034
3912
|
};
|
|
4035
3913
|
|
|
4036
3914
|
// ../commons/src/events/test.utils.ts
|
|
4037
|
-
var
|
|
3915
|
+
var import_lodash4 = require("lodash");
|
|
4038
3916
|
var import_date_fns4 = require("date-fns");
|
|
4039
3917
|
|
|
4040
3918
|
// ../commons/src/field-config/field-configuration.ts
|
|
@@ -4056,6 +3934,7 @@ function field(fieldId, options = {}) {
|
|
|
4056
3934
|
}
|
|
4057
3935
|
|
|
4058
3936
|
// ../commons/src/fixtures/forms.ts
|
|
3937
|
+
var import_date_fns3 = require("date-fns");
|
|
4059
3938
|
var PRINT_CERTIFICATE_FORM = defineActionForm({
|
|
4060
3939
|
label: {
|
|
4061
3940
|
id: "event.tennis-club-membership.action.certificate.form.label",
|
|
@@ -4855,7 +4734,7 @@ var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
|
|
|
4855
4734
|
conditionals: [
|
|
4856
4735
|
{
|
|
4857
4736
|
type: ConditionalType.DISPLAY_ON_REVIEW,
|
|
4858
|
-
conditional:
|
|
4737
|
+
conditional: never()
|
|
4859
4738
|
}
|
|
4860
4739
|
]
|
|
4861
4740
|
},
|
|
@@ -5238,16 +5117,119 @@ var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
|
|
|
5238
5117
|
}
|
|
5239
5118
|
}
|
|
5240
5119
|
],
|
|
5241
|
-
conditional: not(
|
|
5120
|
+
conditional: not(never())
|
|
5242
5121
|
// Intentional always-true page conditional to exercise interactions between page-level and field-level conditionals in tests
|
|
5243
5122
|
}
|
|
5244
5123
|
]
|
|
5245
5124
|
});
|
|
5125
|
+
var statusOptions = [
|
|
5126
|
+
{
|
|
5127
|
+
value: "ALL",
|
|
5128
|
+
label: {
|
|
5129
|
+
defaultMessage: "Any status",
|
|
5130
|
+
description: "Option for form field: status of record",
|
|
5131
|
+
id: "advancedSearch.form.recordStatusAny"
|
|
5132
|
+
}
|
|
5133
|
+
},
|
|
5134
|
+
{
|
|
5135
|
+
value: EventStatus.enum.CREATED,
|
|
5136
|
+
label: {
|
|
5137
|
+
defaultMessage: "Draft",
|
|
5138
|
+
description: "Option for form field: status of record",
|
|
5139
|
+
id: "advancedSearch.form.recordStatusCreated"
|
|
5140
|
+
}
|
|
5141
|
+
},
|
|
5142
|
+
{
|
|
5143
|
+
value: EventStatus.enum.NOTIFIED,
|
|
5144
|
+
label: {
|
|
5145
|
+
defaultMessage: "Notified",
|
|
5146
|
+
description: "Option for form field: status of record",
|
|
5147
|
+
id: "advancedSearch.form.recordStatusNotified"
|
|
5148
|
+
}
|
|
5149
|
+
},
|
|
5150
|
+
{
|
|
5151
|
+
value: EventStatus.enum.DECLARED,
|
|
5152
|
+
label: {
|
|
5153
|
+
defaultMessage: "Declared",
|
|
5154
|
+
description: "Option for form field: status of record",
|
|
5155
|
+
id: "advancedSearch.form.recordStatusDeclared"
|
|
5156
|
+
}
|
|
5157
|
+
},
|
|
5158
|
+
{
|
|
5159
|
+
value: EventStatus.enum.VALIDATED,
|
|
5160
|
+
label: {
|
|
5161
|
+
defaultMessage: "Validated",
|
|
5162
|
+
description: "Option for form field: status of record",
|
|
5163
|
+
id: "advancedSearch.form.recordStatusValidated"
|
|
5164
|
+
}
|
|
5165
|
+
},
|
|
5166
|
+
{
|
|
5167
|
+
value: EventStatus.enum.REGISTERED,
|
|
5168
|
+
label: {
|
|
5169
|
+
defaultMessage: "Registered",
|
|
5170
|
+
description: "Option for form field: status of record",
|
|
5171
|
+
id: "advancedSearch.form.recordStatusRegistered"
|
|
5172
|
+
}
|
|
5173
|
+
},
|
|
5174
|
+
{
|
|
5175
|
+
value: EventStatus.enum.ARCHIVED,
|
|
5176
|
+
label: {
|
|
5177
|
+
defaultMessage: "Archived",
|
|
5178
|
+
description: "Option for form field: status of record",
|
|
5179
|
+
id: "advancedSearch.form.recordStatusArchived"
|
|
5180
|
+
}
|
|
5181
|
+
}
|
|
5182
|
+
];
|
|
5183
|
+
var timePeriodOptions = [
|
|
5184
|
+
{
|
|
5185
|
+
label: {
|
|
5186
|
+
defaultMessage: "Last 7 days",
|
|
5187
|
+
description: "Label for option of time period select: last 7 days",
|
|
5188
|
+
id: "form.section.label.timePeriodLast7Days"
|
|
5189
|
+
},
|
|
5190
|
+
value: `${(0, import_date_fns3.format)((0, import_date_fns3.subDays)(/* @__PURE__ */ new Date(), 7), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
|
|
5191
|
+
/* @__PURE__ */ new Date(),
|
|
5192
|
+
"yyyy-MM-dd"
|
|
5193
|
+
)}`
|
|
5194
|
+
},
|
|
5195
|
+
{
|
|
5196
|
+
label: {
|
|
5197
|
+
defaultMessage: "Last 30 days",
|
|
5198
|
+
description: "Label for option of time period select: last 30 days",
|
|
5199
|
+
id: "form.section.label.timePeriodLast30Days"
|
|
5200
|
+
},
|
|
5201
|
+
value: `${(0, import_date_fns3.format)((0, import_date_fns3.subMonths)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
|
|
5202
|
+
/* @__PURE__ */ new Date(),
|
|
5203
|
+
"yyyy-MM-dd"
|
|
5204
|
+
)}`
|
|
5205
|
+
},
|
|
5206
|
+
{
|
|
5207
|
+
label: {
|
|
5208
|
+
defaultMessage: "Last 90 days",
|
|
5209
|
+
description: "Label for option of time period select: last 90 days",
|
|
5210
|
+
id: "form.section.label.timePeriodLast90Days"
|
|
5211
|
+
},
|
|
5212
|
+
value: `${(0, import_date_fns3.format)((0, import_date_fns3.subQuarters)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
|
|
5213
|
+
/* @__PURE__ */ new Date(),
|
|
5214
|
+
"yyyy-MM-dd"
|
|
5215
|
+
)}`
|
|
5216
|
+
},
|
|
5217
|
+
{
|
|
5218
|
+
label: {
|
|
5219
|
+
defaultMessage: "Last year",
|
|
5220
|
+
description: "Label for option of time period select: last year",
|
|
5221
|
+
id: "form.section.label.timePeriodLastYear"
|
|
5222
|
+
},
|
|
5223
|
+
value: `${(0, import_date_fns3.format)((0, import_date_fns3.subYears)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
|
|
5224
|
+
/* @__PURE__ */ new Date(),
|
|
5225
|
+
"yyyy-MM-dd"
|
|
5226
|
+
)}`
|
|
5227
|
+
}
|
|
5228
|
+
];
|
|
5246
5229
|
|
|
5247
5230
|
// ../commons/src/fixtures/tennis-club-membership-event.ts
|
|
5248
5231
|
var tennisClubMembershipEvent = defineConfig({
|
|
5249
5232
|
id: TENNIS_CLUB_MEMBERSHIP,
|
|
5250
|
-
declaration: TENNIS_CLUB_DECLARATION_FORM,
|
|
5251
5233
|
label: {
|
|
5252
5234
|
defaultMessage: "Tennis club membership application",
|
|
5253
5235
|
description: "This is what this event is referred as in the system",
|
|
@@ -5278,17 +5260,6 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5278
5260
|
}
|
|
5279
5261
|
]
|
|
5280
5262
|
},
|
|
5281
|
-
flags: [
|
|
5282
|
-
{
|
|
5283
|
-
id: "validated",
|
|
5284
|
-
label: {
|
|
5285
|
-
id: "event.tennis-club-membership.flag.validated",
|
|
5286
|
-
defaultMessage: "Validated",
|
|
5287
|
-
description: "Flag label for validated"
|
|
5288
|
-
},
|
|
5289
|
-
requiresAction: true
|
|
5290
|
-
}
|
|
5291
|
-
],
|
|
5292
5263
|
actions: [
|
|
5293
5264
|
{
|
|
5294
5265
|
type: ActionType.READ,
|
|
@@ -5315,19 +5286,7 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5315
5286
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5316
5287
|
id: "event.tennis-club-membership.action.validate.label"
|
|
5317
5288
|
},
|
|
5318
|
-
|
|
5319
|
-
conditionals: [
|
|
5320
|
-
{ type: ConditionalType.SHOW, conditional: not(flag("validated")) }
|
|
5321
|
-
]
|
|
5322
|
-
},
|
|
5323
|
-
{
|
|
5324
|
-
type: ActionType.REJECT,
|
|
5325
|
-
label: {
|
|
5326
|
-
defaultMessage: "Reject",
|
|
5327
|
-
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5328
|
-
id: "event.tennis-club-membership.action.reject.label"
|
|
5329
|
-
},
|
|
5330
|
-
flags: [{ id: "validated", operation: "remove" }]
|
|
5289
|
+
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5331
5290
|
},
|
|
5332
5291
|
{
|
|
5333
5292
|
type: ActionType.REGISTER,
|
|
@@ -5335,7 +5294,8 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5335
5294
|
defaultMessage: "Register",
|
|
5336
5295
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5337
5296
|
id: "event.tennis-club-membership.action.register.label"
|
|
5338
|
-
}
|
|
5297
|
+
},
|
|
5298
|
+
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5339
5299
|
},
|
|
5340
5300
|
{
|
|
5341
5301
|
type: ActionType.REQUEST_CORRECTION,
|
|
@@ -5538,6 +5498,14 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5538
5498
|
]
|
|
5539
5499
|
}
|
|
5540
5500
|
},
|
|
5501
|
+
{
|
|
5502
|
+
type: ActionType.APPROVE_CORRECTION,
|
|
5503
|
+
label: {
|
|
5504
|
+
defaultMessage: "Approve correction",
|
|
5505
|
+
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5506
|
+
id: "event.tennis-club-membership.action.correction.approve.label"
|
|
5507
|
+
}
|
|
5508
|
+
},
|
|
5541
5509
|
{
|
|
5542
5510
|
type: ActionType.PRINT_CERTIFICATE,
|
|
5543
5511
|
label: {
|
|
@@ -5546,6 +5514,22 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5546
5514
|
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5547
5515
|
},
|
|
5548
5516
|
printForm: PRINT_CERTIFICATE_FORM
|
|
5517
|
+
},
|
|
5518
|
+
{
|
|
5519
|
+
type: ActionType.ARCHIVE,
|
|
5520
|
+
label: {
|
|
5521
|
+
id: "event.tennis-club-membership.action.archive.label",
|
|
5522
|
+
defaultMessage: "Archive",
|
|
5523
|
+
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5524
|
+
}
|
|
5525
|
+
},
|
|
5526
|
+
{
|
|
5527
|
+
type: ActionType.REJECT,
|
|
5528
|
+
label: {
|
|
5529
|
+
id: "event.tennis-club-membership.action.reject.label",
|
|
5530
|
+
defaultMessage: "Reject",
|
|
5531
|
+
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5532
|
+
}
|
|
5549
5533
|
}
|
|
5550
5534
|
],
|
|
5551
5535
|
advancedSearch: [
|
|
@@ -5582,7 +5566,8 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5582
5566
|
},
|
|
5583
5567
|
fields: [field("recommender.name").fuzzy()]
|
|
5584
5568
|
}
|
|
5585
|
-
]
|
|
5569
|
+
],
|
|
5570
|
+
declaration: TENNIS_CLUB_DECLARATION_FORM
|
|
5586
5571
|
});
|
|
5587
5572
|
|
|
5588
5573
|
// ../commons/src/fixtures/football-club-membership-event.ts
|
|
@@ -5656,7 +5641,8 @@ var footballClubMembershipEvent = defineConfig({
|
|
|
5656
5641
|
defaultMessage: "Validate",
|
|
5657
5642
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5658
5643
|
id: "event.football-club-membership.action.validate.label"
|
|
5659
|
-
}
|
|
5644
|
+
},
|
|
5645
|
+
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5660
5646
|
},
|
|
5661
5647
|
{
|
|
5662
5648
|
type: ActionType.REGISTER,
|
|
@@ -5664,7 +5650,8 @@ var footballClubMembershipEvent = defineConfig({
|
|
|
5664
5650
|
defaultMessage: "Register",
|
|
5665
5651
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5666
5652
|
id: "event.football-club-membership.action.register.label"
|
|
5667
|
-
}
|
|
5653
|
+
},
|
|
5654
|
+
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5668
5655
|
},
|
|
5669
5656
|
{
|
|
5670
5657
|
type: ActionType.REQUEST_CORRECTION,
|
|
@@ -5870,6 +5857,14 @@ var footballClubMembershipEvent = defineConfig({
|
|
|
5870
5857
|
]
|
|
5871
5858
|
}
|
|
5872
5859
|
},
|
|
5860
|
+
{
|
|
5861
|
+
type: ActionType.APPROVE_CORRECTION,
|
|
5862
|
+
label: {
|
|
5863
|
+
defaultMessage: "Approve correction",
|
|
5864
|
+
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5865
|
+
id: "event.football-club-membership.action.correction.approve.label"
|
|
5866
|
+
}
|
|
5867
|
+
},
|
|
5873
5868
|
{
|
|
5874
5869
|
type: ActionType.PRINT_CERTIFICATE,
|
|
5875
5870
|
label: {
|
|
@@ -5878,6 +5873,22 @@ var footballClubMembershipEvent = defineConfig({
|
|
|
5878
5873
|
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5879
5874
|
},
|
|
5880
5875
|
printForm: PRINT_CERTIFICATE_FORM
|
|
5876
|
+
},
|
|
5877
|
+
{
|
|
5878
|
+
type: ActionType.ARCHIVE,
|
|
5879
|
+
label: {
|
|
5880
|
+
id: "event.football-club-membership.action.archive.label",
|
|
5881
|
+
defaultMessage: "Archive",
|
|
5882
|
+
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5883
|
+
}
|
|
5884
|
+
},
|
|
5885
|
+
{
|
|
5886
|
+
type: ActionType.REJECT,
|
|
5887
|
+
label: {
|
|
5888
|
+
id: "event.football-club-membership.action.reject.label",
|
|
5889
|
+
defaultMessage: "Reject",
|
|
5890
|
+
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5891
|
+
}
|
|
5881
5892
|
}
|
|
5882
5893
|
],
|
|
5883
5894
|
advancedSearch: [
|
|
@@ -5977,7 +5988,7 @@ var libraryMembershipEvent = defineConfig({
|
|
|
5977
5988
|
declaration: libraryMembershipForm
|
|
5978
5989
|
});
|
|
5979
5990
|
|
|
5980
|
-
// ../commons/src/fixtures/
|
|
5991
|
+
// ../commons/src/fixtures/v2-birth-event.ts
|
|
5981
5992
|
function generateTranslationConfig(message) {
|
|
5982
5993
|
return {
|
|
5983
5994
|
defaultMessage: message,
|
|
@@ -6006,61 +6017,6 @@ var child = defineFormPage({
|
|
|
6006
6017
|
secured: true,
|
|
6007
6018
|
validation: [],
|
|
6008
6019
|
label: generateTranslationConfig("Date of birth")
|
|
6009
|
-
},
|
|
6010
|
-
{
|
|
6011
|
-
id: "child.placeOfBirth",
|
|
6012
|
-
analytics: true,
|
|
6013
|
-
type: FieldType.SELECT,
|
|
6014
|
-
required: true,
|
|
6015
|
-
secured: true,
|
|
6016
|
-
label: {
|
|
6017
|
-
defaultMessage: "Place of delivery",
|
|
6018
|
-
description: "This is the label for the field",
|
|
6019
|
-
id: "event.birth.action.declare.form.section.child.field.placeOfBirth.label"
|
|
6020
|
-
},
|
|
6021
|
-
options: [
|
|
6022
|
-
{
|
|
6023
|
-
value: "child.placeOfBirth-SELECT-2",
|
|
6024
|
-
label: generateTranslationConfig("Health Institution")
|
|
6025
|
-
},
|
|
6026
|
-
{
|
|
6027
|
-
value: "PRIVATE_HOME",
|
|
6028
|
-
label: generateTranslationConfig("Residential address")
|
|
6029
|
-
}
|
|
6030
|
-
]
|
|
6031
|
-
},
|
|
6032
|
-
{
|
|
6033
|
-
id: "child.birthLocation",
|
|
6034
|
-
analytics: true,
|
|
6035
|
-
type: "FACILITY",
|
|
6036
|
-
required: true,
|
|
6037
|
-
secured: true,
|
|
6038
|
-
label: generateTranslationConfig("Health Institution"),
|
|
6039
|
-
conditionals: [
|
|
6040
|
-
{
|
|
6041
|
-
type: "SHOW",
|
|
6042
|
-
conditional: field("child.placeOfBirth").isEqualTo(
|
|
6043
|
-
"child.placeOfBirth-SELECT-2"
|
|
6044
|
-
)
|
|
6045
|
-
}
|
|
6046
|
-
]
|
|
6047
|
-
},
|
|
6048
|
-
{
|
|
6049
|
-
id: "child.birthLocation.privateHome",
|
|
6050
|
-
analytics: true,
|
|
6051
|
-
type: FieldType.ADDRESS,
|
|
6052
|
-
secured: true,
|
|
6053
|
-
hideLabel: true,
|
|
6054
|
-
label: generateTranslationConfig("Child's address"),
|
|
6055
|
-
conditionals: [
|
|
6056
|
-
{
|
|
6057
|
-
type: "SHOW",
|
|
6058
|
-
conditional: field("child.placeOfBirth").isEqualTo("PRIVATE_HOME")
|
|
6059
|
-
}
|
|
6060
|
-
],
|
|
6061
|
-
configuration: {
|
|
6062
|
-
streetAddressForm: []
|
|
6063
|
-
}
|
|
6064
6020
|
}
|
|
6065
6021
|
]
|
|
6066
6022
|
});
|
|
@@ -6137,7 +6093,7 @@ var mother = defineFormPage({
|
|
|
6137
6093
|
}
|
|
6138
6094
|
]
|
|
6139
6095
|
});
|
|
6140
|
-
var
|
|
6096
|
+
var BIRTH_DECLARATION_REVIEW = {
|
|
6141
6097
|
title: generateTranslationConfig(
|
|
6142
6098
|
"{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}}}}}"
|
|
6143
6099
|
),
|
|
@@ -6157,12 +6113,12 @@ var CHILD_ONBOARDING_DECLARATION_REVIEW = {
|
|
|
6157
6113
|
}
|
|
6158
6114
|
]
|
|
6159
6115
|
};
|
|
6160
|
-
var
|
|
6116
|
+
var BIRTH_DECLARATION_FORM = defineDeclarationForm({
|
|
6161
6117
|
label: generateTranslationConfig("Birth decalration form"),
|
|
6162
6118
|
pages: [child, mother]
|
|
6163
6119
|
});
|
|
6164
|
-
var
|
|
6165
|
-
id:
|
|
6120
|
+
var v2BirthEvent = defineConfig({
|
|
6121
|
+
id: BIRTH_EVENT,
|
|
6166
6122
|
title: generateTranslationConfig(
|
|
6167
6123
|
"{child.name.firstname} {child.name.surname}"
|
|
6168
6124
|
),
|
|
@@ -6170,33 +6126,249 @@ var ChildOnboardingEvent = defineConfig({
|
|
|
6170
6126
|
summary: {
|
|
6171
6127
|
fields: []
|
|
6172
6128
|
},
|
|
6173
|
-
declaration:
|
|
6129
|
+
declaration: BIRTH_DECLARATION_FORM,
|
|
6174
6130
|
actions: [
|
|
6175
6131
|
{
|
|
6176
6132
|
type: ActionType.READ,
|
|
6177
6133
|
label: generateTranslationConfig("Read"),
|
|
6178
|
-
review:
|
|
6134
|
+
review: BIRTH_DECLARATION_REVIEW
|
|
6179
6135
|
},
|
|
6180
6136
|
{
|
|
6181
6137
|
type: ActionType.DECLARE,
|
|
6182
6138
|
label: generateTranslationConfig("Declare"),
|
|
6183
|
-
review:
|
|
6139
|
+
review: BIRTH_DECLARATION_REVIEW
|
|
6184
6140
|
},
|
|
6185
6141
|
{
|
|
6186
6142
|
type: ActionType.VALIDATE,
|
|
6187
|
-
label: generateTranslationConfig("Validate")
|
|
6143
|
+
label: generateTranslationConfig("Validate"),
|
|
6144
|
+
review: BIRTH_DECLARATION_REVIEW
|
|
6188
6145
|
},
|
|
6189
6146
|
{
|
|
6190
6147
|
type: ActionType.REGISTER,
|
|
6191
|
-
label: generateTranslationConfig("Register")
|
|
6148
|
+
label: generateTranslationConfig("Register"),
|
|
6149
|
+
review: BIRTH_DECLARATION_REVIEW
|
|
6192
6150
|
}
|
|
6193
6151
|
],
|
|
6194
6152
|
advancedSearch: []
|
|
6195
6153
|
});
|
|
6196
6154
|
|
|
6155
|
+
// ../commons/src/fixtures/digital-identity-issuance-event.ts
|
|
6156
|
+
var PRINT_DIGITAL_ID_CERTIFICATE_FORM = defineActionForm({
|
|
6157
|
+
label: {
|
|
6158
|
+
id: "event.digital-identity.action.certificate.form.label",
|
|
6159
|
+
defaultMessage: "Digital identity certificate printer",
|
|
6160
|
+
description: "This is what this form is referred as in the system"
|
|
6161
|
+
},
|
|
6162
|
+
pages: [
|
|
6163
|
+
{
|
|
6164
|
+
id: "collector",
|
|
6165
|
+
type: PageTypes.enum.FORM,
|
|
6166
|
+
title: {
|
|
6167
|
+
id: "event.tennis-club-membership.action.certificate.form.section.who.title",
|
|
6168
|
+
defaultMessage: "Print certified copy",
|
|
6169
|
+
description: "This is the title of the section"
|
|
6170
|
+
},
|
|
6171
|
+
fields: [
|
|
6172
|
+
{
|
|
6173
|
+
id: "identity.http-fetch",
|
|
6174
|
+
type: FieldType.HTTP,
|
|
6175
|
+
label: {
|
|
6176
|
+
defaultMessage: "Digital identity certificate",
|
|
6177
|
+
description: "Fetch printable digital identity certificate",
|
|
6178
|
+
id: "event.digital-identity.certificate.fetch.label"
|
|
6179
|
+
},
|
|
6180
|
+
configuration: {
|
|
6181
|
+
trigger: field("identity.http-button"),
|
|
6182
|
+
url: "/api/digital-identity/certificate",
|
|
6183
|
+
timeout: 5e3,
|
|
6184
|
+
method: "POST",
|
|
6185
|
+
headers: {
|
|
6186
|
+
"Content-Type": "application/json"
|
|
6187
|
+
},
|
|
6188
|
+
body: {
|
|
6189
|
+
subjectId: "$event.subject.id"
|
|
6190
|
+
}
|
|
6191
|
+
}
|
|
6192
|
+
},
|
|
6193
|
+
{
|
|
6194
|
+
id: "identity.http-button",
|
|
6195
|
+
type: FieldType.BUTTON,
|
|
6196
|
+
label: {
|
|
6197
|
+
defaultMessage: "Certificate",
|
|
6198
|
+
description: "Certificate",
|
|
6199
|
+
id: "event.digital-identity.certificate.button.label"
|
|
6200
|
+
},
|
|
6201
|
+
conditionals: [
|
|
6202
|
+
{
|
|
6203
|
+
type: ConditionalType.ENABLE,
|
|
6204
|
+
conditional: and(
|
|
6205
|
+
field("identity.http-fetch").isUndefined(),
|
|
6206
|
+
user.isOnline()
|
|
6207
|
+
)
|
|
6208
|
+
},
|
|
6209
|
+
{
|
|
6210
|
+
type: ConditionalType.SHOW,
|
|
6211
|
+
conditional: and(
|
|
6212
|
+
field("identity.http-fetch").get("loading").isFalsy(),
|
|
6213
|
+
field("identity.http-fetch").get("data").isFalsy()
|
|
6214
|
+
)
|
|
6215
|
+
}
|
|
6216
|
+
],
|
|
6217
|
+
configuration: {
|
|
6218
|
+
icon: "IdentificationCard",
|
|
6219
|
+
text: {
|
|
6220
|
+
defaultMessage: "Fetch certificate",
|
|
6221
|
+
description: "Fetch certificate",
|
|
6222
|
+
id: "event.digital-identity.certificate.fetch.text"
|
|
6223
|
+
}
|
|
6224
|
+
}
|
|
6225
|
+
},
|
|
6226
|
+
{
|
|
6227
|
+
id: "identity.http-button",
|
|
6228
|
+
type: FieldType.BUTTON,
|
|
6229
|
+
label: {
|
|
6230
|
+
defaultMessage: "Certificate",
|
|
6231
|
+
description: "Certificate",
|
|
6232
|
+
id: "event.digital-identity.certificate.button.label"
|
|
6233
|
+
},
|
|
6234
|
+
conditionals: [
|
|
6235
|
+
{
|
|
6236
|
+
type: ConditionalType.ENABLE,
|
|
6237
|
+
conditional: never()
|
|
6238
|
+
},
|
|
6239
|
+
{
|
|
6240
|
+
type: ConditionalType.SHOW,
|
|
6241
|
+
conditional: field("identity.http-fetch").get("loading").isEqualTo(true)
|
|
6242
|
+
}
|
|
6243
|
+
],
|
|
6244
|
+
configuration: {
|
|
6245
|
+
loading: true,
|
|
6246
|
+
text: {
|
|
6247
|
+
defaultMessage: "Fetching certificate\u2026",
|
|
6248
|
+
description: "Fetching certificate\u2026",
|
|
6249
|
+
id: "event.digital-identity.certificate.fetching.text"
|
|
6250
|
+
}
|
|
6251
|
+
}
|
|
6252
|
+
},
|
|
6253
|
+
{
|
|
6254
|
+
id: "identity.http-button",
|
|
6255
|
+
type: FieldType.BUTTON,
|
|
6256
|
+
label: {
|
|
6257
|
+
defaultMessage: "Certificate",
|
|
6258
|
+
description: "Certificate",
|
|
6259
|
+
id: "event.digital-identity.certificate.button.label"
|
|
6260
|
+
},
|
|
6261
|
+
conditionals: [
|
|
6262
|
+
{
|
|
6263
|
+
type: ConditionalType.ENABLE,
|
|
6264
|
+
conditional: never()
|
|
6265
|
+
},
|
|
6266
|
+
{
|
|
6267
|
+
type: ConditionalType.SHOW,
|
|
6268
|
+
conditional: not(field("identity.certificateId").isFalsy())
|
|
6269
|
+
}
|
|
6270
|
+
],
|
|
6271
|
+
configuration: {
|
|
6272
|
+
icon: "Check",
|
|
6273
|
+
text: {
|
|
6274
|
+
defaultMessage: "Certificate ready",
|
|
6275
|
+
description: "Certificate ready",
|
|
6276
|
+
id: "event.digital-identity.certificate.ready.text"
|
|
6277
|
+
}
|
|
6278
|
+
}
|
|
6279
|
+
},
|
|
6280
|
+
{
|
|
6281
|
+
id: "identity.certificateId",
|
|
6282
|
+
type: FieldType.TEXT,
|
|
6283
|
+
parent: field("identity.http-fetch"),
|
|
6284
|
+
label: {
|
|
6285
|
+
defaultMessage: "Certificate ID",
|
|
6286
|
+
description: "Issued digital identity certificate identifier",
|
|
6287
|
+
id: "event.digital-identity.certificate.id.label"
|
|
6288
|
+
},
|
|
6289
|
+
conditionals: [
|
|
6290
|
+
{
|
|
6291
|
+
type: ConditionalType.ENABLE,
|
|
6292
|
+
conditional: never()
|
|
6293
|
+
}
|
|
6294
|
+
],
|
|
6295
|
+
value: field("identity.http-fetch").get("data.certificateId")
|
|
6296
|
+
}
|
|
6297
|
+
]
|
|
6298
|
+
}
|
|
6299
|
+
]
|
|
6300
|
+
});
|
|
6301
|
+
var digitalIdentityForm = defineDeclarationForm({
|
|
6302
|
+
label: {
|
|
6303
|
+
id: "event.digital-identity.action.declare.form.label",
|
|
6304
|
+
defaultMessage: "Digital identity issuance",
|
|
6305
|
+
description: "This is what this form is referred as in the system"
|
|
6306
|
+
},
|
|
6307
|
+
pages: [
|
|
6308
|
+
{
|
|
6309
|
+
id: "subject",
|
|
6310
|
+
title: {
|
|
6311
|
+
id: "event.digital-identity.action.declare.form.section.who.title",
|
|
6312
|
+
defaultMessage: "Who is the digital identity issued to?",
|
|
6313
|
+
description: "This is the title of the section"
|
|
6314
|
+
},
|
|
6315
|
+
fields: [
|
|
6316
|
+
{
|
|
6317
|
+
id: "subject.firstname",
|
|
6318
|
+
type: FieldType.TEXT,
|
|
6319
|
+
required: true,
|
|
6320
|
+
conditionals: [],
|
|
6321
|
+
label: {
|
|
6322
|
+
defaultMessage: "Subject's first name",
|
|
6323
|
+
description: "This is the label for the field",
|
|
6324
|
+
id: "event.digital-identity.action.declare.form.section.who.field.firstname.label"
|
|
6325
|
+
}
|
|
6326
|
+
},
|
|
6327
|
+
{
|
|
6328
|
+
id: "subject.surname",
|
|
6329
|
+
type: FieldType.TEXT,
|
|
6330
|
+
required: true,
|
|
6331
|
+
conditionals: [],
|
|
6332
|
+
label: {
|
|
6333
|
+
defaultMessage: "Subject's surname",
|
|
6334
|
+
description: "This is the label for the field",
|
|
6335
|
+
id: "event.digital-identity.action.declare.form.section.who.field.surname.label"
|
|
6336
|
+
}
|
|
6337
|
+
}
|
|
6338
|
+
]
|
|
6339
|
+
}
|
|
6340
|
+
]
|
|
6341
|
+
});
|
|
6342
|
+
var digitalIdentityEvent = defineConfig({
|
|
6343
|
+
id: "digital-identity",
|
|
6344
|
+
label: {
|
|
6345
|
+
defaultMessage: "Digital identity issuance",
|
|
6346
|
+
description: "This is what this event is referred as in the system",
|
|
6347
|
+
id: "event.digital-identity.label"
|
|
6348
|
+
},
|
|
6349
|
+
title: {
|
|
6350
|
+
defaultMessage: "{subject.firstname} {subject.surname}",
|
|
6351
|
+
description: "This is the title of the summary",
|
|
6352
|
+
id: "event.digital-identity.title"
|
|
6353
|
+
},
|
|
6354
|
+
summary: { fields: [] },
|
|
6355
|
+
actions: [
|
|
6356
|
+
{
|
|
6357
|
+
type: ActionType.PRINT_CERTIFICATE,
|
|
6358
|
+
label: {
|
|
6359
|
+
id: "event.football-club-membership.action.collect-certificate.label",
|
|
6360
|
+
defaultMessage: "Print certificate",
|
|
6361
|
+
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
6362
|
+
},
|
|
6363
|
+
printForm: PRINT_DIGITAL_ID_CERTIFICATE_FORM
|
|
6364
|
+
}
|
|
6365
|
+
],
|
|
6366
|
+
declaration: digitalIdentityForm
|
|
6367
|
+
});
|
|
6368
|
+
|
|
6197
6369
|
// ../commons/src/events/test.utils.ts
|
|
6198
|
-
var
|
|
6199
|
-
var TestUserRole =
|
|
6370
|
+
var import_zod35 = require("zod");
|
|
6371
|
+
var TestUserRole = import_zod35.z.enum([
|
|
6200
6372
|
"FIELD_AGENT",
|
|
6201
6373
|
"LOCAL_REGISTRAR",
|
|
6202
6374
|
"LOCAL_SYSTEM_ADMIN",
|
|
@@ -6207,7 +6379,7 @@ var TestUserRole = z37.enum([
|
|
|
6207
6379
|
]);
|
|
6208
6380
|
|
|
6209
6381
|
// ../commons/src/events/scopes.ts
|
|
6210
|
-
var
|
|
6382
|
+
var import_lodash5 = require("lodash");
|
|
6211
6383
|
var ACTION_SCOPE_MAP = {
|
|
6212
6384
|
[ActionType.READ]: ["record.read"],
|
|
6213
6385
|
[ActionType.CREATE]: ["record.create"],
|
|
@@ -6217,7 +6389,6 @@ var ACTION_SCOPE_MAP = {
|
|
|
6217
6389
|
"record.declared.validate",
|
|
6218
6390
|
"record.register"
|
|
6219
6391
|
],
|
|
6220
|
-
[ActionType.EDIT]: ["record.declared.edit"],
|
|
6221
6392
|
[ActionType.DELETE]: ["record.declare"],
|
|
6222
6393
|
[ActionType.VALIDATE]: ["record.declared.validate", "record.register"],
|
|
6223
6394
|
[ActionType.REGISTER]: ["record.register"],
|
|
@@ -6237,8 +6408,7 @@ var ACTION_SCOPE_MAP = {
|
|
|
6237
6408
|
[ActionType.REJECT]: ["record.declared.reject"],
|
|
6238
6409
|
[ActionType.ASSIGN]: null,
|
|
6239
6410
|
[ActionType.UNASSIGN]: null,
|
|
6240
|
-
[ActionType.DUPLICATE_DETECTED]: []
|
|
6241
|
-
[ActionType.CUSTOM]: []
|
|
6411
|
+
[ActionType.DUPLICATE_DETECTED]: []
|
|
6242
6412
|
};
|
|
6243
6413
|
|
|
6244
6414
|
// ../commons/src/events/state/availableActions.ts
|
|
@@ -6247,26 +6417,28 @@ var AVAILABLE_ACTIONS_BY_EVENT_STATUS = {
|
|
|
6247
6417
|
ActionType.READ,
|
|
6248
6418
|
ActionType.DECLARE,
|
|
6249
6419
|
ActionType.NOTIFY,
|
|
6250
|
-
ActionType.DELETE
|
|
6251
|
-
ActionType.CUSTOM
|
|
6420
|
+
ActionType.DELETE
|
|
6252
6421
|
],
|
|
6253
6422
|
[EventStatus.enum.NOTIFIED]: [
|
|
6254
6423
|
ActionType.READ,
|
|
6255
6424
|
ActionType.DECLARE,
|
|
6256
6425
|
ActionType.MARK_AS_DUPLICATE,
|
|
6257
6426
|
ActionType.ARCHIVE,
|
|
6258
|
-
ActionType.REJECT
|
|
6259
|
-
ActionType.CUSTOM
|
|
6427
|
+
ActionType.REJECT
|
|
6260
6428
|
],
|
|
6261
6429
|
[EventStatus.enum.DECLARED]: [
|
|
6262
6430
|
ActionType.READ,
|
|
6263
6431
|
ActionType.VALIDATE,
|
|
6432
|
+
ActionType.MARK_AS_DUPLICATE,
|
|
6433
|
+
ActionType.ARCHIVE,
|
|
6434
|
+
ActionType.REJECT
|
|
6435
|
+
],
|
|
6436
|
+
[EventStatus.enum.VALIDATED]: [
|
|
6437
|
+
ActionType.READ,
|
|
6264
6438
|
ActionType.REGISTER,
|
|
6265
6439
|
ActionType.MARK_AS_DUPLICATE,
|
|
6266
6440
|
ActionType.ARCHIVE,
|
|
6267
|
-
ActionType.REJECT
|
|
6268
|
-
ActionType.CUSTOM,
|
|
6269
|
-
ActionType.EDIT
|
|
6441
|
+
ActionType.REJECT
|
|
6270
6442
|
],
|
|
6271
6443
|
[EventStatus.enum.REGISTERED]: [
|
|
6272
6444
|
ActionType.READ,
|
|
@@ -6274,50 +6446,47 @@ var AVAILABLE_ACTIONS_BY_EVENT_STATUS = {
|
|
|
6274
6446
|
ActionType.REQUEST_CORRECTION,
|
|
6275
6447
|
ActionType.APPROVE_CORRECTION,
|
|
6276
6448
|
ActionType.REJECT_CORRECTION,
|
|
6277
|
-
ActionType.CUSTOM,
|
|
6278
6449
|
ClientSpecificAction.REVIEW_CORRECTION_REQUEST
|
|
6279
6450
|
],
|
|
6280
6451
|
[EventStatus.enum.ARCHIVED]: [
|
|
6281
6452
|
ActionType.READ,
|
|
6282
6453
|
ActionType.ASSIGN,
|
|
6283
|
-
ActionType.UNASSIGN
|
|
6284
|
-
ActionType.CUSTOM
|
|
6454
|
+
ActionType.UNASSIGN
|
|
6285
6455
|
]
|
|
6286
6456
|
};
|
|
6287
6457
|
var ACTION_FILTERS = {
|
|
6288
|
-
[ActionType.PRINT_CERTIFICATE]: (flags) => !flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((
|
|
6289
|
-
[ActionType.REQUEST_CORRECTION]: (flags) => !flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((
|
|
6290
|
-
[ClientSpecificAction.REVIEW_CORRECTION_REQUEST]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((
|
|
6291
|
-
[ActionType.APPROVE_CORRECTION]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((
|
|
6292
|
-
[ActionType.REJECT_CORRECTION]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((
|
|
6293
|
-
[ActionType.MARK_AS_DUPLICATE]: (flags) => flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((
|
|
6294
|
-
[ActionType.VALIDATE]: (flags) => !flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((
|
|
6295
|
-
[ActionType.
|
|
6296
|
-
[ActionType.
|
|
6297
|
-
[ActionType.
|
|
6298
|
-
[ActionType.ARCHIVE]: (flags) => !flags.some((flag2) => flag2.endsWith(":requested"))
|
|
6458
|
+
[ActionType.PRINT_CERTIFICATE]: (flags) => !flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6459
|
+
[ActionType.REQUEST_CORRECTION]: (flags) => !flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6460
|
+
[ClientSpecificAction.REVIEW_CORRECTION_REQUEST]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6461
|
+
[ActionType.APPROVE_CORRECTION]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6462
|
+
[ActionType.REJECT_CORRECTION]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6463
|
+
[ActionType.MARK_AS_DUPLICATE]: (flags) => flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6464
|
+
[ActionType.VALIDATE]: (flags) => !flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6465
|
+
[ActionType.REGISTER]: (flags) => !flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6466
|
+
[ActionType.REJECT]: (flags) => !flags.includes(InherentFlags.REJECTED) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6467
|
+
[ActionType.ARCHIVE]: (flags) => !flags.some((flag) => flag.endsWith(":requested"))
|
|
6299
6468
|
};
|
|
6300
6469
|
|
|
6301
6470
|
// ../commons/src/events/FileUtils.ts
|
|
6302
|
-
var
|
|
6471
|
+
var import_lodash6 = require("lodash");
|
|
6303
6472
|
|
|
6304
6473
|
// ../commons/src/events/locations.ts
|
|
6305
|
-
var
|
|
6306
|
-
var LocationType =
|
|
6474
|
+
var import_zod36 = require("zod");
|
|
6475
|
+
var LocationType = import_zod36.z.enum([
|
|
6307
6476
|
"ADMIN_STRUCTURE",
|
|
6308
6477
|
"CRVS_OFFICE",
|
|
6309
6478
|
"HEALTH_FACILITY"
|
|
6310
6479
|
]);
|
|
6311
|
-
var Location =
|
|
6480
|
+
var Location = import_zod36.z.object({
|
|
6312
6481
|
id: UUID,
|
|
6313
|
-
name:
|
|
6482
|
+
name: import_zod36.z.string(),
|
|
6314
6483
|
parentId: UUID.nullable(),
|
|
6315
|
-
validUntil:
|
|
6484
|
+
validUntil: import_zod36.z.string().datetime().nullable(),
|
|
6316
6485
|
locationType: LocationType.nullable()
|
|
6317
6486
|
});
|
|
6318
6487
|
|
|
6319
6488
|
// ../commons/src/notification/UserNotifications.ts
|
|
6320
|
-
var
|
|
6489
|
+
var import_zod37 = require("zod");
|
|
6321
6490
|
var TriggerEvent = {
|
|
6322
6491
|
USER_CREATED: "user-created",
|
|
6323
6492
|
USER_UPDATED: "user-updated",
|
|
@@ -6329,50 +6498,50 @@ var TriggerEvent = {
|
|
|
6329
6498
|
CHANGE_PHONE_NUMBER: "change-phone-number",
|
|
6330
6499
|
CHANGE_EMAIL_ADDRESS: "change-email-address"
|
|
6331
6500
|
};
|
|
6332
|
-
var Recipient =
|
|
6501
|
+
var Recipient = import_zod37.z.object({
|
|
6333
6502
|
name: NameFieldValue.optional(),
|
|
6334
|
-
mobile:
|
|
6335
|
-
email:
|
|
6336
|
-
bcc:
|
|
6503
|
+
mobile: import_zod37.z.string().optional(),
|
|
6504
|
+
email: import_zod37.z.string().optional(),
|
|
6505
|
+
bcc: import_zod37.z.array(import_zod37.z.string()).optional()
|
|
6337
6506
|
});
|
|
6338
|
-
var BasePayload =
|
|
6507
|
+
var BasePayload = import_zod37.z.object({
|
|
6339
6508
|
recipient: Recipient
|
|
6340
6509
|
});
|
|
6341
6510
|
var TriggerPayload = {
|
|
6342
6511
|
[TriggerEvent.USER_CREATED]: BasePayload.extend({
|
|
6343
|
-
username:
|
|
6344
|
-
temporaryPassword:
|
|
6512
|
+
username: import_zod37.z.string(),
|
|
6513
|
+
temporaryPassword: import_zod37.z.string()
|
|
6345
6514
|
}),
|
|
6346
6515
|
[TriggerEvent.USER_UPDATED]: BasePayload.extend({
|
|
6347
|
-
oldUsername:
|
|
6348
|
-
newUsername:
|
|
6516
|
+
oldUsername: import_zod37.z.string(),
|
|
6517
|
+
newUsername: import_zod37.z.string()
|
|
6349
6518
|
}),
|
|
6350
6519
|
[TriggerEvent.USERNAME_REMINDER]: BasePayload.extend({
|
|
6351
|
-
username:
|
|
6520
|
+
username: import_zod37.z.string()
|
|
6352
6521
|
}),
|
|
6353
6522
|
[TriggerEvent.RESET_PASSWORD]: BasePayload.extend({
|
|
6354
|
-
code:
|
|
6523
|
+
code: import_zod37.z.string()
|
|
6355
6524
|
}),
|
|
6356
6525
|
[TriggerEvent.RESET_PASSWORD_BY_ADMIN]: BasePayload.extend({
|
|
6357
|
-
temporaryPassword:
|
|
6358
|
-
admin:
|
|
6359
|
-
id:
|
|
6526
|
+
temporaryPassword: import_zod37.z.string(),
|
|
6527
|
+
admin: import_zod37.z.object({
|
|
6528
|
+
id: import_zod37.z.string(),
|
|
6360
6529
|
name: NameFieldValue,
|
|
6361
|
-
role:
|
|
6530
|
+
role: import_zod37.z.string()
|
|
6362
6531
|
})
|
|
6363
6532
|
}),
|
|
6364
6533
|
[TriggerEvent.TWO_FA]: BasePayload.extend({
|
|
6365
|
-
code:
|
|
6534
|
+
code: import_zod37.z.string()
|
|
6366
6535
|
}),
|
|
6367
6536
|
[TriggerEvent.ALL_USER_NOTIFICATION]: BasePayload.extend({
|
|
6368
|
-
subject:
|
|
6369
|
-
body:
|
|
6537
|
+
subject: import_zod37.z.string(),
|
|
6538
|
+
body: import_zod37.z.string()
|
|
6370
6539
|
}),
|
|
6371
6540
|
[TriggerEvent.CHANGE_PHONE_NUMBER]: BasePayload.extend({
|
|
6372
|
-
code:
|
|
6541
|
+
code: import_zod37.z.string()
|
|
6373
6542
|
}),
|
|
6374
6543
|
[TriggerEvent.CHANGE_EMAIL_ADDRESS]: BasePayload.extend({
|
|
6375
|
-
code:
|
|
6544
|
+
code: import_zod37.z.string()
|
|
6376
6545
|
})
|
|
6377
6546
|
};
|
|
6378
6547
|
async function triggerUserEventNotification({
|
|
@@ -6394,6 +6563,3 @@ function parseUserEventTrigger(event2, body) {
|
|
|
6394
6563
|
const schema = TriggerPayload[event2];
|
|
6395
6564
|
return schema.parse(body);
|
|
6396
6565
|
}
|
|
6397
|
-
|
|
6398
|
-
// src/notification/index.ts
|
|
6399
|
-
z40.globalRegistry.clear();
|