shred-api-client 2.9.1 → 2.9.2

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/index.d.ts CHANGED
@@ -3497,6 +3497,15 @@ type ActionGroup = "Projects" | "Editors" | "Goals" | "Notes" | "Tenants" | "Off
3497
3497
  type ActionMeta = {
3498
3498
  label: string;
3499
3499
  group: ActionGroup;
3500
+ /**
3501
+ * Whether this action is meaningful when scoped to a single tenant.
3502
+ * A role that contains at least one scopeable action can be assigned with
3503
+ * `scope: tenant:<id>`; roles made only of global capabilities (e.g. admin,
3504
+ * role management) can only be assigned globally.
3505
+ *
3506
+ * Add `scopeable: true` to any action that should become tenant-scoped later.
3507
+ */
3508
+ scopeable?: boolean;
3500
3509
  };
3501
3510
  /** One catalog row as served to the admin UI (GET /actions). */
3502
3511
  type ActionCatalogEntry = ActionMeta & {
@@ -3512,6 +3521,8 @@ type ActionCatalogEntry = ActionMeta & {
3512
3521
  declare const ActionCatalog: Record<Action, ActionMeta>;
3513
3522
  /** The catalog as a flat list of `{ key, label, group }` — e.g. for `GET /actions`. */
3514
3523
  declare function listActionCatalog(): ActionCatalogEntry[];
3524
+ /** Whether an action is meaningful when scoped to a single tenant. */
3525
+ declare function isScopeable(action: Action): boolean;
3515
3526
 
3516
3527
  declare const RoleSchema: z.ZodObject<{
3517
3528
  id: z.ZodString;
@@ -3709,9 +3720,10 @@ declare const index$2_RoleSchema: typeof RoleSchema;
3709
3720
  type index$2_Scope = Scope;
3710
3721
  declare const index$2_ScopeSchema: typeof ScopeSchema;
3711
3722
  type index$2_UpdateRoleInput = UpdateRoleInput;
3723
+ declare const index$2_isScopeable: typeof isScopeable;
3712
3724
  declare const index$2_listActionCatalog: typeof listActionCatalog;
3713
3725
  declare namespace index$2 {
3714
- export { type index$2_Action as Action, index$2_ActionCatalog as ActionCatalog, type index$2_ActionCatalogEntry as ActionCatalogEntry, type index$2_ActionGroup as ActionGroup, type index$2_ActionMeta as ActionMeta, index$2_Actions as Actions, type index$2_AssignRoleInput as AssignRoleInput, type index$2_CreateRoleInput as CreateRoleInput, index$2_Endpoints as Endpoints, type index$2_IAPI as IAPI, type index$2_Role as Role, type index$2_RoleAssignment as RoleAssignment, index$2_RoleAssignmentSchema as RoleAssignmentSchema, type index$2_RoleGrant as RoleGrant, index$2_RoleGrantSchema as RoleGrantSchema, index$2_RoleSchema as RoleSchema, type index$2_Scope as Scope, index$2_ScopeSchema as ScopeSchema, type index$2_UpdateRoleInput as UpdateRoleInput, index$2_listActionCatalog as listActionCatalog };
3726
+ export { type index$2_Action as Action, index$2_ActionCatalog as ActionCatalog, type index$2_ActionCatalogEntry as ActionCatalogEntry, type index$2_ActionGroup as ActionGroup, type index$2_ActionMeta as ActionMeta, index$2_Actions as Actions, type index$2_AssignRoleInput as AssignRoleInput, type index$2_CreateRoleInput as CreateRoleInput, index$2_Endpoints as Endpoints, type index$2_IAPI as IAPI, type index$2_Role as Role, type index$2_RoleAssignment as RoleAssignment, index$2_RoleAssignmentSchema as RoleAssignmentSchema, type index$2_RoleGrant as RoleGrant, index$2_RoleGrantSchema as RoleGrantSchema, index$2_RoleSchema as RoleSchema, type index$2_Scope as Scope, index$2_ScopeSchema as ScopeSchema, type index$2_UpdateRoleInput as UpdateRoleInput, index$2_isScopeable as isScopeable, index$2_listActionCatalog as listActionCatalog };
3715
3727
  }
3716
3728
 
3717
3729
  declare class ShredAPI {
package/dist/index.js CHANGED
@@ -6019,6 +6019,7 @@ __export(rbac_exports, {
6019
6019
  RoleGrantSchema: () => RoleGrantSchema,
6020
6020
  RoleSchema: () => RoleSchema,
6021
6021
  ScopeSchema: () => ScopeSchema,
6022
+ isScopeable: () => isScopeable,
6022
6023
  listActionCatalog: () => listActionCatalog
6023
6024
  });
6024
6025
 
@@ -6148,7 +6149,7 @@ var ActionCatalog = {
6148
6149
  [Actions.TENANT_VIEW_MEMBERS]: { label: "View a tenant's members", group: "Tenants" },
6149
6150
  [Actions.TENANT_UPDATE_MEMBERS]: { label: "Manage a tenant's members", group: "Tenants" },
6150
6151
  [Actions.TENANT_UPDATE_REPORT_VIEWERS]: { label: "Manage a tenant's report viewers", group: "Tenants" },
6151
- [Actions.TENANT_VIEW_REPORT]: { label: "View a tenant's report", group: "Tenants" },
6152
+ [Actions.TENANT_VIEW_REPORT]: { label: "View a tenant's report", group: "Tenants", scopeable: true },
6152
6153
  [Actions.TENANT_VIEW_MINE]: { label: "View your own tenant", group: "Tenants" },
6153
6154
  // Offers
6154
6155
  [Actions.OFFER_LIST]: { label: "List all offers", group: "Offers" },
@@ -6193,6 +6194,10 @@ function listActionCatalog() {
6193
6194
  ...meta
6194
6195
  }));
6195
6196
  }
6197
+ function isScopeable(action) {
6198
+ var _a, _b;
6199
+ return (_b = (_a = ActionCatalog[action]) == null ? void 0 : _a.scopeable) != null ? _b : false;
6200
+ }
6196
6201
 
6197
6202
  // src/model/rbac/Role.schema.ts
6198
6203
  var RoleSchema = external_exports.object({