import { ServiceBubble } from '../../../types/service-bubble-class.js'; import type { BubbleContext } from '../../../types/bubble.js'; import { CredentialType } from '@bubblelab/shared-schemas'; import { type S3ParamsInput, type S3Result } from './s3.schema.js'; /** * S3 Storage Service Bubble * * S3-compatible storage operations for file management. * Works with AWS S3, MinIO, DigitalOcean Spaces, Backblaze B2, and other * S3-compatible providers via a configurable endpoint. * * Uses a single bundled credential (S3_CRED) containing: * - accessKeyId, secretAccessKey (required) * - endpoint (optional, for non-AWS providers) * - region (optional, defaults to us-east-1) */ export declare class S3Bubble extends ServiceBubble> { static readonly service = "s3"; static readonly authType: "apikey"; static readonly bubbleName = "s3-storage"; static readonly type: "service"; static readonly schema: import("zod").ZodDiscriminatedUnion<"operation", [import("zod").ZodObject<{ operation: import("zod").ZodLiteral<"getUploadUrl">; bucketName: import("zod").ZodString; fileName: import("zod").ZodString; region: import("zod").ZodOptional; expirationMinutes: import("zod").ZodDefault>; contentType: import("zod").ZodOptional; userId: import("zod").ZodOptional; credentials: import("zod").ZodOptional, import("zod").ZodString>>; }, "strip", import("zod").ZodTypeAny, { operation: "getUploadUrl"; bucketName: string; fileName: string; expirationMinutes: number; credentials?: Partial> | undefined; contentType?: string | undefined; region?: string | undefined; userId?: string | undefined; }, { operation: "getUploadUrl"; bucketName: string; fileName: string; credentials?: Partial> | undefined; contentType?: string | undefined; region?: string | undefined; expirationMinutes?: number | undefined; userId?: string | undefined; }>, import("zod").ZodObject<{ operation: import("zod").ZodLiteral<"getFile">; bucketName: import("zod").ZodString; fileName: import("zod").ZodString; region: import("zod").ZodOptional; expirationMinutes: import("zod").ZodDefault>; userId: import("zod").ZodOptional; credentials: import("zod").ZodOptional, import("zod").ZodString>>; }, "strip", import("zod").ZodTypeAny, { operation: "getFile"; bucketName: string; fileName: string; expirationMinutes: number; credentials?: Partial> | undefined; region?: string | undefined; userId?: string | undefined; }, { operation: "getFile"; bucketName: string; fileName: string; credentials?: Partial> | undefined; region?: string | undefined; expirationMinutes?: number | undefined; userId?: string | undefined; }>, import("zod").ZodObject<{ operation: import("zod").ZodLiteral<"deleteFile">; bucketName: import("zod").ZodString; fileName: import("zod").ZodString; region: import("zod").ZodOptional; credentials: import("zod").ZodOptional, import("zod").ZodString>>; }, "strip", import("zod").ZodTypeAny, { operation: "deleteFile"; bucketName: string; fileName: string; credentials?: Partial> | undefined; region?: string | undefined; }, { operation: "deleteFile"; bucketName: string; fileName: string; credentials?: Partial> | undefined; region?: string | undefined; }>, import("zod").ZodObject<{ operation: import("zod").ZodLiteral<"updateFile">; bucketName: import("zod").ZodDefault; fileName: import("zod").ZodString; region: import("zod").ZodOptional; expirationMinutes: import("zod").ZodDefault>; contentType: import("zod").ZodOptional; fileContent: import("zod").ZodString; userId: import("zod").ZodOptional; credentials: import("zod").ZodOptional, import("zod").ZodString>>; }, "strip", import("zod").ZodTypeAny, { operation: "updateFile"; bucketName: string; fileName: string; expirationMinutes: number; fileContent: string; credentials?: Partial> | undefined; contentType?: string | undefined; region?: string | undefined; userId?: string | undefined; }, { operation: "updateFile"; fileName: string; fileContent: string; credentials?: Partial> | undefined; contentType?: string | undefined; region?: string | undefined; bucketName?: string | undefined; expirationMinutes?: number | undefined; userId?: string | undefined; }>, import("zod").ZodObject<{ operation: import("zod").ZodLiteral<"getMultipleUploadUrls">; bucketName: import("zod").ZodString; pdfFileName: import("zod").ZodString; pageCount: import("zod").ZodNumber; region: import("zod").ZodOptional; expirationMinutes: import("zod").ZodDefault>; userId: import("zod").ZodOptional; credentials: import("zod").ZodOptional, import("zod").ZodString>>; }, "strip", import("zod").ZodTypeAny, { operation: "getMultipleUploadUrls"; bucketName: string; expirationMinutes: number; pdfFileName: string; pageCount: number; credentials?: Partial> | undefined; region?: string | undefined; userId?: string | undefined; }, { operation: "getMultipleUploadUrls"; bucketName: string; pdfFileName: string; pageCount: number; credentials?: Partial> | undefined; region?: string | undefined; expirationMinutes?: number | undefined; userId?: string | undefined; }>]>; static readonly resultSchema: import("zod").ZodDiscriminatedUnion<"operation", [import("zod").ZodObject<{ operation: import("zod").ZodLiteral<"getUploadUrl">; success: import("zod").ZodBoolean; uploadUrl: import("zod").ZodOptional; fileName: import("zod").ZodOptional; contentType: import("zod").ZodOptional; error: import("zod").ZodString; }, "strip", import("zod").ZodTypeAny, { error: string; success: boolean; operation: "getUploadUrl"; contentType?: string | undefined; fileName?: string | undefined; uploadUrl?: string | undefined; }, { error: string; success: boolean; operation: "getUploadUrl"; contentType?: string | undefined; fileName?: string | undefined; uploadUrl?: string | undefined; }>, import("zod").ZodObject<{ operation: import("zod").ZodLiteral<"getFile">; success: import("zod").ZodBoolean; downloadUrl: import("zod").ZodOptional; fileUrl: import("zod").ZodOptional; fileName: import("zod").ZodOptional; fileSize: import("zod").ZodOptional; contentType: import("zod").ZodOptional; lastModified: import("zod").ZodOptional; error: import("zod").ZodString; }, "strip", import("zod").ZodTypeAny, { error: string; success: boolean; operation: "getFile"; contentType?: string | undefined; fileName?: string | undefined; downloadUrl?: string | undefined; fileUrl?: string | undefined; fileSize?: number | undefined; lastModified?: string | undefined; }, { error: string; success: boolean; operation: "getFile"; contentType?: string | undefined; fileName?: string | undefined; downloadUrl?: string | undefined; fileUrl?: string | undefined; fileSize?: number | undefined; lastModified?: string | undefined; }>, import("zod").ZodObject<{ operation: import("zod").ZodLiteral<"deleteFile">; success: import("zod").ZodBoolean; fileName: import("zod").ZodOptional; deleted: import("zod").ZodOptional; error: import("zod").ZodString; }, "strip", import("zod").ZodTypeAny, { error: string; success: boolean; operation: "deleteFile"; deleted?: boolean | undefined; fileName?: string | undefined; }, { error: string; success: boolean; operation: "deleteFile"; deleted?: boolean | undefined; fileName?: string | undefined; }>, import("zod").ZodObject<{ operation: import("zod").ZodLiteral<"updateFile">; success: import("zod").ZodBoolean; fileName: import("zod").ZodOptional; fileUrl: import("zod").ZodOptional; updated: import("zod").ZodOptional; contentType: import("zod").ZodOptional; error: import("zod").ZodString; }, "strip", import("zod").ZodTypeAny, { error: string; success: boolean; operation: "updateFile"; updated?: boolean | undefined; contentType?: string | undefined; fileName?: string | undefined; fileUrl?: string | undefined; }, { error: string; success: boolean; operation: "updateFile"; updated?: boolean | undefined; contentType?: string | undefined; fileName?: string | undefined; fileUrl?: string | undefined; }>, import("zod").ZodObject<{ operation: import("zod").ZodLiteral<"getMultipleUploadUrls">; success: import("zod").ZodBoolean; pdfUploadUrl: import("zod").ZodOptional; pdfFileName: import("zod").ZodOptional; pageUploadUrls: import("zod").ZodOptional, "many">>; error: import("zod").ZodString; }, "strip", import("zod").ZodTypeAny, { error: string; success: boolean; operation: "getMultipleUploadUrls"; pdfFileName?: string | undefined; pdfUploadUrl?: string | undefined; pageUploadUrls?: { fileName: string; uploadUrl: string; pageNumber: number; }[] | undefined; }, { error: string; success: boolean; operation: "getMultipleUploadUrls"; pdfFileName?: string | undefined; pdfUploadUrl?: string | undefined; pageUploadUrls?: { fileName: string; uploadUrl: string; pageNumber: number; }[] | undefined; }>]>; static readonly shortDescription = "S3-compatible storage operations for file management"; static readonly longDescription = "\n A comprehensive storage bubble for S3-compatible storage providers.\n Works with AWS S3, MinIO, DigitalOcean Spaces, Backblaze B2, and more.\n Use cases:\n - Generate presigned upload URLs for client-side file uploads\n - Get secure download URLs for file retrieval with authentication\n - Delete files from S3 buckets\n - Update/replace files in S3 buckets (supports base64 encoded content for binary files like images)\n - Manage file access with time-limited URLs\n "; static readonly alias = "s3"; private s3Client; constructor(params?: T, context?: BubbleContext, instanceId?: string); protected chooseCredential(): string | undefined; private initializeS3Client; /** * Extract the correct region from an S3 PermanentRedirect error. * AWS returns the correct endpoint in the error message, e.g. * "...endpoint: gymii-test.s3.us-east-2.amazonaws.com" */ private extractRegionFromRedirectError; testCredential(): Promise; private executeOperation; protected performAction(context?: BubbleContext): Promise>; private getUploadUrl; private getFile; private deleteFile; /** Check if a fileName already has a secure prefix (timestamp-UUID pattern) */ private isSecureFileName; private updateFile; private getMultipleUploadUrls; } //# sourceMappingURL=s3.d.ts.map