@opencrvs/toolkit 2.0.0-rc.3c7efd6 → 2.0.0-rc.3c82a4c
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 +11 -0
- package/dist/application-config/index.js +28 -31
- package/dist/cli.js +499 -167
- package/dist/commons/api/router.d.ts +3336 -258
- package/dist/commons/application-config/index.d.ts +16 -4
- 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 +3 -0
- package/dist/commons/events/EventIndex.d.ts +0 -3
- package/dist/commons/events/EventMetadata.d.ts +0 -7
- package/dist/commons/events/WorkqueueConfig.d.ts +146 -146
- 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/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/events/index.js +106 -75
- 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 +497 -165
- 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 +38 -45
- package/opencrvs-toolkit-2.0.0-rc.3c82a4c.tgz +0 -0
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/opencrvs-toolkit-2.0.0-rc.3c7efd6.tgz +0 -0
|
@@ -652,7 +652,10 @@ var ActionConditional = z7.discriminatedUnion("type", [
|
|
|
652
652
|
ShowConditional,
|
|
653
653
|
// Action can be shown to the user in the list but as disabled
|
|
654
654
|
EnableConditional
|
|
655
|
-
])
|
|
655
|
+
]).meta({
|
|
656
|
+
description: "Action conditional configuration",
|
|
657
|
+
id: "ActionConditional"
|
|
658
|
+
});
|
|
656
659
|
var DisplayOnReviewConditional = z7.object({
|
|
657
660
|
type: z7.literal(ConditionalType.DISPLAY_ON_REVIEW),
|
|
658
661
|
conditional: Conditional
|
|
@@ -980,28 +983,20 @@ function schemaPriority(schema) {
|
|
|
980
983
|
return idx === -1 ? 9999 : idx;
|
|
981
984
|
}
|
|
982
985
|
function safeUnion(schemas) {
|
|
986
|
+
const sortedSchemas = [...schemas].sort(
|
|
987
|
+
(a, b) => schemaPriority(a) - schemaPriority(b)
|
|
988
|
+
);
|
|
983
989
|
return z12.any().superRefine((val, ctx) => {
|
|
984
|
-
const
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
if (successful.length === 0) {
|
|
989
|
-
ctx.addIssue({
|
|
990
|
-
code: "invalid_type",
|
|
991
|
-
expected: "custom",
|
|
992
|
-
message: "Value does not match any schema"
|
|
993
|
-
});
|
|
994
|
-
return;
|
|
995
|
-
}
|
|
996
|
-
successful.sort((a, b) => schemaPriority(a) - schemaPriority(b));
|
|
997
|
-
const best = successful[0];
|
|
998
|
-
if (!best.safeParse(val).success) {
|
|
999
|
-
ctx.addIssue({
|
|
1000
|
-
expected: "custom",
|
|
1001
|
-
code: "invalid_type",
|
|
1002
|
-
message: "Value did not match the best schema"
|
|
1003
|
-
});
|
|
990
|
+
for (const schema of sortedSchemas) {
|
|
991
|
+
if (schema.safeParse(val).success) {
|
|
992
|
+
return;
|
|
993
|
+
}
|
|
1004
994
|
}
|
|
995
|
+
ctx.addIssue({
|
|
996
|
+
code: "invalid_type",
|
|
997
|
+
expected: "custom",
|
|
998
|
+
message: "Value does not match any schema"
|
|
999
|
+
});
|
|
1005
1000
|
}).meta({
|
|
1006
1001
|
description: "Value that matches exactly one of the possible schema types (TextValue, DateValue, DateRangeFieldValue). The best matching schema is chosen by priority."
|
|
1007
1002
|
});
|
|
@@ -1311,6 +1306,9 @@ var FlagConfig = z15.object({
|
|
|
1311
1306
|
"Indicates if this flag expects an action to be performed to be cleared."
|
|
1312
1307
|
),
|
|
1313
1308
|
label: TranslationConfig.describe("Human readable label of the flag.")
|
|
1309
|
+
}).meta({
|
|
1310
|
+
description: "Flag configuration",
|
|
1311
|
+
id: "FlagConfig"
|
|
1314
1312
|
});
|
|
1315
1313
|
var ActionFlagConfig = z15.object({
|
|
1316
1314
|
id: Flag,
|
|
@@ -1318,6 +1316,9 @@ var ActionFlagConfig = z15.object({
|
|
|
1318
1316
|
conditional: Conditional.optional().describe(
|
|
1319
1317
|
"When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
|
|
1320
1318
|
)
|
|
1319
|
+
}).meta({
|
|
1320
|
+
description: "Action flag configuration",
|
|
1321
|
+
id: "ActionFlagConfig"
|
|
1321
1322
|
});
|
|
1322
1323
|
|
|
1323
1324
|
// ../commons/src/events/EventMetadata.ts
|
|
@@ -1339,8 +1340,7 @@ var ActionCreationMetadata = z16.object({
|
|
|
1339
1340
|
),
|
|
1340
1341
|
createdByUserType: z16.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1341
1342
|
acceptedAt: z16.iso.datetime().describe("Timestamp when the action request was accepted."),
|
|
1342
|
-
createdByRole: z16.string().optional().describe("Role of the user at the time of action request creation.")
|
|
1343
|
-
createdBySignature: z16.string().nullish().describe("Signature of the user who created the action request.")
|
|
1343
|
+
createdByRole: z16.string().optional().describe("Role of the user at the time of action request creation.")
|
|
1344
1344
|
});
|
|
1345
1345
|
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
1346
1346
|
registrationNumber: z16.string().describe(
|
|
@@ -1368,9 +1368,6 @@ var EventMetadata = z16.object({
|
|
|
1368
1368
|
createdAtLocation: UUID.nullish().describe(
|
|
1369
1369
|
"Location of the user who created the event."
|
|
1370
1370
|
),
|
|
1371
|
-
createdBySignature: DocumentPath.nullish().describe(
|
|
1372
|
-
"Signature of the user who created the event."
|
|
1373
|
-
),
|
|
1374
1371
|
updatedAtLocation: UUID.nullish().describe(
|
|
1375
1372
|
"Location of the user who last changed the status."
|
|
1376
1373
|
),
|
|
@@ -1663,7 +1660,7 @@ var FieldId = import_v43.default.string().superRefine((val, ctx) => {
|
|
|
1663
1660
|
}
|
|
1664
1661
|
}).describe("Unique identifier for the field");
|
|
1665
1662
|
var FieldReference = import_v43.default.object({
|
|
1666
|
-
$$field: FieldId,
|
|
1663
|
+
$$field: FieldId.describe("Id of the field to reference"),
|
|
1667
1664
|
$$subfield: import_v43.default.array(import_v43.default.string()).optional().default([]).describe(
|
|
1668
1665
|
'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
|
|
1669
1666
|
)
|
|
@@ -2376,10 +2373,10 @@ var VerificationPageConfig = FormPageConfig.extend({
|
|
|
2376
2373
|
type: z21.literal(PageTypes.enum.VERIFICATION),
|
|
2377
2374
|
actions: VerificationActionConfig
|
|
2378
2375
|
});
|
|
2379
|
-
var PageConfig = z21.discriminatedUnion("type", [
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2376
|
+
var PageConfig = z21.discriminatedUnion("type", [FormPageConfig, VerificationPageConfig]).meta({
|
|
2377
|
+
description: "Page configuration",
|
|
2378
|
+
id: "PageConfig"
|
|
2379
|
+
});
|
|
2383
2380
|
|
|
2384
2381
|
// ../commons/src/events/FormConfig.ts
|
|
2385
2382
|
var DeclarationFormConfig = z22.object({
|
|
@@ -3679,7 +3676,7 @@ var _EventConfigBase = z33.object({
|
|
|
3679
3676
|
),
|
|
3680
3677
|
label: TranslationConfig.describe("Human-readable label for the event type."),
|
|
3681
3678
|
actions: z33.array(ActionConfig).describe(
|
|
3682
|
-
"Configuration of
|
|
3679
|
+
"Configuration of core and custom actions associated with the event."
|
|
3683
3680
|
),
|
|
3684
3681
|
actionOrder: z33.array(z33.string()).optional().describe(
|
|
3685
3682
|
"Order of actions in the action menu. Use either the action type for core actions or the customActionType for custom actions."
|
|
@@ -3691,7 +3688,7 @@ var _EventConfigBase = z33.object({
|
|
|
3691
3688
|
"Configuration of fields available in the advanced search feature."
|
|
3692
3689
|
),
|
|
3693
3690
|
flags: z33.array(FlagConfig).optional().default([]).describe(
|
|
3694
|
-
"Configuration of flags associated with the actions of this event type."
|
|
3691
|
+
"Configuration of custom flags associated with the actions of this event type."
|
|
3695
3692
|
),
|
|
3696
3693
|
analytics: z33.boolean().optional().default(true).describe(
|
|
3697
3694
|
"Indicates whether the records of this event type are included in analytics"
|
|
@@ -4129,18 +4126,11 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
|
|
|
4129
4126
|
query: true,
|
|
4130
4127
|
columns: true
|
|
4131
4128
|
});
|
|
4132
|
-
var WorkqueueConfigInput =
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
query: CountryConfigQueryInputType,
|
|
4138
|
-
action: z37.object({ type: WorkqueueActionType }).optional().describe(
|
|
4139
|
-
"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."
|
|
4140
|
-
),
|
|
4141
|
-
columns: z37.array(WorkqueueColumn).default(mandatoryColumns),
|
|
4142
|
-
icon: AvailableIcons,
|
|
4143
|
-
emptyMessage: TranslationConfig.optional()
|
|
4129
|
+
var WorkqueueConfigInput = WorkqueueConfig.extend({
|
|
4130
|
+
query: CountryConfigQueryInputType
|
|
4131
|
+
}).meta({
|
|
4132
|
+
description: "Workqueue configuration",
|
|
4133
|
+
id: "WorkqueueConfig"
|
|
4144
4134
|
});
|
|
4145
4135
|
var WorkqueueCountInput = z37.array(
|
|
4146
4136
|
z37.object({ slug: z37.string(), query: QueryType })
|
|
@@ -4180,6 +4170,9 @@ var BaseActionInput = z38.object({
|
|
|
4180
4170
|
originalActionId: UUID.optional(),
|
|
4181
4171
|
// should not be part of base action.
|
|
4182
4172
|
keepAssignment: z38.boolean().optional(),
|
|
4173
|
+
keepAssignmentIfAccepted: z38.boolean().optional(),
|
|
4174
|
+
keepAssignmentIfRejected: z38.boolean().optional(),
|
|
4175
|
+
waitFor: z38.boolean().optional(),
|
|
4183
4176
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
4184
4177
|
// @TODO: createdAtLocation should be limited to actions that system users can perform. For normal users, it should not be part of the base action.
|
|
4185
4178
|
createdAtLocation: UUID.nullish().describe(
|
|
Binary file
|
package/package.json
CHANGED
package/tsconfig.tsbuildinfo
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["./src/cli.ts","./src/api/index.ts","./src/application-config/index.ts","./src/conditionals/index.ts","./src/events/deduplication.ts","./src/events/index.ts","./src/migrations/v2.0/add-birth-certificate-issuance-flag.ts","./src/migrations/v2.0/add-resend-invite-notification.ts","./src/migrations/v2.0/checkout-upstream-files.ts","./src/migrations/v2.0/convert-config-files-to-ts.ts","./src/migrations/v2.0/convert-paragraph-to-heading.ts","./src/migrations/v2.0/create-events-index.ts","./src/migrations/v2.0/delete-infrastructure-directory.ts","./src/migrations/v2.0/index.ts","./src/migrations/v2.0/make-built-in-validate-actions-custom.ts","./src/migrations/v2.0/merge-infrastructure-directory.ts","./src/migrations/v2.0/migrate-application-config-url.ts","./src/migrations/v2.0/migrate-scopes.ts","./src/migrations/v2.0/migrate-validated-workqueue-status-to-flag.ts","./src/migrations/v2.0/migrate-workqueue-configs.ts","./src/migrations/v2.0/remove-delete-actions.ts","./src/migrations/v2.0/remove-demo-scope.ts","./src/migrations/v2.0/remove-deprecated-imports.ts","./src/migrations/v2.0/remove-fhir-url-helpers.ts","./src/migrations/v2.0/remove-hearth-migrations.ts","./src/migrations/v2.0/remove-old-statistics-service.ts","./src/migrations/v2.0/remove-pending-certification-flag.ts","./src/migrations/v2.0/remove-review-from-register-action.ts","./src/migrations/v2.0/remove-unused-environment-variables.ts","./src/migrations/v2.0/rename-api-paths.ts","./src/migrations/v2.0/rename-location-parent-id.ts","./src/migrations/v2.0/simplify-analytics-precalculations.ts","./src/migrations/v2.0/update-package-json.ts","./src/notification/index.ts","./src/scopes/index.ts"],"version":"5.6.3"}
|
|
1
|
+
{"root":["./src/cli.ts","./src/api/index.ts","./src/application-config/index.ts","./src/conditionals/index.ts","./src/events/deduplication.ts","./src/events/index.ts","./src/migrations/v2.0/add-birth-certificate-issuance-flag.ts","./src/migrations/v2.0/add-resend-invite-notification.ts","./src/migrations/v2.0/checkout-upstream-files.ts","./src/migrations/v2.0/convert-config-files-to-ts.ts","./src/migrations/v2.0/convert-paragraph-to-heading.ts","./src/migrations/v2.0/create-events-index.ts","./src/migrations/v2.0/delete-infrastructure-directory.ts","./src/migrations/v2.0/fix-accept-requested-registration-function-type.ts","./src/migrations/v2.0/index.ts","./src/migrations/v2.0/make-built-in-validate-actions-custom.ts","./src/migrations/v2.0/merge-infrastructure-directory.ts","./src/migrations/v2.0/migrate-application-config-url.ts","./src/migrations/v2.0/migrate-scopes.ts","./src/migrations/v2.0/migrate-validated-workqueue-status-to-flag.ts","./src/migrations/v2.0/migrate-workqueue-configs.ts","./src/migrations/v2.0/remove-delete-actions.ts","./src/migrations/v2.0/remove-demo-scope.ts","./src/migrations/v2.0/remove-deprecated-imports.ts","./src/migrations/v2.0/remove-fhir-url-helpers.ts","./src/migrations/v2.0/remove-hearth-migrations.ts","./src/migrations/v2.0/remove-old-statistics-service.ts","./src/migrations/v2.0/remove-pending-certification-flag.ts","./src/migrations/v2.0/remove-review-from-register-action.ts","./src/migrations/v2.0/remove-unused-environment-variables.ts","./src/migrations/v2.0/rename-api-paths.ts","./src/migrations/v2.0/rename-location-parent-id.ts","./src/migrations/v2.0/simplify-analytics-precalculations.ts","./src/migrations/v2.0/update-package-json.ts","./src/notification/index.ts","./src/scopes/index.ts"],"version":"5.6.3"}
|
|
Binary file
|