Interface: ProductProvider
Implement this interface for implementing an api which can provide products.
See
AppFeature
Methods
queryProducts
▸ queryProducts(request
): Promise
<{ data?
: { attributeValues?
: Record
<string
, unknown
> = ZAttributeValues; availability?
: { amount?: number; stockId?: string; stockName?: string; attributeValues?: Record<string, unknown>; }[] ; description?
: string
; details?
: Record
<string
, string
> ; grossPrice?
: { value?: number; divisor?: number; currencyCode?: string; } ; gtin?
: string
; id?
: string
; images?
: { url?: string; isDefault?: boolean; attributeValues?: Record<string, unknown>; }[] ; manufacturer?
: string
; name?
: string
; netPrice?
: { value?: number; divisor?: number; currencyCode?: string; } ; sku?
: string
; taxRate?
: number
; variationParentId?
: string
; weightInGrams?
: number
}[] ; nextPageToken?
: string
; pageSize?
: number
; pageToken?
: string
}>
Handle the request and return the queried products in a unified form.
Parameters
Name | Type | Default value |
---|---|---|
request | Object | undefined |
request.attributeValues? | Record <string , unknown > | ZAttributeValues |
request.filters? | { value?: unknown; field?: string; operation?: FilterOperation; }[] | undefined |
request.pageSize? | number | undefined |
request.pageToken? | string | undefined |
Returns
Promise
<{ data?
: { attributeValues?
: Record
<string
, unknown
> = ZAttributeValues; availability?
: { amount?: number; stockId?: string; stockName?: string; attributeValues?: Record<string, unknown>; }[] ; description?
: string
; details?
: Record
<string
, string
> ; grossPrice?
: { value?: number; divisor?: number; currencyCode?: string; } ; gtin?
: string
; id?
: string
; images?
: { url?: string; isDefault?: boolean; attributeValues?: Record<string, unknown>; }[] ; manufacturer?
: string
; name?
: string
; netPrice?
: { value?: number; divisor?: number; currencyCode?: string; } ; sku?
: string
; taxRate?
: number
; variationParentId?
: string
; weightInGrams?
: number
}[] ; nextPageToken?
: string
; pageSize?
: number
; pageToken?
: string
}>
Defined in
src/contracts/pull-products/handler/product-provider.ts:13