From 39cdce8801bd67363ba743a88bff9d9058f0f932 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 25 Jan 2020 11:52:29 -0800 Subject: [PATCH] fix(typescript): .git.getTree types (#1556) --- index.d.ts | 20 +++++++++++++++++-- .../update-endpoints/generated/endpoints.json | 10 +++++++--- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/index.d.ts b/index.d.ts index b2408554..b1a7dcb2 100644 --- a/index.d.ts +++ b/index.d.ts @@ -19285,6 +19285,20 @@ declare namespace Octokit { ref: string; url: string; }; + type GitGetTreeResponseTreeItem = { + mode: string; + path: string; + sha: string; + size?: number; + type: string; + url: string; + }; + type GitGetTreeResponse = { + sha: string; + tree: Array; + truncated: boolean; + url: string; + }; type GitGetTagResponseVerification = { payload: null; reason: string; @@ -34174,11 +34188,13 @@ declare class Octokit { endpoint: Octokit.Endpoint; }; /** - * If `truncated` is `true`, the number of items in the `tree` array exceeded our maximum limit. If you need to fetch more items, you can clone the repository and iterate over the Git data locally. + * Returns a single tree using the SHA1 value for that tree. + * + * If `truncated` is `true` in the response then the number of items in the `tree` array exceeded our maximum limit. If you need to fetch more items, you can clone the repository and iterate over the Git data locally. */ getTree: { (params?: Octokit.RequestOptions & Octokit.GitGetTreeParams): Promise< - Octokit.AnyResponse + Octokit.Response >; endpoint: Octokit.Endpoint; diff --git a/scripts/update-endpoints/generated/endpoints.json b/scripts/update-endpoints/generated/endpoints.json index ead8447b..30987108 100644 --- a/scripts/update-endpoints/generated/endpoints.json +++ b/scripts/update-endpoints/generated/endpoints.json @@ -22778,7 +22778,7 @@ "url": "/repos/{owner}/{repo}/git/trees/{tree_sha}", "isDeprecated": false, "isLegacy": false, - "description": "If `truncated` is `true`, the number of items in the `tree` array exceeded our maximum limit. If you need to fetch more items, you can clone the repository and iterate over the Git data locally.", + "description": "Returns a single tree using the SHA1 value for that tree.\n\nIf `truncated` is `true` in the response then the number of items in the `tree` array exceeded our maximum limit. If you need to fetch more items, you can clone the repository and iterate over the Git data locally.", "documentationUrl": "https://developer.github.com/v3/git/trees/#get-a-tree", "previews": [], "headers": [], @@ -22839,8 +22839,12 @@ "responses": [ { "code": 200, - "description": "If `truncated` is `true`, the number of items in the `tree` array exceeded our maximum limit. If you need to fetch more items, you can clone the repository and iterate over the Git data locally.", - "examples": null + "description": "If `truncated` is `true` in the response then the number of items in the `tree` array exceeded our maximum limit. If you need to fetch more items, you can clone the repository and iterate over the Git data locally.", + "examples": [ + { + "data": "{\"sha\":\"9fb037999f264ba9a7fc6274d15fa3ae2ab98312\",\"url\":\"https://api.github.com/repos/octocat/Hello-World/trees/9fb037999f264ba9a7fc6274d15fa3ae2ab98312\",\"tree\":[{\"path\":\"file.rb\",\"mode\":\"100644\",\"type\":\"blob\",\"size\":30,\"sha\":\"44b4fc6d56897b048c772eb4087f854f46256132\",\"url\":\"https://api.github.com/repos/octocat/Hello-World/git/blobs/44b4fc6d56897b048c772eb4087f854f46256132\"},{\"path\":\"subdir\",\"mode\":\"040000\",\"type\":\"tree\",\"sha\":\"f484d249c660418515fb01c2b9662073663c242e\",\"url\":\"https://api.github.com/repos/octocat/Hello-World/git/blobs/f484d249c660418515fb01c2b9662073663c242e\"},{\"path\":\"exec_file\",\"mode\":\"100755\",\"type\":\"blob\",\"size\":75,\"sha\":\"45b983be36b73c0788dc9cbcb76cbb80fc7bb057\",\"url\":\"https://api.github.com/repos/octocat/Hello-World/git/blobs/45b983be36b73c0788dc9cbcb76cbb80fc7bb057\"}],\"truncated\":false}" + } + ] } ], "renamed": null