Type Alias WithFileStorageLockSettings

WithFileStorageLockSettings: {
    lockFactory: ILockFactory;
    onlyMethods?: WithFileStorageLockMethods[];
}

Configuration for the withFileStorageLock plugin. Requires a lock factory and optionally restricts which methods are protected.

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

Type declaration

  • lockFactory: ILockFactory

    A factory that creates named locks. Each lock is keyed by the file key to ensure concurrent operations on the same file are serialised while operations on different files can proceed in parallel.

  • OptionalonlyMethods?: WithFileStorageLockMethods[]

    The subset of methods to protect with a lock. When omitted, all methods except removeByPrefix are protected by default.

    [
    "exists",
    "getStream",
    "getBytes",
    "getMetaData",
    "add",
    "addStream",
    "update",
    "updateStream",
    "put",
    "putStream",
    "copy",
    "copyAndReplace",
    "move",
    "moveAndReplace",
    "removeMany",
    "getPublicUrl",
    "getSignedDownloadUrl",
    "getSignedUploadUrl",
    ]