Socket
Socket
Sign inDemoInstall

@octokit/auth-token

Package Overview
Dependencies
2
Maintainers
3
Versions
25
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.2 to 2.1.0

5

dist-types/hook.d.ts

@@ -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>;

2

dist-types/index.d.ts
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"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc