import { z } from 'zod'; import { ServiceBubble } from '../../types/service-bubble-class.js'; import type { BubbleContext } from '../../types/bubble.js'; import { CredentialType } from '@bubblelab/shared-schemas'; declare const StorageParamsSchema: z.ZodDiscriminatedUnion<"operation", [z.ZodObject<{ operation: z.ZodLiteral<"getUploadUrl">; bucketName: z.ZodString; fileName: z.ZodString; accountId: z.ZodOptional; region: z.ZodDefault>; expirationMinutes: z.ZodDefault>; contentType: z.ZodOptional; userId: z.ZodOptional; credentials: z.ZodOptional, z.ZodString>>; }, "strip", z.ZodTypeAny, { operation: "getUploadUrl"; region: string; bucketName: string; fileName: string; expirationMinutes: number; credentials?: Partial> | undefined; contentType?: string | undefined; accountId?: string | undefined; userId?: string | undefined; }, { operation: "getUploadUrl"; bucketName: string; fileName: string; credentials?: Partial> | undefined; contentType?: string | undefined; region?: string | undefined; accountId?: string | undefined; expirationMinutes?: number | undefined; userId?: string | undefined; }>, z.ZodObject<{ operation: z.ZodLiteral<"getFile">; bucketName: z.ZodString; fileName: z.ZodString; accountId: z.ZodOptional; region: z.ZodDefault>; expirationMinutes: z.ZodDefault>; userId: z.ZodOptional; credentials: z.ZodOptional, z.ZodString>>; }, "strip", z.ZodTypeAny, { operation: "getFile"; region: string; bucketName: string; fileName: string; expirationMinutes: number; credentials?: Partial> | undefined; accountId?: string | undefined; userId?: string | undefined; }, { operation: "getFile"; bucketName: string; fileName: string; credentials?: Partial> | undefined; region?: string | undefined; accountId?: string | undefined; expirationMinutes?: number | undefined; userId?: string | undefined; }>, z.ZodObject<{ operation: z.ZodLiteral<"deleteFile">; bucketName: z.ZodString; fileName: z.ZodString; accountId: z.ZodOptional; region: z.ZodDefault>; credentials: z.ZodOptional, z.ZodString>>; }, "strip", z.ZodTypeAny, { operation: "deleteFile"; region: string; bucketName: string; fileName: string; credentials?: Partial> | undefined; accountId?: string | undefined; }, { operation: "deleteFile"; bucketName: string; fileName: string; credentials?: Partial> | undefined; region?: string | undefined; accountId?: string | undefined; }>, z.ZodObject<{ operation: z.ZodLiteral<"updateFile">; bucketName: z.ZodDefault; fileName: z.ZodString; accountId: z.ZodOptional; region: z.ZodDefault>; expirationMinutes: z.ZodDefault>; contentType: z.ZodOptional; fileContent: z.ZodString; credentials: z.ZodOptional, z.ZodString>>; }, "strip", z.ZodTypeAny, { operation: "updateFile"; region: string; bucketName: string; fileName: string; expirationMinutes: number; fileContent: string; credentials?: Partial> | undefined; contentType?: string | undefined; accountId?: string | undefined; }, { operation: "updateFile"; fileName: string; fileContent: string; credentials?: Partial> | undefined; contentType?: string | undefined; region?: string | undefined; bucketName?: string | undefined; accountId?: string | undefined; expirationMinutes?: number | undefined; }>, z.ZodObject<{ operation: z.ZodLiteral<"getMultipleUploadUrls">; bucketName: z.ZodString; pdfFileName: z.ZodString; pageCount: z.ZodNumber; accountId: z.ZodOptional; region: z.ZodDefault>; expirationMinutes: z.ZodDefault>; userId: z.ZodOptional; credentials: z.ZodOptional, z.ZodString>>; }, "strip", z.ZodTypeAny, { operation: "getMultipleUploadUrls"; region: string; bucketName: string; expirationMinutes: number; pdfFileName: string; pageCount: number; credentials?: Partial> | undefined; accountId?: string | undefined; userId?: string | undefined; }, { operation: "getMultipleUploadUrls"; bucketName: string; pdfFileName: string; pageCount: number; credentials?: Partial> | undefined; region?: string | undefined; accountId?: string | undefined; expirationMinutes?: number | undefined; userId?: string | undefined; }>]>; declare const StorageResultSchema: z.ZodDiscriminatedUnion<"operation", [z.ZodObject<{ operation: z.ZodLiteral<"getUploadUrl">; success: z.ZodBoolean; uploadUrl: z.ZodOptional; fileName: z.ZodOptional; contentType: z.ZodOptional; error: z.ZodString; }, "strip", z.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; }>, z.ZodObject<{ operation: z.ZodLiteral<"getFile">; success: z.ZodBoolean; downloadUrl: z.ZodOptional; fileUrl: z.ZodOptional; fileName: z.ZodOptional; fileSize: z.ZodOptional; contentType: z.ZodOptional; lastModified: z.ZodOptional; error: z.ZodString; }, "strip", z.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; }>, z.ZodObject<{ operation: z.ZodLiteral<"deleteFile">; success: z.ZodBoolean; fileName: z.ZodOptional; deleted: z.ZodOptional; error: z.ZodString; }, "strip", z.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; }>, z.ZodObject<{ operation: z.ZodLiteral<"updateFile">; success: z.ZodBoolean; fileName: z.ZodOptional; fileUrl: z.ZodOptional; updated: z.ZodOptional; contentType: z.ZodOptional; error: z.ZodString; }, "strip", z.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; }>, z.ZodObject<{ operation: z.ZodLiteral<"getMultipleUploadUrls">; success: z.ZodBoolean; pdfUploadUrl: z.ZodOptional; pdfFileName: z.ZodOptional; pageUploadUrls: z.ZodOptional, "many">>; error: z.ZodString; }, "strip", z.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; }>]>; type StorageResult = z.output; type StorageParams = z.input; export type StorageOperationResult = Extract; export declare class StorageBubble extends ServiceBubble> { static readonly service = "cloudflare-r2"; static readonly authType: "apikey"; static readonly bubbleName = "storage"; static readonly type: "service"; static readonly schema: z.ZodDiscriminatedUnion<"operation", [z.ZodObject<{ operation: z.ZodLiteral<"getUploadUrl">; bucketName: z.ZodString; fileName: z.ZodString; accountId: z.ZodOptional; region: z.ZodDefault>; expirationMinutes: z.ZodDefault>; contentType: z.ZodOptional; userId: z.ZodOptional; credentials: z.ZodOptional, z.ZodString>>; }, "strip", z.ZodTypeAny, { operation: "getUploadUrl"; region: string; bucketName: string; fileName: string; expirationMinutes: number; credentials?: Partial> | undefined; contentType?: string | undefined; accountId?: string | undefined; userId?: string | undefined; }, { operation: "getUploadUrl"; bucketName: string; fileName: string; credentials?: Partial> | undefined; contentType?: string | undefined; region?: string | undefined; accountId?: string | undefined; expirationMinutes?: number | undefined; userId?: string | undefined; }>, z.ZodObject<{ operation: z.ZodLiteral<"getFile">; bucketName: z.ZodString; fileName: z.ZodString; accountId: z.ZodOptional; region: z.ZodDefault>; expirationMinutes: z.ZodDefault>; userId: z.ZodOptional; credentials: z.ZodOptional, z.ZodString>>; }, "strip", z.ZodTypeAny, { operation: "getFile"; region: string; bucketName: string; fileName: string; expirationMinutes: number; credentials?: Partial> | undefined; accountId?: string | undefined; userId?: string | undefined; }, { operation: "getFile"; bucketName: string; fileName: string; credentials?: Partial> | undefined; region?: string | undefined; accountId?: string | undefined; expirationMinutes?: number | undefined; userId?: string | undefined; }>, z.ZodObject<{ operation: z.ZodLiteral<"deleteFile">; bucketName: z.ZodString; fileName: z.ZodString; accountId: z.ZodOptional; region: z.ZodDefault>; credentials: z.ZodOptional, z.ZodString>>; }, "strip", z.ZodTypeAny, { operation: "deleteFile"; region: string; bucketName: string; fileName: string; credentials?: Partial> | undefined; accountId?: string | undefined; }, { operation: "deleteFile"; bucketName: string; fileName: string; credentials?: Partial> | undefined; region?: string | undefined; accountId?: string | undefined; }>, z.ZodObject<{ operation: z.ZodLiteral<"updateFile">; bucketName: z.ZodDefault; fileName: z.ZodString; accountId: z.ZodOptional; region: z.ZodDefault>; expirationMinutes: z.ZodDefault>; contentType: z.ZodOptional; fileContent: z.ZodString; credentials: z.ZodOptional, z.ZodString>>; }, "strip", z.ZodTypeAny, { operation: "updateFile"; region: string; bucketName: string; fileName: string; expirationMinutes: number; fileContent: string; credentials?: Partial> | undefined; contentType?: string | undefined; accountId?: string | undefined; }, { operation: "updateFile"; fileName: string; fileContent: string; credentials?: Partial> | undefined; contentType?: string | undefined; region?: string | undefined; bucketName?: string | undefined; accountId?: string | undefined; expirationMinutes?: number | undefined; }>, z.ZodObject<{ operation: z.ZodLiteral<"getMultipleUploadUrls">; bucketName: z.ZodString; pdfFileName: z.ZodString; pageCount: z.ZodNumber; accountId: z.ZodOptional; region: z.ZodDefault>; expirationMinutes: z.ZodDefault>; userId: z.ZodOptional; credentials: z.ZodOptional, z.ZodString>>; }, "strip", z.ZodTypeAny, { operation: "getMultipleUploadUrls"; region: string; bucketName: string; expirationMinutes: number; pdfFileName: string; pageCount: number; credentials?: Partial> | undefined; accountId?: string | undefined; userId?: string | undefined; }, { operation: "getMultipleUploadUrls"; bucketName: string; pdfFileName: string; pageCount: number; credentials?: Partial> | undefined; region?: string | undefined; accountId?: string | undefined; expirationMinutes?: number | undefined; userId?: string | undefined; }>]>; static readonly resultSchema: z.ZodDiscriminatedUnion<"operation", [z.ZodObject<{ operation: z.ZodLiteral<"getUploadUrl">; success: z.ZodBoolean; uploadUrl: z.ZodOptional; fileName: z.ZodOptional; contentType: z.ZodOptional; error: z.ZodString; }, "strip", z.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; }>, z.ZodObject<{ operation: z.ZodLiteral<"getFile">; success: z.ZodBoolean; downloadUrl: z.ZodOptional; fileUrl: z.ZodOptional; fileName: z.ZodOptional; fileSize: z.ZodOptional; contentType: z.ZodOptional; lastModified: z.ZodOptional; error: z.ZodString; }, "strip", z.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; }>, z.ZodObject<{ operation: z.ZodLiteral<"deleteFile">; success: z.ZodBoolean; fileName: z.ZodOptional; deleted: z.ZodOptional; error: z.ZodString; }, "strip", z.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; }>, z.ZodObject<{ operation: z.ZodLiteral<"updateFile">; success: z.ZodBoolean; fileName: z.ZodOptional; fileUrl: z.ZodOptional; updated: z.ZodOptional; contentType: z.ZodOptional; error: z.ZodString; }, "strip", z.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; }>, z.ZodObject<{ operation: z.ZodLiteral<"getMultipleUploadUrls">; success: z.ZodBoolean; pdfUploadUrl: z.ZodOptional; pdfFileName: z.ZodOptional; pageUploadUrls: z.ZodOptional, "many">>; error: z.ZodString; }, "strip", z.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 = "Cloudflare R2 storage operations for file management"; static readonly longDescription = "\n A comprehensive storage bubble for Cloudflare R2 operations.\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 R2 buckets\n - Update/replace files in R2 buckets (supports base64 encoded content for binary files like images)\n - Manage file access with time-limited URLs\n "; static readonly alias = "r2"; private s3Client; constructor(params?: T, context?: BubbleContext, instanceId?: string); protected chooseCredential(): string | undefined; private initializeS3Client; testCredential(): Promise; protected performAction(context?: BubbleContext): Promise>; private getUploadUrl; private getFile; private deleteFile; private updateFile; /** * Helper method to detect if a string is base64 encoded */ private isBase64; private getMultipleUploadUrls; } export {}; //# sourceMappingURL=storage.d.ts.map