@octokit/oauth-methods
Advanced tools
Comparing version 2.0.2 to 2.0.3
@@ -12,3 +12,3 @@ 'use strict'; | ||
const VERSION = "2.0.2"; | ||
const VERSION = "2.0.3"; | ||
@@ -145,3 +145,4 @@ function requestToOAuthBaseUrl(request) { | ||
/* istanbul ignore next: we always pass a custom request in tests */ | ||
request.request; | ||
request.request; // @ts-expect-error - TODO: I don't get why TS is complaining here. It works with `defaultRequest` directly | ||
const response = await request$1("POST /applications/{client_id}/token", { | ||
@@ -203,3 +204,3 @@ headers: { | ||
const { | ||
request: request$1, | ||
request: optionsRequest, | ||
clientType, | ||
@@ -211,5 +212,7 @@ clientId, | ||
} = options; | ||
const response = await (request$1 || | ||
const request$1 = optionsRequest || | ||
/* istanbul ignore next: we always pass a custom request in tests */ | ||
request.request)("POST /applications/{client_id}/token/scoped", { | ||
request.request; | ||
const response = await request$1("POST /applications/{client_id}/token/scoped", // @ts-expect-error - TODO: I don't get why TS is complaining here. It works with `defaultRequest` directly | ||
{ | ||
headers: { | ||
@@ -229,3 +232,4 @@ authorization: `basic ${btoa(`${clientId}:${clientSecret}`)}` | ||
expiresAt: response.data.expires_at | ||
} : {}); | ||
} : {}); // @ts-expect-error - response.status type is incompatible (200 vs number) | ||
return { ...response, | ||
@@ -241,3 +245,4 @@ authentication | ||
const auth = btoa(`${options.clientId}:${options.clientSecret}`); | ||
const response = await request$1("PATCH /applications/{client_id}/token", { | ||
const response = await request$1("PATCH /applications/{client_id}/token", // @ts-expect-error - TODO: I don't get why TS is complaining here. It works with `defaultRequest` directly | ||
{ | ||
headers: { | ||
@@ -272,3 +277,4 @@ authorization: `basic ${auth}` | ||
const auth = btoa(`${options.clientId}:${options.clientSecret}`); | ||
return request$1("DELETE /applications/{client_id}/token", { | ||
return request$1("DELETE /applications/{client_id}/token", // @ts-expect-error - TODO: I don't get why TS is complaining here. It works with `defaultRequest` directly | ||
{ | ||
headers: { | ||
@@ -287,3 +293,4 @@ authorization: `basic ${auth}` | ||
const auth = btoa(`${options.clientId}:${options.clientSecret}`); | ||
return request$1("DELETE /applications/{client_id}/grant", { | ||
return request$1("DELETE /applications/{client_id}/grant", // @ts-expect-error - TODO: I don't get why TS is complaining here. It works with `defaultRequest` directly | ||
{ | ||
headers: { | ||
@@ -290,0 +297,0 @@ authorization: `basic ${auth}` |
@@ -7,2 +7,3 @@ import { request as defaultRequest } from "@octokit/request"; | ||
defaultRequest; | ||
// @ts-expect-error - TODO: I don't get why TS is complaining here. It works with `defaultRequest` directly | ||
const response = await request("POST /applications/{client_id}/token", { | ||
@@ -9,0 +10,0 @@ headers: { |
@@ -8,3 +8,5 @@ import { request as defaultRequest } from "@octokit/request"; | ||
const auth = btoa(`${options.clientId}:${options.clientSecret}`); | ||
return request("DELETE /applications/{client_id}/grant", { | ||
return request("DELETE /applications/{client_id}/grant", | ||
// @ts-expect-error - TODO: I don't get why TS is complaining here. It works with `defaultRequest` directly | ||
{ | ||
headers: { | ||
@@ -11,0 +13,0 @@ authorization: `basic ${auth}`, |
@@ -8,3 +8,5 @@ import { request as defaultRequest } from "@octokit/request"; | ||
const auth = btoa(`${options.clientId}:${options.clientSecret}`); | ||
return request("DELETE /applications/{client_id}/token", { | ||
return request("DELETE /applications/{client_id}/token", | ||
// @ts-expect-error - TODO: I don't get why TS is complaining here. It works with `defaultRequest` directly | ||
{ | ||
headers: { | ||
@@ -11,0 +13,0 @@ authorization: `basic ${auth}`, |
@@ -8,3 +8,5 @@ import { request as defaultRequest } from "@octokit/request"; | ||
const auth = btoa(`${options.clientId}:${options.clientSecret}`); | ||
const response = await request("PATCH /applications/{client_id}/token", { | ||
const response = await request("PATCH /applications/{client_id}/token", | ||
// @ts-expect-error - TODO: I don't get why TS is complaining here. It works with `defaultRequest` directly | ||
{ | ||
headers: { | ||
@@ -11,0 +13,0 @@ authorization: `basic ${auth}`, |
import { request as defaultRequest } from "@octokit/request"; | ||
import btoa from "btoa-lite"; | ||
export async function scopeToken(options) { | ||
const { request, clientType, clientId, clientSecret, token, ...requestOptions } = options; | ||
const response = await (request || | ||
/* istanbul ignore next: we always pass a custom request in tests */ defaultRequest)("POST /applications/{client_id}/token/scoped", { | ||
const { request: optionsRequest, clientType, clientId, clientSecret, token, ...requestOptions } = options; | ||
const request = optionsRequest || | ||
/* istanbul ignore next: we always pass a custom request in tests */ | ||
defaultRequest; | ||
const response = await request("POST /applications/{client_id}/token/scoped", | ||
// @ts-expect-error - TODO: I don't get why TS is complaining here. It works with `defaultRequest` directly | ||
{ | ||
headers: { | ||
@@ -20,3 +24,4 @@ authorization: `basic ${btoa(`${clientId}:${clientSecret}`)}`, | ||
}, response.data.expires_at ? { expiresAt: response.data.expires_at } : {}); | ||
// @ts-expect-error - response.status type is incompatible (200 vs number) | ||
return { ...response, authentication }; | ||
} |
@@ -1,1 +0,1 @@ | ||
export const VERSION = "2.0.2"; | ||
export const VERSION = "2.0.3"; |
@@ -1,1 +0,1 @@ | ||
export declare const VERSION = "2.0.2"; | ||
export declare const VERSION = "2.0.3"; |
{ | ||
"name": "@octokit/oauth-methods", | ||
"description": "Set of stateless request methods to create, check, reset, refresh, and delete user access tokens for OAuth and GitHub Apps", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"license": "MIT", | ||
@@ -24,3 +24,3 @@ "files": [ | ||
"@octokit/request-error": "^3.0.0", | ||
"@octokit/types": "^6.12.2", | ||
"@octokit/types": "^7.0.0", | ||
"btoa-lite": "^1.0.0" | ||
@@ -27,0 +27,0 @@ }, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
101487
882
+ Added@octokit/openapi-types@13.13.1(transitive)
+ Added@octokit/types@7.5.1(transitive)
- Removed@octokit/openapi-types@12.11.0(transitive)
- Removed@octokit/types@6.41.0(transitive)
Updated@octokit/types@^7.0.0