@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,13 +1,20 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class ShippingMethods extends ApiResource {
|
3
|
+
// static readonly PATH = 'shipping_methods'
|
4
|
+
async list(params, options) {
|
5
|
+
return this.resources.list({ type: ShippingMethods.TYPE }, params, options);
|
6
|
+
}
|
3
7
|
async create(resource, params, options) {
|
4
|
-
return this.resources.create({
|
8
|
+
return this.resources.create(Object.assign(Object.assign({}, resource), { type: ShippingMethods.TYPE }), params, options);
|
9
|
+
}
|
10
|
+
async retrieve(id, params, options) {
|
11
|
+
return this.resources.retrieve({ type: ShippingMethods.TYPE, id }, params, options);
|
5
12
|
}
|
6
13
|
async update(resource, params, options) {
|
7
|
-
return this.resources.update({
|
14
|
+
return this.resources.update(Object.assign(Object.assign({}, resource), { type: ShippingMethods.TYPE }), params, options);
|
8
15
|
}
|
9
16
|
async delete(id, options) {
|
10
|
-
await this.resources.delete(
|
17
|
+
await this.resources.delete({ type: ShippingMethods.TYPE, id }, options);
|
11
18
|
}
|
12
19
|
async market(shippingMethodId, params, options) {
|
13
20
|
const _shippingMethodId = shippingMethodId.id || shippingMethodId;
|
@@ -41,6 +48,11 @@ class ShippingMethods extends ApiResource {
|
|
41
48
|
const _shippingMethodId = shippingMethodId.id || shippingMethodId;
|
42
49
|
return this.resources.fetch({ type: 'attachments' }, `shipping_methods/${_shippingMethodId}/attachments`, params, options);
|
43
50
|
}
|
51
|
+
async versions(shippingMethodId, params, options) {
|
52
|
+
const _shippingMethodId = shippingMethodId.id || shippingMethodId;
|
53
|
+
return this.resources.fetch({ type: 'versions' }, `shipping_methods/${_shippingMethodId}/versions`, params, options);
|
54
|
+
}
|
55
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
44
56
|
isShippingMethod(resource) {
|
45
57
|
return resource.type && (resource.type === ShippingMethods.TYPE);
|
46
58
|
}
|
@@ -1,47 +1,49 @@
|
|
1
|
-
import { ApiResource } from '../resource';
|
2
|
-
import type {
|
3
|
-
import type {
|
4
|
-
import type { ShippingMethod, ShippingMethodType } from './shipping_methods';
|
1
|
+
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
+
import type { ShippingMethod } from './shipping_methods';
|
5
4
|
import type { Attachment } from './attachments';
|
6
|
-
type
|
5
|
+
import type { Version } from './versions';
|
7
6
|
type ShippingWeightTierRel = ResourceRel & {
|
8
|
-
type:
|
7
|
+
type: typeof ShippingWeightTiers.TYPE;
|
9
8
|
};
|
10
9
|
type ShippingMethodRel = ResourceRel & {
|
11
|
-
type:
|
10
|
+
type: 'shipping_methods';
|
12
11
|
};
|
13
12
|
interface ShippingWeightTier extends Resource {
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
13
|
+
name?: string;
|
14
|
+
up_to?: number;
|
15
|
+
price_amount_cents?: number;
|
16
|
+
price_amount_float?: number;
|
17
|
+
formatted_price_amount?: string;
|
18
|
+
shipping_method?: ShippingMethod;
|
19
|
+
attachments?: Attachment[];
|
20
|
+
versions?: Version[];
|
22
21
|
}
|
23
22
|
interface ShippingWeightTierCreate extends ResourceCreate {
|
24
23
|
name: string;
|
25
|
-
up_to?: number
|
24
|
+
up_to?: number;
|
26
25
|
price_amount_cents: number;
|
27
26
|
shipping_method: ShippingMethodRel;
|
28
27
|
}
|
29
28
|
interface ShippingWeightTierUpdate extends ResourceUpdate {
|
30
|
-
name?: string
|
31
|
-
up_to?: number
|
32
|
-
price_amount_cents?: number
|
33
|
-
shipping_method?: ShippingMethodRel
|
29
|
+
name?: string;
|
30
|
+
up_to?: number;
|
31
|
+
price_amount_cents?: number;
|
32
|
+
shipping_method?: ShippingMethodRel;
|
34
33
|
}
|
35
|
-
declare class ShippingWeightTiers extends ApiResource
|
36
|
-
static readonly TYPE:
|
34
|
+
declare class ShippingWeightTiers extends ApiResource {
|
35
|
+
static readonly TYPE: 'shipping_weight_tiers';
|
36
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ShippingWeightTier>>;
|
37
37
|
create(resource: ShippingWeightTierCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingWeightTier>;
|
38
|
+
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingWeightTier>;
|
38
39
|
update(resource: ShippingWeightTierUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingWeightTier>;
|
39
|
-
delete(id: string
|
40
|
+
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
40
41
|
shipping_method(shippingWeightTierId: string | ShippingWeightTier, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingMethod>;
|
41
42
|
attachments(shippingWeightTierId: string | ShippingWeightTier, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
43
|
+
versions(shippingWeightTierId: string | ShippingWeightTier, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
42
44
|
isShippingWeightTier(resource: any): resource is ShippingWeightTier;
|
43
45
|
relationship(id: string | ResourceId | null): ShippingWeightTierRel;
|
44
|
-
type():
|
46
|
+
type(): string;
|
45
47
|
}
|
46
48
|
export default ShippingWeightTiers;
|
47
|
-
export
|
49
|
+
export { ShippingWeightTier, ShippingWeightTierCreate, ShippingWeightTierUpdate };
|
@@ -1,13 +1,20 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class ShippingWeightTiers extends ApiResource {
|
3
|
+
// static readonly PATH = 'shipping_weight_tiers'
|
4
|
+
async list(params, options) {
|
5
|
+
return this.resources.list({ type: ShippingWeightTiers.TYPE }, params, options);
|
6
|
+
}
|
3
7
|
async create(resource, params, options) {
|
4
|
-
return this.resources.create({
|
8
|
+
return this.resources.create(Object.assign(Object.assign({}, resource), { type: ShippingWeightTiers.TYPE }), params, options);
|
9
|
+
}
|
10
|
+
async retrieve(id, params, options) {
|
11
|
+
return this.resources.retrieve({ type: ShippingWeightTiers.TYPE, id }, params, options);
|
5
12
|
}
|
6
13
|
async update(resource, params, options) {
|
7
|
-
return this.resources.update({
|
14
|
+
return this.resources.update(Object.assign(Object.assign({}, resource), { type: ShippingWeightTiers.TYPE }), params, options);
|
8
15
|
}
|
9
16
|
async delete(id, options) {
|
10
|
-
await this.resources.delete(
|
17
|
+
await this.resources.delete({ type: ShippingWeightTiers.TYPE, id }, options);
|
11
18
|
}
|
12
19
|
async shipping_method(shippingWeightTierId, params, options) {
|
13
20
|
const _shippingWeightTierId = shippingWeightTierId.id || shippingWeightTierId;
|
@@ -17,6 +24,11 @@ class ShippingWeightTiers extends ApiResource {
|
|
17
24
|
const _shippingWeightTierId = shippingWeightTierId.id || shippingWeightTierId;
|
18
25
|
return this.resources.fetch({ type: 'attachments' }, `shipping_weight_tiers/${_shippingWeightTierId}/attachments`, params, options);
|
19
26
|
}
|
27
|
+
async versions(shippingWeightTierId, params, options) {
|
28
|
+
const _shippingWeightTierId = shippingWeightTierId.id || shippingWeightTierId;
|
29
|
+
return this.resources.fetch({ type: 'versions' }, `shipping_weight_tiers/${_shippingWeightTierId}/versions`, params, options);
|
30
|
+
}
|
31
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
20
32
|
isShippingWeightTier(resource) {
|
21
33
|
return resource.type && (resource.type === ShippingWeightTiers.TYPE);
|
22
34
|
}
|
@@ -1,49 +1,51 @@
|
|
1
|
-
import { ApiResource } from '../resource';
|
2
|
-
import type {
|
3
|
-
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
1
|
+
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
4
3
|
import type { Attachment } from './attachments';
|
5
|
-
type
|
4
|
+
import type { Version } from './versions';
|
6
5
|
type ShippingZoneRel = ResourceRel & {
|
7
|
-
type:
|
6
|
+
type: typeof ShippingZones.TYPE;
|
8
7
|
};
|
9
8
|
interface ShippingZone extends Resource {
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
9
|
+
name?: string;
|
10
|
+
country_code_regex?: string;
|
11
|
+
not_country_code_regex?: string;
|
12
|
+
state_code_regex?: string;
|
13
|
+
not_state_code_regex?: string;
|
14
|
+
zip_code_regex?: string;
|
15
|
+
not_zip_code_regex?: string;
|
16
|
+
attachments?: Attachment[];
|
17
|
+
versions?: Version[];
|
19
18
|
}
|
20
19
|
interface ShippingZoneCreate extends ResourceCreate {
|
21
20
|
name: string;
|
22
|
-
country_code_regex?: string
|
23
|
-
not_country_code_regex?: string
|
24
|
-
state_code_regex?: string
|
25
|
-
not_state_code_regex?: string
|
26
|
-
zip_code_regex?: string
|
27
|
-
not_zip_code_regex?: string
|
21
|
+
country_code_regex?: string;
|
22
|
+
not_country_code_regex?: string;
|
23
|
+
state_code_regex?: string;
|
24
|
+
not_state_code_regex?: string;
|
25
|
+
zip_code_regex?: string;
|
26
|
+
not_zip_code_regex?: string;
|
28
27
|
}
|
29
28
|
interface ShippingZoneUpdate extends ResourceUpdate {
|
30
|
-
name?: string
|
31
|
-
country_code_regex?: string
|
32
|
-
not_country_code_regex?: string
|
33
|
-
state_code_regex?: string
|
34
|
-
not_state_code_regex?: string
|
35
|
-
zip_code_regex?: string
|
36
|
-
not_zip_code_regex?: string
|
29
|
+
name?: string;
|
30
|
+
country_code_regex?: string;
|
31
|
+
not_country_code_regex?: string;
|
32
|
+
state_code_regex?: string;
|
33
|
+
not_state_code_regex?: string;
|
34
|
+
zip_code_regex?: string;
|
35
|
+
not_zip_code_regex?: string;
|
37
36
|
}
|
38
|
-
declare class ShippingZones extends ApiResource
|
39
|
-
static readonly TYPE:
|
37
|
+
declare class ShippingZones extends ApiResource {
|
38
|
+
static readonly TYPE: 'shipping_zones';
|
39
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ShippingZone>>;
|
40
40
|
create(resource: ShippingZoneCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingZone>;
|
41
|
+
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingZone>;
|
41
42
|
update(resource: ShippingZoneUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingZone>;
|
42
|
-
delete(id: string
|
43
|
+
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
43
44
|
attachments(shippingZoneId: string | ShippingZone, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
45
|
+
versions(shippingZoneId: string | ShippingZone, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
44
46
|
isShippingZone(resource: any): resource is ShippingZone;
|
45
47
|
relationship(id: string | ResourceId | null): ShippingZoneRel;
|
46
|
-
type():
|
48
|
+
type(): string;
|
47
49
|
}
|
48
50
|
export default ShippingZones;
|
49
|
-
export
|
51
|
+
export { ShippingZone, ShippingZoneCreate, ShippingZoneUpdate };
|
@@ -1,18 +1,30 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class ShippingZones extends ApiResource {
|
3
|
+
// static readonly PATH = 'shipping_zones'
|
4
|
+
async list(params, options) {
|
5
|
+
return this.resources.list({ type: ShippingZones.TYPE }, params, options);
|
6
|
+
}
|
3
7
|
async create(resource, params, options) {
|
4
|
-
return this.resources.create({
|
8
|
+
return this.resources.create(Object.assign(Object.assign({}, resource), { type: ShippingZones.TYPE }), params, options);
|
9
|
+
}
|
10
|
+
async retrieve(id, params, options) {
|
11
|
+
return this.resources.retrieve({ type: ShippingZones.TYPE, id }, params, options);
|
5
12
|
}
|
6
13
|
async update(resource, params, options) {
|
7
|
-
return this.resources.update({
|
14
|
+
return this.resources.update(Object.assign(Object.assign({}, resource), { type: ShippingZones.TYPE }), params, options);
|
8
15
|
}
|
9
16
|
async delete(id, options) {
|
10
|
-
await this.resources.delete(
|
17
|
+
await this.resources.delete({ type: ShippingZones.TYPE, id }, options);
|
11
18
|
}
|
12
19
|
async attachments(shippingZoneId, params, options) {
|
13
20
|
const _shippingZoneId = shippingZoneId.id || shippingZoneId;
|
14
21
|
return this.resources.fetch({ type: 'attachments' }, `shipping_zones/${_shippingZoneId}/attachments`, params, options);
|
15
22
|
}
|
23
|
+
async versions(shippingZoneId, params, options) {
|
24
|
+
const _shippingZoneId = shippingZoneId.id || shippingZoneId;
|
25
|
+
return this.resources.fetch({ type: 'versions' }, `shipping_zones/${_shippingZoneId}/versions`, params, options);
|
26
|
+
}
|
27
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
16
28
|
isShippingZone(resource) {
|
17
29
|
return resource.type && (resource.type === ShippingZones.TYPE);
|
18
30
|
}
|
@@ -1,48 +1,50 @@
|
|
1
|
-
import { ApiResource } from '../resource';
|
2
|
-
import type {
|
3
|
-
import type {
|
4
|
-
import type {
|
5
|
-
import type {
|
6
|
-
type SkuListItemType = 'sku_list_items';
|
1
|
+
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
+
import type { SkuList } from './sku_lists';
|
4
|
+
import type { Sku } from './skus';
|
5
|
+
import type { Version } from './versions';
|
7
6
|
type SkuListItemRel = ResourceRel & {
|
8
|
-
type:
|
7
|
+
type: typeof SkuListItems.TYPE;
|
9
8
|
};
|
10
9
|
type SkuListRel = ResourceRel & {
|
11
|
-
type:
|
10
|
+
type: 'sku_lists';
|
12
11
|
};
|
13
12
|
type SkuRel = ResourceRel & {
|
14
|
-
type:
|
13
|
+
type: 'skus';
|
15
14
|
};
|
16
15
|
interface SkuListItem extends Resource {
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
16
|
+
position?: number;
|
17
|
+
sku_code?: string;
|
18
|
+
quantity?: number;
|
19
|
+
sku_list?: SkuList;
|
20
|
+
sku?: Sku;
|
21
|
+
versions?: Version[];
|
23
22
|
}
|
24
23
|
interface SkuListItemCreate extends ResourceCreate {
|
25
|
-
position?: number
|
26
|
-
sku_code?: string
|
27
|
-
quantity?: number
|
24
|
+
position?: number;
|
25
|
+
sku_code?: string;
|
26
|
+
quantity?: number;
|
28
27
|
sku_list: SkuListRel;
|
29
28
|
sku: SkuRel;
|
30
29
|
}
|
31
30
|
interface SkuListItemUpdate extends ResourceUpdate {
|
32
|
-
position?: number
|
33
|
-
sku_code?: string
|
34
|
-
quantity?: number
|
31
|
+
position?: number;
|
32
|
+
sku_code?: string;
|
33
|
+
quantity?: number;
|
35
34
|
}
|
36
|
-
declare class SkuListItems extends ApiResource
|
37
|
-
static readonly TYPE:
|
35
|
+
declare class SkuListItems extends ApiResource {
|
36
|
+
static readonly TYPE: 'sku_list_items';
|
37
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<SkuListItem>>;
|
38
38
|
create(resource: SkuListItemCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListItem>;
|
39
|
+
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListItem>;
|
39
40
|
update(resource: SkuListItemUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListItem>;
|
40
|
-
delete(id: string
|
41
|
+
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
41
42
|
sku_list(skuListItemId: string | SkuListItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
42
43
|
sku(skuListItemId: string | SkuListItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
|
44
|
+
versions(skuListItemId: string | SkuListItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
43
45
|
isSkuListItem(resource: any): resource is SkuListItem;
|
44
46
|
relationship(id: string | ResourceId | null): SkuListItemRel;
|
45
|
-
type():
|
47
|
+
type(): string;
|
46
48
|
}
|
47
49
|
export default SkuListItems;
|
48
|
-
export
|
50
|
+
export { SkuListItem, SkuListItemCreate, SkuListItemUpdate };
|
@@ -1,13 +1,20 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class SkuListItems extends ApiResource {
|
3
|
+
// static readonly PATH = 'sku_list_items'
|
4
|
+
async list(params, options) {
|
5
|
+
return this.resources.list({ type: SkuListItems.TYPE }, params, options);
|
6
|
+
}
|
3
7
|
async create(resource, params, options) {
|
4
|
-
return this.resources.create({
|
8
|
+
return this.resources.create(Object.assign(Object.assign({}, resource), { type: SkuListItems.TYPE }), params, options);
|
9
|
+
}
|
10
|
+
async retrieve(id, params, options) {
|
11
|
+
return this.resources.retrieve({ type: SkuListItems.TYPE, id }, params, options);
|
5
12
|
}
|
6
13
|
async update(resource, params, options) {
|
7
|
-
return this.resources.update({
|
14
|
+
return this.resources.update(Object.assign(Object.assign({}, resource), { type: SkuListItems.TYPE }), params, options);
|
8
15
|
}
|
9
16
|
async delete(id, options) {
|
10
|
-
await this.resources.delete(
|
17
|
+
await this.resources.delete({ type: SkuListItems.TYPE, id }, options);
|
11
18
|
}
|
12
19
|
async sku_list(skuListItemId, params, options) {
|
13
20
|
const _skuListItemId = skuListItemId.id || skuListItemId;
|
@@ -17,6 +24,11 @@ class SkuListItems extends ApiResource {
|
|
17
24
|
const _skuListItemId = skuListItemId.id || skuListItemId;
|
18
25
|
return this.resources.fetch({ type: 'skus' }, `sku_list_items/${_skuListItemId}/sku`, params, options);
|
19
26
|
}
|
27
|
+
async versions(skuListItemId, params, options) {
|
28
|
+
const _skuListItemId = skuListItemId.id || skuListItemId;
|
29
|
+
return this.resources.fetch({ type: 'versions' }, `sku_list_items/${_skuListItemId}/versions`, params, options);
|
30
|
+
}
|
31
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
20
32
|
isSkuListItem(resource) {
|
21
33
|
return resource.type && (resource.type === SkuListItems.TYPE);
|
22
34
|
}
|
@@ -1,69 +1,75 @@
|
|
1
|
-
import { ApiResource } from '../resource';
|
2
|
-
import type {
|
3
|
-
import type {
|
4
|
-
import type {
|
5
|
-
import type {
|
6
|
-
import type { FreeGiftPromotion
|
7
|
-
import type { FixedPricePromotion
|
8
|
-
import type { ExternalPromotion
|
9
|
-
import type { FixedAmountPromotion
|
10
|
-
import type {
|
1
|
+
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
+
import type { PercentageDiscountPromotion } from './percentage_discount_promotions';
|
4
|
+
import type { FreeShippingPromotion } from './free_shipping_promotions';
|
5
|
+
import type { BuyXPayYPromotion } from './buy_x_pay_y_promotions';
|
6
|
+
import type { FreeGiftPromotion } from './free_gift_promotions';
|
7
|
+
import type { FixedPricePromotion } from './fixed_price_promotions';
|
8
|
+
import type { ExternalPromotion } from './external_promotions';
|
9
|
+
import type { FixedAmountPromotion } from './fixed_amount_promotions';
|
10
|
+
import type { Version } from './versions';
|
11
|
+
import type { SkuList } from './sku_lists';
|
11
12
|
import type { Sku } from './skus';
|
12
|
-
type SkuListPromotionRuleType = 'sku_list_promotion_rules';
|
13
13
|
type SkuListPromotionRuleRel = ResourceRel & {
|
14
|
-
type:
|
14
|
+
type: typeof SkuListPromotionRules.TYPE;
|
15
15
|
};
|
16
16
|
type PercentageDiscountPromotionRel = ResourceRel & {
|
17
|
-
type:
|
17
|
+
type: 'percentage_discount_promotions';
|
18
18
|
};
|
19
19
|
type FreeShippingPromotionRel = ResourceRel & {
|
20
|
-
type:
|
20
|
+
type: 'free_shipping_promotions';
|
21
|
+
};
|
22
|
+
type BuyXPayYPromotionRel = ResourceRel & {
|
23
|
+
type: 'buy_x_pay_y_promotions';
|
21
24
|
};
|
22
25
|
type FreeGiftPromotionRel = ResourceRel & {
|
23
|
-
type:
|
26
|
+
type: 'free_gift_promotions';
|
24
27
|
};
|
25
28
|
type FixedPricePromotionRel = ResourceRel & {
|
26
|
-
type:
|
29
|
+
type: 'fixed_price_promotions';
|
27
30
|
};
|
28
31
|
type ExternalPromotionRel = ResourceRel & {
|
29
|
-
type:
|
32
|
+
type: 'external_promotions';
|
30
33
|
};
|
31
34
|
type FixedAmountPromotionRel = ResourceRel & {
|
32
|
-
type:
|
35
|
+
type: 'fixed_amount_promotions';
|
33
36
|
};
|
34
37
|
type SkuListRel = ResourceRel & {
|
35
|
-
type:
|
38
|
+
type: 'sku_lists';
|
36
39
|
};
|
37
40
|
interface SkuListPromotionRule extends Resource {
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
sku_list?: SkuList
|
43
|
-
skus?: Sku[]
|
41
|
+
all_skus?: boolean;
|
42
|
+
min_quantity?: number;
|
43
|
+
promotion?: PercentageDiscountPromotion | FreeShippingPromotion | BuyXPayYPromotion | FreeGiftPromotion | FixedPricePromotion | ExternalPromotion | FixedAmountPromotion;
|
44
|
+
versions?: Version[];
|
45
|
+
sku_list?: SkuList;
|
46
|
+
skus?: Sku[];
|
44
47
|
}
|
45
48
|
interface SkuListPromotionRuleCreate extends ResourceCreate {
|
46
|
-
all_skus?: boolean
|
47
|
-
min_quantity?: number
|
48
|
-
promotion: PercentageDiscountPromotionRel | FreeShippingPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel | FixedAmountPromotionRel;
|
49
|
-
sku_list?: SkuListRel
|
49
|
+
all_skus?: boolean;
|
50
|
+
min_quantity?: number;
|
51
|
+
promotion: PercentageDiscountPromotionRel | FreeShippingPromotionRel | BuyXPayYPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel | FixedAmountPromotionRel;
|
52
|
+
sku_list?: SkuListRel;
|
50
53
|
}
|
51
54
|
interface SkuListPromotionRuleUpdate extends ResourceUpdate {
|
52
|
-
all_skus?: boolean
|
53
|
-
min_quantity?: number
|
54
|
-
promotion?: PercentageDiscountPromotionRel | FreeShippingPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel | FixedAmountPromotionRel
|
55
|
-
sku_list?: SkuListRel
|
55
|
+
all_skus?: boolean;
|
56
|
+
min_quantity?: number;
|
57
|
+
promotion?: PercentageDiscountPromotionRel | FreeShippingPromotionRel | BuyXPayYPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel | FixedAmountPromotionRel;
|
58
|
+
sku_list?: SkuListRel;
|
56
59
|
}
|
57
|
-
declare class SkuListPromotionRules extends ApiResource
|
58
|
-
static readonly TYPE:
|
60
|
+
declare class SkuListPromotionRules extends ApiResource {
|
61
|
+
static readonly TYPE: 'sku_list_promotion_rules';
|
62
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<SkuListPromotionRule>>;
|
59
63
|
create(resource: SkuListPromotionRuleCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
64
|
+
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
60
65
|
update(resource: SkuListPromotionRuleUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
61
|
-
delete(id: string
|
66
|
+
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
67
|
+
versions(skuListPromotionRuleId: string | SkuListPromotionRule, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
62
68
|
sku_list(skuListPromotionRuleId: string | SkuListPromotionRule, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
63
69
|
skus(skuListPromotionRuleId: string | SkuListPromotionRule, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Sku>>;
|
64
70
|
isSkuListPromotionRule(resource: any): resource is SkuListPromotionRule;
|
65
71
|
relationship(id: string | ResourceId | null): SkuListPromotionRuleRel;
|
66
|
-
type():
|
72
|
+
type(): string;
|
67
73
|
}
|
68
74
|
export default SkuListPromotionRules;
|
69
|
-
export
|
75
|
+
export { SkuListPromotionRule, SkuListPromotionRuleCreate, SkuListPromotionRuleUpdate };
|
@@ -1,13 +1,24 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class SkuListPromotionRules extends ApiResource {
|
3
|
+
// static readonly PATH = 'sku_list_promotion_rules'
|
4
|
+
async list(params, options) {
|
5
|
+
return this.resources.list({ type: SkuListPromotionRules.TYPE }, params, options);
|
6
|
+
}
|
3
7
|
async create(resource, params, options) {
|
4
|
-
return this.resources.create({
|
8
|
+
return this.resources.create(Object.assign(Object.assign({}, resource), { type: SkuListPromotionRules.TYPE }), params, options);
|
9
|
+
}
|
10
|
+
async retrieve(id, params, options) {
|
11
|
+
return this.resources.retrieve({ type: SkuListPromotionRules.TYPE, id }, params, options);
|
5
12
|
}
|
6
13
|
async update(resource, params, options) {
|
7
|
-
return this.resources.update({
|
14
|
+
return this.resources.update(Object.assign(Object.assign({}, resource), { type: SkuListPromotionRules.TYPE }), params, options);
|
8
15
|
}
|
9
16
|
async delete(id, options) {
|
10
|
-
await this.resources.delete(
|
17
|
+
await this.resources.delete({ type: SkuListPromotionRules.TYPE, id }, options);
|
18
|
+
}
|
19
|
+
async versions(skuListPromotionRuleId, params, options) {
|
20
|
+
const _skuListPromotionRuleId = skuListPromotionRuleId.id || skuListPromotionRuleId;
|
21
|
+
return this.resources.fetch({ type: 'versions' }, `sku_list_promotion_rules/${_skuListPromotionRuleId}/versions`, params, options);
|
11
22
|
}
|
12
23
|
async sku_list(skuListPromotionRuleId, params, options) {
|
13
24
|
const _skuListPromotionRuleId = skuListPromotionRuleId.id || skuListPromotionRuleId;
|
@@ -17,6 +28,7 @@ class SkuListPromotionRules extends ApiResource {
|
|
17
28
|
const _skuListPromotionRuleId = skuListPromotionRuleId.id || skuListPromotionRuleId;
|
18
29
|
return this.resources.fetch({ type: 'skus' }, `sku_list_promotion_rules/${_skuListPromotionRuleId}/skus`, params, options);
|
19
30
|
}
|
31
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
20
32
|
isSkuListPromotionRule(resource) {
|
21
33
|
return resource.type && (resource.type === SkuListPromotionRules.TYPE);
|
22
34
|
}
|
@@ -1,61 +1,63 @@
|
|
1
|
-
import { ApiResource } from '../resource';
|
2
|
-
import type {
|
3
|
-
import type {
|
4
|
-
import type { Customer, CustomerType } from './customers';
|
1
|
+
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
+
import type { Customer } from './customers';
|
5
4
|
import type { Sku } from './skus';
|
6
5
|
import type { SkuListItem } from './sku_list_items';
|
7
6
|
import type { Bundle } from './bundles';
|
8
7
|
import type { Attachment } from './attachments';
|
9
|
-
type
|
8
|
+
import type { Version } from './versions';
|
10
9
|
type SkuListRel = ResourceRel & {
|
11
|
-
type:
|
10
|
+
type: typeof SkuLists.TYPE;
|
12
11
|
};
|
13
12
|
type CustomerRel = ResourceRel & {
|
14
|
-
type:
|
13
|
+
type: 'customers';
|
15
14
|
};
|
16
15
|
interface SkuList extends Resource {
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
16
|
+
name?: string;
|
17
|
+
slug?: string;
|
18
|
+
description?: string;
|
19
|
+
image_url?: string;
|
20
|
+
manual?: boolean;
|
21
|
+
sku_code_regex?: string;
|
22
|
+
customer?: Customer;
|
23
|
+
skus?: Sku[];
|
24
|
+
sku_list_items?: SkuListItem[];
|
25
|
+
bundles?: Bundle[];
|
26
|
+
attachments?: Attachment[];
|
27
|
+
versions?: Version[];
|
29
28
|
}
|
30
29
|
interface SkuListCreate extends ResourceCreate {
|
31
30
|
name: string;
|
32
|
-
description?: string
|
33
|
-
image_url?: string
|
34
|
-
manual?: boolean
|
35
|
-
sku_code_regex?: string
|
36
|
-
customer?: CustomerRel
|
31
|
+
description?: string;
|
32
|
+
image_url?: string;
|
33
|
+
manual?: boolean;
|
34
|
+
sku_code_regex?: string;
|
35
|
+
customer?: CustomerRel;
|
37
36
|
}
|
38
37
|
interface SkuListUpdate extends ResourceUpdate {
|
39
|
-
name?: string
|
40
|
-
description?: string
|
41
|
-
image_url?: string
|
42
|
-
manual?: boolean
|
43
|
-
sku_code_regex?: string
|
44
|
-
customer?: CustomerRel
|
38
|
+
name?: string;
|
39
|
+
description?: string;
|
40
|
+
image_url?: string;
|
41
|
+
manual?: boolean;
|
42
|
+
sku_code_regex?: string;
|
43
|
+
customer?: CustomerRel;
|
45
44
|
}
|
46
|
-
declare class SkuLists extends ApiResource
|
47
|
-
static readonly TYPE:
|
45
|
+
declare class SkuLists extends ApiResource {
|
46
|
+
static readonly TYPE: 'sku_lists';
|
47
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<SkuList>>;
|
48
48
|
create(resource: SkuListCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
49
|
+
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
49
50
|
update(resource: SkuListUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
50
|
-
delete(id: string
|
51
|
+
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
51
52
|
customer(skuListId: string | SkuList, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Customer>;
|
52
53
|
skus(skuListId: string | SkuList, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Sku>>;
|
53
54
|
sku_list_items(skuListId: string | SkuList, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<SkuListItem>>;
|
54
55
|
bundles(skuListId: string | SkuList, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Bundle>>;
|
55
56
|
attachments(skuListId: string | SkuList, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
57
|
+
versions(skuListId: string | SkuList, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
56
58
|
isSkuList(resource: any): resource is SkuList;
|
57
59
|
relationship(id: string | ResourceId | null): SkuListRel;
|
58
|
-
type():
|
60
|
+
type(): string;
|
59
61
|
}
|
60
62
|
export default SkuLists;
|
61
|
-
export
|
63
|
+
export { SkuList, SkuListCreate, SkuListUpdate };
|