@opencrvs/toolkit 1.9.7-rc.00d06cf → 1.9.7-rc.04ec821
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 +224 -242
- package/dist/commons/events/ActionConfig.d.ts +0 -70
- 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 +0 -56
- 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 +0 -21
- package/dist/commons/events/FormConfig.d.ts +0 -42
- package/dist/commons/events/PageConfig.d.ts +0 -28
- package/dist/commons/events/defineConfig.d.ts +0 -8
- package/dist/commons/events/state/index.d.ts +3 -3
- package/dist/commons/events/state/utils.d.ts +21 -21
- package/dist/commons/events/test.utils.d.ts +0 -14
- package/dist/commons/events/utils.d.ts +19 -35
- package/dist/events/index.js +6 -58
- package/dist/notification/index.js +5 -11
- package/dist/scopes/index.d.ts +2 -3
- package/dist/scopes/index.js +1 -3
- package/package.json +1 -1
package/dist/events/index.js
CHANGED
|
@@ -270,7 +270,6 @@ __export(events_exports, {
|
|
|
270
270
|
generateActionDeclarationInput: () => generateActionDeclarationInput,
|
|
271
271
|
generateActionDocument: () => generateActionDocument,
|
|
272
272
|
generateActionDuplicateDeclarationInput: () => generateActionDuplicateDeclarationInput,
|
|
273
|
-
generateEventConfig: () => generateEventConfig,
|
|
274
273
|
generateEventDocument: () => generateEventDocument,
|
|
275
274
|
generateEventDraftDocument: () => generateEventDraftDocument,
|
|
276
275
|
generateRandomDatetime: () => generateRandomDatetime,
|
|
@@ -993,7 +992,6 @@ var SCOPES = {
|
|
|
993
992
|
RECORD_IMPORT: "record.import",
|
|
994
993
|
RECORD_EXPORT: "record.export",
|
|
995
994
|
RECORD_REINDEX: "record.reindex",
|
|
996
|
-
INTEGRATION_CREATE: "integration.create",
|
|
997
995
|
// declare
|
|
998
996
|
RECORD_DECLARE_BIRTH: "record.declare-birth",
|
|
999
997
|
RECORD_DECLARE_BIRTH_MY_JURISDICTION: "record.declare-birth:my-jurisdiction",
|
|
@@ -1068,8 +1066,7 @@ var IntegrationScopes = z10.union([
|
|
|
1068
1066
|
z10.literal(SCOPES.WEBHOOK),
|
|
1069
1067
|
z10.literal(SCOPES.NATIONALID),
|
|
1070
1068
|
z10.literal(SCOPES.NOTIFICATION_API),
|
|
1071
|
-
z10.literal(SCOPES.RECORDSEARCH)
|
|
1072
|
-
z10.literal(SCOPES.INTEGRATION_CREATE)
|
|
1069
|
+
z10.literal(SCOPES.RECORDSEARCH)
|
|
1073
1070
|
]);
|
|
1074
1071
|
var InternalOperationsScopes = z10.union([
|
|
1075
1072
|
z10.literal(SCOPES.RECORD_REINDEX),
|
|
@@ -1437,7 +1434,7 @@ var ActionBase = z12.object({
|
|
|
1437
1434
|
),
|
|
1438
1435
|
createdAt: z12.string().datetime().describe("Timestamp indicating when the action was created."),
|
|
1439
1436
|
createdBy: z12.string().describe("Identifier of the user who created the action."),
|
|
1440
|
-
createdByRole: z12.string().
|
|
1437
|
+
createdByRole: z12.string().describe("Role of the user who created the action."),
|
|
1441
1438
|
createdBySignature: z12.string().nullish().describe("Reference to the signature of the user who created the action."),
|
|
1442
1439
|
// @TODO: createdAtLocation should be non-nullable in the future once all actions have this field populated.
|
|
1443
1440
|
createdAtLocation: UUID.nullish().describe(
|
|
@@ -1681,7 +1678,7 @@ var ActionCreationMetadata = z14.object({
|
|
|
1681
1678
|
),
|
|
1682
1679
|
createdByUserType: z14.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1683
1680
|
acceptedAt: z14.iso.datetime().describe("Timestamp when the action request was accepted."),
|
|
1684
|
-
createdByRole: z14.string().
|
|
1681
|
+
createdByRole: z14.string().describe("Role of the user at the time of action request creation."),
|
|
1685
1682
|
createdBySignature: z14.string().nullish().describe("Signature of the user who created the action request.")
|
|
1686
1683
|
});
|
|
1687
1684
|
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
@@ -1705,7 +1702,7 @@ var EventMetadata = z14.object({
|
|
|
1705
1702
|
placeOfEvent: UUID.nullish(),
|
|
1706
1703
|
createdBy: z14.string().describe("ID of the user who created the event."),
|
|
1707
1704
|
createdByUserType: z14.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1708
|
-
updatedByUserRole: z14.string().
|
|
1705
|
+
updatedByUserRole: z14.string().describe("Role of the user who last changed the status."),
|
|
1709
1706
|
// @TODO: createdAtLocation should be non-nullable in the future once all action requests have this field populated.
|
|
1710
1707
|
createdAtLocation: UUID.nullish().describe(
|
|
1711
1708
|
"Location of the user who created the event."
|
|
@@ -2193,16 +2190,12 @@ var HtmlFontVariant = z17.enum([
|
|
|
2193
2190
|
"h2",
|
|
2194
2191
|
"h1"
|
|
2195
2192
|
]);
|
|
2196
|
-
var ParagraphTextAlign = z17.enum(["left", "center", "right", "start", "end"]);
|
|
2197
2193
|
var ParagraphConfiguration = z17.object({
|
|
2198
2194
|
styles: z17.object({
|
|
2199
2195
|
fontVariant: HtmlFontVariant.optional().describe(
|
|
2200
2196
|
"Font variant to use for the paragraph text"
|
|
2201
2197
|
),
|
|
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
|
-
)
|
|
2198
|
+
hint: z17.boolean().optional().describe("When true, paragraph is styled as a hint with grey color")
|
|
2206
2199
|
}).optional()
|
|
2207
2200
|
}).default({});
|
|
2208
2201
|
var Paragraph = BaseField.extend({
|
|
@@ -5784,7 +5777,7 @@ function isFlagConditionMet(conditional, form, action) {
|
|
|
5784
5777
|
$user: {
|
|
5785
5778
|
sub: "",
|
|
5786
5779
|
exp: "",
|
|
5787
|
-
role: action.createdByRole
|
|
5780
|
+
role: action.createdByRole,
|
|
5788
5781
|
algorithm: "",
|
|
5789
5782
|
scope: [],
|
|
5790
5783
|
userType: action.createdByUserType
|
|
@@ -9215,51 +9208,6 @@ var generateWorkqueues = (slug = "all-events") => defineWorkqueues([
|
|
|
9215
9208
|
icon: "Draft"
|
|
9216
9209
|
}
|
|
9217
9210
|
]);
|
|
9218
|
-
var generateEventConfig = ({
|
|
9219
|
-
id,
|
|
9220
|
-
fields,
|
|
9221
|
-
placeOfEventId,
|
|
9222
|
-
dateOfEventId
|
|
9223
|
-
}) => {
|
|
9224
|
-
return defineConfig({
|
|
9225
|
-
id,
|
|
9226
|
-
label: generateTranslationConfig2(id),
|
|
9227
|
-
title: generateTranslationConfig2(`${id} Event`),
|
|
9228
|
-
summary: {
|
|
9229
|
-
fields: []
|
|
9230
|
-
},
|
|
9231
|
-
placeOfEvent: placeOfEventId ? { $$field: placeOfEventId } : void 0,
|
|
9232
|
-
dateOfEvent: dateOfEventId ? { $$field: dateOfEventId } : void 0,
|
|
9233
|
-
declaration: {
|
|
9234
|
-
label: generateTranslationConfig2(`${id} Declaration`),
|
|
9235
|
-
pages: [
|
|
9236
|
-
{
|
|
9237
|
-
id: "page1",
|
|
9238
|
-
title: generateTranslationConfig2("Page 1"),
|
|
9239
|
-
fields
|
|
9240
|
-
}
|
|
9241
|
-
]
|
|
9242
|
-
},
|
|
9243
|
-
actions: [
|
|
9244
|
-
{
|
|
9245
|
-
type: ActionType.READ,
|
|
9246
|
-
label: generateTranslationConfig2("Read"),
|
|
9247
|
-
review: {
|
|
9248
|
-
title: generateTranslationConfig2("Review Read Action"),
|
|
9249
|
-
fields: []
|
|
9250
|
-
}
|
|
9251
|
-
},
|
|
9252
|
-
{
|
|
9253
|
-
type: ActionType.DECLARE,
|
|
9254
|
-
label: generateTranslationConfig2("Declare"),
|
|
9255
|
-
review: {
|
|
9256
|
-
title: generateTranslationConfig2("Review Declare Action"),
|
|
9257
|
-
fields: []
|
|
9258
|
-
}
|
|
9259
|
-
}
|
|
9260
|
-
]
|
|
9261
|
-
});
|
|
9262
|
-
};
|
|
9263
9211
|
|
|
9264
9212
|
// ../commons/src/events/TemplateConfig.ts
|
|
9265
9213
|
var window2 = () => ({
|
|
@@ -629,7 +629,6 @@ 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",
|
|
633
632
|
// declare
|
|
634
633
|
RECORD_DECLARE_BIRTH: "record.declare-birth",
|
|
635
634
|
RECORD_DECLARE_BIRTH_MY_JURISDICTION: "record.declare-birth:my-jurisdiction",
|
|
@@ -704,8 +703,7 @@ var IntegrationScopes = z10.union([
|
|
|
704
703
|
z10.literal(SCOPES.WEBHOOK),
|
|
705
704
|
z10.literal(SCOPES.NATIONALID),
|
|
706
705
|
z10.literal(SCOPES.NOTIFICATION_API),
|
|
707
|
-
z10.literal(SCOPES.RECORDSEARCH)
|
|
708
|
-
z10.literal(SCOPES.INTEGRATION_CREATE)
|
|
706
|
+
z10.literal(SCOPES.RECORDSEARCH)
|
|
709
707
|
]);
|
|
710
708
|
var InternalOperationsScopes = z10.union([
|
|
711
709
|
z10.literal(SCOPES.RECORD_REINDEX),
|
|
@@ -1019,7 +1017,7 @@ var ActionBase = z12.object({
|
|
|
1019
1017
|
),
|
|
1020
1018
|
createdAt: z12.string().datetime().describe("Timestamp indicating when the action was created."),
|
|
1021
1019
|
createdBy: z12.string().describe("Identifier of the user who created the action."),
|
|
1022
|
-
createdByRole: z12.string().
|
|
1020
|
+
createdByRole: z12.string().describe("Role of the user who created the action."),
|
|
1023
1021
|
createdBySignature: z12.string().nullish().describe("Reference to the signature of the user who created the action."),
|
|
1024
1022
|
// @TODO: createdAtLocation should be non-nullable in the future once all actions have this field populated.
|
|
1025
1023
|
createdAtLocation: UUID.nullish().describe(
|
|
@@ -1263,7 +1261,7 @@ var ActionCreationMetadata = z14.object({
|
|
|
1263
1261
|
),
|
|
1264
1262
|
createdByUserType: z14.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1265
1263
|
acceptedAt: z14.iso.datetime().describe("Timestamp when the action request was accepted."),
|
|
1266
|
-
createdByRole: z14.string().
|
|
1264
|
+
createdByRole: z14.string().describe("Role of the user at the time of action request creation."),
|
|
1267
1265
|
createdBySignature: z14.string().nullish().describe("Signature of the user who created the action request.")
|
|
1268
1266
|
});
|
|
1269
1267
|
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
@@ -1287,7 +1285,7 @@ var EventMetadata = z14.object({
|
|
|
1287
1285
|
placeOfEvent: UUID.nullish(),
|
|
1288
1286
|
createdBy: z14.string().describe("ID of the user who created the event."),
|
|
1289
1287
|
createdByUserType: z14.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1290
|
-
updatedByUserRole: z14.string().
|
|
1288
|
+
updatedByUserRole: z14.string().describe("Role of the user who last changed the status."),
|
|
1291
1289
|
// @TODO: createdAtLocation should be non-nullable in the future once all action requests have this field populated.
|
|
1292
1290
|
createdAtLocation: UUID.nullish().describe(
|
|
1293
1291
|
"Location of the user who created the event."
|
|
@@ -1689,16 +1687,12 @@ var HtmlFontVariant = z17.enum([
|
|
|
1689
1687
|
"h2",
|
|
1690
1688
|
"h1"
|
|
1691
1689
|
]);
|
|
1692
|
-
var ParagraphTextAlign = z17.enum(["left", "center", "right", "start", "end"]);
|
|
1693
1690
|
var ParagraphConfiguration = z17.object({
|
|
1694
1691
|
styles: z17.object({
|
|
1695
1692
|
fontVariant: HtmlFontVariant.optional().describe(
|
|
1696
1693
|
"Font variant to use for the paragraph text"
|
|
1697
1694
|
),
|
|
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
|
-
)
|
|
1695
|
+
hint: z17.boolean().optional().describe("When true, paragraph is styled as a hint with grey color")
|
|
1702
1696
|
}).optional()
|
|
1703
1697
|
}).default({});
|
|
1704
1698
|
var Paragraph = BaseField.extend({
|
package/dist/scopes/index.d.ts
CHANGED
|
@@ -12,7 +12,6 @@ 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";
|
|
16
15
|
readonly RECORD_DECLARE_BIRTH: "record.declare-birth";
|
|
17
16
|
readonly RECORD_DECLARE_BIRTH_MY_JURISDICTION: "record.declare-birth:my-jurisdiction";
|
|
18
17
|
readonly RECORD_DECLARE_DEATH: "record.declare-death";
|
|
@@ -64,7 +63,7 @@ export declare const SCOPES: {
|
|
|
64
63
|
readonly USER_DATA_SEEDING: "user.data-seeding";
|
|
65
64
|
};
|
|
66
65
|
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">]>;
|
|
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"
|
|
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">]>]>;
|
|
68
67
|
declare const SearchScope: z.ZodObject<{
|
|
69
68
|
type: z.ZodLiteral<"search">;
|
|
70
69
|
options: z.ZodObject<{
|
|
@@ -326,7 +325,7 @@ export declare function parseConfigurableScope(scope: string): {
|
|
|
326
325
|
};
|
|
327
326
|
} | undefined;
|
|
328
327
|
export declare function parseLiteralScope(scope: string): {
|
|
329
|
-
type: "bypassratelimit" | "register" | "demo" | "config" | "webhook" | "nationalId" | "notification-api" | "recordsearch" | "record.import" | "record.reindex" | "
|
|
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";
|
|
330
329
|
} | undefined;
|
|
331
330
|
/**
|
|
332
331
|
* Stringifies a ConfigurableScopes object into a scope string.
|
package/dist/scopes/index.js
CHANGED
|
@@ -64,7 +64,6 @@ 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",
|
|
68
67
|
// declare
|
|
69
68
|
RECORD_DECLARE_BIRTH: "record.declare-birth",
|
|
70
69
|
RECORD_DECLARE_BIRTH_MY_JURISDICTION: "record.declare-birth:my-jurisdiction",
|
|
@@ -139,8 +138,7 @@ var IntegrationScopes = z.union([
|
|
|
139
138
|
z.literal(SCOPES.WEBHOOK),
|
|
140
139
|
z.literal(SCOPES.NATIONALID),
|
|
141
140
|
z.literal(SCOPES.NOTIFICATION_API),
|
|
142
|
-
z.literal(SCOPES.RECORDSEARCH)
|
|
143
|
-
z.literal(SCOPES.INTEGRATION_CREATE)
|
|
141
|
+
z.literal(SCOPES.RECORDSEARCH)
|
|
144
142
|
]);
|
|
145
143
|
var InternalOperationsScopes = z.union([
|
|
146
144
|
z.literal(SCOPES.RECORD_REINDEX),
|