@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
package/lib/resources/prices.js
CHANGED
@@ -1,15 +1,15 @@
|
|
1
|
-
import { __publicField } from '../chunk-AQ5VUG5P.js';
|
2
1
|
import { ApiResource } from '../resource';
|
3
2
|
|
4
|
-
|
3
|
+
class Prices extends ApiResource {
|
4
|
+
static TYPE = "prices";
|
5
5
|
async create(resource, params, options) {
|
6
|
-
return this.resources.create({ ...resource, type:
|
6
|
+
return this.resources.create({ ...resource, type: Prices.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: Prices.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: Prices.TYPE } : id, options);
|
13
13
|
}
|
14
14
|
async price_list(priceId, params, options) {
|
15
15
|
const _priceId = priceId.id || priceId;
|
@@ -52,7 +52,7 @@ const _Prices = class _Prices extends ApiResource {
|
|
52
52
|
return this.resources.fetch({ type: "stock_locations" }, `prices/${_priceId}/jwt_stock_locations`, params, options);
|
53
53
|
}
|
54
54
|
isPrice(resource) {
|
55
|
-
return resource.type && resource.type ===
|
55
|
+
return resource.type && resource.type === Prices.TYPE;
|
56
56
|
}
|
57
57
|
relationship(id) {
|
58
58
|
return super.relationshipOneToOne(id);
|
@@ -61,11 +61,9 @@ const _Prices = class _Prices extends ApiResource {
|
|
61
61
|
return super.relationshipOneToMany(...ids);
|
62
62
|
}
|
63
63
|
type() {
|
64
|
-
return
|
64
|
+
return Prices.TYPE;
|
65
65
|
}
|
66
|
-
}
|
67
|
-
__publicField(_Prices, "TYPE", "prices");
|
68
|
-
let Prices = _Prices;
|
66
|
+
}
|
69
67
|
const instance = new Prices();
|
70
68
|
var prices_default = instance;
|
71
69
|
|
@@ -1,15 +1,15 @@
|
|
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 PromotionRules extends resource.ApiResource {
|
6
|
+
static TYPE = "promotion_rules";
|
7
7
|
async versions(promotionRuleId, params, options) {
|
8
8
|
const _promotionRuleId = promotionRuleId.id || promotionRuleId;
|
9
9
|
return this.resources.fetch({ type: "versions" }, `promotion_rules/${_promotionRuleId}/versions`, params, options);
|
10
10
|
}
|
11
11
|
isPromotionRule(resource) {
|
12
|
-
return resource.type && resource.type ===
|
12
|
+
return resource.type && resource.type === PromotionRules.TYPE;
|
13
13
|
}
|
14
14
|
relationship(id) {
|
15
15
|
return super.relationshipOneToOne(id);
|
@@ -18,11 +18,9 @@ const _PromotionRules = class _PromotionRules extends resource.ApiResource {
|
|
18
18
|
return super.relationshipOneToMany(...ids);
|
19
19
|
}
|
20
20
|
type() {
|
21
|
-
return
|
21
|
+
return PromotionRules.TYPE;
|
22
22
|
}
|
23
|
-
}
|
24
|
-
chunkJE77HYXB_cjs.__publicField(_PromotionRules, "TYPE", "promotion_rules");
|
25
|
-
let PromotionRules = _PromotionRules;
|
23
|
+
}
|
26
24
|
const instance = new PromotionRules();
|
27
25
|
var promotion_rules_default = instance;
|
28
26
|
|
@@ -1,13 +1,13 @@
|
|
1
|
-
import { __publicField } from '../chunk-AQ5VUG5P.js';
|
2
1
|
import { ApiResource } from '../resource';
|
3
2
|
|
4
|
-
|
3
|
+
class PromotionRules extends ApiResource {
|
4
|
+
static TYPE = "promotion_rules";
|
5
5
|
async versions(promotionRuleId, params, options) {
|
6
6
|
const _promotionRuleId = promotionRuleId.id || promotionRuleId;
|
7
7
|
return this.resources.fetch({ type: "versions" }, `promotion_rules/${_promotionRuleId}/versions`, params, options);
|
8
8
|
}
|
9
9
|
isPromotionRule(resource) {
|
10
|
-
return resource.type && resource.type ===
|
10
|
+
return resource.type && resource.type === PromotionRules.TYPE;
|
11
11
|
}
|
12
12
|
relationship(id) {
|
13
13
|
return super.relationshipOneToOne(id);
|
@@ -16,11 +16,9 @@ const _PromotionRules = class _PromotionRules extends ApiResource {
|
|
16
16
|
return super.relationshipOneToMany(...ids);
|
17
17
|
}
|
18
18
|
type() {
|
19
|
-
return
|
19
|
+
return PromotionRules.TYPE;
|
20
20
|
}
|
21
|
-
}
|
22
|
-
__publicField(_PromotionRules, "TYPE", "promotion_rules");
|
23
|
-
let PromotionRules = _PromotionRules;
|
21
|
+
}
|
24
22
|
const instance = new PromotionRules();
|
25
23
|
var promotion_rules_default = instance;
|
26
24
|
|
@@ -1,9 +1,9 @@
|
|
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 Promotions extends resource.ApiResource {
|
6
|
+
static TYPE = "promotions";
|
7
7
|
async market(promotionId, params, options) {
|
8
8
|
const _promotionId = promotionId.id || promotionId;
|
9
9
|
return this.resources.fetch({ type: "markets" }, `promotions/${_promotionId}/market`, params, options);
|
@@ -49,7 +49,7 @@ const _Promotions = class _Promotions extends resource.ApiResource {
|
|
49
49
|
return this.resources.fetch({ type: "versions" }, `promotions/${_promotionId}/versions`, params, options);
|
50
50
|
}
|
51
51
|
isPromotion(resource) {
|
52
|
-
return resource.type && resource.type ===
|
52
|
+
return resource.type && resource.type === Promotions.TYPE;
|
53
53
|
}
|
54
54
|
relationship(id) {
|
55
55
|
return super.relationshipOneToOne(id);
|
@@ -58,11 +58,9 @@ const _Promotions = class _Promotions extends resource.ApiResource {
|
|
58
58
|
return super.relationshipOneToMany(...ids);
|
59
59
|
}
|
60
60
|
type() {
|
61
|
-
return
|
61
|
+
return Promotions.TYPE;
|
62
62
|
}
|
63
|
-
}
|
64
|
-
chunkJE77HYXB_cjs.__publicField(_Promotions, "TYPE", "promotions");
|
65
|
-
let Promotions = _Promotions;
|
63
|
+
}
|
66
64
|
const instance = new Promotions();
|
67
65
|
var promotions_default = instance;
|
68
66
|
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { __publicField } from '../chunk-AQ5VUG5P.js';
|
2
1
|
import { ApiResource } from '../resource';
|
3
2
|
|
4
|
-
|
3
|
+
class Promotions extends ApiResource {
|
4
|
+
static TYPE = "promotions";
|
5
5
|
async market(promotionId, params, options) {
|
6
6
|
const _promotionId = promotionId.id || promotionId;
|
7
7
|
return this.resources.fetch({ type: "markets" }, `promotions/${_promotionId}/market`, params, options);
|
@@ -47,7 +47,7 @@ const _Promotions = class _Promotions extends ApiResource {
|
|
47
47
|
return this.resources.fetch({ type: "versions" }, `promotions/${_promotionId}/versions`, params, options);
|
48
48
|
}
|
49
49
|
isPromotion(resource) {
|
50
|
-
return resource.type && resource.type ===
|
50
|
+
return resource.type && resource.type === Promotions.TYPE;
|
51
51
|
}
|
52
52
|
relationship(id) {
|
53
53
|
return super.relationshipOneToOne(id);
|
@@ -56,11 +56,9 @@ const _Promotions = class _Promotions extends ApiResource {
|
|
56
56
|
return super.relationshipOneToMany(...ids);
|
57
57
|
}
|
58
58
|
type() {
|
59
|
-
return
|
59
|
+
return Promotions.TYPE;
|
60
60
|
}
|
61
|
-
}
|
62
|
-
__publicField(_Promotions, "TYPE", "promotions");
|
63
|
-
let Promotions = _Promotions;
|
61
|
+
}
|
64
62
|
const instance = new Promotions();
|
65
63
|
var promotions_default = instance;
|
66
64
|
|
@@ -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 RecurringOrderCopies extends resource.ApiResource {
|
6
|
+
static TYPE = "recurring_order_copies";
|
7
7
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create({ ...resource, type:
|
8
|
+
return this.resources.create({ ...resource, type: RecurringOrderCopies.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: RecurringOrderCopies.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: RecurringOrderCopies.TYPE } : id, options);
|
15
15
|
}
|
16
16
|
async source_order(recurringOrderCopyId, params, options) {
|
17
17
|
const _recurringOrderCopyId = recurringOrderCopyId.id || recurringOrderCopyId;
|
@@ -30,7 +30,7 @@ const _RecurringOrderCopies = class _RecurringOrderCopies extends resource.ApiRe
|
|
30
30
|
return this.resources.fetch({ type: "order_subscriptions" }, `recurring_order_copies/${_recurringOrderCopyId}/order_subscription`, params, options);
|
31
31
|
}
|
32
32
|
isRecurringOrderCopy(resource) {
|
33
|
-
return resource.type && resource.type ===
|
33
|
+
return resource.type && resource.type === RecurringOrderCopies.TYPE;
|
34
34
|
}
|
35
35
|
relationship(id) {
|
36
36
|
return super.relationshipOneToOne(id);
|
@@ -39,11 +39,9 @@ const _RecurringOrderCopies = class _RecurringOrderCopies extends resource.ApiRe
|
|
39
39
|
return super.relationshipOneToMany(...ids);
|
40
40
|
}
|
41
41
|
type() {
|
42
|
-
return
|
42
|
+
return RecurringOrderCopies.TYPE;
|
43
43
|
}
|
44
|
-
}
|
45
|
-
chunkJE77HYXB_cjs.__publicField(_RecurringOrderCopies, "TYPE", "recurring_order_copies");
|
46
|
-
let RecurringOrderCopies = _RecurringOrderCopies;
|
44
|
+
}
|
47
45
|
const instance = new RecurringOrderCopies();
|
48
46
|
var recurring_order_copies_default = instance;
|
49
47
|
|
@@ -1,15 +1,15 @@
|
|
1
|
-
import { __publicField } from '../chunk-AQ5VUG5P.js';
|
2
1
|
import { ApiResource } from '../resource';
|
3
2
|
|
4
|
-
|
3
|
+
class RecurringOrderCopies extends ApiResource {
|
4
|
+
static TYPE = "recurring_order_copies";
|
5
5
|
async create(resource, params, options) {
|
6
|
-
return this.resources.create({ ...resource, type:
|
6
|
+
return this.resources.create({ ...resource, type: RecurringOrderCopies.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: RecurringOrderCopies.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: RecurringOrderCopies.TYPE } : id, options);
|
13
13
|
}
|
14
14
|
async source_order(recurringOrderCopyId, params, options) {
|
15
15
|
const _recurringOrderCopyId = recurringOrderCopyId.id || recurringOrderCopyId;
|
@@ -28,7 +28,7 @@ const _RecurringOrderCopies = class _RecurringOrderCopies extends ApiResource {
|
|
28
28
|
return this.resources.fetch({ type: "order_subscriptions" }, `recurring_order_copies/${_recurringOrderCopyId}/order_subscription`, params, options);
|
29
29
|
}
|
30
30
|
isRecurringOrderCopy(resource) {
|
31
|
-
return resource.type && resource.type ===
|
31
|
+
return resource.type && resource.type === RecurringOrderCopies.TYPE;
|
32
32
|
}
|
33
33
|
relationship(id) {
|
34
34
|
return super.relationshipOneToOne(id);
|
@@ -37,11 +37,9 @@ const _RecurringOrderCopies = class _RecurringOrderCopies extends ApiResource {
|
|
37
37
|
return super.relationshipOneToMany(...ids);
|
38
38
|
}
|
39
39
|
type() {
|
40
|
-
return
|
40
|
+
return RecurringOrderCopies.TYPE;
|
41
41
|
}
|
42
|
-
}
|
43
|
-
__publicField(_RecurringOrderCopies, "TYPE", "recurring_order_copies");
|
44
|
-
let RecurringOrderCopies = _RecurringOrderCopies;
|
42
|
+
}
|
45
43
|
const instance = new RecurringOrderCopies();
|
46
44
|
var recurring_order_copies_default = instance;
|
47
45
|
|
@@ -1,11 +1,11 @@
|
|
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 Refunds extends resource.ApiResource {
|
6
|
+
static TYPE = "refunds";
|
7
7
|
async update(resource, params, options) {
|
8
|
-
return this.resources.update({ ...resource, type:
|
8
|
+
return this.resources.update({ ...resource, type: Refunds.TYPE }, params, options);
|
9
9
|
}
|
10
10
|
async order(refundId, params, options) {
|
11
11
|
const _refundId = refundId.id || refundId;
|
@@ -32,10 +32,10 @@ const _Refunds = class _Refunds extends resource.ApiResource {
|
|
32
32
|
return this.resources.fetch({ type: "returns" }, `refunds/${_refundId}/return`, params, options);
|
33
33
|
}
|
34
34
|
async _forward(id, 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: Refunds.TYPE, _forward: true }, params, options);
|
36
36
|
}
|
37
37
|
isRefund(resource) {
|
38
|
-
return resource.type && resource.type ===
|
38
|
+
return resource.type && resource.type === Refunds.TYPE;
|
39
39
|
}
|
40
40
|
relationship(id) {
|
41
41
|
return super.relationshipOneToOne(id);
|
@@ -44,11 +44,9 @@ const _Refunds = class _Refunds extends resource.ApiResource {
|
|
44
44
|
return super.relationshipOneToMany(...ids);
|
45
45
|
}
|
46
46
|
type() {
|
47
|
-
return
|
47
|
+
return Refunds.TYPE;
|
48
48
|
}
|
49
|
-
}
|
50
|
-
chunkJE77HYXB_cjs.__publicField(_Refunds, "TYPE", "refunds");
|
51
|
-
let Refunds = _Refunds;
|
49
|
+
}
|
52
50
|
const instance = new Refunds();
|
53
51
|
var refunds_default = instance;
|
54
52
|
|
package/lib/resources/refunds.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
import { __publicField } from '../chunk-AQ5VUG5P.js';
|
2
1
|
import { ApiResource } from '../resource';
|
3
2
|
|
4
|
-
|
3
|
+
class Refunds extends ApiResource {
|
4
|
+
static TYPE = "refunds";
|
5
5
|
async update(resource, params, options) {
|
6
|
-
return this.resources.update({ ...resource, type:
|
6
|
+
return this.resources.update({ ...resource, type: Refunds.TYPE }, params, options);
|
7
7
|
}
|
8
8
|
async order(refundId, params, options) {
|
9
9
|
const _refundId = refundId.id || refundId;
|
@@ -30,10 +30,10 @@ const _Refunds = class _Refunds extends ApiResource {
|
|
30
30
|
return this.resources.fetch({ type: "returns" }, `refunds/${_refundId}/return`, params, options);
|
31
31
|
}
|
32
32
|
async _forward(id, params, options) {
|
33
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
33
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Refunds.TYPE, _forward: true }, params, options);
|
34
34
|
}
|
35
35
|
isRefund(resource) {
|
36
|
-
return resource.type && resource.type ===
|
36
|
+
return resource.type && resource.type === Refunds.TYPE;
|
37
37
|
}
|
38
38
|
relationship(id) {
|
39
39
|
return super.relationshipOneToOne(id);
|
@@ -42,11 +42,9 @@ const _Refunds = class _Refunds extends ApiResource {
|
|
42
42
|
return super.relationshipOneToMany(...ids);
|
43
43
|
}
|
44
44
|
type() {
|
45
|
-
return
|
45
|
+
return Refunds.TYPE;
|
46
46
|
}
|
47
|
-
}
|
48
|
-
__publicField(_Refunds, "TYPE", "refunds");
|
49
|
-
let Refunds = _Refunds;
|
47
|
+
}
|
50
48
|
const instance = new Refunds();
|
51
49
|
var refunds_default = instance;
|
52
50
|
|
@@ -1,9 +1,9 @@
|
|
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 ReservedStocks extends resource.ApiResource {
|
6
|
+
static TYPE = "reserved_stocks";
|
7
7
|
async stock_item(reservedStockId, params, options) {
|
8
8
|
const _reservedStockId = reservedStockId.id || reservedStockId;
|
9
9
|
return this.resources.fetch({ type: "stock_items" }, `reserved_stocks/${_reservedStockId}/stock_item`, params, options);
|
@@ -21,7 +21,7 @@ const _ReservedStocks = class _ReservedStocks extends resource.ApiResource {
|
|
21
21
|
return this.resources.fetch({ type: "versions" }, `reserved_stocks/${_reservedStockId}/versions`, params, options);
|
22
22
|
}
|
23
23
|
isReservedStock(resource) {
|
24
|
-
return resource.type && resource.type ===
|
24
|
+
return resource.type && resource.type === ReservedStocks.TYPE;
|
25
25
|
}
|
26
26
|
relationship(id) {
|
27
27
|
return super.relationshipOneToOne(id);
|
@@ -30,11 +30,9 @@ const _ReservedStocks = class _ReservedStocks extends resource.ApiResource {
|
|
30
30
|
return super.relationshipOneToMany(...ids);
|
31
31
|
}
|
32
32
|
type() {
|
33
|
-
return
|
33
|
+
return ReservedStocks.TYPE;
|
34
34
|
}
|
35
|
-
}
|
36
|
-
chunkJE77HYXB_cjs.__publicField(_ReservedStocks, "TYPE", "reserved_stocks");
|
37
|
-
let ReservedStocks = _ReservedStocks;
|
35
|
+
}
|
38
36
|
const instance = new ReservedStocks();
|
39
37
|
var reserved_stocks_default = instance;
|
40
38
|
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { __publicField } from '../chunk-AQ5VUG5P.js';
|
2
1
|
import { ApiResource } from '../resource';
|
3
2
|
|
4
|
-
|
3
|
+
class ReservedStocks extends ApiResource {
|
4
|
+
static TYPE = "reserved_stocks";
|
5
5
|
async stock_item(reservedStockId, params, options) {
|
6
6
|
const _reservedStockId = reservedStockId.id || reservedStockId;
|
7
7
|
return this.resources.fetch({ type: "stock_items" }, `reserved_stocks/${_reservedStockId}/stock_item`, params, options);
|
@@ -19,7 +19,7 @@ const _ReservedStocks = class _ReservedStocks extends ApiResource {
|
|
19
19
|
return this.resources.fetch({ type: "versions" }, `reserved_stocks/${_reservedStockId}/versions`, params, options);
|
20
20
|
}
|
21
21
|
isReservedStock(resource) {
|
22
|
-
return resource.type && resource.type ===
|
22
|
+
return resource.type && resource.type === ReservedStocks.TYPE;
|
23
23
|
}
|
24
24
|
relationship(id) {
|
25
25
|
return super.relationshipOneToOne(id);
|
@@ -28,11 +28,9 @@ const _ReservedStocks = class _ReservedStocks extends ApiResource {
|
|
28
28
|
return super.relationshipOneToMany(...ids);
|
29
29
|
}
|
30
30
|
type() {
|
31
|
-
return
|
31
|
+
return ReservedStocks.TYPE;
|
32
32
|
}
|
33
|
-
}
|
34
|
-
__publicField(_ReservedStocks, "TYPE", "reserved_stocks");
|
35
|
-
let ReservedStocks = _ReservedStocks;
|
33
|
+
}
|
36
34
|
const instance = new ReservedStocks();
|
37
35
|
var reserved_stocks_default = instance;
|
38
36
|
|
@@ -1,11 +1,11 @@
|
|
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 ResourceErrors extends resource.ApiResource {
|
6
|
+
static TYPE = "resource_errors";
|
7
7
|
isResourceError(resource) {
|
8
|
-
return resource.type && resource.type ===
|
8
|
+
return resource.type && resource.type === ResourceErrors.TYPE;
|
9
9
|
}
|
10
10
|
relationship(id) {
|
11
11
|
return super.relationshipOneToOne(id);
|
@@ -14,11 +14,9 @@ const _ResourceErrors = class _ResourceErrors extends resource.ApiResource {
|
|
14
14
|
return super.relationshipOneToMany(...ids);
|
15
15
|
}
|
16
16
|
type() {
|
17
|
-
return
|
17
|
+
return ResourceErrors.TYPE;
|
18
18
|
}
|
19
|
-
}
|
20
|
-
chunkJE77HYXB_cjs.__publicField(_ResourceErrors, "TYPE", "resource_errors");
|
21
|
-
let ResourceErrors = _ResourceErrors;
|
19
|
+
}
|
22
20
|
const instance = new ResourceErrors();
|
23
21
|
var resource_errors_default = instance;
|
24
22
|
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import { __publicField } from '../chunk-AQ5VUG5P.js';
|
2
1
|
import { ApiResource } from '../resource';
|
3
2
|
|
4
|
-
|
3
|
+
class ResourceErrors extends ApiResource {
|
4
|
+
static TYPE = "resource_errors";
|
5
5
|
isResourceError(resource) {
|
6
|
-
return resource.type && resource.type ===
|
6
|
+
return resource.type && resource.type === ResourceErrors.TYPE;
|
7
7
|
}
|
8
8
|
relationship(id) {
|
9
9
|
return super.relationshipOneToOne(id);
|
@@ -12,11 +12,9 @@ const _ResourceErrors = class _ResourceErrors extends ApiResource {
|
|
12
12
|
return super.relationshipOneToMany(...ids);
|
13
13
|
}
|
14
14
|
type() {
|
15
|
-
return
|
15
|
+
return ResourceErrors.TYPE;
|
16
16
|
}
|
17
|
-
}
|
18
|
-
__publicField(_ResourceErrors, "TYPE", "resource_errors");
|
19
|
-
let ResourceErrors = _ResourceErrors;
|
17
|
+
}
|
20
18
|
const instance = new ResourceErrors();
|
21
19
|
var resource_errors_default = instance;
|
22
20
|
|
@@ -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 ReturnLineItems extends resource.ApiResource {
|
6
|
+
static TYPE = "return_line_items";
|
7
7
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create({ ...resource, type:
|
8
|
+
return this.resources.create({ ...resource, type: ReturnLineItems.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: ReturnLineItems.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: ReturnLineItems.TYPE } : id, options);
|
15
15
|
}
|
16
16
|
async return(returnLineItemId, params, options) {
|
17
17
|
const _returnLineItemId = returnLineItemId.id || returnLineItemId;
|
@@ -22,10 +22,10 @@ const _ReturnLineItems = class _ReturnLineItems extends resource.ApiResource {
|
|
22
22
|
return this.resources.fetch({ type: "line_items" }, `return_line_items/${_returnLineItemId}/line_item`, params, options);
|
23
23
|
}
|
24
24
|
async _restock(id, params, options) {
|
25
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
25
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: ReturnLineItems.TYPE, _restock: true }, params, options);
|
26
26
|
}
|
27
27
|
isReturnLineItem(resource) {
|
28
|
-
return resource.type && resource.type ===
|
28
|
+
return resource.type && resource.type === ReturnLineItems.TYPE;
|
29
29
|
}
|
30
30
|
relationship(id) {
|
31
31
|
return super.relationshipOneToOne(id);
|
@@ -34,11 +34,9 @@ const _ReturnLineItems = class _ReturnLineItems extends resource.ApiResource {
|
|
34
34
|
return super.relationshipOneToMany(...ids);
|
35
35
|
}
|
36
36
|
type() {
|
37
|
-
return
|
37
|
+
return ReturnLineItems.TYPE;
|
38
38
|
}
|
39
|
-
}
|
40
|
-
chunkJE77HYXB_cjs.__publicField(_ReturnLineItems, "TYPE", "return_line_items");
|
41
|
-
let ReturnLineItems = _ReturnLineItems;
|
39
|
+
}
|
42
40
|
const instance = new ReturnLineItems();
|
43
41
|
var return_line_items_default = instance;
|
44
42
|
|
@@ -1,15 +1,15 @@
|
|
1
|
-
import { __publicField } from '../chunk-AQ5VUG5P.js';
|
2
1
|
import { ApiResource } from '../resource';
|
3
2
|
|
4
|
-
|
3
|
+
class ReturnLineItems extends ApiResource {
|
4
|
+
static TYPE = "return_line_items";
|
5
5
|
async create(resource, params, options) {
|
6
|
-
return this.resources.create({ ...resource, type:
|
6
|
+
return this.resources.create({ ...resource, type: ReturnLineItems.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: ReturnLineItems.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: ReturnLineItems.TYPE } : id, options);
|
13
13
|
}
|
14
14
|
async return(returnLineItemId, params, options) {
|
15
15
|
const _returnLineItemId = returnLineItemId.id || returnLineItemId;
|
@@ -20,10 +20,10 @@ const _ReturnLineItems = class _ReturnLineItems extends ApiResource {
|
|
20
20
|
return this.resources.fetch({ type: "line_items" }, `return_line_items/${_returnLineItemId}/line_item`, params, options);
|
21
21
|
}
|
22
22
|
async _restock(id, params, options) {
|
23
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
23
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: ReturnLineItems.TYPE, _restock: true }, params, options);
|
24
24
|
}
|
25
25
|
isReturnLineItem(resource) {
|
26
|
-
return resource.type && resource.type ===
|
26
|
+
return resource.type && resource.type === ReturnLineItems.TYPE;
|
27
27
|
}
|
28
28
|
relationship(id) {
|
29
29
|
return super.relationshipOneToOne(id);
|
@@ -32,11 +32,9 @@ const _ReturnLineItems = class _ReturnLineItems extends ApiResource {
|
|
32
32
|
return super.relationshipOneToMany(...ids);
|
33
33
|
}
|
34
34
|
type() {
|
35
|
-
return
|
35
|
+
return ReturnLineItems.TYPE;
|
36
36
|
}
|
37
|
-
}
|
38
|
-
__publicField(_ReturnLineItems, "TYPE", "return_line_items");
|
39
|
-
let ReturnLineItems = _ReturnLineItems;
|
37
|
+
}
|
40
38
|
const instance = new ReturnLineItems();
|
41
39
|
var return_line_items_default = instance;
|
42
40
|
|