Type Alias S3FileStorageAdapterSettings

S3FileStorageAdapterSettings: {
    bucket: string;
    cdnUrl?: string | null;
    client: S3Client;
    enableAccurateGetPublicUrl?: boolean;
    enableAccurateGetSignedDownloadUrl?: boolean;
    enableAccuratePut?: boolean;
    enableAccurateRemoveMany?: boolean;
    publicUrlGenerator?: S3FilePublicUrlGenerator;
    serverSideEncryption?: ServerSideEncryption | null;
}

Configuration for S3FileStorageAdapter. Provides AWS S3-backed file storage.

IMPORT_PATH: "@daiso-tech/core/file-storage/aws-file-storage-adapter"

Type declaration

  • bucket: string

    The bucket option defines the S3 bucket to use for managing files.

  • OptionalcdnUrl?: string | null

    The cdnUrl field can be used to define the base URL for generating public URL for a file. For example, If you use CloudFront alongside S3 to serve public files, the cdnUrl property should be the CloudFront URL.

    null
    
  • client: S3Client

    The AWS S3 client instance for communicating with the S3 API.

  • OptionalenableAccurateGetPublicUrl?: boolean

    If false the getPublicUrl method of ISignedFileStorageAdapter will perfom one database call and therby always return string even when the file doesnt exists. Note the fewer S3 API calls the cheaper it will be when using AWS S3.

    true
    
  • OptionalenableAccurateGetSignedDownloadUrl?: boolean

    If false the getSignedDownloadUrl method of ISignedFileStorageAdapter will perfom one database call and therby always return string even when the file doesnt exists. Note the fewer S3 API calls the cheaper it will be when using AWS S3.

    true
    
  • OptionalenableAccuratePut?: boolean

    If false the put method of ISignedFileStorageAdapter will perform one database call and thereby always return true even when the file doesnt exists. Note the fewer S3 API calls the cheaper it will be when using AWS S3.

    true
    
  • OptionalenableAccurateRemoveMany?: boolean

    When false, removeMany will skip verifying whether each key exists before deletion, reducing API calls at the cost of accuracy. Note the fewer S3 API calls the cheaper it will be when using AWS S3.

    true
    
  • OptionalpublicUrlGenerator?: S3FilePublicUrlGenerator

    Define a custom public url generator for creating public and signed URLs.

    import { defaultPublicUrlGenerator } from "@daiso-tech/core/file-storage/s3-file-storage-adapter"
    defaultPublicUrlGenerator
  • OptionalserverSideEncryption?: ServerSideEncryption | null

    Define ServerSideEncryption option for all objects uploaded to S3. It can be disabled by passing null

    null