@dotdev/apparel21-sdk
Advanced tools
Comparing version 0.0.78 to 0.0.79
@@ -50,2 +50,8 @@ import currency from 'currency.js'; | ||
} | ||
export interface Image { | ||
sequence: number; | ||
typeId: number; | ||
typeCode: string; | ||
url: string; | ||
} | ||
export interface PersonReference { | ||
@@ -104,2 +110,3 @@ referenceTypeId: number; | ||
customData: CustomData; | ||
images: Image[]; | ||
} | ||
@@ -122,2 +129,3 @@ export interface ProductNote { | ||
customData: CustomData; | ||
images: Image[]; | ||
} | ||
@@ -124,0 +132,0 @@ export interface ProductSimple { |
@@ -52,2 +52,12 @@ "use strict"; | ||
}; | ||
const formatImages = (imagesData) => { | ||
if (!imagesData) | ||
return []; | ||
return (imagesData[0].Image?.map((image) => ({ | ||
url: image.Url[0], | ||
sequence: parseInt(image.Sequence[0], 10), | ||
typeId: parseInt(image.TypeId[0], 10), | ||
typeCode: image.TypeCode[0], | ||
})) || []); | ||
}; | ||
const formatCustomData = (customData) => { | ||
@@ -110,2 +120,3 @@ if (!customData) | ||
: {}, | ||
images: colour.Images ? formatImages(colour.Images) : [], | ||
})), | ||
@@ -115,2 +126,3 @@ customData: product.CustomData | ||
: {}, | ||
images: product.Images ? formatImages(product.Images) : [], | ||
})); | ||
@@ -117,0 +129,0 @@ exports.formatProductsSimple = (products = []) => products.map((product) => ({ |
{ | ||
"name": "@dotdev/apparel21-sdk", | ||
"version": "0.0.78", | ||
"version": "0.0.79", | ||
"license": "UNLICENSED", | ||
@@ -5,0 +5,0 @@ "description": "Apparel21 Interface Library", |
Sorry, the diff of this file is not supported yet
219697
3661