@octokit/auth-token
Advanced tools
Comparing version 2.0.2 to 2.1.0
@@ -1,3 +0,2 @@ | ||
import { request as Request } from "@octokit/request"; | ||
import { AnyResponse, Endpoint, Parameters, Route, Token } from "./types"; | ||
export declare function hook(token: Token, request: typeof Request, route: Route | Endpoint, parameters?: Parameters): Promise<AnyResponse>; | ||
import { AnyResponse, EndpointOptions, RequestInterface, RequestParameters, Route, Token } from "./types"; | ||
export declare function hook(token: Token, request: RequestInterface, route: Route | EndpointOptions, parameters?: RequestParameters): Promise<AnyResponse>; |
import { Token } from "./types"; | ||
export declare function createTokenAuth(token: Token): (() => Promise<import("./types").Authentication>) & { | ||
hook: (request: import("@octokit/request/dist-types/types").request, route: string | import("./types").Endpoint, parameters?: import("./types").Parameters | undefined) => Promise<import("./types").OctokitResponse<any>>; | ||
hook: (request: import("@octokit/types").RequestInterface, route: string | import("@octokit/types").EndpointOptions, parameters?: import("@octokit/types").RequestParameters | undefined) => Promise<import("@octokit/types").OctokitResponse<any>>; | ||
}; |
@@ -1,2 +0,8 @@ | ||
/// <reference types="node" /> | ||
import * as OctokitTypes from "@octokit/types"; | ||
export declare type AnyResponse = OctokitTypes.OctokitResponse<any>; | ||
export declare type EndpointDefaults = OctokitTypes.EndpointDefaults; | ||
export declare type EndpointOptions = OctokitTypes.EndpointOptions; | ||
export declare type RequestParameters = OctokitTypes.RequestParameters; | ||
export declare type RequestInterface = OctokitTypes.RequestInterface; | ||
export declare type Route = OctokitTypes.Route; | ||
export declare type Token = string; | ||
@@ -14,115 +20,1 @@ export declare type OAuthTokenAuthentication = { | ||
export declare type Authentication = OAuthTokenAuthentication | InstallationTokenAuthentication; | ||
import { Agent } from "http"; | ||
export declare type Fetch = any; | ||
export declare type Signal = any; | ||
export declare type Endpoint = Parameters & { | ||
method: Method; | ||
url: Url; | ||
}; | ||
export declare type Method = "DELETE" | "GET" | "HEAD" | "PATCH" | "POST" | "PUT"; | ||
export declare type Route = string; | ||
export declare type Url = string; | ||
export declare type Parameters = { | ||
/** | ||
* Base URL to be used when a relative URL is passed, such as `/orgs/:org`. | ||
* If `baseUrl` is `https://enterprise.acme-inc.com/api/v3`, then the request | ||
* will be sent to `https://enterprise.acme-inc.com/api/v3/orgs/:org`. | ||
*/ | ||
baseUrl?: string; | ||
/** | ||
* HTTP headers. Use lowercase keys. | ||
*/ | ||
headers?: RequestHeaders; | ||
/** | ||
* Media type options, see {@link https://developer.github.com/v3/media/|GitHub Developer Guide} | ||
*/ | ||
mediaType?: { | ||
/** | ||
* `json` by default. Can be `raw`, `text`, `html`, `full`, `diff`, `patch`, `sha`, `base64`. Depending on endpoint | ||
*/ | ||
format?: string; | ||
/** | ||
* Custom media type names of {@link https://developer.github.com/v3/media/|API Previews} without the `-preview` suffix. | ||
* Example for single preview: `['squirrel-girl']`. | ||
* Example for multiple previews: `['squirrel-girl', 'mister-fantastic']`. | ||
*/ | ||
previews?: string[]; | ||
}; | ||
/** | ||
* Pass custom meta information for the request. The `request` object will be returned as is. | ||
*/ | ||
request?: OctokitRequestOptions; | ||
/** | ||
* Any additional parameter will be passed as follows | ||
* 1. URL parameter if `':parameter'` or `{parameter}` is part of `url` | ||
* 2. Query parameter if `method` is `'GET'` or `'HEAD'` | ||
* 3. Request body if `parameter` is `'data'` | ||
* 4. JSON in the request body in the form of `body[parameter]` unless `parameter` key is `'data'` | ||
*/ | ||
[parameter: string]: any; | ||
}; | ||
export declare type OctokitRequestOptions = { | ||
/** | ||
* Node only. Useful for custom proxy, certificate, or dns lookup. | ||
*/ | ||
agent?: Agent; | ||
/** | ||
* Custom replacement for built-in fetch method. Useful for testing or request hooks. | ||
*/ | ||
fetch?: Fetch; | ||
/** | ||
* Use an `AbortController` instance to cancel a request. In node you can only cancel streamed requests. | ||
*/ | ||
signal?: Signal; | ||
/** | ||
* Node only. Request/response timeout in ms, it resets on redirect. 0 to disable (OS limit applies). `options.request.signal` is recommended instead. | ||
*/ | ||
timeout?: number; | ||
[option: string]: any; | ||
}; | ||
export declare type RequestHeaders = { | ||
/** | ||
* Avoid setting `accept`, use `mediaFormat.{format|previews}` instead. | ||
*/ | ||
accept?: string; | ||
/** | ||
* Use `authorization` to send authenticated request, remember `token ` / `bearer ` prefixes. Example: `token 1234567890abcdef1234567890abcdef12345678` | ||
*/ | ||
authorization?: string; | ||
/** | ||
* `user-agent` is set do a default and can be overwritten as needed. | ||
*/ | ||
"user-agent"?: string; | ||
[header: string]: string | number | undefined; | ||
}; | ||
export declare type ResponseHeaders = { | ||
[header: string]: string; | ||
}; | ||
export declare type OctokitResponse<T> = { | ||
headers: ResponseHeaders; | ||
/** | ||
* http response code | ||
*/ | ||
status: number; | ||
/** | ||
* URL of response after all redirects | ||
*/ | ||
url: string; | ||
/** | ||
* This is the data you would see in https://developer.Octokit.com/v3/ | ||
*/ | ||
data: T; | ||
}; | ||
export declare type AnyResponse = OctokitResponse<any>; | ||
export declare type Defaults = Parameters & { | ||
method: Method; | ||
baseUrl: string; | ||
headers: RequestHeaders & { | ||
accept: string; | ||
"user-agent": string; | ||
}; | ||
mediaType: { | ||
format: string; | ||
previews: string[]; | ||
}; | ||
}; |
{ | ||
"name": "@octokit/auth-token", | ||
"description": "GitHub API token authentication for browsers and Node.js", | ||
"version": "2.0.2", | ||
"version": "2.1.0", | ||
"license": "MIT", | ||
@@ -24,9 +24,10 @@ "files": [ | ||
"dependencies": { | ||
"@octokit/request": "^5.0.1" | ||
"@octokit/types": "^1.0.0" | ||
}, | ||
"devDependencies": { | ||
"@octokit/request": "^5.3.0", | ||
"@pika/pack": "^0.5.0", | ||
"@pika/plugin-build-node": "^0.6.0", | ||
"@pika/plugin-build-web": "^0.6.0", | ||
"@pika/plugin-ts-standard-pkg": "^0.6.0", | ||
"@pika/plugin-build-node": "^0.7.0", | ||
"@pika/plugin-build-web": "^0.7.0", | ||
"@pika/plugin-ts-standard-pkg": "^0.7.0", | ||
"@types/fetch-mock": "^7.3.1", | ||
@@ -46,3 +47,3 @@ "@types/jest": "^24.0.13", | ||
"main": "dist-node/index.js", | ||
"module": "dist-web/index.js" | ||
"deno": "dist-web/index.js" | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
17677
12
107
+ Added@octokit/types@^1.0.0
+ Added@octokit/types@1.1.0(transitive)
+ Added@types/node@12.20.55(transitive)
- Removed@octokit/request@^5.0.1
- Removed@octokit/endpoint@6.0.12(transitive)
- Removed@octokit/openapi-types@12.11.0(transitive)
- Removed@octokit/request@5.6.3(transitive)
- Removed@octokit/request-error@2.1.0(transitive)
- Removed@octokit/types@6.41.0(transitive)
- Removeddeprecation@2.3.1(transitive)
- Removedis-plain-object@5.0.0(transitive)
- Removednode-fetch@2.7.0(transitive)
- Removedonce@1.4.0(transitive)
- Removedtr46@0.0.3(transitive)
- Removeduniversal-user-agent@6.0.1(transitive)
- Removedwebidl-conversions@3.0.1(transitive)
- Removedwhatwg-url@5.0.0(transitive)
- Removedwrappy@1.0.2(transitive)