import { RestMethod, RestResponse } from './Rest'; import { GetTokenRequest, TokenInfo } from './definitions'; import Restapi from './paths/Restapi'; import Scim from './paths/Scim'; import Rest, { RestOptions, RestRequestConfig } from './Rest'; import SdkExtension from './extensions'; declare type PasswordFlowOptions = { username: string; extension?: string; password: string; }; declare type AuthCodeFlowOptions = { code: string; redirect_uri: string; }; export default class RingCentral { sdkExtensions: SdkExtension[]; rest?: Rest; constructor(restOptions?: RestOptions); installExtension(sdkExtension: SdkExtension): void; get token(): TokenInfo | undefined; set token(token: TokenInfo | undefined); request(method: RestMethod, endpoint: string, content?: {}, queryParams?: {}, config?: RestRequestConfig): Promise>; get(endpoint: string, queryParams?: {}, config?: RestRequestConfig): Promise>; delete(endpoint: string, queryParams?: {}, config?: RestRequestConfig): Promise>; post(endpoint: string, content?: {}, queryParams?: {}, config?: RestRequestConfig): Promise>; put(endpoint: string, content: {}, queryParams?: {}, config?: RestRequestConfig): Promise>; patch(endpoint: string, content: {}, queryParams?: {}, config?: RestRequestConfig): Promise>; getToken(getTokenRequest: GetTokenRequest): Promise; authorize(options: PasswordFlowOptions | AuthCodeFlowOptions): Promise; /** * Each time you call token endpoint using this flow a new client session starts. * It is associated with the issued token pair: access token and refresh token, returned in response to this request. * To continue the session you can refresh the obtained access token and refresh token as many times as you need, using Refresh Token flow or the same flow. * To start another client session you should call token endpoint using this flow again. * * Please consider that only 5 simultaneously active sessions per extension per application are supported. * Thus if you exceed the number of sessions started per extension per application, the oldest one is ended. * * https://developers.ringcentral.com/api-reference/Get-Token * * @param options PasswordLoginFlowOpts */ login(options: PasswordFlowOptions): Promise; /** * Each time you call token endpoint using this flow, you continue current client session, and receive a new token pair: access token and refresh token in response to this request. * The old token pair immediately becomes inactive. * * https://developers.ringcentral.com/api-reference/Get-Token * * @param refreshToken Refresh Token */ refresh(refreshToken?: string): Promise; /** * Each time you call token endpoint using this flow, you continue current client session, and receive a new token pair: access token and refresh token in response to this request. * The old token pair immediately becomes inactive. * * https://developers.ringcentral.com/api-reference/Revoke-Token * * @param tokenToRevoke AccessToken */ revoke(tokenToRevoke?: string): Promise; /** * This method provides you with a start of chain methods `rc.restapi() ...`, * so that you can construct longer ones, like this `rc.restapi().account().extension().messageStore().list()` * * @param apiVersion API version, currently the only valid value is 'v1.0' */ restapi(apiVersion?: string | null): Restapi; /** * This method provides you with a start of chain methods `rc.scim() ...`, * so that you can construct longer ones, like this `rc.scim().users(userId).delete()` * * @param version SCIM API version, currently the only valid value is 'v2' */ scim(version?: string | null): Scim; } export {};