@octokit/types 13.10.0 → 14.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-types/EndpointDefaults.d.ts +2 -2
- package/dist-types/EndpointInterface.d.ts +3 -3
- package/dist-types/EndpointOptions.d.ts +2 -2
- package/dist-types/RequestInterface.d.ts +2 -2
- package/dist-types/VERSION.d.ts +1 -1
- package/dist-types/generated/Endpoints.d.ts +29 -8
- package/package.json +6 -6
|
@@ -6,7 +6,7 @@ import type { Url } from "./Url.js";
|
|
|
6
6
|
* The `.endpoint()` method is guaranteed to set all keys defined by RequestParameters
|
|
7
7
|
* as well as the method property.
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export interface EndpointDefaults extends RequestParameters {
|
|
10
10
|
baseUrl: Url;
|
|
11
11
|
method: RequestMethod;
|
|
12
12
|
url?: Url;
|
|
@@ -18,4 +18,4 @@ export type EndpointDefaults = RequestParameters & {
|
|
|
18
18
|
format: string;
|
|
19
19
|
previews?: string[];
|
|
20
20
|
};
|
|
21
|
-
}
|
|
21
|
+
}
|
|
@@ -2,7 +2,7 @@ import type { EndpointDefaults } from "./EndpointDefaults.js";
|
|
|
2
2
|
import type { RequestOptions } from "./RequestOptions.js";
|
|
3
3
|
import type { RequestParameters } from "./RequestParameters.js";
|
|
4
4
|
import type { Route } from "./Route.js";
|
|
5
|
-
import type { Endpoints } from "./generated/Endpoints.js";
|
|
5
|
+
import type { EndpointKeys, Endpoints } from "./generated/Endpoints.js";
|
|
6
6
|
export interface EndpointInterface<D extends object = object> {
|
|
7
7
|
/**
|
|
8
8
|
* Transforms a GitHub REST API endpoint into generic request options
|
|
@@ -22,7 +22,7 @@ export interface EndpointInterface<D extends object = object> {
|
|
|
22
22
|
* @param {string} route Request method + URL. Example: `'GET /orgs/{org}'`
|
|
23
23
|
* @param {object} [parameters] URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`.
|
|
24
24
|
*/
|
|
25
|
-
<R extends Route, P extends RequestParameters = R extends
|
|
25
|
+
<R extends Route, P extends RequestParameters = R extends EndpointKeys ? Endpoints[R]["parameters"] & RequestParameters : RequestParameters>(route: EndpointKeys | R, parameters?: P): (R extends EndpointKeys ? Endpoints[R]["request"] : RequestOptions) & Pick<P, keyof RequestOptions>;
|
|
26
26
|
/**
|
|
27
27
|
* Object with current default route and parameters
|
|
28
28
|
*/
|
|
@@ -40,7 +40,7 @@ export interface EndpointInterface<D extends object = object> {
|
|
|
40
40
|
* @param {object} [parameters] URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`.
|
|
41
41
|
*
|
|
42
42
|
*/
|
|
43
|
-
<R extends Route, P extends RequestParameters = R extends
|
|
43
|
+
<R extends Route, P extends RequestParameters = R extends EndpointKeys ? Endpoints[R]["parameters"] & RequestParameters : RequestParameters>(route: EndpointKeys | R, parameters?: P): D & (R extends EndpointKeys ? Endpoints[R]["request"] & Endpoints[R]["parameters"] : EndpointDefaults) & P;
|
|
44
44
|
/**
|
|
45
45
|
* Merges current endpoint defaults with passed route and parameters,
|
|
46
46
|
* without transforming them into request options.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RequestMethod } from "./RequestMethod.js";
|
|
2
2
|
import type { Url } from "./Url.js";
|
|
3
3
|
import type { RequestParameters } from "./RequestParameters.js";
|
|
4
|
-
export
|
|
4
|
+
export interface EndpointOptions extends RequestParameters {
|
|
5
5
|
method: RequestMethod;
|
|
6
6
|
url: Url;
|
|
7
|
-
}
|
|
7
|
+
}
|
|
@@ -2,7 +2,7 @@ import type { EndpointInterface } from "./EndpointInterface.js";
|
|
|
2
2
|
import type { OctokitResponse } from "./OctokitResponse.js";
|
|
3
3
|
import type { RequestParameters } from "./RequestParameters.js";
|
|
4
4
|
import type { Route } from "./Route.js";
|
|
5
|
-
import type { Endpoints } from "./generated/Endpoints.js";
|
|
5
|
+
import type { EndpointKeys, Endpoints } from "./generated/Endpoints.js";
|
|
6
6
|
export interface RequestInterface<D extends object = object> {
|
|
7
7
|
/**
|
|
8
8
|
* Sends a request based on endpoint options
|
|
@@ -22,7 +22,7 @@ export interface RequestInterface<D extends object = object> {
|
|
|
22
22
|
* @param {string} route Request method + URL. Example: `'GET /orgs/{org}'`
|
|
23
23
|
* @param {object} [parameters] URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`.
|
|
24
24
|
*/
|
|
25
|
-
<R extends Route>(route:
|
|
25
|
+
<R extends Route>(route: EndpointKeys | R, options?: R extends EndpointKeys ? Endpoints[R]["parameters"] & RequestParameters : RequestParameters): R extends EndpointKeys ? Promise<Endpoints[R]["response"]> : Promise<OctokitResponse<any>>;
|
|
26
26
|
/**
|
|
27
27
|
* Returns a new `request` with updated route and parameters
|
|
28
28
|
*/
|
package/dist-types/VERSION.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "
|
|
1
|
+
export declare const VERSION = "14.1.0";
|
|
@@ -159,6 +159,10 @@ export interface Endpoints {
|
|
|
159
159
|
* @see https://docs.github.com/rest/orgs/blocking#unblock-a-user-from-an-organization
|
|
160
160
|
*/
|
|
161
161
|
"DELETE /orgs/{org}/blocks/{username}": Operation<"/orgs/{org}/blocks/{username}", "delete">;
|
|
162
|
+
/**
|
|
163
|
+
* @see https://docs.github.com/rest/campaigns/campaigns#delete-a-campaign-for-an-organization
|
|
164
|
+
*/
|
|
165
|
+
"DELETE /orgs/{org}/campaigns/{campaign_number}": Operation<"/orgs/{org}/campaigns/{campaign_number}", "delete">;
|
|
162
166
|
/**
|
|
163
167
|
* @see https://docs.github.com/rest/code-security/configurations#detach-configurations-from-repositories
|
|
164
168
|
*/
|
|
@@ -1076,6 +1080,14 @@ export interface Endpoints {
|
|
|
1076
1080
|
* @see https://docs.github.com/rest/orgs/blocking#check-if-a-user-is-blocked-by-an-organization
|
|
1077
1081
|
*/
|
|
1078
1082
|
"GET /orgs/{org}/blocks/{username}": Operation<"/orgs/{org}/blocks/{username}", "get">;
|
|
1083
|
+
/**
|
|
1084
|
+
* @see https://docs.github.com/rest/campaigns/campaigns#list-campaigns-for-an-organization
|
|
1085
|
+
*/
|
|
1086
|
+
"GET /orgs/{org}/campaigns": Operation<"/orgs/{org}/campaigns", "get">;
|
|
1087
|
+
/**
|
|
1088
|
+
* @see https://docs.github.com/rest/campaigns/campaigns#get-a-campaign-for-an-organization
|
|
1089
|
+
*/
|
|
1090
|
+
"GET /orgs/{org}/campaigns/{campaign_number}": Operation<"/orgs/{org}/campaigns/{campaign_number}", "get">;
|
|
1079
1091
|
/**
|
|
1080
1092
|
* @see https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-an-organization
|
|
1081
1093
|
*/
|
|
@@ -1128,10 +1140,6 @@ export interface Endpoints {
|
|
|
1128
1140
|
* @see https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-organization
|
|
1129
1141
|
*/
|
|
1130
1142
|
"GET /orgs/{org}/copilot/metrics": Operation<"/orgs/{org}/copilot/metrics", "get">;
|
|
1131
|
-
/**
|
|
1132
|
-
* @see https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-organization-members
|
|
1133
|
-
*/
|
|
1134
|
-
"GET /orgs/{org}/copilot/usage": Operation<"/orgs/{org}/copilot/usage", "get">;
|
|
1135
1143
|
/**
|
|
1136
1144
|
* @see https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-an-organization
|
|
1137
1145
|
*/
|
|
@@ -1444,10 +1452,6 @@ export interface Endpoints {
|
|
|
1444
1452
|
* @see https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-a-team
|
|
1445
1453
|
*/
|
|
1446
1454
|
"GET /orgs/{org}/team/{team_slug}/copilot/metrics": Operation<"/orgs/{org}/team/{team_slug}/copilot/metrics", "get">;
|
|
1447
|
-
/**
|
|
1448
|
-
* @see https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-a-team
|
|
1449
|
-
*/
|
|
1450
|
-
"GET /orgs/{org}/team/{team_slug}/copilot/usage": Operation<"/orgs/{org}/team/{team_slug}/copilot/usage", "get">;
|
|
1451
1455
|
/**
|
|
1452
1456
|
* @see https://docs.github.com/rest/teams/teams#list-teams
|
|
1453
1457
|
*/
|
|
@@ -2877,6 +2881,10 @@ export interface Endpoints {
|
|
|
2877
2881
|
* @see https://docs.github.com/rest/billing/billing#get-shared-storage-billing-for-a-user
|
|
2878
2882
|
*/
|
|
2879
2883
|
"GET /users/{username}/settings/billing/shared-storage": Operation<"/users/{username}/settings/billing/shared-storage", "get">;
|
|
2884
|
+
/**
|
|
2885
|
+
* @see https://docs.github.com/rest/billing/enhanced-billing#get-billing-usage-report-for-a-user
|
|
2886
|
+
*/
|
|
2887
|
+
"GET /users/{username}/settings/billing/usage": Operation<"/users/{username}/settings/billing/usage", "get">;
|
|
2880
2888
|
/**
|
|
2881
2889
|
* @see https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-a-user
|
|
2882
2890
|
*/
|
|
@@ -2941,6 +2949,10 @@ export interface Endpoints {
|
|
|
2941
2949
|
* @see https://docs.github.com/rest/actions/variables#update-an-organization-variable
|
|
2942
2950
|
*/
|
|
2943
2951
|
"PATCH /orgs/{org}/actions/variables/{name}": Operation<"/orgs/{org}/actions/variables/{name}", "patch">;
|
|
2952
|
+
/**
|
|
2953
|
+
* @see https://docs.github.com/rest/campaigns/campaigns#update-a-campaign
|
|
2954
|
+
*/
|
|
2955
|
+
"PATCH /orgs/{org}/campaigns/{campaign_number}": Operation<"/orgs/{org}/campaigns/{campaign_number}", "patch">;
|
|
2944
2956
|
/**
|
|
2945
2957
|
* @see https://docs.github.com/rest/code-security/configurations#update-a-code-security-configuration
|
|
2946
2958
|
*/
|
|
@@ -3165,6 +3177,10 @@ export interface Endpoints {
|
|
|
3165
3177
|
* @see https://docs.github.com/rest/apps/apps#create-a-scoped-access-token
|
|
3166
3178
|
*/
|
|
3167
3179
|
"POST /applications/{client_id}/token/scoped": Operation<"/applications/{client_id}/token/scoped", "post">;
|
|
3180
|
+
/**
|
|
3181
|
+
* @see https://docs.github.com/rest/credentials/revoke#revoke-a-list-of-credentials
|
|
3182
|
+
*/
|
|
3183
|
+
"POST /credentials/revoke": Operation<"/credentials/revoke", "post">;
|
|
3168
3184
|
/**
|
|
3169
3185
|
* @see https://docs.github.com/rest/code-security/configurations#create-a-code-security-configuration-for-an-enterprise
|
|
3170
3186
|
*/
|
|
@@ -3221,6 +3237,10 @@ export interface Endpoints {
|
|
|
3221
3237
|
* @see https://docs.github.com/rest/actions/variables#create-an-organization-variable
|
|
3222
3238
|
*/
|
|
3223
3239
|
"POST /orgs/{org}/actions/variables": Operation<"/orgs/{org}/actions/variables", "post">;
|
|
3240
|
+
/**
|
|
3241
|
+
* @see https://docs.github.com/rest/campaigns/campaigns#create-a-campaign-for-an-organization
|
|
3242
|
+
*/
|
|
3243
|
+
"POST /orgs/{org}/campaigns": Operation<"/orgs/{org}/campaigns", "post">;
|
|
3224
3244
|
/**
|
|
3225
3245
|
* @see https://docs.github.com/rest/code-security/configurations#create-a-code-security-configuration
|
|
3226
3246
|
*/
|
|
@@ -4170,4 +4190,5 @@ export interface Endpoints {
|
|
|
4170
4190
|
*/
|
|
4171
4191
|
"PUT /user/starred/{owner}/{repo}": Operation<"/user/starred/{owner}/{repo}", "put">;
|
|
4172
4192
|
}
|
|
4193
|
+
export type EndpointKeys = keyof Endpoints;
|
|
4173
4194
|
export {};
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octokit/types",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "14.1.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": true
|
|
7
7
|
},
|
|
8
8
|
"description": "Shared TypeScript definitions for Octokit projects",
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@octokit/openapi-types": "^
|
|
10
|
+
"@octokit/openapi-types": "^25.1.0"
|
|
11
11
|
},
|
|
12
12
|
"repository": "github:octokit/types.ts",
|
|
13
13
|
"keywords": [
|
|
@@ -21,18 +21,18 @@
|
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@octokit/tsconfig": "^4.0.0",
|
|
24
|
-
"github-openapi-graphql-query": "^
|
|
24
|
+
"github-openapi-graphql-query": "^5.0.0",
|
|
25
25
|
"handlebars": "^4.7.6",
|
|
26
|
-
"npm-run-all2": "^
|
|
26
|
+
"npm-run-all2": "^8.0.0",
|
|
27
27
|
"prettier": "^3.0.0",
|
|
28
28
|
"semantic-release": "^24.0.0",
|
|
29
29
|
"semantic-release-plugin-update-version-in-files": "^2.0.0",
|
|
30
30
|
"sort-keys": "^5.0.0",
|
|
31
|
-
"typedoc": "^0.
|
|
31
|
+
"typedoc": "^0.28.0",
|
|
32
32
|
"typescript": "^5.0.0"
|
|
33
33
|
},
|
|
34
34
|
"octokit": {
|
|
35
|
-
"openapi-version": "
|
|
35
|
+
"openapi-version": "19.1.0"
|
|
36
36
|
},
|
|
37
37
|
"files": [
|
|
38
38
|
"dist-types/**"
|