forked from mirrors/probot
fix: update `@octokit/graphql` to v4 (#1006)
This commit is contained in:
parent
1328ac4c1d
commit
27cecb0e7e
|
@ -492,60 +492,14 @@
|
|||
}
|
||||
},
|
||||
"@octokit/endpoint": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-4.1.1.tgz",
|
||||
"integrity": "sha512-lfphGC9hglBDiIOU84f1xDUzjWE5j3jGkO3Ng/IpDDVARw760A+/x408JOEpdV20ZUj2GRWdDBC0+HPu5qA5gQ==",
|
||||
"version": "5.3.5",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-5.3.5.tgz",
|
||||
"integrity": "sha512-f8KqzIrnzPLiezDsZZPB+K8v8YSv6aKFl7eOu59O46lmlW4HagWl1U6NWl6LmT8d1w7NsKBI3paVtzcnRGO1gw==",
|
||||
"requires": {
|
||||
"deepmerge": "3.2.0",
|
||||
"is-plain-object": "^2.0.4",
|
||||
"universal-user-agent": "^2.0.1",
|
||||
"url-template": "^2.0.8"
|
||||
}
|
||||
},
|
||||
"@octokit/graphql": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-3.0.1.tgz",
|
||||
"integrity": "sha512-TiegCo0jueDPlkpcYlx8KSYa3ybs13ePBteoJutEHou0hu8sJHHhvIaQWvDH5jj4mHfJwZwD4r6/Xbl33UHLUw==",
|
||||
"requires": {
|
||||
"@octokit/request": "^5.0.0",
|
||||
"universal-user-agent": "^3.0.0"
|
||||
"is-plain-object": "^3.0.0",
|
||||
"universal-user-agent": "^4.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@octokit/endpoint": {
|
||||
"version": "5.2.2",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-5.2.2.tgz",
|
||||
"integrity": "sha512-VhKxM4CQanIUZDffExqpdpgqu3heF51qbY1wazoNtvIKXAAVoFjqLq2BOhesXkTqxXMO1Ze1XbS8DkIjUxAB+g==",
|
||||
"requires": {
|
||||
"deepmerge": "4.0.0",
|
||||
"is-plain-object": "^3.0.0",
|
||||
"universal-user-agent": "^3.0.0",
|
||||
"url-template": "^2.0.8"
|
||||
}
|
||||
},
|
||||
"@octokit/request": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.0.1.tgz",
|
||||
"integrity": "sha512-SHOk/APYpfrzV1RNf7Ux8SZi+vZXhMIB2dBr4TQR6ExMX8R4jcy/0gHw26HLe1dWV7Wxe9WzYyDSEC0XwnoCSQ==",
|
||||
"requires": {
|
||||
"@octokit/endpoint": "^5.1.0",
|
||||
"@octokit/request-error": "^1.0.1",
|
||||
"deprecation": "^2.0.0",
|
||||
"is-plain-object": "^3.0.0",
|
||||
"node-fetch": "^2.3.0",
|
||||
"once": "^1.4.0",
|
||||
"universal-user-agent": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"deepmerge": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.0.0.tgz",
|
||||
"integrity": "sha512-YZ1rOP5+kHor4hMAH+HRQnBQHg+wvS1un1hAOuIcxcBy0hzcUf6Jg2a1w65kpoOUnurOfZbERwjI1TfZxNjcww=="
|
||||
},
|
||||
"deprecation": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz",
|
||||
"integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ=="
|
||||
},
|
||||
"is-plain-object": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.0.tgz",
|
||||
|
@ -559,12 +513,49 @@
|
|||
"resolved": "https://registry.npmjs.org/isobject/-/isobject-4.0.0.tgz",
|
||||
"integrity": "sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA=="
|
||||
},
|
||||
"universal-user-agent": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-3.0.0.tgz",
|
||||
"integrity": "sha512-T3siHThqoj5X0benA5H0qcDnrKGXzU8TKoX15x/tQHw1hQBvIEBHjxQ2klizYsqBOO/Q+WuxoQUihadeeqDnoA==",
|
||||
"os-name": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/os-name/-/os-name-3.1.0.tgz",
|
||||
"integrity": "sha512-h8L+8aNjNcMpo/mAIBPn5PXCM16iyPGjHNWo6U1YO8sJTMHtEtyczI6QJnLoplswm6goopQkqc7OAnjhWcugVg==",
|
||||
"requires": {
|
||||
"os-name": "^3.0.0"
|
||||
"macos-release": "^2.2.0",
|
||||
"windows-release": "^3.1.0"
|
||||
}
|
||||
},
|
||||
"universal-user-agent": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-4.0.0.tgz",
|
||||
"integrity": "sha512-eM8knLpev67iBDizr/YtqkJsF3GK8gzDc6st/WKzrTuPtcsOKW/0IdL4cnMBsU69pOx0otavLWBDGTwg+dB0aA==",
|
||||
"requires": {
|
||||
"os-name": "^3.1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@octokit/graphql": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.2.0.tgz",
|
||||
"integrity": "sha512-6JKVE2cJPZVIM1LLsy7M4rKcaE3r6dbP7o895FLEpClHeMDv1a+k3yANue0ycMhM1Es9/WEy8hjBaBpOBETw6A==",
|
||||
"requires": {
|
||||
"@octokit/request": "^5.0.0",
|
||||
"universal-user-agent": "^4.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"os-name": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/os-name/-/os-name-3.1.0.tgz",
|
||||
"integrity": "sha512-h8L+8aNjNcMpo/mAIBPn5PXCM16iyPGjHNWo6U1YO8sJTMHtEtyczI6QJnLoplswm6goopQkqc7OAnjhWcugVg==",
|
||||
"requires": {
|
||||
"macos-release": "^2.2.0",
|
||||
"windows-release": "^3.1.0"
|
||||
}
|
||||
},
|
||||
"universal-user-agent": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-4.0.0.tgz",
|
||||
"integrity": "sha512-eM8knLpev67iBDizr/YtqkJsF3GK8gzDc6st/WKzrTuPtcsOKW/0IdL4cnMBsU69pOx0otavLWBDGTwg+dB0aA==",
|
||||
"requires": {
|
||||
"os-name": "^3.1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -591,16 +582,54 @@
|
|||
}
|
||||
},
|
||||
"@octokit/request": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-3.0.0.tgz",
|
||||
"integrity": "sha512-DZqmbm66tq+a9FtcKrn0sjrUpi0UaZ9QPUCxxyk/4CJ2rseTMpAWRf6gCwOSUCzZcx/4XVIsDk+kz5BVdaeenA==",
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.1.0.tgz",
|
||||
"integrity": "sha512-I15T9PwjFs4tbWyhtFU2Kq7WDPidYMvRB7spmxoQRZfxSmiqullG+Nz+KbSmpkfnlvHwTr1e31R5WReFRKMXjg==",
|
||||
"requires": {
|
||||
"@octokit/endpoint": "^4.0.0",
|
||||
"deprecation": "^1.0.1",
|
||||
"is-plain-object": "^2.0.4",
|
||||
"@octokit/endpoint": "^5.1.0",
|
||||
"@octokit/request-error": "^1.0.1",
|
||||
"deprecation": "^2.0.0",
|
||||
"is-plain-object": "^3.0.0",
|
||||
"node-fetch": "^2.3.0",
|
||||
"once": "^1.4.0",
|
||||
"universal-user-agent": "^2.0.1"
|
||||
"universal-user-agent": "^4.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"deprecation": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz",
|
||||
"integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ=="
|
||||
},
|
||||
"is-plain-object": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.0.tgz",
|
||||
"integrity": "sha512-tZIpofR+P05k8Aocp7UI/2UTa9lTJSebCXpFFoR9aibpokDj/uXBsJ8luUu0tTVYKkMU6URDUuOfJZ7koewXvg==",
|
||||
"requires": {
|
||||
"isobject": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"isobject": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/isobject/-/isobject-4.0.0.tgz",
|
||||
"integrity": "sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA=="
|
||||
},
|
||||
"os-name": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/os-name/-/os-name-3.1.0.tgz",
|
||||
"integrity": "sha512-h8L+8aNjNcMpo/mAIBPn5PXCM16iyPGjHNWo6U1YO8sJTMHtEtyczI6QJnLoplswm6goopQkqc7OAnjhWcugVg==",
|
||||
"requires": {
|
||||
"macos-release": "^2.2.0",
|
||||
"windows-release": "^3.1.0"
|
||||
}
|
||||
},
|
||||
"universal-user-agent": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-4.0.0.tgz",
|
||||
"integrity": "sha512-eM8knLpev67iBDizr/YtqkJsF3GK8gzDc6st/WKzrTuPtcsOKW/0IdL4cnMBsU69pOx0otavLWBDGTwg+dB0aA==",
|
||||
"requires": {
|
||||
"os-name": "^3.1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@octokit/request-error": {
|
||||
|
@ -636,6 +665,47 @@
|
|||
"once": "^1.4.0",
|
||||
"universal-user-agent": "^2.0.0",
|
||||
"url-template": "^2.0.8"
|
||||
},
|
||||
"dependencies": {
|
||||
"@octokit/endpoint": {
|
||||
"version": "4.2.2",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-4.2.2.tgz",
|
||||
"integrity": "sha512-5IZjkUNhx5q0IRN7Juwf5A+Lu2qAso7ULST7C1P2mbGHePuCOk936Stcl/5GdJpB3ovD8M6/Lv3xra6Mn0IKNQ==",
|
||||
"requires": {
|
||||
"deepmerge": "3.2.0",
|
||||
"is-plain-object": "^3.0.0",
|
||||
"universal-user-agent": "^2.0.1",
|
||||
"url-template": "^2.0.8"
|
||||
},
|
||||
"dependencies": {
|
||||
"is-plain-object": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.0.tgz",
|
||||
"integrity": "sha512-tZIpofR+P05k8Aocp7UI/2UTa9lTJSebCXpFFoR9aibpokDj/uXBsJ8luUu0tTVYKkMU6URDUuOfJZ7koewXvg==",
|
||||
"requires": {
|
||||
"isobject": "^4.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@octokit/request": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-3.0.0.tgz",
|
||||
"integrity": "sha512-DZqmbm66tq+a9FtcKrn0sjrUpi0UaZ9QPUCxxyk/4CJ2rseTMpAWRf6gCwOSUCzZcx/4XVIsDk+kz5BVdaeenA==",
|
||||
"requires": {
|
||||
"@octokit/endpoint": "^4.0.0",
|
||||
"deprecation": "^1.0.1",
|
||||
"is-plain-object": "^2.0.4",
|
||||
"node-fetch": "^2.3.0",
|
||||
"once": "^1.4.0",
|
||||
"universal-user-agent": "^2.0.1"
|
||||
}
|
||||
},
|
||||
"isobject": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/isobject/-/isobject-4.0.0.tgz",
|
||||
"integrity": "sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"@octokit/webhooks": {
|
||||
|
|
|
@ -52,10 +52,11 @@
|
|||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@octokit/app": "^4.0.0",
|
||||
"@octokit/graphql": "3.0.1",
|
||||
"@octokit/graphql": "^4.2.0",
|
||||
"@octokit/plugin-enterprise-compatibility": "^1.0.0",
|
||||
"@octokit/plugin-retry": "^2.1.1",
|
||||
"@octokit/plugin-throttling": "^2.3.0",
|
||||
"@octokit/request": "^5.1.0",
|
||||
"@octokit/rest": "^16.25.0",
|
||||
"@octokit/webhooks": "^6.0.0",
|
||||
"@types/supports-color": "^5.3.0",
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
declare module '@octokit/graphql/lib/with-defaults' {
|
||||
import Octokit from '@octokit/rest'
|
||||
|
||||
export = withDefaults
|
||||
declare function withDefaults(request: Octokit.request, defaults: Octokit.EndpointOptions): any;
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
// tslint:disable-next-line
|
||||
import octokitGraphqlWithDefaults from '@octokit/graphql/lib/with-defaults'
|
||||
import { withCustomRequest } from '@octokit/graphql'
|
||||
|
||||
import { request } from '@octokit/request'
|
||||
import {
|
||||
GitHubAPI
|
||||
} from './'
|
||||
|
@ -15,11 +16,11 @@ export interface GraphQLError {
|
|||
}
|
||||
|
||||
export function addGraphQL (client: GitHubAPI) {
|
||||
const graphql = octokitGraphqlWithDefaults(client.request, {
|
||||
method: 'POST',
|
||||
url: '/graphql',
|
||||
const graphqlRequest = (client.request as any as typeof request).defaults({
|
||||
...(process.env.GHE_HOST ? { baseUrl: `https://${process.env.GHE_HOST}/api` } : {})
|
||||
})
|
||||
const graphql = withCustomRequest(graphqlRequest)
|
||||
|
||||
client.graphql = (...args: any[]): any => {
|
||||
if (args[2]) {
|
||||
// tslint:disable-next-line:no-console
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { graphql } from '@octokit/graphql'
|
||||
import enterpriseCompatibility from '@octokit/plugin-enterprise-compatibility'
|
||||
import retryPlugin from '@octokit/plugin-retry'
|
||||
import throttlePlugin from '@octokit/plugin-throttling'
|
||||
|
@ -67,7 +68,7 @@ interface Paginate extends Octokit.Paginate {
|
|||
): Promise<any[]>
|
||||
}
|
||||
|
||||
type Graphql = (query: string, variables?: Variables, headers?: Headers) => Promise<GraphQlQueryResponse>
|
||||
type Graphql = (query: string, variables?: Variables, headers?: Headers) => ReturnType<typeof graphql>
|
||||
|
||||
export interface GitHubAPI extends Octokit {
|
||||
paginate: Paginate
|
||||
|
|
Loading…
Reference in New Issue