Skip to content
Open
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update typescript definitions to match the latest SDK v3.0.2 (#106)
* chore: updated index.d.ts

* chore: updated index.d.ts
  • Loading branch information
shlok-kothari authored Nov 8, 2020
commit 6d3d14120107689ff2e23809ec130acb3ba3cf1f
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