/** * Pipedrive API v2 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 2.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import { AxiosResponse } from "axios"; export type TokenResponse = { access_token: string; refresh_token: string; token_type: string; expires_in: number; scope: string; api_domain: string; }; export interface Parameters { clientId: string; clientSecret: string; redirectUri: string; host?: string; } export type ParamKey = keyof Parameters; export declare class OAuth2Configuration { host: string; clientId: string; clientSecret: string; basePath: string; onTokenUpdate?: (token: TokenResponse) => void; private axios; private accessToken; private refreshToken; private scope; private expiresIn; private expiresAt; private redirectUri; constructor(params: Parameters); get authorizationUrl(): string; getAccessToken: () => Promise; shouldRefreshToken: () => boolean; /** * Authorizes the authorization code sent by the server and returns OAuth 2 token. * @param {String} code The authorization code sent by the OAuth server. * @returns {Object} The OAuth 2 token. */ authorize: (code: string) => Promise; tokenRefresh: () => Promise; updateToken: (token: TokenResponse | null) => TokenResponse; /** * Revoke Refresh Token aka marking an app uninstalled or revoke the Access Token. * @param {String} tokenTypeHint values can be: 'access_token' or 'refresh_token'. */ revokeToken(tokenTypeHint?: 'access_token' | 'refresh_token'): Promise>; private validateParam; } export interface ConfigurationParameters { apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); formDataCtor?: new () => any; basePath?: string; } export declare class Configuration { /** * parameter for apiKey security * @param name security name * @memberof Configuration */ apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); /** * parameter for basic security * * @type {string} * @memberof Configuration */ username?: string; /** * parameter for basic security * * @type {string} * @memberof Configuration */ password?: string; /** * parameter for oauth2 security * @param name security name * @param scopes oauth2 scope * @memberof Configuration */ accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); /** * override base path * * @type {string} * @memberof Configuration */ basePath?: string; /** * base options for axios calls * * @type {any} * @memberof Configuration */ baseOptions?: any; /** * The FormData constructor that will be used to create multipart form data * requests. You can inject this here so that execution environments that * do not support the FormData class can still run the generated client. * * @type {new () => FormData} */ formDataCtor?: new () => any; constructor(param: ConfigurationParameters); /** * Check if the given MIME is a JSON MIME. * JSON MIME examples: * application/json * application/json; charset=UTF8 * APPLICATION/JSON * application/vnd.company+json * @param mime - MIME (Multipurpose Internet Mail Extensions) * @return True if the given MIME is JSON, false otherwise. */ isJsonMime(mime: string): boolean; }