@opencrvs/toolkit 2.0.0-rc.bee2b7b → 2.0.0-rc.bf9a757
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 +280 -133
- package/dist/cli.js +1945 -363
- package/dist/commons/api/router.d.ts +3401 -269
- 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/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 +21 -0
- 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 +66 -12
- package/dist/events/index.js +1021 -265
- 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 +63 -39
- package/dist/migrations/v2.0/add-resend-invite-notification.d.ts +3 -0
- package/dist/migrations/v2.0/add-resend-invite-notification.d.ts.map +1 -0
- package/dist/migrations/v2.0/add-resend-invite-notification.js +373 -0
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts +19 -0
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
- package/dist/migrations/v2.0/checkout-upstream-files.js +17 -14
- package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts.map +1 -1
- package/dist/migrations/v2.0/convert-config-files-to-ts.js +4 -5
- package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts.map +1 -1
- package/dist/migrations/v2.0/convert-paragraph-to-heading.js +4 -5
- package/dist/migrations/v2.0/create-events-index.d.ts.map +1 -1
- package/dist/migrations/v2.0/create-events-index.js +1 -2
- package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts +11 -0
- package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts.map +1 -0
- package/dist/migrations/v2.0/delete-infrastructure-directory.js +123 -0
- 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 +10 -4
- package/dist/migrations/v2.0/index.d.ts.map +1 -1
- package/dist/migrations/v2.0/index.js +1913 -360
- 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 +95 -7
- package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts +13 -0
- package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts.map +1 -0
- package/dist/migrations/v2.0/merge-infrastructure-directory.js +222 -0
- package/dist/migrations/v2.0/migrate-application-config-url.d.ts +3 -0
- package/dist/migrations/v2.0/migrate-application-config-url.d.ts.map +1 -0
- package/dist/migrations/v2.0/migrate-application-config-url.js +342 -0
- package/dist/migrations/v2.0/migrate-scopes.d.ts.map +1 -1
- package/dist/migrations/v2.0/migrate-scopes.js +55 -32
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts.map +1 -1
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.js +3 -4
- package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts.map +1 -1
- package/dist/migrations/v2.0/migrate-workqueue-configs.js +143 -63
- package/dist/migrations/v2.0/remove-delete-actions.d.ts.map +1 -1
- package/dist/migrations/v2.0/remove-delete-actions.js +3 -4
- package/dist/migrations/v2.0/remove-demo-scope.d.ts.map +1 -1
- package/dist/migrations/v2.0/remove-demo-scope.js +2 -3
- package/dist/migrations/v2.0/remove-deprecated-imports.d.ts.map +1 -1
- package/dist/migrations/v2.0/remove-deprecated-imports.js +3 -4
- package/dist/migrations/v2.0/remove-fhir-url-helpers.d.ts +3 -0
- package/dist/migrations/v2.0/remove-fhir-url-helpers.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-fhir-url-helpers.js +163 -0
- package/dist/migrations/v2.0/remove-hearth-migrations.d.ts.map +1 -1
- package/dist/migrations/v2.0/remove-hearth-migrations.js +1 -2
- package/dist/migrations/v2.0/remove-old-statistics-service.d.ts +3 -0
- package/dist/migrations/v2.0/remove-old-statistics-service.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-old-statistics-service.js +356 -0
- package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts.map +1 -1
- package/dist/migrations/v2.0/remove-pending-certification-flag.js +3 -4
- package/dist/migrations/v2.0/remove-review-from-register-action.d.ts.map +1 -1
- package/dist/migrations/v2.0/remove-review-from-register-action.js +3 -4
- package/dist/migrations/v2.0/remove-unused-environment-variables.d.ts +3 -0
- package/dist/migrations/v2.0/remove-unused-environment-variables.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-unused-environment-variables.js +186 -0
- package/dist/migrations/v2.0/rename-api-paths.d.ts.map +1 -1
- package/dist/migrations/v2.0/rename-api-paths.js +3 -4
- package/dist/migrations/v2.0/rename-location-parent-id.d.ts.map +1 -1
- package/dist/migrations/v2.0/rename-location-parent-id.js +3 -4
- package/dist/migrations/v2.0/simplify-analytics-precalculations.d.ts.map +1 -1
- package/dist/migrations/v2.0/simplify-analytics-precalculations.js +1 -2
- package/dist/migrations/v2.0/update-package-json.d.ts +3 -0
- package/dist/migrations/v2.0/update-package-json.d.ts.map +1 -0
- package/dist/migrations/v2.0/update-package-json.js +105 -0
- package/dist/notification/index.js +816 -164
- package/dist/scopes/index.d.ts +12 -7
- package/dist/scopes/index.js +23 -14
- package/opencrvs-toolkit-2.0.0-rc.bf9a757.tgz +0 -0
- package/package.json +6 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/opencrvs-toolkit-2.0.0-rc.bee2b7b.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
|
|
@@ -321,7 +324,7 @@ var PlainDate = import_zod.z.string().date().brand("PlainDate").describe("Date i
|
|
|
321
324
|
// ../commons/src/events/FieldValue.ts
|
|
322
325
|
var TextValue = z7.string();
|
|
323
326
|
var HiddenFieldValue = z7.string();
|
|
324
|
-
var NonEmptyTextValue =
|
|
327
|
+
var NonEmptyTextValue = z7.string().trim().min(1);
|
|
325
328
|
var DateValue = z7.iso.date().describe("Date in the format YYYY-MM-DD");
|
|
326
329
|
var AgeValue = z7.object({
|
|
327
330
|
age: z7.number(),
|
|
@@ -350,6 +353,7 @@ var DateRangeFieldValue = z7.object({
|
|
|
350
353
|
var EmailValue = z7.email();
|
|
351
354
|
var CheckboxFieldValue = z7.boolean();
|
|
352
355
|
var NumberFieldValue = z7.number();
|
|
356
|
+
var SignatureFieldValue = FileFieldValue;
|
|
353
357
|
var ButtonFieldValue = z7.number();
|
|
354
358
|
var VerificationStatusValue = z7.enum([
|
|
355
359
|
"verified",
|
|
@@ -418,28 +422,20 @@ function schemaPriority(schema) {
|
|
|
418
422
|
return idx === -1 ? 9999 : idx;
|
|
419
423
|
}
|
|
420
424
|
function safeUnion(schemas) {
|
|
425
|
+
const sortedSchemas = [...schemas].sort(
|
|
426
|
+
(a, b) => schemaPriority(a) - schemaPriority(b)
|
|
427
|
+
);
|
|
421
428
|
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
|
-
});
|
|
429
|
+
for (const schema of sortedSchemas) {
|
|
430
|
+
if (schema.safeParse(val).success) {
|
|
431
|
+
return;
|
|
432
|
+
}
|
|
442
433
|
}
|
|
434
|
+
ctx.addIssue({
|
|
435
|
+
code: "invalid_type",
|
|
436
|
+
expected: "custom",
|
|
437
|
+
message: "Value does not match any schema"
|
|
438
|
+
});
|
|
443
439
|
}).meta({
|
|
444
440
|
description: "Value that matches exactly one of the possible schema types (TextValue, DateValue, DateRangeFieldValue). The best matching schema is chosen by priority."
|
|
445
441
|
});
|
|
@@ -683,6 +679,9 @@ var CustomActionScopeOptions = AllRecordScopeOptions.extend({
|
|
|
683
679
|
var AccessLevelOptions = z11.object({
|
|
684
680
|
accessLevel: JurisdictionFilter.optional()
|
|
685
681
|
});
|
|
682
|
+
var AllUserScopeOptions = AccessLevelOptions.extend({
|
|
683
|
+
role: userRole.optional()
|
|
684
|
+
});
|
|
686
685
|
var WorkqueueOrDashboardOptions = z11.object({
|
|
687
686
|
ids: z11.preprocess(
|
|
688
687
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
@@ -692,6 +691,7 @@ var WorkqueueOrDashboardOptions = z11.object({
|
|
|
692
691
|
var AllScopeOptions = z11.object({
|
|
693
692
|
...AllRecordScopeOptions.shape,
|
|
694
693
|
...AccessLevelOptions.shape,
|
|
694
|
+
...AllUserScopeOptions.shape,
|
|
695
695
|
...WorkqueueOrDashboardOptions.shape
|
|
696
696
|
});
|
|
697
697
|
var ScopeOptionKey = AllScopeOptions.keyof();
|
|
@@ -768,27 +768,24 @@ var SystemScopeType = z11.enum([
|
|
|
768
768
|
"organisation.read-locations",
|
|
769
769
|
"user.read",
|
|
770
770
|
"user.create",
|
|
771
|
-
"user.edit"
|
|
771
|
+
"user.edit",
|
|
772
|
+
"user.search"
|
|
772
773
|
]);
|
|
773
774
|
var UserScopeType = SystemScopeType.extract([
|
|
774
775
|
"user.read",
|
|
775
776
|
"user.create",
|
|
776
|
-
"user.edit"
|
|
777
|
+
"user.edit",
|
|
778
|
+
"user.search"
|
|
777
779
|
]);
|
|
778
780
|
var ScopesWithRoleOption = UserScopeType.extract(["user.edit", "user.create"]);
|
|
779
781
|
var UserScopeV2 = z11.discriminatedUnion("type", [
|
|
780
782
|
z11.object({
|
|
781
783
|
type: ScopesWithRoleOption,
|
|
782
|
-
options:
|
|
783
|
-
accessLevel: JurisdictionFilter.optional(),
|
|
784
|
-
role: userRole.optional()
|
|
785
|
-
}).optional()
|
|
784
|
+
options: AllUserScopeOptions.optional()
|
|
786
785
|
}),
|
|
787
786
|
z11.object({
|
|
788
|
-
type: UserScopeType.extract(["user.read"]),
|
|
789
|
-
options:
|
|
790
|
-
accessLevel: JurisdictionFilter.optional()
|
|
791
|
-
}).optional()
|
|
787
|
+
type: UserScopeType.extract(["user.read", "user.search"]),
|
|
788
|
+
options: AccessLevelOptions.optional()
|
|
792
789
|
})
|
|
793
790
|
]);
|
|
794
791
|
var ResolvedRecordScopeV2 = z11.discriminatedUnion("type", [
|
|
@@ -838,7 +835,9 @@ var ScopeType = z11.enum([
|
|
|
838
835
|
var EncodedScope = z11.string().brand("EncodedScope");
|
|
839
836
|
var DEFAULT_SCOPE_OPTIONS = {
|
|
840
837
|
placeOfEvent: JurisdictionFilter.enum.all,
|
|
841
|
-
accessLevel: JurisdictionFilter.enum.all
|
|
838
|
+
accessLevel: JurisdictionFilter.enum.all,
|
|
839
|
+
registeredIn: JurisdictionFilter.enum.all,
|
|
840
|
+
declaredIn: JurisdictionFilter.enum.all
|
|
842
841
|
};
|
|
843
842
|
|
|
844
843
|
// ../commons/src/authentication.ts
|
|
@@ -991,8 +990,9 @@ var RequestedCorrectionAction = ActionBase.extend(
|
|
|
991
990
|
var ApprovedCorrectionAction = ActionBase.extend(
|
|
992
991
|
z13.object({
|
|
993
992
|
type: z13.literal(ActionType.APPROVE_CORRECTION),
|
|
994
|
-
requestId: z13.string()
|
|
993
|
+
requestId: z13.string(),
|
|
995
994
|
// TODO move into 'content' property
|
|
995
|
+
content: z13.object({ immediateCorrection: z13.boolean().optional() }).optional()
|
|
996
996
|
}).shape
|
|
997
997
|
);
|
|
998
998
|
var RejectedCorrectionAction = ActionBase.extend(
|
|
@@ -1084,6 +1084,9 @@ var FlagConfig = z14.object({
|
|
|
1084
1084
|
"Indicates if this flag expects an action to be performed to be cleared."
|
|
1085
1085
|
),
|
|
1086
1086
|
label: TranslationConfig.describe("Human readable label of the flag.")
|
|
1087
|
+
}).meta({
|
|
1088
|
+
id: "FlagConfig",
|
|
1089
|
+
description: "Configuration for a custom flag that can be added to or removed from records by event actions."
|
|
1087
1090
|
});
|
|
1088
1091
|
var ActionFlagConfig = z14.object({
|
|
1089
1092
|
id: Flag,
|
|
@@ -1091,6 +1094,9 @@ var ActionFlagConfig = z14.object({
|
|
|
1091
1094
|
conditional: Conditional.optional().describe(
|
|
1092
1095
|
"When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
|
|
1093
1096
|
)
|
|
1097
|
+
}).meta({
|
|
1098
|
+
id: "ActionFlagConfig",
|
|
1099
|
+
description: "Add or remove operation applied to a flag when the parent action is accepted. Optionally gated by a conditional."
|
|
1094
1100
|
});
|
|
1095
1101
|
|
|
1096
1102
|
// ../commons/src/events/EventMetadata.ts
|
|
@@ -1112,8 +1118,7 @@ var ActionCreationMetadata = z15.object({
|
|
|
1112
1118
|
),
|
|
1113
1119
|
createdByUserType: z15.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1114
1120
|
acceptedAt: z15.iso.datetime().describe("Timestamp when the action request was accepted."),
|
|
1115
|
-
createdByRole: z15.string().optional().describe("Role of the user at the time of action request creation.")
|
|
1116
|
-
createdBySignature: z15.string().nullish().describe("Signature of the user who created the action request.")
|
|
1121
|
+
createdByRole: z15.string().optional().describe("Role of the user at the time of action request creation.")
|
|
1117
1122
|
});
|
|
1118
1123
|
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
1119
1124
|
registrationNumber: z15.string().describe(
|
|
@@ -1141,9 +1146,6 @@ var EventMetadata = z15.object({
|
|
|
1141
1146
|
createdAtLocation: UUID.nullish().describe(
|
|
1142
1147
|
"Location of the user who created the event."
|
|
1143
1148
|
),
|
|
1144
|
-
createdBySignature: DocumentPath.nullish().describe(
|
|
1145
|
-
"Signature of the user who created the event."
|
|
1146
|
-
),
|
|
1147
1149
|
updatedAtLocation: UUID.nullish().describe(
|
|
1148
1150
|
"Location of the user who last changed the status."
|
|
1149
1151
|
),
|
|
@@ -1407,14 +1409,31 @@ var FieldId = import_v43.default.string().superRefine((val, ctx) => {
|
|
|
1407
1409
|
}
|
|
1408
1410
|
}).describe("Unique identifier for the field");
|
|
1409
1411
|
var FieldReference = import_v43.default.object({
|
|
1410
|
-
$$field: FieldId,
|
|
1412
|
+
$$field: FieldId.describe("Id of the field to reference"),
|
|
1411
1413
|
$$subfield: import_v43.default.array(import_v43.default.string()).optional().default([]).describe(
|
|
1412
1414
|
'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
|
|
1415
|
+
),
|
|
1416
|
+
$$code: import_v43.default.string().optional().describe(
|
|
1417
|
+
"Serialised client-side function body. When present the expression is evaluated rather than dereferenced."
|
|
1418
|
+
)
|
|
1419
|
+
}).describe(
|
|
1420
|
+
"Reference to a field value, with an optional client-side computation applied."
|
|
1421
|
+
);
|
|
1422
|
+
var ComputedDefaultValue = import_v43.default.object({
|
|
1423
|
+
$$code: import_v43.default.string().describe(
|
|
1424
|
+
"Serialised client-side function body. Receives (undefined, context) where context includes $now, $online, and system variables."
|
|
1413
1425
|
)
|
|
1414
|
-
}).describe("
|
|
1426
|
+
}).describe("A context-only computation used as a field default value.");
|
|
1415
1427
|
var ValidationConfig = import_v43.default.object({
|
|
1416
|
-
validator: Conditional
|
|
1417
|
-
|
|
1428
|
+
validator: Conditional.describe(
|
|
1429
|
+
"Conditional expression that must hold for the field value to be considered valid."
|
|
1430
|
+
),
|
|
1431
|
+
message: TranslationConfig.describe(
|
|
1432
|
+
"Error message displayed when the validator does not hold."
|
|
1433
|
+
)
|
|
1434
|
+
}).meta({
|
|
1435
|
+
id: "ValidationConfig",
|
|
1436
|
+
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."
|
|
1418
1437
|
});
|
|
1419
1438
|
var requiredSchema = import_v43.default.union([
|
|
1420
1439
|
import_v43.default.boolean(),
|
|
@@ -1445,7 +1464,7 @@ var BaseField = import_v43.default.object({
|
|
|
1445
1464
|
"Indicates whether the field can be modified during record correction."
|
|
1446
1465
|
),
|
|
1447
1466
|
value: FieldReference.or(import_v43.default.array(FieldReference)).optional().describe(
|
|
1448
|
-
"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."
|
|
1467
|
+
"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."
|
|
1449
1468
|
),
|
|
1450
1469
|
analytics: import_v43.default.boolean().default(false).optional().describe(
|
|
1451
1470
|
"Indicates whether the field is included in analytics. When enabled, its value becomes available in the analytics dashboard."
|
|
@@ -1453,30 +1472,39 @@ var BaseField = import_v43.default.object({
|
|
|
1453
1472
|
}).describe("Common properties shared across all field types.");
|
|
1454
1473
|
var Divider = BaseField.extend({
|
|
1455
1474
|
type: import_v43.default.literal(FieldType.DIVIDER)
|
|
1475
|
+
}).meta({
|
|
1476
|
+
description: "A horizontal line divider",
|
|
1477
|
+
id: "Divider"
|
|
1456
1478
|
});
|
|
1457
1479
|
var TextField = BaseField.extend({
|
|
1458
1480
|
type: import_v43.default.literal(FieldType.TEXT),
|
|
1459
|
-
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1481
|
+
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
1460
1482
|
configuration: import_v43.default.object({
|
|
1461
1483
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text"),
|
|
1462
1484
|
type: import_v43.default.enum(["text", "password"]).optional(),
|
|
1463
1485
|
prefix: TranslationConfig.optional(),
|
|
1464
1486
|
postfix: TranslationConfig.optional()
|
|
1465
1487
|
}).default({ type: "text" }).optional()
|
|
1466
|
-
}).
|
|
1488
|
+
}).meta({
|
|
1489
|
+
description: "A text input field",
|
|
1490
|
+
id: "TextField"
|
|
1491
|
+
});
|
|
1467
1492
|
var NumberField = BaseField.extend({
|
|
1468
1493
|
type: import_v43.default.literal(FieldType.NUMBER),
|
|
1469
|
-
defaultValue: NumberFieldValue.optional(),
|
|
1494
|
+
defaultValue: NumberFieldValue.or(ComputedDefaultValue).optional(),
|
|
1470
1495
|
configuration: import_v43.default.object({
|
|
1471
1496
|
min: import_v43.default.number().optional().describe("Minimum value"),
|
|
1472
1497
|
max: import_v43.default.number().optional().describe("Maximum value"),
|
|
1473
1498
|
prefix: TranslationConfig.optional(),
|
|
1474
1499
|
postfix: TranslationConfig.optional()
|
|
1475
1500
|
}).optional()
|
|
1476
|
-
}).
|
|
1501
|
+
}).meta({
|
|
1502
|
+
description: "A number input field",
|
|
1503
|
+
id: "NumberField"
|
|
1504
|
+
});
|
|
1477
1505
|
var TextAreaField = BaseField.extend({
|
|
1478
1506
|
type: import_v43.default.literal(FieldType.TEXTAREA),
|
|
1479
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1507
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1480
1508
|
configuration: import_v43.default.object({
|
|
1481
1509
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text"),
|
|
1482
1510
|
rows: import_v43.default.number().optional().describe("Number of visible text lines"),
|
|
@@ -1484,7 +1512,10 @@ var TextAreaField = BaseField.extend({
|
|
|
1484
1512
|
prefix: TranslationConfig.optional(),
|
|
1485
1513
|
postfix: TranslationConfig.optional()
|
|
1486
1514
|
}).default({ rows: 4 }).optional()
|
|
1487
|
-
}).
|
|
1515
|
+
}).meta({
|
|
1516
|
+
description: "A multiline text input",
|
|
1517
|
+
id: "TextAreaField"
|
|
1518
|
+
});
|
|
1488
1519
|
var ImageMimeType = import_v43.default.enum([
|
|
1489
1520
|
"image/png",
|
|
1490
1521
|
"image/jpg",
|
|
@@ -1507,58 +1538,76 @@ var SignatureField = BaseField.extend({
|
|
|
1507
1538
|
signaturePromptLabel: TranslationConfig.describe(
|
|
1508
1539
|
"Title of the signature modal"
|
|
1509
1540
|
),
|
|
1510
|
-
defaultValue:
|
|
1541
|
+
defaultValue: SignatureFieldValue.or(ComputedDefaultValue).optional(),
|
|
1511
1542
|
configuration: import_v43.default.object({
|
|
1512
1543
|
maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1513
1544
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
|
1514
1545
|
}).default({
|
|
1515
1546
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1516
1547
|
})
|
|
1517
|
-
}).
|
|
1548
|
+
}).meta({
|
|
1549
|
+
description: "A signature input field",
|
|
1550
|
+
id: "SignatureField"
|
|
1551
|
+
});
|
|
1518
1552
|
var EmailField = BaseField.extend({
|
|
1519
1553
|
type: import_v43.default.literal(FieldType.EMAIL),
|
|
1520
1554
|
configuration: import_v43.default.object({
|
|
1521
1555
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text")
|
|
1522
1556
|
}).default({ maxLength: 255 }).optional(),
|
|
1523
|
-
defaultValue: NonEmptyTextValue.optional()
|
|
1557
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional()
|
|
1558
|
+
}).meta({
|
|
1559
|
+
description: "An email input field",
|
|
1560
|
+
id: "EmailField"
|
|
1524
1561
|
});
|
|
1525
1562
|
var DateField = BaseField.extend({
|
|
1526
1563
|
type: import_v43.default.literal(FieldType.DATE),
|
|
1527
|
-
defaultValue: SerializedNowDateTime.or(PlainDate).optional().describe("Default date value(yyyy-MM-dd)"),
|
|
1564
|
+
defaultValue: SerializedNowDateTime.or(PlainDate).or(ComputedDefaultValue).optional().describe("Default date value(yyyy-MM-dd)"),
|
|
1528
1565
|
configuration: import_v43.default.object({
|
|
1529
1566
|
notice: TranslationConfig.describe(
|
|
1530
1567
|
"Text to display above the date input"
|
|
1531
1568
|
).optional()
|
|
1532
1569
|
}).optional()
|
|
1533
|
-
}).
|
|
1570
|
+
}).meta({
|
|
1571
|
+
description: "A date input (yyyy-MM-dd)",
|
|
1572
|
+
id: "DateField"
|
|
1573
|
+
});
|
|
1534
1574
|
var AgeField = BaseField.extend({
|
|
1535
1575
|
type: import_v43.default.literal(FieldType.AGE),
|
|
1536
|
-
defaultValue: NumberFieldValue.optional(),
|
|
1576
|
+
defaultValue: NumberFieldValue.or(ComputedDefaultValue).optional(),
|
|
1537
1577
|
configuration: import_v43.default.object({
|
|
1538
1578
|
asOfDate: FieldReference,
|
|
1539
1579
|
prefix: TranslationConfig.optional(),
|
|
1540
1580
|
postfix: TranslationConfig.optional()
|
|
1541
1581
|
})
|
|
1542
|
-
}).
|
|
1582
|
+
}).meta({
|
|
1583
|
+
description: "An age input field which uses the current date as the asOfDate",
|
|
1584
|
+
id: "AgeField"
|
|
1585
|
+
});
|
|
1543
1586
|
var TimeField = BaseField.extend({
|
|
1544
1587
|
type: import_v43.default.literal(FieldType.TIME),
|
|
1545
|
-
defaultValue: SerializedNowDateTime.or(TimeValue).optional().describe("Default time value (HH-mm)"),
|
|
1588
|
+
defaultValue: SerializedNowDateTime.or(TimeValue).or(ComputedDefaultValue).optional().describe("Default time value (HH-mm)"),
|
|
1546
1589
|
configuration: import_v43.default.object({
|
|
1547
1590
|
use12HourFormat: import_v43.default.boolean().optional().describe("Whether to use 12-hour format"),
|
|
1548
1591
|
notice: TranslationConfig.describe(
|
|
1549
1592
|
"Text to display above the time input"
|
|
1550
1593
|
).optional()
|
|
1551
1594
|
}).optional()
|
|
1552
|
-
}).
|
|
1595
|
+
}).meta({
|
|
1596
|
+
description: "A single time input (HH-mm)",
|
|
1597
|
+
id: "TimeField"
|
|
1598
|
+
});
|
|
1553
1599
|
var DateRangeField = BaseField.extend({
|
|
1554
1600
|
type: import_v43.default.literal(FieldType.DATE_RANGE),
|
|
1555
|
-
defaultValue: DateRangeFieldValue.optional(),
|
|
1601
|
+
defaultValue: DateRangeFieldValue.or(ComputedDefaultValue).optional(),
|
|
1556
1602
|
configuration: import_v43.default.object({
|
|
1557
1603
|
notice: TranslationConfig.describe(
|
|
1558
1604
|
"Text to display above the date input"
|
|
1559
1605
|
).optional()
|
|
1560
1606
|
}).optional()
|
|
1561
|
-
}).
|
|
1607
|
+
}).meta({
|
|
1608
|
+
description: "A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })",
|
|
1609
|
+
id: "DateRangeField"
|
|
1610
|
+
});
|
|
1562
1611
|
var HtmlFontVariant = import_v43.default.enum([
|
|
1563
1612
|
"reg12",
|
|
1564
1613
|
"reg14",
|
|
@@ -1602,21 +1651,33 @@ var ImageViewField = BaseField.extend({
|
|
|
1602
1651
|
type: import_v43.default.literal(FieldType.IMAGE_VIEW),
|
|
1603
1652
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1604
1653
|
configuration: ImageConfiguration
|
|
1605
|
-
}).
|
|
1654
|
+
}).meta({
|
|
1655
|
+
description: "A read-only image component for form pages",
|
|
1656
|
+
id: "ImageViewField"
|
|
1657
|
+
});
|
|
1606
1658
|
var Paragraph = BaseField.extend({
|
|
1607
1659
|
type: import_v43.default.literal(FieldType.PARAGRAPH),
|
|
1608
1660
|
configuration: ParagraphConfiguration
|
|
1609
|
-
}).
|
|
1661
|
+
}).meta({
|
|
1662
|
+
description: "A read-only HTML <p> paragraph",
|
|
1663
|
+
id: "Paragraph"
|
|
1664
|
+
});
|
|
1610
1665
|
var Heading = BaseField.extend({
|
|
1611
1666
|
type: import_v43.default.literal(FieldType.HEADING),
|
|
1612
1667
|
configuration: HeadingConfiguration
|
|
1613
|
-
}).
|
|
1668
|
+
}).meta({
|
|
1669
|
+
description: "A read-only heading component for form pages",
|
|
1670
|
+
id: "Heading"
|
|
1671
|
+
});
|
|
1614
1672
|
var PageHeader = BaseField.extend({
|
|
1615
1673
|
type: import_v43.default.literal(FieldType.PAGE_HEADER)
|
|
1616
|
-
}).
|
|
1674
|
+
}).meta({
|
|
1675
|
+
description: "A read-only header component for form pages",
|
|
1676
|
+
id: "PageHeader"
|
|
1677
|
+
});
|
|
1617
1678
|
var File = BaseField.extend({
|
|
1618
1679
|
type: import_v43.default.literal(FieldType.FILE),
|
|
1619
|
-
defaultValue: FileFieldValue.optional(),
|
|
1680
|
+
defaultValue: FileFieldValue.or(ComputedDefaultValue).optional(),
|
|
1620
1681
|
configuration: import_v43.default.object({
|
|
1621
1682
|
maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1622
1683
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature"),
|
|
@@ -1632,7 +1693,10 @@ var File = BaseField.extend({
|
|
|
1632
1693
|
}).default({
|
|
1633
1694
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1634
1695
|
})
|
|
1635
|
-
}).
|
|
1696
|
+
}).meta({
|
|
1697
|
+
description: "A file upload field",
|
|
1698
|
+
id: "File"
|
|
1699
|
+
});
|
|
1636
1700
|
var SelectOption = import_v43.default.object({
|
|
1637
1701
|
value: import_v43.default.string().describe("The value of the option"),
|
|
1638
1702
|
label: import_v43.default.union([import_v43.default.string(), TranslationConfig]).describe("The label of the option"),
|
|
@@ -1640,7 +1704,7 @@ var SelectOption = import_v43.default.object({
|
|
|
1640
1704
|
});
|
|
1641
1705
|
var NumberWithUnitField = BaseField.extend({
|
|
1642
1706
|
type: import_v43.default.literal(FieldType.NUMBER_WITH_UNIT),
|
|
1643
|
-
defaultValue: NumberWithUnitFieldValue.optional(),
|
|
1707
|
+
defaultValue: NumberWithUnitFieldValue.or(ComputedDefaultValue).optional(),
|
|
1644
1708
|
options: import_v43.default.array(SelectOption).describe("A list of options for the unit select"),
|
|
1645
1709
|
configuration: import_v43.default.object({
|
|
1646
1710
|
min: import_v43.default.number().optional().describe("Minimum value of the number field"),
|
|
@@ -1649,17 +1713,23 @@ var NumberWithUnitField = BaseField.extend({
|
|
|
1649
1713
|
"Placeholder for the number field"
|
|
1650
1714
|
)
|
|
1651
1715
|
}).optional()
|
|
1652
|
-
}).
|
|
1716
|
+
}).meta({
|
|
1717
|
+
description: "A number with unit input field",
|
|
1718
|
+
id: "NumberWithUnitField"
|
|
1719
|
+
});
|
|
1653
1720
|
var RadioGroup = BaseField.extend({
|
|
1654
1721
|
type: import_v43.default.literal(FieldType.RADIO_GROUP),
|
|
1655
|
-
defaultValue: TextValue.optional(),
|
|
1722
|
+
defaultValue: TextValue.or(ComputedDefaultValue).optional(),
|
|
1656
1723
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
1657
1724
|
configuration: import_v43.default.object({
|
|
1658
1725
|
styles: import_v43.default.object({
|
|
1659
1726
|
size: import_v43.default.enum(["NORMAL", "LARGE"]).optional()
|
|
1660
1727
|
}).optional()
|
|
1661
1728
|
}).optional()
|
|
1662
|
-
}).
|
|
1729
|
+
}).meta({
|
|
1730
|
+
description: "A grouped radio button field",
|
|
1731
|
+
id: "RadioGroup"
|
|
1732
|
+
});
|
|
1663
1733
|
var BulletList = BaseField.extend({
|
|
1664
1734
|
type: import_v43.default.literal(FieldType.BULLET_LIST),
|
|
1665
1735
|
items: import_v43.default.array(TranslationConfig).describe("A list of items"),
|
|
@@ -1668,10 +1738,13 @@ var BulletList = BaseField.extend({
|
|
|
1668
1738
|
fontVariant: HtmlFontVariant.optional()
|
|
1669
1739
|
}).optional()
|
|
1670
1740
|
}).default({})
|
|
1671
|
-
}).
|
|
1741
|
+
}).meta({
|
|
1742
|
+
description: "A list of bullet points",
|
|
1743
|
+
id: "BulletList"
|
|
1744
|
+
});
|
|
1672
1745
|
var Select = BaseField.extend({
|
|
1673
1746
|
type: import_v43.default.literal(FieldType.SELECT),
|
|
1674
|
-
defaultValue: TextValue.optional(),
|
|
1747
|
+
defaultValue: TextValue.or(ComputedDefaultValue).optional(),
|
|
1675
1748
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
1676
1749
|
noOptionsMessage: TranslationConfig.optional().describe(
|
|
1677
1750
|
`
|
|
@@ -1683,16 +1756,22 @@ var Select = BaseField.extend({
|
|
|
1683
1756
|
{ ..., defaultMessage: "'{input}' is not listed among the health facilities." }
|
|
1684
1757
|
`
|
|
1685
1758
|
)
|
|
1686
|
-
}).
|
|
1759
|
+
}).meta({
|
|
1760
|
+
description: "A select input field",
|
|
1761
|
+
id: "Select"
|
|
1762
|
+
});
|
|
1687
1763
|
var SelectDateRangeOption = import_v43.default.object({
|
|
1688
1764
|
value: SelectDateRangeValue.describe("The value of the option"),
|
|
1689
1765
|
label: TranslationConfig.describe("The label of the option")
|
|
1690
1766
|
});
|
|
1691
1767
|
var SelectDateRangeField = BaseField.extend({
|
|
1692
1768
|
type: import_v43.default.literal(FieldType.SELECT_DATE_RANGE),
|
|
1693
|
-
defaultValue: SelectDateRangeValue.optional(),
|
|
1769
|
+
defaultValue: SelectDateRangeValue.or(ComputedDefaultValue).optional(),
|
|
1694
1770
|
options: import_v43.default.array(SelectDateRangeOption).describe("A list of options")
|
|
1695
|
-
}).
|
|
1771
|
+
}).meta({
|
|
1772
|
+
description: "A date range selection field",
|
|
1773
|
+
id: "SelectDateRangeField"
|
|
1774
|
+
});
|
|
1696
1775
|
var NameConfig = import_v43.default.object({
|
|
1697
1776
|
firstname: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
1698
1777
|
middlename: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
@@ -1704,7 +1783,7 @@ var NameField = BaseField.extend({
|
|
|
1704
1783
|
firstname: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
1705
1784
|
middlename: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
1706
1785
|
surname: SerializedUserField.or(NonEmptyTextValue).optional()
|
|
1707
|
-
}).optional(),
|
|
1786
|
+
}).or(ComputedDefaultValue).optional(),
|
|
1708
1787
|
configuration: import_v43.default.object({
|
|
1709
1788
|
name: NameConfig.default({
|
|
1710
1789
|
firstname: { required: true },
|
|
@@ -1723,26 +1802,41 @@ var NameField = BaseField.extend({
|
|
|
1723
1802
|
surname: { required: true }
|
|
1724
1803
|
}
|
|
1725
1804
|
}).optional()
|
|
1726
|
-
}).
|
|
1805
|
+
}).meta({
|
|
1806
|
+
description: "A field for entering a persons name",
|
|
1807
|
+
id: "NameField"
|
|
1808
|
+
});
|
|
1727
1809
|
var PhoneField = BaseField.extend({
|
|
1728
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1810
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1729
1811
|
type: import_v43.default.literal(FieldType.PHONE)
|
|
1730
|
-
}).
|
|
1812
|
+
}).meta({
|
|
1813
|
+
description: "A field for entering a phone number",
|
|
1814
|
+
id: "PhoneField"
|
|
1815
|
+
});
|
|
1731
1816
|
var IdField = BaseField.extend({
|
|
1732
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1817
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1733
1818
|
type: import_v43.default.literal(FieldType.ID)
|
|
1734
|
-
}).
|
|
1819
|
+
}).meta({
|
|
1820
|
+
description: "A field for entering an ID",
|
|
1821
|
+
id: "IdField"
|
|
1822
|
+
});
|
|
1735
1823
|
var Checkbox = BaseField.extend({
|
|
1736
1824
|
type: import_v43.default.literal(FieldType.CHECKBOX),
|
|
1737
|
-
defaultValue: CheckboxFieldValue.default(false)
|
|
1738
|
-
}).
|
|
1825
|
+
defaultValue: CheckboxFieldValue.or(ComputedDefaultValue).default(false)
|
|
1826
|
+
}).meta({
|
|
1827
|
+
description: "A boolean checkbox field",
|
|
1828
|
+
id: "Checkbox"
|
|
1829
|
+
});
|
|
1739
1830
|
var Country = BaseField.extend({
|
|
1740
1831
|
type: import_v43.default.literal(FieldType.COUNTRY),
|
|
1741
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1832
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1742
1833
|
optionOverrides: import_v43.default.array(SelectOption.omit({ label: true })).optional().describe(
|
|
1743
1834
|
"Conditionals for specific countries. Countries not listed are always shown and enabled."
|
|
1744
1835
|
)
|
|
1745
|
-
}).
|
|
1836
|
+
}).meta({
|
|
1837
|
+
description: "A field for selecting a country",
|
|
1838
|
+
id: "Country"
|
|
1839
|
+
});
|
|
1746
1840
|
var AllowedLocations = JurisdictionReference.optional().describe(
|
|
1747
1841
|
"Limits which location options are selectable depending on user jurisdiction and location."
|
|
1748
1842
|
);
|
|
@@ -1751,28 +1845,33 @@ var AdministrativeAreas = import_v43.default.enum([
|
|
|
1751
1845
|
"HEALTH_FACILITY",
|
|
1752
1846
|
"CRVS_OFFICE"
|
|
1753
1847
|
]);
|
|
1754
|
-
var AdministrativeAreaConfiguration = import_v43.default.object({
|
|
1755
|
-
partOf: FieldReference.optional().describe("Parent location"),
|
|
1756
|
-
type: AdministrativeAreas,
|
|
1757
|
-
allowedLocations: AllowedLocations
|
|
1758
|
-
}).describe("Administrative area options");
|
|
1759
1848
|
var AdministrativeAreaField = BaseField.extend({
|
|
1760
1849
|
type: import_v43.default.literal(FieldType.ADMINISTRATIVE_AREA),
|
|
1761
|
-
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1762
|
-
configuration:
|
|
1763
|
-
|
|
1850
|
+
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
1851
|
+
configuration: import_v43.default.object({
|
|
1852
|
+
partOf: FieldReference.optional().describe("Parent location"),
|
|
1853
|
+
type: AdministrativeAreas,
|
|
1854
|
+
allowedLocations: AllowedLocations
|
|
1855
|
+
}).describe("Administrative area options")
|
|
1856
|
+
}).meta({
|
|
1857
|
+
description: "Administrative area input field",
|
|
1858
|
+
id: "AdministrativeAreaField"
|
|
1859
|
+
});
|
|
1764
1860
|
var LocationInput = BaseField.extend({
|
|
1765
1861
|
type: import_v43.default.literal(FieldType.LOCATION),
|
|
1766
|
-
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1862
|
+
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
1767
1863
|
configuration: import_v43.default.object({
|
|
1768
1864
|
locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
|
|
1769
1865
|
allowedLocations: AllowedLocations
|
|
1770
1866
|
}).optional()
|
|
1771
|
-
}).
|
|
1867
|
+
}).meta({
|
|
1868
|
+
description: "A field for selecting a location",
|
|
1869
|
+
id: "LocationInput"
|
|
1870
|
+
});
|
|
1772
1871
|
var FileUploadWithOptions = BaseField.extend({
|
|
1773
1872
|
type: import_v43.default.literal(FieldType.FILE_WITH_OPTIONS),
|
|
1774
1873
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
1775
|
-
defaultValue: FileFieldWithOptionValue.optional(),
|
|
1874
|
+
defaultValue: FileFieldWithOptionValue.or(ComputedDefaultValue).optional(),
|
|
1776
1875
|
configuration: import_v43.default.object({
|
|
1777
1876
|
maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1778
1877
|
maxImageSize: import_v43.default.object({
|
|
@@ -1782,15 +1881,18 @@ var FileUploadWithOptions = BaseField.extend({
|
|
|
1782
1881
|
}).default({
|
|
1783
1882
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1784
1883
|
})
|
|
1884
|
+
}).meta({
|
|
1885
|
+
description: "A field for uploading files with file type options",
|
|
1886
|
+
id: "FileUploadWithOptions"
|
|
1785
1887
|
});
|
|
1786
1888
|
var Facility = BaseField.extend({
|
|
1787
1889
|
type: import_v43.default.literal(FieldType.FACILITY),
|
|
1788
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1890
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1789
1891
|
configuration: import_v43.default.object({ allowedLocations: AllowedLocations }).optional()
|
|
1790
1892
|
}).describe("Input field for a facility");
|
|
1791
1893
|
var Office = BaseField.extend({
|
|
1792
1894
|
type: import_v43.default.literal(FieldType.OFFICE),
|
|
1793
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1895
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1794
1896
|
configuration: import_v43.default.object({ allowedLocations: AllowedLocations }).optional()
|
|
1795
1897
|
}).describe("Input field for an office");
|
|
1796
1898
|
var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
|
|
@@ -1826,8 +1928,11 @@ var Address = BaseField.extend({
|
|
|
1826
1928
|
).optional(),
|
|
1827
1929
|
allowedLocations: AllowedLocations
|
|
1828
1930
|
}).optional(),
|
|
1829
|
-
defaultValue: DefaultAddressFieldValue.optional()
|
|
1830
|
-
}).
|
|
1931
|
+
defaultValue: DefaultAddressFieldValue.or(ComputedDefaultValue).optional()
|
|
1932
|
+
}).meta({
|
|
1933
|
+
description: "Address input field \u2013 a combination of location and text fields",
|
|
1934
|
+
id: "Address"
|
|
1935
|
+
});
|
|
1831
1936
|
var StaticDataEntry = import_v43.default.object({
|
|
1832
1937
|
id: import_v43.default.string().describe("ID for the data entry."),
|
|
1833
1938
|
label: TranslationConfig,
|
|
@@ -1842,7 +1947,10 @@ var DataField = BaseField.extend({
|
|
|
1842
1947
|
subtitle: TranslationConfig.optional(),
|
|
1843
1948
|
data: import_v43.default.array(DataEntry)
|
|
1844
1949
|
})
|
|
1845
|
-
}).
|
|
1950
|
+
}).meta({
|
|
1951
|
+
description: "A field for displaying a table of read-only data",
|
|
1952
|
+
id: "DataField"
|
|
1953
|
+
});
|
|
1846
1954
|
var ButtonSize = import_v43.default.enum(["small", "medium", "large"]);
|
|
1847
1955
|
var ButtonType = import_v43.default.enum([
|
|
1848
1956
|
"primary",
|
|
@@ -1867,13 +1975,19 @@ var ButtonConfiguration = import_v43.default.object({
|
|
|
1867
1975
|
});
|
|
1868
1976
|
var ButtonField = BaseField.extend({
|
|
1869
1977
|
type: import_v43.default.literal(FieldType.BUTTON),
|
|
1870
|
-
defaultValue: ButtonFieldValue.optional(),
|
|
1978
|
+
defaultValue: ButtonFieldValue.or(ComputedDefaultValue).optional(),
|
|
1871
1979
|
configuration: ButtonConfiguration
|
|
1872
|
-
}).
|
|
1980
|
+
}).meta({
|
|
1981
|
+
description: "A generic button that can be used to trigger an action",
|
|
1982
|
+
id: "ButtonField"
|
|
1983
|
+
});
|
|
1873
1984
|
var FieldGroup = BaseField.extend({
|
|
1874
1985
|
type: import_v43.default.literal(FieldType.FIELD_GROUP),
|
|
1875
1986
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
1876
1987
|
fields: import_v43.default.lazy(() => import_v43.default.array(FieldConfig))
|
|
1988
|
+
}).meta({
|
|
1989
|
+
description: "A group of fields that are displayed together",
|
|
1990
|
+
id: "FieldGroup"
|
|
1877
1991
|
});
|
|
1878
1992
|
var AlphaPrintButton = BaseField.extend({
|
|
1879
1993
|
type: import_v43.default.literal(FieldType.ALPHA_PRINT_BUTTON),
|
|
@@ -1883,10 +1997,13 @@ var AlphaPrintButton = BaseField.extend({
|
|
|
1883
1997
|
"Label for the print button"
|
|
1884
1998
|
)
|
|
1885
1999
|
})
|
|
1886
|
-
}).
|
|
2000
|
+
}).meta({
|
|
2001
|
+
description: "An experimental print button field for printing certificates during the declaration process",
|
|
2002
|
+
id: "AlphaPrintButton"
|
|
2003
|
+
});
|
|
1887
2004
|
var HttpField = BaseField.extend({
|
|
1888
2005
|
type: import_v43.default.literal(FieldType.HTTP),
|
|
1889
|
-
defaultValue: HttpFieldValue.optional(),
|
|
2006
|
+
defaultValue: HttpFieldValue.or(ComputedDefaultValue).optional(),
|
|
1890
2007
|
configuration: import_v43.default.object({
|
|
1891
2008
|
trigger: FieldReference.optional().describe(
|
|
1892
2009
|
"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."
|
|
@@ -1899,20 +2016,30 @@ var HttpField = BaseField.extend({
|
|
|
1899
2016
|
params: import_v43.default.record(import_v43.default.string(), import_v43.default.union([import_v43.default.string(), FieldReference])).optional(),
|
|
1900
2017
|
timeout: import_v43.default.number().default(15e3).describe("Request timeout in milliseconds")
|
|
1901
2018
|
})
|
|
1902
|
-
}).
|
|
2019
|
+
}).meta({
|
|
2020
|
+
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.",
|
|
2021
|
+
id: "HttpField"
|
|
2022
|
+
});
|
|
1903
2023
|
var AutocompleteField = BaseField.extend({
|
|
1904
2024
|
type: import_v43.default.literal(FieldType.AUTOCOMPLETE),
|
|
1905
2025
|
configuration: import_v43.default.object({
|
|
1906
|
-
url: import_v43.default.string().describe(
|
|
2026
|
+
url: import_v43.default.string().describe(
|
|
2027
|
+
"URL to fetch autocomplete suggestions from. This should be a country config server endpoint."
|
|
2028
|
+
).optional(),
|
|
1907
2029
|
method: import_v43.default.enum(["GET", "POST"]).default("GET").optional(),
|
|
1908
2030
|
defaultOptions: import_v43.default.array(
|
|
1909
2031
|
import_v43.default.object({
|
|
1910
2032
|
label: import_v43.default.string(),
|
|
1911
2033
|
value: import_v43.default.string()
|
|
1912
2034
|
})
|
|
1913
|
-
).optional()
|
|
2035
|
+
).optional().describe(
|
|
2036
|
+
"Manual entry is supported through configuration, allowing users to provide values not currently represented in the dataset."
|
|
2037
|
+
)
|
|
1914
2038
|
})
|
|
1915
|
-
}).
|
|
2039
|
+
}).meta({
|
|
2040
|
+
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.",
|
|
2041
|
+
id: "AutocompleteField"
|
|
2042
|
+
});
|
|
1916
2043
|
var SearchField = HttpField.extend({
|
|
1917
2044
|
type: import_v43.default.literal(FieldType.SEARCH),
|
|
1918
2045
|
configuration: SearchQuery.pick({
|
|
@@ -1945,6 +2072,9 @@ var SearchField = HttpField.extend({
|
|
|
1945
2072
|
ok: TranslationConfig.optional()
|
|
1946
2073
|
}).optional()
|
|
1947
2074
|
})
|
|
2075
|
+
}).meta({
|
|
2076
|
+
description: "A search input field",
|
|
2077
|
+
id: "SearchField"
|
|
1948
2078
|
});
|
|
1949
2079
|
var LinkButtonField = BaseField.extend({
|
|
1950
2080
|
type: import_v43.default.literal(FieldType.LINK_BUTTON),
|
|
@@ -1953,28 +2083,35 @@ var LinkButtonField = BaseField.extend({
|
|
|
1953
2083
|
text: TranslationConfig.describe("Text to display on the button"),
|
|
1954
2084
|
icon: import_v43.default.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit.")
|
|
1955
2085
|
})
|
|
1956
|
-
}).
|
|
2086
|
+
}).meta({
|
|
2087
|
+
description: "A button that opens a URL link",
|
|
2088
|
+
id: "LinkButtonField"
|
|
2089
|
+
});
|
|
1957
2090
|
var VerificationStatus = BaseField.extend({
|
|
1958
2091
|
type: import_v43.default.literal(FieldType.VERIFICATION_STATUS),
|
|
1959
|
-
defaultValue: VerificationStatusValue.optional(),
|
|
2092
|
+
defaultValue: VerificationStatusValue.or(ComputedDefaultValue).optional(),
|
|
1960
2093
|
configuration: import_v43.default.object({
|
|
1961
2094
|
status: TranslationConfig.describe("Text to display on the status pill."),
|
|
1962
2095
|
description: TranslationConfig.describe(
|
|
1963
2096
|
"Explaining text on the banner in form."
|
|
1964
2097
|
)
|
|
1965
2098
|
})
|
|
2099
|
+
}).meta({
|
|
2100
|
+
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.",
|
|
2101
|
+
id: "VerificationStatus"
|
|
1966
2102
|
});
|
|
1967
2103
|
var QueryParamReaderField = BaseField.extend({
|
|
1968
2104
|
type: import_v43.default.literal(FieldType.QUERY_PARAM_READER),
|
|
1969
2105
|
configuration: import_v43.default.object({
|
|
1970
2106
|
pickParams: import_v43.default.array(import_v43.default.string()).describe("List of query parameters to read from the URL")
|
|
1971
2107
|
})
|
|
1972
|
-
}).
|
|
1973
|
-
"A field that maps URL query params into form values and clears them afterward"
|
|
1974
|
-
|
|
2108
|
+
}).meta({
|
|
2109
|
+
description: "A field that maps URL query params into form values and clears them afterward",
|
|
2110
|
+
id: "QueryParamReaderField"
|
|
2111
|
+
});
|
|
1975
2112
|
var QrReaderField = BaseField.extend({
|
|
1976
2113
|
type: import_v43.default.literal(FieldType.QR_READER),
|
|
1977
|
-
defaultValue: QrReaderFieldValue.optional(),
|
|
2114
|
+
defaultValue: QrReaderFieldValue.or(ComputedDefaultValue).optional(),
|
|
1978
2115
|
configuration: import_v43.default.object({
|
|
1979
2116
|
validator: import_v43.default.any().meta({
|
|
1980
2117
|
description: "JSON Schema to validate the scanned QR code data against before populating the form fields.",
|
|
@@ -1982,21 +2119,27 @@ var QrReaderField = BaseField.extend({
|
|
|
1982
2119
|
})
|
|
1983
2120
|
}).optional()
|
|
1984
2121
|
}).meta({
|
|
1985
|
-
description: "
|
|
2122
|
+
description: "QR code reader field, including optional JSON Schema validator.",
|
|
1986
2123
|
id: "QrReaderField"
|
|
1987
2124
|
});
|
|
1988
2125
|
var IdReaderField = BaseField.extend({
|
|
1989
2126
|
type: import_v43.default.literal(FieldType.ID_READER),
|
|
1990
|
-
defaultValue: IdReaderFieldValue.optional(),
|
|
2127
|
+
defaultValue: IdReaderFieldValue.or(ComputedDefaultValue).optional(),
|
|
1991
2128
|
methods: import_v43.default.array(
|
|
1992
2129
|
import_v43.default.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
|
|
1993
2130
|
)
|
|
2131
|
+
}).meta({
|
|
2132
|
+
description: "A wrapper around nested form fields, specifically QR_READER and LINK_BUTTON. It can hold the QR_READERs value.",
|
|
2133
|
+
id: "IdReaderField"
|
|
1994
2134
|
});
|
|
1995
2135
|
var CustomField = BaseField.extend({
|
|
1996
2136
|
type: import_v43.default.literal(FieldType._EXPERIMENTAL_CUSTOM),
|
|
1997
2137
|
defaultValue: CustomFieldValue.optional(),
|
|
1998
2138
|
src: import_v43.default.string().describe("Module source path for the custom field component"),
|
|
1999
2139
|
configuration: import_v43.default.unknown().optional()
|
|
2140
|
+
}).meta({
|
|
2141
|
+
description: "An expiremental custom field that is defined by a module source path",
|
|
2142
|
+
id: "CustomField"
|
|
2000
2143
|
});
|
|
2001
2144
|
var FieldStyleVariant = import_v43.default.enum(["default", "highlighted"]);
|
|
2002
2145
|
var LoaderField = BaseField.extend({
|
|
@@ -2006,22 +2149,25 @@ var LoaderField = BaseField.extend({
|
|
|
2006
2149
|
configuration: import_v43.default.object({
|
|
2007
2150
|
text: TranslationConfig.describe("Display text above the loading spinner")
|
|
2008
2151
|
})
|
|
2009
|
-
}).
|
|
2010
|
-
"A non-interactive field that indicates an in progress operation in form"
|
|
2011
|
-
|
|
2152
|
+
}).meta({
|
|
2153
|
+
description: "A non-interactive field that indicates an in progress operation in form",
|
|
2154
|
+
id: "LoaderField"
|
|
2155
|
+
});
|
|
2012
2156
|
var HiddenField = BaseField.extend({
|
|
2013
2157
|
type: import_v43.default.literal(FieldType.ALPHA_HIDDEN),
|
|
2014
2158
|
required: import_v43.default.boolean().default(false).optional(),
|
|
2015
2159
|
defaultValue: TextValue.optional()
|
|
2016
|
-
}).
|
|
2017
|
-
"A non-interactive, hidden field that only hold a value in the form"
|
|
2018
|
-
|
|
2160
|
+
}).meta({
|
|
2161
|
+
description: "A non-interactive, hidden field that only hold a value in the form",
|
|
2162
|
+
id: "HiddenField"
|
|
2163
|
+
});
|
|
2019
2164
|
var UserRoleField = BaseField.extend({
|
|
2020
2165
|
type: import_v43.default.literal(FieldType.USER_ROLE),
|
|
2021
2166
|
defaultValue: TextValue.optional()
|
|
2022
|
-
}).
|
|
2023
|
-
"A select dropdown that is automatically populated with available user roles"
|
|
2024
|
-
|
|
2167
|
+
}).meta({
|
|
2168
|
+
description: "A select dropdown that is automatically populated with available user roles",
|
|
2169
|
+
id: "UserRoleField"
|
|
2170
|
+
});
|
|
2025
2171
|
var FieldConfig = import_v43.default.discriminatedUnion("type", [
|
|
2026
2172
|
FieldGroup,
|
|
2027
2173
|
Address,
|
|
@@ -2107,8 +2253,8 @@ var ApplicationConfig = z20.object({
|
|
|
2107
2253
|
})
|
|
2108
2254
|
),
|
|
2109
2255
|
PHONE_NUMBER_PATTERN: z20.string().or(z20.instanceof(RegExp)),
|
|
2110
|
-
USER_NOTIFICATION_DELIVERY_METHOD: z20.
|
|
2111
|
-
INFORMANT_NOTIFICATION_DELIVERY_METHOD: z20.
|
|
2256
|
+
USER_NOTIFICATION_DELIVERY_METHOD: z20.enum(["email", "sms"]),
|
|
2257
|
+
INFORMANT_NOTIFICATION_DELIVERY_METHOD: z20.enum(["email", "sms"]),
|
|
2112
2258
|
SEARCH_DEFAULT_CRITERIA: SearchCriteria.optional().default("TRACKING_ID"),
|
|
2113
2259
|
ADDITIONAL_USER_FIELDS: z20.array(FieldConfig).optional().default([])
|
|
2114
2260
|
});
|
|
@@ -2126,8 +2272,8 @@ var BackgroundConfig = z20.object({
|
|
|
2126
2272
|
var LoginConfig = z20.object({
|
|
2127
2273
|
COUNTRY: z20.string(),
|
|
2128
2274
|
LANGUAGES: z20.array(z20.string()),
|
|
2129
|
-
USER_NOTIFICATION_DELIVERY_METHOD: z20.
|
|
2130
|
-
INFORMANT_NOTIFICATION_DELIVERY_METHOD: z20.
|
|
2275
|
+
USER_NOTIFICATION_DELIVERY_METHOD: z20.enum(["email", "sms"]),
|
|
2276
|
+
INFORMANT_NOTIFICATION_DELIVERY_METHOD: z20.enum(["email", "sms"]),
|
|
2131
2277
|
PHONE_NUMBER_PATTERN: z20.string().or(z20.instanceof(RegExp)),
|
|
2132
2278
|
LOGIN_BACKGROUND: BackgroundConfig,
|
|
2133
2279
|
SENTRY: z20.string().optional()
|
|
@@ -2139,6 +2285,7 @@ var ClientConfig = z20.object({
|
|
|
2139
2285
|
COUNTRY: z20.string(),
|
|
2140
2286
|
LANGUAGES: z20.array(z20.string()),
|
|
2141
2287
|
SENTRY: z20.string().optional(),
|
|
2288
|
+
LOGIN_URL: z20.string().optional(),
|
|
2142
2289
|
REGISTER_BACKGROUND: BackgroundConfig,
|
|
2143
2290
|
DASHBOARDS: z20.array(
|
|
2144
2291
|
z20.object({
|