diff --git a/types/simple-oauth2/index.d.ts b/types/simple-oauth2/index.d.ts index 8091a56f2d..8c60a38139 100644 --- a/types/simple-oauth2/index.d.ts +++ b/types/simple-oauth2/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for simple-oauth2 2.2 +// Type definitions for simple-oauth2 2.5 // Project: https://github.com/lelylan/simple-oauth2 // Definitions by: Michael Müller , // Troy Lamerton @@ -76,6 +76,8 @@ export interface AuthorizationTokenConfig { code: AuthorizationCode; /** A string that represents the callback uri */ redirect_uri: string; + /** A string or array of strings that represents the application privileges */ + scope: string | string[]; } export interface PasswordTokenConfig { @@ -92,6 +94,27 @@ export interface ClientCredentialTokenConfig { scope?: string | string[]; } +export interface WreckHttpOptions { + baseUrl?: string; + socketPath?: string; + payload?: any; + headers?: { [key: string]: any }; + redirects?: number; + redirect303?: boolean; + beforeRedirect?: (redirectMethod: string, statusCode: number, location: string, resHeaders: { [key: string]: any }, redirectOptions: any, next: () => {}) => void; + redirected?: (statusCode: number, location: string, req: any) => void; + timeout?: number; + maxBytes?: number; + rejectUnauthorized?: boolean; + downstreamRes?: any; + agent?: any; + secureProtocol?: string; + ciphers?: string; + events?: boolean; + json?: true | "strict" | "force"; + gunzip?: boolean | "force"; +} + export interface OAuthClient { authorizationCode: { /** @@ -113,21 +136,21 @@ export interface OAuthClient { ): string, /** Returns the Access Token object */ - getToken(params: AuthorizationTokenConfig): Promise; + getToken(params: AuthorizationTokenConfig, httpOptions?: WreckHttpOptions): Promise; }; ownerPassword: { /** Returns the Access Token Object */ - getToken(params: PasswordTokenConfig): Promise; + getToken(params: PasswordTokenConfig, httpOptions?: WreckHttpOptions): Promise; }; clientCredentials: { /** Returns the Access Token Object */ - getToken(params: ClientCredentialTokenConfig): Promise; + getToken(params: ClientCredentialTokenConfig, httpOptions?: WreckHttpOptions): Promise; }; accessToken: { /** Creates an OAuth2.AccessToken instance */ - create(tokenToUse: Token): AccessToken; + create(tokenToUse: Token, httpOptions?: WreckHttpOptions): AccessToken; }; }