@commercelayer/sdk 4.27.0 → 4.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/api.d.ts +23 -2
- package/lib/cjs/api.js +4 -14
- package/lib/cjs/client.d.ts +3 -5
- package/lib/cjs/client.js +11 -8
- package/lib/cjs/commercelayer.d.ts +6 -5
- package/lib/cjs/commercelayer.js +4 -3
- package/lib/cjs/common.d.ts +1 -0
- package/lib/cjs/common.js +11 -2
- package/lib/cjs/config.d.ts +1 -0
- package/lib/cjs/config.js +1 -0
- package/lib/cjs/debug.js +0 -4
- package/lib/cjs/error.js +1 -4
- package/lib/cjs/index.d.ts +1 -1
- package/lib/cjs/index.js +0 -16
- package/lib/cjs/interceptor.d.ts +6 -2
- package/lib/cjs/jsonapi.js +5 -1
- package/lib/cjs/micro.d.ts +4 -0
- package/lib/cjs/micro.js +13 -0
- package/lib/cjs/model.d.ts +1 -0
- package/lib/cjs/query.d.ts +9 -15
- package/lib/cjs/query.js +3 -2
- package/lib/cjs/resource.d.ts +33 -25
- package/lib/cjs/resource.js +34 -9
- package/lib/cjs/resources/addresses.d.ts +78 -66
- package/lib/cjs/resources/addresses.js +11 -11
- package/lib/cjs/resources/adjustments.d.ts +19 -18
- package/lib/cjs/resources/adjustments.js +3 -11
- package/lib/cjs/resources/adyen_gateways.d.ts +34 -33
- package/lib/cjs/resources/adyen_gateways.js +3 -11
- package/lib/cjs/resources/adyen_payments.d.ts +27 -26
- package/lib/cjs/resources/adyen_payments.js +3 -11
- package/lib/cjs/resources/application.d.ts +14 -13
- package/lib/cjs/resources/application.js +1 -6
- package/lib/cjs/resources/attachments.d.ts +81 -80
- package/lib/cjs/resources/attachments.js +3 -11
- package/lib/cjs/resources/authorizations.d.ts +42 -41
- package/lib/cjs/resources/authorizations.js +1 -9
- package/lib/cjs/resources/avalara_accounts.d.ts +31 -30
- package/lib/cjs/resources/avalara_accounts.js +3 -11
- package/lib/cjs/resources/axerve_gateways.d.ts +22 -21
- package/lib/cjs/resources/axerve_gateways.js +3 -11
- package/lib/cjs/resources/axerve_payments.d.ts +26 -25
- package/lib/cjs/resources/axerve_payments.js +3 -11
- package/lib/cjs/resources/billing_info_validation_rules.d.ts +16 -15
- package/lib/cjs/resources/billing_info_validation_rules.js +3 -11
- package/lib/cjs/resources/bing_geocoders.d.ts +16 -15
- package/lib/cjs/resources/bing_geocoders.js +3 -11
- package/lib/cjs/resources/braintree_gateways.d.ts +33 -32
- package/lib/cjs/resources/braintree_gateways.js +3 -11
- package/lib/cjs/resources/braintree_payments.d.ts +29 -28
- package/lib/cjs/resources/braintree_payments.js +3 -11
- package/lib/cjs/resources/bundles.d.ts +59 -47
- package/lib/cjs/resources/bundles.js +11 -11
- package/lib/cjs/resources/captures.d.ts +33 -32
- package/lib/cjs/resources/captures.js +1 -9
- package/lib/cjs/resources/carrier_accounts.d.ts +15 -14
- package/lib/cjs/resources/carrier_accounts.js +0 -8
- package/lib/cjs/resources/checkout_com_gateways.d.ts +24 -23
- package/lib/cjs/resources/checkout_com_gateways.js +3 -11
- package/lib/cjs/resources/checkout_com_payments.d.ts +38 -37
- package/lib/cjs/resources/checkout_com_payments.js +3 -11
- package/lib/cjs/resources/cleanups.d.ts +23 -22
- package/lib/cjs/resources/cleanups.js +2 -10
- package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +30 -29
- package/lib/cjs/resources/coupon_codes_promotion_rules.js +3 -11
- package/lib/cjs/resources/coupon_recipients.d.ts +25 -24
- package/lib/cjs/resources/coupon_recipients.js +3 -11
- package/lib/cjs/resources/coupons.d.ts +38 -26
- package/lib/cjs/resources/coupons.js +11 -11
- package/lib/cjs/resources/customer_addresses.d.ts +21 -20
- package/lib/cjs/resources/customer_addresses.js +3 -11
- package/lib/cjs/resources/customer_groups.d.ts +16 -15
- package/lib/cjs/resources/customer_groups.js +3 -11
- package/lib/cjs/resources/customer_password_resets.d.ts +18 -17
- package/lib/cjs/resources/customer_password_resets.js +3 -11
- package/lib/cjs/resources/customer_payment_sources.d.ts +40 -39
- package/lib/cjs/resources/customer_payment_sources.js +3 -11
- package/lib/cjs/resources/customer_subscriptions.d.ts +14 -13
- package/lib/cjs/resources/customer_subscriptions.js +3 -11
- package/lib/cjs/resources/customers.d.ts +39 -30
- package/lib/cjs/resources/customers.js +7 -11
- package/lib/cjs/resources/delivery_lead_times.d.ts +26 -25
- package/lib/cjs/resources/delivery_lead_times.js +3 -11
- package/lib/cjs/resources/event_callbacks.d.ts +15 -14
- package/lib/cjs/resources/event_callbacks.js +0 -8
- package/lib/cjs/resources/events.d.ts +13 -12
- package/lib/cjs/resources/events.js +0 -8
- package/lib/cjs/resources/exports.d.ts +27 -26
- package/lib/cjs/resources/exports.js +2 -10
- package/lib/cjs/resources/external_gateways.d.ts +31 -30
- package/lib/cjs/resources/external_gateways.js +3 -11
- package/lib/cjs/resources/external_payments.d.ts +22 -21
- package/lib/cjs/resources/external_payments.js +3 -11
- package/lib/cjs/resources/external_promotions.d.ts +62 -53
- package/lib/cjs/resources/external_promotions.js +7 -11
- package/lib/cjs/resources/external_tax_calculators.d.ts +18 -17
- package/lib/cjs/resources/external_tax_calculators.js +3 -11
- package/lib/cjs/resources/fixed_amount_promotions.d.ts +63 -54
- package/lib/cjs/resources/fixed_amount_promotions.js +7 -11
- package/lib/cjs/resources/fixed_price_promotions.d.ts +68 -59
- package/lib/cjs/resources/fixed_price_promotions.js +7 -11
- package/lib/cjs/resources/free_gift_promotions.d.ts +67 -58
- package/lib/cjs/resources/free_gift_promotions.js +7 -11
- package/lib/cjs/resources/free_shipping_promotions.d.ts +59 -50
- package/lib/cjs/resources/free_shipping_promotions.js +7 -11
- package/lib/cjs/resources/geocoders.d.ts +13 -12
- package/lib/cjs/resources/geocoders.js +0 -8
- package/lib/cjs/resources/gift_card_recipients.d.ts +25 -24
- package/lib/cjs/resources/gift_card_recipients.js +3 -11
- package/lib/cjs/resources/gift_cards.d.ts +69 -60
- package/lib/cjs/resources/gift_cards.js +7 -11
- package/lib/cjs/resources/google_geocoders.d.ts +16 -15
- package/lib/cjs/resources/google_geocoders.js +3 -11
- package/lib/cjs/resources/imports.d.ts +32 -31
- package/lib/cjs/resources/imports.js +2 -10
- package/lib/cjs/resources/in_stock_subscriptions.d.ts +35 -34
- package/lib/cjs/resources/in_stock_subscriptions.js +3 -11
- package/lib/cjs/resources/inventory_models.d.ts +22 -21
- package/lib/cjs/resources/inventory_models.js +3 -11
- package/lib/cjs/resources/inventory_return_locations.d.ts +21 -20
- package/lib/cjs/resources/inventory_return_locations.js +3 -11
- package/lib/cjs/resources/inventory_stock_locations.d.ts +24 -23
- package/lib/cjs/resources/inventory_stock_locations.js +3 -11
- package/lib/cjs/resources/klarna_gateways.d.ts +22 -21
- package/lib/cjs/resources/klarna_gateways.js +3 -11
- package/lib/cjs/resources/klarna_payments.d.ts +27 -26
- package/lib/cjs/resources/klarna_payments.js +3 -11
- package/lib/cjs/resources/line_item_options.d.ts +46 -34
- package/lib/cjs/resources/line_item_options.js +11 -11
- package/lib/cjs/resources/line_items.d.ts +92 -80
- package/lib/cjs/resources/line_items.js +11 -11
- package/lib/cjs/resources/manual_gateways.d.ts +14 -13
- package/lib/cjs/resources/manual_gateways.js +3 -11
- package/lib/cjs/resources/manual_tax_calculators.d.ts +20 -19
- package/lib/cjs/resources/manual_tax_calculators.js +3 -11
- package/lib/cjs/resources/markets.d.ts +59 -58
- package/lib/cjs/resources/markets.js +3 -11
- package/lib/cjs/resources/merchants.d.ts +18 -17
- package/lib/cjs/resources/merchants.js +3 -11
- package/lib/cjs/resources/order_amount_promotion_rules.d.ts +30 -29
- package/lib/cjs/resources/order_amount_promotion_rules.js +3 -11
- package/lib/cjs/resources/order_copies.d.ts +29 -28
- package/lib/cjs/resources/order_copies.js +3 -11
- package/lib/cjs/resources/order_factories.d.ts +21 -20
- package/lib/cjs/resources/order_factories.js +0 -8
- package/lib/cjs/resources/order_subscription_items.d.ts +35 -34
- package/lib/cjs/resources/order_subscription_items.js +3 -11
- package/lib/cjs/resources/order_subscriptions.d.ts +51 -50
- package/lib/cjs/resources/order_subscriptions.js +3 -11
- package/lib/cjs/resources/order_validation_rules.d.ts +12 -11
- package/lib/cjs/resources/order_validation_rules.js +0 -8
- package/lib/cjs/resources/orders.d.ts +233 -224
- package/lib/cjs/resources/orders.js +7 -11
- package/lib/cjs/resources/organization.d.ts +25 -24
- package/lib/cjs/resources/organization.js +1 -6
- package/lib/cjs/resources/packages.d.ts +30 -29
- package/lib/cjs/resources/packages.js +3 -11
- package/lib/cjs/resources/parcel_line_items.d.ts +22 -21
- package/lib/cjs/resources/parcel_line_items.js +3 -11
- package/lib/cjs/resources/parcels.d.ts +93 -89
- package/lib/cjs/resources/parcels.js +3 -11
- package/lib/cjs/resources/payment_gateways.d.ts +12 -11
- package/lib/cjs/resources/payment_gateways.js +0 -8
- package/lib/cjs/resources/payment_methods.d.ts +48 -47
- package/lib/cjs/resources/payment_methods.js +3 -11
- package/lib/cjs/resources/paypal_gateways.d.ts +17 -16
- package/lib/cjs/resources/paypal_gateways.js +3 -11
- package/lib/cjs/resources/paypal_payments.d.ts +31 -30
- package/lib/cjs/resources/paypal_payments.js +3 -11
- package/lib/cjs/resources/percentage_discount_promotions.d.ts +67 -58
- package/lib/cjs/resources/percentage_discount_promotions.js +7 -11
- package/lib/cjs/resources/price_frequency_tiers.d.ts +26 -25
- package/lib/cjs/resources/price_frequency_tiers.js +3 -11
- package/lib/cjs/resources/price_lists.d.ts +20 -19
- package/lib/cjs/resources/price_lists.js +3 -11
- package/lib/cjs/resources/price_tiers.d.ts +17 -16
- package/lib/cjs/resources/price_tiers.js +0 -8
- package/lib/cjs/resources/price_volume_tiers.d.ts +26 -25
- package/lib/cjs/resources/price_volume_tiers.js +3 -11
- package/lib/cjs/resources/prices.d.ts +39 -38
- package/lib/cjs/resources/prices.js +3 -11
- package/lib/cjs/resources/promotion_rules.d.ts +10 -10
- package/lib/cjs/resources/promotion_rules.js +0 -8
- package/lib/cjs/resources/promotions.d.ts +27 -23
- package/lib/cjs/resources/promotions.js +4 -8
- package/lib/cjs/resources/recurring_order_copies.d.ts +29 -28
- package/lib/cjs/resources/recurring_order_copies.js +3 -11
- package/lib/cjs/resources/refunds.d.ts +24 -23
- package/lib/cjs/resources/refunds.js +0 -8
- package/lib/cjs/resources/return_line_items.d.ts +27 -26
- package/lib/cjs/resources/return_line_items.js +3 -11
- package/lib/cjs/resources/returns.d.ts +52 -43
- package/lib/cjs/resources/returns.js +7 -11
- package/lib/cjs/resources/satispay_gateways.d.ts +23 -19
- package/lib/cjs/resources/satispay_gateways.js +3 -11
- package/lib/cjs/resources/satispay_payments.d.ts +21 -23
- package/lib/cjs/resources/satispay_payments.js +3 -11
- package/lib/cjs/resources/shipments.d.ts +52 -51
- package/lib/cjs/resources/shipments.js +1 -9
- package/lib/cjs/resources/shipping_categories.d.ts +15 -14
- package/lib/cjs/resources/shipping_categories.js +3 -11
- package/lib/cjs/resources/shipping_method_tiers.d.ts +17 -16
- package/lib/cjs/resources/shipping_method_tiers.js +0 -8
- package/lib/cjs/resources/shipping_methods.d.ts +71 -70
- package/lib/cjs/resources/shipping_methods.js +3 -11
- package/lib/cjs/resources/shipping_weight_tiers.d.ts +25 -24
- package/lib/cjs/resources/shipping_weight_tiers.js +3 -11
- package/lib/cjs/resources/shipping_zones.d.ts +32 -31
- package/lib/cjs/resources/shipping_zones.js +3 -11
- package/lib/cjs/resources/sku_list_items.d.ts +26 -25
- package/lib/cjs/resources/sku_list_items.js +3 -11
- package/lib/cjs/resources/sku_list_promotion_rules.d.ts +37 -36
- package/lib/cjs/resources/sku_list_promotion_rules.js +3 -11
- package/lib/cjs/resources/sku_lists.d.ts +35 -34
- package/lib/cjs/resources/sku_lists.js +3 -11
- package/lib/cjs/resources/sku_options.d.ts +48 -36
- package/lib/cjs/resources/sku_options.js +11 -11
- package/lib/cjs/resources/skus.d.ts +60 -48
- package/lib/cjs/resources/skus.js +11 -11
- package/lib/cjs/resources/stock_items.d.ts +26 -25
- package/lib/cjs/resources/stock_items.js +3 -11
- package/lib/cjs/resources/stock_line_items.d.ts +16 -15
- package/lib/cjs/resources/stock_line_items.js +0 -8
- package/lib/cjs/resources/stock_locations.d.ts +29 -28
- package/lib/cjs/resources/stock_locations.js +3 -11
- package/lib/cjs/resources/stock_transfers.d.ts +42 -41
- package/lib/cjs/resources/stock_transfers.js +3 -11
- package/lib/cjs/resources/stripe_gateways.d.ts +22 -21
- package/lib/cjs/resources/stripe_gateways.js +3 -11
- package/lib/cjs/resources/stripe_payments.d.ts +28 -27
- package/lib/cjs/resources/stripe_payments.js +3 -11
- package/lib/cjs/resources/subscription_models.d.ts +27 -26
- package/lib/cjs/resources/subscription_models.js +3 -11
- package/lib/cjs/resources/tags.d.ts +28 -0
- package/lib/cjs/resources/tags.js +25 -0
- package/lib/cjs/resources/tax_calculators.d.ts +13 -12
- package/lib/cjs/resources/tax_calculators.js +0 -8
- package/lib/cjs/resources/tax_categories.d.ts +30 -29
- package/lib/cjs/resources/tax_categories.js +3 -11
- package/lib/cjs/resources/tax_rules.d.ts +51 -50
- package/lib/cjs/resources/tax_rules.js +3 -11
- package/lib/cjs/resources/taxjar_accounts.d.ts +21 -20
- package/lib/cjs/resources/taxjar_accounts.js +3 -11
- package/lib/cjs/resources/transactions.d.ts +22 -21
- package/lib/cjs/resources/transactions.js +0 -8
- package/lib/cjs/resources/voids.d.ts +24 -23
- package/lib/cjs/resources/voids.js +0 -8
- package/lib/cjs/resources/webhooks.d.ts +26 -25
- package/lib/cjs/resources/webhooks.js +3 -11
- package/lib/cjs/resources/wire_transfers.d.ts +16 -15
- package/lib/cjs/resources/wire_transfers.js +3 -11
- package/lib/cjs/static.d.ts +1 -1
- package/lib/cjs/util.d.ts +1 -3
- package/lib/esm/api.d.ts +23 -2
- package/lib/esm/api.js +2 -13
- package/lib/esm/client.d.ts +3 -5
- package/lib/esm/client.js +11 -8
- package/lib/esm/commercelayer.d.ts +6 -5
- package/lib/esm/commercelayer.js +4 -3
- package/lib/esm/common.d.ts +1 -0
- package/lib/esm/common.js +11 -2
- package/lib/esm/config.d.ts +1 -0
- package/lib/esm/config.js +1 -0
- package/lib/esm/debug.js +0 -4
- package/lib/esm/error.js +1 -4
- package/lib/esm/index.d.ts +1 -1
- package/lib/esm/index.js +0 -2
- package/lib/esm/interceptor.d.ts +6 -2
- package/lib/esm/jsonapi.js +5 -1
- package/lib/esm/micro.d.ts +4 -0
- package/lib/esm/micro.js +7 -0
- package/lib/esm/model.d.ts +1 -0
- package/lib/esm/query.d.ts +9 -15
- package/lib/esm/query.js +2 -2
- package/lib/esm/resource.d.ts +33 -25
- package/lib/esm/resource.js +34 -10
- package/lib/esm/resources/addresses.d.ts +78 -66
- package/lib/esm/resources/addresses.js +11 -11
- package/lib/esm/resources/adjustments.d.ts +19 -18
- package/lib/esm/resources/adjustments.js +3 -11
- package/lib/esm/resources/adyen_gateways.d.ts +34 -33
- package/lib/esm/resources/adyen_gateways.js +3 -11
- package/lib/esm/resources/adyen_payments.d.ts +27 -26
- package/lib/esm/resources/adyen_payments.js +3 -11
- package/lib/esm/resources/application.d.ts +14 -13
- package/lib/esm/resources/application.js +2 -7
- package/lib/esm/resources/attachments.d.ts +81 -80
- package/lib/esm/resources/attachments.js +3 -11
- package/lib/esm/resources/authorizations.d.ts +42 -41
- package/lib/esm/resources/authorizations.js +1 -9
- package/lib/esm/resources/avalara_accounts.d.ts +31 -30
- package/lib/esm/resources/avalara_accounts.js +3 -11
- package/lib/esm/resources/axerve_gateways.d.ts +22 -21
- package/lib/esm/resources/axerve_gateways.js +3 -11
- package/lib/esm/resources/axerve_payments.d.ts +26 -25
- package/lib/esm/resources/axerve_payments.js +3 -11
- package/lib/esm/resources/billing_info_validation_rules.d.ts +16 -15
- package/lib/esm/resources/billing_info_validation_rules.js +3 -11
- package/lib/esm/resources/bing_geocoders.d.ts +16 -15
- package/lib/esm/resources/bing_geocoders.js +3 -11
- package/lib/esm/resources/braintree_gateways.d.ts +33 -32
- package/lib/esm/resources/braintree_gateways.js +3 -11
- package/lib/esm/resources/braintree_payments.d.ts +29 -28
- package/lib/esm/resources/braintree_payments.js +3 -11
- package/lib/esm/resources/bundles.d.ts +59 -47
- package/lib/esm/resources/bundles.js +11 -11
- package/lib/esm/resources/captures.d.ts +33 -32
- package/lib/esm/resources/captures.js +1 -9
- package/lib/esm/resources/carrier_accounts.d.ts +15 -14
- package/lib/esm/resources/carrier_accounts.js +0 -8
- package/lib/esm/resources/checkout_com_gateways.d.ts +24 -23
- package/lib/esm/resources/checkout_com_gateways.js +3 -11
- package/lib/esm/resources/checkout_com_payments.d.ts +38 -37
- package/lib/esm/resources/checkout_com_payments.js +3 -11
- package/lib/esm/resources/cleanups.d.ts +23 -22
- package/lib/esm/resources/cleanups.js +2 -10
- package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +30 -29
- package/lib/esm/resources/coupon_codes_promotion_rules.js +3 -11
- package/lib/esm/resources/coupon_recipients.d.ts +25 -24
- package/lib/esm/resources/coupon_recipients.js +3 -11
- package/lib/esm/resources/coupons.d.ts +38 -26
- package/lib/esm/resources/coupons.js +11 -11
- package/lib/esm/resources/customer_addresses.d.ts +21 -20
- package/lib/esm/resources/customer_addresses.js +3 -11
- package/lib/esm/resources/customer_groups.d.ts +16 -15
- package/lib/esm/resources/customer_groups.js +3 -11
- package/lib/esm/resources/customer_password_resets.d.ts +18 -17
- package/lib/esm/resources/customer_password_resets.js +3 -11
- package/lib/esm/resources/customer_payment_sources.d.ts +40 -39
- package/lib/esm/resources/customer_payment_sources.js +3 -11
- package/lib/esm/resources/customer_subscriptions.d.ts +14 -13
- package/lib/esm/resources/customer_subscriptions.js +3 -11
- package/lib/esm/resources/customers.d.ts +39 -30
- package/lib/esm/resources/customers.js +7 -11
- package/lib/esm/resources/delivery_lead_times.d.ts +26 -25
- package/lib/esm/resources/delivery_lead_times.js +3 -11
- package/lib/esm/resources/event_callbacks.d.ts +15 -14
- package/lib/esm/resources/event_callbacks.js +0 -8
- package/lib/esm/resources/events.d.ts +13 -12
- package/lib/esm/resources/events.js +0 -8
- package/lib/esm/resources/exports.d.ts +27 -26
- package/lib/esm/resources/exports.js +2 -10
- package/lib/esm/resources/external_gateways.d.ts +31 -30
- package/lib/esm/resources/external_gateways.js +3 -11
- package/lib/esm/resources/external_payments.d.ts +22 -21
- package/lib/esm/resources/external_payments.js +3 -11
- package/lib/esm/resources/external_promotions.d.ts +62 -53
- package/lib/esm/resources/external_promotions.js +7 -11
- package/lib/esm/resources/external_tax_calculators.d.ts +18 -17
- package/lib/esm/resources/external_tax_calculators.js +3 -11
- package/lib/esm/resources/fixed_amount_promotions.d.ts +63 -54
- package/lib/esm/resources/fixed_amount_promotions.js +7 -11
- package/lib/esm/resources/fixed_price_promotions.d.ts +68 -59
- package/lib/esm/resources/fixed_price_promotions.js +7 -11
- package/lib/esm/resources/free_gift_promotions.d.ts +67 -58
- package/lib/esm/resources/free_gift_promotions.js +7 -11
- package/lib/esm/resources/free_shipping_promotions.d.ts +59 -50
- package/lib/esm/resources/free_shipping_promotions.js +7 -11
- package/lib/esm/resources/geocoders.d.ts +13 -12
- package/lib/esm/resources/geocoders.js +0 -8
- package/lib/esm/resources/gift_card_recipients.d.ts +25 -24
- package/lib/esm/resources/gift_card_recipients.js +3 -11
- package/lib/esm/resources/gift_cards.d.ts +69 -60
- package/lib/esm/resources/gift_cards.js +7 -11
- package/lib/esm/resources/google_geocoders.d.ts +16 -15
- package/lib/esm/resources/google_geocoders.js +3 -11
- package/lib/esm/resources/imports.d.ts +32 -31
- package/lib/esm/resources/imports.js +2 -10
- package/lib/esm/resources/in_stock_subscriptions.d.ts +35 -34
- package/lib/esm/resources/in_stock_subscriptions.js +3 -11
- package/lib/esm/resources/inventory_models.d.ts +22 -21
- package/lib/esm/resources/inventory_models.js +3 -11
- package/lib/esm/resources/inventory_return_locations.d.ts +21 -20
- package/lib/esm/resources/inventory_return_locations.js +3 -11
- package/lib/esm/resources/inventory_stock_locations.d.ts +24 -23
- package/lib/esm/resources/inventory_stock_locations.js +3 -11
- package/lib/esm/resources/klarna_gateways.d.ts +22 -21
- package/lib/esm/resources/klarna_gateways.js +3 -11
- package/lib/esm/resources/klarna_payments.d.ts +27 -26
- package/lib/esm/resources/klarna_payments.js +3 -11
- package/lib/esm/resources/line_item_options.d.ts +46 -34
- package/lib/esm/resources/line_item_options.js +11 -11
- package/lib/esm/resources/line_items.d.ts +92 -80
- package/lib/esm/resources/line_items.js +11 -11
- package/lib/esm/resources/manual_gateways.d.ts +14 -13
- package/lib/esm/resources/manual_gateways.js +3 -11
- package/lib/esm/resources/manual_tax_calculators.d.ts +20 -19
- package/lib/esm/resources/manual_tax_calculators.js +3 -11
- package/lib/esm/resources/markets.d.ts +59 -58
- package/lib/esm/resources/markets.js +3 -11
- package/lib/esm/resources/merchants.d.ts +18 -17
- package/lib/esm/resources/merchants.js +3 -11
- package/lib/esm/resources/order_amount_promotion_rules.d.ts +30 -29
- package/lib/esm/resources/order_amount_promotion_rules.js +3 -11
- package/lib/esm/resources/order_copies.d.ts +29 -28
- package/lib/esm/resources/order_copies.js +3 -11
- package/lib/esm/resources/order_factories.d.ts +21 -20
- package/lib/esm/resources/order_factories.js +0 -8
- package/lib/esm/resources/order_subscription_items.d.ts +35 -34
- package/lib/esm/resources/order_subscription_items.js +3 -11
- package/lib/esm/resources/order_subscriptions.d.ts +51 -50
- package/lib/esm/resources/order_subscriptions.js +3 -11
- package/lib/esm/resources/order_validation_rules.d.ts +12 -11
- package/lib/esm/resources/order_validation_rules.js +0 -8
- package/lib/esm/resources/orders.d.ts +233 -224
- package/lib/esm/resources/orders.js +7 -11
- package/lib/esm/resources/organization.d.ts +25 -24
- package/lib/esm/resources/organization.js +2 -7
- package/lib/esm/resources/packages.d.ts +30 -29
- package/lib/esm/resources/packages.js +3 -11
- package/lib/esm/resources/parcel_line_items.d.ts +22 -21
- package/lib/esm/resources/parcel_line_items.js +3 -11
- package/lib/esm/resources/parcels.d.ts +93 -89
- package/lib/esm/resources/parcels.js +3 -11
- package/lib/esm/resources/payment_gateways.d.ts +12 -11
- package/lib/esm/resources/payment_gateways.js +0 -8
- package/lib/esm/resources/payment_methods.d.ts +48 -47
- package/lib/esm/resources/payment_methods.js +3 -11
- package/lib/esm/resources/paypal_gateways.d.ts +17 -16
- package/lib/esm/resources/paypal_gateways.js +3 -11
- package/lib/esm/resources/paypal_payments.d.ts +31 -30
- package/lib/esm/resources/paypal_payments.js +3 -11
- package/lib/esm/resources/percentage_discount_promotions.d.ts +67 -58
- package/lib/esm/resources/percentage_discount_promotions.js +7 -11
- package/lib/esm/resources/price_frequency_tiers.d.ts +26 -25
- package/lib/esm/resources/price_frequency_tiers.js +3 -11
- package/lib/esm/resources/price_lists.d.ts +20 -19
- package/lib/esm/resources/price_lists.js +3 -11
- package/lib/esm/resources/price_tiers.d.ts +17 -16
- package/lib/esm/resources/price_tiers.js +0 -8
- package/lib/esm/resources/price_volume_tiers.d.ts +26 -25
- package/lib/esm/resources/price_volume_tiers.js +3 -11
- package/lib/esm/resources/prices.d.ts +39 -38
- package/lib/esm/resources/prices.js +3 -11
- package/lib/esm/resources/promotion_rules.d.ts +10 -10
- package/lib/esm/resources/promotion_rules.js +0 -8
- package/lib/esm/resources/promotions.d.ts +27 -23
- package/lib/esm/resources/promotions.js +4 -8
- package/lib/esm/resources/recurring_order_copies.d.ts +29 -28
- package/lib/esm/resources/recurring_order_copies.js +3 -11
- package/lib/esm/resources/refunds.d.ts +24 -23
- package/lib/esm/resources/refunds.js +0 -8
- package/lib/esm/resources/return_line_items.d.ts +27 -26
- package/lib/esm/resources/return_line_items.js +3 -11
- package/lib/esm/resources/returns.d.ts +52 -43
- package/lib/esm/resources/returns.js +7 -11
- package/lib/esm/resources/satispay_gateways.d.ts +23 -19
- package/lib/esm/resources/satispay_gateways.js +3 -11
- package/lib/esm/resources/satispay_payments.d.ts +21 -23
- package/lib/esm/resources/satispay_payments.js +3 -11
- package/lib/esm/resources/shipments.d.ts +52 -51
- package/lib/esm/resources/shipments.js +1 -9
- package/lib/esm/resources/shipping_categories.d.ts +15 -14
- package/lib/esm/resources/shipping_categories.js +3 -11
- package/lib/esm/resources/shipping_method_tiers.d.ts +17 -16
- package/lib/esm/resources/shipping_method_tiers.js +0 -8
- package/lib/esm/resources/shipping_methods.d.ts +71 -70
- package/lib/esm/resources/shipping_methods.js +3 -11
- package/lib/esm/resources/shipping_weight_tiers.d.ts +25 -24
- package/lib/esm/resources/shipping_weight_tiers.js +3 -11
- package/lib/esm/resources/shipping_zones.d.ts +32 -31
- package/lib/esm/resources/shipping_zones.js +3 -11
- package/lib/esm/resources/sku_list_items.d.ts +26 -25
- package/lib/esm/resources/sku_list_items.js +3 -11
- package/lib/esm/resources/sku_list_promotion_rules.d.ts +37 -36
- package/lib/esm/resources/sku_list_promotion_rules.js +3 -11
- package/lib/esm/resources/sku_lists.d.ts +35 -34
- package/lib/esm/resources/sku_lists.js +3 -11
- package/lib/esm/resources/sku_options.d.ts +48 -36
- package/lib/esm/resources/sku_options.js +11 -11
- package/lib/esm/resources/skus.d.ts +60 -48
- package/lib/esm/resources/skus.js +11 -11
- package/lib/esm/resources/stock_items.d.ts +26 -25
- package/lib/esm/resources/stock_items.js +3 -11
- package/lib/esm/resources/stock_line_items.d.ts +16 -15
- package/lib/esm/resources/stock_line_items.js +0 -8
- package/lib/esm/resources/stock_locations.d.ts +29 -28
- package/lib/esm/resources/stock_locations.js +3 -11
- package/lib/esm/resources/stock_transfers.d.ts +42 -41
- package/lib/esm/resources/stock_transfers.js +3 -11
- package/lib/esm/resources/stripe_gateways.d.ts +22 -21
- package/lib/esm/resources/stripe_gateways.js +3 -11
- package/lib/esm/resources/stripe_payments.d.ts +28 -27
- package/lib/esm/resources/stripe_payments.js +3 -11
- package/lib/esm/resources/subscription_models.d.ts +27 -26
- package/lib/esm/resources/subscription_models.js +3 -11
- package/lib/esm/resources/tags.d.ts +28 -0
- package/lib/esm/resources/tags.js +23 -0
- package/lib/esm/resources/tax_calculators.d.ts +13 -12
- package/lib/esm/resources/tax_calculators.js +0 -8
- package/lib/esm/resources/tax_categories.d.ts +30 -29
- package/lib/esm/resources/tax_categories.js +3 -11
- package/lib/esm/resources/tax_rules.d.ts +51 -50
- package/lib/esm/resources/tax_rules.js +3 -11
- package/lib/esm/resources/taxjar_accounts.d.ts +21 -20
- package/lib/esm/resources/taxjar_accounts.js +3 -11
- package/lib/esm/resources/transactions.d.ts +22 -21
- package/lib/esm/resources/transactions.js +0 -8
- package/lib/esm/resources/voids.d.ts +24 -23
- package/lib/esm/resources/voids.js +0 -8
- package/lib/esm/resources/webhooks.d.ts +26 -25
- package/lib/esm/resources/webhooks.js +3 -11
- package/lib/esm/resources/wire_transfers.d.ts +16 -15
- package/lib/esm/resources/wire_transfers.js +3 -11
- package/lib/esm/static.d.ts +1 -1
- package/lib/esm/util.d.ts +1 -3
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +20 -20
@@ -1,20 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class PaymentMethods extends ApiResource {
|
3
|
-
// static readonly PATH = 'payment_methods'
|
4
|
-
async list(params, options) {
|
5
|
-
return this.resources.list({ type: PaymentMethods.TYPE }, params, options);
|
6
|
-
}
|
7
3
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
9
|
-
}
|
10
|
-
async retrieve(id, params, options) {
|
11
|
-
return this.resources.retrieve({ type: PaymentMethods.TYPE, id }, params, options);
|
4
|
+
return this.resources.create({ ...resource, type: PaymentMethods.TYPE }, params, options);
|
12
5
|
}
|
13
6
|
async update(resource, params, options) {
|
14
|
-
return this.resources.update(
|
7
|
+
return this.resources.update({ ...resource, type: PaymentMethods.TYPE }, params, options);
|
15
8
|
}
|
16
9
|
async delete(id, options) {
|
17
|
-
await this.resources.delete({ type: PaymentMethods.TYPE
|
10
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: PaymentMethods.TYPE } : id, options);
|
18
11
|
}
|
19
12
|
async market(paymentMethodId, params, options) {
|
20
13
|
const _paymentMethodId = paymentMethodId.id || paymentMethodId;
|
@@ -28,7 +21,6 @@ class PaymentMethods extends ApiResource {
|
|
28
21
|
const _paymentMethodId = paymentMethodId.id || paymentMethodId;
|
29
22
|
return this.resources.fetch({ type: 'attachments' }, `payment_methods/${_paymentMethodId}/attachments`, params, options);
|
30
23
|
}
|
31
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
32
24
|
isPaymentMethod(resource) {
|
33
25
|
return resource.type && (resource.type === PaymentMethods.TYPE);
|
34
26
|
}
|
@@ -1,14 +1,17 @@
|
|
1
|
-
import { ApiResource
|
2
|
-
import type {
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
3
|
+
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
3
4
|
import type { PaymentMethod } from './payment_methods';
|
4
5
|
import type { PaypalPayment } from './paypal_payments';
|
6
|
+
type PaypalGatewayType = 'paypal_gateways';
|
5
7
|
type PaypalGatewayRel = ResourceRel & {
|
6
|
-
type:
|
8
|
+
type: PaypalGatewayType;
|
7
9
|
};
|
8
10
|
interface PaypalGateway extends Resource {
|
9
|
-
|
10
|
-
|
11
|
-
|
11
|
+
readonly type: PaypalGatewayType;
|
12
|
+
name: string;
|
13
|
+
payment_methods?: PaymentMethod[] | null;
|
14
|
+
paypal_payments?: PaypalPayment[] | null;
|
12
15
|
}
|
13
16
|
interface PaypalGatewayCreate extends ResourceCreate {
|
14
17
|
name: string;
|
@@ -16,22 +19,20 @@ interface PaypalGatewayCreate extends ResourceCreate {
|
|
16
19
|
client_secret: string;
|
17
20
|
}
|
18
21
|
interface PaypalGatewayUpdate extends ResourceUpdate {
|
19
|
-
name?: string;
|
20
|
-
client_id?: string;
|
21
|
-
client_secret?: string;
|
22
|
+
name?: string | null;
|
23
|
+
client_id?: string | null;
|
24
|
+
client_secret?: string | null;
|
22
25
|
}
|
23
|
-
declare class PaypalGateways extends ApiResource {
|
24
|
-
static readonly TYPE:
|
25
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaypalGateway>>;
|
26
|
+
declare class PaypalGateways extends ApiResource<PaypalGateway> {
|
27
|
+
static readonly TYPE: PaypalGatewayType;
|
26
28
|
create(resource: PaypalGatewayCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaypalGateway>;
|
27
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaypalGateway>;
|
28
29
|
update(resource: PaypalGatewayUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaypalGateway>;
|
29
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
30
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
30
31
|
payment_methods(paypalGatewayId: string | PaypalGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>>;
|
31
32
|
paypal_payments(paypalGatewayId: string | PaypalGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaypalPayment>>;
|
32
33
|
isPaypalGateway(resource: any): resource is PaypalGateway;
|
33
34
|
relationship(id: string | ResourceId | null): PaypalGatewayRel;
|
34
|
-
type():
|
35
|
+
type(): PaypalGatewayType;
|
35
36
|
}
|
36
37
|
export default PaypalGateways;
|
37
|
-
export { PaypalGateway, PaypalGatewayCreate, PaypalGatewayUpdate };
|
38
|
+
export type { PaypalGateway, PaypalGatewayCreate, PaypalGatewayUpdate, PaypalGatewayType };
|
@@ -1,20 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class PaypalGateways extends ApiResource {
|
3
|
-
// static readonly PATH = 'paypal_gateways'
|
4
|
-
async list(params, options) {
|
5
|
-
return this.resources.list({ type: PaypalGateways.TYPE }, params, options);
|
6
|
-
}
|
7
3
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
9
|
-
}
|
10
|
-
async retrieve(id, params, options) {
|
11
|
-
return this.resources.retrieve({ type: PaypalGateways.TYPE, id }, params, options);
|
4
|
+
return this.resources.create({ ...resource, type: PaypalGateways.TYPE }, params, options);
|
12
5
|
}
|
13
6
|
async update(resource, params, options) {
|
14
|
-
return this.resources.update(
|
7
|
+
return this.resources.update({ ...resource, type: PaypalGateways.TYPE }, params, options);
|
15
8
|
}
|
16
9
|
async delete(id, options) {
|
17
|
-
await this.resources.delete({ type: PaypalGateways.TYPE
|
10
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: PaypalGateways.TYPE } : id, options);
|
18
11
|
}
|
19
12
|
async payment_methods(paypalGatewayId, params, options) {
|
20
13
|
const _paypalGatewayId = paypalGatewayId.id || paypalGatewayId;
|
@@ -24,7 +17,6 @@ class PaypalGateways extends ApiResource {
|
|
24
17
|
const _paypalGatewayId = paypalGatewayId.id || paypalGatewayId;
|
25
18
|
return this.resources.fetch({ type: 'paypal_payments' }, `paypal_gateways/${_paypalGatewayId}/paypal_payments`, params, options);
|
26
19
|
}
|
27
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
28
20
|
isPaypalGateway(resource) {
|
29
21
|
return resource.type && (resource.type === PaypalGateways.TYPE);
|
30
22
|
}
|
@@ -1,52 +1,53 @@
|
|
1
|
-
import { ApiResource
|
2
|
-
import type {
|
3
|
-
import type {
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel } from '../resource';
|
3
|
+
import type { QueryParamsRetrieve } from '../query';
|
4
|
+
import type { Order, OrderType } from './orders';
|
4
5
|
import type { PaymentGateway } from './payment_gateways';
|
6
|
+
type PaypalPaymentType = 'paypal_payments';
|
5
7
|
type PaypalPaymentRel = ResourceRel & {
|
6
|
-
type:
|
8
|
+
type: PaypalPaymentType;
|
7
9
|
};
|
8
10
|
type OrderRel = ResourceRel & {
|
9
|
-
type:
|
11
|
+
type: OrderType;
|
10
12
|
};
|
11
13
|
interface PaypalPayment extends Resource {
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
14
|
+
readonly type: PaypalPaymentType;
|
15
|
+
return_url: string;
|
16
|
+
cancel_url: string;
|
17
|
+
note_to_payer?: string | null;
|
18
|
+
paypal_payer_id?: string | null;
|
19
|
+
name?: string | null;
|
20
|
+
paypal_id?: string | null;
|
21
|
+
status: 'created' | 'approved';
|
22
|
+
approval_url?: string | null;
|
23
|
+
mismatched_amounts?: boolean | null;
|
24
|
+
intent_amount_cents: number;
|
25
|
+
intent_amount_float?: number | null;
|
26
|
+
formatted_intent_amount?: string | null;
|
27
|
+
payment_instrument?: Record<string, any> | null;
|
28
|
+
order?: Order | null;
|
29
|
+
payment_gateway?: PaymentGateway | null;
|
27
30
|
}
|
28
31
|
interface PaypalPaymentCreate extends ResourceCreate {
|
29
32
|
return_url: string;
|
30
33
|
cancel_url: string;
|
31
|
-
note_to_payer?: string;
|
34
|
+
note_to_payer?: string | null;
|
32
35
|
order: OrderRel;
|
33
36
|
}
|
34
37
|
interface PaypalPaymentUpdate extends ResourceUpdate {
|
35
|
-
paypal_payer_id?: string;
|
36
|
-
order?: OrderRel;
|
38
|
+
paypal_payer_id?: string | null;
|
39
|
+
order?: OrderRel | null;
|
37
40
|
}
|
38
|
-
declare class PaypalPayments extends ApiResource {
|
39
|
-
static readonly TYPE:
|
40
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaypalPayment>>;
|
41
|
+
declare class PaypalPayments extends ApiResource<PaypalPayment> {
|
42
|
+
static readonly TYPE: PaypalPaymentType;
|
41
43
|
create(resource: PaypalPaymentCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaypalPayment>;
|
42
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaypalPayment>;
|
43
44
|
update(resource: PaypalPaymentUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaypalPayment>;
|
44
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
45
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
45
46
|
order(paypalPaymentId: string | PaypalPayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
46
47
|
payment_gateway(paypalPaymentId: string | PaypalPayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentGateway>;
|
47
48
|
isPaypalPayment(resource: any): resource is PaypalPayment;
|
48
49
|
relationship(id: string | ResourceId | null): PaypalPaymentRel;
|
49
|
-
type():
|
50
|
+
type(): PaypalPaymentType;
|
50
51
|
}
|
51
52
|
export default PaypalPayments;
|
52
|
-
export { PaypalPayment, PaypalPaymentCreate, PaypalPaymentUpdate };
|
53
|
+
export type { PaypalPayment, PaypalPaymentCreate, PaypalPaymentUpdate, PaypalPaymentType };
|
@@ -1,20 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class PaypalPayments extends ApiResource {
|
3
|
-
// static readonly PATH = 'paypal_payments'
|
4
|
-
async list(params, options) {
|
5
|
-
return this.resources.list({ type: PaypalPayments.TYPE }, params, options);
|
6
|
-
}
|
7
3
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
9
|
-
}
|
10
|
-
async retrieve(id, params, options) {
|
11
|
-
return this.resources.retrieve({ type: PaypalPayments.TYPE, id }, params, options);
|
4
|
+
return this.resources.create({ ...resource, type: PaypalPayments.TYPE }, params, options);
|
12
5
|
}
|
13
6
|
async update(resource, params, options) {
|
14
|
-
return this.resources.update(
|
7
|
+
return this.resources.update({ ...resource, type: PaypalPayments.TYPE }, params, options);
|
15
8
|
}
|
16
9
|
async delete(id, options) {
|
17
|
-
await this.resources.delete({ type: PaypalPayments.TYPE
|
10
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: PaypalPayments.TYPE } : id, options);
|
18
11
|
}
|
19
12
|
async order(paypalPaymentId, params, options) {
|
20
13
|
const _paypalPaymentId = paypalPaymentId.id || paypalPaymentId;
|
@@ -24,7 +17,6 @@ class PaypalPayments extends ApiResource {
|
|
24
17
|
const _paypalPaymentId = paypalPaymentId.id || paypalPaymentId;
|
25
18
|
return this.resources.fetch({ type: 'payment_gateways' }, `paypal_payments/${_paypalPaymentId}/payment_gateway`, params, options);
|
26
19
|
}
|
27
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
28
20
|
isPaypalPayment(resource) {
|
29
21
|
return resource.type && (resource.type === PaypalPayments.TYPE);
|
30
22
|
}
|
@@ -1,100 +1,109 @@
|
|
1
|
-
import { ApiResource
|
2
|
-
import type {
|
3
|
-
import type {
|
4
|
-
import type {
|
5
|
-
import type {
|
6
|
-
import type {
|
7
|
-
import type {
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
3
|
+
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
4
|
+
import type { Market, MarketType } from './markets';
|
5
|
+
import type { PromotionRule, PromotionRuleType } from './promotion_rules';
|
6
|
+
import type { OrderAmountPromotionRule, OrderAmountPromotionRuleType } from './order_amount_promotion_rules';
|
7
|
+
import type { SkuListPromotionRule, SkuListPromotionRuleType } from './sku_list_promotion_rules';
|
8
|
+
import type { CouponCodesPromotionRule, CouponCodesPromotionRuleType } from './coupon_codes_promotion_rules';
|
8
9
|
import type { Attachment } from './attachments';
|
9
10
|
import type { Event } from './events';
|
10
|
-
import type {
|
11
|
+
import type { Tag, TagType } from './tags';
|
12
|
+
import type { SkuList, SkuListType } from './sku_lists';
|
11
13
|
import type { Sku } from './skus';
|
14
|
+
type PercentageDiscountPromotionType = 'percentage_discount_promotions';
|
12
15
|
type PercentageDiscountPromotionRel = ResourceRel & {
|
13
|
-
type:
|
16
|
+
type: PercentageDiscountPromotionType;
|
14
17
|
};
|
15
18
|
type MarketRel = ResourceRel & {
|
16
|
-
type:
|
19
|
+
type: MarketType;
|
17
20
|
};
|
18
21
|
type PromotionRuleRel = ResourceRel & {
|
19
|
-
type:
|
22
|
+
type: PromotionRuleType;
|
20
23
|
};
|
21
24
|
type OrderAmountPromotionRuleRel = ResourceRel & {
|
22
|
-
type:
|
25
|
+
type: OrderAmountPromotionRuleType;
|
23
26
|
};
|
24
27
|
type SkuListPromotionRuleRel = ResourceRel & {
|
25
|
-
type:
|
28
|
+
type: SkuListPromotionRuleType;
|
26
29
|
};
|
27
30
|
type CouponCodesPromotionRuleRel = ResourceRel & {
|
28
|
-
type:
|
31
|
+
type: CouponCodesPromotionRuleType;
|
32
|
+
};
|
33
|
+
type TagRel = ResourceRel & {
|
34
|
+
type: TagType;
|
29
35
|
};
|
30
36
|
type SkuListRel = ResourceRel & {
|
31
|
-
type:
|
37
|
+
type: SkuListType;
|
32
38
|
};
|
33
39
|
interface PercentageDiscountPromotion extends Resource {
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
40
|
+
readonly type: PercentageDiscountPromotionType;
|
41
|
+
name: string;
|
42
|
+
currency_code?: string | null;
|
43
|
+
starts_at: string;
|
44
|
+
expires_at: string;
|
45
|
+
total_usage_limit: number;
|
46
|
+
total_usage_count?: number | null;
|
47
|
+
active?: boolean | null;
|
48
|
+
percentage: number;
|
49
|
+
market?: Market | null;
|
50
|
+
promotion_rules?: PromotionRule[] | null;
|
51
|
+
order_amount_promotion_rule?: OrderAmountPromotionRule | null;
|
52
|
+
sku_list_promotion_rule?: SkuListPromotionRule | null;
|
53
|
+
coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
|
54
|
+
attachments?: Attachment[] | null;
|
55
|
+
events?: Event[] | null;
|
56
|
+
tags?: Tag[] | null;
|
57
|
+
sku_list?: SkuList | null;
|
58
|
+
skus?: Sku[] | null;
|
51
59
|
}
|
52
60
|
interface PercentageDiscountPromotionCreate extends ResourceCreate {
|
53
61
|
name: string;
|
54
|
-
currency_code?: string;
|
62
|
+
currency_code?: string | null;
|
55
63
|
starts_at: string;
|
56
64
|
expires_at: string;
|
57
65
|
total_usage_limit: number;
|
58
66
|
percentage: number;
|
59
|
-
market?: MarketRel;
|
60
|
-
promotion_rules?: PromotionRuleRel[];
|
61
|
-
order_amount_promotion_rule?: OrderAmountPromotionRuleRel;
|
62
|
-
sku_list_promotion_rule?: SkuListPromotionRuleRel;
|
63
|
-
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel;
|
64
|
-
|
67
|
+
market?: MarketRel | null;
|
68
|
+
promotion_rules?: PromotionRuleRel[] | null;
|
69
|
+
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
70
|
+
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
71
|
+
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
72
|
+
tags?: TagRel[] | null;
|
73
|
+
sku_list?: SkuListRel | null;
|
65
74
|
}
|
66
75
|
interface PercentageDiscountPromotionUpdate extends ResourceUpdate {
|
67
|
-
name?: string;
|
68
|
-
currency_code?: string;
|
69
|
-
starts_at?: string;
|
70
|
-
expires_at?: string;
|
71
|
-
total_usage_limit?: number;
|
72
|
-
percentage?: number;
|
73
|
-
market?: MarketRel;
|
74
|
-
promotion_rules?: PromotionRuleRel[];
|
75
|
-
order_amount_promotion_rule?: OrderAmountPromotionRuleRel;
|
76
|
-
sku_list_promotion_rule?: SkuListPromotionRuleRel;
|
77
|
-
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel;
|
78
|
-
|
76
|
+
name?: string | null;
|
77
|
+
currency_code?: string | null;
|
78
|
+
starts_at?: string | null;
|
79
|
+
expires_at?: string | null;
|
80
|
+
total_usage_limit?: number | null;
|
81
|
+
percentage?: number | null;
|
82
|
+
market?: MarketRel | null;
|
83
|
+
promotion_rules?: PromotionRuleRel[] | null;
|
84
|
+
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
85
|
+
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
86
|
+
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
87
|
+
tags?: TagRel[] | null;
|
88
|
+
sku_list?: SkuListRel | null;
|
79
89
|
}
|
80
|
-
declare class PercentageDiscountPromotions extends ApiResource {
|
81
|
-
static readonly TYPE:
|
82
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PercentageDiscountPromotion>>;
|
90
|
+
declare class PercentageDiscountPromotions extends ApiResource<PercentageDiscountPromotion> {
|
91
|
+
static readonly TYPE: PercentageDiscountPromotionType;
|
83
92
|
create(resource: PercentageDiscountPromotionCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PercentageDiscountPromotion>;
|
84
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PercentageDiscountPromotion>;
|
85
93
|
update(resource: PercentageDiscountPromotionUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PercentageDiscountPromotion>;
|
86
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
94
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
87
95
|
market(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
|
88
96
|
order_amount_promotion_rule(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
89
97
|
sku_list_promotion_rule(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
90
98
|
coupon_codes_promotion_rule(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
91
99
|
attachments(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
92
100
|
events(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
101
|
+
tags(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
93
102
|
sku_list(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
94
103
|
skus(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Sku>>;
|
95
104
|
isPercentageDiscountPromotion(resource: any): resource is PercentageDiscountPromotion;
|
96
105
|
relationship(id: string | ResourceId | null): PercentageDiscountPromotionRel;
|
97
|
-
type():
|
106
|
+
type(): PercentageDiscountPromotionType;
|
98
107
|
}
|
99
108
|
export default PercentageDiscountPromotions;
|
100
|
-
export { PercentageDiscountPromotion, PercentageDiscountPromotionCreate, PercentageDiscountPromotionUpdate };
|
109
|
+
export type { PercentageDiscountPromotion, PercentageDiscountPromotionCreate, PercentageDiscountPromotionUpdate, PercentageDiscountPromotionType };
|
@@ -1,20 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class PercentageDiscountPromotions extends ApiResource {
|
3
|
-
// static readonly PATH = 'percentage_discount_promotions'
|
4
|
-
async list(params, options) {
|
5
|
-
return this.resources.list({ type: PercentageDiscountPromotions.TYPE }, params, options);
|
6
|
-
}
|
7
3
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
9
|
-
}
|
10
|
-
async retrieve(id, params, options) {
|
11
|
-
return this.resources.retrieve({ type: PercentageDiscountPromotions.TYPE, id }, params, options);
|
4
|
+
return this.resources.create({ ...resource, type: PercentageDiscountPromotions.TYPE }, params, options);
|
12
5
|
}
|
13
6
|
async update(resource, params, options) {
|
14
|
-
return this.resources.update(
|
7
|
+
return this.resources.update({ ...resource, type: PercentageDiscountPromotions.TYPE }, params, options);
|
15
8
|
}
|
16
9
|
async delete(id, options) {
|
17
|
-
await this.resources.delete({ type: PercentageDiscountPromotions.TYPE
|
10
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: PercentageDiscountPromotions.TYPE } : id, options);
|
18
11
|
}
|
19
12
|
async market(percentageDiscountPromotionId, params, options) {
|
20
13
|
const _percentageDiscountPromotionId = percentageDiscountPromotionId.id || percentageDiscountPromotionId;
|
@@ -40,6 +33,10 @@ class PercentageDiscountPromotions extends ApiResource {
|
|
40
33
|
const _percentageDiscountPromotionId = percentageDiscountPromotionId.id || percentageDiscountPromotionId;
|
41
34
|
return this.resources.fetch({ type: 'events' }, `percentage_discount_promotions/${_percentageDiscountPromotionId}/events`, params, options);
|
42
35
|
}
|
36
|
+
async tags(percentageDiscountPromotionId, params, options) {
|
37
|
+
const _percentageDiscountPromotionId = percentageDiscountPromotionId.id || percentageDiscountPromotionId;
|
38
|
+
return this.resources.fetch({ type: 'tags' }, `percentage_discount_promotions/${_percentageDiscountPromotionId}/tags`, params, options);
|
39
|
+
}
|
43
40
|
async sku_list(percentageDiscountPromotionId, params, options) {
|
44
41
|
const _percentageDiscountPromotionId = percentageDiscountPromotionId.id || percentageDiscountPromotionId;
|
45
42
|
return this.resources.fetch({ type: 'sku_lists' }, `percentage_discount_promotions/${_percentageDiscountPromotionId}/sku_list`, params, options);
|
@@ -48,7 +45,6 @@ class PercentageDiscountPromotions extends ApiResource {
|
|
48
45
|
const _percentageDiscountPromotionId = percentageDiscountPromotionId.id || percentageDiscountPromotionId;
|
49
46
|
return this.resources.fetch({ type: 'skus' }, `percentage_discount_promotions/${_percentageDiscountPromotionId}/skus`, params, options);
|
50
47
|
}
|
51
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
52
48
|
isPercentageDiscountPromotion(resource) {
|
53
49
|
return resource.type && (resource.type === PercentageDiscountPromotions.TYPE);
|
54
50
|
}
|
@@ -1,49 +1,50 @@
|
|
1
|
-
import { ApiResource
|
2
|
-
import type {
|
3
|
-
import type {
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
3
|
+
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
4
|
+
import type { Price, PriceType } from './prices';
|
4
5
|
import type { Attachment } from './attachments';
|
5
6
|
import type { Event } from './events';
|
7
|
+
type PriceFrequencyTierType = 'price_frequency_tiers';
|
6
8
|
type PriceFrequencyTierRel = ResourceRel & {
|
7
|
-
type:
|
9
|
+
type: PriceFrequencyTierType;
|
8
10
|
};
|
9
11
|
type PriceRel = ResourceRel & {
|
10
|
-
type:
|
12
|
+
type: PriceType;
|
11
13
|
};
|
12
14
|
interface PriceFrequencyTier extends Resource {
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
15
|
+
readonly type: PriceFrequencyTierType;
|
16
|
+
name: string;
|
17
|
+
up_to?: number | null;
|
18
|
+
price_amount_cents: number;
|
19
|
+
price_amount_float?: number | null;
|
20
|
+
formatted_price_amount?: string | null;
|
21
|
+
price?: Price | null;
|
22
|
+
attachments?: Attachment[] | null;
|
23
|
+
events?: Event[] | null;
|
21
24
|
}
|
22
25
|
interface PriceFrequencyTierCreate extends ResourceCreate {
|
23
26
|
name: string;
|
24
|
-
up_to?: number;
|
27
|
+
up_to?: number | null;
|
25
28
|
price_amount_cents: number;
|
26
29
|
price: PriceRel;
|
27
30
|
}
|
28
31
|
interface PriceFrequencyTierUpdate extends ResourceUpdate {
|
29
|
-
name?: string;
|
30
|
-
up_to?: number;
|
31
|
-
price_amount_cents?: number;
|
32
|
-
price?: PriceRel;
|
32
|
+
name?: string | null;
|
33
|
+
up_to?: number | null;
|
34
|
+
price_amount_cents?: number | null;
|
35
|
+
price?: PriceRel | null;
|
33
36
|
}
|
34
|
-
declare class PriceFrequencyTiers extends ApiResource {
|
35
|
-
static readonly TYPE:
|
36
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PriceFrequencyTier>>;
|
37
|
+
declare class PriceFrequencyTiers extends ApiResource<PriceFrequencyTier> {
|
38
|
+
static readonly TYPE: PriceFrequencyTierType;
|
37
39
|
create(resource: PriceFrequencyTierCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PriceFrequencyTier>;
|
38
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PriceFrequencyTier>;
|
39
40
|
update(resource: PriceFrequencyTierUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PriceFrequencyTier>;
|
40
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
41
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
41
42
|
price(priceFrequencyTierId: string | PriceFrequencyTier, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Price>;
|
42
43
|
attachments(priceFrequencyTierId: string | PriceFrequencyTier, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
43
44
|
events(priceFrequencyTierId: string | PriceFrequencyTier, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
44
45
|
isPriceFrequencyTier(resource: any): resource is PriceFrequencyTier;
|
45
46
|
relationship(id: string | ResourceId | null): PriceFrequencyTierRel;
|
46
|
-
type():
|
47
|
+
type(): PriceFrequencyTierType;
|
47
48
|
}
|
48
49
|
export default PriceFrequencyTiers;
|
49
|
-
export { PriceFrequencyTier, PriceFrequencyTierCreate, PriceFrequencyTierUpdate };
|
50
|
+
export type { PriceFrequencyTier, PriceFrequencyTierCreate, PriceFrequencyTierUpdate, PriceFrequencyTierType };
|
@@ -1,20 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class PriceFrequencyTiers extends ApiResource {
|
3
|
-
// static readonly PATH = 'price_frequency_tiers'
|
4
|
-
async list(params, options) {
|
5
|
-
return this.resources.list({ type: PriceFrequencyTiers.TYPE }, params, options);
|
6
|
-
}
|
7
3
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
9
|
-
}
|
10
|
-
async retrieve(id, params, options) {
|
11
|
-
return this.resources.retrieve({ type: PriceFrequencyTiers.TYPE, id }, params, options);
|
4
|
+
return this.resources.create({ ...resource, type: PriceFrequencyTiers.TYPE }, params, options);
|
12
5
|
}
|
13
6
|
async update(resource, params, options) {
|
14
|
-
return this.resources.update(
|
7
|
+
return this.resources.update({ ...resource, type: PriceFrequencyTiers.TYPE }, params, options);
|
15
8
|
}
|
16
9
|
async delete(id, options) {
|
17
|
-
await this.resources.delete({ type: PriceFrequencyTiers.TYPE
|
10
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: PriceFrequencyTiers.TYPE } : id, options);
|
18
11
|
}
|
19
12
|
async price(priceFrequencyTierId, params, options) {
|
20
13
|
const _priceFrequencyTierId = priceFrequencyTierId.id || priceFrequencyTierId;
|
@@ -28,7 +21,6 @@ class PriceFrequencyTiers extends ApiResource {
|
|
28
21
|
const _priceFrequencyTierId = priceFrequencyTierId.id || priceFrequencyTierId;
|
29
22
|
return this.resources.fetch({ type: 'events' }, `price_frequency_tiers/${_priceFrequencyTierId}/events`, params, options);
|
30
23
|
}
|
31
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
32
24
|
isPriceFrequencyTier(resource) {
|
33
25
|
return resource.type && (resource.type === PriceFrequencyTiers.TYPE);
|
34
26
|
}
|
@@ -1,39 +1,40 @@
|
|
1
|
-
import { ApiResource
|
2
|
-
import type {
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
3
|
+
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
3
4
|
import type { Price } from './prices';
|
4
5
|
import type { Attachment } from './attachments';
|
6
|
+
type PriceListType = 'price_lists';
|
5
7
|
type PriceListRel = ResourceRel & {
|
6
|
-
type:
|
8
|
+
type: PriceListType;
|
7
9
|
};
|
8
10
|
interface PriceList extends Resource {
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
readonly type: PriceListType;
|
12
|
+
name: string;
|
13
|
+
currency_code: string;
|
14
|
+
tax_included?: boolean | null;
|
15
|
+
prices?: Price[] | null;
|
16
|
+
attachments?: Attachment[] | null;
|
14
17
|
}
|
15
18
|
interface PriceListCreate extends ResourceCreate {
|
16
19
|
name: string;
|
17
20
|
currency_code: string;
|
18
|
-
tax_included?: boolean;
|
21
|
+
tax_included?: boolean | null;
|
19
22
|
}
|
20
23
|
interface PriceListUpdate extends ResourceUpdate {
|
21
|
-
name?: string;
|
22
|
-
currency_code?: string;
|
23
|
-
tax_included?: boolean;
|
24
|
+
name?: string | null;
|
25
|
+
currency_code?: string | null;
|
26
|
+
tax_included?: boolean | null;
|
24
27
|
}
|
25
|
-
declare class PriceLists extends ApiResource {
|
26
|
-
static readonly TYPE:
|
27
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PriceList>>;
|
28
|
+
declare class PriceLists extends ApiResource<PriceList> {
|
29
|
+
static readonly TYPE: PriceListType;
|
28
30
|
create(resource: PriceListCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PriceList>;
|
29
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PriceList>;
|
30
31
|
update(resource: PriceListUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PriceList>;
|
31
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
32
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
32
33
|
prices(priceListId: string | PriceList, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Price>>;
|
33
34
|
attachments(priceListId: string | PriceList, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
34
35
|
isPriceList(resource: any): resource is PriceList;
|
35
36
|
relationship(id: string | ResourceId | null): PriceListRel;
|
36
|
-
type():
|
37
|
+
type(): PriceListType;
|
37
38
|
}
|
38
39
|
export default PriceLists;
|
39
|
-
export { PriceList, PriceListCreate, PriceListUpdate };
|
40
|
+
export type { PriceList, PriceListCreate, PriceListUpdate, PriceListType };
|