@commercelayer/sdk
Version:
Commerce Layer Javascript SDK
44 lines (42 loc) • 1.95 kB
JavaScript
import { ApiResource } from './chunk-XKERR6OR.js';
// src/resources/reserved_stocks.ts
var ReservedStocks = class _ReservedStocks extends ApiResource {
static TYPE = "reserved_stocks";
async stock_item(reservedStockId, params, options) {
const _reservedStockId = reservedStockId.id || reservedStockId;
return this.resources.fetch({ type: "stock_items" }, `reserved_stocks/${_reservedStockId}/stock_item`, params, options);
}
async sku(reservedStockId, params, options) {
const _reservedStockId = reservedStockId.id || reservedStockId;
return this.resources.fetch({ type: "skus" }, `reserved_stocks/${_reservedStockId}/sku`, params, options);
}
async stock_reservations(reservedStockId, params, options) {
const _reservedStockId = reservedStockId.id || reservedStockId;
return this.resources.fetch({ type: "stock_reservations" }, `reserved_stocks/${_reservedStockId}/stock_reservations`, params, options);
}
async versions(reservedStockId, params, options) {
const _reservedStockId = reservedStockId.id || reservedStockId;
return this.resources.fetch({ type: "versions" }, `reserved_stocks/${_reservedStockId}/versions`, params, options);
}
async event_stores(reservedStockId, params, options) {
const _reservedStockId = reservedStockId.id || reservedStockId;
return this.resources.fetch({ type: "event_stores" }, `reserved_stocks/${_reservedStockId}/event_stores`, params, options);
}
isReservedStock(resource) {
return resource.type && resource.type === _ReservedStocks.TYPE;
}
relationship(id) {
return super.relationshipOneToOne(id);
}
relationshipToMany(...ids) {
return super.relationshipOneToMany(...ids);
}
type() {
return _ReservedStocks.TYPE;
}
};
var instance = new ReservedStocks();
var reserved_stocks_default = instance;
export { reserved_stocks_default };
//# sourceMappingURL=chunk-I2NZB6KN.js.map
//# sourceMappingURL=chunk-I2NZB6KN.js.map