@octokit/types 6.1.0 → 6.1.1

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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const VERSION = "6.1.0";
5
+ const VERSION = "6.1.1";
6
6
 
7
7
  exports.VERSION = VERSION;
8
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- export const VERSION = "6.1.0";
1
+ export const VERSION = "6.1.1";
@@ -1 +1 @@
1
- export declare const VERSION = "6.1.0";
1
+ export declare const VERSION = "6.1.1";
@@ -25,7 +25,7 @@ declare type Operation<Url extends keyof paths, Method extends keyof paths[Url],
25
25
  headers: RequestHeaders;
26
26
  request: RequestRequestOptions;
27
27
  };
28
- response: Url extends keyof EndpointsWithMissingRequiredResponseDataSchema ? Method extends EndpointsWithMissingRequiredResponseDataSchema[Url] ? DeepRequired<ExtractFirstSuccessResponse<paths[Url][Method]>> : ExtractFirstSuccessResponse<paths[Url][Method]> : ExtractFirstSuccessResponse<paths[Url][Method]>;
28
+ response: Url extends keyof EndpointsWithMissingRequiredResponseDataSchema ? Method extends EndpointsWithMissingRequiredResponseDataSchema[Url] ? DeepRequired<ExtractOctokitResponse<paths[Url][Method]>> : ExtractOctokitResponse<paths[Url][Method]> : ExtractOctokitResponse<paths[Url][Method]>;
29
29
  };
30
30
  declare type MethodsMap = {
31
31
  delete: "DELETE";
@@ -43,9 +43,19 @@ declare type RedirectStatusesMap = {
43
43
  "301": 301;
44
44
  "302": 302;
45
45
  };
46
- declare type DataType<T> = "application/json" extends keyof T ? T["application/json"] : "application/scim+json" extends keyof T ? T["application/scim+json"] : unknown;
47
- declare type ExtractFirstSuccessResponse<R> = "responses" extends keyof R ? FirstSuccessResponse<R["responses"]> : unknown;
48
- declare type FirstSuccessResponse<R, S extends keyof R = keyof R> = S extends keyof SuccessStatusesMap ? R[S] extends never ? Omit<OctokitResponse<unknown, SuccessStatusesMap[S]>, "data"> : OctokitResponse<DataType<R[S]>, SuccessStatusesMap[S]> : S extends keyof RedirectStatusesMap ? OctokitResponse<unknown, RedirectStatusesMap[S]> : never;
46
+ declare type SuccessStatuses = keyof SuccessStatusesMap;
47
+ declare type RedirectStatuses = keyof RedirectStatusesMap;
48
+ declare type KnownJsonResponseTypes = "application/json" | "application/scim+json";
49
+ declare type SuccessResponseDataType<Responses> = {
50
+ [K in SuccessStatuses & keyof Responses]: OctokitResponse<DataType<Responses[K]> extends never ? unknown : DataType<Responses[K]>, SuccessStatusesMap[K]>;
51
+ }[SuccessStatuses & keyof Responses];
52
+ declare type RedirectResponseDataType<Responses> = {
53
+ [K in RedirectStatuses & keyof Responses]: OctokitResponse<unknown, RedirectStatusesMap[K]>;
54
+ }[RedirectStatuses & keyof Responses];
55
+ declare type DataType<T> = {
56
+ [K in KnownJsonResponseTypes & keyof T]: T[K];
57
+ }[KnownJsonResponseTypes & keyof T];
58
+ declare type ExtractOctokitResponse<R> = "responses" extends keyof R ? SuccessResponseDataType<R["responses"]> extends never ? RedirectResponseDataType<R["responses"]> extends never ? never : RedirectResponseDataType<R["responses"]> : SuccessResponseDataType<R["responses"]> : unknown;
49
59
  declare type EndpointsWithMissingRequiredResponseDataSchema = {
50
60
  "/app/hook/config": "get" | "patch";
51
61
  "/app/installations/{installation_id}/access_tokens": "post";
package/dist-web/index.js CHANGED
@@ -1,4 +1,4 @@
1
- const VERSION = "6.1.0";
1
+ const VERSION = "6.1.1";
2
2
 
3
3
  export { VERSION };
4
4
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@octokit/types",
3
3
  "description": "Shared TypeScript definitions for Octokit projects",
4
- "version": "6.1.0",
4
+ "version": "6.1.1",
5
5
  "license": "MIT",
6
6
  "files": [
7
7
  "dist-*/",