@octokit/types 12.2.0 → 12.4.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.
@@ -1 +1 @@
1
- export declare const VERSION = "12.2.0";
1
+ export declare const VERSION = "12.4.0";
@@ -2,6 +2,13 @@ import type { paths } from "@octokit/openapi-types";
2
2
  import type { OctokitResponse } from "../OctokitResponse";
3
3
  import type { RequestHeaders } from "../RequestHeaders";
4
4
  import type { RequestRequestOptions } from "../RequestRequestOptions";
5
+ /**
6
+ * @license (MIT OR CC0-1.0)
7
+ * @source https://github.com/sindresorhus/type-fest/blob/570e27f8fdaee37ef5d5e0fbf241e0212ff8fc1a/source/simplify.d.ts
8
+ */
9
+ export type Simplify<T> = {
10
+ [KeyType in keyof T]: T[KeyType];
11
+ } & {};
5
12
  type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
6
13
  type ExtractParameters<T> = "parameters" extends keyof T ? UnionToIntersection<{
7
14
  [K in keyof T["parameters"]]-?: T["parameters"][K];
@@ -17,26 +24,26 @@ type ExtractRequestBody<T> = "requestBody" extends keyof T ? "content" extends k
17
24
  } : {};
18
25
  type ToOctokitParameters<T> = ExtractParameters<T> & ExtractRequestBody<Required<T>>;
19
26
  type Operation<Url extends keyof paths, Method extends keyof paths[Url]> = {
20
- parameters: ToOctokitParameters<paths[Url][Method]>;
21
- request: {
22
- method: Method extends keyof MethodsMap ? MethodsMap[Method] : never;
27
+ parameters: Simplify<ToOctokitParameters<paths[Url][Method]>>;
28
+ request: Method extends ReadOnlyMethods ? {
29
+ method: Method extends string ? Uppercase<Method> : never;
23
30
  url: Url;
24
31
  headers: RequestHeaders;
25
32
  request: RequestRequestOptions;
33
+ } : {
34
+ method: Method extends string ? Uppercase<Method> : never;
35
+ url: Url;
36
+ headers: RequestHeaders;
37
+ request: RequestRequestOptions;
38
+ data: ExtractRequestBody<paths[Url][Method]>;
26
39
  };
27
40
  response: ExtractOctokitResponse<paths[Url][Method]>;
28
41
  };
29
- type MethodsMap = {
30
- delete: "DELETE";
31
- get: "GET";
32
- patch: "PATCH";
33
- post: "POST";
34
- put: "PUT";
35
- };
36
- type SuccessStatuses = 200 | 201 | 202 | 204;
42
+ type ReadOnlyMethods = "get" | "head";
43
+ type SuccessStatuses = 200 | 201 | 202 | 204 | 205;
37
44
  type RedirectStatuses = 301 | 302;
38
- type EmptyResponseStatuses = 201 | 204;
39
- type KnownJsonResponseTypes = "application/json" | "application/scim+json" | "text/html";
45
+ type EmptyResponseStatuses = 201 | 204 | 205;
46
+ type KnownJsonResponseTypes = "application/json" | "application/octocat-stream" | "application/scim+json" | "text/html" | "text/plain";
40
47
  type SuccessResponseDataType<Responses> = {
41
48
  [K in SuccessStatuses & keyof Responses]: GetContentKeyIfPresent<Responses[K]> extends never ? never : OctokitResponse<GetContentKeyIfPresent<Responses[K]>, K>;
42
49
  }[SuccessStatuses & keyof Responses];
@@ -201,7 +208,7 @@ export interface Endpoints {
201
208
  */
202
209
  "DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}": Operation<"/orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}", "delete">;
203
210
  /**
204
- * @see https://docs.github.com/rest/orgs/properties#remove-a-custom-property-for-an-organization
211
+ * @see https://docs.github.com/rest/orgs/custom-properties#remove-a-custom-property-for-an-organization
205
212
  */
206
213
  "DELETE /orgs/{org}/properties/schema/{custom_property_name}": Operation<"/orgs/{org}/properties/schema/{custom_property_name}", "delete">;
207
214
  /**
@@ -1114,15 +1121,15 @@ export interface Endpoints {
1114
1121
  */
1115
1122
  "GET /orgs/{org}/projects": Operation<"/orgs/{org}/projects", "get">;
1116
1123
  /**
1117
- * @see https://docs.github.com/rest/orgs/properties#get-all-custom-properties-for-an-organization
1124
+ * @see https://docs.github.com/rest/orgs/custom-properties#get-all-custom-properties-for-an-organization
1118
1125
  */
1119
1126
  "GET /orgs/{org}/properties/schema": Operation<"/orgs/{org}/properties/schema", "get">;
1120
1127
  /**
1121
- * @see https://docs.github.com/rest/orgs/properties#get-a-custom-property-for-an-organization
1128
+ * @see https://docs.github.com/rest/orgs/custom-properties#get-a-custom-property-for-an-organization
1122
1129
  */
1123
1130
  "GET /orgs/{org}/properties/schema/{custom_property_name}": Operation<"/orgs/{org}/properties/schema/{custom_property_name}", "get">;
1124
1131
  /**
1125
- * @see https://docs.github.com/rest/orgs/properties#list-custom-property-values-for-organization-repositories
1132
+ * @see https://docs.github.com/rest/orgs/custom-properties#list-custom-property-values-for-organization-repositories
1126
1133
  */
1127
1134
  "GET /orgs/{org}/properties/values": Operation<"/orgs/{org}/properties/values", "get">;
1128
1135
  /**
@@ -1939,7 +1946,7 @@ export interface Endpoints {
1939
1946
  */
1940
1947
  "GET /repos/{owner}/{repo}/projects": Operation<"/repos/{owner}/{repo}/projects", "get">;
1941
1948
  /**
1942
- * @see https://docs.github.com/rest/repos/properties#get-all-custom-property-values-for-a-repository
1949
+ * @see https://docs.github.com/rest/repos/custom-properties#get-all-custom-property-values-for-a-repository
1943
1950
  */
1944
1951
  "GET /repos/{owner}/{repo}/properties/values": Operation<"/repos/{owner}/{repo}/properties/values", "get">;
1945
1952
  /**
@@ -2615,11 +2622,11 @@ export interface Endpoints {
2615
2622
  */
2616
2623
  "PATCH /orgs/{org}/hooks/{hook_id}/config": Operation<"/orgs/{org}/hooks/{hook_id}/config", "patch">;
2617
2624
  /**
2618
- * @see https://docs.github.com/rest/orgs/properties#create-or-update-custom-properties-for-an-organization
2625
+ * @see https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-properties-for-an-organization
2619
2626
  */
2620
2627
  "PATCH /orgs/{org}/properties/schema": Operation<"/orgs/{org}/properties/schema", "patch">;
2621
2628
  /**
2622
- * @see https://docs.github.com/rest/orgs/properties#create-or-update-custom-property-values-for-organization-repositories
2629
+ * @see https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-property-values-for-organization-repositories
2623
2630
  */
2624
2631
  "PATCH /orgs/{org}/properties/values": Operation<"/orgs/{org}/properties/values", "patch">;
2625
2632
  /**
@@ -3483,7 +3490,7 @@ export interface Endpoints {
3483
3490
  */
3484
3491
  "PUT /orgs/{org}/outside_collaborators/{username}": Operation<"/orgs/{org}/outside_collaborators/{username}", "put">;
3485
3492
  /**
3486
- * @see https://docs.github.com/rest/orgs/properties#create-or-update-a-custom-property-for-an-organization
3493
+ * @see https://docs.github.com/rest/orgs/custom-properties#create-or-update-a-custom-property-for-an-organization
3487
3494
  */
3488
3495
  "PUT /orgs/{org}/properties/schema/{custom_property_name}": Operation<"/orgs/{org}/properties/schema/{custom_property_name}", "put">;
3489
3496
  /**
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@octokit/types",
3
- "version": "12.2.0",
3
+ "version": "12.4.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
7
  "description": "Shared TypeScript definitions for Octokit projects",
8
8
  "dependencies": {
9
- "@octokit/openapi-types": "^19.0.2"
9
+ "@octokit/openapi-types": "^19.1.0"
10
10
  },
11
11
  "repository": "github:octokit/types.ts",
12
12
  "keywords": [
@@ -36,7 +36,7 @@
36
36
  "typescript": "^5.0.0"
37
37
  },
38
38
  "octokit": {
39
- "openapi-version": "13.2.0"
39
+ "openapi-version": "13.3.0"
40
40
  },
41
41
  "files": [
42
42
  "dist-types/**"