@commercelayer/sdk 6.0.0-alfa.1 → 6.0.0-alfa.11
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/api.d.ts +0 -3
- package/lib/cjs/api.js +0 -10
- package/lib/cjs/client.d.ts +6 -14
- package/lib/cjs/client.js +39 -73
- package/lib/cjs/commercelayer.d.ts +128 -127
- package/lib/cjs/commercelayer.js +268 -156
- package/lib/cjs/common.js +0 -11
- package/lib/cjs/config.d.ts +3 -0
- package/lib/cjs/config.js +3 -2
- package/lib/cjs/debug.js +0 -21
- package/lib/cjs/error.d.ts +6 -7
- package/lib/cjs/error.js +35 -33
- package/lib/cjs/fetch.d.ts +13 -0
- package/lib/cjs/fetch.js +67 -0
- package/lib/cjs/index.js +0 -2
- package/lib/cjs/interceptor.d.ts +24 -12
- package/lib/cjs/jsonapi.js +10 -7
- package/lib/cjs/model.d.ts +0 -3
- package/lib/cjs/model.js +0 -1
- package/lib/cjs/query.d.ts +3 -2
- package/lib/cjs/query.js +25 -7
- package/lib/cjs/resource.d.ts +4 -4
- package/lib/cjs/resource.js +14 -30
- package/lib/cjs/resources/addresses.d.ts +1 -0
- package/lib/cjs/resources/addresses.js +4 -1
- package/lib/cjs/resources/adjustments.d.ts +1 -0
- package/lib/cjs/resources/adjustments.js +4 -1
- package/lib/cjs/resources/adyen_gateways.d.ts +1 -0
- package/lib/cjs/resources/adyen_gateways.js +4 -1
- package/lib/cjs/resources/adyen_payments.d.ts +1 -0
- package/lib/cjs/resources/adyen_payments.js +4 -1
- package/lib/cjs/resources/application.d.ts +1 -0
- package/lib/cjs/resources/application.js +4 -1
- package/lib/cjs/resources/attachments.d.ts +1 -0
- package/lib/cjs/resources/attachments.js +4 -1
- package/lib/cjs/resources/authorizations.d.ts +1 -0
- package/lib/cjs/resources/authorizations.js +4 -1
- package/lib/cjs/resources/avalara_accounts.d.ts +1 -0
- package/lib/cjs/resources/avalara_accounts.js +4 -1
- package/lib/cjs/resources/axerve_gateways.d.ts +1 -0
- package/lib/cjs/resources/axerve_gateways.js +4 -1
- package/lib/cjs/resources/axerve_payments.d.ts +1 -0
- package/lib/cjs/resources/axerve_payments.js +4 -1
- package/lib/cjs/resources/billing_info_validation_rules.d.ts +1 -0
- package/lib/cjs/resources/billing_info_validation_rules.js +4 -1
- package/lib/cjs/resources/bing_geocoders.d.ts +1 -0
- package/lib/cjs/resources/bing_geocoders.js +4 -1
- package/lib/cjs/resources/braintree_gateways.d.ts +1 -0
- package/lib/cjs/resources/braintree_gateways.js +4 -1
- package/lib/cjs/resources/braintree_payments.d.ts +1 -0
- package/lib/cjs/resources/braintree_payments.js +4 -1
- package/lib/cjs/resources/bundles.d.ts +1 -0
- package/lib/cjs/resources/bundles.js +4 -1
- package/lib/cjs/resources/buy_x_pay_y_promotions.d.ts +1 -0
- package/lib/cjs/resources/buy_x_pay_y_promotions.js +4 -1
- package/lib/cjs/resources/captures.d.ts +1 -0
- package/lib/cjs/resources/captures.js +4 -1
- package/lib/cjs/resources/carrier_accounts.d.ts +1 -0
- package/lib/cjs/resources/carrier_accounts.js +4 -1
- package/lib/cjs/resources/checkout_com_gateways.d.ts +1 -0
- package/lib/cjs/resources/checkout_com_gateways.js +4 -1
- package/lib/cjs/resources/checkout_com_payments.d.ts +1 -0
- package/lib/cjs/resources/checkout_com_payments.js +4 -1
- package/lib/cjs/resources/cleanups.d.ts +1 -0
- package/lib/cjs/resources/cleanups.js +4 -1
- package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +1 -0
- package/lib/cjs/resources/coupon_codes_promotion_rules.js +4 -1
- package/lib/cjs/resources/coupon_recipients.d.ts +1 -0
- package/lib/cjs/resources/coupon_recipients.js +4 -1
- package/lib/cjs/resources/coupons.d.ts +1 -0
- package/lib/cjs/resources/coupons.js +4 -1
- package/lib/cjs/resources/custom_promotion_rules.d.ts +1 -0
- package/lib/cjs/resources/custom_promotion_rules.js +4 -1
- package/lib/cjs/resources/customer_addresses.d.ts +1 -0
- package/lib/cjs/resources/customer_addresses.js +4 -1
- package/lib/cjs/resources/customer_groups.d.ts +1 -0
- package/lib/cjs/resources/customer_groups.js +4 -1
- package/lib/cjs/resources/customer_password_resets.d.ts +1 -0
- package/lib/cjs/resources/customer_password_resets.js +4 -1
- package/lib/cjs/resources/customer_payment_sources.d.ts +1 -0
- package/lib/cjs/resources/customer_payment_sources.js +4 -1
- package/lib/cjs/resources/customer_subscriptions.d.ts +1 -0
- package/lib/cjs/resources/customer_subscriptions.js +4 -1
- package/lib/cjs/resources/customers.d.ts +1 -0
- package/lib/cjs/resources/customers.js +4 -1
- package/lib/cjs/resources/delivery_lead_times.d.ts +1 -0
- package/lib/cjs/resources/delivery_lead_times.js +4 -1
- package/lib/cjs/resources/event_callbacks.d.ts +1 -0
- package/lib/cjs/resources/event_callbacks.js +4 -1
- package/lib/cjs/resources/events.d.ts +4 -3
- package/lib/cjs/resources/events.js +8 -5
- package/lib/cjs/resources/exports.d.ts +1 -0
- package/lib/cjs/resources/exports.js +4 -1
- package/lib/cjs/resources/external_gateways.d.ts +1 -0
- package/lib/cjs/resources/external_gateways.js +4 -1
- package/lib/cjs/resources/external_payments.d.ts +1 -0
- package/lib/cjs/resources/external_payments.js +4 -1
- package/lib/cjs/resources/external_promotions.d.ts +1 -0
- package/lib/cjs/resources/external_promotions.js +4 -1
- package/lib/cjs/resources/external_tax_calculators.d.ts +1 -0
- package/lib/cjs/resources/external_tax_calculators.js +4 -1
- package/lib/cjs/resources/fixed_amount_promotions.d.ts +1 -0
- package/lib/cjs/resources/fixed_amount_promotions.js +4 -1
- package/lib/cjs/resources/fixed_price_promotions.d.ts +1 -0
- package/lib/cjs/resources/fixed_price_promotions.js +4 -1
- package/lib/cjs/resources/free_gift_promotions.d.ts +1 -0
- package/lib/cjs/resources/free_gift_promotions.js +4 -1
- package/lib/cjs/resources/free_shipping_promotions.d.ts +1 -0
- package/lib/cjs/resources/free_shipping_promotions.js +4 -1
- package/lib/cjs/resources/geocoders.d.ts +1 -0
- package/lib/cjs/resources/geocoders.js +4 -1
- package/lib/cjs/resources/gift_card_recipients.d.ts +1 -0
- package/lib/cjs/resources/gift_card_recipients.js +4 -1
- package/lib/cjs/resources/gift_cards.d.ts +1 -0
- package/lib/cjs/resources/gift_cards.js +4 -1
- package/lib/cjs/resources/google_geocoders.d.ts +1 -0
- package/lib/cjs/resources/google_geocoders.js +4 -1
- package/lib/cjs/resources/imports.d.ts +1 -0
- package/lib/cjs/resources/imports.js +4 -1
- package/lib/cjs/resources/in_stock_subscriptions.d.ts +1 -0
- package/lib/cjs/resources/in_stock_subscriptions.js +4 -1
- package/lib/cjs/resources/inventory_models.d.ts +1 -0
- package/lib/cjs/resources/inventory_models.js +4 -1
- package/lib/cjs/resources/inventory_return_locations.d.ts +1 -0
- package/lib/cjs/resources/inventory_return_locations.js +4 -1
- package/lib/cjs/resources/inventory_stock_locations.d.ts +1 -0
- package/lib/cjs/resources/inventory_stock_locations.js +4 -1
- package/lib/cjs/resources/klarna_gateways.d.ts +1 -0
- package/lib/cjs/resources/klarna_gateways.js +4 -1
- package/lib/cjs/resources/klarna_payments.d.ts +1 -0
- package/lib/cjs/resources/klarna_payments.js +4 -1
- package/lib/cjs/resources/line_item_options.d.ts +1 -0
- package/lib/cjs/resources/line_item_options.js +4 -1
- package/lib/cjs/resources/line_items.d.ts +1 -0
- package/lib/cjs/resources/line_items.js +4 -1
- package/lib/cjs/resources/manual_gateways.d.ts +1 -0
- package/lib/cjs/resources/manual_gateways.js +4 -1
- package/lib/cjs/resources/manual_tax_calculators.d.ts +1 -0
- package/lib/cjs/resources/manual_tax_calculators.js +4 -1
- package/lib/cjs/resources/markets.d.ts +1 -0
- package/lib/cjs/resources/markets.js +4 -1
- package/lib/cjs/resources/merchants.d.ts +1 -0
- package/lib/cjs/resources/merchants.js +4 -1
- package/lib/cjs/resources/order_amount_promotion_rules.d.ts +1 -0
- package/lib/cjs/resources/order_amount_promotion_rules.js +4 -1
- package/lib/cjs/resources/order_copies.d.ts +1 -0
- package/lib/cjs/resources/order_copies.js +4 -1
- package/lib/cjs/resources/order_factories.d.ts +1 -0
- package/lib/cjs/resources/order_factories.js +4 -1
- package/lib/cjs/resources/order_subscription_items.d.ts +1 -0
- package/lib/cjs/resources/order_subscription_items.js +4 -1
- package/lib/cjs/resources/order_subscriptions.d.ts +1 -0
- package/lib/cjs/resources/order_subscriptions.js +4 -1
- package/lib/cjs/resources/order_validation_rules.d.ts +1 -0
- package/lib/cjs/resources/order_validation_rules.js +4 -1
- package/lib/cjs/resources/orders.d.ts +1 -0
- package/lib/cjs/resources/orders.js +4 -1
- package/lib/cjs/resources/organization.d.ts +2 -0
- package/lib/cjs/resources/organization.js +4 -1
- package/lib/cjs/resources/packages.d.ts +1 -0
- package/lib/cjs/resources/packages.js +4 -1
- package/lib/cjs/resources/parcel_line_items.d.ts +1 -0
- package/lib/cjs/resources/parcel_line_items.js +4 -1
- package/lib/cjs/resources/parcels.d.ts +1 -0
- package/lib/cjs/resources/parcels.js +4 -1
- package/lib/cjs/resources/payment_gateways.d.ts +1 -0
- package/lib/cjs/resources/payment_gateways.js +4 -1
- package/lib/cjs/resources/payment_methods.d.ts +1 -0
- package/lib/cjs/resources/payment_methods.js +4 -1
- package/lib/cjs/resources/payment_options.d.ts +1 -0
- package/lib/cjs/resources/payment_options.js +4 -1
- package/lib/cjs/resources/paypal_gateways.d.ts +1 -0
- package/lib/cjs/resources/paypal_gateways.js +4 -1
- package/lib/cjs/resources/paypal_payments.d.ts +1 -0
- package/lib/cjs/resources/paypal_payments.js +4 -1
- package/lib/cjs/resources/percentage_discount_promotions.d.ts +1 -0
- package/lib/cjs/resources/percentage_discount_promotions.js +4 -1
- package/lib/cjs/resources/price_frequency_tiers.d.ts +1 -0
- package/lib/cjs/resources/price_frequency_tiers.js +4 -1
- package/lib/cjs/resources/price_lists.d.ts +1 -0
- package/lib/cjs/resources/price_lists.js +4 -1
- package/lib/cjs/resources/price_tiers.d.ts +1 -0
- package/lib/cjs/resources/price_tiers.js +4 -1
- package/lib/cjs/resources/price_volume_tiers.d.ts +1 -0
- package/lib/cjs/resources/price_volume_tiers.js +4 -1
- package/lib/cjs/resources/prices.d.ts +1 -0
- package/lib/cjs/resources/prices.js +4 -1
- package/lib/cjs/resources/promotion_rules.d.ts +1 -0
- package/lib/cjs/resources/promotion_rules.js +4 -1
- package/lib/cjs/resources/promotions.d.ts +1 -0
- package/lib/cjs/resources/promotions.js +4 -1
- package/lib/cjs/resources/recurring_order_copies.d.ts +1 -0
- package/lib/cjs/resources/recurring_order_copies.js +4 -1
- package/lib/cjs/resources/refunds.d.ts +1 -0
- package/lib/cjs/resources/refunds.js +4 -1
- package/lib/cjs/resources/reserved_stocks.d.ts +1 -0
- package/lib/cjs/resources/reserved_stocks.js +4 -1
- package/lib/cjs/resources/resource_errors.d.ts +1 -0
- package/lib/cjs/resources/resource_errors.js +4 -1
- package/lib/cjs/resources/return_line_items.d.ts +1 -0
- package/lib/cjs/resources/return_line_items.js +4 -1
- package/lib/cjs/resources/returns.d.ts +1 -0
- package/lib/cjs/resources/returns.js +4 -1
- package/lib/cjs/resources/satispay_gateways.d.ts +1 -0
- package/lib/cjs/resources/satispay_gateways.js +4 -1
- package/lib/cjs/resources/satispay_payments.d.ts +1 -0
- package/lib/cjs/resources/satispay_payments.js +4 -1
- package/lib/cjs/resources/shipments.d.ts +4 -0
- package/lib/cjs/resources/shipments.js +8 -1
- package/lib/cjs/resources/shipping_categories.d.ts +1 -0
- package/lib/cjs/resources/shipping_categories.js +4 -1
- package/lib/cjs/resources/shipping_method_tiers.d.ts +1 -0
- package/lib/cjs/resources/shipping_method_tiers.js +4 -1
- package/lib/cjs/resources/shipping_methods.d.ts +1 -0
- package/lib/cjs/resources/shipping_methods.js +4 -1
- package/lib/cjs/resources/shipping_weight_tiers.d.ts +1 -0
- package/lib/cjs/resources/shipping_weight_tiers.js +4 -1
- package/lib/cjs/resources/shipping_zones.d.ts +1 -0
- package/lib/cjs/resources/shipping_zones.js +4 -1
- package/lib/cjs/resources/sku_list_items.d.ts +1 -0
- package/lib/cjs/resources/sku_list_items.js +4 -1
- package/lib/cjs/resources/sku_list_promotion_rules.d.ts +1 -0
- package/lib/cjs/resources/sku_list_promotion_rules.js +4 -1
- package/lib/cjs/resources/sku_lists.d.ts +1 -0
- package/lib/cjs/resources/sku_lists.js +4 -1
- package/lib/cjs/resources/sku_options.d.ts +1 -0
- package/lib/cjs/resources/sku_options.js +4 -1
- package/lib/cjs/resources/skus.d.ts +1 -0
- package/lib/cjs/resources/skus.js +4 -1
- package/lib/cjs/resources/stock_items.d.ts +1 -0
- package/lib/cjs/resources/stock_items.js +4 -1
- package/lib/cjs/resources/stock_line_items.d.ts +1 -0
- package/lib/cjs/resources/stock_line_items.js +4 -1
- package/lib/cjs/resources/stock_locations.d.ts +1 -0
- package/lib/cjs/resources/stock_locations.js +4 -1
- package/lib/cjs/resources/stock_reservations.d.ts +1 -0
- package/lib/cjs/resources/stock_reservations.js +4 -1
- package/lib/cjs/resources/stock_transfers.d.ts +1 -0
- package/lib/cjs/resources/stock_transfers.js +4 -1
- package/lib/cjs/resources/stripe_gateways.d.ts +1 -0
- package/lib/cjs/resources/stripe_gateways.js +4 -1
- package/lib/cjs/resources/stripe_payments.d.ts +1 -0
- package/lib/cjs/resources/stripe_payments.js +4 -1
- package/lib/cjs/resources/subscription_models.d.ts +1 -0
- package/lib/cjs/resources/subscription_models.js +4 -1
- package/lib/cjs/resources/tags.d.ts +1 -0
- package/lib/cjs/resources/tags.js +4 -1
- package/lib/cjs/resources/tax_calculators.d.ts +1 -0
- package/lib/cjs/resources/tax_calculators.js +4 -1
- package/lib/cjs/resources/tax_categories.d.ts +1 -0
- package/lib/cjs/resources/tax_categories.js +4 -1
- package/lib/cjs/resources/tax_rules.d.ts +1 -0
- package/lib/cjs/resources/tax_rules.js +4 -1
- package/lib/cjs/resources/taxjar_accounts.d.ts +1 -0
- package/lib/cjs/resources/taxjar_accounts.js +4 -1
- package/lib/cjs/resources/transactions.d.ts +1 -0
- package/lib/cjs/resources/transactions.js +4 -1
- package/lib/cjs/resources/versions.d.ts +1 -0
- package/lib/cjs/resources/versions.js +4 -1
- package/lib/cjs/resources/voids.d.ts +1 -0
- package/lib/cjs/resources/voids.js +4 -1
- package/lib/cjs/resources/webhooks.d.ts +1 -0
- package/lib/cjs/resources/webhooks.js +4 -1
- package/lib/cjs/resources/wire_transfers.d.ts +1 -0
- package/lib/cjs/resources/wire_transfers.js +4 -1
- package/lib/cjs/static.js +0 -1
- package/lib/cjs/util.js +0 -1
- package/lib/esm/api.d.ts +0 -3
- package/lib/esm/api.js +0 -10
- package/lib/esm/client.d.ts +6 -14
- package/lib/esm/client.js +37 -73
- package/lib/esm/commercelayer.d.ts +128 -127
- package/lib/esm/commercelayer.js +266 -278
- package/lib/esm/common.js +0 -11
- package/lib/esm/config.d.ts +3 -0
- package/lib/esm/config.js +3 -2
- package/lib/esm/debug.js +0 -21
- package/lib/esm/error.d.ts +6 -7
- package/lib/esm/error.js +35 -31
- package/lib/esm/fetch.d.ts +13 -0
- package/lib/esm/fetch.js +46 -0
- package/lib/esm/index.js +0 -2
- package/lib/esm/interceptor.d.ts +24 -12
- package/lib/esm/jsonapi.js +10 -7
- package/lib/esm/model.d.ts +0 -3
- package/lib/esm/model.js +0 -1
- package/lib/esm/query.d.ts +3 -2
- package/lib/esm/query.js +24 -7
- package/lib/esm/resource.d.ts +4 -4
- package/lib/esm/resource.js +14 -30
- package/lib/esm/resources/addresses.d.ts +1 -0
- package/lib/esm/resources/addresses.js +4 -1
- package/lib/esm/resources/adjustments.d.ts +1 -0
- package/lib/esm/resources/adjustments.js +4 -1
- package/lib/esm/resources/adyen_gateways.d.ts +1 -0
- package/lib/esm/resources/adyen_gateways.js +4 -1
- package/lib/esm/resources/adyen_payments.d.ts +1 -0
- package/lib/esm/resources/adyen_payments.js +4 -1
- package/lib/esm/resources/application.d.ts +1 -0
- package/lib/esm/resources/application.js +4 -1
- package/lib/esm/resources/attachments.d.ts +1 -0
- package/lib/esm/resources/attachments.js +4 -1
- package/lib/esm/resources/authorizations.d.ts +1 -0
- package/lib/esm/resources/authorizations.js +4 -1
- package/lib/esm/resources/avalara_accounts.d.ts +1 -0
- package/lib/esm/resources/avalara_accounts.js +4 -1
- package/lib/esm/resources/axerve_gateways.d.ts +1 -0
- package/lib/esm/resources/axerve_gateways.js +4 -1
- package/lib/esm/resources/axerve_payments.d.ts +1 -0
- package/lib/esm/resources/axerve_payments.js +4 -1
- package/lib/esm/resources/billing_info_validation_rules.d.ts +1 -0
- package/lib/esm/resources/billing_info_validation_rules.js +4 -1
- package/lib/esm/resources/bing_geocoders.d.ts +1 -0
- package/lib/esm/resources/bing_geocoders.js +4 -1
- package/lib/esm/resources/braintree_gateways.d.ts +1 -0
- package/lib/esm/resources/braintree_gateways.js +4 -1
- package/lib/esm/resources/braintree_payments.d.ts +1 -0
- package/lib/esm/resources/braintree_payments.js +4 -1
- package/lib/esm/resources/bundles.d.ts +1 -0
- package/lib/esm/resources/bundles.js +4 -1
- package/lib/esm/resources/buy_x_pay_y_promotions.d.ts +1 -0
- package/lib/esm/resources/buy_x_pay_y_promotions.js +4 -1
- package/lib/esm/resources/captures.d.ts +1 -0
- package/lib/esm/resources/captures.js +4 -1
- package/lib/esm/resources/carrier_accounts.d.ts +1 -0
- package/lib/esm/resources/carrier_accounts.js +4 -1
- package/lib/esm/resources/checkout_com_gateways.d.ts +1 -0
- package/lib/esm/resources/checkout_com_gateways.js +4 -1
- package/lib/esm/resources/checkout_com_payments.d.ts +1 -0
- package/lib/esm/resources/checkout_com_payments.js +4 -1
- package/lib/esm/resources/cleanups.d.ts +1 -0
- package/lib/esm/resources/cleanups.js +4 -1
- package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +1 -0
- package/lib/esm/resources/coupon_codes_promotion_rules.js +4 -1
- package/lib/esm/resources/coupon_recipients.d.ts +1 -0
- package/lib/esm/resources/coupon_recipients.js +4 -1
- package/lib/esm/resources/coupons.d.ts +1 -0
- package/lib/esm/resources/coupons.js +4 -1
- package/lib/esm/resources/custom_promotion_rules.d.ts +1 -0
- package/lib/esm/resources/custom_promotion_rules.js +4 -1
- package/lib/esm/resources/customer_addresses.d.ts +1 -0
- package/lib/esm/resources/customer_addresses.js +4 -1
- package/lib/esm/resources/customer_groups.d.ts +1 -0
- package/lib/esm/resources/customer_groups.js +4 -1
- package/lib/esm/resources/customer_password_resets.d.ts +1 -0
- package/lib/esm/resources/customer_password_resets.js +4 -1
- package/lib/esm/resources/customer_payment_sources.d.ts +1 -0
- package/lib/esm/resources/customer_payment_sources.js +4 -1
- package/lib/esm/resources/customer_subscriptions.d.ts +1 -0
- package/lib/esm/resources/customer_subscriptions.js +4 -1
- package/lib/esm/resources/customers.d.ts +1 -0
- package/lib/esm/resources/customers.js +4 -1
- package/lib/esm/resources/delivery_lead_times.d.ts +1 -0
- package/lib/esm/resources/delivery_lead_times.js +4 -1
- package/lib/esm/resources/event_callbacks.d.ts +1 -0
- package/lib/esm/resources/event_callbacks.js +4 -1
- package/lib/esm/resources/events.d.ts +4 -3
- package/lib/esm/resources/events.js +8 -5
- package/lib/esm/resources/exports.d.ts +1 -0
- package/lib/esm/resources/exports.js +4 -1
- package/lib/esm/resources/external_gateways.d.ts +1 -0
- package/lib/esm/resources/external_gateways.js +4 -1
- package/lib/esm/resources/external_payments.d.ts +1 -0
- package/lib/esm/resources/external_payments.js +4 -1
- package/lib/esm/resources/external_promotions.d.ts +1 -0
- package/lib/esm/resources/external_promotions.js +4 -1
- package/lib/esm/resources/external_tax_calculators.d.ts +1 -0
- package/lib/esm/resources/external_tax_calculators.js +4 -1
- package/lib/esm/resources/fixed_amount_promotions.d.ts +1 -0
- package/lib/esm/resources/fixed_amount_promotions.js +4 -1
- package/lib/esm/resources/fixed_price_promotions.d.ts +1 -0
- package/lib/esm/resources/fixed_price_promotions.js +4 -1
- package/lib/esm/resources/free_gift_promotions.d.ts +1 -0
- package/lib/esm/resources/free_gift_promotions.js +4 -1
- package/lib/esm/resources/free_shipping_promotions.d.ts +1 -0
- package/lib/esm/resources/free_shipping_promotions.js +4 -1
- package/lib/esm/resources/geocoders.d.ts +1 -0
- package/lib/esm/resources/geocoders.js +4 -1
- package/lib/esm/resources/gift_card_recipients.d.ts +1 -0
- package/lib/esm/resources/gift_card_recipients.js +4 -1
- package/lib/esm/resources/gift_cards.d.ts +1 -0
- package/lib/esm/resources/gift_cards.js +4 -1
- package/lib/esm/resources/google_geocoders.d.ts +1 -0
- package/lib/esm/resources/google_geocoders.js +4 -1
- package/lib/esm/resources/imports.d.ts +1 -0
- package/lib/esm/resources/imports.js +4 -1
- package/lib/esm/resources/in_stock_subscriptions.d.ts +1 -0
- package/lib/esm/resources/in_stock_subscriptions.js +4 -1
- package/lib/esm/resources/inventory_models.d.ts +1 -0
- package/lib/esm/resources/inventory_models.js +4 -1
- package/lib/esm/resources/inventory_return_locations.d.ts +1 -0
- package/lib/esm/resources/inventory_return_locations.js +4 -1
- package/lib/esm/resources/inventory_stock_locations.d.ts +1 -0
- package/lib/esm/resources/inventory_stock_locations.js +4 -1
- package/lib/esm/resources/klarna_gateways.d.ts +1 -0
- package/lib/esm/resources/klarna_gateways.js +4 -1
- package/lib/esm/resources/klarna_payments.d.ts +1 -0
- package/lib/esm/resources/klarna_payments.js +4 -1
- package/lib/esm/resources/line_item_options.d.ts +1 -0
- package/lib/esm/resources/line_item_options.js +4 -1
- package/lib/esm/resources/line_items.d.ts +1 -0
- package/lib/esm/resources/line_items.js +4 -1
- package/lib/esm/resources/manual_gateways.d.ts +1 -0
- package/lib/esm/resources/manual_gateways.js +4 -1
- package/lib/esm/resources/manual_tax_calculators.d.ts +1 -0
- package/lib/esm/resources/manual_tax_calculators.js +4 -1
- package/lib/esm/resources/markets.d.ts +1 -0
- package/lib/esm/resources/markets.js +4 -1
- package/lib/esm/resources/merchants.d.ts +1 -0
- package/lib/esm/resources/merchants.js +4 -1
- package/lib/esm/resources/order_amount_promotion_rules.d.ts +1 -0
- package/lib/esm/resources/order_amount_promotion_rules.js +4 -1
- package/lib/esm/resources/order_copies.d.ts +1 -0
- package/lib/esm/resources/order_copies.js +4 -1
- package/lib/esm/resources/order_factories.d.ts +1 -0
- package/lib/esm/resources/order_factories.js +4 -1
- package/lib/esm/resources/order_subscription_items.d.ts +1 -0
- package/lib/esm/resources/order_subscription_items.js +4 -1
- package/lib/esm/resources/order_subscriptions.d.ts +1 -0
- package/lib/esm/resources/order_subscriptions.js +4 -1
- package/lib/esm/resources/order_validation_rules.d.ts +1 -0
- package/lib/esm/resources/order_validation_rules.js +4 -1
- package/lib/esm/resources/orders.d.ts +1 -0
- package/lib/esm/resources/orders.js +4 -1
- package/lib/esm/resources/organization.d.ts +2 -0
- package/lib/esm/resources/organization.js +4 -1
- package/lib/esm/resources/packages.d.ts +1 -0
- package/lib/esm/resources/packages.js +4 -1
- package/lib/esm/resources/parcel_line_items.d.ts +1 -0
- package/lib/esm/resources/parcel_line_items.js +4 -1
- package/lib/esm/resources/parcels.d.ts +1 -0
- package/lib/esm/resources/parcels.js +4 -1
- package/lib/esm/resources/payment_gateways.d.ts +1 -0
- package/lib/esm/resources/payment_gateways.js +4 -1
- package/lib/esm/resources/payment_methods.d.ts +1 -0
- package/lib/esm/resources/payment_methods.js +4 -1
- package/lib/esm/resources/payment_options.d.ts +1 -0
- package/lib/esm/resources/payment_options.js +4 -1
- package/lib/esm/resources/paypal_gateways.d.ts +1 -0
- package/lib/esm/resources/paypal_gateways.js +4 -1
- package/lib/esm/resources/paypal_payments.d.ts +1 -0
- package/lib/esm/resources/paypal_payments.js +4 -1
- package/lib/esm/resources/percentage_discount_promotions.d.ts +1 -0
- package/lib/esm/resources/percentage_discount_promotions.js +4 -1
- package/lib/esm/resources/price_frequency_tiers.d.ts +1 -0
- package/lib/esm/resources/price_frequency_tiers.js +4 -1
- package/lib/esm/resources/price_lists.d.ts +1 -0
- package/lib/esm/resources/price_lists.js +4 -1
- package/lib/esm/resources/price_tiers.d.ts +1 -0
- package/lib/esm/resources/price_tiers.js +4 -1
- package/lib/esm/resources/price_volume_tiers.d.ts +1 -0
- package/lib/esm/resources/price_volume_tiers.js +4 -1
- package/lib/esm/resources/prices.d.ts +1 -0
- package/lib/esm/resources/prices.js +4 -1
- package/lib/esm/resources/promotion_rules.d.ts +1 -0
- package/lib/esm/resources/promotion_rules.js +4 -1
- package/lib/esm/resources/promotions.d.ts +1 -0
- package/lib/esm/resources/promotions.js +4 -1
- package/lib/esm/resources/recurring_order_copies.d.ts +1 -0
- package/lib/esm/resources/recurring_order_copies.js +4 -1
- package/lib/esm/resources/refunds.d.ts +1 -0
- package/lib/esm/resources/refunds.js +4 -1
- package/lib/esm/resources/reserved_stocks.d.ts +1 -0
- package/lib/esm/resources/reserved_stocks.js +4 -1
- package/lib/esm/resources/resource_errors.d.ts +1 -0
- package/lib/esm/resources/resource_errors.js +4 -1
- package/lib/esm/resources/return_line_items.d.ts +1 -0
- package/lib/esm/resources/return_line_items.js +4 -1
- package/lib/esm/resources/returns.d.ts +1 -0
- package/lib/esm/resources/returns.js +4 -1
- package/lib/esm/resources/satispay_gateways.d.ts +1 -0
- package/lib/esm/resources/satispay_gateways.js +4 -1
- package/lib/esm/resources/satispay_payments.d.ts +1 -0
- package/lib/esm/resources/satispay_payments.js +4 -1
- package/lib/esm/resources/shipments.d.ts +4 -0
- package/lib/esm/resources/shipments.js +8 -1
- package/lib/esm/resources/shipping_categories.d.ts +1 -0
- package/lib/esm/resources/shipping_categories.js +4 -1
- package/lib/esm/resources/shipping_method_tiers.d.ts +1 -0
- package/lib/esm/resources/shipping_method_tiers.js +4 -1
- package/lib/esm/resources/shipping_methods.d.ts +1 -0
- package/lib/esm/resources/shipping_methods.js +4 -1
- package/lib/esm/resources/shipping_weight_tiers.d.ts +1 -0
- package/lib/esm/resources/shipping_weight_tiers.js +4 -1
- package/lib/esm/resources/shipping_zones.d.ts +1 -0
- package/lib/esm/resources/shipping_zones.js +4 -1
- package/lib/esm/resources/sku_list_items.d.ts +1 -0
- package/lib/esm/resources/sku_list_items.js +4 -1
- package/lib/esm/resources/sku_list_promotion_rules.d.ts +1 -0
- package/lib/esm/resources/sku_list_promotion_rules.js +4 -1
- package/lib/esm/resources/sku_lists.d.ts +1 -0
- package/lib/esm/resources/sku_lists.js +4 -1
- package/lib/esm/resources/sku_options.d.ts +1 -0
- package/lib/esm/resources/sku_options.js +4 -1
- package/lib/esm/resources/skus.d.ts +1 -0
- package/lib/esm/resources/skus.js +4 -1
- package/lib/esm/resources/stock_items.d.ts +1 -0
- package/lib/esm/resources/stock_items.js +4 -1
- package/lib/esm/resources/stock_line_items.d.ts +1 -0
- package/lib/esm/resources/stock_line_items.js +4 -1
- package/lib/esm/resources/stock_locations.d.ts +1 -0
- package/lib/esm/resources/stock_locations.js +4 -1
- package/lib/esm/resources/stock_reservations.d.ts +1 -0
- package/lib/esm/resources/stock_reservations.js +4 -1
- package/lib/esm/resources/stock_transfers.d.ts +1 -0
- package/lib/esm/resources/stock_transfers.js +4 -1
- package/lib/esm/resources/stripe_gateways.d.ts +1 -0
- package/lib/esm/resources/stripe_gateways.js +4 -1
- package/lib/esm/resources/stripe_payments.d.ts +1 -0
- package/lib/esm/resources/stripe_payments.js +4 -1
- package/lib/esm/resources/subscription_models.d.ts +1 -0
- package/lib/esm/resources/subscription_models.js +4 -1
- package/lib/esm/resources/tags.d.ts +1 -0
- package/lib/esm/resources/tags.js +4 -1
- package/lib/esm/resources/tax_calculators.d.ts +1 -0
- package/lib/esm/resources/tax_calculators.js +4 -1
- package/lib/esm/resources/tax_categories.d.ts +1 -0
- package/lib/esm/resources/tax_categories.js +4 -1
- package/lib/esm/resources/tax_rules.d.ts +1 -0
- package/lib/esm/resources/tax_rules.js +4 -1
- package/lib/esm/resources/taxjar_accounts.d.ts +1 -0
- package/lib/esm/resources/taxjar_accounts.js +4 -1
- package/lib/esm/resources/transactions.d.ts +1 -0
- package/lib/esm/resources/transactions.js +4 -1
- package/lib/esm/resources/versions.d.ts +1 -0
- package/lib/esm/resources/versions.js +4 -1
- package/lib/esm/resources/voids.d.ts +1 -0
- package/lib/esm/resources/voids.js +4 -1
- package/lib/esm/resources/webhooks.d.ts +1 -0
- package/lib/esm/resources/webhooks.js +4 -1
- package/lib/esm/resources/wire_transfers.d.ts +1 -0
- package/lib/esm/resources/wire_transfers.js +4 -1
- package/lib/esm/static.js +0 -1
- package/lib/esm/util.js +1 -27
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -14
package/lib/esm/commercelayer.js
CHANGED
@@ -3,282 +3,268 @@ import { CommerceLayerStatic } from './static';
|
|
3
3
|
import ResourceAdapter from './resource';
|
4
4
|
import Debug from './debug';
|
5
5
|
const debug = Debug('commercelayer');
|
6
|
-
|
7
|
-
const OPEN_API_SCHEMA_VERSION = '5.0.0';
|
6
|
+
const OPEN_API_SCHEMA_VERSION = '5.1.0';
|
8
7
|
export { OPEN_API_SCHEMA_VERSION };
|
9
8
|
class CommerceLayerClient {
|
10
|
-
// static get openApiSchemaVersion(): string { return OPEN_API_SCHEMA_VERSION }
|
11
9
|
openApiSchemaVersion = OPEN_API_SCHEMA_VERSION;
|
12
10
|
#adapter;
|
11
|
+
#slug;
|
12
|
+
#addresses;
|
13
|
+
#adjustments;
|
14
|
+
#adyen_gateways;
|
15
|
+
#adyen_payments;
|
16
|
+
#application;
|
17
|
+
#attachments;
|
18
|
+
#authorizations;
|
19
|
+
#avalara_accounts;
|
20
|
+
#axerve_gateways;
|
21
|
+
#axerve_payments;
|
22
|
+
#billing_info_validation_rules;
|
23
|
+
#bing_geocoders;
|
24
|
+
#braintree_gateways;
|
25
|
+
#braintree_payments;
|
26
|
+
#bundles;
|
27
|
+
#buy_x_pay_y_promotions;
|
28
|
+
#captures;
|
29
|
+
#carrier_accounts;
|
30
|
+
#checkout_com_gateways;
|
31
|
+
#checkout_com_payments;
|
32
|
+
#cleanups;
|
33
|
+
#coupon_codes_promotion_rules;
|
34
|
+
#coupon_recipients;
|
35
|
+
#coupons;
|
36
|
+
#custom_promotion_rules;
|
37
|
+
#customer_addresses;
|
38
|
+
#customer_groups;
|
39
|
+
#customer_password_resets;
|
40
|
+
#customer_payment_sources;
|
41
|
+
#customer_subscriptions;
|
42
|
+
#customers;
|
43
|
+
#delivery_lead_times;
|
44
|
+
#event_callbacks;
|
45
|
+
#events;
|
46
|
+
#exports;
|
47
|
+
#external_gateways;
|
48
|
+
#external_payments;
|
49
|
+
#external_promotions;
|
50
|
+
#external_tax_calculators;
|
51
|
+
#fixed_amount_promotions;
|
52
|
+
#fixed_price_promotions;
|
53
|
+
#free_gift_promotions;
|
54
|
+
#free_shipping_promotions;
|
55
|
+
#geocoders;
|
56
|
+
#gift_card_recipients;
|
57
|
+
#gift_cards;
|
58
|
+
#google_geocoders;
|
59
|
+
#imports;
|
60
|
+
#in_stock_subscriptions;
|
61
|
+
#inventory_models;
|
62
|
+
#inventory_return_locations;
|
63
|
+
#inventory_stock_locations;
|
64
|
+
#klarna_gateways;
|
65
|
+
#klarna_payments;
|
66
|
+
#line_item_options;
|
67
|
+
#line_items;
|
68
|
+
#manual_gateways;
|
69
|
+
#manual_tax_calculators;
|
70
|
+
#markets;
|
71
|
+
#merchants;
|
72
|
+
#order_amount_promotion_rules;
|
73
|
+
#order_copies;
|
74
|
+
#order_factories;
|
75
|
+
#order_subscription_items;
|
76
|
+
#order_subscriptions;
|
77
|
+
#order_validation_rules;
|
78
|
+
#orders;
|
13
79
|
#organization;
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
inventory_return_locations;
|
68
|
-
inventory_stock_locations;
|
69
|
-
klarna_gateways;
|
70
|
-
klarna_payments;
|
71
|
-
line_item_options;
|
72
|
-
line_items;
|
73
|
-
manual_gateways;
|
74
|
-
manual_tax_calculators;
|
75
|
-
markets;
|
76
|
-
merchants;
|
77
|
-
order_amount_promotion_rules;
|
78
|
-
order_copies;
|
79
|
-
order_factories;
|
80
|
-
order_subscription_items;
|
81
|
-
order_subscriptions;
|
82
|
-
order_validation_rules;
|
83
|
-
orders;
|
84
|
-
organization;
|
85
|
-
packages;
|
86
|
-
parcel_line_items;
|
87
|
-
parcels;
|
88
|
-
payment_gateways;
|
89
|
-
payment_methods;
|
90
|
-
payment_options;
|
91
|
-
paypal_gateways;
|
92
|
-
paypal_payments;
|
93
|
-
percentage_discount_promotions;
|
94
|
-
price_frequency_tiers;
|
95
|
-
price_lists;
|
96
|
-
price_tiers;
|
97
|
-
price_volume_tiers;
|
98
|
-
prices;
|
99
|
-
promotion_rules;
|
100
|
-
promotions;
|
101
|
-
recurring_order_copies;
|
102
|
-
refunds;
|
103
|
-
reserved_stocks;
|
104
|
-
resource_errors;
|
105
|
-
return_line_items;
|
106
|
-
returns;
|
107
|
-
satispay_gateways;
|
108
|
-
satispay_payments;
|
109
|
-
shipments;
|
110
|
-
shipping_categories;
|
111
|
-
shipping_method_tiers;
|
112
|
-
shipping_methods;
|
113
|
-
shipping_weight_tiers;
|
114
|
-
shipping_zones;
|
115
|
-
sku_list_items;
|
116
|
-
sku_list_promotion_rules;
|
117
|
-
sku_lists;
|
118
|
-
sku_options;
|
119
|
-
skus;
|
120
|
-
stock_items;
|
121
|
-
stock_line_items;
|
122
|
-
stock_locations;
|
123
|
-
stock_reservations;
|
124
|
-
stock_transfers;
|
125
|
-
stripe_gateways;
|
126
|
-
stripe_payments;
|
127
|
-
subscription_models;
|
128
|
-
tags;
|
129
|
-
tax_calculators;
|
130
|
-
tax_categories;
|
131
|
-
tax_rules;
|
132
|
-
taxjar_accounts;
|
133
|
-
transactions;
|
134
|
-
versions;
|
135
|
-
voids;
|
136
|
-
webhooks;
|
137
|
-
wire_transfers;
|
138
|
-
// ##__CL_RESOURCES_DEF_STOP__##
|
80
|
+
#packages;
|
81
|
+
#parcel_line_items;
|
82
|
+
#parcels;
|
83
|
+
#payment_gateways;
|
84
|
+
#payment_methods;
|
85
|
+
#payment_options;
|
86
|
+
#paypal_gateways;
|
87
|
+
#paypal_payments;
|
88
|
+
#percentage_discount_promotions;
|
89
|
+
#price_frequency_tiers;
|
90
|
+
#price_lists;
|
91
|
+
#price_tiers;
|
92
|
+
#price_volume_tiers;
|
93
|
+
#prices;
|
94
|
+
#promotion_rules;
|
95
|
+
#promotions;
|
96
|
+
#recurring_order_copies;
|
97
|
+
#refunds;
|
98
|
+
#reserved_stocks;
|
99
|
+
#resource_errors;
|
100
|
+
#return_line_items;
|
101
|
+
#returns;
|
102
|
+
#satispay_gateways;
|
103
|
+
#satispay_payments;
|
104
|
+
#shipments;
|
105
|
+
#shipping_categories;
|
106
|
+
#shipping_method_tiers;
|
107
|
+
#shipping_methods;
|
108
|
+
#shipping_weight_tiers;
|
109
|
+
#shipping_zones;
|
110
|
+
#sku_list_items;
|
111
|
+
#sku_list_promotion_rules;
|
112
|
+
#sku_lists;
|
113
|
+
#sku_options;
|
114
|
+
#skus;
|
115
|
+
#stock_items;
|
116
|
+
#stock_line_items;
|
117
|
+
#stock_locations;
|
118
|
+
#stock_reservations;
|
119
|
+
#stock_transfers;
|
120
|
+
#stripe_gateways;
|
121
|
+
#stripe_payments;
|
122
|
+
#subscription_models;
|
123
|
+
#tags;
|
124
|
+
#tax_calculators;
|
125
|
+
#tax_categories;
|
126
|
+
#tax_rules;
|
127
|
+
#taxjar_accounts;
|
128
|
+
#transactions;
|
129
|
+
#versions;
|
130
|
+
#voids;
|
131
|
+
#webhooks;
|
132
|
+
#wire_transfers;
|
139
133
|
constructor(config) {
|
140
134
|
debug('new commercelayer instance %O', config);
|
141
135
|
this.#adapter = new ResourceAdapter(config);
|
142
|
-
this.#
|
143
|
-
// this.#environment = 'test'
|
144
|
-
// ##__CL_RESOURCES_INIT_START__##
|
145
|
-
// ##__CL_RESOURCES_INIT_TEMPLATE:: ##__TAB__####__TAB__##this.##__RESOURCE_TYPE__## = new api.##__RESOURCE_CLASS__##(this.#adapter)
|
146
|
-
this.addresses = new api.Addresses(this.#adapter);
|
147
|
-
this.adjustments = new api.Adjustments(this.#adapter);
|
148
|
-
this.adyen_gateways = new api.AdyenGateways(this.#adapter);
|
149
|
-
this.adyen_payments = new api.AdyenPayments(this.#adapter);
|
150
|
-
this.application = new api.Applications(this.#adapter);
|
151
|
-
this.attachments = new api.Attachments(this.#adapter);
|
152
|
-
this.authorizations = new api.Authorizations(this.#adapter);
|
153
|
-
this.avalara_accounts = new api.AvalaraAccounts(this.#adapter);
|
154
|
-
this.axerve_gateways = new api.AxerveGateways(this.#adapter);
|
155
|
-
this.axerve_payments = new api.AxervePayments(this.#adapter);
|
156
|
-
this.billing_info_validation_rules = new api.BillingInfoValidationRules(this.#adapter);
|
157
|
-
this.bing_geocoders = new api.BingGeocoders(this.#adapter);
|
158
|
-
this.braintree_gateways = new api.BraintreeGateways(this.#adapter);
|
159
|
-
this.braintree_payments = new api.BraintreePayments(this.#adapter);
|
160
|
-
this.bundles = new api.Bundles(this.#adapter);
|
161
|
-
this.buy_x_pay_y_promotions = new api.BuyXPayYPromotions(this.#adapter);
|
162
|
-
this.captures = new api.Captures(this.#adapter);
|
163
|
-
this.carrier_accounts = new api.CarrierAccounts(this.#adapter);
|
164
|
-
this.checkout_com_gateways = new api.CheckoutComGateways(this.#adapter);
|
165
|
-
this.checkout_com_payments = new api.CheckoutComPayments(this.#adapter);
|
166
|
-
this.cleanups = new api.Cleanups(this.#adapter);
|
167
|
-
this.coupon_codes_promotion_rules = new api.CouponCodesPromotionRules(this.#adapter);
|
168
|
-
this.coupon_recipients = new api.CouponRecipients(this.#adapter);
|
169
|
-
this.coupons = new api.Coupons(this.#adapter);
|
170
|
-
this.custom_promotion_rules = new api.CustomPromotionRules(this.#adapter);
|
171
|
-
this.customer_addresses = new api.CustomerAddresses(this.#adapter);
|
172
|
-
this.customer_groups = new api.CustomerGroups(this.#adapter);
|
173
|
-
this.customer_password_resets = new api.CustomerPasswordResets(this.#adapter);
|
174
|
-
this.customer_payment_sources = new api.CustomerPaymentSources(this.#adapter);
|
175
|
-
this.customer_subscriptions = new api.CustomerSubscriptions(this.#adapter);
|
176
|
-
this.customers = new api.Customers(this.#adapter);
|
177
|
-
this.delivery_lead_times = new api.DeliveryLeadTimes(this.#adapter);
|
178
|
-
this.event_callbacks = new api.EventCallbacks(this.#adapter);
|
179
|
-
this.events = new api.Events(this.#adapter);
|
180
|
-
this.exports = new api.Exports(this.#adapter);
|
181
|
-
this.external_gateways = new api.ExternalGateways(this.#adapter);
|
182
|
-
this.external_payments = new api.ExternalPayments(this.#adapter);
|
183
|
-
this.external_promotions = new api.ExternalPromotions(this.#adapter);
|
184
|
-
this.external_tax_calculators = new api.ExternalTaxCalculators(this.#adapter);
|
185
|
-
this.fixed_amount_promotions = new api.FixedAmountPromotions(this.#adapter);
|
186
|
-
this.fixed_price_promotions = new api.FixedPricePromotions(this.#adapter);
|
187
|
-
this.free_gift_promotions = new api.FreeGiftPromotions(this.#adapter);
|
188
|
-
this.free_shipping_promotions = new api.FreeShippingPromotions(this.#adapter);
|
189
|
-
this.geocoders = new api.Geocoders(this.#adapter);
|
190
|
-
this.gift_card_recipients = new api.GiftCardRecipients(this.#adapter);
|
191
|
-
this.gift_cards = new api.GiftCards(this.#adapter);
|
192
|
-
this.google_geocoders = new api.GoogleGeocoders(this.#adapter);
|
193
|
-
this.imports = new api.Imports(this.#adapter);
|
194
|
-
this.in_stock_subscriptions = new api.InStockSubscriptions(this.#adapter);
|
195
|
-
this.inventory_models = new api.InventoryModels(this.#adapter);
|
196
|
-
this.inventory_return_locations = new api.InventoryReturnLocations(this.#adapter);
|
197
|
-
this.inventory_stock_locations = new api.InventoryStockLocations(this.#adapter);
|
198
|
-
this.klarna_gateways = new api.KlarnaGateways(this.#adapter);
|
199
|
-
this.klarna_payments = new api.KlarnaPayments(this.#adapter);
|
200
|
-
this.line_item_options = new api.LineItemOptions(this.#adapter);
|
201
|
-
this.line_items = new api.LineItems(this.#adapter);
|
202
|
-
this.manual_gateways = new api.ManualGateways(this.#adapter);
|
203
|
-
this.manual_tax_calculators = new api.ManualTaxCalculators(this.#adapter);
|
204
|
-
this.markets = new api.Markets(this.#adapter);
|
205
|
-
this.merchants = new api.Merchants(this.#adapter);
|
206
|
-
this.order_amount_promotion_rules = new api.OrderAmountPromotionRules(this.#adapter);
|
207
|
-
this.order_copies = new api.OrderCopies(this.#adapter);
|
208
|
-
this.order_factories = new api.OrderFactories(this.#adapter);
|
209
|
-
this.order_subscription_items = new api.OrderSubscriptionItems(this.#adapter);
|
210
|
-
this.order_subscriptions = new api.OrderSubscriptions(this.#adapter);
|
211
|
-
this.order_validation_rules = new api.OrderValidationRules(this.#adapter);
|
212
|
-
this.orders = new api.Orders(this.#adapter);
|
213
|
-
this.organization = new api.Organizations(this.#adapter);
|
214
|
-
this.packages = new api.Packages(this.#adapter);
|
215
|
-
this.parcel_line_items = new api.ParcelLineItems(this.#adapter);
|
216
|
-
this.parcels = new api.Parcels(this.#adapter);
|
217
|
-
this.payment_gateways = new api.PaymentGateways(this.#adapter);
|
218
|
-
this.payment_methods = new api.PaymentMethods(this.#adapter);
|
219
|
-
this.payment_options = new api.PaymentOptions(this.#adapter);
|
220
|
-
this.paypal_gateways = new api.PaypalGateways(this.#adapter);
|
221
|
-
this.paypal_payments = new api.PaypalPayments(this.#adapter);
|
222
|
-
this.percentage_discount_promotions = new api.PercentageDiscountPromotions(this.#adapter);
|
223
|
-
this.price_frequency_tiers = new api.PriceFrequencyTiers(this.#adapter);
|
224
|
-
this.price_lists = new api.PriceLists(this.#adapter);
|
225
|
-
this.price_tiers = new api.PriceTiers(this.#adapter);
|
226
|
-
this.price_volume_tiers = new api.PriceVolumeTiers(this.#adapter);
|
227
|
-
this.prices = new api.Prices(this.#adapter);
|
228
|
-
this.promotion_rules = new api.PromotionRules(this.#adapter);
|
229
|
-
this.promotions = new api.Promotions(this.#adapter);
|
230
|
-
this.recurring_order_copies = new api.RecurringOrderCopies(this.#adapter);
|
231
|
-
this.refunds = new api.Refunds(this.#adapter);
|
232
|
-
this.reserved_stocks = new api.ReservedStocks(this.#adapter);
|
233
|
-
this.resource_errors = new api.ResourceErrors(this.#adapter);
|
234
|
-
this.return_line_items = new api.ReturnLineItems(this.#adapter);
|
235
|
-
this.returns = new api.Returns(this.#adapter);
|
236
|
-
this.satispay_gateways = new api.SatispayGateways(this.#adapter);
|
237
|
-
this.satispay_payments = new api.SatispayPayments(this.#adapter);
|
238
|
-
this.shipments = new api.Shipments(this.#adapter);
|
239
|
-
this.shipping_categories = new api.ShippingCategories(this.#adapter);
|
240
|
-
this.shipping_method_tiers = new api.ShippingMethodTiers(this.#adapter);
|
241
|
-
this.shipping_methods = new api.ShippingMethods(this.#adapter);
|
242
|
-
this.shipping_weight_tiers = new api.ShippingWeightTiers(this.#adapter);
|
243
|
-
this.shipping_zones = new api.ShippingZones(this.#adapter);
|
244
|
-
this.sku_list_items = new api.SkuListItems(this.#adapter);
|
245
|
-
this.sku_list_promotion_rules = new api.SkuListPromotionRules(this.#adapter);
|
246
|
-
this.sku_lists = new api.SkuLists(this.#adapter);
|
247
|
-
this.sku_options = new api.SkuOptions(this.#adapter);
|
248
|
-
this.skus = new api.Skus(this.#adapter);
|
249
|
-
this.stock_items = new api.StockItems(this.#adapter);
|
250
|
-
this.stock_line_items = new api.StockLineItems(this.#adapter);
|
251
|
-
this.stock_locations = new api.StockLocations(this.#adapter);
|
252
|
-
this.stock_reservations = new api.StockReservations(this.#adapter);
|
253
|
-
this.stock_transfers = new api.StockTransfers(this.#adapter);
|
254
|
-
this.stripe_gateways = new api.StripeGateways(this.#adapter);
|
255
|
-
this.stripe_payments = new api.StripePayments(this.#adapter);
|
256
|
-
this.subscription_models = new api.SubscriptionModels(this.#adapter);
|
257
|
-
this.tags = new api.Tags(this.#adapter);
|
258
|
-
this.tax_calculators = new api.TaxCalculators(this.#adapter);
|
259
|
-
this.tax_categories = new api.TaxCategories(this.#adapter);
|
260
|
-
this.tax_rules = new api.TaxRules(this.#adapter);
|
261
|
-
this.taxjar_accounts = new api.TaxjarAccounts(this.#adapter);
|
262
|
-
this.transactions = new api.Transactions(this.#adapter);
|
263
|
-
this.versions = new api.Versions(this.#adapter);
|
264
|
-
this.voids = new api.Voids(this.#adapter);
|
265
|
-
this.webhooks = new api.Webhooks(this.#adapter);
|
266
|
-
this.wire_transfers = new api.WireTransfers(this.#adapter);
|
267
|
-
// ##__CL_RESOURCES_INIT_STOP__##
|
136
|
+
this.#slug = config.organization;
|
268
137
|
}
|
269
|
-
get
|
270
|
-
|
271
|
-
|
138
|
+
get addresses() { return this.#addresses || (this.#addresses = new api.Addresses(this.#adapter)); }
|
139
|
+
get adjustments() { return this.#adjustments || (this.#adjustments = new api.Adjustments(this.#adapter)); }
|
140
|
+
get adyen_gateways() { return this.#adyen_gateways || (this.#adyen_gateways = new api.AdyenGateways(this.#adapter)); }
|
141
|
+
get adyen_payments() { return this.#adyen_payments || (this.#adyen_payments = new api.AdyenPayments(this.#adapter)); }
|
142
|
+
get application() { return this.#application || (this.#application = new api.Applications(this.#adapter)); }
|
143
|
+
get attachments() { return this.#attachments || (this.#attachments = new api.Attachments(this.#adapter)); }
|
144
|
+
get authorizations() { return this.#authorizations || (this.#authorizations = new api.Authorizations(this.#adapter)); }
|
145
|
+
get avalara_accounts() { return this.#avalara_accounts || (this.#avalara_accounts = new api.AvalaraAccounts(this.#adapter)); }
|
146
|
+
get axerve_gateways() { return this.#axerve_gateways || (this.#axerve_gateways = new api.AxerveGateways(this.#adapter)); }
|
147
|
+
get axerve_payments() { return this.#axerve_payments || (this.#axerve_payments = new api.AxervePayments(this.#adapter)); }
|
148
|
+
get billing_info_validation_rules() { return this.#billing_info_validation_rules || (this.#billing_info_validation_rules = new api.BillingInfoValidationRules(this.#adapter)); }
|
149
|
+
get bing_geocoders() { return this.#bing_geocoders || (this.#bing_geocoders = new api.BingGeocoders(this.#adapter)); }
|
150
|
+
get braintree_gateways() { return this.#braintree_gateways || (this.#braintree_gateways = new api.BraintreeGateways(this.#adapter)); }
|
151
|
+
get braintree_payments() { return this.#braintree_payments || (this.#braintree_payments = new api.BraintreePayments(this.#adapter)); }
|
152
|
+
get bundles() { return this.#bundles || (this.#bundles = new api.Bundles(this.#adapter)); }
|
153
|
+
get buy_x_pay_y_promotions() { return this.#buy_x_pay_y_promotions || (this.#buy_x_pay_y_promotions = new api.BuyXPayYPromotions(this.#adapter)); }
|
154
|
+
get captures() { return this.#captures || (this.#captures = new api.Captures(this.#adapter)); }
|
155
|
+
get carrier_accounts() { return this.#carrier_accounts || (this.#carrier_accounts = new api.CarrierAccounts(this.#adapter)); }
|
156
|
+
get checkout_com_gateways() { return this.#checkout_com_gateways || (this.#checkout_com_gateways = new api.CheckoutComGateways(this.#adapter)); }
|
157
|
+
get checkout_com_payments() { return this.#checkout_com_payments || (this.#checkout_com_payments = new api.CheckoutComPayments(this.#adapter)); }
|
158
|
+
get cleanups() { return this.#cleanups || (this.#cleanups = new api.Cleanups(this.#adapter)); }
|
159
|
+
get coupon_codes_promotion_rules() { return this.#coupon_codes_promotion_rules || (this.#coupon_codes_promotion_rules = new api.CouponCodesPromotionRules(this.#adapter)); }
|
160
|
+
get coupon_recipients() { return this.#coupon_recipients || (this.#coupon_recipients = new api.CouponRecipients(this.#adapter)); }
|
161
|
+
get coupons() { return this.#coupons || (this.#coupons = new api.Coupons(this.#adapter)); }
|
162
|
+
get custom_promotion_rules() { return this.#custom_promotion_rules || (this.#custom_promotion_rules = new api.CustomPromotionRules(this.#adapter)); }
|
163
|
+
get customer_addresses() { return this.#customer_addresses || (this.#customer_addresses = new api.CustomerAddresses(this.#adapter)); }
|
164
|
+
get customer_groups() { return this.#customer_groups || (this.#customer_groups = new api.CustomerGroups(this.#adapter)); }
|
165
|
+
get customer_password_resets() { return this.#customer_password_resets || (this.#customer_password_resets = new api.CustomerPasswordResets(this.#adapter)); }
|
166
|
+
get customer_payment_sources() { return this.#customer_payment_sources || (this.#customer_payment_sources = new api.CustomerPaymentSources(this.#adapter)); }
|
167
|
+
get customer_subscriptions() { return this.#customer_subscriptions || (this.#customer_subscriptions = new api.CustomerSubscriptions(this.#adapter)); }
|
168
|
+
get customers() { return this.#customers || (this.#customers = new api.Customers(this.#adapter)); }
|
169
|
+
get delivery_lead_times() { return this.#delivery_lead_times || (this.#delivery_lead_times = new api.DeliveryLeadTimes(this.#adapter)); }
|
170
|
+
get event_callbacks() { return this.#event_callbacks || (this.#event_callbacks = new api.EventCallbacks(this.#adapter)); }
|
171
|
+
get events() { return this.#events || (this.#events = new api.Events(this.#adapter)); }
|
172
|
+
get exports() { return this.#exports || (this.#exports = new api.Exports(this.#adapter)); }
|
173
|
+
get external_gateways() { return this.#external_gateways || (this.#external_gateways = new api.ExternalGateways(this.#adapter)); }
|
174
|
+
get external_payments() { return this.#external_payments || (this.#external_payments = new api.ExternalPayments(this.#adapter)); }
|
175
|
+
get external_promotions() { return this.#external_promotions || (this.#external_promotions = new api.ExternalPromotions(this.#adapter)); }
|
176
|
+
get external_tax_calculators() { return this.#external_tax_calculators || (this.#external_tax_calculators = new api.ExternalTaxCalculators(this.#adapter)); }
|
177
|
+
get fixed_amount_promotions() { return this.#fixed_amount_promotions || (this.#fixed_amount_promotions = new api.FixedAmountPromotions(this.#adapter)); }
|
178
|
+
get fixed_price_promotions() { return this.#fixed_price_promotions || (this.#fixed_price_promotions = new api.FixedPricePromotions(this.#adapter)); }
|
179
|
+
get free_gift_promotions() { return this.#free_gift_promotions || (this.#free_gift_promotions = new api.FreeGiftPromotions(this.#adapter)); }
|
180
|
+
get free_shipping_promotions() { return this.#free_shipping_promotions || (this.#free_shipping_promotions = new api.FreeShippingPromotions(this.#adapter)); }
|
181
|
+
get geocoders() { return this.#geocoders || (this.#geocoders = new api.Geocoders(this.#adapter)); }
|
182
|
+
get gift_card_recipients() { return this.#gift_card_recipients || (this.#gift_card_recipients = new api.GiftCardRecipients(this.#adapter)); }
|
183
|
+
get gift_cards() { return this.#gift_cards || (this.#gift_cards = new api.GiftCards(this.#adapter)); }
|
184
|
+
get google_geocoders() { return this.#google_geocoders || (this.#google_geocoders = new api.GoogleGeocoders(this.#adapter)); }
|
185
|
+
get imports() { return this.#imports || (this.#imports = new api.Imports(this.#adapter)); }
|
186
|
+
get in_stock_subscriptions() { return this.#in_stock_subscriptions || (this.#in_stock_subscriptions = new api.InStockSubscriptions(this.#adapter)); }
|
187
|
+
get inventory_models() { return this.#inventory_models || (this.#inventory_models = new api.InventoryModels(this.#adapter)); }
|
188
|
+
get inventory_return_locations() { return this.#inventory_return_locations || (this.#inventory_return_locations = new api.InventoryReturnLocations(this.#adapter)); }
|
189
|
+
get inventory_stock_locations() { return this.#inventory_stock_locations || (this.#inventory_stock_locations = new api.InventoryStockLocations(this.#adapter)); }
|
190
|
+
get klarna_gateways() { return this.#klarna_gateways || (this.#klarna_gateways = new api.KlarnaGateways(this.#adapter)); }
|
191
|
+
get klarna_payments() { return this.#klarna_payments || (this.#klarna_payments = new api.KlarnaPayments(this.#adapter)); }
|
192
|
+
get line_item_options() { return this.#line_item_options || (this.#line_item_options = new api.LineItemOptions(this.#adapter)); }
|
193
|
+
get line_items() { return this.#line_items || (this.#line_items = new api.LineItems(this.#adapter)); }
|
194
|
+
get manual_gateways() { return this.#manual_gateways || (this.#manual_gateways = new api.ManualGateways(this.#adapter)); }
|
195
|
+
get manual_tax_calculators() { return this.#manual_tax_calculators || (this.#manual_tax_calculators = new api.ManualTaxCalculators(this.#adapter)); }
|
196
|
+
get markets() { return this.#markets || (this.#markets = new api.Markets(this.#adapter)); }
|
197
|
+
get merchants() { return this.#merchants || (this.#merchants = new api.Merchants(this.#adapter)); }
|
198
|
+
get order_amount_promotion_rules() { return this.#order_amount_promotion_rules || (this.#order_amount_promotion_rules = new api.OrderAmountPromotionRules(this.#adapter)); }
|
199
|
+
get order_copies() { return this.#order_copies || (this.#order_copies = new api.OrderCopies(this.#adapter)); }
|
200
|
+
get order_factories() { return this.#order_factories || (this.#order_factories = new api.OrderFactories(this.#adapter)); }
|
201
|
+
get order_subscription_items() { return this.#order_subscription_items || (this.#order_subscription_items = new api.OrderSubscriptionItems(this.#adapter)); }
|
202
|
+
get order_subscriptions() { return this.#order_subscriptions || (this.#order_subscriptions = new api.OrderSubscriptions(this.#adapter)); }
|
203
|
+
get order_validation_rules() { return this.#order_validation_rules || (this.#order_validation_rules = new api.OrderValidationRules(this.#adapter)); }
|
204
|
+
get orders() { return this.#orders || (this.#orders = new api.Orders(this.#adapter)); }
|
205
|
+
get organization() { return this.#organization || (this.#organization = new api.Organizations(this.#adapter)); }
|
206
|
+
get packages() { return this.#packages || (this.#packages = new api.Packages(this.#adapter)); }
|
207
|
+
get parcel_line_items() { return this.#parcel_line_items || (this.#parcel_line_items = new api.ParcelLineItems(this.#adapter)); }
|
208
|
+
get parcels() { return this.#parcels || (this.#parcels = new api.Parcels(this.#adapter)); }
|
209
|
+
get payment_gateways() { return this.#payment_gateways || (this.#payment_gateways = new api.PaymentGateways(this.#adapter)); }
|
210
|
+
get payment_methods() { return this.#payment_methods || (this.#payment_methods = new api.PaymentMethods(this.#adapter)); }
|
211
|
+
get payment_options() { return this.#payment_options || (this.#payment_options = new api.PaymentOptions(this.#adapter)); }
|
212
|
+
get paypal_gateways() { return this.#paypal_gateways || (this.#paypal_gateways = new api.PaypalGateways(this.#adapter)); }
|
213
|
+
get paypal_payments() { return this.#paypal_payments || (this.#paypal_payments = new api.PaypalPayments(this.#adapter)); }
|
214
|
+
get percentage_discount_promotions() { return this.#percentage_discount_promotions || (this.#percentage_discount_promotions = new api.PercentageDiscountPromotions(this.#adapter)); }
|
215
|
+
get price_frequency_tiers() { return this.#price_frequency_tiers || (this.#price_frequency_tiers = new api.PriceFrequencyTiers(this.#adapter)); }
|
216
|
+
get price_lists() { return this.#price_lists || (this.#price_lists = new api.PriceLists(this.#adapter)); }
|
217
|
+
get price_tiers() { return this.#price_tiers || (this.#price_tiers = new api.PriceTiers(this.#adapter)); }
|
218
|
+
get price_volume_tiers() { return this.#price_volume_tiers || (this.#price_volume_tiers = new api.PriceVolumeTiers(this.#adapter)); }
|
219
|
+
get prices() { return this.#prices || (this.#prices = new api.Prices(this.#adapter)); }
|
220
|
+
get promotion_rules() { return this.#promotion_rules || (this.#promotion_rules = new api.PromotionRules(this.#adapter)); }
|
221
|
+
get promotions() { return this.#promotions || (this.#promotions = new api.Promotions(this.#adapter)); }
|
222
|
+
get recurring_order_copies() { return this.#recurring_order_copies || (this.#recurring_order_copies = new api.RecurringOrderCopies(this.#adapter)); }
|
223
|
+
get refunds() { return this.#refunds || (this.#refunds = new api.Refunds(this.#adapter)); }
|
224
|
+
get reserved_stocks() { return this.#reserved_stocks || (this.#reserved_stocks = new api.ReservedStocks(this.#adapter)); }
|
225
|
+
get resource_errors() { return this.#resource_errors || (this.#resource_errors = new api.ResourceErrors(this.#adapter)); }
|
226
|
+
get return_line_items() { return this.#return_line_items || (this.#return_line_items = new api.ReturnLineItems(this.#adapter)); }
|
227
|
+
get returns() { return this.#returns || (this.#returns = new api.Returns(this.#adapter)); }
|
228
|
+
get satispay_gateways() { return this.#satispay_gateways || (this.#satispay_gateways = new api.SatispayGateways(this.#adapter)); }
|
229
|
+
get satispay_payments() { return this.#satispay_payments || (this.#satispay_payments = new api.SatispayPayments(this.#adapter)); }
|
230
|
+
get shipments() { return this.#shipments || (this.#shipments = new api.Shipments(this.#adapter)); }
|
231
|
+
get shipping_categories() { return this.#shipping_categories || (this.#shipping_categories = new api.ShippingCategories(this.#adapter)); }
|
232
|
+
get shipping_method_tiers() { return this.#shipping_method_tiers || (this.#shipping_method_tiers = new api.ShippingMethodTiers(this.#adapter)); }
|
233
|
+
get shipping_methods() { return this.#shipping_methods || (this.#shipping_methods = new api.ShippingMethods(this.#adapter)); }
|
234
|
+
get shipping_weight_tiers() { return this.#shipping_weight_tiers || (this.#shipping_weight_tiers = new api.ShippingWeightTiers(this.#adapter)); }
|
235
|
+
get shipping_zones() { return this.#shipping_zones || (this.#shipping_zones = new api.ShippingZones(this.#adapter)); }
|
236
|
+
get sku_list_items() { return this.#sku_list_items || (this.#sku_list_items = new api.SkuListItems(this.#adapter)); }
|
237
|
+
get sku_list_promotion_rules() { return this.#sku_list_promotion_rules || (this.#sku_list_promotion_rules = new api.SkuListPromotionRules(this.#adapter)); }
|
238
|
+
get sku_lists() { return this.#sku_lists || (this.#sku_lists = new api.SkuLists(this.#adapter)); }
|
239
|
+
get sku_options() { return this.#sku_options || (this.#sku_options = new api.SkuOptions(this.#adapter)); }
|
240
|
+
get skus() { return this.#skus || (this.#skus = new api.Skus(this.#adapter)); }
|
241
|
+
get stock_items() { return this.#stock_items || (this.#stock_items = new api.StockItems(this.#adapter)); }
|
242
|
+
get stock_line_items() { return this.#stock_line_items || (this.#stock_line_items = new api.StockLineItems(this.#adapter)); }
|
243
|
+
get stock_locations() { return this.#stock_locations || (this.#stock_locations = new api.StockLocations(this.#adapter)); }
|
244
|
+
get stock_reservations() { return this.#stock_reservations || (this.#stock_reservations = new api.StockReservations(this.#adapter)); }
|
245
|
+
get stock_transfers() { return this.#stock_transfers || (this.#stock_transfers = new api.StockTransfers(this.#adapter)); }
|
246
|
+
get stripe_gateways() { return this.#stripe_gateways || (this.#stripe_gateways = new api.StripeGateways(this.#adapter)); }
|
247
|
+
get stripe_payments() { return this.#stripe_payments || (this.#stripe_payments = new api.StripePayments(this.#adapter)); }
|
248
|
+
get subscription_models() { return this.#subscription_models || (this.#subscription_models = new api.SubscriptionModels(this.#adapter)); }
|
249
|
+
get tags() { return this.#tags || (this.#tags = new api.Tags(this.#adapter)); }
|
250
|
+
get tax_calculators() { return this.#tax_calculators || (this.#tax_calculators = new api.TaxCalculators(this.#adapter)); }
|
251
|
+
get tax_categories() { return this.#tax_categories || (this.#tax_categories = new api.TaxCategories(this.#adapter)); }
|
252
|
+
get tax_rules() { return this.#tax_rules || (this.#tax_rules = new api.TaxRules(this.#adapter)); }
|
253
|
+
get taxjar_accounts() { return this.#taxjar_accounts || (this.#taxjar_accounts = new api.TaxjarAccounts(this.#adapter)); }
|
254
|
+
get transactions() { return this.#transactions || (this.#transactions = new api.Transactions(this.#adapter)); }
|
255
|
+
get versions() { return this.#versions || (this.#versions = new api.Versions(this.#adapter)); }
|
256
|
+
get voids() { return this.#voids || (this.#voids = new api.Voids(this.#adapter)); }
|
257
|
+
get webhooks() { return this.#webhooks || (this.#webhooks = new api.Webhooks(this.#adapter)); }
|
258
|
+
get wire_transfers() { return this.#wire_transfers || (this.#wire_transfers = new api.WireTransfers(this.#adapter)); }
|
259
|
+
get currentOrganization() { return this.#slug; }
|
260
|
+
get interceptors() { return this.#adapter.client.interceptors; }
|
272
261
|
localConfig(config) {
|
273
262
|
if (config.organization)
|
274
|
-
this.#
|
263
|
+
this.#slug = config.organization;
|
275
264
|
}
|
276
265
|
config(config) {
|
277
266
|
debug('config %o', config);
|
278
|
-
// CommerceLayer config
|
279
267
|
this.localConfig(config);
|
280
|
-
// ResourceAdapter config
|
281
|
-
// To rebuild baseUrl in client in case only the domain is defined
|
282
268
|
if (!config.organization)
|
283
269
|
config.organization = this.currentOrganization;
|
284
270
|
this.#adapter.config(config);
|
@@ -293,39 +279,41 @@ class CommerceLayerClient {
|
|
293
279
|
isSingleton(resource) {
|
294
280
|
return CommerceLayerStatic.isSingleton(resource);
|
295
281
|
}
|
296
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
297
282
|
isApiError(error) {
|
298
283
|
return CommerceLayerStatic.isApiError(error);
|
299
284
|
}
|
300
|
-
addRequestInterceptor(
|
301
|
-
|
285
|
+
addRequestInterceptor(onSuccess, onFailure) {
|
286
|
+
this.interceptors.request = { onSuccess, onFailure };
|
302
287
|
}
|
303
|
-
addResponseInterceptor(
|
304
|
-
|
288
|
+
addResponseInterceptor(onSuccess, onFailure) {
|
289
|
+
this.interceptors.response = { onSuccess, onFailure };
|
305
290
|
}
|
306
|
-
removeInterceptor(type, id) {
|
307
|
-
this
|
291
|
+
removeInterceptor(type, id = 1) {
|
292
|
+
this.interceptors[type] = undefined;
|
308
293
|
}
|
309
294
|
addRawResponseReader(options) {
|
310
295
|
const reader = {
|
311
296
|
id: undefined,
|
312
297
|
rawResponse: undefined,
|
313
298
|
headers: undefined,
|
299
|
+
ok: true
|
314
300
|
};
|
315
|
-
function rawResponseInterceptor(response) {
|
316
|
-
reader.rawResponse = response?.
|
317
|
-
|
318
|
-
|
301
|
+
async function rawResponseInterceptor(response) {
|
302
|
+
reader.rawResponse = await response?.clone().json().catch(() => { });
|
303
|
+
reader.ok = response.ok;
|
304
|
+
if (options?.headers) {
|
305
|
+
const ho = {};
|
306
|
+
response.headers.forEach((value, key) => { ho[key] = value; });
|
307
|
+
reader.headers = ho;
|
308
|
+
}
|
319
309
|
return response;
|
320
310
|
}
|
321
|
-
|
322
|
-
reader.id =
|
311
|
+
this.interceptors.rawReader = { onSuccess: rawResponseInterceptor, onFailure: rawResponseInterceptor };
|
312
|
+
reader.id = 1;
|
323
313
|
return reader;
|
324
314
|
}
|
325
|
-
removeRawResponseReader(
|
326
|
-
|
327
|
-
if (id && (id >= 0))
|
328
|
-
this.removeInterceptor('response', id);
|
315
|
+
removeRawResponseReader() {
|
316
|
+
this.interceptors.rawReader = undefined;
|
329
317
|
}
|
330
318
|
}
|
331
319
|
const CommerceLayer = (config) => {
|
package/lib/esm/common.js
CHANGED
@@ -6,14 +6,3 @@ const isResourceType = (resource) => {
|
|
6
6
|
return resource && (typeof resource.type !== 'undefined') && resource.type && resourceList.includes(resource.type);
|
7
7
|
};
|
8
8
|
export { isResourceId, isResourceType };
|
9
|
-
/*
|
10
|
-
// Nullable types
|
11
|
-
type StringNullable = string | null
|
12
|
-
type NumberNullable = number | null
|
13
|
-
type BooleanNullable = boolean | null
|
14
|
-
type ResourceNullable<R extends Resource> = R | null
|
15
|
-
type ResourceArrayNullable<R extends Resource> = R[] | null
|
16
|
-
|
17
|
-
|
18
|
-
export type { StringNullable, NumberNullable, BooleanNullable, ResourceNullable, ResourceArrayNullable }
|
19
|
-
*/
|
package/lib/esm/config.d.ts
CHANGED
package/lib/esm/config.js
CHANGED
@@ -1,7 +1,5 @@
|
|
1
|
-
// export type ApiMode = 'test' | 'live'
|
2
1
|
const config = {
|
3
2
|
default: {
|
4
|
-
// environment: 'test',
|
5
3
|
domain: 'commercelayer.io',
|
6
4
|
pageNumber: 1,
|
7
5
|
pageSize: 10,
|
@@ -9,6 +7,9 @@ const config = {
|
|
9
7
|
client: {
|
10
8
|
timeout: 15000,
|
11
9
|
requiredAttributes: ['organization', 'accessToken'],
|
10
|
+
},
|
11
|
+
jsonapi: {
|
12
|
+
maxResourceIncluded: 2
|
12
13
|
}
|
13
14
|
};
|
14
15
|
export default config;
|