export interface RequestError { message: string; locations: Array<{ line: number; column: number; }>; path: Array; extensions: { errorMessage: string; classification: string; }; } export interface ClientProps { apiUrl: string; environmentId: string; websiteCode: string; storeCode: string; storeViewCode: string; apiKey?: string; contentType?: string; xRequestId?: string; } export interface StoreDetailsConfig { minQueryLength?: number; pageSize?: number; currencySymbol?: string; currencyRate?: string; currentCategoryUrlPath?: string; categoryName?: string; displaySearchBox?: boolean; displayOutOfStock?: string; allowAllProducts?: boolean; displayMode?: string; locale?: string; } export type RedirectRouteFunc = ({ sku, urlKey, identifier, }: { sku: string; urlKey?: string; identifier?: string; }) => string; export type BucketTypename = "ScalarBucket" | "RangeBucket" | "StatsBucket"; export interface MagentoHeaders { environmentId: string; websiteCode: string; storeCode: string; storeViewCode: string; apiKey: string; contentType: string; xRequestId: string; } export interface ProductSearchQuery { phrase: string; pageSize?: number; currentPage?: number; displayOutOfStock?: string; filter?: SearchClauseInput[]; sort?: ProductSearchSortInput[]; xRequestId?: string; context?: QueryContextInput; data?: QueryData; categorySearch?: boolean; } export type QueryResponse = Promise; export interface SearchClauseInput { attribute: string; in?: string[]; eq?: string; range?: { from: number; to: number; }; } export interface ProductSearchSortInput { attribute: string; direction: "ASC" | "DESC"; } export interface QueryContextInput { customerGroup?: string; userViewHistory?: { sku: string; dateTime: string; }[]; } export interface QueryData { products: boolean; facets: boolean; suggestions: boolean; } export type ProductSearchPromise = QueryResponse; export type Sortable = { attribute: string; label: string; numeric: boolean; }; export interface ProductSearchResponse { extensions: { "request-id": string; }; data: { productSearch: { total_count: null | number; items: null | Array; facets: null | Array; suggestions?: null | Array; related_terms?: null | Array; page_info: null | PageInfo; }; }; errors: Array; } export interface Product { product: { __typename: string; id: number; uid: string; name: string; sku: string; description: null | ComplexTextValue; short_description: null | ComplexTextValue; attribute_set_id: null | number; meta_title: null | string; meta_keyword: null | string; meta_description: null | string; image: null | Media; small_image: null | Media; thumbnail: null | Media; new_from_date: null | string; new_to_date: null | string; created_at: null | string; updated_at: null | string; price_range: { minimum_price: Price; maximum_price: Price; }; gift_message_available: null | string; canonical_url: null | string; media_gallery: null | Media; custom_attributes: null | CustomAttribute; add_to_cart_allowed: null | boolean; }; highlights: Array; } export interface ComplexTextValue { html: string; } export interface Money { value: number; currency: string; } export interface Price { fixed_product_taxes: null | { amount: Money; label: string; }; regular_price: Money; final_price: Money; discount: null | { percent_off: number; amount_off: number; }; } export interface Media { url: null | string; label: null | string; position: null | number; disabled: null | boolean; } export interface CustomAttribute { code: string; value: string; } export interface Highlights { attribute: string; value: string; matched_words: Array; } export interface PageInfo { current_page: number; page_size: number; total_pages: number; } export interface Facet { __typename?: BucketTypename; title: string; attribute: string; type?: "PINNED" | "INTELLIGENT" | "POPULAR"; buckets: Array; } export interface RangeBucket { __typename: "RangeBucket"; title: string; from: number; to: number; count: number; } export interface ScalarBucket { __typename: "ScalarBucket"; title: string; id?: string; count: number; } export interface StatsBucket { __typename: "StatsBucket"; title: string; min: number; max: number; } export interface PriceFacet extends Facet { buckets: RangeBucket[]; } export interface FacetFilter { attribute: string; in?: string[]; eq?: string; range?: { from: number; to: number; }; }