import { CommerceAPI, CommonArgs, GetProductsArgs, Identifiable, Product } from '../../../../common'; import { CodecPropertyConfig, CommerceCodecType, CommerceCodec } from '../../core'; import { StringProperty } from '../../../cms-property-types'; import { AxiosInstance } from 'axios'; import { BigCommerceCorsProduct } from './types'; /** * BigCommerce CORS Codec config properties */ declare type CodecConfig = { api_token: StringProperty; site_id: StringProperty; }; /** * Commerce Codec Type that integrates with BigCommerce and is CORS compatible. */ export declare class BigCommerceCorsCommerceCodecType extends CommerceCodecType { /** * @inheritdoc */ get vendor(): string; /** * @inheritdoc */ get properties(): CodecConfig; /** * @inheritdoc */ getApi(config: CodecPropertyConfig): Promise; } /** * Commerce Codec that integrates with BigCommerce and is CORS compatible. */ export declare class BigCommerceCorsCommerceCodec extends CommerceCodec { config: CodecPropertyConfig; apiClient: AxiosInstance; getPage: (axios: import("axios").AxiosStatic, url: string, config: import("axios").AxiosRequestConfig, params?: any) => (page: number, pageSize: number) => Promise<{ data: T[]; total: number; }>; /** * @inheritdoc */ init(codecType: CommerceCodecType): Promise; /** * Make a request to the Bigcommerce GraphQL API. * @param query The GraphQL query string * @param variables Variables to use with the GraphQL query * @returns GraphQL response data */ gqlRequest(query: string, variables: any): Promise; /** * @inheritdoc */ cacheCategoryTree(): Promise; /** * @inheritdoc */ getProducts(args: GetProductsArgs): Promise; /** * Ensures a given array of identifiable objects has matching position to a list of IDs. * Missing items are replaced with null. * @param ids List of IDs * @param items List of items * @returns Items in the order of the specified ID list */ mapIdentifiers: (ids: string[], items: BigCommerceCorsProduct[]) => (BigCommerceCorsProduct | null)[]; /** * @inheritdoc */ getRawProducts(args: GetProductsArgs, method?: string): Promise; /** * @inheritdoc */ getCustomerGroups(args: CommonArgs): Promise; } export default BigCommerceCorsCommerceCodecType;