import { ClientCredentialsConfiguration, CommerceAPI, CommonArgs, GetProductsArgs, OAuthRestClientInterface, Product, CustomerGroup, PaginationArgs } from '../../../../common'; import { CodecPropertyConfig, CommerceCodecType, CommerceCodec } from '../../core'; import { StringProperty } from '../../../cms-property-types'; import { AxiosRequestConfig } from 'axios'; import { SFCCProduct } from './types'; /** * SFCC Codec config properties. */ declare type CodecConfig = ClientCredentialsConfiguration & { api_token: StringProperty; site_id: StringProperty; version?: StringProperty; }; /** * Commerce Codec Type that integrates with SFCC. */ export declare class SFCCCommerceCodecType extends CommerceCodecType { /** * @inheritdoc */ get vendor(): string; /** * @inheritdoc */ get properties(): CodecConfig; /** * @inheritdoc */ getApi(config: CodecPropertyConfig): Promise; /** * @inheritdoc */ postProcess(config: CodecConfig): Promise; } /** * Commerce Codec that integrates with SFCC. */ export declare class SFCCCommerceCodec extends CommerceCodec { config: CodecPropertyConfig; rest: OAuthRestClientInterface; shopApi: string; sitesApi: string; getPage: (client: OAuthRestClientInterface, url: string, params?: any) => (page: number, pageSize: number) => Promise<{ data: T[]; total: number; }>; getPageAxios: (axios: import("axios").AxiosStatic, url: string, config: AxiosRequestConfig, params?: any) => (page: number, pageSize: number) => Promise<{ data: T[]; total: number; }>; /** * @inheritdoc */ init(codecType: CommerceCodecType): Promise; /** * @inheritdoc */ cacheCategoryTree(): Promise; /** * Gets the request config based off of the configuration parameters * @returns Axios request config */ axiosConfig(): AxiosRequestConfig; /** * Fetches data from the unauthenticated axios client. * @param url URL to fetch data from * @returns Response data */ fetch(url: string): Promise; /** * Fetches data from the OAuth authenticated client. * @param url URL to fetch data from * @returns Response data */ authenticatedFetch(url: string): Promise; /** * Gets an SFCC product by ID. * @param productId Product ID to fetch * @returns SFCC product */ getProductById(productId: string): Promise; /** * Lists SFCC products for a given search query. * @param query Search query * @param args Pagination arguments, new cursor and offset is written back into the object. * @returns List of SFCC products */ search(query: string, args: PaginationArgs): Promise; /** * @inheritdoc */ getRawProducts(args: GetProductsArgs, method?: string): Promise; /** * @inheritdoc */ getProducts(args: GetProductsArgs): Promise; /** * @inheritdoc */ getCustomerGroups(args: CommonArgs): Promise; } export default SFCCCommerceCodecType;