Backstage
    Preparing search index...
    Index
    • Lists the files and directories inside one directory.

      Calls GET /2.0/repositories/{workspace}/{repo_slug}/src/{commit}/{path} and follows next. The repository root is an empty directoryPath; the source API requires a trailing slash for that listing. A missing path yields no entries.

      Parameters

      • workspace: string

        The workspace slug or UUID.

      • repoSlug: string

        The repository slug.

      • commit: string

        A branch name, tag, or commit hash. This is one path segment. A branch name that contains / has to be that branch's commit hash, because the source API reads only the first segment as the commit.

      • directoryPath: string = ''

        The directory path from the repository root.

      Returns AsyncGenerator<BitbucketCloudSourceEntry, void>

    • Returns whether a file exists at filePath on commit.

      Calls GET /2.0/repositories/{workspace}/{repo_slug}/src/{commit}/{path}?format=meta. A missing path answers 404 and this method returns false. A directory at that path also returns false.

      Parameters

      • workspace: string

        The workspace slug or UUID.

      • repoSlug: string

        The repository slug.

      • commit: string

        A branch name, tag, or commit hash. This is one path segment. A branch name that contains / has to be that branch's commit hash, because the source API reads only the first segment as the commit.

      • filePath: string

        The file path from the repository root.

      Returns Promise<boolean>

    • Searches code in all repositories of a workspace with the endpoint POST /2.0/workspaces/{workspace}/codesearch, and yields each page of results.

      The endpoint needs a credential that identifies a user, with the scopes read:repository:bitbucket and read:workspace:bitbucket. Bitbucket Cloud rejects app passwords, legacy OAuth consumers, and API keys for this endpoint with BitbucketCloudApiError status 403. An API token without read:workspace:bitbucket is rejected with the same status. Adding that scope makes workspace code search available again.

      Parameters

      • workspace: string

        The workspace slug or UUID.

      • query: Query

        The search term and the optional filters.

      • Optionaloptions: { maxResults?: number }

        maxResults sets the number of results per page (1 to 100).

      Returns AsyncGenerator<ResultPage, void>