@commercelayer/sdk 4.33.0 → 4.35.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 +3 -22
- package/lib/cjs/api.js +17 -1
- package/lib/cjs/client.d.ts +8 -15
- package/lib/cjs/client.js +10 -42
- package/lib/cjs/commercelayer.d.ts +5 -4
- package/lib/cjs/commercelayer.js +4 -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.d.ts +0 -1
- package/lib/cjs/error.js +6 -2
- 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 +2 -9
- package/lib/cjs/model.d.ts +1 -0
- 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 +45 -43
- package/lib/cjs/resources/authorizations.js +13 -1
- 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 +28 -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 +56 -54
- package/lib/cjs/resources/bundles.js +15 -3
- package/lib/cjs/resources/captures.d.ts +36 -34
- package/lib/cjs/resources/captures.js +13 -1
- 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 +32 -30
- 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 +40 -38
- package/lib/cjs/resources/coupons.js +15 -3
- package/lib/cjs/resources/customer_addresses.d.ts +24 -22
- 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 +39 -45
- package/lib/cjs/resources/customer_payment_sources.js +15 -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 -37
- 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 +70 -60
- package/lib/cjs/resources/external_promotions.js +19 -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 +71 -61
- package/lib/cjs/resources/fixed_amount_promotions.js +19 -3
- package/lib/cjs/resources/fixed_price_promotions.d.ts +75 -65
- package/lib/cjs/resources/fixed_price_promotions.js +19 -3
- package/lib/cjs/resources/free_gift_promotions.d.ts +74 -64
- package/lib/cjs/resources/free_gift_promotions.js +19 -3
- package/lib/cjs/resources/free_shipping_promotions.d.ts +67 -57
- package/lib/cjs/resources/free_shipping_promotions.js +19 -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 +31 -29
- 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 +27 -25
- 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 +93 -90
- package/lib/cjs/resources/line_items.js +11 -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 +61 -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 +35 -33
- 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 +53 -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 +238 -231
- package/lib/cjs/resources/orders.js +15 -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 +50 -48
- package/lib/cjs/resources/payment_methods.js +15 -3
- 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 +74 -64
- package/lib/cjs/resources/percentage_discount_promotions.js +19 -3
- 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 +22 -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 +41 -39
- package/lib/cjs/resources/prices.js +15 -3
- package/lib/cjs/resources/promotion_rules.d.ts +13 -10
- package/lib/cjs/resources/promotion_rules.js +12 -0
- package/lib/cjs/resources/promotions.d.ts +31 -26
- package/lib/cjs/resources/promotions.js +16 -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 +27 -25
- package/lib/cjs/resources/refunds.js +12 -0
- package/lib/cjs/resources/reserved_stocks.d.ts +13 -14
- package/lib/cjs/resources/reserved_stocks.js +8 -0
- package/lib/cjs/resources/return_line_items.d.ts +27 -28
- 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 -28
- package/lib/cjs/resources/satispay_payments.js +15 -3
- package/lib/cjs/resources/shipments.d.ts +59 -52
- package/lib/cjs/resources/shipments.js +13 -1
- package/lib/cjs/resources/shipping_categories.d.ts +17 -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 +79 -77
- 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 +39 -37
- 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 +58 -56
- package/lib/cjs/resources/skus.js +15 -3
- package/lib/cjs/resources/stock_items.d.ts +30 -28
- package/lib/cjs/resources/stock_items.js +15 -3
- package/lib/cjs/resources/stock_line_items.d.ts +19 -17
- package/lib/cjs/resources/stock_line_items.js +12 -0
- package/lib/cjs/resources/stock_locations.d.ts +31 -29
- package/lib/cjs/resources/stock_locations.js +15 -3
- package/lib/cjs/resources/stock_reservations.d.ts +17 -18
- package/lib/cjs/resources/stock_reservations.js +8 -0
- package/lib/cjs/resources/stock_transfers.d.ts +44 -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 +34 -29
- 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 +25 -23
- package/lib/cjs/resources/transactions.js +12 -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 +27 -25
- package/lib/cjs/resources/voids.js +12 -0
- package/lib/cjs/resources/webhooks.d.ts +28 -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 +3 -1
- package/lib/esm/api.d.ts +3 -22
- package/lib/esm/api.js +15 -0
- package/lib/esm/client.d.ts +8 -15
- package/lib/esm/client.js +10 -42
- package/lib/esm/commercelayer.d.ts +5 -4
- package/lib/esm/commercelayer.js +4 -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.d.ts +0 -1
- 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 +2 -9
- package/lib/esm/model.d.ts +1 -0
- 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 +45 -43
- package/lib/esm/resources/authorizations.js +13 -1
- 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 +28 -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 +56 -54
- package/lib/esm/resources/bundles.js +15 -3
- package/lib/esm/resources/captures.d.ts +36 -34
- package/lib/esm/resources/captures.js +13 -1
- 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 +32 -30
- 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 +40 -38
- package/lib/esm/resources/coupons.js +15 -3
- package/lib/esm/resources/customer_addresses.d.ts +24 -22
- 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 +39 -45
- package/lib/esm/resources/customer_payment_sources.js +15 -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 -37
- 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 +70 -60
- package/lib/esm/resources/external_promotions.js +19 -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 +71 -61
- package/lib/esm/resources/fixed_amount_promotions.js +19 -3
- package/lib/esm/resources/fixed_price_promotions.d.ts +75 -65
- package/lib/esm/resources/fixed_price_promotions.js +19 -3
- package/lib/esm/resources/free_gift_promotions.d.ts +74 -64
- package/lib/esm/resources/free_gift_promotions.js +19 -3
- package/lib/esm/resources/free_shipping_promotions.d.ts +67 -57
- package/lib/esm/resources/free_shipping_promotions.js +19 -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 +31 -29
- 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 +27 -25
- 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 +93 -90
- package/lib/esm/resources/line_items.js +11 -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 +61 -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 +35 -33
- 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 +53 -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 +238 -231
- package/lib/esm/resources/orders.js +15 -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 +50 -48
- package/lib/esm/resources/payment_methods.js +15 -3
- 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 +74 -64
- package/lib/esm/resources/percentage_discount_promotions.js +19 -3
- 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 +22 -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 +41 -39
- package/lib/esm/resources/prices.js +15 -3
- package/lib/esm/resources/promotion_rules.d.ts +13 -10
- package/lib/esm/resources/promotion_rules.js +12 -0
- package/lib/esm/resources/promotions.d.ts +31 -26
- package/lib/esm/resources/promotions.js +16 -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 +27 -25
- package/lib/esm/resources/refunds.js +12 -0
- package/lib/esm/resources/reserved_stocks.d.ts +13 -14
- package/lib/esm/resources/reserved_stocks.js +8 -0
- package/lib/esm/resources/return_line_items.d.ts +27 -28
- 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 -28
- package/lib/esm/resources/satispay_payments.js +15 -3
- package/lib/esm/resources/shipments.d.ts +59 -52
- package/lib/esm/resources/shipments.js +13 -1
- package/lib/esm/resources/shipping_categories.d.ts +17 -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 +79 -77
- 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 +39 -37
- 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 +58 -56
- package/lib/esm/resources/skus.js +15 -3
- package/lib/esm/resources/stock_items.d.ts +30 -28
- package/lib/esm/resources/stock_items.js +15 -3
- package/lib/esm/resources/stock_line_items.d.ts +19 -17
- package/lib/esm/resources/stock_line_items.js +12 -0
- package/lib/esm/resources/stock_locations.d.ts +31 -29
- package/lib/esm/resources/stock_locations.js +15 -3
- package/lib/esm/resources/stock_reservations.d.ts +17 -18
- package/lib/esm/resources/stock_reservations.js +8 -0
- package/lib/esm/resources/stock_transfers.d.ts +44 -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 +34 -29
- 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 +25 -23
- package/lib/esm/resources/transactions.js +12 -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 +27 -25
- package/lib/esm/resources/voids.js +12 -0
- package/lib/esm/resources/webhooks.d.ts +28 -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 +3 -1
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
@@ -1,51 +1,56 @@
|
|
1
|
-
import { ApiResource } from '../resource';
|
2
|
-
import type {
|
3
|
-
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
1
|
+
import { ApiResource, Resource, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
4
3
|
import type { Market } from './markets';
|
5
4
|
import type { PromotionRule } from './promotion_rules';
|
6
5
|
import type { OrderAmountPromotionRule } from './order_amount_promotion_rules';
|
7
6
|
import type { SkuListPromotionRule } from './sku_list_promotion_rules';
|
8
7
|
import type { CouponCodesPromotionRule } from './coupon_codes_promotion_rules';
|
8
|
+
import type { Coupon } from './coupons';
|
9
9
|
import type { SkuList } from './sku_lists';
|
10
10
|
import type { Attachment } from './attachments';
|
11
11
|
import type { Event } from './events';
|
12
12
|
import type { Tag } from './tags';
|
13
|
-
type
|
13
|
+
import type { Version } from './versions';
|
14
14
|
type PromotionRel = ResourceRel & {
|
15
|
-
type:
|
15
|
+
type: typeof Promotions.TYPE;
|
16
16
|
};
|
17
17
|
interface Promotion extends Resource {
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
sku_list?: SkuList
|
32
|
-
attachments?: Attachment[]
|
33
|
-
events?: Event[]
|
34
|
-
tags?: Tag[]
|
18
|
+
name?: string;
|
19
|
+
currency_code?: string;
|
20
|
+
starts_at?: string;
|
21
|
+
expires_at?: string;
|
22
|
+
total_usage_limit?: number;
|
23
|
+
total_usage_count?: number;
|
24
|
+
active?: boolean;
|
25
|
+
market?: Market;
|
26
|
+
promotion_rules?: PromotionRule[];
|
27
|
+
order_amount_promotion_rule?: OrderAmountPromotionRule;
|
28
|
+
sku_list_promotion_rule?: SkuListPromotionRule;
|
29
|
+
coupon_codes_promotion_rule?: CouponCodesPromotionRule;
|
30
|
+
coupons?: Coupon[];
|
31
|
+
sku_list?: SkuList;
|
32
|
+
attachments?: Attachment[];
|
33
|
+
events?: Event[];
|
34
|
+
tags?: Tag[];
|
35
|
+
versions?: Version[];
|
35
36
|
}
|
36
|
-
declare class Promotions extends ApiResource
|
37
|
-
static readonly TYPE:
|
37
|
+
declare class Promotions extends ApiResource {
|
38
|
+
static readonly TYPE: 'promotions';
|
39
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Promotion>>;
|
40
|
+
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Promotion>;
|
38
41
|
market(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
|
39
42
|
order_amount_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
40
43
|
sku_list_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
41
44
|
coupon_codes_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
45
|
+
coupons(promotionId: string | Promotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
|
42
46
|
sku_list(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
43
47
|
attachments(promotionId: string | Promotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
44
48
|
events(promotionId: string | Promotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
45
49
|
tags(promotionId: string | Promotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
50
|
+
versions(promotionId: string | Promotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
46
51
|
isPromotion(resource: any): resource is Promotion;
|
47
52
|
relationship(id: string | ResourceId | null): PromotionRel;
|
48
|
-
type():
|
53
|
+
type(): string;
|
49
54
|
}
|
50
55
|
export default Promotions;
|
51
|
-
export
|
56
|
+
export { Promotion };
|
@@ -1,5 +1,12 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class Promotions extends ApiResource {
|
3
|
+
// static readonly PATH = 'promotions'
|
4
|
+
async list(params, options) {
|
5
|
+
return this.resources.list({ type: Promotions.TYPE }, params, options);
|
6
|
+
}
|
7
|
+
async retrieve(id, params, options) {
|
8
|
+
return this.resources.retrieve({ type: Promotions.TYPE, id }, params, options);
|
9
|
+
}
|
3
10
|
async market(promotionId, params, options) {
|
4
11
|
const _promotionId = promotionId.id || promotionId;
|
5
12
|
return this.resources.fetch({ type: 'markets' }, `promotions/${_promotionId}/market`, params, options);
|
@@ -16,6 +23,10 @@ class Promotions extends ApiResource {
|
|
16
23
|
const _promotionId = promotionId.id || promotionId;
|
17
24
|
return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `promotions/${_promotionId}/coupon_codes_promotion_rule`, params, options);
|
18
25
|
}
|
26
|
+
async coupons(promotionId, params, options) {
|
27
|
+
const _promotionId = promotionId.id || promotionId;
|
28
|
+
return this.resources.fetch({ type: 'coupons' }, `promotions/${_promotionId}/coupons`, params, options);
|
29
|
+
}
|
19
30
|
async sku_list(promotionId, params, options) {
|
20
31
|
const _promotionId = promotionId.id || promotionId;
|
21
32
|
return this.resources.fetch({ type: 'sku_lists' }, `promotions/${_promotionId}/sku_list`, params, options);
|
@@ -32,6 +43,11 @@ class Promotions extends ApiResource {
|
|
32
43
|
const _promotionId = promotionId.id || promotionId;
|
33
44
|
return this.resources.fetch({ type: 'tags' }, `promotions/${_promotionId}/tags`, params, options);
|
34
45
|
}
|
46
|
+
async versions(promotionId, params, options) {
|
47
|
+
const _promotionId = promotionId.id || promotionId;
|
48
|
+
return this.resources.fetch({ type: 'versions' }, `promotions/${_promotionId}/versions`, params, options);
|
49
|
+
}
|
50
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
35
51
|
isPromotion(resource) {
|
36
52
|
return resource.type && (resource.type === Promotions.TYPE);
|
37
53
|
}
|
@@ -1,53 +1,52 @@
|
|
1
|
-
import { ApiResource } from '../resource';
|
2
|
-
import type {
|
3
|
-
import type {
|
4
|
-
import type { Order, OrderType } from './orders';
|
1
|
+
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
+
import type { Order } from './orders';
|
5
4
|
import type { Event } from './events';
|
6
|
-
import type { OrderSubscription
|
7
|
-
type RecurringOrderCopyType = 'recurring_order_copies';
|
5
|
+
import type { OrderSubscription } from './order_subscriptions';
|
8
6
|
type RecurringOrderCopyRel = ResourceRel & {
|
9
|
-
type:
|
7
|
+
type: typeof RecurringOrderCopies.TYPE;
|
10
8
|
};
|
11
9
|
type OrderRel = ResourceRel & {
|
12
|
-
type:
|
10
|
+
type: 'orders';
|
13
11
|
};
|
14
12
|
type OrderSubscriptionRel = ResourceRel & {
|
15
|
-
type:
|
13
|
+
type: 'order_subscriptions';
|
16
14
|
};
|
17
15
|
interface RecurringOrderCopy extends Resource {
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
order_subscription?: OrderSubscription | null;
|
16
|
+
status?: string;
|
17
|
+
started_at?: string;
|
18
|
+
completed_at?: string;
|
19
|
+
failed_at?: string;
|
20
|
+
errors_log?: object;
|
21
|
+
errors_count?: number;
|
22
|
+
place_target_order?: boolean;
|
23
|
+
reuse_wallet?: boolean;
|
24
|
+
source_order?: Order;
|
25
|
+
target_order?: Order;
|
26
|
+
events?: Event[];
|
27
|
+
order_subscription?: OrderSubscription;
|
31
28
|
}
|
32
29
|
interface RecurringOrderCopyCreate extends ResourceCreate {
|
33
|
-
place_target_order?: boolean
|
34
|
-
reuse_wallet?: boolean
|
30
|
+
place_target_order?: boolean;
|
31
|
+
reuse_wallet?: boolean;
|
35
32
|
source_order: OrderRel;
|
36
33
|
order_subscription: OrderSubscriptionRel;
|
37
34
|
}
|
38
35
|
type RecurringOrderCopyUpdate = ResourceUpdate;
|
39
|
-
declare class RecurringOrderCopies extends ApiResource
|
40
|
-
static readonly TYPE:
|
36
|
+
declare class RecurringOrderCopies extends ApiResource {
|
37
|
+
static readonly TYPE: 'recurring_order_copies';
|
38
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<RecurringOrderCopy>>;
|
41
39
|
create(resource: RecurringOrderCopyCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<RecurringOrderCopy>;
|
40
|
+
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<RecurringOrderCopy>;
|
42
41
|
update(resource: RecurringOrderCopyUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<RecurringOrderCopy>;
|
43
|
-
delete(id: string
|
42
|
+
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
44
43
|
source_order(recurringOrderCopyId: string | RecurringOrderCopy, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
45
44
|
target_order(recurringOrderCopyId: string | RecurringOrderCopy, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
46
45
|
events(recurringOrderCopyId: string | RecurringOrderCopy, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
47
46
|
order_subscription(recurringOrderCopyId: string | RecurringOrderCopy, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderSubscription>;
|
48
47
|
isRecurringOrderCopy(resource: any): resource is RecurringOrderCopy;
|
49
48
|
relationship(id: string | ResourceId | null): RecurringOrderCopyRel;
|
50
|
-
type():
|
49
|
+
type(): string;
|
51
50
|
}
|
52
51
|
export default RecurringOrderCopies;
|
53
|
-
export
|
52
|
+
export { RecurringOrderCopy, RecurringOrderCopyCreate, RecurringOrderCopyUpdate };
|
@@ -1,13 +1,20 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class RecurringOrderCopies extends ApiResource {
|
3
|
+
// static readonly PATH = 'recurring_order_copies'
|
4
|
+
async list(params, options) {
|
5
|
+
return this.resources.list({ type: RecurringOrderCopies.TYPE }, params, options);
|
6
|
+
}
|
3
7
|
async create(resource, params, options) {
|
4
|
-
return this.resources.create({
|
8
|
+
return this.resources.create(Object.assign(Object.assign({}, resource), { type: RecurringOrderCopies.TYPE }), params, options);
|
9
|
+
}
|
10
|
+
async retrieve(id, params, options) {
|
11
|
+
return this.resources.retrieve({ type: RecurringOrderCopies.TYPE, id }, params, options);
|
5
12
|
}
|
6
13
|
async update(resource, params, options) {
|
7
|
-
return this.resources.update({
|
14
|
+
return this.resources.update(Object.assign(Object.assign({}, resource), { type: RecurringOrderCopies.TYPE }), params, options);
|
8
15
|
}
|
9
16
|
async delete(id, options) {
|
10
|
-
await this.resources.delete(
|
17
|
+
await this.resources.delete({ type: RecurringOrderCopies.TYPE, id }, options);
|
11
18
|
}
|
12
19
|
async source_order(recurringOrderCopyId, params, options) {
|
13
20
|
const _recurringOrderCopyId = recurringOrderCopyId.id || recurringOrderCopyId;
|
@@ -25,6 +32,7 @@ class RecurringOrderCopies extends ApiResource {
|
|
25
32
|
const _recurringOrderCopyId = recurringOrderCopyId.id || recurringOrderCopyId;
|
26
33
|
return this.resources.fetch({ type: 'order_subscriptions' }, `recurring_order_copies/${_recurringOrderCopyId}/order_subscription`, params, options);
|
27
34
|
}
|
35
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
28
36
|
isRecurringOrderCopy(resource) {
|
29
37
|
return resource.type && (resource.type === RecurringOrderCopies.TYPE);
|
30
38
|
}
|
@@ -1,41 +1,43 @@
|
|
1
|
-
import { ApiResource } from '../resource';
|
2
|
-
import type {
|
3
|
-
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
1
|
+
import { ApiResource, Resource, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
4
3
|
import type { Order } from './orders';
|
5
4
|
import type { Attachment } from './attachments';
|
5
|
+
import type { Version } from './versions';
|
6
6
|
import type { Capture } from './captures';
|
7
7
|
import type { Event } from './events';
|
8
|
-
type RefundType = 'refunds';
|
9
8
|
type RefundRel = ResourceRel & {
|
10
|
-
type:
|
9
|
+
type: typeof Refunds.TYPE;
|
11
10
|
};
|
12
11
|
interface Refund extends Resource {
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
reference_capture?: Capture
|
28
|
-
events?: Event[]
|
12
|
+
number?: string;
|
13
|
+
currency_code?: string;
|
14
|
+
amount_cents?: number;
|
15
|
+
amount_float?: number;
|
16
|
+
formatted_amount?: string;
|
17
|
+
succeeded?: boolean;
|
18
|
+
message?: string;
|
19
|
+
error_code?: string;
|
20
|
+
error_detail?: string;
|
21
|
+
token?: string;
|
22
|
+
gateway_transaction_id?: string;
|
23
|
+
order?: Order;
|
24
|
+
attachments?: Attachment[];
|
25
|
+
versions?: Version[];
|
26
|
+
reference_capture?: Capture;
|
27
|
+
events?: Event[];
|
29
28
|
}
|
30
|
-
declare class Refunds extends ApiResource
|
31
|
-
static readonly TYPE:
|
29
|
+
declare class Refunds extends ApiResource {
|
30
|
+
static readonly TYPE: 'refunds';
|
31
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Refund>>;
|
32
|
+
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Refund>;
|
32
33
|
order(refundId: string | Refund, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
33
34
|
attachments(refundId: string | Refund, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
35
|
+
versions(refundId: string | Refund, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
34
36
|
reference_capture(refundId: string | Refund, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Capture>;
|
35
37
|
events(refundId: string | Refund, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
36
38
|
isRefund(resource: any): resource is Refund;
|
37
39
|
relationship(id: string | ResourceId | null): RefundRel;
|
38
|
-
type():
|
40
|
+
type(): string;
|
39
41
|
}
|
40
42
|
export default Refunds;
|
41
|
-
export
|
43
|
+
export { Refund };
|
@@ -1,5 +1,12 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class Refunds extends ApiResource {
|
3
|
+
// static readonly PATH = 'refunds'
|
4
|
+
async list(params, options) {
|
5
|
+
return this.resources.list({ type: Refunds.TYPE }, params, options);
|
6
|
+
}
|
7
|
+
async retrieve(id, params, options) {
|
8
|
+
return this.resources.retrieve({ type: Refunds.TYPE, id }, params, options);
|
9
|
+
}
|
3
10
|
async order(refundId, params, options) {
|
4
11
|
const _refundId = refundId.id || refundId;
|
5
12
|
return this.resources.fetch({ type: 'orders' }, `refunds/${_refundId}/order`, params, options);
|
@@ -8,6 +15,10 @@ class Refunds extends ApiResource {
|
|
8
15
|
const _refundId = refundId.id || refundId;
|
9
16
|
return this.resources.fetch({ type: 'attachments' }, `refunds/${_refundId}/attachments`, params, options);
|
10
17
|
}
|
18
|
+
async versions(refundId, params, options) {
|
19
|
+
const _refundId = refundId.id || refundId;
|
20
|
+
return this.resources.fetch({ type: 'versions' }, `refunds/${_refundId}/versions`, params, options);
|
21
|
+
}
|
11
22
|
async reference_capture(refundId, params, options) {
|
12
23
|
const _refundId = refundId.id || refundId;
|
13
24
|
return this.resources.fetch({ type: 'captures' }, `refunds/${_refundId}/reference_capture`, params, options);
|
@@ -16,6 +27,7 @@ class Refunds extends ApiResource {
|
|
16
27
|
const _refundId = refundId.id || refundId;
|
17
28
|
return this.resources.fetch({ type: 'events' }, `refunds/${_refundId}/events`, params, options);
|
18
29
|
}
|
30
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
19
31
|
isRefund(resource) {
|
20
32
|
return resource.type && (resource.type === Refunds.TYPE);
|
21
33
|
}
|
@@ -1,28 +1,27 @@
|
|
1
|
-
import { ApiResource } from '../resource';
|
2
|
-
import type {
|
3
|
-
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
1
|
+
import { ApiResource, Resource, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
4
3
|
import type { StockItem } from './stock_items';
|
5
4
|
import type { Sku } from './skus';
|
6
5
|
import type { StockReservation } from './stock_reservations';
|
7
|
-
type ReservedStockType = 'reserved_stocks';
|
8
6
|
type ReservedStockRel = ResourceRel & {
|
9
|
-
type:
|
7
|
+
type: typeof ReservedStocks.TYPE;
|
10
8
|
};
|
11
9
|
interface ReservedStock extends Resource {
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
stock_reservations?: StockReservation[] | null;
|
10
|
+
quantity?: number;
|
11
|
+
stock_item?: StockItem;
|
12
|
+
sku?: Sku;
|
13
|
+
stock_reservations?: StockReservation[];
|
17
14
|
}
|
18
|
-
declare class ReservedStocks extends ApiResource
|
19
|
-
static readonly TYPE:
|
15
|
+
declare class ReservedStocks extends ApiResource {
|
16
|
+
static readonly TYPE: 'reserved_stocks';
|
17
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ReservedStock>>;
|
18
|
+
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ReservedStock>;
|
20
19
|
stock_item(reservedStockId: string | ReservedStock, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockItem>;
|
21
20
|
sku(reservedStockId: string | ReservedStock, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
|
22
21
|
stock_reservations(reservedStockId: string | ReservedStock, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockReservation>>;
|
23
22
|
isReservedStock(resource: any): resource is ReservedStock;
|
24
23
|
relationship(id: string | ResourceId | null): ReservedStockRel;
|
25
|
-
type():
|
24
|
+
type(): string;
|
26
25
|
}
|
27
26
|
export default ReservedStocks;
|
28
|
-
export
|
27
|
+
export { ReservedStock };
|
@@ -1,5 +1,12 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class ReservedStocks extends ApiResource {
|
3
|
+
// static readonly PATH = 'reserved_stocks'
|
4
|
+
async list(params, options) {
|
5
|
+
return this.resources.list({ type: ReservedStocks.TYPE }, params, options);
|
6
|
+
}
|
7
|
+
async retrieve(id, params, options) {
|
8
|
+
return this.resources.retrieve({ type: ReservedStocks.TYPE, id }, params, options);
|
9
|
+
}
|
3
10
|
async stock_item(reservedStockId, params, options) {
|
4
11
|
const _reservedStockId = reservedStockId.id || reservedStockId;
|
5
12
|
return this.resources.fetch({ type: 'stock_items' }, `reserved_stocks/${_reservedStockId}/stock_item`, params, options);
|
@@ -12,6 +19,7 @@ class ReservedStocks extends ApiResource {
|
|
12
19
|
const _reservedStockId = reservedStockId.id || reservedStockId;
|
13
20
|
return this.resources.fetch({ type: 'stock_reservations' }, `reserved_stocks/${_reservedStockId}/stock_reservations`, params, options);
|
14
21
|
}
|
22
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
15
23
|
isReservedStock(resource) {
|
16
24
|
return resource.type && (resource.type === ReservedStocks.TYPE);
|
17
25
|
}
|
@@ -1,51 +1,50 @@
|
|
1
|
-
import { ApiResource } from '../resource';
|
2
|
-
import type {
|
3
|
-
import type {
|
4
|
-
import type {
|
5
|
-
import type { LineItem, LineItemType } from './line_items';
|
6
|
-
type ReturnLineItemType = 'return_line_items';
|
1
|
+
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
+
import type { Return } from './returns';
|
4
|
+
import type { LineItem } from './line_items';
|
7
5
|
type ReturnLineItemRel = ResourceRel & {
|
8
|
-
type:
|
6
|
+
type: typeof ReturnLineItems.TYPE;
|
9
7
|
};
|
10
8
|
type ReturnRel = ResourceRel & {
|
11
|
-
type:
|
9
|
+
type: 'returns';
|
12
10
|
};
|
13
11
|
type LineItemRel = ResourceRel & {
|
14
|
-
type:
|
12
|
+
type: 'line_items';
|
15
13
|
};
|
16
14
|
interface ReturnLineItem extends Resource {
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
line_item?: LineItem | null;
|
15
|
+
sku_code?: string;
|
16
|
+
bundle_code?: string;
|
17
|
+
quantity?: number;
|
18
|
+
name?: string;
|
19
|
+
image_url?: string;
|
20
|
+
return_reason?: object;
|
21
|
+
restocked_at?: string;
|
22
|
+
return?: Return;
|
23
|
+
line_item?: LineItem;
|
27
24
|
}
|
28
25
|
interface ReturnLineItemCreate extends ResourceCreate {
|
29
26
|
quantity: number;
|
30
|
-
return_reason?:
|
27
|
+
return_reason?: object;
|
31
28
|
return: ReturnRel;
|
32
29
|
line_item: LineItemRel;
|
33
30
|
}
|
34
31
|
interface ReturnLineItemUpdate extends ResourceUpdate {
|
35
|
-
quantity?: number
|
36
|
-
_restock?: boolean
|
37
|
-
return_reason?:
|
32
|
+
quantity?: number;
|
33
|
+
_restock?: boolean;
|
34
|
+
return_reason?: object;
|
38
35
|
}
|
39
|
-
declare class ReturnLineItems extends ApiResource
|
40
|
-
static readonly TYPE:
|
36
|
+
declare class ReturnLineItems extends ApiResource {
|
37
|
+
static readonly TYPE: 'return_line_items';
|
38
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ReturnLineItem>>;
|
41
39
|
create(resource: ReturnLineItemCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ReturnLineItem>;
|
40
|
+
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ReturnLineItem>;
|
42
41
|
update(resource: ReturnLineItemUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ReturnLineItem>;
|
43
|
-
delete(id: string
|
42
|
+
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
44
43
|
return(returnLineItemId: string | ReturnLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Return>;
|
45
44
|
line_item(returnLineItemId: string | ReturnLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
|
46
45
|
isReturnLineItem(resource: any): resource is ReturnLineItem;
|
47
46
|
relationship(id: string | ResourceId | null): ReturnLineItemRel;
|
48
|
-
type():
|
47
|
+
type(): string;
|
49
48
|
}
|
50
49
|
export default ReturnLineItems;
|
51
|
-
export
|
50
|
+
export { ReturnLineItem, ReturnLineItemCreate, ReturnLineItemUpdate };
|
@@ -1,13 +1,20 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class ReturnLineItems extends ApiResource {
|
3
|
+
// static readonly PATH = 'return_line_items'
|
4
|
+
async list(params, options) {
|
5
|
+
return this.resources.list({ type: ReturnLineItems.TYPE }, params, options);
|
6
|
+
}
|
3
7
|
async create(resource, params, options) {
|
4
|
-
return this.resources.create({
|
8
|
+
return this.resources.create(Object.assign(Object.assign({}, resource), { type: ReturnLineItems.TYPE }), params, options);
|
9
|
+
}
|
10
|
+
async retrieve(id, params, options) {
|
11
|
+
return this.resources.retrieve({ type: ReturnLineItems.TYPE, id }, params, options);
|
5
12
|
}
|
6
13
|
async update(resource, params, options) {
|
7
|
-
return this.resources.update({
|
14
|
+
return this.resources.update(Object.assign(Object.assign({}, resource), { type: ReturnLineItems.TYPE }), params, options);
|
8
15
|
}
|
9
16
|
async delete(id, options) {
|
10
|
-
await this.resources.delete(
|
17
|
+
await this.resources.delete({ type: ReturnLineItems.TYPE, id }, options);
|
11
18
|
}
|
12
19
|
async return(returnLineItemId, params, options) {
|
13
20
|
const _returnLineItemId = returnLineItemId.id || returnLineItemId;
|
@@ -17,6 +24,7 @@ class ReturnLineItems extends ApiResource {
|
|
17
24
|
const _returnLineItemId = returnLineItemId.id || returnLineItemId;
|
18
25
|
return this.resources.fetch({ type: 'line_items' }, `return_line_items/${_returnLineItemId}/line_item`, params, options);
|
19
26
|
}
|
27
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
20
28
|
isReturnLineItem(resource) {
|
21
29
|
return resource.type && (resource.type === ReturnLineItems.TYPE);
|
22
30
|
}
|