shred-api-client 2.9.2 → 2.9.4

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
@@ -3442,6 +3442,13 @@ declare const Actions: {
3442
3442
  readonly NOTE_CREATE: "note.create";
3443
3443
  readonly NOTE_UPDATE: "note.update";
3444
3444
  readonly NOTE_DELETE: "note.delete";
3445
+ readonly NOTIFICATION_LIST_OWN: "notification.list_own";
3446
+ readonly NOTIFICATION_MARK_READ: "notification.mark_read";
3447
+ readonly NOTIFICATION_CLEAR: "notification.clear";
3448
+ readonly TRIGGER_VIEW: "trigger.view";
3449
+ readonly TRIGGER_CREATE: "trigger.create";
3450
+ readonly TRIGGER_UPDATE: "trigger.update";
3451
+ readonly TRIGGER_DELETE: "trigger.delete";
3445
3452
  readonly TENANT_CREATE: "tenant.create";
3446
3453
  readonly TENANT_LIST: "tenant.list";
3447
3454
  readonly TENANT_VIEW: "tenant.view";
@@ -3493,7 +3500,7 @@ type Scope = {
3493
3500
  type: "tenant";
3494
3501
  id: string;
3495
3502
  };
3496
- type ActionGroup = "Projects" | "Editors" | "Goals" | "Notes" | "Tenants" | "Offers" | "Subscriptions" | "Scripts" | "Prompts" | "Email" | "Users" | "Administration";
3503
+ type ActionGroup = "Projects" | "Editors" | "Goals" | "Notes" | "Notifications" | "Tenants" | "Offers" | "Subscriptions" | "Scripts" | "Prompts" | "Email" | "Users" | "Administration";
3497
3504
  type ActionMeta = {
3498
3505
  label: string;
3499
3506
  group: ActionGroup;
@@ -3653,6 +3660,24 @@ declare const RoleAssignmentSchema: z.ZodObject<{
3653
3660
  type RoleGrant = z.infer<typeof RoleGrantSchema>;
3654
3661
  type RoleAssignment = z.infer<typeof RoleAssignmentSchema>;
3655
3662
 
3663
+ declare const PrincipalSchema: z.ZodObject<{
3664
+ uid: z.ZodString;
3665
+ email: z.ZodString;
3666
+ name: z.ZodString;
3667
+ disabled: z.ZodBoolean;
3668
+ }, "strip", z.ZodTypeAny, {
3669
+ email: string;
3670
+ name: string;
3671
+ uid: string;
3672
+ disabled: boolean;
3673
+ }, {
3674
+ email: string;
3675
+ name: string;
3676
+ uid: string;
3677
+ disabled: boolean;
3678
+ }>;
3679
+ type Principal = z.infer<typeof PrincipalSchema>;
3680
+
3656
3681
  type CreateRoleInput = Omit<Role, "id">;
3657
3682
  type UpdateRoleInput = Partial<Omit<Role, "id">>;
3658
3683
  type AssignRoleInput = RoleGrant;
@@ -3665,6 +3690,7 @@ interface IAPI {
3665
3690
  getAssignments: (c: Context, uid: string) => Promise<RoleAssignment | null>;
3666
3691
  assign: (c: Context, uid: string, input: AssignRoleInput) => Promise<RoleAssignment>;
3667
3692
  unassign: (c: Context, uid: string, input: AssignRoleInput) => Promise<RoleAssignment>;
3693
+ searchPrincipals: (c: Context, term: string) => Promise<Principal[]>;
3668
3694
  }
3669
3695
  declare const Endpoints: {
3670
3696
  GetActions: {
@@ -3699,6 +3725,10 @@ declare const Endpoints: {
3699
3725
  uri: string;
3700
3726
  method: string;
3701
3727
  };
3728
+ SearchPrincipals: {
3729
+ uri: string;
3730
+ method: string;
3731
+ };
3702
3732
  };
3703
3733
 
3704
3734
  type index$2_Action = Action;
@@ -3711,6 +3741,8 @@ type index$2_AssignRoleInput = AssignRoleInput;
3711
3741
  type index$2_CreateRoleInput = CreateRoleInput;
3712
3742
  declare const index$2_Endpoints: typeof Endpoints;
3713
3743
  type index$2_IAPI = IAPI;
3744
+ type index$2_Principal = Principal;
3745
+ declare const index$2_PrincipalSchema: typeof PrincipalSchema;
3714
3746
  type index$2_Role = Role;
3715
3747
  type index$2_RoleAssignment = RoleAssignment;
3716
3748
  declare const index$2_RoleAssignmentSchema: typeof RoleAssignmentSchema;
@@ -3723,7 +3755,7 @@ type index$2_UpdateRoleInput = UpdateRoleInput;
3723
3755
  declare const index$2_isScopeable: typeof isScopeable;
3724
3756
  declare const index$2_listActionCatalog: typeof listActionCatalog;
3725
3757
  declare namespace index$2 {
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 };
3758
+ 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_Principal as Principal, index$2_PrincipalSchema as PrincipalSchema, 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 };
3727
3759
  }
3728
3760
 
3729
3761
  declare class ShredAPI {
package/dist/index.js CHANGED
@@ -6015,6 +6015,7 @@ __export(rbac_exports, {
6015
6015
  ActionCatalog: () => ActionCatalog,
6016
6016
  Actions: () => Actions,
6017
6017
  Endpoints: () => Endpoints9,
6018
+ PrincipalSchema: () => PrincipalSchema,
6018
6019
  RoleAssignmentSchema: () => RoleAssignmentSchema,
6019
6020
  RoleGrantSchema: () => RoleGrantSchema,
6020
6021
  RoleSchema: () => RoleSchema,
@@ -6059,6 +6060,14 @@ var Actions = {
6059
6060
  NOTE_CREATE: "note.create",
6060
6061
  NOTE_UPDATE: "note.update",
6061
6062
  NOTE_DELETE: "note.delete",
6063
+ // — Notifications (inbox + trigger) —
6064
+ NOTIFICATION_LIST_OWN: "notification.list_own",
6065
+ NOTIFICATION_MARK_READ: "notification.mark_read",
6066
+ NOTIFICATION_CLEAR: "notification.clear",
6067
+ TRIGGER_VIEW: "trigger.view",
6068
+ TRIGGER_CREATE: "trigger.create",
6069
+ TRIGGER_UPDATE: "trigger.update",
6070
+ TRIGGER_DELETE: "trigger.delete",
6062
6071
  // — Tenants —
6063
6072
  TENANT_CREATE: "tenant.create",
6064
6073
  TENANT_LIST: "tenant.list",
@@ -6141,6 +6150,14 @@ var ActionCatalog = {
6141
6150
  [Actions.NOTE_CREATE]: { label: "Add a note to a user", group: "Notes" },
6142
6151
  [Actions.NOTE_UPDATE]: { label: "Edit a user note", group: "Notes" },
6143
6152
  [Actions.NOTE_DELETE]: { label: "Delete a user note", group: "Notes" },
6153
+ // Notifications
6154
+ [Actions.NOTIFICATION_LIST_OWN]: { label: "View your own notifications", group: "Notifications" },
6155
+ [Actions.NOTIFICATION_MARK_READ]: { label: "Mark your own notifications as read", group: "Notifications" },
6156
+ [Actions.NOTIFICATION_CLEAR]: { label: "Clear your own notifications", group: "Notifications" },
6157
+ [Actions.TRIGGER_VIEW]: { label: "View notification triggers", group: "Notifications" },
6158
+ [Actions.TRIGGER_CREATE]: { label: "Create notification triggers", group: "Notifications" },
6159
+ [Actions.TRIGGER_UPDATE]: { label: "Update notification triggers", group: "Notifications" },
6160
+ [Actions.TRIGGER_DELETE]: { label: "Delete notification triggers", group: "Notifications" },
6144
6161
  // Tenants
6145
6162
  [Actions.TENANT_CREATE]: { label: "Create a tenant", group: "Tenants" },
6146
6163
  [Actions.TENANT_LIST]: { label: "List all tenants", group: "Tenants" },
@@ -6220,6 +6237,14 @@ var RoleAssignmentSchema = external_exports.object({
6220
6237
  roles: external_exports.array(RoleGrantSchema)
6221
6238
  });
6222
6239
 
6240
+ // src/model/rbac/Principal.schema.ts
6241
+ var PrincipalSchema = external_exports.object({
6242
+ uid: external_exports.string(),
6243
+ email: external_exports.string(),
6244
+ name: external_exports.string(),
6245
+ disabled: external_exports.boolean()
6246
+ });
6247
+
6223
6248
  // src/model/rbac/RBAC.api.ts
6224
6249
  var Endpoints9 = {
6225
6250
  GetActions: { uri: "/rbac/actions", method: "GET" },
@@ -6229,7 +6254,8 @@ var Endpoints9 = {
6229
6254
  DeleteRole: { uri: "/rbac/roles/:roleId", method: "DELETE" },
6230
6255
  GetAssignments: { uri: "/rbac/assignments/:uid", method: "GET" },
6231
6256
  Assign: { uri: "/rbac/assignments/:uid", method: "POST" },
6232
- Unassign: { uri: "/rbac/assignments/:uid", method: "DELETE" }
6257
+ Unassign: { uri: "/rbac/assignments/:uid", method: "DELETE" },
6258
+ SearchPrincipals: { uri: "/rbac/principals", method: "GET" }
6233
6259
  };
6234
6260
 
6235
6261
  // src/api/RBAC.api.ts
@@ -6282,6 +6308,11 @@ var RBACAPI = class {
6282
6308
  const uri = e.uri.replace(":uid", uid);
6283
6309
  return this.clientHTTP.makeRequest(this.env, uri, e.method, input, c, RoleAssignmentSchema);
6284
6310
  }
6311
+ async searchPrincipals(c, term) {
6312
+ const e = Endpoints9.SearchPrincipals;
6313
+ const uri = `${e.uri}?q=${encodeURIComponent(term)}`;
6314
+ return this.clientHTTP.makeRequest(this.env, uri, e.method, null, c, external_exports.array(PrincipalSchema));
6315
+ }
6285
6316
  };
6286
6317
  var RBAC_api_default = RBACAPI;
6287
6318