@commercelayer/sdk 4.48.0 → 4.49.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 +1 -126
- package/lib/cjs/api.js +1 -394
- package/lib/cjs/client.d.ts +1 -31
- package/lib/cjs/client.js +1 -123
- package/lib/cjs/commercelayer.d.ts +1 -152
- package/lib/cjs/commercelayer.js +1 -243
- package/lib/cjs/common.d.ts +1 -4
- package/lib/cjs/common.js +1 -14
- package/lib/cjs/config.d.ts +1 -11
- package/lib/cjs/config.js +1 -13
- package/lib/cjs/debug.d.ts +1 -3
- package/lib/cjs/debug.js +1 -42
- package/lib/cjs/error.d.ts +1 -28
- package/lib/cjs/error.js +1 -43
- package/lib/cjs/index.d.ts +1 -7
- package/lib/cjs/index.js +1 -29
- package/lib/cjs/interceptor.d.ts +1 -21
- package/lib/cjs/interceptor.js +1 -2
- package/lib/cjs/jsonapi.d.ts +1 -5
- package/lib/cjs/jsonapi.js +1 -82
- package/lib/cjs/model.d.ts +1 -124
- package/lib/cjs/model.js +1 -3
- package/lib/cjs/query.d.ts +1 -23
- package/lib/cjs/query.js +1 -51
- package/lib/cjs/resource.d.ts +1 -75
- package/lib/cjs/resource.js +1 -145
- package/lib/cjs/resources/addresses.d.ts +1 -102
- package/lib/cjs/resources/addresses.js +1 -49
- package/lib/cjs/resources/adjustments.d.ts +1 -41
- package/lib/cjs/resources/adjustments.js +1 -37
- package/lib/cjs/resources/adyen_gateways.d.ts +1 -59
- package/lib/cjs/resources/adyen_gateways.js +1 -45
- package/lib/cjs/resources/adyen_payments.d.ts +1 -49
- package/lib/cjs/resources/adyen_payments.js +1 -45
- package/lib/cjs/resources/application.d.ts +1 -21
- package/lib/cjs/resources/application.js +1 -21
- package/lib/cjs/resources/attachments.d.ts +1 -156
- package/lib/cjs/resources/attachments.js +1 -33
- package/lib/cjs/resources/authorizations.d.ts +1 -66
- package/lib/cjs/resources/authorizations.js +1 -51
- package/lib/cjs/resources/avalara_accounts.d.ts +1 -58
- package/lib/cjs/resources/avalara_accounts.js +1 -49
- package/lib/cjs/resources/axerve_gateways.d.ts +1 -47
- package/lib/cjs/resources/axerve_gateways.js +1 -45
- package/lib/cjs/resources/axerve_payments.d.ts +1 -52
- package/lib/cjs/resources/axerve_payments.js +1 -45
- package/lib/cjs/resources/billing_info_validation_rules.d.ts +1 -38
- package/lib/cjs/resources/billing_info_validation_rules.js +1 -45
- package/lib/cjs/resources/bing_geocoders.d.ts +1 -35
- package/lib/cjs/resources/bing_geocoders.js +1 -41
- package/lib/cjs/resources/braintree_gateways.d.ts +1 -59
- package/lib/cjs/resources/braintree_gateways.js +1 -45
- package/lib/cjs/resources/braintree_payments.d.ts +1 -51
- package/lib/cjs/resources/braintree_payments.js +1 -45
- package/lib/cjs/resources/bundles.d.ts +1 -90
- package/lib/cjs/resources/bundles.js +1 -61
- package/lib/cjs/resources/buy_x_pay_y_promotions.d.ts +1 -134
- package/lib/cjs/resources/buy_x_pay_y_promotions.js +1 -81
- package/lib/cjs/resources/captures.d.ts +1 -57
- package/lib/cjs/resources/captures.js +1 -51
- package/lib/cjs/resources/carrier_accounts.d.ts +1 -29
- package/lib/cjs/resources/carrier_accounts.js +1 -36
- package/lib/cjs/resources/checkout_com_gateways.d.ts +1 -48
- package/lib/cjs/resources/checkout_com_gateways.js +1 -45
- package/lib/cjs/resources/checkout_com_payments.d.ts +1 -62
- package/lib/cjs/resources/checkout_com_payments.js +1 -45
- package/lib/cjs/resources/cleanups.d.ts +1 -39
- package/lib/cjs/resources/cleanups.js +1 -38
- package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +1 -66
- package/lib/cjs/resources/coupon_codes_promotion_rules.js +1 -41
- package/lib/cjs/resources/coupon_recipients.d.ts +1 -47
- package/lib/cjs/resources/coupon_recipients.js +1 -45
- package/lib/cjs/resources/coupons.d.ts +1 -70
- package/lib/cjs/resources/coupons.js +1 -53
- package/lib/cjs/resources/custom_promotion_rules.d.ts +1 -61
- package/lib/cjs/resources/custom_promotion_rules.js +1 -37
- package/lib/cjs/resources/customer_addresses.d.ts +1 -49
- package/lib/cjs/resources/customer_addresses.js +1 -49
- package/lib/cjs/resources/customer_groups.d.ts +1 -39
- package/lib/cjs/resources/customer_groups.js +1 -49
- package/lib/cjs/resources/customer_password_resets.d.ts +1 -36
- package/lib/cjs/resources/customer_password_resets.js +1 -41
- package/lib/cjs/resources/customer_payment_sources.d.ts +1 -85
- package/lib/cjs/resources/customer_payment_sources.js +1 -45
- package/lib/cjs/resources/customer_subscriptions.d.ts +1 -34
- package/lib/cjs/resources/customer_subscriptions.js +1 -45
- package/lib/cjs/resources/customers.d.ts +1 -75
- package/lib/cjs/resources/customers.js +1 -77
- package/lib/cjs/resources/delivery_lead_times.d.ts +1 -54
- package/lib/cjs/resources/delivery_lead_times.js +1 -49
- package/lib/cjs/resources/event_callbacks.d.ts +1 -24
- package/lib/cjs/resources/event_callbacks.js +1 -28
- package/lib/cjs/resources/events.d.ts +1 -24
- package/lib/cjs/resources/events.js +1 -32
- package/lib/cjs/resources/exports.d.ts +1 -40
- package/lib/cjs/resources/exports.js +1 -34
- package/lib/cjs/resources/external_gateways.d.ts +1 -55
- package/lib/cjs/resources/external_gateways.js +1 -45
- package/lib/cjs/resources/external_payments.d.ts +1 -47
- package/lib/cjs/resources/external_payments.js +1 -49
- package/lib/cjs/resources/external_promotions.d.ts +1 -132
- package/lib/cjs/resources/external_promotions.js +1 -81
- package/lib/cjs/resources/external_tax_calculators.d.ts +1 -43
- package/lib/cjs/resources/external_tax_calculators.js +1 -45
- package/lib/cjs/resources/fixed_amount_promotions.d.ts +1 -130
- package/lib/cjs/resources/fixed_amount_promotions.js +1 -81
- package/lib/cjs/resources/fixed_price_promotions.d.ts +1 -130
- package/lib/cjs/resources/fixed_price_promotions.js +1 -81
- package/lib/cjs/resources/free_gift_promotions.d.ts +1 -128
- package/lib/cjs/resources/free_gift_promotions.js +1 -81
- package/lib/cjs/resources/free_shipping_promotions.d.ts +1 -122
- package/lib/cjs/resources/free_shipping_promotions.js +1 -77
- package/lib/cjs/resources/geocoders.d.ts +1 -24
- package/lib/cjs/resources/geocoders.js +1 -32
- package/lib/cjs/resources/gift_card_recipients.d.ts +1 -47
- package/lib/cjs/resources/gift_card_recipients.js +1 -45
- package/lib/cjs/resources/gift_cards.d.ts +1 -99
- package/lib/cjs/resources/gift_cards.js +1 -57
- package/lib/cjs/resources/google_geocoders.d.ts +1 -35
- package/lib/cjs/resources/google_geocoders.js +1 -41
- package/lib/cjs/resources/imports.d.ts +1 -43
- package/lib/cjs/resources/imports.js +1 -34
- package/lib/cjs/resources/in_stock_subscriptions.d.ts +1 -65
- package/lib/cjs/resources/in_stock_subscriptions.js +1 -53
- package/lib/cjs/resources/inventory_models.d.ts +1 -54
- package/lib/cjs/resources/inventory_models.js +1 -49
- package/lib/cjs/resources/inventory_return_locations.d.ts +1 -46
- package/lib/cjs/resources/inventory_return_locations.js +1 -45
- package/lib/cjs/resources/inventory_stock_locations.d.ts +1 -49
- package/lib/cjs/resources/inventory_stock_locations.js +1 -45
- package/lib/cjs/resources/klarna_gateways.d.ts +1 -47
- package/lib/cjs/resources/klarna_gateways.js +1 -45
- package/lib/cjs/resources/klarna_payments.d.ts +1 -46
- package/lib/cjs/resources/klarna_payments.js +1 -45
- package/lib/cjs/resources/line_item_options.d.ts +1 -68
- package/lib/cjs/resources/line_item_options.js +1 -49
- package/lib/cjs/resources/line_items.d.ts +1 -166
- package/lib/cjs/resources/line_items.js +1 -65
- package/lib/cjs/resources/manual_gateways.d.ts +1 -33
- package/lib/cjs/resources/manual_gateways.js +1 -41
- package/lib/cjs/resources/manual_tax_calculators.d.ts +1 -44
- package/lib/cjs/resources/manual_tax_calculators.js +1 -49
- package/lib/cjs/resources/markets.d.ts +1 -104
- package/lib/cjs/resources/markets.js +1 -65
- package/lib/cjs/resources/merchants.d.ts +1 -41
- package/lib/cjs/resources/merchants.js +1 -45
- package/lib/cjs/resources/order_amount_promotion_rules.d.ts +1 -66
- package/lib/cjs/resources/order_amount_promotion_rules.js +1 -37
- package/lib/cjs/resources/order_copies.d.ts +1 -50
- package/lib/cjs/resources/order_copies.js +1 -49
- package/lib/cjs/resources/order_factories.d.ts +1 -33
- package/lib/cjs/resources/order_factories.js +1 -36
- package/lib/cjs/resources/order_subscription_items.d.ts +1 -71
- package/lib/cjs/resources/order_subscription_items.js +1 -41
- package/lib/cjs/resources/order_subscriptions.d.ts +1 -94
- package/lib/cjs/resources/order_subscriptions.js +1 -77
- package/lib/cjs/resources/order_validation_rules.d.ts +1 -26
- package/lib/cjs/resources/order_validation_rules.js +1 -36
- package/lib/cjs/resources/orders.d.ts +1 -359
- package/lib/cjs/resources/orders.js +1 -157
- package/lib/cjs/resources/organization.d.ts +1 -33
- package/lib/cjs/resources/organization.js +1 -21
- package/lib/cjs/resources/packages.d.ts +1 -59
- package/lib/cjs/resources/packages.js +1 -49
- package/lib/cjs/resources/parcel_line_items.d.ts +1 -46
- package/lib/cjs/resources/parcel_line_items.js +1 -45
- package/lib/cjs/resources/parcels.d.ts +1 -125
- package/lib/cjs/resources/parcels.js +1 -57
- package/lib/cjs/resources/payment_gateways.d.ts +1 -24
- package/lib/cjs/resources/payment_gateways.js +1 -32
- package/lib/cjs/resources/payment_methods.d.ts +1 -80
- package/lib/cjs/resources/payment_methods.js +1 -49
- package/lib/cjs/resources/payment_options.d.ts +1 -43
- package/lib/cjs/resources/payment_options.js +1 -41
- package/lib/cjs/resources/paypal_gateways.d.ts +1 -40
- package/lib/cjs/resources/paypal_gateways.js +1 -45
- package/lib/cjs/resources/paypal_payments.d.ts +1 -52
- package/lib/cjs/resources/paypal_payments.js +1 -45
- package/lib/cjs/resources/percentage_discount_promotions.d.ts +1 -128
- package/lib/cjs/resources/percentage_discount_promotions.js +1 -81
- package/lib/cjs/resources/price_frequency_tiers.d.ts +1 -52
- package/lib/cjs/resources/price_frequency_tiers.js +1 -49
- package/lib/cjs/resources/price_lists.d.ts +1 -45
- package/lib/cjs/resources/price_lists.js +1 -45
- package/lib/cjs/resources/price_tiers.d.ts +1 -31
- package/lib/cjs/resources/price_tiers.js +1 -36
- package/lib/cjs/resources/price_volume_tiers.d.ts +1 -52
- package/lib/cjs/resources/price_volume_tiers.js +1 -49
- package/lib/cjs/resources/prices.d.ts +1 -83
- package/lib/cjs/resources/prices.js +1 -73
- package/lib/cjs/resources/promotion_rules.d.ts +1 -28
- package/lib/cjs/resources/promotion_rules.js +1 -28
- package/lib/cjs/resources/promotions.d.ts +1 -62
- package/lib/cjs/resources/promotions.js +1 -68
- package/lib/cjs/resources/recurring_order_copies.d.ts +1 -52
- package/lib/cjs/resources/recurring_order_copies.js +1 -49
- package/lib/cjs/resources/refunds.d.ts +1 -43
- package/lib/cjs/resources/refunds.js +1 -44
- package/lib/cjs/resources/reserved_stocks.d.ts +1 -27
- package/lib/cjs/resources/reserved_stocks.js +1 -36
- package/lib/cjs/resources/resource_errors.d.ts +1 -22
- package/lib/cjs/resources/resource_errors.js +1 -24
- package/lib/cjs/resources/return_line_items.d.ts +1 -50
- package/lib/cjs/resources/return_line_items.js +1 -41
- package/lib/cjs/resources/returns.d.ts +1 -86
- package/lib/cjs/resources/returns.js +1 -73
- package/lib/cjs/resources/satispay_gateways.d.ts +1 -45
- package/lib/cjs/resources/satispay_gateways.js +1 -45
- package/lib/cjs/resources/satispay_payments.d.ts +1 -48
- package/lib/cjs/resources/satispay_payments.js +1 -45
- package/lib/cjs/resources/shipments.d.ts +1 -139
- package/lib/cjs/resources/shipments.js +1 -105
- package/lib/cjs/resources/shipping_categories.d.ts +1 -39
- package/lib/cjs/resources/shipping_categories.js +1 -45
- package/lib/cjs/resources/shipping_method_tiers.d.ts +1 -31
- package/lib/cjs/resources/shipping_method_tiers.js +1 -36
- package/lib/cjs/resources/shipping_methods.d.ts +1 -121
- package/lib/cjs/resources/shipping_methods.js +1 -69
- package/lib/cjs/resources/shipping_weight_tiers.d.ts +1 -49
- package/lib/cjs/resources/shipping_weight_tiers.js +1 -45
- package/lib/cjs/resources/shipping_zones.d.ts +1 -51
- package/lib/cjs/resources/shipping_zones.js +1 -41
- package/lib/cjs/resources/sku_list_items.d.ts +1 -50
- package/lib/cjs/resources/sku_list_items.js +1 -45
- package/lib/cjs/resources/sku_list_promotion_rules.d.ts +1 -75
- package/lib/cjs/resources/sku_list_promotion_rules.js +1 -45
- package/lib/cjs/resources/sku_lists.d.ts +1 -63
- package/lib/cjs/resources/sku_lists.js +1 -57
- package/lib/cjs/resources/sku_options.d.ts +1 -70
- package/lib/cjs/resources/sku_options.js +1 -53
- package/lib/cjs/resources/skus.d.ts +1 -95
- package/lib/cjs/resources/skus.js +1 -73
- package/lib/cjs/resources/stock_items.d.ts +1 -59
- package/lib/cjs/resources/stock_items.js +1 -57
- package/lib/cjs/resources/stock_line_items.d.ts +1 -69
- package/lib/cjs/resources/stock_line_items.js +1 -53
- package/lib/cjs/resources/stock_locations.d.ts +1 -63
- package/lib/cjs/resources/stock_locations.js +1 -61
- package/lib/cjs/resources/stock_reservations.d.ts +1 -49
- package/lib/cjs/resources/stock_reservations.js +1 -53
- package/lib/cjs/resources/stock_transfers.d.ts +1 -79
- package/lib/cjs/resources/stock_transfers.js +1 -61
- package/lib/cjs/resources/stripe_gateways.d.ts +1 -44
- package/lib/cjs/resources/stripe_gateways.js +1 -45
- package/lib/cjs/resources/stripe_payments.d.ts +1 -56
- package/lib/cjs/resources/stripe_payments.js +1 -45
- package/lib/cjs/resources/subscription_models.d.ts +1 -48
- package/lib/cjs/resources/subscription_models.js +1 -45
- package/lib/cjs/resources/tags.d.ts +1 -27
- package/lib/cjs/resources/tags.js +1 -33
- package/lib/cjs/resources/tax_calculators.d.ts +1 -27
- package/lib/cjs/resources/tax_calculators.js +1 -36
- package/lib/cjs/resources/tax_categories.d.ts +1 -62
- package/lib/cjs/resources/tax_categories.js +1 -45
- package/lib/cjs/resources/tax_rules.d.ts +1 -72
- package/lib/cjs/resources/tax_rules.js +1 -41
- package/lib/cjs/resources/taxjar_accounts.d.ts +1 -46
- package/lib/cjs/resources/taxjar_accounts.js +1 -49
- package/lib/cjs/resources/transactions.d.ts +1 -40
- package/lib/cjs/resources/transactions.js +1 -40
- package/lib/cjs/resources/versions.d.ts +1 -22
- package/lib/cjs/resources/versions.js +1 -24
- package/lib/cjs/resources/voids.d.ts +1 -43
- package/lib/cjs/resources/voids.js +1 -44
- package/lib/cjs/resources/webhooks.d.ts +1 -51
- package/lib/cjs/resources/webhooks.js +1 -41
- package/lib/cjs/resources/wire_transfers.d.ts +1 -36
- package/lib/cjs/resources/wire_transfers.js +1 -41
- package/lib/cjs/static.d.ts +1 -9
- package/lib/cjs/static.js +1 -45
- package/lib/cjs/util.d.ts +1 -6
- package/lib/cjs/util.js +1 -15
- package/lib/esm/api.d.ts +1 -126
- package/lib/esm/api.js +1 -265
- package/lib/esm/client.d.ts +1 -31
- package/lib/esm/client.js +1 -118
- package/lib/esm/commercelayer.d.ts +1 -152
- package/lib/esm/commercelayer.js +1 -214
- package/lib/esm/common.d.ts +1 -4
- package/lib/esm/common.js +1 -10
- package/lib/esm/config.d.ts +1 -11
- package/lib/esm/config.js +1 -11
- package/lib/esm/debug.d.ts +1 -3
- package/lib/esm/debug.js +1 -40
- package/lib/esm/error.d.ts +1 -28
- package/lib/esm/error.js +1 -38
- package/lib/esm/index.d.ts +1 -7
- package/lib/esm/index.js +1 -6
- package/lib/esm/interceptor.d.ts +1 -21
- package/lib/esm/interceptor.js +1 -1
- package/lib/esm/jsonapi.d.ts +1 -5
- package/lib/esm/jsonapi.js +1 -75
- package/lib/esm/model.d.ts +1 -124
- package/lib/esm/model.js +1 -2
- package/lib/esm/query.d.ts +1 -23
- package/lib/esm/query.js +1 -45
- package/lib/esm/resource.d.ts +1 -75
- package/lib/esm/resource.js +1 -139
- package/lib/esm/resources/addresses.d.ts +1 -102
- package/lib/esm/resources/addresses.js +1 -47
- package/lib/esm/resources/adjustments.d.ts +1 -41
- package/lib/esm/resources/adjustments.js +1 -35
- package/lib/esm/resources/adyen_gateways.d.ts +1 -59
- package/lib/esm/resources/adyen_gateways.js +1 -43
- package/lib/esm/resources/adyen_payments.d.ts +1 -49
- package/lib/esm/resources/adyen_payments.js +1 -43
- package/lib/esm/resources/application.d.ts +1 -21
- package/lib/esm/resources/application.js +1 -19
- package/lib/esm/resources/attachments.d.ts +1 -156
- package/lib/esm/resources/attachments.js +1 -31
- package/lib/esm/resources/authorizations.d.ts +1 -66
- package/lib/esm/resources/authorizations.js +1 -49
- package/lib/esm/resources/avalara_accounts.d.ts +1 -58
- package/lib/esm/resources/avalara_accounts.js +1 -47
- package/lib/esm/resources/axerve_gateways.d.ts +1 -47
- package/lib/esm/resources/axerve_gateways.js +1 -43
- package/lib/esm/resources/axerve_payments.d.ts +1 -52
- package/lib/esm/resources/axerve_payments.js +1 -43
- package/lib/esm/resources/billing_info_validation_rules.d.ts +1 -38
- package/lib/esm/resources/billing_info_validation_rules.js +1 -43
- package/lib/esm/resources/bing_geocoders.d.ts +1 -35
- package/lib/esm/resources/bing_geocoders.js +1 -39
- package/lib/esm/resources/braintree_gateways.d.ts +1 -59
- package/lib/esm/resources/braintree_gateways.js +1 -43
- package/lib/esm/resources/braintree_payments.d.ts +1 -51
- package/lib/esm/resources/braintree_payments.js +1 -43
- package/lib/esm/resources/bundles.d.ts +1 -90
- package/lib/esm/resources/bundles.js +1 -59
- package/lib/esm/resources/buy_x_pay_y_promotions.d.ts +1 -134
- package/lib/esm/resources/buy_x_pay_y_promotions.js +1 -79
- package/lib/esm/resources/captures.d.ts +1 -57
- package/lib/esm/resources/captures.js +1 -49
- package/lib/esm/resources/carrier_accounts.d.ts +1 -29
- package/lib/esm/resources/carrier_accounts.js +1 -34
- package/lib/esm/resources/checkout_com_gateways.d.ts +1 -48
- package/lib/esm/resources/checkout_com_gateways.js +1 -43
- package/lib/esm/resources/checkout_com_payments.d.ts +1 -62
- package/lib/esm/resources/checkout_com_payments.js +1 -43
- package/lib/esm/resources/cleanups.d.ts +1 -39
- package/lib/esm/resources/cleanups.js +1 -36
- package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +1 -66
- package/lib/esm/resources/coupon_codes_promotion_rules.js +1 -39
- package/lib/esm/resources/coupon_recipients.d.ts +1 -47
- package/lib/esm/resources/coupon_recipients.js +1 -43
- package/lib/esm/resources/coupons.d.ts +1 -70
- package/lib/esm/resources/coupons.js +1 -51
- package/lib/esm/resources/custom_promotion_rules.d.ts +1 -61
- package/lib/esm/resources/custom_promotion_rules.js +1 -35
- package/lib/esm/resources/customer_addresses.d.ts +1 -49
- package/lib/esm/resources/customer_addresses.js +1 -47
- package/lib/esm/resources/customer_groups.d.ts +1 -39
- package/lib/esm/resources/customer_groups.js +1 -47
- package/lib/esm/resources/customer_password_resets.d.ts +1 -36
- package/lib/esm/resources/customer_password_resets.js +1 -39
- package/lib/esm/resources/customer_payment_sources.d.ts +1 -85
- package/lib/esm/resources/customer_payment_sources.js +1 -43
- package/lib/esm/resources/customer_subscriptions.d.ts +1 -34
- package/lib/esm/resources/customer_subscriptions.js +1 -43
- package/lib/esm/resources/customers.d.ts +1 -75
- package/lib/esm/resources/customers.js +1 -75
- package/lib/esm/resources/delivery_lead_times.d.ts +1 -54
- package/lib/esm/resources/delivery_lead_times.js +1 -47
- package/lib/esm/resources/event_callbacks.d.ts +1 -24
- package/lib/esm/resources/event_callbacks.js +1 -26
- package/lib/esm/resources/events.d.ts +1 -24
- package/lib/esm/resources/events.js +1 -30
- package/lib/esm/resources/exports.d.ts +1 -40
- package/lib/esm/resources/exports.js +1 -32
- package/lib/esm/resources/external_gateways.d.ts +1 -55
- package/lib/esm/resources/external_gateways.js +1 -43
- package/lib/esm/resources/external_payments.d.ts +1 -47
- package/lib/esm/resources/external_payments.js +1 -47
- package/lib/esm/resources/external_promotions.d.ts +1 -132
- package/lib/esm/resources/external_promotions.js +1 -79
- package/lib/esm/resources/external_tax_calculators.d.ts +1 -43
- package/lib/esm/resources/external_tax_calculators.js +1 -43
- package/lib/esm/resources/fixed_amount_promotions.d.ts +1 -130
- package/lib/esm/resources/fixed_amount_promotions.js +1 -79
- package/lib/esm/resources/fixed_price_promotions.d.ts +1 -130
- package/lib/esm/resources/fixed_price_promotions.js +1 -79
- package/lib/esm/resources/free_gift_promotions.d.ts +1 -128
- package/lib/esm/resources/free_gift_promotions.js +1 -79
- package/lib/esm/resources/free_shipping_promotions.d.ts +1 -122
- package/lib/esm/resources/free_shipping_promotions.js +1 -75
- package/lib/esm/resources/geocoders.d.ts +1 -24
- package/lib/esm/resources/geocoders.js +1 -30
- package/lib/esm/resources/gift_card_recipients.d.ts +1 -47
- package/lib/esm/resources/gift_card_recipients.js +1 -43
- package/lib/esm/resources/gift_cards.d.ts +1 -99
- package/lib/esm/resources/gift_cards.js +1 -55
- package/lib/esm/resources/google_geocoders.d.ts +1 -35
- package/lib/esm/resources/google_geocoders.js +1 -39
- package/lib/esm/resources/imports.d.ts +1 -43
- package/lib/esm/resources/imports.js +1 -32
- package/lib/esm/resources/in_stock_subscriptions.d.ts +1 -65
- package/lib/esm/resources/in_stock_subscriptions.js +1 -51
- package/lib/esm/resources/inventory_models.d.ts +1 -54
- package/lib/esm/resources/inventory_models.js +1 -47
- package/lib/esm/resources/inventory_return_locations.d.ts +1 -46
- package/lib/esm/resources/inventory_return_locations.js +1 -43
- package/lib/esm/resources/inventory_stock_locations.d.ts +1 -49
- package/lib/esm/resources/inventory_stock_locations.js +1 -43
- package/lib/esm/resources/klarna_gateways.d.ts +1 -47
- package/lib/esm/resources/klarna_gateways.js +1 -43
- package/lib/esm/resources/klarna_payments.d.ts +1 -46
- package/lib/esm/resources/klarna_payments.js +1 -43
- package/lib/esm/resources/line_item_options.d.ts +1 -68
- package/lib/esm/resources/line_item_options.js +1 -47
- package/lib/esm/resources/line_items.d.ts +1 -166
- package/lib/esm/resources/line_items.js +1 -63
- package/lib/esm/resources/manual_gateways.d.ts +1 -33
- package/lib/esm/resources/manual_gateways.js +1 -39
- package/lib/esm/resources/manual_tax_calculators.d.ts +1 -44
- package/lib/esm/resources/manual_tax_calculators.js +1 -47
- package/lib/esm/resources/markets.d.ts +1 -104
- package/lib/esm/resources/markets.js +1 -63
- package/lib/esm/resources/merchants.d.ts +1 -41
- package/lib/esm/resources/merchants.js +1 -43
- package/lib/esm/resources/order_amount_promotion_rules.d.ts +1 -66
- package/lib/esm/resources/order_amount_promotion_rules.js +1 -35
- package/lib/esm/resources/order_copies.d.ts +1 -50
- package/lib/esm/resources/order_copies.js +1 -47
- package/lib/esm/resources/order_factories.d.ts +1 -33
- package/lib/esm/resources/order_factories.js +1 -34
- package/lib/esm/resources/order_subscription_items.d.ts +1 -71
- package/lib/esm/resources/order_subscription_items.js +1 -39
- package/lib/esm/resources/order_subscriptions.d.ts +1 -94
- package/lib/esm/resources/order_subscriptions.js +1 -75
- package/lib/esm/resources/order_validation_rules.d.ts +1 -26
- package/lib/esm/resources/order_validation_rules.js +1 -34
- package/lib/esm/resources/orders.d.ts +1 -359
- package/lib/esm/resources/orders.js +1 -155
- package/lib/esm/resources/organization.d.ts +1 -33
- package/lib/esm/resources/organization.js +1 -19
- package/lib/esm/resources/packages.d.ts +1 -59
- package/lib/esm/resources/packages.js +1 -47
- package/lib/esm/resources/parcel_line_items.d.ts +1 -46
- package/lib/esm/resources/parcel_line_items.js +1 -43
- package/lib/esm/resources/parcels.d.ts +1 -125
- package/lib/esm/resources/parcels.js +1 -55
- package/lib/esm/resources/payment_gateways.d.ts +1 -24
- package/lib/esm/resources/payment_gateways.js +1 -30
- package/lib/esm/resources/payment_methods.d.ts +1 -80
- package/lib/esm/resources/payment_methods.js +1 -47
- package/lib/esm/resources/payment_options.d.ts +1 -43
- package/lib/esm/resources/payment_options.js +1 -39
- package/lib/esm/resources/paypal_gateways.d.ts +1 -40
- package/lib/esm/resources/paypal_gateways.js +1 -43
- package/lib/esm/resources/paypal_payments.d.ts +1 -52
- package/lib/esm/resources/paypal_payments.js +1 -43
- package/lib/esm/resources/percentage_discount_promotions.d.ts +1 -128
- package/lib/esm/resources/percentage_discount_promotions.js +1 -79
- package/lib/esm/resources/price_frequency_tiers.d.ts +1 -52
- package/lib/esm/resources/price_frequency_tiers.js +1 -47
- package/lib/esm/resources/price_lists.d.ts +1 -45
- package/lib/esm/resources/price_lists.js +1 -43
- package/lib/esm/resources/price_tiers.d.ts +1 -31
- package/lib/esm/resources/price_tiers.js +1 -34
- package/lib/esm/resources/price_volume_tiers.d.ts +1 -52
- package/lib/esm/resources/price_volume_tiers.js +1 -47
- package/lib/esm/resources/prices.d.ts +1 -83
- package/lib/esm/resources/prices.js +1 -71
- package/lib/esm/resources/promotion_rules.d.ts +1 -28
- package/lib/esm/resources/promotion_rules.js +1 -26
- package/lib/esm/resources/promotions.d.ts +1 -62
- package/lib/esm/resources/promotions.js +1 -66
- package/lib/esm/resources/recurring_order_copies.d.ts +1 -52
- package/lib/esm/resources/recurring_order_copies.js +1 -47
- package/lib/esm/resources/refunds.d.ts +1 -43
- package/lib/esm/resources/refunds.js +1 -42
- package/lib/esm/resources/reserved_stocks.d.ts +1 -27
- package/lib/esm/resources/reserved_stocks.js +1 -34
- package/lib/esm/resources/resource_errors.d.ts +1 -22
- package/lib/esm/resources/resource_errors.js +1 -22
- package/lib/esm/resources/return_line_items.d.ts +1 -50
- package/lib/esm/resources/return_line_items.js +1 -39
- package/lib/esm/resources/returns.d.ts +1 -86
- package/lib/esm/resources/returns.js +1 -71
- package/lib/esm/resources/satispay_gateways.d.ts +1 -45
- package/lib/esm/resources/satispay_gateways.js +1 -43
- package/lib/esm/resources/satispay_payments.d.ts +1 -48
- package/lib/esm/resources/satispay_payments.js +1 -43
- package/lib/esm/resources/shipments.d.ts +1 -139
- package/lib/esm/resources/shipments.js +1 -103
- package/lib/esm/resources/shipping_categories.d.ts +1 -39
- package/lib/esm/resources/shipping_categories.js +1 -43
- package/lib/esm/resources/shipping_method_tiers.d.ts +1 -31
- package/lib/esm/resources/shipping_method_tiers.js +1 -34
- package/lib/esm/resources/shipping_methods.d.ts +1 -121
- package/lib/esm/resources/shipping_methods.js +1 -67
- package/lib/esm/resources/shipping_weight_tiers.d.ts +1 -49
- package/lib/esm/resources/shipping_weight_tiers.js +1 -43
- package/lib/esm/resources/shipping_zones.d.ts +1 -51
- package/lib/esm/resources/shipping_zones.js +1 -39
- package/lib/esm/resources/sku_list_items.d.ts +1 -50
- package/lib/esm/resources/sku_list_items.js +1 -43
- package/lib/esm/resources/sku_list_promotion_rules.d.ts +1 -75
- package/lib/esm/resources/sku_list_promotion_rules.js +1 -43
- package/lib/esm/resources/sku_lists.d.ts +1 -63
- package/lib/esm/resources/sku_lists.js +1 -55
- package/lib/esm/resources/sku_options.d.ts +1 -70
- package/lib/esm/resources/sku_options.js +1 -51
- package/lib/esm/resources/skus.d.ts +1 -95
- package/lib/esm/resources/skus.js +1 -71
- package/lib/esm/resources/stock_items.d.ts +1 -59
- package/lib/esm/resources/stock_items.js +1 -55
- package/lib/esm/resources/stock_line_items.d.ts +1 -69
- package/lib/esm/resources/stock_line_items.js +1 -51
- package/lib/esm/resources/stock_locations.d.ts +1 -63
- package/lib/esm/resources/stock_locations.js +1 -59
- package/lib/esm/resources/stock_reservations.d.ts +1 -49
- package/lib/esm/resources/stock_reservations.js +1 -51
- package/lib/esm/resources/stock_transfers.d.ts +1 -79
- package/lib/esm/resources/stock_transfers.js +1 -59
- package/lib/esm/resources/stripe_gateways.d.ts +1 -44
- package/lib/esm/resources/stripe_gateways.js +1 -43
- package/lib/esm/resources/stripe_payments.d.ts +1 -56
- package/lib/esm/resources/stripe_payments.js +1 -43
- package/lib/esm/resources/subscription_models.d.ts +1 -48
- package/lib/esm/resources/subscription_models.js +1 -43
- package/lib/esm/resources/tags.d.ts +1 -27
- package/lib/esm/resources/tags.js +1 -31
- package/lib/esm/resources/tax_calculators.d.ts +1 -27
- package/lib/esm/resources/tax_calculators.js +1 -34
- package/lib/esm/resources/tax_categories.d.ts +1 -62
- package/lib/esm/resources/tax_categories.js +1 -43
- package/lib/esm/resources/tax_rules.d.ts +1 -72
- package/lib/esm/resources/tax_rules.js +1 -39
- package/lib/esm/resources/taxjar_accounts.d.ts +1 -46
- package/lib/esm/resources/taxjar_accounts.js +1 -47
- package/lib/esm/resources/transactions.d.ts +1 -40
- package/lib/esm/resources/transactions.js +1 -38
- package/lib/esm/resources/versions.d.ts +1 -22
- package/lib/esm/resources/versions.js +1 -22
- package/lib/esm/resources/voids.d.ts +1 -43
- package/lib/esm/resources/voids.js +1 -42
- package/lib/esm/resources/webhooks.d.ts +1 -51
- package/lib/esm/resources/webhooks.js +1 -39
- package/lib/esm/resources/wire_transfers.d.ts +1 -36
- package/lib/esm/resources/wire_transfers.js +1 -39
- package/lib/esm/static.d.ts +1 -9
- package/lib/esm/static.js +1 -19
- package/lib/esm/util.d.ts +1 -6
- package/lib/esm/util.js +1 -11
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/lib/cjs/client.js
CHANGED
@@ -1,123 +1 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
3
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
4
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
5
|
-
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");
|
6
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
7
|
-
};
|
8
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
9
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
10
|
-
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");
|
11
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
12
|
-
};
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
15
|
-
};
|
16
|
-
var _ApiClient_accessToken, _ApiClient_client;
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
18
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
19
|
-
const axios_1 = __importDefault(require("axios"));
|
20
|
-
const error_1 = require("./error");
|
21
|
-
const config_1 = __importDefault(require("./config"));
|
22
|
-
const debug_1 = __importDefault(require("./debug"));
|
23
|
-
const debug = (0, debug_1.default)('client');
|
24
|
-
const baseURL = (organization, domain) => {
|
25
|
-
return `https://${organization.toLowerCase()}.${domain || config_1.default.default.domain}/api`;
|
26
|
-
};
|
27
|
-
const handleError = (error) => {
|
28
|
-
let sdkError = new error_1.SdkError({ message: error.message });
|
29
|
-
if (axios_1.default.isAxiosError(error)) {
|
30
|
-
if (error.response) {
|
31
|
-
// The request was made and the server responded with a status code that falls out of the range of 2xx
|
32
|
-
const apiError = new error_1.ApiError(sdkError);
|
33
|
-
apiError.type = error_1.ErrorType.RESPONSE;
|
34
|
-
apiError.status = error.response.status;
|
35
|
-
apiError.code = String(apiError.status);
|
36
|
-
apiError.errors = error.response.data.errors;
|
37
|
-
sdkError = apiError;
|
38
|
-
}
|
39
|
-
else if (error.request) {
|
40
|
-
// The request was made but no response was received
|
41
|
-
// `error.request` is an instance of XMLHttpRequest in the browser and an instance of http.ClientRequest in node.js
|
42
|
-
sdkError.type = error_1.ErrorType.REQUEST;
|
43
|
-
sdkError.request = error.request;
|
44
|
-
}
|
45
|
-
else {
|
46
|
-
// Something happened in setting up the request that triggered an Error
|
47
|
-
sdkError.type = error_1.ErrorType.CLIENT;
|
48
|
-
}
|
49
|
-
}
|
50
|
-
else if (axios_1.default.isCancel(error))
|
51
|
-
sdkError.type = error_1.ErrorType.CANCEL;
|
52
|
-
else
|
53
|
-
sdkError.source = error;
|
54
|
-
throw sdkError;
|
55
|
-
};
|
56
|
-
class ApiClient {
|
57
|
-
static create(options) {
|
58
|
-
if (!(options === null || options === void 0 ? void 0 : options.organization))
|
59
|
-
throw new Error("Undefined 'organization' parameter");
|
60
|
-
if (!(options === null || options === void 0 ? void 0 : options.accessToken))
|
61
|
-
throw new Error("Undefined 'accessToken' parameter");
|
62
|
-
return new ApiClient(options);
|
63
|
-
}
|
64
|
-
constructor(options) {
|
65
|
-
_ApiClient_accessToken.set(this, void 0);
|
66
|
-
_ApiClient_client.set(this, void 0);
|
67
|
-
debug('new client instance %O', options);
|
68
|
-
this.baseUrl = baseURL(options.organization, options.domain);
|
69
|
-
__classPrivateFieldSet(this, _ApiClient_accessToken, options.accessToken, "f");
|
70
|
-
const axiosConfig = {
|
71
|
-
timeout: options.timeout || config_1.default.client.timeout,
|
72
|
-
proxy: options.proxy,
|
73
|
-
httpAgent: options.httpAgent,
|
74
|
-
httpsAgent: options.httpsAgent,
|
75
|
-
};
|
76
|
-
const axiosOptions = Object.assign({ baseURL: this.baseUrl, timeout: config_1.default.client.timeout, headers: {
|
77
|
-
'Accept': 'application/vnd.api+json',
|
78
|
-
'Content-Type': 'application/vnd.api+json',
|
79
|
-
'Authorization': 'Bearer ' + __classPrivateFieldGet(this, _ApiClient_accessToken, "f"),
|
80
|
-
} }, axiosConfig);
|
81
|
-
debug('axios options: %O', axiosOptions);
|
82
|
-
__classPrivateFieldSet(this, _ApiClient_client, axios_1.default.create(axiosOptions), "f");
|
83
|
-
this.interceptors = __classPrivateFieldGet(this, _ApiClient_client, "f").interceptors;
|
84
|
-
}
|
85
|
-
config(config) {
|
86
|
-
debug('config %o', config);
|
87
|
-
const def = __classPrivateFieldGet(this, _ApiClient_client, "f").defaults;
|
88
|
-
// Axios config
|
89
|
-
if (config.timeout)
|
90
|
-
def.timeout = config.timeout;
|
91
|
-
if (config.proxy)
|
92
|
-
def.proxy = config.proxy;
|
93
|
-
if (config.httpAgent)
|
94
|
-
def.httpAgent = config.httpAgent;
|
95
|
-
if (config.httpsAgent)
|
96
|
-
def.httpsAgent = config.httpsAgent;
|
97
|
-
// API Client config
|
98
|
-
if (config.organization)
|
99
|
-
this.baseUrl = baseURL(config.organization, config.domain);
|
100
|
-
if (config.accessToken) {
|
101
|
-
__classPrivateFieldSet(this, _ApiClient_accessToken, config.accessToken, "f");
|
102
|
-
def.headers.common.Authorization = 'Bearer ' + __classPrivateFieldGet(this, _ApiClient_accessToken, "f");
|
103
|
-
}
|
104
|
-
}
|
105
|
-
async request(method, path, body, options) {
|
106
|
-
debug('request %s %s, %O, %O', method, path, body || {}, options || {});
|
107
|
-
const data = body ? { data: body } : undefined;
|
108
|
-
const url = path;
|
109
|
-
// Runtime request parameters
|
110
|
-
const baseUrl = (options === null || options === void 0 ? void 0 : options.organization) ? baseURL(options.organization, options.domain) : undefined;
|
111
|
-
const accessToken = (options === null || options === void 0 ? void 0 : options.accessToken) || __classPrivateFieldGet(this, _ApiClient_accessToken, "f");
|
112
|
-
const headers = accessToken ? { 'Authorization': 'Bearer ' + accessToken } : undefined;
|
113
|
-
const requestParams = Object.assign({ method, baseURL: baseUrl, url, data, headers }, options);
|
114
|
-
debug('request params: %O', requestParams);
|
115
|
-
// const start = Date.now()
|
116
|
-
return __classPrivateFieldGet(this, _ApiClient_client, "f").request(requestParams)
|
117
|
-
.then(response => response.data)
|
118
|
-
.catch(error => handleError(error));
|
119
|
-
// .finally(() => console.log(`<<-- ${method} ${path} ${Date.now() - start}`))
|
120
|
-
}
|
121
|
-
}
|
122
|
-
_ApiClient_accessToken = new WeakMap(), _ApiClient_client = new WeakMap();
|
123
|
-
exports.default = ApiClient;
|
1
|
+
"use strict";var __classPrivateFieldSet=this&&this.__classPrivateFieldSet||function(t,e,r,a,s){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?s.call(t,r):s?s.value=r:e.set(t,r),r},__classPrivateFieldGet=this&&this.__classPrivateFieldGet||function(t,e,r,a){if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?a:r==="a"?a.call(t):a?a.value:e.get(t)},__importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},_ApiClient_accessToken,_ApiClient_client;Object.defineProperty(exports,"__esModule",{value:!0});const axios_1=__importDefault(require("axios")),error_1=require("./error"),config_1=__importDefault(require("./config")),debug_1=__importDefault(require("./debug")),debug=(0,debug_1.default)("client"),baseURL=(t,e)=>`https://${t.toLowerCase()}.${e||config_1.default.default.domain}/api`,handleError=t=>{let e=new error_1.SdkError({message:t.message});if(axios_1.default.isAxiosError(t))if(t.response){const r=new error_1.ApiError(e);r.type=error_1.ErrorType.RESPONSE,r.status=t.response.status,r.code=String(r.status),r.errors=t.response.data.errors,e=r}else t.request?(e.type=error_1.ErrorType.REQUEST,e.request=t.request):e.type=error_1.ErrorType.CLIENT;else axios_1.default.isCancel(t)?e.type=error_1.ErrorType.CANCEL:e.source=t;throw e};class ApiClient{static create(e){if(!e?.organization)throw new Error("Undefined 'organization' parameter");if(!e?.accessToken)throw new Error("Undefined 'accessToken' parameter");return new ApiClient(e)}constructor(e){_ApiClient_accessToken.set(this,void 0),_ApiClient_client.set(this,void 0),debug("new client instance %O",e),this.baseUrl=baseURL(e.organization,e.domain),__classPrivateFieldSet(this,_ApiClient_accessToken,e.accessToken,"f");const r={timeout:e.timeout||config_1.default.client.timeout,proxy:e.proxy,httpAgent:e.httpAgent,httpsAgent:e.httpsAgent},a=Object.assign({baseURL:this.baseUrl,timeout:config_1.default.client.timeout,headers:{Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json",Authorization:"Bearer "+__classPrivateFieldGet(this,_ApiClient_accessToken,"f")}},r);debug("axios options: %O",a),__classPrivateFieldSet(this,_ApiClient_client,axios_1.default.create(a),"f"),this.interceptors=__classPrivateFieldGet(this,_ApiClient_client,"f").interceptors}config(e){debug("config %o",e);const r=__classPrivateFieldGet(this,_ApiClient_client,"f").defaults;e.timeout&&(r.timeout=e.timeout),e.proxy&&(r.proxy=e.proxy),e.httpAgent&&(r.httpAgent=e.httpAgent),e.httpsAgent&&(r.httpsAgent=e.httpsAgent),e.organization&&(this.baseUrl=baseURL(e.organization,e.domain)),e.accessToken&&(__classPrivateFieldSet(this,_ApiClient_accessToken,e.accessToken,"f"),r.headers.common.Authorization="Bearer "+__classPrivateFieldGet(this,_ApiClient_accessToken,"f"))}async request(e,r,a,s){debug("request %s %s, %O, %O",e,r,a||{},s||{});const u=a?{data:a}:void 0,c=r,l=s?.organization?baseURL(s.organization,s.domain):void 0,n=s?.accessToken||__classPrivateFieldGet(this,_ApiClient_accessToken,"f"),d=n?{Authorization:"Bearer "+n}:void 0,o=Object.assign({method:e,baseURL:l,url:c,data:u,headers:d},s);return debug("request params: %O",o),__classPrivateFieldGet(this,_ApiClient_client,"f").request(o).then(i=>i.data).catch(i=>handleError(i))}}_ApiClient_accessToken=new WeakMap,_ApiClient_client=new WeakMap,exports.default=ApiClient;
|
@@ -1,152 +1 @@
|
|
1
|
-
import
|
2
|
-
import { ApiError } from './error';
|
3
|
-
import type { ErrorInterceptor, InterceptorType, RawResponseReader, RequestInterceptor, ResponseInterceptor } from './interceptor';
|
4
|
-
import { ResourcesInitConfig } from './resource';
|
5
|
-
declare const OPEN_API_SCHEMA_VERSION = "5.2.1";
|
6
|
-
export { OPEN_API_SCHEMA_VERSION };
|
7
|
-
type SdkConfig = {};
|
8
|
-
type CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig;
|
9
|
-
type CommerceLayerConfig = Partial<CommerceLayerInitConfig>;
|
10
|
-
declare class CommerceLayerClient {
|
11
|
-
#private;
|
12
|
-
static get openApiSchemaVersion(): string;
|
13
|
-
readonly openApiSchemaVersion = "5.2.1";
|
14
|
-
addresses: api.Addresses;
|
15
|
-
adjustments: api.Adjustments;
|
16
|
-
adyen_gateways: api.AdyenGateways;
|
17
|
-
adyen_payments: api.AdyenPayments;
|
18
|
-
application: api.Applications;
|
19
|
-
attachments: api.Attachments;
|
20
|
-
authorizations: api.Authorizations;
|
21
|
-
avalara_accounts: api.AvalaraAccounts;
|
22
|
-
axerve_gateways: api.AxerveGateways;
|
23
|
-
axerve_payments: api.AxervePayments;
|
24
|
-
billing_info_validation_rules: api.BillingInfoValidationRules;
|
25
|
-
bing_geocoders: api.BingGeocoders;
|
26
|
-
braintree_gateways: api.BraintreeGateways;
|
27
|
-
braintree_payments: api.BraintreePayments;
|
28
|
-
bundles: api.Bundles;
|
29
|
-
buy_x_pay_y_promotions: api.BuyXPayYPromotions;
|
30
|
-
captures: api.Captures;
|
31
|
-
carrier_accounts: api.CarrierAccounts;
|
32
|
-
checkout_com_gateways: api.CheckoutComGateways;
|
33
|
-
checkout_com_payments: api.CheckoutComPayments;
|
34
|
-
cleanups: api.Cleanups;
|
35
|
-
coupon_codes_promotion_rules: api.CouponCodesPromotionRules;
|
36
|
-
coupon_recipients: api.CouponRecipients;
|
37
|
-
coupons: api.Coupons;
|
38
|
-
custom_promotion_rules: api.CustomPromotionRules;
|
39
|
-
customer_addresses: api.CustomerAddresses;
|
40
|
-
customer_groups: api.CustomerGroups;
|
41
|
-
customer_password_resets: api.CustomerPasswordResets;
|
42
|
-
customer_payment_sources: api.CustomerPaymentSources;
|
43
|
-
customer_subscriptions: api.CustomerSubscriptions;
|
44
|
-
customers: api.Customers;
|
45
|
-
delivery_lead_times: api.DeliveryLeadTimes;
|
46
|
-
event_callbacks: api.EventCallbacks;
|
47
|
-
events: api.Events;
|
48
|
-
exports: api.Exports;
|
49
|
-
external_gateways: api.ExternalGateways;
|
50
|
-
external_payments: api.ExternalPayments;
|
51
|
-
external_promotions: api.ExternalPromotions;
|
52
|
-
external_tax_calculators: api.ExternalTaxCalculators;
|
53
|
-
fixed_amount_promotions: api.FixedAmountPromotions;
|
54
|
-
fixed_price_promotions: api.FixedPricePromotions;
|
55
|
-
free_gift_promotions: api.FreeGiftPromotions;
|
56
|
-
free_shipping_promotions: api.FreeShippingPromotions;
|
57
|
-
geocoders: api.Geocoders;
|
58
|
-
gift_card_recipients: api.GiftCardRecipients;
|
59
|
-
gift_cards: api.GiftCards;
|
60
|
-
google_geocoders: api.GoogleGeocoders;
|
61
|
-
imports: api.Imports;
|
62
|
-
in_stock_subscriptions: api.InStockSubscriptions;
|
63
|
-
inventory_models: api.InventoryModels;
|
64
|
-
inventory_return_locations: api.InventoryReturnLocations;
|
65
|
-
inventory_stock_locations: api.InventoryStockLocations;
|
66
|
-
klarna_gateways: api.KlarnaGateways;
|
67
|
-
klarna_payments: api.KlarnaPayments;
|
68
|
-
line_item_options: api.LineItemOptions;
|
69
|
-
line_items: api.LineItems;
|
70
|
-
manual_gateways: api.ManualGateways;
|
71
|
-
manual_tax_calculators: api.ManualTaxCalculators;
|
72
|
-
markets: api.Markets;
|
73
|
-
merchants: api.Merchants;
|
74
|
-
order_amount_promotion_rules: api.OrderAmountPromotionRules;
|
75
|
-
order_copies: api.OrderCopies;
|
76
|
-
order_factories: api.OrderFactories;
|
77
|
-
order_subscription_items: api.OrderSubscriptionItems;
|
78
|
-
order_subscriptions: api.OrderSubscriptions;
|
79
|
-
order_validation_rules: api.OrderValidationRules;
|
80
|
-
orders: api.Orders;
|
81
|
-
organization: api.Organizations;
|
82
|
-
packages: api.Packages;
|
83
|
-
parcel_line_items: api.ParcelLineItems;
|
84
|
-
parcels: api.Parcels;
|
85
|
-
payment_gateways: api.PaymentGateways;
|
86
|
-
payment_methods: api.PaymentMethods;
|
87
|
-
payment_options: api.PaymentOptions;
|
88
|
-
paypal_gateways: api.PaypalGateways;
|
89
|
-
paypal_payments: api.PaypalPayments;
|
90
|
-
percentage_discount_promotions: api.PercentageDiscountPromotions;
|
91
|
-
price_frequency_tiers: api.PriceFrequencyTiers;
|
92
|
-
price_lists: api.PriceLists;
|
93
|
-
price_tiers: api.PriceTiers;
|
94
|
-
price_volume_tiers: api.PriceVolumeTiers;
|
95
|
-
prices: api.Prices;
|
96
|
-
promotion_rules: api.PromotionRules;
|
97
|
-
promotions: api.Promotions;
|
98
|
-
recurring_order_copies: api.RecurringOrderCopies;
|
99
|
-
refunds: api.Refunds;
|
100
|
-
reserved_stocks: api.ReservedStocks;
|
101
|
-
resource_errors: api.ResourceErrors;
|
102
|
-
return_line_items: api.ReturnLineItems;
|
103
|
-
returns: api.Returns;
|
104
|
-
satispay_gateways: api.SatispayGateways;
|
105
|
-
satispay_payments: api.SatispayPayments;
|
106
|
-
shipments: api.Shipments;
|
107
|
-
shipping_categories: api.ShippingCategories;
|
108
|
-
shipping_method_tiers: api.ShippingMethodTiers;
|
109
|
-
shipping_methods: api.ShippingMethods;
|
110
|
-
shipping_weight_tiers: api.ShippingWeightTiers;
|
111
|
-
shipping_zones: api.ShippingZones;
|
112
|
-
sku_list_items: api.SkuListItems;
|
113
|
-
sku_list_promotion_rules: api.SkuListPromotionRules;
|
114
|
-
sku_lists: api.SkuLists;
|
115
|
-
sku_options: api.SkuOptions;
|
116
|
-
skus: api.Skus;
|
117
|
-
stock_items: api.StockItems;
|
118
|
-
stock_line_items: api.StockLineItems;
|
119
|
-
stock_locations: api.StockLocations;
|
120
|
-
stock_reservations: api.StockReservations;
|
121
|
-
stock_transfers: api.StockTransfers;
|
122
|
-
stripe_gateways: api.StripeGateways;
|
123
|
-
stripe_payments: api.StripePayments;
|
124
|
-
subscription_models: api.SubscriptionModels;
|
125
|
-
tags: api.Tags;
|
126
|
-
tax_calculators: api.TaxCalculators;
|
127
|
-
tax_categories: api.TaxCategories;
|
128
|
-
tax_rules: api.TaxRules;
|
129
|
-
taxjar_accounts: api.TaxjarAccounts;
|
130
|
-
transactions: api.Transactions;
|
131
|
-
versions: api.Versions;
|
132
|
-
voids: api.Voids;
|
133
|
-
webhooks: api.Webhooks;
|
134
|
-
wire_transfers: api.WireTransfers;
|
135
|
-
constructor(config: CommerceLayerInitConfig);
|
136
|
-
get currentOrganization(): string;
|
137
|
-
private localConfig;
|
138
|
-
config(config: CommerceLayerConfig): void;
|
139
|
-
resources(): readonly string[];
|
140
|
-
isApiError(error: any): error is ApiError;
|
141
|
-
addRequestInterceptor(onFulfilled?: RequestInterceptor, onRejected?: ErrorInterceptor): number;
|
142
|
-
addResponseInterceptor(onFulfilled?: ResponseInterceptor, onRejected?: ErrorInterceptor): number;
|
143
|
-
removeInterceptor(type: InterceptorType, id: number): void;
|
144
|
-
addRawResponseReader(options?: {
|
145
|
-
headers: boolean;
|
146
|
-
}): RawResponseReader;
|
147
|
-
removeRawResponseReader(reader: number | RawResponseReader): void;
|
148
|
-
}
|
149
|
-
declare const CommerceLayer: (config: CommerceLayerInitConfig) => CommerceLayerClient;
|
150
|
-
export default CommerceLayer;
|
151
|
-
export { CommerceLayer };
|
152
|
-
export type { CommerceLayerClient, CommerceLayerConfig, CommerceLayerInitConfig };
|
1
|
+
import*as api from'./api';import{ApiError}from'./error';import type{ErrorInterceptor,InterceptorType,RawResponseReader,RequestInterceptor,ResponseInterceptor}from'./interceptor';import{ResourcesInitConfig}from'./resource';declare const OPEN_API_SCHEMA_VERSION="5.2.2";export{OPEN_API_SCHEMA_VERSION};type SdkConfig={};type CommerceLayerInitConfig=SdkConfig&ResourcesInitConfig;type CommerceLayerConfig=Partial<CommerceLayerInitConfig>;declare class CommerceLayerClient{#private;static get openApiSchemaVersion():string;readonly openApiSchemaVersion="5.2.2";addresses:api.Addresses;adjustments:api.Adjustments;adyen_gateways:api.AdyenGateways;adyen_payments:api.AdyenPayments;application:api.Applications;attachments:api.Attachments;authorizations:api.Authorizations;avalara_accounts:api.AvalaraAccounts;axerve_gateways:api.AxerveGateways;axerve_payments:api.AxervePayments;billing_info_validation_rules:api.BillingInfoValidationRules;bing_geocoders:api.BingGeocoders;braintree_gateways:api.BraintreeGateways;braintree_payments:api.BraintreePayments;bundles:api.Bundles;buy_x_pay_y_promotions:api.BuyXPayYPromotions;captures:api.Captures;carrier_accounts:api.CarrierAccounts;checkout_com_gateways:api.CheckoutComGateways;checkout_com_payments:api.CheckoutComPayments;cleanups:api.Cleanups;coupon_codes_promotion_rules:api.CouponCodesPromotionRules;coupon_recipients:api.CouponRecipients;coupons:api.Coupons;custom_promotion_rules:api.CustomPromotionRules;customer_addresses:api.CustomerAddresses;customer_groups:api.CustomerGroups;customer_password_resets:api.CustomerPasswordResets;customer_payment_sources:api.CustomerPaymentSources;customer_subscriptions:api.CustomerSubscriptions;customers:api.Customers;delivery_lead_times:api.DeliveryLeadTimes;event_callbacks:api.EventCallbacks;events:api.Events;exports:api.Exports;external_gateways:api.ExternalGateways;external_payments:api.ExternalPayments;external_promotions:api.ExternalPromotions;external_tax_calculators:api.ExternalTaxCalculators;fixed_amount_promotions:api.FixedAmountPromotions;fixed_price_promotions:api.FixedPricePromotions;free_gift_promotions:api.FreeGiftPromotions;free_shipping_promotions:api.FreeShippingPromotions;geocoders:api.Geocoders;gift_card_recipients:api.GiftCardRecipients;gift_cards:api.GiftCards;google_geocoders:api.GoogleGeocoders;imports:api.Imports;in_stock_subscriptions:api.InStockSubscriptions;inventory_models:api.InventoryModels;inventory_return_locations:api.InventoryReturnLocations;inventory_stock_locations:api.InventoryStockLocations;klarna_gateways:api.KlarnaGateways;klarna_payments:api.KlarnaPayments;line_item_options:api.LineItemOptions;line_items:api.LineItems;manual_gateways:api.ManualGateways;manual_tax_calculators:api.ManualTaxCalculators;markets:api.Markets;merchants:api.Merchants;order_amount_promotion_rules:api.OrderAmountPromotionRules;order_copies:api.OrderCopies;order_factories:api.OrderFactories;order_subscription_items:api.OrderSubscriptionItems;order_subscriptions:api.OrderSubscriptions;order_validation_rules:api.OrderValidationRules;orders:api.Orders;organization:api.Organizations;packages:api.Packages;parcel_line_items:api.ParcelLineItems;parcels:api.Parcels;payment_gateways:api.PaymentGateways;payment_methods:api.PaymentMethods;payment_options:api.PaymentOptions;paypal_gateways:api.PaypalGateways;paypal_payments:api.PaypalPayments;percentage_discount_promotions:api.PercentageDiscountPromotions;price_frequency_tiers:api.PriceFrequencyTiers;price_lists:api.PriceLists;price_tiers:api.PriceTiers;price_volume_tiers:api.PriceVolumeTiers;prices:api.Prices;promotion_rules:api.PromotionRules;promotions:api.Promotions;recurring_order_copies:api.RecurringOrderCopies;refunds:api.Refunds;reserved_stocks:api.ReservedStocks;resource_errors:api.ResourceErrors;return_line_items:api.ReturnLineItems;returns:api.Returns;satispay_gateways:api.SatispayGateways;satispay_payments:api.SatispayPayments;shipments:api.Shipments;shipping_categories:api.ShippingCategories;shipping_method_tiers:api.ShippingMethodTiers;shipping_methods:api.ShippingMethods;shipping_weight_tiers:api.ShippingWeightTiers;shipping_zones:api.ShippingZones;sku_list_items:api.SkuListItems;sku_list_promotion_rules:api.SkuListPromotionRules;sku_lists:api.SkuLists;sku_options:api.SkuOptions;skus:api.Skus;stock_items:api.StockItems;stock_line_items:api.StockLineItems;stock_locations:api.StockLocations;stock_reservations:api.StockReservations;stock_transfers:api.StockTransfers;stripe_gateways:api.StripeGateways;stripe_payments:api.StripePayments;subscription_models:api.SubscriptionModels;tags:api.Tags;tax_calculators:api.TaxCalculators;tax_categories:api.TaxCategories;tax_rules:api.TaxRules;taxjar_accounts:api.TaxjarAccounts;transactions:api.Transactions;versions:api.Versions;voids:api.Voids;webhooks:api.Webhooks;wire_transfers:api.WireTransfers;constructor(config:CommerceLayerInitConfig);get currentOrganization():string;private localConfig;config(config:CommerceLayerConfig):void;resources():readonly string[];isApiError(error:any):error is ApiError;addRequestInterceptor(onFulfilled?:RequestInterceptor,onRejected?:ErrorInterceptor):number;addResponseInterceptor(onFulfilled?:ResponseInterceptor,onRejected?:ErrorInterceptor):number;removeInterceptor(type:InterceptorType,id:number):void;addRawResponseReader(options?:{headers:boolean;}):RawResponseReader;removeRawResponseReader(reader:number|RawResponseReader):void;}declare const CommerceLayer:(config:CommerceLayerInitConfig)=>CommerceLayerClient;export default CommerceLayer;export{CommerceLayer};export type{CommerceLayerClient,CommerceLayerConfig,CommerceLayerInitConfig};
|
package/lib/cjs/commercelayer.js
CHANGED
@@ -1,243 +1 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
-
}) : function(o, v) {
|
16
|
-
o["default"] = v;
|
17
|
-
});
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
-
if (mod && mod.__esModule) return mod;
|
20
|
-
var result = {};
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
-
__setModuleDefault(result, mod);
|
23
|
-
return result;
|
24
|
-
};
|
25
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
26
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
27
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
28
|
-
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");
|
29
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
30
|
-
};
|
31
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
32
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
33
|
-
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");
|
34
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
35
|
-
};
|
36
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
37
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
38
|
-
};
|
39
|
-
var _CommerceLayerClient_adapter, _CommerceLayerClient_organization;
|
40
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
41
|
-
exports.CommerceLayer = exports.OPEN_API_SCHEMA_VERSION = void 0;
|
42
|
-
const api = __importStar(require("./api"));
|
43
|
-
const static_1 = require("./static");
|
44
|
-
const resource_1 = __importDefault(require("./resource"));
|
45
|
-
const debug_1 = __importDefault(require("./debug"));
|
46
|
-
const debug = (0, debug_1.default)('commercelayer');
|
47
|
-
// Autogenerated schema version number, do not remove this line
|
48
|
-
const OPEN_API_SCHEMA_VERSION = '5.2.1';
|
49
|
-
exports.OPEN_API_SCHEMA_VERSION = OPEN_API_SCHEMA_VERSION;
|
50
|
-
class CommerceLayerClient {
|
51
|
-
static get openApiSchemaVersion() { return OPEN_API_SCHEMA_VERSION; }
|
52
|
-
// ##__CL_RESOURCES_DEF_STOP__##
|
53
|
-
constructor(config) {
|
54
|
-
this.openApiSchemaVersion = OPEN_API_SCHEMA_VERSION;
|
55
|
-
_CommerceLayerClient_adapter.set(this, void 0);
|
56
|
-
_CommerceLayerClient_organization.set(this, void 0);
|
57
|
-
debug('new commercelayer instance %O', config);
|
58
|
-
__classPrivateFieldSet(this, _CommerceLayerClient_adapter, new resource_1.default(config), "f");
|
59
|
-
__classPrivateFieldSet(this, _CommerceLayerClient_organization, config.organization, "f");
|
60
|
-
// ##__CL_RESOURCES_INIT_START__##
|
61
|
-
// ##__CL_RESOURCES_INIT_TEMPLATE:: ##__TAB__####__TAB__##this.##__RESOURCE_TYPE__## = new api.##__RESOURCE_CLASS__##(this.#adapter)
|
62
|
-
this.addresses = new api.Addresses(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
63
|
-
this.adjustments = new api.Adjustments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
64
|
-
this.adyen_gateways = new api.AdyenGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
65
|
-
this.adyen_payments = new api.AdyenPayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
66
|
-
this.application = new api.Applications(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
67
|
-
this.attachments = new api.Attachments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
68
|
-
this.authorizations = new api.Authorizations(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
69
|
-
this.avalara_accounts = new api.AvalaraAccounts(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
70
|
-
this.axerve_gateways = new api.AxerveGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
71
|
-
this.axerve_payments = new api.AxervePayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
72
|
-
this.billing_info_validation_rules = new api.BillingInfoValidationRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
73
|
-
this.bing_geocoders = new api.BingGeocoders(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
74
|
-
this.braintree_gateways = new api.BraintreeGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
75
|
-
this.braintree_payments = new api.BraintreePayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
76
|
-
this.bundles = new api.Bundles(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
77
|
-
this.buy_x_pay_y_promotions = new api.BuyXPayYPromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
78
|
-
this.captures = new api.Captures(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
79
|
-
this.carrier_accounts = new api.CarrierAccounts(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
80
|
-
this.checkout_com_gateways = new api.CheckoutComGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
81
|
-
this.checkout_com_payments = new api.CheckoutComPayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
82
|
-
this.cleanups = new api.Cleanups(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
83
|
-
this.coupon_codes_promotion_rules = new api.CouponCodesPromotionRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
84
|
-
this.coupon_recipients = new api.CouponRecipients(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
85
|
-
this.coupons = new api.Coupons(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
86
|
-
this.custom_promotion_rules = new api.CustomPromotionRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
87
|
-
this.customer_addresses = new api.CustomerAddresses(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
88
|
-
this.customer_groups = new api.CustomerGroups(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
89
|
-
this.customer_password_resets = new api.CustomerPasswordResets(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
90
|
-
this.customer_payment_sources = new api.CustomerPaymentSources(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
91
|
-
this.customer_subscriptions = new api.CustomerSubscriptions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
92
|
-
this.customers = new api.Customers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
93
|
-
this.delivery_lead_times = new api.DeliveryLeadTimes(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
94
|
-
this.event_callbacks = new api.EventCallbacks(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
95
|
-
this.events = new api.Events(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
96
|
-
this.exports = new api.Exports(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
97
|
-
this.external_gateways = new api.ExternalGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
98
|
-
this.external_payments = new api.ExternalPayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
99
|
-
this.external_promotions = new api.ExternalPromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
100
|
-
this.external_tax_calculators = new api.ExternalTaxCalculators(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
101
|
-
this.fixed_amount_promotions = new api.FixedAmountPromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
102
|
-
this.fixed_price_promotions = new api.FixedPricePromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
103
|
-
this.free_gift_promotions = new api.FreeGiftPromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
104
|
-
this.free_shipping_promotions = new api.FreeShippingPromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
105
|
-
this.geocoders = new api.Geocoders(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
106
|
-
this.gift_card_recipients = new api.GiftCardRecipients(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
107
|
-
this.gift_cards = new api.GiftCards(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
108
|
-
this.google_geocoders = new api.GoogleGeocoders(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
109
|
-
this.imports = new api.Imports(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
110
|
-
this.in_stock_subscriptions = new api.InStockSubscriptions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
111
|
-
this.inventory_models = new api.InventoryModels(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
112
|
-
this.inventory_return_locations = new api.InventoryReturnLocations(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
113
|
-
this.inventory_stock_locations = new api.InventoryStockLocations(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
114
|
-
this.klarna_gateways = new api.KlarnaGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
115
|
-
this.klarna_payments = new api.KlarnaPayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
116
|
-
this.line_item_options = new api.LineItemOptions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
117
|
-
this.line_items = new api.LineItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
118
|
-
this.manual_gateways = new api.ManualGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
119
|
-
this.manual_tax_calculators = new api.ManualTaxCalculators(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
120
|
-
this.markets = new api.Markets(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
121
|
-
this.merchants = new api.Merchants(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
122
|
-
this.order_amount_promotion_rules = new api.OrderAmountPromotionRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
123
|
-
this.order_copies = new api.OrderCopies(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
124
|
-
this.order_factories = new api.OrderFactories(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
125
|
-
this.order_subscription_items = new api.OrderSubscriptionItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
126
|
-
this.order_subscriptions = new api.OrderSubscriptions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
127
|
-
this.order_validation_rules = new api.OrderValidationRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
128
|
-
this.orders = new api.Orders(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
129
|
-
this.organization = new api.Organizations(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
130
|
-
this.packages = new api.Packages(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
131
|
-
this.parcel_line_items = new api.ParcelLineItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
132
|
-
this.parcels = new api.Parcels(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
133
|
-
this.payment_gateways = new api.PaymentGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
134
|
-
this.payment_methods = new api.PaymentMethods(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
135
|
-
this.payment_options = new api.PaymentOptions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
136
|
-
this.paypal_gateways = new api.PaypalGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
137
|
-
this.paypal_payments = new api.PaypalPayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
138
|
-
this.percentage_discount_promotions = new api.PercentageDiscountPromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
139
|
-
this.price_frequency_tiers = new api.PriceFrequencyTiers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
140
|
-
this.price_lists = new api.PriceLists(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
141
|
-
this.price_tiers = new api.PriceTiers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
142
|
-
this.price_volume_tiers = new api.PriceVolumeTiers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
143
|
-
this.prices = new api.Prices(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
144
|
-
this.promotion_rules = new api.PromotionRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
145
|
-
this.promotions = new api.Promotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
146
|
-
this.recurring_order_copies = new api.RecurringOrderCopies(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
147
|
-
this.refunds = new api.Refunds(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
148
|
-
this.reserved_stocks = new api.ReservedStocks(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
149
|
-
this.resource_errors = new api.ResourceErrors(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
150
|
-
this.return_line_items = new api.ReturnLineItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
151
|
-
this.returns = new api.Returns(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
152
|
-
this.satispay_gateways = new api.SatispayGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
153
|
-
this.satispay_payments = new api.SatispayPayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
154
|
-
this.shipments = new api.Shipments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
155
|
-
this.shipping_categories = new api.ShippingCategories(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
156
|
-
this.shipping_method_tiers = new api.ShippingMethodTiers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
157
|
-
this.shipping_methods = new api.ShippingMethods(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
158
|
-
this.shipping_weight_tiers = new api.ShippingWeightTiers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
159
|
-
this.shipping_zones = new api.ShippingZones(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
160
|
-
this.sku_list_items = new api.SkuListItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
161
|
-
this.sku_list_promotion_rules = new api.SkuListPromotionRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
162
|
-
this.sku_lists = new api.SkuLists(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
163
|
-
this.sku_options = new api.SkuOptions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
164
|
-
this.skus = new api.Skus(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
165
|
-
this.stock_items = new api.StockItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
166
|
-
this.stock_line_items = new api.StockLineItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
167
|
-
this.stock_locations = new api.StockLocations(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
168
|
-
this.stock_reservations = new api.StockReservations(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
169
|
-
this.stock_transfers = new api.StockTransfers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
170
|
-
this.stripe_gateways = new api.StripeGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
171
|
-
this.stripe_payments = new api.StripePayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
172
|
-
this.subscription_models = new api.SubscriptionModels(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
173
|
-
this.tags = new api.Tags(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
174
|
-
this.tax_calculators = new api.TaxCalculators(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
175
|
-
this.tax_categories = new api.TaxCategories(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
176
|
-
this.tax_rules = new api.TaxRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
177
|
-
this.taxjar_accounts = new api.TaxjarAccounts(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
178
|
-
this.transactions = new api.Transactions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
179
|
-
this.versions = new api.Versions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
180
|
-
this.voids = new api.Voids(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
181
|
-
this.webhooks = new api.Webhooks(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
182
|
-
this.wire_transfers = new api.WireTransfers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
183
|
-
// ##__CL_RESOURCES_INIT_STOP__##
|
184
|
-
}
|
185
|
-
get currentOrganization() { return __classPrivateFieldGet(this, _CommerceLayerClient_organization, "f"); }
|
186
|
-
localConfig(config) {
|
187
|
-
if (config.organization)
|
188
|
-
__classPrivateFieldSet(this, _CommerceLayerClient_organization, config.organization, "f");
|
189
|
-
}
|
190
|
-
config(config) {
|
191
|
-
debug('config %o', config);
|
192
|
-
// CommerceLayer config
|
193
|
-
this.localConfig(config);
|
194
|
-
// ResourceAdapter config
|
195
|
-
// To rebuild baseUrl in client in case only the domain is defined
|
196
|
-
if (!config.organization)
|
197
|
-
config.organization = this.currentOrganization;
|
198
|
-
__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f").config(config);
|
199
|
-
}
|
200
|
-
resources() {
|
201
|
-
return static_1.CommerceLayerStatic.resources();
|
202
|
-
}
|
203
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
204
|
-
isApiError(error) {
|
205
|
-
return static_1.CommerceLayerStatic.isApiError(error);
|
206
|
-
}
|
207
|
-
addRequestInterceptor(onFulfilled, onRejected) {
|
208
|
-
return __classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f").interceptors.request.use(onFulfilled, onRejected);
|
209
|
-
}
|
210
|
-
addResponseInterceptor(onFulfilled, onRejected) {
|
211
|
-
return __classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f").interceptors.response.use(onFulfilled, onRejected);
|
212
|
-
}
|
213
|
-
removeInterceptor(type, id) {
|
214
|
-
return __classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f").interceptors[type].eject(id);
|
215
|
-
}
|
216
|
-
addRawResponseReader(options) {
|
217
|
-
const reader = {
|
218
|
-
id: undefined,
|
219
|
-
rawResponse: undefined,
|
220
|
-
headers: undefined,
|
221
|
-
};
|
222
|
-
function rawResponseInterceptor(response) {
|
223
|
-
reader.rawResponse = response === null || response === void 0 ? void 0 : response.data;
|
224
|
-
if (options === null || options === void 0 ? void 0 : options.headers)
|
225
|
-
reader.headers = response.headers;
|
226
|
-
return response;
|
227
|
-
}
|
228
|
-
const interceptor = this.addResponseInterceptor(rawResponseInterceptor);
|
229
|
-
reader.id = interceptor;
|
230
|
-
return reader;
|
231
|
-
}
|
232
|
-
removeRawResponseReader(reader) {
|
233
|
-
const id = (typeof reader === 'number') ? reader : reader === null || reader === void 0 ? void 0 : reader.id;
|
234
|
-
if (id && (id >= 0))
|
235
|
-
return this.removeInterceptor('response', id);
|
236
|
-
}
|
237
|
-
}
|
238
|
-
_CommerceLayerClient_adapter = new WeakMap(), _CommerceLayerClient_organization = new WeakMap();
|
239
|
-
const CommerceLayer = (config) => {
|
240
|
-
return new CommerceLayerClient(config);
|
241
|
-
};
|
242
|
-
exports.CommerceLayer = CommerceLayer;
|
243
|
-
exports.default = CommerceLayer;
|
1
|
+
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,t,s,i){i===void 0&&(i=s);var n=Object.getOwnPropertyDescriptor(t,s);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,i,n)}:function(e,t,s,i){i===void 0&&(i=s),e[i]=t[s]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var s in e)s!=="default"&&Object.prototype.hasOwnProperty.call(e,s)&&__createBinding(t,e,s);return __setModuleDefault(t,e),t},__classPrivateFieldSet=this&&this.__classPrivateFieldSet||function(e,t,s,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(e,s):n?n.value=s:t.set(e,s),s},__classPrivateFieldGet=this&&this.__classPrivateFieldGet||function(e,t,s,i){if(s==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?i:s==="a"?i.call(e):i?i.value:t.get(e)},__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},_CommerceLayerClient_adapter,_CommerceLayerClient_organization;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CommerceLayer=exports.OPEN_API_SCHEMA_VERSION=void 0;const api=__importStar(require("./api")),static_1=require("./static"),resource_1=__importDefault(require("./resource")),debug_1=__importDefault(require("./debug")),debug=(0,debug_1.default)("commercelayer"),OPEN_API_SCHEMA_VERSION="5.2.2";exports.OPEN_API_SCHEMA_VERSION=OPEN_API_SCHEMA_VERSION;class CommerceLayerClient{static get openApiSchemaVersion(){return OPEN_API_SCHEMA_VERSION}constructor(t){this.openApiSchemaVersion=OPEN_API_SCHEMA_VERSION,_CommerceLayerClient_adapter.set(this,void 0),_CommerceLayerClient_organization.set(this,void 0),debug("new commercelayer instance %O",t),__classPrivateFieldSet(this,_CommerceLayerClient_adapter,new resource_1.default(t),"f"),__classPrivateFieldSet(this,_CommerceLayerClient_organization,t.organization,"f"),this.addresses=new api.Addresses(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.adjustments=new api.Adjustments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.adyen_gateways=new api.AdyenGateways(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.adyen_payments=new api.AdyenPayments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.application=new api.Applications(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.attachments=new api.Attachments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.authorizations=new api.Authorizations(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.avalara_accounts=new api.AvalaraAccounts(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.axerve_gateways=new api.AxerveGateways(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.axerve_payments=new api.AxervePayments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.billing_info_validation_rules=new api.BillingInfoValidationRules(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.bing_geocoders=new api.BingGeocoders(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.braintree_gateways=new api.BraintreeGateways(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.braintree_payments=new api.BraintreePayments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.bundles=new api.Bundles(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.buy_x_pay_y_promotions=new api.BuyXPayYPromotions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.captures=new api.Captures(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.carrier_accounts=new api.CarrierAccounts(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.checkout_com_gateways=new api.CheckoutComGateways(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.checkout_com_payments=new api.CheckoutComPayments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.cleanups=new api.Cleanups(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.coupon_codes_promotion_rules=new api.CouponCodesPromotionRules(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.coupon_recipients=new api.CouponRecipients(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.coupons=new api.Coupons(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.custom_promotion_rules=new api.CustomPromotionRules(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.customer_addresses=new api.CustomerAddresses(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.customer_groups=new api.CustomerGroups(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.customer_password_resets=new api.CustomerPasswordResets(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.customer_payment_sources=new api.CustomerPaymentSources(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.customer_subscriptions=new api.CustomerSubscriptions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.customers=new api.Customers(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.delivery_lead_times=new api.DeliveryLeadTimes(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.event_callbacks=new api.EventCallbacks(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.events=new api.Events(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.exports=new api.Exports(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.external_gateways=new api.ExternalGateways(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.external_payments=new api.ExternalPayments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.external_promotions=new api.ExternalPromotions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.external_tax_calculators=new api.ExternalTaxCalculators(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.fixed_amount_promotions=new api.FixedAmountPromotions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.fixed_price_promotions=new api.FixedPricePromotions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.free_gift_promotions=new api.FreeGiftPromotions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.free_shipping_promotions=new api.FreeShippingPromotions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.geocoders=new api.Geocoders(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.gift_card_recipients=new api.GiftCardRecipients(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.gift_cards=new api.GiftCards(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.google_geocoders=new api.GoogleGeocoders(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.imports=new api.Imports(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.in_stock_subscriptions=new api.InStockSubscriptions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.inventory_models=new api.InventoryModels(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.inventory_return_locations=new api.InventoryReturnLocations(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.inventory_stock_locations=new api.InventoryStockLocations(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.klarna_gateways=new api.KlarnaGateways(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.klarna_payments=new api.KlarnaPayments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.line_item_options=new api.LineItemOptions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.line_items=new api.LineItems(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.manual_gateways=new api.ManualGateways(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.manual_tax_calculators=new api.ManualTaxCalculators(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.markets=new api.Markets(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.merchants=new api.Merchants(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.order_amount_promotion_rules=new api.OrderAmountPromotionRules(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.order_copies=new api.OrderCopies(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.order_factories=new api.OrderFactories(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.order_subscription_items=new api.OrderSubscriptionItems(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.order_subscriptions=new api.OrderSubscriptions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.order_validation_rules=new api.OrderValidationRules(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.orders=new api.Orders(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.organization=new api.Organizations(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.packages=new api.Packages(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.parcel_line_items=new api.ParcelLineItems(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.parcels=new api.Parcels(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.payment_gateways=new api.PaymentGateways(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.payment_methods=new api.PaymentMethods(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.payment_options=new api.PaymentOptions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.paypal_gateways=new api.PaypalGateways(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.paypal_payments=new api.PaypalPayments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.percentage_discount_promotions=new api.PercentageDiscountPromotions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.price_frequency_tiers=new api.PriceFrequencyTiers(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.price_lists=new api.PriceLists(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.price_tiers=new api.PriceTiers(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.price_volume_tiers=new api.PriceVolumeTiers(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.prices=new api.Prices(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.promotion_rules=new api.PromotionRules(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.promotions=new api.Promotions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.recurring_order_copies=new api.RecurringOrderCopies(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.refunds=new api.Refunds(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.reserved_stocks=new api.ReservedStocks(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.resource_errors=new api.ResourceErrors(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.return_line_items=new api.ReturnLineItems(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.returns=new api.Returns(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.satispay_gateways=new api.SatispayGateways(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.satispay_payments=new api.SatispayPayments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.shipments=new api.Shipments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.shipping_categories=new api.ShippingCategories(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.shipping_method_tiers=new api.ShippingMethodTiers(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.shipping_methods=new api.ShippingMethods(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.shipping_weight_tiers=new api.ShippingWeightTiers(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.shipping_zones=new api.ShippingZones(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.sku_list_items=new api.SkuListItems(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.sku_list_promotion_rules=new api.SkuListPromotionRules(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.sku_lists=new api.SkuLists(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.sku_options=new api.SkuOptions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.skus=new api.Skus(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.stock_items=new api.StockItems(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.stock_line_items=new api.StockLineItems(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.stock_locations=new api.StockLocations(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.stock_reservations=new api.StockReservations(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.stock_transfers=new api.StockTransfers(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.stripe_gateways=new api.StripeGateways(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.stripe_payments=new api.StripePayments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.subscription_models=new api.SubscriptionModels(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.tags=new api.Tags(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.tax_calculators=new api.TaxCalculators(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.tax_categories=new api.TaxCategories(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.tax_rules=new api.TaxRules(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.taxjar_accounts=new api.TaxjarAccounts(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.transactions=new api.Transactions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.versions=new api.Versions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.voids=new api.Voids(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.webhooks=new api.Webhooks(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.wire_transfers=new api.WireTransfers(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f"))}get currentOrganization(){return __classPrivateFieldGet(this,_CommerceLayerClient_organization,"f")}localConfig(t){t.organization&&__classPrivateFieldSet(this,_CommerceLayerClient_organization,t.organization,"f")}config(t){debug("config %o",t),this.localConfig(t),t.organization||(t.organization=this.currentOrganization),__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f").config(t)}resources(){return static_1.CommerceLayerStatic.resources()}isApiError(t){return static_1.CommerceLayerStatic.isApiError(t)}addRequestInterceptor(t,s){return __classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f").interceptors.request.use(t,s)}addResponseInterceptor(t,s){return __classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f").interceptors.response.use(t,s)}removeInterceptor(t,s){return __classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f").interceptors[t].eject(s)}addRawResponseReader(t){const s={id:void 0,rawResponse:void 0,headers:void 0};function i(r){return s.rawResponse=r?.data,t?.headers&&(s.headers=r.headers),r}const n=this.addResponseInterceptor(i);return s.id=n,s}removeRawResponseReader(t){const s=typeof t=="number"?t:t?.id;if(s&&s>=0)return this.removeInterceptor("response",s)}}_CommerceLayerClient_adapter=new WeakMap,_CommerceLayerClient_organization=new WeakMap;const CommerceLayer=e=>new CommerceLayerClient(e);exports.CommerceLayer=CommerceLayer,exports.default=CommerceLayer;
|
package/lib/cjs/common.d.ts
CHANGED
@@ -1,4 +1 @@
|
|
1
|
-
import type
|
2
|
-
declare const isResourceId: (resource: any) => resource is ResourceId;
|
3
|
-
declare const isResourceType: (resource: any) => resource is ResourceType;
|
4
|
-
export { isResourceId, isResourceType };
|
1
|
+
import type{ResourceId,ResourceType}from'./resource';declare const isResourceId:(resource:any)=>resource is ResourceId;declare const isResourceType:(resource:any)=>resource is ResourceType;export{isResourceId,isResourceType};
|
package/lib/cjs/common.js
CHANGED
@@ -1,14 +1 @@
|
|
1
|
-
"use strict";
|
2
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
3
|
-
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
5
|
-
exports.isResourceType = exports.isResourceId = void 0;
|
6
|
-
const api_1 = require("./api");
|
7
|
-
const isResourceId = (resource) => {
|
8
|
-
return ((resource === null || resource === void 0 ? void 0 : resource.type) && resource.id) && api_1.resourceList.includes(resource.type);
|
9
|
-
};
|
10
|
-
exports.isResourceId = isResourceId;
|
11
|
-
const isResourceType = (resource) => {
|
12
|
-
return resource && (typeof resource.type !== 'undefined') && resource.type && api_1.resourceList.includes(resource.type);
|
13
|
-
};
|
14
|
-
exports.isResourceType = isResourceType;
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isResourceType=exports.isResourceId=void 0;const api_1=require("./api"),isResourceId=e=>e?.type&&e.id&&api_1.resourceList.includes(e.type);exports.isResourceId=isResourceId;const isResourceType=e=>e&&typeof e.type<"u"&&e.type&&api_1.resourceList.includes(e.type);exports.isResourceType=isResourceType;
|
package/lib/cjs/config.d.ts
CHANGED
@@ -1,11 +1 @@
|
|
1
|
-
declare const config: {
|
2
|
-
readonly default: {
|
3
|
-
readonly domain: "commercelayer.io";
|
4
|
-
readonly pageNumber: 1;
|
5
|
-
readonly pageSize: 10;
|
6
|
-
};
|
7
|
-
readonly client: {
|
8
|
-
readonly timeout: 15000;
|
9
|
-
};
|
10
|
-
};
|
11
|
-
export default config;
|
1
|
+
declare const config:{readonly default:{readonly domain:"commercelayer.io";readonly pageNumber:1;readonly pageSize:10;};readonly client:{readonly timeout:15000;};};export default config;
|
package/lib/cjs/config.js
CHANGED
@@ -1,13 +1 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
const config = {
|
4
|
-
default: {
|
5
|
-
domain: 'commercelayer.io',
|
6
|
-
pageNumber: 1,
|
7
|
-
pageSize: 10,
|
8
|
-
},
|
9
|
-
client: {
|
10
|
-
timeout: 15000,
|
11
|
-
}
|
12
|
-
};
|
13
|
-
exports.default = config;
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const config={default:{domain:"commercelayer.io",pageNumber:1,pageSize:10},client:{timeout:15e3}};exports.default=config;
|