import Base, { MaybeRaw } from "../../../Base"; import { DetailedRole, Permission, PermissionDiscovery, Role } from "../../../interfaces/cosmo/permissions"; import { SearchFilter, Sorting } from "../../../interfaces/global"; export declare class CosmoPermissions extends Base { /** * Fetches a list of all available permissions that can be assigned to roles. * * @returns A promise resolving to the permission discovery metadata. */ listAllPermissions(raw?: { raw: R; }): Promise>; /** * Creates a new role within a specified organization and space. * * @param orgName - The name of the organization. * @param spaceName - The name of the space. * @param roleName - The name of the new role. * @param permissions - A record of resource keys to arrays of permission names. * @returns A promise resolving to the created role object. */ createRole(orgName: string, spaceName: string, roleName: string, permissions: Record, raw?: { raw: R; }): Promise>; /** * Searches for roles within a space based on filters, sorting, and pagination. * * @param options - An object containing search parameters. * @param options.orgName - The name of the organization. * @param options.spaceName - The name of the space. * @param options.filters - Optional array of search filters. * @param options.sorting - Optional sorting criteria. * @param options.limit - Optional limit for pagination. * @param options.page - Optional page number for pagination. * @returns A promise resolving to a list of matching role objects. */ searchRoles({ orgName, spaceName, filters, sorting, limit, page, }: { orgName: string; spaceName: string; filters?: SearchFilter[]; sorting?: Sorting; limit?: number; page?: number; }, raw?: { raw: R; }): Promise>; /** * Updates an existing role's name and permissions. * * @param orgName - The name of the organization. * @param spaceName - The name of the space. * @param roleId - The ID of the role to update. * @param newName - The new name for the role. * @param permissions - The updated permissions mapping. * @returns A promise resolving to the updated role. */ updateRole(orgName: string, spaceName: string, roleId: string, newName: string, permissions: Record, raw?: { raw: R; }): Promise>; /** * Fetches detailed information about a specific role. * * @param orgName - The name of the organization. * @param spaceName - The name of the space. * @param roleId - The ID of the role to retrieve. * @returns A promise resolving to the detailed role object. */ fetchRole(orgName: string, spaceName: string, roleId: string, raw?: { raw: R; }): Promise>; /** * Deletes a role by its ID. * * @param orgName - The name of the organization. * @param spaceName - The name of the space. * @param roleId - The ID of the role to delete. * @returns A promise that resolves when the role is deleted. */ deleteRole(orgName: string, spaceName: string, roleId: string, raw?: { raw: R; }): Promise>; /** * Assigns a user to a role. * * @param orgName - The name of the organization. * @param spaceName - The name of the space. * @param roleId - The ID of the role. * @param userId - The ID of the user to assign. * @returns A promise that resolves when the assignment is complete. */ assignUserToRole(orgName: string, spaceName: string, roleId: string, userId: string, raw?: { raw: R; }): Promise>; /** * Unassigns a user from a role. * * @param orgName - The name of the organization. * @param spaceName - The name of the space. * @param roleId - The ID of the role. * @param userId - The ID of the user to unassign. * @returns A promise that resolves when the user is removed. */ unassignUserFromRole(orgName: string, spaceName: string, roleId: string, userId: string, raw?: { raw: R; }): Promise>; /** * Assigns a team to a role. * * @param orgName - The name of the organization. * @param spaceName - The name of the space. * @param roleId - The ID of the role. * @param teamName - The name of the team to assign. * @returns A promise that resolves when the assignment is complete. */ assignTeamToRole(orgName: string, spaceName: string, roleId: string, teamName: string, raw?: { raw: R; }): Promise>; /** * Unassigns a team from a role. * * @param orgName - The name of the organization. * @param spaceName - The name of the space. * @param roleId - The ID of the role. * @param teamName - The name of the team to unassign. * @returns A promise that resolves when the team is removed. */ unassignTeamFromRole(orgName: string, spaceName: string, roleId: string, teamName: string, raw?: { raw: R; }): Promise>; protected getEndpoint(endpoint: string): string; }