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

@octokit-next/types

Package Overview
Dependencies
Maintainers
2
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@octokit-next/types - npm Package Compare versions

Comparing version 2.3.1 to 2.4.0

auth.d.ts

43

index.d.ts

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

import { RequestInterface } from "./request";
import {
AuthAbstractSrategyInterface,
AuthInterface,
AuthTokenConfig,
} from "./auth";
export { EndpointInterface, KnownEndpointParameters } from "./endpoint";
import { RequestInterface } from "./request";
export { RequestInterface } from "./request";
export * from "./auth";
interface AuthStrategyInterface {
(options?: any): AuthInterface;
}
interface AuthInterface {
(options?: any): Promise<unknown>;
}
type AuthStrategyAndOptions<
AuthStrategy extends AuthStrategyInterface | undefined = undefined
> = AuthStrategy extends undefined
TAuthStrategy extends AuthAbstractSrategyInterface | undefined = undefined
> = TAuthStrategy extends undefined
? { auth?: string }
: AuthStrategy extends AuthStrategyInterface
: TAuthStrategy extends AuthAbstractSrategyInterface
? {
authStrategy: AuthStrategy;
auth: Parameters<AuthStrategy>[0];
authStrategy: TAuthStrategy;
auth: Parameters<TAuthStrategy>[0];
}

@@ -29,3 +29,3 @@ : never;

TVersion extends keyof Octokit.ApiVersions = "github.com",
TAuthStrategy extends AuthStrategyInterface | undefined = undefined
TAuthStrategy extends AuthAbstractSrategyInterface | undefined = undefined
> {

@@ -68,3 +68,3 @@ /**

? string
: TAuthStrategy extends AuthStrategyInterface
: TAuthStrategy extends AuthAbstractSrategyInterface
? Parameters<TAuthStrategy>[0]

@@ -273,3 +273,3 @@ : never;

TVersion extends keyof Octokit.ApiVersions = "github.com",
TAuthStrategy extends AuthStrategyInterface | undefined = undefined,
TAuthStrategy extends AuthAbstractSrategyInterface | undefined = undefined,
TOptions extends Octokit.Options<TVersion, TAuthStrategy> = Octokit.Options<

@@ -336,3 +336,3 @@ TVersion,

TVersion extends keyof Octokit.ApiVersions = "github.com",
TAuthStrategy extends AuthStrategyInterface | undefined = undefined
TAuthStrategy extends AuthAbstractSrategyInterface | undefined = undefined
>(

@@ -413,2 +413,9 @@ this: ClassOne,

request: RequestInterface<TVersion>;
/**
* Authenticate based on used strategy.
*/
auth: TAuthStrategy extends AuthAbstractSrategyInterface
? ReturnType<TAuthStrategy>
: AuthInterface<AuthTokenConfig>;
}

@@ -487,3 +494,3 @@

? // if authStrategy is set and it's a valid auth strategy
PredefinedOptions["authStrategy"] extends AuthStrategyInterface
PredefinedOptions["authStrategy"] extends AuthAbstractSrategyInterface
? // then `options.auth` is required to be set to the strategy options

@@ -490,0 +497,0 @@ {

@@ -7,3 +7,3 @@ {

"type": "module",
"version": "2.3.1",
"version": "2.4.0",
"description": "Shared TypeScript definitions for upcoming Octokit SDK",

@@ -10,0 +10,0 @@ "types": "./index.d.ts",

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