@opencrvs/toolkit 2.0.0-rc.18d8164 → 2.0.0-rc.18f6ed6
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/dist/application-config/index.js +29 -29
- package/dist/cli.js +392 -128
- package/dist/commons/api/router.d.ts +3359 -239
- package/dist/commons/conditionals/validate.d.ts +1 -0
- package/dist/commons/events/ActionDocument.d.ts +6 -0
- package/dist/commons/events/ActionInput.d.ts +114 -0
- package/dist/commons/events/Draft.d.ts +3 -0
- package/dist/commons/events/EventDocument.d.ts +3 -0
- package/dist/commons/events/EventIndex.d.ts +0 -3
- package/dist/commons/events/EventMetadata.d.ts +0 -7
- package/dist/commons/events/WorkqueueConfig.d.ts +146 -146
- package/dist/commons/events/state/index.d.ts +0 -4
- package/dist/commons/events/state/utils.d.ts +3 -2
- package/dist/commons/events/utils.d.ts +4 -1
- package/dist/conditionals/index.js +3 -1
- package/dist/events/index.js +58 -78
- 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 +390 -126
- 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 +45 -48
- package/dist/scopes/index.js +3 -1
- package/opencrvs-toolkit-2.0.0-rc.18f6ed6.tgz +0 -0
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/opencrvs-toolkit-2.0.0-rc.18d8164.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
|
+
description: "Action conditional configuration",
|
|
80
|
+
id: "ActionConditional"
|
|
81
|
+
});
|
|
79
82
|
var DisplayOnReviewConditional = z.object({
|
|
80
83
|
type: z.literal(ConditionalType.DISPLAY_ON_REVIEW),
|
|
81
84
|
conditional: Conditional
|
|
@@ -418,28 +421,20 @@ function schemaPriority(schema) {
|
|
|
418
421
|
return idx === -1 ? 9999 : idx;
|
|
419
422
|
}
|
|
420
423
|
function safeUnion(schemas) {
|
|
424
|
+
const sortedSchemas = [...schemas].sort(
|
|
425
|
+
(a, b) => schemaPriority(a) - schemaPriority(b)
|
|
426
|
+
);
|
|
421
427
|
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
|
-
});
|
|
428
|
+
for (const schema of sortedSchemas) {
|
|
429
|
+
if (schema.safeParse(val).success) {
|
|
430
|
+
return;
|
|
431
|
+
}
|
|
442
432
|
}
|
|
433
|
+
ctx.addIssue({
|
|
434
|
+
code: "invalid_type",
|
|
435
|
+
expected: "custom",
|
|
436
|
+
message: "Value does not match any schema"
|
|
437
|
+
});
|
|
443
438
|
}).meta({
|
|
444
439
|
description: "Value that matches exactly one of the possible schema types (TextValue, DateValue, DateRangeFieldValue). The best matching schema is chosen by priority."
|
|
445
440
|
});
|
|
@@ -839,7 +834,9 @@ var ScopeType = z11.enum([
|
|
|
839
834
|
var EncodedScope = z11.string().brand("EncodedScope");
|
|
840
835
|
var DEFAULT_SCOPE_OPTIONS = {
|
|
841
836
|
placeOfEvent: JurisdictionFilter.enum.all,
|
|
842
|
-
accessLevel: JurisdictionFilter.enum.all
|
|
837
|
+
accessLevel: JurisdictionFilter.enum.all,
|
|
838
|
+
registeredIn: JurisdictionFilter.enum.all,
|
|
839
|
+
declaredIn: JurisdictionFilter.enum.all
|
|
843
840
|
};
|
|
844
841
|
|
|
845
842
|
// ../commons/src/authentication.ts
|
|
@@ -992,8 +989,9 @@ var RequestedCorrectionAction = ActionBase.extend(
|
|
|
992
989
|
var ApprovedCorrectionAction = ActionBase.extend(
|
|
993
990
|
z13.object({
|
|
994
991
|
type: z13.literal(ActionType.APPROVE_CORRECTION),
|
|
995
|
-
requestId: z13.string()
|
|
992
|
+
requestId: z13.string(),
|
|
996
993
|
// TODO move into 'content' property
|
|
994
|
+
content: z13.object({ immediateCorrection: z13.boolean().optional() }).optional()
|
|
997
995
|
}).shape
|
|
998
996
|
);
|
|
999
997
|
var RejectedCorrectionAction = ActionBase.extend(
|
|
@@ -1085,6 +1083,9 @@ var FlagConfig = z14.object({
|
|
|
1085
1083
|
"Indicates if this flag expects an action to be performed to be cleared."
|
|
1086
1084
|
),
|
|
1087
1085
|
label: TranslationConfig.describe("Human readable label of the flag.")
|
|
1086
|
+
}).meta({
|
|
1087
|
+
description: "Flag configuration",
|
|
1088
|
+
id: "FlagConfig"
|
|
1088
1089
|
});
|
|
1089
1090
|
var ActionFlagConfig = z14.object({
|
|
1090
1091
|
id: Flag,
|
|
@@ -1092,6 +1093,9 @@ var ActionFlagConfig = z14.object({
|
|
|
1092
1093
|
conditional: Conditional.optional().describe(
|
|
1093
1094
|
"When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
|
|
1094
1095
|
)
|
|
1096
|
+
}).meta({
|
|
1097
|
+
description: "Action flag configuration",
|
|
1098
|
+
id: "ActionFlagConfig"
|
|
1095
1099
|
});
|
|
1096
1100
|
|
|
1097
1101
|
// ../commons/src/events/EventMetadata.ts
|
|
@@ -1113,8 +1117,7 @@ var ActionCreationMetadata = z15.object({
|
|
|
1113
1117
|
),
|
|
1114
1118
|
createdByUserType: z15.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1115
1119
|
acceptedAt: z15.iso.datetime().describe("Timestamp when the action request was accepted."),
|
|
1116
|
-
createdByRole: z15.string().optional().describe("Role of the user at the time of action request creation.")
|
|
1117
|
-
createdBySignature: z15.string().nullish().describe("Signature of the user who created the action request.")
|
|
1120
|
+
createdByRole: z15.string().optional().describe("Role of the user at the time of action request creation.")
|
|
1118
1121
|
});
|
|
1119
1122
|
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
1120
1123
|
registrationNumber: z15.string().describe(
|
|
@@ -1142,9 +1145,6 @@ var EventMetadata = z15.object({
|
|
|
1142
1145
|
createdAtLocation: UUID.nullish().describe(
|
|
1143
1146
|
"Location of the user who created the event."
|
|
1144
1147
|
),
|
|
1145
|
-
createdBySignature: DocumentPath.nullish().describe(
|
|
1146
|
-
"Signature of the user who created the event."
|
|
1147
|
-
),
|
|
1148
1148
|
updatedAtLocation: UUID.nullish().describe(
|
|
1149
1149
|
"Location of the user who last changed the status."
|
|
1150
1150
|
),
|
|
@@ -1408,7 +1408,7 @@ var FieldId = import_v43.default.string().superRefine((val, ctx) => {
|
|
|
1408
1408
|
}
|
|
1409
1409
|
}).describe("Unique identifier for the field");
|
|
1410
1410
|
var FieldReference = import_v43.default.object({
|
|
1411
|
-
$$field: FieldId,
|
|
1411
|
+
$$field: FieldId.describe("Id of the field to reference"),
|
|
1412
1412
|
$$subfield: import_v43.default.array(import_v43.default.string()).optional().default([]).describe(
|
|
1413
1413
|
'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
|
|
1414
1414
|
)
|