Skip to content

Commit 738e4b3

Browse files
committed
Merge branch 'main' into cjs
2 parents ce534d9 + 1c297ca commit 738e4b3

17 files changed

+5914
-4931
lines changed

.github/workflows/add_to_octokit_project.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
continue-on-error: true
1414
steps:
15-
- uses: actions/[email protected].1
15+
- uses: actions/[email protected].2
1616
with:
1717
project-url: https://github.com/orgs/octokit/projects/10
1818
github-token: ${{ secrets.OCTOKITBOT_PROJECT_ACTION_TOKEN }}

.github/workflows/immediate-response.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ jobs:
2525
body: >
2626
👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday!
2727
We have a [process in place](https://github.com/octokit/.github/blob/main/community/prioritization_response.md#overview) for prioritizing and responding to your input.
28-
Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labled with `Status: Up for grabs`.
28+
Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with `Status: Up for grabs`.
2929
You & others like you are the reason all of this works! So thank you & happy coding! 🚀

.github/workflows/test.yml

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
node_version:
1616
- 18
1717
- 20
18+
- 22
1819
steps:
1920
- uses: actions/checkout@v4
2021
- name: Use Node.js ${{ matrix.node_version }}

package-lock.json

+3,010-3,996
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
],
2727
"license": "MIT",
2828
"dependencies": {
29-
"@octokit/types": "^13.5.0"
29+
"@octokit/types": "^13.7.0"
3030
},
3131
"peerDependencies": {
3232
"@octokit/core": "5"

scripts/update-endpoints/generated/endpoints.json

+2,570-835
Large diffs are not rendered by default.

src/generated/paginating-endpoints.ts

+163-5
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,19 @@ export interface PaginatingEndpoints {
5858
};
5959

6060
/**
61-
* @see https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-enterprise-members
61+
* @see https://docs.github.com/rest/code-security/configurations#get-code-security-configurations-for-an-enterprise
6262
*/
63-
"GET /enterprises/{enterprise}/copilot/usage": {
64-
parameters: Endpoints["GET /enterprises/{enterprise}/copilot/usage"]["parameters"];
65-
response: Endpoints["GET /enterprises/{enterprise}/copilot/usage"]["response"];
63+
"GET /enterprises/{enterprise}/code-security/configurations": {
64+
parameters: Endpoints["GET /enterprises/{enterprise}/code-security/configurations"]["parameters"];
65+
response: Endpoints["GET /enterprises/{enterprise}/code-security/configurations"]["response"];
66+
};
67+
68+
/**
69+
* @see https://docs.github.com/rest/code-security/configurations#get-repositories-associated-with-an-enterprise-code-security-configuration
70+
*/
71+
"GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories": {
72+
parameters: Endpoints["GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories"]["parameters"];
73+
response: Endpoints["GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories"]["response"];
6674
};
6775

6876
/**
@@ -239,6 +247,36 @@ export interface PaginatingEndpoints {
239247
};
240248
};
241249

250+
/**
251+
* @see https://docs.github.com/rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-organization
252+
*/
253+
"GET /orgs/{org}/actions/runner-groups": {
254+
parameters: Endpoints["GET /orgs/{org}/actions/runner-groups"]["parameters"];
255+
response: Endpoints["GET /orgs/{org}/actions/runner-groups"]["response"] & {
256+
data: Endpoints["GET /orgs/{org}/actions/runner-groups"]["response"]["data"]["runner_groups"];
257+
};
258+
};
259+
260+
/**
261+
* @see https://docs.github.com/rest/actions/self-hosted-runner-groups#list-repository-access-to-a-self-hosted-runner-group-in-an-organization
262+
*/
263+
"GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories": {
264+
parameters: Endpoints["GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories"]["parameters"];
265+
response: Endpoints["GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories"]["response"] & {
266+
data: Endpoints["GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories"]["response"]["data"]["repositories"];
267+
};
268+
};
269+
270+
/**
271+
* @see https://docs.github.com/rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-organization
272+
*/
273+
"GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners": {
274+
parameters: Endpoints["GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners"]["parameters"];
275+
response: Endpoints["GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners"]["response"] & {
276+
data: Endpoints["GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners"]["response"]["data"]["runners"];
277+
};
278+
};
279+
242280
/**
243281
* @see https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-organization
244282
*/
@@ -289,6 +327,16 @@ export interface PaginatingEndpoints {
289327
};
290328
};
291329

330+
/**
331+
* @see https://docs.github.com/rest/orgs/orgs#list-attestations
332+
*/
333+
"GET /orgs/{org}/attestations/{subject_digest}": {
334+
parameters: Endpoints["GET /orgs/{org}/attestations/{subject_digest}"]["parameters"];
335+
response: Endpoints["GET /orgs/{org}/attestations/{subject_digest}"]["response"] & {
336+
data: Endpoints["GET /orgs/{org}/attestations/{subject_digest}"]["response"]["data"]["attestations"];
337+
};
338+
};
339+
292340
/**
293341
* @see https://docs.github.com/rest/orgs/blocking#list-users-blocked-by-an-organization
294342
*/
@@ -305,6 +353,22 @@ export interface PaginatingEndpoints {
305353
response: Endpoints["GET /orgs/{org}/code-scanning/alerts"]["response"];
306354
};
307355

356+
/**
357+
* @see https://docs.github.com/rest/code-security/configurations#get-code-security-configurations-for-an-organization
358+
*/
359+
"GET /orgs/{org}/code-security/configurations": {
360+
parameters: Endpoints["GET /orgs/{org}/code-security/configurations"]["parameters"];
361+
response: Endpoints["GET /orgs/{org}/code-security/configurations"]["response"];
362+
};
363+
364+
/**
365+
* @see https://docs.github.com/rest/code-security/configurations#get-repositories-associated-with-a-code-security-configuration
366+
*/
367+
"GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories": {
368+
parameters: Endpoints["GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories"]["parameters"];
369+
response: Endpoints["GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories"]["response"];
370+
};
371+
308372
/**
309373
* @see https://docs.github.com/rest/codespaces/organizations#list-codespaces-for-the-organization
310374
*/
@@ -345,6 +409,14 @@ export interface PaginatingEndpoints {
345409
};
346410
};
347411

412+
/**
413+
* @see https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-organization
414+
*/
415+
"GET /orgs/{org}/copilot/metrics": {
416+
parameters: Endpoints["GET /orgs/{org}/copilot/metrics"]["parameters"];
417+
response: Endpoints["GET /orgs/{org}/copilot/metrics"]["response"];
418+
};
419+
348420
/**
349421
* @see https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-organization-members
350422
*/
@@ -413,6 +485,30 @@ export interface PaginatingEndpoints {
413485
response: Endpoints["GET /orgs/{org}/hooks/{hook_id}/deliveries"]["response"];
414486
};
415487

488+
/**
489+
* @see https://docs.github.com/rest/orgs/api-insights#get-route-stats-by-actor
490+
*/
491+
"GET /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}": {
492+
parameters: Endpoints["GET /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}"]["parameters"];
493+
response: Endpoints["GET /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}"]["response"];
494+
};
495+
496+
/**
497+
* @see https://docs.github.com/rest/orgs/api-insights#get-subject-stats
498+
*/
499+
"GET /orgs/{org}/insights/api/subject-stats": {
500+
parameters: Endpoints["GET /orgs/{org}/insights/api/subject-stats"]["parameters"];
501+
response: Endpoints["GET /orgs/{org}/insights/api/subject-stats"]["response"];
502+
};
503+
504+
/**
505+
* @see https://docs.github.com/rest/orgs/api-insights#get-user-stats
506+
*/
507+
"GET /orgs/{org}/insights/api/user-stats/{user_id}": {
508+
parameters: Endpoints["GET /orgs/{org}/insights/api/user-stats/{user_id}"]["parameters"];
509+
response: Endpoints["GET /orgs/{org}/insights/api/user-stats/{user_id}"]["response"];
510+
};
511+
416512
/**
417513
* @see https://docs.github.com/rest/orgs/orgs#list-app-installations-for-an-organization
418514
*/
@@ -553,6 +649,16 @@ export interface PaginatingEndpoints {
553649
response: Endpoints["GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"]["response"];
554650
};
555651

652+
/**
653+
* @see https://docs.github.com/rest/private-registries/organization-configurations#list-private-registries-for-an-organization
654+
*/
655+
"GET /orgs/{org}/private-registries": {
656+
parameters: Endpoints["GET /orgs/{org}/private-registries"]["parameters"];
657+
response: Endpoints["GET /orgs/{org}/private-registries"]["response"] & {
658+
data: Endpoints["GET /orgs/{org}/private-registries"]["response"]["data"]["configurations"];
659+
};
660+
};
661+
556662
/**
557663
* @see https://docs.github.com/rest/projects/projects#list-organization-projects
558664
*/
@@ -617,6 +723,14 @@ export interface PaginatingEndpoints {
617723
response: Endpoints["GET /orgs/{org}/security-advisories"]["response"];
618724
};
619725

726+
/**
727+
* @see https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-a-team
728+
*/
729+
"GET /orgs/{org}/team/{team_slug}/copilot/metrics": {
730+
parameters: Endpoints["GET /orgs/{org}/team/{team_slug}/copilot/metrics"]["parameters"];
731+
response: Endpoints["GET /orgs/{org}/team/{team_slug}/copilot/metrics"]["response"];
732+
};
733+
620734
/**
621735
* @see https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-a-team
622736
*/
@@ -875,6 +989,16 @@ export interface PaginatingEndpoints {
875989
response: Endpoints["GET /repos/{owner}/{repo}/assignees"]["response"];
876990
};
877991

992+
/**
993+
* @see https://docs.github.com/rest/repos/repos#list-attestations
994+
*/
995+
"GET /repos/{owner}/{repo}/attestations/{subject_digest}": {
996+
parameters: Endpoints["GET /repos/{owner}/{repo}/attestations/{subject_digest}"]["parameters"];
997+
response: Endpoints["GET /repos/{owner}/{repo}/attestations/{subject_digest}"]["response"] & {
998+
data: Endpoints["GET /repos/{owner}/{repo}/attestations/{subject_digest}"]["response"]["data"]["attestations"];
999+
};
1000+
};
1001+
8781002
/**
8791003
* @see https://docs.github.com/rest/branches/branches#list-branches
8801004
*/
@@ -1237,6 +1361,14 @@ export interface PaginatingEndpoints {
12371361
response: Endpoints["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"]["response"];
12381362
};
12391363

1364+
/**
1365+
* @see https://docs.github.com/rest/issues/sub-issues#list-sub-issues
1366+
*/
1367+
"GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues": {
1368+
parameters: Endpoints["GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"]["parameters"];
1369+
response: Endpoints["GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"]["response"];
1370+
};
1371+
12401372
/**
12411373
* @see https://docs.github.com/rest/issues/timeline#list-timeline-events-for-an-issue
12421374
*/
@@ -1861,6 +1993,16 @@ export interface PaginatingEndpoints {
18611993
response: Endpoints["GET /users"]["response"];
18621994
};
18631995

1996+
/**
1997+
* @see https://docs.github.com/rest/users/attestations#list-attestations
1998+
*/
1999+
"GET /users/{username}/attestations/{subject_digest}": {
2000+
parameters: Endpoints["GET /users/{username}/attestations/{subject_digest}"]["parameters"];
2001+
response: Endpoints["GET /users/{username}/attestations/{subject_digest}"]["response"] & {
2002+
data: Endpoints["GET /users/{username}/attestations/{subject_digest}"]["response"]["data"]["attestations"];
2003+
};
2004+
};
2005+
18642006
/**
18652007
* @see https://docs.github.com/rest/activity/events#list-events-for-the-authenticated-user
18662008
*/
@@ -2014,7 +2156,8 @@ export const paginatingEndpoints: (keyof PaginatingEndpoints)[] = [
20142156
"GET /assignments/{assignment_id}/accepted_assignments",
20152157
"GET /classrooms",
20162158
"GET /classrooms/{classroom_id}/assignments",
2017-
"GET /enterprises/{enterprise}/copilot/usage",
2159+
"GET /enterprises/{enterprise}/code-security/configurations",
2160+
"GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories",
20182161
"GET /enterprises/{enterprise}/dependabot/alerts",
20192162
"GET /enterprises/{enterprise}/secret-scanning/alerts",
20202163
"GET /events",
@@ -2036,17 +2179,24 @@ export const paginatingEndpoints: (keyof PaginatingEndpoints)[] = [
20362179
"GET /organizations",
20372180
"GET /orgs/{org}/actions/cache/usage-by-repository",
20382181
"GET /orgs/{org}/actions/permissions/repositories",
2182+
"GET /orgs/{org}/actions/runner-groups",
2183+
"GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories",
2184+
"GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners",
20392185
"GET /orgs/{org}/actions/runners",
20402186
"GET /orgs/{org}/actions/secrets",
20412187
"GET /orgs/{org}/actions/secrets/{secret_name}/repositories",
20422188
"GET /orgs/{org}/actions/variables",
20432189
"GET /orgs/{org}/actions/variables/{name}/repositories",
2190+
"GET /orgs/{org}/attestations/{subject_digest}",
20442191
"GET /orgs/{org}/blocks",
20452192
"GET /orgs/{org}/code-scanning/alerts",
2193+
"GET /orgs/{org}/code-security/configurations",
2194+
"GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories",
20462195
"GET /orgs/{org}/codespaces",
20472196
"GET /orgs/{org}/codespaces/secrets",
20482197
"GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories",
20492198
"GET /orgs/{org}/copilot/billing/seats",
2199+
"GET /orgs/{org}/copilot/metrics",
20502200
"GET /orgs/{org}/copilot/usage",
20512201
"GET /orgs/{org}/dependabot/alerts",
20522202
"GET /orgs/{org}/dependabot/secrets",
@@ -2055,6 +2205,9 @@ export const paginatingEndpoints: (keyof PaginatingEndpoints)[] = [
20552205
"GET /orgs/{org}/failed_invitations",
20562206
"GET /orgs/{org}/hooks",
20572207
"GET /orgs/{org}/hooks/{hook_id}/deliveries",
2208+
"GET /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}",
2209+
"GET /orgs/{org}/insights/api/subject-stats",
2210+
"GET /orgs/{org}/insights/api/user-stats/{user_id}",
20582211
"GET /orgs/{org}/installations",
20592212
"GET /orgs/{org}/invitations",
20602213
"GET /orgs/{org}/invitations/{invitation_id}/teams",
@@ -2072,6 +2225,7 @@ export const paginatingEndpoints: (keyof PaginatingEndpoints)[] = [
20722225
"GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories",
20732226
"GET /orgs/{org}/personal-access-tokens",
20742227
"GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories",
2228+
"GET /orgs/{org}/private-registries",
20752229
"GET /orgs/{org}/projects",
20762230
"GET /orgs/{org}/properties/values",
20772231
"GET /orgs/{org}/public_members",
@@ -2080,6 +2234,7 @@ export const paginatingEndpoints: (keyof PaginatingEndpoints)[] = [
20802234
"GET /orgs/{org}/rulesets/rule-suites",
20812235
"GET /orgs/{org}/secret-scanning/alerts",
20822236
"GET /orgs/{org}/security-advisories",
2237+
"GET /orgs/{org}/team/{team_slug}/copilot/metrics",
20832238
"GET /orgs/{org}/team/{team_slug}/copilot/usage",
20842239
"GET /orgs/{org}/teams",
20852240
"GET /orgs/{org}/teams/{team_slug}/discussions",
@@ -2109,6 +2264,7 @@ export const paginatingEndpoints: (keyof PaginatingEndpoints)[] = [
21092264
"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs",
21102265
"GET /repos/{owner}/{repo}/activity",
21112266
"GET /repos/{owner}/{repo}/assignees",
2267+
"GET /repos/{owner}/{repo}/attestations/{subject_digest}",
21122268
"GET /repos/{owner}/{repo}/branches",
21132269
"GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations",
21142270
"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs",
@@ -2151,6 +2307,7 @@ export const paginatingEndpoints: (keyof PaginatingEndpoints)[] = [
21512307
"GET /repos/{owner}/{repo}/issues/{issue_number}/events",
21522308
"GET /repos/{owner}/{repo}/issues/{issue_number}/labels",
21532309
"GET /repos/{owner}/{repo}/issues/{issue_number}/reactions",
2310+
"GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues",
21542311
"GET /repos/{owner}/{repo}/issues/{issue_number}/timeline",
21552312
"GET /repos/{owner}/{repo}/keys",
21562313
"GET /repos/{owner}/{repo}/labels",
@@ -2226,6 +2383,7 @@ export const paginatingEndpoints: (keyof PaginatingEndpoints)[] = [
22262383
"GET /user/subscriptions",
22272384
"GET /user/teams",
22282385
"GET /users",
2386+
"GET /users/{username}/attestations/{subject_digest}",
22292387
"GET /users/{username}/events",
22302388
"GET /users/{username}/events/orgs/{org}",
22312389
"GET /users/{username}/events/public",

src/iterator.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export function iterator(
3737
// '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
3838
// sets `url` to undefined if "next" URL is not present or `link` header is not set
3939
url = ((normalizedResponse.headers.link || "").match(
40-
/<([^>]+)>;\s*rel="next"/,
40+
/<([^<>]+)>;\s*rel="next"/,
4141
) || [])[1];
4242

4343
return { value: normalizedResponse };
@@ -58,5 +58,5 @@ export function iterator(
5858
}
5959
},
6060
}),
61-
};
61+
} as AsyncIterable<any>;
6262
}

src/paginate.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,15 @@ export function paginate(
2323
return gather(
2424
octokit,
2525
[],
26-
iterator(octokit, route, parameters)[
27-
Symbol.asyncIterator
28-
]() as AsyncIterableIterator<any>,
26+
iterator(octokit, route, parameters)[Symbol.asyncIterator](),
2927
mapFn,
3028
);
3129
}
3230

3331
function gather(
3432
octokit: Octokit,
3533
results: PaginationResults,
36-
iterator: AsyncIterableIterator<any>,
34+
iterator: AsyncIterator<any>,
3735
mapFn?: MapFunction,
3836
): Promise<PaginationResults> {
3937
return iterator.next().then((result) => {

0 commit comments

Comments
 (0)