@opencrvs/toolkit 2.0.0-rc.33379e6 → 2.0.0-rc.33e3164
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/create-countryconfig/index.js +103 -0
- package/create-countryconfig/package.json +21 -0
- package/dist/application-config/index.js +311 -130
- package/dist/cli.js +548 -178
- package/dist/commons/api/router.d.ts +3384 -237
- package/dist/commons/application-config/index.d.ts +17 -4
- package/dist/commons/conditionals/conditionals.d.ts +360 -10
- package/dist/commons/conditionals/validate.d.ts +52 -2
- package/dist/commons/events/ActionDocument.d.ts +6 -0
- package/dist/commons/events/ActionInput.d.ts +114 -0
- package/dist/commons/events/AdvancedSearchConfig.d.ts +342 -0
- package/dist/commons/events/Draft.d.ts +4 -2
- package/dist/commons/events/EventDocument.d.ts +3 -0
- package/dist/commons/events/EventIndex.d.ts +0 -3
- package/dist/commons/events/EventMetadata.d.ts +0 -7
- package/dist/commons/events/FieldConfig.d.ts +387 -50
- package/dist/commons/events/FieldType.d.ts +1 -0
- package/dist/commons/events/FieldValue.d.ts +6 -0
- package/dist/commons/events/WorkqueueConfig.d.ts +150 -150
- package/dist/commons/events/field.d.ts +53 -1
- package/dist/commons/events/index.d.ts +2 -0
- package/dist/commons/events/locations.d.ts +38 -1
- package/dist/commons/events/mocks.test.utils.d.ts +19 -0
- package/dist/commons/events/scopes.d.ts +24 -1
- package/dist/commons/events/state/flags.d.ts +16 -0
- package/dist/commons/events/state/index.d.ts +0 -4
- package/dist/commons/events/state/utils.d.ts +12 -289
- package/dist/commons/events/utils.d.ts +13 -2
- package/dist/conditionals/index.js +92 -9
- package/dist/events/index.js +1100 -270
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts.map +1 -1
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.js +60 -35
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts +1 -1
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
- package/dist/migrations/v2.0/checkout-upstream-files.js +1 -2
- package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts +9 -1
- package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts.map +1 -1
- package/dist/migrations/v2.0/delete-infrastructure-directory.js +66 -20
- package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.d.ts +3 -0
- package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.d.ts.map +1 -0
- package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.js +110 -0
- package/dist/migrations/v2.0/index.d.ts +5 -3
- package/dist/migrations/v2.0/index.d.ts.map +1 -1
- package/dist/migrations/v2.0/index.js +546 -176
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts.map +1 -1
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.js +90 -1
- package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts +11 -1
- package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts.map +1 -1
- package/dist/migrations/v2.0/merge-infrastructure-directory.js +17 -16
- package/dist/migrations/v2.0/migrate-scopes.d.ts.map +1 -1
- package/dist/migrations/v2.0/migrate-scopes.js +54 -30
- package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts.map +1 -1
- package/dist/migrations/v2.0/migrate-workqueue-configs.js +140 -59
- package/dist/notification/index.js +854 -161
- package/dist/scopes/index.d.ts +91 -16
- package/dist/scopes/index.js +55 -12
- package/opencrvs-toolkit-2.0.0-rc.33e3164.tgz +0 -0
- package/package.json +6 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/opencrvs-toolkit-2.0.0-rc.33379e6.tgz +0 -0
|
@@ -75,7 +75,10 @@ var ActionConditional = z.discriminatedUnion("type", [
|
|
|
75
75
|
ShowConditional,
|
|
76
76
|
// Action can be shown to the user in the list but as disabled
|
|
77
77
|
EnableConditional
|
|
78
|
-
])
|
|
78
|
+
]).meta({
|
|
79
|
+
id: "ActionConditional",
|
|
80
|
+
description: "Conditional gating whether an action is shown (SHOW) or enabled (ENABLE). When omitted from an action, the action is shown and enabled for everyone."
|
|
81
|
+
});
|
|
79
82
|
var DisplayOnReviewConditional = z.object({
|
|
80
83
|
type: z.literal(ConditionalType.DISPLAY_ON_REVIEW),
|
|
81
84
|
conditional: Conditional
|
|
@@ -90,8 +93,8 @@ var FieldConditional = z.discriminatedUnion("type", [
|
|
|
90
93
|
// Field output can be shown / hidden on the review page
|
|
91
94
|
DisplayOnReviewConditional
|
|
92
95
|
]).meta({
|
|
93
|
-
|
|
94
|
-
|
|
96
|
+
id: "FieldConditional",
|
|
97
|
+
description: "Conditional gating whether a form field is shown (SHOW), enabled (ENABLE), or displayed on the review page (DISPLAY_ON_REVIEW). When omitted, the field is shown and enabled for everyone, and is displayed on review whenever it has a value."
|
|
95
98
|
});
|
|
96
99
|
|
|
97
100
|
// ../commons/src/events/TranslationConfig.ts
|
|
@@ -203,6 +206,11 @@ var FieldTypesToHideInReview = [
|
|
|
203
206
|
FieldType.ALPHA_PRINT_BUTTON,
|
|
204
207
|
FieldType.ALPHA_HIDDEN
|
|
205
208
|
];
|
|
209
|
+
var HiddenFieldTypes = [
|
|
210
|
+
FieldType.HTTP,
|
|
211
|
+
FieldType.QUERY_PARAM_READER,
|
|
212
|
+
FieldType.ALPHA_HIDDEN
|
|
213
|
+
];
|
|
206
214
|
|
|
207
215
|
// ../commons/src/events/FieldValue.ts
|
|
208
216
|
var z7 = __toESM(require("zod/v4"));
|
|
@@ -321,7 +329,7 @@ var PlainDate = import_zod.z.string().date().brand("PlainDate").describe("Date i
|
|
|
321
329
|
// ../commons/src/events/FieldValue.ts
|
|
322
330
|
var TextValue = z7.string();
|
|
323
331
|
var HiddenFieldValue = z7.string();
|
|
324
|
-
var NonEmptyTextValue =
|
|
332
|
+
var NonEmptyTextValue = z7.string().trim().min(1);
|
|
325
333
|
var DateValue = z7.iso.date().describe("Date in the format YYYY-MM-DD");
|
|
326
334
|
var AgeValue = z7.object({
|
|
327
335
|
age: z7.number(),
|
|
@@ -350,6 +358,7 @@ var DateRangeFieldValue = z7.object({
|
|
|
350
358
|
var EmailValue = z7.email();
|
|
351
359
|
var CheckboxFieldValue = z7.boolean();
|
|
352
360
|
var NumberFieldValue = z7.number();
|
|
361
|
+
var SignatureFieldValue = FileFieldValue;
|
|
353
362
|
var ButtonFieldValue = z7.number();
|
|
354
363
|
var VerificationStatusValue = z7.enum([
|
|
355
364
|
"verified",
|
|
@@ -418,28 +427,20 @@ function schemaPriority(schema) {
|
|
|
418
427
|
return idx === -1 ? 9999 : idx;
|
|
419
428
|
}
|
|
420
429
|
function safeUnion(schemas) {
|
|
430
|
+
const sortedSchemas = [...schemas].sort(
|
|
431
|
+
(a, b) => schemaPriority(a) - schemaPriority(b)
|
|
432
|
+
);
|
|
421
433
|
return z7.any().superRefine((val, ctx) => {
|
|
422
|
-
const
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
if (successful.length === 0) {
|
|
427
|
-
ctx.addIssue({
|
|
428
|
-
code: "invalid_type",
|
|
429
|
-
expected: "custom",
|
|
430
|
-
message: "Value does not match any schema"
|
|
431
|
-
});
|
|
432
|
-
return;
|
|
433
|
-
}
|
|
434
|
-
successful.sort((a, b) => schemaPriority(a) - schemaPriority(b));
|
|
435
|
-
const best = successful[0];
|
|
436
|
-
if (!best.safeParse(val).success) {
|
|
437
|
-
ctx.addIssue({
|
|
438
|
-
expected: "custom",
|
|
439
|
-
code: "invalid_type",
|
|
440
|
-
message: "Value did not match the best schema"
|
|
441
|
-
});
|
|
434
|
+
for (const schema of sortedSchemas) {
|
|
435
|
+
if (schema.safeParse(val).success) {
|
|
436
|
+
return;
|
|
437
|
+
}
|
|
442
438
|
}
|
|
439
|
+
ctx.addIssue({
|
|
440
|
+
code: "invalid_type",
|
|
441
|
+
expected: "custom",
|
|
442
|
+
message: "Value does not match any schema"
|
|
443
|
+
});
|
|
443
444
|
}).meta({
|
|
444
445
|
description: "Value that matches exactly one of the possible schema types (TextValue, DateValue, DateRangeFieldValue). The best matching schema is chosen by priority."
|
|
445
446
|
});
|
|
@@ -656,6 +657,10 @@ var scopeByEvent = z11.preprocess(
|
|
|
656
657
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
657
658
|
z11.array(z11.string()).optional()
|
|
658
659
|
).describe("Event type, e.g. birth, death");
|
|
660
|
+
var userRole = z11.preprocess(
|
|
661
|
+
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
662
|
+
z11.array(z11.string()).optional()
|
|
663
|
+
).describe("User role, e.g. admin, field agent");
|
|
659
664
|
var scopeOptionsPlaceEvent = z11.object({
|
|
660
665
|
event: scopeByEvent,
|
|
661
666
|
placeOfEvent: JurisdictionFilter.optional()
|
|
@@ -679,6 +684,9 @@ var CustomActionScopeOptions = AllRecordScopeOptions.extend({
|
|
|
679
684
|
var AccessLevelOptions = z11.object({
|
|
680
685
|
accessLevel: JurisdictionFilter.optional()
|
|
681
686
|
});
|
|
687
|
+
var AllUserScopeOptions = AccessLevelOptions.extend({
|
|
688
|
+
role: userRole.optional()
|
|
689
|
+
});
|
|
682
690
|
var WorkqueueOrDashboardOptions = z11.object({
|
|
683
691
|
ids: z11.preprocess(
|
|
684
692
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
@@ -688,6 +696,7 @@ var WorkqueueOrDashboardOptions = z11.object({
|
|
|
688
696
|
var AllScopeOptions = z11.object({
|
|
689
697
|
...AllRecordScopeOptions.shape,
|
|
690
698
|
...AccessLevelOptions.shape,
|
|
699
|
+
...AllUserScopeOptions.shape,
|
|
691
700
|
...WorkqueueOrDashboardOptions.shape
|
|
692
701
|
});
|
|
693
702
|
var ScopeOptionKey = AllScopeOptions.keyof();
|
|
@@ -760,6 +769,30 @@ var RecordScopeV2 = z11.discriminatedUnion("type", [
|
|
|
760
769
|
]).describe(
|
|
761
770
|
"Scopes used to check user's permission to perform actions on a record."
|
|
762
771
|
);
|
|
772
|
+
var SystemScopeType = z11.enum([
|
|
773
|
+
"organisation.read-locations",
|
|
774
|
+
"user.read",
|
|
775
|
+
"user.create",
|
|
776
|
+
"user.edit",
|
|
777
|
+
"user.search"
|
|
778
|
+
]);
|
|
779
|
+
var UserScopeType = SystemScopeType.extract([
|
|
780
|
+
"user.read",
|
|
781
|
+
"user.create",
|
|
782
|
+
"user.edit",
|
|
783
|
+
"user.search"
|
|
784
|
+
]);
|
|
785
|
+
var ScopesWithRoleOption = UserScopeType.extract(["user.edit", "user.create"]);
|
|
786
|
+
var UserScopeV2 = z11.discriminatedUnion("type", [
|
|
787
|
+
z11.object({
|
|
788
|
+
type: ScopesWithRoleOption,
|
|
789
|
+
options: AllUserScopeOptions.optional()
|
|
790
|
+
}),
|
|
791
|
+
z11.object({
|
|
792
|
+
type: UserScopeType.extract(["user.read", "user.search"]),
|
|
793
|
+
options: AccessLevelOptions.optional()
|
|
794
|
+
})
|
|
795
|
+
]);
|
|
763
796
|
var ResolvedRecordScopeV2 = z11.discriminatedUnion("type", [
|
|
764
797
|
z11.object({
|
|
765
798
|
type: ScopesWithPlaceEventOptions,
|
|
@@ -780,16 +813,14 @@ var ResolvedRecordScopeV2 = z11.discriminatedUnion("type", [
|
|
|
780
813
|
}).optional()
|
|
781
814
|
})
|
|
782
815
|
]).describe("Resolved scope with location/user IDs instead of filters.");
|
|
783
|
-
var SystemScopeType = z11.enum([
|
|
784
|
-
"organisation.read-locations",
|
|
785
|
-
"user.read",
|
|
786
|
-
"user.create",
|
|
787
|
-
"user.edit"
|
|
788
|
-
]);
|
|
789
816
|
var Scope = z11.discriminatedUnion("type", [
|
|
790
817
|
z11.object({ type: PlainScopeType }),
|
|
791
818
|
...RecordScopeV2.options,
|
|
792
|
-
|
|
819
|
+
...UserScopeV2.options,
|
|
820
|
+
z11.object({
|
|
821
|
+
type: z11.literal("organisation.read-locations"),
|
|
822
|
+
options: AccessLevelOptions.optional()
|
|
823
|
+
}),
|
|
793
824
|
z11.object({
|
|
794
825
|
type: z11.literal("workqueue"),
|
|
795
826
|
options: WorkqueueOrDashboardOptions
|
|
@@ -809,7 +840,9 @@ var ScopeType = z11.enum([
|
|
|
809
840
|
var EncodedScope = z11.string().brand("EncodedScope");
|
|
810
841
|
var DEFAULT_SCOPE_OPTIONS = {
|
|
811
842
|
placeOfEvent: JurisdictionFilter.enum.all,
|
|
812
|
-
accessLevel: JurisdictionFilter.enum.all
|
|
843
|
+
accessLevel: JurisdictionFilter.enum.all,
|
|
844
|
+
registeredIn: JurisdictionFilter.enum.all,
|
|
845
|
+
declaredIn: JurisdictionFilter.enum.all
|
|
813
846
|
};
|
|
814
847
|
|
|
815
848
|
// ../commons/src/authentication.ts
|
|
@@ -962,8 +995,9 @@ var RequestedCorrectionAction = ActionBase.extend(
|
|
|
962
995
|
var ApprovedCorrectionAction = ActionBase.extend(
|
|
963
996
|
z13.object({
|
|
964
997
|
type: z13.literal(ActionType.APPROVE_CORRECTION),
|
|
965
|
-
requestId: z13.string()
|
|
998
|
+
requestId: z13.string(),
|
|
966
999
|
// TODO move into 'content' property
|
|
1000
|
+
content: z13.object({ immediateCorrection: z13.boolean().optional() }).optional()
|
|
967
1001
|
}).shape
|
|
968
1002
|
);
|
|
969
1003
|
var RejectedCorrectionAction = ActionBase.extend(
|
|
@@ -1055,6 +1089,9 @@ var FlagConfig = z14.object({
|
|
|
1055
1089
|
"Indicates if this flag expects an action to be performed to be cleared."
|
|
1056
1090
|
),
|
|
1057
1091
|
label: TranslationConfig.describe("Human readable label of the flag.")
|
|
1092
|
+
}).meta({
|
|
1093
|
+
id: "FlagConfig",
|
|
1094
|
+
description: "Configuration for a custom flag that can be added to or removed from records by event actions."
|
|
1058
1095
|
});
|
|
1059
1096
|
var ActionFlagConfig = z14.object({
|
|
1060
1097
|
id: Flag,
|
|
@@ -1062,6 +1099,9 @@ var ActionFlagConfig = z14.object({
|
|
|
1062
1099
|
conditional: Conditional.optional().describe(
|
|
1063
1100
|
"When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
|
|
1064
1101
|
)
|
|
1102
|
+
}).meta({
|
|
1103
|
+
id: "ActionFlagConfig",
|
|
1104
|
+
description: "Add or remove operation applied to a flag when the parent action is accepted. Optionally gated by a conditional."
|
|
1065
1105
|
});
|
|
1066
1106
|
|
|
1067
1107
|
// ../commons/src/events/EventMetadata.ts
|
|
@@ -1083,8 +1123,7 @@ var ActionCreationMetadata = z15.object({
|
|
|
1083
1123
|
),
|
|
1084
1124
|
createdByUserType: z15.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1085
1125
|
acceptedAt: z15.iso.datetime().describe("Timestamp when the action request was accepted."),
|
|
1086
|
-
createdByRole: z15.string().optional().describe("Role of the user at the time of action request creation.")
|
|
1087
|
-
createdBySignature: z15.string().nullish().describe("Signature of the user who created the action request.")
|
|
1126
|
+
createdByRole: z15.string().optional().describe("Role of the user at the time of action request creation.")
|
|
1088
1127
|
});
|
|
1089
1128
|
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
1090
1129
|
registrationNumber: z15.string().describe(
|
|
@@ -1112,9 +1151,6 @@ var EventMetadata = z15.object({
|
|
|
1112
1151
|
createdAtLocation: UUID.nullish().describe(
|
|
1113
1152
|
"Location of the user who created the event."
|
|
1114
1153
|
),
|
|
1115
|
-
createdBySignature: DocumentPath.nullish().describe(
|
|
1116
|
-
"Signature of the user who created the event."
|
|
1117
|
-
),
|
|
1118
1154
|
updatedAtLocation: UUID.nullish().describe(
|
|
1119
1155
|
"Location of the user who last changed the status."
|
|
1120
1156
|
),
|
|
@@ -1378,14 +1414,31 @@ var FieldId = import_v43.default.string().superRefine((val, ctx) => {
|
|
|
1378
1414
|
}
|
|
1379
1415
|
}).describe("Unique identifier for the field");
|
|
1380
1416
|
var FieldReference = import_v43.default.object({
|
|
1381
|
-
$$field: FieldId,
|
|
1417
|
+
$$field: FieldId.describe("Id of the field to reference"),
|
|
1382
1418
|
$$subfield: import_v43.default.array(import_v43.default.string()).optional().default([]).describe(
|
|
1383
1419
|
'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
|
|
1420
|
+
),
|
|
1421
|
+
$$code: import_v43.default.string().optional().describe(
|
|
1422
|
+
"Serialised client-side function body. When present the expression is evaluated rather than dereferenced."
|
|
1384
1423
|
)
|
|
1385
|
-
}).describe(
|
|
1424
|
+
}).describe(
|
|
1425
|
+
"Reference to a field value, with an optional client-side computation applied."
|
|
1426
|
+
);
|
|
1427
|
+
var ComputedDefaultValue = import_v43.default.object({
|
|
1428
|
+
$$code: import_v43.default.string().describe(
|
|
1429
|
+
"Serialised client-side function body. Receives (undefined, context) where context includes $now, $online, and system variables."
|
|
1430
|
+
)
|
|
1431
|
+
}).describe("A context-only computation used as a field default value.");
|
|
1386
1432
|
var ValidationConfig = import_v43.default.object({
|
|
1387
|
-
validator: Conditional
|
|
1388
|
-
|
|
1433
|
+
validator: Conditional.describe(
|
|
1434
|
+
"Conditional expression that must hold for the field value to be considered valid."
|
|
1435
|
+
),
|
|
1436
|
+
message: TranslationConfig.describe(
|
|
1437
|
+
"Error message displayed when the validator does not hold."
|
|
1438
|
+
)
|
|
1439
|
+
}).meta({
|
|
1440
|
+
id: "ValidationConfig",
|
|
1441
|
+
description: "Validation rule applied to a form field. The validator is a conditional expression that must hold for the field value to be considered valid."
|
|
1389
1442
|
});
|
|
1390
1443
|
var requiredSchema = import_v43.default.union([
|
|
1391
1444
|
import_v43.default.boolean(),
|
|
@@ -1416,7 +1469,7 @@ var BaseField = import_v43.default.object({
|
|
|
1416
1469
|
"Indicates whether the field can be modified during record correction."
|
|
1417
1470
|
),
|
|
1418
1471
|
value: FieldReference.or(import_v43.default.array(FieldReference)).optional().describe(
|
|
1419
|
-
"Reference to the source field or fields. When a value is defined, it is copied from the parent field when changed. If multiple references are provided, the first truthy value is used."
|
|
1472
|
+
"Reference to the source field or fields. When a value is defined, it is copied from the parent field when changed. If multiple references are provided, the first truthy value is used. A FieldReference with $$code computes the value via a custom client-side function."
|
|
1420
1473
|
),
|
|
1421
1474
|
analytics: import_v43.default.boolean().default(false).optional().describe(
|
|
1422
1475
|
"Indicates whether the field is included in analytics. When enabled, its value becomes available in the analytics dashboard."
|
|
@@ -1424,30 +1477,39 @@ var BaseField = import_v43.default.object({
|
|
|
1424
1477
|
}).describe("Common properties shared across all field types.");
|
|
1425
1478
|
var Divider = BaseField.extend({
|
|
1426
1479
|
type: import_v43.default.literal(FieldType.DIVIDER)
|
|
1480
|
+
}).meta({
|
|
1481
|
+
description: "A horizontal line divider",
|
|
1482
|
+
id: "Divider"
|
|
1427
1483
|
});
|
|
1428
1484
|
var TextField = BaseField.extend({
|
|
1429
1485
|
type: import_v43.default.literal(FieldType.TEXT),
|
|
1430
|
-
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1486
|
+
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
1431
1487
|
configuration: import_v43.default.object({
|
|
1432
1488
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text"),
|
|
1433
1489
|
type: import_v43.default.enum(["text", "password"]).optional(),
|
|
1434
1490
|
prefix: TranslationConfig.optional(),
|
|
1435
1491
|
postfix: TranslationConfig.optional()
|
|
1436
1492
|
}).default({ type: "text" }).optional()
|
|
1437
|
-
}).
|
|
1493
|
+
}).meta({
|
|
1494
|
+
description: "A text input field",
|
|
1495
|
+
id: "TextField"
|
|
1496
|
+
});
|
|
1438
1497
|
var NumberField = BaseField.extend({
|
|
1439
1498
|
type: import_v43.default.literal(FieldType.NUMBER),
|
|
1440
|
-
defaultValue: NumberFieldValue.optional(),
|
|
1499
|
+
defaultValue: NumberFieldValue.or(ComputedDefaultValue).optional(),
|
|
1441
1500
|
configuration: import_v43.default.object({
|
|
1442
1501
|
min: import_v43.default.number().optional().describe("Minimum value"),
|
|
1443
1502
|
max: import_v43.default.number().optional().describe("Maximum value"),
|
|
1444
1503
|
prefix: TranslationConfig.optional(),
|
|
1445
1504
|
postfix: TranslationConfig.optional()
|
|
1446
1505
|
}).optional()
|
|
1447
|
-
}).
|
|
1506
|
+
}).meta({
|
|
1507
|
+
description: "A number input field",
|
|
1508
|
+
id: "NumberField"
|
|
1509
|
+
});
|
|
1448
1510
|
var TextAreaField = BaseField.extend({
|
|
1449
1511
|
type: import_v43.default.literal(FieldType.TEXTAREA),
|
|
1450
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1512
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1451
1513
|
configuration: import_v43.default.object({
|
|
1452
1514
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text"),
|
|
1453
1515
|
rows: import_v43.default.number().optional().describe("Number of visible text lines"),
|
|
@@ -1455,7 +1517,10 @@ var TextAreaField = BaseField.extend({
|
|
|
1455
1517
|
prefix: TranslationConfig.optional(),
|
|
1456
1518
|
postfix: TranslationConfig.optional()
|
|
1457
1519
|
}).default({ rows: 4 }).optional()
|
|
1458
|
-
}).
|
|
1520
|
+
}).meta({
|
|
1521
|
+
description: "A multiline text input",
|
|
1522
|
+
id: "TextAreaField"
|
|
1523
|
+
});
|
|
1459
1524
|
var ImageMimeType = import_v43.default.enum([
|
|
1460
1525
|
"image/png",
|
|
1461
1526
|
"image/jpg",
|
|
@@ -1478,58 +1543,76 @@ var SignatureField = BaseField.extend({
|
|
|
1478
1543
|
signaturePromptLabel: TranslationConfig.describe(
|
|
1479
1544
|
"Title of the signature modal"
|
|
1480
1545
|
),
|
|
1481
|
-
defaultValue:
|
|
1546
|
+
defaultValue: SignatureFieldValue.or(ComputedDefaultValue).optional(),
|
|
1482
1547
|
configuration: import_v43.default.object({
|
|
1483
1548
|
maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1484
1549
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
|
1485
1550
|
}).default({
|
|
1486
1551
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1487
1552
|
})
|
|
1488
|
-
}).
|
|
1553
|
+
}).meta({
|
|
1554
|
+
description: "A signature input field",
|
|
1555
|
+
id: "SignatureField"
|
|
1556
|
+
});
|
|
1489
1557
|
var EmailField = BaseField.extend({
|
|
1490
1558
|
type: import_v43.default.literal(FieldType.EMAIL),
|
|
1491
1559
|
configuration: import_v43.default.object({
|
|
1492
1560
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text")
|
|
1493
1561
|
}).default({ maxLength: 255 }).optional(),
|
|
1494
|
-
defaultValue: NonEmptyTextValue.optional()
|
|
1562
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional()
|
|
1563
|
+
}).meta({
|
|
1564
|
+
description: "An email input field",
|
|
1565
|
+
id: "EmailField"
|
|
1495
1566
|
});
|
|
1496
1567
|
var DateField = BaseField.extend({
|
|
1497
1568
|
type: import_v43.default.literal(FieldType.DATE),
|
|
1498
|
-
defaultValue: SerializedNowDateTime.or(PlainDate).optional().describe("Default date value(yyyy-MM-dd)"),
|
|
1569
|
+
defaultValue: SerializedNowDateTime.or(PlainDate).or(ComputedDefaultValue).optional().describe("Default date value(yyyy-MM-dd)"),
|
|
1499
1570
|
configuration: import_v43.default.object({
|
|
1500
1571
|
notice: TranslationConfig.describe(
|
|
1501
1572
|
"Text to display above the date input"
|
|
1502
1573
|
).optional()
|
|
1503
1574
|
}).optional()
|
|
1504
|
-
}).
|
|
1575
|
+
}).meta({
|
|
1576
|
+
description: "A date input (yyyy-MM-dd)",
|
|
1577
|
+
id: "DateField"
|
|
1578
|
+
});
|
|
1505
1579
|
var AgeField = BaseField.extend({
|
|
1506
1580
|
type: import_v43.default.literal(FieldType.AGE),
|
|
1507
|
-
defaultValue: NumberFieldValue.optional(),
|
|
1581
|
+
defaultValue: NumberFieldValue.or(ComputedDefaultValue).optional(),
|
|
1508
1582
|
configuration: import_v43.default.object({
|
|
1509
1583
|
asOfDate: FieldReference,
|
|
1510
1584
|
prefix: TranslationConfig.optional(),
|
|
1511
1585
|
postfix: TranslationConfig.optional()
|
|
1512
1586
|
})
|
|
1513
|
-
}).
|
|
1587
|
+
}).meta({
|
|
1588
|
+
description: "An age input field which uses the current date as the asOfDate",
|
|
1589
|
+
id: "AgeField"
|
|
1590
|
+
});
|
|
1514
1591
|
var TimeField = BaseField.extend({
|
|
1515
1592
|
type: import_v43.default.literal(FieldType.TIME),
|
|
1516
|
-
defaultValue: SerializedNowDateTime.or(TimeValue).optional().describe("Default time value (HH-mm)"),
|
|
1593
|
+
defaultValue: SerializedNowDateTime.or(TimeValue).or(ComputedDefaultValue).optional().describe("Default time value (HH-mm)"),
|
|
1517
1594
|
configuration: import_v43.default.object({
|
|
1518
1595
|
use12HourFormat: import_v43.default.boolean().optional().describe("Whether to use 12-hour format"),
|
|
1519
1596
|
notice: TranslationConfig.describe(
|
|
1520
1597
|
"Text to display above the time input"
|
|
1521
1598
|
).optional()
|
|
1522
1599
|
}).optional()
|
|
1523
|
-
}).
|
|
1600
|
+
}).meta({
|
|
1601
|
+
description: "A single time input (HH-mm)",
|
|
1602
|
+
id: "TimeField"
|
|
1603
|
+
});
|
|
1524
1604
|
var DateRangeField = BaseField.extend({
|
|
1525
1605
|
type: import_v43.default.literal(FieldType.DATE_RANGE),
|
|
1526
|
-
defaultValue: DateRangeFieldValue.optional(),
|
|
1606
|
+
defaultValue: DateRangeFieldValue.or(ComputedDefaultValue).optional(),
|
|
1527
1607
|
configuration: import_v43.default.object({
|
|
1528
1608
|
notice: TranslationConfig.describe(
|
|
1529
1609
|
"Text to display above the date input"
|
|
1530
1610
|
).optional()
|
|
1531
1611
|
}).optional()
|
|
1532
|
-
}).
|
|
1612
|
+
}).meta({
|
|
1613
|
+
description: "A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })",
|
|
1614
|
+
id: "DateRangeField"
|
|
1615
|
+
});
|
|
1533
1616
|
var HtmlFontVariant = import_v43.default.enum([
|
|
1534
1617
|
"reg12",
|
|
1535
1618
|
"reg14",
|
|
@@ -1573,21 +1656,33 @@ var ImageViewField = BaseField.extend({
|
|
|
1573
1656
|
type: import_v43.default.literal(FieldType.IMAGE_VIEW),
|
|
1574
1657
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1575
1658
|
configuration: ImageConfiguration
|
|
1576
|
-
}).
|
|
1659
|
+
}).meta({
|
|
1660
|
+
description: "A read-only image component for form pages",
|
|
1661
|
+
id: "ImageViewField"
|
|
1662
|
+
});
|
|
1577
1663
|
var Paragraph = BaseField.extend({
|
|
1578
1664
|
type: import_v43.default.literal(FieldType.PARAGRAPH),
|
|
1579
1665
|
configuration: ParagraphConfiguration
|
|
1580
|
-
}).
|
|
1666
|
+
}).meta({
|
|
1667
|
+
description: "A read-only HTML <p> paragraph",
|
|
1668
|
+
id: "Paragraph"
|
|
1669
|
+
});
|
|
1581
1670
|
var Heading = BaseField.extend({
|
|
1582
1671
|
type: import_v43.default.literal(FieldType.HEADING),
|
|
1583
1672
|
configuration: HeadingConfiguration
|
|
1584
|
-
}).
|
|
1673
|
+
}).meta({
|
|
1674
|
+
description: "A read-only heading component for form pages",
|
|
1675
|
+
id: "Heading"
|
|
1676
|
+
});
|
|
1585
1677
|
var PageHeader = BaseField.extend({
|
|
1586
1678
|
type: import_v43.default.literal(FieldType.PAGE_HEADER)
|
|
1587
|
-
}).
|
|
1679
|
+
}).meta({
|
|
1680
|
+
description: "A read-only header component for form pages",
|
|
1681
|
+
id: "PageHeader"
|
|
1682
|
+
});
|
|
1588
1683
|
var File = BaseField.extend({
|
|
1589
1684
|
type: import_v43.default.literal(FieldType.FILE),
|
|
1590
|
-
defaultValue: FileFieldValue.optional(),
|
|
1685
|
+
defaultValue: FileFieldValue.or(ComputedDefaultValue).optional(),
|
|
1591
1686
|
configuration: import_v43.default.object({
|
|
1592
1687
|
maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1593
1688
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature"),
|
|
@@ -1603,7 +1698,10 @@ var File = BaseField.extend({
|
|
|
1603
1698
|
}).default({
|
|
1604
1699
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1605
1700
|
})
|
|
1606
|
-
}).
|
|
1701
|
+
}).meta({
|
|
1702
|
+
description: "A file upload field",
|
|
1703
|
+
id: "File"
|
|
1704
|
+
});
|
|
1607
1705
|
var SelectOption = import_v43.default.object({
|
|
1608
1706
|
value: import_v43.default.string().describe("The value of the option"),
|
|
1609
1707
|
label: import_v43.default.union([import_v43.default.string(), TranslationConfig]).describe("The label of the option"),
|
|
@@ -1611,7 +1709,7 @@ var SelectOption = import_v43.default.object({
|
|
|
1611
1709
|
});
|
|
1612
1710
|
var NumberWithUnitField = BaseField.extend({
|
|
1613
1711
|
type: import_v43.default.literal(FieldType.NUMBER_WITH_UNIT),
|
|
1614
|
-
defaultValue: NumberWithUnitFieldValue.optional(),
|
|
1712
|
+
defaultValue: NumberWithUnitFieldValue.or(ComputedDefaultValue).optional(),
|
|
1615
1713
|
options: import_v43.default.array(SelectOption).describe("A list of options for the unit select"),
|
|
1616
1714
|
configuration: import_v43.default.object({
|
|
1617
1715
|
min: import_v43.default.number().optional().describe("Minimum value of the number field"),
|
|
@@ -1620,17 +1718,23 @@ var NumberWithUnitField = BaseField.extend({
|
|
|
1620
1718
|
"Placeholder for the number field"
|
|
1621
1719
|
)
|
|
1622
1720
|
}).optional()
|
|
1623
|
-
}).
|
|
1721
|
+
}).meta({
|
|
1722
|
+
description: "A number with unit input field",
|
|
1723
|
+
id: "NumberWithUnitField"
|
|
1724
|
+
});
|
|
1624
1725
|
var RadioGroup = BaseField.extend({
|
|
1625
1726
|
type: import_v43.default.literal(FieldType.RADIO_GROUP),
|
|
1626
|
-
defaultValue: TextValue.optional(),
|
|
1727
|
+
defaultValue: TextValue.or(ComputedDefaultValue).optional(),
|
|
1627
1728
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
1628
1729
|
configuration: import_v43.default.object({
|
|
1629
1730
|
styles: import_v43.default.object({
|
|
1630
1731
|
size: import_v43.default.enum(["NORMAL", "LARGE"]).optional()
|
|
1631
1732
|
}).optional()
|
|
1632
1733
|
}).optional()
|
|
1633
|
-
}).
|
|
1734
|
+
}).meta({
|
|
1735
|
+
description: "A grouped radio button field",
|
|
1736
|
+
id: "RadioGroup"
|
|
1737
|
+
});
|
|
1634
1738
|
var BulletList = BaseField.extend({
|
|
1635
1739
|
type: import_v43.default.literal(FieldType.BULLET_LIST),
|
|
1636
1740
|
items: import_v43.default.array(TranslationConfig).describe("A list of items"),
|
|
@@ -1639,10 +1743,13 @@ var BulletList = BaseField.extend({
|
|
|
1639
1743
|
fontVariant: HtmlFontVariant.optional()
|
|
1640
1744
|
}).optional()
|
|
1641
1745
|
}).default({})
|
|
1642
|
-
}).
|
|
1746
|
+
}).meta({
|
|
1747
|
+
description: "A list of bullet points",
|
|
1748
|
+
id: "BulletList"
|
|
1749
|
+
});
|
|
1643
1750
|
var Select = BaseField.extend({
|
|
1644
1751
|
type: import_v43.default.literal(FieldType.SELECT),
|
|
1645
|
-
defaultValue: TextValue.optional(),
|
|
1752
|
+
defaultValue: TextValue.or(ComputedDefaultValue).optional(),
|
|
1646
1753
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
1647
1754
|
noOptionsMessage: TranslationConfig.optional().describe(
|
|
1648
1755
|
`
|
|
@@ -1654,16 +1761,22 @@ var Select = BaseField.extend({
|
|
|
1654
1761
|
{ ..., defaultMessage: "'{input}' is not listed among the health facilities." }
|
|
1655
1762
|
`
|
|
1656
1763
|
)
|
|
1657
|
-
}).
|
|
1764
|
+
}).meta({
|
|
1765
|
+
description: "A select input field",
|
|
1766
|
+
id: "Select"
|
|
1767
|
+
});
|
|
1658
1768
|
var SelectDateRangeOption = import_v43.default.object({
|
|
1659
1769
|
value: SelectDateRangeValue.describe("The value of the option"),
|
|
1660
1770
|
label: TranslationConfig.describe("The label of the option")
|
|
1661
1771
|
});
|
|
1662
1772
|
var SelectDateRangeField = BaseField.extend({
|
|
1663
1773
|
type: import_v43.default.literal(FieldType.SELECT_DATE_RANGE),
|
|
1664
|
-
defaultValue: SelectDateRangeValue.optional(),
|
|
1774
|
+
defaultValue: SelectDateRangeValue.or(ComputedDefaultValue).optional(),
|
|
1665
1775
|
options: import_v43.default.array(SelectDateRangeOption).describe("A list of options")
|
|
1666
|
-
}).
|
|
1776
|
+
}).meta({
|
|
1777
|
+
description: "A date range selection field",
|
|
1778
|
+
id: "SelectDateRangeField"
|
|
1779
|
+
});
|
|
1667
1780
|
var NameConfig = import_v43.default.object({
|
|
1668
1781
|
firstname: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
1669
1782
|
middlename: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
@@ -1675,7 +1788,7 @@ var NameField = BaseField.extend({
|
|
|
1675
1788
|
firstname: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
1676
1789
|
middlename: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
1677
1790
|
surname: SerializedUserField.or(NonEmptyTextValue).optional()
|
|
1678
|
-
}).optional(),
|
|
1791
|
+
}).or(ComputedDefaultValue).optional(),
|
|
1679
1792
|
configuration: import_v43.default.object({
|
|
1680
1793
|
name: NameConfig.default({
|
|
1681
1794
|
firstname: { required: true },
|
|
@@ -1694,26 +1807,41 @@ var NameField = BaseField.extend({
|
|
|
1694
1807
|
surname: { required: true }
|
|
1695
1808
|
}
|
|
1696
1809
|
}).optional()
|
|
1697
|
-
}).
|
|
1810
|
+
}).meta({
|
|
1811
|
+
description: "A field for entering a persons name",
|
|
1812
|
+
id: "NameField"
|
|
1813
|
+
});
|
|
1698
1814
|
var PhoneField = BaseField.extend({
|
|
1699
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1815
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1700
1816
|
type: import_v43.default.literal(FieldType.PHONE)
|
|
1701
|
-
}).
|
|
1817
|
+
}).meta({
|
|
1818
|
+
description: "A field for entering a phone number",
|
|
1819
|
+
id: "PhoneField"
|
|
1820
|
+
});
|
|
1702
1821
|
var IdField = BaseField.extend({
|
|
1703
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1822
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1704
1823
|
type: import_v43.default.literal(FieldType.ID)
|
|
1705
|
-
}).
|
|
1824
|
+
}).meta({
|
|
1825
|
+
description: "A field for entering an ID",
|
|
1826
|
+
id: "IdField"
|
|
1827
|
+
});
|
|
1706
1828
|
var Checkbox = BaseField.extend({
|
|
1707
1829
|
type: import_v43.default.literal(FieldType.CHECKBOX),
|
|
1708
|
-
defaultValue: CheckboxFieldValue.default(false)
|
|
1709
|
-
}).
|
|
1830
|
+
defaultValue: CheckboxFieldValue.or(ComputedDefaultValue).default(false)
|
|
1831
|
+
}).meta({
|
|
1832
|
+
description: "A boolean checkbox field",
|
|
1833
|
+
id: "Checkbox"
|
|
1834
|
+
});
|
|
1710
1835
|
var Country = BaseField.extend({
|
|
1711
1836
|
type: import_v43.default.literal(FieldType.COUNTRY),
|
|
1712
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1837
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1713
1838
|
optionOverrides: import_v43.default.array(SelectOption.omit({ label: true })).optional().describe(
|
|
1714
1839
|
"Conditionals for specific countries. Countries not listed are always shown and enabled."
|
|
1715
1840
|
)
|
|
1716
|
-
}).
|
|
1841
|
+
}).meta({
|
|
1842
|
+
description: "A field for selecting a country",
|
|
1843
|
+
id: "Country"
|
|
1844
|
+
});
|
|
1717
1845
|
var AllowedLocations = JurisdictionReference.optional().describe(
|
|
1718
1846
|
"Limits which location options are selectable depending on user jurisdiction and location."
|
|
1719
1847
|
);
|
|
@@ -1722,28 +1850,33 @@ var AdministrativeAreas = import_v43.default.enum([
|
|
|
1722
1850
|
"HEALTH_FACILITY",
|
|
1723
1851
|
"CRVS_OFFICE"
|
|
1724
1852
|
]);
|
|
1725
|
-
var AdministrativeAreaConfiguration = import_v43.default.object({
|
|
1726
|
-
partOf: FieldReference.optional().describe("Parent location"),
|
|
1727
|
-
type: AdministrativeAreas,
|
|
1728
|
-
allowedLocations: AllowedLocations
|
|
1729
|
-
}).describe("Administrative area options");
|
|
1730
1853
|
var AdministrativeAreaField = BaseField.extend({
|
|
1731
1854
|
type: import_v43.default.literal(FieldType.ADMINISTRATIVE_AREA),
|
|
1732
|
-
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1733
|
-
configuration:
|
|
1734
|
-
|
|
1855
|
+
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
1856
|
+
configuration: import_v43.default.object({
|
|
1857
|
+
partOf: FieldReference.optional().describe("Parent location"),
|
|
1858
|
+
type: AdministrativeAreas,
|
|
1859
|
+
allowedLocations: AllowedLocations
|
|
1860
|
+
}).describe("Administrative area options")
|
|
1861
|
+
}).meta({
|
|
1862
|
+
description: "Administrative area input field",
|
|
1863
|
+
id: "AdministrativeAreaField"
|
|
1864
|
+
});
|
|
1735
1865
|
var LocationInput = BaseField.extend({
|
|
1736
1866
|
type: import_v43.default.literal(FieldType.LOCATION),
|
|
1737
|
-
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1867
|
+
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
1738
1868
|
configuration: import_v43.default.object({
|
|
1739
1869
|
locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
|
|
1740
1870
|
allowedLocations: AllowedLocations
|
|
1741
1871
|
}).optional()
|
|
1742
|
-
}).
|
|
1872
|
+
}).meta({
|
|
1873
|
+
description: "A field for selecting a location",
|
|
1874
|
+
id: "LocationInput"
|
|
1875
|
+
});
|
|
1743
1876
|
var FileUploadWithOptions = BaseField.extend({
|
|
1744
1877
|
type: import_v43.default.literal(FieldType.FILE_WITH_OPTIONS),
|
|
1745
1878
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
1746
|
-
defaultValue: FileFieldWithOptionValue.optional(),
|
|
1879
|
+
defaultValue: FileFieldWithOptionValue.or(ComputedDefaultValue).optional(),
|
|
1747
1880
|
configuration: import_v43.default.object({
|
|
1748
1881
|
maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1749
1882
|
maxImageSize: import_v43.default.object({
|
|
@@ -1753,15 +1886,18 @@ var FileUploadWithOptions = BaseField.extend({
|
|
|
1753
1886
|
}).default({
|
|
1754
1887
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1755
1888
|
})
|
|
1889
|
+
}).meta({
|
|
1890
|
+
description: "A field for uploading files with file type options",
|
|
1891
|
+
id: "FileUploadWithOptions"
|
|
1756
1892
|
});
|
|
1757
1893
|
var Facility = BaseField.extend({
|
|
1758
1894
|
type: import_v43.default.literal(FieldType.FACILITY),
|
|
1759
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1895
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1760
1896
|
configuration: import_v43.default.object({ allowedLocations: AllowedLocations }).optional()
|
|
1761
1897
|
}).describe("Input field for a facility");
|
|
1762
1898
|
var Office = BaseField.extend({
|
|
1763
1899
|
type: import_v43.default.literal(FieldType.OFFICE),
|
|
1764
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1900
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1765
1901
|
configuration: import_v43.default.object({ allowedLocations: AllowedLocations }).optional()
|
|
1766
1902
|
}).describe("Input field for an office");
|
|
1767
1903
|
var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
|
|
@@ -1797,8 +1933,11 @@ var Address = BaseField.extend({
|
|
|
1797
1933
|
).optional(),
|
|
1798
1934
|
allowedLocations: AllowedLocations
|
|
1799
1935
|
}).optional(),
|
|
1800
|
-
defaultValue: DefaultAddressFieldValue.optional()
|
|
1801
|
-
}).
|
|
1936
|
+
defaultValue: DefaultAddressFieldValue.or(ComputedDefaultValue).optional()
|
|
1937
|
+
}).meta({
|
|
1938
|
+
description: "Address input field \u2013 a combination of location and text fields",
|
|
1939
|
+
id: "Address"
|
|
1940
|
+
});
|
|
1802
1941
|
var StaticDataEntry = import_v43.default.object({
|
|
1803
1942
|
id: import_v43.default.string().describe("ID for the data entry."),
|
|
1804
1943
|
label: TranslationConfig,
|
|
@@ -1813,7 +1952,10 @@ var DataField = BaseField.extend({
|
|
|
1813
1952
|
subtitle: TranslationConfig.optional(),
|
|
1814
1953
|
data: import_v43.default.array(DataEntry)
|
|
1815
1954
|
})
|
|
1816
|
-
}).
|
|
1955
|
+
}).meta({
|
|
1956
|
+
description: "A field for displaying a table of read-only data",
|
|
1957
|
+
id: "DataField"
|
|
1958
|
+
});
|
|
1817
1959
|
var ButtonSize = import_v43.default.enum(["small", "medium", "large"]);
|
|
1818
1960
|
var ButtonType = import_v43.default.enum([
|
|
1819
1961
|
"primary",
|
|
@@ -1838,13 +1980,19 @@ var ButtonConfiguration = import_v43.default.object({
|
|
|
1838
1980
|
});
|
|
1839
1981
|
var ButtonField = BaseField.extend({
|
|
1840
1982
|
type: import_v43.default.literal(FieldType.BUTTON),
|
|
1841
|
-
defaultValue: ButtonFieldValue.optional(),
|
|
1983
|
+
defaultValue: ButtonFieldValue.or(ComputedDefaultValue).optional(),
|
|
1842
1984
|
configuration: ButtonConfiguration
|
|
1843
|
-
}).
|
|
1985
|
+
}).meta({
|
|
1986
|
+
description: "A generic button that can be used to trigger an action",
|
|
1987
|
+
id: "ButtonField"
|
|
1988
|
+
});
|
|
1844
1989
|
var FieldGroup = BaseField.extend({
|
|
1845
1990
|
type: import_v43.default.literal(FieldType.FIELD_GROUP),
|
|
1846
1991
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
1847
1992
|
fields: import_v43.default.lazy(() => import_v43.default.array(FieldConfig))
|
|
1993
|
+
}).meta({
|
|
1994
|
+
description: "A group of fields that are displayed together",
|
|
1995
|
+
id: "FieldGroup"
|
|
1848
1996
|
});
|
|
1849
1997
|
var AlphaPrintButton = BaseField.extend({
|
|
1850
1998
|
type: import_v43.default.literal(FieldType.ALPHA_PRINT_BUTTON),
|
|
@@ -1854,10 +2002,13 @@ var AlphaPrintButton = BaseField.extend({
|
|
|
1854
2002
|
"Label for the print button"
|
|
1855
2003
|
)
|
|
1856
2004
|
})
|
|
1857
|
-
}).
|
|
2005
|
+
}).meta({
|
|
2006
|
+
description: "An experimental print button field for printing certificates during the declaration process",
|
|
2007
|
+
id: "AlphaPrintButton"
|
|
2008
|
+
});
|
|
1858
2009
|
var HttpField = BaseField.extend({
|
|
1859
2010
|
type: import_v43.default.literal(FieldType.HTTP),
|
|
1860
|
-
defaultValue: HttpFieldValue.optional(),
|
|
2011
|
+
defaultValue: HttpFieldValue.or(ComputedDefaultValue).optional(),
|
|
1861
2012
|
configuration: import_v43.default.object({
|
|
1862
2013
|
trigger: FieldReference.optional().describe(
|
|
1863
2014
|
"Reference to the field that triggers the HTTP request when its value changes. If not provided, the HTTP request is triggered once on component mount."
|
|
@@ -1870,20 +2021,30 @@ var HttpField = BaseField.extend({
|
|
|
1870
2021
|
params: import_v43.default.record(import_v43.default.string(), import_v43.default.union([import_v43.default.string(), FieldReference])).optional(),
|
|
1871
2022
|
timeout: import_v43.default.number().default(15e3).describe("Request timeout in milliseconds")
|
|
1872
2023
|
})
|
|
1873
|
-
}).
|
|
2024
|
+
}).meta({
|
|
2025
|
+
description: "Makes a background HTTP request to an external service and stores the response so other fields can use it. Has no visible UI \u2014 pair with LOADER to show request status.",
|
|
2026
|
+
id: "HttpField"
|
|
2027
|
+
});
|
|
1874
2028
|
var AutocompleteField = BaseField.extend({
|
|
1875
2029
|
type: import_v43.default.literal(FieldType.AUTOCOMPLETE),
|
|
1876
2030
|
configuration: import_v43.default.object({
|
|
1877
|
-
url: import_v43.default.string().describe(
|
|
2031
|
+
url: import_v43.default.string().describe(
|
|
2032
|
+
"URL to fetch autocomplete suggestions from. This should be a country config server endpoint."
|
|
2033
|
+
).optional(),
|
|
1878
2034
|
method: import_v43.default.enum(["GET", "POST"]).default("GET").optional(),
|
|
1879
2035
|
defaultOptions: import_v43.default.array(
|
|
1880
2036
|
import_v43.default.object({
|
|
1881
2037
|
label: import_v43.default.string(),
|
|
1882
2038
|
value: import_v43.default.string()
|
|
1883
2039
|
})
|
|
1884
|
-
).optional()
|
|
2040
|
+
).optional().describe(
|
|
2041
|
+
"Manual entry is supported through configuration, allowing users to provide values not currently represented in the dataset."
|
|
2042
|
+
)
|
|
1885
2043
|
})
|
|
1886
|
-
}).
|
|
2044
|
+
}).meta({
|
|
2045
|
+
description: "Generic autocomplete component designed for use with large dictionary-based datasets. The component supports dynamic retrieval of options from configurable data sources and is intended for datasets that may contain tens or hundreds of thousands of records.",
|
|
2046
|
+
id: "AutocompleteField"
|
|
2047
|
+
});
|
|
1887
2048
|
var SearchField = HttpField.extend({
|
|
1888
2049
|
type: import_v43.default.literal(FieldType.SEARCH),
|
|
1889
2050
|
configuration: SearchQuery.pick({
|
|
@@ -1916,6 +2077,9 @@ var SearchField = HttpField.extend({
|
|
|
1916
2077
|
ok: TranslationConfig.optional()
|
|
1917
2078
|
}).optional()
|
|
1918
2079
|
})
|
|
2080
|
+
}).meta({
|
|
2081
|
+
description: "A search input field",
|
|
2082
|
+
id: "SearchField"
|
|
1919
2083
|
});
|
|
1920
2084
|
var LinkButtonField = BaseField.extend({
|
|
1921
2085
|
type: import_v43.default.literal(FieldType.LINK_BUTTON),
|
|
@@ -1924,28 +2088,35 @@ var LinkButtonField = BaseField.extend({
|
|
|
1924
2088
|
text: TranslationConfig.describe("Text to display on the button"),
|
|
1925
2089
|
icon: import_v43.default.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit.")
|
|
1926
2090
|
})
|
|
1927
|
-
}).
|
|
2091
|
+
}).meta({
|
|
2092
|
+
description: "A button that opens a URL link",
|
|
2093
|
+
id: "LinkButtonField"
|
|
2094
|
+
});
|
|
1928
2095
|
var VerificationStatus = BaseField.extend({
|
|
1929
2096
|
type: import_v43.default.literal(FieldType.VERIFICATION_STATUS),
|
|
1930
|
-
defaultValue: VerificationStatusValue.optional(),
|
|
2097
|
+
defaultValue: VerificationStatusValue.or(ComputedDefaultValue).optional(),
|
|
1931
2098
|
configuration: import_v43.default.object({
|
|
1932
2099
|
status: TranslationConfig.describe("Text to display on the status pill."),
|
|
1933
2100
|
description: TranslationConfig.describe(
|
|
1934
2101
|
"Explaining text on the banner in form."
|
|
1935
2102
|
)
|
|
1936
2103
|
})
|
|
2104
|
+
}).meta({
|
|
2105
|
+
description: "Displays a verification state (e.g. ID verified / pending). Often paired with ID_READER \u2014 it can read its value off an ID_READER rather than holding its own.",
|
|
2106
|
+
id: "VerificationStatus"
|
|
1937
2107
|
});
|
|
1938
2108
|
var QueryParamReaderField = BaseField.extend({
|
|
1939
2109
|
type: import_v43.default.literal(FieldType.QUERY_PARAM_READER),
|
|
1940
2110
|
configuration: import_v43.default.object({
|
|
1941
2111
|
pickParams: import_v43.default.array(import_v43.default.string()).describe("List of query parameters to read from the URL")
|
|
1942
2112
|
})
|
|
1943
|
-
}).
|
|
1944
|
-
"A field that maps URL query params into form values and clears them afterward"
|
|
1945
|
-
|
|
2113
|
+
}).meta({
|
|
2114
|
+
description: "A field that maps URL query params into form values and clears them afterward",
|
|
2115
|
+
id: "QueryParamReaderField"
|
|
2116
|
+
});
|
|
1946
2117
|
var QrReaderField = BaseField.extend({
|
|
1947
2118
|
type: import_v43.default.literal(FieldType.QR_READER),
|
|
1948
|
-
defaultValue: QrReaderFieldValue.optional(),
|
|
2119
|
+
defaultValue: QrReaderFieldValue.or(ComputedDefaultValue).optional(),
|
|
1949
2120
|
configuration: import_v43.default.object({
|
|
1950
2121
|
validator: import_v43.default.any().meta({
|
|
1951
2122
|
description: "JSON Schema to validate the scanned QR code data against before populating the form fields.",
|
|
@@ -1953,21 +2124,27 @@ var QrReaderField = BaseField.extend({
|
|
|
1953
2124
|
})
|
|
1954
2125
|
}).optional()
|
|
1955
2126
|
}).meta({
|
|
1956
|
-
description: "
|
|
2127
|
+
description: "QR code reader field, including optional JSON Schema validator.",
|
|
1957
2128
|
id: "QrReaderField"
|
|
1958
2129
|
});
|
|
1959
2130
|
var IdReaderField = BaseField.extend({
|
|
1960
2131
|
type: import_v43.default.literal(FieldType.ID_READER),
|
|
1961
|
-
defaultValue: IdReaderFieldValue.optional(),
|
|
2132
|
+
defaultValue: IdReaderFieldValue.or(ComputedDefaultValue).optional(),
|
|
1962
2133
|
methods: import_v43.default.array(
|
|
1963
2134
|
import_v43.default.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
|
|
1964
2135
|
)
|
|
2136
|
+
}).meta({
|
|
2137
|
+
description: "A wrapper around nested form fields, specifically QR_READER and LINK_BUTTON. It can hold the QR_READERs value.",
|
|
2138
|
+
id: "IdReaderField"
|
|
1965
2139
|
});
|
|
1966
2140
|
var CustomField = BaseField.extend({
|
|
1967
2141
|
type: import_v43.default.literal(FieldType._EXPERIMENTAL_CUSTOM),
|
|
1968
2142
|
defaultValue: CustomFieldValue.optional(),
|
|
1969
2143
|
src: import_v43.default.string().describe("Module source path for the custom field component"),
|
|
1970
2144
|
configuration: import_v43.default.unknown().optional()
|
|
2145
|
+
}).meta({
|
|
2146
|
+
description: "An expiremental custom field that is defined by a module source path",
|
|
2147
|
+
id: "CustomField"
|
|
1971
2148
|
});
|
|
1972
2149
|
var FieldStyleVariant = import_v43.default.enum(["default", "highlighted"]);
|
|
1973
2150
|
var LoaderField = BaseField.extend({
|
|
@@ -1977,22 +2154,25 @@ var LoaderField = BaseField.extend({
|
|
|
1977
2154
|
configuration: import_v43.default.object({
|
|
1978
2155
|
text: TranslationConfig.describe("Display text above the loading spinner")
|
|
1979
2156
|
})
|
|
1980
|
-
}).
|
|
1981
|
-
"A non-interactive field that indicates an in progress operation in form"
|
|
1982
|
-
|
|
2157
|
+
}).meta({
|
|
2158
|
+
description: "A non-interactive field that indicates an in progress operation in form",
|
|
2159
|
+
id: "LoaderField"
|
|
2160
|
+
});
|
|
1983
2161
|
var HiddenField = BaseField.extend({
|
|
1984
2162
|
type: import_v43.default.literal(FieldType.ALPHA_HIDDEN),
|
|
1985
2163
|
required: import_v43.default.boolean().default(false).optional(),
|
|
1986
2164
|
defaultValue: TextValue.optional()
|
|
1987
|
-
}).
|
|
1988
|
-
"A non-interactive, hidden field that only hold a value in the form"
|
|
1989
|
-
|
|
2165
|
+
}).meta({
|
|
2166
|
+
description: "A non-interactive, hidden field that only hold a value in the form",
|
|
2167
|
+
id: "HiddenField"
|
|
2168
|
+
});
|
|
1990
2169
|
var UserRoleField = BaseField.extend({
|
|
1991
2170
|
type: import_v43.default.literal(FieldType.USER_ROLE),
|
|
1992
2171
|
defaultValue: TextValue.optional()
|
|
1993
|
-
}).
|
|
1994
|
-
"A select dropdown that is automatically populated with available user roles"
|
|
1995
|
-
|
|
2172
|
+
}).meta({
|
|
2173
|
+
description: "A select dropdown that is automatically populated with available user roles",
|
|
2174
|
+
id: "UserRoleField"
|
|
2175
|
+
});
|
|
1996
2176
|
var FieldConfig = import_v43.default.discriminatedUnion("type", [
|
|
1997
2177
|
FieldGroup,
|
|
1998
2178
|
Address,
|
|
@@ -2078,8 +2258,8 @@ var ApplicationConfig = z20.object({
|
|
|
2078
2258
|
})
|
|
2079
2259
|
),
|
|
2080
2260
|
PHONE_NUMBER_PATTERN: z20.string().or(z20.instanceof(RegExp)),
|
|
2081
|
-
USER_NOTIFICATION_DELIVERY_METHOD: z20.
|
|
2082
|
-
INFORMANT_NOTIFICATION_DELIVERY_METHOD: z20.
|
|
2261
|
+
USER_NOTIFICATION_DELIVERY_METHOD: z20.enum(["email", "sms"]),
|
|
2262
|
+
INFORMANT_NOTIFICATION_DELIVERY_METHOD: z20.enum(["email", "sms"]),
|
|
2083
2263
|
SEARCH_DEFAULT_CRITERIA: SearchCriteria.optional().default("TRACKING_ID"),
|
|
2084
2264
|
ADDITIONAL_USER_FIELDS: z20.array(FieldConfig).optional().default([])
|
|
2085
2265
|
});
|
|
@@ -2097,8 +2277,8 @@ var BackgroundConfig = z20.object({
|
|
|
2097
2277
|
var LoginConfig = z20.object({
|
|
2098
2278
|
COUNTRY: z20.string(),
|
|
2099
2279
|
LANGUAGES: z20.array(z20.string()),
|
|
2100
|
-
USER_NOTIFICATION_DELIVERY_METHOD: z20.
|
|
2101
|
-
INFORMANT_NOTIFICATION_DELIVERY_METHOD: z20.
|
|
2280
|
+
USER_NOTIFICATION_DELIVERY_METHOD: z20.enum(["email", "sms"]),
|
|
2281
|
+
INFORMANT_NOTIFICATION_DELIVERY_METHOD: z20.enum(["email", "sms"]),
|
|
2102
2282
|
PHONE_NUMBER_PATTERN: z20.string().or(z20.instanceof(RegExp)),
|
|
2103
2283
|
LOGIN_BACKGROUND: BackgroundConfig,
|
|
2104
2284
|
SENTRY: z20.string().optional()
|
|
@@ -2110,6 +2290,7 @@ var ClientConfig = z20.object({
|
|
|
2110
2290
|
COUNTRY: z20.string(),
|
|
2111
2291
|
LANGUAGES: z20.array(z20.string()),
|
|
2112
2292
|
SENTRY: z20.string().optional(),
|
|
2293
|
+
LOGIN_URL: z20.string().optional(),
|
|
2113
2294
|
REGISTER_BACKGROUND: BackgroundConfig,
|
|
2114
2295
|
DASHBOARDS: z20.array(
|
|
2115
2296
|
z20.object({
|