@commercelayer/sdk
Version:
Commerce Layer Javascript SDK
49 lines (47 loc) • 2.5 kB
JavaScript
import { ApiResource } from './chunk-XKERR6OR.js';
// src/resources/inventory_stock_locations.ts
var InventoryStockLocations = class _InventoryStockLocations extends 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 versions(inventoryStockLocationId, params, options) {
const _inventoryStockLocationId = inventoryStockLocationId.id || inventoryStockLocationId;
return this.resources.fetch({ type: "versions" }, `inventory_stock_locations/${_inventoryStockLocationId}/versions`, 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;
export { inventory_stock_locations_default };
//# sourceMappingURL=chunk-5TL34ZY6.js.map
//# sourceMappingURL=chunk-5TL34ZY6.js.map