@commercelayer/sdk 5.35.0 → 6.0.0-alfa.10
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 +41 -75
- package/lib/cjs/commercelayer.d.ts +126 -125
- package/lib/cjs/commercelayer.js +267 -155
- package/lib/cjs/common.js +1 -12
- package/lib/cjs/config.js +0 -2
- package/lib/cjs/debug.js +0 -21
- package/lib/cjs/error.d.ts +6 -7
- package/lib/cjs/error.js +36 -35
- 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 +22 -10
- package/lib/cjs/jsonapi.js +0 -2
- package/lib/cjs/model.d.ts +0 -3
- package/lib/cjs/model.js +0 -1
- package/lib/cjs/query.d.ts +2 -1
- package/lib/cjs/query.js +8 -7
- package/lib/cjs/resource.d.ts +2 -5
- package/lib/cjs/resource.js +32 -58
- 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 +1 -0
- package/lib/cjs/resources/events.js +4 -1
- 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 +1 -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 +1 -0
- package/lib/cjs/resources/shipments.js +4 -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 +43 -90
- package/lib/esm/commercelayer.d.ts +126 -125
- package/lib/esm/commercelayer.js +270 -171
- package/lib/esm/common.js +1 -12
- package/lib/esm/config.js +0 -2
- package/lib/esm/debug.js +0 -21
- package/lib/esm/error.d.ts +6 -7
- package/lib/esm/error.js +44 -35
- 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 +22 -10
- package/lib/esm/jsonapi.js +0 -2
- package/lib/esm/model.d.ts +0 -3
- package/lib/esm/model.js +0 -1
- package/lib/esm/query.d.ts +2 -1
- package/lib/esm/query.js +7 -7
- package/lib/esm/resource.d.ts +2 -5
- package/lib/esm/resource.js +40 -76
- package/lib/esm/resources/addresses.d.ts +1 -0
- package/lib/esm/resources/addresses.js +5 -2
- package/lib/esm/resources/adjustments.d.ts +1 -0
- package/lib/esm/resources/adjustments.js +5 -2
- package/lib/esm/resources/adyen_gateways.d.ts +1 -0
- package/lib/esm/resources/adyen_gateways.js +5 -2
- package/lib/esm/resources/adyen_payments.d.ts +1 -0
- package/lib/esm/resources/adyen_payments.js +5 -2
- package/lib/esm/resources/application.d.ts +1 -0
- package/lib/esm/resources/application.js +5 -2
- package/lib/esm/resources/attachments.d.ts +1 -0
- package/lib/esm/resources/attachments.js +5 -2
- package/lib/esm/resources/authorizations.d.ts +1 -0
- package/lib/esm/resources/authorizations.js +5 -2
- package/lib/esm/resources/avalara_accounts.d.ts +1 -0
- package/lib/esm/resources/avalara_accounts.js +5 -2
- package/lib/esm/resources/axerve_gateways.d.ts +1 -0
- package/lib/esm/resources/axerve_gateways.js +5 -2
- package/lib/esm/resources/axerve_payments.d.ts +1 -0
- package/lib/esm/resources/axerve_payments.js +5 -2
- package/lib/esm/resources/billing_info_validation_rules.d.ts +1 -0
- package/lib/esm/resources/billing_info_validation_rules.js +5 -2
- package/lib/esm/resources/bing_geocoders.d.ts +1 -0
- package/lib/esm/resources/bing_geocoders.js +5 -2
- package/lib/esm/resources/braintree_gateways.d.ts +1 -0
- package/lib/esm/resources/braintree_gateways.js +5 -2
- package/lib/esm/resources/braintree_payments.d.ts +1 -0
- package/lib/esm/resources/braintree_payments.js +5 -2
- package/lib/esm/resources/bundles.d.ts +1 -0
- package/lib/esm/resources/bundles.js +5 -2
- package/lib/esm/resources/buy_x_pay_y_promotions.d.ts +1 -0
- package/lib/esm/resources/buy_x_pay_y_promotions.js +5 -2
- package/lib/esm/resources/captures.d.ts +1 -0
- package/lib/esm/resources/captures.js +5 -2
- package/lib/esm/resources/carrier_accounts.d.ts +1 -0
- package/lib/esm/resources/carrier_accounts.js +5 -2
- package/lib/esm/resources/checkout_com_gateways.d.ts +1 -0
- package/lib/esm/resources/checkout_com_gateways.js +5 -2
- package/lib/esm/resources/checkout_com_payments.d.ts +1 -0
- package/lib/esm/resources/checkout_com_payments.js +5 -2
- package/lib/esm/resources/cleanups.d.ts +1 -0
- package/lib/esm/resources/cleanups.js +5 -2
- package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +1 -0
- package/lib/esm/resources/coupon_codes_promotion_rules.js +5 -2
- package/lib/esm/resources/coupon_recipients.d.ts +1 -0
- package/lib/esm/resources/coupon_recipients.js +5 -2
- package/lib/esm/resources/coupons.d.ts +1 -0
- package/lib/esm/resources/coupons.js +5 -2
- package/lib/esm/resources/custom_promotion_rules.d.ts +1 -0
- package/lib/esm/resources/custom_promotion_rules.js +5 -2
- package/lib/esm/resources/customer_addresses.d.ts +1 -0
- package/lib/esm/resources/customer_addresses.js +5 -2
- package/lib/esm/resources/customer_groups.d.ts +1 -0
- package/lib/esm/resources/customer_groups.js +5 -2
- package/lib/esm/resources/customer_password_resets.d.ts +1 -0
- package/lib/esm/resources/customer_password_resets.js +5 -2
- package/lib/esm/resources/customer_payment_sources.d.ts +1 -0
- package/lib/esm/resources/customer_payment_sources.js +5 -2
- package/lib/esm/resources/customer_subscriptions.d.ts +1 -0
- package/lib/esm/resources/customer_subscriptions.js +5 -2
- package/lib/esm/resources/customers.d.ts +1 -0
- package/lib/esm/resources/customers.js +5 -2
- package/lib/esm/resources/delivery_lead_times.d.ts +1 -0
- package/lib/esm/resources/delivery_lead_times.js +5 -2
- package/lib/esm/resources/event_callbacks.d.ts +1 -0
- package/lib/esm/resources/event_callbacks.js +5 -2
- package/lib/esm/resources/events.d.ts +1 -0
- package/lib/esm/resources/events.js +5 -2
- package/lib/esm/resources/exports.d.ts +1 -0
- package/lib/esm/resources/exports.js +5 -2
- package/lib/esm/resources/external_gateways.d.ts +1 -0
- package/lib/esm/resources/external_gateways.js +5 -2
- package/lib/esm/resources/external_payments.d.ts +1 -0
- package/lib/esm/resources/external_payments.js +5 -2
- package/lib/esm/resources/external_promotions.d.ts +1 -0
- package/lib/esm/resources/external_promotions.js +5 -2
- package/lib/esm/resources/external_tax_calculators.d.ts +1 -0
- package/lib/esm/resources/external_tax_calculators.js +5 -2
- package/lib/esm/resources/fixed_amount_promotions.d.ts +1 -0
- package/lib/esm/resources/fixed_amount_promotions.js +5 -2
- package/lib/esm/resources/fixed_price_promotions.d.ts +1 -0
- package/lib/esm/resources/fixed_price_promotions.js +5 -2
- package/lib/esm/resources/free_gift_promotions.d.ts +1 -0
- package/lib/esm/resources/free_gift_promotions.js +5 -2
- package/lib/esm/resources/free_shipping_promotions.d.ts +1 -0
- package/lib/esm/resources/free_shipping_promotions.js +5 -2
- package/lib/esm/resources/geocoders.d.ts +1 -0
- package/lib/esm/resources/geocoders.js +5 -2
- package/lib/esm/resources/gift_card_recipients.d.ts +1 -0
- package/lib/esm/resources/gift_card_recipients.js +5 -2
- package/lib/esm/resources/gift_cards.d.ts +1 -0
- package/lib/esm/resources/gift_cards.js +5 -2
- package/lib/esm/resources/google_geocoders.d.ts +1 -0
- package/lib/esm/resources/google_geocoders.js +5 -2
- package/lib/esm/resources/imports.d.ts +1 -0
- package/lib/esm/resources/imports.js +5 -2
- package/lib/esm/resources/in_stock_subscriptions.d.ts +1 -0
- package/lib/esm/resources/in_stock_subscriptions.js +5 -2
- package/lib/esm/resources/inventory_models.d.ts +1 -0
- package/lib/esm/resources/inventory_models.js +5 -2
- package/lib/esm/resources/inventory_return_locations.d.ts +1 -0
- package/lib/esm/resources/inventory_return_locations.js +5 -2
- package/lib/esm/resources/inventory_stock_locations.d.ts +1 -0
- package/lib/esm/resources/inventory_stock_locations.js +5 -2
- package/lib/esm/resources/klarna_gateways.d.ts +1 -0
- package/lib/esm/resources/klarna_gateways.js +5 -2
- package/lib/esm/resources/klarna_payments.d.ts +1 -0
- package/lib/esm/resources/klarna_payments.js +5 -2
- package/lib/esm/resources/line_item_options.d.ts +1 -0
- package/lib/esm/resources/line_item_options.js +5 -2
- package/lib/esm/resources/line_items.d.ts +1 -0
- package/lib/esm/resources/line_items.js +5 -2
- package/lib/esm/resources/manual_gateways.d.ts +1 -0
- package/lib/esm/resources/manual_gateways.js +5 -2
- package/lib/esm/resources/manual_tax_calculators.d.ts +1 -0
- package/lib/esm/resources/manual_tax_calculators.js +5 -2
- package/lib/esm/resources/markets.d.ts +1 -0
- package/lib/esm/resources/markets.js +5 -2
- package/lib/esm/resources/merchants.d.ts +1 -0
- package/lib/esm/resources/merchants.js +5 -2
- package/lib/esm/resources/order_amount_promotion_rules.d.ts +1 -0
- package/lib/esm/resources/order_amount_promotion_rules.js +5 -2
- package/lib/esm/resources/order_copies.d.ts +1 -0
- package/lib/esm/resources/order_copies.js +5 -2
- package/lib/esm/resources/order_factories.d.ts +1 -0
- package/lib/esm/resources/order_factories.js +5 -2
- package/lib/esm/resources/order_subscription_items.d.ts +1 -0
- package/lib/esm/resources/order_subscription_items.js +5 -2
- package/lib/esm/resources/order_subscriptions.d.ts +1 -0
- package/lib/esm/resources/order_subscriptions.js +5 -2
- package/lib/esm/resources/order_validation_rules.d.ts +1 -0
- package/lib/esm/resources/order_validation_rules.js +5 -2
- package/lib/esm/resources/orders.d.ts +1 -0
- package/lib/esm/resources/orders.js +5 -2
- package/lib/esm/resources/organization.d.ts +1 -0
- package/lib/esm/resources/organization.js +5 -2
- package/lib/esm/resources/packages.d.ts +1 -0
- package/lib/esm/resources/packages.js +5 -2
- package/lib/esm/resources/parcel_line_items.d.ts +1 -0
- package/lib/esm/resources/parcel_line_items.js +5 -2
- package/lib/esm/resources/parcels.d.ts +1 -0
- package/lib/esm/resources/parcels.js +5 -2
- package/lib/esm/resources/payment_gateways.d.ts +1 -0
- package/lib/esm/resources/payment_gateways.js +5 -2
- package/lib/esm/resources/payment_methods.d.ts +1 -0
- package/lib/esm/resources/payment_methods.js +5 -2
- package/lib/esm/resources/payment_options.d.ts +1 -0
- package/lib/esm/resources/payment_options.js +5 -2
- package/lib/esm/resources/paypal_gateways.d.ts +1 -0
- package/lib/esm/resources/paypal_gateways.js +5 -2
- package/lib/esm/resources/paypal_payments.d.ts +1 -0
- package/lib/esm/resources/paypal_payments.js +5 -2
- package/lib/esm/resources/percentage_discount_promotions.d.ts +1 -0
- package/lib/esm/resources/percentage_discount_promotions.js +5 -2
- package/lib/esm/resources/price_frequency_tiers.d.ts +1 -0
- package/lib/esm/resources/price_frequency_tiers.js +5 -2
- package/lib/esm/resources/price_lists.d.ts +1 -0
- package/lib/esm/resources/price_lists.js +5 -2
- package/lib/esm/resources/price_tiers.d.ts +1 -0
- package/lib/esm/resources/price_tiers.js +5 -2
- package/lib/esm/resources/price_volume_tiers.d.ts +1 -0
- package/lib/esm/resources/price_volume_tiers.js +5 -2
- package/lib/esm/resources/prices.d.ts +1 -0
- package/lib/esm/resources/prices.js +5 -2
- package/lib/esm/resources/promotion_rules.d.ts +1 -0
- package/lib/esm/resources/promotion_rules.js +5 -2
- package/lib/esm/resources/promotions.d.ts +1 -0
- package/lib/esm/resources/promotions.js +5 -2
- package/lib/esm/resources/recurring_order_copies.d.ts +1 -0
- package/lib/esm/resources/recurring_order_copies.js +5 -2
- package/lib/esm/resources/refunds.d.ts +1 -0
- package/lib/esm/resources/refunds.js +5 -2
- package/lib/esm/resources/reserved_stocks.d.ts +1 -0
- package/lib/esm/resources/reserved_stocks.js +5 -2
- package/lib/esm/resources/resource_errors.d.ts +1 -0
- package/lib/esm/resources/resource_errors.js +5 -2
- package/lib/esm/resources/return_line_items.d.ts +1 -0
- package/lib/esm/resources/return_line_items.js +5 -2
- package/lib/esm/resources/returns.d.ts +1 -0
- package/lib/esm/resources/returns.js +5 -2
- package/lib/esm/resources/satispay_gateways.d.ts +1 -0
- package/lib/esm/resources/satispay_gateways.js +5 -2
- package/lib/esm/resources/satispay_payments.d.ts +1 -0
- package/lib/esm/resources/satispay_payments.js +5 -2
- package/lib/esm/resources/shipments.d.ts +1 -0
- package/lib/esm/resources/shipments.js +5 -2
- package/lib/esm/resources/shipping_categories.d.ts +1 -0
- package/lib/esm/resources/shipping_categories.js +5 -2
- package/lib/esm/resources/shipping_method_tiers.d.ts +1 -0
- package/lib/esm/resources/shipping_method_tiers.js +5 -2
- package/lib/esm/resources/shipping_methods.d.ts +1 -0
- package/lib/esm/resources/shipping_methods.js +5 -2
- package/lib/esm/resources/shipping_weight_tiers.d.ts +1 -0
- package/lib/esm/resources/shipping_weight_tiers.js +5 -2
- package/lib/esm/resources/shipping_zones.d.ts +1 -0
- package/lib/esm/resources/shipping_zones.js +5 -2
- package/lib/esm/resources/sku_list_items.d.ts +1 -0
- package/lib/esm/resources/sku_list_items.js +5 -2
- package/lib/esm/resources/sku_list_promotion_rules.d.ts +1 -0
- package/lib/esm/resources/sku_list_promotion_rules.js +5 -2
- package/lib/esm/resources/sku_lists.d.ts +1 -0
- package/lib/esm/resources/sku_lists.js +5 -2
- package/lib/esm/resources/sku_options.d.ts +1 -0
- package/lib/esm/resources/sku_options.js +5 -2
- package/lib/esm/resources/skus.d.ts +1 -0
- package/lib/esm/resources/skus.js +5 -2
- package/lib/esm/resources/stock_items.d.ts +1 -0
- package/lib/esm/resources/stock_items.js +5 -2
- package/lib/esm/resources/stock_line_items.d.ts +1 -0
- package/lib/esm/resources/stock_line_items.js +5 -2
- package/lib/esm/resources/stock_locations.d.ts +1 -0
- package/lib/esm/resources/stock_locations.js +5 -2
- package/lib/esm/resources/stock_reservations.d.ts +1 -0
- package/lib/esm/resources/stock_reservations.js +5 -2
- package/lib/esm/resources/stock_transfers.d.ts +1 -0
- package/lib/esm/resources/stock_transfers.js +5 -2
- package/lib/esm/resources/stripe_gateways.d.ts +1 -0
- package/lib/esm/resources/stripe_gateways.js +5 -2
- package/lib/esm/resources/stripe_payments.d.ts +1 -0
- package/lib/esm/resources/stripe_payments.js +5 -2
- package/lib/esm/resources/subscription_models.d.ts +1 -0
- package/lib/esm/resources/subscription_models.js +5 -2
- package/lib/esm/resources/tags.d.ts +1 -0
- package/lib/esm/resources/tags.js +5 -2
- package/lib/esm/resources/tax_calculators.d.ts +1 -0
- package/lib/esm/resources/tax_calculators.js +5 -2
- package/lib/esm/resources/tax_categories.d.ts +1 -0
- package/lib/esm/resources/tax_categories.js +5 -2
- package/lib/esm/resources/tax_rules.d.ts +1 -0
- package/lib/esm/resources/tax_rules.js +5 -2
- package/lib/esm/resources/taxjar_accounts.d.ts +1 -0
- package/lib/esm/resources/taxjar_accounts.js +5 -2
- package/lib/esm/resources/transactions.d.ts +1 -0
- package/lib/esm/resources/transactions.js +5 -2
- package/lib/esm/resources/versions.d.ts +1 -0
- package/lib/esm/resources/versions.js +5 -2
- package/lib/esm/resources/voids.d.ts +1 -0
- package/lib/esm/resources/voids.js +5 -2
- package/lib/esm/resources/webhooks.d.ts +1 -0
- package/lib/esm/resources/webhooks.js +5 -2
- package/lib/esm/resources/wire_transfers.d.ts +1 -0
- package/lib/esm/resources/wire_transfers.js +5 -2
- 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 +20 -17
package/lib/esm/commercelayer.js
CHANGED
@@ -1,175 +1,273 @@
|
|
1
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
2
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
5
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
6
|
-
};
|
7
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
8
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
9
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
10
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
11
|
-
};
|
12
|
-
var _CommerceLayerClient_adapter, _CommerceLayerClient_organization;
|
13
1
|
import * as api from './api';
|
14
2
|
import { CommerceLayerStatic } from './static';
|
15
3
|
import ResourceAdapter from './resource';
|
16
4
|
import Debug from './debug';
|
17
5
|
const debug = Debug('commercelayer');
|
18
|
-
// Autogenerated schema version number, do not remove this line
|
19
6
|
const OPEN_API_SCHEMA_VERSION = '5.1.0';
|
20
7
|
export { OPEN_API_SCHEMA_VERSION };
|
21
8
|
class CommerceLayerClient {
|
22
|
-
|
9
|
+
openApiSchemaVersion = OPEN_API_SCHEMA_VERSION;
|
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;
|
79
|
+
#organization;
|
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;
|
23
133
|
constructor(config) {
|
24
|
-
// static get openApiSchemaVersion(): string { return OPEN_API_SCHEMA_VERSION }
|
25
|
-
this.openApiSchemaVersion = OPEN_API_SCHEMA_VERSION;
|
26
|
-
_CommerceLayerClient_adapter.set(this, void 0);
|
27
|
-
_CommerceLayerClient_organization.set(this, void 0);
|
28
134
|
debug('new commercelayer instance %O', config);
|
29
|
-
|
30
|
-
|
31
|
-
// this.#environment = 'test'
|
32
|
-
// ##__CL_RESOURCES_INIT_START__##
|
33
|
-
// ##__CL_RESOURCES_INIT_TEMPLATE:: ##__TAB__####__TAB__##this.##__RESOURCE_TYPE__## = new api.##__RESOURCE_CLASS__##(this.#adapter)
|
34
|
-
this.addresses = new api.Addresses(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
35
|
-
this.adjustments = new api.Adjustments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
36
|
-
this.adyen_gateways = new api.AdyenGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
37
|
-
this.adyen_payments = new api.AdyenPayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
38
|
-
this.application = new api.Applications(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
39
|
-
this.attachments = new api.Attachments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
40
|
-
this.authorizations = new api.Authorizations(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
41
|
-
this.avalara_accounts = new api.AvalaraAccounts(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
42
|
-
this.axerve_gateways = new api.AxerveGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
43
|
-
this.axerve_payments = new api.AxervePayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
44
|
-
this.billing_info_validation_rules = new api.BillingInfoValidationRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
45
|
-
this.bing_geocoders = new api.BingGeocoders(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
46
|
-
this.braintree_gateways = new api.BraintreeGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
47
|
-
this.braintree_payments = new api.BraintreePayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
48
|
-
this.bundles = new api.Bundles(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
49
|
-
this.buy_x_pay_y_promotions = new api.BuyXPayYPromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
50
|
-
this.captures = new api.Captures(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
51
|
-
this.carrier_accounts = new api.CarrierAccounts(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
52
|
-
this.checkout_com_gateways = new api.CheckoutComGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
53
|
-
this.checkout_com_payments = new api.CheckoutComPayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
54
|
-
this.cleanups = new api.Cleanups(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
55
|
-
this.coupon_codes_promotion_rules = new api.CouponCodesPromotionRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
56
|
-
this.coupon_recipients = new api.CouponRecipients(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
57
|
-
this.coupons = new api.Coupons(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
58
|
-
this.custom_promotion_rules = new api.CustomPromotionRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
59
|
-
this.customer_addresses = new api.CustomerAddresses(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
60
|
-
this.customer_groups = new api.CustomerGroups(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
61
|
-
this.customer_password_resets = new api.CustomerPasswordResets(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
62
|
-
this.customer_payment_sources = new api.CustomerPaymentSources(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
63
|
-
this.customer_subscriptions = new api.CustomerSubscriptions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
64
|
-
this.customers = new api.Customers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
65
|
-
this.delivery_lead_times = new api.DeliveryLeadTimes(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
66
|
-
this.event_callbacks = new api.EventCallbacks(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
67
|
-
this.events = new api.Events(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
68
|
-
this.exports = new api.Exports(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
69
|
-
this.external_gateways = new api.ExternalGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
70
|
-
this.external_payments = new api.ExternalPayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
71
|
-
this.external_promotions = new api.ExternalPromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
72
|
-
this.external_tax_calculators = new api.ExternalTaxCalculators(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
73
|
-
this.fixed_amount_promotions = new api.FixedAmountPromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
74
|
-
this.fixed_price_promotions = new api.FixedPricePromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
75
|
-
this.free_gift_promotions = new api.FreeGiftPromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
76
|
-
this.free_shipping_promotions = new api.FreeShippingPromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
77
|
-
this.geocoders = new api.Geocoders(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
78
|
-
this.gift_card_recipients = new api.GiftCardRecipients(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
79
|
-
this.gift_cards = new api.GiftCards(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
80
|
-
this.google_geocoders = new api.GoogleGeocoders(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
81
|
-
this.imports = new api.Imports(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
82
|
-
this.in_stock_subscriptions = new api.InStockSubscriptions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
83
|
-
this.inventory_models = new api.InventoryModels(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
84
|
-
this.inventory_return_locations = new api.InventoryReturnLocations(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
85
|
-
this.inventory_stock_locations = new api.InventoryStockLocations(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
86
|
-
this.klarna_gateways = new api.KlarnaGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
87
|
-
this.klarna_payments = new api.KlarnaPayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
88
|
-
this.line_item_options = new api.LineItemOptions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
89
|
-
this.line_items = new api.LineItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
90
|
-
this.manual_gateways = new api.ManualGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
91
|
-
this.manual_tax_calculators = new api.ManualTaxCalculators(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
92
|
-
this.markets = new api.Markets(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
93
|
-
this.merchants = new api.Merchants(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
94
|
-
this.order_amount_promotion_rules = new api.OrderAmountPromotionRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
95
|
-
this.order_copies = new api.OrderCopies(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
96
|
-
this.order_factories = new api.OrderFactories(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
97
|
-
this.order_subscription_items = new api.OrderSubscriptionItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
98
|
-
this.order_subscriptions = new api.OrderSubscriptions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
99
|
-
this.order_validation_rules = new api.OrderValidationRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
100
|
-
this.orders = new api.Orders(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
101
|
-
this.organization = new api.Organizations(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
102
|
-
this.packages = new api.Packages(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
103
|
-
this.parcel_line_items = new api.ParcelLineItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
104
|
-
this.parcels = new api.Parcels(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
105
|
-
this.payment_gateways = new api.PaymentGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
106
|
-
this.payment_methods = new api.PaymentMethods(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
107
|
-
this.payment_options = new api.PaymentOptions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
108
|
-
this.paypal_gateways = new api.PaypalGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
109
|
-
this.paypal_payments = new api.PaypalPayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
110
|
-
this.percentage_discount_promotions = new api.PercentageDiscountPromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
111
|
-
this.price_frequency_tiers = new api.PriceFrequencyTiers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
112
|
-
this.price_lists = new api.PriceLists(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
113
|
-
this.price_tiers = new api.PriceTiers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
114
|
-
this.price_volume_tiers = new api.PriceVolumeTiers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
115
|
-
this.prices = new api.Prices(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
116
|
-
this.promotion_rules = new api.PromotionRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
117
|
-
this.promotions = new api.Promotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
118
|
-
this.recurring_order_copies = new api.RecurringOrderCopies(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
119
|
-
this.refunds = new api.Refunds(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
120
|
-
this.reserved_stocks = new api.ReservedStocks(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
121
|
-
this.resource_errors = new api.ResourceErrors(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
122
|
-
this.return_line_items = new api.ReturnLineItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
123
|
-
this.returns = new api.Returns(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
124
|
-
this.satispay_gateways = new api.SatispayGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
125
|
-
this.satispay_payments = new api.SatispayPayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
126
|
-
this.shipments = new api.Shipments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
127
|
-
this.shipping_categories = new api.ShippingCategories(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
128
|
-
this.shipping_method_tiers = new api.ShippingMethodTiers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
129
|
-
this.shipping_methods = new api.ShippingMethods(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
130
|
-
this.shipping_weight_tiers = new api.ShippingWeightTiers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
131
|
-
this.shipping_zones = new api.ShippingZones(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
132
|
-
this.sku_list_items = new api.SkuListItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
133
|
-
this.sku_list_promotion_rules = new api.SkuListPromotionRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
134
|
-
this.sku_lists = new api.SkuLists(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
135
|
-
this.sku_options = new api.SkuOptions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
136
|
-
this.skus = new api.Skus(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
137
|
-
this.stock_items = new api.StockItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
138
|
-
this.stock_line_items = new api.StockLineItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
139
|
-
this.stock_locations = new api.StockLocations(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
140
|
-
this.stock_reservations = new api.StockReservations(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
141
|
-
this.stock_transfers = new api.StockTransfers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
142
|
-
this.stripe_gateways = new api.StripeGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
143
|
-
this.stripe_payments = new api.StripePayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
144
|
-
this.subscription_models = new api.SubscriptionModels(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
145
|
-
this.tags = new api.Tags(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
146
|
-
this.tax_calculators = new api.TaxCalculators(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
147
|
-
this.tax_categories = new api.TaxCategories(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
148
|
-
this.tax_rules = new api.TaxRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
149
|
-
this.taxjar_accounts = new api.TaxjarAccounts(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
150
|
-
this.transactions = new api.Transactions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
151
|
-
this.versions = new api.Versions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
152
|
-
this.voids = new api.Voids(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
153
|
-
this.webhooks = new api.Webhooks(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
154
|
-
this.wire_transfers = new api.WireTransfers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
155
|
-
// ##__CL_RESOURCES_INIT_STOP__##
|
135
|
+
this.#adapter = new ResourceAdapter(config);
|
136
|
+
this.#slug = config.organization;
|
156
137
|
}
|
157
|
-
get
|
158
|
-
|
159
|
-
|
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; }
|
160
261
|
localConfig(config) {
|
161
262
|
if (config.organization)
|
162
|
-
|
263
|
+
this.#slug = config.organization;
|
163
264
|
}
|
164
265
|
config(config) {
|
165
266
|
debug('config %o', config);
|
166
|
-
// CommerceLayer config
|
167
267
|
this.localConfig(config);
|
168
|
-
// ResourceAdapter config
|
169
|
-
// To rebuild baseUrl in client in case only the domain is defined
|
170
268
|
if (!config.organization)
|
171
269
|
config.organization = this.currentOrganization;
|
172
|
-
|
270
|
+
this.#adapter.config(config);
|
173
271
|
return this;
|
174
272
|
}
|
175
273
|
resources() {
|
@@ -181,42 +279,43 @@ class CommerceLayerClient {
|
|
181
279
|
isSingleton(resource) {
|
182
280
|
return CommerceLayerStatic.isSingleton(resource);
|
183
281
|
}
|
184
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
185
282
|
isApiError(error) {
|
186
283
|
return CommerceLayerStatic.isApiError(error);
|
187
284
|
}
|
188
|
-
addRequestInterceptor(
|
189
|
-
|
285
|
+
addRequestInterceptor(onSuccess, onFailure) {
|
286
|
+
this.interceptors.request = { onSuccess, onFailure };
|
190
287
|
}
|
191
|
-
addResponseInterceptor(
|
192
|
-
|
288
|
+
addResponseInterceptor(onSuccess, onFailure) {
|
289
|
+
this.interceptors.response = { onSuccess, onFailure };
|
193
290
|
}
|
194
|
-
removeInterceptor(type, id) {
|
195
|
-
|
291
|
+
removeInterceptor(type, id = 1) {
|
292
|
+
this.interceptors[type] = undefined;
|
196
293
|
}
|
197
294
|
addRawResponseReader(options) {
|
198
295
|
const reader = {
|
199
296
|
id: undefined,
|
200
297
|
rawResponse: undefined,
|
201
298
|
headers: undefined,
|
299
|
+
ok: true
|
202
300
|
};
|
203
|
-
function rawResponseInterceptor(response) {
|
204
|
-
reader.rawResponse =
|
205
|
-
|
206
|
-
|
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
|
+
}
|
207
309
|
return response;
|
208
310
|
}
|
209
|
-
|
210
|
-
reader.id =
|
311
|
+
this.interceptors.rawReader = { onSuccess: rawResponseInterceptor, onFailure: rawResponseInterceptor };
|
312
|
+
reader.id = 1;
|
211
313
|
return reader;
|
212
314
|
}
|
213
|
-
removeRawResponseReader(
|
214
|
-
|
215
|
-
if (id && (id >= 0))
|
216
|
-
this.removeInterceptor('response', id);
|
315
|
+
removeRawResponseReader() {
|
316
|
+
this.interceptors.rawReader = undefined;
|
217
317
|
}
|
218
318
|
}
|
219
|
-
_CommerceLayerClient_adapter = new WeakMap(), _CommerceLayerClient_organization = new WeakMap();
|
220
319
|
const CommerceLayer = (config) => {
|
221
320
|
return new CommerceLayerClient(config);
|
222
321
|
};
|
package/lib/esm/common.js
CHANGED
@@ -1,19 +1,8 @@
|
|
1
1
|
import { resourceList } from './api';
|
2
2
|
const isResourceId = (resource) => {
|
3
|
-
return (
|
3
|
+
return (resource?.type && resource.id) && resourceList.includes(resource.type);
|
4
4
|
};
|
5
5
|
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.js
CHANGED
package/lib/esm/debug.js
CHANGED
@@ -1,35 +1,14 @@
|
|
1
|
-
/* Nope debugger */
|
2
1
|
const debuggerFunction = (_pattern, ..._args) => {
|
3
|
-
// console.log(_pattern)
|
4
2
|
};
|
5
3
|
let debuggerFactory = (_namespace) => debuggerFunction;
|
6
|
-
/* Try loading 'debug' module */
|
7
4
|
try {
|
8
5
|
const debugModule = require('debug');
|
9
6
|
if (debugModule && (typeof debugModule === 'function'))
|
10
7
|
debuggerFactory = debugModule;
|
11
8
|
}
|
12
9
|
catch (error) {
|
13
|
-
//
|
14
10
|
}
|
15
11
|
const debugPrefix = 'clsdk';
|
16
|
-
/* Retrieve the name of the caller 'module' */
|
17
|
-
/*
|
18
|
-
const caller = (): string => {
|
19
|
-
|
20
|
-
const err = new Error()
|
21
|
-
|
22
|
-
Error.prepareStackTrace = (_, stack) => stack
|
23
|
-
const stack = err.stack as unknown as NodeJS.CallSite[]
|
24
|
-
Error.prepareStackTrace = undefined
|
25
|
-
|
26
|
-
const fileName = stack[2].getFileName() || '/'
|
27
|
-
|
28
|
-
return fileName.replace(/^.*[\\/]/, '').replace('.ts', '')
|
29
|
-
|
30
|
-
}
|
31
|
-
*/
|
32
|
-
/* Return a debugger for the defined namespace */
|
33
12
|
const debug = (namespace) => {
|
34
13
|
return debuggerFactory(`${debugPrefix}:${namespace}`);
|
35
14
|
};
|
package/lib/esm/error.d.ts
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
declare enum ErrorType {
|
2
|
-
CLIENT = "client"
|
3
|
-
REQUEST = "request"
|
4
|
-
RESPONSE = "response"
|
5
|
-
CANCEL = "cancel"
|
6
|
-
PARSE = "parse"
|
7
|
-
|
2
|
+
CLIENT = "client",
|
3
|
+
REQUEST = "request",
|
4
|
+
RESPONSE = "response",
|
5
|
+
CANCEL = "cancel",
|
6
|
+
PARSE = "parse",
|
7
|
+
TIMEOUT = "timeout"
|
8
8
|
}
|
9
9
|
declare class SdkError extends Error {
|
10
10
|
static NAME: string;
|
@@ -12,7 +12,6 @@ declare class SdkError extends Error {
|
|
12
12
|
type: ErrorType;
|
13
13
|
code?: string;
|
14
14
|
source?: Error;
|
15
|
-
request?: any;
|
16
15
|
constructor(error: {
|
17
16
|
message: string;
|
18
17
|
type?: ErrorType;
|