@octokit-next/types
Advanced tools
Comparing version 2.3.1 to 2.4.0
@@ -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", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
31359
7
946
0