@commercelayer/sdk 7.0.0-beta.17 → 7.0.0-beta.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api.cjs +0 -1
- package/lib/api.js +0 -1
- package/lib/client.cjs +45 -54
- package/lib/client.js +45 -54
- package/lib/commercelayer.cjs +11 -13
- package/lib/commercelayer.js +11 -13
- package/lib/common.cjs +0 -1
- package/lib/common.js +0 -1
- package/lib/config.cjs +0 -2
- package/lib/config.js +0 -2
- package/lib/debug.cjs +0 -2
- package/lib/debug.js +0 -2
- package/lib/enum.cjs +0 -2
- package/lib/enum.js +0 -2
- package/lib/error.cjs +19 -22
- package/lib/error.js +19 -22
- package/lib/fetch.cjs +17 -24
- package/lib/fetch.js +17 -24
- package/lib/index.cjs +0 -1
- package/lib/index.d.cts +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +0 -1
- package/lib/jsonapi.cjs +0 -1
- package/lib/jsonapi.js +0 -1
- package/lib/query.cjs +0 -1
- package/lib/query.js +0 -1
- package/lib/resource.cjs +21 -26
- package/lib/resource.js +21 -26
- package/lib/resources/addresses.cjs +10 -12
- package/lib/resources/addresses.js +10 -12
- package/lib/resources/adjustments.cjs +8 -10
- package/lib/resources/adjustments.js +8 -10
- package/lib/resources/adyen_gateways.cjs +8 -10
- package/lib/resources/adyen_gateways.js +8 -10
- package/lib/resources/adyen_payments.cjs +10 -12
- package/lib/resources/adyen_payments.js +10 -12
- package/lib/resources/applications.cjs +5 -7
- package/lib/resources/applications.js +5 -7
- package/lib/resources/attachments.cjs +8 -10
- package/lib/resources/attachments.js +8 -10
- package/lib/resources/authorizations.cjs +11 -13
- package/lib/resources/authorizations.js +11 -13
- package/lib/resources/avalara_accounts.cjs +8 -10
- package/lib/resources/avalara_accounts.js +8 -10
- package/lib/resources/axerve_gateways.cjs +8 -10
- package/lib/resources/axerve_gateways.js +8 -10
- package/lib/resources/axerve_payments.cjs +9 -11
- package/lib/resources/axerve_payments.js +9 -11
- package/lib/resources/bing_geocoders.cjs +8 -10
- package/lib/resources/bing_geocoders.js +8 -10
- package/lib/resources/braintree_gateways.cjs +8 -10
- package/lib/resources/braintree_gateways.js +8 -10
- package/lib/resources/braintree_payments.cjs +8 -10
- package/lib/resources/braintree_payments.js +8 -10
- package/lib/resources/bundles.cjs +12 -14
- package/lib/resources/bundles.js +12 -14
- package/lib/resources/buy_x_pay_y_promotions.cjs +12 -14
- package/lib/resources/buy_x_pay_y_promotions.js +12 -14
- package/lib/resources/captures.cjs +10 -12
- package/lib/resources/captures.js +10 -12
- package/lib/resources/carrier_accounts.cjs +8 -10
- package/lib/resources/carrier_accounts.js +8 -10
- package/lib/resources/checkout_com_gateways.cjs +8 -10
- package/lib/resources/checkout_com_gateways.js +8 -10
- package/lib/resources/checkout_com_payments.cjs +10 -12
- package/lib/resources/checkout_com_payments.js +10 -12
- package/lib/resources/cleanups.cjs +9 -11
- package/lib/resources/cleanups.js +9 -11
- package/lib/resources/coupon_codes_promotion_rules.cjs +8 -10
- package/lib/resources/coupon_codes_promotion_rules.js +8 -10
- package/lib/resources/coupon_recipients.cjs +8 -10
- package/lib/resources/coupon_recipients.js +8 -10
- package/lib/resources/coupons.cjs +10 -12
- package/lib/resources/coupons.js +10 -12
- package/lib/resources/custom_promotion_rules.cjs +8 -10
- package/lib/resources/custom_promotion_rules.js +8 -10
- package/lib/resources/customer_addresses.cjs +8 -10
- package/lib/resources/customer_addresses.js +8 -10
- package/lib/resources/customer_groups.cjs +8 -10
- package/lib/resources/customer_groups.js +8 -10
- package/lib/resources/customer_password_resets.cjs +9 -11
- package/lib/resources/customer_password_resets.js +9 -11
- package/lib/resources/customer_payment_sources.cjs +8 -10
- package/lib/resources/customer_payment_sources.js +8 -10
- package/lib/resources/customer_subscriptions.cjs +8 -10
- package/lib/resources/customer_subscriptions.js +8 -10
- package/lib/resources/customers.cjs +10 -12
- package/lib/resources/customers.js +10 -12
- package/lib/resources/delivery_lead_times.cjs +8 -10
- package/lib/resources/delivery_lead_times.js +8 -10
- package/lib/resources/discount_engine_items.cjs +5 -7
- package/lib/resources/discount_engine_items.js +5 -7
- package/lib/resources/discount_engines.cjs +5 -7
- package/lib/resources/discount_engines.js +5 -7
- package/lib/resources/easypost_pickups.cjs +9 -11
- package/lib/resources/easypost_pickups.js +9 -11
- package/lib/resources/event_callbacks.cjs +5 -7
- package/lib/resources/event_callbacks.js +5 -7
- package/lib/resources/events.cjs +7 -9
- package/lib/resources/events.js +7 -9
- package/lib/resources/exports.cjs +9 -11
- package/lib/resources/exports.js +9 -11
- package/lib/resources/external_gateways.cjs +9 -11
- package/lib/resources/external_gateways.js +9 -11
- package/lib/resources/external_payments.cjs +8 -10
- package/lib/resources/external_payments.js +8 -10
- package/lib/resources/external_promotions.cjs +13 -15
- package/lib/resources/external_promotions.js +13 -15
- package/lib/resources/external_tax_calculators.cjs +9 -11
- package/lib/resources/external_tax_calculators.js +9 -11
- package/lib/resources/fixed_amount_promotions.cjs +12 -14
- package/lib/resources/fixed_amount_promotions.js +12 -14
- package/lib/resources/fixed_price_promotions.cjs +12 -14
- package/lib/resources/fixed_price_promotions.js +12 -14
- package/lib/resources/flex_promotions.cjs +12 -14
- package/lib/resources/flex_promotions.js +12 -14
- package/lib/resources/free_gift_promotions.cjs +12 -14
- package/lib/resources/free_gift_promotions.js +12 -14
- package/lib/resources/free_shipping_promotions.cjs +12 -14
- package/lib/resources/free_shipping_promotions.js +12 -14
- package/lib/resources/geocoders.cjs +5 -7
- package/lib/resources/geocoders.js +5 -7
- package/lib/resources/gift_card_recipients.cjs +8 -10
- package/lib/resources/gift_card_recipients.js +8 -10
- package/lib/resources/gift_cards.cjs +14 -16
- package/lib/resources/gift_cards.js +14 -16
- package/lib/resources/google_geocoders.cjs +8 -10
- package/lib/resources/google_geocoders.js +8 -10
- package/lib/resources/imports.cjs +9 -11
- package/lib/resources/imports.js +9 -11
- package/lib/resources/in_stock_subscriptions.cjs +10 -12
- package/lib/resources/in_stock_subscriptions.js +10 -12
- package/lib/resources/inventory_models.cjs +8 -10
- package/lib/resources/inventory_models.js +8 -10
- package/lib/resources/inventory_return_locations.cjs +8 -10
- package/lib/resources/inventory_return_locations.js +8 -10
- package/lib/resources/inventory_stock_locations.cjs +8 -10
- package/lib/resources/inventory_stock_locations.js +8 -10
- package/lib/resources/klarna_gateways.cjs +8 -10
- package/lib/resources/klarna_gateways.js +8 -10
- package/lib/resources/klarna_payments.cjs +9 -11
- package/lib/resources/klarna_payments.js +9 -11
- package/lib/resources/line_item_options.cjs +10 -12
- package/lib/resources/line_item_options.js +10 -12
- package/lib/resources/line_items.cjs +13 -15
- package/lib/resources/line_items.js +13 -15
- package/lib/resources/links.cjs +10 -12
- package/lib/resources/links.js +10 -12
- package/lib/resources/manual_gateways.cjs +8 -10
- package/lib/resources/manual_gateways.js +8 -10
- package/lib/resources/manual_tax_calculators.cjs +8 -10
- package/lib/resources/manual_tax_calculators.js +8 -10
- package/lib/resources/markets.cjs +10 -12
- package/lib/resources/markets.js +10 -12
- package/lib/resources/merchants.cjs +8 -10
- package/lib/resources/merchants.js +8 -10
- package/lib/resources/notifications.cjs +8 -10
- package/lib/resources/notifications.js +8 -10
- package/lib/resources/order_amount_promotion_rules.cjs +8 -10
- package/lib/resources/order_amount_promotion_rules.js +8 -10
- package/lib/resources/order_copies.cjs +8 -10
- package/lib/resources/order_copies.js +8 -10
- package/lib/resources/order_factories.cjs +5 -7
- package/lib/resources/order_factories.js +5 -7
- package/lib/resources/order_subscription_items.cjs +8 -10
- package/lib/resources/order_subscription_items.js +8 -10
- package/lib/resources/order_subscriptions.cjs +14 -16
- package/lib/resources/order_subscriptions.js +14 -16
- package/lib/resources/orders.cjs +41 -43
- package/lib/resources/orders.js +41 -43
- package/lib/resources/organizations.cjs +5 -7
- package/lib/resources/organizations.js +5 -7
- package/lib/resources/packages.cjs +8 -10
- package/lib/resources/packages.js +8 -10
- package/lib/resources/parcel_line_items.cjs +8 -10
- package/lib/resources/parcel_line_items.js +8 -10
- package/lib/resources/parcels.cjs +8 -10
- package/lib/resources/parcels.js +8 -10
- package/lib/resources/payment_gateways.cjs +5 -7
- package/lib/resources/payment_gateways.js +5 -7
- package/lib/resources/payment_methods.cjs +10 -12
- package/lib/resources/payment_methods.js +10 -12
- package/lib/resources/payment_options.cjs +8 -10
- package/lib/resources/payment_options.js +8 -10
- package/lib/resources/paypal_gateways.cjs +8 -10
- package/lib/resources/paypal_gateways.js +8 -10
- package/lib/resources/paypal_payments.cjs +8 -10
- package/lib/resources/paypal_payments.js +8 -10
- package/lib/resources/percentage_discount_promotions.cjs +12 -14
- package/lib/resources/percentage_discount_promotions.js +12 -14
- package/lib/resources/pickups.cjs +5 -7
- package/lib/resources/pickups.js +5 -7
- package/lib/resources/price_frequency_tiers.cjs +8 -10
- package/lib/resources/price_frequency_tiers.js +8 -10
- package/lib/resources/price_list_schedulers.cjs +10 -12
- package/lib/resources/price_list_schedulers.js +10 -12
- package/lib/resources/price_lists.cjs +8 -10
- package/lib/resources/price_lists.js +8 -10
- package/lib/resources/price_tiers.cjs +5 -7
- package/lib/resources/price_tiers.js +5 -7
- package/lib/resources/price_volume_tiers.cjs +8 -10
- package/lib/resources/price_volume_tiers.js +8 -10
- package/lib/resources/prices.cjs +8 -10
- package/lib/resources/prices.js +8 -10
- package/lib/resources/promotion_rules.cjs +5 -7
- package/lib/resources/promotion_rules.js +5 -7
- package/lib/resources/promotions.cjs +5 -7
- package/lib/resources/promotions.js +5 -7
- package/lib/resources/recurring_order_copies.cjs +8 -10
- package/lib/resources/recurring_order_copies.js +8 -10
- package/lib/resources/refunds.cjs +7 -9
- package/lib/resources/refunds.js +7 -9
- package/lib/resources/reserved_stocks.cjs +5 -7
- package/lib/resources/reserved_stocks.js +5 -7
- package/lib/resources/resource_errors.cjs +5 -7
- package/lib/resources/resource_errors.js +5 -7
- package/lib/resources/return_line_items.cjs +9 -11
- package/lib/resources/return_line_items.js +9 -11
- package/lib/resources/returns.cjs +21 -23
- package/lib/resources/returns.js +21 -23
- package/lib/resources/satispay_gateways.cjs +8 -10
- package/lib/resources/satispay_gateways.js +8 -10
- package/lib/resources/satispay_payments.cjs +9 -11
- package/lib/resources/satispay_payments.js +9 -11
- package/lib/resources/shipments.cjs +23 -25
- package/lib/resources/shipments.js +23 -25
- package/lib/resources/shipping_categories.cjs +8 -10
- package/lib/resources/shipping_categories.js +8 -10
- package/lib/resources/shipping_method_tiers.cjs +5 -7
- package/lib/resources/shipping_method_tiers.js +5 -7
- package/lib/resources/shipping_methods.cjs +11 -13
- package/lib/resources/shipping_methods.js +11 -13
- package/lib/resources/shipping_weight_tiers.cjs +8 -10
- package/lib/resources/shipping_weight_tiers.js +8 -10
- package/lib/resources/shipping_zones.cjs +8 -10
- package/lib/resources/shipping_zones.js +8 -10
- package/lib/resources/sku_list_items.cjs +8 -10
- package/lib/resources/sku_list_items.js +8 -10
- package/lib/resources/sku_list_promotion_rules.cjs +8 -10
- package/lib/resources/sku_list_promotion_rules.js +8 -10
- package/lib/resources/sku_lists.cjs +8 -10
- package/lib/resources/sku_lists.js +8 -10
- package/lib/resources/sku_options.cjs +10 -12
- package/lib/resources/sku_options.js +10 -12
- package/lib/resources/skus.cjs +10 -12
- package/lib/resources/skus.js +10 -12
- package/lib/resources/stock_items.cjs +9 -11
- package/lib/resources/stock_items.js +9 -11
- package/lib/resources/stock_line_items.cjs +11 -13
- package/lib/resources/stock_line_items.js +11 -13
- package/lib/resources/stock_locations.cjs +8 -10
- package/lib/resources/stock_locations.js +8 -10
- package/lib/resources/stock_reservations.cjs +9 -11
- package/lib/resources/stock_reservations.js +9 -11
- package/lib/resources/stock_transfers.cjs +14 -16
- package/lib/resources/stock_transfers.js +14 -16
- package/lib/resources/stores.cjs +8 -10
- package/lib/resources/stores.js +8 -10
- package/lib/resources/stripe_gateways.cjs +8 -10
- package/lib/resources/stripe_gateways.js +8 -10
- package/lib/resources/stripe_payments.cjs +10 -12
- package/lib/resources/stripe_payments.js +10 -12
- package/lib/resources/stripe_tax_accounts.cjs +8 -10
- package/lib/resources/stripe_tax_accounts.js +8 -10
- package/lib/resources/subscription_models.cjs +8 -10
- package/lib/resources/subscription_models.js +8 -10
- package/lib/resources/tags.cjs +8 -10
- package/lib/resources/tags.js +8 -10
- package/lib/resources/talon_one_accounts.cjs +8 -10
- package/lib/resources/talon_one_accounts.js +8 -10
- package/lib/resources/tax_calculators.cjs +5 -7
- package/lib/resources/tax_calculators.js +5 -7
- package/lib/resources/tax_categories.cjs +8 -10
- package/lib/resources/tax_categories.js +8 -10
- package/lib/resources/tax_rules.cjs +8 -10
- package/lib/resources/tax_rules.js +8 -10
- package/lib/resources/taxjar_accounts.cjs +8 -10
- package/lib/resources/taxjar_accounts.js +8 -10
- package/lib/resources/transactions.cjs +5 -7
- package/lib/resources/transactions.js +5 -7
- package/lib/resources/versions.cjs +5 -7
- package/lib/resources/versions.js +5 -7
- package/lib/resources/vertex_accounts.cjs +9 -11
- package/lib/resources/vertex_accounts.js +9 -11
- package/lib/resources/voids.cjs +7 -9
- package/lib/resources/voids.js +7 -9
- package/lib/resources/webhooks.cjs +11 -13
- package/lib/resources/webhooks.js +11 -13
- package/lib/resources/wire_transfers.cjs +8 -10
- package/lib/resources/wire_transfers.js +8 -10
- package/lib/static.cjs +0 -1
- package/lib/static.js +0 -1
- package/lib/util.cjs +0 -2
- package/lib/util.js +0 -2
- package/package.json +4 -4
- package/lib/chunk-AQ5VUG5P.js +0 -12
- package/lib/chunk-JE77HYXB.cjs +0 -17
@@ -1,15 +1,15 @@
|
|
1
|
-
import { __publicField } from '../chunk-AQ5VUG5P.js';
|
2
1
|
import { ApiResource } from '../resource';
|
3
2
|
|
4
|
-
|
3
|
+
class SkuLists extends ApiResource {
|
4
|
+
static TYPE = "sku_lists";
|
5
5
|
async create(resource, params, options) {
|
6
|
-
return this.resources.create({ ...resource, type:
|
6
|
+
return this.resources.create({ ...resource, type: SkuLists.TYPE }, params, options);
|
7
7
|
}
|
8
8
|
async update(resource, params, options) {
|
9
|
-
return this.resources.update({ ...resource, type:
|
9
|
+
return this.resources.update({ ...resource, type: SkuLists.TYPE }, params, options);
|
10
10
|
}
|
11
11
|
async delete(id, options) {
|
12
|
-
await this.resources.delete(typeof id === "string" ? { id, type:
|
12
|
+
await this.resources.delete(typeof id === "string" ? { id, type: SkuLists.TYPE } : id, options);
|
13
13
|
}
|
14
14
|
async customer(skuListId, params, options) {
|
15
15
|
const _skuListId = skuListId.id || skuListId;
|
@@ -40,7 +40,7 @@ const _SkuLists = class _SkuLists extends ApiResource {
|
|
40
40
|
return this.resources.fetch({ type: "versions" }, `sku_lists/${_skuListId}/versions`, params, options);
|
41
41
|
}
|
42
42
|
isSkuList(resource) {
|
43
|
-
return resource.type && resource.type ===
|
43
|
+
return resource.type && resource.type === SkuLists.TYPE;
|
44
44
|
}
|
45
45
|
relationship(id) {
|
46
46
|
return super.relationshipOneToOne(id);
|
@@ -49,11 +49,9 @@ const _SkuLists = class _SkuLists extends ApiResource {
|
|
49
49
|
return super.relationshipOneToMany(...ids);
|
50
50
|
}
|
51
51
|
type() {
|
52
|
-
return
|
52
|
+
return SkuLists.TYPE;
|
53
53
|
}
|
54
|
-
}
|
55
|
-
__publicField(_SkuLists, "TYPE", "sku_lists");
|
56
|
-
let SkuLists = _SkuLists;
|
54
|
+
}
|
57
55
|
const instance = new SkuLists();
|
58
56
|
var sku_lists_default = instance;
|
59
57
|
|
@@ -1,17 +1,17 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
-
var chunkJE77HYXB_cjs = require('../chunk-JE77HYXB.cjs');
|
4
3
|
var resource = require('../resource');
|
5
4
|
|
6
|
-
|
5
|
+
class SkuOptions extends resource.ApiResource {
|
6
|
+
static TYPE = "sku_options";
|
7
7
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create({ ...resource, type:
|
8
|
+
return this.resources.create({ ...resource, type: SkuOptions.TYPE }, params, options);
|
9
9
|
}
|
10
10
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update({ ...resource, type:
|
11
|
+
return this.resources.update({ ...resource, type: SkuOptions.TYPE }, params, options);
|
12
12
|
}
|
13
13
|
async delete(id, options) {
|
14
|
-
await this.resources.delete(typeof id === "string" ? { id, type:
|
14
|
+
await this.resources.delete(typeof id === "string" ? { id, type: SkuOptions.TYPE } : id, options);
|
15
15
|
}
|
16
16
|
async market(skuOptionId, params, options) {
|
17
17
|
const _skuOptionId = skuOptionId.id || skuOptionId;
|
@@ -34,13 +34,13 @@ const _SkuOptions = class _SkuOptions extends resource.ApiResource {
|
|
34
34
|
return this.resources.fetch({ type: "versions" }, `sku_options/${_skuOptionId}/versions`, params, options);
|
35
35
|
}
|
36
36
|
async _add_tags(id, triggerValue, params, options) {
|
37
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
37
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: SkuOptions.TYPE, _add_tags: triggerValue }, params, options);
|
38
38
|
}
|
39
39
|
async _remove_tags(id, triggerValue, params, options) {
|
40
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
40
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: SkuOptions.TYPE, _remove_tags: triggerValue }, params, options);
|
41
41
|
}
|
42
42
|
isSkuOption(resource) {
|
43
|
-
return resource.type && resource.type ===
|
43
|
+
return resource.type && resource.type === SkuOptions.TYPE;
|
44
44
|
}
|
45
45
|
relationship(id) {
|
46
46
|
return super.relationshipOneToOne(id);
|
@@ -49,11 +49,9 @@ const _SkuOptions = class _SkuOptions extends resource.ApiResource {
|
|
49
49
|
return super.relationshipOneToMany(...ids);
|
50
50
|
}
|
51
51
|
type() {
|
52
|
-
return
|
52
|
+
return SkuOptions.TYPE;
|
53
53
|
}
|
54
|
-
}
|
55
|
-
chunkJE77HYXB_cjs.__publicField(_SkuOptions, "TYPE", "sku_options");
|
56
|
-
let SkuOptions = _SkuOptions;
|
54
|
+
}
|
57
55
|
const instance = new SkuOptions();
|
58
56
|
var sku_options_default = instance;
|
59
57
|
|
@@ -1,15 +1,15 @@
|
|
1
|
-
import { __publicField } from '../chunk-AQ5VUG5P.js';
|
2
1
|
import { ApiResource } from '../resource';
|
3
2
|
|
4
|
-
|
3
|
+
class SkuOptions extends ApiResource {
|
4
|
+
static TYPE = "sku_options";
|
5
5
|
async create(resource, params, options) {
|
6
|
-
return this.resources.create({ ...resource, type:
|
6
|
+
return this.resources.create({ ...resource, type: SkuOptions.TYPE }, params, options);
|
7
7
|
}
|
8
8
|
async update(resource, params, options) {
|
9
|
-
return this.resources.update({ ...resource, type:
|
9
|
+
return this.resources.update({ ...resource, type: SkuOptions.TYPE }, params, options);
|
10
10
|
}
|
11
11
|
async delete(id, options) {
|
12
|
-
await this.resources.delete(typeof id === "string" ? { id, type:
|
12
|
+
await this.resources.delete(typeof id === "string" ? { id, type: SkuOptions.TYPE } : id, options);
|
13
13
|
}
|
14
14
|
async market(skuOptionId, params, options) {
|
15
15
|
const _skuOptionId = skuOptionId.id || skuOptionId;
|
@@ -32,13 +32,13 @@ const _SkuOptions = class _SkuOptions extends ApiResource {
|
|
32
32
|
return this.resources.fetch({ type: "versions" }, `sku_options/${_skuOptionId}/versions`, params, options);
|
33
33
|
}
|
34
34
|
async _add_tags(id, triggerValue, params, options) {
|
35
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
35
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: SkuOptions.TYPE, _add_tags: triggerValue }, params, options);
|
36
36
|
}
|
37
37
|
async _remove_tags(id, triggerValue, params, options) {
|
38
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
38
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: SkuOptions.TYPE, _remove_tags: triggerValue }, params, options);
|
39
39
|
}
|
40
40
|
isSkuOption(resource) {
|
41
|
-
return resource.type && resource.type ===
|
41
|
+
return resource.type && resource.type === SkuOptions.TYPE;
|
42
42
|
}
|
43
43
|
relationship(id) {
|
44
44
|
return super.relationshipOneToOne(id);
|
@@ -47,11 +47,9 @@ const _SkuOptions = class _SkuOptions extends ApiResource {
|
|
47
47
|
return super.relationshipOneToMany(...ids);
|
48
48
|
}
|
49
49
|
type() {
|
50
|
-
return
|
50
|
+
return SkuOptions.TYPE;
|
51
51
|
}
|
52
|
-
}
|
53
|
-
__publicField(_SkuOptions, "TYPE", "sku_options");
|
54
|
-
let SkuOptions = _SkuOptions;
|
52
|
+
}
|
55
53
|
const instance = new SkuOptions();
|
56
54
|
var sku_options_default = instance;
|
57
55
|
|
package/lib/resources/skus.cjs
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
-
var chunkJE77HYXB_cjs = require('../chunk-JE77HYXB.cjs');
|
4
3
|
var resource = require('../resource');
|
5
4
|
|
6
|
-
|
5
|
+
class Skus extends resource.ApiResource {
|
6
|
+
static TYPE = "skus";
|
7
7
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create({ ...resource, type:
|
8
|
+
return this.resources.create({ ...resource, type: Skus.TYPE }, params, options);
|
9
9
|
}
|
10
10
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update({ ...resource, type:
|
11
|
+
return this.resources.update({ ...resource, type: Skus.TYPE }, params, options);
|
12
12
|
}
|
13
13
|
async delete(id, options) {
|
14
|
-
await this.resources.delete(typeof id === "string" ? { id, type:
|
14
|
+
await this.resources.delete(typeof id === "string" ? { id, type: Skus.TYPE } : id, options);
|
15
15
|
}
|
16
16
|
async shipping_category(skuId, params, options) {
|
17
17
|
const _skuId = skuId.id || skuId;
|
@@ -78,13 +78,13 @@ const _Skus = class _Skus extends resource.ApiResource {
|
|
78
78
|
return this.resources.fetch({ type: "stock_locations" }, `skus/${_skuId}/jwt_stock_locations`, params, options);
|
79
79
|
}
|
80
80
|
async _add_tags(id, triggerValue, params, options) {
|
81
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
81
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Skus.TYPE, _add_tags: triggerValue }, params, options);
|
82
82
|
}
|
83
83
|
async _remove_tags(id, triggerValue, params, options) {
|
84
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
84
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Skus.TYPE, _remove_tags: triggerValue }, params, options);
|
85
85
|
}
|
86
86
|
isSku(resource) {
|
87
|
-
return resource.type && resource.type ===
|
87
|
+
return resource.type && resource.type === Skus.TYPE;
|
88
88
|
}
|
89
89
|
relationship(id) {
|
90
90
|
return super.relationshipOneToOne(id);
|
@@ -93,11 +93,9 @@ const _Skus = class _Skus extends resource.ApiResource {
|
|
93
93
|
return super.relationshipOneToMany(...ids);
|
94
94
|
}
|
95
95
|
type() {
|
96
|
-
return
|
96
|
+
return Skus.TYPE;
|
97
97
|
}
|
98
|
-
}
|
99
|
-
chunkJE77HYXB_cjs.__publicField(_Skus, "TYPE", "skus");
|
100
|
-
let Skus = _Skus;
|
98
|
+
}
|
101
99
|
const instance = new Skus();
|
102
100
|
var skus_default = instance;
|
103
101
|
|
package/lib/resources/skus.js
CHANGED
@@ -1,15 +1,15 @@
|
|
1
|
-
import { __publicField } from '../chunk-AQ5VUG5P.js';
|
2
1
|
import { ApiResource } from '../resource';
|
3
2
|
|
4
|
-
|
3
|
+
class Skus extends ApiResource {
|
4
|
+
static TYPE = "skus";
|
5
5
|
async create(resource, params, options) {
|
6
|
-
return this.resources.create({ ...resource, type:
|
6
|
+
return this.resources.create({ ...resource, type: Skus.TYPE }, params, options);
|
7
7
|
}
|
8
8
|
async update(resource, params, options) {
|
9
|
-
return this.resources.update({ ...resource, type:
|
9
|
+
return this.resources.update({ ...resource, type: Skus.TYPE }, params, options);
|
10
10
|
}
|
11
11
|
async delete(id, options) {
|
12
|
-
await this.resources.delete(typeof id === "string" ? { id, type:
|
12
|
+
await this.resources.delete(typeof id === "string" ? { id, type: Skus.TYPE } : id, options);
|
13
13
|
}
|
14
14
|
async shipping_category(skuId, params, options) {
|
15
15
|
const _skuId = skuId.id || skuId;
|
@@ -76,13 +76,13 @@ const _Skus = class _Skus extends ApiResource {
|
|
76
76
|
return this.resources.fetch({ type: "stock_locations" }, `skus/${_skuId}/jwt_stock_locations`, params, options);
|
77
77
|
}
|
78
78
|
async _add_tags(id, triggerValue, params, options) {
|
79
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
79
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Skus.TYPE, _add_tags: triggerValue }, params, options);
|
80
80
|
}
|
81
81
|
async _remove_tags(id, triggerValue, params, options) {
|
82
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
82
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Skus.TYPE, _remove_tags: triggerValue }, params, options);
|
83
83
|
}
|
84
84
|
isSku(resource) {
|
85
|
-
return resource.type && resource.type ===
|
85
|
+
return resource.type && resource.type === Skus.TYPE;
|
86
86
|
}
|
87
87
|
relationship(id) {
|
88
88
|
return super.relationshipOneToOne(id);
|
@@ -91,11 +91,9 @@ const _Skus = class _Skus extends ApiResource {
|
|
91
91
|
return super.relationshipOneToMany(...ids);
|
92
92
|
}
|
93
93
|
type() {
|
94
|
-
return
|
94
|
+
return Skus.TYPE;
|
95
95
|
}
|
96
|
-
}
|
97
|
-
__publicField(_Skus, "TYPE", "skus");
|
98
|
-
let Skus = _Skus;
|
96
|
+
}
|
99
97
|
const instance = new Skus();
|
100
98
|
var skus_default = instance;
|
101
99
|
|
@@ -1,17 +1,17 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
-
var chunkJE77HYXB_cjs = require('../chunk-JE77HYXB.cjs');
|
4
3
|
var resource = require('../resource');
|
5
4
|
|
6
|
-
|
5
|
+
class StockItems extends resource.ApiResource {
|
6
|
+
static TYPE = "stock_items";
|
7
7
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create({ ...resource, type:
|
8
|
+
return this.resources.create({ ...resource, type: StockItems.TYPE }, params, options);
|
9
9
|
}
|
10
10
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update({ ...resource, type:
|
11
|
+
return this.resources.update({ ...resource, type: StockItems.TYPE }, params, options);
|
12
12
|
}
|
13
13
|
async delete(id, options) {
|
14
|
-
await this.resources.delete(typeof id === "string" ? { id, type:
|
14
|
+
await this.resources.delete(typeof id === "string" ? { id, type: StockItems.TYPE } : id, options);
|
15
15
|
}
|
16
16
|
async stock_location(stockItemId, params, options) {
|
17
17
|
const _stockItemId = stockItemId.id || stockItemId;
|
@@ -38,10 +38,10 @@ const _StockItems = class _StockItems extends resource.ApiResource {
|
|
38
38
|
return this.resources.fetch({ type: "versions" }, `stock_items/${_stockItemId}/versions`, params, options);
|
39
39
|
}
|
40
40
|
async _validate(id, params, options) {
|
41
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
41
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: StockItems.TYPE, _validate: true }, params, options);
|
42
42
|
}
|
43
43
|
isStockItem(resource) {
|
44
|
-
return resource.type && resource.type ===
|
44
|
+
return resource.type && resource.type === StockItems.TYPE;
|
45
45
|
}
|
46
46
|
relationship(id) {
|
47
47
|
return super.relationshipOneToOne(id);
|
@@ -50,11 +50,9 @@ const _StockItems = class _StockItems extends resource.ApiResource {
|
|
50
50
|
return super.relationshipOneToMany(...ids);
|
51
51
|
}
|
52
52
|
type() {
|
53
|
-
return
|
53
|
+
return StockItems.TYPE;
|
54
54
|
}
|
55
|
-
}
|
56
|
-
chunkJE77HYXB_cjs.__publicField(_StockItems, "TYPE", "stock_items");
|
57
|
-
let StockItems = _StockItems;
|
55
|
+
}
|
58
56
|
const instance = new StockItems();
|
59
57
|
var stock_items_default = instance;
|
60
58
|
|
@@ -1,15 +1,15 @@
|
|
1
|
-
import { __publicField } from '../chunk-AQ5VUG5P.js';
|
2
1
|
import { ApiResource } from '../resource';
|
3
2
|
|
4
|
-
|
3
|
+
class StockItems extends ApiResource {
|
4
|
+
static TYPE = "stock_items";
|
5
5
|
async create(resource, params, options) {
|
6
|
-
return this.resources.create({ ...resource, type:
|
6
|
+
return this.resources.create({ ...resource, type: StockItems.TYPE }, params, options);
|
7
7
|
}
|
8
8
|
async update(resource, params, options) {
|
9
|
-
return this.resources.update({ ...resource, type:
|
9
|
+
return this.resources.update({ ...resource, type: StockItems.TYPE }, params, options);
|
10
10
|
}
|
11
11
|
async delete(id, options) {
|
12
|
-
await this.resources.delete(typeof id === "string" ? { id, type:
|
12
|
+
await this.resources.delete(typeof id === "string" ? { id, type: StockItems.TYPE } : id, options);
|
13
13
|
}
|
14
14
|
async stock_location(stockItemId, params, options) {
|
15
15
|
const _stockItemId = stockItemId.id || stockItemId;
|
@@ -36,10 +36,10 @@ const _StockItems = class _StockItems extends ApiResource {
|
|
36
36
|
return this.resources.fetch({ type: "versions" }, `stock_items/${_stockItemId}/versions`, params, options);
|
37
37
|
}
|
38
38
|
async _validate(id, params, options) {
|
39
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
39
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: StockItems.TYPE, _validate: true }, params, options);
|
40
40
|
}
|
41
41
|
isStockItem(resource) {
|
42
|
-
return resource.type && resource.type ===
|
42
|
+
return resource.type && resource.type === StockItems.TYPE;
|
43
43
|
}
|
44
44
|
relationship(id) {
|
45
45
|
return super.relationshipOneToOne(id);
|
@@ -48,11 +48,9 @@ const _StockItems = class _StockItems extends ApiResource {
|
|
48
48
|
return super.relationshipOneToMany(...ids);
|
49
49
|
}
|
50
50
|
type() {
|
51
|
-
return
|
51
|
+
return StockItems.TYPE;
|
52
52
|
}
|
53
|
-
}
|
54
|
-
__publicField(_StockItems, "TYPE", "stock_items");
|
55
|
-
let StockItems = _StockItems;
|
53
|
+
}
|
56
54
|
const instance = new StockItems();
|
57
55
|
var stock_items_default = instance;
|
58
56
|
|
@@ -1,17 +1,17 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
-
var chunkJE77HYXB_cjs = require('../chunk-JE77HYXB.cjs');
|
4
3
|
var resource = require('../resource');
|
5
4
|
|
6
|
-
|
5
|
+
class StockLineItems extends resource.ApiResource {
|
6
|
+
static TYPE = "stock_line_items";
|
7
7
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create({ ...resource, type:
|
8
|
+
return this.resources.create({ ...resource, type: StockLineItems.TYPE }, params, options);
|
9
9
|
}
|
10
10
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update({ ...resource, type:
|
11
|
+
return this.resources.update({ ...resource, type: StockLineItems.TYPE }, params, options);
|
12
12
|
}
|
13
13
|
async delete(id, options) {
|
14
|
-
await this.resources.delete(typeof id === "string" ? { id, type:
|
14
|
+
await this.resources.delete(typeof id === "string" ? { id, type: StockLineItems.TYPE } : id, options);
|
15
15
|
}
|
16
16
|
async shipment(stockLineItemId, params, options) {
|
17
17
|
const _stockLineItemId = stockLineItemId.id || stockLineItemId;
|
@@ -38,16 +38,16 @@ const _StockLineItems = class _StockLineItems extends resource.ApiResource {
|
|
38
38
|
return this.resources.fetch({ type: "versions" }, `stock_line_items/${_stockLineItemId}/versions`, params, options);
|
39
39
|
}
|
40
40
|
async _reserve_stock(id, params, options) {
|
41
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
41
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: StockLineItems.TYPE, _reserve_stock: true }, params, options);
|
42
42
|
}
|
43
43
|
async _release_stock(id, params, options) {
|
44
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
44
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: StockLineItems.TYPE, _release_stock: true }, params, options);
|
45
45
|
}
|
46
46
|
async _decrement_stock(id, params, options) {
|
47
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
47
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: StockLineItems.TYPE, _decrement_stock: true }, params, options);
|
48
48
|
}
|
49
49
|
isStockLineItem(resource) {
|
50
|
-
return resource.type && resource.type ===
|
50
|
+
return resource.type && resource.type === StockLineItems.TYPE;
|
51
51
|
}
|
52
52
|
relationship(id) {
|
53
53
|
return super.relationshipOneToOne(id);
|
@@ -56,11 +56,9 @@ const _StockLineItems = class _StockLineItems extends resource.ApiResource {
|
|
56
56
|
return super.relationshipOneToMany(...ids);
|
57
57
|
}
|
58
58
|
type() {
|
59
|
-
return
|
59
|
+
return StockLineItems.TYPE;
|
60
60
|
}
|
61
|
-
}
|
62
|
-
chunkJE77HYXB_cjs.__publicField(_StockLineItems, "TYPE", "stock_line_items");
|
63
|
-
let StockLineItems = _StockLineItems;
|
61
|
+
}
|
64
62
|
const instance = new StockLineItems();
|
65
63
|
var stock_line_items_default = instance;
|
66
64
|
|
@@ -1,15 +1,15 @@
|
|
1
|
-
import { __publicField } from '../chunk-AQ5VUG5P.js';
|
2
1
|
import { ApiResource } from '../resource';
|
3
2
|
|
4
|
-
|
3
|
+
class StockLineItems extends ApiResource {
|
4
|
+
static TYPE = "stock_line_items";
|
5
5
|
async create(resource, params, options) {
|
6
|
-
return this.resources.create({ ...resource, type:
|
6
|
+
return this.resources.create({ ...resource, type: StockLineItems.TYPE }, params, options);
|
7
7
|
}
|
8
8
|
async update(resource, params, options) {
|
9
|
-
return this.resources.update({ ...resource, type:
|
9
|
+
return this.resources.update({ ...resource, type: StockLineItems.TYPE }, params, options);
|
10
10
|
}
|
11
11
|
async delete(id, options) {
|
12
|
-
await this.resources.delete(typeof id === "string" ? { id, type:
|
12
|
+
await this.resources.delete(typeof id === "string" ? { id, type: StockLineItems.TYPE } : id, options);
|
13
13
|
}
|
14
14
|
async shipment(stockLineItemId, params, options) {
|
15
15
|
const _stockLineItemId = stockLineItemId.id || stockLineItemId;
|
@@ -36,16 +36,16 @@ const _StockLineItems = class _StockLineItems extends ApiResource {
|
|
36
36
|
return this.resources.fetch({ type: "versions" }, `stock_line_items/${_stockLineItemId}/versions`, params, options);
|
37
37
|
}
|
38
38
|
async _reserve_stock(id, params, options) {
|
39
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
39
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: StockLineItems.TYPE, _reserve_stock: true }, params, options);
|
40
40
|
}
|
41
41
|
async _release_stock(id, params, options) {
|
42
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
42
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: StockLineItems.TYPE, _release_stock: true }, params, options);
|
43
43
|
}
|
44
44
|
async _decrement_stock(id, params, options) {
|
45
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
45
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: StockLineItems.TYPE, _decrement_stock: true }, params, options);
|
46
46
|
}
|
47
47
|
isStockLineItem(resource) {
|
48
|
-
return resource.type && resource.type ===
|
48
|
+
return resource.type && resource.type === StockLineItems.TYPE;
|
49
49
|
}
|
50
50
|
relationship(id) {
|
51
51
|
return super.relationshipOneToOne(id);
|
@@ -54,11 +54,9 @@ const _StockLineItems = class _StockLineItems extends ApiResource {
|
|
54
54
|
return super.relationshipOneToMany(...ids);
|
55
55
|
}
|
56
56
|
type() {
|
57
|
-
return
|
57
|
+
return StockLineItems.TYPE;
|
58
58
|
}
|
59
|
-
}
|
60
|
-
__publicField(_StockLineItems, "TYPE", "stock_line_items");
|
61
|
-
let StockLineItems = _StockLineItems;
|
59
|
+
}
|
62
60
|
const instance = new StockLineItems();
|
63
61
|
var stock_line_items_default = instance;
|
64
62
|
|
@@ -1,17 +1,17 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
-
var chunkJE77HYXB_cjs = require('../chunk-JE77HYXB.cjs');
|
4
3
|
var resource = require('../resource');
|
5
4
|
|
6
|
-
|
5
|
+
class StockLocations extends resource.ApiResource {
|
6
|
+
static TYPE = "stock_locations";
|
7
7
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create({ ...resource, type:
|
8
|
+
return this.resources.create({ ...resource, type: StockLocations.TYPE }, params, options);
|
9
9
|
}
|
10
10
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update({ ...resource, type:
|
11
|
+
return this.resources.update({ ...resource, type: StockLocations.TYPE }, params, options);
|
12
12
|
}
|
13
13
|
async delete(id, options) {
|
14
|
-
await this.resources.delete(typeof id === "string" ? { id, type:
|
14
|
+
await this.resources.delete(typeof id === "string" ? { id, type: StockLocations.TYPE } : id, options);
|
15
15
|
}
|
16
16
|
async address(stockLocationId, params, options) {
|
17
17
|
const _stockLocationId = stockLocationId.id || stockLocationId;
|
@@ -46,7 +46,7 @@ const _StockLocations = class _StockLocations extends resource.ApiResource {
|
|
46
46
|
return this.resources.fetch({ type: "versions" }, `stock_locations/${_stockLocationId}/versions`, params, options);
|
47
47
|
}
|
48
48
|
isStockLocation(resource) {
|
49
|
-
return resource.type && resource.type ===
|
49
|
+
return resource.type && resource.type === StockLocations.TYPE;
|
50
50
|
}
|
51
51
|
relationship(id) {
|
52
52
|
return super.relationshipOneToOne(id);
|
@@ -55,11 +55,9 @@ const _StockLocations = class _StockLocations extends resource.ApiResource {
|
|
55
55
|
return super.relationshipOneToMany(...ids);
|
56
56
|
}
|
57
57
|
type() {
|
58
|
-
return
|
58
|
+
return StockLocations.TYPE;
|
59
59
|
}
|
60
|
-
}
|
61
|
-
chunkJE77HYXB_cjs.__publicField(_StockLocations, "TYPE", "stock_locations");
|
62
|
-
let StockLocations = _StockLocations;
|
60
|
+
}
|
63
61
|
const instance = new StockLocations();
|
64
62
|
var stock_locations_default = instance;
|
65
63
|
|
@@ -1,15 +1,15 @@
|
|
1
|
-
import { __publicField } from '../chunk-AQ5VUG5P.js';
|
2
1
|
import { ApiResource } from '../resource';
|
3
2
|
|
4
|
-
|
3
|
+
class StockLocations extends ApiResource {
|
4
|
+
static TYPE = "stock_locations";
|
5
5
|
async create(resource, params, options) {
|
6
|
-
return this.resources.create({ ...resource, type:
|
6
|
+
return this.resources.create({ ...resource, type: StockLocations.TYPE }, params, options);
|
7
7
|
}
|
8
8
|
async update(resource, params, options) {
|
9
|
-
return this.resources.update({ ...resource, type:
|
9
|
+
return this.resources.update({ ...resource, type: StockLocations.TYPE }, params, options);
|
10
10
|
}
|
11
11
|
async delete(id, options) {
|
12
|
-
await this.resources.delete(typeof id === "string" ? { id, type:
|
12
|
+
await this.resources.delete(typeof id === "string" ? { id, type: StockLocations.TYPE } : id, options);
|
13
13
|
}
|
14
14
|
async address(stockLocationId, params, options) {
|
15
15
|
const _stockLocationId = stockLocationId.id || stockLocationId;
|
@@ -44,7 +44,7 @@ const _StockLocations = class _StockLocations extends ApiResource {
|
|
44
44
|
return this.resources.fetch({ type: "versions" }, `stock_locations/${_stockLocationId}/versions`, params, options);
|
45
45
|
}
|
46
46
|
isStockLocation(resource) {
|
47
|
-
return resource.type && resource.type ===
|
47
|
+
return resource.type && resource.type === StockLocations.TYPE;
|
48
48
|
}
|
49
49
|
relationship(id) {
|
50
50
|
return super.relationshipOneToOne(id);
|
@@ -53,11 +53,9 @@ const _StockLocations = class _StockLocations extends ApiResource {
|
|
53
53
|
return super.relationshipOneToMany(...ids);
|
54
54
|
}
|
55
55
|
type() {
|
56
|
-
return
|
56
|
+
return StockLocations.TYPE;
|
57
57
|
}
|
58
|
-
}
|
59
|
-
__publicField(_StockLocations, "TYPE", "stock_locations");
|
60
|
-
let StockLocations = _StockLocations;
|
58
|
+
}
|
61
59
|
const instance = new StockLocations();
|
62
60
|
var stock_locations_default = instance;
|
63
61
|
|
@@ -1,17 +1,17 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
-
var chunkJE77HYXB_cjs = require('../chunk-JE77HYXB.cjs');
|
4
3
|
var resource = require('../resource');
|
5
4
|
|
6
|
-
|
5
|
+
class StockReservations extends resource.ApiResource {
|
6
|
+
static TYPE = "stock_reservations";
|
7
7
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create({ ...resource, type:
|
8
|
+
return this.resources.create({ ...resource, type: StockReservations.TYPE }, params, options);
|
9
9
|
}
|
10
10
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update({ ...resource, type:
|
11
|
+
return this.resources.update({ ...resource, type: StockReservations.TYPE }, params, options);
|
12
12
|
}
|
13
13
|
async delete(id, options) {
|
14
|
-
await this.resources.delete(typeof id === "string" ? { id, type:
|
14
|
+
await this.resources.delete(typeof id === "string" ? { id, type: StockReservations.TYPE } : id, options);
|
15
15
|
}
|
16
16
|
async line_item(stockReservationId, params, options) {
|
17
17
|
const _stockReservationId = stockReservationId.id || stockReservationId;
|
@@ -42,10 +42,10 @@ const _StockReservations = class _StockReservations extends resource.ApiResource
|
|
42
42
|
return this.resources.fetch({ type: "skus" }, `stock_reservations/${_stockReservationId}/sku`, params, options);
|
43
43
|
}
|
44
44
|
async _pending(id, params, options) {
|
45
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
45
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: StockReservations.TYPE, _pending: true }, params, options);
|
46
46
|
}
|
47
47
|
isStockReservation(resource) {
|
48
|
-
return resource.type && resource.type ===
|
48
|
+
return resource.type && resource.type === StockReservations.TYPE;
|
49
49
|
}
|
50
50
|
relationship(id) {
|
51
51
|
return super.relationshipOneToOne(id);
|
@@ -54,11 +54,9 @@ const _StockReservations = class _StockReservations extends resource.ApiResource
|
|
54
54
|
return super.relationshipOneToMany(...ids);
|
55
55
|
}
|
56
56
|
type() {
|
57
|
-
return
|
57
|
+
return StockReservations.TYPE;
|
58
58
|
}
|
59
|
-
}
|
60
|
-
chunkJE77HYXB_cjs.__publicField(_StockReservations, "TYPE", "stock_reservations");
|
61
|
-
let StockReservations = _StockReservations;
|
59
|
+
}
|
62
60
|
const instance = new StockReservations();
|
63
61
|
var stock_reservations_default = instance;
|
64
62
|
|