@commercelayer/sdk 4.28.0 → 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 +9 -23
- package/lib/cjs/api.js +35 -4
- package/lib/cjs/client.d.ts +5 -3
- package/lib/cjs/client.js +8 -11
- package/lib/cjs/commercelayer.d.ts +11 -5
- package/lib/cjs/commercelayer.js +9 -3
- package/lib/cjs/common.d.ts +0 -1
- package/lib/cjs/common.js +2 -11
- package/lib/cjs/config.d.ts +0 -1
- package/lib/cjs/config.js +0 -1
- package/lib/cjs/debug.js +4 -0
- package/lib/cjs/error.js +4 -1
- package/lib/cjs/index.d.ts +1 -1
- package/lib/cjs/index.js +16 -0
- package/lib/cjs/interceptor.d.ts +2 -6
- package/lib/cjs/jsonapi.js +1 -5
- package/lib/cjs/model.d.ts +9 -3
- package/lib/cjs/query.d.ts +15 -9
- package/lib/cjs/query.js +2 -3
- package/lib/cjs/resource.d.ts +19 -29
- package/lib/cjs/resource.js +9 -34
- package/lib/cjs/resources/addresses.d.ts +75 -73
- package/lib/cjs/resources/addresses.js +15 -3
- package/lib/cjs/resources/adjustments.d.ts +21 -19
- package/lib/cjs/resources/adjustments.js +15 -3
- package/lib/cjs/resources/adyen_gateways.d.ts +36 -34
- package/lib/cjs/resources/adyen_gateways.js +15 -3
- package/lib/cjs/resources/adyen_payments.d.ts +29 -27
- package/lib/cjs/resources/adyen_payments.js +15 -3
- package/lib/cjs/resources/application.d.ts +13 -14
- package/lib/cjs/resources/application.js +6 -1
- package/lib/cjs/resources/attachments.d.ts +80 -81
- package/lib/cjs/resources/attachments.js +11 -3
- package/lib/cjs/resources/authorizations.d.ts +49 -44
- package/lib/cjs/resources/authorizations.js +21 -5
- package/lib/cjs/resources/avalara_accounts.d.ts +33 -31
- package/lib/cjs/resources/avalara_accounts.js +15 -3
- package/lib/cjs/resources/axerve_gateways.d.ts +25 -22
- package/lib/cjs/resources/axerve_gateways.js +15 -3
- package/lib/cjs/resources/axerve_payments.d.ts +34 -26
- package/lib/cjs/resources/axerve_payments.js +15 -3
- package/lib/cjs/resources/billing_info_validation_rules.d.ts +18 -16
- package/lib/cjs/resources/billing_info_validation_rules.js +15 -3
- package/lib/cjs/resources/bing_geocoders.d.ts +15 -16
- package/lib/cjs/resources/bing_geocoders.js +11 -3
- package/lib/cjs/resources/braintree_gateways.d.ts +35 -33
- package/lib/cjs/resources/braintree_gateways.js +15 -3
- package/lib/cjs/resources/braintree_payments.d.ts +31 -29
- package/lib/cjs/resources/braintree_payments.js +15 -3
- package/lib/cjs/resources/bundles.d.ts +58 -56
- package/lib/cjs/resources/bundles.js +15 -3
- 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 +40 -35
- package/lib/cjs/resources/captures.js +21 -5
- package/lib/cjs/resources/carrier_accounts.d.ts +17 -15
- package/lib/cjs/resources/carrier_accounts.js +12 -0
- package/lib/cjs/resources/checkout_com_gateways.d.ts +26 -24
- package/lib/cjs/resources/checkout_com_gateways.js +15 -3
- package/lib/cjs/resources/checkout_com_payments.d.ts +40 -38
- package/lib/cjs/resources/checkout_com_payments.js +15 -3
- package/lib/cjs/resources/cleanups.d.ts +25 -23
- package/lib/cjs/resources/cleanups.js +14 -2
- package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +37 -31
- package/lib/cjs/resources/coupon_codes_promotion_rules.js +15 -3
- package/lib/cjs/resources/coupon_recipients.d.ts +27 -25
- package/lib/cjs/resources/coupon_recipients.js +15 -3
- package/lib/cjs/resources/coupons.d.ts +46 -33
- package/lib/cjs/resources/coupons.js +19 -3
- 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 +25 -21
- package/lib/cjs/resources/customer_addresses.js +15 -3
- package/lib/cjs/resources/customer_groups.d.ts +18 -16
- package/lib/cjs/resources/customer_groups.js +15 -3
- package/lib/cjs/resources/customer_password_resets.d.ts +17 -18
- package/lib/cjs/resources/customer_password_resets.js +11 -3
- package/lib/cjs/resources/customer_payment_sources.d.ts +51 -45
- package/lib/cjs/resources/customer_payment_sources.js +19 -3
- package/lib/cjs/resources/customer_subscriptions.d.ts +16 -14
- package/lib/cjs/resources/customer_subscriptions.js +15 -3
- package/lib/cjs/resources/customers.d.ts +36 -36
- package/lib/cjs/resources/customers.js +11 -3
- package/lib/cjs/resources/delivery_lead_times.d.ts +28 -26
- package/lib/cjs/resources/delivery_lead_times.js +15 -3
- package/lib/cjs/resources/event_callbacks.d.ts +14 -15
- package/lib/cjs/resources/event_callbacks.js +8 -0
- package/lib/cjs/resources/events.d.ts +12 -13
- package/lib/cjs/resources/events.js +8 -0
- package/lib/cjs/resources/exports.d.ts +26 -27
- package/lib/cjs/resources/exports.js +10 -2
- package/lib/cjs/resources/external_gateways.d.ts +33 -31
- package/lib/cjs/resources/external_gateways.js +15 -3
- package/lib/cjs/resources/external_payments.d.ts +24 -22
- package/lib/cjs/resources/external_payments.js +15 -3
- package/lib/cjs/resources/external_promotions.d.ts +92 -62
- package/lib/cjs/resources/external_promotions.js +31 -3
- package/lib/cjs/resources/external_tax_calculators.d.ts +20 -18
- package/lib/cjs/resources/external_tax_calculators.js +15 -3
- package/lib/cjs/resources/fixed_amount_promotions.d.ts +93 -63
- package/lib/cjs/resources/fixed_amount_promotions.js +31 -3
- package/lib/cjs/resources/fixed_price_promotions.d.ts +89 -70
- package/lib/cjs/resources/fixed_price_promotions.js +25 -5
- package/lib/cjs/resources/free_gift_promotions.d.ts +88 -69
- package/lib/cjs/resources/free_gift_promotions.js +25 -5
- package/lib/cjs/resources/free_shipping_promotions.d.ts +86 -59
- package/lib/cjs/resources/free_shipping_promotions.js +27 -3
- package/lib/cjs/resources/geocoders.d.ts +12 -13
- package/lib/cjs/resources/geocoders.js +8 -0
- package/lib/cjs/resources/gift_card_recipients.d.ts +27 -25
- package/lib/cjs/resources/gift_card_recipients.js +15 -3
- package/lib/cjs/resources/gift_cards.d.ts +68 -66
- package/lib/cjs/resources/gift_cards.js +15 -3
- package/lib/cjs/resources/google_geocoders.d.ts +15 -16
- package/lib/cjs/resources/google_geocoders.js +11 -3
- package/lib/cjs/resources/imports.d.ts +29 -32
- package/lib/cjs/resources/imports.js +10 -2
- package/lib/cjs/resources/in_stock_subscriptions.d.ts +37 -35
- package/lib/cjs/resources/in_stock_subscriptions.js +15 -3
- package/lib/cjs/resources/inventory_models.d.ts +33 -22
- package/lib/cjs/resources/inventory_models.js +15 -3
- package/lib/cjs/resources/inventory_return_locations.d.ts +23 -21
- package/lib/cjs/resources/inventory_return_locations.js +15 -3
- package/lib/cjs/resources/inventory_stock_locations.d.ts +26 -24
- package/lib/cjs/resources/inventory_stock_locations.js +15 -3
- package/lib/cjs/resources/klarna_gateways.d.ts +24 -22
- package/lib/cjs/resources/klarna_gateways.js +15 -3
- package/lib/cjs/resources/klarna_payments.d.ts +29 -27
- package/lib/cjs/resources/klarna_payments.js +15 -3
- package/lib/cjs/resources/line_item_options.d.ts +40 -41
- package/lib/cjs/resources/line_item_options.js +11 -3
- package/lib/cjs/resources/line_items.d.ts +105 -87
- package/lib/cjs/resources/line_items.js +19 -3
- package/lib/cjs/resources/manual_gateways.d.ts +16 -14
- package/lib/cjs/resources/manual_gateways.js +15 -3
- package/lib/cjs/resources/manual_tax_calculators.d.ts +22 -20
- package/lib/cjs/resources/manual_tax_calculators.js +15 -3
- package/lib/cjs/resources/markets.d.ts +66 -59
- package/lib/cjs/resources/markets.js +15 -3
- package/lib/cjs/resources/merchants.d.ts +20 -18
- package/lib/cjs/resources/merchants.js +15 -3
- package/lib/cjs/resources/order_amount_promotion_rules.d.ts +40 -31
- package/lib/cjs/resources/order_amount_promotion_rules.js +15 -3
- package/lib/cjs/resources/order_copies.d.ts +28 -29
- package/lib/cjs/resources/order_copies.js +11 -3
- package/lib/cjs/resources/order_factories.d.ts +20 -21
- package/lib/cjs/resources/order_factories.js +8 -0
- package/lib/cjs/resources/order_subscription_items.d.ts +41 -35
- package/lib/cjs/resources/order_subscription_items.js +15 -3
- package/lib/cjs/resources/order_subscriptions.d.ts +54 -51
- package/lib/cjs/resources/order_subscriptions.js +15 -3
- package/lib/cjs/resources/order_validation_rules.d.ts +14 -12
- package/lib/cjs/resources/order_validation_rules.js +12 -0
- package/lib/cjs/resources/orders.d.ts +266 -231
- package/lib/cjs/resources/orders.js +39 -3
- package/lib/cjs/resources/organization.d.ts +24 -25
- package/lib/cjs/resources/organization.js +6 -1
- package/lib/cjs/resources/packages.d.ts +32 -30
- package/lib/cjs/resources/packages.js +15 -3
- package/lib/cjs/resources/parcel_line_items.d.ts +24 -22
- package/lib/cjs/resources/parcel_line_items.js +15 -3
- package/lib/cjs/resources/parcels.d.ts +95 -93
- package/lib/cjs/resources/parcels.js +15 -3
- package/lib/cjs/resources/payment_gateways.d.ts +14 -12
- package/lib/cjs/resources/payment_gateways.js +12 -0
- package/lib/cjs/resources/payment_methods.d.ts +55 -48
- package/lib/cjs/resources/payment_methods.js +15 -3
- 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 +19 -17
- package/lib/cjs/resources/paypal_gateways.js +15 -3
- package/lib/cjs/resources/paypal_payments.d.ts +33 -31
- package/lib/cjs/resources/paypal_payments.js +15 -3
- package/lib/cjs/resources/percentage_discount_promotions.d.ts +88 -69
- package/lib/cjs/resources/percentage_discount_promotions.js +25 -5
- package/lib/cjs/resources/price_frequency_tiers.d.ts +28 -26
- package/lib/cjs/resources/price_frequency_tiers.js +15 -3
- package/lib/cjs/resources/price_lists.d.ts +25 -20
- package/lib/cjs/resources/price_lists.js +15 -3
- package/lib/cjs/resources/price_tiers.d.ts +19 -17
- package/lib/cjs/resources/price_tiers.js +12 -0
- package/lib/cjs/resources/price_volume_tiers.d.ts +28 -26
- package/lib/cjs/resources/price_volume_tiers.js +15 -3
- package/lib/cjs/resources/prices.d.ts +42 -40
- package/lib/cjs/resources/prices.js +15 -3
- package/lib/cjs/resources/promotion_rules.d.ts +14 -10
- package/lib/cjs/resources/promotion_rules.js +12 -0
- package/lib/cjs/resources/promotions.d.ts +39 -25
- package/lib/cjs/resources/promotions.js +24 -0
- package/lib/cjs/resources/recurring_order_copies.d.ts +28 -29
- package/lib/cjs/resources/recurring_order_copies.js +11 -3
- package/lib/cjs/resources/refunds.d.ts +31 -26
- package/lib/cjs/resources/refunds.js +18 -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 +27 -27
- package/lib/cjs/resources/return_line_items.js +11 -3
- package/lib/cjs/resources/returns.d.ts +51 -49
- package/lib/cjs/resources/returns.js +15 -3
- package/lib/cjs/resources/satispay_gateways.d.ts +24 -22
- package/lib/cjs/resources/satispay_gateways.js +15 -3
- package/lib/cjs/resources/satispay_payments.d.ts +31 -21
- package/lib/cjs/resources/satispay_payments.js +15 -3
- package/lib/cjs/resources/shipments.d.ts +98 -52
- package/lib/cjs/resources/shipments.js +27 -1
- package/lib/cjs/resources/shipping_categories.d.ts +20 -15
- package/lib/cjs/resources/shipping_categories.js +15 -3
- package/lib/cjs/resources/shipping_method_tiers.d.ts +19 -17
- package/lib/cjs/resources/shipping_method_tiers.js +12 -0
- package/lib/cjs/resources/shipping_methods.d.ts +81 -71
- package/lib/cjs/resources/shipping_methods.js +15 -3
- package/lib/cjs/resources/shipping_weight_tiers.d.ts +27 -25
- package/lib/cjs/resources/shipping_weight_tiers.js +15 -3
- package/lib/cjs/resources/shipping_zones.d.ts +34 -32
- package/lib/cjs/resources/shipping_zones.js +15 -3
- package/lib/cjs/resources/sku_list_items.d.ts +28 -26
- package/lib/cjs/resources/sku_list_items.js +15 -3
- package/lib/cjs/resources/sku_list_promotion_rules.d.ts +44 -38
- package/lib/cjs/resources/sku_list_promotion_rules.js +15 -3
- package/lib/cjs/resources/sku_lists.d.ts +37 -35
- package/lib/cjs/resources/sku_lists.js +15 -3
- package/lib/cjs/resources/sku_options.d.ts +45 -43
- package/lib/cjs/resources/sku_options.js +15 -3
- package/lib/cjs/resources/skus.d.ts +60 -55
- package/lib/cjs/resources/skus.js +19 -3
- package/lib/cjs/resources/stock_items.d.ts +34 -26
- package/lib/cjs/resources/stock_items.js +23 -3
- package/lib/cjs/resources/stock_line_items.d.ts +54 -15
- package/lib/cjs/resources/stock_line_items.js +25 -0
- package/lib/cjs/resources/stock_locations.d.ts +34 -29
- package/lib/cjs/resources/stock_locations.js +15 -3
- 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 +46 -42
- package/lib/cjs/resources/stock_transfers.js +15 -3
- package/lib/cjs/resources/stripe_gateways.d.ts +24 -22
- package/lib/cjs/resources/stripe_gateways.js +15 -3
- package/lib/cjs/resources/stripe_payments.d.ts +39 -28
- package/lib/cjs/resources/stripe_payments.js +15 -3
- package/lib/cjs/resources/subscription_models.d.ts +26 -27
- package/lib/cjs/resources/subscription_models.js +11 -3
- package/lib/cjs/resources/tags.d.ts +12 -13
- package/lib/cjs/resources/tags.js +11 -3
- package/lib/cjs/resources/tax_calculators.d.ts +15 -13
- package/lib/cjs/resources/tax_calculators.js +12 -0
- package/lib/cjs/resources/tax_categories.d.ts +32 -30
- package/lib/cjs/resources/tax_categories.js +15 -3
- package/lib/cjs/resources/tax_rules.d.ts +53 -51
- package/lib/cjs/resources/tax_rules.js +15 -3
- package/lib/cjs/resources/taxjar_accounts.d.ts +23 -21
- package/lib/cjs/resources/taxjar_accounts.js +15 -3
- package/lib/cjs/resources/transactions.d.ts +30 -22
- package/lib/cjs/resources/transactions.js +20 -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 +31 -26
- package/lib/cjs/resources/voids.js +18 -2
- package/lib/cjs/resources/webhooks.d.ts +33 -26
- package/lib/cjs/resources/webhooks.js +15 -3
- package/lib/cjs/resources/wire_transfers.d.ts +18 -16
- package/lib/cjs/resources/wire_transfers.js +15 -3
- package/lib/cjs/static.d.ts +1 -1
- package/lib/cjs/util.d.ts +4 -1
- package/lib/esm/api.d.ts +9 -23
- package/lib/esm/api.js +26 -1
- package/lib/esm/client.d.ts +5 -3
- package/lib/esm/client.js +8 -11
- package/lib/esm/commercelayer.d.ts +11 -5
- package/lib/esm/commercelayer.js +9 -3
- package/lib/esm/common.d.ts +0 -1
- package/lib/esm/common.js +2 -11
- package/lib/esm/config.d.ts +0 -1
- package/lib/esm/config.js +0 -1
- package/lib/esm/debug.js +4 -0
- package/lib/esm/error.js +4 -1
- package/lib/esm/index.d.ts +1 -1
- package/lib/esm/index.js +2 -0
- package/lib/esm/interceptor.d.ts +2 -6
- package/lib/esm/jsonapi.js +1 -5
- package/lib/esm/model.d.ts +9 -3
- package/lib/esm/query.d.ts +15 -9
- package/lib/esm/query.js +2 -2
- package/lib/esm/resource.d.ts +19 -29
- package/lib/esm/resource.js +10 -34
- package/lib/esm/resources/addresses.d.ts +75 -73
- package/lib/esm/resources/addresses.js +15 -3
- package/lib/esm/resources/adjustments.d.ts +21 -19
- package/lib/esm/resources/adjustments.js +15 -3
- package/lib/esm/resources/adyen_gateways.d.ts +36 -34
- package/lib/esm/resources/adyen_gateways.js +15 -3
- package/lib/esm/resources/adyen_payments.d.ts +29 -27
- package/lib/esm/resources/adyen_payments.js +15 -3
- package/lib/esm/resources/application.d.ts +13 -14
- package/lib/esm/resources/application.js +7 -2
- package/lib/esm/resources/attachments.d.ts +80 -81
- package/lib/esm/resources/attachments.js +11 -3
- package/lib/esm/resources/authorizations.d.ts +49 -44
- package/lib/esm/resources/authorizations.js +21 -5
- package/lib/esm/resources/avalara_accounts.d.ts +33 -31
- package/lib/esm/resources/avalara_accounts.js +15 -3
- package/lib/esm/resources/axerve_gateways.d.ts +25 -22
- package/lib/esm/resources/axerve_gateways.js +15 -3
- package/lib/esm/resources/axerve_payments.d.ts +34 -26
- package/lib/esm/resources/axerve_payments.js +15 -3
- package/lib/esm/resources/billing_info_validation_rules.d.ts +18 -16
- package/lib/esm/resources/billing_info_validation_rules.js +15 -3
- package/lib/esm/resources/bing_geocoders.d.ts +15 -16
- package/lib/esm/resources/bing_geocoders.js +11 -3
- package/lib/esm/resources/braintree_gateways.d.ts +35 -33
- package/lib/esm/resources/braintree_gateways.js +15 -3
- package/lib/esm/resources/braintree_payments.d.ts +31 -29
- package/lib/esm/resources/braintree_payments.js +15 -3
- package/lib/esm/resources/bundles.d.ts +58 -56
- package/lib/esm/resources/bundles.js +15 -3
- 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 +40 -35
- package/lib/esm/resources/captures.js +21 -5
- package/lib/esm/resources/carrier_accounts.d.ts +17 -15
- package/lib/esm/resources/carrier_accounts.js +12 -0
- package/lib/esm/resources/checkout_com_gateways.d.ts +26 -24
- package/lib/esm/resources/checkout_com_gateways.js +15 -3
- package/lib/esm/resources/checkout_com_payments.d.ts +40 -38
- package/lib/esm/resources/checkout_com_payments.js +15 -3
- package/lib/esm/resources/cleanups.d.ts +25 -23
- package/lib/esm/resources/cleanups.js +14 -2
- package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +37 -31
- package/lib/esm/resources/coupon_codes_promotion_rules.js +15 -3
- package/lib/esm/resources/coupon_recipients.d.ts +27 -25
- package/lib/esm/resources/coupon_recipients.js +15 -3
- package/lib/esm/resources/coupons.d.ts +46 -33
- package/lib/esm/resources/coupons.js +19 -3
- 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 +25 -21
- package/lib/esm/resources/customer_addresses.js +15 -3
- package/lib/esm/resources/customer_groups.d.ts +18 -16
- package/lib/esm/resources/customer_groups.js +15 -3
- package/lib/esm/resources/customer_password_resets.d.ts +17 -18
- package/lib/esm/resources/customer_password_resets.js +11 -3
- package/lib/esm/resources/customer_payment_sources.d.ts +51 -45
- package/lib/esm/resources/customer_payment_sources.js +19 -3
- package/lib/esm/resources/customer_subscriptions.d.ts +16 -14
- package/lib/esm/resources/customer_subscriptions.js +15 -3
- package/lib/esm/resources/customers.d.ts +36 -36
- package/lib/esm/resources/customers.js +11 -3
- package/lib/esm/resources/delivery_lead_times.d.ts +28 -26
- package/lib/esm/resources/delivery_lead_times.js +15 -3
- package/lib/esm/resources/event_callbacks.d.ts +14 -15
- package/lib/esm/resources/event_callbacks.js +8 -0
- package/lib/esm/resources/events.d.ts +12 -13
- package/lib/esm/resources/events.js +8 -0
- package/lib/esm/resources/exports.d.ts +26 -27
- package/lib/esm/resources/exports.js +10 -2
- package/lib/esm/resources/external_gateways.d.ts +33 -31
- package/lib/esm/resources/external_gateways.js +15 -3
- package/lib/esm/resources/external_payments.d.ts +24 -22
- package/lib/esm/resources/external_payments.js +15 -3
- package/lib/esm/resources/external_promotions.d.ts +92 -62
- package/lib/esm/resources/external_promotions.js +31 -3
- package/lib/esm/resources/external_tax_calculators.d.ts +20 -18
- package/lib/esm/resources/external_tax_calculators.js +15 -3
- package/lib/esm/resources/fixed_amount_promotions.d.ts +93 -63
- package/lib/esm/resources/fixed_amount_promotions.js +31 -3
- package/lib/esm/resources/fixed_price_promotions.d.ts +89 -70
- package/lib/esm/resources/fixed_price_promotions.js +25 -5
- package/lib/esm/resources/free_gift_promotions.d.ts +88 -69
- package/lib/esm/resources/free_gift_promotions.js +25 -5
- package/lib/esm/resources/free_shipping_promotions.d.ts +86 -59
- package/lib/esm/resources/free_shipping_promotions.js +27 -3
- package/lib/esm/resources/geocoders.d.ts +12 -13
- package/lib/esm/resources/geocoders.js +8 -0
- package/lib/esm/resources/gift_card_recipients.d.ts +27 -25
- package/lib/esm/resources/gift_card_recipients.js +15 -3
- package/lib/esm/resources/gift_cards.d.ts +68 -66
- package/lib/esm/resources/gift_cards.js +15 -3
- package/lib/esm/resources/google_geocoders.d.ts +15 -16
- package/lib/esm/resources/google_geocoders.js +11 -3
- package/lib/esm/resources/imports.d.ts +29 -32
- package/lib/esm/resources/imports.js +10 -2
- package/lib/esm/resources/in_stock_subscriptions.d.ts +37 -35
- package/lib/esm/resources/in_stock_subscriptions.js +15 -3
- package/lib/esm/resources/inventory_models.d.ts +33 -22
- package/lib/esm/resources/inventory_models.js +15 -3
- package/lib/esm/resources/inventory_return_locations.d.ts +23 -21
- package/lib/esm/resources/inventory_return_locations.js +15 -3
- package/lib/esm/resources/inventory_stock_locations.d.ts +26 -24
- package/lib/esm/resources/inventory_stock_locations.js +15 -3
- package/lib/esm/resources/klarna_gateways.d.ts +24 -22
- package/lib/esm/resources/klarna_gateways.js +15 -3
- package/lib/esm/resources/klarna_payments.d.ts +29 -27
- package/lib/esm/resources/klarna_payments.js +15 -3
- package/lib/esm/resources/line_item_options.d.ts +40 -41
- package/lib/esm/resources/line_item_options.js +11 -3
- package/lib/esm/resources/line_items.d.ts +105 -87
- package/lib/esm/resources/line_items.js +19 -3
- package/lib/esm/resources/manual_gateways.d.ts +16 -14
- package/lib/esm/resources/manual_gateways.js +15 -3
- package/lib/esm/resources/manual_tax_calculators.d.ts +22 -20
- package/lib/esm/resources/manual_tax_calculators.js +15 -3
- package/lib/esm/resources/markets.d.ts +66 -59
- package/lib/esm/resources/markets.js +15 -3
- package/lib/esm/resources/merchants.d.ts +20 -18
- package/lib/esm/resources/merchants.js +15 -3
- package/lib/esm/resources/order_amount_promotion_rules.d.ts +40 -31
- package/lib/esm/resources/order_amount_promotion_rules.js +15 -3
- package/lib/esm/resources/order_copies.d.ts +28 -29
- package/lib/esm/resources/order_copies.js +11 -3
- package/lib/esm/resources/order_factories.d.ts +20 -21
- package/lib/esm/resources/order_factories.js +8 -0
- package/lib/esm/resources/order_subscription_items.d.ts +41 -35
- package/lib/esm/resources/order_subscription_items.js +15 -3
- package/lib/esm/resources/order_subscriptions.d.ts +54 -51
- package/lib/esm/resources/order_subscriptions.js +15 -3
- package/lib/esm/resources/order_validation_rules.d.ts +14 -12
- package/lib/esm/resources/order_validation_rules.js +12 -0
- package/lib/esm/resources/orders.d.ts +266 -231
- package/lib/esm/resources/orders.js +39 -3
- package/lib/esm/resources/organization.d.ts +24 -25
- package/lib/esm/resources/organization.js +7 -2
- package/lib/esm/resources/packages.d.ts +32 -30
- package/lib/esm/resources/packages.js +15 -3
- package/lib/esm/resources/parcel_line_items.d.ts +24 -22
- package/lib/esm/resources/parcel_line_items.js +15 -3
- package/lib/esm/resources/parcels.d.ts +95 -93
- package/lib/esm/resources/parcels.js +15 -3
- package/lib/esm/resources/payment_gateways.d.ts +14 -12
- package/lib/esm/resources/payment_gateways.js +12 -0
- package/lib/esm/resources/payment_methods.d.ts +55 -48
- package/lib/esm/resources/payment_methods.js +15 -3
- 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 +19 -17
- package/lib/esm/resources/paypal_gateways.js +15 -3
- package/lib/esm/resources/paypal_payments.d.ts +33 -31
- package/lib/esm/resources/paypal_payments.js +15 -3
- package/lib/esm/resources/percentage_discount_promotions.d.ts +88 -69
- package/lib/esm/resources/percentage_discount_promotions.js +25 -5
- package/lib/esm/resources/price_frequency_tiers.d.ts +28 -26
- package/lib/esm/resources/price_frequency_tiers.js +15 -3
- package/lib/esm/resources/price_lists.d.ts +25 -20
- package/lib/esm/resources/price_lists.js +15 -3
- package/lib/esm/resources/price_tiers.d.ts +19 -17
- package/lib/esm/resources/price_tiers.js +12 -0
- package/lib/esm/resources/price_volume_tiers.d.ts +28 -26
- package/lib/esm/resources/price_volume_tiers.js +15 -3
- package/lib/esm/resources/prices.d.ts +42 -40
- package/lib/esm/resources/prices.js +15 -3
- package/lib/esm/resources/promotion_rules.d.ts +14 -10
- package/lib/esm/resources/promotion_rules.js +12 -0
- package/lib/esm/resources/promotions.d.ts +39 -25
- package/lib/esm/resources/promotions.js +24 -0
- package/lib/esm/resources/recurring_order_copies.d.ts +28 -29
- package/lib/esm/resources/recurring_order_copies.js +11 -3
- package/lib/esm/resources/refunds.d.ts +31 -26
- package/lib/esm/resources/refunds.js +18 -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 +27 -27
- package/lib/esm/resources/return_line_items.js +11 -3
- package/lib/esm/resources/returns.d.ts +51 -49
- package/lib/esm/resources/returns.js +15 -3
- package/lib/esm/resources/satispay_gateways.d.ts +24 -22
- package/lib/esm/resources/satispay_gateways.js +15 -3
- package/lib/esm/resources/satispay_payments.d.ts +31 -21
- package/lib/esm/resources/satispay_payments.js +15 -3
- package/lib/esm/resources/shipments.d.ts +98 -52
- package/lib/esm/resources/shipments.js +27 -1
- package/lib/esm/resources/shipping_categories.d.ts +20 -15
- package/lib/esm/resources/shipping_categories.js +15 -3
- package/lib/esm/resources/shipping_method_tiers.d.ts +19 -17
- package/lib/esm/resources/shipping_method_tiers.js +12 -0
- package/lib/esm/resources/shipping_methods.d.ts +81 -71
- package/lib/esm/resources/shipping_methods.js +15 -3
- package/lib/esm/resources/shipping_weight_tiers.d.ts +27 -25
- package/lib/esm/resources/shipping_weight_tiers.js +15 -3
- package/lib/esm/resources/shipping_zones.d.ts +34 -32
- package/lib/esm/resources/shipping_zones.js +15 -3
- package/lib/esm/resources/sku_list_items.d.ts +28 -26
- package/lib/esm/resources/sku_list_items.js +15 -3
- package/lib/esm/resources/sku_list_promotion_rules.d.ts +44 -38
- package/lib/esm/resources/sku_list_promotion_rules.js +15 -3
- package/lib/esm/resources/sku_lists.d.ts +37 -35
- package/lib/esm/resources/sku_lists.js +15 -3
- package/lib/esm/resources/sku_options.d.ts +45 -43
- package/lib/esm/resources/sku_options.js +15 -3
- package/lib/esm/resources/skus.d.ts +60 -55
- package/lib/esm/resources/skus.js +19 -3
- package/lib/esm/resources/stock_items.d.ts +34 -26
- package/lib/esm/resources/stock_items.js +23 -3
- package/lib/esm/resources/stock_line_items.d.ts +54 -15
- package/lib/esm/resources/stock_line_items.js +25 -0
- package/lib/esm/resources/stock_locations.d.ts +34 -29
- package/lib/esm/resources/stock_locations.js +15 -3
- 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 +46 -42
- package/lib/esm/resources/stock_transfers.js +15 -3
- package/lib/esm/resources/stripe_gateways.d.ts +24 -22
- package/lib/esm/resources/stripe_gateways.js +15 -3
- package/lib/esm/resources/stripe_payments.d.ts +39 -28
- package/lib/esm/resources/stripe_payments.js +15 -3
- package/lib/esm/resources/subscription_models.d.ts +26 -27
- package/lib/esm/resources/subscription_models.js +11 -3
- package/lib/esm/resources/tags.d.ts +12 -13
- package/lib/esm/resources/tags.js +11 -3
- package/lib/esm/resources/tax_calculators.d.ts +15 -13
- package/lib/esm/resources/tax_calculators.js +12 -0
- package/lib/esm/resources/tax_categories.d.ts +32 -30
- package/lib/esm/resources/tax_categories.js +15 -3
- package/lib/esm/resources/tax_rules.d.ts +53 -51
- package/lib/esm/resources/tax_rules.js +15 -3
- package/lib/esm/resources/taxjar_accounts.d.ts +23 -21
- package/lib/esm/resources/taxjar_accounts.js +15 -3
- package/lib/esm/resources/transactions.d.ts +30 -22
- package/lib/esm/resources/transactions.js +20 -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 +31 -26
- package/lib/esm/resources/voids.js +18 -2
- package/lib/esm/resources/webhooks.d.ts +33 -26
- package/lib/esm/resources/webhooks.js +15 -3
- package/lib/esm/resources/wire_transfers.d.ts +18 -16
- package/lib/esm/resources/wire_transfers.js +15 -3
- package/lib/esm/static.d.ts +1 -1
- package/lib/esm/util.d.ts +4 -1
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +25 -25
- package/lib/cjs/micro.d.ts +0 -4
- package/lib/cjs/micro.js +0 -13
- package/lib/esm/micro.d.ts +0 -4
- package/lib/esm/micro.js +0 -7
@@ -1,100 +1,130 @@
|
|
1
|
-
import { ApiResource } from '../resource';
|
2
|
-
import type {
|
3
|
-
import type {
|
4
|
-
import type {
|
5
|
-
import type {
|
6
|
-
import type {
|
7
|
-
import type {
|
8
|
-
import type {
|
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';
|
9
11
|
import type { Attachment } from './attachments';
|
10
12
|
import type { Event } from './events';
|
11
|
-
import type { Tag
|
12
|
-
type
|
13
|
+
import type { Tag } from './tags';
|
14
|
+
import type { Version } from './versions';
|
15
|
+
import type { Sku } from './skus';
|
13
16
|
type FixedAmountPromotionRel = ResourceRel & {
|
14
|
-
type:
|
17
|
+
type: typeof FixedAmountPromotions.TYPE;
|
15
18
|
};
|
16
19
|
type MarketRel = ResourceRel & {
|
17
|
-
type:
|
18
|
-
};
|
19
|
-
type PromotionRuleRel = ResourceRel & {
|
20
|
-
type: PromotionRuleType;
|
20
|
+
type: 'markets';
|
21
21
|
};
|
22
22
|
type OrderAmountPromotionRuleRel = ResourceRel & {
|
23
|
-
type:
|
23
|
+
type: 'order_amount_promotion_rules';
|
24
24
|
};
|
25
25
|
type SkuListPromotionRuleRel = ResourceRel & {
|
26
|
-
type:
|
26
|
+
type: 'sku_list_promotion_rules';
|
27
27
|
};
|
28
28
|
type CouponCodesPromotionRuleRel = ResourceRel & {
|
29
|
-
type:
|
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';
|
30
36
|
};
|
31
37
|
type TagRel = ResourceRel & {
|
32
|
-
type:
|
38
|
+
type: 'tags';
|
33
39
|
};
|
34
40
|
interface FixedAmountPromotion extends Resource {
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
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
|
+
fixed_amount_cents?: number;
|
52
|
+
fixed_amount_float?: number;
|
53
|
+
formatted_fixed_amount?: string;
|
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[];
|
54
67
|
}
|
55
68
|
interface FixedAmountPromotionCreate extends ResourceCreate {
|
56
69
|
name: string;
|
57
|
-
currency_code?: string
|
70
|
+
currency_code?: string;
|
71
|
+
exclusive?: boolean;
|
72
|
+
priority?: number;
|
58
73
|
starts_at: string;
|
59
74
|
expires_at: string;
|
60
|
-
total_usage_limit
|
75
|
+
total_usage_limit?: number;
|
76
|
+
_disable?: boolean;
|
77
|
+
_enable?: boolean;
|
61
78
|
fixed_amount_cents: number;
|
62
|
-
market?: MarketRel
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
79
|
+
market?: MarketRel;
|
80
|
+
order_amount_promotion_rule?: OrderAmountPromotionRuleRel;
|
81
|
+
sku_list_promotion_rule?: SkuListPromotionRuleRel;
|
82
|
+
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel;
|
83
|
+
custom_promotion_rule?: CustomPromotionRuleRel;
|
84
|
+
sku_list?: SkuListRel;
|
85
|
+
tags?: TagRel[];
|
68
86
|
}
|
69
87
|
interface FixedAmountPromotionUpdate extends ResourceUpdate {
|
70
|
-
name?: string
|
71
|
-
currency_code?: string
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
88
|
+
name?: string;
|
89
|
+
currency_code?: string;
|
90
|
+
exclusive?: boolean;
|
91
|
+
priority?: number;
|
92
|
+
starts_at?: string;
|
93
|
+
expires_at?: string;
|
94
|
+
total_usage_limit?: number;
|
95
|
+
_disable?: boolean;
|
96
|
+
_enable?: boolean;
|
97
|
+
fixed_amount_cents?: number;
|
98
|
+
market?: MarketRel;
|
99
|
+
order_amount_promotion_rule?: OrderAmountPromotionRuleRel;
|
100
|
+
sku_list_promotion_rule?: SkuListPromotionRuleRel;
|
101
|
+
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel;
|
102
|
+
custom_promotion_rule?: CustomPromotionRuleRel;
|
103
|
+
sku_list?: SkuListRel;
|
104
|
+
tags?: TagRel[];
|
82
105
|
}
|
83
|
-
declare class FixedAmountPromotions extends ApiResource
|
84
|
-
static readonly TYPE:
|
106
|
+
declare class FixedAmountPromotions extends ApiResource {
|
107
|
+
static readonly TYPE: 'fixed_amount_promotions';
|
108
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<FixedAmountPromotion>>;
|
85
109
|
create(resource: FixedAmountPromotionCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<FixedAmountPromotion>;
|
110
|
+
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<FixedAmountPromotion>;
|
86
111
|
update(resource: FixedAmountPromotionUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<FixedAmountPromotion>;
|
87
|
-
delete(id: string
|
112
|
+
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
88
113
|
market(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
|
89
114
|
order_amount_promotion_rule(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
90
115
|
sku_list_promotion_rule(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
91
116
|
coupon_codes_promotion_rule(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
117
|
+
custom_promotion_rule(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
|
118
|
+
sku_list(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
119
|
+
coupons(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
|
92
120
|
attachments(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
93
121
|
events(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
94
122
|
tags(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
123
|
+
versions(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
124
|
+
skus(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Sku>>;
|
95
125
|
isFixedAmountPromotion(resource: any): resource is FixedAmountPromotion;
|
96
126
|
relationship(id: string | ResourceId | null): FixedAmountPromotionRel;
|
97
|
-
type():
|
127
|
+
type(): string;
|
98
128
|
}
|
99
129
|
export default FixedAmountPromotions;
|
100
|
-
export
|
130
|
+
export { FixedAmountPromotion, FixedAmountPromotionCreate, FixedAmountPromotionUpdate };
|
@@ -2,14 +2,21 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class FixedAmountPromotions extends resource_1.ApiResource {
|
5
|
+
// static readonly PATH = 'fixed_amount_promotions'
|
6
|
+
async list(params, options) {
|
7
|
+
return this.resources.list({ type: FixedAmountPromotions.TYPE }, params, options);
|
8
|
+
}
|
5
9
|
async create(resource, params, options) {
|
6
|
-
return this.resources.create({
|
10
|
+
return this.resources.create(Object.assign(Object.assign({}, resource), { type: FixedAmountPromotions.TYPE }), params, options);
|
11
|
+
}
|
12
|
+
async retrieve(id, params, options) {
|
13
|
+
return this.resources.retrieve({ type: FixedAmountPromotions.TYPE, id }, params, options);
|
7
14
|
}
|
8
15
|
async update(resource, params, options) {
|
9
|
-
return this.resources.update({
|
16
|
+
return this.resources.update(Object.assign(Object.assign({}, resource), { type: FixedAmountPromotions.TYPE }), params, options);
|
10
17
|
}
|
11
18
|
async delete(id, options) {
|
12
|
-
await this.resources.delete(
|
19
|
+
await this.resources.delete({ type: FixedAmountPromotions.TYPE, id }, options);
|
13
20
|
}
|
14
21
|
async market(fixedAmountPromotionId, params, options) {
|
15
22
|
const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
|
@@ -27,6 +34,18 @@ class FixedAmountPromotions extends resource_1.ApiResource {
|
|
27
34
|
const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
|
28
35
|
return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/coupon_codes_promotion_rule`, params, options);
|
29
36
|
}
|
37
|
+
async custom_promotion_rule(fixedAmountPromotionId, params, options) {
|
38
|
+
const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
|
39
|
+
return this.resources.fetch({ type: 'custom_promotion_rules' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/custom_promotion_rule`, params, options);
|
40
|
+
}
|
41
|
+
async sku_list(fixedAmountPromotionId, params, options) {
|
42
|
+
const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
|
43
|
+
return this.resources.fetch({ type: 'sku_lists' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/sku_list`, params, options);
|
44
|
+
}
|
45
|
+
async coupons(fixedAmountPromotionId, params, options) {
|
46
|
+
const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
|
47
|
+
return this.resources.fetch({ type: 'coupons' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/coupons`, params, options);
|
48
|
+
}
|
30
49
|
async attachments(fixedAmountPromotionId, params, options) {
|
31
50
|
const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
|
32
51
|
return this.resources.fetch({ type: 'attachments' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/attachments`, params, options);
|
@@ -39,6 +58,15 @@ class FixedAmountPromotions extends resource_1.ApiResource {
|
|
39
58
|
const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
|
40
59
|
return this.resources.fetch({ type: 'tags' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/tags`, params, options);
|
41
60
|
}
|
61
|
+
async versions(fixedAmountPromotionId, params, options) {
|
62
|
+
const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
|
63
|
+
return this.resources.fetch({ type: 'versions' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/versions`, params, options);
|
64
|
+
}
|
65
|
+
async skus(fixedAmountPromotionId, params, options) {
|
66
|
+
const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
|
67
|
+
return this.resources.fetch({ type: 'skus' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/skus`, params, options);
|
68
|
+
}
|
69
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
42
70
|
isFixedAmountPromotion(resource) {
|
43
71
|
return resource.type && (resource.type === FixedAmountPromotions.TYPE);
|
44
72
|
}
|
@@ -1,111 +1,130 @@
|
|
1
|
-
import { ApiResource } from '../resource';
|
2
|
-
import type {
|
3
|
-
import type {
|
4
|
-
import type {
|
5
|
-
import type {
|
6
|
-
import type {
|
7
|
-
import type {
|
8
|
-
import type {
|
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';
|
9
11
|
import type { Attachment } from './attachments';
|
10
12
|
import type { Event } from './events';
|
11
|
-
import type { Tag
|
12
|
-
import type {
|
13
|
+
import type { Tag } from './tags';
|
14
|
+
import type { Version } from './versions';
|
13
15
|
import type { Sku } from './skus';
|
14
|
-
type FixedPricePromotionType = 'fixed_price_promotions';
|
15
16
|
type FixedPricePromotionRel = ResourceRel & {
|
16
|
-
type:
|
17
|
+
type: typeof FixedPricePromotions.TYPE;
|
17
18
|
};
|
18
19
|
type MarketRel = ResourceRel & {
|
19
|
-
type:
|
20
|
-
};
|
21
|
-
type PromotionRuleRel = ResourceRel & {
|
22
|
-
type: PromotionRuleType;
|
20
|
+
type: 'markets';
|
23
21
|
};
|
24
22
|
type OrderAmountPromotionRuleRel = ResourceRel & {
|
25
|
-
type:
|
23
|
+
type: 'order_amount_promotion_rules';
|
26
24
|
};
|
27
25
|
type SkuListPromotionRuleRel = ResourceRel & {
|
28
|
-
type:
|
26
|
+
type: 'sku_list_promotion_rules';
|
29
27
|
};
|
30
28
|
type CouponCodesPromotionRuleRel = ResourceRel & {
|
31
|
-
type:
|
29
|
+
type: 'coupon_codes_promotion_rules';
|
32
30
|
};
|
33
|
-
type
|
34
|
-
type:
|
31
|
+
type CustomPromotionRuleRel = ResourceRel & {
|
32
|
+
type: 'custom_promotion_rules';
|
35
33
|
};
|
36
34
|
type SkuListRel = ResourceRel & {
|
37
|
-
type:
|
35
|
+
type: 'sku_lists';
|
36
|
+
};
|
37
|
+
type TagRel = ResourceRel & {
|
38
|
+
type: 'tags';
|
38
39
|
};
|
39
40
|
interface FixedPricePromotion extends Resource {
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
sku_list?: SkuList
|
60
|
-
|
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
|
+
fixed_amount_cents?: number;
|
52
|
+
fixed_amount_float?: number;
|
53
|
+
formatted_fixed_amount?: string;
|
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[];
|
61
67
|
}
|
62
68
|
interface FixedPricePromotionCreate extends ResourceCreate {
|
63
69
|
name: string;
|
64
|
-
currency_code?: string
|
70
|
+
currency_code?: string;
|
71
|
+
exclusive?: boolean;
|
72
|
+
priority?: number;
|
65
73
|
starts_at: string;
|
66
74
|
expires_at: string;
|
67
|
-
total_usage_limit
|
75
|
+
total_usage_limit?: number;
|
76
|
+
_disable?: boolean;
|
77
|
+
_enable?: boolean;
|
68
78
|
fixed_amount_cents: number;
|
69
|
-
market?: MarketRel
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
tags?: TagRel[] | null;
|
79
|
+
market?: MarketRel;
|
80
|
+
order_amount_promotion_rule?: OrderAmountPromotionRuleRel;
|
81
|
+
sku_list_promotion_rule?: SkuListPromotionRuleRel;
|
82
|
+
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel;
|
83
|
+
custom_promotion_rule?: CustomPromotionRuleRel;
|
75
84
|
sku_list: SkuListRel;
|
85
|
+
tags?: TagRel[];
|
76
86
|
}
|
77
87
|
interface FixedPricePromotionUpdate extends ResourceUpdate {
|
78
|
-
name?: string
|
79
|
-
currency_code?: string
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
88
|
+
name?: string;
|
89
|
+
currency_code?: string;
|
90
|
+
exclusive?: boolean;
|
91
|
+
priority?: number;
|
92
|
+
starts_at?: string;
|
93
|
+
expires_at?: string;
|
94
|
+
total_usage_limit?: number;
|
95
|
+
_disable?: boolean;
|
96
|
+
_enable?: boolean;
|
97
|
+
fixed_amount_cents?: number;
|
98
|
+
market?: MarketRel;
|
99
|
+
order_amount_promotion_rule?: OrderAmountPromotionRuleRel;
|
100
|
+
sku_list_promotion_rule?: SkuListPromotionRuleRel;
|
101
|
+
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel;
|
102
|
+
custom_promotion_rule?: CustomPromotionRuleRel;
|
103
|
+
sku_list?: SkuListRel;
|
104
|
+
tags?: TagRel[];
|
91
105
|
}
|
92
|
-
declare class FixedPricePromotions extends ApiResource
|
93
|
-
static readonly TYPE:
|
106
|
+
declare class FixedPricePromotions extends ApiResource {
|
107
|
+
static readonly TYPE: 'fixed_price_promotions';
|
108
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<FixedPricePromotion>>;
|
94
109
|
create(resource: FixedPricePromotionCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<FixedPricePromotion>;
|
110
|
+
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<FixedPricePromotion>;
|
95
111
|
update(resource: FixedPricePromotionUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<FixedPricePromotion>;
|
96
|
-
delete(id: string
|
112
|
+
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
97
113
|
market(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
|
98
114
|
order_amount_promotion_rule(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
99
115
|
sku_list_promotion_rule(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
100
116
|
coupon_codes_promotion_rule(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
117
|
+
custom_promotion_rule(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
|
118
|
+
sku_list(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
119
|
+
coupons(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
|
101
120
|
attachments(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
102
121
|
events(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
103
122
|
tags(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
104
|
-
|
123
|
+
versions(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
105
124
|
skus(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Sku>>;
|
106
125
|
isFixedPricePromotion(resource: any): resource is FixedPricePromotion;
|
107
126
|
relationship(id: string | ResourceId | null): FixedPricePromotionRel;
|
108
|
-
type():
|
127
|
+
type(): string;
|
109
128
|
}
|
110
129
|
export default FixedPricePromotions;
|
111
|
-
export
|
130
|
+
export { FixedPricePromotion, FixedPricePromotionCreate, FixedPricePromotionUpdate };
|
@@ -2,14 +2,21 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class FixedPricePromotions extends resource_1.ApiResource {
|
5
|
+
// static readonly PATH = 'fixed_price_promotions'
|
6
|
+
async list(params, options) {
|
7
|
+
return this.resources.list({ type: FixedPricePromotions.TYPE }, params, options);
|
8
|
+
}
|
5
9
|
async create(resource, params, options) {
|
6
|
-
return this.resources.create({
|
10
|
+
return this.resources.create(Object.assign(Object.assign({}, resource), { type: FixedPricePromotions.TYPE }), params, options);
|
11
|
+
}
|
12
|
+
async retrieve(id, params, options) {
|
13
|
+
return this.resources.retrieve({ type: FixedPricePromotions.TYPE, id }, params, options);
|
7
14
|
}
|
8
15
|
async update(resource, params, options) {
|
9
|
-
return this.resources.update({
|
16
|
+
return this.resources.update(Object.assign(Object.assign({}, resource), { type: FixedPricePromotions.TYPE }), params, options);
|
10
17
|
}
|
11
18
|
async delete(id, options) {
|
12
|
-
await this.resources.delete(
|
19
|
+
await this.resources.delete({ type: FixedPricePromotions.TYPE, id }, options);
|
13
20
|
}
|
14
21
|
async market(fixedPricePromotionId, params, options) {
|
15
22
|
const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
|
@@ -27,6 +34,18 @@ class FixedPricePromotions extends resource_1.ApiResource {
|
|
27
34
|
const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
|
28
35
|
return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `fixed_price_promotions/${_fixedPricePromotionId}/coupon_codes_promotion_rule`, params, options);
|
29
36
|
}
|
37
|
+
async custom_promotion_rule(fixedPricePromotionId, params, options) {
|
38
|
+
const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
|
39
|
+
return this.resources.fetch({ type: 'custom_promotion_rules' }, `fixed_price_promotions/${_fixedPricePromotionId}/custom_promotion_rule`, params, options);
|
40
|
+
}
|
41
|
+
async sku_list(fixedPricePromotionId, params, options) {
|
42
|
+
const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
|
43
|
+
return this.resources.fetch({ type: 'sku_lists' }, `fixed_price_promotions/${_fixedPricePromotionId}/sku_list`, params, options);
|
44
|
+
}
|
45
|
+
async coupons(fixedPricePromotionId, params, options) {
|
46
|
+
const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
|
47
|
+
return this.resources.fetch({ type: 'coupons' }, `fixed_price_promotions/${_fixedPricePromotionId}/coupons`, params, options);
|
48
|
+
}
|
30
49
|
async attachments(fixedPricePromotionId, params, options) {
|
31
50
|
const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
|
32
51
|
return this.resources.fetch({ type: 'attachments' }, `fixed_price_promotions/${_fixedPricePromotionId}/attachments`, params, options);
|
@@ -39,14 +58,15 @@ class FixedPricePromotions extends resource_1.ApiResource {
|
|
39
58
|
const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
|
40
59
|
return this.resources.fetch({ type: 'tags' }, `fixed_price_promotions/${_fixedPricePromotionId}/tags`, params, options);
|
41
60
|
}
|
42
|
-
async
|
61
|
+
async versions(fixedPricePromotionId, params, options) {
|
43
62
|
const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
|
44
|
-
return this.resources.fetch({ type: '
|
63
|
+
return this.resources.fetch({ type: 'versions' }, `fixed_price_promotions/${_fixedPricePromotionId}/versions`, params, options);
|
45
64
|
}
|
46
65
|
async skus(fixedPricePromotionId, params, options) {
|
47
66
|
const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
|
48
67
|
return this.resources.fetch({ type: 'skus' }, `fixed_price_promotions/${_fixedPricePromotionId}/skus`, params, options);
|
49
68
|
}
|
69
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
50
70
|
isFixedPricePromotion(resource) {
|
51
71
|
return resource.type && (resource.type === FixedPricePromotions.TYPE);
|
52
72
|
}
|