import { APIResource } from "../../core/resource.js"; import * as FilesAPI from "./files.js"; import { APIPromise } from "../../core/api-promise.js"; import { RequestOptions } from "../../internal/request-options.js"; export declare class Uploads extends APIResource { /** * Initiate a multipart upload and receive presigned URLs for uploading parts * directly to storage. */ create(body: UploadCreateParams, options?: RequestOptions): APIPromise; /** * Get a multipart upload's details with fresh presigned URLs for any parts not yet * uploaded. */ retrieve(uploadID: string, options?: RequestOptions): APIPromise; /** * List all in-progress multipart uploads for the authenticated organization. */ list(options?: RequestOptions): APIPromise; /** * Abort a multipart upload and clean up any uploaded parts. */ abort(uploadID: string, options?: RequestOptions): APIPromise; /** * Complete a multipart upload after all parts have been uploaded. Creates the file * object and returns it. */ complete(uploadID: string, body: UploadCompleteParams, options?: RequestOptions): APIPromise; } export interface MultipartUploadPart { /** * 1-based part number */ part_number: number; /** * ETag returned by the storage backend after uploading the part */ etag: string; } export interface MultipartUploadPartURL { /** * 1-based part number */ part_number: number; /** * Presigned URL for uploading this part */ url: string; } export interface UploadCreateResponse { /** * The multipart upload ID (use this to complete or abort) */ id: string; /** * Presigned URLs for uploading parts */ part_urls: Array; } export interface UploadRetrieveResponse { /** * The multipart upload record ID */ id: string; /** * Original filename */ filename: string; /** * Total file size in bytes */ file_size: number; /** * MIME type of the file */ mime_type: string; /** * Number of parts the file was split into */ part_count: number; /** * When the upload was initiated */ created_at: string; /** * Parts that have already been uploaded */ completed_parts: Array; /** * Presigned URLs for the parts that still need to be uploaded */ part_urls: Array; } export interface UploadListResponse { /** * List of in-progress multipart uploads */ data: Array; } export declare namespace UploadListResponse { /** * List of in-progress multipart uploads */ interface Data { /** * The multipart upload record ID */ id: string; /** * Original filename */ filename: string; /** * Total file size in bytes */ file_size: number; /** * MIME type of the file */ mime_type: string; /** * Number of parts the file was split into */ part_count: number; /** * When the upload was initiated */ created_at: string; } } export interface UploadAbortResponse { /** * The ID of the deleted file */ id: string; /** * Whether the file was deleted */ deleted?: boolean; /** * The type of the deleted object */ object?: 'file'; } export interface UploadCreateParams { /** * Name of the file including extension */ filename: string; /** * Total size of the file in bytes */ file_size: number; /** * MIME type of the file */ mime_type: string; /** * Number of parts to split the upload into */ part_count?: number; } export interface UploadCompleteParams { /** * List of completed parts with their ETags */ parts: Array; } export declare namespace Uploads { export { type MultipartUploadPart as MultipartUploadPart, type MultipartUploadPartURL as MultipartUploadPartURL, type UploadCreateResponse as UploadCreateResponse, type UploadRetrieveResponse as UploadRetrieveResponse, type UploadListResponse as UploadListResponse, type UploadAbortResponse as UploadAbortResponse, type UploadCreateParams as UploadCreateParams, type UploadCompleteParams as UploadCompleteParams, }; } //# sourceMappingURL=uploads.d.ts.map