[{"data":1,"prerenderedAt":683},["ShallowReactive",2],{"navigation_docs":3,"-platforms-gitee":96,"-platforms-gitee-surround":678},[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":80,"body":98,"description":670,"extension":671,"links":672,"meta":673,"navigation":148,"path":81,"seo":675,"stem":82,"__hash__":677},"docs\u002F2.platforms\u002F05.gitee.md",{"type":99,"value":100,"toc":660},"minimark",[101,105,110,291,298,309,320,325,343,350,354,368,502,506,590,594,597,618,622,629,636,639,643,656],[102,103],"platform-facts",{"platform":104},"gitee",[106,107,109],"h2",{"id":108},"read-a-gitee-repository","Read a Gitee repository",[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 gitee = await createProvider(\"gitee\", { token: process.env.GITEE_TOKEN });\n\nconst docs = { owner: \"openharmony\", repo: \"docs\" };\nconst issue = await gitee.issues.get({ ...docs, number: \"ICK440\" });\nconst pull = await gitee.pullRequests.get({ ...docs, number: 95569 });\nconst readme = await gitee.repos.readContents(docs, { path: \"README.md\" });\n","ts","",[118,119,120,143,150,178,183,208,241,265],"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}," gitee ",[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},"\"gitee\"",[121,176,177],{"class":131},", { token: process.env.GITEE_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}," docs ",[121,192,161],{"class":127},[121,194,195],{"class":131}," { owner: ",[121,197,198],{"class":138},"\"openharmony\"",[121,200,201],{"class":131},", repo: ",[121,203,204],{"class":138},"\"docs\"",[121,206,207],{"class":131}," };\n",[121,209,211,213,216,218,220,223,226,229,232,235,238],{"class":123,"line":210},6,[121,212,155],{"class":127},[121,214,215],{"class":131}," issue ",[121,217,161],{"class":127},[121,219,164],{"class":127},[121,221,222],{"class":131}," gitee.issues.",[121,224,225],{"class":167},"get",[121,227,228],{"class":131},"({ ",[121,230,231],{"class":127},"...",[121,233,234],{"class":131},"docs, number: ",[121,236,237],{"class":138},"\"ICK440\"",[121,239,240],{"class":131}," });\n",[121,242,244,246,249,251,253,256,258,260,262],{"class":123,"line":243},7,[121,245,155],{"class":127},[121,247,248],{"class":131}," pull ",[121,250,161],{"class":127},[121,252,164],{"class":127},[121,254,255],{"class":131}," gitee.pullRequests.",[121,257,225],{"class":167},[121,259,228],{"class":131},[121,261,231],{"class":127},[121,263,264],{"class":131},"docs, number: 95569 });\n",[121,266,268,270,273,275,277,280,283,286,289],{"class":123,"line":267},8,[121,269,155],{"class":127},[121,271,272],{"class":131}," readme ",[121,274,161],{"class":127},[121,276,164],{"class":127},[121,278,279],{"class":131}," gitee.repos.",[121,281,282],{"class":167},"readContents",[121,284,285],{"class":131},"(docs, { path: ",[121,287,288],{"class":138},"\"README.md\"",[121,290,240],{"class":131},[292,293,294,295,297],"p",{},"Spot the odd one out? The issue goes by ",[118,296,237],{},", a string. Gitee numbers its pull requests like everyone else, but an issue gets a key of letters and digits.",[292,299,300,301,304,305,308],{},"So ",[118,302,303],{},"Issue.number"," is ",[118,306,307],{},"number | string",". On every other forge it stays a number. A pull request is a number on Gitee too, and a key there is a 400 before any request.",[292,310,311,312,315,316,319],{},"The default API base is ",[118,313,314],{},"https:\u002F\u002Fgitee.com\u002Fapi\u002Fv5",". forges adds ",[118,317,318],{},"\u002Fapi\u002Fv5"," when it's missing. The enterprise edition at e.gitee.com is a different API, and it's out.",[321,322,324],"h3",{"id":323},"where-does-the-token-come-from","Where does the token come from?",[292,326,327,330,331,334,335,338,339,342],{},[118,328,329],{},"@agntn\u002Fcredentials\u002Fgitee"," checks an explicit ",[118,332,333],{},"token"," first. Then ",[118,336,337],{},"GITEE_TOKEN",", then ",[118,340,341],{},"GITEE_ACCESS_TOKEN",". That's the whole chain. No Gitee CLI keeps a login to read.",[292,344,345,346,349],{},"Pass ",[118,347,348],{},"{ token: \"\" }"," for anonymous reads. They work, for a while. Gitee counts anonymous calls per address, and a few dozen in its firewall answers a plain-text 403. forges reads that as a rate limit, not a permission problem. A token is the sane choice.",[106,351,353],{"id":352},"what-it-reads","What it reads",[292,355,356,357,359,360,363,364,367],{},"Endpoints are relative to ",[118,358,318],{},". In the table, ",[118,361,362],{},"…"," means ",[118,365,366],{},"\u002Frepos\u002F:owner\u002F:repo",".",[369,370,371,384],"table",{},[372,373,374],"thead",{},[375,376,377,381],"tr",{},[378,379,380],"th",{},"Resource",[378,382,383],{},"Endpoint",[385,386,387,409,424,447,459,478,492],"tbody",{},[375,388,389,393],{},[390,391,392],"td",{},"Repositories and tags",[390,394,395,398,399,402,403,398,406],{},[118,396,397],{},"GET …",", ",[118,400,401],{},"GET \u002Forgs\u002F:org\u002Frepos"," or ",[118,404,405],{},"GET \u002Fusers\u002F:user\u002Frepos",[118,407,408],{},"GET …\u002Ftags",[375,410,411,413],{},[390,412,20],{},[390,414,415,398,418,398,421],{},[118,416,417],{},"GET …\u002Fissues",[118,419,420],{},"GET …\u002Fissues\u002F:key",[118,422,423],{},"GET …\u002Fissues\u002F:key\u002Fcomments",[375,425,426,428],{},[390,427,24],{},[390,429,430,398,433,436,437,398,440,443,444],{},[118,431,432],{},"GET …\u002Fpulls",[118,434,435],{},"GET …\u002Fpulls\u002F:number",", with ",[118,438,439],{},"\u002Ffiles",[118,441,442],{},"\u002Fcomments"," and ",[118,445,446],{},"\u002Fcommits",[375,448,449,452],{},[390,450,451],{},"Timelines",[390,453,454,455,458],{},"the comments plus ",[118,456,457],{},"operate_logs",", merged by time",[375,460,461,464],{},[390,462,463],{},"Commits, releases and users",[390,465,466,398,469,398,472,398,475],{},[118,467,468],{},"GET …\u002Fcommits",[118,470,471],{},"GET …\u002Fcommits\u002F:sha",[118,473,474],{},"GET …\u002Freleases",[118,476,477],{},"GET \u002Fusers\u002F:login",[375,479,480,483],{},[390,481,482],{},"Repository contents",[390,484,485,486,338,489],{},"the ref resolved through ",[118,487,488],{},"GET …\u002Fcommits\u002F:ref",[118,490,491],{},"GET …\u002Fcontents\u002F:path?ref=",[375,493,494,497],{},[390,495,496],{},"Commit comparison",[390,498,499],{},[118,500,501],{},"GET …\u002Fcompare\u002F:base...:head",[106,503,505],{"id":504},"what-comes-back","What comes back",[507,508,509,522,544,551,565,568,579],"ul",{},[510,511,512,514,515,517,518,521],"li",{},[118,513,303],{}," is the key, ",[118,516,237],{},". Pass it back as is. ",[118,519,520],{},"PullRequest.number"," is a number.",[510,523,524,525,528,529,402,531,534,535,538,539,402,541,367],{},"An issue's state is ",[118,526,527],{},"open"," while Gitee says ",[118,530,527],{},[118,532,533],{},"progressing",", and ",[118,536,537],{},"closed"," for ",[118,540,537],{},[118,542,543],{},"rejected",[510,545,546,547,550],{},"Gitee keeps one assignee per issue, so ",[118,548,549],{},"assignees"," has one entry at most.",[510,552,553,556,557,560,561,564],{},[118,554,555],{},"cloneUrl"," ends in a single ",[118,558,559],{},".git",". Gitee's ",[118,562,563],{},"html_url"," already carries one, and forges doesn't add a second.",[510,566,567],{},"A file read pins the ref to its resolved commit. A continuation past offset zero must pass that SHA.",[510,569,570,571,574,575,578],{},"Directory entries carry ",[118,572,573],{},"size"," for files and ",[118,576,577],{},"null"," for directories.",[510,580,581,582,585,586,589],{},"A comparison lists at most 100 commits. Past that Gitee sets ",[118,583,584],{},"truncated",", and forges answers ",[118,587,588],{},"filesComplete: null",", because the list is a floor, not the range.",[106,591,593],{"id":592},"gotchas","Gotchas",[292,595,596],{},"Why would a missing file come back as an empty folder?",[507,598,599,606,615],{},[510,600,601,602,605],{},"Gitee answers 200 with ",[118,603,604],{},"[]"," for a path that isn't there. forges turns an empty listing outside the root into a 404. A real empty directory can't exist in Git anyway.",[510,607,608,610,611,614],{},[118,609,401],{}," answers 500 for some big organizations, openharmony and mindspore among them. That's Gitee's error, and it comes back as one. Read a known repository with ",[118,612,613],{},"repos.get"," instead.",[510,616,617],{},"Gitee's anonymous limit hits fast. One explorer session can spend it.",[106,619,621],{"id":620},"what-isnt-there","What isn't there",[292,623,624,625,628],{},"Each operation below returns a ",[118,626,627],{},"ForgesError"," with status 501 and a sentence. An agent can stop instead of retrying.",[292,630,631,632,635],{},"Gitee has no CI runs in its API, so ",[118,633,634],{},"ciRuns.*"," is a 501. Review threads, reactions, code search and templates are 501 too, and so are issue fields and sub issues.",[292,637,638],{},"Some gaps are ours, not Gitee's. Creating an issue or a pull request works, and so do comment edits and deletes. Posting a new comment, editing an issue or pull request, merging, reviews, patches and issue search aren't wired up yet. Same 501, same sentence.",[106,640,642],{"id":641},"where-it-lives","Where it lives",[292,644,645,646,649,650,653,654,367],{},"The provider lives in ",[118,647,648],{},"src\u002Fproviders\u002Fgitee.ts",". It uses the ",[118,651,652],{},"forges\u002Fgitee"," adapter and gets tokens from ",[118,655,329],{},[657,658,659],"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":661},[662,665,666,667,668,669],{"id":108,"depth":145,"text":109,"children":663},[664],{"id":323,"depth":152,"text":324},{"id":352,"depth":145,"text":353},{"id":504,"depth":145,"text":505},{"id":592,"depth":145,"text":593},{"id":620,"depth":145,"text":621},{"id":641,"depth":145,"text":642},"Gitee repositories, issues and pull requests in the same shapes as every other forge. Issues keep their text keys.","md",null,{"icon":674},"i-simple-icons-gitee",{"title":676,"description":670},"Read Gitee issues, pull requests and files with forges","WCv7bhcXzx_HgA7I8QYT6qVE4jBiB8C8wxw4AIYQV94",[679,681],{"title":76,"path":77,"stem":78,"description":680,"children":-1},"Bitbucket Cloud pull requests and review threads in the same shapes as every other forge. No issues there to read.",{"title":84,"path":85,"stem":86,"description":682,"children":-1},"Azure DevOps repositories, pull requests and work items in the same shapes as every other forge. The owner is organization\u002Fproject.",1794778614639]