@commercelayer/sdk
Version:
Commerce Layer Javascript SDK
47 lines (44 loc) • 2.27 kB
JavaScript
;
var chunkVRRJS3ZM_cjs = require('./chunk-VRRJS3ZM.cjs');
// src/resources/inventory_stock_locations.ts
var InventoryStockLocations = class _InventoryStockLocations extends chunkVRRJS3ZM_cjs.ApiResource {
static TYPE = "inventory_stock_locations";
async create(resource, params, options) {
return this.resources.create({ ...resource, type: _InventoryStockLocations.TYPE }, params, options);
}
async update(resource, params, options) {
return this.resources.update({ ...resource, type: _InventoryStockLocations.TYPE }, params, options);
}
async delete(id, options) {
await this.resources.delete(typeof id === "string" ? { id, type: _InventoryStockLocations.TYPE } : id, options);
}
async stock_location(inventoryStockLocationId, params, options) {
const _inventoryStockLocationId = inventoryStockLocationId.id || inventoryStockLocationId;
return this.resources.fetch({ type: "stock_locations" }, `inventory_stock_locations/${_inventoryStockLocationId}/stock_location`, params, options);
}
async inventory_model(inventoryStockLocationId, params, options) {
const _inventoryStockLocationId = inventoryStockLocationId.id || inventoryStockLocationId;
return this.resources.fetch({ type: "inventory_models" }, `inventory_stock_locations/${_inventoryStockLocationId}/inventory_model`, params, options);
}
async event_stores(inventoryStockLocationId, params, options) {
const _inventoryStockLocationId = inventoryStockLocationId.id || inventoryStockLocationId;
return this.resources.fetch({ type: "event_stores" }, `inventory_stock_locations/${_inventoryStockLocationId}/event_stores`, params, options);
}
isInventoryStockLocation(resource) {
return resource.type && resource.type === _InventoryStockLocations.TYPE;
}
relationship(id) {
return super.relationshipOneToOne(id);
}
relationshipToMany(...ids) {
return super.relationshipOneToMany(...ids);
}
type() {
return _InventoryStockLocations.TYPE;
}
};
var instance = new InventoryStockLocations();
var inventory_stock_locations_default = instance;
exports.inventory_stock_locations_default = inventory_stock_locations_default;
//# sourceMappingURL=chunk-5HIY5RJQ.cjs.map
//# sourceMappingURL=chunk-5HIY5RJQ.cjs.map