Type Alias FileStorageSettingsBase

FileStorageSettingsBase: {
    context?: IReadableContext;
    defaultCacheControl?: string | null;
    defaultContentDisposition?: string | null;
    defaultContentEncoding?: string | null;
    defaultContentLanguage?: string | null;
    defaultContentType?: string;
    keyValidator?: FileKeyValidator;
    onlyLowercase?: boolean;
    serde?: OneOrMore<ISerderRegister>;
    serdeTransformerName?: string;
    urlAdapter?: Partial<IFileUrlAdapter>;
}

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

Type declaration

  • Optionalcontext?: IReadableContext

    You can pass IReadableContext that will be used by context-aware adapters.

    import { ExecutionContext } from "@daiso-tech/core/execution-context"
    import { NoOpExecutionContextAdapter } from "@daiso-tech/core/execution-context/no-op-execution-context-adapter"

    new ExecutionContext(new NoOpExecutionContextAdapter())
  • OptionaldefaultCacheControl?: string | null

    Note this setting is only used by cloud object storage services like aws s3, azure, or google cloud storage.

    ""
    
  • OptionaldefaultContentDisposition?: string | null

    Note this setting is only used by cloud object storage services like aws s3, azure, or google cloud storage.

    "inline"
    
  • OptionaldefaultContentEncoding?: string | null

    Note this setting is only used by cloud object storage services like aws s3, azure, or google cloud storage.

    null
    
  • OptionaldefaultContentLanguage?: string | null

    Note this setting is only used by cloud object storage services like aws s3, azure, or google cloud storage.

    null
    
  • OptionaldefaultContentType?: string

    The default content type to be used when it cannot be infered by file extension.

    "application/octet-stream"
    
  • OptionalkeyValidator?: FileKeyValidator

    You can pass a key validator. The method should return string error message if unvalid or null if valid.

    import { defaultKeyValidator } from "@daiso-tech/core/file-storage";

    defaultKeyValidator
  • OptionalonlyLowercase?: boolean

    When true, all file keys are automatically converted to lowercase before storage and retrieval. Helps avoid case-sensitivity issues across different storage backends.

    false
    
  • Optionalserde?: OneOrMore<ISerderRegister>

    You can pass an ISerderRegister instance to the FileStorage to register the file's serialization and deserialization logic for the provided adapter.

    import { Serde } from "@daiso-tech/core/serde";
    import { NoOpSerdeAdapter } from "@daiso-tech/core/serde/no-op-serde-adapter";

    new Serde(new NoOpSerdeAdapter())
  • OptionalserdeTransformerName?: string

    The serde transformer name used to identify file storage serializers and deserializers when there are adapters with the same name.

    ""
    
  • OptionalurlAdapter?: Partial<IFileUrlAdapter>

    You can pass partial IFileUrlAdapter that can overide generating public url, signed upload and download url of the file storage adapter.