[{"data":1,"prerenderedAt":726},["ShallowReactive",2],{"navigation_docs":3,"-platforms-bitbucket":96,"-platforms-bitbucket-surround":721},[4,56],{"title":5,"path":6,"stem":7,"children":8,"icon":55},"Guide","\u002Fguide","1.guide\u002F01.index",[9,11,15,19,23,27,31,35,39,43,47,51],{"title":10,"path":6,"stem":7},"Getting Started",{"title":12,"path":13,"stem":14},"Authentication","\u002Fguide\u002Fauth","1.guide\u002F02.auth",{"title":16,"path":17,"stem":18},"Repositories","\u002Fguide\u002Frepositories","1.guide\u002F03.repositories",{"title":20,"path":21,"stem":22},"Issues","\u002Fguide\u002Fissues","1.guide\u002F04.issues",{"title":24,"path":25,"stem":26},"Pull requests","\u002Fguide\u002Fpull-requests","1.guide\u002F05.pull-requests",{"title":28,"path":29,"stem":30},"Review threads","\u002Fguide\u002Fthreads","1.guide\u002F06.threads",{"title":32,"path":33,"stem":34},"Commits, CI and releases","\u002Fguide\u002Fcommits","1.guide\u002F07.commits",{"title":36,"path":37,"stem":38},"Contribution templates","\u002Fguide\u002Ftemplates","1.guide\u002F08.templates",{"title":40,"path":41,"stem":42},"Code search","\u002Fguide\u002Fcode-search","1.guide\u002F09.code-search",{"title":44,"path":45,"stem":46},"Agents","\u002Fguide\u002Fagents","1.guide\u002F10.agents",{"title":48,"path":49,"stem":50},"Custom providers","\u002Fguide\u002Fcustom","1.guide\u002F11.custom",{"title":52,"path":53,"stem":54},"Explorer","\u002Fguide\u002Fexplorer","1.guide\u002F12.explorer","i-lucide-book-open",{"title":57,"path":58,"stem":59,"children":60,"icon":95},"Platforms","\u002Fplatforms","2.platforms\u002F0.index",[61,63,67,71,75,79,83,87,91],{"title":62,"path":58,"stem":59},"Overview",{"title":64,"path":65,"stem":66},"GitHub","\u002Fplatforms\u002Fgithub","2.platforms\u002F01.github",{"title":68,"path":69,"stem":70},"GitLab","\u002Fplatforms\u002Fgitlab","2.platforms\u002F02.gitlab",{"title":72,"path":73,"stem":74},"Gitea","\u002Fplatforms\u002Fgitea","2.platforms\u002F03.gitea",{"title":76,"path":77,"stem":78},"Bitbucket","\u002Fplatforms\u002Fbitbucket","2.platforms\u002F04.bitbucket",{"title":80,"path":81,"stem":82},"Gitee","\u002Fplatforms\u002Fgitee","2.platforms\u002F05.gitee",{"title":84,"path":85,"stem":86},"Azure DevOps","\u002Fplatforms\u002Fazure-devops","2.platforms\u002F06.azure-devops",{"title":88,"path":89,"stem":90},"GitBucket","\u002Fplatforms\u002Fgitbucket","2.platforms\u002F07.gitbucket",{"title":92,"path":93,"stem":94},"Artifacts","\u002Fplatforms\u002Fartifacts","2.platforms\u002F08.artifacts","i-lucide-library",{"id":97,"title":76,"body":98,"description":713,"extension":714,"links":715,"meta":716,"navigation":148,"path":77,"seo":718,"stem":78,"__hash__":720},"docs\u002F2.platforms\u002F04.bitbucket.md",{"type":99,"value":100,"toc":703},"minimark",[101,105,110,256,271,286,291,305,316,326,348,354,361,365,379,527,531,622,626,629,647,651,658,676,679,682,686,699],[102,103],"platform-facts",{"platform":104},"bitbucket",[106,107,109],"h2",{"id":108},"address-a-bitbucket-workspace","Address a Bitbucket workspace",[111,112,117],"pre",{"className":113,"code":114,"language":115,"meta":116,"style":116},"language-ts shiki shiki-themes forges forges forges","import { createProvider } from \"@agntn\u002Fforges\";\n\nconst bitbucket = await createProvider(\"bitbucket\", { token: process.env.BITBUCKET_TOKEN });\n\nconst pull = { owner: \"atlassian\", repo: \"atlassian-connect-express\", number: 527 };\nconst { items: threads } = await bitbucket.threads.list(pull);\nconst readme = await bitbucket.repos.readContents(pull, { path: \"README.md\" });\n","ts","",[118,119,120,143,150,178,183,208,229],"code",{"__ignoreMap":116},[121,122,125,129,133,136,140],"span",{"class":123,"line":124},"line",1,[121,126,128],{"class":127},"skH_V","import",[121,130,132],{"class":131},"s38Sx"," { createProvider } ",[121,134,135],{"class":127},"from",[121,137,139],{"class":138},"shU9J"," \"@agntn\u002Fforges\"",[121,141,142],{"class":131},";\n",[121,144,146],{"class":123,"line":145},2,[121,147,149],{"emptyLinePlaceholder":148},true,"\n",[121,151,153,156,159,162,165,169,172,175],{"class":123,"line":152},3,[121,154,155],{"class":127},"const",[121,157,158],{"class":131}," bitbucket ",[121,160,161],{"class":127},"=",[121,163,164],{"class":127}," await",[121,166,168],{"class":167},"sK71F"," createProvider",[121,170,171],{"class":131},"(",[121,173,174],{"class":138},"\"bitbucket\"",[121,176,177],{"class":131},", { token: process.env.BITBUCKET_TOKEN });\n",[121,179,181],{"class":123,"line":180},4,[121,182,149],{"emptyLinePlaceholder":148},[121,184,186,188,191,193,196,199,202,205],{"class":123,"line":185},5,[121,187,155],{"class":127},[121,189,190],{"class":131}," pull ",[121,192,161],{"class":127},[121,194,195],{"class":131}," { owner: ",[121,197,198],{"class":138},"\"atlassian\"",[121,200,201],{"class":131},", repo: ",[121,203,204],{"class":138},"\"atlassian-connect-express\"",[121,206,207],{"class":131},", number: 527 };\n",[121,209,211,213,216,218,220,223,226],{"class":123,"line":210},6,[121,212,155],{"class":127},[121,214,215],{"class":131}," { items: threads } ",[121,217,161],{"class":127},[121,219,164],{"class":127},[121,221,222],{"class":131}," bitbucket.threads.",[121,224,225],{"class":167},"list",[121,227,228],{"class":131},"(pull);\n",[121,230,232,234,237,239,241,244,247,250,253],{"class":123,"line":231},7,[121,233,155],{"class":127},[121,235,236],{"class":131}," readme ",[121,238,161],{"class":127},[121,240,164],{"class":127},[121,242,243],{"class":131}," bitbucket.repos.",[121,245,246],{"class":167},"readContents",[121,248,249],{"class":131},"(pull, { path: ",[121,251,252],{"class":138},"\"README.md\"",[121,254,255],{"class":131}," });\n",[257,258,259,262,263,266,267,270],"p",{},[118,260,261],{},"owner"," means workspace, and ",[118,264,265],{},"repo"," means repository slug. Each must be a single path segment. Something like ",[118,268,269],{},"..\u002Fadmin"," gets a 400 before any request.",[257,272,273,274,277,278,281,282,285],{},"The default API base is ",[118,275,276],{},"https:\u002F\u002Fapi.bitbucket.org\u002F2.0",". Set ",[118,279,280],{},"baseURL"," to override it. forges adds ",[118,283,284],{},"\u002F2.0"," when it's missing.",[287,288,290],"h3",{"id":289},"where-does-the-token-come-from","Where does the token come from?",[257,292,293,296,297,300,301,304],{},[118,294,295],{},"@agntn\u002Fcredentials\u002Fbitbucket"," checks an explicit ",[118,298,299],{},"token"," first. Then it checks ",[118,302,303],{},"BITBUCKET_TOKEN",", an access token sent as a bearer.",[257,306,307,308,311,312,315],{},"Finally, it checks ",[118,309,310],{},"BITBUCKET_API_TOKEN"," and ",[118,313,314],{},"BITBUCKET_EMAIL"," together. That Atlassian API token uses Basic auth, with the email as login. The API token alone doesn't count.",[257,317,318,319,322,323,325],{},"For an explicit API token, pass ",[118,320,321],{},"username"," beside ",[118,324,299],{},":",[111,327,329],{"className":113,"code":328,"language":115,"meta":116,"style":116},"createProvider(\"bitbucket\", { token, username: \"you@example.com\" });\n",[118,330,331],{"__ignoreMap":116},[121,332,333,336,338,340,343,346],{"class":123,"line":124},[121,334,335],{"class":167},"createProvider",[121,337,171],{"class":131},[121,339,174],{"class":138},[121,341,342],{"class":131},", { token, username: ",[121,344,345],{"class":138},"\"you@example.com\"",[121,347,255],{"class":131},[257,349,350,351,353],{},"Without ",[118,352,321],{},", an explicit token goes as a bearer. There's no Bitbucket CLI login to check.",[257,355,356,357,360],{},"Pass ",[118,358,359],{},"{ token: \"\" }"," for anonymous reads. Public repositories work without a token, but probing hit a 429 after a handful of calls. A token is the sane choice.",[106,362,364],{"id":363},"what-it-reads","What it reads",[257,366,367,368,370,371,374,375,378],{},"Endpoints are relative to ",[118,369,284],{},". In the table, ",[118,372,373],{},"…"," means ",[118,376,377],{},"\u002Frepositories\u002F:workspace\u002F:slug",".",[380,381,382,395],"table",{},[383,384,385],"thead",{},[386,387,388,392],"tr",{},[389,390,391],"th",{},"Resource",[389,393,394],{},"Endpoint",[396,397,398,416,432,448,468,492,512],"tbody",{},[386,399,400,404],{},[401,402,403],"td",{},"Repositories and tags",[401,405,406,409,410,409,413],{},[118,407,408],{},"GET …",", ",[118,411,412],{},"GET \u002Frepositories\u002F:workspace",[118,414,415],{},"GET …\u002Frefs\u002Ftags",[386,417,418,420],{},[401,419,24],{},[401,421,422,425,426,409,429],{},[118,423,424],{},"GET …\u002Fpullrequests"," with a state filter, ",[118,427,428],{},"GET …\u002Fpullrequests\u002F:id",[118,430,431],{},"POST …\u002Fpullrequests",[386,433,434,437],{},[401,435,436],{},"Pull request files, checks and timeline",[401,438,439,409,442,409,445],{},[118,440,441],{},"GET …\u002Fpullrequests\u002F:id\u002Fdiffstat",[118,443,444],{},"GET …\u002Fpullrequests\u002F:id\u002Fstatuses",[118,446,447],{},"GET …\u002Fpullrequests\u002F:id\u002Factivity",[386,449,450,453],{},[401,451,452],{},"Conversation comments",[401,454,455,409,458,409,461,311,464,467],{},[118,456,457],{},"GET …\u002Fpullrequests\u002F:id\u002Fcomments?q=(deleted=false) AND (inline.path=null)",[118,459,460],{},"POST …\u002Fcomments",[118,462,463],{},"PUT",[118,465,466],{},"DELETE …\u002Fcomments\u002F:id"," after a read",[386,469,470,472],{},[401,471,28],{},[401,473,474,409,477,480,481,484,485,488,489],{},[118,475,476],{},"GET …\u002Fpullrequests\u002F:id\u002Fcomments",[118,478,479],{},"POST …\u002Fpullrequests\u002F:id\u002Fcomments"," with ",[118,482,483],{},"parent"," for replies, ",[118,486,487],{},"POST"," or ",[118,490,491],{},"DELETE …\u002Fpullrequests\u002F:id\u002Fcomments\u002F:id\u002Fresolve",[386,493,494,497],{},[401,495,496],{},"Commits and checks",[401,498,499,409,502,480,505,409,508,511],{},[118,500,501],{},"GET …\u002Fcommits",[118,503,504],{},"GET …\u002Fcommit\u002F:sha",[118,506,507],{},"GET …\u002Fdiffstat\u002F:sha",[118,509,510],{},"GET …\u002Fcommit\u002F:sha\u002Fstatuses"," after ref resolution",[386,513,514,517],{},[401,515,516],{},"Repository contents",[401,518,519,522,523,526],{},[118,520,521],{},"GET …\u002Fcommit\u002F:ref",", then ",[118,524,525],{},"GET …\u002Fsrc\u002F:sha\u002F:path?format=meta",", then the raw file or directory listing",[106,528,530],{"id":529},"what-comes-back","What comes back",[532,533,534,546,549,567,572,575,581,588,602,605,608,611],"ul",{},[535,536,537,538,541,542,545],"li",{},"Bitbucket keeps conversation and inline comments together. The ",[118,539,540],{},"inline"," field distinguishes them. ",[118,543,544],{},"pullRequests.listComments"," returns only conversation, using a filter on Bitbucket's server. That keeps pages full.",[535,547,548],{},"A thread starts with an inline comment and includes every reply, oldest first. Its ID is the opening comment's ID, because Bitbucket resolves that comment. Replies to replies stay in the right thread.",[535,550,551,554,555,558,559,562,563,566],{},[118,552,553],{},"isResolved"," comes from the opening comment's ",[118,556,557],{},"resolution"," object. ",[118,560,561],{},"isOutdated"," is always ",[118,564,565],{},"false"," because Bitbucket doesn't say.",[535,568,569,571],{},[118,570,123],{}," points to the new side. For a removed line, it uses the old side instead.",[535,573,574],{},"Deleted comments remain in Bitbucket's list with empty bodies. forges drops them. A deleted reply disappears, and a deleted opening comment takes its thread with it. Even Bitbucket's ghosts have empty speech bubbles.",[535,576,577,580],{},[118,578,579],{},"threads.reply"," posts under the newest comment. The reply lands at the bottom.",[535,582,583,584,587],{},"Comment ",[118,585,586],{},"author.login"," is the Bitbucket nickname.",[535,589,590,591,594,595,598,599,378],{},"Directory entries have ",[118,592,593],{},"size"," for files and ",[118,596,597],{},"null"," for directories and symlinks. Listing stops after ten pages, with ",[118,600,601],{},"entriesComplete: false",[535,603,604],{},"A file over 1 MiB is a 413 from the metadata alone. Its bytes never leave Bitbucket.",[535,606,607],{},"File reads pin the ref to its resolved commit. A continuation with an offset above zero must pass that SHA. A moving branch can't splice versions together.",[535,609,610],{},"Pull request checks come from build statuses. Pipelines report there too.",[535,612,613,614,617,618,621],{},"Pagination follows Bitbucket's ",[118,615,616],{},"next"," link in the response body. ",[118,619,620],{},"nextCursor"," carries that link.",[106,623,625],{"id":624},"gotchas","Gotchas",[257,627,628],{},"Why does resolving need a read first?",[532,630,631,634,644],{},[535,632,633],{},"Bitbucket returns 409 when you resolve an already resolved thread. It returns 404 when you reopen an open one. That's annoying. forges reads the state first and returns the thread unchanged, so resolving twice is harmless.",[535,635,636,637,488,640,643],{},"The commit log filters by ref and path only. ",[118,638,639],{},"since",[118,641,642],{},"until"," would come back ignored, so they're a 501 instead of a quietly wrong list.",[535,645,646],{},"Thread listing reads every comment page, 100 comments at a time. Conversation and review comments share that list.",[106,648,650],{"id":649},"what-isnt-there","What isn't there",[257,652,653,654,657],{},"Each operation below returns a ",[118,655,656],{},"ForgesError"," with status 501 and a sentence, before any request. An agent can stop instead of retrying.",[257,659,660,661,311,664,667,668,671,672,675],{},"Bitbucket Cloud has no issue tracker or releases, so ",[118,662,663],{},"issues.*",[118,665,666],{},"releases.*"," return 501. ",[118,669,670],{},"ciRuns.list"," also returns 501 and points to pull request or commit checks instead. ",[118,673,674],{},"users.get"," by username returns 501 because Bitbucket profiles use account IDs, not names.",[257,677,678],{},"Code search, templates, reactions, issue fields and sub issues return 501 too. Zero open issues, forever. Nice dashboard.",[257,680,681],{},"Some gaps are ours, not Bitbucket's. Editing or merging a pull request, reviews, search, commit comparison, patches and review comment edits aren't wired up here yet. Same 501, same sentence.",[106,683,685],{"id":684},"where-it-lives","Where it lives",[257,687,688,689,692,693,696,697,378],{},"The provider lives in ",[118,690,691],{},"src\u002Fproviders\u002Fbitbucket.ts",". It uses the ",[118,694,695],{},"forges\u002Fbitbucket"," adapter and gets tokens from ",[118,698,295],{},[700,701,702],"style",{},"html pre.shiki code .skH_V, html code.shiki .skH_V{--shiki-light:var(--shiki-token-keyword);--shiki-default:var(--shiki-token-keyword);--shiki-dark:var(--shiki-token-keyword)}html pre.shiki code .s38Sx, html code.shiki .s38Sx{--shiki-light:var(--ui-text-highlighted);--shiki-default:var(--ui-text-highlighted);--shiki-dark:var(--ui-text-highlighted)}html pre.shiki code .shU9J, html code.shiki .shU9J{--shiki-light:var(--shiki-token-string);--shiki-default:var(--shiki-token-string);--shiki-dark:var(--shiki-token-string)}html pre.shiki code .sK71F, html code.shiki .sK71F{--shiki-light:var(--shiki-token-function);--shiki-default:var(--shiki-token-function);--shiki-dark:var(--shiki-token-function)}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":116,"searchDepth":145,"depth":145,"links":704},[705,708,709,710,711,712],{"id":108,"depth":145,"text":109,"children":706},[707],{"id":289,"depth":152,"text":290},{"id":363,"depth":145,"text":364},{"id":529,"depth":145,"text":530},{"id":624,"depth":145,"text":625},{"id":649,"depth":145,"text":650},{"id":684,"depth":145,"text":685},"Bitbucket Cloud pull requests and review threads in the same shapes as every other forge. No issues there to read.","md",null,{"icon":717},"i-simple-icons-bitbucket",{"title":719,"description":713},"Read Bitbucket Cloud pull requests and review threads with forges","FGNUgjgSkTdK-P-u4pJyv8ALuwSyOPOtgtDGgPSuQKM",[722,724],{"title":72,"path":73,"stem":74,"description":723,"children":-1},"API v1 with limit instead of per_page, empty strings and nulls where fields are missing, and Codeberg or any Forgejo instance through baseURL.",{"title":80,"path":81,"stem":82,"description":725,"children":-1},"Gitee repositories, issues and pull requests in the same shapes as every other forge. Issues keep their text keys.",1794778614639]