UNPKG

buildx-connect

Version:

Official JavaScript/TypeScript SDK for Buildx low-code platform

45 lines (44 loc) 1.34 kB
import { ErrorResponse, SuccessResponse, BuildxConfig } from "../types/index"; /** * Storage service for Buildx * Handles file upload, download, and management * * @example * ```typescript * const storage = buildx.storage(); * * // Upload file * const result = await storage.upload(file, 'uploads/'); * * // List files in directory * const files = await storage.list('uploads/'); * * // Delete file * await storage.delete('uploads/file.txt'); * ``` */ export declare class Storage { private baseService; constructor(config: BuildxConfig); updateConfig(config: BuildxConfig): void; /** * Upload file to storage */ upload(file: File, prefix?: string, projectId?: string): Promise<SuccessResponse | ErrorResponse>; /** * Upload file to collection storage */ uploadToCollection(file: File, collectionId: string, prefix?: string, projectId?: string): Promise<SuccessResponse | ErrorResponse>; /** * List files in directory */ list(path: string, projectId?: string): Promise<any | ErrorResponse>; /** * Get storage size for path */ getSize(path: string, projectId?: string): Promise<any | ErrorResponse>; /** * Delete file from storage */ delete(path: string, projectId?: string): Promise<SuccessResponse | ErrorResponse>; }