GithubHelp home page GithubHelp logo

octokit / plugin-paginate-rest.js Goto Github PK

View Code? Open in Web Editor NEW
45.0 9.0 20.0 7.15 MB

Octokit plugin to paginate REST API endpoint responses

License: MIT License

TypeScript 95.25% JavaScript 4.75%
octokit-js plugin rest-api hacktoberfest

plugin-paginate-rest.js's Introduction

plugin-paginate-rest.js

Octokit plugin to paginate REST API endpoint responses

@latest Build Status

Usage

Browsers

Load @octokit/plugin-paginate-rest and @octokit/core (or core-compatible module) directly from esm.sh

<script type="module">
  import { Octokit } from "https://esm.sh/@octokit/core";
  import {
    paginateRest,
    composePaginateRest,
  } from "https://esm.sh/@octokit/plugin-paginate-rest";
</script>
Node

Install with npm install @octokit/core @octokit/plugin-paginate-rest. Optionally replace @octokit/core with a core-compatible module

const { Octokit } = require("@octokit/core");
const {
  paginateRest,
  composePaginateRest,
} = require("@octokit/plugin-paginate-rest");
const MyOctokit = Octokit.plugin(paginateRest);
const octokit = new MyOctokit({ auth: "secret123" });

// See https://developer.github.com/v3/issues/#list-issues-for-a-repository
const issues = await octokit.paginate("GET /repos/{owner}/{repo}/issues", {
  owner: "octocat",
  repo: "hello-world",
  since: "2010-10-01",
  per_page: 100,
});

If you want to utilize the pagination methods in another plugin, use composePaginateRest.

function myPlugin(octokit, options) {
  return {
    allStars({owner, repo}) => {
      return composePaginateRest(
        octokit,
        "GET /repos/{owner}/{repo}/stargazers",
        {owner, repo }
      )
    }
  }
}

octokit.paginate()

The paginateRest plugin adds a new octokit.paginate() method which accepts the same parameters as octokit.request. Only "List ..." endpoints such as List issues for a repository are supporting pagination. Their response includes a Link header. For other endpoints, octokit.paginate() behaves the same as octokit.request().

The per_page parameter is usually defaulting to 30, and can be set to up to 100, which helps retrieving a big amount of data without hitting the rate limits too soon.

An optional mapFunction can be passed to map each page response to a new value, usually an array with only the data you need. This can help to reduce memory usage, as only the relevant data has to be kept in memory until the pagination is complete.

const issueTitles = await octokit.paginate(
  "GET /repos/{owner}/{repo}/issues",
  {
    owner: "octocat",
    repo: "hello-world",
    since: "2010-10-01",
    per_page: 100,
  },
  (response) => response.data.map((issue) => issue.title),
);

The mapFunction gets a 2nd argument done which can be called to end the pagination early.

const issues = await octokit.paginate(
  "GET /repos/{owner}/{repo}/issues",
  {
    owner: "octocat",
    repo: "hello-world",
    since: "2010-10-01",
    per_page: 100,
  },
  (response, done) => {
    if (response.data.find((issue) => issue.title.includes("something"))) {
      done();
    }
    return response.data;
  },
);

Alternatively you can pass a request method as first argument. This is great when using in combination with @octokit/plugin-rest-endpoint-methods:

const issues = await octokit.paginate(octokit.rest.issues.listForRepo, {
  owner: "octocat",
  repo: "hello-world",
  since: "2010-10-01",
  per_page: 100,
});

octokit.paginate.iterator()

If your target runtime environments supports async iterators (such as most modern browsers and Node 10+), you can iterate through each response

const parameters = {
  owner: "octocat",
  repo: "hello-world",
  since: "2010-10-01",
  per_page: 100,
};
for await (const response of octokit.paginate.iterator(
  "GET /repos/{owner}/{repo}/issues",
  parameters,
)) {
  // do whatever you want with each response, break out of the loop, etc.
  const issues = response.data;
  console.log("%d issues found", issues.length);
}

Alternatively you can pass a request method as first argument. This is great when using in combination with @octokit/plugin-rest-endpoint-methods:

const parameters = {
  owner: "octocat",
  repo: "hello-world",
  since: "2010-10-01",
  per_page: 100,
};
for await (const response of octokit.paginate.iterator(
  octokit.rest.issues.listForRepo,
  parameters,
)) {
  // do whatever you want with each response, break out of the loop, etc.
  const issues = response.data;
  console.log("%d issues found", issues.length);
}

composePaginateRest and composePaginateRest.iterator

The compose* methods work just like their octokit.* counterparts described above, with the differenct that both methods require an octokit instance to be passed as first argument

How it works

octokit.paginate() wraps octokit.request(). As long as a rel="next" link value is present in the response's Link header, it sends another request for that URL, and so on.

Most of GitHub's paginating REST API endpoints return an array, but there are a few exceptions which return an object with a key that includes the items array. For example:

octokit.paginate() is working around these inconsistencies so you don't have to worry about it.

If a response is lacking the Link header, octokit.paginate() still resolves with an array, even if the response returns a single object.

Types

The plugin also exposes some types and runtime type guards for TypeScript projects.

Types
import {
  PaginateInterface,
  PaginatingEndpoints,
} from "@octokit/plugin-paginate-rest";
Guards
import { isPaginatingEndpoint } from "@octokit/plugin-paginate-rest";

PaginateInterface

An interface that declares all the overloads of the .paginate method.

PaginatingEndpoints

An interface which describes all API endpoints supported by the plugin. Some overloads of .paginate() method and composePaginateRest() function depend on PaginatingEndpoints, using the keyof PaginatingEndpoints as a type for one of its arguments.

import { Octokit } from "@octokit/core";
import {
  PaginatingEndpoints,
  composePaginateRest,
} from "@octokit/plugin-paginate-rest";

type DataType<T> = "data" extends keyof T ? T["data"] : unknown;

async function myPaginatePlugin<E extends keyof PaginatingEndpoints>(
  octokit: Octokit,
  endpoint: E,
  parameters?: PaginatingEndpoints[E]["parameters"],
): Promise<DataType<PaginatingEndpoints[E]["response"]>> {
  return await composePaginateRest(octokit, endpoint, parameters);
}

isPaginatingEndpoint

A type guard, isPaginatingEndpoint(arg) returns true if arg is one of the keys in PaginatingEndpoints (is keyof PaginatingEndpoints).

import { Octokit } from "@octokit/core";
import {
  isPaginatingEndpoint,
  composePaginateRest,
} from "@octokit/plugin-paginate-rest";

async function myPlugin(octokit: Octokit, arg: unknown) {
  if (isPaginatingEndpoint(arg)) {
    return await composePaginateRest(octokit, arg);
  }
  // ...
}

Contributing

See CONTRIBUTING.md

License

MIT

plugin-paginate-rest.js's People

Contributors

dependabot[bot] avatar github-actions[bot] avatar gr2m avatar greenkeeper[bot] avatar jhutchings1 avatar kfcampbell avatar nickfloyd avatar octokitbot avatar oscard0m avatar ptomulik avatar renovate[bot] avatar timocov avatar timrogers avatar wolfy1339 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

plugin-paginate-rest.js's Issues

[BUG]: Normalizing paginated response

What happened?

Using the provided iterator function for the octokit.rest.repos.getAllEnvironments endpoint results in a normalized response where the environments key under response.data is replaced by the environments keyed by their index. This causes the response object to no longer match the response type.

I expected the response to not need normalization and simply return just like the typehinting was telling me.

Versions

Octokit/rest v20.0.1, Deno v1.36.4

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

The automated release is failing 🚨

🚨 The automated release from the 2.x branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you can benefit from your bug fixes and new features again.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can fix this πŸ’ͺ.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the 2.x branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here are some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


The release 3.0.0 on branch 2.x cannot be published as it is out of range.

Only releases within the range >=2.0.0 <3.0.0 can be merged into the maintenance branch 2.x and published to the 2.x distribution channel.

The branch 2.x head should be reset to a previous commit so the commit with tag v3.0.0 is removed from the branch history.

See the workflow configuration documentation for more details.


Good luck with your project ✨

Your semantic-release bot πŸ“¦πŸš€

Support passing in a REST endpoint method as first argument

When using with @octokit/rest, the recommended way is to do the following

const options = octokit.issues.listForRepo.endpoint.merge({
  owner: "octokit",
  repo: "rest.js"
});

const issues = await octokit.paginate(options)

To simplify that, octokit.paginate should accept an endpoint method as first argument:

const issues = await octokit.paginate(octokit.issues.listForRepo, {
  owner: "octokit",
  repo: "rest.js"
})

Writing tests for a custom function using octokit.paginate

Hi there! This is not to report an issue with the plugin itself, but to get some guidance about how to write some tests for a function using octokit.paginate.

I basically have a React hook based on React Query which is wrapping a call to octokit.paginate. The idea is to fetch the first 1k releases to allow the user to filter them in Octoclairvoyant.

The functionality is working fine in the actual app, but I'm trying to write some tests with Jest + React Hooks Testing Library and I can't figure out how to keep paginating the hook.

This is the PR where you can see a test failing, expecting 1k releases fetched but got just 100 (first page of releases): octoclairvoyant/octoclairvoyant-webapp#767

It seems I need to trigger the next tick for octokit.paginate iterator, but I don't know how. I've used both octokit.paginate and octokit.paginate.iterator but both fail in the same way. I've tried to use Jest's fake timers but I can't run it to the next tick. I've tried to wait for different booleans from React Query, but after fetching the first page it's always finished.

Any clue where the problem could be located? Thanks in advance!

An in-range update of @types/node is breaking the build 🚨

The devDependency @types/node was updated from 13.7.0 to 13.7.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@types/node is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ test (12): There are 1 failures, 0 warnings, and 0 notices.
  • ❌ test (10): There are 2 failures, 0 warnings, and 0 notices.
  • ❌ test (8): There are 2 failures, 0 warnings, and 0 notices.

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

GET /projects/columns/:column_id/cards TypeScript overload error

What happened?

When trying to use the GET /projects/columns/:column_id/cards endpoint I am getting the following error:

No overload matches this call.
  The last overload gave the following error.
    Argument of type '"GET /projects/columns/:column_id/cards"' is not assignable to parameter of type 'RequestInterface<object>'.

Example code:

import { Octokit } from '@octokit/rest';

const octokit = new Octokit({
  auth: process.env.GITHUB_API_TOKEN,
  previews: ['inertia-preview'],
});

octokit.paginate('GET /projects/columns/:column_id/cards', {
  column_id: process.env.GITHUB_PROJECT_COLUMN_ID,
}).then((cards) => {
  console.log(cards);
});

What did you expect to happen?

I wasn't expecting any errors! Running without TypeScript succeeds (I did attempt using RunKit but can't get this working for TypeScript errors, it just runs successfully with JS only).

Interestingly, if I changes the path id, e.g.

octokit.paginate('GET /projects/columns/:column/cards', {
  column: process.env.GITHUB_PROJECT_COLUMN_ID,
}).then((cards) => {
  console.log(cards);
});

It will work, but then it loses the types on the end result, becoming unknown[].

What the problem might be

Whilst I am comfortable using TypeScript, I'm a way off being an expert! I've spent some time looking through the generated types and can't see anything obvious as to why this would be a problem.

Simply passing any object for parameters is enough to trigger this error, even if the object is empty. Running without parameters won't trigger any TypeScript errors - but will respond with a "Not Found" response (obviously).

Routes such as GET /projects/columns/:column_id work correctly, it only seems to be when accessing /cards that the overload error is presented.

"GET /repos/{owner}/{repo}/commits/{ref}" can paginate the "files" property

See https://docs.github.com/en/rest/reference/repos#get-a-commit

If there are more than 300 files in the commit diff, the response will include pagination link headers for the remaining files, up to a limit of 3000 files. Each page contains the static commit information, and the only changes are to the file listing.

It's an odd case. Only the "files" key array will be paginated, but unlike the other endpoints that paginate that return an object instead of an array, this one will include lots of other keys. I'm not sure if that case is covered by https://github.com/octokit/plugin-paginate-rest.js/blob/92ed1aab99fe8045fe2c23b21308390471d0c8f5/src/normalize-paginated-list-response.ts

If someone would like to give this a go, I'd be happy to advice. Comment below if you have any questions. The first step would be to add a test to https://github.com/octokit/plugin-paginate-rest.js/blob/master/test/paginate.test.ts, then start a pull request. We can continue the discussion there

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on Greenkeeper branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet.
We recommend using:

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please click the 'fix repo' button on account.greenkeeper.io.

PaginateInterface & ComposePaginateInterface - code duplication issue

I've seen this comment and I came across the following idea.

interface Overloads {
    0: (t1: number) => number;
    1: (t1: number, t2: number) => number;
}

interface Generate<Prepend extends []|[string]> {
    (...args: [...Prepend, ...Parameters<Overloads[0]>]): ReturnType<Overloads[0]>;
    (...args: [...Prepend, ...Parameters<Overloads[1]>]): ReturnType<Overloads[1]>;
}

type Normal = Generate<[]>; // Generate Overloads
type Prepended = Generate<[string]>; // Generate Overloads with leading argument of type string

const normal: Normal = (t1: number, t2?: number) => {
    return t1 + (t2 === undefined ? 0 : t2);
}

const prepended: Prepended = (s: string, t1: number, t2?: number) => {
    console.log(s);
    return t1 + (t2 === undefined ? 0 : t2);
}

console.log(normal(1));
console.log(normal(1, 2));
console.log(prepended("one", 1));
console.log(prepended("two plus three", 2, 3));

Technically this approach could do the job, but there are three problems - argument names get lost, doc-strings get lost and the final interfaces/types become completely unreadable :).

Using paginate with the retry plugin

Can the retry plugin be used for calls that are being used with the paginate plugin?

I'm trying to workaround an issue where GitHub App installation tokens occasionally don't work if used too quickly after they've been created, and GitHub have suggested retrying requests after a short time (error returned by the GitHub API is 401 Bad Authentication). Trying to make use of the retry plugin along with the paginate plugin and it looks like the paginate plugin ignores any settings from the retry plugin when either specified as part of the call to paginate, or when setup on the octokit object.

Tested this by using a bad API url as the 401 error is sporadic so hard to test.

Log output when trying to use the paginate plugin:

  sdlc:github:info Wed Apr 29 2020 11:19:33 GMT+0100 (British Summer Time), Before Hook +0ms
  sdlc:github Wed Apr 29 2020 11:19:33 GMT+0100 (British Summer Time), Error Hook +0ms
  sdlc:github URL: https://api.github.com/orgs/octokit/credential-authorizations2?per_page=100, Status: 404 +1ms
  sdlc:github RateLimit: 5000, RateLimitRemaining: 4982 +0ms

Log output when trying to use a normal request:

  sdlc:github:info Wed Apr 29 2020 11:19:56 GMT+0100 (British Summer Time), Before Hook +0ms
  sdlc:github Wed Apr 29 2020 11:20:23 GMT+0100 (British Summer Time), Error Hook +0ms
  sdlc:github URL: https://api.github.com/orgs/octokit/credential-authorizations2?per_page=100, Status: 404 +0ms
  sdlc:github RateLimit: 5000, RateLimitRemaining: 4976 +0ms

This is with a retries of 5 and a retryAfter of 5 to make it obvious that retries are happening. The paginate call errors out immediately, the request call errors out over 25 seconds after the before hook is called. So it looks to me like paginate isn't honouring the retry plugin whereas request is?

I've tried to get this running in runkit, https://runkit.com/steve-norman-rft/5ea944308e20c1001ad95df5, but for some reason the paginate plugin is causing an error when it is included:

image

The error is generated from line 14 of the notebook. If I just use the retry plugin the first test completes as expected with the retries, the second fails as paginate doesn't exist.

Help with Pagination Types for listReposAccessibleToInstallation

@gr2m, first off, thank you for all the work you do with Octokit. It's really incredible.

I'm relatively new to TypeScript and I'm having some issues with the pagination types. I'm trying to use a try/catch statement to provide some error handling with my octokit call, but I want to preserve the type information with my let declaration. I'm getting the TypeScript error shown in the dropdown below. Do you know what I'm doing wrong here?

TypeScript Error
Type 'AppsListReposAccessibleToInstallationResponseData & { id: number; node_id: string; name: string; full_name: string; owner: { login: string; ... 16 more ...; site_admin: boolean; }; ... 74 more ...; network_count: number; }[]' is not assignable to type '{ id: number; node_id: string; name: string; full_name: string; license: { key: string; name: string; url: string | null; spdx_id: string | null; node_id: string; html_url?: string | undefined; } | null; ... 81 more ...; starred_at?: string | undefined; }[] | undefined'.
  Type 'AppsListReposAccessibleToInstallationResponseData & { id: number; node_id: string; name: string; full_name: string; owner: { login: string; ... 16 more ...; site_admin: boolean; }; ... 74 more ...; network_count: number; }[]' is not assignable to type '{ id: number; node_id: string; name: string; full_name: string; license: { key: string; name: string; url: string | null; spdx_id: string | null; node_id: string; html_url?: string | undefined; } | null; ... 81 more ...; starred_at?: string | undefined; }[]'.
    The types returned by 'pop()' are incompatible between these types.
      Type '{ id: number; node_id: string; name: string; full_name: string; owner: { login: string; id: number; node_id: string; avatar_url: string; gravatar_id: string; url: string; html_url: string; followers_url: string; ... 9 more ...; site_admin: boolean; }; ... 74 more ...; network_count: number; } | undefined' is not assignable to type '{ id: number; node_id: string; name: string; full_name: string; license: { key: string; name: string; url: string | null; spdx_id: string | null; node_id: string; html_url?: string | undefined; } | null; ... 81 more ...; starred_at?: string | undefined; } | undefined'.
        Type '{ id: number; node_id: string; name: string; full_name: string; owner: { login: string; id: number; node_id: string; avatar_url: string; gravatar_id: string; url: string; html_url: string; followers_url: string; ... 9 more ...; site_admin: boolean; }; ... 74 more ...; network_count: number; }' is missing the following properties from type '{ id: number; node_id: string; name: string; full_name: string; license: { key: string; name: string; url: string | null; spdx_id: string | null; node_id: string; html_url?: string | undefined; } | null; ... 81 more ...; starred_at?: string | undefined; }': license, forks, open_issues, watchers

Example Screenshot:

image

Example Text:

import { Octokit } from "@octokit/rest";
import { Endpoints } from "@octokit/types";

const client = new Octokit();

(async () => {
  let repositories: Endpoints["GET /installation/repositories"]["response"]["data"]["repositories"];

  try {
    repositories = await client.paginate(
      client.apps.listReposAccessibleToInstallation
    );
  } catch (error) {
    // error handling
  }

  // Iterate over repos
  for (let i = 0; i < repositories.length; i++) {
    //
  }
})();

204 responses are not handled correctly

GET /repos/{owner}/{repo}/contributors returns 204 No Content when the repository is empty, i.e. with no commits. Trying to use paginate results in error

TypeError: Cannot use 'in' operator to search for 'total_count' in undefined

Fun stuff: GET /repos/{owner}/{repo}/commits returns 409 Conflict which kinda matches the documentation here: https://developer.github.com/v3/git/

Maybe provide a workaround to this?

[BUG]: @octokit/[email protected] incompatible with @octokit/[email protected]

What happened?

When upgrading to the latest version of @octokit/types, typescript throws compilation errors.

Versions

@octokit/[email protected] incompatible with @octokit/[email protected]

Relevant log output

node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/generated/parameters-and-response-types.d.ts:848:33 - error TS2339: Property 'PUT /organizations/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}' does not exist on type 'Endpoints'.

848             response: Endpoints["PUT /organizations/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"]["response"];
                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/generated/parameters-and-response-types.d.ts:859:60 - error TS2339: Property 'PUT /organizations/{org}/codespaces/secrets/{secret_name}' does not exist on type 'Endpoints'.

859             parameters: RequestParameters & Omit<Endpoints["PUT /organizations/{org}/codespaces/secrets/{secret_name}"]["parameters"], "baseUrl" | "headers" | "mediaType">;
                             

Code of Conduct

  • I agree to follow this project's Code of Conduct

An in-range update of semantic-release is breaking the build 🚨

The devDependency semantic-release was updated from 17.0.2 to 17.0.3.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

semantic-release is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ test (12): There are 1 failures, 0 warnings, and 0 notices.
  • ❌ test (10): There are 2 failures, 0 warnings, and 0 notices.
  • ❌ test (8): There are 2 failures, 0 warnings, and 0 notices.

Release Notes for v17.0.3

17.0.3 (2020-02-13)

Bug Fixes

  • pass a branch name to getGitAuthUrl (e7bede1)
Commits

The new version differs by 6 commits.

  • e7bede1 fix: pass a branch name to getGitAuthUrl
  • 8426b42 chore(package): update tempy to version 0.4.0
  • 804fc2a docs(Troubleshooting): release not found in prereleases branch (e.g. beta) after rebase on master) (#1444)
  • 389e331 chore(package): update got to version 10.5.2
  • a93c96f revert: fix: allow plugins to set environment variables to be used by other plugins
  • 68f7e92 fix: allow plugins to set environment variables to be used by other plugins

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

[BUG]: TypeScript compilation errors due to `@octokit/types` v9.1.2

What happened?

When upgrading to the latest version of @octokit/types, typescript throws compilation errors.

Versions

@octokit/[email protected] (due to openapi-types.ts v17 released 3 days ago presumably) incompatible with @octokit/[email protected]

Relevant log output

node_modules/@octokit/plugin-paginate-rest/dist-types/generated/paginating-endpoints.d.ts:21:31 - error TS2339: Property 'GET /enterprises/{enterprise}/actions/runner-groups' does not exist on type 'Endpoints'.

21         parameters: Endpoints["GET /enterprises/{enterprise}/actions/runner-groups"]["parameters"];
                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@octokit/plugin-paginate-rest/dist-types/generated/paginating-endpoints.d.ts:22:29 - error TS2339: Property 'GET /enterprises/{enterprise}/actions/runner-groups' does not exist on type 'Endpoints'.

22         response: Endpoints["GET /enterprises/{enterprise}/actions/runner-groups"]["response"] & {
                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@octokit/plugin-paginate-rest/dist-types/generated/paginating-endpoints.d.ts:23:29 - error TS2339: Property 'GET /enterprises/{enterprise}/actions/runner-groups' does not exist on type 'Endpoints'.

23             data: Endpoints["GET /enterprises/{enterprise}/actions/runner-groups"]["response"]["data"]["runner_groups"];
                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@octokit/plugin-paginate-rest/dist-types/generated/paginating-endpoints.d.ts:192:31 - error TS2339: Property 'GET /orgs/{org}/actions/runner-groups' does not exist on type 'Endpoints'.

192         parameters: Endpoints["GET /orgs/{org}/actions/runner-groups"]["parameters"];
                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@octokit/plugin-paginate-rest/dist-types/generated/paginating-endpoints.d.ts:193:29 - error TS2339: Property 'GET /orgs/{org}/actions/runner-groups' does not exist on type 'Endpoints'.

193         response: Endpoints["GET /orgs/{org}/actions/runner-groups"]["response"] & {
                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@octokit/plugin-paginate-rest/dist-types/generated/paginating-endpoints.d.ts:194:29 - error TS2339: Property 'GET /orgs/{org}/actions/runner-groups' does not exist on type 'Endpoints'.

194             data: Endpoints["GET /orgs/{org}/actions/runner-groups"]["response"]["data"]["runner_groups"];
                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@octokit/plugin-paginate-rest/dist-types/generated/paginating-endpoints.d.ts:201:31 - error TS2339: Property 'GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories' does not exist on type 'Endpoints'.

201         parameters: Endpoints["GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories"]["parameters"];
                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@octokit/plugin-paginate-rest/dist-types/generated/paginating-endpoints.d.ts:202:29 - error TS2339: Property 'GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories' does not exist on type 'Endpoints'.

202         response: Endpoints["GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories"]["response"] & {
                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@octokit/plugin-paginate-rest/dist-types/generated/paginating-endpoints.d.ts:203:29 - error TS2339: Property 'GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories' does not exist on type 'Endpoints'.

203             data: Endpoints["GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories"]["response"]["data"]["repositories"];
                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@octokit/plugin-paginate-rest/dist-types/generated/paginating-endpoints.d.ts:210:31 - error TS2339: Property 'GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners' does not exist on type 'Endpoints'.

210         parameters: Endpoints["GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners"]["parameters"];
                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@octokit/plugin-paginate-rest/dist-types/generated/paginating-endpoints.d.ts:211:29 - error TS2339: Property 'GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners' does not exist on type 'Endpoints'.

211         response: Endpoints["GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners"]["response"] & {
                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@octokit/plugin-paginate-rest/dist-types/generated/paginating-endpoints.d.ts:212:29 - error TS2339: Property 'GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners' does not exist on type 'Endpoints'.

212             data: Endpoints["GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners"]["response"]["data"]["runners"];
                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/generated/parameters-and-response-types.d.ts:1223:60 - error TS2339: Property 'POST /enterprises/{enterprise}/actions/runners/{runner_id}/labels' does not exist on type 'Endpoints'.

1223             parameters: RequestParameters & Omit<Endpoints["POST /enterprises/{enterprise}/actions/runners/{runner_id}/labels"]["parameters"], "baseUrl" | "headers" | "mediaType">;
                                                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/generated/parameters-and-response-types.d.ts:1224:33 - error TS2339: Property 'POST /enterprises/{enterprise}/actions/runners/{runner_id}/labels' does not exist on type 'Endpoints'.

1224             response: Endpoints["POST /enterprises/{enterprise}/actions/runners/{runner_id}/labels"]["response"];
                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/generated/parameters-and-response-types.d.ts:1227:60 - error TS2339: Property 'PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id}' does not exist on type 'Endpoints'.

1227             parameters: RequestParameters & Omit<Endpoints["PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id}"]["parameters"], "baseUrl" | "headers" | "mediaType">;
                                                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/generated/parameters-and-response-types.d.ts:1228:33 - error TS2339: Property 'PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id}' does not exist on type 'Endpoints'.

1228             response: Endpoints["PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id}"]["response"];
                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/generated/parameters-and-response-types.d.ts:1231:60 - error TS2339: Property 'GET /enterprises/{enterprise}/actions/runners/{runner_id}/labels' does not exist on type 'Endpoints'.

1231             parameters: RequestParameters & Omit<Endpoints["GET /enterprises/{enterprise}/actions/runners/{runner_id}/labels"]["parameters"], "baseUrl" | "headers" | "mediaType">;
                                                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/generated/parameters-and-response-types.d.ts:1232:33 - error TS2339: Property 'GET /enterprises/{enterprise}/actions/runners/{runner_id}/labels' does not exist on type 'Endpoints'.

1232             response: Endpoints["GET /enterprises/{enterprise}/actions/runners/{runner_id}/labels"]["response"];
                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/generated/parameters-and-response-types.d.ts:3067:60 - error TS2339: Property 'GET /enterprises/{enterprise}/code_security_and_analysis' does not exist on type 'Endpoints'.

3067             parameters: RequestParameters & Omit<Endpoints["GET /enterprises/{enterprise}/code_security_and_analysis"]["parameters"], "baseUrl" | "headers" | "mediaType">;
                                                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/generated/parameters-and-response-types.d.ts:3068:33 - error TS2339: Property 'GET /enterprises/{enterprise}/code_security_and_analysis' does not exist on type 'Endpoints'.

3068             response: Endpoints["GET /enterprises/{enterprise}/code_security_and_analysis"]["response"];
                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/generated/parameters-and-response-types.d.ts:3087:60 - error TS2339: Property 'PATCH /enterprises/{enterprise}/code_security_and_analysis' does not exist on type 'Endpoints'.

3087             parameters: RequestParameters & Omit<Endpoints["PATCH /enterprises/{enterprise}/code_security_and_analysis"]["parameters"], "baseUrl" | "headers" | "mediaType">;
                                                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/generated/parameters-and-response-types.d.ts:3088:33 - error TS2339: Property 'PATCH /enterprises/{enterprise}/code_security_and_analysis' does not exist on type 'Endpoints'.

3088             response: Endpoints["PATCH /enterprises/{enterprise}/code_security_and_analysis"]["response"];
                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/generated/parameters-and-response-types.d.ts:3091:60 - error TS2339: Property 'POST /enterprises/{enterprise}/{security_product}/{enablement}' does not exist on type 'Endpoints'.

3091             parameters: RequestParameters & Omit<Endpoints["POST /enterprises/{enterprise}/{security_product}/{enablement}"]["parameters"], "baseUrl" | "headers" | "mediaType">;
                                                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/generated/parameters-and-response-types.d.ts:3092:33 - error TS2339: Property 'POST /enterprises/{enterprise}/{security_product}/{enablement}' does not exist on type 'Endpoints'.

3092             response: Endpoints["POST /enterprises/{enterprise}/{security_product}/{enablement}"]["response"];
                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Code of Conduct

  • I agree to follow this project's Code of Conduct

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this πŸ’ͺ.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Cannot push to the Git repository.

semantic-release cannot push the version tag to the branch master on the remote Git repository with URL https://x-access-token:[secure]@github.com/octokit/plugin-paginate-rest.js.

This can be caused by:


Good luck with your project ✨

Your semantic-release bot πŸ“¦πŸš€

[yarn 2] Cannot find module '@octokit/core' or its corresponding type declarations

While consuming this package in yarn v2, I got a compile break because this package consumes @octokit/core at runtime:

import { Octokit } from "@octokit/core";

Yet is package.json file claims that this dependency is not needed in production:

"dependencies": {
"@octokit/types": "^5.2.0"
},
"devDependencies": {
"@octokit/core": "^3.0.0",

Yarn's PnP mode catches this error, and I have to workaround it by putting it into loose mode.

Dependency Dashboard

This issue contains a list of Renovate updates and their statuses.

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to ignore the schedule.

  • fix(deps): lock file maintenance

  • Check this box to trigger a request for Renovate to run again on this repository

Cannot find module '@octokit/core'

Hi,

I'm using Yarn 2 with TypeScript, and, when using @octokit/rest, I'm getting a tsc error:

Screen Shot 2020-04-13 at 9 01 23 PM

It looks like @octokit/core should be a dependency instead of devDependency. I fixed it on my end by using packageExtensions(via yarnpkg/berry#893), but it's a workaround:

packageExtensions:
  "@octokit/plugin-paginate-rest@*":
    dependencies:
      "@octokit/core": "^v2.0.0"

I'm not using plugin-paginate-rest directly, but rather as a dependency of "@octokit/rest": "^17.2.1"

An in-range update of fetch-mock is breaking the build 🚨


☝️ Important announcement: Greenkeeper will be saying goodbye πŸ‘‹ and passing the torch to Snyk on June 3rd, 2020! Find out how to migrate to Snyk and more at greenkeeper.io


The devDependency fetch-mock was updated from 9.3.0 to 9.3.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

fetch-mock is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ test (12): There are 2 failures, 0 warnings, and 0 notices.
  • ❌ test (10): There are 2 failures, 0 warnings, and 0 notices.
  • ❌ test (8): There are 1 failures, 0 warnings, and 0 notices.

Commits

The new version differs by 7 commits.

  • d22e983 linked to cheatsheet EVERYWHERE
  • 1d2557d Merge pull request #524 from wheresrhys/cheatsheet
  • 1dfc6c2 completed cheatsheet
  • 7efa6c5 cheatsheet formatting
  • 438c835 refined set up/teardown section of cheatsheet
  • 6a2d449 midway through writing cheatsheet content
  • 633cf3e improve documentation for when to use a named matcher

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

automated OpenAPI are currently failing

e.g. https://github.com/octokit/plugin-paginate-rest.js/runs/2396088102?check_suite_focus=true

RequestError [HttpError]: request to http://localhost:3000/api/graphql failed, reason: connect ECONNREFUSED 127.0.0.1:3000
    at /home/runner/work/plugin-paginate-rest.js/plugin-paginate-rest.js/node_modules/@octokit/request/dist-node/index.js:109:11
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async main (/home/runner/work/plugin-paginate-rest.js/plugin-paginate-rest.js/scripts/update-endpoints/fetch-json.js:35:27) {
  status: 500,
  headers: {},
  request: {
    method: 'POST',
    url: 'http://localhost:3000/api/graphql',
    headers: {
      accept: 'application/vnd.github.v3+json',
      'user-agent': 'octokit-graphql.js/4.6.1 Node.js/14.16.1 (linux; x64)',
      'content-type': 'application/json; charset=utf-8'
    },
    body: '{"query":"\\n  query($version: String) {\\n    endpoints(version: $version) {\\n      url\\n      id\\n      scope\\n      documentationUrl\\n      renamed {\\n        note\\n      }\\n      responses {\\n        code\\n        schema\\n      }\\n    }\\n  }\\n","variables":{"version":"2.16.2"}}'
  }
}

The GraphQL server fails on Vercel with

[ERROR] [1619021004881] LAMBDA_RUNTIME Failed to post handler success response. Http response code: 413

It's most likely an out-of-memory problem. The query includes response schemas which are huge now, probably too big for Vercel functions to return in a single respones. The scripts/update-endpoints/typescript.js looks into the response schema to see if the server responds with an array at the root, or with an object that includes an array key. This is necessary to normalize the responses for the pagination plugin.

To workaround this, we could implement this server side and export a new key that can be queried, that way we don't need to return the entire JSON schemas for all responses

Replace "cdn.pika.dev" with "cdn.skypack.dev" in README

πŸ†•πŸ₯☝ First Timers Only.

This issue is reserved for people who never contributed to Open Source before. We know that the process of creating a pull request is the biggest barrier for new contributors. This issue is for you πŸ’

About First Timers Only.

πŸ€” What you will need to know.

The Pika CDN is now Skypack, see https://www.pika.dev/cdn. The CDN at https://cdn.pika.dev/ no longer works, all URLs must be replaced with the new CDN: https://cdn.skypack.dev/. We currently recommend using cdn.pika.dev to import the library into the browser, but that no longer works. Replacing it with cdn.skypack.dev will make it work again.

πŸ“‹ Step by Step

  • πŸ™‹ Claim this issue: Comment below.

    More than one person can work on this issue, don't worry if it's already claimed.

  • πŸ“ Update the file \README.md (press the little pen Icon) and edit as shown below:

@@ -13,12 +13,12 @@
 Browsers
 </th><td width=100%>
 
-Load `@octokit/plugin-paginate-rest` and [`@octokit/core`](https://github.com/octokit/core.js) (or core-compatible module) directly from [cdn.pika.dev](https://cdn.pika.dev)
+Load `@octokit/plugin-paginate-rest` and [`@octokit/core`](https://github.com/octokit/core.js) (or core-compatible module) directly from [cdn.skypack.dev](https://cdn.skypack.dev)
 
 ```html
 <script type="module">
-  import { Octokit } from "https://cdn.pika.dev/@octokit/core";
-  import { paginateRest } from "https://cdn.pika.dev/@octokit/plugin-paginate-rest";
+  import { Octokit } from "https://cdn.skypack.dev/@octokit/core";
+  import { paginateRest } from "https://cdn.skypack.dev/@octokit/plugin-paginate-rest";
 </script>
 ```
 
  • πŸ’Ύ Commit your changes

  • πŸ”€ Start a Pull Request. There are two ways how you can start a pull request:

    1. If you are familiar with the terminal or would like to learn it, here is a great tutorial on how to send a pull request using the terminal.
    2. You can edit files directly in your browser
  • 🏁 Done Ask for a review :)

If there are more than one pull requests with the correct change, we will merge the first one, but attribute the change to all authors who made the same change using @Co-authored-by, so yo can be sure your contribution will count.

πŸ€”β“ Questions

Leave a comment below!

This issue was created by First-Timers-Bot.

An in-range update of prettier is breaking the build 🚨


☝️ Important announcement: Greenkeeper will be saying goodbye πŸ‘‹ and passing the torch to Snyk on June 3rd, 2020! Find out how to migrate to Snyk and more at greenkeeper.io


The devDependency prettier was updated from 2.0.2 to 2.0.3.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

prettier is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • βœ… update_prettier: There are 0 failures, 1 warnings, and 0 notices.
  • ❌ test (13): There are 1 failures, 0 warnings, and 0 notices.
  • ❌ test (12): There are 1 failures, 0 warnings, and 0 notices.
  • ❌ test (10): There are 2 failures, 0 warnings, and 0 notices.

Release Notes for 2.0.3

πŸ”— Changelog

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

peer dependency issues

Hi all, I recently went through some package updating in a project, and found that you have updated your ocktokit/core to v4 on v2.21.2 and then did a subsequent v3 that dropped the old node version support. Shouldn't that peer update have happened in your v3 release and not as a final patch release on v2?

I can probably work on my own updates to fix the npm install issue, but it is inconvenient.

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Location: package.json
Error type: The renovate configuration file contains some invalid settings
Message: Configuration option 'packageRules[0].npm' should be a json object, Invalid configuration option: @pika/pack, Invalid configuration option: jest, Invalid configuration option: keywords, Invalid configuration option: license, Invalid configuration option: name, Invalid configuration option: packageRules[0].@octokit/types, Invalid configuration option: packageRules[0].i, Invalid configuration option: packageRules[1].@octokit/core, Invalid configuration option: packageRules[2].@octokit/core, Invalid configuration option: packageRules[2].@octokit/plugin-rest-endpoint-methods, Invalid configuration option: packageRules[2].@pika/pack, Invalid configuration option: packageRules[2].@pika/plugin-build-node, Invalid configuration option: packageRules[2].@pika/plugin-build-web, Invalid configuration option: packageRules[2].@pika/plugin-ts-standard-pkg, Invalid configuration option: packageRules[2].@types/fetch-mock, Invalid configuration option: packageRules[2].@types/jest, Invalid configuration option: packageRules[2].@types/node, Invalid configuration option: packageRules[2].fetch-mock, Invalid configuration option: packageRules[2].jest, Invalid configuration option: packageRules[2].npm-run-all, Invalid configuration option: packageRules[2].prettier, Invalid configuration option: packageRules[2].semantic-release, Invalid configuration option: packageRules[2].semantic-release-plugin-update-version-in-files, Invalid configuration option: packageRules[2].ts-jest, Invalid configuration option: packageRules[2].typescript, Invalid configuration option: publishConfig, Invalid configuration option: release, Invalid configuration option: renovate, Invalid configuration option: scripts, Invalid configuration option: version, The "npm" object can only be configured at the top level of a config but was found inside "packageRules[0]"

TypeScript types appear to be incorrect for paginate() on apps.listReposAccessibleToInstallation

Hey there.

When running await paginate(...) on apps.listReposAccessibleToInstallation, the TypeScript inferred data type is not correct.

  // context is an Octokit with an installation.id

  const repos = await context.paginate(context.apps.listReposAccessibleToInstallation, {
    per_page: 100,
  });

  // TypeScript compiler/VSCode sees `repos` as:
  // {
  //   total_count: number,
  //   repositories: { id: number,  /*...*/ }[ ],
  //   repository_selection: ?string
  // }

But really at runtime it contains repositories data array:

  console.log(repos)
  // [
  //   { id: 123,  /*...*/ },
  //   { id: 456,  /*...*/ }
  // ]

Workaround

  // FIXME: Have been doing this as a workaround.
  const installationRepos = repos.repositories ?? repos;

  installationRepos.forEach(/*...*/);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.