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