@opencrvs/toolkit 1.9.7-rc.fb3d80c → 1.9.8-rc.0e21859
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 +2459 -29537
- package/dist/commons/conditionals/conditionals.d.ts +1 -10
- package/dist/commons/conditionals/validate.d.ts +4 -11
- package/dist/commons/events/ActionConfig.d.ts +1552 -25043
- package/dist/commons/events/ActionDocument.d.ts +1856 -803
- package/dist/commons/events/ActionInput.d.ts +1073 -277
- package/dist/commons/events/ActionType.d.ts +9 -86
- package/dist/commons/events/AdvancedSearchConfig.d.ts +1238 -228
- package/dist/commons/events/CompositeFieldValue.d.ts +190 -29
- 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 +4223 -1195
- package/dist/commons/events/CreatedAtLocation.d.ts +2 -0
- package/dist/commons/events/DeduplicationConfig.d.ts +171 -15
- package/dist/commons/events/Draft.d.ts +105 -70
- package/dist/commons/events/DynamicFieldValue.d.ts +91 -7
- package/dist/commons/events/EventConfig.d.ts +2120 -19988
- package/dist/commons/events/EventConfigInput.d.ts +1 -1
- package/dist/commons/events/EventDocument.d.ts +1332 -320
- package/dist/commons/events/EventIndex.d.ts +980 -193
- package/dist/commons/events/EventInput.d.ts +8 -3
- package/dist/commons/events/EventMetadata.d.ts +347 -106
- package/dist/commons/events/FieldConfig.d.ts +12296 -4538
- package/dist/commons/events/FieldType.d.ts +4 -20
- package/dist/commons/events/FieldTypeMapping.d.ts +897 -193
- package/dist/commons/events/FieldValue.d.ts +396 -87
- package/dist/commons/events/FormConfig.d.ts +721 -14022
- package/dist/commons/events/PageConfig.d.ts +319 -9368
- package/dist/commons/events/SummaryConfig.d.ts +161 -14
- package/dist/commons/events/TemplateConfig.d.ts +3 -2
- 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 +7131 -1819
- package/dist/commons/events/deduplication.d.ts +3 -3
- package/dist/commons/events/defineConfig.d.ts +162 -26586
- package/dist/commons/events/index.d.ts +0 -1
- package/dist/commons/events/locations.d.ts +19 -26
- package/dist/commons/events/scopes.d.ts +4 -5
- package/dist/commons/events/state/availableActions.d.ts +2 -0
- package/dist/commons/events/state/flags.d.ts +3 -21
- package/dist/commons/events/state/index.d.ts +19 -22
- package/dist/commons/events/state/utils.d.ts +112 -130
- package/dist/commons/events/test.utils.d.ts +8 -31
- package/dist/commons/events/transactions.d.ts +1 -1
- package/dist/commons/events/utils.d.ts +381 -53194
- package/dist/commons/notification/UserNotifications.d.ts +636 -55
- package/dist/conditionals/index.d.ts.map +1 -1
- package/dist/conditionals/index.js +11 -45
- package/dist/events/deduplication.d.ts +3 -3
- package/dist/events/index.js +1719 -2048
- package/dist/notification/index.d.ts.map +1 -1
- package/dist/notification/index.js +1505 -1593
- package/dist/scopes/index.d.ts +132 -167
- package/dist/scopes/index.d.ts.map +1 -1
- package/dist/scopes/index.js +94 -133
- package/package.json +5 -5
- package/dist/commons/events/Flag.d.ts +0 -67
- package/dist/commons/events/eventConfigValidation.d.ts +0 -8
|
@@ -38,7 +38,6 @@ __export(notification_exports, {
|
|
|
38
38
|
triggerUserEventNotification: () => triggerUserEventNotification
|
|
39
39
|
});
|
|
40
40
|
module.exports = __toCommonJS(notification_exports);
|
|
41
|
-
var z41 = __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_zod20 = require("zod");
|
|
55
54
|
|
|
56
55
|
// ../commons/src/events/TranslationConfig.ts
|
|
57
|
-
var
|
|
58
|
-
var
|
|
59
|
-
|
|
56
|
+
var import_zod = require("zod");
|
|
57
|
+
var import_zod_openapi = require("zod-openapi");
|
|
58
|
+
(0, import_zod_openapi.extendZodWithOpenApi)(import_zod.z);
|
|
59
|
+
var TranslationConfig = import_zod.z.object({
|
|
60
|
+
id: import_zod.z.string().describe(
|
|
60
61
|
"The identifier of the translation referred in translation CSV files"
|
|
61
62
|
),
|
|
62
|
-
defaultMessage: z.string().describe("Default translation message"),
|
|
63
|
-
description: z.string().describe(
|
|
63
|
+
defaultMessage: import_zod.z.string().describe("Default translation message"),
|
|
64
|
+
description: import_zod.z.string().describe(
|
|
64
65
|
"Describe the translation for a translator to be able to identify it."
|
|
65
66
|
)
|
|
66
|
-
}).
|
|
67
|
+
}).openapi({
|
|
67
68
|
description: "Translation configuration",
|
|
68
|
-
|
|
69
|
+
ref: "TranslationConfig"
|
|
69
70
|
});
|
|
70
71
|
|
|
71
72
|
// ../commons/src/events/ActionType.ts
|
|
72
|
-
var
|
|
73
|
+
var import_zod2 = require("zod");
|
|
73
74
|
var ActionType = {
|
|
74
75
|
// Pre-declaration actions
|
|
75
76
|
DELETE: "DELETE",
|
|
@@ -77,8 +78,8 @@ var ActionType = {
|
|
|
77
78
|
NOTIFY: "NOTIFY",
|
|
78
79
|
// Declaration actions
|
|
79
80
|
DECLARE: "DECLARE",
|
|
81
|
+
VALIDATE: "VALIDATE",
|
|
80
82
|
REGISTER: "REGISTER",
|
|
81
|
-
EDIT: "EDIT",
|
|
82
83
|
// Declaration system actions. Non-configurable.
|
|
83
84
|
DUPLICATE_DETECTED: "DUPLICATE_DETECTED",
|
|
84
85
|
REJECT: "REJECT",
|
|
@@ -94,29 +95,26 @@ var ActionType = {
|
|
|
94
95
|
// General actions
|
|
95
96
|
READ: "READ",
|
|
96
97
|
ASSIGN: "ASSIGN",
|
|
97
|
-
UNASSIGN: "UNASSIGN"
|
|
98
|
-
// Custom action
|
|
99
|
-
CUSTOM: "CUSTOM"
|
|
98
|
+
UNASSIGN: "UNASSIGN"
|
|
100
99
|
};
|
|
101
100
|
var ConfirmableActions = [
|
|
102
101
|
ActionType.NOTIFY,
|
|
103
102
|
ActionType.DECLARE,
|
|
104
|
-
ActionType.
|
|
103
|
+
ActionType.VALIDATE,
|
|
105
104
|
ActionType.REGISTER,
|
|
106
105
|
ActionType.REJECT,
|
|
107
106
|
ActionType.ARCHIVE,
|
|
108
107
|
ActionType.PRINT_CERTIFICATE,
|
|
109
108
|
ActionType.REQUEST_CORRECTION,
|
|
110
109
|
ActionType.APPROVE_CORRECTION,
|
|
111
|
-
ActionType.REJECT_CORRECTION
|
|
112
|
-
ActionType.CUSTOM
|
|
110
|
+
ActionType.REJECT_CORRECTION
|
|
113
111
|
];
|
|
114
|
-
var ActionTypes =
|
|
112
|
+
var ActionTypes = import_zod2.z.enum([
|
|
115
113
|
"DELETE",
|
|
116
114
|
"CREATE",
|
|
117
115
|
"NOTIFY",
|
|
118
116
|
"DECLARE",
|
|
119
|
-
"
|
|
117
|
+
"VALIDATE",
|
|
120
118
|
"REGISTER",
|
|
121
119
|
"DUPLICATE_DETECTED",
|
|
122
120
|
"REJECT",
|
|
@@ -129,15 +127,14 @@ var ActionTypes = z2.enum([
|
|
|
129
127
|
"APPROVE_CORRECTION",
|
|
130
128
|
"READ",
|
|
131
129
|
"ASSIGN",
|
|
132
|
-
"UNASSIGN"
|
|
133
|
-
"CUSTOM"
|
|
130
|
+
"UNASSIGN"
|
|
134
131
|
]);
|
|
135
132
|
var ClientSpecificAction = {
|
|
136
133
|
REVIEW_CORRECTION_REQUEST: "REVIEW_CORRECTION_REQUEST"
|
|
137
134
|
};
|
|
138
135
|
var declarationActionValues = [
|
|
139
136
|
ActionTypes.enum.DECLARE,
|
|
140
|
-
ActionTypes.enum.
|
|
137
|
+
ActionTypes.enum.VALIDATE,
|
|
141
138
|
ActionTypes.enum.REGISTER,
|
|
142
139
|
ActionTypes.enum.NOTIFY,
|
|
143
140
|
ActionTypes.enum.DUPLICATE_DETECTED
|
|
@@ -158,14 +155,13 @@ var writeActions = ActionTypes.exclude([
|
|
|
158
155
|
ActionType.UNASSIGN
|
|
159
156
|
]);
|
|
160
157
|
var workqueueActions = ActionTypes.exclude([
|
|
161
|
-
ActionType.READ,
|
|
162
158
|
ActionType.CREATE,
|
|
163
159
|
ActionType.NOTIFY,
|
|
164
160
|
ActionType.DUPLICATE_DETECTED,
|
|
161
|
+
ActionType.REJECT,
|
|
165
162
|
ActionType.MARK_AS_NOT_DUPLICATE,
|
|
166
163
|
ActionType.REJECT_CORRECTION,
|
|
167
|
-
ActionType.APPROVE_CORRECTION
|
|
168
|
-
ActionType.CUSTOM
|
|
164
|
+
ActionType.APPROVE_CORRECTION
|
|
169
165
|
]);
|
|
170
166
|
var META_ACTIONS = [
|
|
171
167
|
ActionType.ASSIGN,
|
|
@@ -174,57 +170,59 @@ var META_ACTIONS = [
|
|
|
174
170
|
];
|
|
175
171
|
|
|
176
172
|
// ../commons/src/events/FieldConfig.ts
|
|
177
|
-
var
|
|
173
|
+
var import_zod16 = require("zod");
|
|
178
174
|
|
|
179
175
|
// ../commons/src/events/Conditional.ts
|
|
180
|
-
var
|
|
181
|
-
var
|
|
176
|
+
var import_zod3 = require("zod");
|
|
177
|
+
var import_zod_openapi2 = require("zod-openapi");
|
|
178
|
+
(0, import_zod_openapi2.extendZodWithOpenApi)(import_zod3.z);
|
|
179
|
+
var Conditional = import_zod3.z.custom((val) => typeof val === "object" && val !== null).openapi({
|
|
182
180
|
description: "JSON schema conditional configuration",
|
|
183
|
-
|
|
181
|
+
ref: "Conditional"
|
|
184
182
|
});
|
|
185
183
|
var ConditionalType = {
|
|
186
184
|
SHOW: "SHOW",
|
|
187
185
|
ENABLE: "ENABLE",
|
|
188
186
|
DISPLAY_ON_REVIEW: "DISPLAY_ON_REVIEW"
|
|
189
187
|
};
|
|
190
|
-
var ShowConditional =
|
|
191
|
-
type:
|
|
188
|
+
var ShowConditional = import_zod3.z.object({
|
|
189
|
+
type: import_zod3.z.literal(ConditionalType.SHOW),
|
|
192
190
|
conditional: Conditional
|
|
193
191
|
}).describe(
|
|
194
192
|
"If 'SHOW' conditional is defined, the component is shown to the user only if the condition is met"
|
|
195
193
|
);
|
|
196
|
-
var EnableConditional =
|
|
197
|
-
type:
|
|
194
|
+
var EnableConditional = import_zod3.z.object({
|
|
195
|
+
type: import_zod3.z.literal(ConditionalType.ENABLE),
|
|
198
196
|
conditional: Conditional
|
|
199
197
|
}).describe(
|
|
200
198
|
"If 'ENABLE' conditional is defined, the component is enabled only if the condition is met"
|
|
201
199
|
);
|
|
202
|
-
var ActionConditional =
|
|
200
|
+
var ActionConditional = import_zod3.z.discriminatedUnion("type", [
|
|
203
201
|
// Action can be shown / hidden
|
|
204
202
|
ShowConditional,
|
|
205
203
|
// Action can be shown to the user in the list but as disabled
|
|
206
204
|
EnableConditional
|
|
207
205
|
]);
|
|
208
|
-
var DisplayOnReviewConditional =
|
|
209
|
-
type:
|
|
206
|
+
var DisplayOnReviewConditional = import_zod3.z.object({
|
|
207
|
+
type: import_zod3.z.literal(ConditionalType.DISPLAY_ON_REVIEW),
|
|
210
208
|
conditional: Conditional
|
|
211
209
|
}).describe(
|
|
212
210
|
"If 'DISPLAY_ON_REVIEW' conditional is defined, the component is shown on the review page only if both the 'DISPLAY_ON_REVIEW' and 'SHOW' conditions are met. This should only be used for fields within declaration forms, as they are the only ones with review pages."
|
|
213
211
|
);
|
|
214
|
-
var FieldConditional =
|
|
212
|
+
var FieldConditional = import_zod3.z.discriminatedUnion("type", [
|
|
215
213
|
// Field input can be shown / hidden
|
|
216
214
|
ShowConditional,
|
|
217
215
|
// Field input can be shown to the user but as disabled
|
|
218
216
|
EnableConditional,
|
|
219
217
|
// Field output can be shown / hidden on the review page
|
|
220
218
|
DisplayOnReviewConditional
|
|
221
|
-
]).
|
|
219
|
+
]).openapi({
|
|
222
220
|
description: "Field conditional configuration",
|
|
223
|
-
|
|
221
|
+
ref: "FieldConditional"
|
|
224
222
|
});
|
|
225
223
|
|
|
226
224
|
// ../commons/src/events/FieldType.ts
|
|
227
|
-
var
|
|
225
|
+
var import_zod4 = require("zod");
|
|
228
226
|
var FieldType = {
|
|
229
227
|
NAME: "NAME",
|
|
230
228
|
PHONE: "PHONE",
|
|
@@ -267,21 +265,9 @@ var FieldType = {
|
|
|
267
265
|
QUERY_PARAM_READER: "QUERY_PARAM_READER",
|
|
268
266
|
QR_READER: "QR_READER",
|
|
269
267
|
ID_READER: "ID_READER",
|
|
270
|
-
LOADER: "LOADER"
|
|
271
|
-
ALPHA_HIDDEN: "ALPHA_HIDDEN",
|
|
272
|
-
/**
|
|
273
|
-
* @internal
|
|
274
|
-
* @experimental
|
|
275
|
-
*
|
|
276
|
-
* Internal API used by the OpenCRVS core team for experimentation.
|
|
277
|
-
*
|
|
278
|
-
* This component is not part of the public, stable API.
|
|
279
|
-
* Its shape, behavior, or existence may change at any time or be removed
|
|
280
|
-
* entirely without notice.
|
|
281
|
-
*/
|
|
282
|
-
_EXPERIMENTAL_CUSTOM: "CUSTOM"
|
|
268
|
+
LOADER: "LOADER"
|
|
283
269
|
};
|
|
284
|
-
var FileFieldType =
|
|
270
|
+
var FileFieldType = import_zod4.z.enum([
|
|
285
271
|
FieldType.FILE,
|
|
286
272
|
FieldType.FILE_WITH_OPTIONS,
|
|
287
273
|
FieldType.SIGNATURE
|
|
@@ -305,155 +291,154 @@ var FieldTypesToHideInReview = [
|
|
|
305
291
|
FieldType.LOADER,
|
|
306
292
|
FieldType.HTTP,
|
|
307
293
|
FieldType.QUERY_PARAM_READER,
|
|
308
|
-
FieldType.DATA
|
|
309
|
-
FieldType.ALPHA_HIDDEN
|
|
294
|
+
FieldType.DATA
|
|
310
295
|
];
|
|
311
296
|
|
|
312
297
|
// ../commons/src/events/FieldValue.ts
|
|
313
|
-
var
|
|
298
|
+
var import_zod7 = require("zod");
|
|
314
299
|
|
|
315
300
|
// ../commons/src/documents.ts
|
|
316
|
-
var
|
|
317
|
-
var
|
|
301
|
+
var import_zod5 = require("zod");
|
|
302
|
+
var import_zod_openapi3 = require("zod-openapi");
|
|
303
|
+
(0, import_zod_openapi3.extendZodWithOpenApi)(import_zod5.z);
|
|
304
|
+
var FullDocumentUrl = import_zod5.z.string().brand("FullDocumentUrl").describe(
|
|
318
305
|
"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"
|
|
319
306
|
);
|
|
320
|
-
var FullDocumentPath =
|
|
307
|
+
var FullDocumentPath = import_zod5.z.string().transform((val) => val.startsWith("/") ? val : `/${val}`).openapi({ effectType: "input", type: "string" }).describe(
|
|
321
308
|
"A full absolute path with bucket name, starting from the root of the S3 server, /bucket-name/document-id.jpg"
|
|
322
309
|
);
|
|
323
|
-
var DocumentPath =
|
|
310
|
+
var DocumentPath = import_zod5.z.string().brand("DocumentPath").describe(
|
|
324
311
|
"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"
|
|
325
312
|
);
|
|
326
313
|
|
|
327
314
|
// ../commons/src/events/CompositeFieldValue.ts
|
|
328
|
-
var
|
|
315
|
+
var import_zod6 = require("zod");
|
|
329
316
|
var AddressType = {
|
|
330
317
|
DOMESTIC: "DOMESTIC",
|
|
331
318
|
INTERNATIONAL: "INTERNATIONAL"
|
|
332
319
|
};
|
|
333
|
-
var FileFieldValue =
|
|
320
|
+
var FileFieldValue = import_zod6.z.object({
|
|
334
321
|
path: FullDocumentPath,
|
|
335
|
-
originalFilename:
|
|
336
|
-
type:
|
|
337
|
-
});
|
|
338
|
-
var NameFieldValue =
|
|
339
|
-
firstname:
|
|
340
|
-
surname:
|
|
341
|
-
middlename:
|
|
342
|
-
});
|
|
343
|
-
var NameFieldUpdateValue =
|
|
344
|
-
firstname:
|
|
345
|
-
surname:
|
|
346
|
-
middlename:
|
|
347
|
-
}).or(
|
|
348
|
-
var StreetLevelDetailsValue =
|
|
349
|
-
var StreetLevelDetailsUpdateValue =
|
|
350
|
-
var BaseAddressFieldValue =
|
|
351
|
-
country:
|
|
322
|
+
originalFilename: import_zod6.z.string(),
|
|
323
|
+
type: import_zod6.z.string()
|
|
324
|
+
});
|
|
325
|
+
var NameFieldValue = import_zod6.z.object({
|
|
326
|
+
firstname: import_zod6.z.string(),
|
|
327
|
+
surname: import_zod6.z.string(),
|
|
328
|
+
middlename: import_zod6.z.string().optional()
|
|
329
|
+
});
|
|
330
|
+
var NameFieldUpdateValue = import_zod6.z.object({
|
|
331
|
+
firstname: import_zod6.z.string().nullish(),
|
|
332
|
+
surname: import_zod6.z.string().nullish(),
|
|
333
|
+
middlename: import_zod6.z.string().nullish()
|
|
334
|
+
}).or(import_zod6.z.null()).or(import_zod6.z.undefined());
|
|
335
|
+
var StreetLevelDetailsValue = import_zod6.z.record(import_zod6.z.string(), import_zod6.z.string()).optional();
|
|
336
|
+
var StreetLevelDetailsUpdateValue = import_zod6.z.record(import_zod6.z.string(), import_zod6.z.string().nullable()).nullish();
|
|
337
|
+
var BaseAddressFieldValue = import_zod6.z.object({
|
|
338
|
+
country: import_zod6.z.string(),
|
|
352
339
|
streetLevelDetails: StreetLevelDetailsValue
|
|
353
340
|
});
|
|
354
|
-
var BaseAddressFieldUpdateValue =
|
|
355
|
-
country:
|
|
341
|
+
var BaseAddressFieldUpdateValue = import_zod6.z.object({
|
|
342
|
+
country: import_zod6.z.string().nullish(),
|
|
356
343
|
streetLevelDetails: StreetLevelDetailsUpdateValue
|
|
357
344
|
});
|
|
358
345
|
var DomesticAddressFieldValue = BaseAddressFieldValue.extend({
|
|
359
|
-
addressType:
|
|
360
|
-
administrativeArea:
|
|
346
|
+
addressType: import_zod6.z.literal(AddressType.DOMESTIC),
|
|
347
|
+
administrativeArea: import_zod6.z.string().uuid()
|
|
361
348
|
});
|
|
362
349
|
var InternationalAddressFieldValue = BaseAddressFieldValue.extend({
|
|
363
|
-
addressType:
|
|
350
|
+
addressType: import_zod6.z.literal(AddressType.INTERNATIONAL)
|
|
364
351
|
});
|
|
365
|
-
var AddressFieldValue =
|
|
352
|
+
var AddressFieldValue = import_zod6.z.discriminatedUnion("addressType", [
|
|
366
353
|
DomesticAddressFieldValue,
|
|
367
354
|
InternationalAddressFieldValue
|
|
368
355
|
]);
|
|
369
356
|
var DomesticAddressUpdateFieldValue = BaseAddressFieldUpdateValue.extend({
|
|
370
|
-
addressType:
|
|
371
|
-
administrativeArea:
|
|
357
|
+
addressType: import_zod6.z.literal(AddressType.DOMESTIC),
|
|
358
|
+
administrativeArea: import_zod6.z.string().uuid().nullish()
|
|
372
359
|
/* Leaf level admin structure */
|
|
373
360
|
});
|
|
374
361
|
var InternationalAddressUpdateFieldValue = BaseAddressFieldUpdateValue.extend(
|
|
375
362
|
{
|
|
376
|
-
addressType:
|
|
363
|
+
addressType: import_zod6.z.literal(AddressType.INTERNATIONAL)
|
|
377
364
|
}
|
|
378
365
|
);
|
|
379
|
-
var AddressFieldUpdateValue =
|
|
366
|
+
var AddressFieldUpdateValue = import_zod6.z.discriminatedUnion("addressType", [
|
|
380
367
|
DomesticAddressUpdateFieldValue,
|
|
381
368
|
InternationalAddressUpdateFieldValue
|
|
382
369
|
]).nullish();
|
|
383
|
-
var FileFieldValueWithOption =
|
|
370
|
+
var FileFieldValueWithOption = import_zod6.z.object({
|
|
384
371
|
path: FullDocumentPath,
|
|
385
|
-
originalFilename:
|
|
386
|
-
type:
|
|
387
|
-
option:
|
|
388
|
-
});
|
|
389
|
-
var FileFieldWithOptionValue =
|
|
390
|
-
var HttpFieldValue =
|
|
391
|
-
loading:
|
|
392
|
-
error:
|
|
393
|
-
data:
|
|
394
|
-
});
|
|
395
|
-
var HttpFieldUpdateValue =
|
|
396
|
-
loading:
|
|
397
|
-
error:
|
|
398
|
-
data:
|
|
399
|
-
}).or(
|
|
400
|
-
var QueryParamReaderFieldValue =
|
|
401
|
-
data:
|
|
372
|
+
originalFilename: import_zod6.z.string(),
|
|
373
|
+
type: import_zod6.z.string(),
|
|
374
|
+
option: import_zod6.z.string()
|
|
375
|
+
});
|
|
376
|
+
var FileFieldWithOptionValue = import_zod6.z.array(FileFieldValueWithOption);
|
|
377
|
+
var HttpFieldValue = import_zod6.z.object({
|
|
378
|
+
loading: import_zod6.z.boolean(),
|
|
379
|
+
error: import_zod6.z.object({ statusCode: import_zod6.z.number(), message: import_zod6.z.string() }).nullish(),
|
|
380
|
+
data: import_zod6.z.any()
|
|
381
|
+
});
|
|
382
|
+
var HttpFieldUpdateValue = import_zod6.z.object({
|
|
383
|
+
loading: import_zod6.z.boolean().nullish(),
|
|
384
|
+
error: import_zod6.z.object({ statusCode: import_zod6.z.number(), message: import_zod6.z.string() }).nullish(),
|
|
385
|
+
data: import_zod6.z.any().nullish()
|
|
386
|
+
}).or(import_zod6.z.null()).or(import_zod6.z.undefined());
|
|
387
|
+
var QueryParamReaderFieldValue = import_zod6.z.object({
|
|
388
|
+
data: import_zod6.z.record(import_zod6.z.string(), import_zod6.z.string())
|
|
402
389
|
}).nullish();
|
|
403
|
-
var QueryParamReaderFieldUpdateValue =
|
|
404
|
-
data:
|
|
390
|
+
var QueryParamReaderFieldUpdateValue = import_zod6.z.object({
|
|
391
|
+
data: import_zod6.z.record(import_zod6.z.string(), import_zod6.z.string())
|
|
405
392
|
});
|
|
406
|
-
var ReadDataValue =
|
|
407
|
-
data:
|
|
393
|
+
var ReadDataValue = import_zod6.z.object({
|
|
394
|
+
data: import_zod6.z.any()
|
|
408
395
|
});
|
|
409
396
|
var QrReaderFieldValue = ReadDataValue;
|
|
410
397
|
var IdReaderFieldValue = ReadDataValue;
|
|
411
|
-
var NumberWithUnitFieldValue =
|
|
412
|
-
numericValue:
|
|
413
|
-
unit:
|
|
398
|
+
var NumberWithUnitFieldValue = import_zod6.z.object({
|
|
399
|
+
numericValue: import_zod6.z.number(),
|
|
400
|
+
unit: import_zod6.z.string()
|
|
414
401
|
});
|
|
415
|
-
var NumberWithUnitFieldUpdateValue =
|
|
416
|
-
numericValue:
|
|
417
|
-
unit:
|
|
402
|
+
var NumberWithUnitFieldUpdateValue = import_zod6.z.object({
|
|
403
|
+
numericValue: import_zod6.z.number().optional(),
|
|
404
|
+
unit: import_zod6.z.string().optional()
|
|
418
405
|
});
|
|
419
|
-
var CustomFieldValue = z6.unknown().brand("CustomFieldValue");
|
|
420
406
|
|
|
421
407
|
// ../commons/src/events/FieldValue.ts
|
|
422
|
-
var TextValue =
|
|
423
|
-
var HiddenFieldValue = z7.string();
|
|
408
|
+
var TextValue = import_zod7.z.string();
|
|
424
409
|
var NonEmptyTextValue = TextValue.min(1);
|
|
425
|
-
var DateValue =
|
|
426
|
-
var AgeValue =
|
|
427
|
-
age:
|
|
428
|
-
asOfDateRef:
|
|
410
|
+
var DateValue = import_zod7.z.string().date().describe("Date in the format YYYY-MM-DD");
|
|
411
|
+
var AgeValue = import_zod7.z.object({
|
|
412
|
+
age: import_zod7.z.number(),
|
|
413
|
+
asOfDateRef: import_zod7.z.string()
|
|
429
414
|
});
|
|
430
415
|
var AgeUpdateValue = AgeValue.optional().nullable();
|
|
431
|
-
var TimeValue =
|
|
432
|
-
var DatetimeValue =
|
|
433
|
-
var SelectDateRangeValue =
|
|
416
|
+
var TimeValue = import_zod7.z.string().regex(/^([01][0-9]|2[0-3]):[0-5][0-9]$/);
|
|
417
|
+
var DatetimeValue = import_zod7.z.string().datetime();
|
|
418
|
+
var SelectDateRangeValue = import_zod7.z.enum([
|
|
434
419
|
"last7Days",
|
|
435
420
|
"last30Days",
|
|
436
421
|
"last90Days",
|
|
437
422
|
"last365Days"
|
|
438
423
|
]);
|
|
439
|
-
var DateRangeFieldValue =
|
|
424
|
+
var DateRangeFieldValue = import_zod7.z.object({
|
|
440
425
|
start: DateValue,
|
|
441
426
|
end: DateValue
|
|
442
427
|
}).or(DateValue).describe(
|
|
443
428
|
"Date range with start and end dates in the format YYYY-MM-DD. Inclusive start, exclusive end."
|
|
444
429
|
);
|
|
445
|
-
var EmailValue =
|
|
446
|
-
var CheckboxFieldValue =
|
|
447
|
-
var NumberFieldValue =
|
|
448
|
-
var SignatureFieldValue =
|
|
449
|
-
var ButtonFieldValue =
|
|
450
|
-
var VerificationStatusValue =
|
|
430
|
+
var EmailValue = import_zod7.z.string().email();
|
|
431
|
+
var CheckboxFieldValue = import_zod7.z.boolean();
|
|
432
|
+
var NumberFieldValue = import_zod7.z.number();
|
|
433
|
+
var SignatureFieldValue = import_zod7.z.string();
|
|
434
|
+
var ButtonFieldValue = import_zod7.z.number();
|
|
435
|
+
var VerificationStatusValue = import_zod7.z.enum([
|
|
451
436
|
"verified",
|
|
452
437
|
"authenticated",
|
|
453
438
|
"failed",
|
|
454
439
|
"pending"
|
|
455
440
|
]);
|
|
456
|
-
var FieldValuesWithoutDataField =
|
|
441
|
+
var FieldValuesWithoutDataField = import_zod7.z.union([
|
|
457
442
|
AddressFieldValue,
|
|
458
443
|
TextValue,
|
|
459
444
|
DateValue,
|
|
@@ -474,13 +459,12 @@ var FieldValuesWithoutDataField = z7.union([
|
|
|
474
459
|
QrReaderFieldValue,
|
|
475
460
|
IdReaderFieldValue,
|
|
476
461
|
NumberWithUnitFieldValue,
|
|
477
|
-
NumberWithUnitFieldUpdateValue
|
|
478
|
-
CustomFieldValue
|
|
462
|
+
NumberWithUnitFieldUpdateValue
|
|
479
463
|
]);
|
|
480
|
-
var DataFieldValue =
|
|
481
|
-
data:
|
|
464
|
+
var DataFieldValue = import_zod7.z.object({
|
|
465
|
+
data: import_zod7.z.record(import_zod7.z.string(), FieldValuesWithoutDataField)
|
|
482
466
|
}).nullish();
|
|
483
|
-
var FieldValue =
|
|
467
|
+
var FieldValue = import_zod7.z.union([
|
|
484
468
|
FieldValuesWithoutDataField,
|
|
485
469
|
DataFieldValue
|
|
486
470
|
]);
|
|
@@ -501,38 +485,22 @@ var PRIORITY_ORDER = [
|
|
|
501
485
|
"DataFieldValue"
|
|
502
486
|
];
|
|
503
487
|
function schemaPriority(schema) {
|
|
504
|
-
const name = schema.description;
|
|
505
|
-
if (!name) {
|
|
506
|
-
return 9999;
|
|
507
|
-
}
|
|
488
|
+
const name = schema._def?.description;
|
|
508
489
|
const idx = PRIORITY_ORDER.indexOf(name);
|
|
509
490
|
return idx === -1 ? 9999 : idx;
|
|
510
491
|
}
|
|
511
492
|
function safeUnion(schemas) {
|
|
512
|
-
return
|
|
493
|
+
return import_zod7.z.custom((val) => {
|
|
513
494
|
const successful = schemas.filter((s) => s.safeParse(val).success);
|
|
514
495
|
if (successful.length === 1) {
|
|
515
|
-
return;
|
|
496
|
+
return true;
|
|
516
497
|
}
|
|
517
498
|
if (successful.length === 0) {
|
|
518
|
-
|
|
519
|
-
code: "invalid_type",
|
|
520
|
-
expected: "custom",
|
|
521
|
-
message: "Value does not match any schema"
|
|
522
|
-
});
|
|
523
|
-
return;
|
|
499
|
+
return false;
|
|
524
500
|
}
|
|
525
501
|
successful.sort((a, b) => schemaPriority(a) - schemaPriority(b));
|
|
526
502
|
const best = successful[0];
|
|
527
|
-
|
|
528
|
-
ctx.addIssue({
|
|
529
|
-
expected: "custom",
|
|
530
|
-
code: "invalid_type",
|
|
531
|
-
message: "Value did not match the best schema"
|
|
532
|
-
});
|
|
533
|
-
}
|
|
534
|
-
}).meta({
|
|
535
|
-
description: "Value that matches exactly one of the possible schema types (TextValue, DateValue, DateRangeFieldValue). The best matching schema is chosen by priority."
|
|
503
|
+
return best.safeParse(val).success;
|
|
536
504
|
});
|
|
537
505
|
}
|
|
538
506
|
var FieldUpdateValue = safeUnion([
|
|
@@ -551,23 +519,24 @@ var FieldUpdateValue = safeUnion([
|
|
|
551
519
|
DataFieldValue.describe("DataFieldValue"),
|
|
552
520
|
NameFieldUpdateValue.describe("NameFieldUpdateValue"),
|
|
553
521
|
HttpFieldUpdateValue.describe("HttpFieldUpdateValue"),
|
|
554
|
-
QueryParamReaderFieldUpdateValue.describe("QueryParamReaderFieldUpdateValue")
|
|
555
|
-
CustomFieldValue.describe("CustomFieldValue"),
|
|
556
|
-
HiddenFieldValue.describe("HiddenFieldValue")
|
|
522
|
+
QueryParamReaderFieldUpdateValue.describe("QueryParamReaderFieldUpdateValue")
|
|
557
523
|
]);
|
|
558
524
|
|
|
525
|
+
// ../commons/src/events/FieldConfig.ts
|
|
526
|
+
var import_zod_openapi6 = require("zod-openapi");
|
|
527
|
+
|
|
559
528
|
// ../commons/src/uuid.ts
|
|
560
529
|
var import_uuid = require("uuid");
|
|
561
|
-
var
|
|
562
|
-
var UUID =
|
|
530
|
+
var import_zod8 = require("zod");
|
|
531
|
+
var UUID = import_zod8.z.string().uuid().brand("UUID");
|
|
563
532
|
function getUUID() {
|
|
564
533
|
return (0, import_uuid.v4)();
|
|
565
534
|
}
|
|
566
535
|
|
|
567
536
|
// ../commons/src/events/serializers/user/serializer.ts
|
|
568
|
-
var
|
|
569
|
-
var SerializedUserField =
|
|
570
|
-
$userField:
|
|
537
|
+
var import_zod9 = require("zod");
|
|
538
|
+
var SerializedUserField = import_zod9.z.object({
|
|
539
|
+
$userField: import_zod9.z.enum([
|
|
571
540
|
"id",
|
|
572
541
|
"name",
|
|
573
542
|
"role",
|
|
@@ -576,12 +545,11 @@ var SerializedUserField = z9.object({
|
|
|
576
545
|
"firstname",
|
|
577
546
|
"middlename",
|
|
578
547
|
"surname",
|
|
579
|
-
"
|
|
580
|
-
"
|
|
581
|
-
"primaryOfficeId"
|
|
582
|
-
"administrativeAreaId"
|
|
548
|
+
"district",
|
|
549
|
+
"province",
|
|
550
|
+
"primaryOfficeId"
|
|
583
551
|
]),
|
|
584
|
-
$location:
|
|
552
|
+
$location: import_zod9.z.string().optional()
|
|
585
553
|
});
|
|
586
554
|
function userSerializer(userField) {
|
|
587
555
|
return {
|
|
@@ -601,20 +569,24 @@ function userSerializer(userField) {
|
|
|
601
569
|
}
|
|
602
570
|
|
|
603
571
|
// ../commons/src/events/EventIndex.ts
|
|
604
|
-
var
|
|
572
|
+
var import_zod14 = require("zod");
|
|
605
573
|
|
|
606
574
|
// ../commons/src/events/EventMetadata.ts
|
|
607
|
-
var
|
|
575
|
+
var import_zod13 = require("zod");
|
|
608
576
|
|
|
609
577
|
// ../commons/src/events/ActionDocument.ts
|
|
610
|
-
var
|
|
578
|
+
var import_zod12 = require("zod");
|
|
579
|
+
var import_zod_openapi4 = require("zod-openapi");
|
|
580
|
+
|
|
581
|
+
// ../commons/src/events/CreatedAtLocation.ts
|
|
582
|
+
var CreatedAtLocation = UUID.nullish();
|
|
611
583
|
|
|
612
584
|
// ../commons/src/authentication.ts
|
|
613
585
|
var import_jwt_decode = __toESM(require("jwt-decode"));
|
|
614
|
-
var
|
|
586
|
+
var import_zod11 = require("zod");
|
|
615
587
|
|
|
616
588
|
// ../commons/src/scopes.ts
|
|
617
|
-
var
|
|
589
|
+
var import_zod10 = require("zod");
|
|
618
590
|
var SCOPES = {
|
|
619
591
|
// TODO v1.8 legacy scopes
|
|
620
592
|
BYPASSRATELIMIT: "bypassratelimit",
|
|
@@ -693,91 +665,91 @@ var SCOPES = {
|
|
|
693
665
|
// data seeding
|
|
694
666
|
USER_DATA_SEEDING: "user.data-seeding"
|
|
695
667
|
};
|
|
696
|
-
var LegacyScopes =
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
668
|
+
var LegacyScopes = import_zod10.z.union([
|
|
669
|
+
import_zod10.z.literal(SCOPES.BYPASSRATELIMIT),
|
|
670
|
+
import_zod10.z.literal(SCOPES.REGISTER),
|
|
671
|
+
import_zod10.z.literal(SCOPES.DEMO),
|
|
672
|
+
import_zod10.z.literal(SCOPES.CONFIG)
|
|
701
673
|
]);
|
|
702
|
-
var IntegrationScopes =
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
674
|
+
var IntegrationScopes = import_zod10.z.union([
|
|
675
|
+
import_zod10.z.literal(SCOPES.WEBHOOK),
|
|
676
|
+
import_zod10.z.literal(SCOPES.NATIONALID),
|
|
677
|
+
import_zod10.z.literal(SCOPES.NOTIFICATION_API),
|
|
678
|
+
import_zod10.z.literal(SCOPES.RECORDSEARCH)
|
|
707
679
|
]);
|
|
708
|
-
var InternalOperationsScopes =
|
|
709
|
-
|
|
710
|
-
|
|
680
|
+
var InternalOperationsScopes = import_zod10.z.union([
|
|
681
|
+
import_zod10.z.literal(SCOPES.RECORD_REINDEX),
|
|
682
|
+
import_zod10.z.literal(SCOPES.RECORD_IMPORT)
|
|
711
683
|
]);
|
|
712
|
-
var DeclareScopes =
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
684
|
+
var DeclareScopes = import_zod10.z.union([
|
|
685
|
+
import_zod10.z.literal(SCOPES.RECORD_DECLARE_BIRTH),
|
|
686
|
+
import_zod10.z.literal(SCOPES.RECORD_DECLARE_BIRTH_MY_JURISDICTION),
|
|
687
|
+
import_zod10.z.literal(SCOPES.RECORD_DECLARE_DEATH),
|
|
688
|
+
import_zod10.z.literal(SCOPES.RECORD_DECLARE_DEATH_MY_JURISDICTION),
|
|
689
|
+
import_zod10.z.literal(SCOPES.RECORD_DECLARE_MARRIAGE),
|
|
690
|
+
import_zod10.z.literal(SCOPES.RECORD_DECLARE_MARRIAGE_MY_JURISDICTION),
|
|
691
|
+
import_zod10.z.literal(SCOPES.RECORD_SUBMIT_INCOMPLETE),
|
|
692
|
+
import_zod10.z.literal(SCOPES.RECORD_SUBMIT_FOR_REVIEW)
|
|
721
693
|
]);
|
|
722
|
-
var UnassignScope =
|
|
723
|
-
var ValidateScopes =
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
694
|
+
var UnassignScope = import_zod10.z.literal(SCOPES.RECORD_UNASSIGN_OTHERS);
|
|
695
|
+
var ValidateScopes = import_zod10.z.union([
|
|
696
|
+
import_zod10.z.literal(SCOPES.RECORD_SUBMIT_FOR_APPROVAL),
|
|
697
|
+
import_zod10.z.literal(SCOPES.RECORD_SUBMIT_FOR_UPDATES),
|
|
698
|
+
import_zod10.z.literal(SCOPES.RECORD_DECLARATION_EDIT),
|
|
699
|
+
import_zod10.z.literal(SCOPES.RECORD_REVIEW_DUPLICATES),
|
|
700
|
+
import_zod10.z.literal(SCOPES.RECORD_DECLARATION_ARCHIVE),
|
|
701
|
+
import_zod10.z.literal(SCOPES.RECORD_DECLARATION_REINSTATE)
|
|
730
702
|
]);
|
|
731
|
-
var RegisterScope =
|
|
732
|
-
var CorrectionScopes =
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
703
|
+
var RegisterScope = import_zod10.z.literal(SCOPES.RECORD_REGISTER);
|
|
704
|
+
var CorrectionScopes = import_zod10.z.union([
|
|
705
|
+
import_zod10.z.literal(SCOPES.RECORD_REGISTRATION_REQUEST_CORRECTION),
|
|
706
|
+
import_zod10.z.literal(SCOPES.RECORD_REGISTRATION_CORRECT),
|
|
707
|
+
import_zod10.z.literal(SCOPES.RECORD_CONFIRM_REGISTRATION),
|
|
708
|
+
import_zod10.z.literal(SCOPES.RECORD_REJECT_REGISTRATION)
|
|
737
709
|
]);
|
|
738
|
-
var SearchScopes =
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
710
|
+
var SearchScopes = import_zod10.z.union([
|
|
711
|
+
import_zod10.z.literal(SCOPES.SEARCH_BIRTH_MY_JURISDICTION),
|
|
712
|
+
import_zod10.z.literal(SCOPES.SEARCH_BIRTH),
|
|
713
|
+
import_zod10.z.literal(SCOPES.SEARCH_DEATH_MY_JURISDICTION),
|
|
714
|
+
import_zod10.z.literal(SCOPES.SEARCH_DEATH),
|
|
715
|
+
import_zod10.z.literal(SCOPES.SEARCH_MARRIAGE_MY_JURISDICTION),
|
|
716
|
+
import_zod10.z.literal(SCOPES.SEARCH_MARRIAGE)
|
|
745
717
|
]);
|
|
746
|
-
var AuditScopes =
|
|
747
|
-
var PerformanceScopes =
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
718
|
+
var AuditScopes = import_zod10.z.literal(SCOPES.RECORD_READ);
|
|
719
|
+
var PerformanceScopes = import_zod10.z.union([
|
|
720
|
+
import_zod10.z.literal(SCOPES.PERFORMANCE_READ),
|
|
721
|
+
import_zod10.z.literal(SCOPES.PERFORMANCE_READ_DASHBOARDS),
|
|
722
|
+
import_zod10.z.literal(SCOPES.PERFORMANCE_EXPORT_VITAL_STATISTICS)
|
|
751
723
|
]);
|
|
752
|
-
var OrganisationScopes =
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
724
|
+
var OrganisationScopes = import_zod10.z.union([
|
|
725
|
+
import_zod10.z.literal(SCOPES.ORGANISATION_READ_LOCATIONS),
|
|
726
|
+
import_zod10.z.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_OFFICE),
|
|
727
|
+
import_zod10.z.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_JURISDICTION)
|
|
756
728
|
]);
|
|
757
|
-
var UserScopes =
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
729
|
+
var UserScopes = import_zod10.z.union([
|
|
730
|
+
import_zod10.z.literal(SCOPES.USER_READ),
|
|
731
|
+
import_zod10.z.literal(SCOPES.USER_READ_MY_OFFICE),
|
|
732
|
+
import_zod10.z.literal(SCOPES.USER_READ_MY_JURISDICTION),
|
|
733
|
+
import_zod10.z.literal(SCOPES.USER_READ_ONLY_MY_AUDIT),
|
|
734
|
+
import_zod10.z.literal(SCOPES.USER_CREATE),
|
|
735
|
+
import_zod10.z.literal(SCOPES.USER_CREATE_MY_JURISDICTION),
|
|
736
|
+
import_zod10.z.literal(SCOPES.USER_UPDATE),
|
|
737
|
+
import_zod10.z.literal(SCOPES.USER_UPDATE_MY_JURISDICTION)
|
|
766
738
|
]);
|
|
767
|
-
var ConfigScope =
|
|
768
|
-
var DataSeedingScope =
|
|
769
|
-
var LiteralScopes =
|
|
739
|
+
var ConfigScope = import_zod10.z.literal(SCOPES.CONFIG_UPDATE_ALL);
|
|
740
|
+
var DataSeedingScope = import_zod10.z.literal(SCOPES.USER_DATA_SEEDING);
|
|
741
|
+
var LiteralScopes = import_zod10.z.union([
|
|
770
742
|
LegacyScopes,
|
|
771
743
|
IntegrationScopes,
|
|
772
744
|
UnassignScope,
|
|
773
745
|
DeclareScopes,
|
|
774
746
|
ValidateScopes,
|
|
775
747
|
RegisterScope,
|
|
776
|
-
|
|
748
|
+
import_zod10.z.literal(SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES),
|
|
777
749
|
CorrectionScopes,
|
|
778
750
|
SearchScopes,
|
|
779
751
|
AuditScopes,
|
|
780
|
-
|
|
752
|
+
import_zod10.z.literal(SCOPES.PROFILE_ELECTRONIC_SIGNATURE),
|
|
781
753
|
PerformanceScopes,
|
|
782
754
|
OrganisationScopes,
|
|
783
755
|
UserScopes,
|
|
@@ -786,38 +758,38 @@ var LiteralScopes = z10.union([
|
|
|
786
758
|
InternalOperationsScopes
|
|
787
759
|
]);
|
|
788
760
|
var rawConfigurableScopeRegex = /^([a-zA-Z][a-zA-Z0-9.-]*(?:\.[a-zA-Z0-9.-]+)*)\[((?:\w+=[\w.-]+(?:\|[\w.-]+)*)(?:,[\w]+=[\w.-]+(?:\|[\w.-]+)*)*)\]$/;
|
|
789
|
-
var rawConfigurableScope =
|
|
790
|
-
var CreateUserScope =
|
|
791
|
-
type:
|
|
792
|
-
options:
|
|
793
|
-
role:
|
|
761
|
+
var rawConfigurableScope = import_zod10.z.string().regex(rawConfigurableScopeRegex);
|
|
762
|
+
var CreateUserScope = import_zod10.z.object({
|
|
763
|
+
type: import_zod10.z.literal("user.create"),
|
|
764
|
+
options: import_zod10.z.object({
|
|
765
|
+
role: import_zod10.z.array(import_zod10.z.string())
|
|
794
766
|
})
|
|
795
767
|
});
|
|
796
|
-
var EditUserScope =
|
|
797
|
-
type:
|
|
798
|
-
options:
|
|
799
|
-
role:
|
|
768
|
+
var EditUserScope = import_zod10.z.object({
|
|
769
|
+
type: import_zod10.z.literal("user.edit"),
|
|
770
|
+
options: import_zod10.z.object({
|
|
771
|
+
role: import_zod10.z.array(import_zod10.z.string())
|
|
800
772
|
})
|
|
801
773
|
});
|
|
802
|
-
var WorkqueueScope =
|
|
803
|
-
type:
|
|
804
|
-
options:
|
|
805
|
-
id:
|
|
774
|
+
var WorkqueueScope = import_zod10.z.object({
|
|
775
|
+
type: import_zod10.z.literal("workqueue"),
|
|
776
|
+
options: import_zod10.z.object({
|
|
777
|
+
id: import_zod10.z.array(import_zod10.z.string())
|
|
806
778
|
})
|
|
807
779
|
});
|
|
808
|
-
var SearchScope =
|
|
809
|
-
type:
|
|
810
|
-
options:
|
|
811
|
-
event:
|
|
812
|
-
access:
|
|
780
|
+
var SearchScope = import_zod10.z.object({
|
|
781
|
+
type: import_zod10.z.literal("search"),
|
|
782
|
+
options: import_zod10.z.object({
|
|
783
|
+
event: import_zod10.z.array(import_zod10.z.string()).length(1),
|
|
784
|
+
access: import_zod10.z.array(import_zod10.z.enum(["my-jurisdiction", "all"])).length(1)
|
|
813
785
|
})
|
|
814
786
|
});
|
|
815
|
-
var RecordScopeType =
|
|
787
|
+
var RecordScopeType = import_zod10.z.enum([
|
|
816
788
|
"record.create",
|
|
817
789
|
"record.read",
|
|
818
790
|
"record.declare",
|
|
819
791
|
"record.notify",
|
|
820
|
-
"record.declared.
|
|
792
|
+
"record.declared.validate",
|
|
821
793
|
"record.declared.reject",
|
|
822
794
|
"record.declared.archive",
|
|
823
795
|
"record.declared.review-duplicates",
|
|
@@ -827,40 +799,27 @@ var RecordScopeType = z10.enum([
|
|
|
827
799
|
"record.registered.correct",
|
|
828
800
|
"record.unassign-others"
|
|
829
801
|
]);
|
|
830
|
-
var RecordScope =
|
|
802
|
+
var RecordScope = import_zod10.z.object({
|
|
831
803
|
type: RecordScopeType,
|
|
832
|
-
options:
|
|
833
|
-
event:
|
|
804
|
+
options: import_zod10.z.object({
|
|
805
|
+
event: import_zod10.z.array(import_zod10.z.string()).describe("Event type, e.g. birth, death")
|
|
834
806
|
})
|
|
835
807
|
}).describe(
|
|
836
808
|
"Scopes used to check user's permission to perform actions on a record."
|
|
837
809
|
);
|
|
838
|
-
var
|
|
839
|
-
type: z10.literal("record.custom-action"),
|
|
840
|
-
options: z10.object({
|
|
841
|
-
event: z10.array(z10.string()).describe("Allowed event type, e.g. birth, death"),
|
|
842
|
-
customActionType: z10.array(z10.string()).describe("Allowed custom action types")
|
|
843
|
-
})
|
|
844
|
-
});
|
|
845
|
-
var ConfigurableRawScopes = z10.discriminatedUnion("type", [
|
|
810
|
+
var ConfigurableRawScopes = import_zod10.z.discriminatedUnion("type", [
|
|
846
811
|
SearchScope,
|
|
847
812
|
CreateUserScope,
|
|
848
813
|
EditUserScope,
|
|
849
814
|
WorkqueueScope,
|
|
850
|
-
RecordScope
|
|
851
|
-
CustomActionScope
|
|
852
|
-
]);
|
|
853
|
-
var ConfigurableActionScopes = z10.discriminatedUnion("type", [
|
|
854
|
-
// @TODO - Record scope holds non-action scopes as well e.g., `record.read`
|
|
855
|
-
RecordScope,
|
|
856
|
-
CustomActionScope
|
|
815
|
+
RecordScope
|
|
857
816
|
]);
|
|
858
817
|
var scopes = Object.values(SCOPES);
|
|
859
|
-
var ActionScopes =
|
|
818
|
+
var ActionScopes = import_zod10.z.union([
|
|
860
819
|
DeclareScopes,
|
|
861
820
|
ValidateScopes,
|
|
862
821
|
RegisterScope,
|
|
863
|
-
|
|
822
|
+
import_zod10.z.literal(SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES),
|
|
864
823
|
CorrectionScopes
|
|
865
824
|
]);
|
|
866
825
|
|
|
@@ -994,14 +953,15 @@ var DEFAULT_ROLES_DEFINITION = [
|
|
|
994
953
|
]
|
|
995
954
|
}
|
|
996
955
|
];
|
|
997
|
-
var TokenUserType =
|
|
998
|
-
var TokenWithBearer =
|
|
956
|
+
var TokenUserType = import_zod11.z.enum(["user", "system"]);
|
|
957
|
+
var TokenWithBearer = import_zod11.z.string().regex(/^Bearer\s/);
|
|
999
958
|
|
|
1000
959
|
// ../commons/src/events/ActionDocument.ts
|
|
1001
|
-
|
|
960
|
+
(0, import_zod_openapi4.extendZodWithOpenApi)(import_zod12.z);
|
|
961
|
+
var ActionUpdate = import_zod12.z.record(import_zod12.z.string(), FieldUpdateValue).describe(
|
|
1002
962
|
"Record of field-level changes made by an action. Supports partial updates and nullable values."
|
|
1003
963
|
);
|
|
1004
|
-
var EventState =
|
|
964
|
+
var EventState = import_zod12.z.record(import_zod12.z.string(), FieldValue).describe(
|
|
1005
965
|
"Aggregate representation of event data after all actions have been applied, with all updates consolidated and null values removed."
|
|
1006
966
|
);
|
|
1007
967
|
var ActionStatus = {
|
|
@@ -1009,25 +969,24 @@ var ActionStatus = {
|
|
|
1009
969
|
Accepted: "Accepted",
|
|
1010
970
|
Rejected: "Rejected"
|
|
1011
971
|
};
|
|
1012
|
-
var ActionBase =
|
|
972
|
+
var ActionBase = import_zod12.z.object({
|
|
1013
973
|
id: UUID.describe("Unique identifier of the action."),
|
|
1014
|
-
transactionId:
|
|
974
|
+
transactionId: import_zod12.z.string().describe("Unique identifier of the transaction."),
|
|
1015
975
|
createdByUserType: TokenUserType.describe(
|
|
1016
976
|
"Indicates whether the action was created by a human-user or by a system-user."
|
|
1017
977
|
),
|
|
1018
|
-
createdAt:
|
|
1019
|
-
createdBy:
|
|
1020
|
-
createdByRole:
|
|
1021
|
-
createdBySignature:
|
|
1022
|
-
|
|
1023
|
-
createdAtLocation: UUID.nullish().describe(
|
|
978
|
+
createdAt: import_zod12.z.string().datetime().describe("Timestamp indicating when the action was created."),
|
|
979
|
+
createdBy: import_zod12.z.string().describe("Identifier of the user who created the action."),
|
|
980
|
+
createdByRole: import_zod12.z.string().describe("Role of the user who created the action."),
|
|
981
|
+
createdBySignature: import_zod12.z.string().nullish().describe("Reference to the signature of the user who created the action."),
|
|
982
|
+
createdAtLocation: CreatedAtLocation.describe(
|
|
1024
983
|
"Reference to the location of the user who created the action."
|
|
1025
984
|
),
|
|
1026
985
|
declaration: ActionUpdate.describe(
|
|
1027
986
|
"Declaration data defined by the ActionConfig. Supports partial updates."
|
|
1028
987
|
),
|
|
1029
988
|
annotation: ActionUpdate.optional().nullable().describe("Action-specific metadata used to annotate the event."),
|
|
1030
|
-
status:
|
|
989
|
+
status: import_zod12.z.enum([
|
|
1031
990
|
ActionStatus.Requested,
|
|
1032
991
|
ActionStatus.Accepted,
|
|
1033
992
|
ActionStatus.Rejected
|
|
@@ -1038,181 +997,172 @@ var ActionBase = z12.object({
|
|
|
1038
997
|
"Reference to the original action asynchronously accepted or rejected by a third-party integration."
|
|
1039
998
|
)
|
|
1040
999
|
});
|
|
1041
|
-
var AssignedAction = ActionBase.
|
|
1042
|
-
|
|
1043
|
-
type:
|
|
1044
|
-
assignedTo:
|
|
1000
|
+
var AssignedAction = ActionBase.merge(
|
|
1001
|
+
import_zod12.z.object({
|
|
1002
|
+
type: import_zod12.z.literal(ActionType.ASSIGN),
|
|
1003
|
+
assignedTo: import_zod12.z.string().describe("Identifier of the user to whom the action is assigned.")
|
|
1045
1004
|
// TODO move into 'content' property
|
|
1046
|
-
})
|
|
1005
|
+
})
|
|
1047
1006
|
);
|
|
1048
|
-
var UnassignedAction = ActionBase.
|
|
1049
|
-
|
|
1050
|
-
type:
|
|
1051
|
-
})
|
|
1007
|
+
var UnassignedAction = ActionBase.merge(
|
|
1008
|
+
import_zod12.z.object({
|
|
1009
|
+
type: import_zod12.z.literal(ActionType.UNASSIGN)
|
|
1010
|
+
})
|
|
1052
1011
|
);
|
|
1053
|
-
var RegisterAction = ActionBase.
|
|
1054
|
-
|
|
1055
|
-
type:
|
|
1056
|
-
registrationNumber:
|
|
1012
|
+
var RegisterAction = ActionBase.merge(
|
|
1013
|
+
import_zod12.z.object({
|
|
1014
|
+
type: import_zod12.z.literal(ActionType.REGISTER),
|
|
1015
|
+
registrationNumber: import_zod12.z.string().optional().describe(
|
|
1057
1016
|
"Registration number of the event. Always present for accepted registrations."
|
|
1058
1017
|
)
|
|
1059
1018
|
// TODO move into 'content' property
|
|
1060
|
-
})
|
|
1019
|
+
})
|
|
1020
|
+
);
|
|
1021
|
+
var DeclareAction = ActionBase.merge(
|
|
1022
|
+
import_zod12.z.object({
|
|
1023
|
+
type: import_zod12.z.literal(ActionType.DECLARE)
|
|
1024
|
+
})
|
|
1061
1025
|
);
|
|
1062
|
-
var
|
|
1063
|
-
|
|
1064
|
-
type:
|
|
1065
|
-
})
|
|
1026
|
+
var ValidateAction = ActionBase.merge(
|
|
1027
|
+
import_zod12.z.object({
|
|
1028
|
+
type: import_zod12.z.literal(ActionType.VALIDATE)
|
|
1029
|
+
})
|
|
1066
1030
|
);
|
|
1067
|
-
var ReasonContent =
|
|
1068
|
-
reason:
|
|
1031
|
+
var ReasonContent = import_zod12.z.object({
|
|
1032
|
+
reason: import_zod12.z.string().min(1, { message: "Message cannot be empty" }).describe(
|
|
1069
1033
|
"Message describing the reason for rejecting or archiving the event."
|
|
1070
1034
|
)
|
|
1071
1035
|
});
|
|
1072
|
-
var RejectAction = ActionBase.
|
|
1073
|
-
|
|
1074
|
-
type:
|
|
1036
|
+
var RejectAction = ActionBase.merge(
|
|
1037
|
+
import_zod12.z.object({
|
|
1038
|
+
type: import_zod12.z.literal(ActionType.REJECT),
|
|
1075
1039
|
content: ReasonContent
|
|
1076
|
-
})
|
|
1040
|
+
})
|
|
1077
1041
|
);
|
|
1078
|
-
var PotentialDuplicate =
|
|
1042
|
+
var PotentialDuplicate = import_zod12.z.object({
|
|
1079
1043
|
id: UUID,
|
|
1080
|
-
trackingId:
|
|
1044
|
+
trackingId: import_zod12.z.string()
|
|
1081
1045
|
});
|
|
1082
|
-
var DuplicateDetectedAction = ActionBase.
|
|
1083
|
-
|
|
1084
|
-
type:
|
|
1085
|
-
content:
|
|
1086
|
-
duplicates:
|
|
1046
|
+
var DuplicateDetectedAction = ActionBase.merge(
|
|
1047
|
+
import_zod12.z.object({
|
|
1048
|
+
type: import_zod12.z.literal(ActionType.DUPLICATE_DETECTED),
|
|
1049
|
+
content: import_zod12.z.object({
|
|
1050
|
+
duplicates: import_zod12.z.array(PotentialDuplicate)
|
|
1087
1051
|
})
|
|
1088
|
-
})
|
|
1052
|
+
})
|
|
1089
1053
|
);
|
|
1090
|
-
var MarkNotDuplicateAction = ActionBase.
|
|
1091
|
-
|
|
1092
|
-
type:
|
|
1093
|
-
})
|
|
1054
|
+
var MarkNotDuplicateAction = ActionBase.merge(
|
|
1055
|
+
import_zod12.z.object({
|
|
1056
|
+
type: import_zod12.z.literal(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
1057
|
+
})
|
|
1094
1058
|
);
|
|
1095
|
-
var MarkAsDuplicateAction = ActionBase.
|
|
1096
|
-
|
|
1097
|
-
type:
|
|
1098
|
-
content:
|
|
1059
|
+
var MarkAsDuplicateAction = ActionBase.merge(
|
|
1060
|
+
import_zod12.z.object({
|
|
1061
|
+
type: import_zod12.z.literal(ActionType.MARK_AS_DUPLICATE),
|
|
1062
|
+
content: import_zod12.z.object({
|
|
1099
1063
|
duplicateOf: UUID
|
|
1100
1064
|
}).optional()
|
|
1101
|
-
})
|
|
1065
|
+
})
|
|
1102
1066
|
);
|
|
1103
|
-
var ArchiveAction = ActionBase.
|
|
1104
|
-
|
|
1105
|
-
type:
|
|
1067
|
+
var ArchiveAction = ActionBase.merge(
|
|
1068
|
+
import_zod12.z.object({
|
|
1069
|
+
type: import_zod12.z.literal(ActionType.ARCHIVE),
|
|
1106
1070
|
content: ReasonContent
|
|
1107
|
-
})
|
|
1108
|
-
);
|
|
1109
|
-
var CreatedAction = ActionBase.extend(
|
|
1110
|
-
z12.object({
|
|
1111
|
-
type: z12.literal(ActionType.CREATE)
|
|
1112
|
-
}).shape
|
|
1071
|
+
})
|
|
1113
1072
|
);
|
|
1114
|
-
var
|
|
1115
|
-
|
|
1116
|
-
type:
|
|
1117
|
-
})
|
|
1073
|
+
var CreatedAction = ActionBase.merge(
|
|
1074
|
+
import_zod12.z.object({
|
|
1075
|
+
type: import_zod12.z.literal(ActionType.CREATE)
|
|
1076
|
+
})
|
|
1118
1077
|
);
|
|
1119
|
-
var
|
|
1120
|
-
|
|
1121
|
-
type:
|
|
1122
|
-
|
|
1123
|
-
comment: z12.string().describe("Comment for the edit action.").optional()
|
|
1124
|
-
})
|
|
1125
|
-
}).shape
|
|
1078
|
+
var NotifiedAction = ActionBase.merge(
|
|
1079
|
+
import_zod12.z.object({
|
|
1080
|
+
type: import_zod12.z.literal(ActionType.NOTIFY)
|
|
1081
|
+
})
|
|
1126
1082
|
);
|
|
1127
|
-
var PrintContent =
|
|
1128
|
-
templateId:
|
|
1083
|
+
var PrintContent = import_zod12.z.object({
|
|
1084
|
+
templateId: import_zod12.z.string().optional()
|
|
1129
1085
|
});
|
|
1130
|
-
var PrintCertificateAction = ActionBase.
|
|
1131
|
-
|
|
1132
|
-
type:
|
|
1086
|
+
var PrintCertificateAction = ActionBase.merge(
|
|
1087
|
+
import_zod12.z.object({
|
|
1088
|
+
type: import_zod12.z.literal(ActionType.PRINT_CERTIFICATE),
|
|
1133
1089
|
content: PrintContent.optional().nullable()
|
|
1134
|
-
})
|
|
1090
|
+
})
|
|
1135
1091
|
);
|
|
1136
|
-
var RequestedCorrectionAction = ActionBase.
|
|
1137
|
-
|
|
1138
|
-
type:
|
|
1139
|
-
})
|
|
1092
|
+
var RequestedCorrectionAction = ActionBase.merge(
|
|
1093
|
+
import_zod12.z.object({
|
|
1094
|
+
type: import_zod12.z.literal(ActionType.REQUEST_CORRECTION)
|
|
1095
|
+
})
|
|
1140
1096
|
);
|
|
1141
|
-
var ApprovedCorrectionAction = ActionBase.
|
|
1142
|
-
|
|
1143
|
-
type:
|
|
1144
|
-
requestId:
|
|
1097
|
+
var ApprovedCorrectionAction = ActionBase.merge(
|
|
1098
|
+
import_zod12.z.object({
|
|
1099
|
+
type: import_zod12.z.literal(ActionType.APPROVE_CORRECTION),
|
|
1100
|
+
requestId: import_zod12.z.string()
|
|
1145
1101
|
// TODO move into 'content' property
|
|
1146
|
-
})
|
|
1102
|
+
})
|
|
1147
1103
|
);
|
|
1148
|
-
var RejectedCorrectionAction = ActionBase.
|
|
1149
|
-
|
|
1150
|
-
type:
|
|
1151
|
-
requestId:
|
|
1104
|
+
var RejectedCorrectionAction = ActionBase.merge(
|
|
1105
|
+
import_zod12.z.object({
|
|
1106
|
+
type: import_zod12.z.literal(ActionType.REJECT_CORRECTION),
|
|
1107
|
+
requestId: import_zod12.z.string(),
|
|
1152
1108
|
// TODO move into 'content' property
|
|
1153
1109
|
content: ReasonContent
|
|
1154
|
-
})
|
|
1155
|
-
);
|
|
1156
|
-
var ReadAction = ActionBase.extend(
|
|
1157
|
-
z12.object({
|
|
1158
|
-
type: z12.literal(ActionType.READ)
|
|
1159
|
-
}).shape
|
|
1110
|
+
})
|
|
1160
1111
|
);
|
|
1161
|
-
var
|
|
1162
|
-
|
|
1163
|
-
type:
|
|
1164
|
-
customActionType: z12.string()
|
|
1112
|
+
var ReadAction = ActionBase.merge(
|
|
1113
|
+
import_zod12.z.object({
|
|
1114
|
+
type: import_zod12.z.literal(ActionType.READ)
|
|
1165
1115
|
})
|
|
1166
1116
|
);
|
|
1167
|
-
var ActionDocument =
|
|
1168
|
-
CreatedAction.
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
id: "ActionDocument"
|
|
1117
|
+
var ActionDocument = import_zod12.z.discriminatedUnion("type", [
|
|
1118
|
+
CreatedAction.openapi({ ref: "CreatedAction" }),
|
|
1119
|
+
ValidateAction.openapi({ ref: "ValidateAction" }),
|
|
1120
|
+
RejectAction.openapi({ ref: "RejectAction" }),
|
|
1121
|
+
DuplicateDetectedAction.openapi({ ref: "DuplicateDetectedAction" }),
|
|
1122
|
+
MarkNotDuplicateAction.openapi({ ref: "MarkNotDuplicateAction" }),
|
|
1123
|
+
MarkAsDuplicateAction.openapi({ ref: "MarkAsDuplicateAction" }),
|
|
1124
|
+
ArchiveAction.openapi({ ref: "ArchiveAction" }),
|
|
1125
|
+
NotifiedAction.openapi({ ref: "NotifiedAction" }),
|
|
1126
|
+
RegisterAction.openapi({ ref: "RegisterAction" }),
|
|
1127
|
+
DeclareAction.openapi({ ref: "DeclareAction" }),
|
|
1128
|
+
AssignedAction.openapi({ ref: "AssignedAction" }),
|
|
1129
|
+
RequestedCorrectionAction.openapi({ ref: "RequestedCorrectionAction" }),
|
|
1130
|
+
ApprovedCorrectionAction.openapi({ ref: "ApprovedCorrectionAction" }),
|
|
1131
|
+
RejectedCorrectionAction.openapi({ ref: "RejectedCorrectionAction" }),
|
|
1132
|
+
UnassignedAction.openapi({ ref: "UnassignedAction" }),
|
|
1133
|
+
PrintCertificateAction.openapi({ ref: "PrintCertificateAction" }),
|
|
1134
|
+
ReadAction.openapi({ ref: "ReadAction" })
|
|
1135
|
+
]).openapi({
|
|
1136
|
+
ref: "ActionDocument"
|
|
1188
1137
|
});
|
|
1189
1138
|
var AsyncRejectActionDocument = ActionBase.omit({
|
|
1190
1139
|
declaration: true,
|
|
1191
1140
|
annotation: true
|
|
1192
|
-
}).
|
|
1193
|
-
|
|
1194
|
-
type:
|
|
1195
|
-
status:
|
|
1196
|
-
})
|
|
1141
|
+
}).merge(
|
|
1142
|
+
import_zod12.z.object({
|
|
1143
|
+
type: import_zod12.z.enum(ConfirmableActions),
|
|
1144
|
+
status: import_zod12.z.literal(ActionStatus.Rejected)
|
|
1145
|
+
})
|
|
1197
1146
|
);
|
|
1198
|
-
var Action =
|
|
1147
|
+
var Action = import_zod12.z.union([ActionDocument, AsyncRejectActionDocument]);
|
|
1199
1148
|
|
|
1200
|
-
// ../commons/src/events/
|
|
1201
|
-
var
|
|
1149
|
+
// ../commons/src/events/EventMetadata.ts
|
|
1150
|
+
var EventStatus = import_zod13.z.enum([
|
|
1151
|
+
"CREATED",
|
|
1152
|
+
"NOTIFIED",
|
|
1153
|
+
"DECLARED",
|
|
1154
|
+
"VALIDATED",
|
|
1155
|
+
"REGISTERED",
|
|
1156
|
+
"ARCHIVED"
|
|
1157
|
+
]);
|
|
1202
1158
|
var InherentFlags = {
|
|
1159
|
+
PENDING_CERTIFICATION: "pending-certification",
|
|
1203
1160
|
INCOMPLETE: "incomplete",
|
|
1204
1161
|
REJECTED: "rejected",
|
|
1205
1162
|
CORRECTION_REQUESTED: "correction-requested",
|
|
1206
|
-
POTENTIAL_DUPLICATE: "potential-duplicate"
|
|
1207
|
-
/**
|
|
1208
|
-
* This flag is set by the Edit-action and removed after the declaration or registration.
|
|
1209
|
-
* A record should never stay with the EDIT_IN_PROGRESS flag, since it should always be declared or registered right after.
|
|
1210
|
-
*
|
|
1211
|
-
* We only use this flag to determine that a NOTIFY, DECLARE or REGISTER action is allowed next.
|
|
1212
|
-
*/
|
|
1213
|
-
EDIT_IN_PROGRESS: "edit-in-progress"
|
|
1163
|
+
POTENTIAL_DUPLICATE: "potential-duplicate"
|
|
1214
1164
|
};
|
|
1215
|
-
var ActionFlag =
|
|
1165
|
+
var ActionFlag = import_zod13.z.string().regex(
|
|
1216
1166
|
new RegExp(
|
|
1217
1167
|
`^(${Object.values(ActionType).join("|").toLowerCase()}):(${Object.values(
|
|
1218
1168
|
ActionStatus
|
|
@@ -1220,92 +1170,59 @@ var ActionFlag = z13.string().regex(
|
|
|
1220
1170
|
),
|
|
1221
1171
|
"Flag must be in the format ActionType:ActionStatus (lowerCase)"
|
|
1222
1172
|
);
|
|
1223
|
-
var
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
).
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
}).describe("Custom flag identifier defined by the country config.");
|
|
1230
|
-
var Flag = ActionFlag.or(z13.enum(InherentFlags)).or(CustomFlag);
|
|
1231
|
-
var FlagConfig = z13.object({
|
|
1232
|
-
id: CustomFlag,
|
|
1233
|
-
requiresAction: z13.boolean().describe(
|
|
1234
|
-
"Indicates if this flag expects an action to be performed to be cleared."
|
|
1235
|
-
),
|
|
1236
|
-
label: TranslationConfig.describe("Human readable label of the flag.")
|
|
1237
|
-
});
|
|
1238
|
-
var ActionFlagConfig = z13.object({
|
|
1239
|
-
id: Flag,
|
|
1240
|
-
operation: z13.enum(["add", "remove"]).describe("Operation to perform on the flag."),
|
|
1241
|
-
conditional: Conditional.optional().describe(
|
|
1242
|
-
"When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
|
|
1243
|
-
)
|
|
1244
|
-
});
|
|
1245
|
-
|
|
1246
|
-
// ../commons/src/events/EventMetadata.ts
|
|
1247
|
-
var EventStatus = z14.enum([
|
|
1248
|
-
"CREATED",
|
|
1249
|
-
"NOTIFIED",
|
|
1250
|
-
"DECLARED",
|
|
1251
|
-
"REGISTERED",
|
|
1252
|
-
"ARCHIVED"
|
|
1253
|
-
]);
|
|
1254
|
-
var ZodDate = z14.iso.date();
|
|
1255
|
-
var ActionCreationMetadata = z14.object({
|
|
1256
|
-
createdAt: z14.iso.datetime().describe("The timestamp when the action request was created."),
|
|
1257
|
-
createdBy: z14.string().describe("ID of the user who created the action request."),
|
|
1258
|
-
// @TODO: createdAtLocation should be non-nullable in the future once all action requests have this field populated.
|
|
1259
|
-
createdAtLocation: UUID.nullish().describe(
|
|
1173
|
+
var Flag = ActionFlag.or(import_zod13.z.nativeEnum(InherentFlags));
|
|
1174
|
+
var ZodDate = import_zod13.z.string().date();
|
|
1175
|
+
var ActionCreationMetadata = import_zod13.z.object({
|
|
1176
|
+
createdAt: import_zod13.z.string().datetime().describe("The timestamp when the action request was created."),
|
|
1177
|
+
createdBy: import_zod13.z.string().describe("ID of the user who created the action request."),
|
|
1178
|
+
createdAtLocation: CreatedAtLocation.describe(
|
|
1260
1179
|
"Location of the user who created the action request."
|
|
1261
1180
|
),
|
|
1262
|
-
createdByUserType:
|
|
1263
|
-
acceptedAt:
|
|
1264
|
-
createdByRole:
|
|
1265
|
-
createdBySignature:
|
|
1181
|
+
createdByUserType: import_zod13.z.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1182
|
+
acceptedAt: import_zod13.z.string().datetime().describe("Timestamp when the action request was accepted."),
|
|
1183
|
+
createdByRole: import_zod13.z.string().describe("Role of the user at the time of action request creation."),
|
|
1184
|
+
createdBySignature: import_zod13.z.string().nullish().describe("Signature of the user who created the action request.")
|
|
1266
1185
|
});
|
|
1267
1186
|
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
1268
|
-
registrationNumber:
|
|
1187
|
+
registrationNumber: import_zod13.z.string().describe(
|
|
1269
1188
|
"Registration number of the event. Always present for accepted registrations."
|
|
1270
1189
|
)
|
|
1271
1190
|
});
|
|
1272
|
-
var LegalStatuses =
|
|
1191
|
+
var LegalStatuses = import_zod13.z.object({
|
|
1273
1192
|
[EventStatus.enum.DECLARED]: ActionCreationMetadata.nullish(),
|
|
1274
1193
|
[EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish()
|
|
1275
1194
|
});
|
|
1276
|
-
var EventMetadata =
|
|
1195
|
+
var EventMetadata = import_zod13.z.object({
|
|
1277
1196
|
id: UUID,
|
|
1278
|
-
type:
|
|
1197
|
+
type: import_zod13.z.string().describe("The type of event, such as birth, death, or marriage."),
|
|
1279
1198
|
status: EventStatus,
|
|
1280
1199
|
legalStatuses: LegalStatuses.describe(
|
|
1281
1200
|
"Metadata related to the legal registration of the event, such as who registered it and when."
|
|
1282
1201
|
),
|
|
1283
|
-
createdAt:
|
|
1202
|
+
createdAt: import_zod13.z.string().datetime().describe("The timestamp when the event was first created and saved."),
|
|
1284
1203
|
dateOfEvent: ZodDate.nullish(),
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
// @TODO: createdAtLocation should be non-nullable in the future once all action requests have this field populated.
|
|
1290
|
-
createdAtLocation: UUID.nullish().describe(
|
|
1204
|
+
createdBy: import_zod13.z.string().describe("ID of the user who created the event."),
|
|
1205
|
+
createdByUserType: import_zod13.z.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1206
|
+
updatedByUserRole: import_zod13.z.string().describe("Role of the user who last changed the status."),
|
|
1207
|
+
createdAtLocation: CreatedAtLocation.describe(
|
|
1291
1208
|
"Location of the user who created the event."
|
|
1292
1209
|
),
|
|
1293
|
-
createdBySignature:
|
|
1210
|
+
createdBySignature: import_zod13.z.string().nullish().describe("Signature of the user who created the event."),
|
|
1294
1211
|
updatedAtLocation: UUID.nullish().describe(
|
|
1295
1212
|
"Location of the user who last changed the status."
|
|
1296
1213
|
),
|
|
1297
|
-
updatedAt:
|
|
1214
|
+
updatedAt: import_zod13.z.string().datetime().describe(
|
|
1298
1215
|
"Timestamp of the most recent *accepted* status change. Possibly 3rd party update, if action is validation asynchronously."
|
|
1299
1216
|
),
|
|
1300
|
-
assignedTo:
|
|
1301
|
-
updatedBy:
|
|
1302
|
-
trackingId:
|
|
1217
|
+
assignedTo: import_zod13.z.string().nullish().describe("ID of the user currently assigned to the event."),
|
|
1218
|
+
updatedBy: import_zod13.z.string().nullish().describe("ID of the user who last changed the status."),
|
|
1219
|
+
trackingId: import_zod13.z.string().describe(
|
|
1303
1220
|
"System-generated tracking ID used by informants or registrars to look up the event."
|
|
1304
1221
|
),
|
|
1305
|
-
potentialDuplicates:
|
|
1222
|
+
potentialDuplicates: import_zod13.z.array(PotentialDuplicate).describe(
|
|
1306
1223
|
"List of event IDs and their tracking IDs that this event could be a duplicate of."
|
|
1307
1224
|
),
|
|
1308
|
-
flags:
|
|
1225
|
+
flags: import_zod13.z.array(Flag)
|
|
1309
1226
|
});
|
|
1310
1227
|
var EventMetadataKeysArray = [
|
|
1311
1228
|
"id",
|
|
@@ -1313,7 +1230,6 @@ var EventMetadataKeysArray = [
|
|
|
1313
1230
|
"status",
|
|
1314
1231
|
"createdAt",
|
|
1315
1232
|
"dateOfEvent",
|
|
1316
|
-
"placeOfEvent",
|
|
1317
1233
|
"createdBy",
|
|
1318
1234
|
"createdByUserType",
|
|
1319
1235
|
"updatedByUserRole",
|
|
@@ -1326,124 +1242,130 @@ var EventMetadataKeysArray = [
|
|
|
1326
1242
|
"legalStatuses",
|
|
1327
1243
|
"flags"
|
|
1328
1244
|
];
|
|
1329
|
-
var EventMetadataKeys =
|
|
1245
|
+
var EventMetadataKeys = import_zod13.z.enum(EventMetadataKeysArray);
|
|
1330
1246
|
|
|
1331
1247
|
// ../commons/src/events/EventIndex.ts
|
|
1248
|
+
var import_zod_openapi5 = require("zod-openapi");
|
|
1249
|
+
(0, import_zod_openapi5.extendZodWithOpenApi)(import_zod14.z);
|
|
1332
1250
|
var EventIndex = EventMetadata.extend({
|
|
1333
1251
|
declaration: EventState
|
|
1334
|
-
}).
|
|
1335
|
-
|
|
1252
|
+
}).openapi({
|
|
1253
|
+
ref: "EventIndex"
|
|
1336
1254
|
});
|
|
1337
|
-
var EventSearchIndex =
|
|
1338
|
-
|
|
1339
|
-
type:
|
|
1255
|
+
var EventSearchIndex = import_zod14.z.record(import_zod14.z.string(), import_zod14.z.any()).and(
|
|
1256
|
+
import_zod14.z.object({
|
|
1257
|
+
type: import_zod14.z.string()
|
|
1340
1258
|
// Ensures "type" (event-id) exists and is a string
|
|
1341
1259
|
})
|
|
1342
|
-
).
|
|
1343
|
-
|
|
1260
|
+
).openapi({
|
|
1261
|
+
ref: "EventSearchIndex"
|
|
1344
1262
|
});
|
|
1345
|
-
var Fuzzy =
|
|
1346
|
-
|
|
1263
|
+
var Fuzzy = import_zod14.z.object({ type: import_zod14.z.literal("fuzzy"), term: import_zod14.z.string() }).openapi({
|
|
1264
|
+
ref: "Fuzzy"
|
|
1347
1265
|
});
|
|
1348
|
-
var Exact =
|
|
1349
|
-
|
|
1266
|
+
var Exact = import_zod14.z.object({ type: import_zod14.z.literal("exact"), term: import_zod14.z.string() }).openapi({
|
|
1267
|
+
ref: "Exact"
|
|
1350
1268
|
});
|
|
1351
|
-
var ExactStatus =
|
|
1352
|
-
type:
|
|
1269
|
+
var ExactStatus = import_zod14.z.object({
|
|
1270
|
+
type: import_zod14.z.literal("exact"),
|
|
1353
1271
|
term: EventStatus
|
|
1354
|
-
}).
|
|
1355
|
-
|
|
1272
|
+
}).openapi({
|
|
1273
|
+
ref: "ExactStatus"
|
|
1356
1274
|
});
|
|
1357
|
-
var ExactUserType =
|
|
1358
|
-
type:
|
|
1275
|
+
var ExactUserType = import_zod14.z.object({
|
|
1276
|
+
type: import_zod14.z.literal("exact"),
|
|
1359
1277
|
term: TokenUserType
|
|
1360
|
-
}).
|
|
1361
|
-
|
|
1362
|
-
});
|
|
1363
|
-
var AnyOf =
|
|
1364
|
-
type:
|
|
1365
|
-
terms:
|
|
1366
|
-
}).
|
|
1367
|
-
|
|
1368
|
-
});
|
|
1369
|
-
var AnyOfStatus =
|
|
1370
|
-
type:
|
|
1371
|
-
terms:
|
|
1372
|
-
}).
|
|
1373
|
-
|
|
1374
|
-
});
|
|
1375
|
-
var Range =
|
|
1376
|
-
type:
|
|
1377
|
-
gte:
|
|
1378
|
-
lte:
|
|
1379
|
-
}).
|
|
1380
|
-
|
|
1381
|
-
});
|
|
1382
|
-
var ContainsFlags =
|
|
1383
|
-
anyOf:
|
|
1384
|
-
noneOf:
|
|
1385
|
-
}).
|
|
1386
|
-
|
|
1387
|
-
});
|
|
1388
|
-
var Within =
|
|
1389
|
-
|
|
1390
|
-
});
|
|
1391
|
-
var RangeDate =
|
|
1392
|
-
type:
|
|
1393
|
-
gte:
|
|
1394
|
-
lte:
|
|
1395
|
-
}).
|
|
1278
|
+
}).openapi({
|
|
1279
|
+
ref: "ExactUserType"
|
|
1280
|
+
});
|
|
1281
|
+
var AnyOf = import_zod14.z.object({
|
|
1282
|
+
type: import_zod14.z.literal("anyOf"),
|
|
1283
|
+
terms: import_zod14.z.array(import_zod14.z.string())
|
|
1284
|
+
}).openapi({
|
|
1285
|
+
ref: "AnyOf"
|
|
1286
|
+
});
|
|
1287
|
+
var AnyOfStatus = import_zod14.z.object({
|
|
1288
|
+
type: import_zod14.z.literal("anyOf"),
|
|
1289
|
+
terms: import_zod14.z.array(EventStatus)
|
|
1290
|
+
}).openapi({
|
|
1291
|
+
ref: "AnyOfStatus"
|
|
1292
|
+
});
|
|
1293
|
+
var Range = import_zod14.z.object({
|
|
1294
|
+
type: import_zod14.z.literal("range"),
|
|
1295
|
+
gte: import_zod14.z.string(),
|
|
1296
|
+
lte: import_zod14.z.string()
|
|
1297
|
+
}).openapi({
|
|
1298
|
+
ref: "Range"
|
|
1299
|
+
});
|
|
1300
|
+
var ContainsFlags = import_zod14.z.object({
|
|
1301
|
+
anyOf: import_zod14.z.array(Flag).optional(),
|
|
1302
|
+
noneOf: import_zod14.z.array(Flag).optional()
|
|
1303
|
+
}).openapi({
|
|
1304
|
+
ref: "ContainsFlags"
|
|
1305
|
+
});
|
|
1306
|
+
var Within = import_zod14.z.object({ type: import_zod14.z.literal("within"), location: import_zod14.z.string() }).openapi({
|
|
1307
|
+
ref: "Within"
|
|
1308
|
+
});
|
|
1309
|
+
var RangeDate = import_zod14.z.object({
|
|
1310
|
+
type: import_zod14.z.literal("range"),
|
|
1311
|
+
gte: import_zod14.z.string().date().or(import_zod14.z.string().datetime()),
|
|
1312
|
+
lte: import_zod14.z.string().date().or(import_zod14.z.string().datetime())
|
|
1313
|
+
}).openapi({ ref: "RangeDate" });
|
|
1396
1314
|
var ExactDate = Exact.extend({
|
|
1397
|
-
term:
|
|
1398
|
-
}).
|
|
1399
|
-
|
|
1315
|
+
term: import_zod14.z.string().date().or(import_zod14.z.string().datetime())
|
|
1316
|
+
}).openapi({
|
|
1317
|
+
ref: "ExactDate"
|
|
1400
1318
|
});
|
|
1401
|
-
var TimePeriod =
|
|
1402
|
-
type:
|
|
1319
|
+
var TimePeriod = import_zod14.z.object({
|
|
1320
|
+
type: import_zod14.z.literal("timePeriod"),
|
|
1403
1321
|
term: SelectDateRangeValue
|
|
1404
|
-
}).
|
|
1405
|
-
|
|
1322
|
+
}).openapi({
|
|
1323
|
+
ref: "TimePeriod"
|
|
1406
1324
|
});
|
|
1407
|
-
var DateCondition =
|
|
1408
|
-
|
|
1325
|
+
var DateCondition = import_zod14.z.union([ExactDate, RangeDate, TimePeriod]).openapi({
|
|
1326
|
+
ref: "DateCondition"
|
|
1409
1327
|
});
|
|
1410
|
-
var QueryInput =
|
|
1411
|
-
() =>
|
|
1412
|
-
|
|
1413
|
-
|
|
1328
|
+
var QueryInput = import_zod14.z.lazy(
|
|
1329
|
+
() => import_zod14.z.union([
|
|
1330
|
+
import_zod14.z.discriminatedUnion("type", [Fuzzy, Exact, Range, Within, AnyOf]),
|
|
1331
|
+
import_zod14.z.record(import_zod14.z.string(), QueryInput)
|
|
1414
1332
|
])
|
|
1415
|
-
).
|
|
1416
|
-
|
|
1417
|
-
});
|
|
1418
|
-
var QueryExpression =
|
|
1419
|
-
id:
|
|
1420
|
-
eventType:
|
|
1421
|
-
status:
|
|
1422
|
-
createdAt:
|
|
1423
|
-
updatedAt:
|
|
1424
|
-
"legalStatuses.REGISTERED.acceptedAt":
|
|
1425
|
-
"legalStatuses.DECLARED.createdAtLocation":
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
createdAtLocation:
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1333
|
+
).openapi({
|
|
1334
|
+
ref: "QueryInput"
|
|
1335
|
+
});
|
|
1336
|
+
var QueryExpression = import_zod14.z.object({
|
|
1337
|
+
id: import_zod14.z.optional(import_zod14.z.string()),
|
|
1338
|
+
eventType: import_zod14.z.string(),
|
|
1339
|
+
status: import_zod14.z.optional(import_zod14.z.union([AnyOfStatus, ExactStatus])),
|
|
1340
|
+
createdAt: import_zod14.z.optional(DateCondition),
|
|
1341
|
+
updatedAt: import_zod14.z.optional(DateCondition),
|
|
1342
|
+
"legalStatuses.REGISTERED.acceptedAt": import_zod14.z.optional(DateCondition),
|
|
1343
|
+
"legalStatuses.DECLARED.createdAtLocation": import_zod14.z.optional(
|
|
1344
|
+
import_zod14.z.union([Within, Exact])
|
|
1345
|
+
),
|
|
1346
|
+
"legalStatuses.REGISTERED.createdAtLocation": import_zod14.z.optional(
|
|
1347
|
+
import_zod14.z.union([Within, Exact])
|
|
1348
|
+
),
|
|
1349
|
+
"legalStatuses.REGISTERED.registrationNumber": import_zod14.z.optional(Exact),
|
|
1350
|
+
createdAtLocation: import_zod14.z.optional(import_zod14.z.union([Within, Exact])),
|
|
1351
|
+
updatedAtLocation: import_zod14.z.optional(import_zod14.z.union([Within, Exact])),
|
|
1352
|
+
assignedTo: import_zod14.z.optional(Exact),
|
|
1353
|
+
createdByUserType: import_zod14.z.optional(ExactUserType),
|
|
1354
|
+
createdBy: import_zod14.z.optional(Exact),
|
|
1355
|
+
updatedBy: import_zod14.z.optional(Exact),
|
|
1356
|
+
trackingId: import_zod14.z.optional(Exact),
|
|
1357
|
+
flags: import_zod14.z.optional(ContainsFlags),
|
|
1436
1358
|
// @todo: The type for this comes out as "any"
|
|
1437
1359
|
data: QueryInput
|
|
1438
1360
|
}).partial().refine((obj) => Object.values(obj).some((val) => val !== void 0), {
|
|
1439
|
-
|
|
1440
|
-
}).
|
|
1441
|
-
|
|
1442
|
-
});
|
|
1443
|
-
var QueryType =
|
|
1444
|
-
() =>
|
|
1445
|
-
type:
|
|
1446
|
-
clauses:
|
|
1361
|
+
message: "At least one query field must be specified."
|
|
1362
|
+
}).openapi({
|
|
1363
|
+
ref: "QueryExpression"
|
|
1364
|
+
});
|
|
1365
|
+
var QueryType = import_zod14.z.lazy(
|
|
1366
|
+
() => import_zod14.z.object({
|
|
1367
|
+
type: import_zod14.z.literal("and").or(import_zod14.z.literal("or")).openapi({ default: "and" }),
|
|
1368
|
+
clauses: import_zod14.z.array(import_zod14.z.union([QueryExpression, QueryType])).nonempty("At least one clause is required.").openapi({
|
|
1447
1369
|
default: [
|
|
1448
1370
|
{
|
|
1449
1371
|
eventType: TENNIS_CLUB_MEMBERSHIP,
|
|
@@ -1461,8 +1383,8 @@ var QueryType = import_v4.z.lazy(
|
|
|
1461
1383
|
]
|
|
1462
1384
|
})
|
|
1463
1385
|
})
|
|
1464
|
-
).
|
|
1465
|
-
|
|
1386
|
+
).openapi({
|
|
1387
|
+
ref: "QueryType"
|
|
1466
1388
|
});
|
|
1467
1389
|
function parseStringifiedQueryField(val) {
|
|
1468
1390
|
if (typeof val === "string") {
|
|
@@ -1470,8 +1392,8 @@ function parseStringifiedQueryField(val) {
|
|
|
1470
1392
|
}
|
|
1471
1393
|
return val;
|
|
1472
1394
|
}
|
|
1473
|
-
var SearchQuery =
|
|
1474
|
-
query:
|
|
1395
|
+
var SearchQuery = import_zod14.z.object({
|
|
1396
|
+
query: import_zod14.z.preprocess(parseStringifiedQueryField, QueryType).openapi({
|
|
1475
1397
|
default: {
|
|
1476
1398
|
type: "and",
|
|
1477
1399
|
clauses: [
|
|
@@ -1491,193 +1413,199 @@ var SearchQuery = import_v4.z.object({
|
|
|
1491
1413
|
]
|
|
1492
1414
|
}
|
|
1493
1415
|
}),
|
|
1494
|
-
limit:
|
|
1495
|
-
offset:
|
|
1496
|
-
sort:
|
|
1416
|
+
limit: import_zod14.z.number().optional().default(100),
|
|
1417
|
+
offset: import_zod14.z.number().optional().default(0),
|
|
1418
|
+
sort: import_zod14.z.preprocess(
|
|
1497
1419
|
parseStringifiedQueryField,
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
field:
|
|
1501
|
-
direction:
|
|
1420
|
+
import_zod14.z.array(
|
|
1421
|
+
import_zod14.z.object({
|
|
1422
|
+
field: import_zod14.z.string(),
|
|
1423
|
+
direction: import_zod14.z.enum(["asc", "desc"]).default("asc")
|
|
1502
1424
|
})
|
|
1503
1425
|
)
|
|
1504
1426
|
).optional()
|
|
1505
|
-
}).
|
|
1506
|
-
|
|
1427
|
+
}).openapi({
|
|
1428
|
+
ref: "SearchQuery"
|
|
1507
1429
|
});
|
|
1508
1430
|
|
|
1509
1431
|
// ../commons/src/events/serializers/date/serializer.ts
|
|
1510
|
-
var
|
|
1511
|
-
var SerializedNowDateTime =
|
|
1512
|
-
$$now:
|
|
1432
|
+
var import_zod15 = require("zod");
|
|
1433
|
+
var SerializedNowDateTime = import_zod15.z.object({
|
|
1434
|
+
$$now: import_zod15.z.literal(true)
|
|
1513
1435
|
});
|
|
1514
1436
|
function todayDateTimeValueSerializer() {
|
|
1515
1437
|
return { $$now: true };
|
|
1516
1438
|
}
|
|
1517
1439
|
|
|
1518
1440
|
// ../commons/src/events/FieldConfig.ts
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1441
|
+
(0, import_zod_openapi6.extendZodWithOpenApi)(import_zod16.z);
|
|
1442
|
+
var FieldId = import_zod16.z.string().refine(
|
|
1443
|
+
/*
|
|
1444
|
+
* Disallow underscores '_' in field ids.
|
|
1445
|
+
* Why? Theres two reasons:
|
|
1446
|
+
* 1. We transform dots to underscores as separator in Formik field ids, so this avoids any issues with the Formik transformations.
|
|
1447
|
+
* 2. On Kysely-SQL queries, we use the CamelCasePlugin. This plugin transforms snake_case to camelCase also on nested (jsonb) object keys.
|
|
1448
|
+
* 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.
|
|
1449
|
+
*/
|
|
1450
|
+
(val) => !val.includes("_"),
|
|
1451
|
+
(val) => ({
|
|
1452
|
+
message: `id: '${val}' must not contain underscores '_'`
|
|
1453
|
+
})
|
|
1454
|
+
).describe("Unique identifier for the field");
|
|
1455
|
+
var FieldReference = import_zod16.z.object({
|
|
1528
1456
|
$$field: FieldId,
|
|
1529
|
-
$$subfield:
|
|
1457
|
+
$$subfield: import_zod16.z.array(import_zod16.z.string()).optional().describe(
|
|
1530
1458
|
'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
|
|
1531
1459
|
)
|
|
1532
1460
|
}).describe("Reference to a field by its ID");
|
|
1533
|
-
var ValidationConfig =
|
|
1461
|
+
var ValidationConfig = import_zod16.z.object({
|
|
1534
1462
|
validator: Conditional,
|
|
1535
1463
|
message: TranslationConfig
|
|
1536
1464
|
});
|
|
1537
|
-
var requiredSchema =
|
|
1538
|
-
|
|
1539
|
-
|
|
1465
|
+
var requiredSchema = import_zod16.z.union([
|
|
1466
|
+
import_zod16.z.boolean(),
|
|
1467
|
+
import_zod16.z.object({
|
|
1540
1468
|
message: TranslationConfig.describe("Custom required validation message")
|
|
1541
1469
|
})
|
|
1542
1470
|
]).default(false).optional();
|
|
1543
|
-
var BaseField =
|
|
1471
|
+
var BaseField = import_zod16.z.object({
|
|
1544
1472
|
id: FieldId.describe("Unique identifier of the field."),
|
|
1545
1473
|
label: TranslationConfig.describe("Human-readable label of the field."),
|
|
1546
|
-
parent: FieldReference.or(
|
|
1474
|
+
parent: FieldReference.or(import_zod16.z.array(FieldReference)).optional().describe(
|
|
1547
1475
|
"Reference to the parent field or fields. When a parent field changes, this field is reset."
|
|
1548
1476
|
),
|
|
1549
1477
|
required: requiredSchema.describe(
|
|
1550
1478
|
"Indicates whether the field is mandatory."
|
|
1551
1479
|
),
|
|
1552
|
-
conditionals:
|
|
1480
|
+
conditionals: import_zod16.z.array(FieldConditional).default([]).optional().describe(
|
|
1553
1481
|
"Conditions determining when the field is shown or enabled. By default, the field is always shown and enabled."
|
|
1554
1482
|
),
|
|
1555
|
-
secured:
|
|
1483
|
+
secured: import_zod16.z.boolean().default(false).optional().describe(
|
|
1556
1484
|
"Indicates whether the field is secured. Secured fields are not indexed for search and are only visible when explicitly assigned."
|
|
1557
1485
|
),
|
|
1558
1486
|
placeholder: TranslationConfig.optional(),
|
|
1559
|
-
validation:
|
|
1487
|
+
validation: import_zod16.z.array(ValidationConfig).default([]).optional().describe("Additional validation rules applied to the field."),
|
|
1560
1488
|
helperText: TranslationConfig.optional(),
|
|
1561
|
-
hideLabel:
|
|
1562
|
-
uncorrectable:
|
|
1489
|
+
hideLabel: import_zod16.z.boolean().default(false).optional(),
|
|
1490
|
+
uncorrectable: import_zod16.z.boolean().default(false).optional().describe(
|
|
1563
1491
|
"Indicates whether the field can be modified during record correction."
|
|
1564
1492
|
),
|
|
1565
|
-
value: FieldReference.or(
|
|
1493
|
+
value: FieldReference.or(import_zod16.z.array(FieldReference)).optional().describe(
|
|
1566
1494
|
"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."
|
|
1567
1495
|
),
|
|
1568
|
-
analytics:
|
|
1496
|
+
analytics: import_zod16.z.boolean().default(false).optional().describe(
|
|
1569
1497
|
"Indicates whether the field is included in analytics. When enabled, its value becomes available in the analytics dashboard."
|
|
1570
1498
|
)
|
|
1571
1499
|
}).describe("Common properties shared across all field types.");
|
|
1572
1500
|
var Divider = BaseField.extend({
|
|
1573
|
-
type:
|
|
1501
|
+
type: import_zod16.z.literal(FieldType.DIVIDER)
|
|
1574
1502
|
});
|
|
1575
1503
|
var TextField = BaseField.extend({
|
|
1576
|
-
type:
|
|
1577
|
-
defaultValue:
|
|
1578
|
-
configuration:
|
|
1579
|
-
maxLength:
|
|
1580
|
-
type:
|
|
1504
|
+
type: import_zod16.z.literal(FieldType.TEXT),
|
|
1505
|
+
defaultValue: import_zod16.z.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1506
|
+
configuration: import_zod16.z.object({
|
|
1507
|
+
maxLength: import_zod16.z.number().optional().describe("Maximum length of the text"),
|
|
1508
|
+
type: import_zod16.z.enum(["text", "password"]).optional(),
|
|
1581
1509
|
prefix: TranslationConfig.optional(),
|
|
1582
1510
|
postfix: TranslationConfig.optional()
|
|
1583
1511
|
}).default({ type: "text" }).optional()
|
|
1584
1512
|
}).describe("Text input");
|
|
1585
1513
|
var NumberField = BaseField.extend({
|
|
1586
|
-
type:
|
|
1514
|
+
type: import_zod16.z.literal(FieldType.NUMBER),
|
|
1587
1515
|
defaultValue: NumberFieldValue.optional(),
|
|
1588
|
-
configuration:
|
|
1589
|
-
min:
|
|
1590
|
-
max:
|
|
1516
|
+
configuration: import_zod16.z.object({
|
|
1517
|
+
min: import_zod16.z.number().optional().describe("Minimum value"),
|
|
1518
|
+
max: import_zod16.z.number().optional().describe("Maximum value"),
|
|
1591
1519
|
prefix: TranslationConfig.optional(),
|
|
1592
1520
|
postfix: TranslationConfig.optional()
|
|
1593
1521
|
}).optional()
|
|
1594
1522
|
}).describe("Number input");
|
|
1595
1523
|
var TextAreaField = BaseField.extend({
|
|
1596
|
-
type:
|
|
1524
|
+
type: import_zod16.z.literal(FieldType.TEXTAREA),
|
|
1597
1525
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1598
|
-
configuration:
|
|
1599
|
-
maxLength:
|
|
1600
|
-
rows:
|
|
1601
|
-
cols:
|
|
1526
|
+
configuration: import_zod16.z.object({
|
|
1527
|
+
maxLength: import_zod16.z.number().optional().describe("Maximum length of the text"),
|
|
1528
|
+
rows: import_zod16.z.number().optional().describe("Number of visible text lines"),
|
|
1529
|
+
cols: import_zod16.z.number().optional().describe("Number of visible columns"),
|
|
1602
1530
|
prefix: TranslationConfig.optional(),
|
|
1603
1531
|
postfix: TranslationConfig.optional()
|
|
1604
1532
|
}).default({ rows: 4 }).optional()
|
|
1605
1533
|
}).describe("Multiline text input");
|
|
1606
|
-
var ImageMimeType =
|
|
1534
|
+
var ImageMimeType = import_zod16.z.enum([
|
|
1607
1535
|
"image/png",
|
|
1608
1536
|
"image/jpg",
|
|
1609
1537
|
"image/jpeg",
|
|
1610
1538
|
"image/svg+xml"
|
|
1611
1539
|
]);
|
|
1612
|
-
var DocumentMimeType =
|
|
1540
|
+
var DocumentMimeType = import_zod16.z.enum([
|
|
1613
1541
|
"application/pdf",
|
|
1614
1542
|
"application/msword",
|
|
1615
1543
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
1616
1544
|
"application/vnd.oasis.opendocument.text"
|
|
1617
1545
|
]);
|
|
1618
|
-
var MimeType =
|
|
1546
|
+
var MimeType = import_zod16.z.enum([
|
|
1619
1547
|
...ImageMimeType.options,
|
|
1620
1548
|
...DocumentMimeType.options
|
|
1621
1549
|
]);
|
|
1622
1550
|
var DEFAULT_MAX_FILE_SIZE_BYTES = 5 * 1024 * 1024;
|
|
1623
1551
|
var SignatureField = BaseField.extend({
|
|
1624
|
-
type:
|
|
1552
|
+
type: import_zod16.z.literal(FieldType.SIGNATURE),
|
|
1625
1553
|
signaturePromptLabel: TranslationConfig.describe(
|
|
1626
1554
|
"Title of the signature modal"
|
|
1627
1555
|
),
|
|
1628
1556
|
defaultValue: SignatureFieldValue.optional(),
|
|
1629
|
-
configuration:
|
|
1630
|
-
maxFileSize:
|
|
1557
|
+
configuration: import_zod16.z.object({
|
|
1558
|
+
maxFileSize: import_zod16.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1631
1559
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
|
1632
1560
|
}).default({
|
|
1633
1561
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1634
1562
|
})
|
|
1635
1563
|
}).describe("Signature input field");
|
|
1636
1564
|
var EmailField = BaseField.extend({
|
|
1637
|
-
type:
|
|
1638
|
-
configuration:
|
|
1639
|
-
maxLength:
|
|
1640
|
-
}).default({ maxLength:
|
|
1565
|
+
type: import_zod16.z.literal(FieldType.EMAIL),
|
|
1566
|
+
configuration: import_zod16.z.object({
|
|
1567
|
+
maxLength: import_zod16.z.number().optional().describe("Maximum length of the text")
|
|
1568
|
+
}).default({ maxLength: 10 }).optional(),
|
|
1641
1569
|
defaultValue: NonEmptyTextValue.optional()
|
|
1642
1570
|
});
|
|
1643
1571
|
var DateField = BaseField.extend({
|
|
1644
|
-
type:
|
|
1645
|
-
defaultValue: SerializedNowDateTime.or(DateValue).optional().describe("Default date value(yyyy-MM-dd)"),
|
|
1646
|
-
configuration:
|
|
1572
|
+
type: import_zod16.z.literal(FieldType.DATE),
|
|
1573
|
+
defaultValue: SerializedNowDateTime.or(DateValue).optional().openapi({ effectType: "input", type: "string" }).describe("Default date value(yyyy-MM-dd)"),
|
|
1574
|
+
configuration: import_zod16.z.object({
|
|
1647
1575
|
notice: TranslationConfig.describe(
|
|
1648
1576
|
"Text to display above the date input"
|
|
1649
1577
|
).optional()
|
|
1650
1578
|
}).optional()
|
|
1651
1579
|
}).describe("A single date input (yyyy-MM-dd)");
|
|
1652
1580
|
var AgeField = BaseField.extend({
|
|
1653
|
-
type:
|
|
1581
|
+
type: import_zod16.z.literal(FieldType.AGE),
|
|
1654
1582
|
defaultValue: NumberFieldValue.optional(),
|
|
1655
|
-
configuration:
|
|
1583
|
+
configuration: import_zod16.z.object({
|
|
1656
1584
|
asOfDate: FieldReference,
|
|
1657
1585
|
prefix: TranslationConfig.optional(),
|
|
1658
1586
|
postfix: TranslationConfig.optional()
|
|
1659
1587
|
})
|
|
1660
1588
|
}).describe("An age input field which uses the current date as the asOfDate");
|
|
1661
1589
|
var TimeField = BaseField.extend({
|
|
1662
|
-
type:
|
|
1663
|
-
defaultValue: SerializedNowDateTime.or(TimeValue).optional().describe("Default time value (HH-mm)"),
|
|
1664
|
-
configuration:
|
|
1665
|
-
use12HourFormat:
|
|
1590
|
+
type: import_zod16.z.literal(FieldType.TIME),
|
|
1591
|
+
defaultValue: SerializedNowDateTime.or(TimeValue).optional().openapi({ effectType: "input", type: "object" }).describe("Default time value (HH-mm)"),
|
|
1592
|
+
configuration: import_zod16.z.object({
|
|
1593
|
+
use12HourFormat: import_zod16.z.boolean().optional().describe("Whether to use 12-hour format"),
|
|
1666
1594
|
notice: TranslationConfig.describe(
|
|
1667
1595
|
"Text to display above the time input"
|
|
1668
1596
|
).optional()
|
|
1669
1597
|
}).optional()
|
|
1670
1598
|
}).describe("A single date input (HH-mm)");
|
|
1671
1599
|
var DateRangeField = BaseField.extend({
|
|
1672
|
-
type:
|
|
1600
|
+
type: import_zod16.z.literal(FieldType.DATE_RANGE),
|
|
1673
1601
|
defaultValue: DateRangeFieldValue.optional(),
|
|
1674
|
-
configuration:
|
|
1602
|
+
configuration: import_zod16.z.object({
|
|
1675
1603
|
notice: TranslationConfig.describe(
|
|
1676
1604
|
"Text to display above the date input"
|
|
1677
1605
|
).optional()
|
|
1678
1606
|
}).optional()
|
|
1679
1607
|
}).describe("A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })");
|
|
1680
|
-
var HtmlFontVariant =
|
|
1608
|
+
var HtmlFontVariant = import_zod16.z.enum([
|
|
1681
1609
|
"reg12",
|
|
1682
1610
|
"reg14",
|
|
1683
1611
|
"reg16",
|
|
@@ -1687,38 +1615,34 @@ var HtmlFontVariant = z17.enum([
|
|
|
1687
1615
|
"h2",
|
|
1688
1616
|
"h1"
|
|
1689
1617
|
]);
|
|
1690
|
-
var
|
|
1691
|
-
|
|
1692
|
-
styles: z17.object({
|
|
1618
|
+
var ParagraphConfiguration = import_zod16.z.object({
|
|
1619
|
+
styles: import_zod16.z.object({
|
|
1693
1620
|
fontVariant: HtmlFontVariant.optional().describe(
|
|
1694
1621
|
"Font variant to use for the paragraph text"
|
|
1695
1622
|
),
|
|
1696
|
-
hint:
|
|
1697
|
-
textAlign: ParagraphTextAlign.optional().describe(
|
|
1698
|
-
"Text alignment for the paragraph"
|
|
1699
|
-
)
|
|
1623
|
+
hint: import_zod16.z.boolean().optional().describe("When true, paragraph is styled as a hint with grey color")
|
|
1700
1624
|
}).optional()
|
|
1701
1625
|
}).default({});
|
|
1702
1626
|
var Paragraph = BaseField.extend({
|
|
1703
|
-
type:
|
|
1627
|
+
type: import_zod16.z.literal(FieldType.PARAGRAPH),
|
|
1704
1628
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1705
1629
|
configuration: ParagraphConfiguration
|
|
1706
1630
|
}).describe("A read-only HTML <p> paragraph");
|
|
1707
1631
|
var PageHeader = BaseField.extend({
|
|
1708
|
-
type:
|
|
1632
|
+
type: import_zod16.z.literal(FieldType.PAGE_HEADER),
|
|
1709
1633
|
defaultValue: NonEmptyTextValue.optional()
|
|
1710
1634
|
}).describe("A read-only header component for form pages");
|
|
1711
1635
|
var File = BaseField.extend({
|
|
1712
|
-
type:
|
|
1636
|
+
type: import_zod16.z.literal(FieldType.FILE),
|
|
1713
1637
|
defaultValue: FileFieldValue.optional(),
|
|
1714
|
-
configuration:
|
|
1715
|
-
maxFileSize:
|
|
1638
|
+
configuration: import_zod16.z.object({
|
|
1639
|
+
maxFileSize: import_zod16.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1716
1640
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature"),
|
|
1717
|
-
maxImageSize:
|
|
1718
|
-
targetSize:
|
|
1641
|
+
maxImageSize: import_zod16.z.object({
|
|
1642
|
+
targetSize: import_zod16.z.object({ width: import_zod16.z.number(), height: import_zod16.z.number() })
|
|
1719
1643
|
}).optional(),
|
|
1720
|
-
style:
|
|
1721
|
-
width:
|
|
1644
|
+
style: import_zod16.z.object({
|
|
1645
|
+
width: import_zod16.z.enum(["full", "auto"]).optional().describe(
|
|
1722
1646
|
"Whether the file upload button should take the full width of the container or not"
|
|
1723
1647
|
)
|
|
1724
1648
|
}).optional(),
|
|
@@ -1727,46 +1651,46 @@ var File = BaseField.extend({
|
|
|
1727
1651
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1728
1652
|
})
|
|
1729
1653
|
}).describe("File upload");
|
|
1730
|
-
var SelectOption =
|
|
1731
|
-
value:
|
|
1732
|
-
label:
|
|
1654
|
+
var SelectOption = import_zod16.z.object({
|
|
1655
|
+
value: import_zod16.z.string().describe("The value of the option"),
|
|
1656
|
+
label: import_zod16.z.union([import_zod16.z.string(), TranslationConfig]).describe("The label of the option")
|
|
1733
1657
|
});
|
|
1734
1658
|
var NumberWithUnitField = BaseField.extend({
|
|
1735
|
-
type:
|
|
1659
|
+
type: import_zod16.z.literal(FieldType.NUMBER_WITH_UNIT),
|
|
1736
1660
|
defaultValue: NumberWithUnitFieldValue.optional(),
|
|
1737
|
-
options:
|
|
1738
|
-
configuration:
|
|
1739
|
-
min:
|
|
1740
|
-
max:
|
|
1661
|
+
options: import_zod16.z.array(SelectOption).describe("A list of options for the unit select"),
|
|
1662
|
+
configuration: import_zod16.z.object({
|
|
1663
|
+
min: import_zod16.z.number().optional().describe("Minimum value of the number field"),
|
|
1664
|
+
max: import_zod16.z.number().optional().describe("Maximum value of the number field"),
|
|
1741
1665
|
numberFieldPlaceholder: TranslationConfig.optional().describe(
|
|
1742
1666
|
"Placeholder for the number field"
|
|
1743
1667
|
)
|
|
1744
1668
|
}).optional()
|
|
1745
1669
|
}).describe("Number with unit input");
|
|
1746
1670
|
var RadioGroup = BaseField.extend({
|
|
1747
|
-
type:
|
|
1671
|
+
type: import_zod16.z.literal(FieldType.RADIO_GROUP),
|
|
1748
1672
|
defaultValue: TextValue.optional(),
|
|
1749
|
-
options:
|
|
1750
|
-
configuration:
|
|
1751
|
-
styles:
|
|
1752
|
-
size:
|
|
1673
|
+
options: import_zod16.z.array(SelectOption).describe("A list of options"),
|
|
1674
|
+
configuration: import_zod16.z.object({
|
|
1675
|
+
styles: import_zod16.z.object({
|
|
1676
|
+
size: import_zod16.z.enum(["NORMAL", "LARGE"]).optional()
|
|
1753
1677
|
}).optional()
|
|
1754
1678
|
}).optional()
|
|
1755
1679
|
}).describe("Grouped radio options");
|
|
1756
1680
|
var BulletList = BaseField.extend({
|
|
1757
|
-
type:
|
|
1681
|
+
type: import_zod16.z.literal(FieldType.BULLET_LIST),
|
|
1758
1682
|
defaultValue: TextValue.optional(),
|
|
1759
|
-
items:
|
|
1760
|
-
configuration:
|
|
1761
|
-
styles:
|
|
1683
|
+
items: import_zod16.z.array(TranslationConfig).describe("A list of items"),
|
|
1684
|
+
configuration: import_zod16.z.object({
|
|
1685
|
+
styles: import_zod16.z.object({
|
|
1762
1686
|
fontVariant: HtmlFontVariant.optional()
|
|
1763
1687
|
}).optional()
|
|
1764
1688
|
}).default({})
|
|
1765
1689
|
}).describe("A list of bullet points");
|
|
1766
1690
|
var Select = BaseField.extend({
|
|
1767
|
-
type:
|
|
1691
|
+
type: import_zod16.z.literal(FieldType.SELECT),
|
|
1768
1692
|
defaultValue: TextValue.optional(),
|
|
1769
|
-
options:
|
|
1693
|
+
options: import_zod16.z.array(SelectOption).describe("A list of options"),
|
|
1770
1694
|
noOptionsMessage: TranslationConfig.optional().describe(
|
|
1771
1695
|
`
|
|
1772
1696
|
A translation configuration object used to display a message when no options are available.
|
|
@@ -1778,34 +1702,34 @@ var Select = BaseField.extend({
|
|
|
1778
1702
|
`
|
|
1779
1703
|
)
|
|
1780
1704
|
}).describe("Select input");
|
|
1781
|
-
var SelectDateRangeOption =
|
|
1705
|
+
var SelectDateRangeOption = import_zod16.z.object({
|
|
1782
1706
|
value: SelectDateRangeValue.describe("The value of the option"),
|
|
1783
1707
|
label: TranslationConfig.describe("The label of the option")
|
|
1784
1708
|
});
|
|
1785
1709
|
var SelectDateRangeField = BaseField.extend({
|
|
1786
|
-
type:
|
|
1710
|
+
type: import_zod16.z.literal(FieldType.SELECT_DATE_RANGE),
|
|
1787
1711
|
defaultValue: SelectDateRangeValue.optional(),
|
|
1788
|
-
options:
|
|
1712
|
+
options: import_zod16.z.array(SelectDateRangeOption).describe("A list of options")
|
|
1789
1713
|
}).describe("Select input with date range options");
|
|
1790
|
-
var NameConfig =
|
|
1791
|
-
firstname:
|
|
1792
|
-
middlename:
|
|
1793
|
-
surname:
|
|
1714
|
+
var NameConfig = import_zod16.z.object({
|
|
1715
|
+
firstname: import_zod16.z.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
1716
|
+
middlename: import_zod16.z.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
1717
|
+
surname: import_zod16.z.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional()
|
|
1794
1718
|
});
|
|
1795
1719
|
var NameField = BaseField.extend({
|
|
1796
|
-
type:
|
|
1797
|
-
defaultValue:
|
|
1720
|
+
type: import_zod16.z.literal(FieldType.NAME),
|
|
1721
|
+
defaultValue: import_zod16.z.object({
|
|
1798
1722
|
firstname: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
1799
1723
|
middlename: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
1800
1724
|
surname: SerializedUserField.or(NonEmptyTextValue).optional()
|
|
1801
1725
|
}).optional(),
|
|
1802
|
-
configuration:
|
|
1726
|
+
configuration: import_zod16.z.object({
|
|
1803
1727
|
name: NameConfig.default({
|
|
1804
1728
|
firstname: { required: true },
|
|
1805
1729
|
surname: { required: true }
|
|
1806
1730
|
}).optional(),
|
|
1807
|
-
order:
|
|
1808
|
-
maxLength:
|
|
1731
|
+
order: import_zod16.z.array(import_zod16.z.enum(["firstname", "middlename", "surname"])).optional(),
|
|
1732
|
+
maxLength: import_zod16.z.number().optional().describe("Maximum length of the text"),
|
|
1809
1733
|
prefix: TranslationConfig.optional(),
|
|
1810
1734
|
postfix: TranslationConfig.optional()
|
|
1811
1735
|
}).default({
|
|
@@ -1817,51 +1741,51 @@ var NameField = BaseField.extend({
|
|
|
1817
1741
|
}).describe("Name input field");
|
|
1818
1742
|
var PhoneField = BaseField.extend({
|
|
1819
1743
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1820
|
-
type:
|
|
1744
|
+
type: import_zod16.z.literal(FieldType.PHONE)
|
|
1821
1745
|
}).describe("Phone input field");
|
|
1822
1746
|
var IdField = BaseField.extend({
|
|
1823
1747
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1824
|
-
type:
|
|
1748
|
+
type: import_zod16.z.literal(FieldType.ID)
|
|
1825
1749
|
}).describe("ID input field");
|
|
1826
1750
|
var Checkbox = BaseField.extend({
|
|
1827
|
-
type:
|
|
1751
|
+
type: import_zod16.z.literal(FieldType.CHECKBOX),
|
|
1828
1752
|
defaultValue: CheckboxFieldValue.default(false)
|
|
1829
1753
|
}).describe("Boolean checkbox field");
|
|
1830
1754
|
var Country = BaseField.extend({
|
|
1831
|
-
type:
|
|
1755
|
+
type: import_zod16.z.literal(FieldType.COUNTRY),
|
|
1832
1756
|
defaultValue: NonEmptyTextValue.optional()
|
|
1833
1757
|
}).describe("Country select field");
|
|
1834
|
-
var AdministrativeAreas =
|
|
1758
|
+
var AdministrativeAreas = import_zod16.z.enum([
|
|
1835
1759
|
"ADMIN_STRUCTURE",
|
|
1836
1760
|
"HEALTH_FACILITY",
|
|
1837
1761
|
"CRVS_OFFICE"
|
|
1838
1762
|
]);
|
|
1839
|
-
var AdministrativeAreaConfiguration =
|
|
1840
|
-
partOf:
|
|
1841
|
-
$declaration:
|
|
1763
|
+
var AdministrativeAreaConfiguration = import_zod16.z.object({
|
|
1764
|
+
partOf: import_zod16.z.object({
|
|
1765
|
+
$declaration: import_zod16.z.string()
|
|
1842
1766
|
}).optional().describe("Parent location"),
|
|
1843
1767
|
type: AdministrativeAreas
|
|
1844
1768
|
}).describe("Administrative area options");
|
|
1845
|
-
var
|
|
1846
|
-
type:
|
|
1769
|
+
var AdministrativeArea = BaseField.extend({
|
|
1770
|
+
type: import_zod16.z.literal(FieldType.ADMINISTRATIVE_AREA),
|
|
1847
1771
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1848
1772
|
configuration: AdministrativeAreaConfiguration
|
|
1849
1773
|
}).describe("Administrative area input field e.g. facility, office");
|
|
1850
1774
|
var LocationInput = BaseField.extend({
|
|
1851
|
-
type:
|
|
1775
|
+
type: import_zod16.z.literal(FieldType.LOCATION),
|
|
1852
1776
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1853
|
-
configuration:
|
|
1854
|
-
searchableResource:
|
|
1777
|
+
configuration: import_zod16.z.object({
|
|
1778
|
+
searchableResource: import_zod16.z.array(import_zod16.z.enum(["locations", "facilities", "offices"]))
|
|
1855
1779
|
})
|
|
1856
1780
|
}).describe("Input field for a location");
|
|
1857
1781
|
var FileUploadWithOptions = BaseField.extend({
|
|
1858
|
-
type:
|
|
1859
|
-
options:
|
|
1782
|
+
type: import_zod16.z.literal(FieldType.FILE_WITH_OPTIONS),
|
|
1783
|
+
options: import_zod16.z.array(SelectOption).describe("A list of options"),
|
|
1860
1784
|
defaultValue: FileFieldWithOptionValue.optional(),
|
|
1861
|
-
configuration:
|
|
1862
|
-
maxFileSize:
|
|
1863
|
-
maxImageSize:
|
|
1864
|
-
targetSize:
|
|
1785
|
+
configuration: import_zod16.z.object({
|
|
1786
|
+
maxFileSize: import_zod16.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1787
|
+
maxImageSize: import_zod16.z.object({
|
|
1788
|
+
targetSize: import_zod16.z.object({ width: import_zod16.z.number(), height: import_zod16.z.number() })
|
|
1865
1789
|
}).optional(),
|
|
1866
1790
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
|
1867
1791
|
}).default({
|
|
@@ -1869,93 +1793,93 @@ var FileUploadWithOptions = BaseField.extend({
|
|
|
1869
1793
|
})
|
|
1870
1794
|
});
|
|
1871
1795
|
var Facility = BaseField.extend({
|
|
1872
|
-
type:
|
|
1796
|
+
type: import_zod16.z.literal(FieldType.FACILITY),
|
|
1873
1797
|
defaultValue: NonEmptyTextValue.optional()
|
|
1874
1798
|
}).describe("Input field for a facility");
|
|
1875
1799
|
var Office = BaseField.extend({
|
|
1876
|
-
type:
|
|
1800
|
+
type: import_zod16.z.literal(FieldType.OFFICE),
|
|
1877
1801
|
defaultValue: NonEmptyTextValue.optional()
|
|
1878
1802
|
}).describe("Input field for an office");
|
|
1879
1803
|
var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
|
|
1880
|
-
administrativeArea:
|
|
1804
|
+
administrativeArea: import_zod16.z.union([UUID, SerializedUserField]).optional()
|
|
1881
1805
|
});
|
|
1882
1806
|
var Address = BaseField.extend({
|
|
1883
|
-
type:
|
|
1884
|
-
configuration:
|
|
1885
|
-
lineSeparator:
|
|
1886
|
-
fields:
|
|
1887
|
-
administrativeLevels:
|
|
1888
|
-
streetAddressForm:
|
|
1889
|
-
|
|
1890
|
-
id:
|
|
1807
|
+
type: import_zod16.z.literal(FieldType.ADDRESS),
|
|
1808
|
+
configuration: import_zod16.z.object({
|
|
1809
|
+
lineSeparator: import_zod16.z.string().optional(),
|
|
1810
|
+
fields: import_zod16.z.array(import_zod16.z.enum(["country", "administrativeArea"])).optional(),
|
|
1811
|
+
administrativeLevels: import_zod16.z.array(import_zod16.z.string()).optional(),
|
|
1812
|
+
streetAddressForm: import_zod16.z.array(
|
|
1813
|
+
import_zod16.z.object({
|
|
1814
|
+
id: import_zod16.z.string(),
|
|
1891
1815
|
required: requiredSchema,
|
|
1892
1816
|
label: TranslationConfig,
|
|
1893
|
-
type:
|
|
1894
|
-
conditionals:
|
|
1817
|
+
type: import_zod16.z.literal(FieldType.TEXT),
|
|
1818
|
+
conditionals: import_zod16.z.array(FieldConditional).default([]).optional(),
|
|
1895
1819
|
parent: FieldReference.optional()
|
|
1896
1820
|
})
|
|
1897
1821
|
).optional()
|
|
1898
1822
|
}).optional(),
|
|
1899
1823
|
defaultValue: DefaultAddressFieldValue.optional()
|
|
1900
1824
|
}).describe("Address input field \u2013 a combination of location and text fields");
|
|
1901
|
-
var StaticDataEntry =
|
|
1902
|
-
id:
|
|
1825
|
+
var StaticDataEntry = import_zod16.z.object({
|
|
1826
|
+
id: import_zod16.z.string().describe("ID for the data entry."),
|
|
1903
1827
|
label: TranslationConfig,
|
|
1904
|
-
value: TranslationConfig.or(
|
|
1828
|
+
value: TranslationConfig.or(import_zod16.z.string()).or(FieldReference)
|
|
1905
1829
|
}).describe("Static data entry");
|
|
1906
|
-
var DataEntry =
|
|
1830
|
+
var DataEntry = import_zod16.z.union([StaticDataEntry, import_zod16.z.object({ fieldId: import_zod16.z.string() })]).describe(
|
|
1907
1831
|
"Data entry can be either a static data entry, or a reference to another field in the current form or the declaration."
|
|
1908
1832
|
);
|
|
1909
1833
|
var DataField = BaseField.extend({
|
|
1910
|
-
type:
|
|
1911
|
-
configuration:
|
|
1834
|
+
type: import_zod16.z.literal(FieldType.DATA),
|
|
1835
|
+
configuration: import_zod16.z.object({
|
|
1912
1836
|
subtitle: TranslationConfig.optional(),
|
|
1913
|
-
data:
|
|
1837
|
+
data: import_zod16.z.array(DataEntry)
|
|
1914
1838
|
})
|
|
1915
1839
|
}).describe("Data field for displaying read-only data");
|
|
1916
1840
|
var ButtonField = BaseField.extend({
|
|
1917
|
-
type:
|
|
1841
|
+
type: import_zod16.z.literal(FieldType.BUTTON),
|
|
1918
1842
|
defaultValue: ButtonFieldValue.optional(),
|
|
1919
|
-
configuration:
|
|
1920
|
-
icon:
|
|
1843
|
+
configuration: import_zod16.z.object({
|
|
1844
|
+
icon: import_zod16.z.string().optional().describe(
|
|
1921
1845
|
"Icon for the button. You can find icons from OpenCRVS UI-Kit."
|
|
1922
1846
|
),
|
|
1923
|
-
loading:
|
|
1847
|
+
loading: import_zod16.z.boolean().optional().describe("Whether the button is in a loading state and shows a spinner"),
|
|
1924
1848
|
text: TranslationConfig.describe("Text to display on the button")
|
|
1925
1849
|
})
|
|
1926
1850
|
}).describe("Generic button without any built-in functionality");
|
|
1927
1851
|
var AlphaPrintButton = BaseField.extend({
|
|
1928
|
-
type:
|
|
1929
|
-
configuration:
|
|
1930
|
-
template:
|
|
1852
|
+
type: import_zod16.z.literal(FieldType.ALPHA_PRINT_BUTTON),
|
|
1853
|
+
configuration: import_zod16.z.object({
|
|
1854
|
+
template: import_zod16.z.string().describe("Template ID from countryconfig templates to use for printing"),
|
|
1931
1855
|
buttonLabel: TranslationConfig.optional().describe(
|
|
1932
1856
|
"Label for the print button"
|
|
1933
1857
|
)
|
|
1934
1858
|
})
|
|
1935
1859
|
}).describe("Print button field for printing certificates");
|
|
1936
1860
|
var HttpField = BaseField.extend({
|
|
1937
|
-
type:
|
|
1861
|
+
type: import_zod16.z.literal(FieldType.HTTP),
|
|
1938
1862
|
defaultValue: HttpFieldValue.optional(),
|
|
1939
|
-
configuration:
|
|
1863
|
+
configuration: import_zod16.z.object({
|
|
1940
1864
|
trigger: FieldReference,
|
|
1941
|
-
url:
|
|
1942
|
-
method:
|
|
1943
|
-
headers:
|
|
1944
|
-
body:
|
|
1945
|
-
errorValue:
|
|
1946
|
-
params:
|
|
1947
|
-
timeout:
|
|
1865
|
+
url: import_zod16.z.string().describe("URL to send the HTTP request to"),
|
|
1866
|
+
method: import_zod16.z.enum(["GET", "POST", "PUT", "DELETE"]),
|
|
1867
|
+
headers: import_zod16.z.record(import_zod16.z.string()).optional(),
|
|
1868
|
+
body: import_zod16.z.record(import_zod16.z.any()).optional(),
|
|
1869
|
+
errorValue: import_zod16.z.any().optional().describe("Value to set if the request fails"),
|
|
1870
|
+
params: import_zod16.z.record(import_zod16.z.string(), import_zod16.z.union([import_zod16.z.string(), FieldReference])).optional(),
|
|
1871
|
+
timeout: import_zod16.z.number().default(15e3).describe("Request timeout in milliseconds")
|
|
1948
1872
|
})
|
|
1949
1873
|
}).describe("HTTP request function triggered by a button click or other event");
|
|
1950
1874
|
var SearchField = HttpField.extend({
|
|
1951
|
-
type:
|
|
1875
|
+
type: import_zod16.z.literal(FieldType.SEARCH),
|
|
1952
1876
|
configuration: SearchQuery.pick({
|
|
1953
1877
|
query: true,
|
|
1954
1878
|
limit: true,
|
|
1955
1879
|
offset: true
|
|
1956
1880
|
}).extend({
|
|
1957
1881
|
validation: ValidationConfig,
|
|
1958
|
-
indicators:
|
|
1882
|
+
indicators: import_zod16.z.object({
|
|
1959
1883
|
loading: TranslationConfig.optional().describe(
|
|
1960
1884
|
"Text to display while the search is in progress"
|
|
1961
1885
|
),
|
|
@@ -1970,7 +1894,7 @@ var SearchField = HttpField.extend({
|
|
|
1970
1894
|
),
|
|
1971
1895
|
confirmButton: TranslationConfig.optional(),
|
|
1972
1896
|
clearButton: TranslationConfig.optional(),
|
|
1973
|
-
clearModal:
|
|
1897
|
+
clearModal: import_zod16.z.object({
|
|
1974
1898
|
title: TranslationConfig.optional(),
|
|
1975
1899
|
description: TranslationConfig.optional(),
|
|
1976
1900
|
cancel: TranslationConfig.optional(),
|
|
@@ -1981,17 +1905,17 @@ var SearchField = HttpField.extend({
|
|
|
1981
1905
|
})
|
|
1982
1906
|
});
|
|
1983
1907
|
var LinkButtonField = BaseField.extend({
|
|
1984
|
-
type:
|
|
1985
|
-
configuration:
|
|
1986
|
-
url:
|
|
1908
|
+
type: import_zod16.z.literal(FieldType.LINK_BUTTON),
|
|
1909
|
+
configuration: import_zod16.z.object({
|
|
1910
|
+
url: import_zod16.z.string().describe("URL to open"),
|
|
1987
1911
|
text: TranslationConfig.describe("Text to display on the button"),
|
|
1988
|
-
icon:
|
|
1912
|
+
icon: import_zod16.z.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit.")
|
|
1989
1913
|
})
|
|
1990
1914
|
}).describe("Button that opens a link");
|
|
1991
1915
|
var VerificationStatus = BaseField.extend({
|
|
1992
|
-
type:
|
|
1916
|
+
type: import_zod16.z.literal(FieldType.VERIFICATION_STATUS),
|
|
1993
1917
|
defaultValue: VerificationStatusValue.optional(),
|
|
1994
|
-
configuration:
|
|
1918
|
+
configuration: import_zod16.z.object({
|
|
1995
1919
|
status: TranslationConfig.describe("Text to display on the status pill."),
|
|
1996
1920
|
description: TranslationConfig.describe(
|
|
1997
1921
|
"Explaining text on the banner in form."
|
|
@@ -1999,55 +1923,38 @@ var VerificationStatus = BaseField.extend({
|
|
|
1999
1923
|
})
|
|
2000
1924
|
});
|
|
2001
1925
|
var QueryParamReaderField = BaseField.extend({
|
|
2002
|
-
type:
|
|
2003
|
-
configuration:
|
|
2004
|
-
pickParams:
|
|
1926
|
+
type: import_zod16.z.literal(FieldType.QUERY_PARAM_READER),
|
|
1927
|
+
configuration: import_zod16.z.object({
|
|
1928
|
+
pickParams: import_zod16.z.array(import_zod16.z.string()).describe("List of query parameters to read from the URL")
|
|
2005
1929
|
})
|
|
2006
1930
|
}).describe(
|
|
2007
1931
|
"A field that maps URL query params into form values and clears them afterward"
|
|
2008
1932
|
);
|
|
2009
1933
|
var QrReaderField = BaseField.extend({
|
|
2010
|
-
type:
|
|
1934
|
+
type: import_zod16.z.literal(FieldType.QR_READER),
|
|
2011
1935
|
defaultValue: QrReaderFieldValue.optional(),
|
|
2012
|
-
configuration:
|
|
2013
|
-
validator:
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
})
|
|
1936
|
+
configuration: import_zod16.z.object({
|
|
1937
|
+
validator: import_zod16.z.custom(
|
|
1938
|
+
(val) => typeof val === "object" && val !== null
|
|
1939
|
+
)
|
|
2017
1940
|
}).optional()
|
|
2018
|
-
}).meta({
|
|
2019
|
-
description: "Configuration for QR code reader field, including optional JSON Schema validator.",
|
|
2020
|
-
id: "QrReaderField"
|
|
2021
1941
|
});
|
|
2022
1942
|
var IdReaderField = BaseField.extend({
|
|
2023
|
-
type:
|
|
1943
|
+
type: import_zod16.z.literal(FieldType.ID_READER),
|
|
2024
1944
|
defaultValue: IdReaderFieldValue.optional(),
|
|
2025
|
-
methods:
|
|
2026
|
-
|
|
1945
|
+
methods: import_zod16.z.array(
|
|
1946
|
+
import_zod16.z.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
|
|
2027
1947
|
)
|
|
2028
1948
|
});
|
|
2029
|
-
var CustomField = BaseField.extend({
|
|
2030
|
-
type: z17.literal(FieldType._EXPERIMENTAL_CUSTOM),
|
|
2031
|
-
defaultValue: CustomFieldValue.optional(),
|
|
2032
|
-
src: z17.string().describe("Module source path for the custom field component"),
|
|
2033
|
-
configuration: z17.unknown().optional()
|
|
2034
|
-
});
|
|
2035
1949
|
var LoaderField = BaseField.extend({
|
|
2036
|
-
type:
|
|
2037
|
-
configuration:
|
|
1950
|
+
type: import_zod16.z.literal(FieldType.LOADER),
|
|
1951
|
+
configuration: import_zod16.z.object({
|
|
2038
1952
|
text: TranslationConfig.describe("Display text above the loading spinner")
|
|
2039
1953
|
})
|
|
2040
1954
|
}).describe(
|
|
2041
1955
|
"A non-interactive field that indicates an in progress operation in form"
|
|
2042
1956
|
);
|
|
2043
|
-
var
|
|
2044
|
-
type: z17.literal(FieldType.ALPHA_HIDDEN),
|
|
2045
|
-
required: z17.boolean().default(false).optional(),
|
|
2046
|
-
defaultValue: TextValue.optional()
|
|
2047
|
-
}).describe(
|
|
2048
|
-
"A non-interactive, hidden field that only hold a value in the form"
|
|
2049
|
-
);
|
|
2050
|
-
var FieldConfig = z17.discriminatedUnion("type", [
|
|
1957
|
+
var FieldConfig = import_zod16.z.discriminatedUnion("type", [
|
|
2051
1958
|
Address,
|
|
2052
1959
|
TextField,
|
|
2053
1960
|
NumberField,
|
|
@@ -2069,7 +1976,7 @@ var FieldConfig = z17.discriminatedUnion("type", [
|
|
|
2069
1976
|
Checkbox,
|
|
2070
1977
|
File,
|
|
2071
1978
|
Country,
|
|
2072
|
-
|
|
1979
|
+
AdministrativeArea,
|
|
2073
1980
|
Divider,
|
|
2074
1981
|
LocationInput,
|
|
2075
1982
|
Facility,
|
|
@@ -2087,81 +1994,83 @@ var FieldConfig = z17.discriminatedUnion("type", [
|
|
|
2087
1994
|
IdReaderField,
|
|
2088
1995
|
QueryParamReaderField,
|
|
2089
1996
|
LoaderField,
|
|
2090
|
-
SearchField
|
|
2091
|
-
|
|
2092
|
-
HiddenField
|
|
2093
|
-
]).meta({
|
|
1997
|
+
SearchField
|
|
1998
|
+
]).openapi({
|
|
2094
1999
|
description: "Form field configuration",
|
|
2095
|
-
|
|
2000
|
+
ref: "FieldConfig"
|
|
2096
2001
|
});
|
|
2097
|
-
var AnyFileField =
|
|
2002
|
+
var AnyFileField = import_zod16.z.discriminatedUnion("type", [
|
|
2098
2003
|
SignatureField,
|
|
2099
2004
|
File,
|
|
2100
2005
|
FileUploadWithOptions
|
|
2101
2006
|
]);
|
|
2102
2007
|
|
|
2103
2008
|
// ../commons/src/events/FormConfig.ts
|
|
2104
|
-
var
|
|
2009
|
+
var import_zod18 = require("zod");
|
|
2105
2010
|
|
|
2106
2011
|
// ../commons/src/events/PageConfig.ts
|
|
2107
|
-
var
|
|
2108
|
-
var
|
|
2109
|
-
|
|
2110
|
-
|
|
2012
|
+
var import_zod17 = require("zod");
|
|
2013
|
+
var import_zod_openapi7 = require("zod-openapi");
|
|
2014
|
+
(0, import_zod_openapi7.extendZodWithOpenApi)(import_zod17.z);
|
|
2015
|
+
var PageTypes = import_zod17.z.enum(["FORM", "VERIFICATION"]);
|
|
2016
|
+
var PageConfigBase = import_zod17.z.object({
|
|
2017
|
+
id: import_zod17.z.string().describe("Unique identifier for the page"),
|
|
2111
2018
|
title: TranslationConfig.describe("Header title of the page"),
|
|
2112
|
-
requireCompletionToContinue:
|
|
2019
|
+
requireCompletionToContinue: import_zod17.z.boolean().default(false).describe(
|
|
2113
2020
|
"If true, all required fields must be filled before continuing to the next page"
|
|
2114
2021
|
),
|
|
2115
|
-
fields:
|
|
2022
|
+
fields: import_zod17.z.array(FieldConfig).describe("Fields to be rendered on the page"),
|
|
2116
2023
|
conditional: Conditional.optional().describe(
|
|
2117
2024
|
"Page will be shown if condition is met. If conditional is not defined, the page will be always shown."
|
|
2118
2025
|
)
|
|
2119
|
-
}).
|
|
2026
|
+
}).openapi({
|
|
2120
2027
|
description: "Form page configuration",
|
|
2121
|
-
|
|
2028
|
+
ref: "FormPageConfig"
|
|
2122
2029
|
});
|
|
2123
2030
|
var FormPageConfig = PageConfigBase.extend({
|
|
2124
|
-
type:
|
|
2031
|
+
type: import_zod17.z.literal(PageTypes.enum.FORM).default(PageTypes.enum.FORM)
|
|
2125
2032
|
});
|
|
2126
|
-
var VerificationActionConfig =
|
|
2127
|
-
verify:
|
|
2128
|
-
cancel:
|
|
2033
|
+
var VerificationActionConfig = import_zod17.z.object({
|
|
2034
|
+
verify: import_zod17.z.object({ label: TranslationConfig }),
|
|
2035
|
+
cancel: import_zod17.z.object({
|
|
2129
2036
|
label: TranslationConfig,
|
|
2130
|
-
confirmation:
|
|
2037
|
+
confirmation: import_zod17.z.object({
|
|
2131
2038
|
title: TranslationConfig,
|
|
2132
2039
|
body: TranslationConfig
|
|
2133
2040
|
})
|
|
2134
2041
|
})
|
|
2135
|
-
}).describe("Actions available on the verification page").
|
|
2042
|
+
}).describe("Actions available on the verification page").openapi({
|
|
2136
2043
|
description: "Verification action configuration",
|
|
2137
|
-
|
|
2044
|
+
ref: "VerificationActionConfig"
|
|
2138
2045
|
});
|
|
2139
2046
|
var VerificationPageConfig = FormPageConfig.extend({
|
|
2140
|
-
type:
|
|
2047
|
+
type: import_zod17.z.literal(PageTypes.enum.VERIFICATION),
|
|
2141
2048
|
actions: VerificationActionConfig
|
|
2142
2049
|
});
|
|
2143
|
-
var PageConfig =
|
|
2050
|
+
var PageConfig = import_zod17.z.discriminatedUnion("type", [
|
|
2144
2051
|
FormPageConfig,
|
|
2145
2052
|
VerificationPageConfig
|
|
2146
2053
|
]);
|
|
2147
2054
|
|
|
2148
2055
|
// ../commons/src/events/FormConfig.ts
|
|
2149
|
-
var DeclarationFormConfig =
|
|
2056
|
+
var DeclarationFormConfig = import_zod18.z.object({
|
|
2150
2057
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2151
|
-
pages:
|
|
2058
|
+
pages: import_zod18.z.array(FormPageConfig)
|
|
2152
2059
|
}).describe("Configuration of the declaration form.");
|
|
2153
|
-
var ActionFormConfig =
|
|
2060
|
+
var ActionFormConfig = import_zod18.z.object({
|
|
2154
2061
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2155
|
-
pages:
|
|
2062
|
+
pages: import_zod18.z.array(PageConfig)
|
|
2156
2063
|
}).describe(
|
|
2157
2064
|
"Configuration of the form used for system actions beyond declaration, supporting a wider range of page types."
|
|
2158
2065
|
);
|
|
2159
|
-
var FormConfig =
|
|
2066
|
+
var FormConfig = import_zod18.z.union([DeclarationFormConfig, ActionFormConfig]);
|
|
2160
2067
|
|
|
2161
2068
|
// ../commons/src/events/DeduplicationConfig.ts
|
|
2162
|
-
var
|
|
2163
|
-
var
|
|
2164
|
-
|
|
2069
|
+
var import_zod19 = require("zod");
|
|
2070
|
+
var import_zod_openapi8 = require("zod-openapi");
|
|
2071
|
+
(0, import_zod_openapi8.extendZodWithOpenApi)(import_zod19.z);
|
|
2072
|
+
var FieldReference2 = import_zod19.z.string();
|
|
2073
|
+
var Matcher = import_zod19.z.object({
|
|
2165
2074
|
/**
|
|
2166
2075
|
* Reference to the field used in matching.
|
|
2167
2076
|
*
|
|
@@ -2169,23 +2078,23 @@ var Matcher = z20.object({
|
|
|
2169
2078
|
* be used as the origin date to calculate the distance from.
|
|
2170
2079
|
*/
|
|
2171
2080
|
fieldId: FieldReference2,
|
|
2172
|
-
options:
|
|
2173
|
-
boost:
|
|
2081
|
+
options: import_zod19.z.object({
|
|
2082
|
+
boost: import_zod19.z.number().optional(),
|
|
2174
2083
|
matchAgainst: FieldReference2.optional()
|
|
2175
2084
|
}).optional().default({
|
|
2176
2085
|
boost: 1
|
|
2177
2086
|
})
|
|
2178
2087
|
});
|
|
2179
2088
|
var FuzzyMatcher = Matcher.extend({
|
|
2180
|
-
type:
|
|
2181
|
-
options:
|
|
2089
|
+
type: import_zod19.z.literal("fuzzy"),
|
|
2090
|
+
options: import_zod19.z.object({
|
|
2182
2091
|
/**
|
|
2183
2092
|
* Names of length 3 or less characters = 0 edits allowed
|
|
2184
2093
|
* Names of length 4 - 6 characters = 1 edit allowed
|
|
2185
2094
|
* Names of length >7 characters = 2 edits allowed
|
|
2186
2095
|
*/
|
|
2187
|
-
fuzziness:
|
|
2188
|
-
boost:
|
|
2096
|
+
fuzziness: import_zod19.z.union([import_zod19.z.string(), import_zod19.z.number()]).optional().default("AUTO:4,7"),
|
|
2097
|
+
boost: import_zod19.z.number().optional().default(1),
|
|
2189
2098
|
matchAgainst: FieldReference2.optional()
|
|
2190
2099
|
}).optional().default({
|
|
2191
2100
|
fuzziness: "AUTO:4,7",
|
|
@@ -2193,48 +2102,48 @@ var FuzzyMatcher = Matcher.extend({
|
|
|
2193
2102
|
})
|
|
2194
2103
|
});
|
|
2195
2104
|
var StrictMatcher = Matcher.extend({
|
|
2196
|
-
type:
|
|
2197
|
-
options:
|
|
2198
|
-
boost:
|
|
2105
|
+
type: import_zod19.z.literal("strict"),
|
|
2106
|
+
options: import_zod19.z.object({
|
|
2107
|
+
boost: import_zod19.z.number().optional().default(1),
|
|
2199
2108
|
/**
|
|
2200
2109
|
* The constant value to be present in the field for both records
|
|
2201
2110
|
*/
|
|
2202
|
-
value:
|
|
2111
|
+
value: import_zod19.z.string().optional(),
|
|
2203
2112
|
matchAgainst: FieldReference2.optional()
|
|
2204
2113
|
}).optional().default({
|
|
2205
2114
|
boost: 1
|
|
2206
2115
|
})
|
|
2207
2116
|
});
|
|
2208
2117
|
var DateRangeMatcher = Matcher.extend({
|
|
2209
|
-
type:
|
|
2210
|
-
options:
|
|
2118
|
+
type: import_zod19.z.literal("dateRange"),
|
|
2119
|
+
options: import_zod19.z.object({
|
|
2211
2120
|
/**
|
|
2212
2121
|
* The distance pivot in days. Distance from the origin (the value of
|
|
2213
2122
|
* fieldId) at which relevance scores receive half of the boost value
|
|
2214
2123
|
*/
|
|
2215
|
-
pivot:
|
|
2216
|
-
days:
|
|
2217
|
-
boost:
|
|
2124
|
+
pivot: import_zod19.z.number().optional(),
|
|
2125
|
+
days: import_zod19.z.number(),
|
|
2126
|
+
boost: import_zod19.z.number().optional().default(1),
|
|
2218
2127
|
matchAgainst: FieldReference2.optional()
|
|
2219
2128
|
})
|
|
2220
2129
|
});
|
|
2221
|
-
var Not =
|
|
2222
|
-
type:
|
|
2130
|
+
var Not = import_zod19.z.object({
|
|
2131
|
+
type: import_zod19.z.literal("not"),
|
|
2223
2132
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2224
|
-
clause:
|
|
2133
|
+
clause: import_zod19.z.lazy(() => Clause)
|
|
2225
2134
|
});
|
|
2226
|
-
var And =
|
|
2227
|
-
type:
|
|
2135
|
+
var And = import_zod19.z.object({
|
|
2136
|
+
type: import_zod19.z.literal("and"),
|
|
2228
2137
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2229
|
-
clauses:
|
|
2138
|
+
clauses: import_zod19.z.lazy(() => Clause.array())
|
|
2230
2139
|
});
|
|
2231
|
-
var Or =
|
|
2232
|
-
type:
|
|
2140
|
+
var Or = import_zod19.z.object({
|
|
2141
|
+
type: import_zod19.z.literal("or"),
|
|
2233
2142
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2234
|
-
clauses:
|
|
2143
|
+
clauses: import_zod19.z.lazy(() => Clause.array())
|
|
2235
2144
|
});
|
|
2236
|
-
var Clause =
|
|
2237
|
-
() =>
|
|
2145
|
+
var Clause = import_zod19.z.lazy(
|
|
2146
|
+
() => import_zod19.z.discriminatedUnion("type", [
|
|
2238
2147
|
Not,
|
|
2239
2148
|
And,
|
|
2240
2149
|
Or,
|
|
@@ -2242,328 +2151,193 @@ var Clause = z20.lazy(
|
|
|
2242
2151
|
StrictMatcher,
|
|
2243
2152
|
DateRangeMatcher
|
|
2244
2153
|
])
|
|
2245
|
-
).
|
|
2246
|
-
|
|
2154
|
+
).openapi({
|
|
2155
|
+
ref: "Clause"
|
|
2247
2156
|
});
|
|
2248
|
-
var DeduplicationConfig =
|
|
2249
|
-
id:
|
|
2157
|
+
var DeduplicationConfig = import_zod19.z.object({
|
|
2158
|
+
id: import_zod19.z.string(),
|
|
2250
2159
|
label: TranslationConfig,
|
|
2251
2160
|
query: Clause
|
|
2252
2161
|
});
|
|
2253
2162
|
|
|
2254
|
-
// ../commons/src/icons.ts
|
|
2255
|
-
var z21 = __toESM(require("zod/v4"));
|
|
2256
|
-
var AvailableIcons = z21.enum([
|
|
2257
|
-
"Archived",
|
|
2258
|
-
"Assigned",
|
|
2259
|
-
"Briefcase",
|
|
2260
|
-
"Certified",
|
|
2261
|
-
"Close",
|
|
2262
|
-
"Collapse",
|
|
2263
|
-
"Draft",
|
|
2264
|
-
"DuplicateYellow",
|
|
2265
|
-
"Expand",
|
|
2266
|
-
"ExternalValidate",
|
|
2267
|
-
"FilledCheck",
|
|
2268
|
-
"InReview",
|
|
2269
|
-
"Offline",
|
|
2270
|
-
"Registered",
|
|
2271
|
-
"RequiresUpdates",
|
|
2272
|
-
"Sent",
|
|
2273
|
-
"Validated",
|
|
2274
|
-
"WaitingApproval",
|
|
2275
|
-
"ChartActivity",
|
|
2276
|
-
"Activity",
|
|
2277
|
-
"Archive",
|
|
2278
|
-
"ArchiveTray",
|
|
2279
|
-
"ArrowLeft",
|
|
2280
|
-
"ArrowRight",
|
|
2281
|
-
"Buildings",
|
|
2282
|
-
"Circle",
|
|
2283
|
-
"CaretDown",
|
|
2284
|
-
"CaretLeft",
|
|
2285
|
-
"CaretRight",
|
|
2286
|
-
"ChartBar",
|
|
2287
|
-
"ChartLine",
|
|
2288
|
-
"ChatCircle",
|
|
2289
|
-
"CheckSquare",
|
|
2290
|
-
"Compass",
|
|
2291
|
-
"Check",
|
|
2292
|
-
"Copy",
|
|
2293
|
-
"Database",
|
|
2294
|
-
"DotsThreeVertical",
|
|
2295
|
-
"ArrowCounterClockwise",
|
|
2296
|
-
"MagnifyingGlassMinus",
|
|
2297
|
-
"MagnifyingGlassPlus",
|
|
2298
|
-
"Export",
|
|
2299
|
-
"Eye",
|
|
2300
|
-
"EyeSlash",
|
|
2301
|
-
"Envelope",
|
|
2302
|
-
"File",
|
|
2303
|
-
"FileSearch",
|
|
2304
|
-
"FileMinus",
|
|
2305
|
-
"FilePlus",
|
|
2306
|
-
"FileText",
|
|
2307
|
-
"FileX",
|
|
2308
|
-
"Handshake",
|
|
2309
|
-
"Gear",
|
|
2310
|
-
"GitBranch",
|
|
2311
|
-
"IdentificationCard",
|
|
2312
|
-
"List",
|
|
2313
|
-
"ListBullets",
|
|
2314
|
-
"Lock",
|
|
2315
|
-
"MagnifyingGlass",
|
|
2316
|
-
"MapPin",
|
|
2317
|
-
"Medal",
|
|
2318
|
-
"NotePencil",
|
|
2319
|
-
"Paperclip",
|
|
2320
|
-
"PaperPlaneTilt",
|
|
2321
|
-
"Pen",
|
|
2322
|
-
"PenNib",
|
|
2323
|
-
"Pencil",
|
|
2324
|
-
"PencilSimpleLine",
|
|
2325
|
-
"Phone",
|
|
2326
|
-
"Plus",
|
|
2327
|
-
"Printer",
|
|
2328
|
-
"SignOut",
|
|
2329
|
-
"Stamp",
|
|
2330
|
-
"Star",
|
|
2331
|
-
"Target",
|
|
2332
|
-
"TextT",
|
|
2333
|
-
"Trash",
|
|
2334
|
-
"UploadSimple",
|
|
2335
|
-
"User",
|
|
2336
|
-
"UserPlus",
|
|
2337
|
-
"Users",
|
|
2338
|
-
"WarningCircle",
|
|
2339
|
-
"X",
|
|
2340
|
-
"ChatText",
|
|
2341
|
-
"CircleWavyCheck",
|
|
2342
|
-
"CircleWavyQuestion",
|
|
2343
|
-
"ArchiveBox",
|
|
2344
|
-
"ArrowCircleDown",
|
|
2345
|
-
"FileArrowUp",
|
|
2346
|
-
"FileDotted",
|
|
2347
|
-
"Files",
|
|
2348
|
-
"PencilLine",
|
|
2349
|
-
"PencilCircle",
|
|
2350
|
-
"UserCircle",
|
|
2351
|
-
"Clock",
|
|
2352
|
-
"QrCode",
|
|
2353
|
-
"Webcam",
|
|
2354
|
-
"Sun",
|
|
2355
|
-
"DeviceTabletCamera",
|
|
2356
|
-
"Globe",
|
|
2357
|
-
"Fingerprint",
|
|
2358
|
-
"PushPin",
|
|
2359
|
-
"Timer"
|
|
2360
|
-
]);
|
|
2361
|
-
|
|
2362
2163
|
// ../commons/src/events/ActionConfig.ts
|
|
2363
|
-
var
|
|
2164
|
+
var import_zod_openapi9 = require("zod-openapi");
|
|
2165
|
+
(0, import_zod_openapi9.extendZodWithOpenApi)(import_zod20.z);
|
|
2166
|
+
var DeclarationReviewConfig = import_zod20.z.object({
|
|
2364
2167
|
title: TranslationConfig.describe("Title of the review page"),
|
|
2365
|
-
fields:
|
|
2168
|
+
fields: import_zod20.z.array(FieldConfig).describe("Fields displayed on the review page for annotations.")
|
|
2366
2169
|
}).describe(
|
|
2367
2170
|
"Configuration of the declaration review page for collecting event-related metadata."
|
|
2368
2171
|
);
|
|
2369
|
-
var ActionConfigBase =
|
|
2370
|
-
label: TranslationConfig.describe("Human readable description of the action")
|
|
2371
|
-
flags: z22.array(ActionFlagConfig).optional().default([]).describe("Flag actions which are executed when the action is performed."),
|
|
2372
|
-
supportingCopy: TranslationConfig.optional().describe(
|
|
2373
|
-
"Text displayed on the confirmation dialog"
|
|
2374
|
-
),
|
|
2375
|
-
icon: AvailableIcons.describe("Icon representing the action").optional(),
|
|
2376
|
-
conditionals: z22.array(ActionConditional).optional().describe("Conditionals which can disable or hide actions.")
|
|
2172
|
+
var ActionConfigBase = import_zod20.z.object({
|
|
2173
|
+
label: TranslationConfig.describe("Human readable description of the action")
|
|
2377
2174
|
});
|
|
2378
2175
|
var DeclarationActionBase = ActionConfigBase.extend({
|
|
2176
|
+
review: DeclarationReviewConfig,
|
|
2379
2177
|
deduplication: DeduplicationConfig.optional()
|
|
2380
2178
|
});
|
|
2381
|
-
var ReadActionConfig = ActionConfigBase.
|
|
2382
|
-
|
|
2383
|
-
type:
|
|
2179
|
+
var ReadActionConfig = ActionConfigBase.merge(
|
|
2180
|
+
import_zod20.z.object({
|
|
2181
|
+
type: import_zod20.z.literal(ActionType.READ),
|
|
2384
2182
|
review: DeclarationReviewConfig.describe(
|
|
2385
2183
|
"Configuration of the review page for read-only view."
|
|
2386
|
-
)
|
|
2387
|
-
|
|
2388
|
-
}).shape
|
|
2184
|
+
)
|
|
2185
|
+
})
|
|
2389
2186
|
);
|
|
2390
|
-
var DeclareConfig = DeclarationActionBase.
|
|
2391
|
-
|
|
2392
|
-
type:
|
|
2393
|
-
|
|
2394
|
-
"Configuration of the review page fields."
|
|
2395
|
-
),
|
|
2396
|
-
dialogCopy: z22.object({
|
|
2397
|
-
notify: TranslationConfig.describe(
|
|
2398
|
-
"Confirmation text for the notify action"
|
|
2399
|
-
),
|
|
2400
|
-
declare: TranslationConfig.describe(
|
|
2401
|
-
"Confirmation text for the declare action"
|
|
2402
|
-
),
|
|
2403
|
-
register: TranslationConfig.describe(
|
|
2404
|
-
"Confirmation text for the register action"
|
|
2405
|
-
)
|
|
2406
|
-
}).optional()
|
|
2407
|
-
}).shape
|
|
2187
|
+
var DeclareConfig = DeclarationActionBase.merge(
|
|
2188
|
+
import_zod20.z.object({
|
|
2189
|
+
type: import_zod20.z.literal(ActionType.DECLARE)
|
|
2190
|
+
})
|
|
2408
2191
|
);
|
|
2409
|
-
var
|
|
2410
|
-
|
|
2411
|
-
type:
|
|
2412
|
-
})
|
|
2192
|
+
var ValidateConfig = DeclarationActionBase.merge(
|
|
2193
|
+
import_zod20.z.object({
|
|
2194
|
+
type: import_zod20.z.literal(ActionType.VALIDATE)
|
|
2195
|
+
})
|
|
2413
2196
|
);
|
|
2414
|
-
var
|
|
2415
|
-
|
|
2416
|
-
type:
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
),
|
|
2424
|
-
register: TranslationConfig.describe(
|
|
2425
|
-
"Confirmation text for the register with edits action"
|
|
2426
|
-
)
|
|
2427
|
-
})
|
|
2428
|
-
}).shape
|
|
2197
|
+
var RegisterConfig = DeclarationActionBase.merge(
|
|
2198
|
+
import_zod20.z.object({
|
|
2199
|
+
type: import_zod20.z.literal(ActionType.REGISTER)
|
|
2200
|
+
})
|
|
2201
|
+
);
|
|
2202
|
+
var RejectDeclarationConfig = ActionConfigBase.merge(
|
|
2203
|
+
import_zod20.z.object({
|
|
2204
|
+
type: import_zod20.z.literal(ActionType.REJECT)
|
|
2205
|
+
})
|
|
2429
2206
|
);
|
|
2430
|
-
var
|
|
2431
|
-
|
|
2432
|
-
type:
|
|
2433
|
-
})
|
|
2207
|
+
var ArchiveConfig = ActionConfigBase.merge(
|
|
2208
|
+
import_zod20.z.object({
|
|
2209
|
+
type: import_zod20.z.literal(ActionType.ARCHIVE)
|
|
2210
|
+
})
|
|
2434
2211
|
);
|
|
2435
|
-
var
|
|
2436
|
-
|
|
2437
|
-
type:
|
|
2438
|
-
})
|
|
2212
|
+
var DeleteConfig = ActionConfigBase.merge(
|
|
2213
|
+
import_zod20.z.object({
|
|
2214
|
+
type: import_zod20.z.literal(ActionType.DELETE)
|
|
2215
|
+
})
|
|
2439
2216
|
);
|
|
2440
|
-
var PrintCertificateActionConfig = ActionConfigBase.
|
|
2441
|
-
|
|
2442
|
-
type:
|
|
2217
|
+
var PrintCertificateActionConfig = ActionConfigBase.merge(
|
|
2218
|
+
import_zod20.z.object({
|
|
2219
|
+
type: import_zod20.z.literal(ActionType.PRINT_CERTIFICATE),
|
|
2443
2220
|
printForm: ActionFormConfig
|
|
2444
|
-
})
|
|
2221
|
+
})
|
|
2445
2222
|
);
|
|
2446
|
-
var RequestCorrectionConfig = ActionConfigBase.
|
|
2447
|
-
|
|
2448
|
-
type:
|
|
2223
|
+
var RequestCorrectionConfig = ActionConfigBase.merge(
|
|
2224
|
+
import_zod20.z.object({
|
|
2225
|
+
type: import_zod20.z.literal(ActionType.REQUEST_CORRECTION),
|
|
2449
2226
|
correctionForm: ActionFormConfig
|
|
2450
|
-
})
|
|
2227
|
+
})
|
|
2451
2228
|
);
|
|
2452
|
-
var
|
|
2453
|
-
|
|
2454
|
-
type:
|
|
2455
|
-
customActionType: z22.string().describe("Type identifier of the custom action."),
|
|
2456
|
-
/** Custom action form configuration supports a simple array of field configs, which should be rendered on the action modal. In the future, we might add support for pages etc. */
|
|
2457
|
-
form: z22.array(FieldConfig).describe(
|
|
2458
|
-
"Form configuration for the custom action. The form configured here will be used on the custom action confirmation modal."
|
|
2459
|
-
),
|
|
2460
|
-
auditHistoryLabel: TranslationConfig.describe(
|
|
2461
|
-
'The label to show in audit history for this action. For example "Approved".'
|
|
2462
|
-
)
|
|
2229
|
+
var RejectCorrectionConfig = ActionConfigBase.merge(
|
|
2230
|
+
import_zod20.z.object({
|
|
2231
|
+
type: import_zod20.z.literal(ActionType.REJECT_CORRECTION)
|
|
2463
2232
|
})
|
|
2464
2233
|
);
|
|
2465
|
-
var
|
|
2234
|
+
var ApproveCorrectionConfig = ActionConfigBase.merge(
|
|
2235
|
+
import_zod20.z.object({
|
|
2236
|
+
type: import_zod20.z.literal(ActionType.APPROVE_CORRECTION)
|
|
2237
|
+
})
|
|
2238
|
+
);
|
|
2239
|
+
var ActionConfig = import_zod20.z.discriminatedUnion("type", [
|
|
2466
2240
|
/*
|
|
2467
2241
|
* OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
|
|
2468
2242
|
* and treat them as "models" instead of duplicating the data structure in each endpoint.
|
|
2469
2243
|
*/
|
|
2470
|
-
ReadActionConfig.
|
|
2471
|
-
DeclareConfig.
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2244
|
+
ReadActionConfig.openapi({ ref: "ReadActionConfig" }),
|
|
2245
|
+
DeclareConfig.openapi({ ref: "DeclareActionConfig" }),
|
|
2246
|
+
ValidateConfig.openapi({ ref: "ValidateActionConfig" }),
|
|
2247
|
+
RejectDeclarationConfig.openapi({ ref: "RejectDeclarationActionConfig" }),
|
|
2248
|
+
ArchiveConfig.openapi({ ref: "ArchiveActionConfig" }),
|
|
2249
|
+
RegisterConfig.openapi({ ref: "RegisterActionConfig" }),
|
|
2250
|
+
DeleteConfig.openapi({ ref: "DeleteActionConfig" }),
|
|
2251
|
+
PrintCertificateActionConfig.openapi({
|
|
2252
|
+
ref: "PrintCertificateActionConfig"
|
|
2476
2253
|
}),
|
|
2477
|
-
RequestCorrectionConfig.
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
CustomActionConfig.meta({ id: "CustomActionConfig" })
|
|
2254
|
+
RequestCorrectionConfig.openapi({ ref: "RequestCorrectionActionConfig" }),
|
|
2255
|
+
RejectCorrectionConfig.openapi({ ref: "RejectCorrectionActionConfig" }),
|
|
2256
|
+
ApproveCorrectionConfig.openapi({ ref: "ApproveCorrectionActionConfig" })
|
|
2481
2257
|
]).describe(
|
|
2482
2258
|
"Configuration of an action available for an event. Data collected depends on the action type and is accessible through the annotation property in ActionDocument."
|
|
2483
|
-
).
|
|
2484
|
-
var
|
|
2485
|
-
ActionConfig.options.map((opt) => opt.shape.type.value)
|
|
2486
|
-
);
|
|
2487
|
-
var DeclarationActionConfig = z22.discriminatedUnion("type", [
|
|
2259
|
+
).openapi({ ref: "ActionConfig" });
|
|
2260
|
+
var DeclarationActionConfig = import_zod20.z.discriminatedUnion("type", [
|
|
2488
2261
|
DeclareConfig,
|
|
2262
|
+
ValidateConfig,
|
|
2489
2263
|
RegisterConfig
|
|
2490
2264
|
]);
|
|
2491
2265
|
|
|
2492
2266
|
// ../commons/src/events/offline/CertificateConfig.ts
|
|
2493
|
-
var
|
|
2494
|
-
var FontFamily =
|
|
2495
|
-
normal:
|
|
2496
|
-
bold:
|
|
2497
|
-
italics:
|
|
2498
|
-
bolditalics:
|
|
2499
|
-
});
|
|
2500
|
-
var CertificateConfig =
|
|
2501
|
-
id:
|
|
2502
|
-
event:
|
|
2503
|
-
isV2Template:
|
|
2267
|
+
var import_zod21 = require("zod");
|
|
2268
|
+
var FontFamily = import_zod21.z.object({
|
|
2269
|
+
normal: import_zod21.z.string(),
|
|
2270
|
+
bold: import_zod21.z.string(),
|
|
2271
|
+
italics: import_zod21.z.string(),
|
|
2272
|
+
bolditalics: import_zod21.z.string()
|
|
2273
|
+
});
|
|
2274
|
+
var CertificateConfig = import_zod21.z.object({
|
|
2275
|
+
id: import_zod21.z.string(),
|
|
2276
|
+
event: import_zod21.z.string(),
|
|
2277
|
+
isV2Template: import_zod21.z.boolean().optional(),
|
|
2504
2278
|
label: TranslationConfig,
|
|
2505
|
-
isDefault:
|
|
2506
|
-
fee:
|
|
2507
|
-
onTime:
|
|
2508
|
-
late:
|
|
2509
|
-
delayed:
|
|
2279
|
+
isDefault: import_zod21.z.boolean(),
|
|
2280
|
+
fee: import_zod21.z.object({
|
|
2281
|
+
onTime: import_zod21.z.number(),
|
|
2282
|
+
late: import_zod21.z.number(),
|
|
2283
|
+
delayed: import_zod21.z.number()
|
|
2510
2284
|
}),
|
|
2511
|
-
svgUrl:
|
|
2512
|
-
fonts:
|
|
2513
|
-
conditionals:
|
|
2285
|
+
svgUrl: import_zod21.z.string(),
|
|
2286
|
+
fonts: import_zod21.z.record(FontFamily).optional(),
|
|
2287
|
+
conditionals: import_zod21.z.array(ShowConditional).optional()
|
|
2514
2288
|
});
|
|
2515
2289
|
var CertificateTemplateConfig = CertificateConfig.extend({
|
|
2516
|
-
hash:
|
|
2517
|
-
svg:
|
|
2290
|
+
hash: import_zod21.z.string().optional(),
|
|
2291
|
+
svg: import_zod21.z.string()
|
|
2518
2292
|
});
|
|
2519
2293
|
|
|
2520
2294
|
// ../commons/src/events/offline/LanguageConfig.ts
|
|
2521
|
-
var
|
|
2522
|
-
var LanguageConfig =
|
|
2523
|
-
lang:
|
|
2295
|
+
var import_zod22 = require("zod");
|
|
2296
|
+
var LanguageConfig = import_zod22.z.object({
|
|
2297
|
+
lang: import_zod22.z.string(),
|
|
2524
2298
|
/**
|
|
2525
2299
|
* client.csv contents
|
|
2526
2300
|
*/
|
|
2527
|
-
messages:
|
|
2301
|
+
messages: import_zod22.z.record(import_zod22.z.string())
|
|
2528
2302
|
});
|
|
2529
2303
|
|
|
2530
2304
|
// ../commons/src/events/EventConfig.ts
|
|
2531
|
-
var
|
|
2305
|
+
var import_zod27 = require("zod");
|
|
2532
2306
|
|
|
2533
2307
|
// ../commons/src/events/SummaryConfig.ts
|
|
2534
|
-
var
|
|
2535
|
-
var BaseField2 =
|
|
2308
|
+
var import_zod23 = require("zod");
|
|
2309
|
+
var BaseField2 = import_zod23.z.object({
|
|
2536
2310
|
emptyValueMessage: TranslationConfig.optional().describe(
|
|
2537
2311
|
"Default message displayed when the field value is empty."
|
|
2538
2312
|
),
|
|
2539
|
-
conditionals:
|
|
2313
|
+
conditionals: import_zod23.z.array(ShowConditional).default([]).optional()
|
|
2540
2314
|
});
|
|
2541
2315
|
var ReferenceField = BaseField2.extend({
|
|
2542
|
-
fieldId:
|
|
2316
|
+
fieldId: import_zod23.z.string(),
|
|
2543
2317
|
label: TranslationConfig.optional().describe(
|
|
2544
2318
|
"Overrides the default label from the referenced field when provided."
|
|
2545
2319
|
)
|
|
2546
2320
|
}).describe("Field referencing existing event data by field ID.");
|
|
2547
2321
|
var Field = BaseField2.extend({
|
|
2548
|
-
id:
|
|
2322
|
+
id: import_zod23.z.string().describe("Identifier of the summary field."),
|
|
2549
2323
|
value: TranslationConfig.describe(
|
|
2550
2324
|
'Field value template supporting variables from configuration and EventMetadata (e.g. "{informant.phoneNo} {informant.email}").'
|
|
2551
2325
|
),
|
|
2552
2326
|
label: TranslationConfig
|
|
2553
2327
|
}).describe("Custom field defined for the summary view.");
|
|
2554
|
-
var SummaryConfig =
|
|
2555
|
-
fields:
|
|
2328
|
+
var SummaryConfig = import_zod23.z.object({
|
|
2329
|
+
fields: import_zod23.z.array(import_zod23.z.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
|
|
2556
2330
|
}).describe("Configuration of the event summary section.");
|
|
2557
2331
|
|
|
2558
2332
|
// ../commons/src/events/AdvancedSearchConfig.ts
|
|
2559
|
-
var
|
|
2560
|
-
var MatchType =
|
|
2561
|
-
var BaseField3 =
|
|
2562
|
-
config:
|
|
2333
|
+
var import_zod24 = require("zod");
|
|
2334
|
+
var MatchType = import_zod24.z.enum(["fuzzy", "exact", "range", "within"]);
|
|
2335
|
+
var BaseField3 = import_zod24.z.object({
|
|
2336
|
+
config: import_zod24.z.object({
|
|
2563
2337
|
type: MatchType.describe(
|
|
2564
2338
|
"Determines the search type of field. How to match value."
|
|
2565
2339
|
),
|
|
2566
|
-
searchFields:
|
|
2340
|
+
searchFields: import_zod24.z.array(import_zod24.z.string()).optional().describe(
|
|
2567
2341
|
`
|
|
2568
2342
|
Defines multiple form fields that should be searched when this field has a value.
|
|
2569
2343
|
All specified fields will be combined using OR logic.
|
|
@@ -2573,7 +2347,7 @@ var BaseField3 = z26.object({
|
|
|
2573
2347
|
`
|
|
2574
2348
|
)
|
|
2575
2349
|
}),
|
|
2576
|
-
type:
|
|
2350
|
+
type: import_zod24.z.nativeEnum(FieldType).optional().describe(
|
|
2577
2351
|
`
|
|
2578
2352
|
Explicitly specify the field type for searchFields.
|
|
2579
2353
|
This is required when searchFields is defined, to show the correct control in the UI.
|
|
@@ -2587,7 +2361,7 @@ var BaseField3 = z26.object({
|
|
|
2587
2361
|
This is required when searchFields is defined.
|
|
2588
2362
|
`
|
|
2589
2363
|
),
|
|
2590
|
-
options:
|
|
2364
|
+
options: import_zod24.z.array(SelectOption).optional(),
|
|
2591
2365
|
searchCriteriaLabelPrefix: TranslationConfig.optional().describe(
|
|
2592
2366
|
`
|
|
2593
2367
|
This property determines whether to add a prefix (such as "Child" or "Applicant") before the field label
|
|
@@ -2608,7 +2382,7 @@ var BaseField3 = z26.object({
|
|
|
2608
2382
|
in the country-config > event.advancedSearch configuration. For example: field("child.dob", { searchCriteriaLabelPrefix: TranslationConfig }).
|
|
2609
2383
|
`
|
|
2610
2384
|
),
|
|
2611
|
-
conditionals:
|
|
2385
|
+
conditionals: import_zod24.z.array(FieldConditional).default([]).optional().describe(
|
|
2612
2386
|
`
|
|
2613
2387
|
In advanced search, we sometimes need to override the default field visibility conditionals.
|
|
2614
2388
|
|
|
@@ -2622,20 +2396,20 @@ var BaseField3 = z26.object({
|
|
|
2622
2396
|
are always rendered in the advanced search form.
|
|
2623
2397
|
`
|
|
2624
2398
|
),
|
|
2625
|
-
validations:
|
|
2399
|
+
validations: import_zod24.z.array(ValidationConfig).default([]).optional().describe(
|
|
2626
2400
|
`Option for overriding the field validations specifically for advanced search form.`
|
|
2627
2401
|
)
|
|
2628
2402
|
});
|
|
2629
|
-
var SearchQueryParams =
|
|
2630
|
-
eventType:
|
|
2403
|
+
var SearchQueryParams = import_zod24.z.object({
|
|
2404
|
+
eventType: import_zod24.z.string().optional().describe(
|
|
2631
2405
|
"Defines type of event so that when redirecting to Advanced Search page, appropriate tab can be selected"
|
|
2632
2406
|
)
|
|
2633
2407
|
}).catchall(FieldValue);
|
|
2634
2408
|
var FieldConfigSchema = BaseField3.extend({
|
|
2635
|
-
fieldId:
|
|
2636
|
-
fieldType:
|
|
2409
|
+
fieldId: import_zod24.z.string(),
|
|
2410
|
+
fieldType: import_zod24.z.literal("field")
|
|
2637
2411
|
});
|
|
2638
|
-
var EventFieldIdInput =
|
|
2412
|
+
var EventFieldIdInput = import_zod24.z.enum([
|
|
2639
2413
|
"trackingId",
|
|
2640
2414
|
"status",
|
|
2641
2415
|
"legalStatuses.REGISTERED.acceptedAt",
|
|
@@ -2644,7 +2418,7 @@ var EventFieldIdInput = z26.enum([
|
|
|
2644
2418
|
"updatedAt"
|
|
2645
2419
|
]);
|
|
2646
2420
|
var METADATA_FIELD_PREFIX = "event.";
|
|
2647
|
-
var EventFieldId =
|
|
2421
|
+
var EventFieldId = import_zod24.z.enum([
|
|
2648
2422
|
`${METADATA_FIELD_PREFIX}trackingId`,
|
|
2649
2423
|
`${METADATA_FIELD_PREFIX}status`,
|
|
2650
2424
|
`${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.acceptedAt`,
|
|
@@ -2654,29 +2428,29 @@ var EventFieldId = z26.enum([
|
|
|
2654
2428
|
]);
|
|
2655
2429
|
var EventFieldConfigSchema = BaseField3.extend({
|
|
2656
2430
|
fieldId: EventFieldId,
|
|
2657
|
-
fieldType:
|
|
2431
|
+
fieldType: import_zod24.z.literal("event")
|
|
2658
2432
|
});
|
|
2659
|
-
var AdvancedSearchField =
|
|
2433
|
+
var AdvancedSearchField = import_zod24.z.discriminatedUnion("fieldType", [FieldConfigSchema, EventFieldConfigSchema]).superRefine((data, ctx) => {
|
|
2660
2434
|
if (data.config.searchFields && data.config.searchFields.length > 0) {
|
|
2661
2435
|
if (!data.label) {
|
|
2662
2436
|
ctx.addIssue({
|
|
2663
|
-
code:
|
|
2437
|
+
code: import_zod24.z.ZodIssueCode.custom,
|
|
2664
2438
|
message: "label is required when config.searchFields is defined.",
|
|
2665
2439
|
path: ["label"]
|
|
2666
2440
|
});
|
|
2667
2441
|
}
|
|
2668
2442
|
if (!data.type) {
|
|
2669
2443
|
ctx.addIssue({
|
|
2670
|
-
code:
|
|
2444
|
+
code: import_zod24.z.ZodIssueCode.custom,
|
|
2671
2445
|
message: "type is required when config.searchFields is defined.",
|
|
2672
2446
|
path: ["type"]
|
|
2673
2447
|
});
|
|
2674
2448
|
}
|
|
2675
2449
|
}
|
|
2676
2450
|
});
|
|
2677
|
-
var AdvancedSearchConfig =
|
|
2451
|
+
var AdvancedSearchConfig = import_zod24.z.object({
|
|
2678
2452
|
title: TranslationConfig.describe("Advanced search tab title"),
|
|
2679
|
-
fields:
|
|
2453
|
+
fields: import_zod24.z.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
|
|
2680
2454
|
});
|
|
2681
2455
|
|
|
2682
2456
|
// ../commons/src/events/utils.ts
|
|
@@ -2685,11 +2459,11 @@ var import_lodash = require("lodash");
|
|
|
2685
2459
|
// ../commons/src/conditionals/validate.ts
|
|
2686
2460
|
var import__ = __toESM(require("ajv/dist/2019"));
|
|
2687
2461
|
var import_ajv_formats = __toESM(require("ajv-formats"));
|
|
2688
|
-
var
|
|
2462
|
+
var import_zod26 = require("zod");
|
|
2689
2463
|
var import_date_fns = require("date-fns");
|
|
2690
2464
|
|
|
2691
2465
|
// ../commons/src/events/DynamicFieldValue.ts
|
|
2692
|
-
var
|
|
2466
|
+
var import_zod25 = require("zod");
|
|
2693
2467
|
|
|
2694
2468
|
// ../commons/src/conditionals/validate.ts
|
|
2695
2469
|
var ajv = new import__.default({
|
|
@@ -2698,9 +2472,9 @@ var ajv = new import__.default({
|
|
|
2698
2472
|
strict: false
|
|
2699
2473
|
// Allow minContains and other newer features
|
|
2700
2474
|
});
|
|
2701
|
-
var DataContext =
|
|
2702
|
-
rootData:
|
|
2703
|
-
$leafAdminStructureLocationIds:
|
|
2475
|
+
var DataContext = import_zod26.z.object({
|
|
2476
|
+
rootData: import_zod26.z.object({
|
|
2477
|
+
$leafAdminStructureLocationIds: import_zod26.z.array(import_zod26.z.object({ id: UUID }))
|
|
2704
2478
|
})
|
|
2705
2479
|
});
|
|
2706
2480
|
function resolveDataPath(rootData, dataPath, instancePath) {
|
|
@@ -2777,12 +2551,12 @@ ajv.addKeyword({
|
|
|
2777
2551
|
});
|
|
2778
2552
|
|
|
2779
2553
|
// ../commons/src/utils.ts
|
|
2780
|
-
var
|
|
2781
|
-
var FullNameV1 =
|
|
2782
|
-
|
|
2783
|
-
use:
|
|
2784
|
-
family:
|
|
2785
|
-
given:
|
|
2554
|
+
var z27 = __toESM(require("zod"));
|
|
2555
|
+
var FullNameV1 = z27.array(
|
|
2556
|
+
z27.object({
|
|
2557
|
+
use: z27.string(),
|
|
2558
|
+
family: z27.string(),
|
|
2559
|
+
given: z27.array(z27.string())
|
|
2786
2560
|
})
|
|
2787
2561
|
);
|
|
2788
2562
|
function omitKeyDeep(obj, keyToRemove) {
|
|
@@ -2803,6 +2577,9 @@ function omitKeyDeep(obj, keyToRemove) {
|
|
|
2803
2577
|
|
|
2804
2578
|
// ../commons/src/events/utils.ts
|
|
2805
2579
|
var import_date_fns2 = require("date-fns");
|
|
2580
|
+
function isDeclarationActionConfig(action) {
|
|
2581
|
+
return DeclarationActions.safeParse(action.type).success;
|
|
2582
|
+
}
|
|
2806
2583
|
function getDeclarationFields(configuration) {
|
|
2807
2584
|
return configuration.declaration.pages.flatMap(({ fields }) => fields);
|
|
2808
2585
|
}
|
|
@@ -2813,10 +2590,7 @@ var getActionAnnotationFields = (actionConfig) => {
|
|
|
2813
2590
|
if (actionConfig.type === ActionType.PRINT_CERTIFICATE) {
|
|
2814
2591
|
return actionConfig.printForm.pages.flatMap(({ fields }) => fields);
|
|
2815
2592
|
}
|
|
2816
|
-
if (actionConfig
|
|
2817
|
-
return actionConfig.form;
|
|
2818
|
-
}
|
|
2819
|
-
if ("review" in actionConfig) {
|
|
2593
|
+
if (isDeclarationActionConfig(actionConfig)) {
|
|
2820
2594
|
return actionConfig.review.fields;
|
|
2821
2595
|
}
|
|
2822
2596
|
return [];
|
|
@@ -2836,8 +2610,38 @@ var EXCLUDED_ACTIONS = [
|
|
|
2836
2610
|
ActionType.REJECT_CORRECTION
|
|
2837
2611
|
];
|
|
2838
2612
|
|
|
2839
|
-
// ../commons/src/events/
|
|
2840
|
-
|
|
2613
|
+
// ../commons/src/events/EventConfig.ts
|
|
2614
|
+
var import_zod_openapi10 = require("zod-openapi");
|
|
2615
|
+
(0, import_zod_openapi10.extendZodWithOpenApi)(import_zod27.z);
|
|
2616
|
+
var EventConfig = import_zod27.z.object({
|
|
2617
|
+
id: import_zod27.z.string().describe(
|
|
2618
|
+
'Machine-readable identifier of the event (e.g. "birth", "death").'
|
|
2619
|
+
),
|
|
2620
|
+
dateOfEvent: FieldReference.optional().describe(
|
|
2621
|
+
"Reference to the field capturing the date of the event (e.g. date of birth). Defaults to the event creation date if unspecified."
|
|
2622
|
+
),
|
|
2623
|
+
title: TranslationConfig.describe(
|
|
2624
|
+
'Title template for the singular event, supporting variables (e.g. "{applicant.name.firstname} {applicant.name.surname}").'
|
|
2625
|
+
),
|
|
2626
|
+
fallbackTitle: TranslationConfig.optional().describe(
|
|
2627
|
+
"Fallback title shown when the main title resolves to an empty value."
|
|
2628
|
+
),
|
|
2629
|
+
summary: SummaryConfig.describe(
|
|
2630
|
+
"Summary information displayed in the event overview."
|
|
2631
|
+
),
|
|
2632
|
+
label: TranslationConfig.describe(
|
|
2633
|
+
"Human-readable label for the event type."
|
|
2634
|
+
),
|
|
2635
|
+
actions: import_zod27.z.array(ActionConfig).describe(
|
|
2636
|
+
"Configuration of system-defined actions associated with the event."
|
|
2637
|
+
),
|
|
2638
|
+
declaration: DeclarationFormConfig.describe(
|
|
2639
|
+
"Configuration of the form used to gather event data."
|
|
2640
|
+
),
|
|
2641
|
+
advancedSearch: import_zod27.z.array(AdvancedSearchConfig).optional().default([]).describe(
|
|
2642
|
+
"Configuration of fields available in the advanced search feature."
|
|
2643
|
+
)
|
|
2644
|
+
}).superRefine((event2, ctx) => {
|
|
2841
2645
|
const allFields = findAllFields(event2);
|
|
2842
2646
|
const fieldIds = allFields.map((field3) => field3.id);
|
|
2843
2647
|
const advancedSearchFields = event2.advancedSearch.flatMap(
|
|
@@ -2864,12 +2668,10 @@ function validateAdvancedSearchConfig(event2, ctx) {
|
|
|
2864
2668
|
ctx.addIssue({
|
|
2865
2669
|
code: "custom",
|
|
2866
2670
|
message: `Advanced search id must match a field id of form fields or pre-defined metadata fields.
|
|
2867
|
-
|
|
2671
|
+
Invalid AdvancedSearch field IDs for event ${event2.id}: ${invalidFields.map((f) => f.fieldId).join(", ")}`,
|
|
2868
2672
|
path: ["advancedSearch"]
|
|
2869
2673
|
});
|
|
2870
2674
|
}
|
|
2871
|
-
}
|
|
2872
|
-
function validateDateOfEvent(event2, ctx) {
|
|
2873
2675
|
if (event2.dateOfEvent) {
|
|
2874
2676
|
const eventDateFieldId = getDeclarationFields(event2).find(
|
|
2875
2677
|
({ id }) => id === event2.dateOfEvent?.$$field
|
|
@@ -2878,7 +2680,7 @@ function validateDateOfEvent(event2, ctx) {
|
|
|
2878
2680
|
ctx.addIssue({
|
|
2879
2681
|
code: "custom",
|
|
2880
2682
|
message: `Date of event field id must match a field id in fields array.
|
|
2881
|
-
|
|
2683
|
+
Invalid date of event field ID for event ${event2.id}: ${event2.dateOfEvent.$$field}`,
|
|
2882
2684
|
path: ["dateOfEvent"]
|
|
2883
2685
|
});
|
|
2884
2686
|
} else if (eventDateFieldId.type !== FieldType.DATE) {
|
|
@@ -2889,105 +2691,8 @@ function validateDateOfEvent(event2, ctx) {
|
|
|
2889
2691
|
});
|
|
2890
2692
|
}
|
|
2891
2693
|
}
|
|
2892
|
-
}
|
|
2893
|
-
|
|
2894
|
-
if (event2.placeOfEvent) {
|
|
2895
|
-
const eventPlaceFieldId = getDeclarationFields(event2).find(
|
|
2896
|
-
({ id }) => id === event2.placeOfEvent?.$$field
|
|
2897
|
-
);
|
|
2898
|
-
if (!eventPlaceFieldId) {
|
|
2899
|
-
ctx.addIssue({
|
|
2900
|
-
code: "custom",
|
|
2901
|
-
message: `Place of event field id must match a field id in the event.declaration fields.
|
|
2902
|
-
Invalid place of event field ID for event ${event2.id}: ${event2.placeOfEvent.$$field}`,
|
|
2903
|
-
path: ["placeOfEvent"]
|
|
2904
|
-
});
|
|
2905
|
-
}
|
|
2906
|
-
}
|
|
2907
|
-
}
|
|
2908
|
-
function validateActionFlags(event2, ctx) {
|
|
2909
|
-
const isInherentFlag = (value) => Object.values(InherentFlags).includes(value);
|
|
2910
|
-
const configuredFlagIds = event2.flags.map((flag) => flag.id);
|
|
2911
|
-
const actionFlagIds = event2.actions.flatMap(
|
|
2912
|
-
(action) => action.flags.map((flag) => flag.id)
|
|
2913
|
-
);
|
|
2914
|
-
for (const actionFlagId of actionFlagIds) {
|
|
2915
|
-
const isConfigured = configuredFlagIds.includes(actionFlagId);
|
|
2916
|
-
const isInherent = isInherentFlag(actionFlagId);
|
|
2917
|
-
if (!isConfigured && !isInherent) {
|
|
2918
|
-
ctx.addIssue({
|
|
2919
|
-
code: "custom",
|
|
2920
|
-
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}'`,
|
|
2921
|
-
path: ["actions"]
|
|
2922
|
-
});
|
|
2923
|
-
}
|
|
2924
|
-
}
|
|
2925
|
-
}
|
|
2926
|
-
function validateActionOrder(event2, ctx) {
|
|
2927
|
-
if (event2.actionOrder) {
|
|
2928
|
-
const customActionTypes = event2.actions.filter((action) => action.type === ActionType.CUSTOM).map((action) => action.customActionType);
|
|
2929
|
-
const validActionTypes = [
|
|
2930
|
-
...workqueueActions.options,
|
|
2931
|
-
...customActionTypes
|
|
2932
|
-
];
|
|
2933
|
-
for (const actionType of event2.actionOrder) {
|
|
2934
|
-
if (!validActionTypes.includes(actionType)) {
|
|
2935
|
-
ctx.addIssue({
|
|
2936
|
-
code: "custom",
|
|
2937
|
-
message: `Invalid action type in action order: ${actionType}`,
|
|
2938
|
-
path: ["actionOrder"]
|
|
2939
|
-
});
|
|
2940
|
-
}
|
|
2941
|
-
}
|
|
2942
|
-
}
|
|
2943
|
-
}
|
|
2944
|
-
|
|
2945
|
-
// ../commons/src/events/EventConfig.ts
|
|
2946
|
-
var EventConfig = z30.object({
|
|
2947
|
-
id: z30.string().describe(
|
|
2948
|
-
'Machine-readable identifier of the event (e.g. "birth", "death").'
|
|
2949
|
-
),
|
|
2950
|
-
dateOfEvent: FieldReference.optional().describe(
|
|
2951
|
-
"Reference to the field capturing the date of the event (e.g. date of birth). Defaults to the event creation date if unspecified."
|
|
2952
|
-
),
|
|
2953
|
-
placeOfEvent: FieldReference.optional().describe(
|
|
2954
|
-
"Reference to the field capturing the place of the event (e.g. place of birth). Defaults to the meta.createdAtLocation if unspecified."
|
|
2955
|
-
),
|
|
2956
|
-
title: TranslationConfig.describe(
|
|
2957
|
-
'Title template for the singular event, supporting variables (e.g. "{applicant.name.firstname} {applicant.name.surname}").'
|
|
2958
|
-
),
|
|
2959
|
-
fallbackTitle: TranslationConfig.optional().describe(
|
|
2960
|
-
"Fallback title shown when the main title resolves to an empty value."
|
|
2961
|
-
),
|
|
2962
|
-
summary: SummaryConfig.describe(
|
|
2963
|
-
"Summary information displayed in the event overview."
|
|
2964
|
-
),
|
|
2965
|
-
label: TranslationConfig.describe(
|
|
2966
|
-
"Human-readable label for the event type."
|
|
2967
|
-
),
|
|
2968
|
-
actions: z30.array(ActionConfig).describe(
|
|
2969
|
-
"Configuration of system-defined actions associated with the event."
|
|
2970
|
-
),
|
|
2971
|
-
actionOrder: z30.array(z30.string()).optional().describe(
|
|
2972
|
-
"Order of actions in the action menu. Use either the action type for core actions or the customActionType for custom actions."
|
|
2973
|
-
),
|
|
2974
|
-
declaration: DeclarationFormConfig.describe(
|
|
2975
|
-
"Configuration of the form used to gather event data."
|
|
2976
|
-
),
|
|
2977
|
-
advancedSearch: z30.array(AdvancedSearchConfig).optional().default([]).describe(
|
|
2978
|
-
"Configuration of fields available in the advanced search feature."
|
|
2979
|
-
),
|
|
2980
|
-
flags: z30.array(FlagConfig).optional().default([]).describe(
|
|
2981
|
-
"Configuration of flags associated with the actions of this event type."
|
|
2982
|
-
)
|
|
2983
|
-
}).superRefine((event2, ctx) => {
|
|
2984
|
-
validateAdvancedSearchConfig(event2, ctx);
|
|
2985
|
-
validateDateOfEvent(event2, ctx);
|
|
2986
|
-
validatePlaceOfEvent(event2, ctx);
|
|
2987
|
-
validateActionFlags(event2, ctx);
|
|
2988
|
-
validateActionOrder(event2, ctx);
|
|
2989
|
-
}).meta({
|
|
2990
|
-
id: "EventConfig"
|
|
2694
|
+
}).openapi({
|
|
2695
|
+
ref: "EventConfig"
|
|
2991
2696
|
}).describe("Configuration defining an event type.");
|
|
2992
2697
|
|
|
2993
2698
|
// ../commons/src/events/EventConfigInput.ts
|
|
@@ -2996,7 +2701,7 @@ var defineActionForm = (actionForm) => ActionFormConfig.parse(actionForm);
|
|
|
2996
2701
|
var defineFormPage = (formPage) => FormPageConfig.parse(formPage);
|
|
2997
2702
|
|
|
2998
2703
|
// ../commons/src/events/WorkqueueConfig.ts
|
|
2999
|
-
var
|
|
2704
|
+
var import_zod31 = require("zod");
|
|
3000
2705
|
|
|
3001
2706
|
// ../commons/src/conditionals/conditionals.ts
|
|
3002
2707
|
var objectHash = __toESM(require("object-hash"));
|
|
@@ -3034,7 +2739,7 @@ function not(condition) {
|
|
|
3034
2739
|
required: []
|
|
3035
2740
|
});
|
|
3036
2741
|
}
|
|
3037
|
-
function
|
|
2742
|
+
function never() {
|
|
3038
2743
|
return not(alwaysTrue());
|
|
3039
2744
|
}
|
|
3040
2745
|
function jsonFieldPath(field3) {
|
|
@@ -3744,17 +3449,17 @@ var event = Object.assign(eventFn, {
|
|
|
3744
3449
|
});
|
|
3745
3450
|
|
|
3746
3451
|
// ../commons/src/events/WorkqueueColumnConfig.ts
|
|
3747
|
-
var
|
|
3452
|
+
var import_zod28 = require("zod");
|
|
3748
3453
|
var WorkqueueColumnKeysArray = [
|
|
3749
3454
|
...EventMetadataKeysArray,
|
|
3750
3455
|
"title",
|
|
3751
3456
|
"outbox"
|
|
3752
3457
|
];
|
|
3753
|
-
var WorkqueueColumnKeys =
|
|
3754
|
-
var WorkqueueColumnValue =
|
|
3458
|
+
var WorkqueueColumnKeys = import_zod28.z.enum(WorkqueueColumnKeysArray);
|
|
3459
|
+
var WorkqueueColumnValue = import_zod28.z.object({
|
|
3755
3460
|
$event: WorkqueueColumnKeys
|
|
3756
3461
|
});
|
|
3757
|
-
var WorkqueueColumn =
|
|
3462
|
+
var WorkqueueColumn = import_zod28.z.object({
|
|
3758
3463
|
label: TranslationConfig,
|
|
3759
3464
|
value: WorkqueueColumnValue
|
|
3760
3465
|
});
|
|
@@ -3765,49 +3470,158 @@ function defineWorkqueuesColumns(workqueueColumns) {
|
|
|
3765
3470
|
}
|
|
3766
3471
|
|
|
3767
3472
|
// ../commons/src/events/CountryConfigQueryInput.ts
|
|
3768
|
-
var
|
|
3769
|
-
var SerializableExact =
|
|
3770
|
-
type:
|
|
3771
|
-
term:
|
|
3772
|
-
});
|
|
3773
|
-
var SerializableWithin =
|
|
3774
|
-
type:
|
|
3775
|
-
location:
|
|
3776
|
-
});
|
|
3777
|
-
var SerializedQueryExpression =
|
|
3778
|
-
eventType:
|
|
3779
|
-
status:
|
|
3780
|
-
createdAt:
|
|
3781
|
-
updatedAt:
|
|
3782
|
-
"legalStatuses.REGISTERED.createdAt":
|
|
3783
|
-
"legalStatuses.
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3473
|
+
var import_zod29 = require("zod");
|
|
3474
|
+
var SerializableExact = import_zod29.z.object({
|
|
3475
|
+
type: import_zod29.z.literal("exact"),
|
|
3476
|
+
term: import_zod29.z.union([import_zod29.z.string(), SerializedUserField])
|
|
3477
|
+
});
|
|
3478
|
+
var SerializableWithin = import_zod29.z.object({
|
|
3479
|
+
type: import_zod29.z.literal("within"),
|
|
3480
|
+
location: import_zod29.z.union([import_zod29.z.string(), SerializedUserField])
|
|
3481
|
+
});
|
|
3482
|
+
var SerializedQueryExpression = import_zod29.z.object({
|
|
3483
|
+
eventType: import_zod29.z.string(),
|
|
3484
|
+
status: import_zod29.z.optional(import_zod29.z.union([AnyOfStatus, ExactStatus])),
|
|
3485
|
+
createdAt: import_zod29.z.optional(DateCondition),
|
|
3486
|
+
updatedAt: import_zod29.z.optional(DateCondition),
|
|
3487
|
+
"legalStatuses.REGISTERED.createdAt": import_zod29.z.optional(DateCondition),
|
|
3488
|
+
"legalStatuses.REGISTERED.createdAtLocation": import_zod29.z.optional(
|
|
3489
|
+
import_zod29.z.union([Within, Exact])
|
|
3490
|
+
),
|
|
3491
|
+
"legalStatuses.REGISTERED.registrationNumber": import_zod29.z.optional(Exact),
|
|
3492
|
+
createdAtLocation: import_zod29.z.optional(
|
|
3493
|
+
import_zod29.z.union([SerializableWithin, SerializableExact])
|
|
3494
|
+
),
|
|
3495
|
+
updatedAtLocation: import_zod29.z.optional(
|
|
3496
|
+
import_zod29.z.union([SerializableWithin, SerializableExact])
|
|
3497
|
+
),
|
|
3498
|
+
assignedTo: import_zod29.z.optional(SerializableExact),
|
|
3499
|
+
createdBy: import_zod29.z.optional(SerializableExact),
|
|
3790
3500
|
createdByUserType: ExactUserType,
|
|
3791
|
-
updatedBy:
|
|
3792
|
-
trackingId:
|
|
3793
|
-
flags:
|
|
3501
|
+
updatedBy: import_zod29.z.optional(SerializableExact),
|
|
3502
|
+
trackingId: import_zod29.z.optional(Exact),
|
|
3503
|
+
flags: import_zod29.z.optional(ContainsFlags),
|
|
3794
3504
|
data: QueryInput
|
|
3795
3505
|
}).partial();
|
|
3796
|
-
var Or2 =
|
|
3797
|
-
type:
|
|
3798
|
-
clauses:
|
|
3506
|
+
var Or2 = import_zod29.z.object({
|
|
3507
|
+
type: import_zod29.z.literal("or"),
|
|
3508
|
+
clauses: import_zod29.z.array(SerializedQueryExpression)
|
|
3799
3509
|
});
|
|
3800
|
-
var And2 =
|
|
3801
|
-
type:
|
|
3802
|
-
clauses:
|
|
3510
|
+
var And2 = import_zod29.z.object({
|
|
3511
|
+
type: import_zod29.z.literal("and"),
|
|
3512
|
+
clauses: import_zod29.z.array(SerializedQueryExpression)
|
|
3803
3513
|
});
|
|
3804
|
-
var CountryConfigQueryType =
|
|
3805
|
-
var CountryConfigQueryInputType =
|
|
3514
|
+
var CountryConfigQueryType = import_zod29.z.discriminatedUnion("type", [And2, Or2]);
|
|
3515
|
+
var CountryConfigQueryInputType = import_zod29.z.union([
|
|
3806
3516
|
SerializedQueryExpression,
|
|
3807
3517
|
And2,
|
|
3808
3518
|
Or2
|
|
3809
3519
|
]);
|
|
3810
3520
|
|
|
3521
|
+
// ../commons/src/icons.ts
|
|
3522
|
+
var import_zod30 = require("zod");
|
|
3523
|
+
var AvailableIcons = import_zod30.z.enum([
|
|
3524
|
+
"Archived",
|
|
3525
|
+
"Assigned",
|
|
3526
|
+
"Certified",
|
|
3527
|
+
"Close",
|
|
3528
|
+
"Collapse",
|
|
3529
|
+
"Draft",
|
|
3530
|
+
"DuplicateYellow",
|
|
3531
|
+
"Expand",
|
|
3532
|
+
"ExternalValidate",
|
|
3533
|
+
"FilledCheck",
|
|
3534
|
+
"InReview",
|
|
3535
|
+
"Offline",
|
|
3536
|
+
"Registered",
|
|
3537
|
+
"RequiresUpdates",
|
|
3538
|
+
"Sent",
|
|
3539
|
+
"Validated",
|
|
3540
|
+
"WaitingApproval",
|
|
3541
|
+
"ChartActivity",
|
|
3542
|
+
"Activity",
|
|
3543
|
+
"Archive",
|
|
3544
|
+
"ArchiveTray",
|
|
3545
|
+
"ArrowLeft",
|
|
3546
|
+
"ArrowRight",
|
|
3547
|
+
"Buildings",
|
|
3548
|
+
"Circle",
|
|
3549
|
+
"CaretDown",
|
|
3550
|
+
"CaretLeft",
|
|
3551
|
+
"CaretRight",
|
|
3552
|
+
"ChartBar",
|
|
3553
|
+
"ChartLine",
|
|
3554
|
+
"ChatCircle",
|
|
3555
|
+
"CheckSquare",
|
|
3556
|
+
"Compass",
|
|
3557
|
+
"Check",
|
|
3558
|
+
"Copy",
|
|
3559
|
+
"Database",
|
|
3560
|
+
"DotsThreeVertical",
|
|
3561
|
+
"ArrowCounterClockwise",
|
|
3562
|
+
"MagnifyingGlassMinus",
|
|
3563
|
+
"MagnifyingGlassPlus",
|
|
3564
|
+
"Export",
|
|
3565
|
+
"Eye",
|
|
3566
|
+
"EyeSlash",
|
|
3567
|
+
"Envelope",
|
|
3568
|
+
"File",
|
|
3569
|
+
"FileSearch",
|
|
3570
|
+
"FileMinus",
|
|
3571
|
+
"FilePlus",
|
|
3572
|
+
"FileText",
|
|
3573
|
+
"FileX",
|
|
3574
|
+
"Handshake",
|
|
3575
|
+
"Gear",
|
|
3576
|
+
"GitBranch",
|
|
3577
|
+
"IdentificationCard",
|
|
3578
|
+
"List",
|
|
3579
|
+
"ListBullets",
|
|
3580
|
+
"Lock",
|
|
3581
|
+
"MagnifyingGlass",
|
|
3582
|
+
"MapPin",
|
|
3583
|
+
"Medal",
|
|
3584
|
+
"NotePencil",
|
|
3585
|
+
"Paperclip",
|
|
3586
|
+
"PaperPlaneTilt",
|
|
3587
|
+
"Pen",
|
|
3588
|
+
"Pencil",
|
|
3589
|
+
"PencilSimpleLine",
|
|
3590
|
+
"Phone",
|
|
3591
|
+
"Plus",
|
|
3592
|
+
"Printer",
|
|
3593
|
+
"SignOut",
|
|
3594
|
+
"Star",
|
|
3595
|
+
"Target",
|
|
3596
|
+
"TextT",
|
|
3597
|
+
"Trash",
|
|
3598
|
+
"UploadSimple",
|
|
3599
|
+
"User",
|
|
3600
|
+
"UserPlus",
|
|
3601
|
+
"Users",
|
|
3602
|
+
"WarningCircle",
|
|
3603
|
+
"X",
|
|
3604
|
+
"CircleWavyCheck",
|
|
3605
|
+
"CircleWavyQuestion",
|
|
3606
|
+
"ArchiveBox",
|
|
3607
|
+
"ArrowCircleDown",
|
|
3608
|
+
"FileArrowUp",
|
|
3609
|
+
"FileDotted",
|
|
3610
|
+
"Files",
|
|
3611
|
+
"PencilLine",
|
|
3612
|
+
"PencilCircle",
|
|
3613
|
+
"UserCircle",
|
|
3614
|
+
"Clock",
|
|
3615
|
+
"QrCode",
|
|
3616
|
+
"Webcam",
|
|
3617
|
+
"Sun",
|
|
3618
|
+
"DeviceTabletCamera",
|
|
3619
|
+
"Globe",
|
|
3620
|
+
"Fingerprint",
|
|
3621
|
+
"PushPin",
|
|
3622
|
+
"Timer"
|
|
3623
|
+
]);
|
|
3624
|
+
|
|
3811
3625
|
// ../commons/src/events/WorkqueueConfig.ts
|
|
3812
3626
|
var mandatoryColumns = defineWorkqueuesColumns([
|
|
3813
3627
|
{
|
|
@@ -3827,17 +3641,23 @@ var mandatoryColumns = defineWorkqueuesColumns([
|
|
|
3827
3641
|
value: event.field("updatedAt")
|
|
3828
3642
|
}
|
|
3829
3643
|
]);
|
|
3830
|
-
var
|
|
3831
|
-
|
|
3832
|
-
|
|
3644
|
+
var WorkqueueActionsWithDefault = import_zod31.z.enum([
|
|
3645
|
+
...workqueueActions.options,
|
|
3646
|
+
"DEFAULT"
|
|
3647
|
+
]);
|
|
3648
|
+
var WorkqueueConfig = import_zod31.z.object({
|
|
3649
|
+
slug: import_zod31.z.string().describe("Determines the url of the workqueue."),
|
|
3833
3650
|
name: TranslationConfig.describe(
|
|
3834
3651
|
"Title of the workflow (both in navigation and on the page)"
|
|
3835
3652
|
),
|
|
3836
3653
|
query: CountryConfigQueryType,
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3654
|
+
actions: import_zod31.z.array(
|
|
3655
|
+
import_zod31.z.object({
|
|
3656
|
+
type: WorkqueueActionsWithDefault,
|
|
3657
|
+
conditionals: import_zod31.z.array(Conditional).optional()
|
|
3658
|
+
})
|
|
3659
|
+
),
|
|
3660
|
+
columns: import_zod31.z.array(WorkqueueColumn).default(mandatoryColumns),
|
|
3841
3661
|
icon: AvailableIcons,
|
|
3842
3662
|
emptyMessage: TranslationConfig.optional()
|
|
3843
3663
|
}).describe("Configuration for workqueue.");
|
|
@@ -3845,21 +3665,26 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
|
|
|
3845
3665
|
query: true,
|
|
3846
3666
|
columns: true
|
|
3847
3667
|
});
|
|
3848
|
-
var WorkqueueConfigInput =
|
|
3849
|
-
slug:
|
|
3668
|
+
var WorkqueueConfigInput = import_zod31.z.object({
|
|
3669
|
+
slug: import_zod31.z.string().describe("Determines the url of the workqueue."),
|
|
3850
3670
|
name: TranslationConfig.describe(
|
|
3851
3671
|
"Title of the workflow (both in navigation and on the page)"
|
|
3852
3672
|
),
|
|
3853
3673
|
query: CountryConfigQueryInputType,
|
|
3854
|
-
actions:
|
|
3855
|
-
|
|
3674
|
+
actions: import_zod31.z.array(
|
|
3675
|
+
import_zod31.z.object({
|
|
3676
|
+
type: WorkqueueActionsWithDefault,
|
|
3677
|
+
conditionals: import_zod31.z.array(Conditional).optional()
|
|
3678
|
+
})
|
|
3679
|
+
),
|
|
3680
|
+
columns: import_zod31.z.array(WorkqueueColumn).default(mandatoryColumns),
|
|
3856
3681
|
icon: AvailableIcons,
|
|
3857
3682
|
emptyMessage: TranslationConfig.optional()
|
|
3858
3683
|
});
|
|
3859
|
-
var WorkqueueCountInput =
|
|
3860
|
-
|
|
3684
|
+
var WorkqueueCountInput = import_zod31.z.array(
|
|
3685
|
+
import_zod31.z.object({ slug: import_zod31.z.string(), query: QueryType })
|
|
3861
3686
|
);
|
|
3862
|
-
var WorkqueueCountOutput =
|
|
3687
|
+
var WorkqueueCountOutput = import_zod31.z.record(import_zod31.z.string(), import_zod31.z.number());
|
|
3863
3688
|
|
|
3864
3689
|
// ../commons/src/events/workqueueDefaultColumns.ts
|
|
3865
3690
|
var defaultWorkqueueColumns = [
|
|
@@ -3882,48 +3707,47 @@ var defaultWorkqueueColumns = [
|
|
|
3882
3707
|
];
|
|
3883
3708
|
|
|
3884
3709
|
// ../commons/src/events/Draft.ts
|
|
3885
|
-
var
|
|
3710
|
+
var import_zod33 = require("zod");
|
|
3886
3711
|
|
|
3887
3712
|
// ../commons/src/events/ActionInput.ts
|
|
3888
|
-
var
|
|
3889
|
-
var
|
|
3713
|
+
var import_zod32 = require("zod");
|
|
3714
|
+
var import_zod_openapi11 = require("zod-openapi");
|
|
3715
|
+
(0, import_zod_openapi11.extendZodWithOpenApi)(import_zod32.z);
|
|
3716
|
+
var BaseActionInput = import_zod32.z.object({
|
|
3890
3717
|
eventId: UUID,
|
|
3891
|
-
transactionId:
|
|
3718
|
+
transactionId: import_zod32.z.string(),
|
|
3892
3719
|
declaration: ActionUpdate.default({}),
|
|
3893
3720
|
annotation: ActionUpdate.optional(),
|
|
3894
3721
|
originalActionId: UUID.optional(),
|
|
3895
3722
|
// should not be part of base action.
|
|
3896
|
-
keepAssignment:
|
|
3723
|
+
keepAssignment: import_zod32.z.boolean().optional(),
|
|
3897
3724
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
3898
|
-
|
|
3899
|
-
createdAtLocation: UUID.nullish().describe(
|
|
3725
|
+
createdAtLocation: CreatedAtLocation.describe(
|
|
3900
3726
|
"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."
|
|
3901
3727
|
)
|
|
3902
3728
|
});
|
|
3903
|
-
var CreateActionInput = BaseActionInput.
|
|
3904
|
-
|
|
3905
|
-
type:
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
"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."
|
|
3909
|
-
)
|
|
3910
|
-
}).shape
|
|
3729
|
+
var CreateActionInput = BaseActionInput.merge(
|
|
3730
|
+
import_zod32.z.object({
|
|
3731
|
+
type: import_zod32.z.literal(ActionType.CREATE).default(ActionType.CREATE),
|
|
3732
|
+
createdAtLocation: CreatedAtLocation
|
|
3733
|
+
})
|
|
3911
3734
|
);
|
|
3912
|
-
var RegisterActionInput = BaseActionInput.
|
|
3913
|
-
|
|
3914
|
-
type:
|
|
3915
|
-
registrationNumber:
|
|
3916
|
-
})
|
|
3735
|
+
var RegisterActionInput = BaseActionInput.merge(
|
|
3736
|
+
import_zod32.z.object({
|
|
3737
|
+
type: import_zod32.z.literal(ActionType.REGISTER).default(ActionType.REGISTER),
|
|
3738
|
+
registrationNumber: import_zod32.z.string().optional()
|
|
3739
|
+
})
|
|
3740
|
+
).strict();
|
|
3741
|
+
var ValidateActionInput = BaseActionInput.merge(
|
|
3742
|
+
import_zod32.z.object({
|
|
3743
|
+
type: import_zod32.z.literal(ActionType.VALIDATE).default(ActionType.VALIDATE)
|
|
3744
|
+
})
|
|
3917
3745
|
);
|
|
3918
|
-
var NotifyActionInput = BaseActionInput.
|
|
3919
|
-
|
|
3920
|
-
type:
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
"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."
|
|
3924
|
-
)
|
|
3925
|
-
}).shape
|
|
3926
|
-
).meta({
|
|
3746
|
+
var NotifyActionInput = BaseActionInput.merge(
|
|
3747
|
+
import_zod32.z.object({
|
|
3748
|
+
type: import_zod32.z.literal(ActionType.NOTIFY).default(ActionType.NOTIFY)
|
|
3749
|
+
})
|
|
3750
|
+
).openapi({
|
|
3927
3751
|
default: {
|
|
3928
3752
|
eventId: "<event-id-here>",
|
|
3929
3753
|
transactionId: getUUID(),
|
|
@@ -3932,150 +3756,135 @@ var NotifyActionInput = BaseActionInput.extend(
|
|
|
3932
3756
|
type: ActionType.NOTIFY
|
|
3933
3757
|
}
|
|
3934
3758
|
});
|
|
3935
|
-
var DeclareActionInput = BaseActionInput.
|
|
3936
|
-
|
|
3937
|
-
type:
|
|
3938
|
-
})
|
|
3939
|
-
);
|
|
3940
|
-
var EditActionInput = BaseActionInput.extend(
|
|
3941
|
-
z34.object({
|
|
3942
|
-
type: z34.literal(ActionType.EDIT).default(ActionType.EDIT),
|
|
3943
|
-
content: z34.object({
|
|
3944
|
-
comment: z34.string().describe("Comment for the edit action.").optional()
|
|
3945
|
-
})
|
|
3946
|
-
}).shape
|
|
3759
|
+
var DeclareActionInput = BaseActionInput.merge(
|
|
3760
|
+
import_zod32.z.object({
|
|
3761
|
+
type: import_zod32.z.literal(ActionType.DECLARE).default(ActionType.DECLARE)
|
|
3762
|
+
})
|
|
3947
3763
|
);
|
|
3948
|
-
var PrintCertificateActionInput = BaseActionInput.
|
|
3949
|
-
|
|
3950
|
-
type:
|
|
3764
|
+
var PrintCertificateActionInput = BaseActionInput.merge(
|
|
3765
|
+
import_zod32.z.object({
|
|
3766
|
+
type: import_zod32.z.literal(ActionType.PRINT_CERTIFICATE).default(ActionType.PRINT_CERTIFICATE),
|
|
3951
3767
|
content: PrintContent.optional()
|
|
3952
|
-
})
|
|
3768
|
+
})
|
|
3953
3769
|
);
|
|
3954
|
-
var RejectDeclarationActionInput = BaseActionInput.
|
|
3955
|
-
|
|
3956
|
-
type:
|
|
3770
|
+
var RejectDeclarationActionInput = BaseActionInput.merge(
|
|
3771
|
+
import_zod32.z.object({
|
|
3772
|
+
type: import_zod32.z.literal(ActionType.REJECT).default(ActionType.REJECT),
|
|
3957
3773
|
content: ReasonContent
|
|
3958
|
-
})
|
|
3774
|
+
})
|
|
3959
3775
|
);
|
|
3960
|
-
var DuplicateDetectedActionInput = BaseActionInput.
|
|
3961
|
-
|
|
3962
|
-
type:
|
|
3963
|
-
content:
|
|
3964
|
-
duplicates:
|
|
3776
|
+
var DuplicateDetectedActionInput = BaseActionInput.merge(
|
|
3777
|
+
import_zod32.z.object({
|
|
3778
|
+
type: import_zod32.z.literal(ActionType.DUPLICATE_DETECTED).default(ActionType.DUPLICATE_DETECTED),
|
|
3779
|
+
content: import_zod32.z.object({
|
|
3780
|
+
duplicates: import_zod32.z.array(PotentialDuplicate)
|
|
3965
3781
|
})
|
|
3966
|
-
})
|
|
3782
|
+
})
|
|
3967
3783
|
);
|
|
3968
|
-
var MarkAsDuplicateActionInput = BaseActionInput.
|
|
3969
|
-
|
|
3970
|
-
type:
|
|
3971
|
-
content:
|
|
3784
|
+
var MarkAsDuplicateActionInput = BaseActionInput.merge(
|
|
3785
|
+
import_zod32.z.object({
|
|
3786
|
+
type: import_zod32.z.literal(ActionType.MARK_AS_DUPLICATE).default(ActionType.MARK_AS_DUPLICATE),
|
|
3787
|
+
content: import_zod32.z.object({
|
|
3972
3788
|
duplicateOf: UUID
|
|
3973
3789
|
}).optional()
|
|
3974
|
-
})
|
|
3790
|
+
})
|
|
3975
3791
|
);
|
|
3976
|
-
var MarkNotDuplicateActionInput = BaseActionInput.
|
|
3977
|
-
|
|
3978
|
-
type:
|
|
3979
|
-
})
|
|
3792
|
+
var MarkNotDuplicateActionInput = BaseActionInput.merge(
|
|
3793
|
+
import_zod32.z.object({
|
|
3794
|
+
type: import_zod32.z.literal(ActionType.MARK_AS_NOT_DUPLICATE).default(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
3795
|
+
})
|
|
3980
3796
|
);
|
|
3981
|
-
var ArchiveActionInput = BaseActionInput.
|
|
3982
|
-
|
|
3983
|
-
type:
|
|
3797
|
+
var ArchiveActionInput = BaseActionInput.merge(
|
|
3798
|
+
import_zod32.z.object({
|
|
3799
|
+
type: import_zod32.z.literal(ActionType.ARCHIVE).default(ActionType.ARCHIVE),
|
|
3984
3800
|
content: ReasonContent
|
|
3985
|
-
})
|
|
3801
|
+
})
|
|
3986
3802
|
);
|
|
3987
|
-
var AssignActionInput = BaseActionInput.
|
|
3988
|
-
|
|
3989
|
-
type:
|
|
3990
|
-
assignedTo:
|
|
3991
|
-
})
|
|
3803
|
+
var AssignActionInput = BaseActionInput.merge(
|
|
3804
|
+
import_zod32.z.object({
|
|
3805
|
+
type: import_zod32.z.literal(ActionType.ASSIGN),
|
|
3806
|
+
assignedTo: import_zod32.z.string()
|
|
3807
|
+
})
|
|
3992
3808
|
);
|
|
3993
|
-
var UnassignActionInput = BaseActionInput.
|
|
3994
|
-
|
|
3995
|
-
type:
|
|
3996
|
-
assignedTo:
|
|
3997
|
-
})
|
|
3809
|
+
var UnassignActionInput = BaseActionInput.merge(
|
|
3810
|
+
import_zod32.z.object({
|
|
3811
|
+
type: import_zod32.z.literal(ActionType.UNASSIGN).default(ActionType.UNASSIGN),
|
|
3812
|
+
assignedTo: import_zod32.z.literal(null).default(null)
|
|
3813
|
+
})
|
|
3998
3814
|
);
|
|
3999
|
-
var RequestCorrectionActionInput = BaseActionInput.
|
|
4000
|
-
|
|
4001
|
-
type:
|
|
4002
|
-
})
|
|
3815
|
+
var RequestCorrectionActionInput = BaseActionInput.merge(
|
|
3816
|
+
import_zod32.z.object({
|
|
3817
|
+
type: import_zod32.z.literal(ActionType.REQUEST_CORRECTION).default(ActionType.REQUEST_CORRECTION)
|
|
3818
|
+
})
|
|
4003
3819
|
);
|
|
4004
|
-
var RejectCorrectionActionInput = BaseActionInput.
|
|
4005
|
-
|
|
4006
|
-
requestId:
|
|
4007
|
-
type:
|
|
3820
|
+
var RejectCorrectionActionInput = BaseActionInput.merge(
|
|
3821
|
+
import_zod32.z.object({
|
|
3822
|
+
requestId: import_zod32.z.string(),
|
|
3823
|
+
type: import_zod32.z.literal(ActionType.REJECT_CORRECTION).default(ActionType.REJECT_CORRECTION),
|
|
4008
3824
|
content: ReasonContent
|
|
4009
|
-
})
|
|
4010
|
-
);
|
|
4011
|
-
var ApproveCorrectionActionInput = BaseActionInput.extend(
|
|
4012
|
-
z34.object({
|
|
4013
|
-
requestId: z34.string(),
|
|
4014
|
-
type: z34.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
|
|
4015
|
-
}).shape
|
|
3825
|
+
})
|
|
4016
3826
|
);
|
|
4017
|
-
var
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
3827
|
+
var ApproveCorrectionActionInput = BaseActionInput.merge(
|
|
3828
|
+
import_zod32.z.object({
|
|
3829
|
+
requestId: import_zod32.z.string(),
|
|
3830
|
+
type: import_zod32.z.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
|
|
3831
|
+
})
|
|
4021
3832
|
);
|
|
4022
|
-
var
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
customActionType: z34.string().describe("Name of the custom action.")
|
|
4027
|
-
}).shape
|
|
3833
|
+
var ReadActionInput = BaseActionInput.merge(
|
|
3834
|
+
import_zod32.z.object({
|
|
3835
|
+
type: import_zod32.z.literal(ActionType.READ).default(ActionType.READ)
|
|
3836
|
+
})
|
|
4028
3837
|
);
|
|
4029
|
-
var
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
3838
|
+
var DeleteActionInput = import_zod32.z.object({ eventId: UUID });
|
|
3839
|
+
var ActionInput = import_zod32.z.discriminatedUnion("type", [
|
|
3840
|
+
CreateActionInput.openapi({ ref: "CreateActionInput" }),
|
|
3841
|
+
ValidateActionInput.openapi({ ref: "ValidateActionInput" }),
|
|
3842
|
+
RegisterActionInput.openapi({ ref: "RegisterActionInput" }),
|
|
3843
|
+
NotifyActionInput.openapi({ ref: "NotifyActionInput" }),
|
|
3844
|
+
DeclareActionInput.openapi({ ref: "DeclareActionInput" }),
|
|
3845
|
+
RejectDeclarationActionInput.openapi({
|
|
3846
|
+
ref: "RejectDeclarationActionInput"
|
|
4036
3847
|
}),
|
|
4037
|
-
DuplicateDetectedActionInput.
|
|
4038
|
-
|
|
3848
|
+
DuplicateDetectedActionInput.openapi({
|
|
3849
|
+
ref: "DuplicateDetectedActionInput"
|
|
4039
3850
|
}),
|
|
4040
|
-
MarkAsDuplicateActionInput.
|
|
4041
|
-
|
|
3851
|
+
MarkAsDuplicateActionInput.openapi({
|
|
3852
|
+
ref: "MarkAsDuplicateActionInput"
|
|
4042
3853
|
}),
|
|
4043
|
-
MarkNotDuplicateActionInput.
|
|
4044
|
-
|
|
3854
|
+
MarkNotDuplicateActionInput.openapi({
|
|
3855
|
+
ref: "MarkNotDuplicateActionInput"
|
|
4045
3856
|
}),
|
|
4046
|
-
ArchiveActionInput.
|
|
4047
|
-
AssignActionInput.
|
|
4048
|
-
UnassignActionInput.
|
|
4049
|
-
PrintCertificateActionInput.
|
|
4050
|
-
RequestCorrectionActionInput.
|
|
4051
|
-
|
|
3857
|
+
ArchiveActionInput.openapi({ ref: "ArchiveActionInput" }),
|
|
3858
|
+
AssignActionInput.openapi({ ref: "AssignActionInput" }),
|
|
3859
|
+
UnassignActionInput.openapi({ ref: "UnassignActionInput" }),
|
|
3860
|
+
PrintCertificateActionInput.openapi({ ref: "PrintCertificateActionInput" }),
|
|
3861
|
+
RequestCorrectionActionInput.openapi({
|
|
3862
|
+
ref: "RequestCorrectionActionInput"
|
|
4052
3863
|
}),
|
|
4053
|
-
RejectCorrectionActionInput.
|
|
4054
|
-
ApproveCorrectionActionInput.
|
|
4055
|
-
|
|
3864
|
+
RejectCorrectionActionInput.openapi({ ref: "RejectCorrectionActionInput" }),
|
|
3865
|
+
ApproveCorrectionActionInput.openapi({
|
|
3866
|
+
ref: "ApproveCorrectionActionInput"
|
|
4056
3867
|
}),
|
|
4057
|
-
ReadActionInput.
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
]).meta({
|
|
4061
|
-
id: "ActionInput"
|
|
3868
|
+
ReadActionInput.openapi({ ref: "ReadActionInput" })
|
|
3869
|
+
]).openapi({
|
|
3870
|
+
ref: "ActionInput"
|
|
4062
3871
|
});
|
|
4063
3872
|
|
|
4064
3873
|
// ../commons/src/events/Draft.ts
|
|
4065
|
-
var Draft =
|
|
3874
|
+
var Draft = import_zod33.z.object({
|
|
4066
3875
|
id: UUID,
|
|
4067
3876
|
eventId: UUID,
|
|
4068
|
-
transactionId:
|
|
4069
|
-
createdAt:
|
|
3877
|
+
transactionId: import_zod33.z.string(),
|
|
3878
|
+
createdAt: import_zod33.z.string().datetime(),
|
|
4070
3879
|
action: ActionBase.extend({
|
|
4071
|
-
type: ActionTypes.exclude([ActionTypes.
|
|
3880
|
+
type: ActionTypes.exclude([ActionTypes.Enum.DELETE])
|
|
4072
3881
|
}).omit({ id: true, createdAtLocation: true })
|
|
4073
3882
|
}).describe(
|
|
4074
3883
|
"A temporary storage for an action. Stored with details of the event, creator and creation time."
|
|
4075
3884
|
);
|
|
4076
3885
|
var DraftInput = BaseActionInput.extend({
|
|
4077
|
-
type: ActionTypes.exclude([ActionTypes.
|
|
4078
|
-
status:
|
|
3886
|
+
type: ActionTypes.exclude([ActionTypes.Enum.DELETE]),
|
|
3887
|
+
status: import_zod33.z.enum([
|
|
4079
3888
|
ActionStatus.Requested,
|
|
4080
3889
|
ActionStatus.Accepted,
|
|
4081
3890
|
ActionStatus.Rejected
|
|
@@ -4083,33 +3892,32 @@ var DraftInput = BaseActionInput.extend({
|
|
|
4083
3892
|
});
|
|
4084
3893
|
|
|
4085
3894
|
// ../commons/src/events/EventInput.ts
|
|
4086
|
-
var
|
|
4087
|
-
var
|
|
4088
|
-
var EventInput =
|
|
4089
|
-
transactionId:
|
|
4090
|
-
type:
|
|
4091
|
-
|
|
4092
|
-
"Location where the event occurred. Required for system users."
|
|
4093
|
-
)
|
|
4094
|
-
}).meta({ default: { transactionId: (0, import_uuid9.v4)(), type: "birth" } });
|
|
3895
|
+
var import_zod34 = require("zod");
|
|
3896
|
+
var import_uuid10 = require("uuid");
|
|
3897
|
+
var EventInput = import_zod34.z.object({
|
|
3898
|
+
transactionId: import_zod34.z.string(),
|
|
3899
|
+
type: import_zod34.z.string()
|
|
3900
|
+
}).openapi({ default: { transactionId: (0, import_uuid10.v4)(), type: "birth" } });
|
|
4095
3901
|
|
|
4096
3902
|
// ../commons/src/events/EventDocument.ts
|
|
4097
|
-
var
|
|
4098
|
-
var
|
|
3903
|
+
var import_zod35 = require("zod");
|
|
3904
|
+
var import_zod_openapi12 = require("zod-openapi");
|
|
3905
|
+
(0, import_zod_openapi12.extendZodWithOpenApi)(import_zod35.z);
|
|
3906
|
+
var EventDocument = import_zod35.z.object({
|
|
4099
3907
|
id: UUID.describe("Unique identifier of the event."),
|
|
4100
|
-
type:
|
|
4101
|
-
createdAt:
|
|
4102
|
-
updatedAt:
|
|
3908
|
+
type: import_zod35.z.string().describe("Type of the event (e.g. birth, death, marriage)."),
|
|
3909
|
+
createdAt: import_zod35.z.string().datetime().describe("Timestamp indicating when the event was created."),
|
|
3910
|
+
updatedAt: import_zod35.z.string().datetime().describe(
|
|
4103
3911
|
"Timestamp of the last update, excluding changes from actions."
|
|
4104
3912
|
),
|
|
4105
|
-
actions:
|
|
4106
|
-
trackingId:
|
|
3913
|
+
actions: import_zod35.z.array(Action).describe("Ordered list of actions associated with the event."),
|
|
3914
|
+
trackingId: import_zod35.z.string().describe(
|
|
4107
3915
|
"System-generated tracking identifier used to look up the event."
|
|
4108
3916
|
)
|
|
4109
|
-
}).
|
|
3917
|
+
}).openapi({ ref: "EventDocument" });
|
|
4110
3918
|
|
|
4111
3919
|
// ../commons/src/events/state/index.ts
|
|
4112
|
-
var
|
|
3920
|
+
var import_lodash3 = require("lodash");
|
|
4113
3921
|
|
|
4114
3922
|
// ../commons/src/events/state/utils.ts
|
|
4115
3923
|
var import_lodash2 = require("lodash");
|
|
@@ -4117,18 +3925,14 @@ var updateActions = ActionTypes.extract([
|
|
|
4117
3925
|
ActionType.CREATE,
|
|
4118
3926
|
ActionType.NOTIFY,
|
|
4119
3927
|
ActionType.DECLARE,
|
|
3928
|
+
ActionType.VALIDATE,
|
|
4120
3929
|
ActionType.REGISTER,
|
|
4121
3930
|
ActionType.REJECT,
|
|
4122
3931
|
ActionType.ARCHIVE,
|
|
4123
3932
|
ActionType.PRINT_CERTIFICATE,
|
|
4124
|
-
ActionType.REQUEST_CORRECTION
|
|
4125
|
-
ActionType.CUSTOM
|
|
3933
|
+
ActionType.REQUEST_CORRECTION
|
|
4126
3934
|
]);
|
|
4127
3935
|
|
|
4128
|
-
// ../commons/src/events/state/flags.ts
|
|
4129
|
-
var import_lodash3 = require("lodash");
|
|
4130
|
-
var import_date_fns3 = require("date-fns");
|
|
4131
|
-
|
|
4132
3936
|
// ../commons/src/events/defineConfig.ts
|
|
4133
3937
|
var defineConfig = (config) => {
|
|
4134
3938
|
const input = EventConfig.parse(config);
|
|
@@ -4136,7 +3940,7 @@ var defineConfig = (config) => {
|
|
|
4136
3940
|
};
|
|
4137
3941
|
|
|
4138
3942
|
// ../commons/src/events/test.utils.ts
|
|
4139
|
-
var
|
|
3943
|
+
var import_lodash4 = require("lodash");
|
|
4140
3944
|
var import_date_fns4 = require("date-fns");
|
|
4141
3945
|
|
|
4142
3946
|
// ../commons/src/field-config/field-configuration.ts
|
|
@@ -4158,6 +3962,7 @@ function field(fieldId, options = {}) {
|
|
|
4158
3962
|
}
|
|
4159
3963
|
|
|
4160
3964
|
// ../commons/src/fixtures/forms.ts
|
|
3965
|
+
var import_date_fns3 = require("date-fns");
|
|
4161
3966
|
var PRINT_CERTIFICATE_FORM = defineActionForm({
|
|
4162
3967
|
label: {
|
|
4163
3968
|
id: "event.tennis-club-membership.action.certificate.form.label",
|
|
@@ -4957,7 +4762,7 @@ var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
|
|
|
4957
4762
|
conditionals: [
|
|
4958
4763
|
{
|
|
4959
4764
|
type: ConditionalType.DISPLAY_ON_REVIEW,
|
|
4960
|
-
conditional:
|
|
4765
|
+
conditional: never()
|
|
4961
4766
|
}
|
|
4962
4767
|
]
|
|
4963
4768
|
},
|
|
@@ -5340,16 +5145,119 @@ var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
|
|
|
5340
5145
|
}
|
|
5341
5146
|
}
|
|
5342
5147
|
],
|
|
5343
|
-
conditional: not(
|
|
5148
|
+
conditional: not(never())
|
|
5344
5149
|
// Intentional always-true page conditional to exercise interactions between page-level and field-level conditionals in tests
|
|
5345
5150
|
}
|
|
5346
5151
|
]
|
|
5347
5152
|
});
|
|
5153
|
+
var statusOptions = [
|
|
5154
|
+
{
|
|
5155
|
+
value: "ALL",
|
|
5156
|
+
label: {
|
|
5157
|
+
defaultMessage: "Any status",
|
|
5158
|
+
description: "Option for form field: status of record",
|
|
5159
|
+
id: "advancedSearch.form.recordStatusAny"
|
|
5160
|
+
}
|
|
5161
|
+
},
|
|
5162
|
+
{
|
|
5163
|
+
value: EventStatus.enum.CREATED,
|
|
5164
|
+
label: {
|
|
5165
|
+
defaultMessage: "Draft",
|
|
5166
|
+
description: "Option for form field: status of record",
|
|
5167
|
+
id: "advancedSearch.form.recordStatusCreated"
|
|
5168
|
+
}
|
|
5169
|
+
},
|
|
5170
|
+
{
|
|
5171
|
+
value: EventStatus.enum.NOTIFIED,
|
|
5172
|
+
label: {
|
|
5173
|
+
defaultMessage: "Notified",
|
|
5174
|
+
description: "Option for form field: status of record",
|
|
5175
|
+
id: "advancedSearch.form.recordStatusNotified"
|
|
5176
|
+
}
|
|
5177
|
+
},
|
|
5178
|
+
{
|
|
5179
|
+
value: EventStatus.enum.DECLARED,
|
|
5180
|
+
label: {
|
|
5181
|
+
defaultMessage: "Declared",
|
|
5182
|
+
description: "Option for form field: status of record",
|
|
5183
|
+
id: "advancedSearch.form.recordStatusDeclared"
|
|
5184
|
+
}
|
|
5185
|
+
},
|
|
5186
|
+
{
|
|
5187
|
+
value: EventStatus.enum.VALIDATED,
|
|
5188
|
+
label: {
|
|
5189
|
+
defaultMessage: "Validated",
|
|
5190
|
+
description: "Option for form field: status of record",
|
|
5191
|
+
id: "advancedSearch.form.recordStatusValidated"
|
|
5192
|
+
}
|
|
5193
|
+
},
|
|
5194
|
+
{
|
|
5195
|
+
value: EventStatus.enum.REGISTERED,
|
|
5196
|
+
label: {
|
|
5197
|
+
defaultMessage: "Registered",
|
|
5198
|
+
description: "Option for form field: status of record",
|
|
5199
|
+
id: "advancedSearch.form.recordStatusRegistered"
|
|
5200
|
+
}
|
|
5201
|
+
},
|
|
5202
|
+
{
|
|
5203
|
+
value: EventStatus.enum.ARCHIVED,
|
|
5204
|
+
label: {
|
|
5205
|
+
defaultMessage: "Archived",
|
|
5206
|
+
description: "Option for form field: status of record",
|
|
5207
|
+
id: "advancedSearch.form.recordStatusArchived"
|
|
5208
|
+
}
|
|
5209
|
+
}
|
|
5210
|
+
];
|
|
5211
|
+
var timePeriodOptions = [
|
|
5212
|
+
{
|
|
5213
|
+
label: {
|
|
5214
|
+
defaultMessage: "Last 7 days",
|
|
5215
|
+
description: "Label for option of time period select: last 7 days",
|
|
5216
|
+
id: "form.section.label.timePeriodLast7Days"
|
|
5217
|
+
},
|
|
5218
|
+
value: `${(0, import_date_fns3.format)((0, import_date_fns3.subDays)(/* @__PURE__ */ new Date(), 7), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
|
|
5219
|
+
/* @__PURE__ */ new Date(),
|
|
5220
|
+
"yyyy-MM-dd"
|
|
5221
|
+
)}`
|
|
5222
|
+
},
|
|
5223
|
+
{
|
|
5224
|
+
label: {
|
|
5225
|
+
defaultMessage: "Last 30 days",
|
|
5226
|
+
description: "Label for option of time period select: last 30 days",
|
|
5227
|
+
id: "form.section.label.timePeriodLast30Days"
|
|
5228
|
+
},
|
|
5229
|
+
value: `${(0, import_date_fns3.format)((0, import_date_fns3.subMonths)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
|
|
5230
|
+
/* @__PURE__ */ new Date(),
|
|
5231
|
+
"yyyy-MM-dd"
|
|
5232
|
+
)}`
|
|
5233
|
+
},
|
|
5234
|
+
{
|
|
5235
|
+
label: {
|
|
5236
|
+
defaultMessage: "Last 90 days",
|
|
5237
|
+
description: "Label for option of time period select: last 90 days",
|
|
5238
|
+
id: "form.section.label.timePeriodLast90Days"
|
|
5239
|
+
},
|
|
5240
|
+
value: `${(0, import_date_fns3.format)((0, import_date_fns3.subQuarters)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
|
|
5241
|
+
/* @__PURE__ */ new Date(),
|
|
5242
|
+
"yyyy-MM-dd"
|
|
5243
|
+
)}`
|
|
5244
|
+
},
|
|
5245
|
+
{
|
|
5246
|
+
label: {
|
|
5247
|
+
defaultMessage: "Last year",
|
|
5248
|
+
description: "Label for option of time period select: last year",
|
|
5249
|
+
id: "form.section.label.timePeriodLastYear"
|
|
5250
|
+
},
|
|
5251
|
+
value: `${(0, import_date_fns3.format)((0, import_date_fns3.subYears)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
|
|
5252
|
+
/* @__PURE__ */ new Date(),
|
|
5253
|
+
"yyyy-MM-dd"
|
|
5254
|
+
)}`
|
|
5255
|
+
}
|
|
5256
|
+
];
|
|
5348
5257
|
|
|
5349
5258
|
// ../commons/src/fixtures/tennis-club-membership-event.ts
|
|
5350
5259
|
var tennisClubMembershipEvent = defineConfig({
|
|
5351
5260
|
id: TENNIS_CLUB_MEMBERSHIP,
|
|
5352
|
-
declaration: TENNIS_CLUB_DECLARATION_FORM,
|
|
5353
5261
|
label: {
|
|
5354
5262
|
defaultMessage: "Tennis club membership application",
|
|
5355
5263
|
description: "This is what this event is referred as in the system",
|
|
@@ -5400,12 +5308,13 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5400
5308
|
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5401
5309
|
},
|
|
5402
5310
|
{
|
|
5403
|
-
type: ActionType.
|
|
5311
|
+
type: ActionType.VALIDATE,
|
|
5404
5312
|
label: {
|
|
5405
|
-
defaultMessage: "
|
|
5313
|
+
defaultMessage: "Validate",
|
|
5406
5314
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5407
|
-
id: "event.tennis-club-membership.action.
|
|
5408
|
-
}
|
|
5315
|
+
id: "event.tennis-club-membership.action.validate.label"
|
|
5316
|
+
},
|
|
5317
|
+
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5409
5318
|
},
|
|
5410
5319
|
{
|
|
5411
5320
|
type: ActionType.REGISTER,
|
|
@@ -5413,7 +5322,8 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5413
5322
|
defaultMessage: "Register",
|
|
5414
5323
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5415
5324
|
id: "event.tennis-club-membership.action.register.label"
|
|
5416
|
-
}
|
|
5325
|
+
},
|
|
5326
|
+
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5417
5327
|
},
|
|
5418
5328
|
{
|
|
5419
5329
|
type: ActionType.REQUEST_CORRECTION,
|
|
@@ -5616,6 +5526,14 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5616
5526
|
]
|
|
5617
5527
|
}
|
|
5618
5528
|
},
|
|
5529
|
+
{
|
|
5530
|
+
type: ActionType.APPROVE_CORRECTION,
|
|
5531
|
+
label: {
|
|
5532
|
+
defaultMessage: "Approve correction",
|
|
5533
|
+
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5534
|
+
id: "event.tennis-club-membership.action.correction.approve.label"
|
|
5535
|
+
}
|
|
5536
|
+
},
|
|
5619
5537
|
{
|
|
5620
5538
|
type: ActionType.PRINT_CERTIFICATE,
|
|
5621
5539
|
label: {
|
|
@@ -5624,6 +5542,22 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5624
5542
|
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5625
5543
|
},
|
|
5626
5544
|
printForm: PRINT_CERTIFICATE_FORM
|
|
5545
|
+
},
|
|
5546
|
+
{
|
|
5547
|
+
type: ActionType.ARCHIVE,
|
|
5548
|
+
label: {
|
|
5549
|
+
id: "event.tennis-club-membership.action.archive.label",
|
|
5550
|
+
defaultMessage: "Archive",
|
|
5551
|
+
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5552
|
+
}
|
|
5553
|
+
},
|
|
5554
|
+
{
|
|
5555
|
+
type: ActionType.REJECT,
|
|
5556
|
+
label: {
|
|
5557
|
+
id: "event.tennis-club-membership.action.reject.label",
|
|
5558
|
+
defaultMessage: "Reject",
|
|
5559
|
+
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5560
|
+
}
|
|
5627
5561
|
}
|
|
5628
5562
|
],
|
|
5629
5563
|
advancedSearch: [
|
|
@@ -5660,7 +5594,8 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5660
5594
|
},
|
|
5661
5595
|
fields: [field("recommender.name").fuzzy()]
|
|
5662
5596
|
}
|
|
5663
|
-
]
|
|
5597
|
+
],
|
|
5598
|
+
declaration: TENNIS_CLUB_DECLARATION_FORM
|
|
5664
5599
|
});
|
|
5665
5600
|
|
|
5666
5601
|
// ../commons/src/fixtures/football-club-membership-event.ts
|
|
@@ -5728,13 +5663,23 @@ var footballClubMembershipEvent = defineConfig({
|
|
|
5728
5663
|
},
|
|
5729
5664
|
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5730
5665
|
},
|
|
5666
|
+
{
|
|
5667
|
+
type: ActionType.VALIDATE,
|
|
5668
|
+
label: {
|
|
5669
|
+
defaultMessage: "Validate",
|
|
5670
|
+
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5671
|
+
id: "event.football-club-membership.action.validate.label"
|
|
5672
|
+
},
|
|
5673
|
+
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5674
|
+
},
|
|
5731
5675
|
{
|
|
5732
5676
|
type: ActionType.REGISTER,
|
|
5733
5677
|
label: {
|
|
5734
5678
|
defaultMessage: "Register",
|
|
5735
5679
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5736
5680
|
id: "event.football-club-membership.action.register.label"
|
|
5737
|
-
}
|
|
5681
|
+
},
|
|
5682
|
+
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5738
5683
|
},
|
|
5739
5684
|
{
|
|
5740
5685
|
type: ActionType.REQUEST_CORRECTION,
|
|
@@ -5940,6 +5885,14 @@ var footballClubMembershipEvent = defineConfig({
|
|
|
5940
5885
|
]
|
|
5941
5886
|
}
|
|
5942
5887
|
},
|
|
5888
|
+
{
|
|
5889
|
+
type: ActionType.APPROVE_CORRECTION,
|
|
5890
|
+
label: {
|
|
5891
|
+
defaultMessage: "Approve correction",
|
|
5892
|
+
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
5893
|
+
id: "event.football-club-membership.action.correction.approve.label"
|
|
5894
|
+
}
|
|
5895
|
+
},
|
|
5943
5896
|
{
|
|
5944
5897
|
type: ActionType.PRINT_CERTIFICATE,
|
|
5945
5898
|
label: {
|
|
@@ -5948,6 +5901,22 @@ var footballClubMembershipEvent = defineConfig({
|
|
|
5948
5901
|
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5949
5902
|
},
|
|
5950
5903
|
printForm: PRINT_CERTIFICATE_FORM
|
|
5904
|
+
},
|
|
5905
|
+
{
|
|
5906
|
+
type: ActionType.ARCHIVE,
|
|
5907
|
+
label: {
|
|
5908
|
+
id: "event.football-club-membership.action.archive.label",
|
|
5909
|
+
defaultMessage: "Archive",
|
|
5910
|
+
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5911
|
+
}
|
|
5912
|
+
},
|
|
5913
|
+
{
|
|
5914
|
+
type: ActionType.REJECT,
|
|
5915
|
+
label: {
|
|
5916
|
+
id: "event.football-club-membership.action.reject.label",
|
|
5917
|
+
defaultMessage: "Reject",
|
|
5918
|
+
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
5919
|
+
}
|
|
5951
5920
|
}
|
|
5952
5921
|
],
|
|
5953
5922
|
advancedSearch: [
|
|
@@ -6047,7 +6016,7 @@ var libraryMembershipEvent = defineConfig({
|
|
|
6047
6016
|
declaration: libraryMembershipForm
|
|
6048
6017
|
});
|
|
6049
6018
|
|
|
6050
|
-
// ../commons/src/fixtures/
|
|
6019
|
+
// ../commons/src/fixtures/v2-birth-event.ts
|
|
6051
6020
|
function generateTranslationConfig(message) {
|
|
6052
6021
|
return {
|
|
6053
6022
|
defaultMessage: message,
|
|
@@ -6076,61 +6045,6 @@ var child = defineFormPage({
|
|
|
6076
6045
|
secured: true,
|
|
6077
6046
|
validation: [],
|
|
6078
6047
|
label: generateTranslationConfig("Date of birth")
|
|
6079
|
-
},
|
|
6080
|
-
{
|
|
6081
|
-
id: "child.placeOfBirth",
|
|
6082
|
-
analytics: true,
|
|
6083
|
-
type: FieldType.SELECT,
|
|
6084
|
-
required: true,
|
|
6085
|
-
secured: true,
|
|
6086
|
-
label: {
|
|
6087
|
-
defaultMessage: "Place of delivery",
|
|
6088
|
-
description: "This is the label for the field",
|
|
6089
|
-
id: "event.birth.action.declare.form.section.child.field.placeOfBirth.label"
|
|
6090
|
-
},
|
|
6091
|
-
options: [
|
|
6092
|
-
{
|
|
6093
|
-
value: "child.placeOfBirth-SELECT-2",
|
|
6094
|
-
label: generateTranslationConfig("Health Institution")
|
|
6095
|
-
},
|
|
6096
|
-
{
|
|
6097
|
-
value: "PRIVATE_HOME",
|
|
6098
|
-
label: generateTranslationConfig("Residential address")
|
|
6099
|
-
}
|
|
6100
|
-
]
|
|
6101
|
-
},
|
|
6102
|
-
{
|
|
6103
|
-
id: "child.birthLocation",
|
|
6104
|
-
analytics: true,
|
|
6105
|
-
type: "FACILITY",
|
|
6106
|
-
required: true,
|
|
6107
|
-
secured: true,
|
|
6108
|
-
label: generateTranslationConfig("Health Institution"),
|
|
6109
|
-
conditionals: [
|
|
6110
|
-
{
|
|
6111
|
-
type: "SHOW",
|
|
6112
|
-
conditional: field("child.placeOfBirth").isEqualTo(
|
|
6113
|
-
"child.placeOfBirth-SELECT-2"
|
|
6114
|
-
)
|
|
6115
|
-
}
|
|
6116
|
-
]
|
|
6117
|
-
},
|
|
6118
|
-
{
|
|
6119
|
-
id: "child.birthLocation.privateHome",
|
|
6120
|
-
analytics: true,
|
|
6121
|
-
type: FieldType.ADDRESS,
|
|
6122
|
-
secured: true,
|
|
6123
|
-
hideLabel: true,
|
|
6124
|
-
label: generateTranslationConfig("Child's address"),
|
|
6125
|
-
conditionals: [
|
|
6126
|
-
{
|
|
6127
|
-
type: "SHOW",
|
|
6128
|
-
conditional: field("child.placeOfBirth").isEqualTo("PRIVATE_HOME")
|
|
6129
|
-
}
|
|
6130
|
-
],
|
|
6131
|
-
configuration: {
|
|
6132
|
-
streetAddressForm: []
|
|
6133
|
-
}
|
|
6134
6048
|
}
|
|
6135
6049
|
]
|
|
6136
6050
|
});
|
|
@@ -6234,7 +6148,7 @@ var mother = defineFormPage({
|
|
|
6234
6148
|
}
|
|
6235
6149
|
]
|
|
6236
6150
|
});
|
|
6237
|
-
var
|
|
6151
|
+
var BIRTH_DECLARATION_REVIEW = {
|
|
6238
6152
|
title: generateTranslationConfig(
|
|
6239
6153
|
"{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}}}}}"
|
|
6240
6154
|
),
|
|
@@ -6254,12 +6168,12 @@ var CHILD_ONBOARDING_DECLARATION_REVIEW = {
|
|
|
6254
6168
|
}
|
|
6255
6169
|
]
|
|
6256
6170
|
};
|
|
6257
|
-
var
|
|
6171
|
+
var BIRTH_DECLARATION_FORM = defineDeclarationForm({
|
|
6258
6172
|
label: generateTranslationConfig("Birth decalration form"),
|
|
6259
6173
|
pages: [child, mother]
|
|
6260
6174
|
});
|
|
6261
|
-
var
|
|
6262
|
-
id:
|
|
6175
|
+
var v2BirthEvent = defineConfig({
|
|
6176
|
+
id: BIRTH_EVENT,
|
|
6263
6177
|
title: generateTranslationConfig(
|
|
6264
6178
|
"{child.name.firstname} {child.name.surname}"
|
|
6265
6179
|
),
|
|
@@ -6267,21 +6181,27 @@ var ChildOnboardingEvent = defineConfig({
|
|
|
6267
6181
|
summary: {
|
|
6268
6182
|
fields: []
|
|
6269
6183
|
},
|
|
6270
|
-
declaration:
|
|
6184
|
+
declaration: BIRTH_DECLARATION_FORM,
|
|
6271
6185
|
actions: [
|
|
6272
6186
|
{
|
|
6273
6187
|
type: ActionType.READ,
|
|
6274
6188
|
label: generateTranslationConfig("Read"),
|
|
6275
|
-
review:
|
|
6189
|
+
review: BIRTH_DECLARATION_REVIEW
|
|
6276
6190
|
},
|
|
6277
6191
|
{
|
|
6278
6192
|
type: ActionType.DECLARE,
|
|
6279
6193
|
label: generateTranslationConfig("Declare"),
|
|
6280
|
-
review:
|
|
6194
|
+
review: BIRTH_DECLARATION_REVIEW
|
|
6195
|
+
},
|
|
6196
|
+
{
|
|
6197
|
+
type: ActionType.VALIDATE,
|
|
6198
|
+
label: generateTranslationConfig("Validate"),
|
|
6199
|
+
review: BIRTH_DECLARATION_REVIEW
|
|
6281
6200
|
},
|
|
6282
6201
|
{
|
|
6283
6202
|
type: ActionType.REGISTER,
|
|
6284
|
-
label: generateTranslationConfig("Register")
|
|
6203
|
+
label: generateTranslationConfig("Register"),
|
|
6204
|
+
review: BIRTH_DECLARATION_REVIEW
|
|
6285
6205
|
}
|
|
6286
6206
|
],
|
|
6287
6207
|
advancedSearch: []
|
|
@@ -6369,7 +6289,7 @@ var PRINT_DIGITAL_ID_CERTIFICATE_FORM = defineActionForm({
|
|
|
6369
6289
|
conditionals: [
|
|
6370
6290
|
{
|
|
6371
6291
|
type: ConditionalType.ENABLE,
|
|
6372
|
-
conditional:
|
|
6292
|
+
conditional: never()
|
|
6373
6293
|
},
|
|
6374
6294
|
{
|
|
6375
6295
|
type: ConditionalType.SHOW,
|
|
@@ -6396,7 +6316,7 @@ var PRINT_DIGITAL_ID_CERTIFICATE_FORM = defineActionForm({
|
|
|
6396
6316
|
conditionals: [
|
|
6397
6317
|
{
|
|
6398
6318
|
type: ConditionalType.ENABLE,
|
|
6399
|
-
conditional:
|
|
6319
|
+
conditional: never()
|
|
6400
6320
|
},
|
|
6401
6321
|
{
|
|
6402
6322
|
type: ConditionalType.SHOW,
|
|
@@ -6424,7 +6344,7 @@ var PRINT_DIGITAL_ID_CERTIFICATE_FORM = defineActionForm({
|
|
|
6424
6344
|
conditionals: [
|
|
6425
6345
|
{
|
|
6426
6346
|
type: ConditionalType.ENABLE,
|
|
6427
|
-
conditional:
|
|
6347
|
+
conditional: never()
|
|
6428
6348
|
}
|
|
6429
6349
|
],
|
|
6430
6350
|
value: field("identity.http-fetch").get("data.certificateId")
|
|
@@ -6502,8 +6422,8 @@ var digitalIdentityEvent = defineConfig({
|
|
|
6502
6422
|
});
|
|
6503
6423
|
|
|
6504
6424
|
// ../commons/src/events/test.utils.ts
|
|
6505
|
-
var
|
|
6506
|
-
var TestUserRole =
|
|
6425
|
+
var import_zod36 = require("zod");
|
|
6426
|
+
var TestUserRole = import_zod36.z.enum([
|
|
6507
6427
|
"FIELD_AGENT",
|
|
6508
6428
|
"LOCAL_REGISTRAR",
|
|
6509
6429
|
"LOCAL_SYSTEM_ADMIN",
|
|
@@ -6514,14 +6434,18 @@ var TestUserRole = z38.enum([
|
|
|
6514
6434
|
]);
|
|
6515
6435
|
|
|
6516
6436
|
// ../commons/src/events/scopes.ts
|
|
6517
|
-
var
|
|
6437
|
+
var import_lodash5 = require("lodash");
|
|
6518
6438
|
var ACTION_SCOPE_MAP = {
|
|
6519
6439
|
[ActionType.READ]: ["record.read"],
|
|
6520
6440
|
[ActionType.CREATE]: ["record.create"],
|
|
6521
6441
|
[ActionType.NOTIFY]: ["record.notify"],
|
|
6522
|
-
[ActionType.DECLARE]: [
|
|
6523
|
-
|
|
6442
|
+
[ActionType.DECLARE]: [
|
|
6443
|
+
"record.declare",
|
|
6444
|
+
"record.declared.validate",
|
|
6445
|
+
"record.register"
|
|
6446
|
+
],
|
|
6524
6447
|
[ActionType.DELETE]: ["record.declare"],
|
|
6448
|
+
[ActionType.VALIDATE]: ["record.declared.validate", "record.register"],
|
|
6525
6449
|
[ActionType.REGISTER]: ["record.register"],
|
|
6526
6450
|
[ActionType.PRINT_CERTIFICATE]: ["record.registered.print-certified-copies"],
|
|
6527
6451
|
[ActionType.REQUEST_CORRECTION]: [
|
|
@@ -6539,8 +6463,7 @@ var ACTION_SCOPE_MAP = {
|
|
|
6539
6463
|
[ActionType.REJECT]: ["record.declared.reject"],
|
|
6540
6464
|
[ActionType.ASSIGN]: null,
|
|
6541
6465
|
[ActionType.UNASSIGN]: null,
|
|
6542
|
-
[ActionType.DUPLICATE_DETECTED]: []
|
|
6543
|
-
[ActionType.CUSTOM]: []
|
|
6466
|
+
[ActionType.DUPLICATE_DETECTED]: []
|
|
6544
6467
|
};
|
|
6545
6468
|
|
|
6546
6469
|
// ../commons/src/events/state/availableActions.ts
|
|
@@ -6549,25 +6472,28 @@ var AVAILABLE_ACTIONS_BY_EVENT_STATUS = {
|
|
|
6549
6472
|
ActionType.READ,
|
|
6550
6473
|
ActionType.DECLARE,
|
|
6551
6474
|
ActionType.NOTIFY,
|
|
6552
|
-
ActionType.DELETE
|
|
6553
|
-
ActionType.CUSTOM
|
|
6475
|
+
ActionType.DELETE
|
|
6554
6476
|
],
|
|
6555
6477
|
[EventStatus.enum.NOTIFIED]: [
|
|
6556
6478
|
ActionType.READ,
|
|
6557
|
-
ActionType.
|
|
6479
|
+
ActionType.DECLARE,
|
|
6558
6480
|
ActionType.MARK_AS_DUPLICATE,
|
|
6559
6481
|
ActionType.ARCHIVE,
|
|
6560
|
-
ActionType.REJECT
|
|
6561
|
-
ActionType.CUSTOM
|
|
6482
|
+
ActionType.REJECT
|
|
6562
6483
|
],
|
|
6563
6484
|
[EventStatus.enum.DECLARED]: [
|
|
6485
|
+
ActionType.READ,
|
|
6486
|
+
ActionType.VALIDATE,
|
|
6487
|
+
ActionType.MARK_AS_DUPLICATE,
|
|
6488
|
+
ActionType.ARCHIVE,
|
|
6489
|
+
ActionType.REJECT
|
|
6490
|
+
],
|
|
6491
|
+
[EventStatus.enum.VALIDATED]: [
|
|
6564
6492
|
ActionType.READ,
|
|
6565
6493
|
ActionType.REGISTER,
|
|
6566
6494
|
ActionType.MARK_AS_DUPLICATE,
|
|
6567
6495
|
ActionType.ARCHIVE,
|
|
6568
|
-
ActionType.REJECT
|
|
6569
|
-
ActionType.CUSTOM,
|
|
6570
|
-
ActionType.EDIT
|
|
6496
|
+
ActionType.REJECT
|
|
6571
6497
|
],
|
|
6572
6498
|
[EventStatus.enum.REGISTERED]: [
|
|
6573
6499
|
ActionType.READ,
|
|
@@ -6575,14 +6501,12 @@ var AVAILABLE_ACTIONS_BY_EVENT_STATUS = {
|
|
|
6575
6501
|
ActionType.REQUEST_CORRECTION,
|
|
6576
6502
|
ActionType.APPROVE_CORRECTION,
|
|
6577
6503
|
ActionType.REJECT_CORRECTION,
|
|
6578
|
-
ActionType.CUSTOM,
|
|
6579
6504
|
ClientSpecificAction.REVIEW_CORRECTION_REQUEST
|
|
6580
6505
|
],
|
|
6581
6506
|
[EventStatus.enum.ARCHIVED]: [
|
|
6582
6507
|
ActionType.READ,
|
|
6583
6508
|
ActionType.ASSIGN,
|
|
6584
|
-
ActionType.UNASSIGN
|
|
6585
|
-
ActionType.CUSTOM
|
|
6509
|
+
ActionType.UNASSIGN
|
|
6586
6510
|
]
|
|
6587
6511
|
};
|
|
6588
6512
|
var ACTION_FILTERS = {
|
|
@@ -6592,41 +6516,32 @@ var ACTION_FILTERS = {
|
|
|
6592
6516
|
[ActionType.APPROVE_CORRECTION]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6593
6517
|
[ActionType.REJECT_CORRECTION]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6594
6518
|
[ActionType.MARK_AS_DUPLICATE]: (flags) => flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6595
|
-
[ActionType.
|
|
6519
|
+
[ActionType.VALIDATE]: (flags) => !flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6596
6520
|
[ActionType.REGISTER]: (flags) => !flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6597
6521
|
[ActionType.REJECT]: (flags) => !flags.includes(InherentFlags.REJECTED) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
6598
6522
|
[ActionType.ARCHIVE]: (flags) => !flags.some((flag) => flag.endsWith(":requested"))
|
|
6599
6523
|
};
|
|
6600
6524
|
|
|
6601
6525
|
// ../commons/src/events/FileUtils.ts
|
|
6602
|
-
var
|
|
6526
|
+
var import_lodash6 = require("lodash");
|
|
6603
6527
|
|
|
6604
6528
|
// ../commons/src/events/locations.ts
|
|
6605
|
-
var
|
|
6606
|
-
var
|
|
6529
|
+
var import_zod37 = require("zod");
|
|
6530
|
+
var LocationType = import_zod37.z.enum([
|
|
6607
6531
|
"ADMIN_STRUCTURE",
|
|
6608
6532
|
"CRVS_OFFICE",
|
|
6609
6533
|
"HEALTH_FACILITY"
|
|
6610
6534
|
]);
|
|
6611
|
-
var
|
|
6612
|
-
var AdministrativeArea = z39.object({
|
|
6535
|
+
var Location = import_zod37.z.object({
|
|
6613
6536
|
id: UUID,
|
|
6614
|
-
name:
|
|
6615
|
-
externalId: z39.string().nullish(),
|
|
6537
|
+
name: import_zod37.z.string(),
|
|
6616
6538
|
parentId: UUID.nullable(),
|
|
6617
|
-
validUntil:
|
|
6618
|
-
|
|
6619
|
-
var Location = z39.object({
|
|
6620
|
-
id: UUID,
|
|
6621
|
-
name: z39.string(),
|
|
6622
|
-
externalId: z39.string().nullish(),
|
|
6623
|
-
administrativeAreaId: UUID.nullable(),
|
|
6624
|
-
validUntil: z39.iso.datetime().nullable(),
|
|
6625
|
-
locationType: z39.string().nullable()
|
|
6539
|
+
validUntil: import_zod37.z.string().datetime().nullable(),
|
|
6540
|
+
locationType: LocationType.nullable()
|
|
6626
6541
|
});
|
|
6627
6542
|
|
|
6628
6543
|
// ../commons/src/notification/UserNotifications.ts
|
|
6629
|
-
var
|
|
6544
|
+
var import_zod38 = require("zod");
|
|
6630
6545
|
var TriggerEvent = {
|
|
6631
6546
|
USER_CREATED: "user-created",
|
|
6632
6547
|
USER_UPDATED: "user-updated",
|
|
@@ -6638,50 +6553,50 @@ var TriggerEvent = {
|
|
|
6638
6553
|
CHANGE_PHONE_NUMBER: "change-phone-number",
|
|
6639
6554
|
CHANGE_EMAIL_ADDRESS: "change-email-address"
|
|
6640
6555
|
};
|
|
6641
|
-
var Recipient =
|
|
6556
|
+
var Recipient = import_zod38.z.object({
|
|
6642
6557
|
name: NameFieldValue.optional(),
|
|
6643
|
-
mobile:
|
|
6644
|
-
email:
|
|
6645
|
-
bcc:
|
|
6558
|
+
mobile: import_zod38.z.string().optional(),
|
|
6559
|
+
email: import_zod38.z.string().optional(),
|
|
6560
|
+
bcc: import_zod38.z.array(import_zod38.z.string()).optional()
|
|
6646
6561
|
});
|
|
6647
|
-
var BasePayload =
|
|
6562
|
+
var BasePayload = import_zod38.z.object({
|
|
6648
6563
|
recipient: Recipient
|
|
6649
6564
|
});
|
|
6650
6565
|
var TriggerPayload = {
|
|
6651
6566
|
[TriggerEvent.USER_CREATED]: BasePayload.extend({
|
|
6652
|
-
username:
|
|
6653
|
-
temporaryPassword:
|
|
6567
|
+
username: import_zod38.z.string(),
|
|
6568
|
+
temporaryPassword: import_zod38.z.string()
|
|
6654
6569
|
}),
|
|
6655
6570
|
[TriggerEvent.USER_UPDATED]: BasePayload.extend({
|
|
6656
|
-
oldUsername:
|
|
6657
|
-
newUsername:
|
|
6571
|
+
oldUsername: import_zod38.z.string(),
|
|
6572
|
+
newUsername: import_zod38.z.string()
|
|
6658
6573
|
}),
|
|
6659
6574
|
[TriggerEvent.USERNAME_REMINDER]: BasePayload.extend({
|
|
6660
|
-
username:
|
|
6575
|
+
username: import_zod38.z.string()
|
|
6661
6576
|
}),
|
|
6662
6577
|
[TriggerEvent.RESET_PASSWORD]: BasePayload.extend({
|
|
6663
|
-
code:
|
|
6578
|
+
code: import_zod38.z.string()
|
|
6664
6579
|
}),
|
|
6665
6580
|
[TriggerEvent.RESET_PASSWORD_BY_ADMIN]: BasePayload.extend({
|
|
6666
|
-
temporaryPassword:
|
|
6667
|
-
admin:
|
|
6668
|
-
id:
|
|
6581
|
+
temporaryPassword: import_zod38.z.string(),
|
|
6582
|
+
admin: import_zod38.z.object({
|
|
6583
|
+
id: import_zod38.z.string(),
|
|
6669
6584
|
name: NameFieldValue,
|
|
6670
|
-
role:
|
|
6585
|
+
role: import_zod38.z.string()
|
|
6671
6586
|
})
|
|
6672
6587
|
}),
|
|
6673
6588
|
[TriggerEvent.TWO_FA]: BasePayload.extend({
|
|
6674
|
-
code:
|
|
6589
|
+
code: import_zod38.z.string()
|
|
6675
6590
|
}),
|
|
6676
6591
|
[TriggerEvent.ALL_USER_NOTIFICATION]: BasePayload.extend({
|
|
6677
|
-
subject:
|
|
6678
|
-
body:
|
|
6592
|
+
subject: import_zod38.z.string(),
|
|
6593
|
+
body: import_zod38.z.string()
|
|
6679
6594
|
}),
|
|
6680
6595
|
[TriggerEvent.CHANGE_PHONE_NUMBER]: BasePayload.extend({
|
|
6681
|
-
code:
|
|
6596
|
+
code: import_zod38.z.string()
|
|
6682
6597
|
}),
|
|
6683
6598
|
[TriggerEvent.CHANGE_EMAIL_ADDRESS]: BasePayload.extend({
|
|
6684
|
-
code:
|
|
6599
|
+
code: import_zod38.z.string()
|
|
6685
6600
|
})
|
|
6686
6601
|
};
|
|
6687
6602
|
async function triggerUserEventNotification({
|
|
@@ -6703,6 +6618,3 @@ function parseUserEventTrigger(event2, body) {
|
|
|
6703
6618
|
const schema = TriggerPayload[event2];
|
|
6704
6619
|
return schema.parse(body);
|
|
6705
6620
|
}
|
|
6706
|
-
|
|
6707
|
-
// src/notification/index.ts
|
|
6708
|
-
z41.globalRegistry.clear();
|