@opencrvs/toolkit 2.0.0-rc.cedcafb → 2.0.0-rc.cfb68f5
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 +73 -0
- package/create-countryconfig/package.json +21 -0
- package/dist/application-config/index.js +259 -96
- package/dist/cli.js +1952 -347
- package/dist/commons/api/router.d.ts +3366 -300
- package/dist/commons/application-config/index.d.ts +16 -4
- package/dist/commons/conditionals/conditionals.d.ts +6 -6
- package/dist/commons/conditionals/validate.d.ts +1 -0
- package/dist/commons/events/ActionInput.d.ts +108 -0
- package/dist/commons/events/Draft.d.ts +4 -2
- 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 +10 -0
- package/dist/commons/events/WorkqueueConfig.d.ts +150 -150
- package/dist/commons/events/locations.d.ts +38 -1
- package/dist/commons/events/mocks.test.utils.d.ts +19 -0
- package/dist/commons/events/scopes.d.ts +24 -1
- package/dist/commons/events/state/index.d.ts +0 -4
- package/dist/commons/events/state/utils.d.ts +0 -2
- package/dist/commons/events/utils.d.ts +1 -1
- package/dist/conditionals/index.js +40 -8
- package/dist/events/index.js +432 -154
- 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 +1920 -344
- 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 +326 -124
- package/dist/scopes/index.d.ts +87 -10
- package/dist/scopes/index.js +46 -9
- package/opencrvs-toolkit-2.0.0-rc.cfb68f5.tgz +0 -0
- package/package.json +5 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/opencrvs-toolkit-2.0.0-rc.cedcafb.tgz +0 -0
|
@@ -110,6 +110,10 @@ var scopeByEvent = z2.preprocess(
|
|
|
110
110
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
111
111
|
z2.array(z2.string()).optional()
|
|
112
112
|
).describe("Event type, e.g. birth, death");
|
|
113
|
+
var userRole = z2.preprocess(
|
|
114
|
+
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
115
|
+
z2.array(z2.string()).optional()
|
|
116
|
+
).describe("User role, e.g. admin, field agent");
|
|
113
117
|
var scopeOptionsPlaceEvent = z2.object({
|
|
114
118
|
event: scopeByEvent,
|
|
115
119
|
placeOfEvent: JurisdictionFilter.optional()
|
|
@@ -133,6 +137,9 @@ var CustomActionScopeOptions = AllRecordScopeOptions.extend({
|
|
|
133
137
|
var AccessLevelOptions = z2.object({
|
|
134
138
|
accessLevel: JurisdictionFilter.optional()
|
|
135
139
|
});
|
|
140
|
+
var AllUserScopeOptions = AccessLevelOptions.extend({
|
|
141
|
+
role: userRole.optional()
|
|
142
|
+
});
|
|
136
143
|
var WorkqueueOrDashboardOptions = z2.object({
|
|
137
144
|
ids: z2.preprocess(
|
|
138
145
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
@@ -142,6 +149,7 @@ var WorkqueueOrDashboardOptions = z2.object({
|
|
|
142
149
|
var AllScopeOptions = z2.object({
|
|
143
150
|
...AllRecordScopeOptions.shape,
|
|
144
151
|
...AccessLevelOptions.shape,
|
|
152
|
+
...AllUserScopeOptions.shape,
|
|
145
153
|
...WorkqueueOrDashboardOptions.shape
|
|
146
154
|
});
|
|
147
155
|
var ScopeOptionKey = AllScopeOptions.keyof();
|
|
@@ -214,6 +222,30 @@ var RecordScopeV2 = z2.discriminatedUnion("type", [
|
|
|
214
222
|
]).describe(
|
|
215
223
|
"Scopes used to check user's permission to perform actions on a record."
|
|
216
224
|
);
|
|
225
|
+
var SystemScopeType = z2.enum([
|
|
226
|
+
"organisation.read-locations",
|
|
227
|
+
"user.read",
|
|
228
|
+
"user.create",
|
|
229
|
+
"user.edit",
|
|
230
|
+
"user.search"
|
|
231
|
+
]);
|
|
232
|
+
var UserScopeType = SystemScopeType.extract([
|
|
233
|
+
"user.read",
|
|
234
|
+
"user.create",
|
|
235
|
+
"user.edit",
|
|
236
|
+
"user.search"
|
|
237
|
+
]);
|
|
238
|
+
var ScopesWithRoleOption = UserScopeType.extract(["user.edit", "user.create"]);
|
|
239
|
+
var UserScopeV2 = z2.discriminatedUnion("type", [
|
|
240
|
+
z2.object({
|
|
241
|
+
type: ScopesWithRoleOption,
|
|
242
|
+
options: AllUserScopeOptions.optional()
|
|
243
|
+
}),
|
|
244
|
+
z2.object({
|
|
245
|
+
type: UserScopeType.extract(["user.read", "user.search"]),
|
|
246
|
+
options: AccessLevelOptions.optional()
|
|
247
|
+
})
|
|
248
|
+
]);
|
|
217
249
|
var ResolvedRecordScopeV2 = z2.discriminatedUnion("type", [
|
|
218
250
|
z2.object({
|
|
219
251
|
type: ScopesWithPlaceEventOptions,
|
|
@@ -234,16 +266,14 @@ var ResolvedRecordScopeV2 = z2.discriminatedUnion("type", [
|
|
|
234
266
|
}).optional()
|
|
235
267
|
})
|
|
236
268
|
]).describe("Resolved scope with location/user IDs instead of filters.");
|
|
237
|
-
var SystemScopeType = z2.enum([
|
|
238
|
-
"organisation.read-locations",
|
|
239
|
-
"user.read",
|
|
240
|
-
"user.create",
|
|
241
|
-
"user.edit"
|
|
242
|
-
]);
|
|
243
269
|
var Scope = z2.discriminatedUnion("type", [
|
|
244
270
|
z2.object({ type: PlainScopeType }),
|
|
245
271
|
...RecordScopeV2.options,
|
|
246
|
-
|
|
272
|
+
...UserScopeV2.options,
|
|
273
|
+
z2.object({
|
|
274
|
+
type: z2.literal("organisation.read-locations"),
|
|
275
|
+
options: AccessLevelOptions.optional()
|
|
276
|
+
}),
|
|
247
277
|
z2.object({
|
|
248
278
|
type: z2.literal("workqueue"),
|
|
249
279
|
options: WorkqueueOrDashboardOptions
|
|
@@ -263,7 +293,9 @@ var ScopeType = z2.enum([
|
|
|
263
293
|
var EncodedScope = z2.string().brand("EncodedScope");
|
|
264
294
|
var DEFAULT_SCOPE_OPTIONS = {
|
|
265
295
|
placeOfEvent: JurisdictionFilter.enum.all,
|
|
266
|
-
accessLevel: JurisdictionFilter.enum.all
|
|
296
|
+
accessLevel: JurisdictionFilter.enum.all,
|
|
297
|
+
registeredIn: JurisdictionFilter.enum.all,
|
|
298
|
+
declaredIn: JurisdictionFilter.enum.all
|
|
267
299
|
};
|
|
268
300
|
|
|
269
301
|
// ../commons/src/authentication.ts
|
|
@@ -622,7 +654,10 @@ var ActionConditional = z7.discriminatedUnion("type", [
|
|
|
622
654
|
ShowConditional,
|
|
623
655
|
// Action can be shown to the user in the list but as disabled
|
|
624
656
|
EnableConditional
|
|
625
|
-
])
|
|
657
|
+
]).meta({
|
|
658
|
+
id: "ActionConditional",
|
|
659
|
+
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."
|
|
660
|
+
});
|
|
626
661
|
var DisplayOnReviewConditional = z7.object({
|
|
627
662
|
type: z7.literal(ConditionalType.DISPLAY_ON_REVIEW),
|
|
628
663
|
conditional: Conditional
|
|
@@ -637,8 +672,8 @@ var FieldConditional = z7.discriminatedUnion("type", [
|
|
|
637
672
|
// Field output can be shown / hidden on the review page
|
|
638
673
|
DisplayOnReviewConditional
|
|
639
674
|
]).meta({
|
|
640
|
-
|
|
641
|
-
|
|
675
|
+
id: "FieldConditional",
|
|
676
|
+
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."
|
|
642
677
|
});
|
|
643
678
|
|
|
644
679
|
// ../commons/src/events/FieldType.ts
|
|
@@ -950,28 +985,20 @@ function schemaPriority(schema) {
|
|
|
950
985
|
return idx === -1 ? 9999 : idx;
|
|
951
986
|
}
|
|
952
987
|
function safeUnion(schemas) {
|
|
988
|
+
const sortedSchemas = [...schemas].sort(
|
|
989
|
+
(a, b) => schemaPriority(a) - schemaPriority(b)
|
|
990
|
+
);
|
|
953
991
|
return z12.any().superRefine((val, ctx) => {
|
|
954
|
-
const
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
if (successful.length === 0) {
|
|
959
|
-
ctx.addIssue({
|
|
960
|
-
code: "invalid_type",
|
|
961
|
-
expected: "custom",
|
|
962
|
-
message: "Value does not match any schema"
|
|
963
|
-
});
|
|
964
|
-
return;
|
|
965
|
-
}
|
|
966
|
-
successful.sort((a, b) => schemaPriority(a) - schemaPriority(b));
|
|
967
|
-
const best = successful[0];
|
|
968
|
-
if (!best.safeParse(val).success) {
|
|
969
|
-
ctx.addIssue({
|
|
970
|
-
expected: "custom",
|
|
971
|
-
code: "invalid_type",
|
|
972
|
-
message: "Value did not match the best schema"
|
|
973
|
-
});
|
|
992
|
+
for (const schema of sortedSchemas) {
|
|
993
|
+
if (schema.safeParse(val).success) {
|
|
994
|
+
return;
|
|
995
|
+
}
|
|
974
996
|
}
|
|
997
|
+
ctx.addIssue({
|
|
998
|
+
code: "invalid_type",
|
|
999
|
+
expected: "custom",
|
|
1000
|
+
message: "Value does not match any schema"
|
|
1001
|
+
});
|
|
975
1002
|
}).meta({
|
|
976
1003
|
description: "Value that matches exactly one of the possible schema types (TextValue, DateValue, DateRangeFieldValue). The best matching schema is chosen by priority."
|
|
977
1004
|
});
|
|
@@ -1281,6 +1308,9 @@ var FlagConfig = z15.object({
|
|
|
1281
1308
|
"Indicates if this flag expects an action to be performed to be cleared."
|
|
1282
1309
|
),
|
|
1283
1310
|
label: TranslationConfig.describe("Human readable label of the flag.")
|
|
1311
|
+
}).meta({
|
|
1312
|
+
id: "FlagConfig",
|
|
1313
|
+
description: "Configuration for a custom flag that can be added to or removed from records by event actions."
|
|
1284
1314
|
});
|
|
1285
1315
|
var ActionFlagConfig = z15.object({
|
|
1286
1316
|
id: Flag,
|
|
@@ -1288,6 +1318,9 @@ var ActionFlagConfig = z15.object({
|
|
|
1288
1318
|
conditional: Conditional.optional().describe(
|
|
1289
1319
|
"When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
|
|
1290
1320
|
)
|
|
1321
|
+
}).meta({
|
|
1322
|
+
id: "ActionFlagConfig",
|
|
1323
|
+
description: "Add or remove operation applied to a flag when the parent action is accepted. Optionally gated by a conditional."
|
|
1291
1324
|
});
|
|
1292
1325
|
|
|
1293
1326
|
// ../commons/src/events/EventMetadata.ts
|
|
@@ -1309,8 +1342,7 @@ var ActionCreationMetadata = z16.object({
|
|
|
1309
1342
|
),
|
|
1310
1343
|
createdByUserType: z16.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1311
1344
|
acceptedAt: z16.iso.datetime().describe("Timestamp when the action request was accepted."),
|
|
1312
|
-
createdByRole: z16.string().optional().describe("Role of the user at the time of action request creation.")
|
|
1313
|
-
createdBySignature: z16.string().nullish().describe("Signature of the user who created the action request.")
|
|
1345
|
+
createdByRole: z16.string().optional().describe("Role of the user at the time of action request creation.")
|
|
1314
1346
|
});
|
|
1315
1347
|
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
1316
1348
|
registrationNumber: z16.string().describe(
|
|
@@ -1338,9 +1370,6 @@ var EventMetadata = z16.object({
|
|
|
1338
1370
|
createdAtLocation: UUID.nullish().describe(
|
|
1339
1371
|
"Location of the user who created the event."
|
|
1340
1372
|
),
|
|
1341
|
-
createdBySignature: DocumentPath.nullish().describe(
|
|
1342
|
-
"Signature of the user who created the event."
|
|
1343
|
-
),
|
|
1344
1373
|
updatedAtLocation: UUID.nullish().describe(
|
|
1345
1374
|
"Location of the user who last changed the status."
|
|
1346
1375
|
),
|
|
@@ -1633,14 +1662,21 @@ var FieldId = import_v43.default.string().superRefine((val, ctx) => {
|
|
|
1633
1662
|
}
|
|
1634
1663
|
}).describe("Unique identifier for the field");
|
|
1635
1664
|
var FieldReference = import_v43.default.object({
|
|
1636
|
-
$$field: FieldId,
|
|
1665
|
+
$$field: FieldId.describe("Id of the field to reference"),
|
|
1637
1666
|
$$subfield: import_v43.default.array(import_v43.default.string()).optional().default([]).describe(
|
|
1638
1667
|
'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
|
|
1639
1668
|
)
|
|
1640
1669
|
}).describe("Reference to a field by its ID");
|
|
1641
1670
|
var ValidationConfig = import_v43.default.object({
|
|
1642
|
-
validator: Conditional
|
|
1643
|
-
|
|
1671
|
+
validator: Conditional.describe(
|
|
1672
|
+
"Conditional expression that must hold for the field value to be considered valid."
|
|
1673
|
+
),
|
|
1674
|
+
message: TranslationConfig.describe(
|
|
1675
|
+
"Error message displayed when the validator does not hold."
|
|
1676
|
+
)
|
|
1677
|
+
}).meta({
|
|
1678
|
+
id: "ValidationConfig",
|
|
1679
|
+
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."
|
|
1644
1680
|
});
|
|
1645
1681
|
var requiredSchema = import_v43.default.union([
|
|
1646
1682
|
import_v43.default.boolean(),
|
|
@@ -1679,6 +1715,9 @@ var BaseField = import_v43.default.object({
|
|
|
1679
1715
|
}).describe("Common properties shared across all field types.");
|
|
1680
1716
|
var Divider = BaseField.extend({
|
|
1681
1717
|
type: import_v43.default.literal(FieldType.DIVIDER)
|
|
1718
|
+
}).meta({
|
|
1719
|
+
description: "A horizontal line divider",
|
|
1720
|
+
id: "Divider"
|
|
1682
1721
|
});
|
|
1683
1722
|
var TextField = BaseField.extend({
|
|
1684
1723
|
type: import_v43.default.literal(FieldType.TEXT),
|
|
@@ -1689,7 +1728,10 @@ var TextField = BaseField.extend({
|
|
|
1689
1728
|
prefix: TranslationConfig.optional(),
|
|
1690
1729
|
postfix: TranslationConfig.optional()
|
|
1691
1730
|
}).default({ type: "text" }).optional()
|
|
1692
|
-
}).
|
|
1731
|
+
}).meta({
|
|
1732
|
+
description: "A text input field",
|
|
1733
|
+
id: "TextField"
|
|
1734
|
+
});
|
|
1693
1735
|
var NumberField = BaseField.extend({
|
|
1694
1736
|
type: import_v43.default.literal(FieldType.NUMBER),
|
|
1695
1737
|
defaultValue: NumberFieldValue.optional(),
|
|
@@ -1699,7 +1741,10 @@ var NumberField = BaseField.extend({
|
|
|
1699
1741
|
prefix: TranslationConfig.optional(),
|
|
1700
1742
|
postfix: TranslationConfig.optional()
|
|
1701
1743
|
}).optional()
|
|
1702
|
-
}).
|
|
1744
|
+
}).meta({
|
|
1745
|
+
description: "A number input field",
|
|
1746
|
+
id: "NumberField"
|
|
1747
|
+
});
|
|
1703
1748
|
var TextAreaField = BaseField.extend({
|
|
1704
1749
|
type: import_v43.default.literal(FieldType.TEXTAREA),
|
|
1705
1750
|
defaultValue: NonEmptyTextValue.optional(),
|
|
@@ -1710,7 +1755,10 @@ var TextAreaField = BaseField.extend({
|
|
|
1710
1755
|
prefix: TranslationConfig.optional(),
|
|
1711
1756
|
postfix: TranslationConfig.optional()
|
|
1712
1757
|
}).default({ rows: 4 }).optional()
|
|
1713
|
-
}).
|
|
1758
|
+
}).meta({
|
|
1759
|
+
description: "A multiline text input",
|
|
1760
|
+
id: "TextAreaField"
|
|
1761
|
+
});
|
|
1714
1762
|
var ImageMimeType = import_v43.default.enum([
|
|
1715
1763
|
"image/png",
|
|
1716
1764
|
"image/jpg",
|
|
@@ -1740,13 +1788,19 @@ var SignatureField = BaseField.extend({
|
|
|
1740
1788
|
}).default({
|
|
1741
1789
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1742
1790
|
})
|
|
1743
|
-
}).
|
|
1791
|
+
}).meta({
|
|
1792
|
+
description: "A signature input field",
|
|
1793
|
+
id: "SignatureField"
|
|
1794
|
+
});
|
|
1744
1795
|
var EmailField = BaseField.extend({
|
|
1745
1796
|
type: import_v43.default.literal(FieldType.EMAIL),
|
|
1746
1797
|
configuration: import_v43.default.object({
|
|
1747
1798
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text")
|
|
1748
1799
|
}).default({ maxLength: 255 }).optional(),
|
|
1749
1800
|
defaultValue: NonEmptyTextValue.optional()
|
|
1801
|
+
}).meta({
|
|
1802
|
+
description: "An email input field",
|
|
1803
|
+
id: "EmailField"
|
|
1750
1804
|
});
|
|
1751
1805
|
var DateField = BaseField.extend({
|
|
1752
1806
|
type: import_v43.default.literal(FieldType.DATE),
|
|
@@ -1756,7 +1810,10 @@ var DateField = BaseField.extend({
|
|
|
1756
1810
|
"Text to display above the date input"
|
|
1757
1811
|
).optional()
|
|
1758
1812
|
}).optional()
|
|
1759
|
-
}).
|
|
1813
|
+
}).meta({
|
|
1814
|
+
description: "A date input (yyyy-MM-dd)",
|
|
1815
|
+
id: "DateField"
|
|
1816
|
+
});
|
|
1760
1817
|
var AgeField = BaseField.extend({
|
|
1761
1818
|
type: import_v43.default.literal(FieldType.AGE),
|
|
1762
1819
|
defaultValue: NumberFieldValue.optional(),
|
|
@@ -1765,7 +1822,10 @@ var AgeField = BaseField.extend({
|
|
|
1765
1822
|
prefix: TranslationConfig.optional(),
|
|
1766
1823
|
postfix: TranslationConfig.optional()
|
|
1767
1824
|
})
|
|
1768
|
-
}).
|
|
1825
|
+
}).meta({
|
|
1826
|
+
description: "An age input field which uses the current date as the asOfDate",
|
|
1827
|
+
id: "AgeField"
|
|
1828
|
+
});
|
|
1769
1829
|
var TimeField = BaseField.extend({
|
|
1770
1830
|
type: import_v43.default.literal(FieldType.TIME),
|
|
1771
1831
|
defaultValue: SerializedNowDateTime.or(TimeValue).optional().describe("Default time value (HH-mm)"),
|
|
@@ -1775,7 +1835,10 @@ var TimeField = BaseField.extend({
|
|
|
1775
1835
|
"Text to display above the time input"
|
|
1776
1836
|
).optional()
|
|
1777
1837
|
}).optional()
|
|
1778
|
-
}).
|
|
1838
|
+
}).meta({
|
|
1839
|
+
description: "A single time input (HH-mm)",
|
|
1840
|
+
id: "TimeField"
|
|
1841
|
+
});
|
|
1779
1842
|
var DateRangeField = BaseField.extend({
|
|
1780
1843
|
type: import_v43.default.literal(FieldType.DATE_RANGE),
|
|
1781
1844
|
defaultValue: DateRangeFieldValue.optional(),
|
|
@@ -1784,7 +1847,10 @@ var DateRangeField = BaseField.extend({
|
|
|
1784
1847
|
"Text to display above the date input"
|
|
1785
1848
|
).optional()
|
|
1786
1849
|
}).optional()
|
|
1787
|
-
}).
|
|
1850
|
+
}).meta({
|
|
1851
|
+
description: "A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })",
|
|
1852
|
+
id: "DateRangeField"
|
|
1853
|
+
});
|
|
1788
1854
|
var HtmlFontVariant = import_v43.default.enum([
|
|
1789
1855
|
"reg12",
|
|
1790
1856
|
"reg14",
|
|
@@ -1828,18 +1894,30 @@ var ImageViewField = BaseField.extend({
|
|
|
1828
1894
|
type: import_v43.default.literal(FieldType.IMAGE_VIEW),
|
|
1829
1895
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1830
1896
|
configuration: ImageConfiguration
|
|
1831
|
-
}).
|
|
1897
|
+
}).meta({
|
|
1898
|
+
description: "A read-only image component for form pages",
|
|
1899
|
+
id: "ImageViewField"
|
|
1900
|
+
});
|
|
1832
1901
|
var Paragraph = BaseField.extend({
|
|
1833
1902
|
type: import_v43.default.literal(FieldType.PARAGRAPH),
|
|
1834
1903
|
configuration: ParagraphConfiguration
|
|
1835
|
-
}).
|
|
1904
|
+
}).meta({
|
|
1905
|
+
description: "A read-only HTML <p> paragraph",
|
|
1906
|
+
id: "Paragraph"
|
|
1907
|
+
});
|
|
1836
1908
|
var Heading = BaseField.extend({
|
|
1837
1909
|
type: import_v43.default.literal(FieldType.HEADING),
|
|
1838
1910
|
configuration: HeadingConfiguration
|
|
1839
|
-
}).
|
|
1911
|
+
}).meta({
|
|
1912
|
+
description: "A read-only heading component for form pages",
|
|
1913
|
+
id: "Heading"
|
|
1914
|
+
});
|
|
1840
1915
|
var PageHeader = BaseField.extend({
|
|
1841
1916
|
type: import_v43.default.literal(FieldType.PAGE_HEADER)
|
|
1842
|
-
}).
|
|
1917
|
+
}).meta({
|
|
1918
|
+
description: "A read-only header component for form pages",
|
|
1919
|
+
id: "PageHeader"
|
|
1920
|
+
});
|
|
1843
1921
|
var File = BaseField.extend({
|
|
1844
1922
|
type: import_v43.default.literal(FieldType.FILE),
|
|
1845
1923
|
defaultValue: FileFieldValue.optional(),
|
|
@@ -1858,7 +1936,10 @@ var File = BaseField.extend({
|
|
|
1858
1936
|
}).default({
|
|
1859
1937
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1860
1938
|
})
|
|
1861
|
-
}).
|
|
1939
|
+
}).meta({
|
|
1940
|
+
description: "A file upload field",
|
|
1941
|
+
id: "File"
|
|
1942
|
+
});
|
|
1862
1943
|
var SelectOption = import_v43.default.object({
|
|
1863
1944
|
value: import_v43.default.string().describe("The value of the option"),
|
|
1864
1945
|
label: import_v43.default.union([import_v43.default.string(), TranslationConfig]).describe("The label of the option"),
|
|
@@ -1875,7 +1956,10 @@ var NumberWithUnitField = BaseField.extend({
|
|
|
1875
1956
|
"Placeholder for the number field"
|
|
1876
1957
|
)
|
|
1877
1958
|
}).optional()
|
|
1878
|
-
}).
|
|
1959
|
+
}).meta({
|
|
1960
|
+
description: "A number with unit input field",
|
|
1961
|
+
id: "NumberWithUnitField"
|
|
1962
|
+
});
|
|
1879
1963
|
var RadioGroup = BaseField.extend({
|
|
1880
1964
|
type: import_v43.default.literal(FieldType.RADIO_GROUP),
|
|
1881
1965
|
defaultValue: TextValue.optional(),
|
|
@@ -1885,7 +1969,10 @@ var RadioGroup = BaseField.extend({
|
|
|
1885
1969
|
size: import_v43.default.enum(["NORMAL", "LARGE"]).optional()
|
|
1886
1970
|
}).optional()
|
|
1887
1971
|
}).optional()
|
|
1888
|
-
}).
|
|
1972
|
+
}).meta({
|
|
1973
|
+
description: "A grouped radio button field",
|
|
1974
|
+
id: "RadioGroup"
|
|
1975
|
+
});
|
|
1889
1976
|
var BulletList = BaseField.extend({
|
|
1890
1977
|
type: import_v43.default.literal(FieldType.BULLET_LIST),
|
|
1891
1978
|
items: import_v43.default.array(TranslationConfig).describe("A list of items"),
|
|
@@ -1894,7 +1981,10 @@ var BulletList = BaseField.extend({
|
|
|
1894
1981
|
fontVariant: HtmlFontVariant.optional()
|
|
1895
1982
|
}).optional()
|
|
1896
1983
|
}).default({})
|
|
1897
|
-
}).
|
|
1984
|
+
}).meta({
|
|
1985
|
+
description: "A list of bullet points",
|
|
1986
|
+
id: "BulletList"
|
|
1987
|
+
});
|
|
1898
1988
|
var Select = BaseField.extend({
|
|
1899
1989
|
type: import_v43.default.literal(FieldType.SELECT),
|
|
1900
1990
|
defaultValue: TextValue.optional(),
|
|
@@ -1909,7 +1999,10 @@ var Select = BaseField.extend({
|
|
|
1909
1999
|
{ ..., defaultMessage: "'{input}' is not listed among the health facilities." }
|
|
1910
2000
|
`
|
|
1911
2001
|
)
|
|
1912
|
-
}).
|
|
2002
|
+
}).meta({
|
|
2003
|
+
description: "A select input field",
|
|
2004
|
+
id: "Select"
|
|
2005
|
+
});
|
|
1913
2006
|
var SelectDateRangeOption = import_v43.default.object({
|
|
1914
2007
|
value: SelectDateRangeValue.describe("The value of the option"),
|
|
1915
2008
|
label: TranslationConfig.describe("The label of the option")
|
|
@@ -1918,7 +2011,10 @@ var SelectDateRangeField = BaseField.extend({
|
|
|
1918
2011
|
type: import_v43.default.literal(FieldType.SELECT_DATE_RANGE),
|
|
1919
2012
|
defaultValue: SelectDateRangeValue.optional(),
|
|
1920
2013
|
options: import_v43.default.array(SelectDateRangeOption).describe("A list of options")
|
|
1921
|
-
}).
|
|
2014
|
+
}).meta({
|
|
2015
|
+
description: "A date range selection field",
|
|
2016
|
+
id: "SelectDateRangeField"
|
|
2017
|
+
});
|
|
1922
2018
|
var NameConfig = import_v43.default.object({
|
|
1923
2019
|
firstname: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
1924
2020
|
middlename: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
@@ -1949,26 +2045,41 @@ var NameField = BaseField.extend({
|
|
|
1949
2045
|
surname: { required: true }
|
|
1950
2046
|
}
|
|
1951
2047
|
}).optional()
|
|
1952
|
-
}).
|
|
2048
|
+
}).meta({
|
|
2049
|
+
description: "A field for entering a persons name",
|
|
2050
|
+
id: "NameField"
|
|
2051
|
+
});
|
|
1953
2052
|
var PhoneField = BaseField.extend({
|
|
1954
2053
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1955
2054
|
type: import_v43.default.literal(FieldType.PHONE)
|
|
1956
|
-
}).
|
|
2055
|
+
}).meta({
|
|
2056
|
+
description: "A field for entering a phone number",
|
|
2057
|
+
id: "PhoneField"
|
|
2058
|
+
});
|
|
1957
2059
|
var IdField = BaseField.extend({
|
|
1958
2060
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1959
2061
|
type: import_v43.default.literal(FieldType.ID)
|
|
1960
|
-
}).
|
|
2062
|
+
}).meta({
|
|
2063
|
+
description: "A field for entering an ID",
|
|
2064
|
+
id: "IdField"
|
|
2065
|
+
});
|
|
1961
2066
|
var Checkbox = BaseField.extend({
|
|
1962
2067
|
type: import_v43.default.literal(FieldType.CHECKBOX),
|
|
1963
2068
|
defaultValue: CheckboxFieldValue.default(false)
|
|
1964
|
-
}).
|
|
2069
|
+
}).meta({
|
|
2070
|
+
description: "A boolean checkbox field",
|
|
2071
|
+
id: "Checkbox"
|
|
2072
|
+
});
|
|
1965
2073
|
var Country = BaseField.extend({
|
|
1966
2074
|
type: import_v43.default.literal(FieldType.COUNTRY),
|
|
1967
2075
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1968
2076
|
optionOverrides: import_v43.default.array(SelectOption.omit({ label: true })).optional().describe(
|
|
1969
2077
|
"Conditionals for specific countries. Countries not listed are always shown and enabled."
|
|
1970
2078
|
)
|
|
1971
|
-
}).
|
|
2079
|
+
}).meta({
|
|
2080
|
+
description: "A field for selecting a country",
|
|
2081
|
+
id: "Country"
|
|
2082
|
+
});
|
|
1972
2083
|
var AllowedLocations = JurisdictionReference.optional().describe(
|
|
1973
2084
|
"Limits which location options are selectable depending on user jurisdiction and location."
|
|
1974
2085
|
);
|
|
@@ -1977,16 +2088,18 @@ var AdministrativeAreas = import_v43.default.enum([
|
|
|
1977
2088
|
"HEALTH_FACILITY",
|
|
1978
2089
|
"CRVS_OFFICE"
|
|
1979
2090
|
]);
|
|
1980
|
-
var AdministrativeAreaConfiguration = import_v43.default.object({
|
|
1981
|
-
partOf: FieldReference.optional().describe("Parent location"),
|
|
1982
|
-
type: AdministrativeAreas,
|
|
1983
|
-
allowedLocations: AllowedLocations
|
|
1984
|
-
}).describe("Administrative area options");
|
|
1985
2091
|
var AdministrativeAreaField = BaseField.extend({
|
|
1986
2092
|
type: import_v43.default.literal(FieldType.ADMINISTRATIVE_AREA),
|
|
1987
2093
|
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1988
|
-
configuration:
|
|
1989
|
-
|
|
2094
|
+
configuration: import_v43.default.object({
|
|
2095
|
+
partOf: FieldReference.optional().describe("Parent location"),
|
|
2096
|
+
type: AdministrativeAreas,
|
|
2097
|
+
allowedLocations: AllowedLocations
|
|
2098
|
+
}).describe("Administrative area options")
|
|
2099
|
+
}).meta({
|
|
2100
|
+
description: "Administrative area input field",
|
|
2101
|
+
id: "AdministrativeAreaField"
|
|
2102
|
+
});
|
|
1990
2103
|
var LocationInput = BaseField.extend({
|
|
1991
2104
|
type: import_v43.default.literal(FieldType.LOCATION),
|
|
1992
2105
|
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
@@ -1994,7 +2107,10 @@ var LocationInput = BaseField.extend({
|
|
|
1994
2107
|
locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
|
|
1995
2108
|
allowedLocations: AllowedLocations
|
|
1996
2109
|
}).optional()
|
|
1997
|
-
}).
|
|
2110
|
+
}).meta({
|
|
2111
|
+
description: "A field for selecting a location",
|
|
2112
|
+
id: "LocationInput"
|
|
2113
|
+
});
|
|
1998
2114
|
var FileUploadWithOptions = BaseField.extend({
|
|
1999
2115
|
type: import_v43.default.literal(FieldType.FILE_WITH_OPTIONS),
|
|
2000
2116
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
@@ -2008,6 +2124,9 @@ var FileUploadWithOptions = BaseField.extend({
|
|
|
2008
2124
|
}).default({
|
|
2009
2125
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
2010
2126
|
})
|
|
2127
|
+
}).meta({
|
|
2128
|
+
description: "A field for uploading files with file type options",
|
|
2129
|
+
id: "FileUploadWithOptions"
|
|
2011
2130
|
});
|
|
2012
2131
|
var Facility = BaseField.extend({
|
|
2013
2132
|
type: import_v43.default.literal(FieldType.FACILITY),
|
|
@@ -2053,7 +2172,10 @@ var Address = BaseField.extend({
|
|
|
2053
2172
|
allowedLocations: AllowedLocations
|
|
2054
2173
|
}).optional(),
|
|
2055
2174
|
defaultValue: DefaultAddressFieldValue.optional()
|
|
2056
|
-
}).
|
|
2175
|
+
}).meta({
|
|
2176
|
+
description: "Address input field \u2013 a combination of location and text fields",
|
|
2177
|
+
id: "Address"
|
|
2178
|
+
});
|
|
2057
2179
|
var StaticDataEntry = import_v43.default.object({
|
|
2058
2180
|
id: import_v43.default.string().describe("ID for the data entry."),
|
|
2059
2181
|
label: TranslationConfig,
|
|
@@ -2068,7 +2190,10 @@ var DataField = BaseField.extend({
|
|
|
2068
2190
|
subtitle: TranslationConfig.optional(),
|
|
2069
2191
|
data: import_v43.default.array(DataEntry)
|
|
2070
2192
|
})
|
|
2071
|
-
}).
|
|
2193
|
+
}).meta({
|
|
2194
|
+
description: "A field for displaying a table of read-only data",
|
|
2195
|
+
id: "DataField"
|
|
2196
|
+
});
|
|
2072
2197
|
var ButtonSize = import_v43.default.enum(["small", "medium", "large"]);
|
|
2073
2198
|
var ButtonType = import_v43.default.enum([
|
|
2074
2199
|
"primary",
|
|
@@ -2095,11 +2220,17 @@ var ButtonField = BaseField.extend({
|
|
|
2095
2220
|
type: import_v43.default.literal(FieldType.BUTTON),
|
|
2096
2221
|
defaultValue: ButtonFieldValue.optional(),
|
|
2097
2222
|
configuration: ButtonConfiguration
|
|
2098
|
-
}).
|
|
2223
|
+
}).meta({
|
|
2224
|
+
description: "A generic button that can be used to trigger an action",
|
|
2225
|
+
id: "ButtonField"
|
|
2226
|
+
});
|
|
2099
2227
|
var FieldGroup = BaseField.extend({
|
|
2100
2228
|
type: import_v43.default.literal(FieldType.FIELD_GROUP),
|
|
2101
2229
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2102
2230
|
fields: import_v43.default.lazy(() => import_v43.default.array(FieldConfig))
|
|
2231
|
+
}).meta({
|
|
2232
|
+
description: "A group of fields that are displayed together",
|
|
2233
|
+
id: "FieldGroup"
|
|
2103
2234
|
});
|
|
2104
2235
|
var AlphaPrintButton = BaseField.extend({
|
|
2105
2236
|
type: import_v43.default.literal(FieldType.ALPHA_PRINT_BUTTON),
|
|
@@ -2109,7 +2240,10 @@ var AlphaPrintButton = BaseField.extend({
|
|
|
2109
2240
|
"Label for the print button"
|
|
2110
2241
|
)
|
|
2111
2242
|
})
|
|
2112
|
-
}).
|
|
2243
|
+
}).meta({
|
|
2244
|
+
description: "An experimental print button field for printing certificates during the declaration process",
|
|
2245
|
+
id: "AlphaPrintButton"
|
|
2246
|
+
});
|
|
2113
2247
|
var HttpField = BaseField.extend({
|
|
2114
2248
|
type: import_v43.default.literal(FieldType.HTTP),
|
|
2115
2249
|
defaultValue: HttpFieldValue.optional(),
|
|
@@ -2125,20 +2259,30 @@ var HttpField = BaseField.extend({
|
|
|
2125
2259
|
params: import_v43.default.record(import_v43.default.string(), import_v43.default.union([import_v43.default.string(), FieldReference])).optional(),
|
|
2126
2260
|
timeout: import_v43.default.number().default(15e3).describe("Request timeout in milliseconds")
|
|
2127
2261
|
})
|
|
2128
|
-
}).
|
|
2262
|
+
}).meta({
|
|
2263
|
+
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.",
|
|
2264
|
+
id: "HttpField"
|
|
2265
|
+
});
|
|
2129
2266
|
var AutocompleteField = BaseField.extend({
|
|
2130
2267
|
type: import_v43.default.literal(FieldType.AUTOCOMPLETE),
|
|
2131
2268
|
configuration: import_v43.default.object({
|
|
2132
|
-
url: import_v43.default.string().describe(
|
|
2269
|
+
url: import_v43.default.string().describe(
|
|
2270
|
+
"URL to fetch autocomplete suggestions from. This should be a country config server endpoint."
|
|
2271
|
+
).optional(),
|
|
2133
2272
|
method: import_v43.default.enum(["GET", "POST"]).default("GET").optional(),
|
|
2134
2273
|
defaultOptions: import_v43.default.array(
|
|
2135
2274
|
import_v43.default.object({
|
|
2136
2275
|
label: import_v43.default.string(),
|
|
2137
2276
|
value: import_v43.default.string()
|
|
2138
2277
|
})
|
|
2139
|
-
).optional()
|
|
2278
|
+
).optional().describe(
|
|
2279
|
+
"Manual entry is supported through configuration, allowing users to provide values not currently represented in the dataset."
|
|
2280
|
+
)
|
|
2140
2281
|
})
|
|
2141
|
-
}).
|
|
2282
|
+
}).meta({
|
|
2283
|
+
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.",
|
|
2284
|
+
id: "AutocompleteField"
|
|
2285
|
+
});
|
|
2142
2286
|
var SearchField = HttpField.extend({
|
|
2143
2287
|
type: import_v43.default.literal(FieldType.SEARCH),
|
|
2144
2288
|
configuration: SearchQuery.pick({
|
|
@@ -2171,6 +2315,9 @@ var SearchField = HttpField.extend({
|
|
|
2171
2315
|
ok: TranslationConfig.optional()
|
|
2172
2316
|
}).optional()
|
|
2173
2317
|
})
|
|
2318
|
+
}).meta({
|
|
2319
|
+
description: "A search input field",
|
|
2320
|
+
id: "SearchField"
|
|
2174
2321
|
});
|
|
2175
2322
|
var LinkButtonField = BaseField.extend({
|
|
2176
2323
|
type: import_v43.default.literal(FieldType.LINK_BUTTON),
|
|
@@ -2179,7 +2326,10 @@ var LinkButtonField = BaseField.extend({
|
|
|
2179
2326
|
text: TranslationConfig.describe("Text to display on the button"),
|
|
2180
2327
|
icon: import_v43.default.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit.")
|
|
2181
2328
|
})
|
|
2182
|
-
}).
|
|
2329
|
+
}).meta({
|
|
2330
|
+
description: "A button that opens a URL link",
|
|
2331
|
+
id: "LinkButtonField"
|
|
2332
|
+
});
|
|
2183
2333
|
var VerificationStatus = BaseField.extend({
|
|
2184
2334
|
type: import_v43.default.literal(FieldType.VERIFICATION_STATUS),
|
|
2185
2335
|
defaultValue: VerificationStatusValue.optional(),
|
|
@@ -2189,15 +2339,19 @@ var VerificationStatus = BaseField.extend({
|
|
|
2189
2339
|
"Explaining text on the banner in form."
|
|
2190
2340
|
)
|
|
2191
2341
|
})
|
|
2342
|
+
}).meta({
|
|
2343
|
+
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.",
|
|
2344
|
+
id: "VerificationStatus"
|
|
2192
2345
|
});
|
|
2193
2346
|
var QueryParamReaderField = BaseField.extend({
|
|
2194
2347
|
type: import_v43.default.literal(FieldType.QUERY_PARAM_READER),
|
|
2195
2348
|
configuration: import_v43.default.object({
|
|
2196
2349
|
pickParams: import_v43.default.array(import_v43.default.string()).describe("List of query parameters to read from the URL")
|
|
2197
2350
|
})
|
|
2198
|
-
}).
|
|
2199
|
-
"A field that maps URL query params into form values and clears them afterward"
|
|
2200
|
-
|
|
2351
|
+
}).meta({
|
|
2352
|
+
description: "A field that maps URL query params into form values and clears them afterward",
|
|
2353
|
+
id: "QueryParamReaderField"
|
|
2354
|
+
});
|
|
2201
2355
|
var QrReaderField = BaseField.extend({
|
|
2202
2356
|
type: import_v43.default.literal(FieldType.QR_READER),
|
|
2203
2357
|
defaultValue: QrReaderFieldValue.optional(),
|
|
@@ -2208,7 +2362,7 @@ var QrReaderField = BaseField.extend({
|
|
|
2208
2362
|
})
|
|
2209
2363
|
}).optional()
|
|
2210
2364
|
}).meta({
|
|
2211
|
-
description: "
|
|
2365
|
+
description: "QR code reader field, including optional JSON Schema validator.",
|
|
2212
2366
|
id: "QrReaderField"
|
|
2213
2367
|
});
|
|
2214
2368
|
var IdReaderField = BaseField.extend({
|
|
@@ -2217,12 +2371,18 @@ var IdReaderField = BaseField.extend({
|
|
|
2217
2371
|
methods: import_v43.default.array(
|
|
2218
2372
|
import_v43.default.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
|
|
2219
2373
|
)
|
|
2374
|
+
}).meta({
|
|
2375
|
+
description: "A wrapper around nested form fields, specifically QR_READER and LINK_BUTTON. It can hold the QR_READERs value.",
|
|
2376
|
+
id: "IdReaderField"
|
|
2220
2377
|
});
|
|
2221
2378
|
var CustomField = BaseField.extend({
|
|
2222
2379
|
type: import_v43.default.literal(FieldType._EXPERIMENTAL_CUSTOM),
|
|
2223
2380
|
defaultValue: CustomFieldValue.optional(),
|
|
2224
2381
|
src: import_v43.default.string().describe("Module source path for the custom field component"),
|
|
2225
2382
|
configuration: import_v43.default.unknown().optional()
|
|
2383
|
+
}).meta({
|
|
2384
|
+
description: "An expiremental custom field that is defined by a module source path",
|
|
2385
|
+
id: "CustomField"
|
|
2226
2386
|
});
|
|
2227
2387
|
var FieldStyleVariant = import_v43.default.enum(["default", "highlighted"]);
|
|
2228
2388
|
var LoaderField = BaseField.extend({
|
|
@@ -2232,22 +2392,25 @@ var LoaderField = BaseField.extend({
|
|
|
2232
2392
|
configuration: import_v43.default.object({
|
|
2233
2393
|
text: TranslationConfig.describe("Display text above the loading spinner")
|
|
2234
2394
|
})
|
|
2235
|
-
}).
|
|
2236
|
-
"A non-interactive field that indicates an in progress operation in form"
|
|
2237
|
-
|
|
2395
|
+
}).meta({
|
|
2396
|
+
description: "A non-interactive field that indicates an in progress operation in form",
|
|
2397
|
+
id: "LoaderField"
|
|
2398
|
+
});
|
|
2238
2399
|
var HiddenField = BaseField.extend({
|
|
2239
2400
|
type: import_v43.default.literal(FieldType.ALPHA_HIDDEN),
|
|
2240
2401
|
required: import_v43.default.boolean().default(false).optional(),
|
|
2241
2402
|
defaultValue: TextValue.optional()
|
|
2242
|
-
}).
|
|
2243
|
-
"A non-interactive, hidden field that only hold a value in the form"
|
|
2244
|
-
|
|
2403
|
+
}).meta({
|
|
2404
|
+
description: "A non-interactive, hidden field that only hold a value in the form",
|
|
2405
|
+
id: "HiddenField"
|
|
2406
|
+
});
|
|
2245
2407
|
var UserRoleField = BaseField.extend({
|
|
2246
2408
|
type: import_v43.default.literal(FieldType.USER_ROLE),
|
|
2247
2409
|
defaultValue: TextValue.optional()
|
|
2248
|
-
}).
|
|
2249
|
-
"A select dropdown that is automatically populated with available user roles"
|
|
2250
|
-
|
|
2410
|
+
}).meta({
|
|
2411
|
+
description: "A select dropdown that is automatically populated with available user roles",
|
|
2412
|
+
id: "UserRoleField"
|
|
2413
|
+
});
|
|
2251
2414
|
var FieldConfig = import_v43.default.discriminatedUnion("type", [
|
|
2252
2415
|
FieldGroup,
|
|
2253
2416
|
Address,
|
|
@@ -2346,16 +2509,19 @@ var VerificationPageConfig = FormPageConfig.extend({
|
|
|
2346
2509
|
type: z21.literal(PageTypes.enum.VERIFICATION),
|
|
2347
2510
|
actions: VerificationActionConfig
|
|
2348
2511
|
});
|
|
2349
|
-
var PageConfig = z21.discriminatedUnion("type", [
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2512
|
+
var PageConfig = z21.discriminatedUnion("type", [FormPageConfig, VerificationPageConfig]).meta({
|
|
2513
|
+
id: "PageConfig",
|
|
2514
|
+
description: "Configuration for a single page in a form. Either a form page with fields and a continue button, or a verification page with verify/cancel options."
|
|
2515
|
+
});
|
|
2353
2516
|
|
|
2354
2517
|
// ../commons/src/events/FormConfig.ts
|
|
2355
2518
|
var DeclarationFormConfig = z22.object({
|
|
2356
2519
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2357
2520
|
pages: z22.array(FormPageConfig)
|
|
2358
|
-
}).
|
|
2521
|
+
}).meta({
|
|
2522
|
+
id: "DeclarationFormConfig",
|
|
2523
|
+
description: "Configuration of the declaration form."
|
|
2524
|
+
});
|
|
2359
2525
|
var ActionFormConfig = z22.object({
|
|
2360
2526
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2361
2527
|
pages: z22.array(PageConfig)
|
|
@@ -2455,6 +2621,9 @@ var DeduplicationConfig = z23.object({
|
|
|
2455
2621
|
id: z23.string(),
|
|
2456
2622
|
label: TranslationConfig,
|
|
2457
2623
|
query: Clause
|
|
2624
|
+
}).meta({
|
|
2625
|
+
id: "DeduplicationConfig",
|
|
2626
|
+
description: "Configuration for duplicate detection on a declare or register action. The query is built from fuzzy / strict / date-range matchers combined with and/or/not."
|
|
2458
2627
|
});
|
|
2459
2628
|
|
|
2460
2629
|
// ../commons/src/events/ActionConfig.ts
|
|
@@ -2572,17 +2741,42 @@ var ActionConfig = z24.discriminatedUnion("type", [
|
|
|
2572
2741
|
* OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
|
|
2573
2742
|
* and treat them as "models" instead of duplicating the data structure in each endpoint.
|
|
2574
2743
|
*/
|
|
2575
|
-
ReadActionConfig.meta({
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2744
|
+
ReadActionConfig.meta({
|
|
2745
|
+
id: "ReadActionConfig",
|
|
2746
|
+
description: "Configuration for the read action \u2014 defines the record-tab content displayed on the event overview page."
|
|
2747
|
+
}),
|
|
2748
|
+
DeclareConfig.meta({
|
|
2749
|
+
id: "DeclareActionConfig",
|
|
2750
|
+
description: "Configuration for the declare action. Includes review-page fields. Shared with the notify action (ActionType.NOTIFY)."
|
|
2751
|
+
}),
|
|
2752
|
+
RejectConfig.meta({
|
|
2753
|
+
id: "RejectActionConfig",
|
|
2754
|
+
description: "Configuration for rejecting a record before registration."
|
|
2755
|
+
}),
|
|
2756
|
+
RegisterConfig.meta({
|
|
2757
|
+
id: "RegisterActionConfig",
|
|
2758
|
+
description: "Configuration for registering a record."
|
|
2759
|
+
}),
|
|
2579
2760
|
PrintCertificateActionConfig.meta({
|
|
2580
|
-
id: "PrintCertificateActionConfig"
|
|
2761
|
+
id: "PrintCertificateActionConfig",
|
|
2762
|
+
description: "Configuration for printing a certificate of a registered record."
|
|
2763
|
+
}),
|
|
2764
|
+
RequestCorrectionConfig.meta({
|
|
2765
|
+
id: "RequestCorrectionActionConfig",
|
|
2766
|
+
description: "Configuration for requesting a correction on a registered record."
|
|
2581
2767
|
}),
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2768
|
+
EditActionConfig.meta({
|
|
2769
|
+
id: "EditActionConfig",
|
|
2770
|
+
description: "Configuration for editing a record before registration."
|
|
2771
|
+
}),
|
|
2772
|
+
ArchiveConfig.meta({
|
|
2773
|
+
id: "ArchiveActionConfig",
|
|
2774
|
+
description: "Configuration for archiving a record."
|
|
2775
|
+
}),
|
|
2776
|
+
CustomActionConfig.meta({
|
|
2777
|
+
id: "CustomActionConfig",
|
|
2778
|
+
description: "Configuration for a country-defined custom action. An event may include any number of these."
|
|
2779
|
+
})
|
|
2586
2780
|
]).describe(
|
|
2587
2781
|
"Configuration of an action available for an event. Data collected depends on the action type and is accessible through the annotation property in ActionDocument."
|
|
2588
2782
|
).meta({ id: "ActionConfig" });
|
|
@@ -2658,7 +2852,10 @@ var Field = BaseField2.extend({
|
|
|
2658
2852
|
}).describe("Custom field defined for the summary view.");
|
|
2659
2853
|
var SummaryConfig = z27.object({
|
|
2660
2854
|
fields: z27.array(z27.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
|
|
2661
|
-
}).
|
|
2855
|
+
}).meta({
|
|
2856
|
+
id: "SummaryConfig",
|
|
2857
|
+
description: "Configuration of the event overview page. Defines which declaration fields appear in the record summary, optionally with custom labels, empty-value messages, and templated values."
|
|
2858
|
+
});
|
|
2662
2859
|
|
|
2663
2860
|
// ../commons/src/events/AdvancedSearchConfig.ts
|
|
2664
2861
|
var z28 = __toESM(require("zod/v4"));
|
|
@@ -2782,6 +2979,9 @@ var AdvancedSearchField = z28.discriminatedUnion("fieldType", [FieldConfigSchema
|
|
|
2782
2979
|
var AdvancedSearchConfig = z28.object({
|
|
2783
2980
|
title: TranslationConfig.describe("Advanced search tab title"),
|
|
2784
2981
|
fields: z28.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
|
|
2982
|
+
}).meta({
|
|
2983
|
+
id: "AdvancedSearchConfig",
|
|
2984
|
+
description: "Configuration of one advanced search tab. Each tab has a title and a list of searchable fields \u2014 either declaration fields (via `field()`) or event metadata (via `event()`)."
|
|
2785
2985
|
});
|
|
2786
2986
|
|
|
2787
2987
|
// ../commons/src/events/utils.ts
|
|
@@ -3649,7 +3849,7 @@ var _EventConfigBase = z33.object({
|
|
|
3649
3849
|
),
|
|
3650
3850
|
label: TranslationConfig.describe("Human-readable label for the event type."),
|
|
3651
3851
|
actions: z33.array(ActionConfig).describe(
|
|
3652
|
-
"Configuration of
|
|
3852
|
+
"Configuration of core and custom actions associated with the event."
|
|
3653
3853
|
),
|
|
3654
3854
|
actionOrder: z33.array(z33.string()).optional().describe(
|
|
3655
3855
|
"Order of actions in the action menu. Use either the action type for core actions or the customActionType for custom actions."
|
|
@@ -3661,7 +3861,7 @@ var _EventConfigBase = z33.object({
|
|
|
3661
3861
|
"Configuration of fields available in the advanced search feature."
|
|
3662
3862
|
),
|
|
3663
3863
|
flags: z33.array(FlagConfig).optional().default([]).describe(
|
|
3664
|
-
"Configuration of flags associated with the actions of this event type."
|
|
3864
|
+
"Configuration of custom flags associated with the actions of this event type."
|
|
3665
3865
|
),
|
|
3666
3866
|
analytics: z33.boolean().optional().default(true).describe(
|
|
3667
3867
|
"Indicates whether the records of this event type are included in analytics"
|
|
@@ -3674,8 +3874,9 @@ var EventConfig = _EventConfigBase.superRefine((event2, ctx) => {
|
|
|
3674
3874
|
validateActionFlags(event2, ctx);
|
|
3675
3875
|
validateActionOrder(event2, ctx);
|
|
3676
3876
|
}).meta({
|
|
3677
|
-
id: "EventConfig"
|
|
3678
|
-
|
|
3877
|
+
id: "EventConfig",
|
|
3878
|
+
description: "Configuration defining an event type registered in OpenCRVS (for example birth or death)."
|
|
3879
|
+
});
|
|
3679
3880
|
|
|
3680
3881
|
// ../commons/src/events/EventConfigInput.ts
|
|
3681
3882
|
var defineDeclarationForm = (form) => DeclarationFormConfig.parse(form);
|
|
@@ -3897,6 +4098,9 @@ var WorkqueueColumnValue = z34.object({
|
|
|
3897
4098
|
var WorkqueueColumn = z34.object({
|
|
3898
4099
|
label: TranslationConfig,
|
|
3899
4100
|
value: WorkqueueColumnValue
|
|
4101
|
+
}).meta({
|
|
4102
|
+
id: "WorkqueueColumn",
|
|
4103
|
+
description: "Configuration for a single workqueue column. The value references an event metadata key (e.g. `dateOfEvent`, `status`, `trackingId`)."
|
|
3900
4104
|
});
|
|
3901
4105
|
function defineWorkqueuesColumns(workqueueColumns) {
|
|
3902
4106
|
return workqueueColumns.map(
|
|
@@ -4099,18 +4303,11 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
|
|
|
4099
4303
|
query: true,
|
|
4100
4304
|
columns: true
|
|
4101
4305
|
});
|
|
4102
|
-
var WorkqueueConfigInput =
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
query: CountryConfigQueryInputType,
|
|
4108
|
-
action: z37.object({ type: WorkqueueActionType }).optional().describe(
|
|
4109
|
-
"Workqueue call-to-action button configuration. This determines the quick action button shown on each event card and the action taken when the button is clicked."
|
|
4110
|
-
),
|
|
4111
|
-
columns: z37.array(WorkqueueColumn).default(mandatoryColumns),
|
|
4112
|
-
icon: AvailableIcons,
|
|
4113
|
-
emptyMessage: TranslationConfig.optional()
|
|
4306
|
+
var WorkqueueConfigInput = WorkqueueConfig.extend({
|
|
4307
|
+
query: CountryConfigQueryInputType
|
|
4308
|
+
}).meta({
|
|
4309
|
+
id: "WorkqueueConfig",
|
|
4310
|
+
description: "Configuration for a single workqueue. Defines the filter applied to the event index, the quick-action button, the columns shown on each row, and the message rendered when the queue is empty."
|
|
4114
4311
|
});
|
|
4115
4312
|
var WorkqueueCountInput = z37.array(
|
|
4116
4313
|
z37.object({ slug: z37.string(), query: QueryType })
|
|
@@ -4150,6 +4347,11 @@ var BaseActionInput = z38.object({
|
|
|
4150
4347
|
originalActionId: UUID.optional(),
|
|
4151
4348
|
// should not be part of base action.
|
|
4152
4349
|
keepAssignment: z38.boolean().optional(),
|
|
4350
|
+
keepAssignmentIfAccepted: z38.boolean().optional(),
|
|
4351
|
+
keepAssignmentIfRejected: z38.boolean().optional(),
|
|
4352
|
+
waitFor: z38.boolean().default(true).describe(
|
|
4353
|
+
"Whether action waits for the indexing before returning. Defaults to true. Setting this to to false completes faster but might lead to stale data in the client if the client tries to read the event immediately after performing the action. Use with care."
|
|
4354
|
+
),
|
|
4153
4355
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
4154
4356
|
// @TODO: createdAtLocation should be limited to actions that system users can perform. For normal users, it should not be part of the base action.
|
|
4155
4357
|
createdAtLocation: UUID.nullish().describe(
|
|
@@ -4329,7 +4531,7 @@ var Draft = z39.object({
|
|
|
4329
4531
|
}).describe(
|
|
4330
4532
|
"A temporary storage for an action. Stored with details of the event, creator and creation time."
|
|
4331
4533
|
);
|
|
4332
|
-
var DraftInput = BaseActionInput.extend({
|
|
4534
|
+
var DraftInput = BaseActionInput.omit({ waitFor: true }).extend({
|
|
4333
4535
|
type: ActionTypes.exclude([ActionTypes.enum.DELETE]),
|
|
4334
4536
|
status: z39.enum([
|
|
4335
4537
|
ActionStatus.Requested,
|