UNPKG

@commercelayer/sdk

Version:
35 lines (32 loc) 1.7 kB
import { ApiError } from './error.js'; import { b as RequestInterceptor, c as ErrorInterceptor, d as ResponseInterceptor, I as InterceptorType, e as RawResponseReader } from './interceptor-k15jXzf0.js'; import { s as ResourcesInitConfig } from './api-CAxIMq4w.js'; import './client.js'; import './types.js'; declare const OPEN_API_SCHEMA_VERSION = "7.9.9"; type SdkConfig = {}; type CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig; type CommerceLayerConfig = Partial<CommerceLayerInitConfig>; declare class CommerceLayerClient { readonly openApiSchemaVersion = "7.9.9"; protected static cl: CommerceLayerClient; static get(config?: CommerceLayerInitConfig): CommerceLayerClient; protected constructor(config: CommerceLayerInitConfig); get currentOrganization(): string; get currentAccessToken(): string; private get interceptors(); private localConfig; config(config: CommerceLayerConfig): this; resources(sort?: boolean): readonly string[]; isApiError(error: any): error is ApiError; addRequestInterceptor(onSuccess?: RequestInterceptor, onFailure?: ErrorInterceptor): number; addResponseInterceptor(onSuccess?: ResponseInterceptor, onFailure?: ErrorInterceptor): number; removeInterceptor(type: InterceptorType, id?: number): void; removeInterceptors(): void; addRawResponseReader(options?: { headers: boolean; }): RawResponseReader; removeRawResponseReader(): void; } declare const CommerceLayer: (config: CommerceLayerInitConfig) => CommerceLayerClient; export { CommerceLayer, CommerceLayerClient, type CommerceLayerConfig, type CommerceLayerInitConfig, OPEN_API_SCHEMA_VERSION, CommerceLayer as default };