/** * Utility functions and types for OpenAPI processing */ export interface Operation { 'x-permit-action'?: string; 'x-permit-role'?: string; 'x-permit-resource-role'?: string; 'x-permit-relation'?: Record; 'x-permit-derived-role'?: { base_role: string; derived_role: string; resource?: string; relation?: string; }; [key: string]: unknown; } export interface PathItem { 'x-permit-resource'?: string; get?: Operation; post?: Operation; put?: Operation; delete?: Operation; patch?: Operation; options?: Operation; head?: Operation; [key: string]: unknown; } export interface OpenApiDocument { paths?: Record; servers?: Array<{ url: string; }>; [key: string]: unknown; } export interface RelationObject { key: string; name: string; subject_resource: string; object_resource: string; description?: string; } export interface DerivedRoleObject { key: string; name: string; base_role: string; derived_role: string; resource?: string; relation?: string; description?: string; } export interface UrlMapping { url: string; http_method: string; resource: string; action: string; headers?: Record; } export interface ErrorObject { error_code?: string; title?: string; message?: string; detail?: string; } export declare const HTTP_METHODS: readonly ["get", "post", "put", "delete", "patch", "options", "head"]; /** * Convert resource keys to valid format (no colons, only alphanumeric, dashes, underscores) */ export declare const sanitizeKey: (key: string) => string; /** * Check if error is a duplicate entity error */ export declare const isDuplicateError: (error: unknown) => boolean; export interface ApiResponseData { data?: T[]; [key: string]: unknown; } export interface ApiResponse { success?: boolean; data?: T; error?: string | ErrorObject | null; status?: number; }