@commercelayer/sdk 4.28.0 → 4.28.1
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 +9 -23
- package/lib/cjs/api.js +35 -4
- package/lib/cjs/client.d.ts +5 -3
- package/lib/cjs/client.js +8 -11
- package/lib/cjs/commercelayer.d.ts +11 -5
- package/lib/cjs/commercelayer.js +9 -3
- package/lib/cjs/common.d.ts +0 -1
- package/lib/cjs/common.js +2 -11
- package/lib/cjs/config.d.ts +0 -1
- package/lib/cjs/config.js +0 -1
- package/lib/cjs/debug.js +4 -0
- package/lib/cjs/error.js +4 -1
- package/lib/cjs/index.d.ts +1 -1
- package/lib/cjs/index.js +16 -0
- package/lib/cjs/interceptor.d.ts +2 -6
- package/lib/cjs/jsonapi.js +1 -5
- package/lib/cjs/model.d.ts +9 -3
- package/lib/cjs/query.d.ts +15 -9
- package/lib/cjs/query.js +2 -3
- package/lib/cjs/resource.d.ts +19 -29
- package/lib/cjs/resource.js +9 -34
- package/lib/cjs/resources/addresses.d.ts +75 -73
- package/lib/cjs/resources/addresses.js +15 -3
- package/lib/cjs/resources/adjustments.d.ts +21 -19
- package/lib/cjs/resources/adjustments.js +15 -3
- package/lib/cjs/resources/adyen_gateways.d.ts +36 -34
- package/lib/cjs/resources/adyen_gateways.js +15 -3
- package/lib/cjs/resources/adyen_payments.d.ts +29 -27
- package/lib/cjs/resources/adyen_payments.js +15 -3
- package/lib/cjs/resources/application.d.ts +13 -14
- package/lib/cjs/resources/application.js +6 -1
- package/lib/cjs/resources/attachments.d.ts +80 -81
- package/lib/cjs/resources/attachments.js +11 -3
- package/lib/cjs/resources/authorizations.d.ts +49 -44
- package/lib/cjs/resources/authorizations.js +21 -5
- package/lib/cjs/resources/avalara_accounts.d.ts +33 -31
- package/lib/cjs/resources/avalara_accounts.js +15 -3
- package/lib/cjs/resources/axerve_gateways.d.ts +25 -22
- package/lib/cjs/resources/axerve_gateways.js +15 -3
- package/lib/cjs/resources/axerve_payments.d.ts +34 -26
- package/lib/cjs/resources/axerve_payments.js +15 -3
- package/lib/cjs/resources/billing_info_validation_rules.d.ts +18 -16
- package/lib/cjs/resources/billing_info_validation_rules.js +15 -3
- package/lib/cjs/resources/bing_geocoders.d.ts +15 -16
- package/lib/cjs/resources/bing_geocoders.js +11 -3
- package/lib/cjs/resources/braintree_gateways.d.ts +35 -33
- package/lib/cjs/resources/braintree_gateways.js +15 -3
- package/lib/cjs/resources/braintree_payments.d.ts +31 -29
- package/lib/cjs/resources/braintree_payments.js +15 -3
- package/lib/cjs/resources/bundles.d.ts +58 -56
- package/lib/cjs/resources/bundles.js +15 -3
- package/lib/cjs/resources/buy_x_pay_y_promotions.d.ts +134 -0
- package/lib/cjs/resources/buy_x_pay_y_promotions.js +81 -0
- package/lib/cjs/resources/captures.d.ts +40 -35
- package/lib/cjs/resources/captures.js +21 -5
- package/lib/cjs/resources/carrier_accounts.d.ts +17 -15
- package/lib/cjs/resources/carrier_accounts.js +12 -0
- package/lib/cjs/resources/checkout_com_gateways.d.ts +26 -24
- package/lib/cjs/resources/checkout_com_gateways.js +15 -3
- package/lib/cjs/resources/checkout_com_payments.d.ts +40 -38
- package/lib/cjs/resources/checkout_com_payments.js +15 -3
- package/lib/cjs/resources/cleanups.d.ts +25 -23
- package/lib/cjs/resources/cleanups.js +14 -2
- package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +37 -31
- package/lib/cjs/resources/coupon_codes_promotion_rules.js +15 -3
- package/lib/cjs/resources/coupon_recipients.d.ts +27 -25
- package/lib/cjs/resources/coupon_recipients.js +15 -3
- package/lib/cjs/resources/coupons.d.ts +46 -33
- package/lib/cjs/resources/coupons.js +19 -3
- package/lib/cjs/resources/custom_promotion_rules.d.ts +61 -0
- package/lib/cjs/resources/custom_promotion_rules.js +37 -0
- package/lib/cjs/resources/customer_addresses.d.ts +25 -21
- package/lib/cjs/resources/customer_addresses.js +15 -3
- package/lib/cjs/resources/customer_groups.d.ts +18 -16
- package/lib/cjs/resources/customer_groups.js +15 -3
- package/lib/cjs/resources/customer_password_resets.d.ts +17 -18
- package/lib/cjs/resources/customer_password_resets.js +11 -3
- package/lib/cjs/resources/customer_payment_sources.d.ts +51 -45
- package/lib/cjs/resources/customer_payment_sources.js +19 -3
- package/lib/cjs/resources/customer_subscriptions.d.ts +16 -14
- package/lib/cjs/resources/customer_subscriptions.js +15 -3
- package/lib/cjs/resources/customers.d.ts +36 -36
- package/lib/cjs/resources/customers.js +11 -3
- package/lib/cjs/resources/delivery_lead_times.d.ts +28 -26
- package/lib/cjs/resources/delivery_lead_times.js +15 -3
- package/lib/cjs/resources/event_callbacks.d.ts +14 -15
- package/lib/cjs/resources/event_callbacks.js +8 -0
- package/lib/cjs/resources/events.d.ts +12 -13
- package/lib/cjs/resources/events.js +8 -0
- package/lib/cjs/resources/exports.d.ts +26 -27
- package/lib/cjs/resources/exports.js +10 -2
- package/lib/cjs/resources/external_gateways.d.ts +33 -31
- package/lib/cjs/resources/external_gateways.js +15 -3
- package/lib/cjs/resources/external_payments.d.ts +24 -22
- package/lib/cjs/resources/external_payments.js +15 -3
- package/lib/cjs/resources/external_promotions.d.ts +92 -62
- package/lib/cjs/resources/external_promotions.js +31 -3
- package/lib/cjs/resources/external_tax_calculators.d.ts +20 -18
- package/lib/cjs/resources/external_tax_calculators.js +15 -3
- package/lib/cjs/resources/fixed_amount_promotions.d.ts +93 -63
- package/lib/cjs/resources/fixed_amount_promotions.js +31 -3
- package/lib/cjs/resources/fixed_price_promotions.d.ts +89 -70
- package/lib/cjs/resources/fixed_price_promotions.js +25 -5
- package/lib/cjs/resources/free_gift_promotions.d.ts +88 -69
- package/lib/cjs/resources/free_gift_promotions.js +25 -5
- package/lib/cjs/resources/free_shipping_promotions.d.ts +86 -59
- package/lib/cjs/resources/free_shipping_promotions.js +27 -3
- package/lib/cjs/resources/geocoders.d.ts +12 -13
- package/lib/cjs/resources/geocoders.js +8 -0
- package/lib/cjs/resources/gift_card_recipients.d.ts +27 -25
- package/lib/cjs/resources/gift_card_recipients.js +15 -3
- package/lib/cjs/resources/gift_cards.d.ts +68 -66
- package/lib/cjs/resources/gift_cards.js +15 -3
- package/lib/cjs/resources/google_geocoders.d.ts +15 -16
- package/lib/cjs/resources/google_geocoders.js +11 -3
- package/lib/cjs/resources/imports.d.ts +29 -32
- package/lib/cjs/resources/imports.js +10 -2
- package/lib/cjs/resources/in_stock_subscriptions.d.ts +37 -35
- package/lib/cjs/resources/in_stock_subscriptions.js +15 -3
- package/lib/cjs/resources/inventory_models.d.ts +33 -22
- package/lib/cjs/resources/inventory_models.js +15 -3
- package/lib/cjs/resources/inventory_return_locations.d.ts +23 -21
- package/lib/cjs/resources/inventory_return_locations.js +15 -3
- package/lib/cjs/resources/inventory_stock_locations.d.ts +26 -24
- package/lib/cjs/resources/inventory_stock_locations.js +15 -3
- package/lib/cjs/resources/klarna_gateways.d.ts +24 -22
- package/lib/cjs/resources/klarna_gateways.js +15 -3
- package/lib/cjs/resources/klarna_payments.d.ts +29 -27
- package/lib/cjs/resources/klarna_payments.js +15 -3
- package/lib/cjs/resources/line_item_options.d.ts +40 -41
- package/lib/cjs/resources/line_item_options.js +11 -3
- package/lib/cjs/resources/line_items.d.ts +105 -87
- package/lib/cjs/resources/line_items.js +19 -3
- package/lib/cjs/resources/manual_gateways.d.ts +16 -14
- package/lib/cjs/resources/manual_gateways.js +15 -3
- package/lib/cjs/resources/manual_tax_calculators.d.ts +22 -20
- package/lib/cjs/resources/manual_tax_calculators.js +15 -3
- package/lib/cjs/resources/markets.d.ts +66 -59
- package/lib/cjs/resources/markets.js +15 -3
- package/lib/cjs/resources/merchants.d.ts +20 -18
- package/lib/cjs/resources/merchants.js +15 -3
- package/lib/cjs/resources/order_amount_promotion_rules.d.ts +40 -31
- package/lib/cjs/resources/order_amount_promotion_rules.js +15 -3
- package/lib/cjs/resources/order_copies.d.ts +28 -29
- package/lib/cjs/resources/order_copies.js +11 -3
- package/lib/cjs/resources/order_factories.d.ts +20 -21
- package/lib/cjs/resources/order_factories.js +8 -0
- package/lib/cjs/resources/order_subscription_items.d.ts +41 -35
- package/lib/cjs/resources/order_subscription_items.js +15 -3
- package/lib/cjs/resources/order_subscriptions.d.ts +54 -51
- package/lib/cjs/resources/order_subscriptions.js +15 -3
- package/lib/cjs/resources/order_validation_rules.d.ts +14 -12
- package/lib/cjs/resources/order_validation_rules.js +12 -0
- package/lib/cjs/resources/orders.d.ts +266 -231
- package/lib/cjs/resources/orders.js +39 -3
- package/lib/cjs/resources/organization.d.ts +24 -25
- package/lib/cjs/resources/organization.js +6 -1
- package/lib/cjs/resources/packages.d.ts +32 -30
- package/lib/cjs/resources/packages.js +15 -3
- package/lib/cjs/resources/parcel_line_items.d.ts +24 -22
- package/lib/cjs/resources/parcel_line_items.js +15 -3
- package/lib/cjs/resources/parcels.d.ts +95 -93
- package/lib/cjs/resources/parcels.js +15 -3
- package/lib/cjs/resources/payment_gateways.d.ts +14 -12
- package/lib/cjs/resources/payment_gateways.js +12 -0
- package/lib/cjs/resources/payment_methods.d.ts +55 -48
- package/lib/cjs/resources/payment_methods.js +15 -3
- package/lib/cjs/resources/payment_options.d.ts +43 -0
- package/lib/cjs/resources/payment_options.js +41 -0
- package/lib/cjs/resources/paypal_gateways.d.ts +19 -17
- package/lib/cjs/resources/paypal_gateways.js +15 -3
- package/lib/cjs/resources/paypal_payments.d.ts +33 -31
- package/lib/cjs/resources/paypal_payments.js +15 -3
- package/lib/cjs/resources/percentage_discount_promotions.d.ts +88 -69
- package/lib/cjs/resources/percentage_discount_promotions.js +25 -5
- package/lib/cjs/resources/price_frequency_tiers.d.ts +28 -26
- package/lib/cjs/resources/price_frequency_tiers.js +15 -3
- package/lib/cjs/resources/price_lists.d.ts +25 -20
- package/lib/cjs/resources/price_lists.js +15 -3
- package/lib/cjs/resources/price_tiers.d.ts +19 -17
- package/lib/cjs/resources/price_tiers.js +12 -0
- package/lib/cjs/resources/price_volume_tiers.d.ts +28 -26
- package/lib/cjs/resources/price_volume_tiers.js +15 -3
- package/lib/cjs/resources/prices.d.ts +42 -40
- package/lib/cjs/resources/prices.js +15 -3
- package/lib/cjs/resources/promotion_rules.d.ts +14 -10
- package/lib/cjs/resources/promotion_rules.js +12 -0
- package/lib/cjs/resources/promotions.d.ts +39 -25
- package/lib/cjs/resources/promotions.js +24 -0
- package/lib/cjs/resources/recurring_order_copies.d.ts +28 -29
- package/lib/cjs/resources/recurring_order_copies.js +11 -3
- package/lib/cjs/resources/refunds.d.ts +31 -26
- package/lib/cjs/resources/refunds.js +18 -2
- package/lib/cjs/resources/reserved_stocks.d.ts +27 -0
- package/lib/cjs/resources/reserved_stocks.js +36 -0
- package/lib/cjs/resources/return_line_items.d.ts +27 -27
- package/lib/cjs/resources/return_line_items.js +11 -3
- package/lib/cjs/resources/returns.d.ts +51 -49
- package/lib/cjs/resources/returns.js +15 -3
- package/lib/cjs/resources/satispay_gateways.d.ts +24 -22
- package/lib/cjs/resources/satispay_gateways.js +15 -3
- package/lib/cjs/resources/satispay_payments.d.ts +31 -21
- package/lib/cjs/resources/satispay_payments.js +15 -3
- package/lib/cjs/resources/shipments.d.ts +98 -52
- package/lib/cjs/resources/shipments.js +27 -1
- package/lib/cjs/resources/shipping_categories.d.ts +20 -15
- package/lib/cjs/resources/shipping_categories.js +15 -3
- package/lib/cjs/resources/shipping_method_tiers.d.ts +19 -17
- package/lib/cjs/resources/shipping_method_tiers.js +12 -0
- package/lib/cjs/resources/shipping_methods.d.ts +81 -71
- package/lib/cjs/resources/shipping_methods.js +15 -3
- package/lib/cjs/resources/shipping_weight_tiers.d.ts +27 -25
- package/lib/cjs/resources/shipping_weight_tiers.js +15 -3
- package/lib/cjs/resources/shipping_zones.d.ts +34 -32
- package/lib/cjs/resources/shipping_zones.js +15 -3
- package/lib/cjs/resources/sku_list_items.d.ts +28 -26
- package/lib/cjs/resources/sku_list_items.js +15 -3
- package/lib/cjs/resources/sku_list_promotion_rules.d.ts +44 -38
- package/lib/cjs/resources/sku_list_promotion_rules.js +15 -3
- package/lib/cjs/resources/sku_lists.d.ts +37 -35
- package/lib/cjs/resources/sku_lists.js +15 -3
- package/lib/cjs/resources/sku_options.d.ts +45 -43
- package/lib/cjs/resources/sku_options.js +15 -3
- package/lib/cjs/resources/skus.d.ts +60 -55
- package/lib/cjs/resources/skus.js +19 -3
- package/lib/cjs/resources/stock_items.d.ts +34 -26
- package/lib/cjs/resources/stock_items.js +23 -3
- package/lib/cjs/resources/stock_line_items.d.ts +54 -15
- package/lib/cjs/resources/stock_line_items.js +25 -0
- package/lib/cjs/resources/stock_locations.d.ts +34 -29
- package/lib/cjs/resources/stock_locations.js +15 -3
- package/lib/cjs/resources/stock_reservations.d.ts +49 -0
- package/lib/cjs/resources/stock_reservations.js +53 -0
- package/lib/cjs/resources/stock_transfers.d.ts +46 -42
- package/lib/cjs/resources/stock_transfers.js +15 -3
- package/lib/cjs/resources/stripe_gateways.d.ts +24 -22
- package/lib/cjs/resources/stripe_gateways.js +15 -3
- package/lib/cjs/resources/stripe_payments.d.ts +39 -28
- package/lib/cjs/resources/stripe_payments.js +15 -3
- package/lib/cjs/resources/subscription_models.d.ts +26 -27
- package/lib/cjs/resources/subscription_models.js +11 -3
- package/lib/cjs/resources/tags.d.ts +12 -13
- package/lib/cjs/resources/tags.js +11 -3
- package/lib/cjs/resources/tax_calculators.d.ts +15 -13
- package/lib/cjs/resources/tax_calculators.js +12 -0
- package/lib/cjs/resources/tax_categories.d.ts +32 -30
- package/lib/cjs/resources/tax_categories.js +15 -3
- package/lib/cjs/resources/tax_rules.d.ts +53 -51
- package/lib/cjs/resources/tax_rules.js +15 -3
- package/lib/cjs/resources/taxjar_accounts.d.ts +23 -21
- package/lib/cjs/resources/taxjar_accounts.js +15 -3
- package/lib/cjs/resources/transactions.d.ts +30 -22
- package/lib/cjs/resources/transactions.js +20 -0
- package/lib/cjs/resources/versions.d.ts +22 -0
- package/lib/cjs/resources/versions.js +24 -0
- package/lib/cjs/resources/voids.d.ts +31 -26
- package/lib/cjs/resources/voids.js +18 -2
- package/lib/cjs/resources/webhooks.d.ts +33 -26
- package/lib/cjs/resources/webhooks.js +15 -3
- package/lib/cjs/resources/wire_transfers.d.ts +18 -16
- package/lib/cjs/resources/wire_transfers.js +15 -3
- package/lib/cjs/static.d.ts +1 -1
- package/lib/cjs/util.d.ts +4 -1
- package/lib/esm/api.d.ts +9 -23
- package/lib/esm/api.js +26 -1
- package/lib/esm/client.d.ts +5 -3
- package/lib/esm/client.js +8 -11
- package/lib/esm/commercelayer.d.ts +11 -5
- package/lib/esm/commercelayer.js +9 -3
- package/lib/esm/common.d.ts +0 -1
- package/lib/esm/common.js +2 -11
- package/lib/esm/config.d.ts +0 -1
- package/lib/esm/config.js +0 -1
- package/lib/esm/debug.js +4 -0
- package/lib/esm/error.js +4 -1
- package/lib/esm/index.d.ts +1 -1
- package/lib/esm/index.js +2 -0
- package/lib/esm/interceptor.d.ts +2 -6
- package/lib/esm/jsonapi.js +1 -5
- package/lib/esm/model.d.ts +9 -3
- package/lib/esm/query.d.ts +15 -9
- package/lib/esm/query.js +2 -2
- package/lib/esm/resource.d.ts +19 -29
- package/lib/esm/resource.js +10 -34
- package/lib/esm/resources/addresses.d.ts +75 -73
- package/lib/esm/resources/addresses.js +15 -3
- package/lib/esm/resources/adjustments.d.ts +21 -19
- package/lib/esm/resources/adjustments.js +15 -3
- package/lib/esm/resources/adyen_gateways.d.ts +36 -34
- package/lib/esm/resources/adyen_gateways.js +15 -3
- package/lib/esm/resources/adyen_payments.d.ts +29 -27
- package/lib/esm/resources/adyen_payments.js +15 -3
- package/lib/esm/resources/application.d.ts +13 -14
- package/lib/esm/resources/application.js +7 -2
- package/lib/esm/resources/attachments.d.ts +80 -81
- package/lib/esm/resources/attachments.js +11 -3
- package/lib/esm/resources/authorizations.d.ts +49 -44
- package/lib/esm/resources/authorizations.js +21 -5
- package/lib/esm/resources/avalara_accounts.d.ts +33 -31
- package/lib/esm/resources/avalara_accounts.js +15 -3
- package/lib/esm/resources/axerve_gateways.d.ts +25 -22
- package/lib/esm/resources/axerve_gateways.js +15 -3
- package/lib/esm/resources/axerve_payments.d.ts +34 -26
- package/lib/esm/resources/axerve_payments.js +15 -3
- package/lib/esm/resources/billing_info_validation_rules.d.ts +18 -16
- package/lib/esm/resources/billing_info_validation_rules.js +15 -3
- package/lib/esm/resources/bing_geocoders.d.ts +15 -16
- package/lib/esm/resources/bing_geocoders.js +11 -3
- package/lib/esm/resources/braintree_gateways.d.ts +35 -33
- package/lib/esm/resources/braintree_gateways.js +15 -3
- package/lib/esm/resources/braintree_payments.d.ts +31 -29
- package/lib/esm/resources/braintree_payments.js +15 -3
- package/lib/esm/resources/bundles.d.ts +58 -56
- package/lib/esm/resources/bundles.js +15 -3
- package/lib/esm/resources/buy_x_pay_y_promotions.d.ts +134 -0
- package/lib/esm/resources/buy_x_pay_y_promotions.js +79 -0
- package/lib/esm/resources/captures.d.ts +40 -35
- package/lib/esm/resources/captures.js +21 -5
- package/lib/esm/resources/carrier_accounts.d.ts +17 -15
- package/lib/esm/resources/carrier_accounts.js +12 -0
- package/lib/esm/resources/checkout_com_gateways.d.ts +26 -24
- package/lib/esm/resources/checkout_com_gateways.js +15 -3
- package/lib/esm/resources/checkout_com_payments.d.ts +40 -38
- package/lib/esm/resources/checkout_com_payments.js +15 -3
- package/lib/esm/resources/cleanups.d.ts +25 -23
- package/lib/esm/resources/cleanups.js +14 -2
- package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +37 -31
- package/lib/esm/resources/coupon_codes_promotion_rules.js +15 -3
- package/lib/esm/resources/coupon_recipients.d.ts +27 -25
- package/lib/esm/resources/coupon_recipients.js +15 -3
- package/lib/esm/resources/coupons.d.ts +46 -33
- package/lib/esm/resources/coupons.js +19 -3
- package/lib/esm/resources/custom_promotion_rules.d.ts +61 -0
- package/lib/esm/resources/custom_promotion_rules.js +35 -0
- package/lib/esm/resources/customer_addresses.d.ts +25 -21
- package/lib/esm/resources/customer_addresses.js +15 -3
- package/lib/esm/resources/customer_groups.d.ts +18 -16
- package/lib/esm/resources/customer_groups.js +15 -3
- package/lib/esm/resources/customer_password_resets.d.ts +17 -18
- package/lib/esm/resources/customer_password_resets.js +11 -3
- package/lib/esm/resources/customer_payment_sources.d.ts +51 -45
- package/lib/esm/resources/customer_payment_sources.js +19 -3
- package/lib/esm/resources/customer_subscriptions.d.ts +16 -14
- package/lib/esm/resources/customer_subscriptions.js +15 -3
- package/lib/esm/resources/customers.d.ts +36 -36
- package/lib/esm/resources/customers.js +11 -3
- package/lib/esm/resources/delivery_lead_times.d.ts +28 -26
- package/lib/esm/resources/delivery_lead_times.js +15 -3
- package/lib/esm/resources/event_callbacks.d.ts +14 -15
- package/lib/esm/resources/event_callbacks.js +8 -0
- package/lib/esm/resources/events.d.ts +12 -13
- package/lib/esm/resources/events.js +8 -0
- package/lib/esm/resources/exports.d.ts +26 -27
- package/lib/esm/resources/exports.js +10 -2
- package/lib/esm/resources/external_gateways.d.ts +33 -31
- package/lib/esm/resources/external_gateways.js +15 -3
- package/lib/esm/resources/external_payments.d.ts +24 -22
- package/lib/esm/resources/external_payments.js +15 -3
- package/lib/esm/resources/external_promotions.d.ts +92 -62
- package/lib/esm/resources/external_promotions.js +31 -3
- package/lib/esm/resources/external_tax_calculators.d.ts +20 -18
- package/lib/esm/resources/external_tax_calculators.js +15 -3
- package/lib/esm/resources/fixed_amount_promotions.d.ts +93 -63
- package/lib/esm/resources/fixed_amount_promotions.js +31 -3
- package/lib/esm/resources/fixed_price_promotions.d.ts +89 -70
- package/lib/esm/resources/fixed_price_promotions.js +25 -5
- package/lib/esm/resources/free_gift_promotions.d.ts +88 -69
- package/lib/esm/resources/free_gift_promotions.js +25 -5
- package/lib/esm/resources/free_shipping_promotions.d.ts +86 -59
- package/lib/esm/resources/free_shipping_promotions.js +27 -3
- package/lib/esm/resources/geocoders.d.ts +12 -13
- package/lib/esm/resources/geocoders.js +8 -0
- package/lib/esm/resources/gift_card_recipients.d.ts +27 -25
- package/lib/esm/resources/gift_card_recipients.js +15 -3
- package/lib/esm/resources/gift_cards.d.ts +68 -66
- package/lib/esm/resources/gift_cards.js +15 -3
- package/lib/esm/resources/google_geocoders.d.ts +15 -16
- package/lib/esm/resources/google_geocoders.js +11 -3
- package/lib/esm/resources/imports.d.ts +29 -32
- package/lib/esm/resources/imports.js +10 -2
- package/lib/esm/resources/in_stock_subscriptions.d.ts +37 -35
- package/lib/esm/resources/in_stock_subscriptions.js +15 -3
- package/lib/esm/resources/inventory_models.d.ts +33 -22
- package/lib/esm/resources/inventory_models.js +15 -3
- package/lib/esm/resources/inventory_return_locations.d.ts +23 -21
- package/lib/esm/resources/inventory_return_locations.js +15 -3
- package/lib/esm/resources/inventory_stock_locations.d.ts +26 -24
- package/lib/esm/resources/inventory_stock_locations.js +15 -3
- package/lib/esm/resources/klarna_gateways.d.ts +24 -22
- package/lib/esm/resources/klarna_gateways.js +15 -3
- package/lib/esm/resources/klarna_payments.d.ts +29 -27
- package/lib/esm/resources/klarna_payments.js +15 -3
- package/lib/esm/resources/line_item_options.d.ts +40 -41
- package/lib/esm/resources/line_item_options.js +11 -3
- package/lib/esm/resources/line_items.d.ts +105 -87
- package/lib/esm/resources/line_items.js +19 -3
- package/lib/esm/resources/manual_gateways.d.ts +16 -14
- package/lib/esm/resources/manual_gateways.js +15 -3
- package/lib/esm/resources/manual_tax_calculators.d.ts +22 -20
- package/lib/esm/resources/manual_tax_calculators.js +15 -3
- package/lib/esm/resources/markets.d.ts +66 -59
- package/lib/esm/resources/markets.js +15 -3
- package/lib/esm/resources/merchants.d.ts +20 -18
- package/lib/esm/resources/merchants.js +15 -3
- package/lib/esm/resources/order_amount_promotion_rules.d.ts +40 -31
- package/lib/esm/resources/order_amount_promotion_rules.js +15 -3
- package/lib/esm/resources/order_copies.d.ts +28 -29
- package/lib/esm/resources/order_copies.js +11 -3
- package/lib/esm/resources/order_factories.d.ts +20 -21
- package/lib/esm/resources/order_factories.js +8 -0
- package/lib/esm/resources/order_subscription_items.d.ts +41 -35
- package/lib/esm/resources/order_subscription_items.js +15 -3
- package/lib/esm/resources/order_subscriptions.d.ts +54 -51
- package/lib/esm/resources/order_subscriptions.js +15 -3
- package/lib/esm/resources/order_validation_rules.d.ts +14 -12
- package/lib/esm/resources/order_validation_rules.js +12 -0
- package/lib/esm/resources/orders.d.ts +266 -231
- package/lib/esm/resources/orders.js +39 -3
- package/lib/esm/resources/organization.d.ts +24 -25
- package/lib/esm/resources/organization.js +7 -2
- package/lib/esm/resources/packages.d.ts +32 -30
- package/lib/esm/resources/packages.js +15 -3
- package/lib/esm/resources/parcel_line_items.d.ts +24 -22
- package/lib/esm/resources/parcel_line_items.js +15 -3
- package/lib/esm/resources/parcels.d.ts +95 -93
- package/lib/esm/resources/parcels.js +15 -3
- package/lib/esm/resources/payment_gateways.d.ts +14 -12
- package/lib/esm/resources/payment_gateways.js +12 -0
- package/lib/esm/resources/payment_methods.d.ts +55 -48
- package/lib/esm/resources/payment_methods.js +15 -3
- package/lib/esm/resources/payment_options.d.ts +43 -0
- package/lib/esm/resources/payment_options.js +39 -0
- package/lib/esm/resources/paypal_gateways.d.ts +19 -17
- package/lib/esm/resources/paypal_gateways.js +15 -3
- package/lib/esm/resources/paypal_payments.d.ts +33 -31
- package/lib/esm/resources/paypal_payments.js +15 -3
- package/lib/esm/resources/percentage_discount_promotions.d.ts +88 -69
- package/lib/esm/resources/percentage_discount_promotions.js +25 -5
- package/lib/esm/resources/price_frequency_tiers.d.ts +28 -26
- package/lib/esm/resources/price_frequency_tiers.js +15 -3
- package/lib/esm/resources/price_lists.d.ts +25 -20
- package/lib/esm/resources/price_lists.js +15 -3
- package/lib/esm/resources/price_tiers.d.ts +19 -17
- package/lib/esm/resources/price_tiers.js +12 -0
- package/lib/esm/resources/price_volume_tiers.d.ts +28 -26
- package/lib/esm/resources/price_volume_tiers.js +15 -3
- package/lib/esm/resources/prices.d.ts +42 -40
- package/lib/esm/resources/prices.js +15 -3
- package/lib/esm/resources/promotion_rules.d.ts +14 -10
- package/lib/esm/resources/promotion_rules.js +12 -0
- package/lib/esm/resources/promotions.d.ts +39 -25
- package/lib/esm/resources/promotions.js +24 -0
- package/lib/esm/resources/recurring_order_copies.d.ts +28 -29
- package/lib/esm/resources/recurring_order_copies.js +11 -3
- package/lib/esm/resources/refunds.d.ts +31 -26
- package/lib/esm/resources/refunds.js +18 -2
- package/lib/esm/resources/reserved_stocks.d.ts +27 -0
- package/lib/esm/resources/reserved_stocks.js +34 -0
- package/lib/esm/resources/return_line_items.d.ts +27 -27
- package/lib/esm/resources/return_line_items.js +11 -3
- package/lib/esm/resources/returns.d.ts +51 -49
- package/lib/esm/resources/returns.js +15 -3
- package/lib/esm/resources/satispay_gateways.d.ts +24 -22
- package/lib/esm/resources/satispay_gateways.js +15 -3
- package/lib/esm/resources/satispay_payments.d.ts +31 -21
- package/lib/esm/resources/satispay_payments.js +15 -3
- package/lib/esm/resources/shipments.d.ts +98 -52
- package/lib/esm/resources/shipments.js +27 -1
- package/lib/esm/resources/shipping_categories.d.ts +20 -15
- package/lib/esm/resources/shipping_categories.js +15 -3
- package/lib/esm/resources/shipping_method_tiers.d.ts +19 -17
- package/lib/esm/resources/shipping_method_tiers.js +12 -0
- package/lib/esm/resources/shipping_methods.d.ts +81 -71
- package/lib/esm/resources/shipping_methods.js +15 -3
- package/lib/esm/resources/shipping_weight_tiers.d.ts +27 -25
- package/lib/esm/resources/shipping_weight_tiers.js +15 -3
- package/lib/esm/resources/shipping_zones.d.ts +34 -32
- package/lib/esm/resources/shipping_zones.js +15 -3
- package/lib/esm/resources/sku_list_items.d.ts +28 -26
- package/lib/esm/resources/sku_list_items.js +15 -3
- package/lib/esm/resources/sku_list_promotion_rules.d.ts +44 -38
- package/lib/esm/resources/sku_list_promotion_rules.js +15 -3
- package/lib/esm/resources/sku_lists.d.ts +37 -35
- package/lib/esm/resources/sku_lists.js +15 -3
- package/lib/esm/resources/sku_options.d.ts +45 -43
- package/lib/esm/resources/sku_options.js +15 -3
- package/lib/esm/resources/skus.d.ts +60 -55
- package/lib/esm/resources/skus.js +19 -3
- package/lib/esm/resources/stock_items.d.ts +34 -26
- package/lib/esm/resources/stock_items.js +23 -3
- package/lib/esm/resources/stock_line_items.d.ts +54 -15
- package/lib/esm/resources/stock_line_items.js +25 -0
- package/lib/esm/resources/stock_locations.d.ts +34 -29
- package/lib/esm/resources/stock_locations.js +15 -3
- package/lib/esm/resources/stock_reservations.d.ts +49 -0
- package/lib/esm/resources/stock_reservations.js +51 -0
- package/lib/esm/resources/stock_transfers.d.ts +46 -42
- package/lib/esm/resources/stock_transfers.js +15 -3
- package/lib/esm/resources/stripe_gateways.d.ts +24 -22
- package/lib/esm/resources/stripe_gateways.js +15 -3
- package/lib/esm/resources/stripe_payments.d.ts +39 -28
- package/lib/esm/resources/stripe_payments.js +15 -3
- package/lib/esm/resources/subscription_models.d.ts +26 -27
- package/lib/esm/resources/subscription_models.js +11 -3
- package/lib/esm/resources/tags.d.ts +12 -13
- package/lib/esm/resources/tags.js +11 -3
- package/lib/esm/resources/tax_calculators.d.ts +15 -13
- package/lib/esm/resources/tax_calculators.js +12 -0
- package/lib/esm/resources/tax_categories.d.ts +32 -30
- package/lib/esm/resources/tax_categories.js +15 -3
- package/lib/esm/resources/tax_rules.d.ts +53 -51
- package/lib/esm/resources/tax_rules.js +15 -3
- package/lib/esm/resources/taxjar_accounts.d.ts +23 -21
- package/lib/esm/resources/taxjar_accounts.js +15 -3
- package/lib/esm/resources/transactions.d.ts +30 -22
- package/lib/esm/resources/transactions.js +20 -0
- package/lib/esm/resources/versions.d.ts +22 -0
- package/lib/esm/resources/versions.js +22 -0
- package/lib/esm/resources/voids.d.ts +31 -26
- package/lib/esm/resources/voids.js +18 -2
- package/lib/esm/resources/webhooks.d.ts +33 -26
- package/lib/esm/resources/webhooks.js +15 -3
- package/lib/esm/resources/wire_transfers.d.ts +18 -16
- package/lib/esm/resources/wire_transfers.js +15 -3
- package/lib/esm/static.d.ts +1 -1
- package/lib/esm/util.d.ts +4 -1
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +25 -25
- package/lib/cjs/micro.d.ts +0 -4
- package/lib/cjs/micro.js +0 -13
- package/lib/esm/micro.d.ts +0 -4
- package/lib/esm/micro.js +0 -7
package/lib/cjs/api.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* ©
|
2
|
+
* ©2024 Commerce Layer Inc.
|
3
3
|
**/
|
4
4
|
export { default as Addresses } from './resources/addresses';
|
5
5
|
export { default as Adjustments } from './resources/adjustments';
|
@@ -16,6 +16,7 @@ export { default as BingGeocoders } from './resources/bing_geocoders';
|
|
16
16
|
export { default as BraintreeGateways } from './resources/braintree_gateways';
|
17
17
|
export { default as BraintreePayments } from './resources/braintree_payments';
|
18
18
|
export { default as Bundles } from './resources/bundles';
|
19
|
+
export { default as BuyXPayYPromotions } from './resources/buy_x_pay_y_promotions';
|
19
20
|
export { default as Captures } from './resources/captures';
|
20
21
|
export { default as CarrierAccounts } from './resources/carrier_accounts';
|
21
22
|
export { default as CheckoutComGateways } from './resources/checkout_com_gateways';
|
@@ -24,6 +25,7 @@ export { default as Cleanups } from './resources/cleanups';
|
|
24
25
|
export { default as CouponCodesPromotionRules } from './resources/coupon_codes_promotion_rules';
|
25
26
|
export { default as CouponRecipients } from './resources/coupon_recipients';
|
26
27
|
export { default as Coupons } from './resources/coupons';
|
28
|
+
export { default as CustomPromotionRules } from './resources/custom_promotion_rules';
|
27
29
|
export { default as CustomerAddresses } from './resources/customer_addresses';
|
28
30
|
export { default as CustomerGroups } from './resources/customer_groups';
|
29
31
|
export { default as CustomerPasswordResets } from './resources/customer_password_resets';
|
@@ -72,6 +74,7 @@ export { default as ParcelLineItems } from './resources/parcel_line_items';
|
|
72
74
|
export { default as Parcels } from './resources/parcels';
|
73
75
|
export { default as PaymentGateways } from './resources/payment_gateways';
|
74
76
|
export { default as PaymentMethods } from './resources/payment_methods';
|
77
|
+
export { default as PaymentOptions } from './resources/payment_options';
|
75
78
|
export { default as PaypalGateways } from './resources/paypal_gateways';
|
76
79
|
export { default as PaypalPayments } from './resources/paypal_payments';
|
77
80
|
export { default as PercentageDiscountPromotions } from './resources/percentage_discount_promotions';
|
@@ -84,6 +87,7 @@ export { default as PromotionRules } from './resources/promotion_rules';
|
|
84
87
|
export { default as Promotions } from './resources/promotions';
|
85
88
|
export { default as RecurringOrderCopies } from './resources/recurring_order_copies';
|
86
89
|
export { default as Refunds } from './resources/refunds';
|
90
|
+
export { default as ReservedStocks } from './resources/reserved_stocks';
|
87
91
|
export { default as ReturnLineItems } from './resources/return_line_items';
|
88
92
|
export { default as Returns } from './resources/returns';
|
89
93
|
export { default as SatispayGateways } from './resources/satispay_gateways';
|
@@ -102,6 +106,7 @@ export { default as Skus } from './resources/skus';
|
|
102
106
|
export { default as StockItems } from './resources/stock_items';
|
103
107
|
export { default as StockLineItems } from './resources/stock_line_items';
|
104
108
|
export { default as StockLocations } from './resources/stock_locations';
|
109
|
+
export { default as StockReservations } from './resources/stock_reservations';
|
105
110
|
export { default as StockTransfers } from './resources/stock_transfers';
|
106
111
|
export { default as StripeGateways } from './resources/stripe_gateways';
|
107
112
|
export { default as StripePayments } from './resources/stripe_payments';
|
@@ -112,28 +117,9 @@ export { default as TaxCategories } from './resources/tax_categories';
|
|
112
117
|
export { default as TaxRules } from './resources/tax_rules';
|
113
118
|
export { default as TaxjarAccounts } from './resources/taxjar_accounts';
|
114
119
|
export { default as Transactions } from './resources/transactions';
|
120
|
+
export { default as Versions } from './resources/versions';
|
115
121
|
export { default as Voids } from './resources/voids';
|
116
122
|
export { default as Webhooks } from './resources/webhooks';
|
117
123
|
export { default as WireTransfers } from './resources/wire_transfers';
|
118
|
-
export type ResourceTypeLock = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'application' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'captures' | 'carrier_accounts' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'event_callbacks' | 'events' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'geocoders' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_factories' | 'order_subscription_items' | 'order_subscriptions' | 'order_validation_rules' | 'orders' | 'organization' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_gateways' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_tiers' | 'price_volume_tiers' | 'prices' | 'promotion_rules' | 'promotions' | 'recurring_order_copies' | 'refunds' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_method_tiers' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_line_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_calculators' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'transactions' | 'voids' | 'webhooks' | 'wire_transfers';
|
119
|
-
export declare const resourceList: readonly ["addresses", "adjustments", "adyen_gateways", "adyen_payments", "application", "attachments", "authorizations", "avalara_accounts", "axerve_gateways", "axerve_payments", "billing_info_validation_rules", "bing_geocoders", "braintree_gateways", "braintree_payments", "bundles", "captures", "carrier_accounts", "checkout_com_gateways", "checkout_com_payments", "cleanups", "coupon_codes_promotion_rules", "coupon_recipients", "coupons", "customer_addresses", "customer_groups", "customer_password_resets", "customer_payment_sources", "customer_subscriptions", "customers", "delivery_lead_times", "event_callbacks", "events", "exports", "external_gateways", "external_payments", "external_promotions", "external_tax_calculators", "fixed_amount_promotions", "fixed_price_promotions", "free_gift_promotions", "free_shipping_promotions", "geocoders", "gift_card_recipients", "gift_cards", "google_geocoders", "imports", "in_stock_subscriptions", "inventory_models", "inventory_return_locations", "inventory_stock_locations", "klarna_gateways", "klarna_payments", "line_item_options", "line_items", "manual_gateways", "manual_tax_calculators", "markets", "merchants", "order_amount_promotion_rules", "order_copies", "order_factories", "order_subscription_items", "order_subscriptions", "order_validation_rules", "orders", "organization", "packages", "parcel_line_items", "parcels", "payment_gateways", "payment_methods", "paypal_gateways", "paypal_payments", "percentage_discount_promotions", "price_frequency_tiers", "price_lists", "price_tiers", "price_volume_tiers", "prices", "promotion_rules", "promotions", "recurring_order_copies", "refunds", "return_line_items", "returns", "satispay_gateways", "satispay_payments", "shipments", "shipping_categories", "shipping_method_tiers", "shipping_methods", "shipping_weight_tiers", "shipping_zones", "sku_list_items", "sku_list_promotion_rules", "sku_lists", "sku_options", "skus", "stock_items", "stock_line_items", "stock_locations", "stock_transfers", "stripe_gateways", "stripe_payments", "subscription_models", "tags", "tax_calculators", "tax_categories", "tax_rules", "taxjar_accounts", "transactions", "voids", "webhooks", "wire_transfers"];
|
120
|
-
export type RetrievableResourceType = ResourceTypeLock;
|
121
|
-
export type RetrievableResource = {
|
122
|
-
type: RetrievableResourceType;
|
123
|
-
};
|
124
|
-
export type ListableResourceType = Exclude<ResourceTypeLock, 'application' | 'organization'>;
|
125
|
-
export type ListableResource = {
|
126
|
-
type: ListableResourceType;
|
127
|
-
};
|
128
|
-
export type CreatableResourceType = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'attachments' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_subscription_items' | 'order_subscriptions' | 'orders' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_volume_tiers' | 'prices' | 'recurring_order_copies' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipping_categories' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'webhooks' | 'wire_transfers';
|
129
|
-
export type CreatableResource = {
|
130
|
-
type: CreatableResourceType;
|
131
|
-
};
|
132
|
-
export type UpdatableResourceType = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'captures' | 'checkout_com_gateways' | 'checkout_com_payments' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_subscription_items' | 'order_subscriptions' | 'orders' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_volume_tiers' | 'prices' | 'recurring_order_copies' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'webhooks' | 'wire_transfers';
|
133
|
-
export type UpdatableResource = {
|
134
|
-
type: UpdatableResourceType;
|
135
|
-
};
|
136
|
-
export type DeletableResourceType = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'attachments' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_subscription_items' | 'order_subscriptions' | 'orders' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_volume_tiers' | 'prices' | 'recurring_order_copies' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipping_categories' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'webhooks' | 'wire_transfers';
|
137
|
-
export type DeletableResource = {
|
138
|
-
type: DeletableResourceType;
|
139
|
-
};
|
124
|
+
export type ResourceTypeLock = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'application' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'buy_x_pay_y_promotions' | 'captures' | 'carrier_accounts' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'custom_promotion_rules' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'event_callbacks' | 'events' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'geocoders' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_factories' | 'order_subscription_items' | 'order_subscriptions' | 'order_validation_rules' | 'orders' | 'organization' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_gateways' | 'payment_methods' | 'payment_options' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_tiers' | 'price_volume_tiers' | 'prices' | 'promotion_rules' | 'promotions' | 'recurring_order_copies' | 'refunds' | 'reserved_stocks' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_method_tiers' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_line_items' | 'stock_locations' | 'stock_reservations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_calculators' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'transactions' | 'versions' | 'voids' | 'webhooks' | 'wire_transfers';
|
125
|
+
export declare const resourceList: readonly ["addresses", "adjustments", "adyen_gateways", "adyen_payments", "application", "attachments", "authorizations", "avalara_accounts", "axerve_gateways", "axerve_payments", "billing_info_validation_rules", "bing_geocoders", "braintree_gateways", "braintree_payments", "bundles", "buy_x_pay_y_promotions", "captures", "carrier_accounts", "checkout_com_gateways", "checkout_com_payments", "cleanups", "coupon_codes_promotion_rules", "coupon_recipients", "coupons", "custom_promotion_rules", "customer_addresses", "customer_groups", "customer_password_resets", "customer_payment_sources", "customer_subscriptions", "customers", "delivery_lead_times", "event_callbacks", "events", "exports", "external_gateways", "external_payments", "external_promotions", "external_tax_calculators", "fixed_amount_promotions", "fixed_price_promotions", "free_gift_promotions", "free_shipping_promotions", "geocoders", "gift_card_recipients", "gift_cards", "google_geocoders", "imports", "in_stock_subscriptions", "inventory_models", "inventory_return_locations", "inventory_stock_locations", "klarna_gateways", "klarna_payments", "line_item_options", "line_items", "manual_gateways", "manual_tax_calculators", "markets", "merchants", "order_amount_promotion_rules", "order_copies", "order_factories", "order_subscription_items", "order_subscriptions", "order_validation_rules", "orders", "organization", "packages", "parcel_line_items", "parcels", "payment_gateways", "payment_methods", "payment_options", "paypal_gateways", "paypal_payments", "percentage_discount_promotions", "price_frequency_tiers", "price_lists", "price_tiers", "price_volume_tiers", "prices", "promotion_rules", "promotions", "recurring_order_copies", "refunds", "reserved_stocks", "return_line_items", "returns", "satispay_gateways", "satispay_payments", "shipments", "shipping_categories", "shipping_method_tiers", "shipping_methods", "shipping_weight_tiers", "shipping_zones", "sku_list_items", "sku_list_promotion_rules", "sku_lists", "sku_options", "skus", "stock_items", "stock_line_items", "stock_locations", "stock_reservations", "stock_transfers", "stripe_gateways", "stripe_payments", "subscription_models", "tags", "tax_calculators", "tax_categories", "tax_rules", "taxjar_accounts", "transactions", "versions", "voids", "webhooks", "wire_transfers"];
|
package/lib/cjs/api.js
CHANGED
@@ -3,13 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.
|
7
|
-
exports.
|
8
|
-
exports.resourceList = exports.WireTransfers = exports.Webhooks = exports.Voids = exports.Transactions = exports.TaxjarAccounts = exports.TaxRules = exports.TaxCategories = exports.TaxCalculators = exports.Tags = exports.SubscriptionModels = exports.StripePayments = exports.StripeGateways = exports.StockTransfers = exports.StockLocations = void 0;
|
6
|
+
exports.InventoryModels = exports.InStockSubscriptions = exports.Imports = exports.GoogleGeocoders = exports.GiftCards = exports.GiftCardRecipients = exports.Geocoders = exports.FreeShippingPromotions = exports.FreeGiftPromotions = exports.FixedPricePromotions = exports.FixedAmountPromotions = exports.ExternalTaxCalculators = exports.ExternalPromotions = exports.ExternalPayments = exports.ExternalGateways = exports.Exports = exports.Events = exports.EventCallbacks = exports.DeliveryLeadTimes = exports.Customers = exports.CustomerSubscriptions = exports.CustomerPaymentSources = exports.CustomerPasswordResets = exports.CustomerGroups = exports.CustomerAddresses = exports.CustomPromotionRules = exports.Coupons = exports.CouponRecipients = exports.CouponCodesPromotionRules = exports.Cleanups = exports.CheckoutComPayments = exports.CheckoutComGateways = exports.CarrierAccounts = exports.Captures = exports.BuyXPayYPromotions = exports.Bundles = exports.BraintreePayments = exports.BraintreeGateways = exports.BingGeocoders = exports.BillingInfoValidationRules = exports.AxervePayments = exports.AxerveGateways = exports.AvalaraAccounts = exports.Authorizations = exports.Attachments = exports.Applications = exports.AdyenPayments = exports.AdyenGateways = exports.Adjustments = exports.Addresses = void 0;
|
7
|
+
exports.SkuLists = exports.SkuListPromotionRules = exports.SkuListItems = exports.ShippingZones = exports.ShippingWeightTiers = exports.ShippingMethods = exports.ShippingMethodTiers = exports.ShippingCategories = exports.Shipments = exports.SatispayPayments = exports.SatispayGateways = exports.Returns = exports.ReturnLineItems = exports.ReservedStocks = exports.Refunds = exports.RecurringOrderCopies = exports.Promotions = exports.PromotionRules = exports.Prices = exports.PriceVolumeTiers = exports.PriceTiers = exports.PriceLists = exports.PriceFrequencyTiers = exports.PercentageDiscountPromotions = exports.PaypalPayments = exports.PaypalGateways = exports.PaymentOptions = exports.PaymentMethods = exports.PaymentGateways = exports.Parcels = exports.ParcelLineItems = exports.Packages = exports.Organizations = exports.Orders = exports.OrderValidationRules = exports.OrderSubscriptions = exports.OrderSubscriptionItems = exports.OrderFactories = exports.OrderCopies = exports.OrderAmountPromotionRules = exports.Merchants = exports.Markets = exports.ManualTaxCalculators = exports.ManualGateways = exports.LineItems = exports.LineItemOptions = exports.KlarnaPayments = exports.KlarnaGateways = exports.InventoryStockLocations = exports.InventoryReturnLocations = void 0;
|
8
|
+
exports.resourceList = exports.WireTransfers = exports.Webhooks = exports.Voids = exports.Versions = exports.Transactions = exports.TaxjarAccounts = exports.TaxRules = exports.TaxCategories = exports.TaxCalculators = exports.Tags = exports.SubscriptionModels = exports.StripePayments = exports.StripeGateways = exports.StockTransfers = exports.StockReservations = exports.StockLocations = exports.StockLineItems = exports.StockItems = exports.Skus = exports.SkuOptions = void 0;
|
9
9
|
// ##__API_RESOURCES_START__##
|
10
10
|
// ##__API_RESOURCES_TEMPLATE:: export { default as ##__RESOURCE_CLASS__## } from './resources/##__RESOURCE_TYPE__##'
|
11
11
|
/**
|
12
|
-
* ©
|
12
|
+
* ©2024 Commerce Layer Inc.
|
13
13
|
**/
|
14
14
|
var addresses_1 = require("./resources/addresses");
|
15
15
|
Object.defineProperty(exports, "Addresses", { enumerable: true, get: function () { return __importDefault(addresses_1).default; } });
|
@@ -41,6 +41,8 @@ var braintree_payments_1 = require("./resources/braintree_payments");
|
|
41
41
|
Object.defineProperty(exports, "BraintreePayments", { enumerable: true, get: function () { return __importDefault(braintree_payments_1).default; } });
|
42
42
|
var bundles_1 = require("./resources/bundles");
|
43
43
|
Object.defineProperty(exports, "Bundles", { enumerable: true, get: function () { return __importDefault(bundles_1).default; } });
|
44
|
+
var buy_x_pay_y_promotions_1 = require("./resources/buy_x_pay_y_promotions");
|
45
|
+
Object.defineProperty(exports, "BuyXPayYPromotions", { enumerable: true, get: function () { return __importDefault(buy_x_pay_y_promotions_1).default; } });
|
44
46
|
var captures_1 = require("./resources/captures");
|
45
47
|
Object.defineProperty(exports, "Captures", { enumerable: true, get: function () { return __importDefault(captures_1).default; } });
|
46
48
|
var carrier_accounts_1 = require("./resources/carrier_accounts");
|
@@ -57,6 +59,8 @@ var coupon_recipients_1 = require("./resources/coupon_recipients");
|
|
57
59
|
Object.defineProperty(exports, "CouponRecipients", { enumerable: true, get: function () { return __importDefault(coupon_recipients_1).default; } });
|
58
60
|
var coupons_1 = require("./resources/coupons");
|
59
61
|
Object.defineProperty(exports, "Coupons", { enumerable: true, get: function () { return __importDefault(coupons_1).default; } });
|
62
|
+
var custom_promotion_rules_1 = require("./resources/custom_promotion_rules");
|
63
|
+
Object.defineProperty(exports, "CustomPromotionRules", { enumerable: true, get: function () { return __importDefault(custom_promotion_rules_1).default; } });
|
60
64
|
var customer_addresses_1 = require("./resources/customer_addresses");
|
61
65
|
Object.defineProperty(exports, "CustomerAddresses", { enumerable: true, get: function () { return __importDefault(customer_addresses_1).default; } });
|
62
66
|
var customer_groups_1 = require("./resources/customer_groups");
|
@@ -153,6 +157,8 @@ var payment_gateways_1 = require("./resources/payment_gateways");
|
|
153
157
|
Object.defineProperty(exports, "PaymentGateways", { enumerable: true, get: function () { return __importDefault(payment_gateways_1).default; } });
|
154
158
|
var payment_methods_1 = require("./resources/payment_methods");
|
155
159
|
Object.defineProperty(exports, "PaymentMethods", { enumerable: true, get: function () { return __importDefault(payment_methods_1).default; } });
|
160
|
+
var payment_options_1 = require("./resources/payment_options");
|
161
|
+
Object.defineProperty(exports, "PaymentOptions", { enumerable: true, get: function () { return __importDefault(payment_options_1).default; } });
|
156
162
|
var paypal_gateways_1 = require("./resources/paypal_gateways");
|
157
163
|
Object.defineProperty(exports, "PaypalGateways", { enumerable: true, get: function () { return __importDefault(paypal_gateways_1).default; } });
|
158
164
|
var paypal_payments_1 = require("./resources/paypal_payments");
|
@@ -177,6 +183,8 @@ var recurring_order_copies_1 = require("./resources/recurring_order_copies");
|
|
177
183
|
Object.defineProperty(exports, "RecurringOrderCopies", { enumerable: true, get: function () { return __importDefault(recurring_order_copies_1).default; } });
|
178
184
|
var refunds_1 = require("./resources/refunds");
|
179
185
|
Object.defineProperty(exports, "Refunds", { enumerable: true, get: function () { return __importDefault(refunds_1).default; } });
|
186
|
+
var reserved_stocks_1 = require("./resources/reserved_stocks");
|
187
|
+
Object.defineProperty(exports, "ReservedStocks", { enumerable: true, get: function () { return __importDefault(reserved_stocks_1).default; } });
|
180
188
|
var return_line_items_1 = require("./resources/return_line_items");
|
181
189
|
Object.defineProperty(exports, "ReturnLineItems", { enumerable: true, get: function () { return __importDefault(return_line_items_1).default; } });
|
182
190
|
var returns_1 = require("./resources/returns");
|
@@ -213,6 +221,8 @@ var stock_line_items_1 = require("./resources/stock_line_items");
|
|
213
221
|
Object.defineProperty(exports, "StockLineItems", { enumerable: true, get: function () { return __importDefault(stock_line_items_1).default; } });
|
214
222
|
var stock_locations_1 = require("./resources/stock_locations");
|
215
223
|
Object.defineProperty(exports, "StockLocations", { enumerable: true, get: function () { return __importDefault(stock_locations_1).default; } });
|
224
|
+
var stock_reservations_1 = require("./resources/stock_reservations");
|
225
|
+
Object.defineProperty(exports, "StockReservations", { enumerable: true, get: function () { return __importDefault(stock_reservations_1).default; } });
|
216
226
|
var stock_transfers_1 = require("./resources/stock_transfers");
|
217
227
|
Object.defineProperty(exports, "StockTransfers", { enumerable: true, get: function () { return __importDefault(stock_transfers_1).default; } });
|
218
228
|
var stripe_gateways_1 = require("./resources/stripe_gateways");
|
@@ -233,6 +243,8 @@ var taxjar_accounts_1 = require("./resources/taxjar_accounts");
|
|
233
243
|
Object.defineProperty(exports, "TaxjarAccounts", { enumerable: true, get: function () { return __importDefault(taxjar_accounts_1).default; } });
|
234
244
|
var transactions_1 = require("./resources/transactions");
|
235
245
|
Object.defineProperty(exports, "Transactions", { enumerable: true, get: function () { return __importDefault(transactions_1).default; } });
|
246
|
+
var versions_1 = require("./resources/versions");
|
247
|
+
Object.defineProperty(exports, "Versions", { enumerable: true, get: function () { return __importDefault(versions_1).default; } });
|
236
248
|
var voids_1 = require("./resources/voids");
|
237
249
|
Object.defineProperty(exports, "Voids", { enumerable: true, get: function () { return __importDefault(voids_1).default; } });
|
238
250
|
var webhooks_1 = require("./resources/webhooks");
|
@@ -257,6 +269,7 @@ exports.resourceList = [
|
|
257
269
|
'braintree_gateways',
|
258
270
|
'braintree_payments',
|
259
271
|
'bundles',
|
272
|
+
'buy_x_pay_y_promotions',
|
260
273
|
'captures',
|
261
274
|
'carrier_accounts',
|
262
275
|
'checkout_com_gateways',
|
@@ -265,6 +278,7 @@ exports.resourceList = [
|
|
265
278
|
'coupon_codes_promotion_rules',
|
266
279
|
'coupon_recipients',
|
267
280
|
'coupons',
|
281
|
+
'custom_promotion_rules',
|
268
282
|
'customer_addresses',
|
269
283
|
'customer_groups',
|
270
284
|
'customer_password_resets',
|
@@ -313,6 +327,7 @@ exports.resourceList = [
|
|
313
327
|
'parcels',
|
314
328
|
'payment_gateways',
|
315
329
|
'payment_methods',
|
330
|
+
'payment_options',
|
316
331
|
'paypal_gateways',
|
317
332
|
'paypal_payments',
|
318
333
|
'percentage_discount_promotions',
|
@@ -325,6 +340,7 @@ exports.resourceList = [
|
|
325
340
|
'promotions',
|
326
341
|
'recurring_order_copies',
|
327
342
|
'refunds',
|
343
|
+
'reserved_stocks',
|
328
344
|
'return_line_items',
|
329
345
|
'returns',
|
330
346
|
'satispay_gateways',
|
@@ -343,6 +359,7 @@ exports.resourceList = [
|
|
343
359
|
'stock_items',
|
344
360
|
'stock_line_items',
|
345
361
|
'stock_locations',
|
362
|
+
'stock_reservations',
|
346
363
|
'stock_transfers',
|
347
364
|
'stripe_gateways',
|
348
365
|
'stripe_payments',
|
@@ -353,8 +370,22 @@ exports.resourceList = [
|
|
353
370
|
'tax_rules',
|
354
371
|
'taxjar_accounts',
|
355
372
|
'transactions',
|
373
|
+
'versions',
|
356
374
|
'voids',
|
357
375
|
'webhooks',
|
358
376
|
'wire_transfers'
|
359
377
|
// ##__API_RESOURCE_LIST_STOP__##
|
360
378
|
];
|
379
|
+
/*
|
380
|
+
type ResourceInfo = {
|
381
|
+
name: string;
|
382
|
+
type: string;
|
383
|
+
api: string;
|
384
|
+
}
|
385
|
+
|
386
|
+
|
387
|
+
export const resourceMap: { [res: string]: ResourceInfo } = {
|
388
|
+
// ##__API_RESOURCE_MAP_START__##
|
389
|
+
// ##__API_RESOURCE_MAP_STOP__##
|
390
|
+
} as const
|
391
|
+
*/
|
package/lib/cjs/client.d.ts
CHANGED
@@ -1,13 +1,15 @@
|
|
1
1
|
/// <reference types="node" />
|
2
2
|
/// <reference types="node" />
|
3
|
-
import {
|
3
|
+
import { AxiosProxyConfig, Method } from 'axios';
|
4
4
|
import type { InterceptorManager } from './interceptor';
|
5
5
|
import type { Agent as HttpAgent } from 'http';
|
6
6
|
import type { Agent as HttpsAgent } from 'https';
|
7
7
|
type ProxyConfig = AxiosProxyConfig | false;
|
8
8
|
type RequestConfig = {
|
9
9
|
timeout?: number;
|
10
|
-
params?:
|
10
|
+
params?: {
|
11
|
+
[key: string]: string | number | boolean;
|
12
|
+
};
|
11
13
|
httpAgent?: HttpAgent;
|
12
14
|
httpsAgent?: HttpsAgent;
|
13
15
|
proxy?: ProxyConfig;
|
@@ -28,4 +30,4 @@ declare class ApiClient {
|
|
28
30
|
request(method: Method, path: string, body?: any, options?: ApiClientConfig): Promise<any>;
|
29
31
|
}
|
30
32
|
export default ApiClient;
|
31
|
-
export
|
33
|
+
export { ApiClientInitConfig, ApiClientConfig, RequestConfig };
|
package/lib/cjs/client.js
CHANGED
@@ -15,6 +15,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
15
|
};
|
16
16
|
var _ApiClient_accessToken, _ApiClient_client;
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
18
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
18
19
|
const axios_1 = __importDefault(require("axios"));
|
19
20
|
const error_1 = require("./error");
|
20
21
|
const config_1 = __importDefault(require("./config"));
|
@@ -54,9 +55,10 @@ const handleError = (error) => {
|
|
54
55
|
};
|
55
56
|
class ApiClient {
|
56
57
|
static create(options) {
|
57
|
-
|
58
|
-
|
59
|
-
|
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");
|
60
62
|
return new ApiClient(options);
|
61
63
|
}
|
62
64
|
constructor(options) {
|
@@ -71,16 +73,11 @@ class ApiClient {
|
|
71
73
|
httpAgent: options.httpAgent,
|
72
74
|
httpsAgent: options.httpsAgent,
|
73
75
|
};
|
74
|
-
const axiosOptions = {
|
75
|
-
baseURL: this.baseUrl,
|
76
|
-
timeout: config_1.default.client.timeout,
|
77
|
-
headers: {
|
76
|
+
const axiosOptions = Object.assign({ baseURL: this.baseUrl, timeout: config_1.default.client.timeout, headers: {
|
78
77
|
'Accept': 'application/vnd.api+json',
|
79
78
|
'Content-Type': 'application/vnd.api+json',
|
80
79
|
'Authorization': 'Bearer ' + __classPrivateFieldGet(this, _ApiClient_accessToken, "f"),
|
81
|
-
},
|
82
|
-
...axiosConfig
|
83
|
-
};
|
80
|
+
} }, axiosConfig);
|
84
81
|
debug('axios options: %O', axiosOptions);
|
85
82
|
__classPrivateFieldSet(this, _ApiClient_client, axios_1.default.create(axiosOptions), "f");
|
86
83
|
this.interceptors = __classPrivateFieldGet(this, _ApiClient_client, "f").interceptors;
|
@@ -113,7 +110,7 @@ class ApiClient {
|
|
113
110
|
const baseUrl = (options === null || options === void 0 ? void 0 : options.organization) ? baseURL(options.organization, options.domain) : undefined;
|
114
111
|
const accessToken = (options === null || options === void 0 ? void 0 : options.accessToken) || __classPrivateFieldGet(this, _ApiClient_accessToken, "f");
|
115
112
|
const headers = accessToken ? { 'Authorization': 'Bearer ' + accessToken } : undefined;
|
116
|
-
const requestParams = { method, baseURL: baseUrl, url, data, headers,
|
113
|
+
const requestParams = Object.assign({ method, baseURL: baseUrl, url, data, headers }, options);
|
117
114
|
debug('request params: %O', requestParams);
|
118
115
|
// const start = Date.now()
|
119
116
|
return __classPrivateFieldGet(this, _ApiClient_client, "f").request(requestParams)
|
@@ -1,16 +1,16 @@
|
|
1
1
|
import * as api from './api';
|
2
|
-
import
|
2
|
+
import { ApiError } from './error';
|
3
3
|
import type { ErrorInterceptor, InterceptorType, RawResponseReader, RequestInterceptor, ResponseInterceptor } from './interceptor';
|
4
|
-
import {
|
5
|
-
declare const OPEN_API_SCHEMA_VERSION = "4.
|
4
|
+
import { ResourcesInitConfig } from './resource';
|
5
|
+
declare const OPEN_API_SCHEMA_VERSION = "4.26.0";
|
6
6
|
export { OPEN_API_SCHEMA_VERSION };
|
7
|
-
type SdkConfig =
|
7
|
+
type SdkConfig = {};
|
8
8
|
type CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig;
|
9
9
|
type CommerceLayerConfig = Partial<CommerceLayerInitConfig>;
|
10
10
|
declare class CommerceLayerClient {
|
11
11
|
#private;
|
12
12
|
static get openApiSchemaVersion(): string;
|
13
|
-
readonly openApiSchemaVersion = "4.
|
13
|
+
readonly openApiSchemaVersion = "4.26.0";
|
14
14
|
addresses: api.Addresses;
|
15
15
|
adjustments: api.Adjustments;
|
16
16
|
adyen_gateways: api.AdyenGateways;
|
@@ -26,6 +26,7 @@ declare class CommerceLayerClient {
|
|
26
26
|
braintree_gateways: api.BraintreeGateways;
|
27
27
|
braintree_payments: api.BraintreePayments;
|
28
28
|
bundles: api.Bundles;
|
29
|
+
buy_x_pay_y_promotions: api.BuyXPayYPromotions;
|
29
30
|
captures: api.Captures;
|
30
31
|
carrier_accounts: api.CarrierAccounts;
|
31
32
|
checkout_com_gateways: api.CheckoutComGateways;
|
@@ -34,6 +35,7 @@ declare class CommerceLayerClient {
|
|
34
35
|
coupon_codes_promotion_rules: api.CouponCodesPromotionRules;
|
35
36
|
coupon_recipients: api.CouponRecipients;
|
36
37
|
coupons: api.Coupons;
|
38
|
+
custom_promotion_rules: api.CustomPromotionRules;
|
37
39
|
customer_addresses: api.CustomerAddresses;
|
38
40
|
customer_groups: api.CustomerGroups;
|
39
41
|
customer_password_resets: api.CustomerPasswordResets;
|
@@ -82,6 +84,7 @@ declare class CommerceLayerClient {
|
|
82
84
|
parcels: api.Parcels;
|
83
85
|
payment_gateways: api.PaymentGateways;
|
84
86
|
payment_methods: api.PaymentMethods;
|
87
|
+
payment_options: api.PaymentOptions;
|
85
88
|
paypal_gateways: api.PaypalGateways;
|
86
89
|
paypal_payments: api.PaypalPayments;
|
87
90
|
percentage_discount_promotions: api.PercentageDiscountPromotions;
|
@@ -94,6 +97,7 @@ declare class CommerceLayerClient {
|
|
94
97
|
promotions: api.Promotions;
|
95
98
|
recurring_order_copies: api.RecurringOrderCopies;
|
96
99
|
refunds: api.Refunds;
|
100
|
+
reserved_stocks: api.ReservedStocks;
|
97
101
|
return_line_items: api.ReturnLineItems;
|
98
102
|
returns: api.Returns;
|
99
103
|
satispay_gateways: api.SatispayGateways;
|
@@ -112,6 +116,7 @@ declare class CommerceLayerClient {
|
|
112
116
|
stock_items: api.StockItems;
|
113
117
|
stock_line_items: api.StockLineItems;
|
114
118
|
stock_locations: api.StockLocations;
|
119
|
+
stock_reservations: api.StockReservations;
|
115
120
|
stock_transfers: api.StockTransfers;
|
116
121
|
stripe_gateways: api.StripeGateways;
|
117
122
|
stripe_payments: api.StripePayments;
|
@@ -122,6 +127,7 @@ declare class CommerceLayerClient {
|
|
122
127
|
tax_rules: api.TaxRules;
|
123
128
|
taxjar_accounts: api.TaxjarAccounts;
|
124
129
|
transactions: api.Transactions;
|
130
|
+
versions: api.Versions;
|
125
131
|
voids: api.Voids;
|
126
132
|
webhooks: api.Webhooks;
|
127
133
|
wire_transfers: api.WireTransfers;
|
package/lib/cjs/commercelayer.js
CHANGED
@@ -45,7 +45,7 @@ const resource_1 = __importDefault(require("./resource"));
|
|
45
45
|
const debug_1 = __importDefault(require("./debug"));
|
46
46
|
const debug = (0, debug_1.default)('commercelayer');
|
47
47
|
// Autogenerated schema version number, do not remove this line
|
48
|
-
const OPEN_API_SCHEMA_VERSION = '4.
|
48
|
+
const OPEN_API_SCHEMA_VERSION = '4.26.0';
|
49
49
|
exports.OPEN_API_SCHEMA_VERSION = OPEN_API_SCHEMA_VERSION;
|
50
50
|
class CommerceLayerClient {
|
51
51
|
static get openApiSchemaVersion() { return OPEN_API_SCHEMA_VERSION; }
|
@@ -74,6 +74,7 @@ class CommerceLayerClient {
|
|
74
74
|
this.braintree_gateways = new api.BraintreeGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
75
75
|
this.braintree_payments = new api.BraintreePayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
76
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"));
|
77
78
|
this.captures = new api.Captures(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
78
79
|
this.carrier_accounts = new api.CarrierAccounts(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
79
80
|
this.checkout_com_gateways = new api.CheckoutComGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
@@ -82,6 +83,7 @@ class CommerceLayerClient {
|
|
82
83
|
this.coupon_codes_promotion_rules = new api.CouponCodesPromotionRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
83
84
|
this.coupon_recipients = new api.CouponRecipients(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
84
85
|
this.coupons = new api.Coupons(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
86
|
+
this.custom_promotion_rules = new api.CustomPromotionRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
85
87
|
this.customer_addresses = new api.CustomerAddresses(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
86
88
|
this.customer_groups = new api.CustomerGroups(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
87
89
|
this.customer_password_resets = new api.CustomerPasswordResets(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
@@ -130,6 +132,7 @@ class CommerceLayerClient {
|
|
130
132
|
this.parcels = new api.Parcels(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
131
133
|
this.payment_gateways = new api.PaymentGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
132
134
|
this.payment_methods = new api.PaymentMethods(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
135
|
+
this.payment_options = new api.PaymentOptions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
133
136
|
this.paypal_gateways = new api.PaypalGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
134
137
|
this.paypal_payments = new api.PaypalPayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
135
138
|
this.percentage_discount_promotions = new api.PercentageDiscountPromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
@@ -142,6 +145,7 @@ class CommerceLayerClient {
|
|
142
145
|
this.promotions = new api.Promotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
143
146
|
this.recurring_order_copies = new api.RecurringOrderCopies(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
144
147
|
this.refunds = new api.Refunds(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
148
|
+
this.reserved_stocks = new api.ReservedStocks(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
145
149
|
this.return_line_items = new api.ReturnLineItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
146
150
|
this.returns = new api.Returns(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
147
151
|
this.satispay_gateways = new api.SatispayGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
@@ -160,6 +164,7 @@ class CommerceLayerClient {
|
|
160
164
|
this.stock_items = new api.StockItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
161
165
|
this.stock_line_items = new api.StockLineItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
162
166
|
this.stock_locations = new api.StockLocations(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
167
|
+
this.stock_reservations = new api.StockReservations(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
163
168
|
this.stock_transfers = new api.StockTransfers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
164
169
|
this.stripe_gateways = new api.StripeGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
165
170
|
this.stripe_payments = new api.StripePayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
@@ -170,6 +175,7 @@ class CommerceLayerClient {
|
|
170
175
|
this.tax_rules = new api.TaxRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
171
176
|
this.taxjar_accounts = new api.TaxjarAccounts(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
172
177
|
this.transactions = new api.Transactions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
178
|
+
this.versions = new api.Versions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
173
179
|
this.voids = new api.Voids(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
174
180
|
this.webhooks = new api.Webhooks(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
175
181
|
this.wire_transfers = new api.WireTransfers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
@@ -204,7 +210,7 @@ class CommerceLayerClient {
|
|
204
210
|
return __classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f").interceptors.response.use(onFulfilled, onRejected);
|
205
211
|
}
|
206
212
|
removeInterceptor(type, id) {
|
207
|
-
__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f").interceptors[type].eject(id);
|
213
|
+
return __classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f").interceptors[type].eject(id);
|
208
214
|
}
|
209
215
|
addRawResponseReader(options) {
|
210
216
|
const reader = {
|
@@ -225,7 +231,7 @@ class CommerceLayerClient {
|
|
225
231
|
removeRawResponseReader(reader) {
|
226
232
|
const id = (typeof reader === 'number') ? reader : reader === null || reader === void 0 ? void 0 : reader.id;
|
227
233
|
if (id && (id >= 0))
|
228
|
-
this.removeInterceptor('response', id);
|
234
|
+
return this.removeInterceptor('response', id);
|
229
235
|
}
|
230
236
|
}
|
231
237
|
_CommerceLayerClient_adapter = new WeakMap(), _CommerceLayerClient_organization = new WeakMap();
|
package/lib/cjs/common.d.ts
CHANGED
@@ -2,4 +2,3 @@ import type { ResourceId, ResourceType } from './resource';
|
|
2
2
|
declare const isResourceId: (resource: any) => resource is ResourceId;
|
3
3
|
declare const isResourceType: (resource: any) => resource is ResourceType;
|
4
4
|
export { isResourceId, isResourceType };
|
5
|
-
export type ObjectType = Record<string, any>;
|
package/lib/cjs/common.js
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
"use strict";
|
2
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
3
|
+
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
2
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
5
|
exports.isResourceType = exports.isResourceId = void 0;
|
4
6
|
const api_1 = require("./api");
|
@@ -10,14 +12,3 @@ const isResourceType = (resource) => {
|
|
10
12
|
return resource && (typeof resource.type !== 'undefined') && resource.type && api_1.resourceList.includes(resource.type);
|
11
13
|
};
|
12
14
|
exports.isResourceType = isResourceType;
|
13
|
-
/*
|
14
|
-
// Nullable types
|
15
|
-
type StringNullable = string | null
|
16
|
-
type NumberNullable = number | null
|
17
|
-
type BooleanNullable = boolean | null
|
18
|
-
type ResourceNullable<R extends Resource> = R | null
|
19
|
-
type ResourceArrayNullable<R extends Resource> = R[] | null
|
20
|
-
|
21
|
-
|
22
|
-
export type { StringNullable, NumberNullable, BooleanNullable, ResourceNullable, ResourceArrayNullable }
|
23
|
-
*/
|
package/lib/cjs/config.d.ts
CHANGED
package/lib/cjs/config.js
CHANGED
package/lib/cjs/debug.js
CHANGED
@@ -1,4 +1,7 @@
|
|
1
1
|
"use strict";
|
2
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
3
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
4
|
+
// import Debug from 'debug'
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
6
|
/* Nope debugger */
|
4
7
|
const debuggerFunction = (_pattern, ..._args) => {
|
@@ -7,6 +10,7 @@ const debuggerFunction = (_pattern, ..._args) => {
|
|
7
10
|
let debuggerFactory = (_namespace) => debuggerFunction;
|
8
11
|
/* Try loading 'debug' module */
|
9
12
|
try {
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
10
14
|
const debugModule = require('debug');
|
11
15
|
if (debugModule && (typeof debugModule === 'function'))
|
12
16
|
debuggerFactory = debugModule;
|
package/lib/cjs/error.js
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
"use strict";
|
2
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
4
|
exports.ErrorType = exports.ApiError = exports.SdkError = void 0;
|
4
5
|
var ErrorType;
|
@@ -11,6 +12,7 @@ var ErrorType;
|
|
11
12
|
})(ErrorType || (ErrorType = {}));
|
12
13
|
exports.ErrorType = ErrorType;
|
13
14
|
class SdkError extends Error {
|
15
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
14
16
|
static isSdkError(error) {
|
15
17
|
return error && [SdkError.NAME, ApiError.NAME].includes(error.name) && Object.values(ErrorType).includes(error.type);
|
16
18
|
}
|
@@ -23,11 +25,12 @@ class SdkError extends Error {
|
|
23
25
|
exports.SdkError = SdkError;
|
24
26
|
SdkError.NAME = 'SdkError';
|
25
27
|
class ApiError extends SdkError {
|
28
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
26
29
|
static isApiError(error) {
|
27
30
|
return SdkError.isSdkError(error) && (error.name === ApiError.NAME) && (error.type === ErrorType.RESPONSE);
|
28
31
|
}
|
29
32
|
constructor(error) {
|
30
|
-
super({
|
33
|
+
super(Object.assign(Object.assign({}, error), { type: ErrorType.RESPONSE }));
|
31
34
|
this.errors = [];
|
32
35
|
this.name = ApiError.NAME; // this.constructor.name
|
33
36
|
}
|
package/lib/cjs/index.d.ts
CHANGED
@@ -2,6 +2,6 @@ export { default, CommerceLayer } from './commercelayer';
|
|
2
2
|
export type { CommerceLayerClient } from './commercelayer';
|
3
3
|
export { CommerceLayerStatic } from './static';
|
4
4
|
export type { QueryParamsRetrieve, QueryParamsList, QueryParams } from './query';
|
5
|
-
export
|
5
|
+
export * from './model';
|
6
6
|
export type { RequestObj, ResponseObj, ErrorObj, HeadersObj } from './interceptor';
|
7
7
|
export type { SdkError, ApiError, ErrorType } from './error';
|
package/lib/cjs/index.js
CHANGED
@@ -1,4 +1,18 @@
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
+
};
|
2
16
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
18
|
};
|
@@ -11,3 +25,5 @@ Object.defineProperty(exports, "CommerceLayer", { enumerable: true, get: functio
|
|
11
25
|
// Commerce Layer static functions
|
12
26
|
var static_1 = require("./static");
|
13
27
|
Object.defineProperty(exports, "CommerceLayerStatic", { enumerable: true, get: function () { return static_1.CommerceLayerStatic; } });
|
28
|
+
// Resource model types
|
29
|
+
__exportStar(require("./model"), exports);
|
package/lib/cjs/interceptor.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import { AxiosError, AxiosInterceptorManager, AxiosRequestConfig, AxiosResponse, AxiosResponseHeaders, RawAxiosResponseHeaders } from 'axios';
|
2
2
|
type InterceptorManager = {
|
3
3
|
request: AxiosInterceptorManager<AxiosRequestConfig>;
|
4
4
|
response: AxiosInterceptorManager<any>;
|
@@ -7,11 +7,7 @@ type RequestObj = AxiosRequestConfig;
|
|
7
7
|
type RequestInterceptor = (request: RequestObj) => RequestObj | Promise<RequestObj>;
|
8
8
|
type ResponseObj = AxiosResponse;
|
9
9
|
type ResponseInterceptor = (response: ResponseObj) => ResponseObj;
|
10
|
-
type
|
11
|
-
type ApiHeaders = {
|
12
|
-
[key in ApiHeadersList]: string | number | boolean;
|
13
|
-
};
|
14
|
-
type HeadersObj = (AxiosResponseHeaders | RawAxiosResponseHeaders) & ApiHeaders;
|
10
|
+
type HeadersObj = AxiosResponseHeaders | RawAxiosResponseHeaders;
|
15
11
|
type ErrorObj = AxiosError;
|
16
12
|
type ErrorInterceptor = (error: ErrorObj) => ErrorObj;
|
17
13
|
type InterceptorType = 'request' | 'response';
|