From e533651251fc7caf58af1aa5f0718939f35cdfe5 Mon Sep 17 00:00:00 2001 From: Jonathan Clem Date: Thu, 5 Sep 2019 09:54:27 -0400 Subject: [PATCH 1/3] Accept Octokit.Options in the GitHub constructor --- packages/github/src/github.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/github/src/github.ts b/packages/github/src/github.ts index 5c85e406..35b5f624 100644 --- a/packages/github/src/github.ts +++ b/packages/github/src/github.ts @@ -14,8 +14,8 @@ export class GitHub extends Octokit { variables?: Variables ) => Promise - constructor(token: string) { - super({auth: `token ${token}`}) + constructor(token: string, opts: Omit = {}) { + super({...opts, auth: `token ${token}`}) this.graphql = defaults({ headers: {authorization: `token ${token}`} }) From ebace7edd3c42199b81c7cc05d6cc0bf4ddae002 Mon Sep 17 00:00:00 2001 From: Jonathan Clem Date: Thu, 5 Sep 2019 10:03:10 -0400 Subject: [PATCH 2/3] Bump TypeScript to 3.6.2 --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7f0a7267..e1b08290 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9530,9 +9530,9 @@ "dev": true }, "typescript": { - "version": "3.4.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.4.tgz", - "integrity": "sha512-xt5RsIRCEaf6+j9AyOBgvVuAec0i92rgCaS3S+UVf5Z/vF2Hvtsw08wtUTJqp4djwznoAgjSxeCcU4r+CcDBJA==", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.2.tgz", + "integrity": "sha512-lmQ4L+J6mnu3xweP8+rOrUwzmN+MRAj7TgtJtDaXE5PMyX2kCrklhg3rvOsOIfNeAWMQWO2F1GPc1kMD2vLAfw==", "dev": true }, "uglify-js": { diff --git a/package.json b/package.json index 91269bbc..5bdc8697 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,6 @@ "lerna": "^3.13.3", "prettier": "^1.17.0", "ts-jest": "^24.0.2", - "typescript": "^3.4.4" + "typescript": "^3.6.2" } } From 1c4866fa4822150f2bc8e4c8b624c8d46d7d5239 Mon Sep 17 00:00:00 2001 From: Jonathan Clem Date: Thu, 5 Sep 2019 10:52:34 -0400 Subject: [PATCH 3/3] Add note about constructor options --- packages/github/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/github/README.md b/packages/github/README.md index 2b74bb1d..b4312568 100644 --- a/packages/github/README.md +++ b/packages/github/README.md @@ -27,6 +27,8 @@ const { data: pullRequest } = await octokit.pulls.get({ console.log(pullRequest); ``` +You can pass client options (except `auth`, which is handled by the token argument), as specified by [Octokit](https://octokit.github.io/rest.js/), as a second argument to the `GitHub` constructor. + You can also make GraphQL requests. See https://github.com/octokit/graphql.js for the API. ```js