How to use the @octokit/request.request.endpoint function in @octokit/request

To help you get started, we’ve selected a few @octokit/request examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github newrelic / newrelic-ruby-agent / .github / actions / build-ruby / node_modules / @octokit / core / dist-src / index.js View on Github external
constructor(options = {}) {
        const hook = new Collection();
        const requestDefaults = {
            baseUrl: request.endpoint.DEFAULTS.baseUrl,
            headers: {},
            request: Object.assign({}, options.request, {
                hook: hook.bind(null, "request"),
            }),
            mediaType: {
                previews: [],
                format: "",
            },
        };
        // prepend default user agent with `options.userAgent` if set
        requestDefaults.headers["user-agent"] = [
            options.userAgent,
            `octokit-core.js/${VERSION} ${getUserAgent()}`,
        ]
            .filter(Boolean)
            .join(" ");
github newrelic / newrelic-ruby-agent / .github / actions / build-ruby / node_modules / @octokit / core / dist-web / index.js View on Github external
constructor(options = {}) {
        const hook = new Collection();
        const requestDefaults = {
            baseUrl: request.endpoint.DEFAULTS.baseUrl,
            headers: {},
            request: Object.assign({}, options.request, {
                hook: hook.bind(null, "request"),
            }),
            mediaType: {
                previews: [],
                format: "",
            },
        };
        // prepend default user agent with `options.userAgent` if set
        requestDefaults.headers["user-agent"] = [
            options.userAgent,
            `octokit-core.js/${VERSION} ${getUserAgent()}`,
        ]
            .filter(Boolean)
            .join(" ");
github newrelic / newrelic-ruby-agent / .github / actions / build-ruby / node_modules / @octokit / graphql / dist-web / index.js View on Github external
function withDefaults(request$1, newDefaults) {
    const newRequest = request$1.defaults(newDefaults);
    const newApi = (query, options) => {
        return graphql(newRequest, query, options);
    };
    return Object.assign(newApi, {
        defaults: withDefaults.bind(null, newRequest),
        endpoint: request.endpoint,
    });
}
github Azure / dev-spaces / actions / add-review-url / node_modules / @octokit / graphql / dist-src / with-defaults.js View on Github external
export function withDefaults(request, newDefaults) {
    const newRequest = request.defaults(newDefaults);
    const newApi = (query, options) => {
        return graphql(newRequest, query, options);
    };
    return Object.assign(newApi, {
        defaults: withDefaults.bind(null, newRequest),
        endpoint: Request.endpoint
    });
}
github Azure / dev-spaces / actions / add-review-url / node_modules / @octokit / graphql / dist-web / index.js View on Github external
function withDefaults(request$1, newDefaults) {
    const newRequest = request$1.defaults(newDefaults);
    const newApi = (query, options) => {
        return graphql(newRequest, query, options);
    };
    return Object.assign(newApi, {
        defaults: withDefaults.bind(null, newRequest),
        endpoint: request.endpoint
    });
}
github octokit / graphql.js / src / with-defaults.ts View on Github external
export function withDefaults(
  request: typeof Request,
  newDefaults: Parameters
): ApiInterface {
  const newRequest = request.defaults(newDefaults);
  const newApi = (query: Query | Parameters, options?: Parameters) => {
    return graphql(newRequest, query, options);
  };

  return Object.assign(newApi, {
    defaults: withDefaults.bind(null, newRequest),
    endpoint: Request.endpoint
  });
}

@octokit/request

Send parameterized requests to GitHub's APIs with sensible defaults in browsers and Node

MIT
Latest version published 4 months ago

Package Health Score

92 / 100
Full package analysis