shred-api-client 2.9.2 → 2.9.3

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
@@ -3653,6 +3653,24 @@ declare const RoleAssignmentSchema: z.ZodObject<{
3653
3653
  type RoleGrant = z.infer<typeof RoleGrantSchema>;
3654
3654
  type RoleAssignment = z.infer<typeof RoleAssignmentSchema>;
3655
3655
 
3656
+ declare const PrincipalSchema: z.ZodObject<{
3657
+ uid: z.ZodString;
3658
+ email: z.ZodString;
3659
+ name: z.ZodString;
3660
+ disabled: z.ZodBoolean;
3661
+ }, "strip", z.ZodTypeAny, {
3662
+ email: string;
3663
+ name: string;
3664
+ uid: string;
3665
+ disabled: boolean;
3666
+ }, {
3667
+ email: string;
3668
+ name: string;
3669
+ uid: string;
3670
+ disabled: boolean;
3671
+ }>;
3672
+ type Principal = z.infer<typeof PrincipalSchema>;
3673
+
3656
3674
  type CreateRoleInput = Omit<Role, "id">;
3657
3675
  type UpdateRoleInput = Partial<Omit<Role, "id">>;
3658
3676
  type AssignRoleInput = RoleGrant;
@@ -3665,6 +3683,7 @@ interface IAPI {
3665
3683
  getAssignments: (c: Context, uid: string) => Promise<RoleAssignment | null>;
3666
3684
  assign: (c: Context, uid: string, input: AssignRoleInput) => Promise<RoleAssignment>;
3667
3685
  unassign: (c: Context, uid: string, input: AssignRoleInput) => Promise<RoleAssignment>;
3686
+ searchPrincipals: (c: Context, term: string) => Promise<Principal[]>;
3668
3687
  }
3669
3688
  declare const Endpoints: {
3670
3689
  GetActions: {
@@ -3699,6 +3718,10 @@ declare const Endpoints: {
3699
3718
  uri: string;
3700
3719
  method: string;
3701
3720
  };
3721
+ SearchPrincipals: {
3722
+ uri: string;
3723
+ method: string;
3724
+ };
3702
3725
  };
3703
3726
 
3704
3727
  type index$2_Action = Action;
@@ -3711,6 +3734,8 @@ type index$2_AssignRoleInput = AssignRoleInput;
3711
3734
  type index$2_CreateRoleInput = CreateRoleInput;
3712
3735
  declare const index$2_Endpoints: typeof Endpoints;
3713
3736
  type index$2_IAPI = IAPI;
3737
+ type index$2_Principal = Principal;
3738
+ declare const index$2_PrincipalSchema: typeof PrincipalSchema;
3714
3739
  type index$2_Role = Role;
3715
3740
  type index$2_RoleAssignment = RoleAssignment;
3716
3741
  declare const index$2_RoleAssignmentSchema: typeof RoleAssignmentSchema;
@@ -3723,7 +3748,7 @@ type index$2_UpdateRoleInput = UpdateRoleInput;
3723
3748
  declare const index$2_isScopeable: typeof isScopeable;
3724
3749
  declare const index$2_listActionCatalog: typeof listActionCatalog;
3725
3750
  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 };
3751
+ 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
3752
  }
3728
3753
 
3729
3754
  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,
@@ -6220,6 +6221,14 @@ var RoleAssignmentSchema = external_exports.object({
6220
6221
  roles: external_exports.array(RoleGrantSchema)
6221
6222
  });
6222
6223
 
6224
+ // src/model/rbac/Principal.schema.ts
6225
+ var PrincipalSchema = external_exports.object({
6226
+ uid: external_exports.string(),
6227
+ email: external_exports.string(),
6228
+ name: external_exports.string(),
6229
+ disabled: external_exports.boolean()
6230
+ });
6231
+
6223
6232
  // src/model/rbac/RBAC.api.ts
6224
6233
  var Endpoints9 = {
6225
6234
  GetActions: { uri: "/rbac/actions", method: "GET" },
@@ -6229,7 +6238,8 @@ var Endpoints9 = {
6229
6238
  DeleteRole: { uri: "/rbac/roles/:roleId", method: "DELETE" },
6230
6239
  GetAssignments: { uri: "/rbac/assignments/:uid", method: "GET" },
6231
6240
  Assign: { uri: "/rbac/assignments/:uid", method: "POST" },
6232
- Unassign: { uri: "/rbac/assignments/:uid", method: "DELETE" }
6241
+ Unassign: { uri: "/rbac/assignments/:uid", method: "DELETE" },
6242
+ SearchPrincipals: { uri: "/rbac/principals", method: "GET" }
6233
6243
  };
6234
6244
 
6235
6245
  // src/api/RBAC.api.ts
@@ -6282,6 +6292,11 @@ var RBACAPI = class {
6282
6292
  const uri = e.uri.replace(":uid", uid);
6283
6293
  return this.clientHTTP.makeRequest(this.env, uri, e.method, input, c, RoleAssignmentSchema);
6284
6294
  }
6295
+ async searchPrincipals(c, term) {
6296
+ const e = Endpoints9.SearchPrincipals;
6297
+ const uri = `${e.uri}?q=${encodeURIComponent(term)}`;
6298
+ return this.clientHTTP.makeRequest(this.env, uri, e.method, null, c, external_exports.array(PrincipalSchema));
6299
+ }
6285
6300
  };
6286
6301
  var RBAC_api_default = RBACAPI;
6287
6302