Update to the latest version of @actions/github.
This commit is contained in:
parent
55458a1ab1
commit
9ed519fa12
419 changed files with 56978 additions and 151535 deletions
96
node_modules/@octokit/graphql/README.md
generated
vendored
96
node_modules/@octokit/graphql/README.md
generated
vendored
|
|
@ -3,8 +3,7 @@
|
|||
> GitHub GraphQL API client for browsers and Node
|
||||
|
||||
[](https://www.npmjs.com/package/@octokit/graphql)
|
||||
[](https://travis-ci.com/octokit/graphql.js)
|
||||
[](https://greenkeeper.io/)
|
||||
[](https://github.com/octokit/graphql.js/actions?query=workflow%3ATest+branch%3Amaster)
|
||||
|
||||
<!-- toc -->
|
||||
|
||||
|
|
@ -13,7 +12,8 @@
|
|||
- [Authentication](#authentication)
|
||||
- [Variables](#variables)
|
||||
- [Pass query together with headers and variables](#pass-query-together-with-headers-and-variables)
|
||||
- [Use your own `@octokit/request` instance](#)
|
||||
- [Use with GitHub Enterprise](#use-with-github-enterprise)
|
||||
- [Use custom `@octokit/request` instance](#use-custom-octokitrequest-instance)
|
||||
- [Errors](#errors)
|
||||
- [Partial responses](#partial-responses)
|
||||
- [Writing tests](#writing-tests)
|
||||
|
|
@ -72,8 +72,8 @@ const { repository } = await graphql(
|
|||
`,
|
||||
{
|
||||
headers: {
|
||||
authorization: `token secret123`
|
||||
}
|
||||
authorization: `token secret123`,
|
||||
},
|
||||
}
|
||||
);
|
||||
```
|
||||
|
|
@ -85,8 +85,8 @@ The simplest way to authenticate a request is to set the `Authorization` header,
|
|||
```js
|
||||
const graphqlWithAuth = graphql.defaults({
|
||||
headers: {
|
||||
authorization: `token secret123`
|
||||
}
|
||||
authorization: `token secret123`,
|
||||
},
|
||||
});
|
||||
const { repository } = await graphqlWithAuth(`
|
||||
{
|
||||
|
|
@ -110,12 +110,12 @@ const { createAppAuth } = require("@octokit/auth-app");
|
|||
const auth = createAppAuth({
|
||||
id: process.env.APP_ID,
|
||||
privateKey: process.env.PRIVATE_KEY,
|
||||
installationId: 123
|
||||
installationId: 123,
|
||||
});
|
||||
const graphqlWithAuth = graphql.defaults({
|
||||
request: {
|
||||
hook: auth.hook
|
||||
}
|
||||
hook: auth.hook,
|
||||
},
|
||||
});
|
||||
|
||||
const { repository } = await graphqlWithAuth(
|
||||
|
|
@ -138,30 +138,34 @@ const { repository } = await graphqlWithAuth(
|
|||
⚠️ Do not use [template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) in the query strings as they make your code vulnerable to query injection attacks (see [#2](https://github.com/octokit/graphql.js/issues/2)). Use variables instead:
|
||||
|
||||
```js
|
||||
const { lastIssues } = await graphql(`query lastIssues($owner: String!, $repo: String!, $num: Int = 3) {
|
||||
repository(owner:$owner, name:$repo) {
|
||||
issues(last:$num) {
|
||||
edges {
|
||||
node {
|
||||
title
|
||||
const { lastIssues } = await graphql(
|
||||
`
|
||||
query lastIssues($owner: String!, $repo: String!, $num: Int = 3) {
|
||||
repository(owner: $owner, name: $repo) {
|
||||
issues(last: $num) {
|
||||
edges {
|
||||
node {
|
||||
title
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}`, {
|
||||
owner: 'octokit',
|
||||
repo: 'graphql.js'
|
||||
`,
|
||||
{
|
||||
owner: "octokit",
|
||||
repo: "graphql.js",
|
||||
headers: {
|
||||
authorization: `token secret123`
|
||||
}
|
||||
authorization: `token secret123`,
|
||||
},
|
||||
}
|
||||
})
|
||||
);
|
||||
```
|
||||
|
||||
### Pass query together with headers and variables
|
||||
|
||||
```js
|
||||
const { graphql } = require('@octokit/graphql')
|
||||
const { graphql } = require("@octokit/graphql");
|
||||
const { lastIssues } = await graphql({
|
||||
query: `query lastIssues($owner: String!, $repo: String!, $num: Int = 3) {
|
||||
repository(owner:$owner, name:$repo) {
|
||||
|
|
@ -174,12 +178,12 @@ const { lastIssues } = await graphql({
|
|||
}
|
||||
}
|
||||
}`,
|
||||
owner: 'octokit',
|
||||
repo: 'graphql.js'
|
||||
owner: "octokit",
|
||||
repo: "graphql.js",
|
||||
headers: {
|
||||
authorization: `token secret123`
|
||||
}
|
||||
})
|
||||
authorization: `token secret123`,
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
### Use with GitHub Enterprise
|
||||
|
|
@ -189,8 +193,8 @@ let { graphql } = require("@octokit/graphql");
|
|||
graphql = graphql.defaults({
|
||||
baseUrl: "https://github-enterprise.acme-inc.com/api",
|
||||
headers: {
|
||||
authorization: `token secret123`
|
||||
}
|
||||
authorization: `token secret123`,
|
||||
},
|
||||
});
|
||||
const { repository } = await graphql(`
|
||||
{
|
||||
|
|
@ -213,20 +217,20 @@ const { repository } = await graphql(`
|
|||
const { request } = require("@octokit/request");
|
||||
const { withCustomRequest } = require("@octokit/graphql");
|
||||
|
||||
let requestCounter = 0
|
||||
let requestCounter = 0;
|
||||
const myRequest = request.defaults({
|
||||
headers: {
|
||||
authentication: 'token secret123'
|
||||
authentication: "token secret123",
|
||||
},
|
||||
request: {
|
||||
hook(request, options) {
|
||||
requestCounter++
|
||||
return request(options)
|
||||
}
|
||||
}
|
||||
})
|
||||
const myGraphql = withCustomRequest(myRequest)
|
||||
await request('/')
|
||||
requestCounter++;
|
||||
return request(options);
|
||||
},
|
||||
},
|
||||
});
|
||||
const myGraphql = withCustomRequest(myRequest);
|
||||
await request("/");
|
||||
await myGraphql(`
|
||||
{
|
||||
repository(owner: "acme-project", name: "acme-repo") {
|
||||
|
|
@ -251,8 +255,8 @@ In case of a GraphQL error, `error.message` is set to the first error from the r
|
|||
let { graphql } = require("@octokit/graphql");
|
||||
graphqlt = graphql.defaults({
|
||||
headers: {
|
||||
authorization: `token secret123`
|
||||
}
|
||||
authorization: `token secret123`,
|
||||
},
|
||||
});
|
||||
const query = `{
|
||||
viewer {
|
||||
|
|
@ -288,8 +292,8 @@ A GraphQL query may respond with partial data accompanied by errors. In this cas
|
|||
let { graphql } = require("@octokit/graphql");
|
||||
graphql = graphql.defaults({
|
||||
headers: {
|
||||
authorization: `token secret123`
|
||||
}
|
||||
authorization: `token secret123`,
|
||||
},
|
||||
});
|
||||
const query = `{
|
||||
repository(name: "probot", owner: "probot") {
|
||||
|
|
@ -357,7 +361,7 @@ const { graphql } = require("@octokit/graphql");
|
|||
|
||||
graphql("{ viewer { login } }", {
|
||||
headers: {
|
||||
authorization: "token secret123"
|
||||
authorization: "token secret123",
|
||||
},
|
||||
request: {
|
||||
fetch: fetchMock
|
||||
|
|
@ -370,8 +374,8 @@ graphql("{ viewer { login } }", {
|
|||
"Sends correct query"
|
||||
);
|
||||
return { data: {} };
|
||||
})
|
||||
}
|
||||
}),
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
|
|
|
|||
39
node_modules/@octokit/graphql/dist-node/index.js
generated
vendored
39
node_modules/@octokit/graphql/dist-node/index.js
generated
vendored
|
|
@ -5,13 +5,16 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|||
var request = require('@octokit/request');
|
||||
var universalUserAgent = require('universal-user-agent');
|
||||
|
||||
const VERSION = "4.3.1";
|
||||
const VERSION = "4.5.6";
|
||||
|
||||
class GraphqlError extends Error {
|
||||
constructor(request, response) {
|
||||
const message = response.data.errors[0].message;
|
||||
super(message);
|
||||
Object.assign(this, response.data);
|
||||
Object.assign(this, {
|
||||
headers: response.headers
|
||||
});
|
||||
this.name = "GraphqlError";
|
||||
this.request = request; // Maintains proper stack trace (only available on V8)
|
||||
|
||||
|
|
@ -24,14 +27,19 @@ class GraphqlError extends Error {
|
|||
|
||||
}
|
||||
|
||||
const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query"];
|
||||
const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query", "mediaType"];
|
||||
const GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/;
|
||||
function graphql(request, query, options) {
|
||||
options = typeof query === "string" ? options = Object.assign({
|
||||
if (typeof query === "string" && options && "query" in options) {
|
||||
return Promise.reject(new Error(`[@octokit/graphql] "query" cannot be used as variable name`));
|
||||
}
|
||||
|
||||
const parsedOptions = typeof query === "string" ? Object.assign({
|
||||
query
|
||||
}, options) : options = query;
|
||||
const requestOptions = Object.keys(options).reduce((result, key) => {
|
||||
}, options) : query;
|
||||
const requestOptions = Object.keys(parsedOptions).reduce((result, key) => {
|
||||
if (NON_VARIABLE_OPTIONS.includes(key)) {
|
||||
result[key] = options[key];
|
||||
result[key] = parsedOptions[key];
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
@ -39,12 +47,27 @@ function graphql(request, query, options) {
|
|||
result.variables = {};
|
||||
}
|
||||
|
||||
result.variables[key] = options[key];
|
||||
result.variables[key] = parsedOptions[key];
|
||||
return result;
|
||||
}, {});
|
||||
}, {}); // workaround for GitHub Enterprise baseUrl set with /api/v3 suffix
|
||||
// https://github.com/octokit/auth-app.js/issues/111#issuecomment-657610451
|
||||
|
||||
const baseUrl = parsedOptions.baseUrl || request.endpoint.DEFAULTS.baseUrl;
|
||||
|
||||
if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {
|
||||
requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql");
|
||||
}
|
||||
|
||||
return request(requestOptions).then(response => {
|
||||
if (response.data.errors) {
|
||||
const headers = {};
|
||||
|
||||
for (const key of Object.keys(response.headers)) {
|
||||
headers[key] = response.headers[key];
|
||||
}
|
||||
|
||||
throw new GraphqlError(requestOptions, {
|
||||
headers,
|
||||
data: response.data
|
||||
});
|
||||
}
|
||||
|
|
|
|||
2
node_modules/@octokit/graphql/dist-node/index.js.map
generated
vendored
2
node_modules/@octokit/graphql/dist-node/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
1
node_modules/@octokit/graphql/dist-src/error.js
generated
vendored
1
node_modules/@octokit/graphql/dist-src/error.js
generated
vendored
|
|
@ -3,6 +3,7 @@ export class GraphqlError extends Error {
|
|||
const message = response.data.errors[0].message;
|
||||
super(message);
|
||||
Object.assign(this, response.data);
|
||||
Object.assign(this, { headers: response.headers });
|
||||
this.name = "GraphqlError";
|
||||
this.request = request;
|
||||
// Maintains proper stack trace (only available on V8)
|
||||
|
|
|
|||
33
node_modules/@octokit/graphql/dist-src/graphql.js
generated
vendored
33
node_modules/@octokit/graphql/dist-src/graphql.js
generated
vendored
|
|
@ -5,28 +5,41 @@ const NON_VARIABLE_OPTIONS = [
|
|||
"url",
|
||||
"headers",
|
||||
"request",
|
||||
"query"
|
||||
"query",
|
||||
"mediaType",
|
||||
];
|
||||
const GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/;
|
||||
export function graphql(request, query, options) {
|
||||
options =
|
||||
typeof query === "string"
|
||||
? (options = Object.assign({ query }, options))
|
||||
: (options = query);
|
||||
const requestOptions = Object.keys(options).reduce((result, key) => {
|
||||
if (typeof query === "string" && options && "query" in options) {
|
||||
return Promise.reject(new Error(`[@octokit/graphql] "query" cannot be used as variable name`));
|
||||
}
|
||||
const parsedOptions = typeof query === "string" ? Object.assign({ query }, options) : query;
|
||||
const requestOptions = Object.keys(parsedOptions).reduce((result, key) => {
|
||||
if (NON_VARIABLE_OPTIONS.includes(key)) {
|
||||
result[key] = options[key];
|
||||
result[key] = parsedOptions[key];
|
||||
return result;
|
||||
}
|
||||
if (!result.variables) {
|
||||
result.variables = {};
|
||||
}
|
||||
result.variables[key] = options[key];
|
||||
result.variables[key] = parsedOptions[key];
|
||||
return result;
|
||||
}, {});
|
||||
return request(requestOptions).then(response => {
|
||||
// workaround for GitHub Enterprise baseUrl set with /api/v3 suffix
|
||||
// https://github.com/octokit/auth-app.js/issues/111#issuecomment-657610451
|
||||
const baseUrl = parsedOptions.baseUrl || request.endpoint.DEFAULTS.baseUrl;
|
||||
if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {
|
||||
requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql");
|
||||
}
|
||||
return request(requestOptions).then((response) => {
|
||||
if (response.data.errors) {
|
||||
const headers = {};
|
||||
for (const key of Object.keys(response.headers)) {
|
||||
headers[key] = response.headers[key];
|
||||
}
|
||||
throw new GraphqlError(requestOptions, {
|
||||
data: response.data
|
||||
headers,
|
||||
data: response.data,
|
||||
});
|
||||
}
|
||||
return response.data.data;
|
||||
|
|
|
|||
6
node_modules/@octokit/graphql/dist-src/index.js
generated
vendored
6
node_modules/@octokit/graphql/dist-src/index.js
generated
vendored
|
|
@ -4,14 +4,14 @@ import { VERSION } from "./version";
|
|||
import { withDefaults } from "./with-defaults";
|
||||
export const graphql = withDefaults(request, {
|
||||
headers: {
|
||||
"user-agent": `octokit-graphql.js/${VERSION} ${getUserAgent()}`
|
||||
"user-agent": `octokit-graphql.js/${VERSION} ${getUserAgent()}`,
|
||||
},
|
||||
method: "POST",
|
||||
url: "/graphql"
|
||||
url: "/graphql",
|
||||
});
|
||||
export function withCustomRequest(customRequest) {
|
||||
return withDefaults(customRequest, {
|
||||
method: "POST",
|
||||
url: "/graphql"
|
||||
url: "/graphql",
|
||||
});
|
||||
}
|
||||
|
|
|
|||
2
node_modules/@octokit/graphql/dist-src/version.js
generated
vendored
2
node_modules/@octokit/graphql/dist-src/version.js
generated
vendored
|
|
@ -1 +1 @@
|
|||
export const VERSION = "4.3.1";
|
||||
export const VERSION = "4.5.6";
|
||||
|
|
|
|||
2
node_modules/@octokit/graphql/dist-src/with-defaults.js
generated
vendored
2
node_modules/@octokit/graphql/dist-src/with-defaults.js
generated
vendored
|
|
@ -7,6 +7,6 @@ export function withDefaults(request, newDefaults) {
|
|||
};
|
||||
return Object.assign(newApi, {
|
||||
defaults: withDefaults.bind(null, newRequest),
|
||||
endpoint: Request.endpoint
|
||||
endpoint: Request.endpoint,
|
||||
});
|
||||
}
|
||||
|
|
|
|||
12
node_modules/@octokit/graphql/dist-types/error.d.ts
generated
vendored
12
node_modules/@octokit/graphql/dist-types/error.d.ts
generated
vendored
|
|
@ -1,7 +1,9 @@
|
|||
import { EndpointOptions, GraphQlQueryResponse } from "./types";
|
||||
export declare class GraphqlError<T extends GraphQlQueryResponse> extends Error {
|
||||
request: EndpointOptions;
|
||||
constructor(request: EndpointOptions, response: {
|
||||
data: Required<GraphQlQueryResponse>;
|
||||
import { ResponseHeaders } from "@octokit/types";
|
||||
import { GraphQlEndpointOptions, GraphQlQueryResponse } from "./types";
|
||||
export declare class GraphqlError<ResponseData> extends Error {
|
||||
request: GraphQlEndpointOptions;
|
||||
constructor(request: GraphQlEndpointOptions, response: {
|
||||
headers: ResponseHeaders;
|
||||
data: Required<GraphQlQueryResponse<ResponseData>>;
|
||||
});
|
||||
}
|
||||
|
|
|
|||
2
node_modules/@octokit/graphql/dist-types/graphql.d.ts
generated
vendored
2
node_modules/@octokit/graphql/dist-types/graphql.d.ts
generated
vendored
|
|
@ -1,3 +1,3 @@
|
|||
import { request as Request } from "@octokit/request";
|
||||
import { RequestParameters, GraphQlQueryResponseData } from "./types";
|
||||
export declare function graphql(request: typeof Request, query: string | RequestParameters, options?: RequestParameters): Promise<GraphQlQueryResponseData>;
|
||||
export declare function graphql<ResponseData = GraphQlQueryResponseData>(request: typeof Request, query: string | RequestParameters, options?: RequestParameters): Promise<ResponseData>;
|
||||
|
|
|
|||
27
node_modules/@octokit/graphql/dist-types/types.d.ts
generated
vendored
27
node_modules/@octokit/graphql/dist-types/types.d.ts
generated
vendored
|
|
@ -1,7 +1,10 @@
|
|||
import * as OctokitTypes from "@octokit/types";
|
||||
import { graphql } from "./graphql";
|
||||
export declare type EndpointOptions = OctokitTypes.EndpointOptions;
|
||||
export declare type RequestParameters = OctokitTypes.RequestParameters;
|
||||
import { EndpointOptions, RequestParameters as RequestParametersType, EndpointInterface } from "@octokit/types";
|
||||
export declare type GraphQlEndpointOptions = EndpointOptions & {
|
||||
variables?: {
|
||||
[key: string]: unknown;
|
||||
};
|
||||
};
|
||||
export declare type RequestParameters = RequestParametersType;
|
||||
export declare type Query = string;
|
||||
export interface graphql {
|
||||
/**
|
||||
|
|
@ -10,29 +13,29 @@ export interface graphql {
|
|||
*
|
||||
* @param {object} endpoint Must set `method` and `url`. Plus URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`.
|
||||
*/
|
||||
(options: OctokitTypes.RequestParameters): GraphQlResponse;
|
||||
<ResponseData>(options: RequestParameters): GraphQlResponse<ResponseData>;
|
||||
/**
|
||||
* Sends a GraphQL query request based on endpoint options
|
||||
*
|
||||
* @param {string} query GraphQL query. Example: `'query { viewer { login } }'`.
|
||||
* @param {object} [parameters] URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`.
|
||||
*/
|
||||
(query: Query, parameters?: OctokitTypes.RequestParameters): GraphQlResponse;
|
||||
<ResponseData>(query: Query, parameters?: RequestParameters): GraphQlResponse<ResponseData>;
|
||||
/**
|
||||
* Returns a new `endpoint` with updated route and parameters
|
||||
*/
|
||||
defaults: (newDefaults: OctokitTypes.RequestParameters) => graphql;
|
||||
defaults: (newDefaults: RequestParameters) => graphql;
|
||||
/**
|
||||
* Octokit endpoint API, see {@link https://github.com/octokit/endpoint.js|@octokit/endpoint}
|
||||
*/
|
||||
endpoint: OctokitTypes.EndpointInterface;
|
||||
endpoint: EndpointInterface;
|
||||
}
|
||||
export declare type GraphQlResponse = ReturnType<typeof graphql>;
|
||||
export declare type GraphQlResponse<ResponseData> = Promise<ResponseData>;
|
||||
export declare type GraphQlQueryResponseData = {
|
||||
[key: string]: any;
|
||||
} | null;
|
||||
export declare type GraphQlQueryResponse = {
|
||||
data: GraphQlQueryResponseData;
|
||||
};
|
||||
export declare type GraphQlQueryResponse<ResponseData> = {
|
||||
data: ResponseData;
|
||||
errors?: [{
|
||||
message: string;
|
||||
path: [string];
|
||||
|
|
|
|||
2
node_modules/@octokit/graphql/dist-types/version.d.ts
generated
vendored
2
node_modules/@octokit/graphql/dist-types/version.d.ts
generated
vendored
|
|
@ -1 +1 @@
|
|||
export declare const VERSION = "4.3.1";
|
||||
export declare const VERSION = "4.5.6";
|
||||
|
|
|
|||
44
node_modules/@octokit/graphql/dist-web/index.js
generated
vendored
44
node_modules/@octokit/graphql/dist-web/index.js
generated
vendored
|
|
@ -1,13 +1,14 @@
|
|||
import { request } from '@octokit/request';
|
||||
import { getUserAgent } from 'universal-user-agent';
|
||||
|
||||
const VERSION = "4.3.1";
|
||||
const VERSION = "4.5.6";
|
||||
|
||||
class GraphqlError extends Error {
|
||||
constructor(request, response) {
|
||||
const message = response.data.errors[0].message;
|
||||
super(message);
|
||||
Object.assign(this, response.data);
|
||||
Object.assign(this, { headers: response.headers });
|
||||
this.name = "GraphqlError";
|
||||
this.request = request;
|
||||
// Maintains proper stack trace (only available on V8)
|
||||
|
|
@ -24,28 +25,41 @@ const NON_VARIABLE_OPTIONS = [
|
|||
"url",
|
||||
"headers",
|
||||
"request",
|
||||
"query"
|
||||
"query",
|
||||
"mediaType",
|
||||
];
|
||||
const GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/;
|
||||
function graphql(request, query, options) {
|
||||
options =
|
||||
typeof query === "string"
|
||||
? (options = Object.assign({ query }, options))
|
||||
: (options = query);
|
||||
const requestOptions = Object.keys(options).reduce((result, key) => {
|
||||
if (typeof query === "string" && options && "query" in options) {
|
||||
return Promise.reject(new Error(`[@octokit/graphql] "query" cannot be used as variable name`));
|
||||
}
|
||||
const parsedOptions = typeof query === "string" ? Object.assign({ query }, options) : query;
|
||||
const requestOptions = Object.keys(parsedOptions).reduce((result, key) => {
|
||||
if (NON_VARIABLE_OPTIONS.includes(key)) {
|
||||
result[key] = options[key];
|
||||
result[key] = parsedOptions[key];
|
||||
return result;
|
||||
}
|
||||
if (!result.variables) {
|
||||
result.variables = {};
|
||||
}
|
||||
result.variables[key] = options[key];
|
||||
result.variables[key] = parsedOptions[key];
|
||||
return result;
|
||||
}, {});
|
||||
return request(requestOptions).then(response => {
|
||||
// workaround for GitHub Enterprise baseUrl set with /api/v3 suffix
|
||||
// https://github.com/octokit/auth-app.js/issues/111#issuecomment-657610451
|
||||
const baseUrl = parsedOptions.baseUrl || request.endpoint.DEFAULTS.baseUrl;
|
||||
if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {
|
||||
requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql");
|
||||
}
|
||||
return request(requestOptions).then((response) => {
|
||||
if (response.data.errors) {
|
||||
const headers = {};
|
||||
for (const key of Object.keys(response.headers)) {
|
||||
headers[key] = response.headers[key];
|
||||
}
|
||||
throw new GraphqlError(requestOptions, {
|
||||
data: response.data
|
||||
headers,
|
||||
data: response.data,
|
||||
});
|
||||
}
|
||||
return response.data.data;
|
||||
|
|
@ -59,21 +73,21 @@ function withDefaults(request$1, newDefaults) {
|
|||
};
|
||||
return Object.assign(newApi, {
|
||||
defaults: withDefaults.bind(null, newRequest),
|
||||
endpoint: request.endpoint
|
||||
endpoint: request.endpoint,
|
||||
});
|
||||
}
|
||||
|
||||
const graphql$1 = withDefaults(request, {
|
||||
headers: {
|
||||
"user-agent": `octokit-graphql.js/${VERSION} ${getUserAgent()}`
|
||||
"user-agent": `octokit-graphql.js/${VERSION} ${getUserAgent()}`,
|
||||
},
|
||||
method: "POST",
|
||||
url: "/graphql"
|
||||
url: "/graphql",
|
||||
});
|
||||
function withCustomRequest(customRequest) {
|
||||
return withDefaults(customRequest, {
|
||||
method: "POST",
|
||||
url: "/graphql"
|
||||
url: "/graphql",
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
2
node_modules/@octokit/graphql/dist-web/index.js.map
generated
vendored
2
node_modules/@octokit/graphql/dist-web/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
7
node_modules/@octokit/graphql/node_modules/universal-user-agent/LICENSE.md
generated
vendored
7
node_modules/@octokit/graphql/node_modules/universal-user-agent/LICENSE.md
generated
vendored
|
|
@ -1,7 +0,0 @@
|
|||
# [ISC License](https://spdx.org/licenses/ISC)
|
||||
|
||||
Copyright (c) 2018, Gregor Martynus (https://github.com/gr2m)
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
25
node_modules/@octokit/graphql/node_modules/universal-user-agent/README.md
generated
vendored
25
node_modules/@octokit/graphql/node_modules/universal-user-agent/README.md
generated
vendored
|
|
@ -1,25 +0,0 @@
|
|||
# universal-user-agent
|
||||
|
||||
> Get a user agent string in both browser and node
|
||||
|
||||
[](https://www.npmjs.com/package/universal-user-agent)
|
||||
[](https://travis-ci.com/gr2m/universal-user-agent)
|
||||
[](https://greenkeeper.io/)
|
||||
|
||||
```js
|
||||
const { getUserAgent } = require("universal-user-agent");
|
||||
// or import { getUserAgent } from "universal-user-agent";
|
||||
|
||||
const userAgent = getUserAgent();
|
||||
// userAgent will look like this
|
||||
// in browser: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:61.0) Gecko/20100101 Firefox/61.0"
|
||||
// in node: Node.js/v8.9.4 (macOS High Sierra; x64)
|
||||
```
|
||||
|
||||
## Credits
|
||||
|
||||
The Node implementation was originally inspired by [default-user-agent](https://www.npmjs.com/package/default-user-agent).
|
||||
|
||||
## License
|
||||
|
||||
[ISC](LICENSE.md)
|
||||
22
node_modules/@octokit/graphql/node_modules/universal-user-agent/dist-node/index.js
generated
vendored
22
node_modules/@octokit/graphql/node_modules/universal-user-agent/dist-node/index.js
generated
vendored
|
|
@ -1,22 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
||||
|
||||
var osName = _interopDefault(require('os-name'));
|
||||
|
||||
function getUserAgent() {
|
||||
try {
|
||||
return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
|
||||
} catch (error) {
|
||||
if (/wmic os get Caption/.test(error.message)) {
|
||||
return "Windows <version undetectable>";
|
||||
}
|
||||
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
exports.getUserAgent = getUserAgent;
|
||||
//# sourceMappingURL=index.js.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"index.js","sources":["../dist-src/node.js"],"sourcesContent":["import osName from \"os-name\";\nexport function getUserAgent() {\n try {\n return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;\n }\n catch (error) {\n if (/wmic os get Caption/.test(error.message)) {\n return \"Windows <version undetectable>\";\n }\n throw error;\n }\n}\n"],"names":["getUserAgent","process","version","substr","osName","arch","error","test","message"],"mappings":";;;;;;;;AACO,SAASA,YAAT,GAAwB;MACvB;WACQ,WAAUC,OAAO,CAACC,OAAR,CAAgBC,MAAhB,CAAuB,CAAvB,CAA0B,KAAIC,MAAM,EAAG,KAAIH,OAAO,CAACI,IAAK,GAA1E;GADJ,CAGA,OAAOC,KAAP,EAAc;QACN,sBAAsBC,IAAtB,CAA2BD,KAAK,CAACE,OAAjC,CAAJ,EAA+C;aACpC,gCAAP;;;UAEEF,KAAN;;;;;;"}
|
||||
8
node_modules/@octokit/graphql/node_modules/universal-user-agent/dist-src/browser.js
generated
vendored
8
node_modules/@octokit/graphql/node_modules/universal-user-agent/dist-src/browser.js
generated
vendored
|
|
@ -1,8 +0,0 @@
|
|||
export function getUserAgent() {
|
||||
try {
|
||||
return navigator.userAgent;
|
||||
}
|
||||
catch (e) {
|
||||
return "<environment unknown>";
|
||||
}
|
||||
}
|
||||
1
node_modules/@octokit/graphql/node_modules/universal-user-agent/dist-src/index.js
generated
vendored
1
node_modules/@octokit/graphql/node_modules/universal-user-agent/dist-src/index.js
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
export { getUserAgent } from "./node";
|
||||
12
node_modules/@octokit/graphql/node_modules/universal-user-agent/dist-src/node.js
generated
vendored
12
node_modules/@octokit/graphql/node_modules/universal-user-agent/dist-src/node.js
generated
vendored
|
|
@ -1,12 +0,0 @@
|
|||
import osName from "os-name";
|
||||
export function getUserAgent() {
|
||||
try {
|
||||
return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
|
||||
}
|
||||
catch (error) {
|
||||
if (/wmic os get Caption/.test(error.message)) {
|
||||
return "Windows <version undetectable>";
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
export declare function getUserAgent(): string;
|
||||
|
|
@ -1 +0,0 @@
|
|||
export { getUserAgent } from "./node";
|
||||
1
node_modules/@octokit/graphql/node_modules/universal-user-agent/dist-types/node.d.ts
generated
vendored
1
node_modules/@octokit/graphql/node_modules/universal-user-agent/dist-types/node.d.ts
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
export declare function getUserAgent(): string;
|
||||
11
node_modules/@octokit/graphql/node_modules/universal-user-agent/dist-web/index.js
generated
vendored
11
node_modules/@octokit/graphql/node_modules/universal-user-agent/dist-web/index.js
generated
vendored
|
|
@ -1,11 +0,0 @@
|
|||
function getUserAgent() {
|
||||
try {
|
||||
return navigator.userAgent;
|
||||
}
|
||||
catch (e) {
|
||||
return "<environment unknown>";
|
||||
}
|
||||
}
|
||||
|
||||
export { getUserAgent };
|
||||
//# sourceMappingURL=index.js.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"index.js","sources":["../dist-src/browser.js"],"sourcesContent":["export function getUserAgent() {\n try {\n return navigator.userAgent;\n }\n catch (e) {\n return \"<environment unknown>\";\n }\n}\n"],"names":[],"mappings":"AAAO,SAAS,YAAY,GAAG;IAC3B,IAAI;QACA,OAAO,SAAS,CAAC,SAAS,CAAC;KAC9B;IACD,OAAO,CAAC,EAAE;QACN,OAAO,uBAAuB,CAAC;KAClC;CACJ;;;;"}
|
||||
33
node_modules/@octokit/graphql/node_modules/universal-user-agent/package.json
generated
vendored
33
node_modules/@octokit/graphql/node_modules/universal-user-agent/package.json
generated
vendored
|
|
@ -1,33 +0,0 @@
|
|||
{
|
||||
"name": "universal-user-agent",
|
||||
"description": "Get a user agent string in both browser and node",
|
||||
"version": "4.0.1",
|
||||
"license": "ISC",
|
||||
"files": [
|
||||
"dist-*/",
|
||||
"bin/"
|
||||
],
|
||||
"pika": true,
|
||||
"sideEffects": false,
|
||||
"keywords": [],
|
||||
"repository": "https://github.com/gr2m/universal-user-agent.git",
|
||||
"dependencies": {
|
||||
"os-name": "^3.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gr2m/pika-plugin-build-web": "^0.6.0-issue-84.1",
|
||||
"@pika/pack": "^0.5.0",
|
||||
"@pika/plugin-build-node": "^0.9.1",
|
||||
"@pika/plugin-ts-standard-pkg": "^0.9.1",
|
||||
"@types/jest": "^25.1.0",
|
||||
"jest": "^24.9.0",
|
||||
"prettier": "^1.18.2",
|
||||
"semantic-release": "^17.0.0",
|
||||
"ts-jest": "^25.1.0",
|
||||
"typescript": "^3.6.2"
|
||||
},
|
||||
"source": "dist-src/index.js",
|
||||
"types": "dist-types/index.d.ts",
|
||||
"main": "dist-node/index.js",
|
||||
"module": "dist-web/index.js"
|
||||
}
|
||||
28
node_modules/@octokit/graphql/package.json
generated
vendored
28
node_modules/@octokit/graphql/package.json
generated
vendored
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@octokit/graphql",
|
||||
"description": "GitHub GraphQL API client for browsers and Node",
|
||||
"version": "4.3.1",
|
||||
"version": "4.5.6",
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"dist-*/",
|
||||
|
|
@ -25,23 +25,23 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@octokit/request": "^5.3.0",
|
||||
"@octokit/types": "^2.0.0",
|
||||
"universal-user-agent": "^4.0.0"
|
||||
"@octokit/types": "^5.0.0",
|
||||
"universal-user-agent": "^6.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@pika/pack": "^0.5.0",
|
||||
"@pika/plugin-build-node": "^0.7.0",
|
||||
"@pika/plugin-build-web": "^0.7.0",
|
||||
"@pika/plugin-ts-standard-pkg": "^0.7.0",
|
||||
"@pika/plugin-build-node": "^0.9.0",
|
||||
"@pika/plugin-build-web": "^0.9.0",
|
||||
"@pika/plugin-ts-standard-pkg": "^0.9.0",
|
||||
"@types/fetch-mock": "^7.2.5",
|
||||
"@types/jest": "^24.0.13",
|
||||
"@types/node": "^12.0.2",
|
||||
"fetch-mock": "^7.3.1",
|
||||
"jest": "^24.8.0",
|
||||
"prettier": "^1.17.1",
|
||||
"semantic-release": "^15.13.3",
|
||||
"@types/jest": "^26.0.0",
|
||||
"@types/node": "^14.0.4",
|
||||
"fetch-mock": "^9.0.0",
|
||||
"jest": "^25.1.0",
|
||||
"prettier": "^2.0.0",
|
||||
"semantic-release": "^17.0.0",
|
||||
"semantic-release-plugin-update-version-in-files": "^1.0.0",
|
||||
"ts-jest": "^24.0.2",
|
||||
"ts-jest": "^25.1.0",
|
||||
"typescript": "^3.4.5"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
|
@ -50,5 +50,5 @@
|
|||
"source": "dist-src/index.js",
|
||||
"types": "dist-types/index.d.ts",
|
||||
"main": "dist-node/index.js",
|
||||
"deno": "dist-web/index.js"
|
||||
"module": "dist-web/index.js"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue