import { CommerceAPI, CommonArgs, CustomerGroup, GetProductsArgs, PaginationArgs, Product } from '../../../../common'; import { CodecPropertyConfig, CommerceCodecType, CommerceCodec } from '../../core'; import { StringProperty } from '../../../cms-property-types'; import { AxiosInstance } from 'axios'; import { ShopifyProduct } from './types'; /** * Shopify codec configuration. */ declare type CodecConfig = { /** Storefront access token */ access_token: StringProperty; /** Admin access token */ admin_access_token: StringProperty; /** API version */ version: StringProperty; /** Site identifier */ site_id: StringProperty; }; /** * Commerce Codec Type that integrates with Shopify. */ export declare class ShopifyCommerceCodecType extends CommerceCodecType { /** * @inheritdoc */ get vendor(): string; /** * @inheritdoc */ get properties(): CodecConfig; /** * @inheritdoc */ getApi(config: CodecPropertyConfig): Promise; } /** * Commerce Codec that integrates with Shopify. */ export declare class ShopifyCommerceCodec extends CommerceCodec { config: CodecPropertyConfig; apiClient: AxiosInstance; adminApiClient: AxiosInstance; /** * @inheritdoc */ init(codecType: CommerceCodecType): Promise; /** * Make a request to the Shopify GraphQL API. * @param query The GraphQL query string * @param variables Variables to use with the GraphQL query * @param isAdmin Whether the admin credentials must be used or not * @returns GraphQL response data */ gqlRequest(query: string, variables: any, isAdmin?: boolean): Promise; /** * @inheritdoc */ cacheCategoryTree(): Promise; /** * Get a Shopify product by ID. * @param id The ID of the product to fetch * @returns The shopify product */ getProductById(id: string): Promise; /** * Get a list of all Shopify products that match the given keyword. * @param keyword Keyword used to search products * @param args Pagination arguments, new cursor and offset is written back into the object. * @returns A list of all matching products */ getProductsByKeyword(keyword: string, args: PaginationArgs): Promise; /** * Get a list of all Shopify products in the category with the given slug. * @param slug The category slug * * @param args Pagination arguments, new cursor and offset is written back into the object. * @returns A list of all products in the category */ getProductsByCategory(slug: string, args: PaginationArgs): Promise; /** * @inheritdoc */ getProducts(args: GetProductsArgs): Promise; /** * @inheritdoc */ getRawProducts(args: GetProductsArgs): Promise; /** * @inheritdoc */ getCustomerGroups(args: CommonArgs): Promise; } export default ShopifyCommerceCodecType;