@types/oauth2orize
Advanced tools
Comparing version 1.11.4 to 1.11.5
@@ -6,13 +6,5 @@ /// <reference types="node" /> | ||
declare global { | ||
namespace Express { | ||
interface Request { | ||
oauth2?: OAuth2 | undefined; | ||
} | ||
} | ||
} | ||
export interface OAuth2 { | ||
client: any; | ||
user: any; | ||
export interface OAuth2<Client = any, User = any> { | ||
client: Client; | ||
user: User; | ||
transactionID: string; | ||
@@ -37,5 +29,5 @@ redirectURI: string; | ||
export interface MiddlewareRequest extends IncomingMessage { | ||
oauth2?: OAuth2 | undefined; | ||
user?: any; | ||
export interface MiddlewareRequest<Client = any, User = any> extends IncomingMessage { | ||
oauth2?: OAuth2<Client, User> | undefined; | ||
user?: User; | ||
} | ||
@@ -47,3 +39,4 @@ | ||
export function createServer(options?: ServerOptions): OAuth2Server; | ||
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics | ||
export function createServer<Client = any, User = any>(options?: ServerOptions): OAuth2Server<Client, User>; | ||
@@ -124,7 +117,15 @@ export interface AuthorizeOptions { | ||
export type MiddlewareFunction = (req: MiddlewareRequest, res: ServerResponse, next: MiddlewareNextFunction) => void; | ||
export type MiddlewareFunction< | ||
Client = any, | ||
User = any, | ||
TReq extends MiddlewareRequest<Client, User> = MiddlewareRequest<Client, User>, | ||
> = ( | ||
req: TReq, | ||
res: ServerResponse, | ||
next: MiddlewareNextFunction, | ||
) => void; | ||
export type MiddlewareErrorFunction = ( | ||
export type MiddlewareErrorFunction<Client = any, User = any> = ( | ||
err: Error, | ||
req: MiddlewareRequest, | ||
req: MiddlewareRequest<Client, User>, | ||
res: ServerResponse, | ||
@@ -136,4 +137,8 @@ next: MiddlewareNextFunction, | ||
export type ValidateDoneFunction = (err: Error | null, client?: any, redirectURI?: string) => void; | ||
export type ValidateFunctionArity5 = ( | ||
export type ValidateDoneFunction<Client = any> = ( | ||
err: Error | null, | ||
client?: Client | false, | ||
redirectURI?: string, | ||
) => void; | ||
export type ValidateFunctionArity5<Client = any> = ( | ||
clientId: string, | ||
@@ -143,16 +148,20 @@ redirectURI: string, | ||
type: string, | ||
validated: ValidateDoneFunction, | ||
validated: ValidateDoneFunction<Client>, | ||
) => void; | ||
export type ValidateFunctionArity4 = ( | ||
export type ValidateFunctionArity4<Client> = ( | ||
clientId: string, | ||
redirectURI: string, | ||
scope: string[], | ||
validated: ValidateDoneFunction, | ||
validated: ValidateDoneFunction<Client>, | ||
) => void; | ||
export type ValidateFunction = (clientId: string, redirectURI: string, validated: ValidateDoneFunction) => void; | ||
export type ValidateFunctionArity2 = (areq: OAuth2Req, validated: ValidateDoneFunction) => void; | ||
export type ValidateFunction<Client = any> = ( | ||
clientId: string, | ||
redirectURI: string, | ||
validated: ValidateDoneFunction<Client>, | ||
) => void; | ||
export type ValidateFunctionArity2<Client = any> = (areq: OAuth2Req, validated: ValidateDoneFunction<Client>) => void; | ||
export type ImmediateFunction = ( | ||
client: any, | ||
user: any, | ||
export type ImmediateFunction<Client = any, User = any> = ( | ||
client: Client, | ||
user: User, | ||
scope: string[], | ||
@@ -164,16 +173,23 @@ type: string, | ||
export type DecisionParseFunction = (req: MiddlewareRequest, done: (err: Error | null, params: any) => void) => void; | ||
export type DecisionParseFunction< | ||
Client = any, | ||
User = any, | ||
TReq extends MiddlewareRequest<Client, User> = MiddlewareRequest<any, any>, | ||
> = ( | ||
req: TReq, | ||
done: (err: Error | null, params?: any) => void, | ||
) => void; | ||
export type SerializeClientFunction = (client: any, done: SerializeClientDoneFunction) => void; | ||
export type SerializeClientFunction<Client = any> = (client: Client, done: SerializeClientDoneFunction) => void; | ||
export type SerializeClientDoneFunction = (err: Error | null, id: string) => void; | ||
export type DeserializeClientFunction = (id: string, done: DeserializeClientDoneFunction) => void; | ||
export type DeserializeClientDoneFunction = (err: Error | null, client?: any | boolean) => void; | ||
export type DeserializeClientFunction<Client = any> = (id: string, done: DeserializeClientDoneFunction<Client>) => void; | ||
export type DeserializeClientDoneFunction<Client = any> = (err: Error | null, client?: Client | boolean) => void; | ||
export type IssueGrantCodeDoneFunction = (err: Error | null, code?: string) => void; | ||
export type IssueGrantCodeFunctionArity7 = ( | ||
client: any, | ||
export type IssueGrantCodeFunctionArity7<Client = any, User = any> = ( | ||
client: Client, | ||
redirectUri: string, | ||
user: any, | ||
user: User, | ||
res: any, | ||
@@ -184,6 +200,6 @@ req: OAuth2Req, | ||
) => void; | ||
export type IssueGrantCodeFunctionArity6 = ( | ||
client: any, | ||
export type IssueGrantCodeFunctionArity6<Client = any, User = any> = ( | ||
client: Client, | ||
redirectUri: string, | ||
user: any, | ||
user: User, | ||
res: any, | ||
@@ -193,25 +209,32 @@ req: OAuth2Req, | ||
) => void; | ||
export type IssueGrantCodeFunction = ( | ||
client: any, | ||
export type IssueGrantCodeFunction<Client = any, User = any> = ( | ||
client: Client, | ||
redirectUri: string, | ||
user: any, | ||
user: User, | ||
res: any, | ||
issued: IssueGrantCodeDoneFunction, | ||
) => void; | ||
export type IssueGrantCodeFunctionArity4 = ( | ||
client: any, | ||
export type IssueGrantCodeFunctionArity4<Client = any, User = any> = ( | ||
client: Client, | ||
redirectUri: string, | ||
user: any, | ||
user: User, | ||
issued: IssueGrantCodeDoneFunction, | ||
) => void; | ||
export type IssueGrantTokenFunction = ( | ||
client: any, | ||
user: any, | ||
export type IssueGrantTokenFunctionArity5<Client = any, User = any> = ( | ||
client: Client, | ||
user: User, | ||
ares: any, | ||
issued: (err: Error | null, code?: string, params?: any) => void, | ||
areq: any, | ||
issued: (err: Error | null, code?: string | boolean, params?: any) => void, | ||
) => void; | ||
export type IssueGrantTokenFunctionArity4<Client = any, User = any> = ( | ||
client: Client, | ||
user: User, | ||
ares: any, | ||
issued: (err: Error | null, code?: string | boolean, params?: any) => void, | ||
) => void; | ||
export type IssueExchangeCodeFunctionArity6 = ( | ||
client: any, | ||
export type IssueExchangeCodeFunctionArity6<Client = any> = ( | ||
client: Client, | ||
code: string, | ||
@@ -223,4 +246,4 @@ redirectURI: string, | ||
) => void; | ||
export type IssueExchangeCodeFunctionArity5 = ( | ||
client: any, | ||
export type IssueExchangeCodeFunctionArity5<Client = any> = ( | ||
client: Client, | ||
code: string, | ||
@@ -231,4 +254,4 @@ redirectURI: string, | ||
) => void; | ||
export type IssueExchangeCodeFunction = ( | ||
client: any, | ||
export type IssueExchangeCodeFunction<Client = any> = ( | ||
client: Client, | ||
code: string, | ||
@@ -246,51 +269,72 @@ redirectURI: string, | ||
export class OAuth2Server { | ||
grant(type: string, fn: MiddlewareFunction): OAuth2Server; | ||
grant(fn: MiddlewareFunction): OAuth2Server; | ||
export class OAuth2Server<Client = any, User = any> { | ||
grant(type: string, fn: MiddlewareFunction<Client, User>): OAuth2Server<Client, User>; | ||
grant(fn: MiddlewareFunction<Client, User>): OAuth2Server<Client, User>; | ||
exchange(type: string, fn: MiddlewareFunction): OAuth2Server; | ||
exchange(fn: MiddlewareFunction): OAuth2Server; | ||
exchange(type: string, fn: MiddlewareFunction<Client, User>): OAuth2Server<Client, User>; | ||
exchange(fn: MiddlewareFunction<Client, User>): OAuth2Server<Client, User>; | ||
authorize( | ||
options: AuthorizeOptions, | ||
validate: ValidateFunctionArity5, | ||
immediate?: ImmediateFunction, | ||
): MiddlewareFunction; | ||
validate: ValidateFunctionArity5<Client>, | ||
immediate?: ImmediateFunction<Client, User>, | ||
): MiddlewareFunction<Client, User>; | ||
authorize( | ||
options: AuthorizeOptions, | ||
validate: ValidateFunctionArity4, | ||
immediate?: ImmediateFunction, | ||
): MiddlewareFunction; | ||
authorize(options: AuthorizeOptions, validate: ValidateFunction, immediate?: ImmediateFunction): MiddlewareFunction; | ||
validate: ValidateFunctionArity4<Client>, | ||
immediate?: ImmediateFunction<Client, User>, | ||
): MiddlewareFunction<Client, User>; | ||
authorize( | ||
options: AuthorizeOptions, | ||
validate: ValidateFunctionArity2, | ||
immediate?: ImmediateFunction, | ||
): MiddlewareFunction; | ||
authorize(validate: ValidateFunctionArity5, immediate?: ImmediateFunction): MiddlewareFunction; | ||
authorize(validate: ValidateFunctionArity4, immediate?: ImmediateFunction): MiddlewareFunction; | ||
authorize(validate: ValidateFunction, immediate?: ImmediateFunction): MiddlewareFunction; | ||
authorize(validate: ValidateFunctionArity2, immediate?: ImmediateFunction): MiddlewareFunction; | ||
validate: ValidateFunction<Client>, | ||
immediate?: ImmediateFunction<Client, User>, | ||
): MiddlewareFunction<Client, User>; | ||
authorize( | ||
options: AuthorizeOptions, | ||
validate: ValidateFunctionArity2<Client>, | ||
immediate?: ImmediateFunction<Client, User>, | ||
): MiddlewareFunction<Client, User>; | ||
authorize( | ||
validate: ValidateFunctionArity5<Client>, | ||
immediate?: ImmediateFunction<Client, User>, | ||
): MiddlewareFunction<Client, User>; | ||
authorize( | ||
validate: ValidateFunctionArity4<Client>, | ||
immediate?: ImmediateFunction<Client, User>, | ||
): MiddlewareFunction<Client, User>; | ||
authorize( | ||
validate: ValidateFunction<Client>, | ||
immediate?: ImmediateFunction<Client, User>, | ||
): MiddlewareFunction<Client, User>; | ||
authorize( | ||
validate: ValidateFunctionArity2<Client>, | ||
immediate?: ImmediateFunction<Client, User>, | ||
): MiddlewareFunction<Client, User>; | ||
authorization: OAuth2Server["authorize"]; | ||
authorization: OAuth2Server<Client, User>["authorize"]; | ||
decision(options: DecisionOptions, parse: DecisionParseFunction): MiddlewareFunction; | ||
decision(parse: DecisionParseFunction): MiddlewareFunction; | ||
decision(): MiddlewareFunction; | ||
decision<TReq extends MiddlewareRequest<Client, User>>( | ||
options: DecisionOptions, | ||
parse: DecisionParseFunction<Client, User, TReq>, | ||
): MiddlewareFunction<Client, User, TReq>; | ||
decision<TReq extends MiddlewareRequest<Client, User>>( | ||
parse: DecisionParseFunction<Client, User, TReq>, | ||
): MiddlewareFunction<Client, User, TReq>; | ||
decision<TReq extends MiddlewareRequest<Client, User>>(): MiddlewareFunction<Client, User, TReq>; | ||
token(options?: any): MiddlewareFunction; | ||
token(options?: any): MiddlewareFunction<Client, User>; | ||
errorHandler(options?: any): MiddlewareErrorFunction; | ||
errorHandler(options?: any): MiddlewareErrorFunction<Client, User>; | ||
serializeClient(fn: SerializeClientFunction): void; | ||
serializeClient(client: any, done: SerializeClientDoneFunction): void; | ||
serializeClient(fn: SerializeClientFunction<Client>): void; | ||
serializeClient(client: Client, done: SerializeClientDoneFunction): void; | ||
deserializeClient(fn: DeserializeClientFunction): void; | ||
deserializeClient(obj: any, done: DeserializeClientDoneFunction): void; | ||
deserializeClient(fn: DeserializeClientFunction<Client>): void; | ||
deserializeClient(obj: any, done: DeserializeClientDoneFunction<Client>): void; | ||
} | ||
export namespace grant { | ||
interface Options { | ||
interface Options<Client = any, User = any> { | ||
modes?: { | ||
query?: (txn: OAuth2, res: ServerResponse, params: Record<string, unknown>) => void; | ||
query?: (txn: OAuth2<Client, User>, res: ServerResponse, params: Record<string, unknown>) => void; | ||
}; | ||
@@ -305,13 +349,45 @@ // For maximum flexibility, multiple scope separators can optionally be | ||
function code(options: Options, issue: IssueGrantCodeFunctionArity7): MiddlewareFunction; | ||
function code(options: Options, issue: IssueGrantCodeFunctionArity6): MiddlewareFunction; | ||
function code(options: Options, issue: IssueGrantCodeFunction): MiddlewareFunction; | ||
function code(options: Options, issue: IssueGrantCodeFunctionArity4): MiddlewareFunction; | ||
function code(issue: IssueGrantCodeFunctionArity7): MiddlewareFunction; | ||
function code(issue: IssueGrantCodeFunctionArity6): MiddlewareFunction; | ||
function code(issue: IssueGrantCodeFunction): MiddlewareFunction; | ||
function code(issue: IssueGrantCodeFunctionArity4): MiddlewareFunction; | ||
function code<Client = any, User = any>( | ||
options: Options<Client, User>, | ||
issue: IssueGrantCodeFunctionArity7<Client, User>, | ||
): MiddlewareFunction<Client, User>; | ||
function code<Client = any, User = any>( | ||
options: Options<Client, User>, | ||
issue: IssueGrantCodeFunctionArity6<Client, User>, | ||
): MiddlewareFunction<Client, User>; | ||
function code<Client = any, User = any>( | ||
options: Options<Client, User>, | ||
issue: IssueGrantCodeFunction<Client, User>, | ||
): MiddlewareFunction<Client, User>; | ||
function code<Client = any, User = any>( | ||
options: Options<Client, User>, | ||
issue: IssueGrantCodeFunctionArity4<Client, User>, | ||
): MiddlewareFunction<Client, User>; | ||
function code<Client = any, User = any>( | ||
issue: IssueGrantCodeFunctionArity7<Client, User>, | ||
): MiddlewareFunction<Client, User>; | ||
function code<Client = any, User = any>( | ||
issue: IssueGrantCodeFunctionArity6<Client, User>, | ||
): MiddlewareFunction<Client, User>; | ||
function code<Client = any, User = any>( | ||
issue: IssueGrantCodeFunction<Client, User>, | ||
): MiddlewareFunction<Client, User>; | ||
function code<Client = any, User = any>( | ||
issue: IssueGrantCodeFunctionArity4<Client, User>, | ||
): MiddlewareFunction<Client, User>; | ||
function token(options: Options, issue: IssueGrantTokenFunction): MiddlewareFunction; | ||
function token(issue: IssueGrantTokenFunction): MiddlewareFunction; | ||
function token<Client = any, User = any>( | ||
options: Options<Client, User>, | ||
issue: IssueGrantTokenFunctionArity5<Client, User>, | ||
): MiddlewareFunction<Client, User>; | ||
function token<Client = any, User = any>( | ||
options: Options<Client, User>, | ||
issue: IssueGrantTokenFunctionArity4<Client, User>, | ||
): MiddlewareFunction<Client, User>; | ||
function token<Client = any, User = any>( | ||
issue: IssueGrantTokenFunctionArity5<Client, User>, | ||
): MiddlewareFunction<Client, User>; | ||
function token<Client = any, User = any>( | ||
issue: IssueGrantTokenFunctionArity4<Client, User>, | ||
): MiddlewareFunction<Client, User>; | ||
} | ||
@@ -333,8 +409,29 @@ | ||
function authorizationCode(options: Options, issue: IssueExchangeCodeFunctionArity6): MiddlewareFunction; | ||
function authorizationCode(options: Options, issue: IssueExchangeCodeFunctionArity5): MiddlewareFunction; | ||
function authorizationCode(options: Options, issue: IssueExchangeCodeFunction): MiddlewareFunction; | ||
function authorizationCode(issue: IssueExchangeCodeFunctionArity6): MiddlewareFunction; | ||
function authorizationCode(issue: IssueExchangeCodeFunctionArity5): MiddlewareFunction; | ||
function authorizationCode(issue: IssueExchangeCodeFunction): MiddlewareFunction; | ||
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics | ||
function authorizationCode<Client = any, User = any>( | ||
options: Options, | ||
issue: IssueExchangeCodeFunctionArity6<Client>, | ||
): MiddlewareFunction<Client, User>; | ||
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics | ||
function authorizationCode<Client = any, User = any>( | ||
options: Options, | ||
issue: IssueExchangeCodeFunctionArity5<Client>, | ||
): MiddlewareFunction<Client, User>; | ||
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics | ||
function authorizationCode<Client = any, User = any>( | ||
options: Options, | ||
issue: IssueExchangeCodeFunction<Client>, | ||
): MiddlewareFunction<Client, User>; | ||
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics | ||
function authorizationCode<Client = any, User = any>( | ||
issue: IssueExchangeCodeFunctionArity6<Client>, | ||
): MiddlewareFunction<Client, User>; | ||
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics | ||
function authorizationCode<Client = any, User = any>( | ||
issue: IssueExchangeCodeFunctionArity5<Client>, | ||
): MiddlewareFunction<Client, User>; | ||
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics | ||
function authorizationCode<Client = any, User = any>( | ||
issue: IssueExchangeCodeFunction<Client>, | ||
): MiddlewareFunction<Client, User>; | ||
@@ -344,31 +441,40 @@ const code: typeof authorizationCode; | ||
// arity == 5; issue(client, scope, req.body, req.authInfo, issued); | ||
function clientCredentials( | ||
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics | ||
function clientCredentials<Client = any, User = any>( | ||
options: Options, | ||
issue: (client: any, scope: string[], body: any, authInfo: any, issued: ExchangeDoneFunction) => void, | ||
): MiddlewareFunction; | ||
issue: (client: Client, scope: string[], body: any, authInfo: any, issued: ExchangeDoneFunction) => void, | ||
): MiddlewareFunction<Client, User>; | ||
// arity == 4; issue(client, scope, req.body, issued); | ||
function clientCredentials( | ||
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics | ||
function clientCredentials<Client = any, User = any>( | ||
options: Options, | ||
issue: (client: any, scope: string[], body: any, issued: ExchangeDoneFunction) => void, | ||
): MiddlewareFunction; | ||
issue: (client: Client, scope: string[], body: any, issued: ExchangeDoneFunction) => void, | ||
): MiddlewareFunction<Client, User>; | ||
// arity == 3; issue(client, scope, issued); | ||
function clientCredentials( | ||
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics | ||
function clientCredentials<Client = any, User = any>( | ||
options: Options, | ||
issue: (client: any, scope: string[], issued: ExchangeDoneFunction) => void, | ||
): MiddlewareFunction; | ||
issue: (client: Client, scope: string[], issued: ExchangeDoneFunction) => void, | ||
): MiddlewareFunction<Client, User>; | ||
// arity == 2; issue(client, issued); | ||
function clientCredentials( | ||
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics | ||
function clientCredentials<Client = any, User = any>( | ||
options: Options, | ||
issue: (client: any, issued: ExchangeDoneFunction) => void, | ||
): MiddlewareFunction; | ||
function clientCredentials( | ||
issue: (client: any, scope: string[], issued: ExchangeDoneFunction) => void, | ||
): MiddlewareFunction; | ||
function clientCredentials(issue: (client: any, issued: ExchangeDoneFunction) => void): MiddlewareFunction; | ||
issue: (client: Client, issued: ExchangeDoneFunction) => void, | ||
): MiddlewareFunction<Client, User>; | ||
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics | ||
function clientCredentials<Client = any, User = any>( | ||
issue: (client: Client, scope: string[], issued: ExchangeDoneFunction) => void, | ||
): MiddlewareFunction<Client, User>; | ||
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics | ||
function clientCredentials<Client = any, User = any>( | ||
issue: (client: Client, issued: ExchangeDoneFunction) => void, | ||
): MiddlewareFunction<Client, User>; | ||
// arity == 7; issue(client, username, passwd, scope, req.body, req.authInfo, issued); | ||
function password( | ||
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics | ||
function password<Client = any, User = any>( | ||
options: Options, | ||
issue: ( | ||
client: any, | ||
client: Client, | ||
username: string, | ||
@@ -381,8 +487,9 @@ password: string, | ||
) => void, | ||
): MiddlewareFunction; | ||
): MiddlewareFunction<Client, User>; | ||
// arity == 6; issue(client, username, passwd, scope, req.body, issued); | ||
function password( | ||
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics | ||
function password<Client = any, User = any>( | ||
options: Options, | ||
issue: ( | ||
client: any, | ||
client: Client, | ||
username: string, | ||
@@ -394,25 +501,42 @@ password: string, | ||
) => void, | ||
): MiddlewareFunction; | ||
): MiddlewareFunction<Client, User>; | ||
// arity == 5; issue(client, username, passwd, scope, issued); | ||
function password( | ||
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics | ||
function password<Client = any, User = any>( | ||
options: Options, | ||
issue: (client: any, username: string, password: string, scope: string[], issued: ExchangeDoneFunction) => void, | ||
): MiddlewareFunction; | ||
issue: ( | ||
client: Client, | ||
username: string, | ||
password: string, | ||
scope: string[], | ||
issued: ExchangeDoneFunction, | ||
) => void, | ||
): MiddlewareFunction<Client, User>; | ||
// arity == 4; issue(client, username, passwd, issued); | ||
function password( | ||
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics | ||
function password<Client = any, User = any>( | ||
options: Options, | ||
issue: (client: any, username: string, password: string, issued: ExchangeDoneFunction) => void, | ||
): MiddlewareFunction; | ||
function password( | ||
issue: (client: any, username: string, password: string, scope: string[], issued: ExchangeDoneFunction) => void, | ||
): MiddlewareFunction; | ||
function password( | ||
issue: (client: any, username: string, password: string, issued: ExchangeDoneFunction) => void, | ||
): MiddlewareFunction; | ||
issue: (client: Client, username: string, password: string, issued: ExchangeDoneFunction) => void, | ||
): MiddlewareFunction<Client, User>; | ||
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics | ||
function password<Client = any, User = any>( | ||
issue: ( | ||
client: Client, | ||
username: string, | ||
password: string, | ||
scope: string[], | ||
issued: ExchangeDoneFunction, | ||
) => void, | ||
): MiddlewareFunction<Client, User>; | ||
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics | ||
function password<Client = any, User = any>( | ||
issue: (client: Client, username: string, password: string, issued: ExchangeDoneFunction) => void, | ||
): MiddlewareFunction<Client, User>; | ||
// arity == 6; issue(client, refreshToken, scope, req.body, req.authInfo, issued); | ||
function refreshToken( | ||
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics | ||
function refreshToken<Client = any, User = any>( | ||
options: Options, | ||
issue: ( | ||
client: any, | ||
client: Client, | ||
refreshToken: string, | ||
@@ -424,24 +548,29 @@ scope: string[], | ||
) => void, | ||
): MiddlewareFunction; | ||
): MiddlewareFunction<Client, User>; | ||
// arity == 5; issue(client, refreshToken, scope, req.body, issued); | ||
function refreshToken( | ||
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics | ||
function refreshToken<Client = any, User = any>( | ||
options: Options, | ||
issue: (client: any, refreshToken: string, scope: string[], body: any, issued: ExchangeDoneFunction) => void, | ||
): MiddlewareFunction; | ||
issue: (client: Client, refreshToken: string, scope: string[], body: any, issued: ExchangeDoneFunction) => void, | ||
): MiddlewareFunction<Client, User>; | ||
// arity == 4; issue(client, refreshToken, scope, issued); | ||
function refreshToken( | ||
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics | ||
function refreshToken<Client = any, User = any>( | ||
options: Options, | ||
issue: (client: any, refreshToken: string, scope: string[], issued: ExchangeDoneFunction) => void, | ||
): MiddlewareFunction; | ||
issue: (client: Client, refreshToken: string, scope: string[], issued: ExchangeDoneFunction) => void, | ||
): MiddlewareFunction<Client, User>; | ||
// arity == 3; issue(client, refreshToken, issued); | ||
function refreshToken( | ||
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics | ||
function refreshToken<Client = any, User = any>( | ||
options: Options, | ||
issue: (client: any, refreshToken: string, issued: ExchangeDoneFunction) => void, | ||
): MiddlewareFunction; | ||
function refreshToken( | ||
issue: (client: any, refreshToken: string, scope: string[], issued: ExchangeDoneFunction) => void, | ||
): MiddlewareFunction; | ||
function refreshToken( | ||
issue: (client: any, refreshToken: string, issued: ExchangeDoneFunction) => void, | ||
): MiddlewareFunction; | ||
issue: (client: Client, refreshToken: string, issued: ExchangeDoneFunction) => void, | ||
): MiddlewareFunction<Client, User>; | ||
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics | ||
function refreshToken<Client = any, User = any>( | ||
issue: (client: Client, refreshToken: string, scope: string[], issued: ExchangeDoneFunction) => void, | ||
): MiddlewareFunction<Client, User>; | ||
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics | ||
function refreshToken<Client = any, User = any>( | ||
issue: (client: Client, refreshToken: string, issued: ExchangeDoneFunction) => void, | ||
): MiddlewareFunction<Client, User>; | ||
} |
{ | ||
"name": "@types/oauth2orize", | ||
"version": "1.11.4", | ||
"version": "1.11.5", | ||
"description": "TypeScript definitions for oauth2orize", | ||
@@ -31,4 +31,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/oauth2orize", | ||
}, | ||
"typesPublisherContentHash": "c3b87babbb022f7db53814f0439b3e480ae427675efa45e5a41dd83e7b0d48e8", | ||
"typesPublisherContentHash": "a074807b2742fff6285d1e80786026fb5dd4c62ea4d969ecbd7974a3c7bdc12d", | ||
"typeScriptVersion": "4.7" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Thu, 14 Mar 2024 07:07:17 GMT | ||
* Last updated: Fri, 22 Mar 2024 13:35:59 GMT | ||
* Dependencies: [@types/express](https://npmjs.com/package/@types/express), [@types/node](https://npmjs.com/package/@types/node) | ||
@@ -14,0 +14,0 @@ |
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
24027
510