@unkey/api
Version:
Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@unkey/api* API.
51 lines • 2.48 kB
TypeScript
import * as z from "zod/v3";
export type V2PermissionsCreatePermissionRequestBody = {
/**
* Creates a permission with this human-readable name that describes its purpose.
*
* @remarks
* Names must be unique within your workspace to prevent conflicts during assignment.
* Use clear, semantic names that developers can easily understand when building authorization logic.
* Consider using hierarchical naming conventions like 'resource.action' for better organization.
*
* Examples: 'users.read', 'billing.write', 'analytics.view', 'admin.manage'
*/
name: string;
/**
* Creates a URL-safe identifier for this permission that can be used in APIs and integrations.
*
* @remarks
* Must start with a letter and contain only letters, numbers, periods, underscores, and hyphens.
* Slugs are often used in REST endpoints, configuration files, and external integrations.
* Should closely match the name but in a format suitable for technical usage.
* Must be unique within your workspace to ensure reliable permission lookups.
*
* Keep slugs concise but descriptive for better developer experience.
*/
slug: string;
/**
* Provides detailed documentation of what this permission grants access to.
*
* @remarks
* Include information about affected resources, allowed actions, and any important limitations.
* This internal documentation helps team members understand permission scope and security implications.
* Not visible to end users - designed for development teams and security audits.
*
* Consider documenting:
* - What resources can be accessed
* - What operations are permitted
* - Any conditions or limitations
* - Related permissions that might be needed
*/
description?: string | undefined;
};
/** @internal */
export type V2PermissionsCreatePermissionRequestBody$Outbound = {
name: string;
slug: string;
description?: string | undefined;
};
/** @internal */
export declare const V2PermissionsCreatePermissionRequestBody$outboundSchema: z.ZodType<V2PermissionsCreatePermissionRequestBody$Outbound, z.ZodTypeDef, V2PermissionsCreatePermissionRequestBody>;
export declare function v2PermissionsCreatePermissionRequestBodyToJSON(v2PermissionsCreatePermissionRequestBody: V2PermissionsCreatePermissionRequestBody): string;
//# sourceMappingURL=v2permissionscreatepermissionrequestbody.d.ts.map