@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,30 +1,69 @@
|
|
1
|
-
import { ApiResource } from '../resource';
|
2
|
-
import type {
|
3
|
-
import type { QueryParamsRetrieve } 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 { Shipment } from './shipments';
|
5
4
|
import type { LineItem } from './line_items';
|
6
5
|
import type { StockItem } from './stock_items';
|
7
|
-
type
|
6
|
+
import type { Sku } from './skus';
|
7
|
+
import type { Version } from './versions';
|
8
8
|
type StockLineItemRel = ResourceRel & {
|
9
|
-
type:
|
9
|
+
type: typeof StockLineItems.TYPE;
|
10
|
+
};
|
11
|
+
type ShipmentRel = ResourceRel & {
|
12
|
+
type: 'shipments';
|
13
|
+
};
|
14
|
+
type LineItemRel = ResourceRel & {
|
15
|
+
type: 'line_items';
|
16
|
+
};
|
17
|
+
type StockItemRel = ResourceRel & {
|
18
|
+
type: 'stock_items';
|
19
|
+
};
|
20
|
+
type SkuRel = ResourceRel & {
|
21
|
+
type: 'skus';
|
10
22
|
};
|
11
23
|
interface StockLineItem extends Resource {
|
12
|
-
|
13
|
-
|
14
|
-
|
24
|
+
sku_code?: string;
|
25
|
+
bundle_code?: string;
|
26
|
+
quantity?: number;
|
27
|
+
shipment?: Shipment;
|
28
|
+
line_item?: LineItem;
|
29
|
+
stock_item?: StockItem;
|
30
|
+
sku?: Sku;
|
31
|
+
versions?: Version[];
|
32
|
+
}
|
33
|
+
interface StockLineItemCreate extends ResourceCreate {
|
34
|
+
sku_code?: string;
|
15
35
|
quantity: number;
|
16
|
-
shipment?:
|
17
|
-
line_item?:
|
18
|
-
stock_item?:
|
36
|
+
shipment?: ShipmentRel;
|
37
|
+
line_item?: LineItemRel;
|
38
|
+
stock_item?: StockItemRel;
|
39
|
+
sku?: SkuRel;
|
40
|
+
}
|
41
|
+
interface StockLineItemUpdate extends ResourceUpdate {
|
42
|
+
sku_code?: string;
|
43
|
+
quantity?: number;
|
44
|
+
_reserve_stock?: boolean;
|
45
|
+
_release_stock?: boolean;
|
46
|
+
_decrement_stock?: boolean;
|
47
|
+
shipment?: ShipmentRel;
|
48
|
+
line_item?: LineItemRel;
|
49
|
+
stock_item?: StockItemRel;
|
50
|
+
sku?: SkuRel;
|
19
51
|
}
|
20
|
-
declare class StockLineItems extends ApiResource
|
21
|
-
static readonly TYPE:
|
52
|
+
declare class StockLineItems extends ApiResource {
|
53
|
+
static readonly TYPE: 'stock_line_items';
|
54
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockLineItem>>;
|
55
|
+
create(resource: StockLineItemCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLineItem>;
|
56
|
+
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLineItem>;
|
57
|
+
update(resource: StockLineItemUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLineItem>;
|
58
|
+
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
22
59
|
shipment(stockLineItemId: string | StockLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Shipment>;
|
23
60
|
line_item(stockLineItemId: string | StockLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
|
24
61
|
stock_item(stockLineItemId: string | StockLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockItem>;
|
62
|
+
sku(stockLineItemId: string | StockLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
|
63
|
+
versions(stockLineItemId: string | StockLineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
25
64
|
isStockLineItem(resource: any): resource is StockLineItem;
|
26
65
|
relationship(id: string | ResourceId | null): StockLineItemRel;
|
27
|
-
type():
|
66
|
+
type(): string;
|
28
67
|
}
|
29
68
|
export default StockLineItems;
|
30
|
-
export
|
69
|
+
export { StockLineItem, StockLineItemCreate, StockLineItemUpdate };
|
@@ -2,6 +2,22 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class StockLineItems extends resource_1.ApiResource {
|
5
|
+
// static readonly PATH = 'stock_line_items'
|
6
|
+
async list(params, options) {
|
7
|
+
return this.resources.list({ type: StockLineItems.TYPE }, params, options);
|
8
|
+
}
|
9
|
+
async create(resource, params, options) {
|
10
|
+
return this.resources.create(Object.assign(Object.assign({}, resource), { type: StockLineItems.TYPE }), params, options);
|
11
|
+
}
|
12
|
+
async retrieve(id, params, options) {
|
13
|
+
return this.resources.retrieve({ type: StockLineItems.TYPE, id }, params, options);
|
14
|
+
}
|
15
|
+
async update(resource, params, options) {
|
16
|
+
return this.resources.update(Object.assign(Object.assign({}, resource), { type: StockLineItems.TYPE }), params, options);
|
17
|
+
}
|
18
|
+
async delete(id, options) {
|
19
|
+
await this.resources.delete({ type: StockLineItems.TYPE, id }, options);
|
20
|
+
}
|
5
21
|
async shipment(stockLineItemId, params, options) {
|
6
22
|
const _stockLineItemId = stockLineItemId.id || stockLineItemId;
|
7
23
|
return this.resources.fetch({ type: 'shipments' }, `stock_line_items/${_stockLineItemId}/shipment`, params, options);
|
@@ -14,6 +30,15 @@ class StockLineItems extends resource_1.ApiResource {
|
|
14
30
|
const _stockLineItemId = stockLineItemId.id || stockLineItemId;
|
15
31
|
return this.resources.fetch({ type: 'stock_items' }, `stock_line_items/${_stockLineItemId}/stock_item`, params, options);
|
16
32
|
}
|
33
|
+
async sku(stockLineItemId, params, options) {
|
34
|
+
const _stockLineItemId = stockLineItemId.id || stockLineItemId;
|
35
|
+
return this.resources.fetch({ type: 'skus' }, `stock_line_items/${_stockLineItemId}/sku`, params, options);
|
36
|
+
}
|
37
|
+
async versions(stockLineItemId, params, options) {
|
38
|
+
const _stockLineItemId = stockLineItemId.id || stockLineItemId;
|
39
|
+
return this.resources.fetch({ type: 'versions' }, `stock_line_items/${_stockLineItemId}/versions`, params, options);
|
40
|
+
}
|
41
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
17
42
|
isStockLineItem(resource) {
|
18
43
|
return resource.type && (resource.type === StockLineItems.TYPE);
|
19
44
|
}
|
@@ -1,58 +1,63 @@
|
|
1
|
-
import { ApiResource } from '../resource';
|
2
|
-
import type {
|
3
|
-
import type {
|
4
|
-
import type { Address, AddressType } from './addresses';
|
1
|
+
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
+
import type { Address } from './addresses';
|
5
4
|
import type { InventoryStockLocation } from './inventory_stock_locations';
|
6
5
|
import type { InventoryReturnLocation } from './inventory_return_locations';
|
7
6
|
import type { StockItem } from './stock_items';
|
8
7
|
import type { StockTransfer } from './stock_transfers';
|
9
8
|
import type { Attachment } from './attachments';
|
10
|
-
type
|
9
|
+
import type { Version } from './versions';
|
11
10
|
type StockLocationRel = ResourceRel & {
|
12
|
-
type:
|
11
|
+
type: typeof StockLocations.TYPE;
|
13
12
|
};
|
14
13
|
type AddressRel = ResourceRel & {
|
15
|
-
type:
|
14
|
+
type: 'addresses';
|
16
15
|
};
|
17
16
|
interface StockLocation extends Resource {
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
label_format?: string
|
22
|
-
suppress_etd?: boolean
|
23
|
-
address?: Address
|
24
|
-
inventory_stock_locations?: InventoryStockLocation[]
|
25
|
-
inventory_return_locations?: InventoryReturnLocation[]
|
26
|
-
stock_items?: StockItem[]
|
27
|
-
stock_transfers?: StockTransfer[]
|
28
|
-
attachments?: Attachment[]
|
17
|
+
number?: number;
|
18
|
+
name?: string;
|
19
|
+
code?: string;
|
20
|
+
label_format?: string;
|
21
|
+
suppress_etd?: boolean;
|
22
|
+
address?: Address;
|
23
|
+
inventory_stock_locations?: InventoryStockLocation[];
|
24
|
+
inventory_return_locations?: InventoryReturnLocation[];
|
25
|
+
stock_items?: StockItem[];
|
26
|
+
stock_transfers?: StockTransfer[];
|
27
|
+
attachments?: Attachment[];
|
28
|
+
versions?: Version[];
|
29
29
|
}
|
30
30
|
interface StockLocationCreate extends ResourceCreate {
|
31
31
|
name: string;
|
32
|
-
|
33
|
-
|
32
|
+
code?: string;
|
33
|
+
label_format?: string;
|
34
|
+
suppress_etd?: boolean;
|
34
35
|
address: AddressRel;
|
35
36
|
}
|
36
37
|
interface StockLocationUpdate extends ResourceUpdate {
|
37
|
-
name?: string
|
38
|
-
|
39
|
-
|
40
|
-
|
38
|
+
name?: string;
|
39
|
+
code?: string;
|
40
|
+
label_format?: string;
|
41
|
+
suppress_etd?: boolean;
|
42
|
+
address?: AddressRel;
|
41
43
|
}
|
42
|
-
declare class StockLocations extends ApiResource
|
43
|
-
static readonly TYPE:
|
44
|
+
declare class StockLocations extends ApiResource {
|
45
|
+
static readonly TYPE: 'stock_locations';
|
46
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockLocation>>;
|
44
47
|
create(resource: StockLocationCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
|
48
|
+
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
|
45
49
|
update(resource: StockLocationUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
|
46
|
-
delete(id: string
|
50
|
+
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
47
51
|
address(stockLocationId: string | StockLocation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Address>;
|
48
52
|
inventory_stock_locations(stockLocationId: string | StockLocation, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<InventoryStockLocation>>;
|
49
53
|
inventory_return_locations(stockLocationId: string | StockLocation, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<InventoryReturnLocation>>;
|
50
54
|
stock_items(stockLocationId: string | StockLocation, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockItem>>;
|
51
55
|
stock_transfers(stockLocationId: string | StockLocation, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockTransfer>>;
|
52
56
|
attachments(stockLocationId: string | StockLocation, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
57
|
+
versions(stockLocationId: string | StockLocation, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
53
58
|
isStockLocation(resource: any): resource is StockLocation;
|
54
59
|
relationship(id: string | ResourceId | null): StockLocationRel;
|
55
|
-
type():
|
60
|
+
type(): string;
|
56
61
|
}
|
57
62
|
export default StockLocations;
|
58
|
-
export
|
63
|
+
export { StockLocation, StockLocationCreate, StockLocationUpdate };
|
@@ -2,14 +2,21 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class StockLocations extends resource_1.ApiResource {
|
5
|
+
// static readonly PATH = 'stock_locations'
|
6
|
+
async list(params, options) {
|
7
|
+
return this.resources.list({ type: StockLocations.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: StockLocations.TYPE }), params, options);
|
11
|
+
}
|
12
|
+
async retrieve(id, params, options) {
|
13
|
+
return this.resources.retrieve({ type: StockLocations.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: StockLocations.TYPE }), params, options);
|
10
17
|
}
|
11
18
|
async delete(id, options) {
|
12
|
-
await this.resources.delete(
|
19
|
+
await this.resources.delete({ type: StockLocations.TYPE, id }, options);
|
13
20
|
}
|
14
21
|
async address(stockLocationId, params, options) {
|
15
22
|
const _stockLocationId = stockLocationId.id || stockLocationId;
|
@@ -35,6 +42,11 @@ class StockLocations extends resource_1.ApiResource {
|
|
35
42
|
const _stockLocationId = stockLocationId.id || stockLocationId;
|
36
43
|
return this.resources.fetch({ type: 'attachments' }, `stock_locations/${_stockLocationId}/attachments`, params, options);
|
37
44
|
}
|
45
|
+
async versions(stockLocationId, params, options) {
|
46
|
+
const _stockLocationId = stockLocationId.id || stockLocationId;
|
47
|
+
return this.resources.fetch({ type: 'versions' }, `stock_locations/${_stockLocationId}/versions`, params, options);
|
48
|
+
}
|
49
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
38
50
|
isStockLocation(resource) {
|
39
51
|
return resource.type && (resource.type === StockLocations.TYPE);
|
40
52
|
}
|
@@ -0,0 +1,49 @@
|
|
1
|
+
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
+
import type { LineItem } from './line_items';
|
4
|
+
import type { Order } from './orders';
|
5
|
+
import type { StockItem } from './stock_items';
|
6
|
+
import type { ReservedStock } from './reserved_stocks';
|
7
|
+
import type { Sku } from './skus';
|
8
|
+
type StockReservationRel = ResourceRel & {
|
9
|
+
type: typeof StockReservations.TYPE;
|
10
|
+
};
|
11
|
+
type StockItemRel = ResourceRel & {
|
12
|
+
type: 'stock_items';
|
13
|
+
};
|
14
|
+
interface StockReservation extends Resource {
|
15
|
+
status?: string;
|
16
|
+
quantity?: number;
|
17
|
+
expires_at?: string;
|
18
|
+
line_item?: LineItem;
|
19
|
+
order?: Order;
|
20
|
+
stock_item?: StockItem;
|
21
|
+
reserved_stock?: ReservedStock;
|
22
|
+
sku?: Sku;
|
23
|
+
}
|
24
|
+
interface StockReservationCreate extends ResourceCreate {
|
25
|
+
quantity: number;
|
26
|
+
stock_item: StockItemRel;
|
27
|
+
}
|
28
|
+
interface StockReservationUpdate extends ResourceUpdate {
|
29
|
+
quantity?: number;
|
30
|
+
_pending?: boolean;
|
31
|
+
}
|
32
|
+
declare class StockReservations extends ApiResource {
|
33
|
+
static readonly TYPE: 'stock_reservations';
|
34
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockReservation>>;
|
35
|
+
create(resource: StockReservationCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockReservation>;
|
36
|
+
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockReservation>;
|
37
|
+
update(resource: StockReservationUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockReservation>;
|
38
|
+
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
39
|
+
line_item(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
|
40
|
+
order(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
41
|
+
stock_item(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockItem>;
|
42
|
+
reserved_stock(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ReservedStock>;
|
43
|
+
sku(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
|
44
|
+
isStockReservation(resource: any): resource is StockReservation;
|
45
|
+
relationship(id: string | ResourceId | null): StockReservationRel;
|
46
|
+
type(): string;
|
47
|
+
}
|
48
|
+
export default StockReservations;
|
49
|
+
export { StockReservation, StockReservationCreate, StockReservationUpdate };
|
@@ -0,0 +1,53 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const resource_1 = require("../resource");
|
4
|
+
class StockReservations extends resource_1.ApiResource {
|
5
|
+
// static readonly PATH = 'stock_reservations'
|
6
|
+
async list(params, options) {
|
7
|
+
return this.resources.list({ type: StockReservations.TYPE }, params, options);
|
8
|
+
}
|
9
|
+
async create(resource, params, options) {
|
10
|
+
return this.resources.create(Object.assign(Object.assign({}, resource), { type: StockReservations.TYPE }), params, options);
|
11
|
+
}
|
12
|
+
async retrieve(id, params, options) {
|
13
|
+
return this.resources.retrieve({ type: StockReservations.TYPE, id }, params, options);
|
14
|
+
}
|
15
|
+
async update(resource, params, options) {
|
16
|
+
return this.resources.update(Object.assign(Object.assign({}, resource), { type: StockReservations.TYPE }), params, options);
|
17
|
+
}
|
18
|
+
async delete(id, options) {
|
19
|
+
await this.resources.delete({ type: StockReservations.TYPE, id }, options);
|
20
|
+
}
|
21
|
+
async line_item(stockReservationId, params, options) {
|
22
|
+
const _stockReservationId = stockReservationId.id || stockReservationId;
|
23
|
+
return this.resources.fetch({ type: 'line_items' }, `stock_reservations/${_stockReservationId}/line_item`, params, options);
|
24
|
+
}
|
25
|
+
async order(stockReservationId, params, options) {
|
26
|
+
const _stockReservationId = stockReservationId.id || stockReservationId;
|
27
|
+
return this.resources.fetch({ type: 'orders' }, `stock_reservations/${_stockReservationId}/order`, params, options);
|
28
|
+
}
|
29
|
+
async stock_item(stockReservationId, params, options) {
|
30
|
+
const _stockReservationId = stockReservationId.id || stockReservationId;
|
31
|
+
return this.resources.fetch({ type: 'stock_items' }, `stock_reservations/${_stockReservationId}/stock_item`, params, options);
|
32
|
+
}
|
33
|
+
async reserved_stock(stockReservationId, params, options) {
|
34
|
+
const _stockReservationId = stockReservationId.id || stockReservationId;
|
35
|
+
return this.resources.fetch({ type: 'reserved_stocks' }, `stock_reservations/${_stockReservationId}/reserved_stock`, params, options);
|
36
|
+
}
|
37
|
+
async sku(stockReservationId, params, options) {
|
38
|
+
const _stockReservationId = stockReservationId.id || stockReservationId;
|
39
|
+
return this.resources.fetch({ type: 'skus' }, `stock_reservations/${_stockReservationId}/sku`, params, options);
|
40
|
+
}
|
41
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
42
|
+
isStockReservation(resource) {
|
43
|
+
return resource.type && (resource.type === StockReservations.TYPE);
|
44
|
+
}
|
45
|
+
relationship(id) {
|
46
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: StockReservations.TYPE } : { id: id.id, type: StockReservations.TYPE };
|
47
|
+
}
|
48
|
+
type() {
|
49
|
+
return StockReservations.TYPE;
|
50
|
+
}
|
51
|
+
}
|
52
|
+
StockReservations.TYPE = 'stock_reservations';
|
53
|
+
exports.default = StockReservations;
|
@@ -1,75 +1,79 @@
|
|
1
|
-
import { ApiResource } from '../resource';
|
2
|
-
import type {
|
3
|
-
import type {
|
4
|
-
import type {
|
5
|
-
import type {
|
6
|
-
import type {
|
7
|
-
import type { LineItem, LineItemType } from './line_items';
|
1
|
+
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
+
import type { Sku } from './skus';
|
4
|
+
import type { StockLocation } from './stock_locations';
|
5
|
+
import type { Shipment } from './shipments';
|
6
|
+
import type { LineItem } from './line_items';
|
8
7
|
import type { Event } from './events';
|
9
|
-
type
|
8
|
+
import type { Version } from './versions';
|
10
9
|
type StockTransferRel = ResourceRel & {
|
11
|
-
type:
|
10
|
+
type: typeof StockTransfers.TYPE;
|
12
11
|
};
|
13
12
|
type SkuRel = ResourceRel & {
|
14
|
-
type:
|
13
|
+
type: 'skus';
|
15
14
|
};
|
16
15
|
type StockLocationRel = ResourceRel & {
|
17
|
-
type:
|
16
|
+
type: 'stock_locations';
|
18
17
|
};
|
19
18
|
type ShipmentRel = ResourceRel & {
|
20
|
-
type:
|
19
|
+
type: 'shipments';
|
21
20
|
};
|
22
21
|
type LineItemRel = ResourceRel & {
|
23
|
-
type:
|
22
|
+
type: 'line_items';
|
24
23
|
};
|
25
24
|
interface StockTransfer extends Resource {
|
26
|
-
|
27
|
-
sku_code?: string
|
28
|
-
status
|
29
|
-
quantity
|
30
|
-
completed_at?: string
|
31
|
-
cancelled_at?: string
|
32
|
-
sku?: Sku
|
33
|
-
origin_stock_location?: StockLocation
|
34
|
-
destination_stock_location?: StockLocation
|
35
|
-
shipment?: Shipment
|
36
|
-
line_item?: LineItem
|
37
|
-
events?: Event[]
|
25
|
+
number?: string;
|
26
|
+
sku_code?: string;
|
27
|
+
status?: string;
|
28
|
+
quantity?: number;
|
29
|
+
completed_at?: string;
|
30
|
+
cancelled_at?: string;
|
31
|
+
sku?: Sku;
|
32
|
+
origin_stock_location?: StockLocation;
|
33
|
+
destination_stock_location?: StockLocation;
|
34
|
+
shipment?: Shipment;
|
35
|
+
line_item?: LineItem;
|
36
|
+
events?: Event[];
|
37
|
+
versions?: Version[];
|
38
38
|
}
|
39
39
|
interface StockTransferCreate extends ResourceCreate {
|
40
|
-
sku_code?: string
|
40
|
+
sku_code?: string;
|
41
41
|
quantity: number;
|
42
42
|
sku: SkuRel;
|
43
43
|
origin_stock_location: StockLocationRel;
|
44
44
|
destination_stock_location: StockLocationRel;
|
45
|
-
shipment?: ShipmentRel
|
46
|
-
line_item?: LineItemRel
|
45
|
+
shipment?: ShipmentRel;
|
46
|
+
line_item?: LineItemRel;
|
47
47
|
}
|
48
48
|
interface StockTransferUpdate extends ResourceUpdate {
|
49
|
-
sku_code?: string
|
50
|
-
_upcoming?: boolean
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
49
|
+
sku_code?: string;
|
50
|
+
_upcoming?: boolean;
|
51
|
+
_on_hold?: boolean;
|
52
|
+
_picking?: boolean;
|
53
|
+
_in_transit?: boolean;
|
54
|
+
_complete?: boolean;
|
55
|
+
_cancel?: boolean;
|
56
|
+
sku?: SkuRel;
|
57
|
+
origin_stock_location?: StockLocationRel;
|
58
|
+
destination_stock_location?: StockLocationRel;
|
58
59
|
}
|
59
|
-
declare class StockTransfers extends ApiResource
|
60
|
-
static readonly TYPE:
|
60
|
+
declare class StockTransfers extends ApiResource {
|
61
|
+
static readonly TYPE: 'stock_transfers';
|
62
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockTransfer>>;
|
61
63
|
create(resource: StockTransferCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
|
64
|
+
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
|
62
65
|
update(resource: StockTransferUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
|
63
|
-
delete(id: string
|
66
|
+
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
64
67
|
sku(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
|
65
68
|
origin_stock_location(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
|
66
69
|
destination_stock_location(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
|
67
70
|
shipment(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Shipment>;
|
68
71
|
line_item(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
|
69
72
|
events(stockTransferId: string | StockTransfer, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
73
|
+
versions(stockTransferId: string | StockTransfer, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
70
74
|
isStockTransfer(resource: any): resource is StockTransfer;
|
71
75
|
relationship(id: string | ResourceId | null): StockTransferRel;
|
72
|
-
type():
|
76
|
+
type(): string;
|
73
77
|
}
|
74
78
|
export default StockTransfers;
|
75
|
-
export
|
79
|
+
export { StockTransfer, StockTransferCreate, StockTransferUpdate };
|
@@ -2,14 +2,21 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class StockTransfers extends resource_1.ApiResource {
|
5
|
+
// static readonly PATH = 'stock_transfers'
|
6
|
+
async list(params, options) {
|
7
|
+
return this.resources.list({ type: StockTransfers.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: StockTransfers.TYPE }), params, options);
|
11
|
+
}
|
12
|
+
async retrieve(id, params, options) {
|
13
|
+
return this.resources.retrieve({ type: StockTransfers.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: StockTransfers.TYPE }), params, options);
|
10
17
|
}
|
11
18
|
async delete(id, options) {
|
12
|
-
await this.resources.delete(
|
19
|
+
await this.resources.delete({ type: StockTransfers.TYPE, id }, options);
|
13
20
|
}
|
14
21
|
async sku(stockTransferId, params, options) {
|
15
22
|
const _stockTransferId = stockTransferId.id || stockTransferId;
|
@@ -35,6 +42,11 @@ class StockTransfers extends resource_1.ApiResource {
|
|
35
42
|
const _stockTransferId = stockTransferId.id || stockTransferId;
|
36
43
|
return this.resources.fetch({ type: 'events' }, `stock_transfers/${_stockTransferId}/events`, params, options);
|
37
44
|
}
|
45
|
+
async versions(stockTransferId, params, options) {
|
46
|
+
const _stockTransferId = stockTransferId.id || stockTransferId;
|
47
|
+
return this.resources.fetch({ type: 'versions' }, `stock_transfers/${_stockTransferId}/versions`, params, options);
|
48
|
+
}
|
49
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
38
50
|
isStockTransfer(resource) {
|
39
51
|
return resource.type && (resource.type === StockTransfers.TYPE);
|
40
52
|
}
|
@@ -1,42 +1,44 @@
|
|
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 { PaymentMethod } from './payment_methods';
|
4
|
+
import type { Version } from './versions';
|
5
5
|
import type { StripePayment } from './stripe_payments';
|
6
|
-
type StripeGatewayType = 'stripe_gateways';
|
7
6
|
type StripeGatewayRel = ResourceRel & {
|
8
|
-
type:
|
7
|
+
type: typeof StripeGateways.TYPE;
|
9
8
|
};
|
10
9
|
interface StripeGateway extends Resource {
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
stripe_payments?: StripePayment[]
|
10
|
+
name?: string;
|
11
|
+
auto_payments?: boolean;
|
12
|
+
webhook_endpoint_id?: string;
|
13
|
+
webhook_endpoint_secret?: string;
|
14
|
+
webhook_endpoint_url?: string;
|
15
|
+
payment_methods?: PaymentMethod[];
|
16
|
+
versions?: Version[];
|
17
|
+
stripe_payments?: StripePayment[];
|
19
18
|
}
|
20
19
|
interface StripeGatewayCreate extends ResourceCreate {
|
21
20
|
name: string;
|
22
21
|
login: string;
|
23
|
-
publishable_key?: string
|
24
|
-
auto_payments?: boolean
|
22
|
+
publishable_key?: string;
|
23
|
+
auto_payments?: boolean;
|
25
24
|
}
|
26
25
|
interface StripeGatewayUpdate extends ResourceUpdate {
|
27
|
-
name?: string
|
28
|
-
auto_payments?: boolean
|
26
|
+
name?: string;
|
27
|
+
auto_payments?: boolean;
|
29
28
|
}
|
30
|
-
declare class StripeGateways extends ApiResource
|
31
|
-
static readonly TYPE:
|
29
|
+
declare class StripeGateways extends ApiResource {
|
30
|
+
static readonly TYPE: 'stripe_gateways';
|
31
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StripeGateway>>;
|
32
32
|
create(resource: StripeGatewayCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StripeGateway>;
|
33
|
+
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StripeGateway>;
|
33
34
|
update(resource: StripeGatewayUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StripeGateway>;
|
34
|
-
delete(id: string
|
35
|
+
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
35
36
|
payment_methods(stripeGatewayId: string | StripeGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>>;
|
37
|
+
versions(stripeGatewayId: string | StripeGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
36
38
|
stripe_payments(stripeGatewayId: string | StripeGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StripePayment>>;
|
37
39
|
isStripeGateway(resource: any): resource is StripeGateway;
|
38
40
|
relationship(id: string | ResourceId | null): StripeGatewayRel;
|
39
|
-
type():
|
41
|
+
type(): string;
|
40
42
|
}
|
41
43
|
export default StripeGateways;
|
42
|
-
export
|
44
|
+
export { StripeGateway, StripeGatewayCreate, StripeGatewayUpdate };
|
@@ -2,23 +2,35 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class StripeGateways extends resource_1.ApiResource {
|
5
|
+
// static readonly PATH = 'stripe_gateways'
|
6
|
+
async list(params, options) {
|
7
|
+
return this.resources.list({ type: StripeGateways.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: StripeGateways.TYPE }), params, options);
|
11
|
+
}
|
12
|
+
async retrieve(id, params, options) {
|
13
|
+
return this.resources.retrieve({ type: StripeGateways.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: StripeGateways.TYPE }), params, options);
|
10
17
|
}
|
11
18
|
async delete(id, options) {
|
12
|
-
await this.resources.delete(
|
19
|
+
await this.resources.delete({ type: StripeGateways.TYPE, id }, options);
|
13
20
|
}
|
14
21
|
async payment_methods(stripeGatewayId, params, options) {
|
15
22
|
const _stripeGatewayId = stripeGatewayId.id || stripeGatewayId;
|
16
23
|
return this.resources.fetch({ type: 'payment_methods' }, `stripe_gateways/${_stripeGatewayId}/payment_methods`, params, options);
|
17
24
|
}
|
25
|
+
async versions(stripeGatewayId, params, options) {
|
26
|
+
const _stripeGatewayId = stripeGatewayId.id || stripeGatewayId;
|
27
|
+
return this.resources.fetch({ type: 'versions' }, `stripe_gateways/${_stripeGatewayId}/versions`, params, options);
|
28
|
+
}
|
18
29
|
async stripe_payments(stripeGatewayId, params, options) {
|
19
30
|
const _stripeGatewayId = stripeGatewayId.id || stripeGatewayId;
|
20
31
|
return this.resources.fetch({ type: 'stripe_payments' }, `stripe_gateways/${_stripeGatewayId}/stripe_payments`, params, options);
|
21
32
|
}
|
33
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
22
34
|
isStripeGateway(resource) {
|
23
35
|
return resource.type && (resource.type === StripeGateways.TYPE);
|
24
36
|
}
|