Socket
Socket
Sign inDemoInstall

@octokit/oauth-app

Package Overview
Dependencies
Maintainers
2
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 3.0.1 to 3.1.0

54

dist-node/index.js

@@ -15,24 +15,2 @@ 'use strict';

const VERSION = "3.0.1";
function addEventHandler(state, eventName, eventHandler) {
if (Array.isArray(eventName)) {
for (const singleEventName of eventName) {
addEventHandler(state, singleEventName, eventHandler);
}
return;
}
if (!state.eventHandlers[eventName]) {
state.eventHandlers[eventName] = [];
}
state.eventHandlers[eventName].push(eventHandler);
}
const OAuthAppOctokit = core.Octokit.defaults({
userAgent: `octokit-oauth-app.js/${VERSION} ${universalUserAgent.getUserAgent()}`
});
function _defineProperty(obj, key, value) {

@@ -87,2 +65,24 @@ if (key in obj) {

const VERSION = "3.1.0";
function addEventHandler(state, eventName, eventHandler) {
if (Array.isArray(eventName)) {
for (const singleEventName of eventName) {
addEventHandler(state, singleEventName, eventHandler);
}
return;
}
if (!state.eventHandlers[eventName]) {
state.eventHandlers[eventName] = [];
}
state.eventHandlers[eventName].push(eventHandler);
}
const OAuthAppOctokit = core.Octokit.defaults({
userAgent: `octokit-oauth-app.js/${VERSION} ${universalUserAgent.getUserAgent()}`
});
async function getUserOctokitWithState(state, options) {

@@ -694,2 +694,12 @@ return state.octokit.auth(_objectSpread2(_objectSpread2({

static defaults(defaults) {
const OAuthAppWithDefaults = class extends this {
constructor(...args) {
super(_objectSpread2(_objectSpread2({}, defaults), args[0]));
}
};
return OAuthAppWithDefaults;
}
}

@@ -696,0 +706,0 @@ OAuthApp.VERSION = VERSION;

@@ -52,3 +52,14 @@ import { createOAuthAppAuth } from "@octokit/auth-oauth-app";

}
static defaults(defaults) {
const OAuthAppWithDefaults = class extends this {
constructor(...args) {
super({
...defaults,
...args[0],
});
}
};
return OAuthAppWithDefaults;
}
}
OAuthApp.VERSION = VERSION;

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

export const VERSION = "3.0.1";
export const VERSION = "3.1.0";

@@ -12,4 +12,10 @@ import { GetUserOctokitWithStateInterface } from "./methods/get-user-octokit";

export { createNodeMiddleware } from "./middleware/node/index";
declare type Constructor<T> = new (...args: any[]) => T;
export declare class OAuthApp<TClientType extends ClientType = "oauth-app"> {
static VERSION: string;
static defaults<TClientType extends ClientType, S extends Constructor<any>>(this: S, defaults: Partial<ConstructorOptions<TClientType>>): {
new (...args: any[]): {
[x: string]: any;
};
} & S;
constructor(options: ConstructorOptions<TClientType>);

@@ -16,0 +22,0 @@ type: TClientType;

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

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

@@ -6,0 +6,0 @@ "files": [

@@ -17,2 +17,3 @@ # oauth-app.js

- [Examples](#examples)
- [`OAuthApp.defaults(options)`](#oauthappdefaultsoptions)
- [Constructor options](#constructor-options)

@@ -116,2 +117,14 @@ - [`app.on(eventName, eventHandler)`](#apponeventname-eventhandler)

## `OAuthApp.defaults(options)`
Create a new `OAuthApp` with custom defaults for the [constructor options](#constructor-options)
```js
const MyOAuthApp = OAuthApp.defaults({
Octokit: MyOctokit,
});
const app = new MyOAuthApp({ clientId, clientSecret });
// app.octokit is now an instance of MyOctokit
```
## Constructor options

@@ -118,0 +131,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