export interface SiloFileVariant { id: string; fileId: string; format: string; label?: string | null; mimeType: string; storagePath: string; size: number; width?: number | null; height?: number | null; createdAt: string; } export interface SiloFile { id: string; key: string; bucket: string; bucketName: string; originalName: string; mimeType: string; size: number; /** Total storage used: original + all variants (HLS, thumbnails, captions, etc.) */ totalSize?: number; status: string; errorCode?: string | null; isPrivate: boolean; expiresAt?: string; createdAt: string; updatedAt: string; /** AI-generated or user-defined title */ title?: string | null; /** AI-generated or user-defined description */ description?: string | null; /** AI-generated or user-defined tags */ tags?: string[] | null; /** Age rating per region: { US: "PG-13", BR: "14", EU: "PEGI 16" } */ age_ratings?: Record | null; /** Aggregate reaction counts */ reactions?: { LOVE: number; LIKE: number; DISLIKE: number; }; metadata?: SiloFileMetadata; jobs?: never; variants?: SiloFileVariant[]; captions?: SiloFileCaption[]; audioTracks?: SiloFileAudioTrack[]; /** Direct URL for raw (unprocessed) video files — only present when no HLS variant exists */ rawVideoUrl?: string | null; /** Presigned access URLs for media sub-resources, included in /meta responses */ accessUrls?: { captions?: Array<{ language: string; label?: string | null; url: string; }>; audioTracks?: Array<{ language: string; label?: string | null; url: string; }>; }; } export interface SiloFileMetadata { id: string; fileId: string; width?: number; height?: number; format?: string; duration?: number; fps?: number; videoCodec?: string; audioCodec?: string; hasHls: boolean; hasAv1: boolean; storyboardVttPath?: string | null; storyboardSpritePath?: string | null; caption?: string; altText?: string; } export interface SiloFileCaption { id: string; fileId: string; storagePath: string; language: string; label?: string | null; createdAt: string; } export interface SiloFileAudioTrack { id: string; fileId: string; storagePath: string; language: string; label?: string | null; createdAt: string; } /** * All possible File.status values from the Silo API. * READY/FAILED/CANCELLED/DELETED are terminal; everything else means processing is still in flight. * Raw uploads (`image.raw`/`video.raw`) skip the pipeline entirely and go straight to READY. */ export type FileStatus = "CREATED" | "UPLOADING" | "INGESTING" | "QUEUED" | "PROCESSING" | "FINISHED" | "SYNCING" | "PARTIAL_READY" | "READY" | "FAILED" | "CANCELLED" | "DELETED"; export interface UploadResult { id: string; key: string; bucket: string; /** Viewer URL — routes through the API (auth, transforms, HLS rewrite) */ url: string; /** * Direct URL to the file on S3/CDN. * Public files: CDN URL. Private files: null (use getSignedUrl instead). * null while file is still processing (image/video). */ directUrl: string | null; signedUrl?: string; mimeType: string; size: number; status: FileStatus; /** True when `status` is a terminal, fully-processed state (raw uploads are READY immediately). */ isReady: boolean; /** True when the file is still going through the processing pipeline. */ isProcessing: boolean; /** True when processing failed or the upload was cancelled. */ isFailed: boolean; category: "image" | "video" | "audio" | "document"; } export type DeleteFileResult = { deleted: true; status: 204; } | { deleted: true; status: 202; message: string; } | { deleted: false; status: 409; error: string; canMarkForDeletion: boolean; }; export interface SignedUrlResult { /** Direct URL: CDN for public files, presigned S3 for private files */ url: string; expiresIn: number; viewerQuery?: string; } export interface ListFilesResult { items: SiloFile[]; nextCursor?: string; } export interface OrgQuota { plan: string; storageUsedBytes: number; storageLimitBytes: number; } export interface DashboardData { buckets: SiloBucket[]; files: SiloFile[]; quota: OrgQuota; } export interface SiloServiceAccountConfig { /** OAuth2 issuer base URL — token endpoint will be `{issuerUrl}/token` */ issuerUrl: string; clientId: string; clientSecret: string; } export interface SiloClientOptions { baseUrl: string; /** Base URL of the Silo dashboard app (e.g. "https://silo.geekapps.com.br"). Used by getViewUrl. */ appUrl?: string; token?: string; /** Called on 401 to get a fresh token and retry. Takes precedence over static `token`. */ tokenProvider?: () => Promise; /** Service account credentials for server-side use. Token is fetched automatically and cached for ~6 min. */ serviceAccount?: SiloServiceAccountConfig; defaultBucket?: string; } export interface UploadOptions { bucket?: string; expiresIn?: number; onProgress?: (progress: number) => void; } export interface PresignResult { fileId: string; uploadUrl: string; key: string; bucket: string; s3Key: string; expiresAt: string; } export interface SignOptions { ttl?: number; disposition?: "inline" | "attachment"; w?: string; h?: string; fit?: string; crop?: string; type?: string; q?: string; effect?: string; blur?: string; } export interface SiloAgeRating { id: string; organizationId: string; region: string; code: string; title: string; description: string; imageUrl?: string | null; imageKey?: string | null; createdAt: string; updatedAt: string; } /** @deprecated jobs are no longer tracked — use File.status instead */ export type ProcessingJobStatus = "PENDING" | "PROCESSING" | "DONE" | "FAILED" | "DEAD"; export interface SiloBucket { id: string; name: string; slug: string; visibility: "PUBLIC" | "PRIVATE"; fileCount: number; lastUploadAt: string | null; createdAt: string; } export interface ListBucketsResult { items: SiloBucket[]; } export interface MultipartStartResult { fileId: string; uploadId: string; s3Key: string; } export interface MultipartPartUrl { url: string; partNumber: number; } export interface MultipartPart { PartNumber: number; ETag: string; } export interface ImageUploadOptions { optimize?: boolean; format?: "webp" | "avif" | "heic" | "jpeg" | "png"; /** Skip image processing entirely — file is stored as-is and marked READY immediately. */ raw?: boolean; } export interface VideoUploadOptions { thumbnails?: boolean; storyboard?: boolean; autoCaptions?: boolean; /** Languages to generate captions for (e.g. ["pt", "en", "es"]). Original language is always transcribed when autoCaptions is true. */ languages?: string[]; /** Subset of caption languages to also generate chapters for. Empty = no chapters. */ chapterLanguages?: string[]; separateAudio?: boolean; codec?: "h264" | "h265" | "av1"; transcoding?: Array<"144" | "240" | "360" | "480" | "720" | "1080" | "1440" | "2160"> | "auto"; /** Generate title, description, tags and age ratings via AI analysis of video frames + transcript. */ enrich?: boolean; /** Audio codec. "passthrough" = copy original when HLS-compatible, AAC fallback otherwise. */ audioCodec?: "passthrough" | "aac" | "opus"; /** Audio channel layout. "original" = keep source channels. */ audioChannels?: "original" | "stereo" | "5.1"; /** Preserve Dolby Atmos metadata when present (only effective with eac3 or passthrough). */ preserveAtmos?: boolean; /** HDR handling. "preserve" = keep HDR when codec supports it, "sdr" = tonemap to SDR. */ hdr?: "preserve" | "sdr"; /** Skip video processing entirely — file is stored as-is and marked READY immediately. */ raw?: boolean; } export interface MultipartStartOptions { fileName: string; mimeType: string; size: number; bucket?: string; isPrivate?: boolean; expiresIn?: number; image?: ImageUploadOptions; video?: VideoUploadOptions; } export interface BatchFileEntry { fileName: string; mimeType: string; size: number; } export interface BatchStartOptions { bucket?: string; expiresIn?: number; image?: ImageUploadOptions; video?: VideoUploadOptions; isPrivate?: boolean; /** BCP-47 language codes for auto-generated captions (e.g. ["pt", "en", "es"]) */ captionLanguages?: string[]; files: BatchFileEntry[]; } export interface BatchUploadItem { file_index: number; file_id: string; upload_id: string; s3_key: string; file_name: string; mime_type: string; part_url_template: string; complete_url: string; abort_url: string; expires_at: string; } export interface BatchStartResult { batch_id: string; bucket: string; visibility: string; pipeline_settings: { image?: ImageUploadOptions; video?: { codec: string; transcoding: string[] | "auto"; features: { thumbnails: boolean; storyboard: boolean; auto_captions: boolean; separate_audio: boolean; enrich: boolean; }; caption_languages?: string[]; chapter_languages?: string[]; }; }; expires_at: string; uploads: BatchUploadItem[]; } export interface BatchStatus { batch_id: string; bucket: string; visibility: string; pipeline_settings: Record; status: "PENDING" | "UPLOADING" | "COMPLETE" | "CANCELLED"; file_count: number; expires_at: string; created_at: string; status_counts: Record; files: Array<{ file_id: string; file_name: string; mime_type: string; size: number; status: string; uploaded_at: string | null; }>; } /** @deprecated jobs are no longer tracked — use File.status instead */ export interface ProcessingJob { id: string; fileId: string; type: string; status: ProcessingJobStatus; attempts: number; error?: string; createdAt: string; startedAt?: string; finishedAt?: string; } //# sourceMappingURL=types.d.ts.map