@opencrvs/toolkit 1.8.1-rc.2d48701 → 1.8.1-rc.308ccbb
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 +394 -395
- package/dist/commons/conditionals/validate.d.ts +8 -0
- package/dist/commons/events/ActionConfig.d.ts +3924 -642
- package/dist/commons/events/ActionDocument.d.ts +736 -736
- package/dist/commons/events/ActionInput.d.ts +600 -600
- package/dist/commons/events/AdvancedSearchConfig.d.ts +49 -31
- package/dist/commons/events/CompositeFieldValue.d.ts +6 -6
- package/dist/commons/events/CountryConfigQueryInput.d.ts +88 -88
- package/dist/commons/events/Draft.d.ts +56 -56
- package/dist/commons/events/EventConfig.d.ts +1259 -240
- package/dist/commons/events/EventDocument.d.ts +432 -432
- package/dist/commons/events/EventIndex.d.ts +62 -62
- package/dist/commons/events/EventMetadata.d.ts +9 -9
- package/dist/commons/events/FieldConfig.d.ts +1064 -71
- package/dist/commons/events/FieldType.d.ts +5 -0
- package/dist/commons/events/FieldTypeMapping.d.ts +16 -16
- package/dist/commons/events/FieldValue.d.ts +12 -12
- package/dist/commons/events/FormConfig.d.ts +1956 -378
- package/dist/commons/events/PageConfig.d.ts +524 -82
- package/dist/commons/events/WorkqueueConfig.d.ts +199 -164
- package/dist/commons/events/defineConfig.d.ts +181 -46
- package/dist/commons/events/event.d.ts +6 -6
- package/dist/commons/events/test.utils.d.ts +14 -13
- package/dist/commons/events/utils.d.ts +341 -195
- package/dist/conditionals/index.js +3 -2
- package/dist/events/index.js +960 -837
- package/package.json +1 -1
- package/tsconfig.json +1 -1
- package/dist/commons/conditionals/conditionals.test.d.ts +0 -2
- package/dist/commons/conditionals/validate-address.test.d.ts +0 -2
- package/dist/commons/conditionals/validate.test.d.ts +0 -2
- package/dist/commons/events/utils.test.d.ts +0 -2
package/dist/events/index.js
CHANGED
@@ -40,6 +40,7 @@ __export(events_exports, {
|
|
40
40
|
ActionConfigBase: () => ActionConfigBase,
|
41
41
|
ActionCreationMetadata: () => ActionCreationMetadata,
|
42
42
|
ActionDocument: () => ActionDocument,
|
43
|
+
ActionFlag: () => ActionFlag,
|
43
44
|
ActionFormConfig: () => ActionFormConfig,
|
44
45
|
ActionInput: () => ActionInput,
|
45
46
|
ActionStatus: () => ActionStatus,
|
@@ -51,6 +52,7 @@ __export(events_exports, {
|
|
51
52
|
AddressType: () => AddressType,
|
52
53
|
AdministrativeAreas: () => AdministrativeAreas,
|
53
54
|
AdvancedSearchConfig: () => AdvancedSearchConfig,
|
55
|
+
AnyFileField: () => AnyFileField,
|
54
56
|
AnyOf: () => AnyOf,
|
55
57
|
AnyOfStatus: () => AnyOfStatus,
|
56
58
|
ApproveCorrectionActionInput: () => ApproveCorrectionActionInput,
|
@@ -95,6 +97,7 @@ __export(events_exports, {
|
|
95
97
|
EventDocument: () => EventDocument,
|
96
98
|
EventFieldConfigSchema: () => EventFieldConfigSchema,
|
97
99
|
EventFieldId: () => EventFieldId,
|
100
|
+
EventFieldIdInput: () => EventFieldIdInput,
|
98
101
|
EventIndex: () => EventIndex,
|
99
102
|
EventInput: () => EventInput,
|
100
103
|
EventMetadata: () => EventMetadata,
|
@@ -115,6 +118,7 @@ __export(events_exports, {
|
|
115
118
|
FieldType: () => FieldType,
|
116
119
|
FieldUpdateValue: () => FieldUpdateValue,
|
117
120
|
FieldValue: () => FieldValue,
|
121
|
+
FileFieldType: () => FileFieldType,
|
118
122
|
FileFieldValue: () => FileFieldValue,
|
119
123
|
FileFieldValueWithOption: () => FileFieldValueWithOption,
|
120
124
|
FileFieldWithOptionValue: () => FileFieldWithOptionValue,
|
@@ -129,8 +133,10 @@ __export(events_exports, {
|
|
129
133
|
InherentFlags: () => InherentFlags,
|
130
134
|
LanguageConfig: () => LanguageConfig,
|
131
135
|
LegalStatuses: () => LegalStatuses,
|
136
|
+
METADATA_FIELD_PREFIX: () => METADATA_FIELD_PREFIX,
|
132
137
|
MarkedAsDuplicateActionInput: () => MarkedAsDuplicateActionInput,
|
133
138
|
MimeType: () => MimeType,
|
139
|
+
NameConfig: () => NameConfig,
|
134
140
|
NameFieldUpdateValue: () => NameFieldUpdateValue,
|
135
141
|
NameFieldValue: () => NameFieldValue,
|
136
142
|
NonEmptyTextValue: () => NonEmptyTextValue,
|
@@ -168,6 +174,7 @@ __export(events_exports, {
|
|
168
174
|
TENNIS_CLUB_MEMBERSHIP: () => TENNIS_CLUB_MEMBERSHIP,
|
169
175
|
TEST_SYSTEM_IANA_TIMEZONE: () => TEST_SYSTEM_IANA_TIMEZONE,
|
170
176
|
TestUserRole: () => TestUserRole,
|
177
|
+
TextField: () => TextField,
|
171
178
|
TextValue: () => TextValue,
|
172
179
|
TimeValue: () => TimeValue,
|
173
180
|
TranslationConfig: () => TranslationConfig,
|
@@ -179,7 +186,6 @@ __export(events_exports, {
|
|
179
186
|
ValidationConfig: () => ValidationConfig,
|
180
187
|
VerificationActionConfig: () => VerificationActionConfig,
|
181
188
|
VerificationPageConfig: () => VerificationPageConfig,
|
182
|
-
VisibleStatus: () => VisibleStatus,
|
183
189
|
WRITE_ACTION_SCOPES: () => WRITE_ACTION_SCOPES,
|
184
190
|
Within: () => Within,
|
185
191
|
WorkqueueActionsWithDefault: () => WorkqueueActionsWithDefault,
|
@@ -197,7 +203,7 @@ __export(events_exports, {
|
|
197
203
|
and: () => and,
|
198
204
|
annotationActions: () => annotationActions,
|
199
205
|
applyDeclarationToEventIndex: () => applyDeclarationToEventIndex,
|
200
|
-
|
206
|
+
applyDraftToEventIndex: () => applyDraftToEventIndex,
|
201
207
|
areCertificateConditionsMet: () => areCertificateConditionsMet,
|
202
208
|
areConditionsMet: () => areConditionsMet,
|
203
209
|
compositeFieldTypes: () => compositeFieldTypes,
|
@@ -205,6 +211,7 @@ __export(events_exports, {
|
|
205
211
|
createFieldConditionals: () => createFieldConditionals,
|
206
212
|
createPrng: () => createPrng,
|
207
213
|
createValidationSchema: () => createValidationSchema,
|
214
|
+
dangerouslyGetCurrentEventStateWithDrafts: () => dangerouslyGetCurrentEventStateWithDrafts,
|
208
215
|
deepDropNulls: () => deepDropNulls,
|
209
216
|
deepMerge: () => deepMerge,
|
210
217
|
defaultWorkqueueColumns: () => defaultWorkqueueColumns,
|
@@ -226,7 +233,7 @@ __export(events_exports, {
|
|
226
233
|
eventQueryDataGenerator: () => eventQueryDataGenerator,
|
227
234
|
field: () => field,
|
228
235
|
fieldTypes: () => fieldTypes,
|
229
|
-
|
236
|
+
findActiveDraftForEvent: () => findActiveDraftForEvent,
|
230
237
|
findAllFields: () => findAllFields,
|
231
238
|
findLastAssignmentAction: () => findLastAssignmentAction,
|
232
239
|
findRecordActionPages: () => findRecordActionPages,
|
@@ -254,7 +261,6 @@ __export(events_exports, {
|
|
254
261
|
getAssignedUserSignatureFromActions: () => getAssignedUserSignatureFromActions,
|
255
262
|
getAvailableActionsForEvent: () => getAvailableActionsForEvent,
|
256
263
|
getCurrentEventState: () => getCurrentEventState,
|
257
|
-
getCurrentEventStateWithDrafts: () => getCurrentEventStateWithDrafts,
|
258
264
|
getDeclaration: () => getDeclaration,
|
259
265
|
getDeclarationFieldById: () => getDeclarationFieldById,
|
260
266
|
getDeclarationFields: () => getDeclarationFields,
|
@@ -314,6 +320,7 @@ __export(events_exports, {
|
|
314
320
|
mapFieldTypeToEmptyValue: () => mapFieldTypeToEmptyValue,
|
315
321
|
mapFieldTypeToMockValue: () => mapFieldTypeToMockValue,
|
316
322
|
mapFieldTypeToZod: () => mapFieldTypeToZod,
|
323
|
+
mergeDrafts: () => mergeDrafts,
|
317
324
|
never: () => never,
|
318
325
|
not: () => not,
|
319
326
|
omitHiddenAnnotationFields: () => omitHiddenAnnotationFields,
|
@@ -322,6 +329,7 @@ __export(events_exports, {
|
|
322
329
|
or: () => or,
|
323
330
|
resolveDateOfEvent: () => resolveDateOfEvent,
|
324
331
|
runFieldValidations: () => runFieldValidations,
|
332
|
+
runStructuralValidations: () => runStructuralValidations,
|
325
333
|
timePeriodToDateRange: () => timePeriodToDateRange,
|
326
334
|
user: () => user,
|
327
335
|
validate: () => validate,
|
@@ -336,7 +344,7 @@ var TENNIS_CLUB_MEMBERSHIP = "tennis-club-membership";
|
|
336
344
|
var BIRTH_EVENT = "v2-birth";
|
337
345
|
|
338
346
|
// ../commons/src/events/ActionConfig.ts
|
339
|
-
var
|
347
|
+
var import_zod11 = require("zod");
|
340
348
|
|
341
349
|
// ../commons/src/events/Conditional.ts
|
342
350
|
var import_zod = require("zod");
|
@@ -506,9 +514,10 @@ function isMetaAction(actionType) {
|
|
506
514
|
}
|
507
515
|
|
508
516
|
// ../commons/src/events/FieldConfig.ts
|
509
|
-
var
|
517
|
+
var import_zod8 = require("zod");
|
510
518
|
|
511
519
|
// ../commons/src/events/FieldType.ts
|
520
|
+
var import_zod4 = require("zod");
|
512
521
|
var FieldType = {
|
513
522
|
NAME: "NAME",
|
514
523
|
PHONE: "PHONE",
|
@@ -541,6 +550,11 @@ var FieldType = {
|
|
541
550
|
SIGNATURE: "SIGNATURE",
|
542
551
|
DATA: "DATA"
|
543
552
|
};
|
553
|
+
var FileFieldType = import_zod4.z.enum([
|
554
|
+
FieldType.FILE,
|
555
|
+
FieldType.FILE_WITH_OPTIONS,
|
556
|
+
FieldType.SIGNATURE
|
557
|
+
]);
|
544
558
|
var fieldTypes = Object.values(FieldType);
|
545
559
|
var compositeFieldTypes = [
|
546
560
|
FieldType.DATE_RANGE,
|
@@ -550,24 +564,24 @@ var compositeFieldTypes = [
|
|
550
564
|
];
|
551
565
|
|
552
566
|
// ../commons/src/events/FieldValue.ts
|
553
|
-
var
|
567
|
+
var import_zod7 = require("zod");
|
554
568
|
|
555
569
|
// ../commons/src/documents.ts
|
556
|
-
var
|
570
|
+
var import_zod5 = require("zod");
|
557
571
|
var import_zod_openapi3 = require("zod-openapi");
|
558
|
-
(0, import_zod_openapi3.extendZodWithOpenApi)(
|
559
|
-
var
|
572
|
+
(0, import_zod_openapi3.extendZodWithOpenApi)(import_zod5.z);
|
573
|
+
var FullDocumentUrl = import_zod5.z.string().brand("FullDocumentUrl").describe(
|
560
574
|
"A full url with protocol, host, bucket name, starting from the root of the S3 server, https://minio/bucket-name/document-id.jpg"
|
561
575
|
);
|
562
|
-
var FullDocumentPath =
|
576
|
+
var FullDocumentPath = import_zod5.z.string().transform((val) => val.startsWith("/") ? val : `/${val}`).openapi({ effectType: "input", type: "string" }).describe(
|
563
577
|
"A full absolute path with bucket name, starting from the root of the S3 server, /bucket-name/document-id.jpg"
|
564
578
|
);
|
565
|
-
var DocumentPath =
|
579
|
+
var DocumentPath = import_zod5.z.string().brand("DocumentPath").describe(
|
566
580
|
"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"
|
567
581
|
);
|
568
582
|
|
569
583
|
// ../commons/src/events/CompositeFieldValue.ts
|
570
|
-
var
|
584
|
+
var import_zod6 = require("zod");
|
571
585
|
var GeographicalArea = {
|
572
586
|
URBAN: "URBAN",
|
573
587
|
RURAL: "RURAL"
|
@@ -576,110 +590,110 @@ var AddressType = {
|
|
576
590
|
DOMESTIC: "DOMESTIC",
|
577
591
|
INTERNATIONAL: "INTERNATIONAL"
|
578
592
|
};
|
579
|
-
var FileFieldValue =
|
593
|
+
var FileFieldValue = import_zod6.z.object({
|
580
594
|
path: FullDocumentPath,
|
581
|
-
originalFilename:
|
582
|
-
type:
|
595
|
+
originalFilename: import_zod6.z.string(),
|
596
|
+
type: import_zod6.z.string()
|
583
597
|
});
|
584
|
-
var AdminStructure =
|
585
|
-
country:
|
586
|
-
addressType:
|
587
|
-
province:
|
588
|
-
district:
|
598
|
+
var AdminStructure = import_zod6.z.object({
|
599
|
+
country: import_zod6.z.string(),
|
600
|
+
addressType: import_zod6.z.literal(AddressType.DOMESTIC),
|
601
|
+
province: import_zod6.z.string(),
|
602
|
+
district: import_zod6.z.string()
|
589
603
|
});
|
590
604
|
var UrbanAddressValue = AdminStructure.extend({
|
591
|
-
urbanOrRural:
|
592
|
-
town:
|
593
|
-
residentialArea:
|
594
|
-
street:
|
595
|
-
number:
|
596
|
-
zipCode:
|
605
|
+
urbanOrRural: import_zod6.z.literal(GeographicalArea.URBAN),
|
606
|
+
town: import_zod6.z.string().optional(),
|
607
|
+
residentialArea: import_zod6.z.string().optional(),
|
608
|
+
street: import_zod6.z.string().optional(),
|
609
|
+
number: import_zod6.z.string().optional(),
|
610
|
+
zipCode: import_zod6.z.string().optional()
|
597
611
|
});
|
598
612
|
var RuralAddressValue = AdminStructure.extend({
|
599
|
-
urbanOrRural:
|
600
|
-
village:
|
613
|
+
urbanOrRural: import_zod6.z.literal(GeographicalArea.RURAL),
|
614
|
+
village: import_zod6.z.string().optional()
|
601
615
|
});
|
602
616
|
var UrbanAddressUpdateValue = AdminStructure.extend({
|
603
|
-
urbanOrRural:
|
604
|
-
town:
|
605
|
-
residentialArea:
|
606
|
-
street:
|
607
|
-
number:
|
608
|
-
zipCode:
|
617
|
+
urbanOrRural: import_zod6.z.literal(GeographicalArea.URBAN),
|
618
|
+
town: import_zod6.z.string().nullish(),
|
619
|
+
residentialArea: import_zod6.z.string().nullish(),
|
620
|
+
street: import_zod6.z.string().nullish(),
|
621
|
+
number: import_zod6.z.string().nullish(),
|
622
|
+
zipCode: import_zod6.z.string().nullish()
|
609
623
|
});
|
610
|
-
var NameFieldValue =
|
611
|
-
firstname:
|
612
|
-
surname:
|
613
|
-
middlename:
|
624
|
+
var NameFieldValue = import_zod6.z.object({
|
625
|
+
firstname: import_zod6.z.string(),
|
626
|
+
surname: import_zod6.z.string(),
|
627
|
+
middlename: import_zod6.z.string().optional()
|
614
628
|
});
|
615
|
-
var NameFieldUpdateValue =
|
616
|
-
firstname:
|
617
|
-
surname:
|
618
|
-
middlename:
|
619
|
-
}).or(
|
629
|
+
var NameFieldUpdateValue = import_zod6.z.object({
|
630
|
+
firstname: import_zod6.z.string(),
|
631
|
+
surname: import_zod6.z.string(),
|
632
|
+
middlename: import_zod6.z.string().nullish()
|
633
|
+
}).or(import_zod6.z.null()).or(import_zod6.z.undefined());
|
620
634
|
var RuralAddressUpdateValue = AdminStructure.extend({
|
621
|
-
urbanOrRural:
|
622
|
-
village:
|
635
|
+
urbanOrRural: import_zod6.z.literal(GeographicalArea.RURAL),
|
636
|
+
village: import_zod6.z.string().nullish()
|
623
637
|
});
|
624
|
-
var GenericAddressValue =
|
625
|
-
country:
|
626
|
-
addressType:
|
627
|
-
state:
|
628
|
-
district2:
|
629
|
-
cityOrTown:
|
630
|
-
addressLine1:
|
631
|
-
addressLine2:
|
632
|
-
addressLine3:
|
633
|
-
postcodeOrZip:
|
638
|
+
var GenericAddressValue = import_zod6.z.object({
|
639
|
+
country: import_zod6.z.string(),
|
640
|
+
addressType: import_zod6.z.literal(AddressType.INTERNATIONAL),
|
641
|
+
state: import_zod6.z.string(),
|
642
|
+
district2: import_zod6.z.string(),
|
643
|
+
cityOrTown: import_zod6.z.string().optional(),
|
644
|
+
addressLine1: import_zod6.z.string().optional(),
|
645
|
+
addressLine2: import_zod6.z.string().optional(),
|
646
|
+
addressLine3: import_zod6.z.string().optional(),
|
647
|
+
postcodeOrZip: import_zod6.z.string().optional()
|
634
648
|
});
|
635
|
-
var AddressFieldValue =
|
636
|
-
var GenericAddressUpdateValue =
|
637
|
-
country:
|
638
|
-
addressType:
|
639
|
-
state:
|
640
|
-
district2:
|
641
|
-
cityOrTown:
|
642
|
-
addressLine1:
|
643
|
-
addressLine2:
|
644
|
-
addressLine3:
|
645
|
-
postcodeOrZip:
|
649
|
+
var AddressFieldValue = import_zod6.z.discriminatedUnion("urbanOrRural", [UrbanAddressValue, RuralAddressValue]).or(GenericAddressValue);
|
650
|
+
var GenericAddressUpdateValue = import_zod6.z.object({
|
651
|
+
country: import_zod6.z.string(),
|
652
|
+
addressType: import_zod6.z.literal(AddressType.INTERNATIONAL),
|
653
|
+
state: import_zod6.z.string(),
|
654
|
+
district2: import_zod6.z.string(),
|
655
|
+
cityOrTown: import_zod6.z.string().nullish(),
|
656
|
+
addressLine1: import_zod6.z.string().nullish(),
|
657
|
+
addressLine2: import_zod6.z.string().nullish(),
|
658
|
+
addressLine3: import_zod6.z.string().nullish(),
|
659
|
+
postcodeOrZip: import_zod6.z.string().nullish()
|
646
660
|
});
|
647
|
-
var AddressFieldUpdateValue =
|
661
|
+
var AddressFieldUpdateValue = import_zod6.z.discriminatedUnion("urbanOrRural", [
|
648
662
|
UrbanAddressUpdateValue,
|
649
663
|
RuralAddressUpdateValue
|
650
664
|
]).or(GenericAddressUpdateValue);
|
651
|
-
var FileFieldValueWithOption =
|
665
|
+
var FileFieldValueWithOption = import_zod6.z.object({
|
652
666
|
path: FullDocumentPath,
|
653
|
-
originalFilename:
|
654
|
-
type:
|
655
|
-
option:
|
667
|
+
originalFilename: import_zod6.z.string(),
|
668
|
+
type: import_zod6.z.string(),
|
669
|
+
option: import_zod6.z.string()
|
656
670
|
});
|
657
|
-
var FileFieldWithOptionValue =
|
671
|
+
var FileFieldWithOptionValue = import_zod6.z.array(FileFieldValueWithOption);
|
658
672
|
|
659
673
|
// ../commons/src/events/FieldValue.ts
|
660
|
-
var TextValue =
|
674
|
+
var TextValue = import_zod7.z.string();
|
661
675
|
var NonEmptyTextValue = TextValue.min(1);
|
662
|
-
var DateValue =
|
663
|
-
var TimeValue =
|
664
|
-
var DatetimeValue =
|
665
|
-
var SelectDateRangeValue =
|
676
|
+
var DateValue = import_zod7.z.string().date().describe("Date in the format YYYY-MM-DD");
|
677
|
+
var TimeValue = import_zod7.z.string().regex(/^([01][0-9]|2[0-3]):[0-5][0-9]$/);
|
678
|
+
var DatetimeValue = import_zod7.z.string().datetime();
|
679
|
+
var SelectDateRangeValue = import_zod7.z.enum([
|
666
680
|
"last7Days",
|
667
681
|
"last30Days",
|
668
682
|
"last90Days",
|
669
683
|
"last365Days"
|
670
684
|
]);
|
671
|
-
var DateRangeFieldValue =
|
685
|
+
var DateRangeFieldValue = import_zod7.z.object({
|
672
686
|
start: DateValue,
|
673
687
|
end: DateValue
|
674
688
|
}).or(DateValue).describe(
|
675
689
|
"Date range with start and end dates in the format YYYY-MM-DD. Inclusive start, exclusive end."
|
676
690
|
);
|
677
|
-
var EmailValue =
|
678
|
-
var CheckboxFieldValue =
|
679
|
-
var NumberFieldValue =
|
680
|
-
var DataFieldValue =
|
681
|
-
var SignatureFieldValue =
|
682
|
-
var FieldValue =
|
691
|
+
var EmailValue = import_zod7.z.string().email();
|
692
|
+
var CheckboxFieldValue = import_zod7.z.boolean();
|
693
|
+
var NumberFieldValue = import_zod7.z.number();
|
694
|
+
var DataFieldValue = import_zod7.z.undefined();
|
695
|
+
var SignatureFieldValue = import_zod7.z.string();
|
696
|
+
var FieldValue = import_zod7.z.union([
|
683
697
|
TextValue,
|
684
698
|
DateValue,
|
685
699
|
TimeValue,
|
@@ -696,7 +710,7 @@ var FieldValue = import_zod6.z.union([
|
|
696
710
|
NameFieldValue,
|
697
711
|
NameFieldUpdateValue
|
698
712
|
]);
|
699
|
-
var FieldUpdateValue =
|
713
|
+
var FieldUpdateValue = import_zod7.z.union([
|
700
714
|
TextValue,
|
701
715
|
DateValue,
|
702
716
|
TimeValue,
|
@@ -715,67 +729,67 @@ var FieldUpdateValue = import_zod6.z.union([
|
|
715
729
|
|
716
730
|
// ../commons/src/events/FieldConfig.ts
|
717
731
|
var import_zod_openapi4 = require("zod-openapi");
|
718
|
-
(0, import_zod_openapi4.extendZodWithOpenApi)(
|
719
|
-
var FieldId =
|
720
|
-
var FieldReference =
|
732
|
+
(0, import_zod_openapi4.extendZodWithOpenApi)(import_zod8.z);
|
733
|
+
var FieldId = import_zod8.z.string().describe("Unique identifier for the field");
|
734
|
+
var FieldReference = import_zod8.z.object({
|
721
735
|
$$field: FieldId
|
722
736
|
}).describe("Reference to a field by its ID");
|
723
|
-
var ValidationConfig =
|
737
|
+
var ValidationConfig = import_zod8.z.object({
|
724
738
|
validator: Conditional,
|
725
739
|
message: TranslationConfig
|
726
740
|
});
|
727
|
-
var BaseField =
|
741
|
+
var BaseField = import_zod8.z.object({
|
728
742
|
id: FieldId,
|
729
743
|
label: TranslationConfig,
|
730
744
|
parent: FieldReference.optional().describe(
|
731
745
|
"Reference to a parent field. If a field has a parent, it will be reset when the parent field is changed."
|
732
746
|
),
|
733
|
-
required:
|
734
|
-
conditionals:
|
735
|
-
secured:
|
747
|
+
required: import_zod8.z.boolean().default(false).optional(),
|
748
|
+
conditionals: import_zod8.z.array(FieldConditional).default([]).optional(),
|
749
|
+
secured: import_zod8.z.boolean().default(false).optional(),
|
736
750
|
placeholder: TranslationConfig.optional(),
|
737
|
-
validation:
|
751
|
+
validation: import_zod8.z.array(ValidationConfig).default([]).optional(),
|
738
752
|
helperText: TranslationConfig.optional(),
|
739
|
-
hideLabel:
|
740
|
-
uncorrectable:
|
753
|
+
hideLabel: import_zod8.z.boolean().default(false).optional(),
|
754
|
+
uncorrectable: import_zod8.z.boolean().default(false).optional().describe(
|
741
755
|
"Indicates if the field can be changed during a record correction."
|
742
756
|
)
|
743
757
|
});
|
744
758
|
var Divider = BaseField.extend({
|
745
|
-
type:
|
759
|
+
type: import_zod8.z.literal(FieldType.DIVIDER)
|
746
760
|
});
|
747
761
|
var TextField = BaseField.extend({
|
748
|
-
type:
|
762
|
+
type: import_zod8.z.literal(FieldType.TEXT),
|
749
763
|
defaultValue: NonEmptyTextValue.optional(),
|
750
|
-
configuration:
|
751
|
-
maxLength:
|
752
|
-
type:
|
764
|
+
configuration: import_zod8.z.object({
|
765
|
+
maxLength: import_zod8.z.number().optional().describe("Maximum length of the text"),
|
766
|
+
type: import_zod8.z.enum(["text", "password"]).optional(),
|
753
767
|
prefix: TranslationConfig.optional(),
|
754
768
|
postfix: TranslationConfig.optional()
|
755
769
|
}).default({ type: "text" }).optional()
|
756
770
|
}).describe("Text input");
|
757
771
|
var NumberField = BaseField.extend({
|
758
|
-
type:
|
772
|
+
type: import_zod8.z.literal(FieldType.NUMBER),
|
759
773
|
defaultValue: NumberFieldValue.optional(),
|
760
|
-
configuration:
|
761
|
-
min:
|
762
|
-
max:
|
774
|
+
configuration: import_zod8.z.object({
|
775
|
+
min: import_zod8.z.number().optional().describe("Minimum value"),
|
776
|
+
max: import_zod8.z.number().optional().describe("Maximum value"),
|
763
777
|
prefix: TranslationConfig.optional(),
|
764
778
|
postfix: TranslationConfig.optional()
|
765
779
|
}).optional()
|
766
780
|
}).describe("Number input");
|
767
781
|
var TextAreaField = BaseField.extend({
|
768
|
-
type:
|
782
|
+
type: import_zod8.z.literal(FieldType.TEXTAREA),
|
769
783
|
defaultValue: NonEmptyTextValue.optional(),
|
770
|
-
configuration:
|
771
|
-
maxLength:
|
772
|
-
rows:
|
773
|
-
cols:
|
784
|
+
configuration: import_zod8.z.object({
|
785
|
+
maxLength: import_zod8.z.number().optional().describe("Maximum length of the text"),
|
786
|
+
rows: import_zod8.z.number().optional().describe("Number of visible text lines"),
|
787
|
+
cols: import_zod8.z.number().optional().describe("Number of visible columns"),
|
774
788
|
prefix: TranslationConfig.optional(),
|
775
789
|
postfix: TranslationConfig.optional()
|
776
790
|
}).default({ rows: 4 }).optional()
|
777
791
|
}).describe("Multiline text input");
|
778
|
-
var ImageMimeType =
|
792
|
+
var ImageMimeType = import_zod8.z.enum([
|
779
793
|
"image/png",
|
780
794
|
"image/jpg",
|
781
795
|
"image/jpeg",
|
@@ -784,53 +798,53 @@ var ImageMimeType = import_zod7.z.enum([
|
|
784
798
|
var MimeType = ImageMimeType;
|
785
799
|
var DEFAULT_MAX_FILE_SIZE_BYTES = 5 * 1024 * 1024;
|
786
800
|
var SignatureField = BaseField.extend({
|
787
|
-
type:
|
801
|
+
type: import_zod8.z.literal(FieldType.SIGNATURE),
|
788
802
|
signaturePromptLabel: TranslationConfig.describe(
|
789
803
|
"Title of the signature modal"
|
790
804
|
),
|
791
805
|
defaultValue: SignatureFieldValue.optional(),
|
792
|
-
configuration:
|
793
|
-
maxFileSize:
|
806
|
+
configuration: import_zod8.z.object({
|
807
|
+
maxFileSize: import_zod8.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
794
808
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
795
809
|
}).default({
|
796
810
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
797
811
|
})
|
798
812
|
}).describe("Signature input field");
|
799
813
|
var EmailField = BaseField.extend({
|
800
|
-
type:
|
801
|
-
configuration:
|
802
|
-
maxLength:
|
814
|
+
type: import_zod8.z.literal(FieldType.EMAIL),
|
815
|
+
configuration: import_zod8.z.object({
|
816
|
+
maxLength: import_zod8.z.number().optional().describe("Maximum length of the text")
|
803
817
|
}).default({ maxLength: 10 }).optional(),
|
804
818
|
defaultValue: NonEmptyTextValue.optional()
|
805
819
|
});
|
806
820
|
var DateField = BaseField.extend({
|
807
|
-
type:
|
821
|
+
type: import_zod8.z.literal(FieldType.DATE),
|
808
822
|
defaultValue: DateValue.optional(),
|
809
|
-
configuration:
|
823
|
+
configuration: import_zod8.z.object({
|
810
824
|
notice: TranslationConfig.describe(
|
811
825
|
"Text to display above the date input"
|
812
826
|
).optional()
|
813
827
|
}).optional()
|
814
828
|
}).describe("A single date input (yyyy-MM-dd)");
|
815
829
|
var TimeField = BaseField.extend({
|
816
|
-
type:
|
830
|
+
type: import_zod8.z.literal(FieldType.TIME),
|
817
831
|
defaultValue: TimeValue.optional(),
|
818
|
-
configuration:
|
832
|
+
configuration: import_zod8.z.object({
|
819
833
|
notice: TranslationConfig.describe(
|
820
834
|
"Text to display above the time input"
|
821
835
|
).optional()
|
822
836
|
}).optional()
|
823
837
|
}).describe("A single date input (HH-mm)");
|
824
838
|
var DateRangeField = BaseField.extend({
|
825
|
-
type:
|
839
|
+
type: import_zod8.z.literal(FieldType.DATE_RANGE),
|
826
840
|
defaultValue: DateRangeFieldValue.optional(),
|
827
|
-
configuration:
|
841
|
+
configuration: import_zod8.z.object({
|
828
842
|
notice: TranslationConfig.describe(
|
829
843
|
"Text to display above the date input"
|
830
844
|
).optional()
|
831
845
|
}).optional()
|
832
846
|
}).describe("A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })");
|
833
|
-
var HtmlFontVariant =
|
847
|
+
var HtmlFontVariant = import_zod8.z.enum([
|
834
848
|
"reg12",
|
835
849
|
"reg14",
|
836
850
|
"reg16",
|
@@ -840,31 +854,31 @@ var HtmlFontVariant = import_zod7.z.enum([
|
|
840
854
|
"h2",
|
841
855
|
"h1"
|
842
856
|
]);
|
843
|
-
var ParagraphConfiguration =
|
844
|
-
styles:
|
857
|
+
var ParagraphConfiguration = import_zod8.z.object({
|
858
|
+
styles: import_zod8.z.object({
|
845
859
|
fontVariant: HtmlFontVariant.optional().describe(
|
846
860
|
"Font variant to use for the paragraph text"
|
847
861
|
),
|
848
|
-
hint:
|
862
|
+
hint: import_zod8.z.boolean().optional().describe("When true, paragraph is styled as a hint with grey color")
|
849
863
|
}).optional()
|
850
864
|
}).default({});
|
851
865
|
var Paragraph = BaseField.extend({
|
852
|
-
type:
|
866
|
+
type: import_zod8.z.literal(FieldType.PARAGRAPH),
|
853
867
|
defaultValue: NonEmptyTextValue.optional(),
|
854
868
|
configuration: ParagraphConfiguration
|
855
869
|
}).describe("A read-only HTML <p> paragraph");
|
856
870
|
var PageHeader = BaseField.extend({
|
857
|
-
type:
|
871
|
+
type: import_zod8.z.literal(FieldType.PAGE_HEADER),
|
858
872
|
defaultValue: NonEmptyTextValue.optional()
|
859
873
|
}).describe("A read-only header component for form pages");
|
860
874
|
var File = BaseField.extend({
|
861
|
-
type:
|
875
|
+
type: import_zod8.z.literal(FieldType.FILE),
|
862
876
|
defaultValue: FileFieldValue.optional(),
|
863
|
-
configuration:
|
864
|
-
maxFileSize:
|
877
|
+
configuration: import_zod8.z.object({
|
878
|
+
maxFileSize: import_zod8.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
865
879
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature"),
|
866
|
-
style:
|
867
|
-
width:
|
880
|
+
style: import_zod8.z.object({
|
881
|
+
width: import_zod8.z.enum(["full", "auto"]).optional().describe(
|
868
882
|
"Whether the file upload button should take the full width of the container or not"
|
869
883
|
)
|
870
884
|
}).optional(),
|
@@ -873,140 +887,176 @@ var File = BaseField.extend({
|
|
873
887
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
874
888
|
})
|
875
889
|
}).describe("File upload");
|
876
|
-
var SelectOption =
|
877
|
-
value:
|
890
|
+
var SelectOption = import_zod8.z.object({
|
891
|
+
value: import_zod8.z.string().describe("The value of the option"),
|
878
892
|
label: TranslationConfig.describe("The label of the option")
|
879
893
|
});
|
880
894
|
var RadioGroup = BaseField.extend({
|
881
|
-
type:
|
895
|
+
type: import_zod8.z.literal(FieldType.RADIO_GROUP),
|
882
896
|
defaultValue: TextValue.optional(),
|
883
|
-
options:
|
884
|
-
configuration:
|
885
|
-
styles:
|
886
|
-
size:
|
897
|
+
options: import_zod8.z.array(SelectOption).describe("A list of options"),
|
898
|
+
configuration: import_zod8.z.object({
|
899
|
+
styles: import_zod8.z.object({
|
900
|
+
size: import_zod8.z.enum(["NORMAL", "LARGE"]).optional()
|
887
901
|
}).optional()
|
888
902
|
}).optional()
|
889
903
|
}).describe("Grouped radio options");
|
890
904
|
var BulletList = BaseField.extend({
|
891
|
-
type:
|
905
|
+
type: import_zod8.z.literal(FieldType.BULLET_LIST),
|
892
906
|
defaultValue: TextValue.optional(),
|
893
|
-
items:
|
894
|
-
configuration:
|
895
|
-
styles:
|
907
|
+
items: import_zod8.z.array(TranslationConfig).describe("A list of items"),
|
908
|
+
configuration: import_zod8.z.object({
|
909
|
+
styles: import_zod8.z.object({
|
896
910
|
fontVariant: HtmlFontVariant.optional()
|
897
911
|
}).optional()
|
898
912
|
}).default({})
|
899
913
|
}).describe("A list of bullet points");
|
900
914
|
var Select = BaseField.extend({
|
901
|
-
type:
|
915
|
+
type: import_zod8.z.literal(FieldType.SELECT),
|
902
916
|
defaultValue: TextValue.optional(),
|
903
|
-
options:
|
917
|
+
options: import_zod8.z.array(SelectOption).describe("A list of options")
|
904
918
|
}).describe("Select input");
|
905
|
-
var SelectDateRangeOption =
|
919
|
+
var SelectDateRangeOption = import_zod8.z.object({
|
906
920
|
value: SelectDateRangeValue.describe("The value of the option"),
|
907
921
|
label: TranslationConfig.describe("The label of the option")
|
908
922
|
});
|
909
923
|
var SelectDateRangeField = BaseField.extend({
|
910
|
-
type:
|
924
|
+
type: import_zod8.z.literal(FieldType.SELECT_DATE_RANGE),
|
911
925
|
defaultValue: SelectDateRangeValue.optional(),
|
912
|
-
options:
|
926
|
+
options: import_zod8.z.array(SelectDateRangeOption).describe("A list of options")
|
913
927
|
}).describe("Select input with date range options");
|
928
|
+
var NameConfig = import_zod8.z.object({
|
929
|
+
firstname: import_zod8.z.object({ required: import_zod8.z.boolean(), label: TranslationConfig.optional() }).optional(),
|
930
|
+
middlename: import_zod8.z.object({ required: import_zod8.z.boolean(), label: TranslationConfig.optional() }).optional(),
|
931
|
+
surname: import_zod8.z.object({ required: import_zod8.z.boolean(), label: TranslationConfig.optional() }).optional()
|
932
|
+
});
|
914
933
|
var NameField = BaseField.extend({
|
915
|
-
type:
|
916
|
-
defaultValue:
|
917
|
-
firstname: NonEmptyTextValue,
|
918
|
-
|
934
|
+
type: import_zod8.z.literal(FieldType.NAME),
|
935
|
+
defaultValue: import_zod8.z.object({
|
936
|
+
firstname: NonEmptyTextValue.optional(),
|
937
|
+
middlename: NonEmptyTextValue.optional(),
|
938
|
+
surname: NonEmptyTextValue.optional()
|
919
939
|
}).optional(),
|
920
|
-
configuration:
|
921
|
-
|
940
|
+
configuration: import_zod8.z.object({
|
941
|
+
name: NameConfig.default({
|
942
|
+
firstname: { required: true },
|
943
|
+
surname: { required: true }
|
944
|
+
}).optional(),
|
945
|
+
order: import_zod8.z.array(import_zod8.z.enum(["firstname", "middlename", "surname"])).optional(),
|
946
|
+
maxLength: import_zod8.z.number().optional().describe("Maximum length of the text"),
|
922
947
|
prefix: TranslationConfig.optional(),
|
923
|
-
postfix: TranslationConfig.optional()
|
924
|
-
|
925
|
-
|
948
|
+
postfix: TranslationConfig.optional()
|
949
|
+
}).default({
|
950
|
+
name: {
|
951
|
+
firstname: { required: true },
|
952
|
+
surname: { required: true }
|
953
|
+
}
|
926
954
|
}).optional()
|
927
955
|
}).describe("Name input field");
|
928
956
|
var PhoneField = BaseField.extend({
|
929
957
|
defaultValue: NonEmptyTextValue.optional(),
|
930
|
-
type:
|
958
|
+
type: import_zod8.z.literal(FieldType.PHONE)
|
931
959
|
}).describe("Phone input field");
|
932
960
|
var IdField = BaseField.extend({
|
933
961
|
defaultValue: NonEmptyTextValue.optional(),
|
934
|
-
type:
|
962
|
+
type: import_zod8.z.literal(FieldType.ID)
|
935
963
|
}).describe("ID input field");
|
936
964
|
var Checkbox = BaseField.extend({
|
937
|
-
type:
|
965
|
+
type: import_zod8.z.literal(FieldType.CHECKBOX),
|
938
966
|
defaultValue: CheckboxFieldValue.optional()
|
939
967
|
}).describe("Boolean checkbox field");
|
940
968
|
var Country = BaseField.extend({
|
941
|
-
type:
|
969
|
+
type: import_zod8.z.literal(FieldType.COUNTRY),
|
942
970
|
defaultValue: NonEmptyTextValue.optional()
|
943
971
|
}).describe("Country select field");
|
944
|
-
var AdministrativeAreas =
|
972
|
+
var AdministrativeAreas = import_zod8.z.enum([
|
945
973
|
"ADMIN_STRUCTURE",
|
946
974
|
"HEALTH_FACILITY",
|
947
975
|
"CRVS_OFFICE"
|
948
976
|
]);
|
949
|
-
var AdministrativeAreaConfiguration =
|
950
|
-
partOf:
|
951
|
-
$declaration:
|
977
|
+
var AdministrativeAreaConfiguration = import_zod8.z.object({
|
978
|
+
partOf: import_zod8.z.object({
|
979
|
+
$declaration: import_zod8.z.string()
|
952
980
|
}).optional().describe("Parent location"),
|
953
981
|
type: AdministrativeAreas
|
954
982
|
}).describe("Administrative area options");
|
955
983
|
var AdministrativeArea = BaseField.extend({
|
956
|
-
type:
|
984
|
+
type: import_zod8.z.literal(FieldType.ADMINISTRATIVE_AREA),
|
957
985
|
defaultValue: NonEmptyTextValue.optional(),
|
958
986
|
configuration: AdministrativeAreaConfiguration
|
959
987
|
}).describe("Administrative area input field e.g. facility, office");
|
960
988
|
var Location = BaseField.extend({
|
961
|
-
type:
|
989
|
+
type: import_zod8.z.literal(FieldType.LOCATION),
|
962
990
|
defaultValue: NonEmptyTextValue.optional(),
|
963
|
-
configuration:
|
964
|
-
searchableResource:
|
991
|
+
configuration: import_zod8.z.object({
|
992
|
+
searchableResource: import_zod8.z.array(import_zod8.z.enum(["locations", "facilities", "offices"])).optional()
|
965
993
|
}).optional()
|
966
994
|
}).describe("Input field for a location");
|
967
995
|
var FileUploadWithOptions = BaseField.extend({
|
968
|
-
type:
|
969
|
-
options:
|
996
|
+
type: import_zod8.z.literal(FieldType.FILE_WITH_OPTIONS),
|
997
|
+
options: import_zod8.z.array(SelectOption).describe("A list of options"),
|
970
998
|
defaultValue: FileFieldWithOptionValue.optional(),
|
971
|
-
configuration:
|
972
|
-
maxFileSize:
|
999
|
+
configuration: import_zod8.z.object({
|
1000
|
+
maxFileSize: import_zod8.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
973
1001
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
974
1002
|
}).default({
|
975
1003
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
976
1004
|
})
|
977
1005
|
});
|
978
1006
|
var Facility = BaseField.extend({
|
979
|
-
type:
|
1007
|
+
type: import_zod8.z.literal(FieldType.FACILITY),
|
980
1008
|
defaultValue: NonEmptyTextValue.optional()
|
981
1009
|
}).describe("Input field for a facility");
|
982
1010
|
var Office = BaseField.extend({
|
983
|
-
type:
|
1011
|
+
type: import_zod8.z.literal(FieldType.OFFICE),
|
984
1012
|
defaultValue: NonEmptyTextValue.optional()
|
985
1013
|
}).describe("Input field for an office");
|
986
1014
|
var Address = BaseField.extend({
|
987
|
-
type:
|
988
|
-
|
989
|
-
|
990
|
-
|
991
|
-
|
1015
|
+
type: import_zod8.z.literal(FieldType.ADDRESS),
|
1016
|
+
configuration: import_zod8.z.object({
|
1017
|
+
lineSeparator: import_zod8.z.string().optional(),
|
1018
|
+
fields: import_zod8.z.array(
|
1019
|
+
import_zod8.z.enum([
|
1020
|
+
"number",
|
1021
|
+
"country",
|
1022
|
+
"province",
|
1023
|
+
"addressType",
|
1024
|
+
"district",
|
1025
|
+
"urbanOrRural",
|
1026
|
+
"town",
|
1027
|
+
"residentialArea",
|
1028
|
+
"street",
|
1029
|
+
"zipCode",
|
1030
|
+
"village",
|
1031
|
+
"state",
|
1032
|
+
"district2",
|
1033
|
+
"cityOrTown",
|
1034
|
+
"addressLine1",
|
1035
|
+
"addressLine2",
|
1036
|
+
"addressLine3",
|
1037
|
+
"postcodeOrZip"
|
1038
|
+
])
|
1039
|
+
).optional()
|
1040
|
+
}).optional(),
|
1041
|
+
defaultValue: AddressFieldValue.optional()
|
992
1042
|
}).describe("Address input field \u2013 a combination of location and text fields");
|
993
|
-
var DataEntry =
|
994
|
-
|
1043
|
+
var DataEntry = import_zod8.z.union([
|
1044
|
+
import_zod8.z.object({
|
995
1045
|
label: TranslationConfig,
|
996
|
-
value: TranslationConfig.or(
|
1046
|
+
value: TranslationConfig.or(import_zod8.z.string())
|
997
1047
|
}),
|
998
|
-
|
999
|
-
fieldId:
|
1048
|
+
import_zod8.z.object({
|
1049
|
+
fieldId: import_zod8.z.string()
|
1000
1050
|
})
|
1001
1051
|
]);
|
1002
1052
|
var DataField = BaseField.extend({
|
1003
|
-
type:
|
1004
|
-
configuration:
|
1053
|
+
type: import_zod8.z.literal(FieldType.DATA),
|
1054
|
+
configuration: import_zod8.z.object({
|
1005
1055
|
subtitle: TranslationConfig.optional(),
|
1006
|
-
data:
|
1056
|
+
data: import_zod8.z.array(DataEntry)
|
1007
1057
|
})
|
1008
1058
|
}).describe("Data field for displaying read-only data");
|
1009
|
-
var FieldConfig =
|
1059
|
+
var FieldConfig = import_zod8.z.discriminatedUnion("type", [
|
1010
1060
|
Address,
|
1011
1061
|
TextField,
|
1012
1062
|
NumberField,
|
@@ -1039,19 +1089,24 @@ var FieldConfig = import_zod7.z.discriminatedUnion("type", [
|
|
1039
1089
|
description: "Form field configuration",
|
1040
1090
|
ref: "FieldConfig"
|
1041
1091
|
});
|
1092
|
+
var AnyFileField = import_zod8.z.discriminatedUnion("type", [
|
1093
|
+
SignatureField,
|
1094
|
+
File,
|
1095
|
+
FileUploadWithOptions
|
1096
|
+
]);
|
1042
1097
|
|
1043
1098
|
// ../commons/src/events/FormConfig.ts
|
1044
|
-
var
|
1099
|
+
var import_zod10 = require("zod");
|
1045
1100
|
|
1046
1101
|
// ../commons/src/events/PageConfig.ts
|
1047
|
-
var
|
1102
|
+
var import_zod9 = require("zod");
|
1048
1103
|
var import_zod_openapi5 = require("zod-openapi");
|
1049
|
-
(0, import_zod_openapi5.extendZodWithOpenApi)(
|
1050
|
-
var PageTypes =
|
1051
|
-
var PageConfigBase =
|
1052
|
-
id:
|
1104
|
+
(0, import_zod_openapi5.extendZodWithOpenApi)(import_zod9.z);
|
1105
|
+
var PageTypes = import_zod9.z.enum(["FORM", "VERIFICATION"]);
|
1106
|
+
var PageConfigBase = import_zod9.z.object({
|
1107
|
+
id: import_zod9.z.string().describe("Unique identifier for the page"),
|
1053
1108
|
title: TranslationConfig.describe("Header title of the page"),
|
1054
|
-
fields:
|
1109
|
+
fields: import_zod9.z.array(FieldConfig).describe("Fields to be rendered on the page"),
|
1055
1110
|
conditional: Conditional.optional().describe(
|
1056
1111
|
"Page will be shown if condition is met. If conditional is not defined, the page will be always shown."
|
1057
1112
|
)
|
@@ -1060,13 +1115,13 @@ var PageConfigBase = import_zod8.z.object({
|
|
1060
1115
|
ref: "FormPageConfig"
|
1061
1116
|
});
|
1062
1117
|
var FormPageConfig = PageConfigBase.extend({
|
1063
|
-
type:
|
1118
|
+
type: import_zod9.z.literal(PageTypes.enum.FORM).default(PageTypes.enum.FORM)
|
1064
1119
|
});
|
1065
|
-
var VerificationActionConfig =
|
1066
|
-
verify:
|
1067
|
-
cancel:
|
1120
|
+
var VerificationActionConfig = import_zod9.z.object({
|
1121
|
+
verify: import_zod9.z.object({ label: TranslationConfig }),
|
1122
|
+
cancel: import_zod9.z.object({
|
1068
1123
|
label: TranslationConfig,
|
1069
|
-
confirmation:
|
1124
|
+
confirmation: import_zod9.z.object({
|
1070
1125
|
title: TranslationConfig,
|
1071
1126
|
body: TranslationConfig
|
1072
1127
|
})
|
@@ -1076,110 +1131,110 @@ var VerificationActionConfig = import_zod8.z.object({
|
|
1076
1131
|
ref: "VerificationActionConfig"
|
1077
1132
|
});
|
1078
1133
|
var VerificationPageConfig = FormPageConfig.extend({
|
1079
|
-
type:
|
1134
|
+
type: import_zod9.z.literal(PageTypes.enum.VERIFICATION),
|
1080
1135
|
actions: VerificationActionConfig
|
1081
1136
|
});
|
1082
|
-
var PageConfig =
|
1137
|
+
var PageConfig = import_zod9.z.discriminatedUnion("type", [
|
1083
1138
|
FormPageConfig,
|
1084
1139
|
VerificationPageConfig
|
1085
1140
|
]);
|
1086
1141
|
|
1087
1142
|
// ../commons/src/events/FormConfig.ts
|
1088
|
-
var DeclarationFormConfig =
|
1143
|
+
var DeclarationFormConfig = import_zod10.z.object({
|
1089
1144
|
label: TranslationConfig.describe("Human readable description of the form"),
|
1090
|
-
pages:
|
1145
|
+
pages: import_zod10.z.array(FormPageConfig)
|
1091
1146
|
}).describe("Configuration for a declaration form");
|
1092
|
-
var ActionFormConfig =
|
1147
|
+
var ActionFormConfig = import_zod10.z.object({
|
1093
1148
|
label: TranslationConfig.describe("Human readable description of the form"),
|
1094
|
-
pages:
|
1149
|
+
pages: import_zod10.z.array(PageConfig)
|
1095
1150
|
});
|
1096
|
-
var FormConfig =
|
1151
|
+
var FormConfig = import_zod10.z.union([DeclarationFormConfig, ActionFormConfig]);
|
1097
1152
|
|
1098
1153
|
// ../commons/src/events/ActionConfig.ts
|
1099
1154
|
var import_zod_openapi6 = require("zod-openapi");
|
1100
|
-
(0, import_zod_openapi6.extendZodWithOpenApi)(
|
1101
|
-
var ActionConditional2 =
|
1155
|
+
(0, import_zod_openapi6.extendZodWithOpenApi)(import_zod11.z);
|
1156
|
+
var ActionConditional2 = import_zod11.z.discriminatedUnion("type", [
|
1102
1157
|
/** If conditional is defined, the action is shown to the user only if the condition is met */
|
1103
1158
|
ShowConditional,
|
1104
1159
|
/** If conditional is defined, the action is enabled only if the condition is met */
|
1105
1160
|
EnableConditional
|
1106
1161
|
]);
|
1107
|
-
var DeclarationReviewConfig =
|
1162
|
+
var DeclarationReviewConfig = import_zod11.z.object({
|
1108
1163
|
title: TranslationConfig.describe("Title of the review page"),
|
1109
|
-
fields:
|
1164
|
+
fields: import_zod11.z.array(FieldConfig).describe("Fields to be rendered on the review page for annotations.")
|
1110
1165
|
}).describe("Configuration for **declaration** review page.");
|
1111
|
-
var ActionConfigBase =
|
1166
|
+
var ActionConfigBase = import_zod11.z.object({
|
1112
1167
|
label: TranslationConfig,
|
1113
|
-
conditionals:
|
1114
|
-
draft:
|
1168
|
+
conditionals: import_zod11.z.array(ActionConditional2).optional().default([]),
|
1169
|
+
draft: import_zod11.z.boolean().optional()
|
1115
1170
|
});
|
1116
1171
|
var ReadActionConfig = ActionConfigBase.merge(
|
1117
|
-
|
1118
|
-
type:
|
1172
|
+
import_zod11.z.object({
|
1173
|
+
type: import_zod11.z.literal(ActionType.READ),
|
1119
1174
|
review: DeclarationReviewConfig
|
1120
1175
|
})
|
1121
1176
|
);
|
1122
1177
|
var DeclareConfig = ActionConfigBase.merge(
|
1123
|
-
|
1124
|
-
type:
|
1178
|
+
import_zod11.z.object({
|
1179
|
+
type: import_zod11.z.literal(ActionType.DECLARE),
|
1125
1180
|
review: DeclarationReviewConfig
|
1126
1181
|
})
|
1127
1182
|
);
|
1128
1183
|
var ValidateConfig = ActionConfigBase.merge(
|
1129
|
-
|
1130
|
-
type:
|
1184
|
+
import_zod11.z.object({
|
1185
|
+
type: import_zod11.z.literal(ActionType.VALIDATE),
|
1131
1186
|
review: DeclarationReviewConfig
|
1132
1187
|
})
|
1133
1188
|
);
|
1134
1189
|
var RegisterConfig = ActionConfigBase.merge(
|
1135
|
-
|
1136
|
-
type:
|
1190
|
+
import_zod11.z.object({
|
1191
|
+
type: import_zod11.z.literal(ActionType.REGISTER),
|
1137
1192
|
review: DeclarationReviewConfig
|
1138
1193
|
})
|
1139
1194
|
);
|
1140
1195
|
var RejectDeclarationConfig = ActionConfigBase.merge(
|
1141
|
-
|
1142
|
-
type:
|
1196
|
+
import_zod11.z.object({
|
1197
|
+
type: import_zod11.z.literal(ActionType.REJECT)
|
1143
1198
|
})
|
1144
1199
|
);
|
1145
1200
|
var MarkedAsDuplicateConfig = ActionConfigBase.merge(
|
1146
|
-
|
1147
|
-
type:
|
1201
|
+
import_zod11.z.object({
|
1202
|
+
type: import_zod11.z.literal(ActionType.MARKED_AS_DUPLICATE)
|
1148
1203
|
})
|
1149
1204
|
);
|
1150
1205
|
var ArchiveConfig = ActionConfigBase.merge(
|
1151
|
-
|
1152
|
-
type:
|
1206
|
+
import_zod11.z.object({
|
1207
|
+
type: import_zod11.z.literal(ActionType.ARCHIVE)
|
1153
1208
|
})
|
1154
1209
|
);
|
1155
1210
|
var DeleteConfig = ActionConfigBase.merge(
|
1156
|
-
|
1157
|
-
type:
|
1211
|
+
import_zod11.z.object({
|
1212
|
+
type: import_zod11.z.literal(ActionType.DELETE)
|
1158
1213
|
})
|
1159
1214
|
);
|
1160
1215
|
var PrintCertificateActionConfig = ActionConfigBase.merge(
|
1161
|
-
|
1162
|
-
type:
|
1216
|
+
import_zod11.z.object({
|
1217
|
+
type: import_zod11.z.literal(ActionType.PRINT_CERTIFICATE),
|
1163
1218
|
printForm: ActionFormConfig
|
1164
1219
|
})
|
1165
1220
|
);
|
1166
1221
|
var RequestCorrectionConfig = ActionConfigBase.merge(
|
1167
|
-
|
1168
|
-
type:
|
1222
|
+
import_zod11.z.object({
|
1223
|
+
type: import_zod11.z.literal(ActionType.REQUEST_CORRECTION),
|
1169
1224
|
correctionForm: ActionFormConfig
|
1170
1225
|
})
|
1171
1226
|
);
|
1172
1227
|
var RejectCorrectionConfig = ActionConfigBase.merge(
|
1173
|
-
|
1174
|
-
type:
|
1228
|
+
import_zod11.z.object({
|
1229
|
+
type: import_zod11.z.literal(ActionType.REJECT_CORRECTION)
|
1175
1230
|
})
|
1176
1231
|
);
|
1177
1232
|
var ApproveCorrectionConfig = ActionConfigBase.merge(
|
1178
|
-
|
1179
|
-
type:
|
1233
|
+
import_zod11.z.object({
|
1234
|
+
type: import_zod11.z.literal(ActionType.APPROVE_CORRECTION)
|
1180
1235
|
})
|
1181
1236
|
);
|
1182
|
-
var ActionConfig =
|
1237
|
+
var ActionConfig = import_zod11.z.discriminatedUnion("type", [
|
1183
1238
|
/*
|
1184
1239
|
* OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
|
1185
1240
|
* and treat them as "models" instead of duplicating the data structure in each endpoint.
|
@@ -1199,109 +1254,109 @@ var ActionConfig = import_zod10.z.discriminatedUnion("type", [
|
|
1199
1254
|
RejectCorrectionConfig.openapi({ ref: "RejectCorrectionActionConfig" }),
|
1200
1255
|
ApproveCorrectionConfig.openapi({ ref: "ApproveCorrectionActionConfig" })
|
1201
1256
|
]).openapi({ ref: "ActionConfig" });
|
1202
|
-
var DeclarationActionConfig =
|
1257
|
+
var DeclarationActionConfig = import_zod11.z.discriminatedUnion("type", [
|
1203
1258
|
DeclareConfig,
|
1204
1259
|
ValidateConfig,
|
1205
1260
|
RegisterConfig
|
1206
1261
|
]);
|
1207
1262
|
|
1208
1263
|
// ../commons/src/events/offline/CertificateConfig.ts
|
1209
|
-
var
|
1210
|
-
var FontFamily =
|
1211
|
-
normal:
|
1212
|
-
bold:
|
1213
|
-
italics:
|
1214
|
-
bolditalics:
|
1264
|
+
var import_zod12 = require("zod");
|
1265
|
+
var FontFamily = import_zod12.z.object({
|
1266
|
+
normal: import_zod12.z.string(),
|
1267
|
+
bold: import_zod12.z.string(),
|
1268
|
+
italics: import_zod12.z.string(),
|
1269
|
+
bolditalics: import_zod12.z.string()
|
1215
1270
|
});
|
1216
|
-
var CertificateConfig =
|
1217
|
-
id:
|
1218
|
-
event:
|
1271
|
+
var CertificateConfig = import_zod12.z.object({
|
1272
|
+
id: import_zod12.z.string(),
|
1273
|
+
event: import_zod12.z.string(),
|
1219
1274
|
label: TranslationConfig,
|
1220
|
-
isDefault:
|
1221
|
-
fee:
|
1222
|
-
onTime:
|
1223
|
-
late:
|
1224
|
-
delayed:
|
1275
|
+
isDefault: import_zod12.z.boolean(),
|
1276
|
+
fee: import_zod12.z.object({
|
1277
|
+
onTime: import_zod12.z.number(),
|
1278
|
+
late: import_zod12.z.number(),
|
1279
|
+
delayed: import_zod12.z.number()
|
1225
1280
|
}),
|
1226
|
-
svgUrl:
|
1227
|
-
fonts:
|
1228
|
-
conditionals:
|
1281
|
+
svgUrl: import_zod12.z.string(),
|
1282
|
+
fonts: import_zod12.z.record(FontFamily).optional(),
|
1283
|
+
conditionals: import_zod12.z.array(ShowConditional).optional()
|
1229
1284
|
});
|
1230
1285
|
var CertificateTemplateConfig = CertificateConfig.extend({
|
1231
|
-
hash:
|
1232
|
-
svg:
|
1286
|
+
hash: import_zod12.z.string().optional(),
|
1287
|
+
svg: import_zod12.z.string()
|
1233
1288
|
});
|
1234
1289
|
|
1235
1290
|
// ../commons/src/events/offline/LanguageConfig.ts
|
1236
|
-
var
|
1237
|
-
var LanguageConfig =
|
1238
|
-
lang:
|
1291
|
+
var import_zod13 = require("zod");
|
1292
|
+
var LanguageConfig = import_zod13.z.object({
|
1293
|
+
lang: import_zod13.z.string(),
|
1239
1294
|
/**
|
1240
1295
|
* client.csv contents
|
1241
1296
|
*/
|
1242
|
-
messages:
|
1297
|
+
messages: import_zod13.z.record(import_zod13.z.string())
|
1243
1298
|
});
|
1244
1299
|
|
1245
1300
|
// ../commons/src/events/EventConfig.ts
|
1246
|
-
var
|
1301
|
+
var import_zod22 = require("zod");
|
1247
1302
|
|
1248
1303
|
// ../commons/src/events/DeduplicationConfig.ts
|
1249
|
-
var
|
1304
|
+
var import_zod14 = require("zod");
|
1250
1305
|
var import_zod_openapi7 = require("zod-openapi");
|
1251
|
-
(0, import_zod_openapi7.extendZodWithOpenApi)(
|
1252
|
-
var FieldReference2 =
|
1253
|
-
var Matcher =
|
1254
|
-
fieldId:
|
1255
|
-
options:
|
1256
|
-
boost:
|
1306
|
+
(0, import_zod_openapi7.extendZodWithOpenApi)(import_zod14.z);
|
1307
|
+
var FieldReference2 = import_zod14.z.string();
|
1308
|
+
var Matcher = import_zod14.z.object({
|
1309
|
+
fieldId: import_zod14.z.string(),
|
1310
|
+
options: import_zod14.z.object({
|
1311
|
+
boost: import_zod14.z.number().optional()
|
1257
1312
|
}).optional().default({})
|
1258
1313
|
});
|
1259
1314
|
var FuzzyMatcher = Matcher.extend({
|
1260
|
-
type:
|
1261
|
-
options:
|
1315
|
+
type: import_zod14.z.literal("fuzzy"),
|
1316
|
+
options: import_zod14.z.object({
|
1262
1317
|
/**
|
1263
1318
|
* Names of length 3 or less characters = 0 edits allowed
|
1264
1319
|
* Names of length 4 - 6 characters = 1 edit allowed
|
1265
1320
|
* Names of length >7 characters = 2 edits allowed
|
1266
1321
|
*/
|
1267
|
-
fuzziness:
|
1268
|
-
boost:
|
1322
|
+
fuzziness: import_zod14.z.union([import_zod14.z.string(), import_zod14.z.number()]).optional().default("AUTO:4,7"),
|
1323
|
+
boost: import_zod14.z.number().optional().default(1)
|
1269
1324
|
}).optional().default({})
|
1270
1325
|
});
|
1271
1326
|
var StrictMatcher = Matcher.extend({
|
1272
|
-
type:
|
1273
|
-
options:
|
1274
|
-
boost:
|
1327
|
+
type: import_zod14.z.literal("strict"),
|
1328
|
+
options: import_zod14.z.object({
|
1329
|
+
boost: import_zod14.z.number().optional().default(1)
|
1275
1330
|
}).optional().default({})
|
1276
1331
|
});
|
1277
1332
|
var DateRangeMatcher = Matcher.extend({
|
1278
|
-
type:
|
1279
|
-
options:
|
1280
|
-
days:
|
1333
|
+
type: import_zod14.z.literal("dateRange"),
|
1334
|
+
options: import_zod14.z.object({
|
1335
|
+
days: import_zod14.z.number(),
|
1281
1336
|
origin: FieldReference2,
|
1282
|
-
boost:
|
1337
|
+
boost: import_zod14.z.number().optional().default(1)
|
1283
1338
|
})
|
1284
1339
|
});
|
1285
1340
|
var DateDistanceMatcher = Matcher.extend({
|
1286
|
-
type:
|
1287
|
-
options:
|
1288
|
-
days:
|
1341
|
+
type: import_zod14.z.literal("dateDistance"),
|
1342
|
+
options: import_zod14.z.object({
|
1343
|
+
days: import_zod14.z.number(),
|
1289
1344
|
origin: FieldReference2,
|
1290
|
-
boost:
|
1345
|
+
boost: import_zod14.z.number().optional().default(1)
|
1291
1346
|
})
|
1292
1347
|
});
|
1293
|
-
var And =
|
1294
|
-
type:
|
1348
|
+
var And = import_zod14.z.object({
|
1349
|
+
type: import_zod14.z.literal("and"),
|
1295
1350
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
1296
|
-
clauses:
|
1351
|
+
clauses: import_zod14.z.lazy(() => Clause.array())
|
1297
1352
|
});
|
1298
|
-
var Or =
|
1299
|
-
type:
|
1353
|
+
var Or = import_zod14.z.object({
|
1354
|
+
type: import_zod14.z.literal("or"),
|
1300
1355
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
1301
|
-
clauses:
|
1356
|
+
clauses: import_zod14.z.lazy(() => Clause.array())
|
1302
1357
|
});
|
1303
|
-
var Clause =
|
1304
|
-
() =>
|
1358
|
+
var Clause = import_zod14.z.lazy(
|
1359
|
+
() => import_zod14.z.discriminatedUnion("type", [
|
1305
1360
|
And,
|
1306
1361
|
Or,
|
1307
1362
|
FuzzyMatcher,
|
@@ -1312,43 +1367,43 @@ var Clause = import_zod13.z.lazy(
|
|
1312
1367
|
).openapi({
|
1313
1368
|
ref: "Clause"
|
1314
1369
|
});
|
1315
|
-
var DeduplicationConfig =
|
1316
|
-
id:
|
1370
|
+
var DeduplicationConfig = import_zod14.z.object({
|
1371
|
+
id: import_zod14.z.string(),
|
1317
1372
|
label: TranslationConfig,
|
1318
1373
|
query: Clause
|
1319
1374
|
});
|
1320
1375
|
|
1321
1376
|
// ../commons/src/events/SummaryConfig.ts
|
1322
|
-
var
|
1323
|
-
var BaseField2 =
|
1377
|
+
var import_zod15 = require("zod");
|
1378
|
+
var BaseField2 = import_zod15.z.object({
|
1324
1379
|
emptyValueMessage: TranslationConfig.optional(),
|
1325
|
-
conditionals:
|
1380
|
+
conditionals: import_zod15.z.array(ShowConditional).default([]).optional()
|
1326
1381
|
});
|
1327
1382
|
var ReferenceField = BaseField2.extend({
|
1328
|
-
fieldId:
|
1383
|
+
fieldId: import_zod15.z.string(),
|
1329
1384
|
label: TranslationConfig.optional().describe(
|
1330
1385
|
"By default, the configured field's label is used. This can be overridden by providing a custom label."
|
1331
1386
|
)
|
1332
1387
|
}).describe("Field directly referencing event data with field id");
|
1333
1388
|
var Field = BaseField2.extend({
|
1334
|
-
id:
|
1389
|
+
id: import_zod15.z.string().describe("Id of summary field"),
|
1335
1390
|
value: TranslationConfig.describe(
|
1336
1391
|
"Summary field value. Can utilise values defined in configuration and EventMetadata"
|
1337
1392
|
),
|
1338
1393
|
label: TranslationConfig
|
1339
1394
|
}).describe("Custom configured field");
|
1340
|
-
var SummaryConfig =
|
1341
|
-
fields:
|
1395
|
+
var SummaryConfig = import_zod15.z.object({
|
1396
|
+
fields: import_zod15.z.array(import_zod15.z.union([Field, ReferenceField])).describe("Fields rendered in summary view.")
|
1342
1397
|
}).describe("Configuration for summary in event.");
|
1343
1398
|
|
1344
1399
|
// ../commons/src/events/AdvancedSearchConfig.ts
|
1345
|
-
var
|
1346
|
-
var MatchType =
|
1347
|
-
var BaseField3 =
|
1348
|
-
config:
|
1400
|
+
var import_zod16 = require("zod");
|
1401
|
+
var MatchType = import_zod16.z.enum(["fuzzy", "exact", "range", "within"]);
|
1402
|
+
var BaseField3 = import_zod16.z.object({
|
1403
|
+
config: import_zod16.z.object({
|
1349
1404
|
type: MatchType.describe("Determines the type of field")
|
1350
1405
|
}),
|
1351
|
-
options:
|
1406
|
+
options: import_zod16.z.array(SelectOption).optional(),
|
1352
1407
|
searchCriteriaLabelPrefix: TranslationConfig.optional().describe(
|
1353
1408
|
`
|
1354
1409
|
This property determines whether to add a prefix (such as "Child" or "Applicant") before the field label
|
@@ -1369,7 +1424,7 @@ var BaseField3 = import_zod15.z.object({
|
|
1369
1424
|
in the country-config > event.advancedSearch configuration. For example: field("child.dob", { searchCriteriaLabelPrefix: TranslationConfig }).
|
1370
1425
|
`
|
1371
1426
|
),
|
1372
|
-
conditionals:
|
1427
|
+
conditionals: import_zod16.z.array(FieldConditional).default([]).optional().describe(
|
1373
1428
|
`
|
1374
1429
|
In advanced search, we sometimes need to override the default field visibility conditionals.
|
1375
1430
|
|
@@ -1383,60 +1438,68 @@ var BaseField3 = import_zod15.z.object({
|
|
1383
1438
|
are always rendered in the advanced search form.
|
1384
1439
|
`
|
1385
1440
|
),
|
1386
|
-
validations:
|
1441
|
+
validations: import_zod16.z.array(ValidationConfig).default([]).optional().describe(
|
1387
1442
|
`In advanced search, we sometimes need to override the default field validations.`
|
1388
1443
|
)
|
1389
1444
|
});
|
1390
|
-
var SearchQueryParams =
|
1391
|
-
eventType:
|
1445
|
+
var SearchQueryParams = import_zod16.z.object({
|
1446
|
+
eventType: import_zod16.z.string().optional().describe(
|
1392
1447
|
"Defines type of event so that when redirecting to Advanced Search page, appropriate tab can be selected"
|
1393
1448
|
)
|
1394
1449
|
}).catchall(FieldValue);
|
1395
1450
|
var FieldConfigSchema = BaseField3.extend({
|
1396
|
-
fieldId:
|
1397
|
-
fieldType:
|
1398
|
-
alternateFieldIds:
|
1451
|
+
fieldId: import_zod16.z.string(),
|
1452
|
+
fieldType: import_zod16.z.literal("field"),
|
1453
|
+
alternateFieldIds: import_zod16.z.array(import_zod16.z.string()).optional().describe(
|
1399
1454
|
`Sometimes there might be need to search a value against multiple field of same FormField type. For example
|
1400
|
-
search Country, Province, District against child.address.private and child.address.other. In such case, we
|
1455
|
+
search Country, Province, District against child.address.private and child.address.other. In such case, we
|
1401
1456
|
add a one field as fieldId, and accomodate others in alternateFieldIds`
|
1402
1457
|
),
|
1403
|
-
excludeInSearchQuery:
|
1404
|
-
conditionally display another search field, but its not needed in search query. For example, child.placeOfBirth
|
1458
|
+
excludeInSearchQuery: import_zod16.z.boolean().default(false).optional().describe(`Sometimes there will be search fields which are used to
|
1459
|
+
conditionally display another search field, but its not needed in search query. For example, child.placeOfBirth
|
1405
1460
|
is select field, which has 3 options, FACILITY, PRIVATE_HOME, OTHER. Upon selecting any of the option, pops up another field
|
1406
1461
|
related to the selected option, whose value is required in the search query. But child.placeOfBirth itself is not needed in the query.
|
1407
1462
|
In such case, populate this field (excludeInSearchQuery) with boolean true`)
|
1408
1463
|
});
|
1409
|
-
var
|
1464
|
+
var EventFieldIdInput = import_zod16.z.enum([
|
1410
1465
|
"trackingId",
|
1411
1466
|
"status",
|
1412
1467
|
"legalStatuses.REGISTERED.acceptedAt",
|
1413
1468
|
"legalStatuses.REGISTERED.createdAtLocation",
|
1414
1469
|
"updatedAt"
|
1415
1470
|
]);
|
1471
|
+
var METADATA_FIELD_PREFIX = "event.";
|
1472
|
+
var EventFieldId = import_zod16.z.enum([
|
1473
|
+
`${METADATA_FIELD_PREFIX}trackingId`,
|
1474
|
+
`${METADATA_FIELD_PREFIX}status`,
|
1475
|
+
`${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.acceptedAt`,
|
1476
|
+
`${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.createdAtLocation`,
|
1477
|
+
`${METADATA_FIELD_PREFIX}updatedAt`
|
1478
|
+
]);
|
1416
1479
|
var EventFieldConfigSchema = BaseField3.extend({
|
1417
1480
|
fieldId: EventFieldId,
|
1418
|
-
fieldType:
|
1481
|
+
fieldType: import_zod16.z.literal("event")
|
1419
1482
|
});
|
1420
|
-
var SearchField =
|
1483
|
+
var SearchField = import_zod16.z.discriminatedUnion("fieldType", [
|
1421
1484
|
FieldConfigSchema,
|
1422
1485
|
EventFieldConfigSchema
|
1423
1486
|
]);
|
1424
|
-
var AdvancedSearchConfig =
|
1487
|
+
var AdvancedSearchConfig = import_zod16.z.object({
|
1425
1488
|
title: TranslationConfig.describe("Advanced search tab title"),
|
1426
|
-
fields:
|
1489
|
+
fields: import_zod16.z.array(SearchField).describe("Advanced search fields.")
|
1427
1490
|
});
|
1428
1491
|
|
1429
1492
|
// ../commons/src/events/utils.ts
|
1430
1493
|
var import_lodash = require("lodash");
|
1431
1494
|
|
1432
1495
|
// ../commons/src/events/ActionDocument.ts
|
1433
|
-
var
|
1496
|
+
var import_zod20 = require("zod");
|
1434
1497
|
var import_zod_openapi8 = require("zod-openapi");
|
1435
1498
|
|
1436
1499
|
// ../commons/src/uuid.ts
|
1437
1500
|
var import_uuid = require("uuid");
|
1438
|
-
var
|
1439
|
-
var UUID =
|
1501
|
+
var import_zod17 = require("zod");
|
1502
|
+
var UUID = import_zod17.z.string().uuid().brand("UUID");
|
1440
1503
|
function getUUID() {
|
1441
1504
|
return (0, import_uuid.v4)();
|
1442
1505
|
}
|
@@ -1446,10 +1509,10 @@ var CreatedAtLocation = UUID.nullish();
|
|
1446
1509
|
|
1447
1510
|
// ../commons/src/authentication.ts
|
1448
1511
|
var import_jwt_decode = __toESM(require("jwt-decode"));
|
1449
|
-
var
|
1512
|
+
var import_zod19 = require("zod");
|
1450
1513
|
|
1451
1514
|
// ../commons/src/scopes.ts
|
1452
|
-
var
|
1515
|
+
var import_zod18 = require("zod");
|
1453
1516
|
var SCOPES = {
|
1454
1517
|
// TODO v1.8 legacy scopes
|
1455
1518
|
NATLSYSADMIN: "natlsysadmin",
|
@@ -1562,108 +1625,108 @@ var SCOPES = {
|
|
1562
1625
|
// data seeding
|
1563
1626
|
USER_DATA_SEEDING: "user.data-seeding"
|
1564
1627
|
};
|
1565
|
-
var LegacyScopes =
|
1566
|
-
|
1567
|
-
|
1568
|
-
|
1569
|
-
|
1570
|
-
|
1571
|
-
|
1572
|
-
|
1573
|
-
|
1574
|
-
|
1575
|
-
|
1576
|
-
|
1628
|
+
var LegacyScopes = import_zod18.z.union([
|
1629
|
+
import_zod18.z.literal(SCOPES.NATLSYSADMIN),
|
1630
|
+
import_zod18.z.literal(SCOPES.BYPASSRATELIMIT),
|
1631
|
+
import_zod18.z.literal(SCOPES.DECLARE),
|
1632
|
+
import_zod18.z.literal(SCOPES.REGISTER),
|
1633
|
+
import_zod18.z.literal(SCOPES.VALIDATE),
|
1634
|
+
import_zod18.z.literal(SCOPES.DEMO),
|
1635
|
+
import_zod18.z.literal(SCOPES.CERTIFY),
|
1636
|
+
import_zod18.z.literal(SCOPES.PERFORMANCE),
|
1637
|
+
import_zod18.z.literal(SCOPES.SYSADMIN),
|
1638
|
+
import_zod18.z.literal(SCOPES.TEAMS),
|
1639
|
+
import_zod18.z.literal(SCOPES.CONFIG)
|
1577
1640
|
]);
|
1578
|
-
var IntegrationScopes =
|
1579
|
-
|
1580
|
-
|
1581
|
-
|
1582
|
-
|
1641
|
+
var IntegrationScopes = import_zod18.z.union([
|
1642
|
+
import_zod18.z.literal(SCOPES.WEBHOOK),
|
1643
|
+
import_zod18.z.literal(SCOPES.NATIONALID),
|
1644
|
+
import_zod18.z.literal(SCOPES.NOTIFICATION_API),
|
1645
|
+
import_zod18.z.literal(SCOPES.RECORDSEARCH)
|
1583
1646
|
]);
|
1584
|
-
var DeclareScopes =
|
1585
|
-
|
1586
|
-
|
1587
|
-
|
1588
|
-
|
1589
|
-
|
1590
|
-
|
1591
|
-
|
1592
|
-
|
1593
|
-
|
1594
|
-
|
1647
|
+
var DeclareScopes = import_zod18.z.union([
|
1648
|
+
import_zod18.z.literal(SCOPES.RECORD_DECLARE),
|
1649
|
+
import_zod18.z.literal(SCOPES.RECORD_IMPORT),
|
1650
|
+
import_zod18.z.literal(SCOPES.RECORD_DECLARE_BIRTH),
|
1651
|
+
import_zod18.z.literal(SCOPES.RECORD_DECLARE_BIRTH_MY_JURISDICTION),
|
1652
|
+
import_zod18.z.literal(SCOPES.RECORD_DECLARE_DEATH),
|
1653
|
+
import_zod18.z.literal(SCOPES.RECORD_DECLARE_DEATH_MY_JURISDICTION),
|
1654
|
+
import_zod18.z.literal(SCOPES.RECORD_DECLARE_MARRIAGE),
|
1655
|
+
import_zod18.z.literal(SCOPES.RECORD_DECLARE_MARRIAGE_MY_JURISDICTION),
|
1656
|
+
import_zod18.z.literal(SCOPES.RECORD_SUBMIT_INCOMPLETE),
|
1657
|
+
import_zod18.z.literal(SCOPES.RECORD_SUBMIT_FOR_REVIEW)
|
1595
1658
|
]);
|
1596
|
-
var UnassignScope =
|
1597
|
-
var ValidateScopes =
|
1598
|
-
|
1599
|
-
|
1600
|
-
|
1601
|
-
|
1602
|
-
|
1603
|
-
|
1659
|
+
var UnassignScope = import_zod18.z.literal(SCOPES.RECORD_UNASSIGN_OTHERS);
|
1660
|
+
var ValidateScopes = import_zod18.z.union([
|
1661
|
+
import_zod18.z.literal(SCOPES.RECORD_SUBMIT_FOR_APPROVAL),
|
1662
|
+
import_zod18.z.literal(SCOPES.RECORD_SUBMIT_FOR_UPDATES),
|
1663
|
+
import_zod18.z.literal(SCOPES.RECORD_DECLARATION_EDIT),
|
1664
|
+
import_zod18.z.literal(SCOPES.RECORD_REVIEW_DUPLICATES),
|
1665
|
+
import_zod18.z.literal(SCOPES.RECORD_DECLARATION_ARCHIVE),
|
1666
|
+
import_zod18.z.literal(SCOPES.RECORD_DECLARATION_REINSTATE)
|
1604
1667
|
]);
|
1605
|
-
var RegisterScope =
|
1606
|
-
var CertifyScopes =
|
1607
|
-
|
1608
|
-
|
1609
|
-
|
1610
|
-
|
1611
|
-
|
1612
|
-
|
1613
|
-
|
1614
|
-
|
1668
|
+
var RegisterScope = import_zod18.z.literal(SCOPES.RECORD_REGISTER);
|
1669
|
+
var CertifyScopes = import_zod18.z.union([
|
1670
|
+
import_zod18.z.literal(SCOPES.RECORD_EXPORT_RECORDS),
|
1671
|
+
import_zod18.z.literal(SCOPES.RECORD_DECLARATION_PRINT),
|
1672
|
+
import_zod18.z.literal(SCOPES.RECORD_PRINT_RECORDS_SUPPORTING_DOCUMENTS),
|
1673
|
+
import_zod18.z.literal(SCOPES.RECORD_REGISTRATION_PRINT),
|
1674
|
+
import_zod18.z.literal(SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES),
|
1675
|
+
import_zod18.z.literal(SCOPES.RECORD_PRINT_CERTIFIED_COPIES),
|
1676
|
+
import_zod18.z.literal(SCOPES.RECORD_BULK_PRINT_CERTIFIED_COPIES),
|
1677
|
+
import_zod18.z.literal(SCOPES.RECORD_REGISTRATION_VERIFY_CERTIFIED_COPIES)
|
1615
1678
|
]);
|
1616
|
-
var CorrectionScopes =
|
1617
|
-
|
1618
|
-
|
1619
|
-
|
1620
|
-
|
1621
|
-
|
1622
|
-
|
1623
|
-
|
1624
|
-
|
1679
|
+
var CorrectionScopes = import_zod18.z.union([
|
1680
|
+
import_zod18.z.literal(SCOPES.RECORD_REGISTRATION_REQUEST_CORRECTION),
|
1681
|
+
import_zod18.z.literal(SCOPES.RECORD_REGISTRATION_CORRECT),
|
1682
|
+
import_zod18.z.literal(SCOPES.RECORD_REGISTRATION_REQUEST_REVOCATION),
|
1683
|
+
import_zod18.z.literal(SCOPES.RECORD_REGISTRATION_REVOKE),
|
1684
|
+
import_zod18.z.literal(SCOPES.RECORD_REGISTRATION_REQUEST_REINSTATEMENT),
|
1685
|
+
import_zod18.z.literal(SCOPES.RECORD_REGISTRATION_REINSTATE),
|
1686
|
+
import_zod18.z.literal(SCOPES.RECORD_CONFIRM_REGISTRATION),
|
1687
|
+
import_zod18.z.literal(SCOPES.RECORD_REJECT_REGISTRATION)
|
1625
1688
|
]);
|
1626
|
-
var SearchScopes =
|
1627
|
-
|
1628
|
-
|
1629
|
-
|
1630
|
-
|
1631
|
-
|
1632
|
-
|
1689
|
+
var SearchScopes = import_zod18.z.union([
|
1690
|
+
import_zod18.z.literal(SCOPES.SEARCH_BIRTH_MY_JURISDICTION),
|
1691
|
+
import_zod18.z.literal(SCOPES.SEARCH_BIRTH),
|
1692
|
+
import_zod18.z.literal(SCOPES.SEARCH_DEATH_MY_JURISDICTION),
|
1693
|
+
import_zod18.z.literal(SCOPES.SEARCH_DEATH),
|
1694
|
+
import_zod18.z.literal(SCOPES.SEARCH_MARRIAGE_MY_JURISDICTION),
|
1695
|
+
import_zod18.z.literal(SCOPES.SEARCH_MARRIAGE)
|
1633
1696
|
]);
|
1634
|
-
var AuditScopes =
|
1635
|
-
|
1636
|
-
|
1637
|
-
|
1638
|
-
|
1697
|
+
var AuditScopes = import_zod18.z.union([
|
1698
|
+
import_zod18.z.literal(SCOPES.RECORD_READ),
|
1699
|
+
import_zod18.z.literal(SCOPES.RECORD_READ_AUDIT),
|
1700
|
+
import_zod18.z.literal(SCOPES.RECORD_READ_COMMENTS),
|
1701
|
+
import_zod18.z.literal(SCOPES.RECORD_CREATE_COMMENTS)
|
1639
1702
|
]);
|
1640
|
-
var ProfileScopes =
|
1641
|
-
|
1642
|
-
|
1703
|
+
var ProfileScopes = import_zod18.z.union([
|
1704
|
+
import_zod18.z.literal(SCOPES.PROFILE_UPDATE),
|
1705
|
+
import_zod18.z.literal(SCOPES.PROFILE_ELECTRONIC_SIGNATURE)
|
1643
1706
|
]);
|
1644
|
-
var PerformanceScopes =
|
1645
|
-
|
1646
|
-
|
1647
|
-
|
1707
|
+
var PerformanceScopes = import_zod18.z.union([
|
1708
|
+
import_zod18.z.literal(SCOPES.PERFORMANCE_READ),
|
1709
|
+
import_zod18.z.literal(SCOPES.PERFORMANCE_READ_DASHBOARDS),
|
1710
|
+
import_zod18.z.literal(SCOPES.PERFORMANCE_EXPORT_VITAL_STATISTICS)
|
1648
1711
|
]);
|
1649
|
-
var OrganisationScopes =
|
1650
|
-
|
1651
|
-
|
1652
|
-
|
1712
|
+
var OrganisationScopes = import_zod18.z.union([
|
1713
|
+
import_zod18.z.literal(SCOPES.ORGANISATION_READ_LOCATIONS),
|
1714
|
+
import_zod18.z.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_OFFICE),
|
1715
|
+
import_zod18.z.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_JURISDICTION)
|
1653
1716
|
]);
|
1654
|
-
var UserScopes =
|
1655
|
-
|
1656
|
-
|
1657
|
-
|
1658
|
-
|
1659
|
-
|
1660
|
-
|
1661
|
-
|
1662
|
-
|
1717
|
+
var UserScopes = import_zod18.z.union([
|
1718
|
+
import_zod18.z.literal(SCOPES.USER_READ),
|
1719
|
+
import_zod18.z.literal(SCOPES.USER_READ_MY_OFFICE),
|
1720
|
+
import_zod18.z.literal(SCOPES.USER_READ_MY_JURISDICTION),
|
1721
|
+
import_zod18.z.literal(SCOPES.USER_READ_ONLY_MY_AUDIT),
|
1722
|
+
import_zod18.z.literal(SCOPES.USER_CREATE),
|
1723
|
+
import_zod18.z.literal(SCOPES.USER_CREATE_MY_JURISDICTION),
|
1724
|
+
import_zod18.z.literal(SCOPES.USER_UPDATE),
|
1725
|
+
import_zod18.z.literal(SCOPES.USER_UPDATE_MY_JURISDICTION)
|
1663
1726
|
]);
|
1664
|
-
var ConfigScope =
|
1665
|
-
var DataSeedingScope =
|
1666
|
-
var LiteralScopes =
|
1727
|
+
var ConfigScope = import_zod18.z.literal(SCOPES.CONFIG_UPDATE_ALL);
|
1728
|
+
var DataSeedingScope = import_zod18.z.literal(SCOPES.USER_DATA_SEEDING);
|
1729
|
+
var LiteralScopes = import_zod18.z.union([
|
1667
1730
|
LegacyScopes,
|
1668
1731
|
IntegrationScopes,
|
1669
1732
|
UnassignScope,
|
@@ -1682,39 +1745,39 @@ var LiteralScopes = import_zod17.z.union([
|
|
1682
1745
|
DataSeedingScope
|
1683
1746
|
]);
|
1684
1747
|
var rawConfigurableScopeRegex = /^([a-zA-Z\.]+)\[((?:\w+=[\w.-]+(?:\|[\w.-]+)*)(?:,[\w]+=[\w.-]+(?:\|[\w.-]+)*)*)\]$/;
|
1685
|
-
var rawConfigurableScope =
|
1686
|
-
var CreateUserScope =
|
1687
|
-
type:
|
1688
|
-
options:
|
1689
|
-
role:
|
1748
|
+
var rawConfigurableScope = import_zod18.z.string().regex(rawConfigurableScopeRegex);
|
1749
|
+
var CreateUserScope = import_zod18.z.object({
|
1750
|
+
type: import_zod18.z.literal("user.create"),
|
1751
|
+
options: import_zod18.z.object({
|
1752
|
+
role: import_zod18.z.array(import_zod18.z.string())
|
1690
1753
|
})
|
1691
1754
|
});
|
1692
|
-
var EditUserScope =
|
1693
|
-
type:
|
1694
|
-
options:
|
1695
|
-
role:
|
1755
|
+
var EditUserScope = import_zod18.z.object({
|
1756
|
+
type: import_zod18.z.literal("user.edit"),
|
1757
|
+
options: import_zod18.z.object({
|
1758
|
+
role: import_zod18.z.array(import_zod18.z.string())
|
1696
1759
|
})
|
1697
1760
|
});
|
1698
|
-
var WorkqueueScope =
|
1699
|
-
type:
|
1700
|
-
options:
|
1701
|
-
id:
|
1761
|
+
var WorkqueueScope = import_zod18.z.object({
|
1762
|
+
type: import_zod18.z.literal("workqueue"),
|
1763
|
+
options: import_zod18.z.object({
|
1764
|
+
id: import_zod18.z.array(import_zod18.z.string())
|
1702
1765
|
})
|
1703
1766
|
});
|
1704
|
-
var NotifyRecordScope =
|
1705
|
-
type:
|
1706
|
-
options:
|
1707
|
-
event:
|
1767
|
+
var NotifyRecordScope = import_zod18.z.object({
|
1768
|
+
type: import_zod18.z.literal("record.notify"),
|
1769
|
+
options: import_zod18.z.object({
|
1770
|
+
event: import_zod18.z.array(import_zod18.z.string())
|
1708
1771
|
})
|
1709
1772
|
});
|
1710
|
-
var SearchScope =
|
1711
|
-
type:
|
1712
|
-
options:
|
1713
|
-
event:
|
1714
|
-
access:
|
1773
|
+
var SearchScope = import_zod18.z.object({
|
1774
|
+
type: import_zod18.z.literal("search"),
|
1775
|
+
options: import_zod18.z.object({
|
1776
|
+
event: import_zod18.z.array(import_zod18.z.string()).length(1),
|
1777
|
+
access: import_zod18.z.array(import_zod18.z.enum(["my-jurisdiction", "all"])).length(1)
|
1715
1778
|
})
|
1716
1779
|
});
|
1717
|
-
var ConfigurableRawScopes =
|
1780
|
+
var ConfigurableRawScopes = import_zod18.z.discriminatedUnion("type", [
|
1718
1781
|
SearchScope,
|
1719
1782
|
CreateUserScope,
|
1720
1783
|
EditUserScope,
|
@@ -1722,7 +1785,7 @@ var ConfigurableRawScopes = import_zod17.z.discriminatedUnion("type", [
|
|
1722
1785
|
NotifyRecordScope
|
1723
1786
|
]);
|
1724
1787
|
var scopes = Object.values(SCOPES);
|
1725
|
-
var ActionScopes =
|
1788
|
+
var ActionScopes = import_zod18.z.union([
|
1726
1789
|
DeclareScopes,
|
1727
1790
|
ValidateScopes,
|
1728
1791
|
RegisterScope,
|
@@ -1873,30 +1936,30 @@ var DEFAULT_ROLES_DEFINITION = [
|
|
1873
1936
|
]
|
1874
1937
|
}
|
1875
1938
|
];
|
1876
|
-
var TokenUserType =
|
1877
|
-
var TokenWithBearer =
|
1939
|
+
var TokenUserType = import_zod19.z.enum(["user", "system"]);
|
1940
|
+
var TokenWithBearer = import_zod19.z.string().regex(/^Bearer\s/);
|
1878
1941
|
|
1879
1942
|
// ../commons/src/events/ActionDocument.ts
|
1880
|
-
(0, import_zod_openapi8.extendZodWithOpenApi)(
|
1881
|
-
var ActionUpdate =
|
1882
|
-
var EventState =
|
1943
|
+
(0, import_zod_openapi8.extendZodWithOpenApi)(import_zod20.z);
|
1944
|
+
var ActionUpdate = import_zod20.z.record(import_zod20.z.string(), FieldUpdateValue);
|
1945
|
+
var EventState = import_zod20.z.record(import_zod20.z.string(), FieldValue);
|
1883
1946
|
var ActionStatus = {
|
1884
1947
|
Requested: "Requested",
|
1885
1948
|
Accepted: "Accepted",
|
1886
1949
|
Rejected: "Rejected"
|
1887
1950
|
};
|
1888
|
-
var ActionBase =
|
1951
|
+
var ActionBase = import_zod20.z.object({
|
1889
1952
|
id: UUID,
|
1890
|
-
transactionId:
|
1953
|
+
transactionId: import_zod20.z.string(),
|
1891
1954
|
createdByUserType: TokenUserType,
|
1892
|
-
createdAt:
|
1893
|
-
createdBy:
|
1894
|
-
createdByRole:
|
1895
|
-
createdBySignature:
|
1955
|
+
createdAt: import_zod20.z.string().datetime(),
|
1956
|
+
createdBy: import_zod20.z.string(),
|
1957
|
+
createdByRole: import_zod20.z.string(),
|
1958
|
+
createdBySignature: import_zod20.z.string().nullish().describe("Reference to signature of the user who created the action"),
|
1896
1959
|
createdAtLocation: CreatedAtLocation,
|
1897
1960
|
declaration: ActionUpdate,
|
1898
1961
|
annotation: ActionUpdate.optional().nullable(),
|
1899
|
-
status:
|
1962
|
+
status: import_zod20.z.enum([
|
1900
1963
|
ActionStatus.Requested,
|
1901
1964
|
ActionStatus.Accepted,
|
1902
1965
|
ActionStatus.Rejected
|
@@ -1910,102 +1973,102 @@ var ActionBase = import_zod19.z.object({
|
|
1910
1973
|
// See PrintCertificateAction
|
1911
1974
|
});
|
1912
1975
|
var AssignedAction = ActionBase.merge(
|
1913
|
-
|
1914
|
-
type:
|
1915
|
-
assignedTo:
|
1976
|
+
import_zod20.z.object({
|
1977
|
+
type: import_zod20.z.literal(ActionType.ASSIGN),
|
1978
|
+
assignedTo: import_zod20.z.string()
|
1916
1979
|
// TODO move into 'content' property
|
1917
1980
|
})
|
1918
1981
|
);
|
1919
1982
|
var UnassignedAction = ActionBase.merge(
|
1920
|
-
|
1921
|
-
type:
|
1983
|
+
import_zod20.z.object({
|
1984
|
+
type: import_zod20.z.literal(ActionType.UNASSIGN)
|
1922
1985
|
})
|
1923
1986
|
);
|
1924
1987
|
var RegisterAction = ActionBase.merge(
|
1925
|
-
|
1926
|
-
type:
|
1927
|
-
registrationNumber:
|
1988
|
+
import_zod20.z.object({
|
1989
|
+
type: import_zod20.z.literal(ActionType.REGISTER),
|
1990
|
+
registrationNumber: import_zod20.z.string().optional()
|
1928
1991
|
// TODO move into 'content' property
|
1929
1992
|
})
|
1930
1993
|
);
|
1931
1994
|
var DeclareAction = ActionBase.merge(
|
1932
|
-
|
1933
|
-
type:
|
1995
|
+
import_zod20.z.object({
|
1996
|
+
type: import_zod20.z.literal(ActionType.DECLARE)
|
1934
1997
|
})
|
1935
1998
|
);
|
1936
1999
|
var ValidateAction = ActionBase.merge(
|
1937
|
-
|
1938
|
-
type:
|
2000
|
+
import_zod20.z.object({
|
2001
|
+
type: import_zod20.z.literal(ActionType.VALIDATE)
|
1939
2002
|
})
|
1940
2003
|
);
|
1941
|
-
var RejectionReason =
|
1942
|
-
message:
|
1943
|
-
isDuplicate:
|
2004
|
+
var RejectionReason = import_zod20.z.object({
|
2005
|
+
message: import_zod20.z.string().min(1, { message: "Message cannot be empty" }).describe("Message describing reason for rejection or archiving"),
|
2006
|
+
isDuplicate: import_zod20.z.boolean().optional().describe("If a declaration is duplicated")
|
1944
2007
|
});
|
1945
2008
|
var RejectAction = ActionBase.merge(
|
1946
|
-
|
1947
|
-
type:
|
2009
|
+
import_zod20.z.object({
|
2010
|
+
type: import_zod20.z.literal(ActionType.REJECT),
|
1948
2011
|
reason: RejectionReason
|
1949
2012
|
// TODO move into 'content' property
|
1950
2013
|
})
|
1951
2014
|
);
|
1952
2015
|
var MarkAsDuplicateAction = ActionBase.merge(
|
1953
|
-
|
1954
|
-
type:
|
2016
|
+
import_zod20.z.object({
|
2017
|
+
type: import_zod20.z.literal(ActionType.MARKED_AS_DUPLICATE)
|
1955
2018
|
})
|
1956
2019
|
);
|
1957
2020
|
var ArchiveAction = ActionBase.merge(
|
1958
|
-
|
1959
|
-
type:
|
2021
|
+
import_zod20.z.object({
|
2022
|
+
type: import_zod20.z.literal(ActionType.ARCHIVE),
|
1960
2023
|
reason: RejectionReason
|
1961
2024
|
// TODO move into 'content' property
|
1962
2025
|
})
|
1963
2026
|
);
|
1964
2027
|
var CreatedAction = ActionBase.merge(
|
1965
|
-
|
1966
|
-
type:
|
2028
|
+
import_zod20.z.object({
|
2029
|
+
type: import_zod20.z.literal(ActionType.CREATE)
|
1967
2030
|
})
|
1968
2031
|
);
|
1969
2032
|
var NotifiedAction = ActionBase.merge(
|
1970
|
-
|
1971
|
-
type:
|
2033
|
+
import_zod20.z.object({
|
2034
|
+
type: import_zod20.z.literal(ActionType.NOTIFY)
|
1972
2035
|
})
|
1973
2036
|
);
|
1974
|
-
var PrintContent =
|
1975
|
-
templateId:
|
2037
|
+
var PrintContent = import_zod20.z.object({
|
2038
|
+
templateId: import_zod20.z.string().optional()
|
1976
2039
|
});
|
1977
2040
|
var PrintCertificateAction = ActionBase.merge(
|
1978
|
-
|
1979
|
-
type:
|
2041
|
+
import_zod20.z.object({
|
2042
|
+
type: import_zod20.z.literal(ActionType.PRINT_CERTIFICATE),
|
1980
2043
|
content: PrintContent.optional().nullable()
|
1981
2044
|
})
|
1982
2045
|
);
|
1983
2046
|
var RequestedCorrectionAction = ActionBase.merge(
|
1984
|
-
|
1985
|
-
type:
|
2047
|
+
import_zod20.z.object({
|
2048
|
+
type: import_zod20.z.literal(ActionType.REQUEST_CORRECTION)
|
1986
2049
|
})
|
1987
2050
|
);
|
1988
2051
|
var ApprovedCorrectionAction = ActionBase.merge(
|
1989
|
-
|
1990
|
-
type:
|
1991
|
-
requestId:
|
2052
|
+
import_zod20.z.object({
|
2053
|
+
type: import_zod20.z.literal(ActionType.APPROVE_CORRECTION),
|
2054
|
+
requestId: import_zod20.z.string()
|
1992
2055
|
// TODO move into 'content' property
|
1993
2056
|
})
|
1994
2057
|
);
|
1995
2058
|
var RejectedCorrectionAction = ActionBase.merge(
|
1996
|
-
|
1997
|
-
type:
|
1998
|
-
requestId:
|
2059
|
+
import_zod20.z.object({
|
2060
|
+
type: import_zod20.z.literal(ActionType.REJECT_CORRECTION),
|
2061
|
+
requestId: import_zod20.z.string(),
|
1999
2062
|
// TODO move into 'content' property
|
2000
2063
|
reason: RejectionReason
|
2001
2064
|
})
|
2002
2065
|
);
|
2003
2066
|
var ReadAction = ActionBase.merge(
|
2004
|
-
|
2005
|
-
type:
|
2067
|
+
import_zod20.z.object({
|
2068
|
+
type: import_zod20.z.literal(ActionType.READ)
|
2006
2069
|
})
|
2007
2070
|
);
|
2008
|
-
var ActionDocument =
|
2071
|
+
var ActionDocument = import_zod20.z.discriminatedUnion("type", [
|
2009
2072
|
CreatedAction.openapi({ ref: "CreatedAction" }),
|
2010
2073
|
ValidateAction.openapi({ ref: "ValidateAction" }),
|
2011
2074
|
RejectAction.openapi({ ref: "RejectAction" }),
|
@@ -2028,20 +2091,20 @@ var AsyncRejectActionDocument = ActionBase.omit({
|
|
2028
2091
|
declaration: true,
|
2029
2092
|
annotation: true
|
2030
2093
|
}).merge(
|
2031
|
-
|
2032
|
-
type:
|
2033
|
-
status:
|
2094
|
+
import_zod20.z.object({
|
2095
|
+
type: import_zod20.z.enum(ConfirmableActions),
|
2096
|
+
status: import_zod20.z.literal(ActionStatus.Rejected)
|
2034
2097
|
})
|
2035
2098
|
);
|
2036
|
-
var Action =
|
2037
|
-
var ResolvedUser =
|
2038
|
-
id:
|
2039
|
-
role:
|
2040
|
-
name:
|
2041
|
-
|
2042
|
-
use:
|
2043
|
-
given:
|
2044
|
-
family:
|
2099
|
+
var Action = import_zod20.z.union([ActionDocument, AsyncRejectActionDocument]);
|
2100
|
+
var ResolvedUser = import_zod20.z.object({
|
2101
|
+
id: import_zod20.z.string(),
|
2102
|
+
role: import_zod20.z.string(),
|
2103
|
+
name: import_zod20.z.array(
|
2104
|
+
import_zod20.z.object({
|
2105
|
+
use: import_zod20.z.string(),
|
2106
|
+
given: import_zod20.z.array(import_zod20.z.string()),
|
2107
|
+
family: import_zod20.z.string()
|
2045
2108
|
})
|
2046
2109
|
)
|
2047
2110
|
});
|
@@ -2052,7 +2115,7 @@ var import_ajv_formats = __toESM(require("ajv-formats"));
|
|
2052
2115
|
var import_date_fns = require("date-fns");
|
2053
2116
|
|
2054
2117
|
// ../commons/src/events/FieldTypeMapping.ts
|
2055
|
-
var
|
2118
|
+
var import_zod21 = require("zod");
|
2056
2119
|
function mapFieldTypeToZod(type, required) {
|
2057
2120
|
let schema;
|
2058
2121
|
switch (type) {
|
@@ -2118,7 +2181,7 @@ function createValidationSchema(config) {
|
|
2118
2181
|
for (const field2 of config) {
|
2119
2182
|
shape[field2.id] = mapFieldTypeToZod(field2.type, field2.required);
|
2120
2183
|
}
|
2121
|
-
return
|
2184
|
+
return import_zod21.z.object(shape);
|
2122
2185
|
}
|
2123
2186
|
function mapFieldTypeToEmptyValue(field2) {
|
2124
2187
|
switch (field2.type) {
|
@@ -2438,6 +2501,23 @@ function validateFieldInput({
|
|
2438
2501
|
const rawError = zodType.safeParse(value, { errorMap: zodToIntlErrorMap });
|
2439
2502
|
return rawError.error?.issues.map((issue) => issue.message) ?? [];
|
2440
2503
|
}
|
2504
|
+
function runStructuralValidations({
|
2505
|
+
field: field2,
|
2506
|
+
values
|
2507
|
+
}) {
|
2508
|
+
if (!isFieldVisible(field2, values) || isFieldEmptyAndNotRequired(field2, values)) {
|
2509
|
+
return {
|
2510
|
+
errors: []
|
2511
|
+
};
|
2512
|
+
}
|
2513
|
+
const fieldValidationResult = validateFieldInput({
|
2514
|
+
field: field2,
|
2515
|
+
value: values[field2.id]
|
2516
|
+
});
|
2517
|
+
return {
|
2518
|
+
errors: fieldValidationResult
|
2519
|
+
};
|
2520
|
+
}
|
2441
2521
|
function runFieldValidations({
|
2442
2522
|
field: field2,
|
2443
2523
|
values
|
@@ -2609,10 +2689,16 @@ function omitHiddenPaginatedFields(formConfig, declaration) {
|
|
2609
2689
|
const visiblePagesFormFields = formConfig.pages.filter((p) => isPageVisible(p, declaration)).flatMap((p) => p.fields);
|
2610
2690
|
return omitHiddenFields(visiblePagesFormFields, declaration);
|
2611
2691
|
}
|
2612
|
-
function
|
2613
|
-
const actions =
|
2692
|
+
function findActiveDraftForEvent(event2, draft) {
|
2693
|
+
const actions = (0, import_lodash.orderBy)(
|
2694
|
+
event2.actions.filter(({ type }) => type !== ActionType.READ),
|
2695
|
+
["createdAt"],
|
2696
|
+
["asc"]
|
2697
|
+
);
|
2614
2698
|
const lastAction = actions[actions.length - 1];
|
2615
|
-
|
2699
|
+
const isDraftActive = draft.createdAt >= lastAction.createdAt;
|
2700
|
+
const isDraftForEvent = event2.id === draft.eventId;
|
2701
|
+
return isDraftActive && isDraftForEvent ? draft : void 0;
|
2616
2702
|
}
|
2617
2703
|
function createEmptyDraft(eventId, draftId, actionType) {
|
2618
2704
|
return {
|
@@ -2728,16 +2814,16 @@ function timePeriodToDateRange(value) {
|
|
2728
2814
|
let startDate;
|
2729
2815
|
switch (value) {
|
2730
2816
|
case "last7Days":
|
2731
|
-
startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(),
|
2817
|
+
startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(), 7);
|
2732
2818
|
break;
|
2733
2819
|
case "last30Days":
|
2734
|
-
startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(),
|
2820
|
+
startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(), 30);
|
2735
2821
|
break;
|
2736
2822
|
case "last90Days":
|
2737
|
-
startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(),
|
2823
|
+
startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(), 90);
|
2738
2824
|
break;
|
2739
2825
|
case "last365Days":
|
2740
|
-
startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(),
|
2826
|
+
startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(), 365);
|
2741
2827
|
break;
|
2742
2828
|
}
|
2743
2829
|
return {
|
@@ -2745,12 +2831,35 @@ function timePeriodToDateRange(value) {
|
|
2745
2831
|
endDate: (/* @__PURE__ */ new Date()).toISOString()
|
2746
2832
|
};
|
2747
2833
|
}
|
2834
|
+
function mergeDrafts(currentDraft, incomingDraft) {
|
2835
|
+
if (currentDraft.eventId !== incomingDraft.eventId) {
|
2836
|
+
throw new Error(
|
2837
|
+
`Cannot merge drafts for different events: ${currentDraft.eventId} and ${incomingDraft.eventId}`
|
2838
|
+
);
|
2839
|
+
}
|
2840
|
+
return {
|
2841
|
+
...currentDraft,
|
2842
|
+
...incomingDraft,
|
2843
|
+
action: {
|
2844
|
+
...currentDraft.action,
|
2845
|
+
...incomingDraft.action,
|
2846
|
+
declaration: deepMerge(
|
2847
|
+
currentDraft.action.declaration,
|
2848
|
+
incomingDraft.action.declaration
|
2849
|
+
),
|
2850
|
+
annotation: deepMerge(
|
2851
|
+
currentDraft.action.annotation ?? {},
|
2852
|
+
incomingDraft.action.annotation ?? {}
|
2853
|
+
)
|
2854
|
+
}
|
2855
|
+
};
|
2856
|
+
}
|
2748
2857
|
|
2749
2858
|
// ../commons/src/events/EventConfig.ts
|
2750
2859
|
var import_zod_openapi9 = require("zod-openapi");
|
2751
|
-
(0, import_zod_openapi9.extendZodWithOpenApi)(
|
2752
|
-
var EventConfig =
|
2753
|
-
id:
|
2860
|
+
(0, import_zod_openapi9.extendZodWithOpenApi)(import_zod22.z);
|
2861
|
+
var EventConfig = import_zod22.z.object({
|
2862
|
+
id: import_zod22.z.string().describe(
|
2754
2863
|
'A machine-readable identifier for the event, e.g. "birth" or "death"'
|
2755
2864
|
),
|
2756
2865
|
dateOfEvent: FieldReference.optional(),
|
@@ -2760,10 +2869,10 @@ var EventConfig = import_zod21.z.object({
|
|
2760
2869
|
),
|
2761
2870
|
summary: SummaryConfig,
|
2762
2871
|
label: TranslationConfig,
|
2763
|
-
actions:
|
2872
|
+
actions: import_zod22.z.array(ActionConfig),
|
2764
2873
|
declaration: DeclarationFormConfig,
|
2765
|
-
deduplication:
|
2766
|
-
advancedSearch:
|
2874
|
+
deduplication: import_zod22.z.array(DeduplicationConfig).optional().default([]),
|
2875
|
+
advancedSearch: import_zod22.z.array(AdvancedSearchConfig).optional().default([])
|
2767
2876
|
}).superRefine((event2, ctx) => {
|
2768
2877
|
const allFields = findAllFields(event2);
|
2769
2878
|
const fieldIds = allFields.map((field2) => field2.id);
|
@@ -2847,12 +2956,12 @@ var definePage = (page) => PageConfig.parse(page);
|
|
2847
2956
|
var defineFormPage = (formPage) => FormPageConfig.parse(formPage);
|
2848
2957
|
|
2849
2958
|
// ../commons/src/events/WorkqueueConfig.ts
|
2850
|
-
var
|
2959
|
+
var import_zod29 = require("zod");
|
2851
2960
|
|
2852
2961
|
// ../commons/src/events/serializers/user/serializer.ts
|
2853
|
-
var
|
2854
|
-
var SerializedUserField =
|
2855
|
-
$userField:
|
2962
|
+
var import_zod23 = require("zod");
|
2963
|
+
var SerializedUserField = import_zod23.z.object({
|
2964
|
+
$userField: import_zod23.z.enum([
|
2856
2965
|
"id",
|
2857
2966
|
"name",
|
2858
2967
|
"role",
|
@@ -3104,8 +3213,9 @@ function createFieldConditionals(fieldId) {
|
|
3104
3213
|
properties: {
|
3105
3214
|
[fieldId]: {
|
3106
3215
|
type: "string",
|
3107
|
-
|
3108
|
-
|
3216
|
+
minLength: 1,
|
3217
|
+
pattern: "^[\\p{Script=Latin}0-9'.-]*(\\([\\p{Script=Latin}0-9'.-]+\\))?[\\p{Script=Latin}0-9'.-]*( [\\p{Script=Latin}0-9'.-]*(\\([\\p{Script=Latin}0-9'.-]+\\))?[\\p{Script=Latin}0-9'.-]*)*$",
|
3218
|
+
description: "Name must contain only letters, numbers, and allowed special characters ('.-). No double spaces."
|
3109
3219
|
}
|
3110
3220
|
}
|
3111
3221
|
}),
|
@@ -3218,7 +3328,7 @@ function createSearchConfig(baseField) {
|
|
3218
3328
|
// ../commons/src/event-config/event-configuration.ts
|
3219
3329
|
function createEventFieldConfig(fieldId) {
|
3220
3330
|
const baseField = {
|
3221
|
-
fieldId
|
3331
|
+
fieldId: `${METADATA_FIELD_PREFIX}${fieldId}`,
|
3222
3332
|
fieldType: "event"
|
3223
3333
|
};
|
3224
3334
|
return createSearchConfig(baseField);
|
@@ -3340,83 +3450,82 @@ var event = Object.assign(eventFn, {
|
|
3340
3450
|
});
|
3341
3451
|
|
3342
3452
|
// ../commons/src/events/WorkqueueColumnConfig.ts
|
3343
|
-
var
|
3453
|
+
var import_zod25 = require("zod");
|
3344
3454
|
|
3345
3455
|
// ../commons/src/events/EventMetadata.ts
|
3346
|
-
var
|
3347
|
-
var EventStatus =
|
3456
|
+
var import_zod24 = require("zod");
|
3457
|
+
var EventStatus = import_zod24.z.enum([
|
3348
3458
|
"CREATED",
|
3349
3459
|
"NOTIFIED",
|
3350
3460
|
"DECLARED",
|
3351
3461
|
"VALIDATED",
|
3352
3462
|
"REGISTERED",
|
3353
|
-
"CERTIFIED",
|
3354
3463
|
"ARCHIVED"
|
3355
3464
|
]);
|
3356
|
-
var VisibleStatus = import_zod23.z.enum([...EventStatus.options, "REJECTED"]);
|
3357
3465
|
var InherentFlags = {
|
3358
|
-
|
3466
|
+
PENDING_CERTIFICATION: "pending-certification",
|
3359
3467
|
INCOMPLETE: "incomplete",
|
3360
3468
|
REJECTED: "rejected",
|
3361
3469
|
CORRECTION_REQUESTED: "correction-requested"
|
3362
3470
|
};
|
3363
|
-
var
|
3471
|
+
var ActionFlag = import_zod24.z.string().regex(
|
3364
3472
|
new RegExp(
|
3365
3473
|
`^(${Object.values(ActionType).join("|").toLowerCase()}):(${Object.values(
|
3366
3474
|
ActionStatus
|
3367
3475
|
).join("|").toLowerCase()})$`
|
3368
3476
|
),
|
3369
3477
|
"Flag must be in the format ActionType:ActionStatus (lowerCase)"
|
3370
|
-
)
|
3371
|
-
var
|
3372
|
-
var
|
3373
|
-
|
3374
|
-
|
3478
|
+
);
|
3479
|
+
var Flag = ActionFlag.or(import_zod24.z.nativeEnum(InherentFlags));
|
3480
|
+
var ZodDate = import_zod24.z.string().date();
|
3481
|
+
var ActionCreationMetadata = import_zod24.z.object({
|
3482
|
+
createdAt: import_zod24.z.string().datetime().describe("The timestamp when the action request was created."),
|
3483
|
+
createdBy: import_zod24.z.string().describe("ID of the user who created the action request."),
|
3375
3484
|
createdAtLocation: CreatedAtLocation.describe(
|
3376
3485
|
"Location of the user who created the action request."
|
3377
3486
|
),
|
3378
|
-
createdByUserType:
|
3379
|
-
acceptedAt:
|
3380
|
-
createdByRole:
|
3381
|
-
createdBySignature:
|
3487
|
+
createdByUserType: import_zod24.z.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
3488
|
+
acceptedAt: import_zod24.z.string().datetime().describe("Timestamp when the action request was accepted."),
|
3489
|
+
createdByRole: import_zod24.z.string().describe("Role of the user at the time of action request creation."),
|
3490
|
+
createdBySignature: import_zod24.z.string().nullish().describe("Signature of the user who created the action request.")
|
3382
3491
|
});
|
3383
3492
|
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
3384
|
-
registrationNumber:
|
3493
|
+
registrationNumber: import_zod24.z.string().describe(
|
3385
3494
|
"Registration number of the event. Always present for accepted registrations."
|
3386
3495
|
)
|
3387
3496
|
});
|
3388
|
-
var LegalStatuses =
|
3497
|
+
var LegalStatuses = import_zod24.z.object({
|
3389
3498
|
[EventStatus.enum.DECLARED]: ActionCreationMetadata.nullish(),
|
3390
3499
|
[EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish()
|
3391
3500
|
});
|
3392
|
-
var EventMetadata =
|
3501
|
+
var EventMetadata = import_zod24.z.object({
|
3393
3502
|
id: UUID,
|
3394
|
-
type:
|
3503
|
+
type: import_zod24.z.string().describe("The type of event, such as birth, death, or marriage."),
|
3395
3504
|
status: EventStatus,
|
3396
3505
|
legalStatuses: LegalStatuses.describe(
|
3397
3506
|
"Metadata related to the legal registration of the event, such as who registered it and when."
|
3398
3507
|
),
|
3399
|
-
createdAt:
|
3508
|
+
createdAt: import_zod24.z.string().datetime().describe("The timestamp when the event was first created and saved."),
|
3400
3509
|
dateOfEvent: ZodDate.nullish(),
|
3401
|
-
createdBy:
|
3402
|
-
createdByUserType:
|
3403
|
-
updatedByUserRole:
|
3510
|
+
createdBy: import_zod24.z.string().describe("ID of the user who created the event."),
|
3511
|
+
createdByUserType: import_zod24.z.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
3512
|
+
updatedByUserRole: import_zod24.z.string().describe("Role of the user who last changed the status."),
|
3404
3513
|
createdAtLocation: CreatedAtLocation.describe(
|
3405
3514
|
"Location of the user who created the event."
|
3406
3515
|
),
|
3407
|
-
createdBySignature:
|
3516
|
+
createdBySignature: import_zod24.z.string().nullish().describe("Signature of the user who created the event."),
|
3408
3517
|
updatedAtLocation: UUID.nullish().describe(
|
3409
3518
|
"Location of the user who last changed the status."
|
3410
3519
|
),
|
3411
|
-
updatedAt:
|
3520
|
+
updatedAt: import_zod24.z.string().datetime().describe(
|
3412
3521
|
"Timestamp of the most recent *accepted* status change. Possibly 3rd party update, if action is validation asynchronously."
|
3413
3522
|
),
|
3414
|
-
assignedTo:
|
3415
|
-
updatedBy:
|
3416
|
-
trackingId:
|
3523
|
+
assignedTo: import_zod24.z.string().nullish().describe("ID of the user currently assigned to the event."),
|
3524
|
+
updatedBy: import_zod24.z.string().nullish().describe("ID of the user who last changed the status."),
|
3525
|
+
trackingId: import_zod24.z.string().describe(
|
3417
3526
|
"System-generated tracking ID used by informants or registrars to look up the event."
|
3418
3527
|
),
|
3419
|
-
flags:
|
3528
|
+
flags: import_zod24.z.array(Flag)
|
3420
3529
|
});
|
3421
3530
|
var EventMetadataKeysArray = [
|
3422
3531
|
"id",
|
@@ -3436,7 +3545,7 @@ var EventMetadataKeysArray = [
|
|
3436
3545
|
"legalStatuses",
|
3437
3546
|
"flags"
|
3438
3547
|
];
|
3439
|
-
var EventMetadataKeys =
|
3548
|
+
var EventMetadataKeys = import_zod24.z.enum(EventMetadataKeysArray);
|
3440
3549
|
var eventMetadataLabelMap = {
|
3441
3550
|
"event.assignedTo": {
|
3442
3551
|
id: "event.assignedTo.label",
|
@@ -3521,11 +3630,11 @@ var WorkqueueColumnKeysArray = [
|
|
3521
3630
|
"title",
|
3522
3631
|
"outbox"
|
3523
3632
|
];
|
3524
|
-
var WorkqueueColumnKeys =
|
3525
|
-
var WorkqueueColumnValue =
|
3633
|
+
var WorkqueueColumnKeys = import_zod25.z.enum(WorkqueueColumnKeysArray);
|
3634
|
+
var WorkqueueColumnValue = import_zod25.z.object({
|
3526
3635
|
$event: WorkqueueColumnKeys
|
3527
3636
|
});
|
3528
|
-
var WorkqueueColumn =
|
3637
|
+
var WorkqueueColumn = import_zod25.z.object({
|
3529
3638
|
label: TranslationConfig,
|
3530
3639
|
value: WorkqueueColumnValue
|
3531
3640
|
});
|
@@ -3536,120 +3645,120 @@ function defineWorkqueuesColumns(workqueueColumns) {
|
|
3536
3645
|
}
|
3537
3646
|
|
3538
3647
|
// ../commons/src/events/CountryConfigQueryInput.ts
|
3539
|
-
var
|
3648
|
+
var import_zod27 = require("zod");
|
3540
3649
|
|
3541
3650
|
// ../commons/src/events/EventIndex.ts
|
3542
|
-
var
|
3651
|
+
var import_zod26 = require("zod");
|
3543
3652
|
var import_zod_openapi10 = require("zod-openapi");
|
3544
|
-
(0, import_zod_openapi10.extendZodWithOpenApi)(
|
3653
|
+
(0, import_zod_openapi10.extendZodWithOpenApi)(import_zod26.z);
|
3545
3654
|
var EventIndex = EventMetadata.extend({
|
3546
3655
|
declaration: EventState
|
3547
3656
|
}).openapi({
|
3548
3657
|
ref: "EventIndex"
|
3549
3658
|
});
|
3550
|
-
var EventSearchIndex =
|
3551
|
-
|
3552
|
-
type:
|
3659
|
+
var EventSearchIndex = import_zod26.z.record(import_zod26.z.string(), import_zod26.z.any()).and(
|
3660
|
+
import_zod26.z.object({
|
3661
|
+
type: import_zod26.z.string()
|
3553
3662
|
// Ensures "type" (event-id) exists and is a string
|
3554
3663
|
})
|
3555
3664
|
).openapi({
|
3556
3665
|
ref: "EventSearchIndex"
|
3557
3666
|
});
|
3558
|
-
var Fuzzy =
|
3667
|
+
var Fuzzy = import_zod26.z.object({ type: import_zod26.z.literal("fuzzy"), term: import_zod26.z.string() }).openapi({
|
3559
3668
|
ref: "Fuzzy"
|
3560
3669
|
});
|
3561
|
-
var Exact =
|
3670
|
+
var Exact = import_zod26.z.object({ type: import_zod26.z.literal("exact"), term: import_zod26.z.string() }).openapi({
|
3562
3671
|
ref: "Exact"
|
3563
3672
|
});
|
3564
|
-
var ExactStatus =
|
3565
|
-
type:
|
3673
|
+
var ExactStatus = import_zod26.z.object({
|
3674
|
+
type: import_zod26.z.literal("exact"),
|
3566
3675
|
term: EventStatus
|
3567
3676
|
}).openapi({
|
3568
3677
|
ref: "ExactStatus"
|
3569
3678
|
});
|
3570
|
-
var ExactUserType =
|
3571
|
-
type:
|
3679
|
+
var ExactUserType = import_zod26.z.object({
|
3680
|
+
type: import_zod26.z.literal("exact"),
|
3572
3681
|
term: TokenUserType
|
3573
3682
|
}).openapi({
|
3574
3683
|
ref: "ExactUserType"
|
3575
3684
|
});
|
3576
|
-
var AnyOf =
|
3577
|
-
type:
|
3578
|
-
terms:
|
3685
|
+
var AnyOf = import_zod26.z.object({
|
3686
|
+
type: import_zod26.z.literal("anyOf"),
|
3687
|
+
terms: import_zod26.z.array(import_zod26.z.string())
|
3579
3688
|
}).openapi({
|
3580
3689
|
ref: "AnyOf"
|
3581
3690
|
});
|
3582
|
-
var AnyOfStatus =
|
3583
|
-
type:
|
3584
|
-
terms:
|
3691
|
+
var AnyOfStatus = import_zod26.z.object({
|
3692
|
+
type: import_zod26.z.literal("anyOf"),
|
3693
|
+
terms: import_zod26.z.array(EventStatus)
|
3585
3694
|
}).openapi({
|
3586
3695
|
ref: "AnyOfStatus"
|
3587
3696
|
});
|
3588
|
-
var Range =
|
3589
|
-
type:
|
3590
|
-
gte:
|
3591
|
-
lte:
|
3697
|
+
var Range = import_zod26.z.object({
|
3698
|
+
type: import_zod26.z.literal("range"),
|
3699
|
+
gte: import_zod26.z.string(),
|
3700
|
+
lte: import_zod26.z.string()
|
3592
3701
|
}).openapi({
|
3593
3702
|
ref: "Range"
|
3594
3703
|
});
|
3595
|
-
var ContainsFlags =
|
3596
|
-
anyOf:
|
3597
|
-
noneOf:
|
3704
|
+
var ContainsFlags = import_zod26.z.object({
|
3705
|
+
anyOf: import_zod26.z.array(Flag).optional(),
|
3706
|
+
noneOf: import_zod26.z.array(Flag).optional()
|
3598
3707
|
}).openapi({
|
3599
3708
|
ref: "ContainsFlags"
|
3600
3709
|
});
|
3601
|
-
var Within =
|
3710
|
+
var Within = import_zod26.z.object({ type: import_zod26.z.literal("within"), location: import_zod26.z.string() }).openapi({
|
3602
3711
|
ref: "Within"
|
3603
3712
|
});
|
3604
|
-
var RangeDate =
|
3605
|
-
type:
|
3606
|
-
gte:
|
3607
|
-
lte:
|
3713
|
+
var RangeDate = import_zod26.z.object({
|
3714
|
+
type: import_zod26.z.literal("range"),
|
3715
|
+
gte: import_zod26.z.string().date().or(import_zod26.z.string().datetime()),
|
3716
|
+
lte: import_zod26.z.string().date().or(import_zod26.z.string().datetime())
|
3608
3717
|
}).openapi({ ref: "RangeDate" });
|
3609
3718
|
var ExactDate = Exact.extend({
|
3610
|
-
term:
|
3719
|
+
term: import_zod26.z.string().date().or(import_zod26.z.string().datetime())
|
3611
3720
|
}).openapi({
|
3612
3721
|
ref: "ExactDate"
|
3613
3722
|
});
|
3614
|
-
var TimePeriod =
|
3615
|
-
type:
|
3723
|
+
var TimePeriod = import_zod26.z.object({
|
3724
|
+
type: import_zod26.z.literal("timePeriod"),
|
3616
3725
|
term: SelectDateRangeValue
|
3617
3726
|
}).openapi({
|
3618
3727
|
ref: "TimePeriod"
|
3619
3728
|
});
|
3620
|
-
var DateCondition =
|
3729
|
+
var DateCondition = import_zod26.z.union([ExactDate, RangeDate, TimePeriod]).openapi({
|
3621
3730
|
ref: "DateCondition"
|
3622
3731
|
});
|
3623
|
-
var QueryInput =
|
3624
|
-
() =>
|
3625
|
-
|
3626
|
-
|
3732
|
+
var QueryInput = import_zod26.z.lazy(
|
3733
|
+
() => import_zod26.z.union([
|
3734
|
+
import_zod26.z.discriminatedUnion("type", [Fuzzy, Exact, Range, Within, AnyOf]),
|
3735
|
+
import_zod26.z.record(import_zod26.z.string(), QueryInput)
|
3627
3736
|
])
|
3628
3737
|
).openapi({
|
3629
3738
|
ref: "QueryInput"
|
3630
3739
|
});
|
3631
|
-
var QueryExpression =
|
3632
|
-
id:
|
3633
|
-
eventType:
|
3634
|
-
status:
|
3635
|
-
createdAt:
|
3636
|
-
updatedAt:
|
3637
|
-
"legalStatuses.REGISTERED.acceptedAt":
|
3638
|
-
"legalStatuses.DECLARED.createdAtLocation":
|
3639
|
-
|
3740
|
+
var QueryExpression = import_zod26.z.object({
|
3741
|
+
id: import_zod26.z.optional(import_zod26.z.string()),
|
3742
|
+
eventType: import_zod26.z.string(),
|
3743
|
+
status: import_zod26.z.optional(import_zod26.z.union([AnyOfStatus, ExactStatus])),
|
3744
|
+
createdAt: import_zod26.z.optional(DateCondition),
|
3745
|
+
updatedAt: import_zod26.z.optional(DateCondition),
|
3746
|
+
"legalStatuses.REGISTERED.acceptedAt": import_zod26.z.optional(DateCondition),
|
3747
|
+
"legalStatuses.DECLARED.createdAtLocation": import_zod26.z.optional(
|
3748
|
+
import_zod26.z.union([Within, Exact])
|
3640
3749
|
),
|
3641
|
-
"legalStatuses.REGISTERED.createdAtLocation":
|
3642
|
-
|
3750
|
+
"legalStatuses.REGISTERED.createdAtLocation": import_zod26.z.optional(
|
3751
|
+
import_zod26.z.union([Within, Exact])
|
3643
3752
|
),
|
3644
|
-
"legalStatuses.REGISTERED.registrationNumber":
|
3645
|
-
createdAtLocation:
|
3646
|
-
updatedAtLocation:
|
3647
|
-
assignedTo:
|
3648
|
-
createdByUserType:
|
3649
|
-
createdBy:
|
3650
|
-
updatedBy:
|
3651
|
-
trackingId:
|
3652
|
-
flags:
|
3753
|
+
"legalStatuses.REGISTERED.registrationNumber": import_zod26.z.optional(Exact),
|
3754
|
+
createdAtLocation: import_zod26.z.optional(import_zod26.z.union([Within, Exact])),
|
3755
|
+
updatedAtLocation: import_zod26.z.optional(import_zod26.z.union([Within, Exact])),
|
3756
|
+
assignedTo: import_zod26.z.optional(Exact),
|
3757
|
+
createdByUserType: import_zod26.z.optional(ExactUserType),
|
3758
|
+
createdBy: import_zod26.z.optional(Exact),
|
3759
|
+
updatedBy: import_zod26.z.optional(Exact),
|
3760
|
+
trackingId: import_zod26.z.optional(Exact),
|
3761
|
+
flags: import_zod26.z.optional(ContainsFlags),
|
3653
3762
|
// @todo: The type for this comes out as "any"
|
3654
3763
|
data: QueryInput
|
3655
3764
|
}).partial().refine((obj) => Object.values(obj).some((val) => val !== void 0), {
|
@@ -3657,9 +3766,9 @@ var QueryExpression = import_zod25.z.object({
|
|
3657
3766
|
}).openapi({
|
3658
3767
|
ref: "QueryExpression"
|
3659
3768
|
});
|
3660
|
-
var QueryType =
|
3661
|
-
type:
|
3662
|
-
clauses:
|
3769
|
+
var QueryType = import_zod26.z.object({
|
3770
|
+
type: import_zod26.z.literal("and").or(import_zod26.z.literal("or")).openapi({ default: "and" }),
|
3771
|
+
clauses: import_zod26.z.preprocess(
|
3663
3772
|
(val) => {
|
3664
3773
|
if (typeof val === "string") {
|
3665
3774
|
return [JSON.parse(val)];
|
@@ -3669,7 +3778,7 @@ var QueryType = import_zod25.z.object({
|
|
3669
3778
|
}
|
3670
3779
|
return val;
|
3671
3780
|
},
|
3672
|
-
|
3781
|
+
import_zod26.z.array(QueryExpression).nonempty("At least one clause is required.").openapi({
|
3673
3782
|
default: [
|
3674
3783
|
{
|
3675
3784
|
eventType: TENNIS_CLUB_MEMBERSHIP,
|
@@ -3696,56 +3805,56 @@ var SearchScopeAccessLevels = {
|
|
3696
3805
|
};
|
3697
3806
|
|
3698
3807
|
// ../commons/src/events/CountryConfigQueryInput.ts
|
3699
|
-
var SerializableExact =
|
3700
|
-
type:
|
3701
|
-
term:
|
3808
|
+
var SerializableExact = import_zod27.z.object({
|
3809
|
+
type: import_zod27.z.literal("exact"),
|
3810
|
+
term: import_zod27.z.union([import_zod27.z.string(), SerializedUserField])
|
3702
3811
|
});
|
3703
|
-
var SerializableWithin =
|
3704
|
-
type:
|
3705
|
-
location:
|
3812
|
+
var SerializableWithin = import_zod27.z.object({
|
3813
|
+
type: import_zod27.z.literal("within"),
|
3814
|
+
location: import_zod27.z.union([import_zod27.z.string(), SerializedUserField])
|
3706
3815
|
});
|
3707
|
-
var SerializedQueryExpression =
|
3708
|
-
eventType:
|
3709
|
-
status:
|
3710
|
-
createdAt:
|
3711
|
-
updatedAt:
|
3712
|
-
"legalStatuses.REGISTERED.createdAt":
|
3713
|
-
"legalStatuses.REGISTERED.createdAtLocation":
|
3714
|
-
|
3816
|
+
var SerializedQueryExpression = import_zod27.z.object({
|
3817
|
+
eventType: import_zod27.z.string(),
|
3818
|
+
status: import_zod27.z.optional(import_zod27.z.union([AnyOfStatus, ExactStatus])),
|
3819
|
+
createdAt: import_zod27.z.optional(DateCondition),
|
3820
|
+
updatedAt: import_zod27.z.optional(DateCondition),
|
3821
|
+
"legalStatuses.REGISTERED.createdAt": import_zod27.z.optional(DateCondition),
|
3822
|
+
"legalStatuses.REGISTERED.createdAtLocation": import_zod27.z.optional(
|
3823
|
+
import_zod27.z.union([Within, Exact])
|
3715
3824
|
),
|
3716
|
-
"legalStatuses.REGISTERED.registrationNumber":
|
3717
|
-
createdAtLocation:
|
3718
|
-
|
3825
|
+
"legalStatuses.REGISTERED.registrationNumber": import_zod27.z.optional(Exact),
|
3826
|
+
createdAtLocation: import_zod27.z.optional(
|
3827
|
+
import_zod27.z.union([SerializableWithin, SerializableExact])
|
3719
3828
|
),
|
3720
|
-
updatedAtLocation:
|
3721
|
-
|
3829
|
+
updatedAtLocation: import_zod27.z.optional(
|
3830
|
+
import_zod27.z.union([SerializableWithin, SerializableExact])
|
3722
3831
|
),
|
3723
|
-
assignedTo:
|
3724
|
-
createdBy:
|
3832
|
+
assignedTo: import_zod27.z.optional(SerializableExact),
|
3833
|
+
createdBy: import_zod27.z.optional(SerializableExact),
|
3725
3834
|
createdByUserType: ExactUserType,
|
3726
|
-
updatedBy:
|
3727
|
-
trackingId:
|
3728
|
-
flags:
|
3835
|
+
updatedBy: import_zod27.z.optional(SerializableExact),
|
3836
|
+
trackingId: import_zod27.z.optional(Exact),
|
3837
|
+
flags: import_zod27.z.optional(ContainsFlags),
|
3729
3838
|
data: QueryInput
|
3730
3839
|
}).partial();
|
3731
|
-
var Or2 =
|
3732
|
-
type:
|
3733
|
-
clauses:
|
3840
|
+
var Or2 = import_zod27.z.object({
|
3841
|
+
type: import_zod27.z.literal("or"),
|
3842
|
+
clauses: import_zod27.z.array(SerializedQueryExpression)
|
3734
3843
|
});
|
3735
|
-
var And2 =
|
3736
|
-
type:
|
3737
|
-
clauses:
|
3844
|
+
var And2 = import_zod27.z.object({
|
3845
|
+
type: import_zod27.z.literal("and"),
|
3846
|
+
clauses: import_zod27.z.array(SerializedQueryExpression)
|
3738
3847
|
});
|
3739
|
-
var CountryConfigQueryType =
|
3740
|
-
var CountryConfigQueryInputType =
|
3848
|
+
var CountryConfigQueryType = import_zod27.z.discriminatedUnion("type", [And2, Or2]);
|
3849
|
+
var CountryConfigQueryInputType = import_zod27.z.union([
|
3741
3850
|
SerializedQueryExpression,
|
3742
3851
|
And2,
|
3743
3852
|
Or2
|
3744
3853
|
]);
|
3745
3854
|
|
3746
3855
|
// ../commons/src/icons.ts
|
3747
|
-
var
|
3748
|
-
var AvailableIcons =
|
3856
|
+
var import_zod28 = require("zod");
|
3857
|
+
var AvailableIcons = import_zod28.z.enum([
|
3749
3858
|
"Archived",
|
3750
3859
|
"Assigned",
|
3751
3860
|
"Certified",
|
@@ -3866,43 +3975,45 @@ var mandatoryColumns = defineWorkqueuesColumns([
|
|
3866
3975
|
value: event.field("updatedAt")
|
3867
3976
|
}
|
3868
3977
|
]);
|
3869
|
-
var WorkqueueActionsWithDefault =
|
3978
|
+
var WorkqueueActionsWithDefault = import_zod29.z.enum([
|
3870
3979
|
...workqueueActions.options,
|
3871
3980
|
"DEFAULT"
|
3872
3981
|
]);
|
3873
|
-
var WorkqueueConfig =
|
3874
|
-
slug:
|
3982
|
+
var WorkqueueConfig = import_zod29.z.object({
|
3983
|
+
slug: import_zod29.z.string().describe("Determines the url of the workqueue."),
|
3875
3984
|
name: TranslationConfig.describe(
|
3876
3985
|
"Title of the workflow (both in navigation and on the page)"
|
3877
3986
|
),
|
3878
3987
|
query: CountryConfigQueryType,
|
3879
|
-
actions:
|
3880
|
-
|
3988
|
+
actions: import_zod29.z.array(
|
3989
|
+
import_zod29.z.object({
|
3881
3990
|
type: WorkqueueActionsWithDefault,
|
3882
|
-
conditionals:
|
3991
|
+
conditionals: import_zod29.z.array(Conditional).optional()
|
3883
3992
|
})
|
3884
3993
|
),
|
3885
|
-
columns:
|
3886
|
-
icon: AvailableIcons
|
3994
|
+
columns: import_zod29.z.array(WorkqueueColumn).default(mandatoryColumns),
|
3995
|
+
icon: AvailableIcons,
|
3996
|
+
emptyMessage: TranslationConfig.optional()
|
3887
3997
|
}).describe("Configuration for workqueue.");
|
3888
3998
|
var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
|
3889
3999
|
query: true,
|
3890
4000
|
columns: true
|
3891
4001
|
});
|
3892
|
-
var WorkqueueConfigInput =
|
3893
|
-
slug:
|
4002
|
+
var WorkqueueConfigInput = import_zod29.z.object({
|
4003
|
+
slug: import_zod29.z.string().describe("Determines the url of the workqueue."),
|
3894
4004
|
name: TranslationConfig.describe(
|
3895
4005
|
"Title of the workflow (both in navigation and on the page)"
|
3896
4006
|
),
|
3897
4007
|
query: CountryConfigQueryInputType,
|
3898
|
-
actions:
|
3899
|
-
|
4008
|
+
actions: import_zod29.z.array(
|
4009
|
+
import_zod29.z.object({
|
3900
4010
|
type: WorkqueueActionsWithDefault,
|
3901
|
-
conditionals:
|
4011
|
+
conditionals: import_zod29.z.array(Conditional).optional()
|
3902
4012
|
})
|
3903
4013
|
),
|
3904
|
-
columns:
|
3905
|
-
icon: AvailableIcons
|
4014
|
+
columns: import_zod29.z.array(WorkqueueColumn).default(mandatoryColumns),
|
4015
|
+
icon: AvailableIcons,
|
4016
|
+
emptyMessage: TranslationConfig.optional()
|
3906
4017
|
});
|
3907
4018
|
function defineWorkqueue(workqueueInput) {
|
3908
4019
|
const queryInput = workqueueInput.query;
|
@@ -3912,10 +4023,10 @@ function defineWorkqueue(workqueueInput) {
|
|
3912
4023
|
function defineWorkqueues(workqueues) {
|
3913
4024
|
return workqueues.map((workqueue) => defineWorkqueue(workqueue));
|
3914
4025
|
}
|
3915
|
-
var WorkqueueCountInput =
|
3916
|
-
|
4026
|
+
var WorkqueueCountInput = import_zod29.z.array(
|
4027
|
+
import_zod29.z.object({ slug: import_zod29.z.string(), query: QueryType })
|
3917
4028
|
);
|
3918
|
-
var WorkqueueCountOutput =
|
4029
|
+
var WorkqueueCountOutput = import_zod29.z.record(import_zod29.z.string(), import_zod29.z.number());
|
3919
4030
|
|
3920
4031
|
// ../commons/src/events/workqueueDefaultColumns.ts
|
3921
4032
|
var defaultWorkqueueColumns = [
|
@@ -3938,42 +4049,42 @@ var defaultWorkqueueColumns = [
|
|
3938
4049
|
];
|
3939
4050
|
|
3940
4051
|
// ../commons/src/events/Draft.ts
|
3941
|
-
var
|
4052
|
+
var import_zod31 = require("zod");
|
3942
4053
|
|
3943
4054
|
// ../commons/src/events/ActionInput.ts
|
3944
|
-
var
|
4055
|
+
var import_zod30 = require("zod");
|
3945
4056
|
var import_zod_openapi11 = require("zod-openapi");
|
3946
|
-
(0, import_zod_openapi11.extendZodWithOpenApi)(
|
3947
|
-
var BaseActionInput =
|
4057
|
+
(0, import_zod_openapi11.extendZodWithOpenApi)(import_zod30.z);
|
4058
|
+
var BaseActionInput = import_zod30.z.object({
|
3948
4059
|
eventId: UUID,
|
3949
|
-
transactionId:
|
4060
|
+
transactionId: import_zod30.z.string(),
|
3950
4061
|
declaration: ActionUpdate.default({}),
|
3951
4062
|
annotation: ActionUpdate.optional(),
|
3952
4063
|
originalActionId: UUID.optional(),
|
3953
4064
|
// should not be part of base action.
|
3954
|
-
keepAssignment:
|
4065
|
+
keepAssignment: import_zod30.z.boolean().optional()
|
3955
4066
|
});
|
3956
4067
|
var CreateActionInput = BaseActionInput.merge(
|
3957
|
-
|
3958
|
-
type:
|
4068
|
+
import_zod30.z.object({
|
4069
|
+
type: import_zod30.z.literal(ActionType.CREATE).default(ActionType.CREATE),
|
3959
4070
|
createdAtLocation: CreatedAtLocation
|
3960
4071
|
})
|
3961
4072
|
);
|
3962
4073
|
var RegisterActionInput = BaseActionInput.merge(
|
3963
|
-
|
3964
|
-
type:
|
3965
|
-
registrationNumber:
|
4074
|
+
import_zod30.z.object({
|
4075
|
+
type: import_zod30.z.literal(ActionType.REGISTER).default(ActionType.REGISTER),
|
4076
|
+
registrationNumber: import_zod30.z.string().optional()
|
3966
4077
|
})
|
3967
4078
|
).strict();
|
3968
4079
|
var ValidateActionInput = BaseActionInput.merge(
|
3969
|
-
|
3970
|
-
type:
|
3971
|
-
duplicates:
|
4080
|
+
import_zod30.z.object({
|
4081
|
+
type: import_zod30.z.literal(ActionType.VALIDATE).default(ActionType.VALIDATE),
|
4082
|
+
duplicates: import_zod30.z.array(import_zod30.z.string())
|
3972
4083
|
})
|
3973
4084
|
);
|
3974
4085
|
var NotifyActionInput = BaseActionInput.merge(
|
3975
|
-
|
3976
|
-
type:
|
4086
|
+
import_zod30.z.object({
|
4087
|
+
type: import_zod30.z.literal(ActionType.NOTIFY).default(ActionType.NOTIFY)
|
3977
4088
|
})
|
3978
4089
|
).openapi({
|
3979
4090
|
default: {
|
@@ -3985,70 +4096,70 @@ var NotifyActionInput = BaseActionInput.merge(
|
|
3985
4096
|
}
|
3986
4097
|
});
|
3987
4098
|
var DeclareActionInput = BaseActionInput.merge(
|
3988
|
-
|
3989
|
-
type:
|
4099
|
+
import_zod30.z.object({
|
4100
|
+
type: import_zod30.z.literal(ActionType.DECLARE).default(ActionType.DECLARE)
|
3990
4101
|
})
|
3991
4102
|
);
|
3992
4103
|
var PrintCertificateActionInput = BaseActionInput.merge(
|
3993
|
-
|
3994
|
-
type:
|
4104
|
+
import_zod30.z.object({
|
4105
|
+
type: import_zod30.z.literal(ActionType.PRINT_CERTIFICATE).default(ActionType.PRINT_CERTIFICATE),
|
3995
4106
|
content: PrintContent.optional()
|
3996
4107
|
})
|
3997
4108
|
);
|
3998
4109
|
var RejectDeclarationActionInput = BaseActionInput.merge(
|
3999
|
-
|
4000
|
-
type:
|
4110
|
+
import_zod30.z.object({
|
4111
|
+
type: import_zod30.z.literal(ActionType.REJECT).default(ActionType.REJECT),
|
4001
4112
|
reason: RejectionReason
|
4002
4113
|
})
|
4003
4114
|
);
|
4004
4115
|
var MarkedAsDuplicateActionInput = BaseActionInput.merge(
|
4005
|
-
|
4006
|
-
type:
|
4116
|
+
import_zod30.z.object({
|
4117
|
+
type: import_zod30.z.literal(ActionType.MARKED_AS_DUPLICATE).default(ActionType.MARKED_AS_DUPLICATE)
|
4007
4118
|
})
|
4008
4119
|
);
|
4009
4120
|
var ArchiveActionInput = BaseActionInput.merge(
|
4010
|
-
|
4011
|
-
type:
|
4121
|
+
import_zod30.z.object({
|
4122
|
+
type: import_zod30.z.literal(ActionType.ARCHIVE).default(ActionType.ARCHIVE),
|
4012
4123
|
reason: RejectionReason
|
4013
4124
|
})
|
4014
4125
|
);
|
4015
4126
|
var AssignActionInput = BaseActionInput.merge(
|
4016
|
-
|
4017
|
-
type:
|
4018
|
-
assignedTo:
|
4127
|
+
import_zod30.z.object({
|
4128
|
+
type: import_zod30.z.literal(ActionType.ASSIGN).default(ActionType.ASSIGN),
|
4129
|
+
assignedTo: import_zod30.z.string()
|
4019
4130
|
})
|
4020
4131
|
);
|
4021
4132
|
var UnassignActionInput = BaseActionInput.merge(
|
4022
|
-
|
4023
|
-
type:
|
4024
|
-
assignedTo:
|
4133
|
+
import_zod30.z.object({
|
4134
|
+
type: import_zod30.z.literal(ActionType.UNASSIGN).default(ActionType.UNASSIGN),
|
4135
|
+
assignedTo: import_zod30.z.literal(null).default(null)
|
4025
4136
|
})
|
4026
4137
|
);
|
4027
4138
|
var RequestCorrectionActionInput = BaseActionInput.merge(
|
4028
|
-
|
4029
|
-
type:
|
4139
|
+
import_zod30.z.object({
|
4140
|
+
type: import_zod30.z.literal(ActionType.REQUEST_CORRECTION).default(ActionType.REQUEST_CORRECTION)
|
4030
4141
|
})
|
4031
4142
|
);
|
4032
4143
|
var RejectCorrectionActionInput = BaseActionInput.merge(
|
4033
|
-
|
4034
|
-
requestId:
|
4035
|
-
type:
|
4144
|
+
import_zod30.z.object({
|
4145
|
+
requestId: import_zod30.z.string(),
|
4146
|
+
type: import_zod30.z.literal(ActionType.REJECT_CORRECTION).default(ActionType.REJECT_CORRECTION),
|
4036
4147
|
reason: RejectionReason
|
4037
4148
|
})
|
4038
4149
|
);
|
4039
4150
|
var ApproveCorrectionActionInput = BaseActionInput.merge(
|
4040
|
-
|
4041
|
-
requestId:
|
4042
|
-
type:
|
4151
|
+
import_zod30.z.object({
|
4152
|
+
requestId: import_zod30.z.string(),
|
4153
|
+
type: import_zod30.z.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
|
4043
4154
|
})
|
4044
4155
|
);
|
4045
4156
|
var ReadActionInput = BaseActionInput.merge(
|
4046
|
-
|
4047
|
-
type:
|
4157
|
+
import_zod30.z.object({
|
4158
|
+
type: import_zod30.z.literal(ActionType.READ).default(ActionType.READ)
|
4048
4159
|
})
|
4049
4160
|
);
|
4050
|
-
var DeleteActionInput =
|
4051
|
-
var ActionInput =
|
4161
|
+
var DeleteActionInput = import_zod30.z.object({ eventId: UUID });
|
4162
|
+
var ActionInput = import_zod30.z.discriminatedUnion("type", [
|
4052
4163
|
CreateActionInput.openapi({ ref: "CreateActionInput" }),
|
4053
4164
|
ValidateActionInput.openapi({ ref: "ValidateActionInput" }),
|
4054
4165
|
RegisterActionInput.openapi({ ref: "RegisterActionInput" }),
|
@@ -4077,18 +4188,18 @@ var ActionInput = import_zod29.z.discriminatedUnion("type", [
|
|
4077
4188
|
});
|
4078
4189
|
|
4079
4190
|
// ../commons/src/events/Draft.ts
|
4080
|
-
var Draft =
|
4191
|
+
var Draft = import_zod31.z.object({
|
4081
4192
|
id: UUID,
|
4082
4193
|
eventId: UUID,
|
4083
|
-
transactionId:
|
4084
|
-
createdAt:
|
4194
|
+
transactionId: import_zod31.z.string(),
|
4195
|
+
createdAt: import_zod31.z.string().datetime(),
|
4085
4196
|
action: ActionBase.extend({
|
4086
|
-
type: ActionTypes
|
4197
|
+
type: ActionTypes.exclude([ActionTypes.Enum.DELETE])
|
4087
4198
|
}).omit({ id: true })
|
4088
4199
|
});
|
4089
4200
|
var DraftInput = BaseActionInput.extend({
|
4090
|
-
type: ActionTypes,
|
4091
|
-
status:
|
4201
|
+
type: ActionTypes.exclude([ActionTypes.Enum.DELETE]),
|
4202
|
+
status: import_zod31.z.enum([
|
4092
4203
|
ActionStatus.Requested,
|
4093
4204
|
ActionStatus.Accepted,
|
4094
4205
|
ActionStatus.Rejected
|
@@ -4096,26 +4207,29 @@ var DraftInput = BaseActionInput.extend({
|
|
4096
4207
|
});
|
4097
4208
|
|
4098
4209
|
// ../commons/src/events/EventInput.ts
|
4099
|
-
var
|
4210
|
+
var import_zod32 = require("zod");
|
4100
4211
|
var import_uuid8 = require("uuid");
|
4101
|
-
var EventInput =
|
4102
|
-
transactionId:
|
4103
|
-
type:
|
4212
|
+
var EventInput = import_zod32.z.object({
|
4213
|
+
transactionId: import_zod32.z.string(),
|
4214
|
+
type: import_zod32.z.string()
|
4104
4215
|
}).openapi({ default: { transactionId: (0, import_uuid8.v4)(), type: "v2.birth" } });
|
4105
4216
|
|
4106
4217
|
// ../commons/src/events/EventDocument.ts
|
4107
|
-
var
|
4218
|
+
var import_zod33 = require("zod");
|
4108
4219
|
var import_zod_openapi12 = require("zod-openapi");
|
4109
|
-
(0, import_zod_openapi12.extendZodWithOpenApi)(
|
4110
|
-
var EventDocument =
|
4220
|
+
(0, import_zod_openapi12.extendZodWithOpenApi)(import_zod33.z);
|
4221
|
+
var EventDocument = import_zod33.z.object({
|
4111
4222
|
id: UUID,
|
4112
|
-
type:
|
4113
|
-
createdAt:
|
4114
|
-
updatedAt:
|
4115
|
-
actions:
|
4116
|
-
trackingId:
|
4223
|
+
type: import_zod33.z.string(),
|
4224
|
+
createdAt: import_zod33.z.string().datetime(),
|
4225
|
+
updatedAt: import_zod33.z.string().datetime(),
|
4226
|
+
actions: import_zod33.z.array(Action),
|
4227
|
+
trackingId: import_zod33.z.string()
|
4117
4228
|
}).openapi({ ref: "EventDocument" });
|
4118
4229
|
|
4230
|
+
// ../commons/src/events/state/index.ts
|
4231
|
+
var import_lodash3 = require("lodash");
|
4232
|
+
|
4119
4233
|
// ../commons/src/events/state/utils.ts
|
4120
4234
|
var import_lodash2 = require("lodash");
|
4121
4235
|
function getActionRequests(actionType, actions) {
|
@@ -4204,16 +4318,19 @@ function getLegalStatuses(actions) {
|
|
4204
4318
|
}
|
4205
4319
|
|
4206
4320
|
// ../commons/src/events/state/flags.ts
|
4207
|
-
function
|
4321
|
+
function isPendingCertification(actions) {
|
4322
|
+
if (getStatusFromActions(actions) !== EventStatus.enum.REGISTERED) {
|
4323
|
+
return false;
|
4324
|
+
}
|
4208
4325
|
return actions.reduce((prev, { type }) => {
|
4209
4326
|
if (type === ActionType.PRINT_CERTIFICATE) {
|
4210
|
-
return
|
4327
|
+
return false;
|
4211
4328
|
}
|
4212
4329
|
if (type === ActionType.APPROVE_CORRECTION) {
|
4213
|
-
return
|
4330
|
+
return true;
|
4214
4331
|
}
|
4215
4332
|
return prev;
|
4216
|
-
},
|
4333
|
+
}, true);
|
4217
4334
|
}
|
4218
4335
|
function isCorrectionRequested(actions) {
|
4219
4336
|
return actions.reduce((prev, { type }) => {
|
@@ -4248,8 +4365,8 @@ function getFlagsFromActions(actions) {
|
|
4248
4365
|
const flag = joinValues([type, status], ":").toLowerCase();
|
4249
4366
|
return flag;
|
4250
4367
|
});
|
4251
|
-
if (
|
4252
|
-
flags.push(InherentFlags.
|
4368
|
+
if (isPendingCertification(sortedActions)) {
|
4369
|
+
flags.push(InherentFlags.PENDING_CERTIFICATION);
|
4253
4370
|
}
|
4254
4371
|
if (isCorrectionRequested(sortedActions)) {
|
4255
4372
|
flags.push(InherentFlags.CORRECTION_REQUESTED);
|
@@ -4280,7 +4397,6 @@ function getStatusFromActions(actions) {
|
|
4280
4397
|
case ActionType.NOTIFY:
|
4281
4398
|
return EventStatus.enum.NOTIFIED;
|
4282
4399
|
case ActionType.PRINT_CERTIFICATE:
|
4283
|
-
return EventStatus.enum.CERTIFIED;
|
4284
4400
|
case ActionType.ASSIGN:
|
4285
4401
|
case ActionType.UNASSIGN:
|
4286
4402
|
case ActionType.REJECT:
|
@@ -4403,30 +4519,36 @@ function getCurrentEventState(event2, config) {
|
|
4403
4519
|
flags: getFlagsFromActions(event2.actions)
|
4404
4520
|
});
|
4405
4521
|
}
|
4406
|
-
function
|
4522
|
+
function dangerouslyGetCurrentEventStateWithDrafts({
|
4407
4523
|
event: event2,
|
4408
|
-
|
4524
|
+
draft,
|
4409
4525
|
configuration
|
4410
4526
|
}) {
|
4411
4527
|
const actions = event2.actions.slice().sort((a, b) => a.createdAt.localeCompare(b.createdAt));
|
4412
|
-
const
|
4413
|
-
|
4414
|
-
|
4415
|
-
|
4416
|
-
|
4417
|
-
|
4418
|
-
|
4419
|
-
|
4420
|
-
|
4421
|
-
|
4422
|
-
|
4423
|
-
|
4424
|
-
|
4425
|
-
|
4528
|
+
const draftActions = draft.action.type === ActionType.REQUEST_CORRECTION ? (
|
4529
|
+
/*
|
4530
|
+
* If the action encountered is "REQUEST_CORRECTION", we want to pretend like it was approved
|
4531
|
+
* so previews etc are shown correctly
|
4532
|
+
*/
|
4533
|
+
[
|
4534
|
+
draft.action,
|
4535
|
+
{
|
4536
|
+
id: getUUID(),
|
4537
|
+
...draft.action,
|
4538
|
+
type: ActionType.APPROVE_CORRECTION
|
4539
|
+
}
|
4540
|
+
]
|
4541
|
+
) : [{ ...draft.action, id: getUUID() }];
|
4542
|
+
const actionsWithDraft = (0, import_lodash3.orderBy)(
|
4543
|
+
[...actions, ...draftActions],
|
4544
|
+
["createdAt"],
|
4545
|
+
"asc"
|
4546
|
+
);
|
4547
|
+
const eventWithDraft = {
|
4426
4548
|
...event2,
|
4427
|
-
actions:
|
4549
|
+
actions: actionsWithDraft
|
4428
4550
|
};
|
4429
|
-
return getCurrentEventState(
|
4551
|
+
return getCurrentEventState(eventWithDraft, configuration);
|
4430
4552
|
}
|
4431
4553
|
function applyDeclarationToEventIndex(eventIndex, declaration, eventConfiguration) {
|
4432
4554
|
const updatedDeclaration = deepMerge(eventIndex.declaration, declaration);
|
@@ -4440,18 +4562,18 @@ function applyDeclarationToEventIndex(eventIndex, declaration, eventConfiguratio
|
|
4440
4562
|
declaration: updatedDeclaration
|
4441
4563
|
};
|
4442
4564
|
}
|
4443
|
-
function
|
4565
|
+
function applyDraftToEventIndex(eventIndex, draft, eventConfiguration) {
|
4444
4566
|
const indexedAt = eventIndex.updatedAt;
|
4445
|
-
const
|
4446
|
-
if (
|
4567
|
+
const activeDraft = draft && draft.createdAt >= indexedAt ? draft : void 0;
|
4568
|
+
if (!activeDraft) {
|
4447
4569
|
return eventIndex;
|
4448
4570
|
}
|
4449
4571
|
return applyDeclarationToEventIndex(
|
4450
4572
|
{
|
4451
4573
|
...eventIndex,
|
4452
|
-
updatedAt:
|
4574
|
+
updatedAt: activeDraft.createdAt
|
4453
4575
|
},
|
4454
|
-
|
4576
|
+
activeDraft.action.declaration,
|
4455
4577
|
eventConfiguration
|
4456
4578
|
);
|
4457
4579
|
}
|
@@ -4465,18 +4587,17 @@ function getAnnotationFromDrafts(drafts) {
|
|
4465
4587
|
function getActionAnnotation({
|
4466
4588
|
event: event2,
|
4467
4589
|
actionType,
|
4468
|
-
|
4590
|
+
draft
|
4469
4591
|
}) {
|
4470
4592
|
const activeActions = getAcceptedActions(event2);
|
4471
|
-
const action = activeActions.
|
4472
|
-
|
4593
|
+
const action = (0, import_lodash3.findLast)(activeActions, (a) => a.type === actionType);
|
4594
|
+
const matchingDraft = draft?.action.type === actionType ? draft : void 0;
|
4595
|
+
const sortedActions = (0, import_lodash3.orderBy)(
|
4596
|
+
[action, matchingDraft?.action].filter((a) => a !== void 0),
|
4597
|
+
"createdAt",
|
4598
|
+
"asc"
|
4473
4599
|
);
|
4474
|
-
const
|
4475
|
-
const sorted = [
|
4476
|
-
...action ? [action] : [],
|
4477
|
-
...eventDrafts.map((draft) => draft.action)
|
4478
|
-
].sort();
|
4479
|
-
const annotation = sorted.reduce((ann, sortedAction) => {
|
4600
|
+
const annotation = sortedActions.reduce((ann, sortedAction) => {
|
4480
4601
|
return deepMerge(ann, sortedAction.annotation ?? {});
|
4481
4602
|
}, {});
|
4482
4603
|
return deepDropNulls(annotation);
|
@@ -4494,23 +4615,23 @@ function generateTransactionId() {
|
|
4494
4615
|
}
|
4495
4616
|
|
4496
4617
|
// ../commons/src/events/User.ts
|
4497
|
-
var
|
4498
|
-
var User =
|
4499
|
-
id:
|
4500
|
-
name:
|
4501
|
-
|
4502
|
-
use:
|
4503
|
-
given:
|
4504
|
-
family:
|
4618
|
+
var import_zod34 = require("zod");
|
4619
|
+
var User = import_zod34.z.object({
|
4620
|
+
id: import_zod34.z.string(),
|
4621
|
+
name: import_zod34.z.array(
|
4622
|
+
import_zod34.z.object({
|
4623
|
+
use: import_zod34.z.string(),
|
4624
|
+
given: import_zod34.z.array(import_zod34.z.string()),
|
4625
|
+
family: import_zod34.z.string()
|
4505
4626
|
})
|
4506
4627
|
),
|
4507
|
-
role:
|
4628
|
+
role: import_zod34.z.string(),
|
4508
4629
|
avatar: FullDocumentPath.optional(),
|
4509
4630
|
signature: FullDocumentPath.optional()
|
4510
4631
|
});
|
4511
4632
|
|
4512
4633
|
// ../commons/src/events/test.utils.ts
|
4513
|
-
var
|
4634
|
+
var import_lodash4 = require("lodash");
|
4514
4635
|
var import_date_fns4 = require("date-fns");
|
4515
4636
|
|
4516
4637
|
// ../commons/src/field-config/field-configuration.ts
|
@@ -5245,7 +5366,27 @@ var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
|
|
5245
5366
|
defaultMessage: "Applicant's name",
|
5246
5367
|
description: "This is the label for the field",
|
5247
5368
|
id: "v2.event.tennis-club-membership.action.declare.form.section.who.field.firstname.label"
|
5248
|
-
}
|
5369
|
+
},
|
5370
|
+
configuration: {
|
5371
|
+
name: {
|
5372
|
+
firstname: { required: true },
|
5373
|
+
middlename: { required: false },
|
5374
|
+
surname: { required: true }
|
5375
|
+
}
|
5376
|
+
},
|
5377
|
+
validation: [
|
5378
|
+
{
|
5379
|
+
validator: field("applicant.name").object({
|
5380
|
+
firstname: field("firstname").isValidEnglishName(),
|
5381
|
+
surname: field("surname").isValidEnglishName()
|
5382
|
+
}),
|
5383
|
+
message: {
|
5384
|
+
defaultMessage: "Input contains invalid characters. Please use only letters (a-z, A-Z), numbers (0-9), hyphens (-), apostrophes(') and underscores (_)",
|
5385
|
+
description: "This is the error message for invalid name",
|
5386
|
+
id: "v2.error.invalidName"
|
5387
|
+
}
|
5388
|
+
}
|
5389
|
+
]
|
5249
5390
|
},
|
5250
5391
|
{
|
5251
5392
|
id: "applicant.email",
|
@@ -5467,22 +5608,6 @@ var statusOptions = [
|
|
5467
5608
|
id: "v2.advancedSearch.form.recordStatusRegistered"
|
5468
5609
|
}
|
5469
5610
|
},
|
5470
|
-
{
|
5471
|
-
value: EventStatus.enum.CERTIFIED,
|
5472
|
-
label: {
|
5473
|
-
defaultMessage: "Certified",
|
5474
|
-
description: "Option for form field: status of record",
|
5475
|
-
id: "v2.advancedSearch.form.recordStatusCertified"
|
5476
|
-
}
|
5477
|
-
},
|
5478
|
-
{
|
5479
|
-
value: VisibleStatus.enum.REJECTED,
|
5480
|
-
label: {
|
5481
|
-
defaultMessage: "Rejected",
|
5482
|
-
description: "Option for form field: status of record",
|
5483
|
-
id: "v2.advancedSearch.form.recordStatusRejected"
|
5484
|
-
}
|
5485
|
-
},
|
5486
5611
|
{
|
5487
5612
|
value: EventStatus.enum.ARCHIVED,
|
5488
5613
|
label: {
|
@@ -6508,9 +6633,9 @@ var v2BirthEvent = defineConfig({
|
|
6508
6633
|
});
|
6509
6634
|
|
6510
6635
|
// ../commons/src/events/test.utils.ts
|
6511
|
-
var
|
6636
|
+
var import_zod35 = require("zod");
|
6512
6637
|
var TEST_SYSTEM_IANA_TIMEZONE = "Asia/Dhaka";
|
6513
|
-
var TestUserRole =
|
6638
|
+
var TestUserRole = import_zod35.z.enum([
|
6514
6639
|
"FIELD_AGENT",
|
6515
6640
|
"LOCAL_REGISTRAR",
|
6516
6641
|
"LOCAL_SYSTEM_ADMIN",
|
@@ -6675,7 +6800,7 @@ function eventPayloadGenerator(rng) {
|
|
6675
6800
|
eventId,
|
6676
6801
|
actionType,
|
6677
6802
|
annotation
|
6678
|
-
}, input = {}) => (0,
|
6803
|
+
}, input = {}) => (0, import_lodash4.merge)(
|
6679
6804
|
{
|
6680
6805
|
id: getUUID(),
|
6681
6806
|
eventId,
|
@@ -6734,13 +6859,13 @@ function eventPayloadGenerator(rng) {
|
|
6734
6859
|
notify: (eventId, input = {}) => {
|
6735
6860
|
let declaration = input.declaration;
|
6736
6861
|
if (!declaration) {
|
6737
|
-
const partialDeclaration = (0,
|
6862
|
+
const partialDeclaration = (0, import_lodash4.omitBy)(
|
6738
6863
|
generateActionDeclarationInput(
|
6739
6864
|
tennisClubMembershipEvent,
|
6740
6865
|
ActionType.DECLARE,
|
6741
6866
|
rng
|
6742
6867
|
),
|
6743
|
-
|
6868
|
+
import_lodash4.isString
|
6744
6869
|
);
|
6745
6870
|
declaration = partialDeclaration;
|
6746
6871
|
}
|
@@ -6787,7 +6912,6 @@ function eventPayloadGenerator(rng) {
|
|
6787
6912
|
type: ActionType.ARCHIVE,
|
6788
6913
|
transactionId: input.transactionId ?? getUUID(),
|
6789
6914
|
declaration: {},
|
6790
|
-
// @TODO: Check whether generator is needed?
|
6791
6915
|
annotation: {},
|
6792
6916
|
duplicates: [],
|
6793
6917
|
eventId,
|
@@ -6843,7 +6967,7 @@ function eventPayloadGenerator(rng) {
|
|
6843
6967
|
request: (eventId, input = {}) => ({
|
6844
6968
|
type: ActionType.REQUEST_CORRECTION,
|
6845
6969
|
transactionId: input.transactionId ?? getUUID(),
|
6846
|
-
declaration: input.declaration ?? (0,
|
6970
|
+
declaration: input.declaration ?? (0, import_lodash4.omit)(
|
6847
6971
|
generateActionDeclarationInput(
|
6848
6972
|
tennisClubMembershipEvent,
|
6849
6973
|
ActionType.REQUEST_CORRECTION,
|
@@ -7001,7 +7125,8 @@ function generateEventDraftDocument({
|
|
7001
7125
|
declaration: {
|
7002
7126
|
...action.declaration,
|
7003
7127
|
...declaration
|
7004
|
-
}
|
7128
|
+
},
|
7129
|
+
annotation: action.annotation
|
7005
7130
|
},
|
7006
7131
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
7007
7132
|
eventId
|
@@ -7108,7 +7233,12 @@ var generateWorkqueues = (slug = "all-events") => defineWorkqueues([
|
|
7108
7233
|
type: "and",
|
7109
7234
|
clauses: [{ eventType: tennisClubMembershipEvent.id }]
|
7110
7235
|
},
|
7111
|
-
actions: [
|
7236
|
+
actions: [
|
7237
|
+
{
|
7238
|
+
type: "DEFAULT",
|
7239
|
+
conditionals: []
|
7240
|
+
}
|
7241
|
+
],
|
7112
7242
|
icon: "Draft"
|
7113
7243
|
}
|
7114
7244
|
]);
|
@@ -7124,9 +7254,7 @@ function isFieldValueWithoutTemplates(value) {
|
|
7124
7254
|
if (isTemplateVariable(value)) {
|
7125
7255
|
return false;
|
7126
7256
|
}
|
7127
|
-
if (typeof value === "object" &&
|
7128
|
-
//@ts-ignore
|
7129
|
-
Object.values(value).some((val) => isTemplateVariable(val))) {
|
7257
|
+
if (typeof value === "object" && value !== null && Object.values(value).some((val) => isTemplateVariable(val))) {
|
7130
7258
|
return false;
|
7131
7259
|
}
|
7132
7260
|
return true;
|
@@ -7148,7 +7276,7 @@ function isFieldConfigDefaultValue(value) {
|
|
7148
7276
|
}
|
7149
7277
|
|
7150
7278
|
// ../commons/src/events/scopes.ts
|
7151
|
-
var
|
7279
|
+
var import_lodash5 = require("lodash");
|
7152
7280
|
var CONFIG_GET_ALLOWED_SCOPES = [
|
7153
7281
|
SCOPES.RECORD_DECLARE,
|
7154
7282
|
SCOPES.RECORD_READ,
|
@@ -7236,13 +7364,13 @@ var WRITE_ACTION_SCOPES = [
|
|
7236
7364
|
...ACTION_ALLOWED_SCOPES[ActionType.PRINT_CERTIFICATE]
|
7237
7365
|
];
|
7238
7366
|
function hasAnyOfScopes(a, b) {
|
7239
|
-
return (0,
|
7367
|
+
return (0, import_lodash5.intersection)(a, b).length > 0;
|
7240
7368
|
}
|
7241
7369
|
|
7242
7370
|
// ../commons/src/events/serializers/user/deserializer.ts
|
7243
|
-
var
|
7371
|
+
var import_zod36 = require("zod");
|
7244
7372
|
var UserWithPrimaryOffice = User.extend({
|
7245
|
-
primaryOfficeId:
|
7373
|
+
primaryOfficeId: import_zod36.z.string()
|
7246
7374
|
});
|
7247
7375
|
function userDeserializer(serializedUserField, user2) {
|
7248
7376
|
if (typeof serializedUserField === "string") {
|
@@ -7338,14 +7466,6 @@ var AVAILABLE_ACTIONS_BY_EVENT_STATUS = {
|
|
7338
7466
|
ActionType.REJECT_CORRECTION,
|
7339
7467
|
ExclusiveActions.REVIEW_CORRECTION_REQUEST
|
7340
7468
|
],
|
7341
|
-
[EventStatus.enum.CERTIFIED]: [
|
7342
|
-
ActionType.READ,
|
7343
|
-
ActionType.PRINT_CERTIFICATE,
|
7344
|
-
ActionType.REQUEST_CORRECTION,
|
7345
|
-
ActionType.APPROVE_CORRECTION,
|
7346
|
-
ActionType.REJECT_CORRECTION,
|
7347
|
-
ExclusiveActions.REVIEW_CORRECTION_REQUEST
|
7348
|
-
],
|
7349
7469
|
[EventStatus.enum.ARCHIVED]: [
|
7350
7470
|
ActionType.READ,
|
7351
7471
|
ActionType.ASSIGN,
|
@@ -7353,9 +7473,12 @@ var AVAILABLE_ACTIONS_BY_EVENT_STATUS = {
|
|
7353
7473
|
]
|
7354
7474
|
};
|
7355
7475
|
var getAvailableActionsForEvent = (event2) => {
|
7356
|
-
|
7357
|
-
|
7358
|
-
|
7359
|
-
|
7360
|
-
|
7476
|
+
if (event2.flags.includes(InherentFlags.REJECTED)) {
|
7477
|
+
return [
|
7478
|
+
ActionType.READ,
|
7479
|
+
event2.status === EventStatus.Enum.VALIDATED ? ActionType.VALIDATE : ActionType.DECLARE,
|
7480
|
+
ActionType.ARCHIVE
|
7481
|
+
];
|
7482
|
+
}
|
7483
|
+
return AVAILABLE_ACTIONS_BY_EVENT_STATUS[event2.status];
|
7361
7484
|
};
|