@opencrvs/toolkit 1.9.7-rc.7aada57 → 1.9.7-rc.80d99a5

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.
@@ -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().nullish().optional().describe("Role of the user who created the action."),
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().nullable().optional().describe("Role of the user at the time of action request creation."),
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().nullish().describe("Role of the user who last changed the status."),
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."
@@ -5780,7 +5777,7 @@ function isFlagConditionMet(conditional, form, action) {
5780
5777
  $user: {
5781
5778
  sub: "",
5782
5779
  exp: "",
5783
- role: action.createdByRole || void 0,
5780
+ role: action.createdByRole,
5784
5781
  algorithm: "",
5785
5782
  scope: [],
5786
5783
  userType: action.createdByUserType
@@ -9211,51 +9208,6 @@ var generateWorkqueues = (slug = "all-events") => defineWorkqueues([
9211
9208
  icon: "Draft"
9212
9209
  }
9213
9210
  ]);
9214
- var generateEventConfig = ({
9215
- id,
9216
- fields,
9217
- placeOfEventId,
9218
- dateOfEventId
9219
- }) => {
9220
- return defineConfig({
9221
- id,
9222
- label: generateTranslationConfig2(id),
9223
- title: generateTranslationConfig2(`${id} Event`),
9224
- summary: {
9225
- fields: []
9226
- },
9227
- placeOfEvent: placeOfEventId ? { $$field: placeOfEventId } : void 0,
9228
- dateOfEvent: dateOfEventId ? { $$field: dateOfEventId } : void 0,
9229
- declaration: {
9230
- label: generateTranslationConfig2(`${id} Declaration`),
9231
- pages: [
9232
- {
9233
- id: "page1",
9234
- title: generateTranslationConfig2("Page 1"),
9235
- fields
9236
- }
9237
- ]
9238
- },
9239
- actions: [
9240
- {
9241
- type: ActionType.READ,
9242
- label: generateTranslationConfig2("Read"),
9243
- review: {
9244
- title: generateTranslationConfig2("Review Read Action"),
9245
- fields: []
9246
- }
9247
- },
9248
- {
9249
- type: ActionType.DECLARE,
9250
- label: generateTranslationConfig2("Declare"),
9251
- review: {
9252
- title: generateTranslationConfig2("Review Declare Action"),
9253
- fields: []
9254
- }
9255
- }
9256
- ]
9257
- });
9258
- };
9259
9211
 
9260
9212
  // ../commons/src/events/TemplateConfig.ts
9261
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().nullish().optional().describe("Role of the user who created the action."),
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().nullable().optional().describe("Role of the user at the time of action request creation."),
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().nullish().describe("Role of the user who last changed the status."),
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."
@@ -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">, 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">]>]>;
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" | "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";
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.
@@ -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),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencrvs/toolkit",
3
- "version": "1.9.7-rc.7aada57",
3
+ "version": "1.9.7-rc.80d99a5",
4
4
  "description": "OpenCRVS toolkit for building country configurations",
5
5
  "license": "MPL-2.0",
6
6
  "exports": {