@opencrvs/toolkit 1.9.7-rc.4e5787b → 1.9.7-rc.51d3a8b
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/commons/api/router.d.ts +239 -223
- package/dist/commons/events/ActionConfig.d.ts +70 -0
- package/dist/commons/events/ActionDocument.d.ts +47 -47
- package/dist/commons/events/Draft.d.ts +1 -1
- package/dist/commons/events/EventConfig.d.ts +56 -0
- package/dist/commons/events/EventDocument.d.ts +19 -19
- package/dist/commons/events/EventIndex.d.ts +3 -3
- package/dist/commons/events/EventMetadata.d.ts +7 -7
- package/dist/commons/events/FieldConfig.d.ts +21 -0
- package/dist/commons/events/FormConfig.d.ts +42 -0
- package/dist/commons/events/PageConfig.d.ts +28 -0
- package/dist/commons/events/defineConfig.d.ts +8 -0
- package/dist/commons/events/state/index.d.ts +3 -3
- package/dist/commons/events/state/utils.d.ts +21 -21
- package/dist/commons/events/utils.d.ts +35 -19
- package/dist/events/index.js +11 -5
- package/dist/notification/index.js +11 -5
- package/dist/scopes/index.d.ts +3 -2
- package/dist/scopes/index.js +3 -1
- package/package.json +1 -1
package/dist/events/index.js
CHANGED
|
@@ -993,6 +993,7 @@ var SCOPES = {
|
|
|
993
993
|
RECORD_IMPORT: "record.import",
|
|
994
994
|
RECORD_EXPORT: "record.export",
|
|
995
995
|
RECORD_REINDEX: "record.reindex",
|
|
996
|
+
INTEGRATION_CREATE: "integration.create",
|
|
996
997
|
// declare
|
|
997
998
|
RECORD_DECLARE_BIRTH: "record.declare-birth",
|
|
998
999
|
RECORD_DECLARE_BIRTH_MY_JURISDICTION: "record.declare-birth:my-jurisdiction",
|
|
@@ -1067,7 +1068,8 @@ var IntegrationScopes = z10.union([
|
|
|
1067
1068
|
z10.literal(SCOPES.WEBHOOK),
|
|
1068
1069
|
z10.literal(SCOPES.NATIONALID),
|
|
1069
1070
|
z10.literal(SCOPES.NOTIFICATION_API),
|
|
1070
|
-
z10.literal(SCOPES.RECORDSEARCH)
|
|
1071
|
+
z10.literal(SCOPES.RECORDSEARCH),
|
|
1072
|
+
z10.literal(SCOPES.INTEGRATION_CREATE)
|
|
1071
1073
|
]);
|
|
1072
1074
|
var InternalOperationsScopes = z10.union([
|
|
1073
1075
|
z10.literal(SCOPES.RECORD_REINDEX),
|
|
@@ -1435,7 +1437,7 @@ var ActionBase = z12.object({
|
|
|
1435
1437
|
),
|
|
1436
1438
|
createdAt: z12.string().datetime().describe("Timestamp indicating when the action was created."),
|
|
1437
1439
|
createdBy: z12.string().describe("Identifier of the user who created the action."),
|
|
1438
|
-
createdByRole: z12.string().describe("Role of the user who created the action."),
|
|
1440
|
+
createdByRole: z12.string().optional().describe("Role of the user who created the action."),
|
|
1439
1441
|
createdBySignature: z12.string().nullish().describe("Reference to the signature of the user who created the action."),
|
|
1440
1442
|
// @TODO: createdAtLocation should be non-nullable in the future once all actions have this field populated.
|
|
1441
1443
|
createdAtLocation: UUID.nullish().describe(
|
|
@@ -1679,7 +1681,7 @@ var ActionCreationMetadata = z14.object({
|
|
|
1679
1681
|
),
|
|
1680
1682
|
createdByUserType: z14.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1681
1683
|
acceptedAt: z14.iso.datetime().describe("Timestamp when the action request was accepted."),
|
|
1682
|
-
createdByRole: z14.string().describe("Role of the user at the time of action request creation."),
|
|
1684
|
+
createdByRole: z14.string().optional().describe("Role of the user at the time of action request creation."),
|
|
1683
1685
|
createdBySignature: z14.string().nullish().describe("Signature of the user who created the action request.")
|
|
1684
1686
|
});
|
|
1685
1687
|
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
@@ -1703,7 +1705,7 @@ var EventMetadata = z14.object({
|
|
|
1703
1705
|
placeOfEvent: UUID.nullish(),
|
|
1704
1706
|
createdBy: z14.string().describe("ID of the user who created the event."),
|
|
1705
1707
|
createdByUserType: z14.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1706
|
-
updatedByUserRole: z14.string().describe("Role of the user who last changed the status."),
|
|
1708
|
+
updatedByUserRole: z14.string().nullish().describe("Role of the user who last changed the status."),
|
|
1707
1709
|
// @TODO: createdAtLocation should be non-nullable in the future once all action requests have this field populated.
|
|
1708
1710
|
createdAtLocation: UUID.nullish().describe(
|
|
1709
1711
|
"Location of the user who created the event."
|
|
@@ -2191,12 +2193,16 @@ var HtmlFontVariant = z17.enum([
|
|
|
2191
2193
|
"h2",
|
|
2192
2194
|
"h1"
|
|
2193
2195
|
]);
|
|
2196
|
+
var ParagraphTextAlign = z17.enum(["left", "center", "right", "start", "end"]);
|
|
2194
2197
|
var ParagraphConfiguration = z17.object({
|
|
2195
2198
|
styles: z17.object({
|
|
2196
2199
|
fontVariant: HtmlFontVariant.optional().describe(
|
|
2197
2200
|
"Font variant to use for the paragraph text"
|
|
2198
2201
|
),
|
|
2199
|
-
hint: z17.boolean().optional().describe("When true, paragraph is styled as a hint with grey color")
|
|
2202
|
+
hint: z17.boolean().optional().describe("When true, paragraph is styled as a hint with grey color"),
|
|
2203
|
+
textAlign: ParagraphTextAlign.optional().describe(
|
|
2204
|
+
"Text alignment for the paragraph"
|
|
2205
|
+
)
|
|
2200
2206
|
}).optional()
|
|
2201
2207
|
}).default({});
|
|
2202
2208
|
var Paragraph = BaseField.extend({
|
|
@@ -629,6 +629,7 @@ var SCOPES = {
|
|
|
629
629
|
RECORD_IMPORT: "record.import",
|
|
630
630
|
RECORD_EXPORT: "record.export",
|
|
631
631
|
RECORD_REINDEX: "record.reindex",
|
|
632
|
+
INTEGRATION_CREATE: "integration.create",
|
|
632
633
|
// declare
|
|
633
634
|
RECORD_DECLARE_BIRTH: "record.declare-birth",
|
|
634
635
|
RECORD_DECLARE_BIRTH_MY_JURISDICTION: "record.declare-birth:my-jurisdiction",
|
|
@@ -703,7 +704,8 @@ var IntegrationScopes = z10.union([
|
|
|
703
704
|
z10.literal(SCOPES.WEBHOOK),
|
|
704
705
|
z10.literal(SCOPES.NATIONALID),
|
|
705
706
|
z10.literal(SCOPES.NOTIFICATION_API),
|
|
706
|
-
z10.literal(SCOPES.RECORDSEARCH)
|
|
707
|
+
z10.literal(SCOPES.RECORDSEARCH),
|
|
708
|
+
z10.literal(SCOPES.INTEGRATION_CREATE)
|
|
707
709
|
]);
|
|
708
710
|
var InternalOperationsScopes = z10.union([
|
|
709
711
|
z10.literal(SCOPES.RECORD_REINDEX),
|
|
@@ -1017,7 +1019,7 @@ var ActionBase = z12.object({
|
|
|
1017
1019
|
),
|
|
1018
1020
|
createdAt: z12.string().datetime().describe("Timestamp indicating when the action was created."),
|
|
1019
1021
|
createdBy: z12.string().describe("Identifier of the user who created the action."),
|
|
1020
|
-
createdByRole: z12.string().describe("Role of the user who created the action."),
|
|
1022
|
+
createdByRole: z12.string().optional().describe("Role of the user who created the action."),
|
|
1021
1023
|
createdBySignature: z12.string().nullish().describe("Reference to the signature of the user who created the action."),
|
|
1022
1024
|
// @TODO: createdAtLocation should be non-nullable in the future once all actions have this field populated.
|
|
1023
1025
|
createdAtLocation: UUID.nullish().describe(
|
|
@@ -1261,7 +1263,7 @@ var ActionCreationMetadata = z14.object({
|
|
|
1261
1263
|
),
|
|
1262
1264
|
createdByUserType: z14.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1263
1265
|
acceptedAt: z14.iso.datetime().describe("Timestamp when the action request was accepted."),
|
|
1264
|
-
createdByRole: z14.string().describe("Role of the user at the time of action request creation."),
|
|
1266
|
+
createdByRole: z14.string().optional().describe("Role of the user at the time of action request creation."),
|
|
1265
1267
|
createdBySignature: z14.string().nullish().describe("Signature of the user who created the action request.")
|
|
1266
1268
|
});
|
|
1267
1269
|
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
@@ -1285,7 +1287,7 @@ var EventMetadata = z14.object({
|
|
|
1285
1287
|
placeOfEvent: UUID.nullish(),
|
|
1286
1288
|
createdBy: z14.string().describe("ID of the user who created the event."),
|
|
1287
1289
|
createdByUserType: z14.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1288
|
-
updatedByUserRole: z14.string().describe("Role of the user who last changed the status."),
|
|
1290
|
+
updatedByUserRole: z14.string().nullish().describe("Role of the user who last changed the status."),
|
|
1289
1291
|
// @TODO: createdAtLocation should be non-nullable in the future once all action requests have this field populated.
|
|
1290
1292
|
createdAtLocation: UUID.nullish().describe(
|
|
1291
1293
|
"Location of the user who created the event."
|
|
@@ -1687,12 +1689,16 @@ var HtmlFontVariant = z17.enum([
|
|
|
1687
1689
|
"h2",
|
|
1688
1690
|
"h1"
|
|
1689
1691
|
]);
|
|
1692
|
+
var ParagraphTextAlign = z17.enum(["left", "center", "right", "start", "end"]);
|
|
1690
1693
|
var ParagraphConfiguration = z17.object({
|
|
1691
1694
|
styles: z17.object({
|
|
1692
1695
|
fontVariant: HtmlFontVariant.optional().describe(
|
|
1693
1696
|
"Font variant to use for the paragraph text"
|
|
1694
1697
|
),
|
|
1695
|
-
hint: z17.boolean().optional().describe("When true, paragraph is styled as a hint with grey color")
|
|
1698
|
+
hint: z17.boolean().optional().describe("When true, paragraph is styled as a hint with grey color"),
|
|
1699
|
+
textAlign: ParagraphTextAlign.optional().describe(
|
|
1700
|
+
"Text alignment for the paragraph"
|
|
1701
|
+
)
|
|
1696
1702
|
}).optional()
|
|
1697
1703
|
}).default({});
|
|
1698
1704
|
var Paragraph = BaseField.extend({
|
package/dist/scopes/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export declare const SCOPES: {
|
|
|
12
12
|
readonly RECORD_IMPORT: "record.import";
|
|
13
13
|
readonly RECORD_EXPORT: "record.export";
|
|
14
14
|
readonly RECORD_REINDEX: "record.reindex";
|
|
15
|
+
readonly INTEGRATION_CREATE: "integration.create";
|
|
15
16
|
readonly RECORD_DECLARE_BIRTH: "record.declare-birth";
|
|
16
17
|
readonly RECORD_DECLARE_BIRTH_MY_JURISDICTION: "record.declare-birth:my-jurisdiction";
|
|
17
18
|
readonly RECORD_DECLARE_DEATH: "record.declare-death";
|
|
@@ -63,7 +64,7 @@ export declare const SCOPES: {
|
|
|
63
64
|
readonly USER_DATA_SEEDING: "user.data-seeding";
|
|
64
65
|
};
|
|
65
66
|
export declare const SearchScopes: z.ZodUnion<readonly [z.ZodLiteral<"search.birth:my-jurisdiction">, z.ZodLiteral<"search.birth">, z.ZodLiteral<"search.death:my-jurisdiction">, z.ZodLiteral<"search.death">, z.ZodLiteral<"search.marriage:my-jurisdiction">, z.ZodLiteral<"search.marriage">]>;
|
|
66
|
-
declare const LiteralScopes: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodLiteral<"bypassratelimit">, z.ZodLiteral<"register">, z.ZodLiteral<"demo">, z.ZodLiteral<"config">]>, z.ZodUnion<readonly [z.ZodLiteral<"webhook">, z.ZodLiteral<"nationalId">, z.ZodLiteral<"notification-api">, z.ZodLiteral<"recordsearch">]>, z.ZodLiteral<"record.unassign-others">, z.ZodUnion<readonly [z.ZodLiteral<"record.declare-birth">, z.ZodLiteral<"record.declare-birth:my-jurisdiction">, z.ZodLiteral<"record.declare-death">, z.ZodLiteral<"record.declare-death:my-jurisdiction">, z.ZodLiteral<"record.declare-marriage">, z.ZodLiteral<"record.declare-marriage:my-jurisdiction">, z.ZodLiteral<"record.declaration-submit-incomplete">, z.ZodLiteral<"record.declaration-submit-for-review">]>, z.ZodUnion<readonly [z.ZodLiteral<"record.declaration-submit-for-approval">, z.ZodLiteral<"record.declaration-submit-for-updates">, z.ZodLiteral<"record.declaration-edit">, z.ZodLiteral<"record.review-duplicates">, z.ZodLiteral<"record.declaration-archive">, z.ZodLiteral<"record.declaration-reinstate">]>, z.ZodLiteral<"record.register">, z.ZodLiteral<"record.registration-print&issue-certified-copies">, z.ZodUnion<readonly [z.ZodLiteral<"record.registration-request-correction">, z.ZodLiteral<"record.registration-correct">, z.ZodLiteral<"record.confirm-registration">, z.ZodLiteral<"record.reject-registration">]>, z.ZodUnion<readonly [z.ZodLiteral<"search.birth:my-jurisdiction">, z.ZodLiteral<"search.birth">, z.ZodLiteral<"search.death:my-jurisdiction">, z.ZodLiteral<"search.death">, z.ZodLiteral<"search.marriage:my-jurisdiction">, z.ZodLiteral<"search.marriage">]>, z.ZodLiteral<"record.read">, z.ZodLiteral<"profile.electronic-signature">, z.ZodUnion<readonly [z.ZodLiteral<"performance.read">, z.ZodLiteral<"performance.read-dashboards">, z.ZodLiteral<"performance.vital-statistics-export">]>, z.ZodUnion<readonly [z.ZodLiteral<"organisation.read-locations:all">, z.ZodLiteral<"organisation.read-locations:my-office">, z.ZodLiteral<"organisation.read-locations:my-jurisdiction">]>, z.ZodUnion<readonly [z.ZodLiteral<"user.read:all">, z.ZodLiteral<"user.read:my-office">, z.ZodLiteral<"user.read:my-jurisdiction">, z.ZodLiteral<"user.read:only-my-audit">, z.ZodLiteral<"user.create:all">, z.ZodLiteral<"user.create:my-jurisdiction">, z.ZodLiteral<"user.update:all">, z.ZodLiteral<"user.update:my-jurisdiction">]>, z.ZodLiteral<"config.update:all">, z.ZodLiteral<"user.data-seeding">, z.ZodUnion<readonly [z.ZodLiteral<"record.reindex">, z.ZodLiteral<"record.import">]>]>;
|
|
67
|
+
declare const LiteralScopes: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodLiteral<"bypassratelimit">, z.ZodLiteral<"register">, z.ZodLiteral<"demo">, z.ZodLiteral<"config">]>, z.ZodUnion<readonly [z.ZodLiteral<"webhook">, z.ZodLiteral<"nationalId">, z.ZodLiteral<"notification-api">, z.ZodLiteral<"recordsearch">, z.ZodLiteral<"integration.create">]>, z.ZodLiteral<"record.unassign-others">, z.ZodUnion<readonly [z.ZodLiteral<"record.declare-birth">, z.ZodLiteral<"record.declare-birth:my-jurisdiction">, z.ZodLiteral<"record.declare-death">, z.ZodLiteral<"record.declare-death:my-jurisdiction">, z.ZodLiteral<"record.declare-marriage">, z.ZodLiteral<"record.declare-marriage:my-jurisdiction">, z.ZodLiteral<"record.declaration-submit-incomplete">, z.ZodLiteral<"record.declaration-submit-for-review">]>, z.ZodUnion<readonly [z.ZodLiteral<"record.declaration-submit-for-approval">, z.ZodLiteral<"record.declaration-submit-for-updates">, z.ZodLiteral<"record.declaration-edit">, z.ZodLiteral<"record.review-duplicates">, z.ZodLiteral<"record.declaration-archive">, z.ZodLiteral<"record.declaration-reinstate">]>, z.ZodLiteral<"record.register">, z.ZodLiteral<"record.registration-print&issue-certified-copies">, z.ZodUnion<readonly [z.ZodLiteral<"record.registration-request-correction">, z.ZodLiteral<"record.registration-correct">, z.ZodLiteral<"record.confirm-registration">, z.ZodLiteral<"record.reject-registration">]>, z.ZodUnion<readonly [z.ZodLiteral<"search.birth:my-jurisdiction">, z.ZodLiteral<"search.birth">, z.ZodLiteral<"search.death:my-jurisdiction">, z.ZodLiteral<"search.death">, z.ZodLiteral<"search.marriage:my-jurisdiction">, z.ZodLiteral<"search.marriage">]>, z.ZodLiteral<"record.read">, z.ZodLiteral<"profile.electronic-signature">, z.ZodUnion<readonly [z.ZodLiteral<"performance.read">, z.ZodLiteral<"performance.read-dashboards">, z.ZodLiteral<"performance.vital-statistics-export">]>, z.ZodUnion<readonly [z.ZodLiteral<"organisation.read-locations:all">, z.ZodLiteral<"organisation.read-locations:my-office">, z.ZodLiteral<"organisation.read-locations:my-jurisdiction">]>, z.ZodUnion<readonly [z.ZodLiteral<"user.read:all">, z.ZodLiteral<"user.read:my-office">, z.ZodLiteral<"user.read:my-jurisdiction">, z.ZodLiteral<"user.read:only-my-audit">, z.ZodLiteral<"user.create:all">, z.ZodLiteral<"user.create:my-jurisdiction">, z.ZodLiteral<"user.update:all">, z.ZodLiteral<"user.update:my-jurisdiction">]>, z.ZodLiteral<"config.update:all">, z.ZodLiteral<"user.data-seeding">, z.ZodUnion<readonly [z.ZodLiteral<"record.reindex">, z.ZodLiteral<"record.import">]>]>;
|
|
67
68
|
declare const SearchScope: z.ZodObject<{
|
|
68
69
|
type: z.ZodLiteral<"search">;
|
|
69
70
|
options: z.ZodObject<{
|
|
@@ -325,7 +326,7 @@ export declare function parseConfigurableScope(scope: string): {
|
|
|
325
326
|
};
|
|
326
327
|
} | undefined;
|
|
327
328
|
export declare function parseLiteralScope(scope: string): {
|
|
328
|
-
type: "bypassratelimit" | "register" | "demo" | "config" | "webhook" | "nationalId" | "notification-api" | "recordsearch" | "record.import" | "record.reindex" | "record.declare-birth" | "record.declare-birth:my-jurisdiction" | "record.declare-death" | "record.declare-death:my-jurisdiction" | "record.declare-marriage" | "record.declare-marriage:my-jurisdiction" | "record.declaration-submit-incomplete" | "record.declaration-submit-for-review" | "record.unassign-others" | "record.declaration-submit-for-approval" | "record.declaration-submit-for-updates" | "record.declaration-edit" | "record.review-duplicates" | "record.declaration-archive" | "record.declaration-reinstate" | "record.register" | "record.registration-print&issue-certified-copies" | "record.registration-request-correction" | "record.registration-correct" | "record.confirm-registration" | "record.reject-registration" | "search.birth:my-jurisdiction" | "search.birth" | "search.death:my-jurisdiction" | "search.death" | "search.marriage:my-jurisdiction" | "search.marriage" | "record.read" | "profile.electronic-signature" | "performance.read" | "performance.read-dashboards" | "performance.vital-statistics-export" | "organisation.read-locations:all" | "organisation.read-locations:my-office" | "organisation.read-locations:my-jurisdiction" | "user.read:all" | "user.read:my-office" | "user.read:my-jurisdiction" | "user.read:only-my-audit" | "user.create:all" | "user.create:my-jurisdiction" | "user.update:all" | "user.update:my-jurisdiction" | "config.update:all" | "user.data-seeding";
|
|
329
|
+
type: "bypassratelimit" | "register" | "demo" | "config" | "webhook" | "nationalId" | "notification-api" | "recordsearch" | "record.import" | "record.reindex" | "integration.create" | "record.declare-birth" | "record.declare-birth:my-jurisdiction" | "record.declare-death" | "record.declare-death:my-jurisdiction" | "record.declare-marriage" | "record.declare-marriage:my-jurisdiction" | "record.declaration-submit-incomplete" | "record.declaration-submit-for-review" | "record.unassign-others" | "record.declaration-submit-for-approval" | "record.declaration-submit-for-updates" | "record.declaration-edit" | "record.review-duplicates" | "record.declaration-archive" | "record.declaration-reinstate" | "record.register" | "record.registration-print&issue-certified-copies" | "record.registration-request-correction" | "record.registration-correct" | "record.confirm-registration" | "record.reject-registration" | "search.birth:my-jurisdiction" | "search.birth" | "search.death:my-jurisdiction" | "search.death" | "search.marriage:my-jurisdiction" | "search.marriage" | "record.read" | "profile.electronic-signature" | "performance.read" | "performance.read-dashboards" | "performance.vital-statistics-export" | "organisation.read-locations:all" | "organisation.read-locations:my-office" | "organisation.read-locations:my-jurisdiction" | "user.read:all" | "user.read:my-office" | "user.read:my-jurisdiction" | "user.read:only-my-audit" | "user.create:all" | "user.create:my-jurisdiction" | "user.update:all" | "user.update:my-jurisdiction" | "config.update:all" | "user.data-seeding";
|
|
329
330
|
} | undefined;
|
|
330
331
|
/**
|
|
331
332
|
* Stringifies a ConfigurableScopes object into a scope string.
|
package/dist/scopes/index.js
CHANGED
|
@@ -64,6 +64,7 @@ var SCOPES = {
|
|
|
64
64
|
RECORD_IMPORT: "record.import",
|
|
65
65
|
RECORD_EXPORT: "record.export",
|
|
66
66
|
RECORD_REINDEX: "record.reindex",
|
|
67
|
+
INTEGRATION_CREATE: "integration.create",
|
|
67
68
|
// declare
|
|
68
69
|
RECORD_DECLARE_BIRTH: "record.declare-birth",
|
|
69
70
|
RECORD_DECLARE_BIRTH_MY_JURISDICTION: "record.declare-birth:my-jurisdiction",
|
|
@@ -138,7 +139,8 @@ var IntegrationScopes = z.union([
|
|
|
138
139
|
z.literal(SCOPES.WEBHOOK),
|
|
139
140
|
z.literal(SCOPES.NATIONALID),
|
|
140
141
|
z.literal(SCOPES.NOTIFICATION_API),
|
|
141
|
-
z.literal(SCOPES.RECORDSEARCH)
|
|
142
|
+
z.literal(SCOPES.RECORDSEARCH),
|
|
143
|
+
z.literal(SCOPES.INTEGRATION_CREATE)
|
|
142
144
|
]);
|
|
143
145
|
var InternalOperationsScopes = z.union([
|
|
144
146
|
z.literal(SCOPES.RECORD_REINDEX),
|