Stratal API Reference
    Preparing search index...

    Interface IS3MultipartProvider

    S3-specific storage provider interface with multipart upload support

    Extends the generic IStorageProvider with S3 multipart upload operations. This interface is S3-specific - other providers (GCS, local) would have their own resumable upload interfaces if needed.

    interface IS3MultipartProvider {
        abortMultipartUpload(key: string, uploadId: string): Promise<void>;
        chunkedUpload(
            body: StreamingBlobPayloadInputTypes | undefined,
            path: string,
            options: Omit<UploadOptions, "size"> & { size?: number },
        ): Promise<
            {
                disk: string;
                fullPath: string;
                mimeType: string;
                path: string;
                size: number;
                uploadedAt: Date;
            },
        >;
        completeMultipartUpload(
            key: string,
            uploadId: string,
            parts: CompletedPart[],
        ): Promise<CompleteMultipartResult>;
        createMultipartUpload(
            key: string,
            options?: CreateMultipartOptions,
        ): Promise<CreateMultipartResult>;
        delete(path: string): Promise<void>;
        deleteObjects(keys: string[]): Promise<DeleteObjectsResult>;
        download(path: string): Promise<DownloadResult>;
        exists(path: string): Promise<boolean>;
        getBucket(): string;
        getPresignedUrl(
            path: string,
            method: "GET" | "PUT" | "DELETE" | "HEAD",
            expiresIn: number,
        ): Promise<
            {
                expiresAt: Date;
                expiresIn: number;
                method: "GET"
                | "PUT"
                | "DELETE"
                | "HEAD";
                url: string;
            },
        >;
        headObject(key: string): Promise<HeadObjectResult | null>;
        listMultipartUploads(
            keyMarker?: string,
            uploadIdMarker?: string,
        ): Promise<ListMultipartUploadsResult>;
        listParts(
            key: string,
            uploadId: string,
            partNumberMarker?: string,
        ): Promise<ListPartsResult>;
        upload(
            body: StreamingBlobPayloadInputTypes | undefined,
            path: string,
            options: UploadOptions,
        ): Promise<
            {
                disk: string;
                fullPath: string;
                mimeType: string;
                path: string;
                size: number;
                uploadedAt: Date;
            },
        >;
        uploadPart(
            key: string,
            uploadId: string,
            partNumber: number,
            body: Uint8Array,
        ): Promise<UploadPartResult>;
    }

    Hierarchy (View Summary)

    Implemented by

    Index

    Methods

    • Chunked upload for streaming data without known size Uses multipart upload under the hood for reliability

      Parameters

      • body: StreamingBlobPayloadInputTypes | undefined

        Content to upload (stream or buffer)

      • path: string

        Full path including disk root

      • options: Omit<UploadOptions, "size"> & { size?: number }

        Upload options (mimeType required, size optional)

      Returns Promise<
          {
              disk: string;
              fullPath: string;
              mimeType: string;
              path: string;
              size: number;
              uploadedAt: Date;
          },
      >

      Upload result with metadata

    • Generate a presigned URL for temporary access

      Parameters

      • path: string

        Full path to the file

      • method: "GET" | "PUT" | "DELETE" | "HEAD"

        HTTP method (GET, PUT, DELETE, HEAD)

      • expiresIn: number

        Expiry time in seconds (1-604800)

      Returns Promise<
          {
              expiresAt: Date;
              expiresIn: number;
              method: "GET"
              | "PUT"
              | "DELETE"
              | "HEAD";
              url: string;
          },
      >

      Presigned URL result

    • Upload content to storage

      Parameters

      • body: StreamingBlobPayloadInputTypes | undefined

        Content to upload (stream, buffer, or string)

      • path: string

        Full path including disk root

      • options: UploadOptions

        Upload options including size and mime type

      Returns Promise<
          {
              disk: string;
              fullPath: string;
              mimeType: string;
              path: string;
              size: number;
              uploadedAt: Date;
          },
      >

      Upload result with metadata