@dotdev/apparel21-sdk
Advanced tools
Comparing version 0.0.71 to 0.0.72
@@ -31,2 +31,14 @@ import { FreeStockSku, FreeStockClr, FreeStockStyle, RequestFunction } from '../common/types'; | ||
/** | ||
* Retrieve a list of freestock for styles | ||
* | ||
* @param storeId: store Id | ||
* @param startRow: starting position of products returned | ||
* @param pageRows: number of products returned | ||
*/ | ||
getFreeStockOfAllStyles: ({ storeId, startRow, pageRows, }?: { | ||
storeId?: number | undefined; | ||
startRow?: number | undefined; | ||
pageRows?: number | undefined; | ||
}) => Promise<FreeStockStyle[]>; | ||
/** | ||
* Retrieves a list of stock changes | ||
@@ -33,0 +45,0 @@ * |
@@ -51,2 +51,21 @@ "use strict"; | ||
/** | ||
* Retrieve a list of freestock for styles | ||
* | ||
* @param storeId: store Id | ||
* @param startRow: starting position of products returned | ||
* @param pageRows: number of products returned | ||
*/ | ||
this.getFreeStockOfAllStyles = async ({ storeId, startRow, pageRows, } = {}) => { | ||
const url = `/Freestock/AllStyles`; | ||
const { FreeStock } = await this.request({ | ||
uri: url, | ||
query: { | ||
storeId, | ||
startRow, | ||
pageRows, | ||
}, | ||
}); | ||
return freestock_1.formatFreestock(FreeStock); | ||
}; | ||
/** | ||
* Retrieves a list of stock changes | ||
@@ -53,0 +72,0 @@ * |
@@ -5,2 +5,3 @@ import { FreeStockSku, FreeStockClr, FreeStockStyle, StockChangedSince } from '../common/types'; | ||
export declare const formatFreestockByStyle: (style: any) => FreeStockStyle; | ||
export declare const formatFreestock: (freestock: any) => FreeStockStyle[]; | ||
export declare const formatStockChangedSince: (stockByStore: any) => StockChangedSince[]; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.formatStockChangedSince = exports.formatFreestockByStyle = exports.formatFreestockByClr = exports.formatFreestockBySku = void 0; | ||
exports.formatStockChangedSince = exports.formatFreestock = exports.formatFreestockByStyle = exports.formatFreestockByClr = exports.formatFreestockBySku = void 0; | ||
exports.formatFreestockBySku = (sku) => { | ||
@@ -35,2 +35,5 @@ const stock = { | ||
}; | ||
exports.formatFreestock = (freestock) => { | ||
return freestock.Style.map((style) => exports.formatFreestockByStyle(style)); | ||
}; | ||
exports.formatStockChangedSince = (stockByStore) => stockByStore?.store?.map((store) => ({ | ||
@@ -37,0 +40,0 @@ storeId: parseInt(store.$.storeid, 10), |
{ | ||
"name": "@dotdev/apparel21-sdk", | ||
"version": "0.0.71", | ||
"version": "0.0.72", | ||
"license": "UNLICENSED", | ||
@@ -5,0 +5,0 @@ "description": "Apparel21 Interface Library", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
217091
3618