Skip to content

Commit

Permalink
Update typescript definitions to match the latest SDK v3.0.2 (#106)
Browse files Browse the repository at this point in the history
* chore: updated index.d.ts

* chore: updated index.d.ts
  • Loading branch information
shlok-kothari authored Nov 8, 2020
1 parent 85012e0 commit 6d3d141
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@ import csrf from 'csrf';

declare class AuthResponse {
constructor(params: AuthResponse.AuthResponseParams);
processResponse(response: Object): void;
getToken(): Token;
text(): string;
status(): number;
headers(): Object;
valid(): boolean;
getJson(): Object;
get_intuit_tid(): string;
isContentType(): boolean;
getContentType(): string;
isJson(): boolean;

}

declare namespace AuthResponse {
Expand Down Expand Up @@ -43,13 +48,14 @@ declare class Token implements Token.TokenData {

declare namespace Token {
export interface TokenData {
realmId: string;
token_type: string;
access_token: string;
refresh_token: string;
realmId?: string;
token_type?: string;
access_token?: string;
refresh_token?: string;
expires_in: number;
x_refresh_token_expires_in: number;
id_token: string;
id_token?: string;
latency: number;
createdAt: string;
}
}
Expand All @@ -61,8 +67,6 @@ declare class OAuthClient {
createError(e: Error, authResponse?: AuthResponse): OAuthClient.OAuthClientError;
createToken(uri: string): Promise<AuthResponse>;
getKeyFromJWKsURI(id_token: string, kid: string, request: Request): Promise<object | string>;
getPublicKey(modulus: string, exponent: string): string;
getToken(): Token;
getTokenRequest(request: Request): Promise<AuthResponse>;
getUserInfo(params?: OAuthClient.GetUserInfoParams): Promise<AuthResponse>;
isAccessTokenValid(): boolean;
Expand All @@ -74,7 +78,7 @@ declare class OAuthClient {
refreshUsingToken(refresh_token: string): Promise<AuthResponse>;
revoke(params?: OAuthClient.RevokeParams): Promise<AuthResponse>;
setToken(params: Token.TokenData): Token;
validateIdToken(params: OAuthClient.ValidateIdTokenParams): Promise<Response>;
validateIdToken(params?: OAuthClient.ValidateIdTokenParams): Promise<Response>;
validateToken(): void;
}

Expand All @@ -84,6 +88,8 @@ declare namespace OAuthClient {
clientSecret: string;
redirectUri?: string;
environment?: string;
token: Token;
logging: boolean;
}

export enum environment {
Expand Down

0 comments on commit 6d3d141

Please sign in to comment.