@opencrvs/toolkit 2.0.0-rc.fd02169 → 2.0.0-rc.fd2511e
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/README.md +15 -0
- package/build.sh +3 -2
- package/create-countryconfig/index.js +50 -20
- package/create-countryconfig/package.json +12 -2
- package/dist/application-config/index.js +274 -103
- package/dist/cli.js +3354 -51
- package/dist/commons/api/router.d.ts +462 -50
- package/dist/commons/application-config/index.d.ts +1 -0
- package/dist/commons/conditionals/conditionals.d.ts +357 -7
- package/dist/commons/conditionals/validate.d.ts +51 -2
- package/dist/commons/events/ActionConfig.d.ts +28 -2
- package/dist/commons/events/ActionDocument.d.ts +6 -0
- package/dist/commons/events/ActionInput.d.ts +42 -36
- package/dist/commons/events/AdvancedSearchConfig.d.ts +354 -0
- package/dist/commons/events/CountryConfigQueryInput.d.ts +42 -0
- package/dist/commons/events/Draft.d.ts +2 -3
- package/dist/commons/events/EventConfig.d.ts +2 -0
- package/dist/commons/events/EventDocument.d.ts +3 -0
- package/dist/commons/events/EventIndex.d.ts +25 -3
- package/dist/commons/events/EventMetadata.d.ts +26 -7
- package/dist/commons/events/FieldConfig.d.ts +388 -50
- package/dist/commons/events/FieldType.d.ts +1 -0
- package/dist/commons/events/FieldTypeMapping.d.ts +1 -1
- package/dist/commons/events/FieldValue.d.ts +6 -0
- package/dist/commons/events/WorkqueueConfig.d.ts +189 -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 +1 -0
- package/dist/commons/events/state/flags.d.ts +16 -0
- package/dist/commons/events/state/index.d.ts +8 -4
- package/dist/commons/events/state/utils.d.ts +21 -289
- package/dist/commons/events/utils.d.ts +12 -1
- package/dist/conditionals/index.js +63 -5
- package/dist/environment/custom-types.d.ts +33 -0
- package/dist/environment/custom-types.d.ts.map +1 -0
- package/dist/environment/custom-types.js +12 -0
- package/dist/environment/derived-variables.d.ts +134 -0
- package/dist/environment/derived-variables.d.ts.map +1 -0
- package/dist/environment/derived-variables.js +169 -0
- package/dist/environment/editor-questions.d.ts +4 -0
- package/dist/environment/editor-questions.d.ts.map +1 -0
- package/dist/environment/editor-questions.js +67 -0
- package/dist/environment/git.d.ts +5 -0
- package/dist/environment/git.d.ts.map +1 -0
- package/dist/environment/git.js +38 -0
- package/dist/environment/github.d.ts +26 -0
- package/dist/environment/github.d.ts.map +1 -0
- package/dist/environment/github.js +247 -0
- package/dist/environment/index.d.ts +5 -0
- package/dist/environment/index.d.ts.map +1 -0
- package/dist/environment/index.js +71 -0
- package/dist/environment/logger.d.ts +15 -0
- package/dist/environment/logger.d.ts.map +1 -0
- package/dist/environment/logger.js +25 -0
- package/dist/environment/manage-users.d.ts +11 -0
- package/dist/environment/manage-users.d.ts.map +1 -0
- package/dist/environment/manage-users.js +497 -0
- package/dist/environment/questions-helper.d.ts +15 -0
- package/dist/environment/questions-helper.d.ts.map +1 -0
- package/dist/environment/questions-helper.js +70 -0
- package/dist/environment/questions.d.ts +199 -0
- package/dist/environment/questions.d.ts.map +1 -0
- package/dist/environment/questions.js +412 -0
- package/dist/environment/setup-environment.d.ts +2 -0
- package/dist/environment/setup-environment.d.ts.map +1 -0
- package/dist/environment/setup-environment.js +794 -0
- package/dist/environment/ssh-keygen.d.ts +5 -0
- package/dist/environment/ssh-keygen.d.ts.map +1 -0
- package/dist/environment/ssh-keygen.js +21 -0
- package/dist/environment/swarm-to-k8s.d.ts +2 -0
- package/dist/environment/swarm-to-k8s.d.ts.map +1 -0
- package/dist/environment/swarm-to-k8s.js +173 -0
- package/dist/environment/templates.d.ts +27 -0
- package/dist/environment/templates.d.ts.map +1 -0
- package/dist/environment/templates.js +163 -0
- package/dist/environment/update-workflows.d.ts +2 -0
- package/dist/environment/update-workflows.d.ts.map +1 -0
- package/dist/environment/update-workflows.js +169 -0
- package/dist/environment/users.d.ts +2 -0
- package/dist/environment/users.d.ts.map +1 -0
- package/dist/environment/users.js +112 -0
- package/dist/environment/utils.d.ts +18 -0
- package/dist/environment/utils.d.ts.map +1 -0
- package/dist/environment/utils.js +100 -0
- package/dist/events/index.js +1089 -258
- 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 -1
- 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.map +1 -1
- package/dist/migrations/v2.0/index.js +114 -12
- package/dist/notification/index.js +900 -140
- package/dist/scopes/index.d.ts +93 -7
- package/dist/scopes/index.js +20 -7
- package/dist/templates/charts-values/dependencies/values.override.yaml +4 -0
- package/dist/templates/charts-values/dependencies/values.yaml +83 -0
- package/dist/templates/charts-values/opencrvs-services/values.override.yaml +4 -0
- package/dist/templates/charts-values/opencrvs-services/values.yaml +81 -0
- package/dist/templates/charts-values/traefik/values.override.yaml +4 -0
- package/dist/templates/charts-values/traefik/values.yaml +115 -0
- package/dist/templates/inventory/inventory.template.yml +100 -0
- package/dist/templates/inventory/production.example.yml +77 -0
- package/dist/templates/inventory/qa.example.yml +48 -0
- package/opencrvs-toolkit-2.0.0-rc.fd2511e.tgz +0 -0
- package/package.json +20 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/opencrvs-toolkit-2.0.0-rc.fd02169.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",
|
|
@@ -656,11 +665,13 @@ var scopeOptionsPlaceEvent = z11.object({
|
|
|
656
665
|
event: scopeByEvent,
|
|
657
666
|
placeOfEvent: JurisdictionFilter.optional()
|
|
658
667
|
}).describe("Options applicable to all record scopes.");
|
|
659
|
-
var
|
|
668
|
+
var scopeOptionsDeclaredOrNotified = scopeOptionsPlaceEvent.extend({
|
|
669
|
+
notifiedIn: JurisdictionFilter.optional(),
|
|
670
|
+
notifiedBy: UserFilter.optional(),
|
|
660
671
|
declaredIn: JurisdictionFilter.optional(),
|
|
661
672
|
declaredBy: UserFilter.optional()
|
|
662
673
|
}).describe("Options applicable to actions that may take place after DECLARE");
|
|
663
|
-
var AllRecordScopeOptions =
|
|
674
|
+
var AllRecordScopeOptions = scopeOptionsDeclaredOrNotified.extend({
|
|
664
675
|
registeredIn: JurisdictionFilter.optional(),
|
|
665
676
|
registeredBy: UserFilter.optional()
|
|
666
677
|
}).describe(
|
|
@@ -698,6 +709,8 @@ var ResolvedScopeOptionsPlaceEvent = z11.object({
|
|
|
698
709
|
"Resolved options applicable to all record scopes, with location ID instead of jurisdiction filter."
|
|
699
710
|
);
|
|
700
711
|
var ResolvedScopeOptionsDeclared = ResolvedScopeOptionsPlaceEvent.extend({
|
|
712
|
+
notifiedIn: UUID.nullish(),
|
|
713
|
+
notifiedBy: z11.string().optional(),
|
|
701
714
|
declaredIn: UUID.nullish(),
|
|
702
715
|
declaredBy: z11.string().optional()
|
|
703
716
|
}).describe(
|
|
@@ -743,7 +756,7 @@ var RecordScopeV2 = z11.discriminatedUnion("type", [
|
|
|
743
756
|
}),
|
|
744
757
|
z11.object({
|
|
745
758
|
type: ScopesWithDeclaredOptions,
|
|
746
|
-
options:
|
|
759
|
+
options: scopeOptionsDeclaredOrNotified.optional()
|
|
747
760
|
}),
|
|
748
761
|
z11.object({
|
|
749
762
|
type: ScopesWithFullOptions,
|
|
@@ -831,7 +844,10 @@ var ScopeType = z11.enum([
|
|
|
831
844
|
var EncodedScope = z11.string().brand("EncodedScope");
|
|
832
845
|
var DEFAULT_SCOPE_OPTIONS = {
|
|
833
846
|
placeOfEvent: JurisdictionFilter.enum.all,
|
|
834
|
-
accessLevel: JurisdictionFilter.enum.all
|
|
847
|
+
accessLevel: JurisdictionFilter.enum.all,
|
|
848
|
+
notifiedIn: JurisdictionFilter.enum.all,
|
|
849
|
+
declaredIn: JurisdictionFilter.enum.all,
|
|
850
|
+
registeredIn: JurisdictionFilter.enum.all
|
|
835
851
|
};
|
|
836
852
|
|
|
837
853
|
// ../commons/src/authentication.ts
|
|
@@ -984,8 +1000,9 @@ var RequestedCorrectionAction = ActionBase.extend(
|
|
|
984
1000
|
var ApprovedCorrectionAction = ActionBase.extend(
|
|
985
1001
|
z13.object({
|
|
986
1002
|
type: z13.literal(ActionType.APPROVE_CORRECTION),
|
|
987
|
-
requestId: z13.string()
|
|
1003
|
+
requestId: z13.string(),
|
|
988
1004
|
// TODO move into 'content' property
|
|
1005
|
+
content: z13.object({ immediateCorrection: z13.boolean().optional() }).optional()
|
|
989
1006
|
}).shape
|
|
990
1007
|
);
|
|
991
1008
|
var RejectedCorrectionAction = ActionBase.extend(
|
|
@@ -1077,6 +1094,9 @@ var FlagConfig = z14.object({
|
|
|
1077
1094
|
"Indicates if this flag expects an action to be performed to be cleared."
|
|
1078
1095
|
),
|
|
1079
1096
|
label: TranslationConfig.describe("Human readable label of the flag.")
|
|
1097
|
+
}).meta({
|
|
1098
|
+
id: "FlagConfig",
|
|
1099
|
+
description: "Configuration for a custom flag that can be added to or removed from records by event actions."
|
|
1080
1100
|
});
|
|
1081
1101
|
var ActionFlagConfig = z14.object({
|
|
1082
1102
|
id: Flag,
|
|
@@ -1084,6 +1104,9 @@ var ActionFlagConfig = z14.object({
|
|
|
1084
1104
|
conditional: Conditional.optional().describe(
|
|
1085
1105
|
"When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
|
|
1086
1106
|
)
|
|
1107
|
+
}).meta({
|
|
1108
|
+
id: "ActionFlagConfig",
|
|
1109
|
+
description: "Add or remove operation applied to a flag when the parent action is accepted. Optionally gated by a conditional."
|
|
1087
1110
|
});
|
|
1088
1111
|
|
|
1089
1112
|
// ../commons/src/events/EventMetadata.ts
|
|
@@ -1105,8 +1128,7 @@ var ActionCreationMetadata = z15.object({
|
|
|
1105
1128
|
),
|
|
1106
1129
|
createdByUserType: z15.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1107
1130
|
acceptedAt: z15.iso.datetime().describe("Timestamp when the action request was accepted."),
|
|
1108
|
-
createdByRole: z15.string().optional().describe("Role of the user at the time of action request creation.")
|
|
1109
|
-
createdBySignature: z15.string().nullish().describe("Signature of the user who created the action request.")
|
|
1131
|
+
createdByRole: z15.string().optional().describe("Role of the user at the time of action request creation.")
|
|
1110
1132
|
});
|
|
1111
1133
|
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
1112
1134
|
registrationNumber: z15.string().describe(
|
|
@@ -1114,6 +1136,7 @@ var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
|
1114
1136
|
)
|
|
1115
1137
|
});
|
|
1116
1138
|
var LegalStatuses = z15.object({
|
|
1139
|
+
[EventStatus.enum.NOTIFIED]: ActionCreationMetadata.nullish(),
|
|
1117
1140
|
[EventStatus.enum.DECLARED]: ActionCreationMetadata.nullish(),
|
|
1118
1141
|
[EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish()
|
|
1119
1142
|
});
|
|
@@ -1134,9 +1157,6 @@ var EventMetadata = z15.object({
|
|
|
1134
1157
|
createdAtLocation: UUID.nullish().describe(
|
|
1135
1158
|
"Location of the user who created the event."
|
|
1136
1159
|
),
|
|
1137
|
-
createdBySignature: DocumentPath.nullish().describe(
|
|
1138
|
-
"Signature of the user who created the event."
|
|
1139
|
-
),
|
|
1140
1160
|
updatedAtLocation: UUID.nullish().describe(
|
|
1141
1161
|
"Location of the user who last changed the status."
|
|
1142
1162
|
),
|
|
@@ -1176,6 +1196,8 @@ var EventMetadataKeys = z15.enum(EventMetadataKeysArray);
|
|
|
1176
1196
|
var EventMetadataDateFieldIdInput = z15.enum([
|
|
1177
1197
|
"createdAt",
|
|
1178
1198
|
"updatedAt",
|
|
1199
|
+
"legalStatuses.NOTIFIED.createdAt",
|
|
1200
|
+
"legalStatuses.NOTIFIED.acceptedAt",
|
|
1179
1201
|
"legalStatuses.DECLARED.createdAt",
|
|
1180
1202
|
"legalStatuses.DECLARED.acceptedAt",
|
|
1181
1203
|
"legalStatuses.REGISTERED.createdAt",
|
|
@@ -1184,6 +1206,8 @@ var EventMetadataDateFieldIdInput = z15.enum([
|
|
|
1184
1206
|
var EventMetadataDateFieldId = z15.enum([
|
|
1185
1207
|
"event.createdAt",
|
|
1186
1208
|
"event.updatedAt",
|
|
1209
|
+
"event.legalStatuses.NOTIFIED.createdAt",
|
|
1210
|
+
"event.legalStatuses.NOTIFIED.acceptedAt",
|
|
1187
1211
|
"event.legalStatuses.DECLARED.createdAt",
|
|
1188
1212
|
"event.legalStatuses.DECLARED.acceptedAt",
|
|
1189
1213
|
"event.legalStatuses.REGISTERED.createdAt",
|
|
@@ -1246,7 +1270,8 @@ var Range = import_v4.z.object({
|
|
|
1246
1270
|
});
|
|
1247
1271
|
var ContainsFlags = import_v4.z.object({
|
|
1248
1272
|
anyOf: import_v4.z.array(Flag).optional(),
|
|
1249
|
-
noneOf: import_v4.z.array(Flag).optional()
|
|
1273
|
+
noneOf: import_v4.z.array(Flag).optional(),
|
|
1274
|
+
allOf: import_v4.z.array(Flag).optional()
|
|
1250
1275
|
}).meta({
|
|
1251
1276
|
id: "ContainsFlags"
|
|
1252
1277
|
});
|
|
@@ -1400,14 +1425,31 @@ var FieldId = import_v43.default.string().superRefine((val, ctx) => {
|
|
|
1400
1425
|
}
|
|
1401
1426
|
}).describe("Unique identifier for the field");
|
|
1402
1427
|
var FieldReference = import_v43.default.object({
|
|
1403
|
-
$$field: FieldId,
|
|
1428
|
+
$$field: FieldId.describe("Id of the field to reference"),
|
|
1404
1429
|
$$subfield: import_v43.default.array(import_v43.default.string()).optional().default([]).describe(
|
|
1405
1430
|
'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
|
|
1431
|
+
),
|
|
1432
|
+
$$code: import_v43.default.string().optional().describe(
|
|
1433
|
+
"Serialised client-side function body. When present the expression is evaluated rather than dereferenced."
|
|
1434
|
+
)
|
|
1435
|
+
}).describe(
|
|
1436
|
+
"Reference to a field value, with an optional client-side computation applied."
|
|
1437
|
+
);
|
|
1438
|
+
var ComputedDefaultValue = import_v43.default.object({
|
|
1439
|
+
$$code: import_v43.default.string().describe(
|
|
1440
|
+
"Serialised client-side function body. Receives (undefined, context) where context includes $now, $online, and system variables."
|
|
1406
1441
|
)
|
|
1407
|
-
}).describe("
|
|
1442
|
+
}).describe("A context-only computation used as a field default value.");
|
|
1408
1443
|
var ValidationConfig = import_v43.default.object({
|
|
1409
|
-
validator: Conditional
|
|
1410
|
-
|
|
1444
|
+
validator: Conditional.describe(
|
|
1445
|
+
"Conditional expression that must hold for the field value to be considered valid."
|
|
1446
|
+
),
|
|
1447
|
+
message: TranslationConfig.describe(
|
|
1448
|
+
"Error message displayed when the validator does not hold."
|
|
1449
|
+
)
|
|
1450
|
+
}).meta({
|
|
1451
|
+
id: "ValidationConfig",
|
|
1452
|
+
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."
|
|
1411
1453
|
});
|
|
1412
1454
|
var requiredSchema = import_v43.default.union([
|
|
1413
1455
|
import_v43.default.boolean(),
|
|
@@ -1438,7 +1480,7 @@ var BaseField = import_v43.default.object({
|
|
|
1438
1480
|
"Indicates whether the field can be modified during record correction."
|
|
1439
1481
|
),
|
|
1440
1482
|
value: FieldReference.or(import_v43.default.array(FieldReference)).optional().describe(
|
|
1441
|
-
"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."
|
|
1483
|
+
"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."
|
|
1442
1484
|
),
|
|
1443
1485
|
analytics: import_v43.default.boolean().default(false).optional().describe(
|
|
1444
1486
|
"Indicates whether the field is included in analytics. When enabled, its value becomes available in the analytics dashboard."
|
|
@@ -1446,30 +1488,40 @@ var BaseField = import_v43.default.object({
|
|
|
1446
1488
|
}).describe("Common properties shared across all field types.");
|
|
1447
1489
|
var Divider = BaseField.extend({
|
|
1448
1490
|
type: import_v43.default.literal(FieldType.DIVIDER)
|
|
1491
|
+
}).meta({
|
|
1492
|
+
description: "A horizontal line divider",
|
|
1493
|
+
id: "Divider"
|
|
1449
1494
|
});
|
|
1450
1495
|
var TextField = BaseField.extend({
|
|
1451
1496
|
type: import_v43.default.literal(FieldType.TEXT),
|
|
1452
|
-
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1497
|
+
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
1453
1498
|
configuration: import_v43.default.object({
|
|
1454
1499
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text"),
|
|
1455
1500
|
type: import_v43.default.enum(["text", "password"]).optional(),
|
|
1456
1501
|
prefix: TranslationConfig.optional(),
|
|
1457
1502
|
postfix: TranslationConfig.optional()
|
|
1458
1503
|
}).default({ type: "text" }).optional()
|
|
1459
|
-
}).
|
|
1504
|
+
}).meta({
|
|
1505
|
+
description: "A text input field",
|
|
1506
|
+
id: "TextField"
|
|
1507
|
+
});
|
|
1460
1508
|
var NumberField = BaseField.extend({
|
|
1461
1509
|
type: import_v43.default.literal(FieldType.NUMBER),
|
|
1462
|
-
defaultValue: NumberFieldValue.optional(),
|
|
1510
|
+
defaultValue: NumberFieldValue.or(ComputedDefaultValue).optional(),
|
|
1463
1511
|
configuration: import_v43.default.object({
|
|
1464
1512
|
min: import_v43.default.number().optional().describe("Minimum value"),
|
|
1465
1513
|
max: import_v43.default.number().optional().describe("Maximum value"),
|
|
1514
|
+
integer: import_v43.default.boolean().optional().describe("When true, only whole numbers are allowed"),
|
|
1466
1515
|
prefix: TranslationConfig.optional(),
|
|
1467
1516
|
postfix: TranslationConfig.optional()
|
|
1468
1517
|
}).optional()
|
|
1469
|
-
}).
|
|
1518
|
+
}).meta({
|
|
1519
|
+
description: "A number input field",
|
|
1520
|
+
id: "NumberField"
|
|
1521
|
+
});
|
|
1470
1522
|
var TextAreaField = BaseField.extend({
|
|
1471
1523
|
type: import_v43.default.literal(FieldType.TEXTAREA),
|
|
1472
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1524
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1473
1525
|
configuration: import_v43.default.object({
|
|
1474
1526
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text"),
|
|
1475
1527
|
rows: import_v43.default.number().optional().describe("Number of visible text lines"),
|
|
@@ -1477,7 +1529,10 @@ var TextAreaField = BaseField.extend({
|
|
|
1477
1529
|
prefix: TranslationConfig.optional(),
|
|
1478
1530
|
postfix: TranslationConfig.optional()
|
|
1479
1531
|
}).default({ rows: 4 }).optional()
|
|
1480
|
-
}).
|
|
1532
|
+
}).meta({
|
|
1533
|
+
description: "A multiline text input",
|
|
1534
|
+
id: "TextAreaField"
|
|
1535
|
+
});
|
|
1481
1536
|
var ImageMimeType = import_v43.default.enum([
|
|
1482
1537
|
"image/png",
|
|
1483
1538
|
"image/jpg",
|
|
@@ -1500,58 +1555,76 @@ var SignatureField = BaseField.extend({
|
|
|
1500
1555
|
signaturePromptLabel: TranslationConfig.describe(
|
|
1501
1556
|
"Title of the signature modal"
|
|
1502
1557
|
),
|
|
1503
|
-
defaultValue:
|
|
1558
|
+
defaultValue: SignatureFieldValue.or(ComputedDefaultValue).optional(),
|
|
1504
1559
|
configuration: import_v43.default.object({
|
|
1505
1560
|
maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1506
1561
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
|
1507
1562
|
}).default({
|
|
1508
1563
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1509
1564
|
})
|
|
1510
|
-
}).
|
|
1565
|
+
}).meta({
|
|
1566
|
+
description: "A signature input field",
|
|
1567
|
+
id: "SignatureField"
|
|
1568
|
+
});
|
|
1511
1569
|
var EmailField = BaseField.extend({
|
|
1512
1570
|
type: import_v43.default.literal(FieldType.EMAIL),
|
|
1513
1571
|
configuration: import_v43.default.object({
|
|
1514
1572
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text")
|
|
1515
1573
|
}).default({ maxLength: 255 }).optional(),
|
|
1516
|
-
defaultValue: NonEmptyTextValue.optional()
|
|
1574
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional()
|
|
1575
|
+
}).meta({
|
|
1576
|
+
description: "An email input field",
|
|
1577
|
+
id: "EmailField"
|
|
1517
1578
|
});
|
|
1518
1579
|
var DateField = BaseField.extend({
|
|
1519
1580
|
type: import_v43.default.literal(FieldType.DATE),
|
|
1520
|
-
defaultValue: SerializedNowDateTime.or(PlainDate).optional().describe("Default date value(yyyy-MM-dd)"),
|
|
1581
|
+
defaultValue: SerializedNowDateTime.or(PlainDate).or(ComputedDefaultValue).optional().describe("Default date value(yyyy-MM-dd)"),
|
|
1521
1582
|
configuration: import_v43.default.object({
|
|
1522
1583
|
notice: TranslationConfig.describe(
|
|
1523
1584
|
"Text to display above the date input"
|
|
1524
1585
|
).optional()
|
|
1525
1586
|
}).optional()
|
|
1526
|
-
}).
|
|
1587
|
+
}).meta({
|
|
1588
|
+
description: "A date input (yyyy-MM-dd)",
|
|
1589
|
+
id: "DateField"
|
|
1590
|
+
});
|
|
1527
1591
|
var AgeField = BaseField.extend({
|
|
1528
1592
|
type: import_v43.default.literal(FieldType.AGE),
|
|
1529
|
-
defaultValue: NumberFieldValue.optional(),
|
|
1593
|
+
defaultValue: NumberFieldValue.or(ComputedDefaultValue).optional(),
|
|
1530
1594
|
configuration: import_v43.default.object({
|
|
1531
1595
|
asOfDate: FieldReference,
|
|
1532
1596
|
prefix: TranslationConfig.optional(),
|
|
1533
1597
|
postfix: TranslationConfig.optional()
|
|
1534
1598
|
})
|
|
1535
|
-
}).
|
|
1599
|
+
}).meta({
|
|
1600
|
+
description: "An age input field which uses the current date as the asOfDate",
|
|
1601
|
+
id: "AgeField"
|
|
1602
|
+
});
|
|
1536
1603
|
var TimeField = BaseField.extend({
|
|
1537
1604
|
type: import_v43.default.literal(FieldType.TIME),
|
|
1538
|
-
defaultValue: SerializedNowDateTime.or(TimeValue).optional().describe("Default time value (HH-mm)"),
|
|
1605
|
+
defaultValue: SerializedNowDateTime.or(TimeValue).or(ComputedDefaultValue).optional().describe("Default time value (HH-mm)"),
|
|
1539
1606
|
configuration: import_v43.default.object({
|
|
1540
1607
|
use12HourFormat: import_v43.default.boolean().optional().describe("Whether to use 12-hour format"),
|
|
1541
1608
|
notice: TranslationConfig.describe(
|
|
1542
1609
|
"Text to display above the time input"
|
|
1543
1610
|
).optional()
|
|
1544
1611
|
}).optional()
|
|
1545
|
-
}).
|
|
1612
|
+
}).meta({
|
|
1613
|
+
description: "A single time input (HH-mm)",
|
|
1614
|
+
id: "TimeField"
|
|
1615
|
+
});
|
|
1546
1616
|
var DateRangeField = BaseField.extend({
|
|
1547
1617
|
type: import_v43.default.literal(FieldType.DATE_RANGE),
|
|
1548
|
-
defaultValue: DateRangeFieldValue.optional(),
|
|
1618
|
+
defaultValue: DateRangeFieldValue.or(ComputedDefaultValue).optional(),
|
|
1549
1619
|
configuration: import_v43.default.object({
|
|
1550
1620
|
notice: TranslationConfig.describe(
|
|
1551
1621
|
"Text to display above the date input"
|
|
1552
1622
|
).optional()
|
|
1553
1623
|
}).optional()
|
|
1554
|
-
}).
|
|
1624
|
+
}).meta({
|
|
1625
|
+
description: "A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })",
|
|
1626
|
+
id: "DateRangeField"
|
|
1627
|
+
});
|
|
1555
1628
|
var HtmlFontVariant = import_v43.default.enum([
|
|
1556
1629
|
"reg12",
|
|
1557
1630
|
"reg14",
|
|
@@ -1595,21 +1668,33 @@ var ImageViewField = BaseField.extend({
|
|
|
1595
1668
|
type: import_v43.default.literal(FieldType.IMAGE_VIEW),
|
|
1596
1669
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1597
1670
|
configuration: ImageConfiguration
|
|
1598
|
-
}).
|
|
1671
|
+
}).meta({
|
|
1672
|
+
description: "A read-only image component for form pages",
|
|
1673
|
+
id: "ImageViewField"
|
|
1674
|
+
});
|
|
1599
1675
|
var Paragraph = BaseField.extend({
|
|
1600
1676
|
type: import_v43.default.literal(FieldType.PARAGRAPH),
|
|
1601
1677
|
configuration: ParagraphConfiguration
|
|
1602
|
-
}).
|
|
1678
|
+
}).meta({
|
|
1679
|
+
description: "A read-only HTML <p> paragraph",
|
|
1680
|
+
id: "Paragraph"
|
|
1681
|
+
});
|
|
1603
1682
|
var Heading = BaseField.extend({
|
|
1604
1683
|
type: import_v43.default.literal(FieldType.HEADING),
|
|
1605
1684
|
configuration: HeadingConfiguration
|
|
1606
|
-
}).
|
|
1685
|
+
}).meta({
|
|
1686
|
+
description: "A read-only heading component for form pages",
|
|
1687
|
+
id: "Heading"
|
|
1688
|
+
});
|
|
1607
1689
|
var PageHeader = BaseField.extend({
|
|
1608
1690
|
type: import_v43.default.literal(FieldType.PAGE_HEADER)
|
|
1609
|
-
}).
|
|
1691
|
+
}).meta({
|
|
1692
|
+
description: "A read-only header component for form pages",
|
|
1693
|
+
id: "PageHeader"
|
|
1694
|
+
});
|
|
1610
1695
|
var File = BaseField.extend({
|
|
1611
1696
|
type: import_v43.default.literal(FieldType.FILE),
|
|
1612
|
-
defaultValue: FileFieldValue.optional(),
|
|
1697
|
+
defaultValue: FileFieldValue.or(ComputedDefaultValue).optional(),
|
|
1613
1698
|
configuration: import_v43.default.object({
|
|
1614
1699
|
maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1615
1700
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature"),
|
|
@@ -1625,7 +1710,10 @@ var File = BaseField.extend({
|
|
|
1625
1710
|
}).default({
|
|
1626
1711
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1627
1712
|
})
|
|
1628
|
-
}).
|
|
1713
|
+
}).meta({
|
|
1714
|
+
description: "A file upload field",
|
|
1715
|
+
id: "File"
|
|
1716
|
+
});
|
|
1629
1717
|
var SelectOption = import_v43.default.object({
|
|
1630
1718
|
value: import_v43.default.string().describe("The value of the option"),
|
|
1631
1719
|
label: import_v43.default.union([import_v43.default.string(), TranslationConfig]).describe("The label of the option"),
|
|
@@ -1633,7 +1721,7 @@ var SelectOption = import_v43.default.object({
|
|
|
1633
1721
|
});
|
|
1634
1722
|
var NumberWithUnitField = BaseField.extend({
|
|
1635
1723
|
type: import_v43.default.literal(FieldType.NUMBER_WITH_UNIT),
|
|
1636
|
-
defaultValue: NumberWithUnitFieldValue.optional(),
|
|
1724
|
+
defaultValue: NumberWithUnitFieldValue.or(ComputedDefaultValue).optional(),
|
|
1637
1725
|
options: import_v43.default.array(SelectOption).describe("A list of options for the unit select"),
|
|
1638
1726
|
configuration: import_v43.default.object({
|
|
1639
1727
|
min: import_v43.default.number().optional().describe("Minimum value of the number field"),
|
|
@@ -1642,17 +1730,23 @@ var NumberWithUnitField = BaseField.extend({
|
|
|
1642
1730
|
"Placeholder for the number field"
|
|
1643
1731
|
)
|
|
1644
1732
|
}).optional()
|
|
1645
|
-
}).
|
|
1733
|
+
}).meta({
|
|
1734
|
+
description: "A number with unit input field",
|
|
1735
|
+
id: "NumberWithUnitField"
|
|
1736
|
+
});
|
|
1646
1737
|
var RadioGroup = BaseField.extend({
|
|
1647
1738
|
type: import_v43.default.literal(FieldType.RADIO_GROUP),
|
|
1648
|
-
defaultValue: TextValue.optional(),
|
|
1739
|
+
defaultValue: TextValue.or(ComputedDefaultValue).optional(),
|
|
1649
1740
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
1650
1741
|
configuration: import_v43.default.object({
|
|
1651
1742
|
styles: import_v43.default.object({
|
|
1652
1743
|
size: import_v43.default.enum(["NORMAL", "LARGE"]).optional()
|
|
1653
1744
|
}).optional()
|
|
1654
1745
|
}).optional()
|
|
1655
|
-
}).
|
|
1746
|
+
}).meta({
|
|
1747
|
+
description: "A grouped radio button field",
|
|
1748
|
+
id: "RadioGroup"
|
|
1749
|
+
});
|
|
1656
1750
|
var BulletList = BaseField.extend({
|
|
1657
1751
|
type: import_v43.default.literal(FieldType.BULLET_LIST),
|
|
1658
1752
|
items: import_v43.default.array(TranslationConfig).describe("A list of items"),
|
|
@@ -1661,10 +1755,13 @@ var BulletList = BaseField.extend({
|
|
|
1661
1755
|
fontVariant: HtmlFontVariant.optional()
|
|
1662
1756
|
}).optional()
|
|
1663
1757
|
}).default({})
|
|
1664
|
-
}).
|
|
1758
|
+
}).meta({
|
|
1759
|
+
description: "A list of bullet points",
|
|
1760
|
+
id: "BulletList"
|
|
1761
|
+
});
|
|
1665
1762
|
var Select = BaseField.extend({
|
|
1666
1763
|
type: import_v43.default.literal(FieldType.SELECT),
|
|
1667
|
-
defaultValue: TextValue.optional(),
|
|
1764
|
+
defaultValue: TextValue.or(ComputedDefaultValue).optional(),
|
|
1668
1765
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
1669
1766
|
noOptionsMessage: TranslationConfig.optional().describe(
|
|
1670
1767
|
`
|
|
@@ -1676,16 +1773,22 @@ var Select = BaseField.extend({
|
|
|
1676
1773
|
{ ..., defaultMessage: "'{input}' is not listed among the health facilities." }
|
|
1677
1774
|
`
|
|
1678
1775
|
)
|
|
1679
|
-
}).
|
|
1776
|
+
}).meta({
|
|
1777
|
+
description: "A select input field",
|
|
1778
|
+
id: "Select"
|
|
1779
|
+
});
|
|
1680
1780
|
var SelectDateRangeOption = import_v43.default.object({
|
|
1681
1781
|
value: SelectDateRangeValue.describe("The value of the option"),
|
|
1682
1782
|
label: TranslationConfig.describe("The label of the option")
|
|
1683
1783
|
});
|
|
1684
1784
|
var SelectDateRangeField = BaseField.extend({
|
|
1685
1785
|
type: import_v43.default.literal(FieldType.SELECT_DATE_RANGE),
|
|
1686
|
-
defaultValue: SelectDateRangeValue.optional(),
|
|
1786
|
+
defaultValue: SelectDateRangeValue.or(ComputedDefaultValue).optional(),
|
|
1687
1787
|
options: import_v43.default.array(SelectDateRangeOption).describe("A list of options")
|
|
1688
|
-
}).
|
|
1788
|
+
}).meta({
|
|
1789
|
+
description: "A date range selection field",
|
|
1790
|
+
id: "SelectDateRangeField"
|
|
1791
|
+
});
|
|
1689
1792
|
var NameConfig = import_v43.default.object({
|
|
1690
1793
|
firstname: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
1691
1794
|
middlename: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
@@ -1697,7 +1800,7 @@ var NameField = BaseField.extend({
|
|
|
1697
1800
|
firstname: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
1698
1801
|
middlename: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
1699
1802
|
surname: SerializedUserField.or(NonEmptyTextValue).optional()
|
|
1700
|
-
}).optional(),
|
|
1803
|
+
}).or(ComputedDefaultValue).optional(),
|
|
1701
1804
|
configuration: import_v43.default.object({
|
|
1702
1805
|
name: NameConfig.default({
|
|
1703
1806
|
firstname: { required: true },
|
|
@@ -1716,26 +1819,41 @@ var NameField = BaseField.extend({
|
|
|
1716
1819
|
surname: { required: true }
|
|
1717
1820
|
}
|
|
1718
1821
|
}).optional()
|
|
1719
|
-
}).
|
|
1822
|
+
}).meta({
|
|
1823
|
+
description: "A field for entering a persons name",
|
|
1824
|
+
id: "NameField"
|
|
1825
|
+
});
|
|
1720
1826
|
var PhoneField = BaseField.extend({
|
|
1721
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1827
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1722
1828
|
type: import_v43.default.literal(FieldType.PHONE)
|
|
1723
|
-
}).
|
|
1829
|
+
}).meta({
|
|
1830
|
+
description: "A field for entering a phone number",
|
|
1831
|
+
id: "PhoneField"
|
|
1832
|
+
});
|
|
1724
1833
|
var IdField = BaseField.extend({
|
|
1725
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1834
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1726
1835
|
type: import_v43.default.literal(FieldType.ID)
|
|
1727
|
-
}).
|
|
1836
|
+
}).meta({
|
|
1837
|
+
description: "A field for entering an ID",
|
|
1838
|
+
id: "IdField"
|
|
1839
|
+
});
|
|
1728
1840
|
var Checkbox = BaseField.extend({
|
|
1729
1841
|
type: import_v43.default.literal(FieldType.CHECKBOX),
|
|
1730
|
-
defaultValue: CheckboxFieldValue.default(false)
|
|
1731
|
-
}).
|
|
1842
|
+
defaultValue: CheckboxFieldValue.or(ComputedDefaultValue).default(false)
|
|
1843
|
+
}).meta({
|
|
1844
|
+
description: "A boolean checkbox field",
|
|
1845
|
+
id: "Checkbox"
|
|
1846
|
+
});
|
|
1732
1847
|
var Country = BaseField.extend({
|
|
1733
1848
|
type: import_v43.default.literal(FieldType.COUNTRY),
|
|
1734
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1849
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1735
1850
|
optionOverrides: import_v43.default.array(SelectOption.omit({ label: true })).optional().describe(
|
|
1736
1851
|
"Conditionals for specific countries. Countries not listed are always shown and enabled."
|
|
1737
1852
|
)
|
|
1738
|
-
}).
|
|
1853
|
+
}).meta({
|
|
1854
|
+
description: "A field for selecting a country",
|
|
1855
|
+
id: "Country"
|
|
1856
|
+
});
|
|
1739
1857
|
var AllowedLocations = JurisdictionReference.optional().describe(
|
|
1740
1858
|
"Limits which location options are selectable depending on user jurisdiction and location."
|
|
1741
1859
|
);
|
|
@@ -1744,28 +1862,33 @@ var AdministrativeAreas = import_v43.default.enum([
|
|
|
1744
1862
|
"HEALTH_FACILITY",
|
|
1745
1863
|
"CRVS_OFFICE"
|
|
1746
1864
|
]);
|
|
1747
|
-
var AdministrativeAreaConfiguration = import_v43.default.object({
|
|
1748
|
-
partOf: FieldReference.optional().describe("Parent location"),
|
|
1749
|
-
type: AdministrativeAreas,
|
|
1750
|
-
allowedLocations: AllowedLocations
|
|
1751
|
-
}).describe("Administrative area options");
|
|
1752
1865
|
var AdministrativeAreaField = BaseField.extend({
|
|
1753
1866
|
type: import_v43.default.literal(FieldType.ADMINISTRATIVE_AREA),
|
|
1754
|
-
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1755
|
-
configuration:
|
|
1756
|
-
|
|
1867
|
+
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
1868
|
+
configuration: import_v43.default.object({
|
|
1869
|
+
partOf: FieldReference.optional().describe("Parent location"),
|
|
1870
|
+
type: AdministrativeAreas,
|
|
1871
|
+
allowedLocations: AllowedLocations
|
|
1872
|
+
}).describe("Administrative area options")
|
|
1873
|
+
}).meta({
|
|
1874
|
+
description: "Administrative area input field",
|
|
1875
|
+
id: "AdministrativeAreaField"
|
|
1876
|
+
});
|
|
1757
1877
|
var LocationInput = BaseField.extend({
|
|
1758
1878
|
type: import_v43.default.literal(FieldType.LOCATION),
|
|
1759
|
-
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1879
|
+
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
1760
1880
|
configuration: import_v43.default.object({
|
|
1761
1881
|
locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
|
|
1762
1882
|
allowedLocations: AllowedLocations
|
|
1763
1883
|
}).optional()
|
|
1764
|
-
}).
|
|
1884
|
+
}).meta({
|
|
1885
|
+
description: "A field for selecting a location",
|
|
1886
|
+
id: "LocationInput"
|
|
1887
|
+
});
|
|
1765
1888
|
var FileUploadWithOptions = BaseField.extend({
|
|
1766
1889
|
type: import_v43.default.literal(FieldType.FILE_WITH_OPTIONS),
|
|
1767
1890
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
1768
|
-
defaultValue: FileFieldWithOptionValue.optional(),
|
|
1891
|
+
defaultValue: FileFieldWithOptionValue.or(ComputedDefaultValue).optional(),
|
|
1769
1892
|
configuration: import_v43.default.object({
|
|
1770
1893
|
maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1771
1894
|
maxImageSize: import_v43.default.object({
|
|
@@ -1775,15 +1898,18 @@ var FileUploadWithOptions = BaseField.extend({
|
|
|
1775
1898
|
}).default({
|
|
1776
1899
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1777
1900
|
})
|
|
1901
|
+
}).meta({
|
|
1902
|
+
description: "A field for uploading files with file type options",
|
|
1903
|
+
id: "FileUploadWithOptions"
|
|
1778
1904
|
});
|
|
1779
1905
|
var Facility = BaseField.extend({
|
|
1780
1906
|
type: import_v43.default.literal(FieldType.FACILITY),
|
|
1781
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1907
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1782
1908
|
configuration: import_v43.default.object({ allowedLocations: AllowedLocations }).optional()
|
|
1783
1909
|
}).describe("Input field for a facility");
|
|
1784
1910
|
var Office = BaseField.extend({
|
|
1785
1911
|
type: import_v43.default.literal(FieldType.OFFICE),
|
|
1786
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1912
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1787
1913
|
configuration: import_v43.default.object({ allowedLocations: AllowedLocations }).optional()
|
|
1788
1914
|
}).describe("Input field for an office");
|
|
1789
1915
|
var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
|
|
@@ -1819,8 +1945,11 @@ var Address = BaseField.extend({
|
|
|
1819
1945
|
).optional(),
|
|
1820
1946
|
allowedLocations: AllowedLocations
|
|
1821
1947
|
}).optional(),
|
|
1822
|
-
defaultValue: DefaultAddressFieldValue.optional()
|
|
1823
|
-
}).
|
|
1948
|
+
defaultValue: DefaultAddressFieldValue.or(ComputedDefaultValue).optional()
|
|
1949
|
+
}).meta({
|
|
1950
|
+
description: "Address input field \u2013 a combination of location and text fields",
|
|
1951
|
+
id: "Address"
|
|
1952
|
+
});
|
|
1824
1953
|
var StaticDataEntry = import_v43.default.object({
|
|
1825
1954
|
id: import_v43.default.string().describe("ID for the data entry."),
|
|
1826
1955
|
label: TranslationConfig,
|
|
@@ -1835,7 +1964,10 @@ var DataField = BaseField.extend({
|
|
|
1835
1964
|
subtitle: TranslationConfig.optional(),
|
|
1836
1965
|
data: import_v43.default.array(DataEntry)
|
|
1837
1966
|
})
|
|
1838
|
-
}).
|
|
1967
|
+
}).meta({
|
|
1968
|
+
description: "A field for displaying a table of read-only data",
|
|
1969
|
+
id: "DataField"
|
|
1970
|
+
});
|
|
1839
1971
|
var ButtonSize = import_v43.default.enum(["small", "medium", "large"]);
|
|
1840
1972
|
var ButtonType = import_v43.default.enum([
|
|
1841
1973
|
"primary",
|
|
@@ -1860,13 +1992,19 @@ var ButtonConfiguration = import_v43.default.object({
|
|
|
1860
1992
|
});
|
|
1861
1993
|
var ButtonField = BaseField.extend({
|
|
1862
1994
|
type: import_v43.default.literal(FieldType.BUTTON),
|
|
1863
|
-
defaultValue: ButtonFieldValue.optional(),
|
|
1995
|
+
defaultValue: ButtonFieldValue.or(ComputedDefaultValue).optional(),
|
|
1864
1996
|
configuration: ButtonConfiguration
|
|
1865
|
-
}).
|
|
1997
|
+
}).meta({
|
|
1998
|
+
description: "A generic button that can be used to trigger an action",
|
|
1999
|
+
id: "ButtonField"
|
|
2000
|
+
});
|
|
1866
2001
|
var FieldGroup = BaseField.extend({
|
|
1867
2002
|
type: import_v43.default.literal(FieldType.FIELD_GROUP),
|
|
1868
2003
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
1869
2004
|
fields: import_v43.default.lazy(() => import_v43.default.array(FieldConfig))
|
|
2005
|
+
}).meta({
|
|
2006
|
+
description: "A group of fields that are displayed together",
|
|
2007
|
+
id: "FieldGroup"
|
|
1870
2008
|
});
|
|
1871
2009
|
var AlphaPrintButton = BaseField.extend({
|
|
1872
2010
|
type: import_v43.default.literal(FieldType.ALPHA_PRINT_BUTTON),
|
|
@@ -1876,10 +2014,13 @@ var AlphaPrintButton = BaseField.extend({
|
|
|
1876
2014
|
"Label for the print button"
|
|
1877
2015
|
)
|
|
1878
2016
|
})
|
|
1879
|
-
}).
|
|
2017
|
+
}).meta({
|
|
2018
|
+
description: "An experimental print button field for printing certificates during the declaration process",
|
|
2019
|
+
id: "AlphaPrintButton"
|
|
2020
|
+
});
|
|
1880
2021
|
var HttpField = BaseField.extend({
|
|
1881
2022
|
type: import_v43.default.literal(FieldType.HTTP),
|
|
1882
|
-
defaultValue: HttpFieldValue.optional(),
|
|
2023
|
+
defaultValue: HttpFieldValue.or(ComputedDefaultValue).optional(),
|
|
1883
2024
|
configuration: import_v43.default.object({
|
|
1884
2025
|
trigger: FieldReference.optional().describe(
|
|
1885
2026
|
"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."
|
|
@@ -1892,20 +2033,30 @@ var HttpField = BaseField.extend({
|
|
|
1892
2033
|
params: import_v43.default.record(import_v43.default.string(), import_v43.default.union([import_v43.default.string(), FieldReference])).optional(),
|
|
1893
2034
|
timeout: import_v43.default.number().default(15e3).describe("Request timeout in milliseconds")
|
|
1894
2035
|
})
|
|
1895
|
-
}).
|
|
2036
|
+
}).meta({
|
|
2037
|
+
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.",
|
|
2038
|
+
id: "HttpField"
|
|
2039
|
+
});
|
|
1896
2040
|
var AutocompleteField = BaseField.extend({
|
|
1897
2041
|
type: import_v43.default.literal(FieldType.AUTOCOMPLETE),
|
|
1898
2042
|
configuration: import_v43.default.object({
|
|
1899
|
-
url: import_v43.default.string().describe(
|
|
2043
|
+
url: import_v43.default.string().describe(
|
|
2044
|
+
"URL to fetch autocomplete suggestions from. This should be a country config server endpoint."
|
|
2045
|
+
).optional(),
|
|
1900
2046
|
method: import_v43.default.enum(["GET", "POST"]).default("GET").optional(),
|
|
1901
2047
|
defaultOptions: import_v43.default.array(
|
|
1902
2048
|
import_v43.default.object({
|
|
1903
2049
|
label: import_v43.default.string(),
|
|
1904
2050
|
value: import_v43.default.string()
|
|
1905
2051
|
})
|
|
1906
|
-
).optional()
|
|
2052
|
+
).optional().describe(
|
|
2053
|
+
"Manual entry is supported through configuration, allowing users to provide values not currently represented in the dataset."
|
|
2054
|
+
)
|
|
1907
2055
|
})
|
|
1908
|
-
}).
|
|
2056
|
+
}).meta({
|
|
2057
|
+
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.",
|
|
2058
|
+
id: "AutocompleteField"
|
|
2059
|
+
});
|
|
1909
2060
|
var SearchField = HttpField.extend({
|
|
1910
2061
|
type: import_v43.default.literal(FieldType.SEARCH),
|
|
1911
2062
|
configuration: SearchQuery.pick({
|
|
@@ -1938,6 +2089,9 @@ var SearchField = HttpField.extend({
|
|
|
1938
2089
|
ok: TranslationConfig.optional()
|
|
1939
2090
|
}).optional()
|
|
1940
2091
|
})
|
|
2092
|
+
}).meta({
|
|
2093
|
+
description: "A search input field",
|
|
2094
|
+
id: "SearchField"
|
|
1941
2095
|
});
|
|
1942
2096
|
var LinkButtonField = BaseField.extend({
|
|
1943
2097
|
type: import_v43.default.literal(FieldType.LINK_BUTTON),
|
|
@@ -1946,28 +2100,35 @@ var LinkButtonField = BaseField.extend({
|
|
|
1946
2100
|
text: TranslationConfig.describe("Text to display on the button"),
|
|
1947
2101
|
icon: import_v43.default.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit.")
|
|
1948
2102
|
})
|
|
1949
|
-
}).
|
|
2103
|
+
}).meta({
|
|
2104
|
+
description: "A button that opens a URL link",
|
|
2105
|
+
id: "LinkButtonField"
|
|
2106
|
+
});
|
|
1950
2107
|
var VerificationStatus = BaseField.extend({
|
|
1951
2108
|
type: import_v43.default.literal(FieldType.VERIFICATION_STATUS),
|
|
1952
|
-
defaultValue: VerificationStatusValue.optional(),
|
|
2109
|
+
defaultValue: VerificationStatusValue.or(ComputedDefaultValue).optional(),
|
|
1953
2110
|
configuration: import_v43.default.object({
|
|
1954
2111
|
status: TranslationConfig.describe("Text to display on the status pill."),
|
|
1955
2112
|
description: TranslationConfig.describe(
|
|
1956
2113
|
"Explaining text on the banner in form."
|
|
1957
2114
|
)
|
|
1958
2115
|
})
|
|
2116
|
+
}).meta({
|
|
2117
|
+
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.",
|
|
2118
|
+
id: "VerificationStatus"
|
|
1959
2119
|
});
|
|
1960
2120
|
var QueryParamReaderField = BaseField.extend({
|
|
1961
2121
|
type: import_v43.default.literal(FieldType.QUERY_PARAM_READER),
|
|
1962
2122
|
configuration: import_v43.default.object({
|
|
1963
2123
|
pickParams: import_v43.default.array(import_v43.default.string()).describe("List of query parameters to read from the URL")
|
|
1964
2124
|
})
|
|
1965
|
-
}).
|
|
1966
|
-
"A field that maps URL query params into form values and clears them afterward"
|
|
1967
|
-
|
|
2125
|
+
}).meta({
|
|
2126
|
+
description: "A field that maps URL query params into form values and clears them afterward",
|
|
2127
|
+
id: "QueryParamReaderField"
|
|
2128
|
+
});
|
|
1968
2129
|
var QrReaderField = BaseField.extend({
|
|
1969
2130
|
type: import_v43.default.literal(FieldType.QR_READER),
|
|
1970
|
-
defaultValue: QrReaderFieldValue.optional(),
|
|
2131
|
+
defaultValue: QrReaderFieldValue.or(ComputedDefaultValue).optional(),
|
|
1971
2132
|
configuration: import_v43.default.object({
|
|
1972
2133
|
validator: import_v43.default.any().meta({
|
|
1973
2134
|
description: "JSON Schema to validate the scanned QR code data against before populating the form fields.",
|
|
@@ -1975,21 +2136,27 @@ var QrReaderField = BaseField.extend({
|
|
|
1975
2136
|
})
|
|
1976
2137
|
}).optional()
|
|
1977
2138
|
}).meta({
|
|
1978
|
-
description: "
|
|
2139
|
+
description: "QR code reader field, including optional JSON Schema validator.",
|
|
1979
2140
|
id: "QrReaderField"
|
|
1980
2141
|
});
|
|
1981
2142
|
var IdReaderField = BaseField.extend({
|
|
1982
2143
|
type: import_v43.default.literal(FieldType.ID_READER),
|
|
1983
|
-
defaultValue: IdReaderFieldValue.optional(),
|
|
2144
|
+
defaultValue: IdReaderFieldValue.or(ComputedDefaultValue).optional(),
|
|
1984
2145
|
methods: import_v43.default.array(
|
|
1985
2146
|
import_v43.default.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
|
|
1986
2147
|
)
|
|
2148
|
+
}).meta({
|
|
2149
|
+
description: "A wrapper around nested form fields, specifically QR_READER and LINK_BUTTON. It can hold the QR_READERs value.",
|
|
2150
|
+
id: "IdReaderField"
|
|
1987
2151
|
});
|
|
1988
2152
|
var CustomField = BaseField.extend({
|
|
1989
2153
|
type: import_v43.default.literal(FieldType._EXPERIMENTAL_CUSTOM),
|
|
1990
2154
|
defaultValue: CustomFieldValue.optional(),
|
|
1991
2155
|
src: import_v43.default.string().describe("Module source path for the custom field component"),
|
|
1992
2156
|
configuration: import_v43.default.unknown().optional()
|
|
2157
|
+
}).meta({
|
|
2158
|
+
description: "An expiremental custom field that is defined by a module source path",
|
|
2159
|
+
id: "CustomField"
|
|
1993
2160
|
});
|
|
1994
2161
|
var FieldStyleVariant = import_v43.default.enum(["default", "highlighted"]);
|
|
1995
2162
|
var LoaderField = BaseField.extend({
|
|
@@ -1999,22 +2166,25 @@ var LoaderField = BaseField.extend({
|
|
|
1999
2166
|
configuration: import_v43.default.object({
|
|
2000
2167
|
text: TranslationConfig.describe("Display text above the loading spinner")
|
|
2001
2168
|
})
|
|
2002
|
-
}).
|
|
2003
|
-
"A non-interactive field that indicates an in progress operation in form"
|
|
2004
|
-
|
|
2169
|
+
}).meta({
|
|
2170
|
+
description: "A non-interactive field that indicates an in progress operation in form",
|
|
2171
|
+
id: "LoaderField"
|
|
2172
|
+
});
|
|
2005
2173
|
var HiddenField = BaseField.extend({
|
|
2006
2174
|
type: import_v43.default.literal(FieldType.ALPHA_HIDDEN),
|
|
2007
2175
|
required: import_v43.default.boolean().default(false).optional(),
|
|
2008
2176
|
defaultValue: TextValue.optional()
|
|
2009
|
-
}).
|
|
2010
|
-
"A non-interactive, hidden field that only hold a value in the form"
|
|
2011
|
-
|
|
2177
|
+
}).meta({
|
|
2178
|
+
description: "A non-interactive, hidden field that only hold a value in the form",
|
|
2179
|
+
id: "HiddenField"
|
|
2180
|
+
});
|
|
2012
2181
|
var UserRoleField = BaseField.extend({
|
|
2013
2182
|
type: import_v43.default.literal(FieldType.USER_ROLE),
|
|
2014
2183
|
defaultValue: TextValue.optional()
|
|
2015
|
-
}).
|
|
2016
|
-
"A select dropdown that is automatically populated with available user roles"
|
|
2017
|
-
|
|
2184
|
+
}).meta({
|
|
2185
|
+
description: "A select dropdown that is automatically populated with available user roles",
|
|
2186
|
+
id: "UserRoleField"
|
|
2187
|
+
});
|
|
2018
2188
|
var FieldConfig = import_v43.default.discriminatedUnion("type", [
|
|
2019
2189
|
FieldGroup,
|
|
2020
2190
|
Address,
|
|
@@ -2132,6 +2302,7 @@ var ClientConfig = z20.object({
|
|
|
2132
2302
|
COUNTRY: z20.string(),
|
|
2133
2303
|
LANGUAGES: z20.array(z20.string()),
|
|
2134
2304
|
SENTRY: z20.string().optional(),
|
|
2305
|
+
LOGIN_URL: z20.string().optional(),
|
|
2135
2306
|
REGISTER_BACKGROUND: BackgroundConfig,
|
|
2136
2307
|
DASHBOARDS: z20.array(
|
|
2137
2308
|
z20.object({
|