Type Alias FileStorageSettingsBase

FileStorageSettingsBase: {
    defaultCacheControl?: string | null;
    defaultContentDisposition?: string | null;
    defaultContentEncoding?: string | null;
    defaultContentLanguage?: string | null;
    defaultContentType?: string;
    eventBus?: EventBusInput;
    executionContext?: IExecutionContext;
    keyValidator?: FileKeyValidator;
    lockFactory?: LockFactoryInput;
    namespace?: INamespace;
    onlyLowercase?: boolean;
    serde?: OneOrMore<ISerderRegister>;
    serdeTransformerName?: string;
    urlAdapter?: Partial<IFileUrlAdapter>;
    waitUntil?: WaitUntil;
}

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

Type declaration

  • 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"
    
  • OptionaleventBus?: EventBusInput

    You can provide an IEventBus or an IEventBusAdapter instance to handle the component's events. If you provide an adapter, it will be automatically wrapped in an EventBus instance.

    import { NoOpEventBusAdapter } from "@daiso-tech/core/event-bus/no-op-event-bus-adapter";

    new NoOpEventBusAdapter()
  • OptionalexecutionContext?: IExecutionContext

    You can pass IExecutionContext 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())
  • 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
  • OptionallockFactory?: LockFactoryInput

    You can provide an ILockFactoryBase, an ILockAdapter or an IDatabaseLockAdapter instance to handle locking when write methods are called. If you provide an adapter, it will be automatically wrapped in an LockFactory instance.

    import { NoOpLockAdapter } from "@daiso-tech/core/lock/no-op-lock-adapter";

    new NoOpLockAdapter()
  • Optionalnamespace?: INamespace
    import { NoOpNamespace } from "@daiso-tech/core/namespace";

    new NoOpNamespace()
  • 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.

  • OptionalwaitUntil?: WaitUntil

    You can pass the waitUntil function to handle background promises. This is required when working with environments like Cloudflare Workers or Vercel Functions to ensure tasks complete after the response is sent.

    import { defaultWaitUntil } from "@daiso-tech/core/utilities"