@opencrvs/toolkit 1.9.6-rc.fbe6e5b → 1.9.6-rc.fc3b4c3

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.
@@ -609,9 +609,6 @@ var z14 = __toESM(require("zod/v4"));
609
609
  // ../commons/src/events/ActionDocument.ts
610
610
  var z12 = __toESM(require("zod/v4"));
611
611
 
612
- // ../commons/src/events/CreatedAtLocation.ts
613
- var CreatedAtLocation = UUID.nullish();
614
-
615
612
  // ../commons/src/authentication.ts
616
613
  var import_jwt_decode = __toESM(require("jwt-decode"));
617
614
  var z11 = __toESM(require("zod/v4"));
@@ -815,12 +812,6 @@ var SearchScope = z10.object({
815
812
  access: z10.array(z10.enum(["my-jurisdiction", "all"])).length(1)
816
813
  })
817
814
  });
818
- var DashboardScope = z10.object({
819
- type: z10.literal("dashboard.view"),
820
- options: z10.object({
821
- id: z10.array(z10.string())
822
- })
823
- });
824
815
  var RecordScopeType = z10.enum([
825
816
  "record.create",
826
817
  "record.read",
@@ -856,7 +847,6 @@ var ConfigurableRawScopes = z10.discriminatedUnion("type", [
856
847
  CreateUserScope,
857
848
  EditUserScope,
858
849
  WorkqueueScope,
859
- DashboardScope,
860
850
  RecordScope,
861
851
  CustomActionScope
862
852
  ]);
@@ -1029,7 +1019,8 @@ var ActionBase = z12.object({
1029
1019
  createdBy: z12.string().describe("Identifier of the user who created the action."),
1030
1020
  createdByRole: z12.string().describe("Role of the user who created the action."),
1031
1021
  createdBySignature: z12.string().nullish().describe("Reference to the signature of the user who created the action."),
1032
- createdAtLocation: CreatedAtLocation.describe(
1022
+ // @TODO: createdAtLocation should be non-nullable in the future once all actions have this field populated.
1023
+ createdAtLocation: UUID.nullish().describe(
1033
1024
  "Reference to the location of the user who created the action."
1034
1025
  ),
1035
1026
  declaration: ActionUpdate.describe(
@@ -1264,7 +1255,8 @@ var ZodDate = z14.iso.date();
1264
1255
  var ActionCreationMetadata = z14.object({
1265
1256
  createdAt: z14.iso.datetime().describe("The timestamp when the action request was created."),
1266
1257
  createdBy: z14.string().describe("ID of the user who created the action request."),
1267
- createdAtLocation: CreatedAtLocation.describe(
1258
+ // @TODO: createdAtLocation should be non-nullable in the future once all action requests have this field populated.
1259
+ createdAtLocation: UUID.nullish().describe(
1268
1260
  "Location of the user who created the action request."
1269
1261
  ),
1270
1262
  createdByUserType: z14.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
@@ -1290,11 +1282,12 @@ var EventMetadata = z14.object({
1290
1282
  ),
1291
1283
  createdAt: z14.iso.datetime().describe("The timestamp when the event was first created and saved."),
1292
1284
  dateOfEvent: ZodDate.nullish(),
1293
- placeOfEvent: CreatedAtLocation,
1285
+ placeOfEvent: UUID.nullish(),
1294
1286
  createdBy: z14.string().describe("ID of the user who created the event."),
1295
1287
  createdByUserType: z14.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
1296
1288
  updatedByUserRole: z14.string().describe("Role of the user who last changed the status."),
1297
- createdAtLocation: CreatedAtLocation.describe(
1289
+ // @TODO: createdAtLocation should be non-nullable in the future once all action requests have this field populated.
1290
+ createdAtLocation: UUID.nullish().describe(
1298
1291
  "Location of the user who created the event."
1299
1292
  ),
1300
1293
  createdBySignature: z14.string().nullish().describe("Signature of the user who created the event."),
@@ -1694,12 +1687,16 @@ var HtmlFontVariant = z17.enum([
1694
1687
  "h2",
1695
1688
  "h1"
1696
1689
  ]);
1690
+ var ParagraphTextAlign = z17.enum(["left", "center", "right", "start", "end"]);
1697
1691
  var ParagraphConfiguration = z17.object({
1698
1692
  styles: z17.object({
1699
1693
  fontVariant: HtmlFontVariant.optional().describe(
1700
1694
  "Font variant to use for the paragraph text"
1701
1695
  ),
1702
- hint: z17.boolean().optional().describe("When true, paragraph is styled as a hint with grey color")
1696
+ hint: z17.boolean().optional().describe("When true, paragraph is styled as a hint with grey color"),
1697
+ textAlign: ParagraphTextAlign.optional().describe(
1698
+ "Text alignment for the paragraph"
1699
+ )
1703
1700
  }).optional()
1704
1701
  }).default({});
1705
1702
  var Paragraph = BaseField.extend({
@@ -3826,11 +3823,7 @@ var mandatoryColumns = defineWorkqueuesColumns([
3826
3823
  value: event.field("updatedAt")
3827
3824
  }
3828
3825
  ]);
3829
- var WorkqueueActionsWithDefault = z33.enum([
3830
- ...workqueueActions.options,
3831
- "DEFAULT",
3832
- ActionType.READ
3833
- ]);
3826
+ var CtaActionType = z33.enum([...workqueueActions.options, ActionType.READ]);
3834
3827
  var WorkqueueConfig = z33.object({
3835
3828
  slug: z33.string().describe("Determines the url of the workqueue."),
3836
3829
  name: TranslationConfig.describe(
@@ -3839,7 +3832,7 @@ var WorkqueueConfig = z33.object({
3839
3832
  query: CountryConfigQueryType,
3840
3833
  /** This action object used to contain a conditionals option, but it was not used anywhere.
3841
3834
  * It's also debatable whether it should be an array, or just a single action. */
3842
- actions: z33.array(z33.object({ type: WorkqueueActionsWithDefault })).describe("Workqueue call-to-action button configuration."),
3835
+ actions: z33.array(z33.object({ type: CtaActionType })).describe("Workqueue call-to-action button configuration."),
3843
3836
  columns: z33.array(WorkqueueColumn).default(mandatoryColumns),
3844
3837
  icon: AvailableIcons,
3845
3838
  emptyMessage: TranslationConfig.optional()
@@ -3854,7 +3847,7 @@ var WorkqueueConfigInput = z33.object({
3854
3847
  "Title of the workflow (both in navigation and on the page)"
3855
3848
  ),
3856
3849
  query: CountryConfigQueryInputType,
3857
- actions: z33.array(z33.object({ type: WorkqueueActionsWithDefault })).describe("Workqueue call-to-action button configuration."),
3850
+ actions: z33.array(z33.object({ type: CtaActionType })).describe("Workqueue call-to-action button configuration."),
3858
3851
  columns: z33.array(WorkqueueColumn).default(mandatoryColumns),
3859
3852
  icon: AvailableIcons,
3860
3853
  emptyMessage: TranslationConfig.optional()
@@ -3898,14 +3891,18 @@ var BaseActionInput = z34.object({
3898
3891
  // should not be part of base action.
3899
3892
  keepAssignment: z34.boolean().optional(),
3900
3893
  // For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
3901
- createdAtLocation: CreatedAtLocation.describe(
3894
+ // @TODO: createdAtLocation should be limited to actions that system users can perform. For normal users, it should not be part of the base action.
3895
+ createdAtLocation: UUID.nullish().describe(
3902
3896
  "A valid office location ID. This is required for system users performing actions. The provided location must be a leaf-location, i.e. it must not have any children locations."
3903
3897
  )
3904
3898
  });
3905
3899
  var CreateActionInput = BaseActionInput.extend(
3906
3900
  z34.object({
3907
3901
  type: z34.literal(ActionType.CREATE).default(ActionType.CREATE),
3908
- createdAtLocation: CreatedAtLocation
3902
+ // For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
3903
+ createdAtLocation: UUID.nullish().describe(
3904
+ "A valid office location ID. This is required for system users performing actions. The provided location must be a leaf-location, i.e. it must not have any children locations."
3905
+ )
3909
3906
  }).shape
3910
3907
  );
3911
3908
  var RegisterActionInput = BaseActionInput.extend(
@@ -3916,7 +3913,11 @@ var RegisterActionInput = BaseActionInput.extend(
3916
3913
  );
3917
3914
  var NotifyActionInput = BaseActionInput.extend(
3918
3915
  z34.object({
3919
- type: z34.literal(ActionType.NOTIFY).default(ActionType.NOTIFY)
3916
+ type: z34.literal(ActionType.NOTIFY).default(ActionType.NOTIFY),
3917
+ // For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
3918
+ createdAtLocation: UUID.nullish().describe(
3919
+ "A valid office location ID. This is required for system users performing actions. The provided location must be a leaf-location, i.e. it must not have any children locations."
3920
+ )
3920
3921
  }).shape
3921
3922
  ).meta({
3922
3923
  default: {
@@ -4079,11 +4080,14 @@ var DraftInput = BaseActionInput.extend({
4079
4080
 
4080
4081
  // ../commons/src/events/EventInput.ts
4081
4082
  var z36 = __toESM(require("zod/v4"));
4082
- var import_uuid10 = require("uuid");
4083
+ var import_uuid9 = require("uuid");
4083
4084
  var EventInput = z36.object({
4084
4085
  transactionId: z36.string(),
4085
- type: z36.string()
4086
- }).meta({ default: { transactionId: (0, import_uuid10.v4)(), type: "birth" } });
4086
+ type: z36.string(),
4087
+ createdAtLocation: UUID.nullish().describe(
4088
+ "Location where the event occurred. Required for system users."
4089
+ )
4090
+ }).meta({ default: { transactionId: (0, import_uuid9.v4)(), type: "birth" } });
4087
4091
 
4088
4092
  // ../commons/src/events/EventDocument.ts
4089
4093
  var z37 = __toESM(require("zod/v4"));
@@ -62,6 +62,7 @@ export declare const SCOPES: {
62
62
  readonly CONFIG_UPDATE_ALL: "config.update:all";
63
63
  readonly USER_DATA_SEEDING: "user.data-seeding";
64
64
  };
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">]>;
65
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">]>]>;
66
67
  declare const SearchScope: z.ZodObject<{
67
68
  type: z.ZodLiteral<"search">;
@@ -73,12 +74,6 @@ declare const SearchScope: z.ZodObject<{
73
74
  }>>;
74
75
  }, z.core.$strip>;
75
76
  }, z.core.$strip>;
76
- export declare const DashboardScope: z.ZodObject<{
77
- type: z.ZodLiteral<"dashboard.view">;
78
- options: z.ZodObject<{
79
- id: z.ZodArray<z.ZodString>;
80
- }, z.core.$strip>;
81
- }, z.core.$strip>;
82
77
  export type SearchScope = z.infer<typeof SearchScope>;
83
78
  export declare const RecordScopeType: z.ZodEnum<{
84
79
  "record.unassign-others": "record.unassign-others";
@@ -149,11 +144,6 @@ declare const ConfigurableRawScopes: z.ZodDiscriminatedUnion<[z.ZodObject<{
149
144
  options: z.ZodObject<{
150
145
  id: z.ZodArray<z.ZodString>;
151
146
  }, z.core.$strip>;
152
- }, z.core.$strip>, z.ZodObject<{
153
- type: z.ZodLiteral<"dashboard.view">;
154
- options: z.ZodObject<{
155
- id: z.ZodArray<z.ZodString>;
156
- }, z.core.$strip>;
157
147
  }, z.core.$strip>, z.ZodObject<{
158
148
  type: z.ZodEnum<{
159
149
  "record.unassign-others": "record.unassign-others";
@@ -236,13 +226,6 @@ export declare function findScope<T extends ConfigurableScopeType>(scopes: strin
236
226
  };
237
227
  }, {
238
228
  type: T;
239
- }> | Extract<{
240
- type: "dashboard.view";
241
- options: {
242
- id: string[];
243
- };
244
- }, {
245
- type: T;
246
229
  }> | Extract<{
247
230
  type: "record.unassign-others" | "record.register" | "record.read" | "record.create" | "record.declare" | "record.notify" | "record.declared.edit" | "record.declared.reject" | "record.declared.archive" | "record.declared.review-duplicates" | "record.registered.print-certified-copies" | "record.registered.request-correction" | "record.registered.correct";
248
231
  options: {
@@ -282,13 +265,6 @@ export declare function findScopes<T extends ConfigurableScopeType>(scopes: stri
282
265
  };
283
266
  }, {
284
267
  type: T;
285
- }> | Extract<{
286
- type: "dashboard.view";
287
- options: {
288
- id: string[];
289
- };
290
- }, {
291
- type: T;
292
268
  }> | Extract<{
293
269
  type: "record.unassign-others" | "record.register" | "record.read" | "record.create" | "record.declare" | "record.notify" | "record.declared.edit" | "record.declared.reject" | "record.declared.archive" | "record.declared.review-duplicates" | "record.registered.print-certified-copies" | "record.registered.request-correction" | "record.registered.correct";
294
270
  options: {
@@ -336,11 +312,6 @@ export declare function parseConfigurableScope(scope: string): {
336
312
  options: {
337
313
  id: string[];
338
314
  };
339
- } | {
340
- type: "dashboard.view";
341
- options: {
342
- id: string[];
343
- };
344
315
  } | {
345
316
  type: "record.unassign-others" | "record.register" | "record.read" | "record.create" | "record.declare" | "record.notify" | "record.declared.edit" | "record.declared.reject" | "record.declared.archive" | "record.declared.review-duplicates" | "record.registered.print-certified-copies" | "record.registered.request-correction" | "record.registered.correct";
346
317
  options: {
@@ -33,10 +33,10 @@ __export(scopes_exports, {
33
33
  ActionScopes: () => ActionScopes,
34
34
  ConfigurableActionScopes: () => ConfigurableActionScopes,
35
35
  CustomActionScope: () => CustomActionScope,
36
- DashboardScope: () => DashboardScope,
37
36
  RecordScope: () => RecordScope,
38
37
  RecordScopeType: () => RecordScopeType,
39
38
  SCOPES: () => SCOPES,
39
+ SearchScopes: () => SearchScopes,
40
40
  findScope: () => findScope,
41
41
  findScopes: () => findScopes,
42
42
  getAuthorizedEventsFromScopes: () => getAuthorizedEventsFromScopes,
@@ -247,12 +247,6 @@ var SearchScope = z.object({
247
247
  access: z.array(z.enum(["my-jurisdiction", "all"])).length(1)
248
248
  })
249
249
  });
250
- var DashboardScope = z.object({
251
- type: z.literal("dashboard.view"),
252
- options: z.object({
253
- id: z.array(z.string())
254
- })
255
- });
256
250
  var RecordScopeType = z.enum([
257
251
  "record.create",
258
252
  "record.read",
@@ -288,7 +282,6 @@ var ConfigurableRawScopes = z.discriminatedUnion("type", [
288
282
  CreateUserScope,
289
283
  EditUserScope,
290
284
  WorkqueueScope,
291
- DashboardScope,
292
285
  RecordScope,
293
286
  CustomActionScope
294
287
  ]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencrvs/toolkit",
3
- "version": "1.9.6-rc.fbe6e5b",
3
+ "version": "1.9.6-rc.fc3b4c3",
4
4
  "description": "OpenCRVS toolkit for building country configurations",
5
5
  "license": "MPL-2.0",
6
6
  "exports": {
@@ -1,2 +0,0 @@
1
- export declare const CreatedAtLocation: import("zod").ZodOptional<import("zod").ZodNullable<import("zod/v4/core").$ZodBranded<import("zod").ZodUUID, "UUID">>>;
2
- //# sourceMappingURL=CreatedAtLocation.d.ts.map