backblaze-labs/b2-action - v0.1.0
    Preparing search index...

    Function findFileByName

    • Look up the most-recent visible (action: 'upload') version of a file by its exact name. Throws if no upload version exists (hidden / deleted / never existed). Used by copy, delete, and retention to resolve a file name to a fileId before operating on it.

      Consistency assumption: B2's listFileNames is read-after-write consistent for a recently-uploaded file in the same region. The simulator returns uploads immediately; production B2 in practice does the same, but a caller that chains "upload then operate on the same name" across two action steps is relying on observed behavior rather than a documented SLA.

      Parameters

      • bucket: Bucket

        The bucket to search.

      • fileName: string

        Exact file name (path) to look up.

      • OptionalbucketDisplayName: string

        Optional label for the error message; defaults to bucket.name. Used when looking up in a source bucket distinct from the action's destination bucket (cross-bucket copy).

      Returns Promise<FileVersion>