UNPKG

@sp-api-sdk/auth

Version:
30 lines (29 loc) 927 B
import { type RequireExactlyOne } from 'type-fest'; import { type AuthorizationScope } from './types/scope'; export interface SellingPartnerAuthParameters { clientId?: string; clientSecret?: string; refreshToken?: string; scopes?: AuthorizationScope[]; } /** * Class for simplify auth with Selling Partner API */ export declare class SellingPartnerApiAuth { #private; private readonly clientId; private readonly clientSecret; private readonly refreshToken?; private readonly scopes?; constructor(parameters: RequireExactlyOne<SellingPartnerAuthParameters, 'refreshToken' | 'scopes'>); /** * Get access token */ getAccessToken(): Promise<string>; /** * Access token expiration date */ protected get accessTokenExpiration(): Date | undefined; } export { SellingPartnerApiAuthError } from './error'; export { AuthorizationScope } from './types/scope';