@commercelayer/sdk 4.35.0 → 4.37.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 +37 -0
- package/lib/cjs/api.js +0 -13
- package/lib/cjs/client.d.ts +15 -8
- package/lib/cjs/client.js +40 -40
- package/lib/cjs/commercelayer.d.ts +3 -4
- package/lib/cjs/commercelayer.js +7 -3
- package/lib/cjs/common.d.ts +1 -0
- package/lib/cjs/common.js +11 -2
- package/lib/cjs/config.d.ts +1 -0
- package/lib/cjs/config.js +3 -0
- package/lib/cjs/debug.js +0 -4
- package/lib/cjs/error.d.ts +3 -1
- package/lib/cjs/error.js +40 -7
- package/lib/cjs/index.d.ts +1 -1
- package/lib/cjs/index.js +0 -16
- package/lib/cjs/interceptor.d.ts +6 -2
- package/lib/cjs/jsonapi.js +9 -2
- package/lib/cjs/query.d.ts +9 -15
- package/lib/cjs/query.js +3 -2
- package/lib/cjs/resource.d.ts +30 -20
- package/lib/cjs/resource.js +40 -9
- package/lib/cjs/resources/addresses.d.ts +74 -73
- package/lib/cjs/resources/addresses.js +3 -11
- package/lib/cjs/resources/adjustments.d.ts +20 -19
- package/lib/cjs/resources/adjustments.js +3 -11
- package/lib/cjs/resources/adyen_gateways.d.ts +35 -34
- package/lib/cjs/resources/adyen_gateways.js +3 -11
- package/lib/cjs/resources/adyen_payments.d.ts +29 -27
- package/lib/cjs/resources/adyen_payments.js +6 -11
- package/lib/cjs/resources/application.d.ts +14 -13
- package/lib/cjs/resources/application.js +1 -6
- package/lib/cjs/resources/attachments.d.ts +81 -80
- package/lib/cjs/resources/attachments.js +3 -11
- package/lib/cjs/resources/authorizations.d.ts +47 -43
- package/lib/cjs/resources/authorizations.js +10 -9
- package/lib/cjs/resources/avalara_accounts.d.ts +32 -31
- package/lib/cjs/resources/avalara_accounts.js +3 -11
- package/lib/cjs/resources/axerve_gateways.d.ts +24 -23
- package/lib/cjs/resources/axerve_gateways.js +3 -11
- package/lib/cjs/resources/axerve_payments.d.ts +28 -26
- package/lib/cjs/resources/axerve_payments.js +6 -11
- package/lib/cjs/resources/billing_info_validation_rules.d.ts +17 -16
- package/lib/cjs/resources/billing_info_validation_rules.js +3 -11
- package/lib/cjs/resources/bing_geocoders.d.ts +16 -15
- package/lib/cjs/resources/bing_geocoders.js +3 -11
- package/lib/cjs/resources/braintree_gateways.d.ts +34 -33
- package/lib/cjs/resources/braintree_gateways.js +3 -11
- package/lib/cjs/resources/braintree_payments.d.ts +30 -29
- package/lib/cjs/resources/braintree_payments.js +3 -11
- package/lib/cjs/resources/bundles.d.ts +57 -54
- package/lib/cjs/resources/bundles.js +9 -11
- package/lib/cjs/resources/captures.d.ts +37 -34
- package/lib/cjs/resources/captures.js +7 -9
- package/lib/cjs/resources/carrier_accounts.d.ts +16 -15
- package/lib/cjs/resources/carrier_accounts.js +0 -8
- package/lib/cjs/resources/checkout_com_gateways.d.ts +25 -24
- package/lib/cjs/resources/checkout_com_gateways.js +3 -11
- package/lib/cjs/resources/checkout_com_payments.d.ts +41 -38
- package/lib/cjs/resources/checkout_com_payments.js +9 -11
- package/lib/cjs/resources/cleanups.d.ts +24 -23
- package/lib/cjs/resources/cleanups.js +2 -10
- package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +31 -30
- package/lib/cjs/resources/coupon_codes_promotion_rules.js +3 -11
- package/lib/cjs/resources/coupon_recipients.d.ts +26 -25
- package/lib/cjs/resources/coupon_recipients.js +3 -11
- package/lib/cjs/resources/coupons.d.ts +39 -38
- package/lib/cjs/resources/coupons.js +3 -11
- package/lib/cjs/resources/customer_addresses.d.ts +23 -22
- package/lib/cjs/resources/customer_addresses.js +3 -11
- package/lib/cjs/resources/customer_groups.d.ts +17 -16
- package/lib/cjs/resources/customer_groups.js +3 -11
- package/lib/cjs/resources/customer_password_resets.d.ts +19 -17
- package/lib/cjs/resources/customer_password_resets.js +6 -11
- package/lib/cjs/resources/customer_payment_sources.d.ts +37 -36
- package/lib/cjs/resources/customer_payment_sources.js +3 -11
- package/lib/cjs/resources/customer_subscriptions.d.ts +15 -14
- package/lib/cjs/resources/customer_subscriptions.js +3 -11
- package/lib/cjs/resources/customers.d.ts +37 -36
- package/lib/cjs/resources/customers.js +3 -11
- package/lib/cjs/resources/delivery_lead_times.d.ts +27 -26
- package/lib/cjs/resources/delivery_lead_times.js +3 -11
- package/lib/cjs/resources/event_callbacks.d.ts +15 -14
- package/lib/cjs/resources/event_callbacks.js +0 -8
- package/lib/cjs/resources/events.d.ts +13 -12
- package/lib/cjs/resources/events.js +0 -8
- package/lib/cjs/resources/exports.d.ts +27 -26
- package/lib/cjs/resources/exports.js +2 -10
- package/lib/cjs/resources/external_gateways.d.ts +32 -31
- package/lib/cjs/resources/external_gateways.js +3 -11
- package/lib/cjs/resources/external_payments.d.ts +23 -22
- package/lib/cjs/resources/external_payments.js +3 -11
- package/lib/cjs/resources/external_promotions.d.ts +66 -65
- package/lib/cjs/resources/external_promotions.js +3 -11
- package/lib/cjs/resources/external_tax_calculators.d.ts +19 -18
- package/lib/cjs/resources/external_tax_calculators.js +3 -11
- package/lib/cjs/resources/fixed_amount_promotions.d.ts +67 -66
- package/lib/cjs/resources/fixed_amount_promotions.js +3 -11
- package/lib/cjs/resources/fixed_price_promotions.d.ts +71 -70
- package/lib/cjs/resources/fixed_price_promotions.js +3 -11
- package/lib/cjs/resources/free_gift_promotions.d.ts +70 -69
- package/lib/cjs/resources/free_gift_promotions.js +3 -11
- package/lib/cjs/resources/free_shipping_promotions.d.ts +63 -62
- package/lib/cjs/resources/free_shipping_promotions.js +3 -11
- package/lib/cjs/resources/geocoders.d.ts +13 -12
- package/lib/cjs/resources/geocoders.js +0 -8
- package/lib/cjs/resources/gift_card_recipients.d.ts +26 -25
- package/lib/cjs/resources/gift_card_recipients.js +3 -11
- package/lib/cjs/resources/gift_cards.d.ts +71 -66
- package/lib/cjs/resources/gift_cards.js +15 -11
- package/lib/cjs/resources/google_geocoders.d.ts +16 -15
- package/lib/cjs/resources/google_geocoders.js +3 -11
- package/lib/cjs/resources/imports.d.ts +32 -31
- package/lib/cjs/resources/imports.js +2 -10
- package/lib/cjs/resources/in_stock_subscriptions.d.ts +38 -35
- package/lib/cjs/resources/in_stock_subscriptions.js +9 -11
- package/lib/cjs/resources/inventory_models.d.ts +26 -25
- package/lib/cjs/resources/inventory_models.js +3 -11
- package/lib/cjs/resources/inventory_return_locations.d.ts +22 -21
- package/lib/cjs/resources/inventory_return_locations.js +3 -11
- package/lib/cjs/resources/inventory_stock_locations.d.ts +25 -24
- package/lib/cjs/resources/inventory_stock_locations.js +3 -11
- package/lib/cjs/resources/klarna_gateways.d.ts +23 -22
- package/lib/cjs/resources/klarna_gateways.js +3 -11
- package/lib/cjs/resources/klarna_payments.d.ts +29 -27
- package/lib/cjs/resources/klarna_payments.js +6 -11
- package/lib/cjs/resources/line_item_options.d.ts +41 -40
- package/lib/cjs/resources/line_item_options.js +3 -11
- package/lib/cjs/resources/line_items.d.ts +96 -93
- package/lib/cjs/resources/line_items.js +9 -11
- package/lib/cjs/resources/manual_gateways.d.ts +15 -14
- package/lib/cjs/resources/manual_gateways.js +3 -11
- package/lib/cjs/resources/manual_tax_calculators.d.ts +21 -20
- package/lib/cjs/resources/manual_tax_calculators.js +3 -11
- package/lib/cjs/resources/markets.d.ts +62 -59
- package/lib/cjs/resources/markets.js +9 -11
- package/lib/cjs/resources/merchants.d.ts +19 -18
- package/lib/cjs/resources/merchants.js +3 -11
- package/lib/cjs/resources/order_amount_promotion_rules.d.ts +34 -33
- package/lib/cjs/resources/order_amount_promotion_rules.js +3 -11
- package/lib/cjs/resources/order_copies.d.ts +29 -28
- package/lib/cjs/resources/order_copies.js +3 -11
- package/lib/cjs/resources/order_factories.d.ts +21 -20
- package/lib/cjs/resources/order_factories.js +0 -8
- package/lib/cjs/resources/order_subscription_items.d.ts +40 -39
- package/lib/cjs/resources/order_subscription_items.js +3 -11
- package/lib/cjs/resources/order_subscriptions.d.ts +55 -51
- package/lib/cjs/resources/order_subscriptions.js +12 -11
- package/lib/cjs/resources/order_validation_rules.d.ts +13 -12
- package/lib/cjs/resources/order_validation_rules.js +0 -8
- package/lib/cjs/resources/orders.d.ts +263 -235
- package/lib/cjs/resources/orders.js +84 -11
- package/lib/cjs/resources/organization.d.ts +25 -24
- package/lib/cjs/resources/organization.js +1 -6
- package/lib/cjs/resources/packages.d.ts +31 -30
- package/lib/cjs/resources/packages.js +3 -11
- package/lib/cjs/resources/parcel_line_items.d.ts +23 -22
- package/lib/cjs/resources/parcel_line_items.js +3 -11
- package/lib/cjs/resources/parcels.d.ts +94 -93
- package/lib/cjs/resources/parcels.js +3 -11
- package/lib/cjs/resources/payment_gateways.d.ts +13 -12
- package/lib/cjs/resources/payment_gateways.js +0 -8
- package/lib/cjs/resources/payment_methods.d.ts +51 -48
- package/lib/cjs/resources/payment_methods.js +9 -11
- package/lib/cjs/resources/paypal_gateways.d.ts +18 -17
- package/lib/cjs/resources/paypal_gateways.js +3 -11
- package/lib/cjs/resources/paypal_payments.d.ts +32 -31
- package/lib/cjs/resources/paypal_payments.js +3 -11
- package/lib/cjs/resources/percentage_discount_promotions.d.ts +70 -69
- package/lib/cjs/resources/percentage_discount_promotions.js +3 -11
- package/lib/cjs/resources/price_frequency_tiers.d.ts +27 -26
- package/lib/cjs/resources/price_frequency_tiers.js +3 -11
- package/lib/cjs/resources/price_lists.d.ts +21 -20
- package/lib/cjs/resources/price_lists.js +3 -11
- package/lib/cjs/resources/price_tiers.d.ts +18 -17
- package/lib/cjs/resources/price_tiers.js +0 -8
- package/lib/cjs/resources/price_volume_tiers.d.ts +27 -26
- package/lib/cjs/resources/price_volume_tiers.js +3 -11
- package/lib/cjs/resources/prices.d.ts +40 -39
- package/lib/cjs/resources/prices.js +3 -11
- package/lib/cjs/resources/promotion_rules.d.ts +12 -11
- package/lib/cjs/resources/promotion_rules.js +0 -8
- package/lib/cjs/resources/promotions.d.ts +28 -27
- package/lib/cjs/resources/promotions.js +0 -8
- package/lib/cjs/resources/recurring_order_copies.d.ts +29 -28
- package/lib/cjs/resources/recurring_order_copies.js +3 -11
- package/lib/cjs/resources/refunds.d.ts +26 -25
- package/lib/cjs/resources/refunds.js +0 -8
- package/lib/cjs/resources/reserved_stocks.d.ts +14 -13
- package/lib/cjs/resources/reserved_stocks.js +0 -8
- package/lib/cjs/resources/return_line_items.d.ts +29 -27
- package/lib/cjs/resources/return_line_items.js +6 -11
- package/lib/cjs/resources/returns.d.ts +59 -49
- package/lib/cjs/resources/returns.js +30 -11
- package/lib/cjs/resources/satispay_gateways.d.ts +23 -22
- package/lib/cjs/resources/satispay_gateways.js +3 -11
- package/lib/cjs/resources/satispay_payments.d.ts +31 -29
- package/lib/cjs/resources/satispay_payments.js +6 -11
- package/lib/cjs/resources/shipments.d.ts +65 -57
- package/lib/cjs/resources/shipments.js +22 -9
- package/lib/cjs/resources/shipping_categories.d.ts +16 -15
- package/lib/cjs/resources/shipping_categories.js +3 -11
- package/lib/cjs/resources/shipping_method_tiers.d.ts +18 -17
- package/lib/cjs/resources/shipping_method_tiers.js +0 -8
- package/lib/cjs/resources/shipping_methods.d.ts +80 -77
- package/lib/cjs/resources/shipping_methods.js +9 -11
- package/lib/cjs/resources/shipping_weight_tiers.d.ts +26 -25
- package/lib/cjs/resources/shipping_weight_tiers.js +3 -11
- package/lib/cjs/resources/shipping_zones.d.ts +33 -32
- package/lib/cjs/resources/shipping_zones.js +3 -11
- package/lib/cjs/resources/sku_list_items.d.ts +27 -26
- package/lib/cjs/resources/sku_list_items.js +3 -11
- package/lib/cjs/resources/sku_list_promotion_rules.d.ts +38 -37
- package/lib/cjs/resources/sku_list_promotion_rules.js +3 -11
- package/lib/cjs/resources/sku_lists.d.ts +36 -35
- package/lib/cjs/resources/sku_lists.js +3 -11
- package/lib/cjs/resources/sku_options.d.ts +44 -43
- package/lib/cjs/resources/sku_options.js +3 -11
- package/lib/cjs/resources/skus.d.ts +57 -56
- package/lib/cjs/resources/skus.js +3 -11
- package/lib/cjs/resources/stock_items.d.ts +29 -28
- package/lib/cjs/resources/stock_items.js +3 -11
- package/lib/cjs/resources/stock_line_items.d.ts +18 -17
- package/lib/cjs/resources/stock_line_items.js +0 -8
- package/lib/cjs/resources/stock_locations.d.ts +30 -29
- package/lib/cjs/resources/stock_locations.js +3 -11
- package/lib/cjs/resources/stock_reservations.d.ts +18 -17
- package/lib/cjs/resources/stock_reservations.js +0 -8
- package/lib/cjs/resources/stock_transfers.d.ts +48 -42
- package/lib/cjs/resources/stock_transfers.js +18 -11
- package/lib/cjs/resources/stripe_gateways.d.ts +23 -22
- package/lib/cjs/resources/stripe_gateways.js +3 -11
- package/lib/cjs/resources/stripe_payments.d.ts +35 -32
- package/lib/cjs/resources/stripe_payments.js +9 -11
- package/lib/cjs/resources/subscription_models.d.ts +27 -26
- package/lib/cjs/resources/subscription_models.js +3 -11
- package/lib/cjs/resources/tags.d.ts +13 -12
- package/lib/cjs/resources/tags.js +3 -11
- package/lib/cjs/resources/tax_calculators.d.ts +14 -13
- package/lib/cjs/resources/tax_calculators.js +0 -8
- package/lib/cjs/resources/tax_categories.d.ts +31 -30
- package/lib/cjs/resources/tax_categories.js +3 -11
- package/lib/cjs/resources/tax_rules.d.ts +52 -51
- package/lib/cjs/resources/tax_rules.js +3 -11
- package/lib/cjs/resources/taxjar_accounts.d.ts +22 -21
- package/lib/cjs/resources/taxjar_accounts.js +3 -11
- package/lib/cjs/resources/transactions.d.ts +24 -23
- package/lib/cjs/resources/transactions.js +0 -8
- package/lib/cjs/resources/versions.d.ts +14 -14
- package/lib/cjs/resources/versions.js +0 -8
- package/lib/cjs/resources/voids.d.ts +26 -25
- package/lib/cjs/resources/voids.js +0 -8
- package/lib/cjs/resources/webhooks.d.ts +28 -26
- package/lib/cjs/resources/webhooks.js +6 -11
- package/lib/cjs/resources/wire_transfers.d.ts +17 -16
- package/lib/cjs/resources/wire_transfers.js +3 -11
- package/lib/cjs/static.d.ts +1 -1
- package/lib/cjs/util.d.ts +1 -3
- package/lib/esm/api.d.ts +37 -0
- package/lib/esm/api.js +0 -13
- package/lib/esm/client.d.ts +15 -8
- package/lib/esm/client.js +40 -40
- package/lib/esm/commercelayer.d.ts +3 -4
- package/lib/esm/commercelayer.js +7 -3
- package/lib/esm/common.d.ts +1 -0
- package/lib/esm/common.js +11 -2
- package/lib/esm/config.d.ts +1 -0
- package/lib/esm/config.js +3 -0
- package/lib/esm/debug.js +0 -4
- package/lib/esm/error.d.ts +3 -1
- package/lib/esm/error.js +35 -5
- package/lib/esm/index.d.ts +1 -1
- package/lib/esm/index.js +0 -2
- package/lib/esm/interceptor.d.ts +6 -2
- package/lib/esm/jsonapi.js +9 -2
- package/lib/esm/query.d.ts +9 -15
- package/lib/esm/query.js +2 -2
- package/lib/esm/resource.d.ts +30 -20
- package/lib/esm/resource.js +40 -10
- package/lib/esm/resources/addresses.d.ts +74 -73
- package/lib/esm/resources/addresses.js +3 -11
- package/lib/esm/resources/adjustments.d.ts +20 -19
- package/lib/esm/resources/adjustments.js +3 -11
- package/lib/esm/resources/adyen_gateways.d.ts +35 -34
- package/lib/esm/resources/adyen_gateways.js +3 -11
- package/lib/esm/resources/adyen_payments.d.ts +29 -27
- package/lib/esm/resources/adyen_payments.js +6 -11
- package/lib/esm/resources/application.d.ts +14 -13
- package/lib/esm/resources/application.js +2 -7
- package/lib/esm/resources/attachments.d.ts +81 -80
- package/lib/esm/resources/attachments.js +3 -11
- package/lib/esm/resources/authorizations.d.ts +47 -43
- package/lib/esm/resources/authorizations.js +10 -9
- package/lib/esm/resources/avalara_accounts.d.ts +32 -31
- package/lib/esm/resources/avalara_accounts.js +3 -11
- package/lib/esm/resources/axerve_gateways.d.ts +24 -23
- package/lib/esm/resources/axerve_gateways.js +3 -11
- package/lib/esm/resources/axerve_payments.d.ts +28 -26
- package/lib/esm/resources/axerve_payments.js +6 -11
- package/lib/esm/resources/billing_info_validation_rules.d.ts +17 -16
- package/lib/esm/resources/billing_info_validation_rules.js +3 -11
- package/lib/esm/resources/bing_geocoders.d.ts +16 -15
- package/lib/esm/resources/bing_geocoders.js +3 -11
- package/lib/esm/resources/braintree_gateways.d.ts +34 -33
- package/lib/esm/resources/braintree_gateways.js +3 -11
- package/lib/esm/resources/braintree_payments.d.ts +30 -29
- package/lib/esm/resources/braintree_payments.js +3 -11
- package/lib/esm/resources/bundles.d.ts +57 -54
- package/lib/esm/resources/bundles.js +9 -11
- package/lib/esm/resources/captures.d.ts +37 -34
- package/lib/esm/resources/captures.js +7 -9
- package/lib/esm/resources/carrier_accounts.d.ts +16 -15
- package/lib/esm/resources/carrier_accounts.js +0 -8
- package/lib/esm/resources/checkout_com_gateways.d.ts +25 -24
- package/lib/esm/resources/checkout_com_gateways.js +3 -11
- package/lib/esm/resources/checkout_com_payments.d.ts +41 -38
- package/lib/esm/resources/checkout_com_payments.js +9 -11
- package/lib/esm/resources/cleanups.d.ts +24 -23
- package/lib/esm/resources/cleanups.js +2 -10
- package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +31 -30
- package/lib/esm/resources/coupon_codes_promotion_rules.js +3 -11
- package/lib/esm/resources/coupon_recipients.d.ts +26 -25
- package/lib/esm/resources/coupon_recipients.js +3 -11
- package/lib/esm/resources/coupons.d.ts +39 -38
- package/lib/esm/resources/coupons.js +3 -11
- package/lib/esm/resources/customer_addresses.d.ts +23 -22
- package/lib/esm/resources/customer_addresses.js +3 -11
- package/lib/esm/resources/customer_groups.d.ts +17 -16
- package/lib/esm/resources/customer_groups.js +3 -11
- package/lib/esm/resources/customer_password_resets.d.ts +19 -17
- package/lib/esm/resources/customer_password_resets.js +6 -11
- package/lib/esm/resources/customer_payment_sources.d.ts +37 -36
- package/lib/esm/resources/customer_payment_sources.js +3 -11
- package/lib/esm/resources/customer_subscriptions.d.ts +15 -14
- package/lib/esm/resources/customer_subscriptions.js +3 -11
- package/lib/esm/resources/customers.d.ts +37 -36
- package/lib/esm/resources/customers.js +3 -11
- package/lib/esm/resources/delivery_lead_times.d.ts +27 -26
- package/lib/esm/resources/delivery_lead_times.js +3 -11
- package/lib/esm/resources/event_callbacks.d.ts +15 -14
- package/lib/esm/resources/event_callbacks.js +0 -8
- package/lib/esm/resources/events.d.ts +13 -12
- package/lib/esm/resources/events.js +0 -8
- package/lib/esm/resources/exports.d.ts +27 -26
- package/lib/esm/resources/exports.js +2 -10
- package/lib/esm/resources/external_gateways.d.ts +32 -31
- package/lib/esm/resources/external_gateways.js +3 -11
- package/lib/esm/resources/external_payments.d.ts +23 -22
- package/lib/esm/resources/external_payments.js +3 -11
- package/lib/esm/resources/external_promotions.d.ts +66 -65
- package/lib/esm/resources/external_promotions.js +3 -11
- package/lib/esm/resources/external_tax_calculators.d.ts +19 -18
- package/lib/esm/resources/external_tax_calculators.js +3 -11
- package/lib/esm/resources/fixed_amount_promotions.d.ts +67 -66
- package/lib/esm/resources/fixed_amount_promotions.js +3 -11
- package/lib/esm/resources/fixed_price_promotions.d.ts +71 -70
- package/lib/esm/resources/fixed_price_promotions.js +3 -11
- package/lib/esm/resources/free_gift_promotions.d.ts +70 -69
- package/lib/esm/resources/free_gift_promotions.js +3 -11
- package/lib/esm/resources/free_shipping_promotions.d.ts +63 -62
- package/lib/esm/resources/free_shipping_promotions.js +3 -11
- package/lib/esm/resources/geocoders.d.ts +13 -12
- package/lib/esm/resources/geocoders.js +0 -8
- package/lib/esm/resources/gift_card_recipients.d.ts +26 -25
- package/lib/esm/resources/gift_card_recipients.js +3 -11
- package/lib/esm/resources/gift_cards.d.ts +71 -66
- package/lib/esm/resources/gift_cards.js +15 -11
- package/lib/esm/resources/google_geocoders.d.ts +16 -15
- package/lib/esm/resources/google_geocoders.js +3 -11
- package/lib/esm/resources/imports.d.ts +32 -31
- package/lib/esm/resources/imports.js +2 -10
- package/lib/esm/resources/in_stock_subscriptions.d.ts +38 -35
- package/lib/esm/resources/in_stock_subscriptions.js +9 -11
- package/lib/esm/resources/inventory_models.d.ts +26 -25
- package/lib/esm/resources/inventory_models.js +3 -11
- package/lib/esm/resources/inventory_return_locations.d.ts +22 -21
- package/lib/esm/resources/inventory_return_locations.js +3 -11
- package/lib/esm/resources/inventory_stock_locations.d.ts +25 -24
- package/lib/esm/resources/inventory_stock_locations.js +3 -11
- package/lib/esm/resources/klarna_gateways.d.ts +23 -22
- package/lib/esm/resources/klarna_gateways.js +3 -11
- package/lib/esm/resources/klarna_payments.d.ts +29 -27
- package/lib/esm/resources/klarna_payments.js +6 -11
- package/lib/esm/resources/line_item_options.d.ts +41 -40
- package/lib/esm/resources/line_item_options.js +3 -11
- package/lib/esm/resources/line_items.d.ts +96 -93
- package/lib/esm/resources/line_items.js +9 -11
- package/lib/esm/resources/manual_gateways.d.ts +15 -14
- package/lib/esm/resources/manual_gateways.js +3 -11
- package/lib/esm/resources/manual_tax_calculators.d.ts +21 -20
- package/lib/esm/resources/manual_tax_calculators.js +3 -11
- package/lib/esm/resources/markets.d.ts +62 -59
- package/lib/esm/resources/markets.js +9 -11
- package/lib/esm/resources/merchants.d.ts +19 -18
- package/lib/esm/resources/merchants.js +3 -11
- package/lib/esm/resources/order_amount_promotion_rules.d.ts +34 -33
- package/lib/esm/resources/order_amount_promotion_rules.js +3 -11
- package/lib/esm/resources/order_copies.d.ts +29 -28
- package/lib/esm/resources/order_copies.js +3 -11
- package/lib/esm/resources/order_factories.d.ts +21 -20
- package/lib/esm/resources/order_factories.js +0 -8
- package/lib/esm/resources/order_subscription_items.d.ts +40 -39
- package/lib/esm/resources/order_subscription_items.js +3 -11
- package/lib/esm/resources/order_subscriptions.d.ts +55 -51
- package/lib/esm/resources/order_subscriptions.js +12 -11
- package/lib/esm/resources/order_validation_rules.d.ts +13 -12
- package/lib/esm/resources/order_validation_rules.js +0 -8
- package/lib/esm/resources/orders.d.ts +263 -235
- package/lib/esm/resources/orders.js +84 -11
- package/lib/esm/resources/organization.d.ts +25 -24
- package/lib/esm/resources/organization.js +2 -7
- package/lib/esm/resources/packages.d.ts +31 -30
- package/lib/esm/resources/packages.js +3 -11
- package/lib/esm/resources/parcel_line_items.d.ts +23 -22
- package/lib/esm/resources/parcel_line_items.js +3 -11
- package/lib/esm/resources/parcels.d.ts +94 -93
- package/lib/esm/resources/parcels.js +3 -11
- package/lib/esm/resources/payment_gateways.d.ts +13 -12
- package/lib/esm/resources/payment_gateways.js +0 -8
- package/lib/esm/resources/payment_methods.d.ts +51 -48
- package/lib/esm/resources/payment_methods.js +9 -11
- package/lib/esm/resources/paypal_gateways.d.ts +18 -17
- package/lib/esm/resources/paypal_gateways.js +3 -11
- package/lib/esm/resources/paypal_payments.d.ts +32 -31
- package/lib/esm/resources/paypal_payments.js +3 -11
- package/lib/esm/resources/percentage_discount_promotions.d.ts +70 -69
- package/lib/esm/resources/percentage_discount_promotions.js +3 -11
- package/lib/esm/resources/price_frequency_tiers.d.ts +27 -26
- package/lib/esm/resources/price_frequency_tiers.js +3 -11
- package/lib/esm/resources/price_lists.d.ts +21 -20
- package/lib/esm/resources/price_lists.js +3 -11
- package/lib/esm/resources/price_tiers.d.ts +18 -17
- package/lib/esm/resources/price_tiers.js +0 -8
- package/lib/esm/resources/price_volume_tiers.d.ts +27 -26
- package/lib/esm/resources/price_volume_tiers.js +3 -11
- package/lib/esm/resources/prices.d.ts +40 -39
- package/lib/esm/resources/prices.js +3 -11
- package/lib/esm/resources/promotion_rules.d.ts +12 -11
- package/lib/esm/resources/promotion_rules.js +0 -8
- package/lib/esm/resources/promotions.d.ts +28 -27
- package/lib/esm/resources/promotions.js +0 -8
- package/lib/esm/resources/recurring_order_copies.d.ts +29 -28
- package/lib/esm/resources/recurring_order_copies.js +3 -11
- package/lib/esm/resources/refunds.d.ts +26 -25
- package/lib/esm/resources/refunds.js +0 -8
- package/lib/esm/resources/reserved_stocks.d.ts +14 -13
- package/lib/esm/resources/reserved_stocks.js +0 -8
- package/lib/esm/resources/return_line_items.d.ts +29 -27
- package/lib/esm/resources/return_line_items.js +6 -11
- package/lib/esm/resources/returns.d.ts +59 -49
- package/lib/esm/resources/returns.js +30 -11
- package/lib/esm/resources/satispay_gateways.d.ts +23 -22
- package/lib/esm/resources/satispay_gateways.js +3 -11
- package/lib/esm/resources/satispay_payments.d.ts +31 -29
- package/lib/esm/resources/satispay_payments.js +6 -11
- package/lib/esm/resources/shipments.d.ts +65 -57
- package/lib/esm/resources/shipments.js +22 -9
- package/lib/esm/resources/shipping_categories.d.ts +16 -15
- package/lib/esm/resources/shipping_categories.js +3 -11
- package/lib/esm/resources/shipping_method_tiers.d.ts +18 -17
- package/lib/esm/resources/shipping_method_tiers.js +0 -8
- package/lib/esm/resources/shipping_methods.d.ts +80 -77
- package/lib/esm/resources/shipping_methods.js +9 -11
- package/lib/esm/resources/shipping_weight_tiers.d.ts +26 -25
- package/lib/esm/resources/shipping_weight_tiers.js +3 -11
- package/lib/esm/resources/shipping_zones.d.ts +33 -32
- package/lib/esm/resources/shipping_zones.js +3 -11
- package/lib/esm/resources/sku_list_items.d.ts +27 -26
- package/lib/esm/resources/sku_list_items.js +3 -11
- package/lib/esm/resources/sku_list_promotion_rules.d.ts +38 -37
- package/lib/esm/resources/sku_list_promotion_rules.js +3 -11
- package/lib/esm/resources/sku_lists.d.ts +36 -35
- package/lib/esm/resources/sku_lists.js +3 -11
- package/lib/esm/resources/sku_options.d.ts +44 -43
- package/lib/esm/resources/sku_options.js +3 -11
- package/lib/esm/resources/skus.d.ts +57 -56
- package/lib/esm/resources/skus.js +3 -11
- package/lib/esm/resources/stock_items.d.ts +29 -28
- package/lib/esm/resources/stock_items.js +3 -11
- package/lib/esm/resources/stock_line_items.d.ts +18 -17
- package/lib/esm/resources/stock_line_items.js +0 -8
- package/lib/esm/resources/stock_locations.d.ts +30 -29
- package/lib/esm/resources/stock_locations.js +3 -11
- package/lib/esm/resources/stock_reservations.d.ts +18 -17
- package/lib/esm/resources/stock_reservations.js +0 -8
- package/lib/esm/resources/stock_transfers.d.ts +48 -42
- package/lib/esm/resources/stock_transfers.js +18 -11
- package/lib/esm/resources/stripe_gateways.d.ts +23 -22
- package/lib/esm/resources/stripe_gateways.js +3 -11
- package/lib/esm/resources/stripe_payments.d.ts +35 -32
- package/lib/esm/resources/stripe_payments.js +9 -11
- package/lib/esm/resources/subscription_models.d.ts +27 -26
- package/lib/esm/resources/subscription_models.js +3 -11
- package/lib/esm/resources/tags.d.ts +13 -12
- package/lib/esm/resources/tags.js +3 -11
- package/lib/esm/resources/tax_calculators.d.ts +14 -13
- package/lib/esm/resources/tax_calculators.js +0 -8
- package/lib/esm/resources/tax_categories.d.ts +31 -30
- package/lib/esm/resources/tax_categories.js +3 -11
- package/lib/esm/resources/tax_rules.d.ts +52 -51
- package/lib/esm/resources/tax_rules.js +3 -11
- package/lib/esm/resources/taxjar_accounts.d.ts +22 -21
- package/lib/esm/resources/taxjar_accounts.js +3 -11
- package/lib/esm/resources/transactions.d.ts +24 -23
- package/lib/esm/resources/transactions.js +0 -8
- package/lib/esm/resources/versions.d.ts +14 -14
- package/lib/esm/resources/versions.js +0 -8
- package/lib/esm/resources/voids.d.ts +26 -25
- package/lib/esm/resources/voids.js +0 -8
- package/lib/esm/resources/webhooks.d.ts +28 -26
- package/lib/esm/resources/webhooks.js +6 -11
- package/lib/esm/resources/wire_transfers.d.ts +17 -16
- package/lib/esm/resources/wire_transfers.js +3 -11
- package/lib/esm/static.d.ts +1 -1
- package/lib/esm/util.d.ts +1 -3
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -8
- 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
@@ -1,139 +1,140 @@
|
|
1
|
-
import { ApiResource
|
2
|
-
import type {
|
3
|
-
import type {
|
4
|
-
import type {
|
5
|
-
import type {
|
6
|
-
import type {
|
7
|
-
import type {
|
8
|
-
import type {
|
9
|
-
import type {
|
10
|
-
import type {
|
11
|
-
import type {
|
12
|
-
import type {
|
13
|
-
import type {
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
3
|
+
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
4
|
+
import type { Order, OrderType } from './orders';
|
5
|
+
import type { Adjustment, AdjustmentType } from './adjustments';
|
6
|
+
import type { Bundle, BundleType } from './bundles';
|
7
|
+
import type { ExternalPromotion, ExternalPromotionType } from './external_promotions';
|
8
|
+
import type { FixedAmountPromotion, FixedAmountPromotionType } from './fixed_amount_promotions';
|
9
|
+
import type { FreeShippingPromotion, FreeShippingPromotionType } from './free_shipping_promotions';
|
10
|
+
import type { GiftCard, GiftCardType } from './gift_cards';
|
11
|
+
import type { PaymentMethod, PaymentMethodType } from './payment_methods';
|
12
|
+
import type { PercentageDiscountPromotion, PercentageDiscountPromotionType } from './percentage_discount_promotions';
|
13
|
+
import type { Shipment, ShipmentType } from './shipments';
|
14
|
+
import type { Sku, SkuType } from './skus';
|
14
15
|
import type { LineItemOption } from './line_item_options';
|
15
16
|
import type { StockReservation } from './stock_reservations';
|
16
17
|
import type { StockLineItem } from './stock_line_items';
|
17
18
|
import type { StockTransfer } from './stock_transfers';
|
18
19
|
import type { Event } from './events';
|
19
|
-
import type { Tag } from './tags';
|
20
|
+
import type { Tag, TagType } from './tags';
|
21
|
+
type LineItemType = 'line_items';
|
20
22
|
type LineItemRel = ResourceRel & {
|
21
|
-
type:
|
23
|
+
type: LineItemType;
|
22
24
|
};
|
23
25
|
type OrderRel = ResourceRel & {
|
24
|
-
type:
|
26
|
+
type: OrderType;
|
25
27
|
};
|
26
28
|
type AdjustmentRel = ResourceRel & {
|
27
|
-
type:
|
29
|
+
type: AdjustmentType;
|
28
30
|
};
|
29
31
|
type BundleRel = ResourceRel & {
|
30
|
-
type:
|
32
|
+
type: BundleType;
|
31
33
|
};
|
32
34
|
type ExternalPromotionRel = ResourceRel & {
|
33
|
-
type:
|
35
|
+
type: ExternalPromotionType;
|
34
36
|
};
|
35
37
|
type FixedAmountPromotionRel = ResourceRel & {
|
36
|
-
type:
|
38
|
+
type: FixedAmountPromotionType;
|
37
39
|
};
|
38
40
|
type FreeShippingPromotionRel = ResourceRel & {
|
39
|
-
type:
|
41
|
+
type: FreeShippingPromotionType;
|
40
42
|
};
|
41
43
|
type GiftCardRel = ResourceRel & {
|
42
|
-
type:
|
44
|
+
type: GiftCardType;
|
43
45
|
};
|
44
46
|
type PaymentMethodRel = ResourceRel & {
|
45
|
-
type:
|
47
|
+
type: PaymentMethodType;
|
46
48
|
};
|
47
49
|
type PercentageDiscountPromotionRel = ResourceRel & {
|
48
|
-
type:
|
50
|
+
type: PercentageDiscountPromotionType;
|
49
51
|
};
|
50
52
|
type ShipmentRel = ResourceRel & {
|
51
|
-
type:
|
53
|
+
type: ShipmentType;
|
52
54
|
};
|
53
55
|
type SkuRel = ResourceRel & {
|
54
|
-
type:
|
56
|
+
type: SkuType;
|
55
57
|
};
|
56
58
|
type TagRel = ResourceRel & {
|
57
|
-
type:
|
59
|
+
type: TagType;
|
58
60
|
};
|
59
61
|
interface LineItem extends Resource {
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
62
|
+
readonly type: LineItemType;
|
63
|
+
sku_code?: string | null;
|
64
|
+
bundle_code?: string | null;
|
65
|
+
quantity: number;
|
66
|
+
currency_code?: string | null;
|
67
|
+
unit_amount_cents?: number | null;
|
68
|
+
unit_amount_float?: number | null;
|
69
|
+
formatted_unit_amount?: string | null;
|
70
|
+
options_amount_cents?: number | null;
|
71
|
+
options_amount_float?: number | null;
|
72
|
+
formatted_options_amount?: string | null;
|
73
|
+
discount_cents?: number | null;
|
74
|
+
discount_float?: number | null;
|
75
|
+
formatted_discount?: string | null;
|
76
|
+
total_amount_cents?: number | null;
|
77
|
+
total_amount_float: number;
|
78
|
+
formatted_total_amount?: string | null;
|
79
|
+
tax_amount_cents?: number | null;
|
80
|
+
tax_amount_float: number;
|
81
|
+
formatted_tax_amount?: string | null;
|
82
|
+
name?: string | null;
|
83
|
+
image_url?: string | null;
|
84
|
+
discount_breakdown?: Record<string, any> | null;
|
85
|
+
tax_rate?: number | null;
|
86
|
+
tax_breakdown?: Record<string, any> | null;
|
87
|
+
item_type?: 'skus' | 'bundles' | 'shipments' | 'payment_methods' | 'adjustments' | 'gift_cards' | 'percentage_discount_promotions' | 'free_shipping_promotions' | 'free_gift_promotions' | 'fixed_price_promotions' | 'external_promotions' | 'fixed_amount_promotions' | null;
|
88
|
+
frequency?: string | null;
|
89
|
+
order?: Order | null;
|
90
|
+
item?: Adjustment | Bundle | ExternalPromotion | FixedAmountPromotion | FreeShippingPromotion | GiftCard | PaymentMethod | PercentageDiscountPromotion | Shipment | Sku | null;
|
91
|
+
sku?: Sku | null;
|
92
|
+
bundle?: Bundle | null;
|
93
|
+
line_item_options?: LineItemOption[] | null;
|
91
94
|
/**
|
92
95
|
* @deprecated This field should not be used as it may be removed in the future without notice
|
93
96
|
*/
|
94
97
|
shipment_line_items?: object[];
|
95
|
-
stock_reservations?: StockReservation[];
|
96
|
-
stock_line_items?: StockLineItem[];
|
97
|
-
stock_transfers?: StockTransfer[];
|
98
|
-
events?: Event[];
|
99
|
-
tags?: Tag[];
|
98
|
+
stock_reservations?: StockReservation[] | null;
|
99
|
+
stock_line_items?: StockLineItem[] | null;
|
100
|
+
stock_transfers?: StockTransfer[] | null;
|
101
|
+
events?: Event[] | null;
|
102
|
+
tags?: Tag[] | null;
|
100
103
|
}
|
101
104
|
interface LineItemCreate extends ResourceCreate {
|
102
|
-
sku_code?: string;
|
103
|
-
bundle_code?: string;
|
105
|
+
sku_code?: string | null;
|
106
|
+
bundle_code?: string | null;
|
104
107
|
quantity: number;
|
105
|
-
_external_price?: boolean;
|
106
|
-
_update_quantity?: boolean;
|
107
|
-
_reserve_stock?: boolean;
|
108
|
-
unit_amount_cents?: number;
|
109
|
-
name?: string;
|
110
|
-
image_url?: string;
|
111
|
-
item_type?:
|
112
|
-
frequency?: string;
|
108
|
+
_external_price?: boolean | null;
|
109
|
+
_update_quantity?: boolean | null;
|
110
|
+
_reserve_stock?: boolean | null;
|
111
|
+
unit_amount_cents?: number | null;
|
112
|
+
name?: string | null;
|
113
|
+
image_url?: string | null;
|
114
|
+
item_type?: 'skus' | 'bundles' | 'shipments' | 'payment_methods' | 'adjustments' | 'gift_cards' | 'percentage_discount_promotions' | 'free_shipping_promotions' | 'free_gift_promotions' | 'fixed_price_promotions' | 'external_promotions' | 'fixed_amount_promotions' | null;
|
115
|
+
frequency?: string | null;
|
113
116
|
order: OrderRel;
|
114
|
-
item?: AdjustmentRel | BundleRel | ExternalPromotionRel | FixedAmountPromotionRel | FreeShippingPromotionRel | GiftCardRel | PaymentMethodRel | PercentageDiscountPromotionRel | ShipmentRel | SkuRel;
|
115
|
-
sku?: SkuRel;
|
116
|
-
bundle?: BundleRel;
|
117
|
-
tags?: TagRel[];
|
117
|
+
item?: AdjustmentRel | BundleRel | ExternalPromotionRel | FixedAmountPromotionRel | FreeShippingPromotionRel | GiftCardRel | PaymentMethodRel | PercentageDiscountPromotionRel | ShipmentRel | SkuRel | null;
|
118
|
+
sku?: SkuRel | null;
|
119
|
+
bundle?: BundleRel | null;
|
120
|
+
tags?: TagRel[] | null;
|
118
121
|
}
|
119
122
|
interface LineItemUpdate extends ResourceUpdate {
|
120
|
-
sku_code?: string;
|
121
|
-
bundle_code?: string;
|
122
|
-
quantity?: number;
|
123
|
-
_external_price?: boolean;
|
124
|
-
_reserve_stock?: boolean;
|
125
|
-
name?: string;
|
126
|
-
image_url?: string;
|
127
|
-
frequency?: string;
|
128
|
-
tags?: TagRel[];
|
123
|
+
sku_code?: string | null;
|
124
|
+
bundle_code?: string | null;
|
125
|
+
quantity?: number | null;
|
126
|
+
_external_price?: boolean | null;
|
127
|
+
_reserve_stock?: boolean | null;
|
128
|
+
name?: string | null;
|
129
|
+
image_url?: string | null;
|
130
|
+
frequency?: string | null;
|
131
|
+
tags?: TagRel[] | null;
|
129
132
|
}
|
130
|
-
declare class LineItems extends ApiResource {
|
131
|
-
static readonly TYPE:
|
132
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<LineItem>>;
|
133
|
+
declare class LineItems extends ApiResource<LineItem> {
|
134
|
+
static readonly TYPE: LineItemType;
|
133
135
|
create(resource: LineItemCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
|
134
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
|
135
136
|
update(resource: LineItemUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
|
136
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
137
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
137
138
|
order(lineItemId: string | LineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
138
139
|
line_item_options(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<LineItemOption>>;
|
139
140
|
stock_reservations(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockReservation>>;
|
@@ -141,9 +142,11 @@ declare class LineItems extends ApiResource {
|
|
141
142
|
stock_transfers(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockTransfer>>;
|
142
143
|
events(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
143
144
|
tags(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
145
|
+
_external_price(id: string | LineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
|
146
|
+
_reserve_stock(id: string | LineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
|
144
147
|
isLineItem(resource: any): resource is LineItem;
|
145
148
|
relationship(id: string | ResourceId | null): LineItemRel;
|
146
|
-
type():
|
149
|
+
type(): LineItemType;
|
147
150
|
}
|
148
151
|
export default LineItems;
|
149
|
-
export { LineItem, LineItemCreate, LineItemUpdate };
|
152
|
+
export type { LineItem, LineItemCreate, LineItemUpdate, LineItemType };
|
@@ -1,20 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class LineItems extends ApiResource {
|
3
|
-
// static readonly PATH = 'line_items'
|
4
|
-
async list(params, options) {
|
5
|
-
return this.resources.list({ type: LineItems.TYPE }, params, options);
|
6
|
-
}
|
7
3
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
9
|
-
}
|
10
|
-
async retrieve(id, params, options) {
|
11
|
-
return this.resources.retrieve({ type: LineItems.TYPE, id }, params, options);
|
4
|
+
return this.resources.create({ ...resource, type: LineItems.TYPE }, params, options);
|
12
5
|
}
|
13
6
|
async update(resource, params, options) {
|
14
|
-
return this.resources.update(
|
7
|
+
return this.resources.update({ ...resource, type: LineItems.TYPE }, params, options);
|
15
8
|
}
|
16
9
|
async delete(id, options) {
|
17
|
-
await this.resources.delete({ type: LineItems.TYPE
|
10
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: LineItems.TYPE } : id, options);
|
18
11
|
}
|
19
12
|
async order(lineItemId, params, options) {
|
20
13
|
const _lineItemId = lineItemId.id || lineItemId;
|
@@ -44,7 +37,12 @@ class LineItems extends ApiResource {
|
|
44
37
|
const _lineItemId = lineItemId.id || lineItemId;
|
45
38
|
return this.resources.fetch({ type: 'tags' }, `line_items/${_lineItemId}/tags`, params, options);
|
46
39
|
}
|
47
|
-
|
40
|
+
async _external_price(id, params, options) {
|
41
|
+
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: LineItems.TYPE, _external_price: true }, params, options);
|
42
|
+
}
|
43
|
+
async _reserve_stock(id, params, options) {
|
44
|
+
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: LineItems.TYPE, _reserve_stock: true }, params, options);
|
45
|
+
}
|
48
46
|
isLineItem(resource) {
|
49
47
|
return resource.type && (resource.type === LineItems.TYPE);
|
50
48
|
}
|
@@ -1,33 +1,34 @@
|
|
1
|
-
import { ApiResource
|
2
|
-
import type {
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
3
|
+
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
3
4
|
import type { PaymentMethod } from './payment_methods';
|
4
5
|
import type { Version } from './versions';
|
6
|
+
type ManualGatewayType = 'manual_gateways';
|
5
7
|
type ManualGatewayRel = ResourceRel & {
|
6
|
-
type:
|
8
|
+
type: ManualGatewayType;
|
7
9
|
};
|
8
10
|
interface ManualGateway extends Resource {
|
9
|
-
|
10
|
-
|
11
|
-
|
11
|
+
readonly type: ManualGatewayType;
|
12
|
+
name: string;
|
13
|
+
payment_methods?: PaymentMethod[] | null;
|
14
|
+
versions?: Version[] | null;
|
12
15
|
}
|
13
16
|
interface ManualGatewayCreate extends ResourceCreate {
|
14
17
|
name: string;
|
15
18
|
}
|
16
19
|
interface ManualGatewayUpdate extends ResourceUpdate {
|
17
|
-
name?: string;
|
20
|
+
name?: string | null;
|
18
21
|
}
|
19
|
-
declare class ManualGateways extends ApiResource {
|
20
|
-
static readonly TYPE:
|
21
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ManualGateway>>;
|
22
|
+
declare class ManualGateways extends ApiResource<ManualGateway> {
|
23
|
+
static readonly TYPE: ManualGatewayType;
|
22
24
|
create(resource: ManualGatewayCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ManualGateway>;
|
23
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ManualGateway>;
|
24
25
|
update(resource: ManualGatewayUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ManualGateway>;
|
25
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
26
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
26
27
|
payment_methods(manualGatewayId: string | ManualGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>>;
|
27
28
|
versions(manualGatewayId: string | ManualGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
28
29
|
isManualGateway(resource: any): resource is ManualGateway;
|
29
30
|
relationship(id: string | ResourceId | null): ManualGatewayRel;
|
30
|
-
type():
|
31
|
+
type(): ManualGatewayType;
|
31
32
|
}
|
32
33
|
export default ManualGateways;
|
33
|
-
export { ManualGateway, ManualGatewayCreate, ManualGatewayUpdate };
|
34
|
+
export type { ManualGateway, ManualGatewayCreate, ManualGatewayUpdate, ManualGatewayType };
|
@@ -1,20 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class ManualGateways extends ApiResource {
|
3
|
-
// static readonly PATH = 'manual_gateways'
|
4
|
-
async list(params, options) {
|
5
|
-
return this.resources.list({ type: ManualGateways.TYPE }, params, options);
|
6
|
-
}
|
7
3
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
9
|
-
}
|
10
|
-
async retrieve(id, params, options) {
|
11
|
-
return this.resources.retrieve({ type: ManualGateways.TYPE, id }, params, options);
|
4
|
+
return this.resources.create({ ...resource, type: ManualGateways.TYPE }, params, options);
|
12
5
|
}
|
13
6
|
async update(resource, params, options) {
|
14
|
-
return this.resources.update(
|
7
|
+
return this.resources.update({ ...resource, type: ManualGateways.TYPE }, params, options);
|
15
8
|
}
|
16
9
|
async delete(id, options) {
|
17
|
-
await this.resources.delete({ type: ManualGateways.TYPE
|
10
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: ManualGateways.TYPE } : id, options);
|
18
11
|
}
|
19
12
|
async payment_methods(manualGatewayId, params, options) {
|
20
13
|
const _manualGatewayId = manualGatewayId.id || manualGatewayId;
|
@@ -24,7 +17,6 @@ class ManualGateways extends ApiResource {
|
|
24
17
|
const _manualGatewayId = manualGatewayId.id || manualGatewayId;
|
25
18
|
return this.resources.fetch({ type: 'versions' }, `manual_gateways/${_manualGatewayId}/versions`, params, options);
|
26
19
|
}
|
27
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
28
20
|
isManualGateway(resource) {
|
29
21
|
return resource.type && (resource.type === ManualGateways.TYPE);
|
30
22
|
}
|
@@ -1,44 +1,45 @@
|
|
1
|
-
import { ApiResource
|
2
|
-
import type {
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
3
|
+
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
3
4
|
import type { Market } from './markets';
|
4
5
|
import type { Attachment } from './attachments';
|
5
6
|
import type { Version } from './versions';
|
6
|
-
import type { TaxRule } from './tax_rules';
|
7
|
+
import type { TaxRule, TaxRuleType } from './tax_rules';
|
8
|
+
type ManualTaxCalculatorType = 'manual_tax_calculators';
|
7
9
|
type ManualTaxCalculatorRel = ResourceRel & {
|
8
|
-
type:
|
10
|
+
type: ManualTaxCalculatorType;
|
9
11
|
};
|
10
12
|
type TaxRuleRel = ResourceRel & {
|
11
|
-
type:
|
13
|
+
type: TaxRuleType;
|
12
14
|
};
|
13
15
|
interface ManualTaxCalculator extends Resource {
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
readonly type: ManualTaxCalculatorType;
|
17
|
+
name: string;
|
18
|
+
markets?: Market[] | null;
|
19
|
+
attachments?: Attachment[] | null;
|
20
|
+
versions?: Version[] | null;
|
21
|
+
tax_rules?: TaxRule[] | null;
|
19
22
|
}
|
20
23
|
interface ManualTaxCalculatorCreate extends ResourceCreate {
|
21
24
|
name: string;
|
22
|
-
tax_rules?: TaxRuleRel[];
|
25
|
+
tax_rules?: TaxRuleRel[] | null;
|
23
26
|
}
|
24
27
|
interface ManualTaxCalculatorUpdate extends ResourceUpdate {
|
25
|
-
name?: string;
|
26
|
-
tax_rules?: TaxRuleRel[];
|
28
|
+
name?: string | null;
|
29
|
+
tax_rules?: TaxRuleRel[] | null;
|
27
30
|
}
|
28
|
-
declare class ManualTaxCalculators extends ApiResource {
|
29
|
-
static readonly TYPE:
|
30
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ManualTaxCalculator>>;
|
31
|
+
declare class ManualTaxCalculators extends ApiResource<ManualTaxCalculator> {
|
32
|
+
static readonly TYPE: ManualTaxCalculatorType;
|
31
33
|
create(resource: ManualTaxCalculatorCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ManualTaxCalculator>;
|
32
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ManualTaxCalculator>;
|
33
34
|
update(resource: ManualTaxCalculatorUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ManualTaxCalculator>;
|
34
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
35
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
35
36
|
markets(manualTaxCalculatorId: string | ManualTaxCalculator, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Market>>;
|
36
37
|
attachments(manualTaxCalculatorId: string | ManualTaxCalculator, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
37
38
|
versions(manualTaxCalculatorId: string | ManualTaxCalculator, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
38
39
|
tax_rules(manualTaxCalculatorId: string | ManualTaxCalculator, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<TaxRule>>;
|
39
40
|
isManualTaxCalculator(resource: any): resource is ManualTaxCalculator;
|
40
41
|
relationship(id: string | ResourceId | null): ManualTaxCalculatorRel;
|
41
|
-
type():
|
42
|
+
type(): ManualTaxCalculatorType;
|
42
43
|
}
|
43
44
|
export default ManualTaxCalculators;
|
44
|
-
export { ManualTaxCalculator, ManualTaxCalculatorCreate, ManualTaxCalculatorUpdate };
|
45
|
+
export type { ManualTaxCalculator, ManualTaxCalculatorCreate, ManualTaxCalculatorUpdate, ManualTaxCalculatorType };
|
@@ -1,20 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class ManualTaxCalculators extends ApiResource {
|
3
|
-
// static readonly PATH = 'manual_tax_calculators'
|
4
|
-
async list(params, options) {
|
5
|
-
return this.resources.list({ type: ManualTaxCalculators.TYPE }, params, options);
|
6
|
-
}
|
7
3
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
9
|
-
}
|
10
|
-
async retrieve(id, params, options) {
|
11
|
-
return this.resources.retrieve({ type: ManualTaxCalculators.TYPE, id }, params, options);
|
4
|
+
return this.resources.create({ ...resource, type: ManualTaxCalculators.TYPE }, params, options);
|
12
5
|
}
|
13
6
|
async update(resource, params, options) {
|
14
|
-
return this.resources.update(
|
7
|
+
return this.resources.update({ ...resource, type: ManualTaxCalculators.TYPE }, params, options);
|
15
8
|
}
|
16
9
|
async delete(id, options) {
|
17
|
-
await this.resources.delete({ type: ManualTaxCalculators.TYPE
|
10
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: ManualTaxCalculators.TYPE } : id, options);
|
18
11
|
}
|
19
12
|
async markets(manualTaxCalculatorId, params, options) {
|
20
13
|
const _manualTaxCalculatorId = manualTaxCalculatorId.id || manualTaxCalculatorId;
|
@@ -32,7 +25,6 @@ class ManualTaxCalculators extends ApiResource {
|
|
32
25
|
const _manualTaxCalculatorId = manualTaxCalculatorId.id || manualTaxCalculatorId;
|
33
26
|
return this.resources.fetch({ type: 'tax_rules' }, `manual_tax_calculators/${_manualTaxCalculatorId}/tax_rules`, params, options);
|
34
27
|
}
|
35
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
36
28
|
isManualTaxCalculator(resource) {
|
37
29
|
return resource.type && (resource.type === ManualTaxCalculators.TYPE);
|
38
30
|
}
|
@@ -1,88 +1,89 @@
|
|
1
|
-
import { ApiResource
|
2
|
-
import type {
|
3
|
-
import type {
|
4
|
-
import type {
|
5
|
-
import type {
|
6
|
-
import type {
|
7
|
-
import type {
|
8
|
-
import type {
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
3
|
+
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
4
|
+
import type { Merchant, MerchantType } from './merchants';
|
5
|
+
import type { PriceList, PriceListType } from './price_lists';
|
6
|
+
import type { InventoryModel, InventoryModelType } from './inventory_models';
|
7
|
+
import type { SubscriptionModel, SubscriptionModelType } from './subscription_models';
|
8
|
+
import type { TaxCalculator, TaxCalculatorType } from './tax_calculators';
|
9
|
+
import type { CustomerGroup, CustomerGroupType } from './customer_groups';
|
9
10
|
import type { Attachment } from './attachments';
|
10
11
|
import type { Version } from './versions';
|
12
|
+
type MarketType = 'markets';
|
11
13
|
type MarketRel = ResourceRel & {
|
12
|
-
type:
|
14
|
+
type: MarketType;
|
13
15
|
};
|
14
16
|
type MerchantRel = ResourceRel & {
|
15
|
-
type:
|
17
|
+
type: MerchantType;
|
16
18
|
};
|
17
19
|
type PriceListRel = ResourceRel & {
|
18
|
-
type:
|
20
|
+
type: PriceListType;
|
19
21
|
};
|
20
22
|
type InventoryModelRel = ResourceRel & {
|
21
|
-
type:
|
23
|
+
type: InventoryModelType;
|
22
24
|
};
|
23
25
|
type SubscriptionModelRel = ResourceRel & {
|
24
|
-
type:
|
26
|
+
type: SubscriptionModelType;
|
25
27
|
};
|
26
28
|
type TaxCalculatorRel = ResourceRel & {
|
27
|
-
type:
|
29
|
+
type: TaxCalculatorType;
|
28
30
|
};
|
29
31
|
type CustomerGroupRel = ResourceRel & {
|
30
|
-
type:
|
32
|
+
type: CustomerGroupType;
|
31
33
|
};
|
32
34
|
interface Market extends Resource {
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
35
|
+
readonly type: MarketType;
|
36
|
+
number?: number | null;
|
37
|
+
name: string;
|
38
|
+
facebook_pixel_id?: string | null;
|
39
|
+
checkout_url?: string | null;
|
40
|
+
external_prices_url?: string | null;
|
41
|
+
external_order_validation_url?: string | null;
|
42
|
+
shared_secret: string;
|
43
|
+
private?: boolean | null;
|
44
|
+
disabled_at?: string | null;
|
45
|
+
merchant?: Merchant | null;
|
46
|
+
price_list?: PriceList | null;
|
47
|
+
inventory_model?: InventoryModel | null;
|
48
|
+
subscription_model?: SubscriptionModel | null;
|
49
|
+
tax_calculator?: TaxCalculator | null;
|
50
|
+
customer_group?: CustomerGroup | null;
|
51
|
+
attachments?: Attachment[] | null;
|
52
|
+
versions?: Version[] | null;
|
50
53
|
}
|
51
54
|
interface MarketCreate extends ResourceCreate {
|
52
55
|
name: string;
|
53
|
-
facebook_pixel_id?: string;
|
54
|
-
checkout_url?: string;
|
55
|
-
external_prices_url?: string;
|
56
|
-
external_order_validation_url?: string;
|
56
|
+
facebook_pixel_id?: string | null;
|
57
|
+
checkout_url?: string | null;
|
58
|
+
external_prices_url?: string | null;
|
59
|
+
external_order_validation_url?: string | null;
|
57
60
|
merchant: MerchantRel;
|
58
61
|
price_list: PriceListRel;
|
59
62
|
inventory_model: InventoryModelRel;
|
60
|
-
subscription_model?: SubscriptionModelRel;
|
61
|
-
tax_calculator?: TaxCalculatorRel;
|
62
|
-
customer_group?: CustomerGroupRel;
|
63
|
+
subscription_model?: SubscriptionModelRel | null;
|
64
|
+
tax_calculator?: TaxCalculatorRel | null;
|
65
|
+
customer_group?: CustomerGroupRel | null;
|
63
66
|
}
|
64
67
|
interface MarketUpdate extends ResourceUpdate {
|
65
|
-
name?: string;
|
66
|
-
facebook_pixel_id?: string;
|
67
|
-
checkout_url?: string;
|
68
|
-
external_prices_url?: string;
|
69
|
-
external_order_validation_url?: string;
|
70
|
-
_disable?: boolean;
|
71
|
-
_enable?: boolean;
|
72
|
-
merchant?: MerchantRel;
|
73
|
-
price_list?: PriceListRel;
|
74
|
-
inventory_model?: InventoryModelRel;
|
75
|
-
subscription_model?: SubscriptionModelRel;
|
76
|
-
tax_calculator?: TaxCalculatorRel;
|
77
|
-
customer_group?: CustomerGroupRel;
|
68
|
+
name?: string | null;
|
69
|
+
facebook_pixel_id?: string | null;
|
70
|
+
checkout_url?: string | null;
|
71
|
+
external_prices_url?: string | null;
|
72
|
+
external_order_validation_url?: string | null;
|
73
|
+
_disable?: boolean | null;
|
74
|
+
_enable?: boolean | null;
|
75
|
+
merchant?: MerchantRel | null;
|
76
|
+
price_list?: PriceListRel | null;
|
77
|
+
inventory_model?: InventoryModelRel | null;
|
78
|
+
subscription_model?: SubscriptionModelRel | null;
|
79
|
+
tax_calculator?: TaxCalculatorRel | null;
|
80
|
+
customer_group?: CustomerGroupRel | null;
|
78
81
|
}
|
79
|
-
declare class Markets extends ApiResource {
|
80
|
-
static readonly TYPE:
|
81
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Market>>;
|
82
|
+
declare class Markets extends ApiResource<Market> {
|
83
|
+
static readonly TYPE: MarketType;
|
82
84
|
create(resource: MarketCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
|
83
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
|
84
85
|
update(resource: MarketUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
|
85
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
86
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
86
87
|
merchant(marketId: string | Market, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Merchant>;
|
87
88
|
price_list(marketId: string | Market, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PriceList>;
|
88
89
|
inventory_model(marketId: string | Market, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<InventoryModel>;
|
@@ -91,9 +92,11 @@ declare class Markets extends ApiResource {
|
|
91
92
|
customer_group(marketId: string | Market, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomerGroup>;
|
92
93
|
attachments(marketId: string | Market, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
93
94
|
versions(marketId: string | Market, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
95
|
+
_disable(id: string | Market, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
|
96
|
+
_enable(id: string | Market, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
|
94
97
|
isMarket(resource: any): resource is Market;
|
95
98
|
relationship(id: string | ResourceId | null): MarketRel;
|
96
|
-
type():
|
99
|
+
type(): MarketType;
|
97
100
|
}
|
98
101
|
export default Markets;
|
99
|
-
export { Market, MarketCreate, MarketUpdate };
|
102
|
+
export type { Market, MarketCreate, MarketUpdate, MarketType };
|