@commercelayer/sdk 5.0.0-beta.4 → 5.0.0-beta.6
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/cjs/client.js +8 -3
- package/lib/cjs/commercelayer.d.ts +2 -2
- package/lib/cjs/commercelayer.js +1 -1
- package/lib/cjs/error.js +1 -1
- package/lib/cjs/jsonapi.js +5 -1
- package/lib/cjs/resource.js +7 -7
- package/lib/cjs/resources/addresses.js +2 -3
- package/lib/cjs/resources/adjustments.js +2 -3
- package/lib/cjs/resources/adyen_gateways.js +2 -3
- package/lib/cjs/resources/adyen_payments.js +2 -3
- package/lib/cjs/resources/application.js +0 -1
- package/lib/cjs/resources/attachments.js +2 -3
- package/lib/cjs/resources/authorizations.js +1 -2
- package/lib/cjs/resources/avalara_accounts.js +2 -3
- package/lib/cjs/resources/axerve_gateways.js +2 -3
- package/lib/cjs/resources/axerve_payments.js +2 -3
- package/lib/cjs/resources/billing_info_validation_rules.js +2 -3
- package/lib/cjs/resources/bing_geocoders.js +2 -3
- package/lib/cjs/resources/braintree_gateways.js +2 -3
- package/lib/cjs/resources/braintree_payments.js +2 -3
- package/lib/cjs/resources/bundles.js +2 -3
- package/lib/cjs/resources/captures.js +1 -2
- package/lib/cjs/resources/carrier_accounts.js +0 -1
- package/lib/cjs/resources/checkout_com_gateways.js +2 -3
- package/lib/cjs/resources/checkout_com_payments.js +2 -3
- package/lib/cjs/resources/cleanups.js +1 -2
- package/lib/cjs/resources/coupon_codes_promotion_rules.js +2 -3
- package/lib/cjs/resources/coupon_recipients.js +2 -3
- package/lib/cjs/resources/coupons.js +2 -3
- package/lib/cjs/resources/customer_addresses.js +2 -3
- package/lib/cjs/resources/customer_groups.js +2 -3
- package/lib/cjs/resources/customer_password_resets.js +2 -3
- package/lib/cjs/resources/customer_payment_sources.js +2 -3
- package/lib/cjs/resources/customer_subscriptions.js +2 -3
- package/lib/cjs/resources/customers.js +2 -3
- package/lib/cjs/resources/delivery_lead_times.js +2 -3
- package/lib/cjs/resources/event_callbacks.js +0 -1
- package/lib/cjs/resources/events.js +0 -1
- package/lib/cjs/resources/exports.js +1 -2
- package/lib/cjs/resources/external_gateways.js +2 -3
- package/lib/cjs/resources/external_payments.js +2 -3
- package/lib/cjs/resources/external_promotions.js +2 -3
- package/lib/cjs/resources/external_tax_calculators.js +2 -3
- package/lib/cjs/resources/fixed_amount_promotions.js +2 -3
- package/lib/cjs/resources/fixed_price_promotions.js +2 -3
- package/lib/cjs/resources/free_gift_promotions.js +2 -3
- package/lib/cjs/resources/free_shipping_promotions.js +2 -3
- package/lib/cjs/resources/geocoders.js +0 -1
- package/lib/cjs/resources/gift_card_recipients.js +2 -3
- package/lib/cjs/resources/gift_cards.js +2 -3
- package/lib/cjs/resources/google_geocoders.js +2 -3
- package/lib/cjs/resources/imports.js +1 -2
- package/lib/cjs/resources/in_stock_subscriptions.js +2 -3
- package/lib/cjs/resources/inventory_models.js +2 -3
- package/lib/cjs/resources/inventory_return_locations.js +2 -3
- package/lib/cjs/resources/inventory_stock_locations.js +2 -3
- package/lib/cjs/resources/klarna_gateways.js +2 -3
- package/lib/cjs/resources/klarna_payments.js +2 -3
- package/lib/cjs/resources/line_item_options.js +2 -3
- package/lib/cjs/resources/line_items.d.ts +2 -2
- package/lib/cjs/resources/line_items.js +2 -3
- package/lib/cjs/resources/manual_gateways.js +2 -3
- package/lib/cjs/resources/manual_tax_calculators.js +2 -3
- package/lib/cjs/resources/markets.js +2 -3
- package/lib/cjs/resources/merchants.js +2 -3
- package/lib/cjs/resources/order_amount_promotion_rules.js +2 -3
- package/lib/cjs/resources/order_copies.js +1 -2
- package/lib/cjs/resources/order_subscriptions.js +2 -3
- package/lib/cjs/resources/order_validation_rules.js +0 -1
- package/lib/cjs/resources/orders.d.ts +2 -2
- package/lib/cjs/resources/orders.js +2 -3
- package/lib/cjs/resources/organization.js +0 -1
- package/lib/cjs/resources/packages.js +2 -3
- package/lib/cjs/resources/parcel_line_items.js +2 -3
- package/lib/cjs/resources/parcels.js +2 -3
- package/lib/cjs/resources/payment_gateways.js +0 -1
- package/lib/cjs/resources/payment_methods.js +2 -3
- package/lib/cjs/resources/paypal_gateways.js +2 -3
- package/lib/cjs/resources/paypal_payments.js +2 -3
- package/lib/cjs/resources/percentage_discount_promotions.js +2 -3
- package/lib/cjs/resources/price_lists.js +2 -3
- package/lib/cjs/resources/price_tiers.js +0 -1
- package/lib/cjs/resources/price_volume_tiers.js +2 -3
- package/lib/cjs/resources/prices.js +2 -3
- package/lib/cjs/resources/promotion_rules.js +0 -1
- package/lib/cjs/resources/promotions.js +0 -1
- package/lib/cjs/resources/refunds.js +0 -1
- package/lib/cjs/resources/return_line_items.js +2 -3
- package/lib/cjs/resources/returns.js +2 -3
- package/lib/cjs/resources/satispay_gateways.js +2 -3
- package/lib/cjs/resources/satispay_payments.js +2 -3
- package/lib/cjs/resources/shipments.js +1 -2
- package/lib/cjs/resources/shipping_categories.js +2 -3
- package/lib/cjs/resources/shipping_method_tiers.js +0 -1
- package/lib/cjs/resources/shipping_methods.js +2 -3
- package/lib/cjs/resources/shipping_weight_tiers.js +2 -3
- package/lib/cjs/resources/shipping_zones.js +2 -3
- package/lib/cjs/resources/sku_list_items.js +2 -3
- package/lib/cjs/resources/sku_list_promotion_rules.js +2 -3
- package/lib/cjs/resources/sku_lists.js +2 -3
- package/lib/cjs/resources/sku_options.js +2 -3
- package/lib/cjs/resources/skus.js +2 -3
- package/lib/cjs/resources/stock_items.js +2 -3
- package/lib/cjs/resources/stock_line_items.js +0 -1
- package/lib/cjs/resources/stock_locations.js +2 -3
- package/lib/cjs/resources/stock_transfers.js +2 -3
- package/lib/cjs/resources/stripe_gateways.js +2 -3
- package/lib/cjs/resources/stripe_payments.js +2 -3
- package/lib/cjs/resources/tax_calculators.js +0 -1
- package/lib/cjs/resources/tax_categories.js +2 -3
- package/lib/cjs/resources/tax_rules.js +2 -3
- package/lib/cjs/resources/taxjar_accounts.js +2 -3
- package/lib/cjs/resources/transactions.js +0 -1
- package/lib/cjs/resources/voids.js +0 -1
- package/lib/cjs/resources/webhooks.js +2 -3
- package/lib/cjs/resources/wire_transfers.js +2 -3
- package/lib/esm/client.js +8 -3
- package/lib/esm/commercelayer.d.ts +2 -2
- package/lib/esm/commercelayer.js +1 -1
- package/lib/esm/error.js +1 -1
- package/lib/esm/jsonapi.js +5 -1
- package/lib/esm/resource.js +7 -7
- package/lib/esm/resources/addresses.js +2 -3
- package/lib/esm/resources/adjustments.js +2 -3
- package/lib/esm/resources/adyen_gateways.js +2 -3
- package/lib/esm/resources/adyen_payments.js +2 -3
- package/lib/esm/resources/application.js +0 -1
- package/lib/esm/resources/attachments.js +2 -3
- package/lib/esm/resources/authorizations.js +1 -2
- package/lib/esm/resources/avalara_accounts.js +2 -3
- package/lib/esm/resources/axerve_gateways.js +2 -3
- package/lib/esm/resources/axerve_payments.js +2 -3
- package/lib/esm/resources/billing_info_validation_rules.js +2 -3
- package/lib/esm/resources/bing_geocoders.js +2 -3
- package/lib/esm/resources/braintree_gateways.js +2 -3
- package/lib/esm/resources/braintree_payments.js +2 -3
- package/lib/esm/resources/bundles.js +2 -3
- package/lib/esm/resources/captures.js +1 -2
- package/lib/esm/resources/carrier_accounts.js +0 -1
- package/lib/esm/resources/checkout_com_gateways.js +2 -3
- package/lib/esm/resources/checkout_com_payments.js +2 -3
- package/lib/esm/resources/cleanups.js +1 -2
- package/lib/esm/resources/coupon_codes_promotion_rules.js +2 -3
- package/lib/esm/resources/coupon_recipients.js +2 -3
- package/lib/esm/resources/coupons.js +2 -3
- package/lib/esm/resources/customer_addresses.js +2 -3
- package/lib/esm/resources/customer_groups.js +2 -3
- package/lib/esm/resources/customer_password_resets.js +2 -3
- package/lib/esm/resources/customer_payment_sources.js +2 -3
- package/lib/esm/resources/customer_subscriptions.js +2 -3
- package/lib/esm/resources/customers.js +2 -3
- package/lib/esm/resources/delivery_lead_times.js +2 -3
- package/lib/esm/resources/event_callbacks.js +0 -1
- package/lib/esm/resources/events.js +0 -1
- package/lib/esm/resources/exports.js +1 -2
- package/lib/esm/resources/external_gateways.js +2 -3
- package/lib/esm/resources/external_payments.js +2 -3
- package/lib/esm/resources/external_promotions.js +2 -3
- package/lib/esm/resources/external_tax_calculators.js +2 -3
- package/lib/esm/resources/fixed_amount_promotions.js +2 -3
- package/lib/esm/resources/fixed_price_promotions.js +2 -3
- package/lib/esm/resources/free_gift_promotions.js +2 -3
- package/lib/esm/resources/free_shipping_promotions.js +2 -3
- package/lib/esm/resources/geocoders.js +0 -1
- package/lib/esm/resources/gift_card_recipients.js +2 -3
- package/lib/esm/resources/gift_cards.js +2 -3
- package/lib/esm/resources/google_geocoders.js +2 -3
- package/lib/esm/resources/imports.js +1 -2
- package/lib/esm/resources/in_stock_subscriptions.js +2 -3
- package/lib/esm/resources/inventory_models.js +2 -3
- package/lib/esm/resources/inventory_return_locations.js +2 -3
- package/lib/esm/resources/inventory_stock_locations.js +2 -3
- package/lib/esm/resources/klarna_gateways.js +2 -3
- package/lib/esm/resources/klarna_payments.js +2 -3
- package/lib/esm/resources/line_item_options.js +2 -3
- package/lib/esm/resources/line_items.d.ts +2 -2
- package/lib/esm/resources/line_items.js +2 -3
- package/lib/esm/resources/manual_gateways.js +2 -3
- package/lib/esm/resources/manual_tax_calculators.js +2 -3
- package/lib/esm/resources/markets.js +2 -3
- package/lib/esm/resources/merchants.js +2 -3
- package/lib/esm/resources/order_amount_promotion_rules.js +2 -3
- package/lib/esm/resources/order_copies.js +1 -2
- package/lib/esm/resources/order_subscriptions.js +2 -3
- package/lib/esm/resources/order_validation_rules.js +0 -1
- package/lib/esm/resources/orders.d.ts +2 -2
- package/lib/esm/resources/orders.js +2 -3
- package/lib/esm/resources/organization.js +0 -1
- package/lib/esm/resources/packages.js +2 -3
- package/lib/esm/resources/parcel_line_items.js +2 -3
- package/lib/esm/resources/parcels.js +2 -3
- package/lib/esm/resources/payment_gateways.js +0 -1
- package/lib/esm/resources/payment_methods.js +2 -3
- package/lib/esm/resources/paypal_gateways.js +2 -3
- package/lib/esm/resources/paypal_payments.js +2 -3
- package/lib/esm/resources/percentage_discount_promotions.js +2 -3
- package/lib/esm/resources/price_lists.js +2 -3
- package/lib/esm/resources/price_tiers.js +0 -1
- package/lib/esm/resources/price_volume_tiers.js +2 -3
- package/lib/esm/resources/prices.js +2 -3
- package/lib/esm/resources/promotion_rules.js +0 -1
- package/lib/esm/resources/promotions.js +0 -1
- package/lib/esm/resources/refunds.js +0 -1
- package/lib/esm/resources/return_line_items.js +2 -3
- package/lib/esm/resources/returns.js +2 -3
- package/lib/esm/resources/satispay_gateways.js +2 -3
- package/lib/esm/resources/satispay_payments.js +2 -3
- package/lib/esm/resources/shipments.js +1 -2
- package/lib/esm/resources/shipping_categories.js +2 -3
- package/lib/esm/resources/shipping_method_tiers.js +0 -1
- package/lib/esm/resources/shipping_methods.js +2 -3
- package/lib/esm/resources/shipping_weight_tiers.js +2 -3
- package/lib/esm/resources/shipping_zones.js +2 -3
- package/lib/esm/resources/sku_list_items.js +2 -3
- package/lib/esm/resources/sku_list_promotion_rules.js +2 -3
- package/lib/esm/resources/sku_lists.js +2 -3
- package/lib/esm/resources/sku_options.js +2 -3
- package/lib/esm/resources/skus.js +2 -3
- package/lib/esm/resources/stock_items.js +2 -3
- package/lib/esm/resources/stock_line_items.js +0 -1
- package/lib/esm/resources/stock_locations.js +2 -3
- package/lib/esm/resources/stock_transfers.js +2 -3
- package/lib/esm/resources/stripe_gateways.js +2 -3
- package/lib/esm/resources/stripe_payments.js +2 -3
- package/lib/esm/resources/tax_calculators.js +0 -1
- package/lib/esm/resources/tax_categories.js +2 -3
- package/lib/esm/resources/tax_rules.js +2 -3
- package/lib/esm/resources/taxjar_accounts.js +2 -3
- package/lib/esm/resources/transactions.js +0 -1
- package/lib/esm/resources/voids.js +0 -1
- package/lib/esm/resources/webhooks.js +2 -3
- package/lib/esm/resources/wire_transfers.js +2 -3
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
@@ -2,7 +2,6 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class StockLineItems extends resource_1.ApiResource {
|
5
|
-
// static readonly PATH = 'stock_line_items'
|
6
5
|
async list(params, options) {
|
7
6
|
return this.resources.list({ type: StockLineItems.TYPE }, params, options);
|
8
7
|
}
|
@@ -2,15 +2,14 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class StockLocations extends resource_1.ApiResource {
|
5
|
-
// static readonly PATH = 'stock_locations'
|
6
5
|
async list(params, options) {
|
7
6
|
return this.resources.list({ type: StockLocations.TYPE }, params, options);
|
8
7
|
}
|
9
8
|
async create(resource, params, options) {
|
10
|
-
return this.resources.create(
|
9
|
+
return this.resources.create({ ...resource, type: StockLocations.TYPE }, params, options);
|
11
10
|
}
|
12
11
|
async update(resource, params, options) {
|
13
|
-
return this.resources.update(
|
12
|
+
return this.resources.update({ ...resource, type: StockLocations.TYPE }, params, options);
|
14
13
|
}
|
15
14
|
async delete(id, options) {
|
16
15
|
await this.resources.delete((typeof id === 'string') ? { id, type: StockLocations.TYPE } : id, options);
|
@@ -2,15 +2,14 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class StockTransfers extends resource_1.ApiResource {
|
5
|
-
// static readonly PATH = 'stock_transfers'
|
6
5
|
async list(params, options) {
|
7
6
|
return this.resources.list({ type: StockTransfers.TYPE }, params, options);
|
8
7
|
}
|
9
8
|
async create(resource, params, options) {
|
10
|
-
return this.resources.create(
|
9
|
+
return this.resources.create({ ...resource, type: StockTransfers.TYPE }, params, options);
|
11
10
|
}
|
12
11
|
async update(resource, params, options) {
|
13
|
-
return this.resources.update(
|
12
|
+
return this.resources.update({ ...resource, type: StockTransfers.TYPE }, params, options);
|
14
13
|
}
|
15
14
|
async delete(id, options) {
|
16
15
|
await this.resources.delete((typeof id === 'string') ? { id, type: StockTransfers.TYPE } : id, options);
|
@@ -2,15 +2,14 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class StripeGateways extends resource_1.ApiResource {
|
5
|
-
// static readonly PATH = 'stripe_gateways'
|
6
5
|
async list(params, options) {
|
7
6
|
return this.resources.list({ type: StripeGateways.TYPE }, params, options);
|
8
7
|
}
|
9
8
|
async create(resource, params, options) {
|
10
|
-
return this.resources.create(
|
9
|
+
return this.resources.create({ ...resource, type: StripeGateways.TYPE }, params, options);
|
11
10
|
}
|
12
11
|
async update(resource, params, options) {
|
13
|
-
return this.resources.update(
|
12
|
+
return this.resources.update({ ...resource, type: StripeGateways.TYPE }, params, options);
|
14
13
|
}
|
15
14
|
async delete(id, options) {
|
16
15
|
await this.resources.delete((typeof id === 'string') ? { id, type: StripeGateways.TYPE } : id, options);
|
@@ -2,15 +2,14 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class StripePayments extends resource_1.ApiResource {
|
5
|
-
// static readonly PATH = 'stripe_payments'
|
6
5
|
async list(params, options) {
|
7
6
|
return this.resources.list({ type: StripePayments.TYPE }, params, options);
|
8
7
|
}
|
9
8
|
async create(resource, params, options) {
|
10
|
-
return this.resources.create(
|
9
|
+
return this.resources.create({ ...resource, type: StripePayments.TYPE }, params, options);
|
11
10
|
}
|
12
11
|
async update(resource, params, options) {
|
13
|
-
return this.resources.update(
|
12
|
+
return this.resources.update({ ...resource, type: StripePayments.TYPE }, params, options);
|
14
13
|
}
|
15
14
|
async delete(id, options) {
|
16
15
|
await this.resources.delete((typeof id === 'string') ? { id, type: StripePayments.TYPE } : id, options);
|
@@ -2,7 +2,6 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class TaxCalculators extends resource_1.ApiResource {
|
5
|
-
// static readonly PATH = 'tax_calculators'
|
6
5
|
async list(params, options) {
|
7
6
|
return this.resources.list({ type: TaxCalculators.TYPE }, params, options);
|
8
7
|
}
|
@@ -2,15 +2,14 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class TaxCategories extends resource_1.ApiResource {
|
5
|
-
// static readonly PATH = 'tax_categories'
|
6
5
|
async list(params, options) {
|
7
6
|
return this.resources.list({ type: TaxCategories.TYPE }, params, options);
|
8
7
|
}
|
9
8
|
async create(resource, params, options) {
|
10
|
-
return this.resources.create(
|
9
|
+
return this.resources.create({ ...resource, type: TaxCategories.TYPE }, params, options);
|
11
10
|
}
|
12
11
|
async update(resource, params, options) {
|
13
|
-
return this.resources.update(
|
12
|
+
return this.resources.update({ ...resource, type: TaxCategories.TYPE }, params, options);
|
14
13
|
}
|
15
14
|
async delete(id, options) {
|
16
15
|
await this.resources.delete((typeof id === 'string') ? { id, type: TaxCategories.TYPE } : id, options);
|
@@ -2,15 +2,14 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class TaxRules extends resource_1.ApiResource {
|
5
|
-
// static readonly PATH = 'tax_rules'
|
6
5
|
async list(params, options) {
|
7
6
|
return this.resources.list({ type: TaxRules.TYPE }, params, options);
|
8
7
|
}
|
9
8
|
async create(resource, params, options) {
|
10
|
-
return this.resources.create(
|
9
|
+
return this.resources.create({ ...resource, type: TaxRules.TYPE }, params, options);
|
11
10
|
}
|
12
11
|
async update(resource, params, options) {
|
13
|
-
return this.resources.update(
|
12
|
+
return this.resources.update({ ...resource, type: TaxRules.TYPE }, params, options);
|
14
13
|
}
|
15
14
|
async delete(id, options) {
|
16
15
|
await this.resources.delete((typeof id === 'string') ? { id, type: TaxRules.TYPE } : id, options);
|
@@ -2,15 +2,14 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class TaxjarAccounts extends resource_1.ApiResource {
|
5
|
-
// static readonly PATH = 'taxjar_accounts'
|
6
5
|
async list(params, options) {
|
7
6
|
return this.resources.list({ type: TaxjarAccounts.TYPE }, params, options);
|
8
7
|
}
|
9
8
|
async create(resource, params, options) {
|
10
|
-
return this.resources.create(
|
9
|
+
return this.resources.create({ ...resource, type: TaxjarAccounts.TYPE }, params, options);
|
11
10
|
}
|
12
11
|
async update(resource, params, options) {
|
13
|
-
return this.resources.update(
|
12
|
+
return this.resources.update({ ...resource, type: TaxjarAccounts.TYPE }, params, options);
|
14
13
|
}
|
15
14
|
async delete(id, options) {
|
16
15
|
await this.resources.delete((typeof id === 'string') ? { id, type: TaxjarAccounts.TYPE } : id, options);
|
@@ -2,7 +2,6 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class Transactions extends resource_1.ApiResource {
|
5
|
-
// static readonly PATH = 'transactions'
|
6
5
|
async list(params, options) {
|
7
6
|
return this.resources.list({ type: Transactions.TYPE }, params, options);
|
8
7
|
}
|
@@ -2,7 +2,6 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class Voids extends resource_1.ApiResource {
|
5
|
-
// static readonly PATH = 'voids'
|
6
5
|
async list(params, options) {
|
7
6
|
return this.resources.list({ type: Voids.TYPE }, params, options);
|
8
7
|
}
|
@@ -2,15 +2,14 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class Webhooks extends resource_1.ApiResource {
|
5
|
-
// static readonly PATH = 'webhooks'
|
6
5
|
async list(params, options) {
|
7
6
|
return this.resources.list({ type: Webhooks.TYPE }, params, options);
|
8
7
|
}
|
9
8
|
async create(resource, params, options) {
|
10
|
-
return this.resources.create(
|
9
|
+
return this.resources.create({ ...resource, type: Webhooks.TYPE }, params, options);
|
11
10
|
}
|
12
11
|
async update(resource, params, options) {
|
13
|
-
return this.resources.update(
|
12
|
+
return this.resources.update({ ...resource, type: Webhooks.TYPE }, params, options);
|
14
13
|
}
|
15
14
|
async delete(id, options) {
|
16
15
|
await this.resources.delete((typeof id === 'string') ? { id, type: Webhooks.TYPE } : id, options);
|
@@ -2,15 +2,14 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class WireTransfers extends resource_1.ApiResource {
|
5
|
-
// static readonly PATH = 'wire_transfers'
|
6
5
|
async list(params, options) {
|
7
6
|
return this.resources.list({ type: WireTransfers.TYPE }, params, options);
|
8
7
|
}
|
9
8
|
async create(resource, params, options) {
|
10
|
-
return this.resources.create(
|
9
|
+
return this.resources.create({ ...resource, type: WireTransfers.TYPE }, params, options);
|
11
10
|
}
|
12
11
|
async update(resource, params, options) {
|
13
|
-
return this.resources.update(
|
12
|
+
return this.resources.update({ ...resource, type: WireTransfers.TYPE }, params, options);
|
14
13
|
}
|
15
14
|
async delete(id, options) {
|
16
15
|
await this.resources.delete((typeof id === 'string') ? { id, type: WireTransfers.TYPE } : id, options);
|
package/lib/esm/client.js
CHANGED
@@ -66,11 +66,16 @@ class ApiClient {
|
|
66
66
|
httpAgent: options.httpAgent,
|
67
67
|
httpsAgent: options.httpsAgent,
|
68
68
|
};
|
69
|
-
const axiosOptions =
|
69
|
+
const axiosOptions = {
|
70
|
+
baseURL: this.baseUrl,
|
71
|
+
timeout: config.client.timeout,
|
72
|
+
headers: {
|
70
73
|
'Accept': 'application/vnd.api+json',
|
71
74
|
'Content-Type': 'application/vnd.api+json',
|
72
75
|
'Authorization': 'Bearer ' + __classPrivateFieldGet(this, _ApiClient_accessToken, "f"),
|
73
|
-
}
|
76
|
+
},
|
77
|
+
...axiosConfig
|
78
|
+
};
|
74
79
|
debug('axios options: %O', axiosOptions);
|
75
80
|
__classPrivateFieldSet(this, _ApiClient_client, axios.create(axiosOptions), "f");
|
76
81
|
this.interceptors = __classPrivateFieldGet(this, _ApiClient_client, "f").interceptors;
|
@@ -103,7 +108,7 @@ class ApiClient {
|
|
103
108
|
const baseUrl = (options === null || options === void 0 ? void 0 : options.organization) ? baseURL(options.organization, options.domain) : undefined;
|
104
109
|
const accessToken = (options === null || options === void 0 ? void 0 : options.accessToken) || __classPrivateFieldGet(this, _ApiClient_accessToken, "f");
|
105
110
|
const headers = accessToken ? { 'Authorization': 'Bearer ' + accessToken } : undefined;
|
106
|
-
const requestParams =
|
111
|
+
const requestParams = { method, baseURL: baseUrl, url, data, headers, ...options };
|
107
112
|
debug('request params: %O', requestParams);
|
108
113
|
// const start = Date.now()
|
109
114
|
return __classPrivateFieldGet(this, _ApiClient_client, "f").request(requestParams)
|
@@ -2,7 +2,7 @@ import * as api from './api';
|
|
2
2
|
import { ApiError } from './error';
|
3
3
|
import type { ErrorInterceptor, InterceptorType, RawResponseReader, RequestInterceptor, ResponseInterceptor } from './interceptor';
|
4
4
|
import { ResourcesInitConfig } from './resource';
|
5
|
-
declare const OPEN_API_SCHEMA_VERSION = "4.0.
|
5
|
+
declare const OPEN_API_SCHEMA_VERSION = "4.0.1";
|
6
6
|
export { OPEN_API_SCHEMA_VERSION };
|
7
7
|
type SdkConfig = {};
|
8
8
|
type CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig;
|
@@ -10,7 +10,7 @@ type CommerceLayerConfig = Partial<CommerceLayerInitConfig>;
|
|
10
10
|
declare class CommerceLayerClient {
|
11
11
|
#private;
|
12
12
|
static get openApiSchemaVersion(): string;
|
13
|
-
readonly openApiSchemaVersion = "4.0.
|
13
|
+
readonly openApiSchemaVersion = "4.0.1";
|
14
14
|
addresses: api.Addresses;
|
15
15
|
adjustments: api.Adjustments;
|
16
16
|
adyen_gateways: api.AdyenGateways;
|
package/lib/esm/commercelayer.js
CHANGED
@@ -16,7 +16,7 @@ import ResourceAdapter from './resource';
|
|
16
16
|
import Debug from './debug';
|
17
17
|
const debug = Debug('commercelayer');
|
18
18
|
// Autogenerated schema version number, do not remove this line
|
19
|
-
const OPEN_API_SCHEMA_VERSION = '4.0.
|
19
|
+
const OPEN_API_SCHEMA_VERSION = '4.0.1';
|
20
20
|
export { OPEN_API_SCHEMA_VERSION };
|
21
21
|
class CommerceLayerClient {
|
22
22
|
static get openApiSchemaVersion() { return OPEN_API_SCHEMA_VERSION; }
|
package/lib/esm/error.js
CHANGED
@@ -22,7 +22,7 @@ class ApiError extends SdkError {
|
|
22
22
|
return SdkError.isSdkError(error) && (error.name === ApiError.NAME) && (error.type === ErrorType.RESPONSE);
|
23
23
|
}
|
24
24
|
constructor(error) {
|
25
|
-
super(
|
25
|
+
super({ ...error, type: ErrorType.RESPONSE });
|
26
26
|
this.errors = [];
|
27
27
|
this.name = ApiError.NAME; // this.constructor.name
|
28
28
|
}
|
package/lib/esm/jsonapi.js
CHANGED
@@ -28,7 +28,11 @@ const denormalizeResource = (res, included) => {
|
|
28
28
|
debug('denormalize resource: %O, %o', res, included || {});
|
29
29
|
if (!res)
|
30
30
|
return res;
|
31
|
-
const resource =
|
31
|
+
const resource = {
|
32
|
+
id: res.id,
|
33
|
+
type: res.type,
|
34
|
+
...res.attributes,
|
35
|
+
};
|
32
36
|
if (res.relationships)
|
33
37
|
Object.keys(res.relationships).forEach(key => {
|
34
38
|
const rel = res.relationships[key].data;
|
package/lib/esm/resource.js
CHANGED
@@ -55,7 +55,7 @@ class ResourceAdapter {
|
|
55
55
|
const queryParams = generateQueryStringParams(params, resource);
|
56
56
|
if (options === null || options === void 0 ? void 0 : options.params)
|
57
57
|
Object.assign(queryParams, options === null || options === void 0 ? void 0 : options.params);
|
58
|
-
const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('get', `${resource.type}`, undefined,
|
58
|
+
const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('get', `${resource.type}`, undefined, { ...options, params: queryParams });
|
59
59
|
const r = denormalize(res);
|
60
60
|
return r;
|
61
61
|
}
|
@@ -64,7 +64,7 @@ class ResourceAdapter {
|
|
64
64
|
const queryParams = generateQueryStringParams(params, resource);
|
65
65
|
if (options === null || options === void 0 ? void 0 : options.params)
|
66
66
|
Object.assign(queryParams, options === null || options === void 0 ? void 0 : options.params);
|
67
|
-
const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('get', `${resource.type}/${resource.id}`, undefined,
|
67
|
+
const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('get', `${resource.type}/${resource.id}`, undefined, { ...options, params: queryParams });
|
68
68
|
const r = denormalize(res);
|
69
69
|
return r;
|
70
70
|
}
|
@@ -74,7 +74,7 @@ class ResourceAdapter {
|
|
74
74
|
const queryParams = generateQueryStringParams(params, resource);
|
75
75
|
if (options === null || options === void 0 ? void 0 : options.params)
|
76
76
|
Object.assign(queryParams, options === null || options === void 0 ? void 0 : options.params);
|
77
|
-
const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('get', `${resource.type}`, undefined,
|
77
|
+
const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('get', `${resource.type}`, undefined, { ...options, params: queryParams });
|
78
78
|
const r = denormalize(res);
|
79
79
|
const meta = {
|
80
80
|
pageCount: Number((_a = res.meta) === null || _a === void 0 ? void 0 : _a.page_count),
|
@@ -90,7 +90,7 @@ class ResourceAdapter {
|
|
90
90
|
if (options === null || options === void 0 ? void 0 : options.params)
|
91
91
|
Object.assign(queryParams, options === null || options === void 0 ? void 0 : options.params);
|
92
92
|
const data = normalize(resource);
|
93
|
-
const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('post', resource.type, data,
|
93
|
+
const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('post', resource.type, data, { ...options, params: queryParams });
|
94
94
|
const r = denormalize(res);
|
95
95
|
return r;
|
96
96
|
}
|
@@ -100,7 +100,7 @@ class ResourceAdapter {
|
|
100
100
|
if (options === null || options === void 0 ? void 0 : options.params)
|
101
101
|
Object.assign(queryParams, options === null || options === void 0 ? void 0 : options.params);
|
102
102
|
const data = normalize(resource);
|
103
|
-
const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('patch', `${resource.type}/${resource.id}`, data,
|
103
|
+
const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('patch', `${resource.type}/${resource.id}`, data, { ...options, params: queryParams });
|
104
104
|
const r = denormalize(res);
|
105
105
|
return r;
|
106
106
|
}
|
@@ -114,7 +114,7 @@ class ResourceAdapter {
|
|
114
114
|
const queryParams = generateQueryStringParams(params, resource);
|
115
115
|
if (options === null || options === void 0 ? void 0 : options.params)
|
116
116
|
Object.assign(queryParams, options === null || options === void 0 ? void 0 : options.params);
|
117
|
-
const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('get', path, undefined,
|
117
|
+
const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('get', path, undefined, { ...options, params: queryParams });
|
118
118
|
const r = denormalize(res);
|
119
119
|
if (Array.isArray(r)) {
|
120
120
|
const p = params;
|
@@ -138,7 +138,7 @@ class ApiResourceBase {
|
|
138
138
|
}
|
139
139
|
// reference, reference_origin and metadata attributes are always updatable
|
140
140
|
async update(resource, params, options) {
|
141
|
-
return this.resources.update(
|
141
|
+
return this.resources.update({ ...resource, type: this.type() }, params, options);
|
142
142
|
}
|
143
143
|
async count(filter, options) {
|
144
144
|
const params = { filters: isParamsList(filter) ? filter.filters : filter, pageNumber: 1, pageSize: 1 };
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class Addresses extends ApiResource {
|
3
|
-
// static readonly PATH = 'addresses'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: Addresses.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: Addresses.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: Addresses.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: Addresses.TYPE } : id, options);
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class Adjustments extends ApiResource {
|
3
|
-
// static readonly PATH = 'adjustments'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: Adjustments.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: Adjustments.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: Adjustments.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: Adjustments.TYPE } : id, options);
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class AdyenGateways extends ApiResource {
|
3
|
-
// static readonly PATH = 'adyen_gateways'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: AdyenGateways.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: AdyenGateways.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: AdyenGateways.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: AdyenGateways.TYPE } : id, options);
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class AdyenPayments extends ApiResource {
|
3
|
-
// static readonly PATH = 'adyen_payments'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: AdyenPayments.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: AdyenPayments.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: AdyenPayments.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: AdyenPayments.TYPE } : id, options);
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class Attachments extends ApiResource {
|
3
|
-
// static readonly PATH = 'attachments'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: Attachments.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: Attachments.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: Attachments.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: Attachments.TYPE } : id, options);
|
@@ -1,11 +1,10 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class Authorizations extends ApiResource {
|
3
|
-
// static readonly PATH = 'authorizations'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: Authorizations.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async update(resource, params, options) {
|
8
|
-
return this.resources.update(
|
7
|
+
return this.resources.update({ ...resource, type: Authorizations.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async order(authorizationId, params, options) {
|
11
10
|
const _authorizationId = authorizationId.id || authorizationId;
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class AvalaraAccounts extends ApiResource {
|
3
|
-
// static readonly PATH = 'avalara_accounts'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: AvalaraAccounts.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: AvalaraAccounts.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: AvalaraAccounts.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: AvalaraAccounts.TYPE } : id, options);
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class AxerveGateways extends ApiResource {
|
3
|
-
// static readonly PATH = 'axerve_gateways'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: AxerveGateways.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: AxerveGateways.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: AxerveGateways.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: AxerveGateways.TYPE } : id, options);
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class AxervePayments extends ApiResource {
|
3
|
-
// static readonly PATH = 'axerve_payments'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: AxervePayments.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: AxervePayments.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: AxervePayments.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: AxervePayments.TYPE } : id, options);
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class BillingInfoValidationRules extends ApiResource {
|
3
|
-
// static readonly PATH = 'billing_info_validation_rules'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: BillingInfoValidationRules.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: BillingInfoValidationRules.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: BillingInfoValidationRules.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: BillingInfoValidationRules.TYPE } : id, options);
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class BingGeocoders extends ApiResource {
|
3
|
-
// static readonly PATH = 'bing_geocoders'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: BingGeocoders.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: BingGeocoders.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: BingGeocoders.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: BingGeocoders.TYPE } : id, options);
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class BraintreeGateways extends ApiResource {
|
3
|
-
// static readonly PATH = 'braintree_gateways'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: BraintreeGateways.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: BraintreeGateways.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: BraintreeGateways.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: BraintreeGateways.TYPE } : id, options);
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class BraintreePayments extends ApiResource {
|
3
|
-
// static readonly PATH = 'braintree_payments'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: BraintreePayments.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: BraintreePayments.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: BraintreePayments.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: BraintreePayments.TYPE } : id, options);
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class Bundles extends ApiResource {
|
3
|
-
// static readonly PATH = 'bundles'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: Bundles.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: Bundles.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: Bundles.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: Bundles.TYPE } : id, options);
|