@commercelayer/sdk
Version:
Commerce Layer Javascript SDK
51 lines (48 loc) • 2.57 kB
JavaScript
;
var chunkU22VLCMN_cjs = require('./chunk-U22VLCMN.cjs');
// src/resources/inventory_stock_locations.ts
var InventoryStockLocations = class _InventoryStockLocations extends chunkU22VLCMN_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 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;
exports.inventory_stock_locations_default = inventory_stock_locations_default;
//# sourceMappingURL=chunk-QYVJGMYT.cjs.map
//# sourceMappingURL=chunk-QYVJGMYT.cjs.map