@commercelayer/sdk 3.7.0 → 3.9.0
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 +8 -3
- package/lib/cjs/api.js +1 -1
- package/lib/cjs/client.js +1 -1
- package/lib/cjs/commercelayer.d.ts +5 -0
- package/lib/cjs/commercelayer.js +1 -1
- package/lib/cjs/config.d.ts +1 -1
- package/lib/cjs/config.js +1 -1
- package/lib/cjs/error.d.ts +26 -1
- package/lib/cjs/error.js +1 -1
- package/lib/cjs/interceptor.d.ts +19 -1
- package/lib/cjs/jsonapi.js +1 -1
- package/lib/cjs/model.d.ts +6 -1
- package/lib/cjs/resource.js +1 -1
- package/lib/cjs/resources/adyen_gateways.js +1 -1
- package/lib/cjs/resources/application.d.ts +1 -1
- package/lib/cjs/resources/avalara_accounts.d.ts +3 -0
- package/lib/cjs/resources/braintree_gateways.js +1 -1
- package/lib/cjs/resources/bundles.d.ts +6 -0
- package/lib/cjs/resources/checkout_com_gateways.js +1 -1
- package/lib/cjs/resources/customer_addresses.d.ts +2 -0
- package/lib/cjs/resources/customer_password_resets.d.ts +2 -0
- package/lib/cjs/resources/customer_subscriptions.d.ts +2 -0
- package/lib/cjs/resources/customers.d.ts +2 -0
- package/lib/cjs/resources/events.d.ts +22 -0
- package/lib/cjs/resources/events.js +1 -0
- package/lib/cjs/resources/external_gateways.js +1 -1
- package/lib/cjs/resources/external_promotions.js +1 -1
- package/lib/cjs/resources/external_tax_calculators.js +1 -1
- package/lib/cjs/resources/fixed_amount_promotions.js +1 -1
- package/lib/cjs/resources/free_gift_promotions.js +1 -1
- package/lib/cjs/resources/gift_cards.d.ts +2 -0
- package/lib/cjs/resources/imports.d.ts +2 -0
- package/lib/cjs/resources/in_stock_subscriptions.d.ts +2 -0
- package/lib/cjs/resources/line_item_options.js +1 -1
- package/lib/cjs/resources/manual_gateways.js +1 -1
- package/lib/cjs/resources/order_amount_promotion_rules.js +1 -1
- package/lib/cjs/resources/order_copies.d.ts +2 -0
- package/lib/cjs/resources/order_subscriptions.d.ts +2 -0
- package/lib/cjs/resources/order_validation_rules.js +1 -1
- package/lib/cjs/resources/orders.d.ts +8 -0
- package/lib/cjs/resources/organization.js +1 -1
- package/lib/cjs/resources/parcels.d.ts +4 -2
- package/lib/cjs/resources/payment_methods.js +1 -1
- package/lib/cjs/resources/paypal_gateways.js +1 -1
- package/lib/cjs/resources/percentage_discount_promotions.js +1 -1
- package/lib/cjs/resources/price_tiers.d.ts +26 -0
- package/lib/cjs/resources/price_tiers.js +1 -0
- package/lib/cjs/resources/price_volume_tiers.d.ts +44 -0
- package/lib/cjs/resources/price_volume_tiers.js +1 -0
- package/lib/cjs/resources/prices.d.ts +9 -0
- package/lib/cjs/resources/refunds.d.ts +2 -0
- package/lib/cjs/resources/returns.d.ts +2 -0
- package/lib/cjs/resources/shipments.d.ts +3 -0
- package/lib/cjs/resources/shipping_method_tiers.d.ts +26 -0
- package/lib/cjs/resources/shipping_method_tiers.js +1 -0
- package/lib/cjs/resources/shipping_methods.d.ts +30 -2
- package/lib/cjs/resources/shipping_weight_tiers.d.ts +44 -0
- package/lib/cjs/resources/shipping_weight_tiers.js +1 -0
- package/lib/cjs/resources/sku_lists.js +1 -1
- package/lib/cjs/resources/sku_options.js +1 -1
- package/lib/cjs/resources/stock_transfers.d.ts +2 -0
- package/lib/cjs/resources/stripe_gateways.js +1 -1
- package/lib/cjs/resources/tax_calculators.js +1 -1
- package/lib/cjs/util.d.ts +5 -1
- package/lib/esm/api.d.ts +8 -3
- package/lib/esm/api.js +1 -1
- package/lib/esm/client.js +1 -1
- package/lib/esm/commercelayer.d.ts +5 -0
- package/lib/esm/commercelayer.js +1 -1
- package/lib/esm/config.d.ts +1 -1
- package/lib/esm/config.js +1 -1
- package/lib/esm/error.d.ts +26 -1
- package/lib/esm/error.js +1 -1
- package/lib/esm/interceptor.d.ts +19 -1
- package/lib/esm/jsonapi.js +1 -1
- package/lib/esm/model.d.ts +6 -1
- package/lib/esm/resource.js +1 -1
- package/lib/esm/resources/addresses.js +1 -1
- package/lib/esm/resources/adjustments.js +1 -1
- package/lib/esm/resources/adyen_gateways.js +1 -1
- package/lib/esm/resources/application.d.ts +1 -1
- package/lib/esm/resources/avalara_accounts.d.ts +3 -0
- package/lib/esm/resources/avalara_accounts.js +1 -1
- package/lib/esm/resources/billing_info_validation_rules.js +1 -1
- package/lib/esm/resources/bing_geocoders.js +1 -1
- package/lib/esm/resources/braintree_gateways.js +1 -1
- package/lib/esm/resources/bundles.d.ts +6 -0
- package/lib/esm/resources/bundles.js +1 -1
- package/lib/esm/resources/carrier_accounts.js +1 -1
- package/lib/esm/resources/checkout_com_gateways.js +1 -1
- package/lib/esm/resources/coupon_codes_promotion_rules.js +1 -1
- package/lib/esm/resources/coupons.js +1 -1
- package/lib/esm/resources/customer_addresses.d.ts +2 -0
- package/lib/esm/resources/customer_password_resets.d.ts +2 -0
- package/lib/esm/resources/customer_subscriptions.d.ts +2 -0
- package/lib/esm/resources/customers.d.ts +2 -0
- package/lib/esm/resources/event_callbacks.js +1 -1
- package/lib/esm/resources/events.d.ts +22 -0
- package/lib/esm/resources/events.js +1 -0
- package/lib/esm/resources/external_promotions.js +1 -1
- package/lib/esm/resources/external_tax_calculators.js +1 -1
- package/lib/esm/resources/fixed_amount_promotions.js +1 -1
- package/lib/esm/resources/fixed_price_promotions.js +1 -1
- package/lib/esm/resources/free_gift_promotions.js +1 -1
- package/lib/esm/resources/free_shipping_promotions.js +1 -1
- package/lib/esm/resources/geocoders.js +1 -1
- package/lib/esm/resources/gift_cards.d.ts +2 -0
- package/lib/esm/resources/google_geocoders.js +1 -1
- package/lib/esm/resources/imports.d.ts +2 -0
- package/lib/esm/resources/in_stock_subscriptions.d.ts +2 -0
- package/lib/esm/resources/inventory_models.js +1 -1
- package/lib/esm/resources/inventory_return_locations.js +1 -1
- package/lib/esm/resources/inventory_stock_locations.js +1 -1
- package/lib/esm/resources/klarna_gateways.js +1 -1
- package/lib/esm/resources/line_item_options.js +1 -1
- package/lib/esm/resources/manual_gateways.js +1 -1
- package/lib/esm/resources/manual_tax_calculators.js +1 -1
- package/lib/esm/resources/markets.js +1 -1
- package/lib/esm/resources/merchants.js +1 -1
- package/lib/esm/resources/order_amount_promotion_rules.js +1 -1
- package/lib/esm/resources/order_copies.d.ts +2 -0
- package/lib/esm/resources/order_subscriptions.d.ts +2 -0
- package/lib/esm/resources/order_validation_rules.js +1 -1
- package/lib/esm/resources/orders.d.ts +8 -0
- package/lib/esm/resources/organization.js +1 -1
- package/lib/esm/resources/parcels.d.ts +4 -2
- package/lib/esm/resources/payment_gateways.js +1 -1
- package/lib/esm/resources/payment_methods.js +1 -1
- package/lib/esm/resources/paypal_gateways.js +1 -1
- package/lib/esm/resources/percentage_discount_promotions.js +1 -1
- package/lib/esm/resources/price_tiers.d.ts +26 -0
- package/lib/esm/resources/price_tiers.js +1 -0
- package/lib/esm/resources/price_volume_tiers.d.ts +44 -0
- package/lib/esm/resources/price_volume_tiers.js +1 -0
- package/lib/esm/resources/prices.d.ts +9 -0
- package/lib/esm/resources/promotion_rules.js +1 -1
- package/lib/esm/resources/promotions.js +1 -1
- package/lib/esm/resources/refunds.d.ts +2 -0
- package/lib/esm/resources/returns.d.ts +2 -0
- package/lib/esm/resources/shipments.d.ts +3 -0
- package/lib/esm/resources/shipping_categories.js +1 -1
- package/lib/esm/resources/shipping_method_tiers.d.ts +26 -0
- package/lib/esm/resources/shipping_method_tiers.js +1 -0
- package/lib/esm/resources/shipping_methods.d.ts +30 -2
- package/lib/esm/resources/shipping_weight_tiers.d.ts +44 -0
- package/lib/esm/resources/shipping_weight_tiers.js +1 -0
- package/lib/esm/resources/shipping_zones.js +1 -1
- package/lib/esm/resources/sku_list_items.js +1 -1
- package/lib/esm/resources/sku_list_promotion_rules.js +1 -1
- package/lib/esm/resources/sku_lists.js +1 -1
- package/lib/esm/resources/sku_options.js +1 -1
- package/lib/esm/resources/stock_items.js +1 -1
- package/lib/esm/resources/stock_transfers.d.ts +2 -0
- package/lib/esm/resources/stripe_gateways.js +1 -1
- package/lib/esm/resources/tax_calculators.js +1 -1
- package/lib/esm/resources/tax_categories.js +1 -1
- package/lib/esm/resources/tax_rules.js +1 -1
- package/lib/esm/resources/taxjar_accounts.js +1 -1
- package/lib/esm/resources/webhooks.js +1 -1
- package/lib/esm/util.d.ts +5 -1
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/lib/api.d.ts +0 -1
- package/lib/api.js +0 -1
- package/lib/client.d.ts +0 -2
- package/lib/client.js +0 -1
- package/lib/commercelayer.d.ts +0 -1
- package/lib/commercelayer.js +0 -1
- package/lib/common.d.ts +0 -1
- package/lib/common.js +0 -1
- package/lib/config.d.ts +0 -1
- package/lib/config.js +0 -1
- package/lib/debug.d.ts +0 -1
- package/lib/debug.js +0 -1
- package/lib/error.d.ts +0 -1
- package/lib/error.js +0 -1
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -1
- package/lib/interceptor.d.ts +0 -1
- package/lib/interceptor.js +0 -1
- package/lib/jsonapi.d.ts +0 -1
- package/lib/jsonapi.js +0 -1
- package/lib/model.d.ts +0 -1
- package/lib/model.js +0 -1
- package/lib/query.d.ts +0 -1
- package/lib/query.js +0 -1
- package/lib/resource.d.ts +0 -1
- package/lib/resource.js +0 -1
- package/lib/resources/addresses.d.ts +0 -1
- package/lib/resources/addresses.js +0 -1
- package/lib/resources/adjustments.d.ts +0 -1
- package/lib/resources/adjustments.js +0 -1
- package/lib/resources/adyen_gateways.d.ts +0 -1
- package/lib/resources/adyen_gateways.js +0 -1
- package/lib/resources/adyen_payments.d.ts +0 -1
- package/lib/resources/adyen_payments.js +0 -1
- package/lib/resources/application.d.ts +0 -1
- package/lib/resources/application.js +0 -1
- package/lib/resources/attachments.d.ts +0 -1
- package/lib/resources/attachments.js +0 -1
- package/lib/resources/authorizations.d.ts +0 -1
- package/lib/resources/authorizations.js +0 -1
- package/lib/resources/avalara_accounts.d.ts +0 -1
- package/lib/resources/avalara_accounts.js +0 -1
- package/lib/resources/billing_info_validation_rules.d.ts +0 -1
- package/lib/resources/billing_info_validation_rules.js +0 -1
- package/lib/resources/bing_geocoders.d.ts +0 -1
- package/lib/resources/bing_geocoders.js +0 -1
- package/lib/resources/braintree_gateways.d.ts +0 -1
- package/lib/resources/braintree_gateways.js +0 -1
- package/lib/resources/braintree_payments.d.ts +0 -1
- package/lib/resources/braintree_payments.js +0 -1
- package/lib/resources/bundles.d.ts +0 -1
- package/lib/resources/bundles.js +0 -1
- package/lib/resources/captures.d.ts +0 -1
- package/lib/resources/captures.js +0 -1
- package/lib/resources/carrier_accounts.d.ts +0 -1
- package/lib/resources/carrier_accounts.js +0 -1
- package/lib/resources/checkout_com_gateways.d.ts +0 -1
- package/lib/resources/checkout_com_gateways.js +0 -1
- package/lib/resources/checkout_com_payments.d.ts +0 -1
- package/lib/resources/checkout_com_payments.js +0 -1
- package/lib/resources/coupon_codes_promotion_rules.d.ts +0 -1
- package/lib/resources/coupon_codes_promotion_rules.js +0 -1
- package/lib/resources/coupon_recipients.d.ts +0 -1
- package/lib/resources/coupon_recipients.js +0 -1
- package/lib/resources/coupons.d.ts +0 -1
- package/lib/resources/coupons.js +0 -1
- package/lib/resources/customer_addresses.d.ts +0 -1
- package/lib/resources/customer_addresses.js +0 -1
- package/lib/resources/customer_groups.d.ts +0 -1
- package/lib/resources/customer_groups.js +0 -1
- package/lib/resources/customer_password_resets.d.ts +0 -1
- package/lib/resources/customer_password_resets.js +0 -1
- package/lib/resources/customer_payment_sources.d.ts +0 -1
- package/lib/resources/customer_payment_sources.js +0 -1
- package/lib/resources/customer_subscriptions.d.ts +0 -1
- package/lib/resources/customer_subscriptions.js +0 -1
- package/lib/resources/customers.d.ts +0 -1
- package/lib/resources/customers.js +0 -1
- package/lib/resources/delivery_lead_times.d.ts +0 -1
- package/lib/resources/delivery_lead_times.js +0 -1
- package/lib/resources/event_callbacks.d.ts +0 -1
- package/lib/resources/event_callbacks.js +0 -1
- package/lib/resources/external_gateways.d.ts +0 -1
- package/lib/resources/external_gateways.js +0 -1
- package/lib/resources/external_payments.d.ts +0 -1
- package/lib/resources/external_payments.js +0 -1
- package/lib/resources/external_promotions.d.ts +0 -1
- package/lib/resources/external_promotions.js +0 -1
- package/lib/resources/external_tax_calculators.d.ts +0 -1
- package/lib/resources/external_tax_calculators.js +0 -1
- package/lib/resources/fixed_amount_promotions.d.ts +0 -1
- package/lib/resources/fixed_amount_promotions.js +0 -1
- package/lib/resources/fixed_price_promotions.d.ts +0 -1
- package/lib/resources/fixed_price_promotions.js +0 -1
- package/lib/resources/free_gift_promotions.d.ts +0 -1
- package/lib/resources/free_gift_promotions.js +0 -1
- package/lib/resources/free_shipping_promotions.d.ts +0 -1
- package/lib/resources/free_shipping_promotions.js +0 -1
- package/lib/resources/geocoders.d.ts +0 -1
- package/lib/resources/geocoders.js +0 -1
- package/lib/resources/gift_card_recipients.d.ts +0 -1
- package/lib/resources/gift_card_recipients.js +0 -1
- package/lib/resources/gift_cards.d.ts +0 -1
- package/lib/resources/gift_cards.js +0 -1
- package/lib/resources/google_geocoders.d.ts +0 -1
- package/lib/resources/google_geocoders.js +0 -1
- package/lib/resources/imports.d.ts +0 -1
- package/lib/resources/imports.js +0 -1
- package/lib/resources/in_stock_subscriptions.d.ts +0 -1
- package/lib/resources/in_stock_subscriptions.js +0 -1
- package/lib/resources/inventory_models.d.ts +0 -1
- package/lib/resources/inventory_models.js +0 -1
- package/lib/resources/inventory_return_locations.d.ts +0 -1
- package/lib/resources/inventory_return_locations.js +0 -1
- package/lib/resources/inventory_stock_locations.d.ts +0 -1
- package/lib/resources/inventory_stock_locations.js +0 -1
- package/lib/resources/klarna_gateways.d.ts +0 -1
- package/lib/resources/klarna_gateways.js +0 -1
- package/lib/resources/klarna_payments.d.ts +0 -1
- package/lib/resources/klarna_payments.js +0 -1
- package/lib/resources/line_item_options.d.ts +0 -1
- package/lib/resources/line_item_options.js +0 -1
- package/lib/resources/line_items.d.ts +0 -1
- package/lib/resources/line_items.js +0 -1
- package/lib/resources/manual_gateways.d.ts +0 -1
- package/lib/resources/manual_gateways.js +0 -1
- package/lib/resources/manual_tax_calculators.d.ts +0 -1
- package/lib/resources/manual_tax_calculators.js +0 -1
- package/lib/resources/markets.d.ts +0 -1
- package/lib/resources/markets.js +0 -1
- package/lib/resources/merchants.d.ts +0 -1
- package/lib/resources/merchants.js +0 -1
- package/lib/resources/order_amount_promotion_rules.d.ts +0 -1
- package/lib/resources/order_amount_promotion_rules.js +0 -1
- package/lib/resources/order_copies.d.ts +0 -1
- package/lib/resources/order_copies.js +0 -1
- package/lib/resources/order_subscriptions.d.ts +0 -1
- package/lib/resources/order_subscriptions.js +0 -1
- package/lib/resources/order_validation_rules.d.ts +0 -1
- package/lib/resources/order_validation_rules.js +0 -1
- package/lib/resources/orders.d.ts +0 -1
- package/lib/resources/orders.js +0 -1
- package/lib/resources/organization.d.ts +0 -1
- package/lib/resources/organization.js +0 -1
- package/lib/resources/packages.d.ts +0 -1
- package/lib/resources/packages.js +0 -1
- package/lib/resources/parcel_line_items.d.ts +0 -1
- package/lib/resources/parcel_line_items.js +0 -1
- package/lib/resources/parcels.d.ts +0 -1
- package/lib/resources/parcels.js +0 -1
- package/lib/resources/payment_gateways.d.ts +0 -1
- package/lib/resources/payment_gateways.js +0 -1
- package/lib/resources/payment_methods.d.ts +0 -1
- package/lib/resources/payment_methods.js +0 -1
- package/lib/resources/paypal_gateways.d.ts +0 -1
- package/lib/resources/paypal_gateways.js +0 -1
- package/lib/resources/paypal_payments.d.ts +0 -1
- package/lib/resources/paypal_payments.js +0 -1
- package/lib/resources/percentage_discount_promotions.d.ts +0 -1
- package/lib/resources/percentage_discount_promotions.js +0 -1
- package/lib/resources/price_lists.d.ts +0 -1
- package/lib/resources/price_lists.js +0 -1
- package/lib/resources/prices.d.ts +0 -1
- package/lib/resources/prices.js +0 -1
- package/lib/resources/promotion_rules.d.ts +0 -1
- package/lib/resources/promotion_rules.js +0 -1
- package/lib/resources/promotions.d.ts +0 -1
- package/lib/resources/promotions.js +0 -1
- package/lib/resources/refunds.d.ts +0 -1
- package/lib/resources/refunds.js +0 -1
- package/lib/resources/return_line_items.d.ts +0 -1
- package/lib/resources/return_line_items.js +0 -1
- package/lib/resources/returns.d.ts +0 -1
- package/lib/resources/returns.js +0 -1
- package/lib/resources/shipments.d.ts +0 -1
- package/lib/resources/shipments.js +0 -1
- package/lib/resources/shipping_categories.d.ts +0 -1
- package/lib/resources/shipping_categories.js +0 -1
- package/lib/resources/shipping_methods.d.ts +0 -1
- package/lib/resources/shipping_methods.js +0 -1
- package/lib/resources/shipping_zones.d.ts +0 -1
- package/lib/resources/shipping_zones.js +0 -1
- package/lib/resources/sku_list_items.d.ts +0 -1
- package/lib/resources/sku_list_items.js +0 -1
- package/lib/resources/sku_list_promotion_rules.d.ts +0 -1
- package/lib/resources/sku_list_promotion_rules.js +0 -1
- package/lib/resources/sku_lists.d.ts +0 -1
- package/lib/resources/sku_lists.js +0 -1
- package/lib/resources/sku_options.d.ts +0 -1
- package/lib/resources/sku_options.js +0 -1
- package/lib/resources/skus.d.ts +0 -1
- package/lib/resources/skus.js +0 -1
- package/lib/resources/stock_items.d.ts +0 -1
- package/lib/resources/stock_items.js +0 -1
- package/lib/resources/stock_line_items.d.ts +0 -1
- package/lib/resources/stock_line_items.js +0 -1
- package/lib/resources/stock_locations.d.ts +0 -1
- package/lib/resources/stock_locations.js +0 -1
- package/lib/resources/stock_transfers.d.ts +0 -1
- package/lib/resources/stock_transfers.js +0 -1
- package/lib/resources/stripe_gateways.d.ts +0 -1
- package/lib/resources/stripe_gateways.js +0 -1
- package/lib/resources/stripe_payments.d.ts +0 -1
- package/lib/resources/stripe_payments.js +0 -1
- package/lib/resources/tax_calculators.d.ts +0 -1
- package/lib/resources/tax_calculators.js +0 -1
- package/lib/resources/tax_categories.d.ts +0 -1
- package/lib/resources/tax_categories.js +0 -1
- package/lib/resources/tax_rules.d.ts +0 -1
- package/lib/resources/tax_rules.js +0 -1
- package/lib/resources/taxjar_accounts.d.ts +0 -1
- package/lib/resources/taxjar_accounts.js +0 -1
- package/lib/resources/transactions.d.ts +0 -1
- package/lib/resources/transactions.js +0 -1
- package/lib/resources/voids.d.ts +0 -1
- package/lib/resources/voids.js +0 -1
- package/lib/resources/webhooks.d.ts +0 -1
- package/lib/resources/webhooks.js +0 -1
- package/lib/resources/wire_transfers.d.ts +0 -1
- package/lib/resources/wire_transfers.js +0 -1
- package/lib/static.d.ts +0 -1
- package/lib/static.js +0 -1
- package/lib/util.d.ts +0 -2
- package/lib/util.js +0 -1
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class ShippingWeightTiers extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:ShippingWeightTiers.TYPE},e,t)}async create(e,t,s){return this.resources.create(Object.assign(Object.assign({},e),{type:ShippingWeightTiers.TYPE}),t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:ShippingWeightTiers.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update(Object.assign(Object.assign({},e),{type:ShippingWeightTiers.TYPE}),t,s)}async delete(e,t){await this.resources.delete({type:ShippingWeightTiers.TYPE,id:e},t)}isShippingWeightTier(e){return e.type&&e.type===ShippingWeightTiers.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:ShippingWeightTiers.TYPE}:{id:e.id,type:ShippingWeightTiers.TYPE}}type(){return ShippingWeightTiers.TYPE}}ShippingWeightTiers.TYPE="shipping_weight_tiers",exports.default=ShippingWeightTiers;
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class SkuLists extends resource_1.ApiResource{async list(e,
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class SkuLists extends resource_1.ApiResource{async list(e,r){return this.resources.list({type:SkuLists.TYPE},e,r)}async create(e,r,t){return this.resources.create(Object.assign(Object.assign({},e),{type:SkuLists.TYPE}),r,t)}async retrieve(e,r,t){return this.resources.retrieve({type:SkuLists.TYPE,id:e},r,t)}async update(e,r,t){return this.resources.update(Object.assign(Object.assign({},e),{type:SkuLists.TYPE}),r,t)}async delete(e,r){await this.resources.delete({type:SkuLists.TYPE,id:e},r)}isSkuList(e){return e.type&&e.type===SkuLists.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:SkuLists.TYPE}:{id:e.id,type:SkuLists.TYPE}}type(){return SkuLists.TYPE}}SkuLists.TYPE="sku_lists",exports.default=SkuLists;
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class SkuOptions extends resource_1.ApiResource{async list(e,
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class SkuOptions extends resource_1.ApiResource{async list(e,r){return this.resources.list({type:SkuOptions.TYPE},e,r)}async create(e,r,t){return this.resources.create(Object.assign(Object.assign({},e),{type:SkuOptions.TYPE}),r,t)}async retrieve(e,r,t){return this.resources.retrieve({type:SkuOptions.TYPE,id:e},r,t)}async update(e,r,t){return this.resources.update(Object.assign(Object.assign({},e),{type:SkuOptions.TYPE}),r,t)}async delete(e,r){await this.resources.delete({type:SkuOptions.TYPE,id:e},r)}isSkuOption(e){return e.type&&e.type===SkuOptions.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:SkuOptions.TYPE}:{id:e.id,type:SkuOptions.TYPE}}type(){return SkuOptions.TYPE}}SkuOptions.TYPE="sku_options",exports.default=SkuOptions;
|
@@ -4,6 +4,7 @@ import { Sku } from './skus';
|
|
4
4
|
import { StockLocation } from './stock_locations';
|
5
5
|
import { Shipment } from './shipments';
|
6
6
|
import { LineItem } from './line_items';
|
7
|
+
import { Event } from './events';
|
7
8
|
declare type StockTransferRel = ResourceRel & {
|
8
9
|
type: typeof StockTransfers.TYPE;
|
9
10
|
};
|
@@ -30,6 +31,7 @@ interface StockTransfer extends Resource {
|
|
30
31
|
destination_stock_location?: StockLocation;
|
31
32
|
shipment?: Shipment;
|
32
33
|
line_item?: LineItem;
|
34
|
+
events?: Event[];
|
33
35
|
}
|
34
36
|
interface StockTransferCreate extends ResourceCreate {
|
35
37
|
sku_code?: string;
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class StripeGateways extends resource_1.ApiResource{async list(e,s){return this.resources.list({type:StripeGateways.TYPE},e,s)}async create(e,s,
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class StripeGateways extends resource_1.ApiResource{async list(e,s){return this.resources.list({type:StripeGateways.TYPE},e,s)}async create(e,s,r){return this.resources.create(Object.assign(Object.assign({},e),{type:StripeGateways.TYPE}),s,r)}async retrieve(e,s,r){return this.resources.retrieve({type:StripeGateways.TYPE,id:e},s,r)}async update(e,s,r){return this.resources.update(Object.assign(Object.assign({},e),{type:StripeGateways.TYPE}),s,r)}async delete(e,s){await this.resources.delete({type:StripeGateways.TYPE,id:e},s)}isStripeGateway(e){return e.type&&e.type===StripeGateways.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:StripeGateways.TYPE}:{id:e.id,type:StripeGateways.TYPE}}type(){return StripeGateways.TYPE}}StripeGateways.TYPE="stripe_gateways",exports.default=StripeGateways;
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class TaxCalculators extends resource_1.ApiResource{async list(e,
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class TaxCalculators extends resource_1.ApiResource{async list(e,r){return this.resources.list({type:TaxCalculators.TYPE},e,r)}async retrieve(e,r,t){return this.resources.retrieve({type:TaxCalculators.TYPE,id:e},r,t)}isTaxCalculator(e){return e.type&&e.type===TaxCalculators.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:TaxCalculators.TYPE}:{id:e.id,type:TaxCalculators.TYPE}}type(){return TaxCalculators.TYPE}}TaxCalculators.TYPE="tax_calculators",exports.default=TaxCalculators;
|
package/lib/cjs/util.d.ts
CHANGED
@@ -1,2 +1,6 @@
|
|
1
1
|
/// <reference types="node" />
|
2
|
-
|
2
|
+
/// <reference types="node" />
|
3
|
+
/// <reference types="node" />
|
4
|
+
/// <reference types="node" />
|
5
|
+
declare const sleep: (ms: number) => Promise<NodeJS.Timeout>;
|
6
|
+
export { sleep };
|
package/lib/esm/api.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/**
|
2
2
|
* ©2022 Commerce Layer Inc.
|
3
|
-
* OpenAPI schema, version 2.9.
|
3
|
+
* OpenAPI schema, version 2.9.5
|
4
4
|
**/
|
5
5
|
export { default as Addresses } from './resources/addresses';
|
6
6
|
export { default as Adjustments } from './resources/adjustments';
|
@@ -30,6 +30,7 @@ export { default as CustomerSubscriptions } from './resources/customer_subscript
|
|
30
30
|
export { default as Customers } from './resources/customers';
|
31
31
|
export { default as DeliveryLeadTimes } from './resources/delivery_lead_times';
|
32
32
|
export { default as EventCallbacks } from './resources/event_callbacks';
|
33
|
+
export { default as Events } from './resources/events';
|
33
34
|
export { default as ExternalGateways } from './resources/external_gateways';
|
34
35
|
export { default as ExternalPayments } from './resources/external_payments';
|
35
36
|
export { default as ExternalPromotions } from './resources/external_promotions';
|
@@ -70,6 +71,8 @@ export { default as PaypalGateways } from './resources/paypal_gateways';
|
|
70
71
|
export { default as PaypalPayments } from './resources/paypal_payments';
|
71
72
|
export { default as PercentageDiscountPromotions } from './resources/percentage_discount_promotions';
|
72
73
|
export { default as PriceLists } from './resources/price_lists';
|
74
|
+
export { default as PriceTiers } from './resources/price_tiers';
|
75
|
+
export { default as PriceVolumeTiers } from './resources/price_volume_tiers';
|
73
76
|
export { default as Prices } from './resources/prices';
|
74
77
|
export { default as PromotionRules } from './resources/promotion_rules';
|
75
78
|
export { default as Promotions } from './resources/promotions';
|
@@ -78,7 +81,9 @@ export { default as ReturnLineItems } from './resources/return_line_items';
|
|
78
81
|
export { default as Returns } from './resources/returns';
|
79
82
|
export { default as Shipments } from './resources/shipments';
|
80
83
|
export { default as ShippingCategories } from './resources/shipping_categories';
|
84
|
+
export { default as ShippingMethodTiers } from './resources/shipping_method_tiers';
|
81
85
|
export { default as ShippingMethods } from './resources/shipping_methods';
|
86
|
+
export { default as ShippingWeightTiers } from './resources/shipping_weight_tiers';
|
82
87
|
export { default as ShippingZones } from './resources/shipping_zones';
|
83
88
|
export { default as SkuListItems } from './resources/sku_list_items';
|
84
89
|
export { default as SkuListPromotionRules } from './resources/sku_list_promotion_rules';
|
@@ -99,5 +104,5 @@ export { default as Transactions } from './resources/transactions';
|
|
99
104
|
export { default as Voids } from './resources/voids';
|
100
105
|
export { default as Webhooks } from './resources/webhooks';
|
101
106
|
export { default as WireTransfers } from './resources/wire_transfers';
|
102
|
-
export declare type ResourceTypeLock = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'application' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'captures' | 'carrier_accounts' | 'checkout_com_gateways' | 'checkout_com_payments' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'event_callbacks' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'geocoders' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_subscriptions' | 'order_validation_rules' | 'orders' | 'organization' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_gateways' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_lists' | 'prices' | 'promotion_rules' | 'promotions' | 'refunds' | 'return_line_items' | 'returns' | 'shipments' | 'shipping_categories' | 'shipping_methods' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_line_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'tax_calculators' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'transactions' | 'voids' | 'webhooks' | 'wire_transfers';
|
103
|
-
export declare const resourceList: readonly ["addresses", "adjustments", "adyen_gateways", "adyen_payments", "application", "attachments", "authorizations", "avalara_accounts", "billing_info_validation_rules", "bing_geocoders", "braintree_gateways", "braintree_payments", "bundles", "captures", "carrier_accounts", "checkout_com_gateways", "checkout_com_payments", "coupon_codes_promotion_rules", "coupon_recipients", "coupons", "customer_addresses", "customer_groups", "customer_password_resets", "customer_payment_sources", "customer_subscriptions", "customers", "delivery_lead_times", "event_callbacks", "external_gateways", "external_payments", "external_promotions", "external_tax_calculators", "fixed_amount_promotions", "fixed_price_promotions", "free_gift_promotions", "free_shipping_promotions", "geocoders", "gift_card_recipients", "gift_cards", "google_geocoders", "imports", "in_stock_subscriptions", "inventory_models", "inventory_return_locations", "inventory_stock_locations", "klarna_gateways", "klarna_payments", "line_item_options", "line_items", "manual_gateways", "manual_tax_calculators", "markets", "merchants", "order_amount_promotion_rules", "order_copies", "order_subscriptions", "order_validation_rules", "orders", "organization", "packages", "parcel_line_items", "parcels", "payment_gateways", "payment_methods", "paypal_gateways", "paypal_payments", "percentage_discount_promotions", "price_lists", "prices", "promotion_rules", "promotions", "refunds", "return_line_items", "returns", "shipments", "shipping_categories", "shipping_methods", "shipping_zones", "sku_list_items", "sku_list_promotion_rules", "sku_lists", "sku_options", "skus", "stock_items", "stock_line_items", "stock_locations", "stock_transfers", "stripe_gateways", "stripe_payments", "tax_calculators", "tax_categories", "tax_rules", "taxjar_accounts", "transactions", "voids", "webhooks", "wire_transfers"];
|
107
|
+
export declare type ResourceTypeLock = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'application' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'captures' | 'carrier_accounts' | 'checkout_com_gateways' | 'checkout_com_payments' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'event_callbacks' | 'events' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'geocoders' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_subscriptions' | 'order_validation_rules' | 'orders' | 'organization' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_gateways' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_lists' | 'price_tiers' | 'price_volume_tiers' | 'prices' | 'promotion_rules' | 'promotions' | 'refunds' | 'return_line_items' | 'returns' | 'shipments' | 'shipping_categories' | 'shipping_method_tiers' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_line_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'tax_calculators' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'transactions' | 'voids' | 'webhooks' | 'wire_transfers';
|
108
|
+
export declare const resourceList: readonly ["addresses", "adjustments", "adyen_gateways", "adyen_payments", "application", "attachments", "authorizations", "avalara_accounts", "billing_info_validation_rules", "bing_geocoders", "braintree_gateways", "braintree_payments", "bundles", "captures", "carrier_accounts", "checkout_com_gateways", "checkout_com_payments", "coupon_codes_promotion_rules", "coupon_recipients", "coupons", "customer_addresses", "customer_groups", "customer_password_resets", "customer_payment_sources", "customer_subscriptions", "customers", "delivery_lead_times", "event_callbacks", "events", "external_gateways", "external_payments", "external_promotions", "external_tax_calculators", "fixed_amount_promotions", "fixed_price_promotions", "free_gift_promotions", "free_shipping_promotions", "geocoders", "gift_card_recipients", "gift_cards", "google_geocoders", "imports", "in_stock_subscriptions", "inventory_models", "inventory_return_locations", "inventory_stock_locations", "klarna_gateways", "klarna_payments", "line_item_options", "line_items", "manual_gateways", "manual_tax_calculators", "markets", "merchants", "order_amount_promotion_rules", "order_copies", "order_subscriptions", "order_validation_rules", "orders", "organization", "packages", "parcel_line_items", "parcels", "payment_gateways", "payment_methods", "paypal_gateways", "paypal_payments", "percentage_discount_promotions", "price_lists", "price_tiers", "price_volume_tiers", "prices", "promotion_rules", "promotions", "refunds", "return_line_items", "returns", "shipments", "shipping_categories", "shipping_method_tiers", "shipping_methods", "shipping_weight_tiers", "shipping_zones", "sku_list_items", "sku_list_promotion_rules", "sku_lists", "sku_options", "skus", "stock_items", "stock_line_items", "stock_locations", "stock_transfers", "stripe_gateways", "stripe_payments", "tax_calculators", "tax_categories", "tax_rules", "taxjar_accounts", "transactions", "voids", "webhooks", "wire_transfers"];
|
package/lib/esm/api.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export{default as Addresses}from"./resources/addresses";export{default as Adjustments}from"./resources/adjustments";export{default as AdyenGateways}from"./resources/adyen_gateways";export{default as AdyenPayments}from"./resources/adyen_payments";export{default as Applications}from"./resources/application";export{default as Attachments}from"./resources/attachments";export{default as Authorizations}from"./resources/authorizations";export{default as AvalaraAccounts}from"./resources/avalara_accounts";export{default as BillingInfoValidationRules}from"./resources/billing_info_validation_rules";export{default as BingGeocoders}from"./resources/bing_geocoders";export{default as BraintreeGateways}from"./resources/braintree_gateways";export{default as BraintreePayments}from"./resources/braintree_payments";export{default as Bundles}from"./resources/bundles";export{default as Captures}from"./resources/captures";export{default as CarrierAccounts}from"./resources/carrier_accounts";export{default as CheckoutComGateways}from"./resources/checkout_com_gateways";export{default as CheckoutComPayments}from"./resources/checkout_com_payments";export{default as CouponCodesPromotionRules}from"./resources/coupon_codes_promotion_rules";export{default as CouponRecipients}from"./resources/coupon_recipients";export{default as Coupons}from"./resources/coupons";export{default as CustomerAddresses}from"./resources/customer_addresses";export{default as CustomerGroups}from"./resources/customer_groups";export{default as CustomerPasswordResets}from"./resources/customer_password_resets";export{default as CustomerPaymentSources}from"./resources/customer_payment_sources";export{default as CustomerSubscriptions}from"./resources/customer_subscriptions";export{default as Customers}from"./resources/customers";export{default as DeliveryLeadTimes}from"./resources/delivery_lead_times";export{default as EventCallbacks}from"./resources/event_callbacks";export{default as ExternalGateways}from"./resources/external_gateways";export{default as ExternalPayments}from"./resources/external_payments";export{default as ExternalPromotions}from"./resources/external_promotions";export{default as ExternalTaxCalculators}from"./resources/external_tax_calculators";export{default as FixedAmountPromotions}from"./resources/fixed_amount_promotions";export{default as FixedPricePromotions}from"./resources/fixed_price_promotions";export{default as FreeGiftPromotions}from"./resources/free_gift_promotions";export{default as FreeShippingPromotions}from"./resources/free_shipping_promotions";export{default as Geocoders}from"./resources/geocoders";export{default as GiftCardRecipients}from"./resources/gift_card_recipients";export{default as GiftCards}from"./resources/gift_cards";export{default as GoogleGeocoders}from"./resources/google_geocoders";export{default as Imports}from"./resources/imports";export{default as InStockSubscriptions}from"./resources/in_stock_subscriptions";export{default as InventoryModels}from"./resources/inventory_models";export{default as InventoryReturnLocations}from"./resources/inventory_return_locations";export{default as InventoryStockLocations}from"./resources/inventory_stock_locations";export{default as KlarnaGateways}from"./resources/klarna_gateways";export{default as KlarnaPayments}from"./resources/klarna_payments";export{default as LineItemOptions}from"./resources/line_item_options";export{default as LineItems}from"./resources/line_items";export{default as ManualGateways}from"./resources/manual_gateways";export{default as ManualTaxCalculators}from"./resources/manual_tax_calculators";export{default as Markets}from"./resources/markets";export{default as Merchants}from"./resources/merchants";export{default as OrderAmountPromotionRules}from"./resources/order_amount_promotion_rules";export{default as OrderCopies}from"./resources/order_copies";export{default as OrderSubscriptions}from"./resources/order_subscriptions";export{default as OrderValidationRules}from"./resources/order_validation_rules";export{default as Orders}from"./resources/orders";export{default as Organizations}from"./resources/organization";export{default as Packages}from"./resources/packages";export{default as ParcelLineItems}from"./resources/parcel_line_items";export{default as Parcels}from"./resources/parcels";export{default as PaymentGateways}from"./resources/payment_gateways";export{default as PaymentMethods}from"./resources/payment_methods";export{default as PaypalGateways}from"./resources/paypal_gateways";export{default as PaypalPayments}from"./resources/paypal_payments";export{default as PercentageDiscountPromotions}from"./resources/percentage_discount_promotions";export{default as PriceLists}from"./resources/price_lists";export{default as Prices}from"./resources/prices";export{default as PromotionRules}from"./resources/promotion_rules";export{default as Promotions}from"./resources/promotions";export{default as Refunds}from"./resources/refunds";export{default as ReturnLineItems}from"./resources/return_line_items";export{default as Returns}from"./resources/returns";export{default as Shipments}from"./resources/shipments";export{default as ShippingCategories}from"./resources/shipping_categories";export{default as ShippingMethods}from"./resources/shipping_methods";export{default as ShippingZones}from"./resources/shipping_zones";export{default as SkuListItems}from"./resources/sku_list_items";export{default as SkuListPromotionRules}from"./resources/sku_list_promotion_rules";export{default as SkuLists}from"./resources/sku_lists";export{default as SkuOptions}from"./resources/sku_options";export{default as Skus}from"./resources/skus";export{default as StockItems}from"./resources/stock_items";export{default as StockLineItems}from"./resources/stock_line_items";export{default as StockLocations}from"./resources/stock_locations";export{default as StockTransfers}from"./resources/stock_transfers";export{default as StripeGateways}from"./resources/stripe_gateways";export{default as StripePayments}from"./resources/stripe_payments";export{default as TaxCalculators}from"./resources/tax_calculators";export{default as TaxCategories}from"./resources/tax_categories";export{default as TaxRules}from"./resources/tax_rules";export{default as TaxjarAccounts}from"./resources/taxjar_accounts";export{default as Transactions}from"./resources/transactions";export{default as Voids}from"./resources/voids";export{default as Webhooks}from"./resources/webhooks";export{default as WireTransfers}from"./resources/wire_transfers";export const resourceList=["addresses","adjustments","adyen_gateways","adyen_payments","application","attachments","authorizations","avalara_accounts","billing_info_validation_rules","bing_geocoders","braintree_gateways","braintree_payments","bundles","captures","carrier_accounts","checkout_com_gateways","checkout_com_payments","coupon_codes_promotion_rules","coupon_recipients","coupons","customer_addresses","customer_groups","customer_password_resets","customer_payment_sources","customer_subscriptions","customers","delivery_lead_times","event_callbacks","external_gateways","external_payments","external_promotions","external_tax_calculators","fixed_amount_promotions","fixed_price_promotions","free_gift_promotions","free_shipping_promotions","geocoders","gift_card_recipients","gift_cards","google_geocoders","imports","in_stock_subscriptions","inventory_models","inventory_return_locations","inventory_stock_locations","klarna_gateways","klarna_payments","line_item_options","line_items","manual_gateways","manual_tax_calculators","markets","merchants","order_amount_promotion_rules","order_copies","order_subscriptions","order_validation_rules","orders","organization","packages","parcel_line_items","parcels","payment_gateways","payment_methods","paypal_gateways","paypal_payments","percentage_discount_promotions","price_lists","prices","promotion_rules","promotions","refunds","return_line_items","returns","shipments","shipping_categories","shipping_methods","shipping_zones","sku_list_items","sku_list_promotion_rules","sku_lists","sku_options","skus","stock_items","stock_line_items","stock_locations","stock_transfers","stripe_gateways","stripe_payments","tax_calculators","tax_categories","tax_rules","taxjar_accounts","transactions","voids","webhooks","wire_transfers"];
|
1
|
+
export{default as Addresses}from"./resources/addresses";export{default as Adjustments}from"./resources/adjustments";export{default as AdyenGateways}from"./resources/adyen_gateways";export{default as AdyenPayments}from"./resources/adyen_payments";export{default as Applications}from"./resources/application";export{default as Attachments}from"./resources/attachments";export{default as Authorizations}from"./resources/authorizations";export{default as AvalaraAccounts}from"./resources/avalara_accounts";export{default as BillingInfoValidationRules}from"./resources/billing_info_validation_rules";export{default as BingGeocoders}from"./resources/bing_geocoders";export{default as BraintreeGateways}from"./resources/braintree_gateways";export{default as BraintreePayments}from"./resources/braintree_payments";export{default as Bundles}from"./resources/bundles";export{default as Captures}from"./resources/captures";export{default as CarrierAccounts}from"./resources/carrier_accounts";export{default as CheckoutComGateways}from"./resources/checkout_com_gateways";export{default as CheckoutComPayments}from"./resources/checkout_com_payments";export{default as CouponCodesPromotionRules}from"./resources/coupon_codes_promotion_rules";export{default as CouponRecipients}from"./resources/coupon_recipients";export{default as Coupons}from"./resources/coupons";export{default as CustomerAddresses}from"./resources/customer_addresses";export{default as CustomerGroups}from"./resources/customer_groups";export{default as CustomerPasswordResets}from"./resources/customer_password_resets";export{default as CustomerPaymentSources}from"./resources/customer_payment_sources";export{default as CustomerSubscriptions}from"./resources/customer_subscriptions";export{default as Customers}from"./resources/customers";export{default as DeliveryLeadTimes}from"./resources/delivery_lead_times";export{default as EventCallbacks}from"./resources/event_callbacks";export{default as Events}from"./resources/events";export{default as ExternalGateways}from"./resources/external_gateways";export{default as ExternalPayments}from"./resources/external_payments";export{default as ExternalPromotions}from"./resources/external_promotions";export{default as ExternalTaxCalculators}from"./resources/external_tax_calculators";export{default as FixedAmountPromotions}from"./resources/fixed_amount_promotions";export{default as FixedPricePromotions}from"./resources/fixed_price_promotions";export{default as FreeGiftPromotions}from"./resources/free_gift_promotions";export{default as FreeShippingPromotions}from"./resources/free_shipping_promotions";export{default as Geocoders}from"./resources/geocoders";export{default as GiftCardRecipients}from"./resources/gift_card_recipients";export{default as GiftCards}from"./resources/gift_cards";export{default as GoogleGeocoders}from"./resources/google_geocoders";export{default as Imports}from"./resources/imports";export{default as InStockSubscriptions}from"./resources/in_stock_subscriptions";export{default as InventoryModels}from"./resources/inventory_models";export{default as InventoryReturnLocations}from"./resources/inventory_return_locations";export{default as InventoryStockLocations}from"./resources/inventory_stock_locations";export{default as KlarnaGateways}from"./resources/klarna_gateways";export{default as KlarnaPayments}from"./resources/klarna_payments";export{default as LineItemOptions}from"./resources/line_item_options";export{default as LineItems}from"./resources/line_items";export{default as ManualGateways}from"./resources/manual_gateways";export{default as ManualTaxCalculators}from"./resources/manual_tax_calculators";export{default as Markets}from"./resources/markets";export{default as Merchants}from"./resources/merchants";export{default as OrderAmountPromotionRules}from"./resources/order_amount_promotion_rules";export{default as OrderCopies}from"./resources/order_copies";export{default as OrderSubscriptions}from"./resources/order_subscriptions";export{default as OrderValidationRules}from"./resources/order_validation_rules";export{default as Orders}from"./resources/orders";export{default as Organizations}from"./resources/organization";export{default as Packages}from"./resources/packages";export{default as ParcelLineItems}from"./resources/parcel_line_items";export{default as Parcels}from"./resources/parcels";export{default as PaymentGateways}from"./resources/payment_gateways";export{default as PaymentMethods}from"./resources/payment_methods";export{default as PaypalGateways}from"./resources/paypal_gateways";export{default as PaypalPayments}from"./resources/paypal_payments";export{default as PercentageDiscountPromotions}from"./resources/percentage_discount_promotions";export{default as PriceLists}from"./resources/price_lists";export{default as PriceTiers}from"./resources/price_tiers";export{default as PriceVolumeTiers}from"./resources/price_volume_tiers";export{default as Prices}from"./resources/prices";export{default as PromotionRules}from"./resources/promotion_rules";export{default as Promotions}from"./resources/promotions";export{default as Refunds}from"./resources/refunds";export{default as ReturnLineItems}from"./resources/return_line_items";export{default as Returns}from"./resources/returns";export{default as Shipments}from"./resources/shipments";export{default as ShippingCategories}from"./resources/shipping_categories";export{default as ShippingMethodTiers}from"./resources/shipping_method_tiers";export{default as ShippingMethods}from"./resources/shipping_methods";export{default as ShippingWeightTiers}from"./resources/shipping_weight_tiers";export{default as ShippingZones}from"./resources/shipping_zones";export{default as SkuListItems}from"./resources/sku_list_items";export{default as SkuListPromotionRules}from"./resources/sku_list_promotion_rules";export{default as SkuLists}from"./resources/sku_lists";export{default as SkuOptions}from"./resources/sku_options";export{default as Skus}from"./resources/skus";export{default as StockItems}from"./resources/stock_items";export{default as StockLineItems}from"./resources/stock_line_items";export{default as StockLocations}from"./resources/stock_locations";export{default as StockTransfers}from"./resources/stock_transfers";export{default as StripeGateways}from"./resources/stripe_gateways";export{default as StripePayments}from"./resources/stripe_payments";export{default as TaxCalculators}from"./resources/tax_calculators";export{default as TaxCategories}from"./resources/tax_categories";export{default as TaxRules}from"./resources/tax_rules";export{default as TaxjarAccounts}from"./resources/taxjar_accounts";export{default as Transactions}from"./resources/transactions";export{default as Voids}from"./resources/voids";export{default as Webhooks}from"./resources/webhooks";export{default as WireTransfers}from"./resources/wire_transfers";export const resourceList=["addresses","adjustments","adyen_gateways","adyen_payments","application","attachments","authorizations","avalara_accounts","billing_info_validation_rules","bing_geocoders","braintree_gateways","braintree_payments","bundles","captures","carrier_accounts","checkout_com_gateways","checkout_com_payments","coupon_codes_promotion_rules","coupon_recipients","coupons","customer_addresses","customer_groups","customer_password_resets","customer_payment_sources","customer_subscriptions","customers","delivery_lead_times","event_callbacks","events","external_gateways","external_payments","external_promotions","external_tax_calculators","fixed_amount_promotions","fixed_price_promotions","free_gift_promotions","free_shipping_promotions","geocoders","gift_card_recipients","gift_cards","google_geocoders","imports","in_stock_subscriptions","inventory_models","inventory_return_locations","inventory_stock_locations","klarna_gateways","klarna_payments","line_item_options","line_items","manual_gateways","manual_tax_calculators","markets","merchants","order_amount_promotion_rules","order_copies","order_subscriptions","order_validation_rules","orders","organization","packages","parcel_line_items","parcels","payment_gateways","payment_methods","paypal_gateways","paypal_payments","percentage_discount_promotions","price_lists","price_tiers","price_volume_tiers","prices","promotion_rules","promotions","refunds","return_line_items","returns","shipments","shipping_categories","shipping_method_tiers","shipping_methods","shipping_weight_tiers","shipping_zones","sku_list_items","sku_list_promotion_rules","sku_lists","sku_options","skus","stock_items","stock_line_items","stock_locations","stock_transfers","stripe_gateways","stripe_payments","tax_calculators","tax_categories","tax_rules","taxjar_accounts","transactions","voids","webhooks","wire_transfers"];
|
package/lib/esm/client.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var
|
1
|
+
var d=this&&this.__classPrivateFieldSet||function(o,t,e,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?o!==t||!i:!t.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(o,e):i?i.value=e:t.set(o,e),e},a=this&&this.__classPrivateFieldGet||function(o,t,e,r){if(e==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?o!==t||!r:!t.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?r:e==="a"?r.call(o):r?r.value:t.get(o)},s,n;import p from"axios";import{SdkError as T,ApiError as g,ErrorType as c}from"./error";import u from"./config";const f=(o,t)=>`https://${o.toLowerCase()}.${t||u.default.domain}/api`,b=o=>{let t=new T({message:o.message,type:c.GENERIC});if(p.isAxiosError(o))if(o.response){const e=new g(t);e.type=c.RESPONSE,e.status=o.response.status,e.code=String(e.status),e.errors=o.response.data.errors,t=e}else o.request?(t.type=c.REQUEST,t.request=o.request):t.type=c.CLIENT;else p.isCancel(o)?t.type=c.CANCEL:t.source=o;throw t};class m{constructor(t){s.set(this,void 0),n.set(this,void 0),this.baseUrl=f(t.organization,t.domain),d(this,s,t.accessToken,"f");const e={timeout:t.timeout||u.client.timeout};d(this,n,p.create(Object.assign({baseURL:this.baseUrl,timeout:u.client.timeout,headers:{Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json",Authorization:"Bearer "+a(this,s,"f")}},e)),"f"),this.interceptors=a(this,n,"f").interceptors}static create(t){if(!t?.organization)throw new Error("Undefined 'organization' parameter");if(!t?.accessToken)throw new Error("Undefined 'accessToken' parameter");return new m(t)}config(t){const e=a(this,n,"f").defaults;t.timeout&&(e.timeout=t.timeout),t.organization&&(this.baseUrl=f(t.organization,t.domain)),t.accessToken&&(d(this,s,t.accessToken,"f"),e.headers.common.Authorization="Bearer "+a(this,s,"f"))}async request(t,e,r,i){const w=r?{data:r}:void 0,E=e,v=i?.organization?f(i.organization,i.domain):void 0,l=i?.accessToken||a(this,s,"f"),y=l?{Authorization:"Bearer "+l}:void 0;return a(this,n,"f").request(Object.assign({method:t,baseURL:v,url:E,data:w,headers:y},i)).then(h=>h.data).catch(h=>b(h))}}s=new WeakMap,n=new WeakMap;export default m;
|
@@ -36,6 +36,7 @@ declare class CommerceLayerClient {
|
|
36
36
|
customers: api.Customers;
|
37
37
|
delivery_lead_times: api.DeliveryLeadTimes;
|
38
38
|
event_callbacks: api.EventCallbacks;
|
39
|
+
events: api.Events;
|
39
40
|
external_gateways: api.ExternalGateways;
|
40
41
|
external_payments: api.ExternalPayments;
|
41
42
|
external_promotions: api.ExternalPromotions;
|
@@ -76,6 +77,8 @@ declare class CommerceLayerClient {
|
|
76
77
|
paypal_payments: api.PaypalPayments;
|
77
78
|
percentage_discount_promotions: api.PercentageDiscountPromotions;
|
78
79
|
price_lists: api.PriceLists;
|
80
|
+
price_tiers: api.PriceTiers;
|
81
|
+
price_volume_tiers: api.PriceVolumeTiers;
|
79
82
|
prices: api.Prices;
|
80
83
|
promotion_rules: api.PromotionRules;
|
81
84
|
promotions: api.Promotions;
|
@@ -84,7 +87,9 @@ declare class CommerceLayerClient {
|
|
84
87
|
returns: api.Returns;
|
85
88
|
shipments: api.Shipments;
|
86
89
|
shipping_categories: api.ShippingCategories;
|
90
|
+
shipping_method_tiers: api.ShippingMethodTiers;
|
87
91
|
shipping_methods: api.ShippingMethods;
|
92
|
+
shipping_weight_tiers: api.ShippingWeightTiers;
|
88
93
|
shipping_zones: api.ShippingZones;
|
89
94
|
sku_list_items: api.SkuListItems;
|
90
95
|
sku_list_promotion_rules: api.SkuListPromotionRules;
|
package/lib/esm/commercelayer.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var c=this&&this.__classPrivateFieldSet||function(
|
1
|
+
var c=this&&this.__classPrivateFieldSet||function(r,i,n,o,a){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof i=="function"?r!==i||!a:!i.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?a.call(r,n):a?a.value=n:i.set(r,n),n},s=this&&this.__classPrivateFieldGet||function(r,i,n,o){if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof i=="function"?r!==i||!o:!i.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?o:n==="a"?o.call(r):o?o.value:i.get(r)},t,h;import*as e from"./api";import{CommerceLayerStatic as w}from"./static";import f from"./resource";const p="2.9.5";class u{constructor(i){t.set(this,void 0),h.set(this,void 0),c(this,t,new f(i),"f"),c(this,h,i.organization,"f"),this.addresses=new e.Addresses(s(this,t,"f")),this.adjustments=new e.Adjustments(s(this,t,"f")),this.adyen_gateways=new e.AdyenGateways(s(this,t,"f")),this.adyen_payments=new e.AdyenPayments(s(this,t,"f")),this.application=new e.Applications(s(this,t,"f")),this.attachments=new e.Attachments(s(this,t,"f")),this.authorizations=new e.Authorizations(s(this,t,"f")),this.avalara_accounts=new e.AvalaraAccounts(s(this,t,"f")),this.billing_info_validation_rules=new e.BillingInfoValidationRules(s(this,t,"f")),this.bing_geocoders=new e.BingGeocoders(s(this,t,"f")),this.braintree_gateways=new e.BraintreeGateways(s(this,t,"f")),this.braintree_payments=new e.BraintreePayments(s(this,t,"f")),this.bundles=new e.Bundles(s(this,t,"f")),this.captures=new e.Captures(s(this,t,"f")),this.carrier_accounts=new e.CarrierAccounts(s(this,t,"f")),this.checkout_com_gateways=new e.CheckoutComGateways(s(this,t,"f")),this.checkout_com_payments=new e.CheckoutComPayments(s(this,t,"f")),this.coupon_codes_promotion_rules=new e.CouponCodesPromotionRules(s(this,t,"f")),this.coupon_recipients=new e.CouponRecipients(s(this,t,"f")),this.coupons=new e.Coupons(s(this,t,"f")),this.customer_addresses=new e.CustomerAddresses(s(this,t,"f")),this.customer_groups=new e.CustomerGroups(s(this,t,"f")),this.customer_password_resets=new e.CustomerPasswordResets(s(this,t,"f")),this.customer_payment_sources=new e.CustomerPaymentSources(s(this,t,"f")),this.customer_subscriptions=new e.CustomerSubscriptions(s(this,t,"f")),this.customers=new e.Customers(s(this,t,"f")),this.delivery_lead_times=new e.DeliveryLeadTimes(s(this,t,"f")),this.event_callbacks=new e.EventCallbacks(s(this,t,"f")),this.events=new e.Events(s(this,t,"f")),this.external_gateways=new e.ExternalGateways(s(this,t,"f")),this.external_payments=new e.ExternalPayments(s(this,t,"f")),this.external_promotions=new e.ExternalPromotions(s(this,t,"f")),this.external_tax_calculators=new e.ExternalTaxCalculators(s(this,t,"f")),this.fixed_amount_promotions=new e.FixedAmountPromotions(s(this,t,"f")),this.fixed_price_promotions=new e.FixedPricePromotions(s(this,t,"f")),this.free_gift_promotions=new e.FreeGiftPromotions(s(this,t,"f")),this.free_shipping_promotions=new e.FreeShippingPromotions(s(this,t,"f")),this.geocoders=new e.Geocoders(s(this,t,"f")),this.gift_card_recipients=new e.GiftCardRecipients(s(this,t,"f")),this.gift_cards=new e.GiftCards(s(this,t,"f")),this.google_geocoders=new e.GoogleGeocoders(s(this,t,"f")),this.imports=new e.Imports(s(this,t,"f")),this.in_stock_subscriptions=new e.InStockSubscriptions(s(this,t,"f")),this.inventory_models=new e.InventoryModels(s(this,t,"f")),this.inventory_return_locations=new e.InventoryReturnLocations(s(this,t,"f")),this.inventory_stock_locations=new e.InventoryStockLocations(s(this,t,"f")),this.klarna_gateways=new e.KlarnaGateways(s(this,t,"f")),this.klarna_payments=new e.KlarnaPayments(s(this,t,"f")),this.line_item_options=new e.LineItemOptions(s(this,t,"f")),this.line_items=new e.LineItems(s(this,t,"f")),this.manual_gateways=new e.ManualGateways(s(this,t,"f")),this.manual_tax_calculators=new e.ManualTaxCalculators(s(this,t,"f")),this.markets=new e.Markets(s(this,t,"f")),this.merchants=new e.Merchants(s(this,t,"f")),this.order_amount_promotion_rules=new e.OrderAmountPromotionRules(s(this,t,"f")),this.order_copies=new e.OrderCopies(s(this,t,"f")),this.order_subscriptions=new e.OrderSubscriptions(s(this,t,"f")),this.order_validation_rules=new e.OrderValidationRules(s(this,t,"f")),this.orders=new e.Orders(s(this,t,"f")),this.organization=new e.Organizations(s(this,t,"f")),this.packages=new e.Packages(s(this,t,"f")),this.parcel_line_items=new e.ParcelLineItems(s(this,t,"f")),this.parcels=new e.Parcels(s(this,t,"f")),this.payment_gateways=new e.PaymentGateways(s(this,t,"f")),this.payment_methods=new e.PaymentMethods(s(this,t,"f")),this.paypal_gateways=new e.PaypalGateways(s(this,t,"f")),this.paypal_payments=new e.PaypalPayments(s(this,t,"f")),this.percentage_discount_promotions=new e.PercentageDiscountPromotions(s(this,t,"f")),this.price_lists=new e.PriceLists(s(this,t,"f")),this.price_tiers=new e.PriceTiers(s(this,t,"f")),this.price_volume_tiers=new e.PriceVolumeTiers(s(this,t,"f")),this.prices=new e.Prices(s(this,t,"f")),this.promotion_rules=new e.PromotionRules(s(this,t,"f")),this.promotions=new e.Promotions(s(this,t,"f")),this.refunds=new e.Refunds(s(this,t,"f")),this.return_line_items=new e.ReturnLineItems(s(this,t,"f")),this.returns=new e.Returns(s(this,t,"f")),this.shipments=new e.Shipments(s(this,t,"f")),this.shipping_categories=new e.ShippingCategories(s(this,t,"f")),this.shipping_method_tiers=new e.ShippingMethodTiers(s(this,t,"f")),this.shipping_methods=new e.ShippingMethods(s(this,t,"f")),this.shipping_weight_tiers=new e.ShippingWeightTiers(s(this,t,"f")),this.shipping_zones=new e.ShippingZones(s(this,t,"f")),this.sku_list_items=new e.SkuListItems(s(this,t,"f")),this.sku_list_promotion_rules=new e.SkuListPromotionRules(s(this,t,"f")),this.sku_lists=new e.SkuLists(s(this,t,"f")),this.sku_options=new e.SkuOptions(s(this,t,"f")),this.skus=new e.Skus(s(this,t,"f")),this.stock_items=new e.StockItems(s(this,t,"f")),this.stock_line_items=new e.StockLineItems(s(this,t,"f")),this.stock_locations=new e.StockLocations(s(this,t,"f")),this.stock_transfers=new e.StockTransfers(s(this,t,"f")),this.stripe_gateways=new e.StripeGateways(s(this,t,"f")),this.stripe_payments=new e.StripePayments(s(this,t,"f")),this.tax_calculators=new e.TaxCalculators(s(this,t,"f")),this.tax_categories=new e.TaxCategories(s(this,t,"f")),this.tax_rules=new e.TaxRules(s(this,t,"f")),this.taxjar_accounts=new e.TaxjarAccounts(s(this,t,"f")),this.transactions=new e.Transactions(s(this,t,"f")),this.voids=new e.Voids(s(this,t,"f")),this.webhooks=new e.Webhooks(s(this,t,"f")),this.wire_transfers=new e.WireTransfers(s(this,t,"f"))}static get openApiSchemaVersion(){return p}get currentOrganization(){return s(this,h,"f")}config(i){i.organization&&c(this,h,i.organization,"f"),s(this,t,"f").config(i)}resources(){return w.resources()}isApiError(i){return w.isApiError(i)}addRequestInterceptor(i,n){return s(this,t,"f").interceptors.request.use(i,n)}addResponseInterceptor(i,n){return s(this,t,"f").interceptors.response.use(i,n)}removeInterceptor(i,n){return s(this,t,"f").interceptors[i].eject(n)}addRawResponseReader(){const i={id:void 0,rawResponse:void 0};function n(a){return i.rawResponse=a?.data,a}const o=this.addResponseInterceptor(n);return i.id=o,i}removeRawResponseReader(i){const n=typeof i=="number"?i:i.id;if(n)return this.removeInterceptor("response",n)}}t=new WeakMap,h=new WeakMap;const m=r=>new u(r);export default m;
|
package/lib/esm/config.d.ts
CHANGED
package/lib/esm/config.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
const e={default:{domain:"commercelayer.io",pageNumber:1,pageSize:10},client:{timeout:
|
1
|
+
const e={default:{domain:"commercelayer.io",pageNumber:1,pageSize:10},client:{timeout:15e3}};export default e;
|
package/lib/esm/error.d.ts
CHANGED
@@ -1 +1,26 @@
|
|
1
|
-
declare enum ErrorType
|
1
|
+
declare enum ErrorType {
|
2
|
+
CLIENT = "client",
|
3
|
+
REQUEST = "request",
|
4
|
+
RESPONSE = "response",
|
5
|
+
GENERIC = "generic",
|
6
|
+
CANCEL = "cancel"
|
7
|
+
}
|
8
|
+
declare class SdkError extends Error {
|
9
|
+
static isSdkError(error: any): error is ApiError;
|
10
|
+
type: string;
|
11
|
+
code?: string;
|
12
|
+
source?: Error;
|
13
|
+
request?: any;
|
14
|
+
constructor(error: {
|
15
|
+
message: string;
|
16
|
+
type?: ErrorType;
|
17
|
+
});
|
18
|
+
}
|
19
|
+
declare class ApiError extends SdkError {
|
20
|
+
static isApiError(error: any): error is ApiError;
|
21
|
+
errors: any[];
|
22
|
+
status?: number;
|
23
|
+
constructor(error: SdkError);
|
24
|
+
first(): any;
|
25
|
+
}
|
26
|
+
export { SdkError, ApiError, ErrorType };
|
package/lib/esm/error.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var
|
1
|
+
var s;(function(e){e.CLIENT="client",e.REQUEST="request",e.RESPONSE="response",e.GENERIC="generic",e.CANCEL="cancel"})(s||(s={}));class t extends Error{constructor(r){super(r.message),this.name=this.constructor.name,this.type=r.type||s.GENERIC}static isSdkError(r){return r&&["SdkError","ApiError"].includes(r.name)&&Object.values(s).includes(r.type)}}class i extends t{constructor(r){super(Object.assign(Object.assign({},r),{type:s.RESPONSE})),this.errors=[],this.name=this.constructor.name}static isApiError(r){return t.isSdkError(r)&&r.name==="ApiError"&&r.type===s.RESPONSE}first(){var r;return((r=this.errors)===null||r===void 0?void 0:r.length)>0?this.errors[0]:void 0}}export{t as SdkError,i as ApiError,s as ErrorType};
|
package/lib/esm/interceptor.d.ts
CHANGED
@@ -1 +1,19 @@
|
|
1
|
-
import{AxiosError,AxiosInterceptorManager,AxiosRequestConfig,AxiosResponse}from"axios";
|
1
|
+
import { AxiosError, AxiosInterceptorManager, AxiosRequestConfig, AxiosResponse } from "axios";
|
2
|
+
declare type InterceptorManager = {
|
3
|
+
request: AxiosInterceptorManager<AxiosRequestConfig>;
|
4
|
+
response: AxiosInterceptorManager<any>;
|
5
|
+
};
|
6
|
+
declare type RequestObj = AxiosRequestConfig;
|
7
|
+
declare type RequestInterceptor = (request: RequestObj) => RequestObj | Promise<RequestObj>;
|
8
|
+
declare type ResponseObj = AxiosResponse;
|
9
|
+
declare type ResponseInterceptor = (response: ResponseObj) => ResponseObj;
|
10
|
+
declare type ErrorObj = AxiosError;
|
11
|
+
declare type ErrorInterceptor = (error: ErrorObj) => ErrorObj;
|
12
|
+
declare type InterceptorType = 'request' | 'response';
|
13
|
+
export type { InterceptorManager, RequestInterceptor, ResponseInterceptor, ErrorInterceptor, InterceptorType };
|
14
|
+
export type { RequestObj, ResponseObj, ErrorObj };
|
15
|
+
declare type RawResponseReader = {
|
16
|
+
id: number | undefined;
|
17
|
+
rawResponse: ResponseObj | undefined;
|
18
|
+
};
|
19
|
+
export type { RawResponseReader };
|
package/lib/esm/jsonapi.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
import{isResourceId as
|
1
|
+
import{isResourceId as i,isResourceType as d}from"./common";const c=t=>{let r;t.links&&delete t.links;const s=t.data,a=t.included;return Array.isArray(s)?r=s.map(e=>o(e,a)):r=o(s,a),r},l=(t,r=[])=>r.find(s=>t.id===s.id&&t.type===s.type)||t,o=(t,r)=>{const s=Object.assign({id:t.id,type:t.type},t.attributes);return t.relationships&&Object.keys(t.relationships).forEach(a=>{const e=t.relationships[a].data;e?Array.isArray(e)?s[a]=e.map(n=>o(l(n,r),r)):s[a]=o(l(e,r),r):e===null&&(s[a]=null)}),s},p=t=>{const r={},s={};for(const e in t){if(["type","id"].includes(e))continue;const n=t[e];n&&d(n)&&n.id===null?s[e]={data:null}:n&&(i(n)||Array.isArray(n)&&i(n[0]))?s[e]={data:n}:r[e]=n}const a={type:t.type,attributes:r,relationships:s};return i(t)&&(a.id=t.id),a};export{c as denormalize,p as normalize};
|
package/lib/esm/model.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/**
|
2
2
|
* ©2022 Commerce Layer Inc.
|
3
|
-
* OpenAPI schema, version 2.9.
|
3
|
+
* OpenAPI schema, version 2.9.5
|
4
4
|
**/
|
5
5
|
export type { Address, AddressCreate, AddressUpdate } from './resources/addresses';
|
6
6
|
export type { Adjustment, AdjustmentCreate, AdjustmentUpdate } from './resources/adjustments';
|
@@ -30,6 +30,7 @@ export type { CustomerSubscription, CustomerSubscriptionCreate, CustomerSubscrip
|
|
30
30
|
export type { Customer, CustomerCreate, CustomerUpdate } from './resources/customers';
|
31
31
|
export type { DeliveryLeadTime, DeliveryLeadTimeCreate, DeliveryLeadTimeUpdate } from './resources/delivery_lead_times';
|
32
32
|
export type { EventCallback } from './resources/event_callbacks';
|
33
|
+
export type { Event } from './resources/events';
|
33
34
|
export type { ExternalGateway, ExternalGatewayCreate, ExternalGatewayUpdate } from './resources/external_gateways';
|
34
35
|
export type { ExternalPayment, ExternalPaymentCreate, ExternalPaymentUpdate } from './resources/external_payments';
|
35
36
|
export type { ExternalPromotion, ExternalPromotionCreate, ExternalPromotionUpdate } from './resources/external_promotions';
|
@@ -70,6 +71,8 @@ export type { PaypalGateway, PaypalGatewayCreate, PaypalGatewayUpdate } from './
|
|
70
71
|
export type { PaypalPayment, PaypalPaymentCreate, PaypalPaymentUpdate } from './resources/paypal_payments';
|
71
72
|
export type { PercentageDiscountPromotion, PercentageDiscountPromotionCreate, PercentageDiscountPromotionUpdate } from './resources/percentage_discount_promotions';
|
72
73
|
export type { PriceList, PriceListCreate, PriceListUpdate } from './resources/price_lists';
|
74
|
+
export type { PriceTier } from './resources/price_tiers';
|
75
|
+
export type { PriceVolumeTier, PriceVolumeTierCreate, PriceVolumeTierUpdate } from './resources/price_volume_tiers';
|
73
76
|
export type { Price, PriceCreate, PriceUpdate } from './resources/prices';
|
74
77
|
export type { PromotionRule } from './resources/promotion_rules';
|
75
78
|
export type { Promotion } from './resources/promotions';
|
@@ -78,7 +81,9 @@ export type { ReturnLineItem, ReturnLineItemCreate, ReturnLineItemUpdate } from
|
|
78
81
|
export type { Return, ReturnCreate, ReturnUpdate } from './resources/returns';
|
79
82
|
export type { Shipment, ShipmentUpdate } from './resources/shipments';
|
80
83
|
export type { ShippingCategory, ShippingCategoryCreate, ShippingCategoryUpdate } from './resources/shipping_categories';
|
84
|
+
export type { ShippingMethodTier } from './resources/shipping_method_tiers';
|
81
85
|
export type { ShippingMethod, ShippingMethodCreate, ShippingMethodUpdate } from './resources/shipping_methods';
|
86
|
+
export type { ShippingWeightTier, ShippingWeightTierCreate, ShippingWeightTierUpdate } from './resources/shipping_weight_tiers';
|
82
87
|
export type { ShippingZone, ShippingZoneCreate, ShippingZoneUpdate } from './resources/shipping_zones';
|
83
88
|
export type { SkuListItem, SkuListItemCreate, SkuListItemUpdate } from './resources/sku_list_items';
|
84
89
|
export type { SkuListPromotionRule, SkuListPromotionRuleCreate, SkuListPromotionRuleUpdate } from './resources/sku_list_promotion_rules';
|
package/lib/esm/resource.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var w=this&&this.__classPrivateFieldSet||function(s,t,a,e,r){if(e==="m")throw new TypeError("Private method is not writable");if(e==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?s!==t||!r:!t.has(s))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e==="a"?r.call(s,a):r?r.value=a:t.set(s,a),a},d=this&&this.__classPrivateFieldGet||function(s,t,a,e){if(a==="a"&&!e)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?s!==t||!e:!t.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return a==="m"?e:a==="a"?e.call(s):e?e.value:t.get(s)},n,h;import y from"./client";import{denormalize as u,normalize as g}from"./jsonapi";import{generateQueryStringParams as o}from"./query";import m from"./config";class b extends Array{constructor(t,a){super(...a||[])
|
1
|
+
var w=this&&this.__classPrivateFieldSet||function(s,t,a,e,r){if(e==="m")throw new TypeError("Private method is not writable");if(e==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?s!==t||!r:!t.has(s))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e==="a"?r.call(s,a):r?r.value=a:t.set(s,a),a},d=this&&this.__classPrivateFieldGet||function(s,t,a,e){if(a==="a"&&!e)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?s!==t||!e:!t.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return a==="m"?e:a==="a"?e.call(s):e?e.value:t.get(s)},n,h;import y from"./client";import{denormalize as u,normalize as g}from"./jsonapi";import{generateQueryStringParams as o}from"./query";import m from"./config";class b extends Array{constructor(t,a){super(...a||[]),this.meta=t}first(){return this.length?this[0]:void 0}last(){return this.length?this[this.length-1]:void 0}get(t){return this.length&&t>=0?this[t]:void 0}}class p{constructor(t){n.set(this,void 0),h.set(this,{}),w(this,n,y.create(t),"f"),this.config(t)}get interceptors(){return d(this,n,"f").interceptors}config(t){d(this,n,"f").config(t)}async singleton(t,a,e){const r=o(a,t);e?.params&&Object.assign(r,e?.params);const i=await d(this,n,"f").request("get",`${t.type}`,void 0,Object.assign(Object.assign({},e),{params:r}));return u(i)}async retrieve(t,a,e){const r=o(a,t);e?.params&&Object.assign(r,e?.params);const i=await d(this,n,"f").request("get",`${t.type}/${t.id}`,void 0,Object.assign(Object.assign({},e),{params:r}));return u(i)}async list(t,a,e){var r,i;const c=o(a,t);e?.params&&Object.assign(c,e?.params);const l=await d(this,n,"f").request("get",`${t.type}`,void 0,Object.assign(Object.assign({},e),{params:c})),f=u(l),v={pageCount:Number((r=l.meta)===null||r===void 0?void 0:r.page_count),recordCount:Number((i=l.meta)===null||i===void 0?void 0:i.record_count),currentPage:a?.pageNumber||m.default.pageNumber,recordsPerPage:a?.pageSize||m.default.pageSize};return new b(v,f)}async create(t,a,e){const r=o(a,t);e?.params&&Object.assign(r,e?.params);const i=g(t),c=await d(this,n,"f").request("post",t.type,i,Object.assign(Object.assign({},e),{params:r}));return u(c)}async update(t,a,e){const r=o(a,t);e?.params&&Object.assign(r,e?.params);const i=g(t),c=await d(this,n,"f").request("patch",`${t.type}/${t.id}`,i,Object.assign(Object.assign({},e),{params:r}));return u(c)}async delete(t,a){await d(this,n,"f").request("delete",`${t.type}/${t.id}`,void 0,a)}}n=new WeakMap,h=new WeakMap;class j{constructor(t){this.resources=t}}export default p;export{j as ApiResource};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as i}from"../resource";class s extends i{async list(e,t){return this.resources.list({type:s.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:s.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:s.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:s.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:s.TYPE,id:e},t)}isAddress(e){return e.type&&e.type===s.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:s.TYPE}:{id:e.id,type:s.TYPE}}type(){return s.TYPE}}s.TYPE="addresses";export default s;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as i}from"../resource";class t extends i{async list(e,s){return this.resources.list({type:t.TYPE},e,s)}async create(e,s,r){return this.resources.create(Object.assign(Object.assign({},e),{type:t.TYPE}),s,r)}async retrieve(e,s,r){return this.resources.retrieve({type:t.TYPE,id:e},s,r)}async update(e,s,r){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),s,r)}async delete(e,s){await this.resources.delete({type:t.TYPE,id:e},s)}isAdjustment(e){return e.type&&e.type===t.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="adjustments";export default t;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class
|
1
|
+
import{ApiResource as i}from"../resource";class s extends i{async list(e,t){return this.resources.list({type:s.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:s.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:s.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:s.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:s.TYPE,id:e},t)}isAdyenGateway(e){return e.type&&e.type===s.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:s.TYPE}:{id:e.id,type:s.TYPE}}type(){return s.TYPE}}s.TYPE="adyen_gateways";export default s;
|
@@ -13,6 +13,7 @@ interface AvalaraAccount extends Resource {
|
|
13
13
|
name?: string;
|
14
14
|
username?: string;
|
15
15
|
company_code?: string;
|
16
|
+
commit_invoice?: string;
|
16
17
|
ddp?: string;
|
17
18
|
tax_categories?: TaxCategory[];
|
18
19
|
markets?: Market[];
|
@@ -23,6 +24,7 @@ interface AvalaraAccountCreate extends ResourceCreate {
|
|
23
24
|
username: string;
|
24
25
|
password: string;
|
25
26
|
company_code: string;
|
27
|
+
commit_invoice?: string;
|
26
28
|
ddp?: string;
|
27
29
|
tax_categories?: TaxCategoryRel[];
|
28
30
|
}
|
@@ -31,6 +33,7 @@ interface AvalaraAccountUpdate extends ResourceUpdate {
|
|
31
33
|
username?: string;
|
32
34
|
password?: string;
|
33
35
|
company_code?: string;
|
36
|
+
commit_invoice?: string;
|
34
37
|
ddp?: string;
|
35
38
|
tax_categories?: TaxCategoryRel[];
|
36
39
|
}
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as a}from"../resource";class s extends a{async list(e,r){return this.resources.list({type:s.TYPE},e,r)}async create(e,r,t){return this.resources.create(Object.assign(Object.assign({},e),{type:s.TYPE}),r,t)}async retrieve(e,r,t){return this.resources.retrieve({type:s.TYPE,id:e},r,t)}async update(e,r,t){return this.resources.update(Object.assign(Object.assign({},e),{type:s.TYPE}),r,t)}async delete(e,r){await this.resources.delete({type:s.TYPE,id:e},r)}isAvalaraAccount(e){return e.type&&e.type===s.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:s.TYPE}:{id:e.id,type:s.TYPE}}type(){return s.TYPE}}s.TYPE="avalara_accounts";export default s;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as i}from"../resource";class s extends i{async list(e,t){return this.resources.list({type:s.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:s.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:s.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:s.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:s.TYPE,id:e},t)}isBillingInfoValidationRule(e){return e.type&&e.type===s.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:s.TYPE}:{id:e.id,type:s.TYPE}}type(){return s.TYPE}}s.TYPE="billing_info_validation_rules";export default s;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as i}from"../resource";class t extends i{async list(e,s){return this.resources.list({type:t.TYPE},e,s)}async create(e,s,r){return this.resources.create(Object.assign(Object.assign({},e),{type:t.TYPE}),s,r)}async retrieve(e,s,r){return this.resources.retrieve({type:t.TYPE,id:e},s,r)}async update(e,s,r){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),s,r)}async delete(e,s){await this.resources.delete({type:t.TYPE,id:e},s)}isBingGeocoder(e){return e.type&&e.type===t.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="bing_geocoders";export default t;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as i}from"../resource";class r extends i{async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,s){return this.resources.create(Object.assign(Object.assign({},e),{type:r.TYPE}),t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:r.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update(Object.assign(Object.assign({},e),{type:r.TYPE}),t,s)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}isBraintreeGateway(e){return e.type&&e.type===r.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:r.TYPE}:{id:e.id,type:r.TYPE}}type(){return r.TYPE}}r.TYPE="braintree_gateways";export default r;
|
@@ -19,6 +19,8 @@ interface Bundle extends Resource {
|
|
19
19
|
currency_code?: string;
|
20
20
|
description?: string;
|
21
21
|
image_url?: string;
|
22
|
+
do_not_ship?: boolean;
|
23
|
+
do_not_track?: boolean;
|
22
24
|
price_amount_cents?: number;
|
23
25
|
price_amount_float?: number;
|
24
26
|
formatted_price_amount?: string;
|
@@ -37,6 +39,8 @@ interface BundleCreate extends ResourceCreate {
|
|
37
39
|
currency_code?: string;
|
38
40
|
description?: string;
|
39
41
|
image_url?: string;
|
42
|
+
do_not_ship?: boolean;
|
43
|
+
do_not_track?: boolean;
|
40
44
|
price_amount_cents: number;
|
41
45
|
compare_at_amount_cents: number;
|
42
46
|
_compute_price_amount?: boolean;
|
@@ -50,6 +54,8 @@ interface BundleUpdate extends ResourceUpdate {
|
|
50
54
|
currency_code?: string;
|
51
55
|
description?: string;
|
52
56
|
image_url?: string;
|
57
|
+
do_not_ship?: boolean;
|
58
|
+
do_not_track?: boolean;
|
53
59
|
price_amount_cents?: number;
|
54
60
|
compare_at_amount_cents?: number;
|
55
61
|
_compute_price_amount?: boolean;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class
|
1
|
+
import{ApiResource as i}from"../resource";class s extends i{async list(e,r){return this.resources.list({type:s.TYPE},e,r)}async create(e,r,t){return this.resources.create(Object.assign(Object.assign({},e),{type:s.TYPE}),r,t)}async retrieve(e,r,t){return this.resources.retrieve({type:s.TYPE,id:e},r,t)}async update(e,r,t){return this.resources.update(Object.assign(Object.assign({},e),{type:s.TYPE}),r,t)}async delete(e,r){await this.resources.delete({type:s.TYPE,id:e},r)}isBundle(e){return e.type&&e.type===s.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:s.TYPE}:{id:e.id,type:s.TYPE}}type(){return s.TYPE}}s.TYPE="bundles";export default s;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as i}from"../resource";class e extends i{async list(r,t){return this.resources.list({type:e.TYPE},r,t)}async retrieve(r,t,s){return this.resources.retrieve({type:e.TYPE,id:r},t,s)}isCarrierAccount(r){return r.type&&r.type===e.TYPE}relationship(r){return r===null||typeof r=="string"?{id:r,type:e.TYPE}:{id:r.id,type:e.TYPE}}type(){return e.TYPE}}e.TYPE="carrier_accounts";export default e;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as i}from"../resource";class t extends i{async list(e,s){return this.resources.list({type:t.TYPE},e,s)}async create(e,s,r){return this.resources.create(Object.assign(Object.assign({},e),{type:t.TYPE}),s,r)}async retrieve(e,s,r){return this.resources.retrieve({type:t.TYPE,id:e},s,r)}async update(e,s,r){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),s,r)}async delete(e,s){await this.resources.delete({type:t.TYPE,id:e},s)}isCheckoutComGateway(e){return e.type&&e.type===t.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="checkout_com_gateways";export default t;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as i}from"../resource";class s extends i{async list(e,r){return this.resources.list({type:s.TYPE},e,r)}async create(e,r,t){return this.resources.create(Object.assign(Object.assign({},e),{type:s.TYPE}),r,t)}async retrieve(e,r,t){return this.resources.retrieve({type:s.TYPE,id:e},r,t)}async update(e,r,t){return this.resources.update(Object.assign(Object.assign({},e),{type:s.TYPE}),r,t)}async delete(e,r){await this.resources.delete({type:s.TYPE,id:e},r)}isCouponCodesPromotionRule(e){return e.type&&e.type===s.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:s.TYPE}:{id:e.id,type:s.TYPE}}type(){return s.TYPE}}s.TYPE="coupon_codes_promotion_rules";export default s;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class
|
1
|
+
import{ApiResource as i}from"../resource";class s extends i{async list(e,r){return this.resources.list({type:s.TYPE},e,r)}async create(e,r,t){return this.resources.create(Object.assign(Object.assign({},e),{type:s.TYPE}),r,t)}async retrieve(e,r,t){return this.resources.retrieve({type:s.TYPE,id:e},r,t)}async update(e,r,t){return this.resources.update(Object.assign(Object.assign({},e),{type:s.TYPE}),r,t)}async delete(e,r){await this.resources.delete({type:s.TYPE,id:e},r)}isCoupon(e){return e.type&&e.type===s.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:s.TYPE}:{id:e.id,type:s.TYPE}}type(){return s.TYPE}}s.TYPE="coupons";export default s;
|
@@ -2,6 +2,7 @@ import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig,
|
|
2
2
|
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
3
|
import { Customer } from './customers';
|
4
4
|
import { Address } from './addresses';
|
5
|
+
import { Event } from './events';
|
5
6
|
declare type CustomerAddressRel = ResourceRel & {
|
6
7
|
type: typeof CustomerAddresses.TYPE;
|
7
8
|
};
|
@@ -15,6 +16,7 @@ interface CustomerAddress extends Resource {
|
|
15
16
|
name?: string;
|
16
17
|
customer?: Customer;
|
17
18
|
address?: Address;
|
19
|
+
events?: Event[];
|
18
20
|
}
|
19
21
|
interface CustomerAddressCreate extends ResourceCreate {
|
20
22
|
customer: CustomerRel;
|