@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
@@ -4,6 +4,9 @@ import type { Market } from './markets';
|
|
4
4
|
import type { SkuList } from './sku_lists';
|
5
5
|
import type { Sku } from './skus';
|
6
6
|
import type { Attachment } from './attachments';
|
7
|
+
import type { Event } from './events';
|
8
|
+
import type { Tag } from './tags';
|
9
|
+
import type { Version } from './versions';
|
7
10
|
type BundleRel = ResourceRel & {
|
8
11
|
type: typeof Bundles.TYPE;
|
9
12
|
};
|
@@ -13,6 +16,9 @@ type MarketRel = ResourceRel & {
|
|
13
16
|
type SkuListRel = ResourceRel & {
|
14
17
|
type: 'sku_lists';
|
15
18
|
};
|
19
|
+
type TagRel = ResourceRel & {
|
20
|
+
type: 'tags';
|
21
|
+
};
|
16
22
|
interface Bundle extends Resource {
|
17
23
|
code?: string;
|
18
24
|
name?: string;
|
@@ -32,6 +38,9 @@ interface Bundle extends Resource {
|
|
32
38
|
sku_list?: SkuList;
|
33
39
|
skus?: Sku[];
|
34
40
|
attachments?: Attachment[];
|
41
|
+
events?: Event[];
|
42
|
+
tags?: Tag[];
|
43
|
+
versions?: Version[];
|
35
44
|
}
|
36
45
|
interface BundleCreate extends ResourceCreate {
|
37
46
|
code: string;
|
@@ -39,12 +48,13 @@ interface BundleCreate extends ResourceCreate {
|
|
39
48
|
currency_code?: string;
|
40
49
|
description?: string;
|
41
50
|
image_url?: string;
|
42
|
-
price_amount_cents
|
43
|
-
compare_at_amount_cents
|
51
|
+
price_amount_cents?: number;
|
52
|
+
compare_at_amount_cents?: number;
|
44
53
|
_compute_price_amount?: boolean;
|
45
54
|
_compute_compare_at_amount?: boolean;
|
46
55
|
market?: MarketRel;
|
47
56
|
sku_list: SkuListRel;
|
57
|
+
tags?: TagRel[];
|
48
58
|
}
|
49
59
|
interface BundleUpdate extends ResourceUpdate {
|
50
60
|
code?: string;
|
@@ -56,6 +66,7 @@ interface BundleUpdate extends ResourceUpdate {
|
|
56
66
|
compare_at_amount_cents?: number;
|
57
67
|
_compute_price_amount?: boolean;
|
58
68
|
_compute_compare_at_amount?: boolean;
|
69
|
+
tags?: TagRel[];
|
59
70
|
}
|
60
71
|
declare class Bundles extends ApiResource {
|
61
72
|
static readonly TYPE: 'bundles';
|
@@ -68,6 +79,9 @@ declare class Bundles extends ApiResource {
|
|
68
79
|
sku_list(bundleId: string | Bundle, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
69
80
|
skus(bundleId: string | Bundle, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Sku>>;
|
70
81
|
attachments(bundleId: string | Bundle, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
82
|
+
events(bundleId: string | Bundle, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
83
|
+
tags(bundleId: string | Bundle, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
84
|
+
versions(bundleId: string | Bundle, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
71
85
|
isBundle(resource: any): resource is Bundle;
|
72
86
|
relationship(id: string | ResourceId | null): BundleRel;
|
73
87
|
type(): string;
|
@@ -32,6 +32,18 @@ class Bundles extends ApiResource {
|
|
32
32
|
const _bundleId = bundleId.id || bundleId;
|
33
33
|
return this.resources.fetch({ type: 'attachments' }, `bundles/${_bundleId}/attachments`, params, options);
|
34
34
|
}
|
35
|
+
async events(bundleId, params, options) {
|
36
|
+
const _bundleId = bundleId.id || bundleId;
|
37
|
+
return this.resources.fetch({ type: 'events' }, `bundles/${_bundleId}/events`, params, options);
|
38
|
+
}
|
39
|
+
async tags(bundleId, params, options) {
|
40
|
+
const _bundleId = bundleId.id || bundleId;
|
41
|
+
return this.resources.fetch({ type: 'tags' }, `bundles/${_bundleId}/tags`, params, options);
|
42
|
+
}
|
43
|
+
async versions(bundleId, params, options) {
|
44
|
+
const _bundleId = bundleId.id || bundleId;
|
45
|
+
return this.resources.fetch({ type: 'versions' }, `bundles/${_bundleId}/versions`, params, options);
|
46
|
+
}
|
35
47
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
36
48
|
isBundle(resource) {
|
37
49
|
return resource.type && (resource.type === Bundles.TYPE);
|
@@ -0,0 +1,134 @@
|
|
1
|
+
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
+
import type { Market } from './markets';
|
4
|
+
import type { PromotionRule } from './promotion_rules';
|
5
|
+
import type { OrderAmountPromotionRule } from './order_amount_promotion_rules';
|
6
|
+
import type { SkuListPromotionRule } from './sku_list_promotion_rules';
|
7
|
+
import type { CouponCodesPromotionRule } from './coupon_codes_promotion_rules';
|
8
|
+
import type { CustomPromotionRule } from './custom_promotion_rules';
|
9
|
+
import type { SkuList } from './sku_lists';
|
10
|
+
import type { Coupon } from './coupons';
|
11
|
+
import type { Attachment } from './attachments';
|
12
|
+
import type { Event } from './events';
|
13
|
+
import type { Tag } from './tags';
|
14
|
+
import type { Version } from './versions';
|
15
|
+
import type { Sku } from './skus';
|
16
|
+
type BuyXPayYPromotionRel = ResourceRel & {
|
17
|
+
type: typeof BuyXPayYPromotions.TYPE;
|
18
|
+
};
|
19
|
+
type MarketRel = ResourceRel & {
|
20
|
+
type: 'markets';
|
21
|
+
};
|
22
|
+
type OrderAmountPromotionRuleRel = ResourceRel & {
|
23
|
+
type: 'order_amount_promotion_rules';
|
24
|
+
};
|
25
|
+
type SkuListPromotionRuleRel = ResourceRel & {
|
26
|
+
type: 'sku_list_promotion_rules';
|
27
|
+
};
|
28
|
+
type CouponCodesPromotionRuleRel = ResourceRel & {
|
29
|
+
type: 'coupon_codes_promotion_rules';
|
30
|
+
};
|
31
|
+
type CustomPromotionRuleRel = ResourceRel & {
|
32
|
+
type: 'custom_promotion_rules';
|
33
|
+
};
|
34
|
+
type SkuListRel = ResourceRel & {
|
35
|
+
type: 'sku_lists';
|
36
|
+
};
|
37
|
+
type TagRel = ResourceRel & {
|
38
|
+
type: 'tags';
|
39
|
+
};
|
40
|
+
interface BuyXPayYPromotion extends Resource {
|
41
|
+
name?: string;
|
42
|
+
currency_code?: string;
|
43
|
+
exclusive?: boolean;
|
44
|
+
priority?: number;
|
45
|
+
starts_at?: string;
|
46
|
+
expires_at?: string;
|
47
|
+
total_usage_limit?: number;
|
48
|
+
total_usage_count?: number;
|
49
|
+
active?: boolean;
|
50
|
+
disabled_at?: string;
|
51
|
+
x?: number;
|
52
|
+
y?: number;
|
53
|
+
cheapest_free?: boolean;
|
54
|
+
market?: Market;
|
55
|
+
promotion_rules?: PromotionRule[];
|
56
|
+
order_amount_promotion_rule?: OrderAmountPromotionRule;
|
57
|
+
sku_list_promotion_rule?: SkuListPromotionRule;
|
58
|
+
coupon_codes_promotion_rule?: CouponCodesPromotionRule;
|
59
|
+
custom_promotion_rule?: CustomPromotionRule;
|
60
|
+
sku_list?: SkuList;
|
61
|
+
coupons?: Coupon[];
|
62
|
+
attachments?: Attachment[];
|
63
|
+
events?: Event[];
|
64
|
+
tags?: Tag[];
|
65
|
+
versions?: Version[];
|
66
|
+
skus?: Sku[];
|
67
|
+
}
|
68
|
+
interface BuyXPayYPromotionCreate extends ResourceCreate {
|
69
|
+
name: string;
|
70
|
+
currency_code?: string;
|
71
|
+
exclusive?: boolean;
|
72
|
+
priority?: number;
|
73
|
+
starts_at: string;
|
74
|
+
expires_at: string;
|
75
|
+
total_usage_limit?: number;
|
76
|
+
_disable?: boolean;
|
77
|
+
_enable?: boolean;
|
78
|
+
x: number;
|
79
|
+
y: number;
|
80
|
+
cheapest_free?: boolean;
|
81
|
+
market?: MarketRel;
|
82
|
+
order_amount_promotion_rule?: OrderAmountPromotionRuleRel;
|
83
|
+
sku_list_promotion_rule?: SkuListPromotionRuleRel;
|
84
|
+
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel;
|
85
|
+
custom_promotion_rule?: CustomPromotionRuleRel;
|
86
|
+
sku_list: SkuListRel;
|
87
|
+
tags?: TagRel[];
|
88
|
+
}
|
89
|
+
interface BuyXPayYPromotionUpdate extends ResourceUpdate {
|
90
|
+
name?: string;
|
91
|
+
currency_code?: string;
|
92
|
+
exclusive?: boolean;
|
93
|
+
priority?: number;
|
94
|
+
starts_at?: string;
|
95
|
+
expires_at?: string;
|
96
|
+
total_usage_limit?: number;
|
97
|
+
_disable?: boolean;
|
98
|
+
_enable?: boolean;
|
99
|
+
x?: number;
|
100
|
+
y?: number;
|
101
|
+
cheapest_free?: boolean;
|
102
|
+
market?: MarketRel;
|
103
|
+
order_amount_promotion_rule?: OrderAmountPromotionRuleRel;
|
104
|
+
sku_list_promotion_rule?: SkuListPromotionRuleRel;
|
105
|
+
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel;
|
106
|
+
custom_promotion_rule?: CustomPromotionRuleRel;
|
107
|
+
sku_list?: SkuListRel;
|
108
|
+
tags?: TagRel[];
|
109
|
+
}
|
110
|
+
declare class BuyXPayYPromotions extends ApiResource {
|
111
|
+
static readonly TYPE: 'buy_x_pay_y_promotions';
|
112
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<BuyXPayYPromotion>>;
|
113
|
+
create(resource: BuyXPayYPromotionCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<BuyXPayYPromotion>;
|
114
|
+
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<BuyXPayYPromotion>;
|
115
|
+
update(resource: BuyXPayYPromotionUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<BuyXPayYPromotion>;
|
116
|
+
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
117
|
+
market(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
|
118
|
+
order_amount_promotion_rule(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
119
|
+
sku_list_promotion_rule(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
120
|
+
coupon_codes_promotion_rule(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
121
|
+
custom_promotion_rule(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
|
122
|
+
sku_list(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
123
|
+
coupons(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
|
124
|
+
attachments(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
125
|
+
events(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
126
|
+
tags(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
127
|
+
versions(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
128
|
+
skus(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Sku>>;
|
129
|
+
isBuyXPayYPromotion(resource: any): resource is BuyXPayYPromotion;
|
130
|
+
relationship(id: string | ResourceId | null): BuyXPayYPromotionRel;
|
131
|
+
type(): string;
|
132
|
+
}
|
133
|
+
export default BuyXPayYPromotions;
|
134
|
+
export { BuyXPayYPromotion, BuyXPayYPromotionCreate, BuyXPayYPromotionUpdate };
|
@@ -0,0 +1,79 @@
|
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
class BuyXPayYPromotions extends ApiResource {
|
3
|
+
// static readonly PATH = 'buy_x_pay_y_promotions'
|
4
|
+
async list(params, options) {
|
5
|
+
return this.resources.list({ type: BuyXPayYPromotions.TYPE }, params, options);
|
6
|
+
}
|
7
|
+
async create(resource, params, options) {
|
8
|
+
return this.resources.create(Object.assign(Object.assign({}, resource), { type: BuyXPayYPromotions.TYPE }), params, options);
|
9
|
+
}
|
10
|
+
async retrieve(id, params, options) {
|
11
|
+
return this.resources.retrieve({ type: BuyXPayYPromotions.TYPE, id }, params, options);
|
12
|
+
}
|
13
|
+
async update(resource, params, options) {
|
14
|
+
return this.resources.update(Object.assign(Object.assign({}, resource), { type: BuyXPayYPromotions.TYPE }), params, options);
|
15
|
+
}
|
16
|
+
async delete(id, options) {
|
17
|
+
await this.resources.delete({ type: BuyXPayYPromotions.TYPE, id }, options);
|
18
|
+
}
|
19
|
+
async market(buyXPayYPromotionId, params, options) {
|
20
|
+
const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
|
21
|
+
return this.resources.fetch({ type: 'markets' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/market`, params, options);
|
22
|
+
}
|
23
|
+
async order_amount_promotion_rule(buyXPayYPromotionId, params, options) {
|
24
|
+
const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
|
25
|
+
return this.resources.fetch({ type: 'order_amount_promotion_rules' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/order_amount_promotion_rule`, params, options);
|
26
|
+
}
|
27
|
+
async sku_list_promotion_rule(buyXPayYPromotionId, params, options) {
|
28
|
+
const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
|
29
|
+
return this.resources.fetch({ type: 'sku_list_promotion_rules' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/sku_list_promotion_rule`, params, options);
|
30
|
+
}
|
31
|
+
async coupon_codes_promotion_rule(buyXPayYPromotionId, params, options) {
|
32
|
+
const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
|
33
|
+
return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/coupon_codes_promotion_rule`, params, options);
|
34
|
+
}
|
35
|
+
async custom_promotion_rule(buyXPayYPromotionId, params, options) {
|
36
|
+
const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
|
37
|
+
return this.resources.fetch({ type: 'custom_promotion_rules' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/custom_promotion_rule`, params, options);
|
38
|
+
}
|
39
|
+
async sku_list(buyXPayYPromotionId, params, options) {
|
40
|
+
const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
|
41
|
+
return this.resources.fetch({ type: 'sku_lists' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/sku_list`, params, options);
|
42
|
+
}
|
43
|
+
async coupons(buyXPayYPromotionId, params, options) {
|
44
|
+
const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
|
45
|
+
return this.resources.fetch({ type: 'coupons' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/coupons`, params, options);
|
46
|
+
}
|
47
|
+
async attachments(buyXPayYPromotionId, params, options) {
|
48
|
+
const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
|
49
|
+
return this.resources.fetch({ type: 'attachments' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/attachments`, params, options);
|
50
|
+
}
|
51
|
+
async events(buyXPayYPromotionId, params, options) {
|
52
|
+
const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
|
53
|
+
return this.resources.fetch({ type: 'events' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/events`, params, options);
|
54
|
+
}
|
55
|
+
async tags(buyXPayYPromotionId, params, options) {
|
56
|
+
const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
|
57
|
+
return this.resources.fetch({ type: 'tags' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/tags`, params, options);
|
58
|
+
}
|
59
|
+
async versions(buyXPayYPromotionId, params, options) {
|
60
|
+
const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
|
61
|
+
return this.resources.fetch({ type: 'versions' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/versions`, params, options);
|
62
|
+
}
|
63
|
+
async skus(buyXPayYPromotionId, params, options) {
|
64
|
+
const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
|
65
|
+
return this.resources.fetch({ type: 'skus' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/skus`, params, options);
|
66
|
+
}
|
67
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
68
|
+
isBuyXPayYPromotion(resource) {
|
69
|
+
return resource.type && (resource.type === BuyXPayYPromotions.TYPE);
|
70
|
+
}
|
71
|
+
relationship(id) {
|
72
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: BuyXPayYPromotions.TYPE } : { id: id.id, type: BuyXPayYPromotions.TYPE };
|
73
|
+
}
|
74
|
+
type() {
|
75
|
+
return BuyXPayYPromotions.TYPE;
|
76
|
+
}
|
77
|
+
}
|
78
|
+
BuyXPayYPromotions.TYPE = 'buy_x_pay_y_promotions';
|
79
|
+
export default BuyXPayYPromotions;
|
@@ -1,9 +1,11 @@
|
|
1
1
|
import { ApiResource, Resource, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
|
2
2
|
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
3
|
import type { Order } from './orders';
|
4
|
+
import type { Attachment } from './attachments';
|
5
|
+
import type { Event } from './events';
|
6
|
+
import type { Version } from './versions';
|
4
7
|
import type { Authorization } from './authorizations';
|
5
8
|
import type { Refund } from './refunds';
|
6
|
-
import type { Event } from './events';
|
7
9
|
type CaptureRel = ResourceRel & {
|
8
10
|
type: typeof Captures.TYPE;
|
9
11
|
};
|
@@ -26,9 +28,11 @@ interface Capture extends Resource {
|
|
26
28
|
refund_balance_float?: number;
|
27
29
|
formatted_refund_balance?: string;
|
28
30
|
order?: Order;
|
31
|
+
attachments?: Attachment[];
|
32
|
+
events?: Event[];
|
33
|
+
versions?: Version[];
|
29
34
|
reference_authorization?: Authorization;
|
30
35
|
refunds?: Refund[];
|
31
|
-
events?: Event[];
|
32
36
|
}
|
33
37
|
interface CaptureUpdate extends ResourceUpdate {
|
34
38
|
_refund?: boolean;
|
@@ -40,9 +44,11 @@ declare class Captures extends ApiResource {
|
|
40
44
|
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Capture>;
|
41
45
|
update(resource: CaptureUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Capture>;
|
42
46
|
order(captureId: string | Capture, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
47
|
+
attachments(captureId: string | Capture, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
48
|
+
events(captureId: string | Capture, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
49
|
+
versions(captureId: string | Capture, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
43
50
|
reference_authorization(captureId: string | Capture, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Authorization>;
|
44
51
|
refunds(captureId: string | Capture, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Refund>>;
|
45
|
-
events(captureId: string | Capture, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
46
52
|
isCapture(resource: any): resource is Capture;
|
47
53
|
relationship(id: string | ResourceId | null): CaptureRel;
|
48
54
|
type(): string;
|
@@ -14,6 +14,18 @@ class Captures extends ApiResource {
|
|
14
14
|
const _captureId = captureId.id || captureId;
|
15
15
|
return this.resources.fetch({ type: 'orders' }, `captures/${_captureId}/order`, params, options);
|
16
16
|
}
|
17
|
+
async attachments(captureId, params, options) {
|
18
|
+
const _captureId = captureId.id || captureId;
|
19
|
+
return this.resources.fetch({ type: 'attachments' }, `captures/${_captureId}/attachments`, params, options);
|
20
|
+
}
|
21
|
+
async events(captureId, params, options) {
|
22
|
+
const _captureId = captureId.id || captureId;
|
23
|
+
return this.resources.fetch({ type: 'events' }, `captures/${_captureId}/events`, params, options);
|
24
|
+
}
|
25
|
+
async versions(captureId, params, options) {
|
26
|
+
const _captureId = captureId.id || captureId;
|
27
|
+
return this.resources.fetch({ type: 'versions' }, `captures/${_captureId}/versions`, params, options);
|
28
|
+
}
|
17
29
|
async reference_authorization(captureId, params, options) {
|
18
30
|
const _captureId = captureId.id || captureId;
|
19
31
|
return this.resources.fetch({ type: 'authorizations' }, `captures/${_captureId}/reference_authorization`, params, options);
|
@@ -22,10 +34,6 @@ class Captures extends ApiResource {
|
|
22
34
|
const _captureId = captureId.id || captureId;
|
23
35
|
return this.resources.fetch({ type: 'refunds' }, `captures/${_captureId}/refunds`, params, options);
|
24
36
|
}
|
25
|
-
async events(captureId, params, options) {
|
26
|
-
const _captureId = captureId.id || captureId;
|
27
|
-
return this.resources.fetch({ type: 'events' }, `captures/${_captureId}/events`, params, options);
|
28
|
-
}
|
29
37
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
30
38
|
isCapture(resource) {
|
31
39
|
return resource.type && (resource.type === Captures.TYPE);
|
@@ -2,6 +2,7 @@ import { ApiResource, Resource, ResourcesConfig, ResourceId, ResourceRel, ListRe
|
|
2
2
|
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
3
|
import type { Market } from './markets';
|
4
4
|
import type { Attachment } from './attachments';
|
5
|
+
import type { Version } from './versions';
|
5
6
|
type CarrierAccountRel = ResourceRel & {
|
6
7
|
type: typeof CarrierAccounts.TYPE;
|
7
8
|
};
|
@@ -11,6 +12,7 @@ interface CarrierAccount extends Resource {
|
|
11
12
|
easypost_id?: string;
|
12
13
|
market?: Market;
|
13
14
|
attachments?: Attachment[];
|
15
|
+
versions?: Version[];
|
14
16
|
}
|
15
17
|
declare class CarrierAccounts extends ApiResource {
|
16
18
|
static readonly TYPE: 'carrier_accounts';
|
@@ -18,6 +20,7 @@ declare class CarrierAccounts extends ApiResource {
|
|
18
20
|
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CarrierAccount>;
|
19
21
|
market(carrierAccountId: string | CarrierAccount, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
|
20
22
|
attachments(carrierAccountId: string | CarrierAccount, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
23
|
+
versions(carrierAccountId: string | CarrierAccount, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
21
24
|
isCarrierAccount(resource: any): resource is CarrierAccount;
|
22
25
|
relationship(id: string | ResourceId | null): CarrierAccountRel;
|
23
26
|
type(): string;
|
@@ -15,6 +15,10 @@ class CarrierAccounts extends ApiResource {
|
|
15
15
|
const _carrierAccountId = carrierAccountId.id || carrierAccountId;
|
16
16
|
return this.resources.fetch({ type: 'attachments' }, `carrier_accounts/${_carrierAccountId}/attachments`, params, options);
|
17
17
|
}
|
18
|
+
async versions(carrierAccountId, params, options) {
|
19
|
+
const _carrierAccountId = carrierAccountId.id || carrierAccountId;
|
20
|
+
return this.resources.fetch({ type: 'versions' }, `carrier_accounts/${_carrierAccountId}/versions`, params, options);
|
21
|
+
}
|
18
22
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
19
23
|
isCarrierAccount(resource) {
|
20
24
|
return resource.type && (resource.type === CarrierAccounts.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 { CheckoutComPayment } from './checkout_com_payments';
|
5
6
|
type CheckoutComGatewayRel = ResourceRel & {
|
6
7
|
type: typeof CheckoutComGateways.TYPE;
|
@@ -14,6 +15,7 @@ interface CheckoutComGateway extends Resource {
|
|
14
15
|
webhook_endpoint_secret?: string;
|
15
16
|
webhook_endpoint_url?: string;
|
16
17
|
payment_methods?: PaymentMethod[];
|
18
|
+
versions?: Version[];
|
17
19
|
checkout_com_payments?: CheckoutComPayment[];
|
18
20
|
}
|
19
21
|
interface CheckoutComGatewayCreate extends ResourceCreate {
|
@@ -36,6 +38,7 @@ declare class CheckoutComGateways extends ApiResource {
|
|
36
38
|
update(resource: CheckoutComGatewayUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CheckoutComGateway>;
|
37
39
|
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
38
40
|
payment_methods(checkoutComGatewayId: string | CheckoutComGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>>;
|
41
|
+
versions(checkoutComGatewayId: string | CheckoutComGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
39
42
|
checkout_com_payments(checkoutComGatewayId: string | CheckoutComGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<CheckoutComPayment>>;
|
40
43
|
isCheckoutComGateway(resource: any): resource is CheckoutComGateway;
|
41
44
|
relationship(id: string | ResourceId | null): CheckoutComGatewayRel;
|
@@ -20,6 +20,10 @@ class CheckoutComGateways extends ApiResource {
|
|
20
20
|
const _checkoutComGatewayId = checkoutComGatewayId.id || checkoutComGatewayId;
|
21
21
|
return this.resources.fetch({ type: 'payment_methods' }, `checkout_com_gateways/${_checkoutComGatewayId}/payment_methods`, params, options);
|
22
22
|
}
|
23
|
+
async versions(checkoutComGatewayId, params, options) {
|
24
|
+
const _checkoutComGatewayId = checkoutComGatewayId.id || checkoutComGatewayId;
|
25
|
+
return this.resources.fetch({ type: 'versions' }, `checkout_com_gateways/${_checkoutComGatewayId}/versions`, params, options);
|
26
|
+
}
|
23
27
|
async checkout_com_payments(checkoutComGatewayId, params, options) {
|
24
28
|
const _checkoutComGatewayId = checkoutComGatewayId.id || checkoutComGatewayId;
|
25
29
|
return this.resources.fetch({ type: 'checkout_com_payments' }, `checkout_com_gateways/${_checkoutComGatewayId}/checkout_com_payments`, params, options);
|
@@ -2,6 +2,7 @@ import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig,
|
|
2
2
|
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
3
|
import type { Order } from './orders';
|
4
4
|
import type { PaymentGateway } from './payment_gateways';
|
5
|
+
import type { Version } from './versions';
|
5
6
|
type CheckoutComPaymentRel = ResourceRel & {
|
6
7
|
type: typeof CheckoutComPayments.TYPE;
|
7
8
|
};
|
@@ -23,6 +24,7 @@ interface CheckoutComPayment extends Resource {
|
|
23
24
|
payment_instrument?: object;
|
24
25
|
order?: Order;
|
25
26
|
payment_gateway?: PaymentGateway;
|
27
|
+
versions?: Version[];
|
26
28
|
}
|
27
29
|
interface CheckoutComPaymentCreate extends ResourceCreate {
|
28
30
|
payment_type: string;
|
@@ -51,6 +53,7 @@ declare class CheckoutComPayments extends ApiResource {
|
|
51
53
|
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
52
54
|
order(checkoutComPaymentId: string | CheckoutComPayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
53
55
|
payment_gateway(checkoutComPaymentId: string | CheckoutComPayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentGateway>;
|
56
|
+
versions(checkoutComPaymentId: string | CheckoutComPayment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
54
57
|
isCheckoutComPayment(resource: any): resource is CheckoutComPayment;
|
55
58
|
relationship(id: string | ResourceId | null): CheckoutComPaymentRel;
|
56
59
|
type(): string;
|
@@ -24,6 +24,10 @@ class CheckoutComPayments extends ApiResource {
|
|
24
24
|
const _checkoutComPaymentId = checkoutComPaymentId.id || checkoutComPaymentId;
|
25
25
|
return this.resources.fetch({ type: 'payment_gateways' }, `checkout_com_payments/${_checkoutComPaymentId}/payment_gateway`, params, options);
|
26
26
|
}
|
27
|
+
async versions(checkoutComPaymentId, params, options) {
|
28
|
+
const _checkoutComPaymentId = checkoutComPaymentId.id || checkoutComPaymentId;
|
29
|
+
return this.resources.fetch({ type: 'versions' }, `checkout_com_payments/${_checkoutComPaymentId}/versions`, params, options);
|
30
|
+
}
|
27
31
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
28
32
|
isCheckoutComPayment(resource) {
|
29
33
|
return resource.type && (resource.type === CheckoutComPayments.TYPE);
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { ApiResource, Resource, ResourceCreate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
|
2
2
|
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
3
|
import type { Event } from './events';
|
4
|
+
import type { Version } from './versions';
|
4
5
|
type CleanupRel = ResourceRel & {
|
5
6
|
type: typeof Cleanups.TYPE;
|
6
7
|
};
|
@@ -16,6 +17,7 @@ interface Cleanup extends Resource {
|
|
16
17
|
processed_count?: number;
|
17
18
|
errors_log?: object;
|
18
19
|
events?: Event[];
|
20
|
+
versions?: Version[];
|
19
21
|
}
|
20
22
|
interface CleanupCreate extends ResourceCreate {
|
21
23
|
resource_type: string;
|
@@ -28,6 +30,7 @@ declare class Cleanups extends ApiResource {
|
|
28
30
|
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Cleanup>;
|
29
31
|
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
30
32
|
events(cleanupId: string | Cleanup, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
33
|
+
versions(cleanupId: string | Cleanup, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
31
34
|
isCleanup(resource: any): resource is Cleanup;
|
32
35
|
relationship(id: string | ResourceId | null): CleanupRel;
|
33
36
|
type(): string;
|
@@ -17,6 +17,10 @@ class Cleanups extends ApiResource {
|
|
17
17
|
const _cleanupId = cleanupId.id || cleanupId;
|
18
18
|
return this.resources.fetch({ type: 'events' }, `cleanups/${_cleanupId}/events`, params, options);
|
19
19
|
}
|
20
|
+
async versions(cleanupId, params, options) {
|
21
|
+
const _cleanupId = cleanupId.id || cleanupId;
|
22
|
+
return this.resources.fetch({ type: 'versions' }, `cleanups/${_cleanupId}/versions`, params, options);
|
23
|
+
}
|
20
24
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
21
25
|
isCleanup(resource) {
|
22
26
|
return resource.type && (resource.type === Cleanups.TYPE);
|
@@ -2,10 +2,12 @@ import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig,
|
|
2
2
|
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
3
|
import type { PercentageDiscountPromotion } from './percentage_discount_promotions';
|
4
4
|
import type { FreeShippingPromotion } from './free_shipping_promotions';
|
5
|
+
import type { BuyXPayYPromotion } from './buy_x_pay_y_promotions';
|
5
6
|
import type { FreeGiftPromotion } from './free_gift_promotions';
|
6
7
|
import type { FixedPricePromotion } from './fixed_price_promotions';
|
7
8
|
import type { ExternalPromotion } from './external_promotions';
|
8
9
|
import type { FixedAmountPromotion } from './fixed_amount_promotions';
|
10
|
+
import type { Version } from './versions';
|
9
11
|
import type { Coupon } from './coupons';
|
10
12
|
type CouponCodesPromotionRuleRel = ResourceRel & {
|
11
13
|
type: typeof CouponCodesPromotionRules.TYPE;
|
@@ -16,6 +18,9 @@ type PercentageDiscountPromotionRel = ResourceRel & {
|
|
16
18
|
type FreeShippingPromotionRel = ResourceRel & {
|
17
19
|
type: 'free_shipping_promotions';
|
18
20
|
};
|
21
|
+
type BuyXPayYPromotionRel = ResourceRel & {
|
22
|
+
type: 'buy_x_pay_y_promotions';
|
23
|
+
};
|
19
24
|
type FreeGiftPromotionRel = ResourceRel & {
|
20
25
|
type: 'free_gift_promotions';
|
21
26
|
};
|
@@ -32,15 +37,16 @@ type CouponRel = ResourceRel & {
|
|
32
37
|
type: 'coupons';
|
33
38
|
};
|
34
39
|
interface CouponCodesPromotionRule extends Resource {
|
35
|
-
promotion?: PercentageDiscountPromotion | FreeShippingPromotion | FreeGiftPromotion | FixedPricePromotion | ExternalPromotion | FixedAmountPromotion;
|
40
|
+
promotion?: PercentageDiscountPromotion | FreeShippingPromotion | BuyXPayYPromotion | FreeGiftPromotion | FixedPricePromotion | ExternalPromotion | FixedAmountPromotion;
|
41
|
+
versions?: Version[];
|
36
42
|
coupons?: Coupon[];
|
37
43
|
}
|
38
44
|
interface CouponCodesPromotionRuleCreate extends ResourceCreate {
|
39
|
-
promotion: PercentageDiscountPromotionRel | FreeShippingPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel | FixedAmountPromotionRel;
|
45
|
+
promotion: PercentageDiscountPromotionRel | FreeShippingPromotionRel | BuyXPayYPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel | FixedAmountPromotionRel;
|
40
46
|
coupons?: CouponRel[];
|
41
47
|
}
|
42
48
|
interface CouponCodesPromotionRuleUpdate extends ResourceUpdate {
|
43
|
-
promotion?: PercentageDiscountPromotionRel | FreeShippingPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel | FixedAmountPromotionRel;
|
49
|
+
promotion?: PercentageDiscountPromotionRel | FreeShippingPromotionRel | BuyXPayYPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel | FixedAmountPromotionRel;
|
44
50
|
coupons?: CouponRel[];
|
45
51
|
}
|
46
52
|
declare class CouponCodesPromotionRules extends ApiResource {
|
@@ -50,6 +56,7 @@ declare class CouponCodesPromotionRules extends ApiResource {
|
|
50
56
|
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
51
57
|
update(resource: CouponCodesPromotionRuleUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
52
58
|
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
59
|
+
versions(couponCodesPromotionRuleId: string | CouponCodesPromotionRule, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
53
60
|
coupons(couponCodesPromotionRuleId: string | CouponCodesPromotionRule, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
|
54
61
|
isCouponCodesPromotionRule(resource: any): resource is CouponCodesPromotionRule;
|
55
62
|
relationship(id: string | ResourceId | null): CouponCodesPromotionRuleRel;
|
@@ -16,6 +16,10 @@ class CouponCodesPromotionRules extends ApiResource {
|
|
16
16
|
async delete(id, options) {
|
17
17
|
await this.resources.delete({ type: CouponCodesPromotionRules.TYPE, id }, options);
|
18
18
|
}
|
19
|
+
async versions(couponCodesPromotionRuleId, params, options) {
|
20
|
+
const _couponCodesPromotionRuleId = couponCodesPromotionRuleId.id || couponCodesPromotionRuleId;
|
21
|
+
return this.resources.fetch({ type: 'versions' }, `coupon_codes_promotion_rules/${_couponCodesPromotionRuleId}/versions`, params, options);
|
22
|
+
}
|
19
23
|
async coupons(couponCodesPromotionRuleId, params, options) {
|
20
24
|
const _couponCodesPromotionRuleId = couponCodesPromotionRuleId.id || couponCodesPromotionRuleId;
|
21
25
|
return this.resources.fetch({ type: 'coupons' }, `coupon_codes_promotion_rules/${_couponCodesPromotionRuleId}/coupons`, params, options);
|
@@ -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 { Attachment } from './attachments';
|
5
|
+
import type { Version } from './versions';
|
5
6
|
type CouponRecipientRel = ResourceRel & {
|
6
7
|
type: typeof CouponRecipients.TYPE;
|
7
8
|
};
|
@@ -14,6 +15,7 @@ interface CouponRecipient extends Resource {
|
|
14
15
|
last_name?: string;
|
15
16
|
customer?: Customer;
|
16
17
|
attachments?: Attachment[];
|
18
|
+
versions?: Version[];
|
17
19
|
}
|
18
20
|
interface CouponRecipientCreate extends ResourceCreate {
|
19
21
|
email: string;
|
@@ -36,6 +38,7 @@ declare class CouponRecipients extends ApiResource {
|
|
36
38
|
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
37
39
|
customer(couponRecipientId: string | CouponRecipient, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Customer>;
|
38
40
|
attachments(couponRecipientId: string | CouponRecipient, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
41
|
+
versions(couponRecipientId: string | CouponRecipient, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
39
42
|
isCouponRecipient(resource: any): resource is CouponRecipient;
|
40
43
|
relationship(id: string | ResourceId | null): CouponRecipientRel;
|
41
44
|
type(): string;
|
@@ -24,6 +24,10 @@ class CouponRecipients extends ApiResource {
|
|
24
24
|
const _couponRecipientId = couponRecipientId.id || couponRecipientId;
|
25
25
|
return this.resources.fetch({ type: 'attachments' }, `coupon_recipients/${_couponRecipientId}/attachments`, params, options);
|
26
26
|
}
|
27
|
+
async versions(couponRecipientId, params, options) {
|
28
|
+
const _couponRecipientId = couponRecipientId.id || couponRecipientId;
|
29
|
+
return this.resources.fetch({ type: 'versions' }, `coupon_recipients/${_couponRecipientId}/versions`, params, options);
|
30
|
+
}
|
27
31
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
28
32
|
isCouponRecipient(resource) {
|
29
33
|
return resource.type && (resource.type === CouponRecipients.TYPE);
|