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<T extends S3ParamsInput = S3ParamsInput> extends ServiceBubble<T, Extract<S3Result, {
    operation: T['operation'];
}>> {
    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<import("zod").ZodString>;
        expirationMinutes: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodNumber>>;
        contentType: import("zod").ZodOptional<import("zod").ZodString>;
        userId: import("zod").ZodOptional<import("zod").ZodString>;
        credentials: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodNativeEnum<typeof CredentialType>, import("zod").ZodString>>;
    }, "strip", import("zod").ZodTypeAny, {
        operation: "getUploadUrl";
        bucketName: string;
        fileName: string;
        expirationMinutes: number;
        credentials?: Partial<Record<CredentialType, string>> | undefined;
        contentType?: string | undefined;
        region?: string | undefined;
        userId?: string | undefined;
    }, {
        operation: "getUploadUrl";
        bucketName: string;
        fileName: string;
        credentials?: Partial<Record<CredentialType, string>> | 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<import("zod").ZodString>;
        expirationMinutes: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodNumber>>;
        userId: import("zod").ZodOptional<import("zod").ZodString>;
        credentials: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodNativeEnum<typeof CredentialType>, import("zod").ZodString>>;
    }, "strip", import("zod").ZodTypeAny, {
        operation: "getFile";
        bucketName: string;
        fileName: string;
        expirationMinutes: number;
        credentials?: Partial<Record<CredentialType, string>> | undefined;
        region?: string | undefined;
        userId?: string | undefined;
    }, {
        operation: "getFile";
        bucketName: string;
        fileName: string;
        credentials?: Partial<Record<CredentialType, string>> | 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<import("zod").ZodString>;
        credentials: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodNativeEnum<typeof CredentialType>, import("zod").ZodString>>;
    }, "strip", import("zod").ZodTypeAny, {
        operation: "deleteFile";
        bucketName: string;
        fileName: string;
        credentials?: Partial<Record<CredentialType, string>> | undefined;
        region?: string | undefined;
    }, {
        operation: "deleteFile";
        bucketName: string;
        fileName: string;
        credentials?: Partial<Record<CredentialType, string>> | undefined;
        region?: string | undefined;
    }>, import("zod").ZodObject<{
        operation: import("zod").ZodLiteral<"updateFile">;
        bucketName: import("zod").ZodDefault<import("zod").ZodString>;
        fileName: import("zod").ZodString;
        region: import("zod").ZodOptional<import("zod").ZodString>;
        expirationMinutes: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodNumber>>;
        contentType: import("zod").ZodOptional<import("zod").ZodString>;
        fileContent: import("zod").ZodString;
        userId: import("zod").ZodOptional<import("zod").ZodString>;
        credentials: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodNativeEnum<typeof CredentialType>, import("zod").ZodString>>;
    }, "strip", import("zod").ZodTypeAny, {
        operation: "updateFile";
        bucketName: string;
        fileName: string;
        expirationMinutes: number;
        fileContent: string;
        credentials?: Partial<Record<CredentialType, string>> | undefined;
        contentType?: string | undefined;
        region?: string | undefined;
        userId?: string | undefined;
    }, {
        operation: "updateFile";
        fileName: string;
        fileContent: string;
        credentials?: Partial<Record<CredentialType, string>> | undefined;
        contentType?: string | undefined;
        bucketName?: string | undefined;
        region?: 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<import("zod").ZodString>;
        expirationMinutes: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodNumber>>;
        userId: import("zod").ZodOptional<import("zod").ZodString>;
        credentials: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodNativeEnum<typeof CredentialType>, import("zod").ZodString>>;
    }, "strip", import("zod").ZodTypeAny, {
        operation: "getMultipleUploadUrls";
        bucketName: string;
        expirationMinutes: number;
        pdfFileName: string;
        pageCount: number;
        credentials?: Partial<Record<CredentialType, string>> | undefined;
        region?: string | undefined;
        userId?: string | undefined;
    }, {
        operation: "getMultipleUploadUrls";
        bucketName: string;
        pdfFileName: string;
        pageCount: number;
        credentials?: Partial<Record<CredentialType, string>> | 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<import("zod").ZodString>;
        fileName: import("zod").ZodOptional<import("zod").ZodString>;
        contentType: import("zod").ZodOptional<import("zod").ZodString>;
        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<import("zod").ZodString>;
        fileUrl: import("zod").ZodOptional<import("zod").ZodString>;
        fileName: import("zod").ZodOptional<import("zod").ZodString>;
        fileSize: import("zod").ZodOptional<import("zod").ZodNumber>;
        contentType: import("zod").ZodOptional<import("zod").ZodString>;
        lastModified: import("zod").ZodOptional<import("zod").ZodString>;
        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<import("zod").ZodString>;
        deleted: import("zod").ZodOptional<import("zod").ZodBoolean>;
        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<import("zod").ZodString>;
        fileUrl: import("zod").ZodOptional<import("zod").ZodString>;
        updated: import("zod").ZodOptional<import("zod").ZodBoolean>;
        contentType: import("zod").ZodOptional<import("zod").ZodString>;
        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<import("zod").ZodString>;
        pdfFileName: import("zod").ZodOptional<import("zod").ZodString>;
        pageUploadUrls: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
            pageNumber: import("zod").ZodNumber;
            uploadUrl: import("zod").ZodString;
            fileName: import("zod").ZodString;
        }, "strip", import("zod").ZodTypeAny, {
            fileName: string;
            uploadUrl: string;
            pageNumber: number;
        }, {
            fileName: string;
            uploadUrl: string;
            pageNumber: number;
        }>, "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<boolean>;
    private executeOperation;
    protected performAction(context?: BubbleContext): Promise<Extract<S3Result, {
        operation: T['operation'];
    }>>;
    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