@commercelayer/sdk 4.27.1 → 4.28.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/api.d.ts +10 -3
- package/lib/cjs/api.js +25 -4
- package/lib/cjs/commercelayer.d.ts +9 -2
- package/lib/cjs/commercelayer.js +8 -1
- package/lib/cjs/model.d.ts +10 -3
- package/lib/cjs/resource.d.ts +7 -9
- package/lib/cjs/resources/addresses.d.ts +14 -0
- package/lib/cjs/resources/addresses.js +12 -0
- package/lib/cjs/resources/adjustments.d.ts +3 -0
- package/lib/cjs/resources/adjustments.js +4 -0
- package/lib/cjs/resources/adyen_gateways.d.ts +5 -2
- package/lib/cjs/resources/adyen_gateways.js +4 -0
- package/lib/cjs/resources/adyen_payments.d.ts +3 -0
- package/lib/cjs/resources/adyen_payments.js +4 -0
- package/lib/cjs/resources/authorizations.d.ts +9 -3
- package/lib/cjs/resources/authorizations.js +12 -4
- package/lib/cjs/resources/avalara_accounts.d.ts +9 -6
- package/lib/cjs/resources/avalara_accounts.js +4 -0
- package/lib/cjs/resources/axerve_gateways.d.ts +4 -0
- package/lib/cjs/resources/axerve_gateways.js +4 -0
- package/lib/cjs/resources/axerve_payments.d.ts +9 -0
- package/lib/cjs/resources/axerve_payments.js +4 -0
- package/lib/cjs/resources/billing_info_validation_rules.d.ts +3 -0
- package/lib/cjs/resources/billing_info_validation_rules.js +4 -0
- package/lib/cjs/resources/braintree_gateways.d.ts +3 -0
- package/lib/cjs/resources/braintree_gateways.js +4 -0
- package/lib/cjs/resources/braintree_payments.d.ts +3 -0
- package/lib/cjs/resources/braintree_payments.js +4 -0
- package/lib/cjs/resources/bundles.d.ts +16 -2
- package/lib/cjs/resources/bundles.js +12 -0
- package/lib/cjs/resources/buy_x_pay_y_promotions.d.ts +134 -0
- package/lib/cjs/resources/buy_x_pay_y_promotions.js +81 -0
- package/lib/cjs/resources/captures.d.ts +9 -3
- package/lib/cjs/resources/captures.js +12 -4
- package/lib/cjs/resources/carrier_accounts.d.ts +3 -0
- package/lib/cjs/resources/carrier_accounts.js +4 -0
- package/lib/cjs/resources/checkout_com_gateways.d.ts +3 -0
- package/lib/cjs/resources/checkout_com_gateways.js +4 -0
- package/lib/cjs/resources/checkout_com_payments.d.ts +3 -0
- package/lib/cjs/resources/checkout_com_payments.js +4 -0
- package/lib/cjs/resources/cleanups.d.ts +3 -0
- package/lib/cjs/resources/cleanups.js +4 -0
- package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +10 -3
- package/lib/cjs/resources/coupon_codes_promotion_rules.js +4 -0
- package/lib/cjs/resources/coupon_recipients.d.ts +3 -0
- package/lib/cjs/resources/coupon_recipients.js +4 -0
- package/lib/cjs/resources/coupons.d.ts +26 -1
- package/lib/cjs/resources/coupons.js +16 -0
- package/lib/cjs/resources/custom_promotion_rules.d.ts +61 -0
- package/lib/cjs/resources/custom_promotion_rules.js +37 -0
- package/lib/cjs/resources/customer_addresses.d.ts +5 -0
- package/lib/cjs/resources/customer_addresses.js +4 -0
- package/lib/cjs/resources/customer_groups.d.ts +3 -0
- package/lib/cjs/resources/customer_groups.js +4 -0
- package/lib/cjs/resources/customer_payment_sources.d.ts +18 -11
- package/lib/cjs/resources/customer_payment_sources.js +8 -0
- package/lib/cjs/resources/customer_subscriptions.d.ts +3 -0
- package/lib/cjs/resources/customer_subscriptions.js +4 -0
- package/lib/cjs/resources/customers.d.ts +9 -0
- package/lib/cjs/resources/customers.js +4 -0
- package/lib/cjs/resources/delivery_lead_times.d.ts +3 -0
- package/lib/cjs/resources/delivery_lead_times.js +4 -0
- package/lib/cjs/resources/external_gateways.d.ts +3 -0
- package/lib/cjs/resources/external_gateways.js +4 -0
- package/lib/cjs/resources/external_payments.d.ts +3 -0
- package/lib/cjs/resources/external_payments.js +4 -0
- package/lib/cjs/resources/external_promotions.d.ts +45 -6
- package/lib/cjs/resources/external_promotions.js +24 -0
- package/lib/cjs/resources/external_tax_calculators.d.ts +3 -0
- package/lib/cjs/resources/external_tax_calculators.js +4 -0
- package/lib/cjs/resources/fixed_amount_promotions.d.ts +45 -6
- package/lib/cjs/resources/fixed_amount_promotions.js +24 -0
- package/lib/cjs/resources/fixed_price_promotions.d.ts +37 -9
- package/lib/cjs/resources/fixed_price_promotions.js +18 -2
- package/lib/cjs/resources/free_gift_promotions.d.ts +37 -9
- package/lib/cjs/resources/free_gift_promotions.js +18 -2
- package/lib/cjs/resources/free_shipping_promotions.d.ts +42 -6
- package/lib/cjs/resources/free_shipping_promotions.js +20 -0
- package/lib/cjs/resources/gift_card_recipients.d.ts +3 -0
- package/lib/cjs/resources/gift_card_recipients.js +4 -0
- package/lib/cjs/resources/gift_cards.d.ts +11 -0
- package/lib/cjs/resources/gift_cards.js +8 -0
- package/lib/cjs/resources/imports.d.ts +1 -3
- package/lib/cjs/resources/in_stock_subscriptions.d.ts +3 -0
- package/lib/cjs/resources/in_stock_subscriptions.js +4 -0
- package/lib/cjs/resources/inventory_models.d.ts +12 -0
- package/lib/cjs/resources/inventory_models.js +4 -0
- package/lib/cjs/resources/inventory_return_locations.d.ts +3 -0
- package/lib/cjs/resources/inventory_return_locations.js +4 -0
- package/lib/cjs/resources/inventory_stock_locations.d.ts +3 -0
- package/lib/cjs/resources/inventory_stock_locations.js +4 -0
- package/lib/cjs/resources/klarna_gateways.d.ts +3 -0
- package/lib/cjs/resources/klarna_gateways.js +4 -0
- package/lib/cjs/resources/klarna_payments.d.ts +3 -0
- package/lib/cjs/resources/klarna_payments.js +4 -0
- package/lib/cjs/resources/line_item_options.d.ts +11 -0
- package/lib/cjs/resources/line_item_options.js +8 -0
- package/lib/cjs/resources/line_items.d.ts +30 -0
- package/lib/cjs/resources/line_items.js +16 -0
- package/lib/cjs/resources/manual_gateways.d.ts +3 -0
- package/lib/cjs/resources/manual_gateways.js +4 -0
- package/lib/cjs/resources/manual_tax_calculators.d.ts +3 -0
- package/lib/cjs/resources/manual_tax_calculators.js +4 -0
- package/lib/cjs/resources/markets.d.ts +8 -0
- package/lib/cjs/resources/markets.js +4 -0
- package/lib/cjs/resources/merchants.d.ts +3 -0
- package/lib/cjs/resources/merchants.js +4 -0
- package/lib/cjs/resources/order_amount_promotion_rules.d.ts +13 -3
- package/lib/cjs/resources/order_amount_promotion_rules.js +4 -0
- package/lib/cjs/resources/order_subscription_items.d.ts +7 -0
- package/lib/cjs/resources/order_subscription_items.js +4 -0
- package/lib/cjs/resources/order_subscriptions.d.ts +4 -0
- package/lib/cjs/resources/order_subscriptions.js +4 -0
- package/lib/cjs/resources/order_validation_rules.d.ts +3 -0
- package/lib/cjs/resources/order_validation_rules.js +4 -0
- package/lib/cjs/resources/orders.d.ts +50 -6
- package/lib/cjs/resources/orders.js +32 -0
- package/lib/cjs/resources/organization.d.ts +4 -4
- package/lib/cjs/resources/packages.d.ts +3 -0
- package/lib/cjs/resources/packages.js +4 -0
- package/lib/cjs/resources/parcel_line_items.d.ts +4 -1
- package/lib/cjs/resources/parcel_line_items.js +4 -0
- package/lib/cjs/resources/parcels.d.ts +9 -3
- package/lib/cjs/resources/parcels.js +4 -0
- package/lib/cjs/resources/payment_gateways.d.ts +3 -0
- package/lib/cjs/resources/payment_gateways.js +4 -0
- package/lib/cjs/resources/payment_methods.d.ts +9 -1
- package/lib/cjs/resources/payment_methods.js +4 -0
- package/lib/cjs/resources/payment_options.d.ts +43 -0
- package/lib/cjs/resources/payment_options.js +41 -0
- package/lib/cjs/resources/paypal_gateways.d.ts +3 -0
- package/lib/cjs/resources/paypal_gateways.js +4 -0
- package/lib/cjs/resources/paypal_payments.d.ts +3 -0
- package/lib/cjs/resources/paypal_payments.js +4 -0
- package/lib/cjs/resources/percentage_discount_promotions.d.ts +37 -9
- package/lib/cjs/resources/percentage_discount_promotions.js +18 -2
- package/lib/cjs/resources/price_frequency_tiers.d.ts +3 -0
- package/lib/cjs/resources/price_frequency_tiers.js +4 -0
- package/lib/cjs/resources/price_lists.d.ts +6 -0
- package/lib/cjs/resources/price_lists.js +4 -0
- package/lib/cjs/resources/price_tiers.d.ts +3 -0
- package/lib/cjs/resources/price_tiers.js +4 -0
- package/lib/cjs/resources/price_volume_tiers.d.ts +3 -0
- package/lib/cjs/resources/price_volume_tiers.js +4 -0
- package/lib/cjs/resources/prices.d.ts +4 -1
- package/lib/cjs/resources/prices.js +4 -0
- package/lib/cjs/resources/promotion_rules.d.ts +5 -1
- package/lib/cjs/resources/promotion_rules.js +4 -0
- package/lib/cjs/resources/promotions.d.ts +18 -0
- package/lib/cjs/resources/promotions.js +20 -0
- package/lib/cjs/resources/refunds.d.ts +9 -3
- package/lib/cjs/resources/refunds.js +10 -2
- package/lib/cjs/resources/reserved_stocks.d.ts +27 -0
- package/lib/cjs/resources/reserved_stocks.js +36 -0
- package/lib/cjs/resources/return_line_items.d.ts +2 -1
- package/lib/cjs/resources/returns.d.ts +11 -0
- package/lib/cjs/resources/returns.js +8 -0
- package/lib/cjs/resources/satispay_gateways.d.ts +6 -0
- package/lib/cjs/resources/satispay_gateways.js +4 -0
- package/lib/cjs/resources/satispay_payments.d.ts +11 -3
- package/lib/cjs/resources/satispay_payments.js +4 -0
- package/lib/cjs/resources/shipments.d.ts +49 -2
- package/lib/cjs/resources/shipments.js +18 -0
- package/lib/cjs/resources/shipping_categories.d.ts +6 -0
- package/lib/cjs/resources/shipping_categories.js +4 -0
- package/lib/cjs/resources/shipping_method_tiers.d.ts +3 -0
- package/lib/cjs/resources/shipping_method_tiers.js +4 -0
- package/lib/cjs/resources/shipping_methods.d.ts +11 -0
- package/lib/cjs/resources/shipping_methods.js +4 -0
- package/lib/cjs/resources/shipping_weight_tiers.d.ts +3 -0
- package/lib/cjs/resources/shipping_weight_tiers.js +4 -0
- package/lib/cjs/resources/shipping_zones.d.ts +3 -0
- package/lib/cjs/resources/shipping_zones.js +4 -0
- package/lib/cjs/resources/sku_list_items.d.ts +3 -0
- package/lib/cjs/resources/sku_list_items.js +4 -0
- package/lib/cjs/resources/sku_list_promotion_rules.d.ts +10 -3
- package/lib/cjs/resources/sku_list_promotion_rules.js +4 -0
- package/lib/cjs/resources/sku_lists.d.ts +3 -0
- package/lib/cjs/resources/sku_lists.js +4 -0
- package/lib/cjs/resources/sku_options.d.ts +14 -0
- package/lib/cjs/resources/sku_options.js +12 -0
- package/lib/cjs/resources/skus.d.ts +17 -0
- package/lib/cjs/resources/skus.js +16 -0
- package/lib/cjs/resources/stock_items.d.ts +9 -0
- package/lib/cjs/resources/stock_items.js +12 -0
- package/lib/cjs/resources/stock_line_items.d.ts +42 -2
- package/lib/cjs/resources/stock_line_items.js +17 -0
- package/lib/cjs/resources/stock_locations.d.ts +6 -0
- package/lib/cjs/resources/stock_locations.js +4 -0
- package/lib/cjs/resources/stock_reservations.d.ts +49 -0
- package/lib/cjs/resources/stock_reservations.js +53 -0
- package/lib/cjs/resources/stock_transfers.d.ts +5 -0
- package/lib/cjs/resources/stock_transfers.js +4 -0
- package/lib/cjs/resources/stripe_gateways.d.ts +3 -0
- package/lib/cjs/resources/stripe_gateways.js +4 -0
- package/lib/cjs/resources/stripe_payments.d.ts +12 -0
- package/lib/cjs/resources/stripe_payments.js +4 -0
- package/lib/cjs/resources/tags.d.ts +27 -0
- package/lib/cjs/resources/tags.js +33 -0
- package/lib/cjs/resources/tax_calculators.d.ts +3 -0
- package/lib/cjs/resources/tax_calculators.js +4 -0
- package/lib/cjs/resources/tax_categories.d.ts +3 -0
- package/lib/cjs/resources/tax_categories.js +4 -0
- package/lib/cjs/resources/tax_rules.d.ts +3 -0
- package/lib/cjs/resources/tax_rules.js +4 -0
- package/lib/cjs/resources/taxjar_accounts.d.ts +3 -0
- package/lib/cjs/resources/taxjar_accounts.js +4 -0
- package/lib/cjs/resources/transactions.d.ts +9 -0
- 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 +9 -3
- package/lib/cjs/resources/voids.js +10 -2
- package/lib/cjs/resources/webhooks.d.ts +8 -0
- package/lib/cjs/resources/webhooks.js +4 -0
- package/lib/cjs/resources/wire_transfers.d.ts +3 -0
- package/lib/cjs/resources/wire_transfers.js +4 -0
- package/lib/cjs/util.d.ts +1 -0
- package/lib/esm/api.d.ts +10 -3
- package/lib/esm/api.js +15 -1
- package/lib/esm/commercelayer.d.ts +9 -2
- package/lib/esm/commercelayer.js +8 -1
- package/lib/esm/model.d.ts +10 -3
- package/lib/esm/resource.d.ts +7 -9
- package/lib/esm/resources/addresses.d.ts +14 -0
- package/lib/esm/resources/addresses.js +12 -0
- package/lib/esm/resources/adjustments.d.ts +3 -0
- package/lib/esm/resources/adjustments.js +4 -0
- package/lib/esm/resources/adyen_gateways.d.ts +5 -2
- package/lib/esm/resources/adyen_gateways.js +4 -0
- package/lib/esm/resources/adyen_payments.d.ts +3 -0
- package/lib/esm/resources/adyen_payments.js +4 -0
- package/lib/esm/resources/authorizations.d.ts +9 -3
- package/lib/esm/resources/authorizations.js +12 -4
- package/lib/esm/resources/avalara_accounts.d.ts +9 -6
- package/lib/esm/resources/avalara_accounts.js +4 -0
- package/lib/esm/resources/axerve_gateways.d.ts +4 -0
- package/lib/esm/resources/axerve_gateways.js +4 -0
- package/lib/esm/resources/axerve_payments.d.ts +9 -0
- package/lib/esm/resources/axerve_payments.js +4 -0
- package/lib/esm/resources/billing_info_validation_rules.d.ts +3 -0
- package/lib/esm/resources/billing_info_validation_rules.js +4 -0
- package/lib/esm/resources/braintree_gateways.d.ts +3 -0
- package/lib/esm/resources/braintree_gateways.js +4 -0
- package/lib/esm/resources/braintree_payments.d.ts +3 -0
- package/lib/esm/resources/braintree_payments.js +4 -0
- package/lib/esm/resources/bundles.d.ts +16 -2
- package/lib/esm/resources/bundles.js +12 -0
- package/lib/esm/resources/buy_x_pay_y_promotions.d.ts +134 -0
- package/lib/esm/resources/buy_x_pay_y_promotions.js +79 -0
- package/lib/esm/resources/captures.d.ts +9 -3
- package/lib/esm/resources/captures.js +12 -4
- package/lib/esm/resources/carrier_accounts.d.ts +3 -0
- package/lib/esm/resources/carrier_accounts.js +4 -0
- package/lib/esm/resources/checkout_com_gateways.d.ts +3 -0
- package/lib/esm/resources/checkout_com_gateways.js +4 -0
- package/lib/esm/resources/checkout_com_payments.d.ts +3 -0
- package/lib/esm/resources/checkout_com_payments.js +4 -0
- package/lib/esm/resources/cleanups.d.ts +3 -0
- package/lib/esm/resources/cleanups.js +4 -0
- package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +10 -3
- package/lib/esm/resources/coupon_codes_promotion_rules.js +4 -0
- package/lib/esm/resources/coupon_recipients.d.ts +3 -0
- package/lib/esm/resources/coupon_recipients.js +4 -0
- package/lib/esm/resources/coupons.d.ts +26 -1
- package/lib/esm/resources/coupons.js +16 -0
- package/lib/esm/resources/custom_promotion_rules.d.ts +61 -0
- package/lib/esm/resources/custom_promotion_rules.js +35 -0
- package/lib/esm/resources/customer_addresses.d.ts +5 -0
- package/lib/esm/resources/customer_addresses.js +4 -0
- package/lib/esm/resources/customer_groups.d.ts +3 -0
- package/lib/esm/resources/customer_groups.js +4 -0
- package/lib/esm/resources/customer_payment_sources.d.ts +18 -11
- package/lib/esm/resources/customer_payment_sources.js +8 -0
- package/lib/esm/resources/customer_subscriptions.d.ts +3 -0
- package/lib/esm/resources/customer_subscriptions.js +4 -0
- package/lib/esm/resources/customers.d.ts +9 -0
- package/lib/esm/resources/customers.js +4 -0
- package/lib/esm/resources/delivery_lead_times.d.ts +3 -0
- package/lib/esm/resources/delivery_lead_times.js +4 -0
- package/lib/esm/resources/external_gateways.d.ts +3 -0
- package/lib/esm/resources/external_gateways.js +4 -0
- package/lib/esm/resources/external_payments.d.ts +3 -0
- package/lib/esm/resources/external_payments.js +4 -0
- package/lib/esm/resources/external_promotions.d.ts +45 -6
- package/lib/esm/resources/external_promotions.js +24 -0
- package/lib/esm/resources/external_tax_calculators.d.ts +3 -0
- package/lib/esm/resources/external_tax_calculators.js +4 -0
- package/lib/esm/resources/fixed_amount_promotions.d.ts +45 -6
- package/lib/esm/resources/fixed_amount_promotions.js +24 -0
- package/lib/esm/resources/fixed_price_promotions.d.ts +37 -9
- package/lib/esm/resources/fixed_price_promotions.js +18 -2
- package/lib/esm/resources/free_gift_promotions.d.ts +37 -9
- package/lib/esm/resources/free_gift_promotions.js +18 -2
- package/lib/esm/resources/free_shipping_promotions.d.ts +42 -6
- package/lib/esm/resources/free_shipping_promotions.js +20 -0
- package/lib/esm/resources/gift_card_recipients.d.ts +3 -0
- package/lib/esm/resources/gift_card_recipients.js +4 -0
- package/lib/esm/resources/gift_cards.d.ts +11 -0
- package/lib/esm/resources/gift_cards.js +8 -0
- package/lib/esm/resources/imports.d.ts +1 -3
- package/lib/esm/resources/in_stock_subscriptions.d.ts +3 -0
- package/lib/esm/resources/in_stock_subscriptions.js +4 -0
- package/lib/esm/resources/inventory_models.d.ts +12 -0
- package/lib/esm/resources/inventory_models.js +4 -0
- package/lib/esm/resources/inventory_return_locations.d.ts +3 -0
- package/lib/esm/resources/inventory_return_locations.js +4 -0
- package/lib/esm/resources/inventory_stock_locations.d.ts +3 -0
- package/lib/esm/resources/inventory_stock_locations.js +4 -0
- package/lib/esm/resources/klarna_gateways.d.ts +3 -0
- package/lib/esm/resources/klarna_gateways.js +4 -0
- package/lib/esm/resources/klarna_payments.d.ts +3 -0
- package/lib/esm/resources/klarna_payments.js +4 -0
- package/lib/esm/resources/line_item_options.d.ts +11 -0
- package/lib/esm/resources/line_item_options.js +8 -0
- package/lib/esm/resources/line_items.d.ts +30 -0
- package/lib/esm/resources/line_items.js +16 -0
- package/lib/esm/resources/manual_gateways.d.ts +3 -0
- package/lib/esm/resources/manual_gateways.js +4 -0
- package/lib/esm/resources/manual_tax_calculators.d.ts +3 -0
- package/lib/esm/resources/manual_tax_calculators.js +4 -0
- package/lib/esm/resources/markets.d.ts +8 -0
- package/lib/esm/resources/markets.js +4 -0
- package/lib/esm/resources/merchants.d.ts +3 -0
- package/lib/esm/resources/merchants.js +4 -0
- package/lib/esm/resources/order_amount_promotion_rules.d.ts +13 -3
- package/lib/esm/resources/order_amount_promotion_rules.js +4 -0
- package/lib/esm/resources/order_subscription_items.d.ts +7 -0
- package/lib/esm/resources/order_subscription_items.js +4 -0
- package/lib/esm/resources/order_subscriptions.d.ts +4 -0
- package/lib/esm/resources/order_subscriptions.js +4 -0
- package/lib/esm/resources/order_validation_rules.d.ts +3 -0
- package/lib/esm/resources/order_validation_rules.js +4 -0
- package/lib/esm/resources/orders.d.ts +50 -6
- package/lib/esm/resources/orders.js +32 -0
- package/lib/esm/resources/organization.d.ts +4 -4
- package/lib/esm/resources/packages.d.ts +3 -0
- package/lib/esm/resources/packages.js +4 -0
- package/lib/esm/resources/parcel_line_items.d.ts +4 -1
- package/lib/esm/resources/parcel_line_items.js +4 -0
- package/lib/esm/resources/parcels.d.ts +9 -3
- package/lib/esm/resources/parcels.js +4 -0
- package/lib/esm/resources/payment_gateways.d.ts +3 -0
- package/lib/esm/resources/payment_gateways.js +4 -0
- package/lib/esm/resources/payment_methods.d.ts +9 -1
- package/lib/esm/resources/payment_methods.js +4 -0
- package/lib/esm/resources/payment_options.d.ts +43 -0
- package/lib/esm/resources/payment_options.js +39 -0
- package/lib/esm/resources/paypal_gateways.d.ts +3 -0
- package/lib/esm/resources/paypal_gateways.js +4 -0
- package/lib/esm/resources/paypal_payments.d.ts +3 -0
- package/lib/esm/resources/paypal_payments.js +4 -0
- package/lib/esm/resources/percentage_discount_promotions.d.ts +37 -9
- package/lib/esm/resources/percentage_discount_promotions.js +18 -2
- package/lib/esm/resources/price_frequency_tiers.d.ts +3 -0
- package/lib/esm/resources/price_frequency_tiers.js +4 -0
- package/lib/esm/resources/price_lists.d.ts +6 -0
- package/lib/esm/resources/price_lists.js +4 -0
- package/lib/esm/resources/price_tiers.d.ts +3 -0
- package/lib/esm/resources/price_tiers.js +4 -0
- package/lib/esm/resources/price_volume_tiers.d.ts +3 -0
- package/lib/esm/resources/price_volume_tiers.js +4 -0
- package/lib/esm/resources/prices.d.ts +4 -1
- package/lib/esm/resources/prices.js +4 -0
- package/lib/esm/resources/promotion_rules.d.ts +5 -1
- package/lib/esm/resources/promotion_rules.js +4 -0
- package/lib/esm/resources/promotions.d.ts +18 -0
- package/lib/esm/resources/promotions.js +20 -0
- package/lib/esm/resources/refunds.d.ts +9 -3
- package/lib/esm/resources/refunds.js +10 -2
- package/lib/esm/resources/reserved_stocks.d.ts +27 -0
- package/lib/esm/resources/reserved_stocks.js +34 -0
- package/lib/esm/resources/return_line_items.d.ts +2 -1
- package/lib/esm/resources/returns.d.ts +11 -0
- package/lib/esm/resources/returns.js +8 -0
- package/lib/esm/resources/satispay_gateways.d.ts +6 -0
- package/lib/esm/resources/satispay_gateways.js +4 -0
- package/lib/esm/resources/satispay_payments.d.ts +11 -3
- package/lib/esm/resources/satispay_payments.js +4 -0
- package/lib/esm/resources/shipments.d.ts +49 -2
- package/lib/esm/resources/shipments.js +18 -0
- package/lib/esm/resources/shipping_categories.d.ts +6 -0
- package/lib/esm/resources/shipping_categories.js +4 -0
- package/lib/esm/resources/shipping_method_tiers.d.ts +3 -0
- package/lib/esm/resources/shipping_method_tiers.js +4 -0
- package/lib/esm/resources/shipping_methods.d.ts +11 -0
- package/lib/esm/resources/shipping_methods.js +4 -0
- package/lib/esm/resources/shipping_weight_tiers.d.ts +3 -0
- package/lib/esm/resources/shipping_weight_tiers.js +4 -0
- package/lib/esm/resources/shipping_zones.d.ts +3 -0
- package/lib/esm/resources/shipping_zones.js +4 -0
- package/lib/esm/resources/sku_list_items.d.ts +3 -0
- package/lib/esm/resources/sku_list_items.js +4 -0
- package/lib/esm/resources/sku_list_promotion_rules.d.ts +10 -3
- package/lib/esm/resources/sku_list_promotion_rules.js +4 -0
- package/lib/esm/resources/sku_lists.d.ts +3 -0
- package/lib/esm/resources/sku_lists.js +4 -0
- package/lib/esm/resources/sku_options.d.ts +14 -0
- package/lib/esm/resources/sku_options.js +12 -0
- package/lib/esm/resources/skus.d.ts +17 -0
- package/lib/esm/resources/skus.js +16 -0
- package/lib/esm/resources/stock_items.d.ts +9 -0
- package/lib/esm/resources/stock_items.js +12 -0
- package/lib/esm/resources/stock_line_items.d.ts +42 -2
- package/lib/esm/resources/stock_line_items.js +17 -0
- package/lib/esm/resources/stock_locations.d.ts +6 -0
- package/lib/esm/resources/stock_locations.js +4 -0
- package/lib/esm/resources/stock_reservations.d.ts +49 -0
- package/lib/esm/resources/stock_reservations.js +51 -0
- package/lib/esm/resources/stock_transfers.d.ts +5 -0
- package/lib/esm/resources/stock_transfers.js +4 -0
- package/lib/esm/resources/stripe_gateways.d.ts +3 -0
- package/lib/esm/resources/stripe_gateways.js +4 -0
- package/lib/esm/resources/stripe_payments.d.ts +12 -0
- package/lib/esm/resources/stripe_payments.js +4 -0
- package/lib/esm/resources/tags.d.ts +27 -0
- package/lib/esm/resources/tags.js +31 -0
- package/lib/esm/resources/tax_calculators.d.ts +3 -0
- package/lib/esm/resources/tax_calculators.js +4 -0
- package/lib/esm/resources/tax_categories.d.ts +3 -0
- package/lib/esm/resources/tax_categories.js +4 -0
- package/lib/esm/resources/tax_rules.d.ts +3 -0
- package/lib/esm/resources/tax_rules.js +4 -0
- package/lib/esm/resources/taxjar_accounts.d.ts +3 -0
- package/lib/esm/resources/taxjar_accounts.js +4 -0
- package/lib/esm/resources/transactions.d.ts +9 -0
- 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 +9 -3
- package/lib/esm/resources/voids.js +10 -2
- package/lib/esm/resources/webhooks.d.ts +8 -0
- package/lib/esm/resources/webhooks.js +4 -0
- package/lib/esm/resources/wire_transfers.d.ts +3 -0
- package/lib/esm/resources/wire_transfers.js +4 -0
- package/lib/esm/util.d.ts +1 -0
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +25 -25
- package/lib/cjs/micro.d.ts +0 -4
- package/lib/cjs/micro.js +0 -13
- package/lib/esm/micro.d.ts +0 -4
- package/lib/esm/micro.js +0 -7
@@ -1,33 +1,54 @@
|
|
1
1
|
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
|
2
2
|
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
3
|
import type { CouponCodesPromotionRule } from './coupon_codes_promotion_rules';
|
4
|
+
import type { CouponRecipient } from './coupon_recipients';
|
5
|
+
import type { Event } from './events';
|
6
|
+
import type { Tag } from './tags';
|
7
|
+
import type { Version } from './versions';
|
4
8
|
type CouponRel = ResourceRel & {
|
5
9
|
type: typeof Coupons.TYPE;
|
6
10
|
};
|
7
11
|
type CouponCodesPromotionRuleRel = ResourceRel & {
|
8
12
|
type: 'coupon_codes_promotion_rules';
|
9
13
|
};
|
14
|
+
type CouponRecipientRel = ResourceRel & {
|
15
|
+
type: 'coupon_recipients';
|
16
|
+
};
|
17
|
+
type TagRel = ResourceRel & {
|
18
|
+
type: 'tags';
|
19
|
+
};
|
10
20
|
interface Coupon extends Resource {
|
11
21
|
code?: string;
|
12
22
|
customer_single_use?: boolean;
|
13
23
|
usage_limit?: number;
|
14
24
|
usage_count?: number;
|
15
25
|
recipient_email?: string;
|
26
|
+
expires_at?: string;
|
16
27
|
promotion_rule?: CouponCodesPromotionRule;
|
28
|
+
coupon_recipient?: CouponRecipient;
|
29
|
+
events?: Event[];
|
30
|
+
tags?: Tag[];
|
31
|
+
versions?: Version[];
|
17
32
|
}
|
18
33
|
interface CouponCreate extends ResourceCreate {
|
19
34
|
code: string;
|
20
35
|
customer_single_use?: boolean;
|
21
|
-
usage_limit
|
36
|
+
usage_limit?: number;
|
22
37
|
recipient_email?: string;
|
38
|
+
expires_at?: string;
|
23
39
|
promotion_rule: CouponCodesPromotionRuleRel;
|
40
|
+
coupon_recipient?: CouponRecipientRel;
|
41
|
+
tags?: TagRel[];
|
24
42
|
}
|
25
43
|
interface CouponUpdate extends ResourceUpdate {
|
26
44
|
code?: string;
|
27
45
|
customer_single_use?: boolean;
|
28
46
|
usage_limit?: number;
|
29
47
|
recipient_email?: string;
|
48
|
+
expires_at?: string;
|
30
49
|
promotion_rule?: CouponCodesPromotionRuleRel;
|
50
|
+
coupon_recipient?: CouponRecipientRel;
|
51
|
+
tags?: TagRel[];
|
31
52
|
}
|
32
53
|
declare class Coupons extends ApiResource {
|
33
54
|
static readonly TYPE: 'coupons';
|
@@ -37,6 +58,10 @@ declare class Coupons extends ApiResource {
|
|
37
58
|
update(resource: CouponUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Coupon>;
|
38
59
|
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
39
60
|
promotion_rule(couponId: string | Coupon, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
61
|
+
coupon_recipient(couponId: string | Coupon, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponRecipient>;
|
62
|
+
events(couponId: string | Coupon, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
63
|
+
tags(couponId: string | Coupon, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
64
|
+
versions(couponId: string | Coupon, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
40
65
|
isCoupon(resource: any): resource is Coupon;
|
41
66
|
relationship(id: string | ResourceId | null): CouponRel;
|
42
67
|
type(): string;
|
@@ -20,6 +20,22 @@ class Coupons extends ApiResource {
|
|
20
20
|
const _couponId = couponId.id || couponId;
|
21
21
|
return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `coupons/${_couponId}/promotion_rule`, params, options);
|
22
22
|
}
|
23
|
+
async coupon_recipient(couponId, params, options) {
|
24
|
+
const _couponId = couponId.id || couponId;
|
25
|
+
return this.resources.fetch({ type: 'coupon_recipients' }, `coupons/${_couponId}/coupon_recipient`, params, options);
|
26
|
+
}
|
27
|
+
async events(couponId, params, options) {
|
28
|
+
const _couponId = couponId.id || couponId;
|
29
|
+
return this.resources.fetch({ type: 'events' }, `coupons/${_couponId}/events`, params, options);
|
30
|
+
}
|
31
|
+
async tags(couponId, params, options) {
|
32
|
+
const _couponId = couponId.id || couponId;
|
33
|
+
return this.resources.fetch({ type: 'tags' }, `coupons/${_couponId}/tags`, params, options);
|
34
|
+
}
|
35
|
+
async versions(couponId, params, options) {
|
36
|
+
const _couponId = couponId.id || couponId;
|
37
|
+
return this.resources.fetch({ type: 'versions' }, `coupons/${_couponId}/versions`, params, options);
|
38
|
+
}
|
23
39
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
24
40
|
isCoupon(resource) {
|
25
41
|
return resource.type && (resource.type === Coupons.TYPE);
|
@@ -0,0 +1,61 @@
|
|
1
|
+
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
+
import type { PercentageDiscountPromotion } from './percentage_discount_promotions';
|
4
|
+
import type { FreeShippingPromotion } from './free_shipping_promotions';
|
5
|
+
import type { BuyXPayYPromotion } from './buy_x_pay_y_promotions';
|
6
|
+
import type { FreeGiftPromotion } from './free_gift_promotions';
|
7
|
+
import type { FixedPricePromotion } from './fixed_price_promotions';
|
8
|
+
import type { ExternalPromotion } from './external_promotions';
|
9
|
+
import type { FixedAmountPromotion } from './fixed_amount_promotions';
|
10
|
+
import type { Version } from './versions';
|
11
|
+
type CustomPromotionRuleRel = ResourceRel & {
|
12
|
+
type: typeof CustomPromotionRules.TYPE;
|
13
|
+
};
|
14
|
+
type PercentageDiscountPromotionRel = ResourceRel & {
|
15
|
+
type: 'percentage_discount_promotions';
|
16
|
+
};
|
17
|
+
type FreeShippingPromotionRel = ResourceRel & {
|
18
|
+
type: 'free_shipping_promotions';
|
19
|
+
};
|
20
|
+
type BuyXPayYPromotionRel = ResourceRel & {
|
21
|
+
type: 'buy_x_pay_y_promotions';
|
22
|
+
};
|
23
|
+
type FreeGiftPromotionRel = ResourceRel & {
|
24
|
+
type: 'free_gift_promotions';
|
25
|
+
};
|
26
|
+
type FixedPricePromotionRel = ResourceRel & {
|
27
|
+
type: 'fixed_price_promotions';
|
28
|
+
};
|
29
|
+
type ExternalPromotionRel = ResourceRel & {
|
30
|
+
type: 'external_promotions';
|
31
|
+
};
|
32
|
+
type FixedAmountPromotionRel = ResourceRel & {
|
33
|
+
type: 'fixed_amount_promotions';
|
34
|
+
};
|
35
|
+
interface CustomPromotionRule extends Resource {
|
36
|
+
filters?: object;
|
37
|
+
promotion?: PercentageDiscountPromotion | FreeShippingPromotion | BuyXPayYPromotion | FreeGiftPromotion | FixedPricePromotion | ExternalPromotion | FixedAmountPromotion;
|
38
|
+
versions?: Version[];
|
39
|
+
}
|
40
|
+
interface CustomPromotionRuleCreate extends ResourceCreate {
|
41
|
+
filters?: object;
|
42
|
+
promotion: PercentageDiscountPromotionRel | FreeShippingPromotionRel | BuyXPayYPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel | FixedAmountPromotionRel;
|
43
|
+
}
|
44
|
+
interface CustomPromotionRuleUpdate extends ResourceUpdate {
|
45
|
+
filters?: object;
|
46
|
+
promotion?: PercentageDiscountPromotionRel | FreeShippingPromotionRel | BuyXPayYPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel | FixedAmountPromotionRel;
|
47
|
+
}
|
48
|
+
declare class CustomPromotionRules extends ApiResource {
|
49
|
+
static readonly TYPE: 'custom_promotion_rules';
|
50
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<CustomPromotionRule>>;
|
51
|
+
create(resource: CustomPromotionRuleCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
|
52
|
+
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
|
53
|
+
update(resource: CustomPromotionRuleUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
|
54
|
+
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
55
|
+
versions(customPromotionRuleId: string | CustomPromotionRule, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
56
|
+
isCustomPromotionRule(resource: any): resource is CustomPromotionRule;
|
57
|
+
relationship(id: string | ResourceId | null): CustomPromotionRuleRel;
|
58
|
+
type(): string;
|
59
|
+
}
|
60
|
+
export default CustomPromotionRules;
|
61
|
+
export { CustomPromotionRule, CustomPromotionRuleCreate, CustomPromotionRuleUpdate };
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
class CustomPromotionRules extends ApiResource {
|
3
|
+
// static readonly PATH = 'custom_promotion_rules'
|
4
|
+
async list(params, options) {
|
5
|
+
return this.resources.list({ type: CustomPromotionRules.TYPE }, params, options);
|
6
|
+
}
|
7
|
+
async create(resource, params, options) {
|
8
|
+
return this.resources.create(Object.assign(Object.assign({}, resource), { type: CustomPromotionRules.TYPE }), params, options);
|
9
|
+
}
|
10
|
+
async retrieve(id, params, options) {
|
11
|
+
return this.resources.retrieve({ type: CustomPromotionRules.TYPE, id }, params, options);
|
12
|
+
}
|
13
|
+
async update(resource, params, options) {
|
14
|
+
return this.resources.update(Object.assign(Object.assign({}, resource), { type: CustomPromotionRules.TYPE }), params, options);
|
15
|
+
}
|
16
|
+
async delete(id, options) {
|
17
|
+
await this.resources.delete({ type: CustomPromotionRules.TYPE, id }, options);
|
18
|
+
}
|
19
|
+
async versions(customPromotionRuleId, params, options) {
|
20
|
+
const _customPromotionRuleId = customPromotionRuleId.id || customPromotionRuleId;
|
21
|
+
return this.resources.fetch({ type: 'versions' }, `custom_promotion_rules/${_customPromotionRuleId}/versions`, params, options);
|
22
|
+
}
|
23
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
24
|
+
isCustomPromotionRule(resource) {
|
25
|
+
return resource.type && (resource.type === CustomPromotionRules.TYPE);
|
26
|
+
}
|
27
|
+
relationship(id) {
|
28
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: CustomPromotionRules.TYPE } : { id: id.id, type: CustomPromotionRules.TYPE };
|
29
|
+
}
|
30
|
+
type() {
|
31
|
+
return CustomPromotionRules.TYPE;
|
32
|
+
}
|
33
|
+
}
|
34
|
+
CustomPromotionRules.TYPE = 'custom_promotion_rules';
|
35
|
+
export default CustomPromotionRules;
|
@@ -3,6 +3,7 @@ import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
|
3
3
|
import type { Customer } from './customers';
|
4
4
|
import type { Address } from './addresses';
|
5
5
|
import type { Event } from './events';
|
6
|
+
import type { Version } from './versions';
|
6
7
|
type CustomerAddressRel = ResourceRel & {
|
7
8
|
type: typeof CustomerAddresses.TYPE;
|
8
9
|
};
|
@@ -14,11 +15,14 @@ type AddressRel = ResourceRel & {
|
|
14
15
|
};
|
15
16
|
interface CustomerAddress extends Resource {
|
16
17
|
name?: string;
|
18
|
+
customer_email?: string;
|
17
19
|
customer?: Customer;
|
18
20
|
address?: Address;
|
19
21
|
events?: Event[];
|
22
|
+
versions?: Version[];
|
20
23
|
}
|
21
24
|
interface CustomerAddressCreate extends ResourceCreate {
|
25
|
+
customer_email: string;
|
22
26
|
customer: CustomerRel;
|
23
27
|
address: AddressRel;
|
24
28
|
}
|
@@ -36,6 +40,7 @@ declare class CustomerAddresses extends ApiResource {
|
|
36
40
|
customer(customerAddressId: string | CustomerAddress, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Customer>;
|
37
41
|
address(customerAddressId: string | CustomerAddress, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Address>;
|
38
42
|
events(customerAddressId: string | CustomerAddress, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
43
|
+
versions(customerAddressId: string | CustomerAddress, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
39
44
|
isCustomerAddress(resource: any): resource is CustomerAddress;
|
40
45
|
relationship(id: string | ResourceId | null): CustomerAddressRel;
|
41
46
|
type(): string;
|
@@ -28,6 +28,10 @@ class CustomerAddresses extends ApiResource {
|
|
28
28
|
const _customerAddressId = customerAddressId.id || customerAddressId;
|
29
29
|
return this.resources.fetch({ type: 'events' }, `customer_addresses/${_customerAddressId}/events`, params, options);
|
30
30
|
}
|
31
|
+
async versions(customerAddressId, params, options) {
|
32
|
+
const _customerAddressId = customerAddressId.id || customerAddressId;
|
33
|
+
return this.resources.fetch({ type: 'versions' }, `customer_addresses/${_customerAddressId}/versions`, params, options);
|
34
|
+
}
|
31
35
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
32
36
|
isCustomerAddress(resource) {
|
33
37
|
return resource.type && (resource.type === CustomerAddresses.TYPE);
|
@@ -3,6 +3,7 @@ import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
|
3
3
|
import type { Customer } from './customers';
|
4
4
|
import type { Market } from './markets';
|
5
5
|
import type { Attachment } from './attachments';
|
6
|
+
import type { Version } from './versions';
|
6
7
|
type CustomerGroupRel = ResourceRel & {
|
7
8
|
type: typeof CustomerGroups.TYPE;
|
8
9
|
};
|
@@ -11,6 +12,7 @@ interface CustomerGroup extends Resource {
|
|
11
12
|
customers?: Customer[];
|
12
13
|
markets?: Market[];
|
13
14
|
attachments?: Attachment[];
|
15
|
+
versions?: Version[];
|
14
16
|
}
|
15
17
|
interface CustomerGroupCreate extends ResourceCreate {
|
16
18
|
name: string;
|
@@ -28,6 +30,7 @@ declare class CustomerGroups extends ApiResource {
|
|
28
30
|
customers(customerGroupId: string | CustomerGroup, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Customer>>;
|
29
31
|
markets(customerGroupId: string | CustomerGroup, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Market>>;
|
30
32
|
attachments(customerGroupId: string | CustomerGroup, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
33
|
+
versions(customerGroupId: string | CustomerGroup, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
31
34
|
isCustomerGroup(resource: any): resource is CustomerGroup;
|
32
35
|
relationship(id: string | ResourceId | null): CustomerGroupRel;
|
33
36
|
type(): string;
|
@@ -28,6 +28,10 @@ class CustomerGroups extends ApiResource {
|
|
28
28
|
const _customerGroupId = customerGroupId.id || customerGroupId;
|
29
29
|
return this.resources.fetch({ type: 'attachments' }, `customer_groups/${_customerGroupId}/attachments`, params, options);
|
30
30
|
}
|
31
|
+
async versions(customerGroupId, params, options) {
|
32
|
+
const _customerGroupId = customerGroupId.id || customerGroupId;
|
33
|
+
return this.resources.fetch({ type: 'versions' }, `customer_groups/${_customerGroupId}/versions`, params, options);
|
34
|
+
}
|
31
35
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
32
36
|
isCustomerGroup(resource) {
|
33
37
|
return resource.type && (resource.type === CustomerGroups.TYPE);
|
@@ -1,22 +1,25 @@
|
|
1
1
|
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
|
2
2
|
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
3
|
import type { Customer } from './customers';
|
4
|
+
import type { PaymentMethod } from './payment_methods';
|
4
5
|
import type { AdyenPayment } from './adyen_payments';
|
5
6
|
import type { AxervePayment } from './axerve_payments';
|
6
7
|
import type { BraintreePayment } from './braintree_payments';
|
7
8
|
import type { CheckoutComPayment } from './checkout_com_payments';
|
8
9
|
import type { ExternalPayment } from './external_payments';
|
9
10
|
import type { KlarnaPayment } from './klarna_payments';
|
10
|
-
import type { PaypalPayment } from './paypal_payments';
|
11
11
|
import type { SatispayPayment } from './satispay_payments';
|
12
12
|
import type { StripePayment } from './stripe_payments';
|
13
|
-
import type {
|
13
|
+
import type { Version } from './versions';
|
14
14
|
type CustomerPaymentSourceRel = ResourceRel & {
|
15
15
|
type: typeof CustomerPaymentSources.TYPE;
|
16
16
|
};
|
17
17
|
type CustomerRel = ResourceRel & {
|
18
18
|
type: 'customers';
|
19
19
|
};
|
20
|
+
type PaymentMethodRel = ResourceRel & {
|
21
|
+
type: 'payment_methods';
|
22
|
+
};
|
20
23
|
type AdyenPaymentRel = ResourceRel & {
|
21
24
|
type: 'adyen_payments';
|
22
25
|
};
|
@@ -35,32 +38,34 @@ type ExternalPaymentRel = ResourceRel & {
|
|
35
38
|
type KlarnaPaymentRel = ResourceRel & {
|
36
39
|
type: 'klarna_payments';
|
37
40
|
};
|
38
|
-
type PaypalPaymentRel = ResourceRel & {
|
39
|
-
type: 'paypal_payments';
|
40
|
-
};
|
41
41
|
type SatispayPaymentRel = ResourceRel & {
|
42
42
|
type: 'satispay_payments';
|
43
43
|
};
|
44
44
|
type StripePaymentRel = ResourceRel & {
|
45
45
|
type: 'stripe_payments';
|
46
46
|
};
|
47
|
-
type WireTransferRel = ResourceRel & {
|
48
|
-
type: 'wire_transfers';
|
49
|
-
};
|
50
47
|
interface CustomerPaymentSource extends Resource {
|
51
48
|
name?: string;
|
52
49
|
customer_token?: string;
|
53
50
|
payment_source_token?: string;
|
54
51
|
customer?: Customer;
|
55
|
-
|
52
|
+
payment_method?: PaymentMethod;
|
53
|
+
payment_source?: AdyenPayment | AxervePayment | BraintreePayment | CheckoutComPayment | ExternalPayment | KlarnaPayment | SatispayPayment | StripePayment;
|
54
|
+
versions?: Version[];
|
56
55
|
}
|
57
56
|
interface CustomerPaymentSourceCreate extends ResourceCreate {
|
57
|
+
customer_token?: string;
|
58
|
+
payment_source_token?: string;
|
58
59
|
customer: CustomerRel;
|
59
|
-
|
60
|
+
payment_method?: PaymentMethodRel;
|
61
|
+
payment_source?: AdyenPaymentRel | AxervePaymentRel | BraintreePaymentRel | CheckoutComPaymentRel | ExternalPaymentRel | KlarnaPaymentRel | SatispayPaymentRel | StripePaymentRel;
|
60
62
|
}
|
61
63
|
interface CustomerPaymentSourceUpdate extends ResourceUpdate {
|
64
|
+
customer_token?: string;
|
65
|
+
payment_source_token?: string;
|
62
66
|
customer?: CustomerRel;
|
63
|
-
|
67
|
+
payment_method?: PaymentMethodRel;
|
68
|
+
payment_source?: AdyenPaymentRel | AxervePaymentRel | BraintreePaymentRel | CheckoutComPaymentRel | ExternalPaymentRel | KlarnaPaymentRel | SatispayPaymentRel | StripePaymentRel;
|
64
69
|
}
|
65
70
|
declare class CustomerPaymentSources extends ApiResource {
|
66
71
|
static readonly TYPE: 'customer_payment_sources';
|
@@ -70,6 +75,8 @@ declare class CustomerPaymentSources extends ApiResource {
|
|
70
75
|
update(resource: CustomerPaymentSourceUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomerPaymentSource>;
|
71
76
|
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
72
77
|
customer(customerPaymentSourceId: string | CustomerPaymentSource, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Customer>;
|
78
|
+
payment_method(customerPaymentSourceId: string | CustomerPaymentSource, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentMethod>;
|
79
|
+
versions(customerPaymentSourceId: string | CustomerPaymentSource, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
73
80
|
isCustomerPaymentSource(resource: any): resource is CustomerPaymentSource;
|
74
81
|
relationship(id: string | ResourceId | null): CustomerPaymentSourceRel;
|
75
82
|
type(): string;
|
@@ -20,6 +20,14 @@ class CustomerPaymentSources extends ApiResource {
|
|
20
20
|
const _customerPaymentSourceId = customerPaymentSourceId.id || customerPaymentSourceId;
|
21
21
|
return this.resources.fetch({ type: 'customers' }, `customer_payment_sources/${_customerPaymentSourceId}/customer`, params, options);
|
22
22
|
}
|
23
|
+
async payment_method(customerPaymentSourceId, params, options) {
|
24
|
+
const _customerPaymentSourceId = customerPaymentSourceId.id || customerPaymentSourceId;
|
25
|
+
return this.resources.fetch({ type: 'payment_methods' }, `customer_payment_sources/${_customerPaymentSourceId}/payment_method`, params, options);
|
26
|
+
}
|
27
|
+
async versions(customerPaymentSourceId, params, options) {
|
28
|
+
const _customerPaymentSourceId = customerPaymentSourceId.id || customerPaymentSourceId;
|
29
|
+
return this.resources.fetch({ type: 'versions' }, `customer_payment_sources/${_customerPaymentSourceId}/versions`, params, options);
|
30
|
+
}
|
23
31
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
24
32
|
isCustomerPaymentSource(resource) {
|
25
33
|
return resource.type && (resource.type === CustomerPaymentSources.TYPE);
|
@@ -2,6 +2,7 @@ import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig,
|
|
2
2
|
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
3
|
import type { Customer } from './customers';
|
4
4
|
import type { Event } from './events';
|
5
|
+
import type { Version } from './versions';
|
5
6
|
type CustomerSubscriptionRel = ResourceRel & {
|
6
7
|
type: typeof CustomerSubscriptions.TYPE;
|
7
8
|
};
|
@@ -9,6 +10,7 @@ interface CustomerSubscription extends Resource {
|
|
9
10
|
customer_email?: string;
|
10
11
|
customer?: Customer;
|
11
12
|
events?: Event[];
|
13
|
+
versions?: Version[];
|
12
14
|
}
|
13
15
|
interface CustomerSubscriptionCreate extends ResourceCreate {
|
14
16
|
customer_email: string;
|
@@ -23,6 +25,7 @@ declare class CustomerSubscriptions extends ApiResource {
|
|
23
25
|
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
24
26
|
customer(customerSubscriptionId: string | CustomerSubscription, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Customer>;
|
25
27
|
events(customerSubscriptionId: string | CustomerSubscription, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
28
|
+
versions(customerSubscriptionId: string | CustomerSubscription, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
26
29
|
isCustomerSubscription(resource: any): resource is CustomerSubscription;
|
27
30
|
relationship(id: string | ResourceId | null): CustomerSubscriptionRel;
|
28
31
|
type(): string;
|
@@ -24,6 +24,10 @@ class CustomerSubscriptions extends ApiResource {
|
|
24
24
|
const _customerSubscriptionId = customerSubscriptionId.id || customerSubscriptionId;
|
25
25
|
return this.resources.fetch({ type: 'events' }, `customer_subscriptions/${_customerSubscriptionId}/events`, params, options);
|
26
26
|
}
|
27
|
+
async versions(customerSubscriptionId, params, options) {
|
28
|
+
const _customerSubscriptionId = customerSubscriptionId.id || customerSubscriptionId;
|
29
|
+
return this.resources.fetch({ type: 'versions' }, `customer_subscriptions/${_customerSubscriptionId}/versions`, params, options);
|
30
|
+
}
|
27
31
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
28
32
|
isCustomerSubscription(resource) {
|
29
33
|
return resource.type && (resource.type === CustomerSubscriptions.TYPE);
|
@@ -10,16 +10,21 @@ import type { Return } from './returns';
|
|
10
10
|
import type { SkuList } from './sku_lists';
|
11
11
|
import type { Attachment } from './attachments';
|
12
12
|
import type { Event } from './events';
|
13
|
+
import type { Tag } from './tags';
|
13
14
|
type CustomerRel = ResourceRel & {
|
14
15
|
type: typeof Customers.TYPE;
|
15
16
|
};
|
16
17
|
type CustomerGroupRel = ResourceRel & {
|
17
18
|
type: 'customer_groups';
|
18
19
|
};
|
20
|
+
type TagRel = ResourceRel & {
|
21
|
+
type: 'tags';
|
22
|
+
};
|
19
23
|
interface Customer extends Resource {
|
20
24
|
email?: string;
|
21
25
|
status?: string;
|
22
26
|
has_password?: boolean;
|
27
|
+
total_orders_count?: number;
|
23
28
|
customer_group?: CustomerGroup;
|
24
29
|
customer_addresses?: CustomerAddress[];
|
25
30
|
customer_payment_sources?: CustomerPaymentSource[];
|
@@ -30,16 +35,19 @@ interface Customer extends Resource {
|
|
30
35
|
sku_lists?: SkuList[];
|
31
36
|
attachments?: Attachment[];
|
32
37
|
events?: Event[];
|
38
|
+
tags?: Tag[];
|
33
39
|
}
|
34
40
|
interface CustomerCreate extends ResourceCreate {
|
35
41
|
email: string;
|
36
42
|
password?: string;
|
37
43
|
customer_group?: CustomerGroupRel;
|
44
|
+
tags?: TagRel[];
|
38
45
|
}
|
39
46
|
interface CustomerUpdate extends ResourceUpdate {
|
40
47
|
email?: string;
|
41
48
|
password?: string;
|
42
49
|
customer_group?: CustomerGroupRel;
|
50
|
+
tags?: TagRel[];
|
43
51
|
}
|
44
52
|
declare class Customers extends ApiResource {
|
45
53
|
static readonly TYPE: 'customers';
|
@@ -58,6 +66,7 @@ declare class Customers extends ApiResource {
|
|
58
66
|
sku_lists(customerId: string | Customer, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<SkuList>>;
|
59
67
|
attachments(customerId: string | Customer, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
60
68
|
events(customerId: string | Customer, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
69
|
+
tags(customerId: string | Customer, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
61
70
|
isCustomer(resource: any): resource is Customer;
|
62
71
|
relationship(id: string | ResourceId | null): CustomerRel;
|
63
72
|
type(): string;
|
@@ -56,6 +56,10 @@ class Customers extends ApiResource {
|
|
56
56
|
const _customerId = customerId.id || customerId;
|
57
57
|
return this.resources.fetch({ type: 'events' }, `customers/${_customerId}/events`, params, options);
|
58
58
|
}
|
59
|
+
async tags(customerId, params, options) {
|
60
|
+
const _customerId = customerId.id || customerId;
|
61
|
+
return this.resources.fetch({ type: 'tags' }, `customers/${_customerId}/tags`, params, options);
|
62
|
+
}
|
59
63
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
60
64
|
isCustomer(resource) {
|
61
65
|
return resource.type && (resource.type === Customers.TYPE);
|
@@ -3,6 +3,7 @@ import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
|
3
3
|
import type { StockLocation } from './stock_locations';
|
4
4
|
import type { ShippingMethod } from './shipping_methods';
|
5
5
|
import type { Attachment } from './attachments';
|
6
|
+
import type { Version } from './versions';
|
6
7
|
type DeliveryLeadTimeRel = ResourceRel & {
|
7
8
|
type: typeof DeliveryLeadTimes.TYPE;
|
8
9
|
};
|
@@ -20,6 +21,7 @@ interface DeliveryLeadTime extends Resource {
|
|
20
21
|
stock_location?: StockLocation;
|
21
22
|
shipping_method?: ShippingMethod;
|
22
23
|
attachments?: Attachment[];
|
24
|
+
versions?: Version[];
|
23
25
|
}
|
24
26
|
interface DeliveryLeadTimeCreate extends ResourceCreate {
|
25
27
|
min_hours: number;
|
@@ -43,6 +45,7 @@ declare class DeliveryLeadTimes extends ApiResource {
|
|
43
45
|
stock_location(deliveryLeadTimeId: string | DeliveryLeadTime, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
|
44
46
|
shipping_method(deliveryLeadTimeId: string | DeliveryLeadTime, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingMethod>;
|
45
47
|
attachments(deliveryLeadTimeId: string | DeliveryLeadTime, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
48
|
+
versions(deliveryLeadTimeId: string | DeliveryLeadTime, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
46
49
|
isDeliveryLeadTime(resource: any): resource is DeliveryLeadTime;
|
47
50
|
relationship(id: string | ResourceId | null): DeliveryLeadTimeRel;
|
48
51
|
type(): string;
|
@@ -28,6 +28,10 @@ class DeliveryLeadTimes extends ApiResource {
|
|
28
28
|
const _deliveryLeadTimeId = deliveryLeadTimeId.id || deliveryLeadTimeId;
|
29
29
|
return this.resources.fetch({ type: 'attachments' }, `delivery_lead_times/${_deliveryLeadTimeId}/attachments`, params, options);
|
30
30
|
}
|
31
|
+
async versions(deliveryLeadTimeId, params, options) {
|
32
|
+
const _deliveryLeadTimeId = deliveryLeadTimeId.id || deliveryLeadTimeId;
|
33
|
+
return this.resources.fetch({ type: 'versions' }, `delivery_lead_times/${_deliveryLeadTimeId}/versions`, params, options);
|
34
|
+
}
|
31
35
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
32
36
|
isDeliveryLeadTime(resource) {
|
33
37
|
return resource.type && (resource.type === DeliveryLeadTimes.TYPE);
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
|
2
2
|
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
3
|
import type { PaymentMethod } from './payment_methods';
|
4
|
+
import type { Version } from './versions';
|
4
5
|
import type { ExternalPayment } from './external_payments';
|
5
6
|
type ExternalGatewayRel = ResourceRel & {
|
6
7
|
type: typeof ExternalGateways.TYPE;
|
@@ -14,6 +15,7 @@ interface ExternalGateway extends Resource {
|
|
14
15
|
refund_url?: string;
|
15
16
|
token_url?: string;
|
16
17
|
payment_methods?: PaymentMethod[];
|
18
|
+
versions?: Version[];
|
17
19
|
external_payments?: ExternalPayment[];
|
18
20
|
}
|
19
21
|
interface ExternalGatewayCreate extends ResourceCreate {
|
@@ -40,6 +42,7 @@ declare class ExternalGateways extends ApiResource {
|
|
40
42
|
update(resource: ExternalGatewayUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ExternalGateway>;
|
41
43
|
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
42
44
|
payment_methods(externalGatewayId: string | ExternalGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>>;
|
45
|
+
versions(externalGatewayId: string | ExternalGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
43
46
|
external_payments(externalGatewayId: string | ExternalGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ExternalPayment>>;
|
44
47
|
isExternalGateway(resource: any): resource is ExternalGateway;
|
45
48
|
relationship(id: string | ResourceId | null): ExternalGatewayRel;
|
@@ -20,6 +20,10 @@ class ExternalGateways extends ApiResource {
|
|
20
20
|
const _externalGatewayId = externalGatewayId.id || externalGatewayId;
|
21
21
|
return this.resources.fetch({ type: 'payment_methods' }, `external_gateways/${_externalGatewayId}/payment_methods`, params, options);
|
22
22
|
}
|
23
|
+
async versions(externalGatewayId, params, options) {
|
24
|
+
const _externalGatewayId = externalGatewayId.id || externalGatewayId;
|
25
|
+
return this.resources.fetch({ type: 'versions' }, `external_gateways/${_externalGatewayId}/versions`, params, options);
|
26
|
+
}
|
23
27
|
async external_payments(externalGatewayId, params, options) {
|
24
28
|
const _externalGatewayId = externalGatewayId.id || externalGatewayId;
|
25
29
|
return this.resources.fetch({ type: 'external_payments' }, `external_gateways/${_externalGatewayId}/external_payments`, params, options);
|
@@ -3,6 +3,7 @@ import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
|
3
3
|
import type { Order } from './orders';
|
4
4
|
import type { PaymentGateway } from './payment_gateways';
|
5
5
|
import type { CustomerPaymentSource } from './customer_payment_sources';
|
6
|
+
import type { Version } from './versions';
|
6
7
|
type ExternalPaymentRel = ResourceRel & {
|
7
8
|
type: typeof ExternalPayments.TYPE;
|
8
9
|
};
|
@@ -16,6 +17,7 @@ interface ExternalPayment extends Resource {
|
|
16
17
|
order?: Order;
|
17
18
|
payment_gateway?: PaymentGateway;
|
18
19
|
wallet?: CustomerPaymentSource;
|
20
|
+
versions?: Version[];
|
19
21
|
}
|
20
22
|
interface ExternalPaymentCreate extends ResourceCreate {
|
21
23
|
payment_source_token: string;
|
@@ -36,6 +38,7 @@ declare class ExternalPayments extends ApiResource {
|
|
36
38
|
order(externalPaymentId: string | ExternalPayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
37
39
|
payment_gateway(externalPaymentId: string | ExternalPayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentGateway>;
|
38
40
|
wallet(externalPaymentId: string | ExternalPayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomerPaymentSource>;
|
41
|
+
versions(externalPaymentId: string | ExternalPayment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
39
42
|
isExternalPayment(resource: any): resource is ExternalPayment;
|
40
43
|
relationship(id: string | ResourceId | null): ExternalPaymentRel;
|
41
44
|
type(): string;
|
@@ -28,6 +28,10 @@ class ExternalPayments extends ApiResource {
|
|
28
28
|
const _externalPaymentId = externalPaymentId.id || externalPaymentId;
|
29
29
|
return this.resources.fetch({ type: 'customer_payment_sources' }, `external_payments/${_externalPaymentId}/wallet`, params, options);
|
30
30
|
}
|
31
|
+
async versions(externalPaymentId, params, options) {
|
32
|
+
const _externalPaymentId = externalPaymentId.id || externalPaymentId;
|
33
|
+
return this.resources.fetch({ type: 'versions' }, `external_payments/${_externalPaymentId}/versions`, params, options);
|
34
|
+
}
|
31
35
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
32
36
|
isExternalPayment(resource) {
|
33
37
|
return resource.type && (resource.type === ExternalPayments.TYPE);
|