Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@octokit/oauth-app

Package Overview
Dependencies
Maintainers
4
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@octokit/oauth-app - npm Package Compare versions

Comparing version 6.0.0 to 6.1.0

2

dist-node/index.js

@@ -45,3 +45,3 @@ "use strict";

// pkg/dist-src/version.js
var VERSION = "6.0.0";
var VERSION = "6.1.0";

@@ -48,0 +48,0 @@ // pkg/dist-src/add-event-handler.js

@@ -7,33 +7,33 @@ import { createOAuthAppAuth } from "@octokit/auth-oauth-app";

getUserOctokitWithState
} from "./methods/get-user-octokit";
} from "./methods/get-user-octokit.js";
import {
getWebFlowAuthorizationUrlWithState
} from "./methods/get-web-flow-authorization-url";
} from "./methods/get-web-flow-authorization-url.js";
import {
createTokenWithState
} from "./methods/create-token";
} from "./methods/create-token.js";
import {
checkTokenWithState
} from "./methods/check-token";
} from "./methods/check-token.js";
import {
resetTokenWithState
} from "./methods/reset-token";
} from "./methods/reset-token.js";
import {
refreshTokenWithState
} from "./methods/refresh-token";
} from "./methods/refresh-token.js";
import {
scopeTokenWithState
} from "./methods/scope-token";
} from "./methods/scope-token.js";
import {
deleteTokenWithState
} from "./methods/delete-token";
} from "./methods/delete-token.js";
import {
deleteAuthorizationWithState
} from "./methods/delete-authorization";
import { handleRequest } from "./middleware/handle-request";
import { unknownRouteResponse } from "./middleware/unknown-route-response";
import { createNodeMiddleware } from "./middleware/node/index";
import { sendResponse } from "./middleware/node/send-response";
import { createWebWorkerHandler } from "./middleware/web-worker/index";
import { createAWSLambdaAPIGatewayV2Handler } from "./middleware/aws-lambda/api-gateway-v2";
} from "./methods/delete-authorization.js";
import { handleRequest } from "./middleware/handle-request.js";
import { unknownRouteResponse } from "./middleware/unknown-route-response.js";
import { createNodeMiddleware } from "./middleware/node/index.js";
import { sendResponse } from "./middleware/node/send-response.js";
import { createWebWorkerHandler } from "./middleware/web-worker/index.js";
import { createAWSLambdaAPIGatewayV2Handler } from "./middleware/aws-lambda/api-gateway-v2.js";
class OAuthApp {

@@ -40,0 +40,0 @@ static {

import * as OAuthAppAuth from "@octokit/auth-oauth-app";
import { emitEvent } from "../emit-event";
import { emitEvent } from "../emit-event.js";
async function createTokenWithState(state, options) {

@@ -4,0 +4,0 @@ const authentication = await state.octokit.auth({

import * as OAuthMethods from "@octokit/oauth-methods";
import { createUnauthenticatedAuth } from "@octokit/auth-unauthenticated";
import { emitEvent } from "../emit-event";
import { emitEvent } from "../emit-event.js";
async function deleteAuthorizationWithState(state, options) {

@@ -5,0 +5,0 @@ const optionsWithDefaults = {

import * as OAuthMethods from "@octokit/oauth-methods";
import { createUnauthenticatedAuth } from "@octokit/auth-unauthenticated";
import { emitEvent } from "../emit-event";
import { emitEvent } from "../emit-event.js";
async function deleteTokenWithState(state, options) {

@@ -5,0 +5,0 @@ const optionsWithDefaults = {

function getOAuthClientCode() {
return `import { Octokit: Core } from "https://cdn.pika.dev/@octokit/core";
return `import { Octokit: Core } from "https://esm.sh/@octokit/core";

@@ -4,0 +4,0 @@ export const Octokit = Core.defaults({

import { createOAuthUserAuth } from "@octokit/auth-oauth-user";
import { emitEvent } from "../emit-event";
import { emitEvent } from "../emit-event.js";
async function getUserOctokitWithState(state, options) {

@@ -4,0 +4,0 @@ return state.octokit.auth({

import * as OAuthMethods from "@octokit/oauth-methods";
import { emitEvent } from "../emit-event";
import { emitEvent } from "../emit-event.js";
import { createOAuthUserAuth } from "@octokit/auth-oauth-user";

@@ -4,0 +4,0 @@ async function refreshTokenWithState(state, options) {

import * as OAuthMethods from "@octokit/oauth-methods";
import { emitEvent } from "../emit-event";
import { emitEvent } from "../emit-event.js";
import { createOAuthUserAuth } from "@octokit/auth-oauth-user";

@@ -4,0 +4,0 @@ async function resetTokenWithState(state, options) {

import * as OAuthMethods from "@octokit/oauth-methods";
import { createOAuthUserAuth } from "@octokit/auth-oauth-user";
import { emitEvent } from "../emit-event";
import { emitEvent } from "../emit-event.js";
async function scopeTokenWithState(state, options) {

@@ -5,0 +5,0 @@ if (state.clientType === "oauth-app") {

import { parseRequest } from "./api-gateway-v2-parse-request";
import { sendResponse } from "./api-gateway-v2-send-response";
import { handleRequest } from "../handle-request";
import { sendResponse } from "./api-gateway-v2-send-response.js";
import { handleRequest } from "../handle-request.js";
function createAWSLambdaAPIGatewayV2Handler(app, options = {}) {

@@ -5,0 +5,0 @@ return async function(event) {

@@ -1,3 +0,3 @@

import { OAuthApp } from "../index";
import { unknownRouteResponse } from "./unknown-route-response";
import { OAuthApp } from "../index.js";
import { unknownRouteResponse } from "./unknown-route-response.js";
async function handleRequest(app, { pathPrefix = "/api/github/oauth" }, request) {

@@ -4,0 +4,0 @@ if (request.method === "OPTIONS") {

@@ -1,4 +0,4 @@

import { parseRequest } from "./parse-request";
import { sendResponse } from "./send-response";
import { handleRequest } from "../handle-request";
import { parseRequest } from "./parse-request.js";
import { sendResponse } from "./send-response.js";
import { handleRequest } from "../handle-request.js";
function createNodeMiddleware(app, options = {}) {

@@ -5,0 +5,0 @@ return async function(request, response, next) {

@@ -1,4 +0,4 @@

import { parseRequest } from "./parse-request";
import { sendResponse } from "./send-response";
import { handleRequest } from "../handle-request";
import { parseRequest } from "./parse-request.js";
import { sendResponse } from "./send-response.js";
import { handleRequest } from "../handle-request.js";
function createWebWorkerHandler(app, options = {}) {

@@ -5,0 +5,0 @@ return async function(request) {

import { Octokit } from "@octokit/core";
import { getUserAgent } from "universal-user-agent";
import { VERSION } from "./version";
import { VERSION } from "./version.js";
const OAuthAppOctokit = Octokit.defaults({

@@ -5,0 +5,0 @@ userAgent: `octokit-oauth-app.js/${VERSION} ${getUserAgent()}`

@@ -1,4 +0,4 @@

const VERSION = "6.0.0";
const VERSION = "6.1.0";
export {
VERSION
};

@@ -1,2 +0,2 @@

import type { EventHandler, EventAndActionName, State, ClientType, Options } from "./types";
import type { EventHandler, EventAndActionName, State, ClientType, Options } from "./types.js";
export declare function addEventHandler(state: State, eventName: EventAndActionName | EventAndActionName[], eventHandler: EventHandler<Options<ClientType>>): void;

@@ -1,2 +0,2 @@

import type { State, EventHandlerContext, ClientType, Options } from "./types";
import type { State, EventHandlerContext, ClientType, Options } from "./types.js";
export declare function emitEvent(state: State, context: EventHandlerContext<Options<ClientType>>): Promise<void>;

@@ -1,18 +0,18 @@

import { type GetUserOctokitWithStateInterface } from "./methods/get-user-octokit";
import { type GetWebFlowAuthorizationUrlInterface } from "./methods/get-web-flow-authorization-url";
import { type CreateTokenInterface } from "./methods/create-token";
import { type CheckTokenInterface } from "./methods/check-token";
import { type ResetTokenInterface } from "./methods/reset-token";
import { type RefreshTokenInterface } from "./methods/refresh-token";
import { type ScopeTokenInterface } from "./methods/scope-token";
import { type DeleteTokenInterface } from "./methods/delete-token";
import { type DeleteAuthorizationInterface } from "./methods/delete-authorization";
import type { AddEventHandler, ClientType, ClientTypeFromOptions, ConstructorOptions, OctokitTypeFromOptions, Options } from "./types";
export type { HandlerOptions, OctokitRequest, OctokitResponse, } from "./middleware/types";
export { handleRequest } from "./middleware/handle-request";
export { unknownRouteResponse } from "./middleware/unknown-route-response";
export { createNodeMiddleware } from "./middleware/node/index";
export { sendResponse as sendNodeResponse } from "./middleware/node/send-response";
export { createWebWorkerHandler } from "./middleware/web-worker/index";
export { createAWSLambdaAPIGatewayV2Handler } from "./middleware/aws-lambda/api-gateway-v2";
import { type GetUserOctokitWithStateInterface } from "./methods/get-user-octokit.js";
import { type GetWebFlowAuthorizationUrlInterface } from "./methods/get-web-flow-authorization-url.js";
import { type CreateTokenInterface } from "./methods/create-token.js";
import { type CheckTokenInterface } from "./methods/check-token.js";
import { type ResetTokenInterface } from "./methods/reset-token.js";
import { type RefreshTokenInterface } from "./methods/refresh-token.js";
import { type ScopeTokenInterface } from "./methods/scope-token.js";
import { type DeleteTokenInterface } from "./methods/delete-token.js";
import { type DeleteAuthorizationInterface } from "./methods/delete-authorization.js";
import type { AddEventHandler, ClientType, ClientTypeFromOptions, ConstructorOptions, OctokitTypeFromOptions, Options } from "./types.js";
export type { HandlerOptions, OctokitRequest, OctokitResponse, } from "./middleware/types.js";
export { handleRequest } from "./middleware/handle-request.js";
export { unknownRouteResponse } from "./middleware/unknown-route-response.js";
export { createNodeMiddleware } from "./middleware/node/index.js";
export { sendResponse as sendNodeResponse } from "./middleware/node/send-response.js";
export { createWebWorkerHandler } from "./middleware/web-worker/index.js";
export { createAWSLambdaAPIGatewayV2Handler } from "./middleware/aws-lambda/api-gateway-v2.js";
type Constructor<T> = new (...args: any[]) => T;

@@ -19,0 +19,0 @@ export declare class OAuthApp<TOptions extends Options<ClientType> = Options<"oauth-app">> {

import * as OAuthMethods from "@octokit/oauth-methods";
import type { ClientType, State } from "../types";
import type { ClientType, State } from "../types.js";
export type CheckTokenOptions = {

@@ -4,0 +4,0 @@ token: string;

import * as OAuthAppAuth from "@octokit/auth-oauth-app";
import type { ClientType, State } from "../types";
import type { ClientType, GithubAppUserAuthenticationWithOptionalExpiration, State } from "../types.js";
export type CreateTokenWebFlowOptions = Omit<OAuthAppAuth.WebFlowAuthOptions, "type">;

@@ -13,5 +13,3 @@ export type CreateTokenOAuthAppDeviceFlowOptions = Omit<OAuthAppAuth.OAuthAppDeviceFlowAuthOptions, "type">;

}> : Promise<{
authentication: OAuthAppAuth.GitHubAppUserAuthentication;
} | {
authentication: OAuthAppAuth.GitHubAppUserAuthenticationWithExpiration;
authentication: GithubAppUserAuthenticationWithOptionalExpiration;
}>;

@@ -21,6 +19,4 @@ (options: TClientType extends "oauth-app" ? CreateTokenOAuthAppDeviceFlowOptions : CreateTokenGitHubAppDeviceFlowOptions): TClientType extends "oauth-app" ? Promise<{

}> : Promise<{
authentication: OAuthAppAuth.GitHubAppUserAuthentication;
} | {
authentication: OAuthAppAuth.GitHubAppUserAuthenticationWithExpiration;
authentication: GithubAppUserAuthenticationWithOptionalExpiration;
}>;
}
import * as OAuthMethods from "@octokit/oauth-methods";
import type { State } from "../types";
import type { State } from "../types.js";
export type DeleteAuthorizationOptions = {

@@ -4,0 +4,0 @@ token: string;

import * as OAuthMethods from "@octokit/oauth-methods";
import type { State } from "../types";
import type { State } from "../types.js";
export type DeleteTokenOptions = {

@@ -4,0 +4,0 @@ token: string;

import type { OAuthAppStrategyOptionsWebFlow, OAuthAppStrategyOptionsDeviceFlow, OAuthAppStrategyOptionsExistingAuthentication, GitHubAppStrategyOptionsWebFlow, GitHubAppStrategyOptionsDeviceFlow, GitHubAppStrategyOptionsExistingAuthentication, GitHubAppStrategyOptionsExistingAuthenticationWithExpiration } from "@octokit/auth-oauth-user";
import type { State, OctokitInstance, ClientType } from "../types";
import type { State, OctokitInstance, ClientType } from "../types.js";
type StateOptions = "clientType" | "clientId" | "clientSecret" | "request";

@@ -4,0 +4,0 @@ export type GetUserOctokitOAuthAppOptions = Omit<OAuthAppStrategyOptionsWebFlow, StateOptions> | Omit<OAuthAppStrategyOptionsDeviceFlow, StateOptions> | Omit<OAuthAppStrategyOptionsExistingAuthentication, StateOptions>;

import * as OAuthMethods from "@octokit/oauth-methods";
import type { ClientType, State } from "../types";
import type { ClientType, State } from "../types.js";
type StateOptions = "clientType" | "clientId" | "clientSecret" | "request";

@@ -4,0 +4,0 @@ export type GetWebFlowAuthorizationUrlOAuthAppOptions = Omit<OAuthMethods.GetWebFlowAuthorizationUrlOAuthAppOptions, StateOptions>;

import * as OAuthMethods from "@octokit/oauth-methods";
import type { State } from "../types";
import type { State } from "../types.js";
export type RefreshTokenOptions = {

@@ -4,0 +4,0 @@ refreshToken: string;

import * as OAuthMethods from "@octokit/oauth-methods";
import type { ClientType, State } from "../types";
import type { ClientType, State } from "../types.js";
export type ResetTokenOptions = {

@@ -4,0 +4,0 @@ token: string;

import * as OAuthMethods from "@octokit/oauth-methods";
import type { State } from "../types";
import type { State } from "../types.js";
type StateOptions = "clientType" | "clientId" | "clientSecret" | "request";

@@ -4,0 +4,0 @@ export type ScopeTokenOptions = Omit<OAuthMethods.ScopeTokenOptions, StateOptions>;

@@ -1,3 +0,3 @@

import type { OctokitRequest } from "../types";
import type { OctokitRequest } from "../types.js";
import type { APIGatewayProxyEventV2 } from "aws-lambda";
export declare function parseRequest(request: APIGatewayProxyEventV2): OctokitRequest;

@@ -1,3 +0,3 @@

import type { OctokitResponse } from "../types";
import type { OctokitResponse } from "../types.js";
import type { APIGatewayProxyStructuredResultV2 } from "aws-lambda";
export declare function sendResponse(octokitResponse: OctokitResponse): APIGatewayProxyStructuredResultV2;

@@ -1,5 +0,5 @@

import type { HandlerOptions } from "../types";
import type { OAuthApp } from "../../index";
import type { ClientType, Options } from "../../types";
import type { HandlerOptions } from "../types.js";
import type { OAuthApp } from "../../index.js";
import type { ClientType, Options } from "../../types.js";
import type { APIGatewayProxyEventV2, APIGatewayProxyStructuredResultV2 } from "aws-lambda";
export declare function createAWSLambdaAPIGatewayV2Handler(app: OAuthApp<Options<ClientType>>, options?: HandlerOptions): (event: APIGatewayProxyEventV2) => Promise<APIGatewayProxyStructuredResultV2 | undefined>;

@@ -1,4 +0,4 @@

import { OAuthApp } from "../index";
import type { HandlerOptions, OctokitRequest, OctokitResponse } from "./types";
import type { ClientType, Options } from "../types";
import { OAuthApp } from "../index.js";
import type { HandlerOptions, OctokitRequest, OctokitResponse } from "./types.js";
import type { ClientType, Options } from "../types.js";
export declare function handleRequest(app: OAuthApp<Options<ClientType>>, { pathPrefix }: HandlerOptions, request: OctokitRequest): Promise<OctokitResponse | undefined>;
type IncomingMessage = any;
type ServerResponse = any;
import type { OAuthApp } from "../../index";
import type { HandlerOptions } from "../types";
import type { ClientType, Options } from "../../types";
import type { OAuthApp } from "../../index.js";
import type { HandlerOptions } from "../types.js";
import type { ClientType, Options } from "../../types.js";
export declare function createNodeMiddleware(app: OAuthApp<Options<ClientType>>, options?: HandlerOptions): (request: IncomingMessage, response: ServerResponse, next?: Function) => Promise<boolean>;
export {};
type IncomingMessage = any;
import type { OctokitRequest } from "../types";
import type { OctokitRequest } from "../types.js";
export declare function parseRequest(request: IncomingMessage): OctokitRequest;
export {};
type ServerResponse = any;
import type { OctokitResponse } from "../types";
import type { OctokitResponse } from "../types.js";
export declare function sendResponse(octokitResponse: OctokitResponse, response: ServerResponse): void;
export {};

@@ -1,2 +0,2 @@

import type { OctokitRequest } from "./types";
import type { OctokitRequest } from "./types.js";
export declare function unknownRouteResponse(request: OctokitRequest): {

@@ -3,0 +3,0 @@ status: number;

@@ -1,4 +0,4 @@

import type { OAuthApp } from "../../index";
import type { HandlerOptions } from "../types";
import type { ClientType, Options } from "../../types";
import type { OAuthApp } from "../../index.js";
import type { HandlerOptions } from "../types.js";
import type { ClientType, Options } from "../../types.js";
export declare function createWebWorkerHandler<T extends Options<ClientType>>(app: OAuthApp<T>, options?: HandlerOptions): (request: Request) => Promise<Response | undefined>;

@@ -1,2 +0,2 @@

import type { OctokitRequest } from "../types";
import type { OctokitRequest } from "../types.js";
export declare function parseRequest(request: Request): OctokitRequest;

@@ -1,2 +0,2 @@

import type { OctokitResponse } from "../types";
import type { OctokitResponse } from "../types.js";
export declare function sendResponse(octokitResponse: OctokitResponse): Response;

@@ -6,2 +6,3 @@ import { Octokit } from "@octokit/core";

export type OAuthAppOctokitClassType = typeof OAuthAppOctokit;
export type GithubAppUserAuthenticationWithOptionalExpiration = GitHubAppUserAuthentication & Partial<GitHubAppUserAuthenticationWithExpiration>;
export type Scope = string;

@@ -64,3 +65,3 @@ export type ClientId = string;

octokit: OctokitTypeFromOptions<TOptions>;
authentication?: GitHubAppUserAuthentication | GitHubAppUserAuthenticationWithExpiration;
authentication?: GithubAppUserAuthenticationWithOptionalExpiration;
};

@@ -67,0 +68,0 @@ export type EventHandler<TOptions extends Options<ClientType>> = (context: EventHandlerContext<TOptions>) => void;

@@ -1,1 +0,1 @@

export declare const VERSION = "6.0.0";
export declare const VERSION = "6.1.0";
{
"name": "@octokit/oauth-app",
"version": "6.0.0",
"version": "6.1.0",
"description": "GitHub OAuth toolset for Node.js",

@@ -27,10 +27,10 @@ "repository": "github:octokit/oauth-app.js",

"@types/jest": "^29.0.0",
"@types/node": "^18.0.0",
"esbuild": "^0.18.0",
"@types/node": "^20.0.0",
"esbuild": "^0.19.0",
"express": "^4.17.1",
"fetch-mock": "^9.0.0",
"fetch-mock": "npm:@gr2m/fetch-mock@9.11.0-pull-request-644.1",
"glob": "^10.2.5",
"jest": "^29.0.0",
"nock": "^13.0.0",
"prettier": "3.0.0",
"prettier": "3.2.4",
"semantic-release-plugin-update-version-in-files": "^1.0.0",

@@ -37,0 +37,0 @@ "ts-jest": "^29.0.0",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc