UNPKG

ordercloud-javascript-sdk

Version:

The offical Javascript SDK for the Ordercloud ecommerce API

30 lines (29 loc) 1.3 kB
import { IdentityToken } from '../models/IdentityToken'; import { RequiredDeep } from '../models/RequiredDeep'; import { RequestOptions } from '../models/RequestOptions'; declare class UserInfo { private impersonating; /** * @ignore * not part of public api, don't include in generated docs */ constructor(); /** * Get the identity token for an OrderCloud user. Used for Discover 2 integration. * * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ GetToken(requestOptions?: RequestOptions): Promise<RequiredDeep<IdentityToken>>; /** * @description * enables impersonation by calling the subsequent method with the stored impersonation token * * @example * UserInfo.As().Get() // Gets userinfo token for the impersonated users' token */ As(): this; } declare const _default: UserInfo; export default _default;