import { ExtensionCommandType, ExtensionCategories, ExtensionPermissions } from '../utils/constant/extension.const.cjs'; import './utils.interface.cjs'; declare enum UserRole { User = "user", Admin = "admin" } type APISuccessResult = { success: true; data: T; } | { success: false; data?: null; }; interface ApiUserProfile { id: string; name: string; role: UserRole; createdAt: string; email: string | null; website: string | null; username: string | null; avatarUrl: string | null; githubHandle: string | null; } type ApiUserData = Pick; interface ApiExtensionCommand { name: string; title: string; description?: string; isInternal?: boolean; type: ExtensionCommandType; } type ApiExtensionStatus = 'in-review' | 'rejected' | 'published'; interface ApiExtensionEntry { status: ApiExtensionStatus; rejectReason: string | null; } type ApiExtensionOwner = Pick; interface ApiExtension { id: string; name: string; title: string; version: string; iconUrl: string; banners: string[]; sourceUrl: string; createdAt: string; updatedAt: string; apiVersion: string; downloadUrl: string; description: string; relativePath: string; isPublished: boolean; downloadCount: number; owner: ApiExtensionOwner; entry: ApiExtensionEntry | null; commands: ApiExtensionCommand[]; categories: ExtensionCategories[]; permissions?: ExtensionPermissions[]; } type ApiExtensionCreatePayload = Pick; type ApiExtensionListItem = Pick; type ApiExtensionDetail = ApiExtensionListItem & Pick; type ApiExtensionStoreListItem = ApiExtensionListItem & Pick & { owner: ApiExtensionOwner; }; type ApiExtensionStoreDetail = Pick & { baseAssetURL: string; }; type ApiExtensionUserListItem = Omit & Pick; type ApiExtensionUserDetail = ApiExtensionDetail & Pick; type ApiExtensionHighlightItem = Pick; interface ApiStoreListExtensionsQuery { q?: string; nextCursor?: string; category?: ExtensionCategories; sortBy?: 'recently-added' | 'most-installed'; } interface ApiWorkflowNode { id: string; type: string; data: Record; position: { x: number; y: number; }; } interface ApiWorkflowEdge { id: string; source: string; target: string; sourceHandle: string; targetHandle: string; } interface ApiWorkflowViewport { x: number; y: number; zoom: number; } interface ApiWorkflowVariable { id: string; name: string; value: string; } interface ApiWorkflowData { edges: ApiWorkflowEdge[]; nodes: ApiWorkflowNode[]; viewport?: ApiWorkflowViewport; variables: ApiWorkflowVariable[]; } interface ApiWorkflow { id: string; name: string; icon: string; readme: string; createdAt: string; updatedAt: string; downloadCount: number; owner: ApiExtensionOwner; workflow: ApiWorkflowData; description?: string | null; categories: ExtensionCategories[]; } type ApiWorkflowUserInsertPayload = Pick; type ApiWorkflowUserUpdatePayload = Partial; type ApiWorkflowListItem = Pick; type ApiWorkflowUserListItem = ApiWorkflowListItem; type ApiWorkflowDetail = Pick; type ApiWorkflowStoreListItem = ApiWorkflowListItem; export { type APISuccessResult, type ApiExtension, type ApiExtensionCommand, type ApiExtensionCreatePayload, type ApiExtensionDetail, type ApiExtensionEntry, type ApiExtensionHighlightItem, type ApiExtensionListItem, type ApiExtensionOwner, type ApiExtensionStatus, type ApiExtensionStoreDetail, type ApiExtensionStoreListItem, type ApiExtensionUserDetail, type ApiExtensionUserListItem, type ApiStoreListExtensionsQuery, type ApiUserData, type ApiUserProfile, type ApiWorkflow, type ApiWorkflowData, type ApiWorkflowDetail, type ApiWorkflowEdge, type ApiWorkflowListItem, type ApiWorkflowNode, type ApiWorkflowStoreListItem, type ApiWorkflowUserInsertPayload, type ApiWorkflowUserListItem, type ApiWorkflowUserUpdatePayload, type ApiWorkflowVariable, type ApiWorkflowViewport, UserRole };