Class: ProductImages

farmaframe. ProductImages

new ProductImages(apiKey, baseUrl, json)

Represents the set of available images for a product.
Parameters:
Name Type Description
apiKey string Your api key.
baseUrl sting Base url for the api.
json Object Json response part from the API for a specific product
Source:

Methods

<static> getCnkCode() → {number}

Returns the CNK code for this product.
Source:
Returns:
The product CNK code.
Type
number

<static> getExternalImages() → {Array.<farmaframe.ProductImage>}

Returns the external images for this product.
Source:
Returns:
The external images.
Type
Array.<farmaframe.ProductImage>

<static> getImages() → {Array.<farmaframe.ProductImage>}

Returns all images for this product. Use this if you do not care about the type of the image.
Source:
Returns:
All available images in order of importance (primary, then secondary, then external, then unit dose)
Type
Array.<farmaframe.ProductImage>

<static> getPrimaryImage() → {farmaframe.ProductImage}

Returns the primary image for this product. This is the image we find best represents the product.
Source:
Returns:
The primary image.
Type
farmaframe.ProductImage

<static> getSecondaryImages() → {Array.<farmaframe.ProductImage>}

Returns the secondary images for this product.
Source:
Returns:
The secondary images.
Type
Array.<farmaframe.ProductImage>

<static> getUnitDoseImages() → {Array.<farmaframe.ProductImage>}

Returns the unit dose images for this product.
Source:
Returns:
The unit dose images.
Type
Array.<farmaframe.ProductImage>