UNPKG

@unkey/api

Version:

Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@unkey/api* API.

113 lines 4.71 kB
import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; export declare class Permissions extends ClientSDK { /** * Create permission * * @remarks * Create a new permission to define specific actions or capabilities in your RBAC system. Permissions can be assigned directly to API keys or included in roles. * * Use hierarchical naming patterns like `documents.read`, `admin.users.delete`, or `billing.invoices.create` for clear organization. * * **Important:** Permission names must be unique within the workspace. Once created, permissions are immediately available for assignment. * * **Required Permissions** * * Your root key must have the following permission: * - `rbac.*.create_permission` */ createPermission(request: components.V2PermissionsCreatePermissionRequestBody, options?: RequestOptions): Promise<components.V2PermissionsCreatePermissionResponseBody>; /** * Create role * * @remarks * Create a new role to group related permissions for easier management. Roles enable consistent permission assignment across multiple API keys. * * **Important:** Role names must be unique within the workspace. Once created, roles are immediately available for assignment. * * **Required Permissions** * * Your root key must have the following permission: * - `rbac.*.create_role` */ createRole(request: components.V2PermissionsCreateRoleRequestBody, options?: RequestOptions): Promise<components.V2PermissionsCreateRoleResponseBody>; /** * Delete permission * * @remarks * Remove a permission from your workspace. This also removes the permission from all API keys and roles. * * **Important:** This operation cannot be undone and immediately affects all API keys and roles that had this permission assigned. * * **Required Permissions** * * Your root key must have the following permission: * - `rbac.*.delete_permission` */ deletePermission(request: components.V2PermissionsDeletePermissionRequestBody, options?: RequestOptions): Promise<components.V2PermissionsDeletePermissionResponseBody>; /** * Delete role * * @remarks * Remove a role from your workspace. This also removes the role from all assigned API keys. * * **Important:** This operation cannot be undone and immediately affects all API keys that had this role assigned. * * **Required Permissions** * * Your root key must have the following permission: * - `rbac.*.delete_role` */ deleteRole(request: components.V2PermissionsDeleteRoleRequestBody, options?: RequestOptions): Promise<components.V2PermissionsDeleteRoleResponseBody>; /** * Get permission * * @remarks * Retrieve details about a specific permission including its name, description, and metadata. * * **Required Permissions** * * Your root key must have the following permission: * - `rbac.*.read_permission` */ getPermission(request: components.V2PermissionsGetPermissionRequestBody, options?: RequestOptions): Promise<components.V2PermissionsGetPermissionResponseBody>; /** * Get role * * @remarks * Retrieve details about a specific role including its assigned permissions. * * **Required Permissions** * * Your root key must have the following permission: * - `rbac.*.read_role` */ getRole(request: components.V2PermissionsGetRoleRequestBody, options?: RequestOptions): Promise<components.V2PermissionsGetRoleResponseBody>; /** * List permissions * * @remarks * Retrieve all permissions in your workspace. * Results are paginated and sorted by their id. * * **Required Permissions** * * Your root key must have the following permission: * - `rbac.*.read_permission` */ listPermissions(request: components.V2PermissionsListPermissionsRequestBody, options?: RequestOptions): Promise<components.V2PermissionsListPermissionsResponseBody>; /** * List roles * * @remarks * Retrieve all roles in your workspace including their assigned permissions. * Results are paginated and sorted by their id. * * **Required Permissions** * * Your root key must have the following permission: * - `rbac.*.read_role` */ listRoles(request: components.V2PermissionsListRolesRequestBody, options?: RequestOptions): Promise<components.V2PermissionsListRolesResponseBody>; } //# sourceMappingURL=permissions.d.ts.map