@commercelayer/sdk 4.40.0 → 4.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/api.d.ts +1 -38
- package/lib/cjs/api.js +14 -1
- package/lib/cjs/client.d.ts +8 -15
- package/lib/cjs/client.js +40 -40
- package/lib/cjs/commercelayer.d.ts +6 -5
- package/lib/cjs/commercelayer.js +4 -8
- 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 -3
- package/lib/cjs/debug.js +4 -0
- package/lib/cjs/error.d.ts +3 -6
- package/lib/cjs/error.js +8 -42
- 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 +2 -9
- package/lib/cjs/model.d.ts +1 -1
- package/lib/cjs/query.d.ts +15 -9
- package/lib/cjs/query.js +2 -3
- package/lib/cjs/resource.d.ts +20 -31
- package/lib/cjs/resource.js +9 -56
- package/lib/cjs/resources/addresses.d.ts +73 -74
- package/lib/cjs/resources/addresses.js +11 -3
- package/lib/cjs/resources/adjustments.d.ts +19 -20
- package/lib/cjs/resources/adjustments.js +11 -3
- package/lib/cjs/resources/adyen_gateways.d.ts +34 -35
- package/lib/cjs/resources/adyen_gateways.js +11 -3
- package/lib/cjs/resources/adyen_payments.d.ts +27 -29
- package/lib/cjs/resources/adyen_payments.js +11 -6
- 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 +45 -49
- package/lib/cjs/resources/authorizations.js +13 -14
- package/lib/cjs/resources/avalara_accounts.d.ts +31 -32
- package/lib/cjs/resources/avalara_accounts.js +11 -3
- package/lib/cjs/resources/axerve_gateways.d.ts +23 -24
- package/lib/cjs/resources/axerve_gateways.js +11 -3
- package/lib/cjs/resources/axerve_payments.d.ts +32 -32
- package/lib/cjs/resources/axerve_payments.js +11 -6
- package/lib/cjs/resources/billing_info_validation_rules.d.ts +16 -17
- package/lib/cjs/resources/billing_info_validation_rules.js +11 -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 +33 -34
- package/lib/cjs/resources/braintree_gateways.js +11 -3
- package/lib/cjs/resources/braintree_payments.d.ts +29 -30
- package/lib/cjs/resources/braintree_payments.js +11 -3
- package/lib/cjs/resources/bundles.d.ts +56 -59
- package/lib/cjs/resources/bundles.js +11 -9
- package/lib/cjs/resources/buy_x_pay_y_promotions.d.ts +85 -86
- package/lib/cjs/resources/buy_x_pay_y_promotions.js +11 -9
- package/lib/cjs/resources/captures.d.ts +36 -39
- package/lib/cjs/resources/captures.js +13 -11
- package/lib/cjs/resources/carrier_accounts.d.ts +15 -16
- package/lib/cjs/resources/carrier_accounts.js +8 -0
- package/lib/cjs/resources/checkout_com_gateways.d.ts +24 -25
- package/lib/cjs/resources/checkout_com_gateways.js +11 -3
- package/lib/cjs/resources/checkout_com_payments.d.ts +38 -41
- package/lib/cjs/resources/checkout_com_payments.js +11 -9
- package/lib/cjs/resources/cleanups.d.ts +23 -24
- package/lib/cjs/resources/cleanups.js +10 -2
- package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +32 -33
- package/lib/cjs/resources/coupon_codes_promotion_rules.js +11 -3
- package/lib/cjs/resources/coupon_recipients.d.ts +25 -26
- package/lib/cjs/resources/coupon_recipients.js +11 -3
- package/lib/cjs/resources/coupons.d.ts +41 -42
- package/lib/cjs/resources/coupons.js +11 -3
- package/lib/cjs/resources/custom_promotion_rules.d.ts +30 -31
- package/lib/cjs/resources/custom_promotion_rules.js +11 -3
- package/lib/cjs/resources/customer_addresses.d.ts +22 -23
- package/lib/cjs/resources/customer_addresses.js +11 -3
- package/lib/cjs/resources/customer_groups.d.ts +16 -17
- package/lib/cjs/resources/customer_groups.js +11 -3
- package/lib/cjs/resources/customer_password_resets.d.ts +17 -19
- package/lib/cjs/resources/customer_password_resets.js +11 -6
- package/lib/cjs/resources/customer_payment_sources.d.ts +49 -38
- package/lib/cjs/resources/customer_payment_sources.js +15 -3
- package/lib/cjs/resources/customer_subscriptions.d.ts +14 -15
- package/lib/cjs/resources/customer_subscriptions.js +11 -3
- package/lib/cjs/resources/customers.d.ts +36 -37
- package/lib/cjs/resources/customers.js +11 -3
- package/lib/cjs/resources/delivery_lead_times.d.ts +26 -27
- package/lib/cjs/resources/delivery_lead_times.js +11 -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 +31 -32
- package/lib/cjs/resources/external_gateways.js +11 -3
- package/lib/cjs/resources/external_payments.d.ts +22 -23
- package/lib/cjs/resources/external_payments.js +11 -3
- package/lib/cjs/resources/external_promotions.d.ts +82 -83
- package/lib/cjs/resources/external_promotions.js +11 -9
- package/lib/cjs/resources/external_tax_calculators.d.ts +18 -19
- package/lib/cjs/resources/external_tax_calculators.js +11 -3
- package/lib/cjs/resources/fixed_amount_promotions.d.ts +83 -84
- package/lib/cjs/resources/fixed_amount_promotions.js +11 -9
- package/lib/cjs/resources/fixed_price_promotions.d.ts +82 -83
- package/lib/cjs/resources/fixed_price_promotions.js +11 -9
- package/lib/cjs/resources/free_gift_promotions.d.ts +81 -82
- package/lib/cjs/resources/free_gift_promotions.js +11 -9
- package/lib/cjs/resources/free_shipping_promotions.d.ts +74 -75
- package/lib/cjs/resources/free_shipping_promotions.js +11 -9
- 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 +25 -26
- package/lib/cjs/resources/gift_card_recipients.js +11 -3
- package/lib/cjs/resources/gift_cards.d.ts +66 -71
- package/lib/cjs/resources/gift_cards.js +11 -15
- 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 +35 -38
- package/lib/cjs/resources/in_stock_subscriptions.js +11 -9
- package/lib/cjs/resources/inventory_models.d.ts +28 -29
- package/lib/cjs/resources/inventory_models.js +11 -3
- package/lib/cjs/resources/inventory_return_locations.d.ts +21 -22
- package/lib/cjs/resources/inventory_return_locations.js +11 -3
- package/lib/cjs/resources/inventory_stock_locations.d.ts +24 -25
- package/lib/cjs/resources/inventory_stock_locations.js +11 -3
- package/lib/cjs/resources/klarna_gateways.d.ts +22 -23
- package/lib/cjs/resources/klarna_gateways.js +11 -3
- package/lib/cjs/resources/klarna_payments.d.ts +27 -29
- package/lib/cjs/resources/klarna_payments.js +11 -6
- 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 +100 -97
- package/lib/cjs/resources/line_items.js +11 -9
- package/lib/cjs/resources/manual_gateways.d.ts +14 -15
- package/lib/cjs/resources/manual_gateways.js +11 -3
- package/lib/cjs/resources/manual_tax_calculators.d.ts +20 -21
- package/lib/cjs/resources/manual_tax_calculators.js +11 -3
- package/lib/cjs/resources/markets.d.ts +64 -62
- package/lib/cjs/resources/markets.js +11 -9
- package/lib/cjs/resources/merchants.d.ts +18 -19
- package/lib/cjs/resources/merchants.js +11 -3
- package/lib/cjs/resources/order_amount_promotion_rules.d.ts +35 -36
- package/lib/cjs/resources/order_amount_promotion_rules.js +11 -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 +39 -40
- package/lib/cjs/resources/order_subscription_items.js +11 -3
- package/lib/cjs/resources/order_subscriptions.d.ts +51 -55
- package/lib/cjs/resources/order_subscriptions.js +11 -12
- package/lib/cjs/resources/order_validation_rules.d.ts +12 -13
- package/lib/cjs/resources/order_validation_rules.js +8 -0
- package/lib/cjs/resources/orders.d.ts +251 -277
- package/lib/cjs/resources/orders.js +11 -84
- package/lib/cjs/resources/organization.d.ts +24 -25
- package/lib/cjs/resources/organization.js +6 -1
- package/lib/cjs/resources/packages.d.ts +30 -31
- package/lib/cjs/resources/packages.js +11 -3
- package/lib/cjs/resources/parcel_line_items.d.ts +22 -23
- package/lib/cjs/resources/parcel_line_items.js +11 -3
- package/lib/cjs/resources/parcels.d.ts +93 -94
- package/lib/cjs/resources/parcels.js +11 -3
- package/lib/cjs/resources/payment_gateways.d.ts +12 -13
- package/lib/cjs/resources/payment_gateways.js +8 -0
- package/lib/cjs/resources/payment_methods.d.ts +51 -52
- package/lib/cjs/resources/payment_methods.js +11 -9
- package/lib/cjs/resources/payment_options.d.ts +23 -24
- package/lib/cjs/resources/payment_options.js +11 -3
- package/lib/cjs/resources/paypal_gateways.d.ts +17 -18
- package/lib/cjs/resources/paypal_gateways.js +11 -3
- package/lib/cjs/resources/paypal_payments.d.ts +31 -32
- package/lib/cjs/resources/paypal_payments.js +11 -3
- package/lib/cjs/resources/percentage_discount_promotions.d.ts +81 -82
- package/lib/cjs/resources/percentage_discount_promotions.js +11 -9
- package/lib/cjs/resources/price_frequency_tiers.d.ts +26 -27
- package/lib/cjs/resources/price_frequency_tiers.js +11 -3
- package/lib/cjs/resources/price_lists.d.ts +23 -21
- package/lib/cjs/resources/price_lists.js +11 -3
- package/lib/cjs/resources/price_tiers.d.ts +17 -18
- package/lib/cjs/resources/price_tiers.js +8 -0
- package/lib/cjs/resources/price_volume_tiers.d.ts +26 -27
- package/lib/cjs/resources/price_volume_tiers.js +11 -3
- package/lib/cjs/resources/prices.d.ts +40 -41
- package/lib/cjs/resources/prices.js +11 -3
- package/lib/cjs/resources/promotion_rules.d.ts +11 -12
- package/lib/cjs/resources/promotion_rules.js +8 -0
- package/lib/cjs/resources/promotions.d.ts +30 -31
- package/lib/cjs/resources/promotions.js +8 -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 +27 -28
- package/lib/cjs/resources/refunds.js +12 -4
- package/lib/cjs/resources/reserved_stocks.d.ts +13 -14
- package/lib/cjs/resources/reserved_stocks.js +8 -0
- package/lib/cjs/resources/return_line_items.d.ts +27 -29
- package/lib/cjs/resources/return_line_items.js +11 -6
- package/lib/cjs/resources/returns.d.ts +49 -59
- package/lib/cjs/resources/returns.js +11 -30
- package/lib/cjs/resources/satispay_gateways.d.ts +22 -23
- package/lib/cjs/resources/satispay_gateways.js +11 -3
- package/lib/cjs/resources/satispay_payments.d.ts +29 -31
- package/lib/cjs/resources/satispay_payments.js +11 -6
- package/lib/cjs/resources/shipments.d.ts +86 -88
- package/lib/cjs/resources/shipments.js +15 -33
- package/lib/cjs/resources/shipping_categories.d.ts +18 -16
- package/lib/cjs/resources/shipping_categories.js +11 -3
- package/lib/cjs/resources/shipping_method_tiers.d.ts +17 -18
- package/lib/cjs/resources/shipping_method_tiers.js +8 -0
- package/lib/cjs/resources/shipping_methods.d.ts +79 -80
- package/lib/cjs/resources/shipping_methods.js +11 -9
- package/lib/cjs/resources/shipping_weight_tiers.d.ts +25 -26
- package/lib/cjs/resources/shipping_weight_tiers.js +11 -3
- package/lib/cjs/resources/shipping_zones.d.ts +32 -33
- package/lib/cjs/resources/shipping_zones.js +11 -3
- package/lib/cjs/resources/sku_list_items.d.ts +26 -27
- package/lib/cjs/resources/sku_list_items.js +11 -3
- package/lib/cjs/resources/sku_list_promotion_rules.d.ts +39 -40
- package/lib/cjs/resources/sku_list_promotion_rules.js +11 -3
- package/lib/cjs/resources/sku_lists.d.ts +35 -36
- package/lib/cjs/resources/sku_lists.js +11 -3
- package/lib/cjs/resources/sku_options.d.ts +43 -44
- package/lib/cjs/resources/sku_options.js +11 -3
- package/lib/cjs/resources/skus.d.ts +56 -57
- package/lib/cjs/resources/skus.js +11 -3
- package/lib/cjs/resources/stock_items.d.ts +28 -29
- package/lib/cjs/resources/stock_items.js +11 -3
- package/lib/cjs/resources/stock_line_items.d.ts +37 -37
- package/lib/cjs/resources/stock_line_items.js +11 -3
- package/lib/cjs/resources/stock_locations.d.ts +32 -30
- package/lib/cjs/resources/stock_locations.js +11 -3
- package/lib/cjs/resources/stock_reservations.d.ts +23 -25
- package/lib/cjs/resources/stock_reservations.js +11 -6
- package/lib/cjs/resources/stock_transfers.d.ts +44 -50
- package/lib/cjs/resources/stock_transfers.js +11 -21
- package/lib/cjs/resources/stripe_gateways.d.ts +22 -23
- package/lib/cjs/resources/stripe_gateways.js +11 -3
- package/lib/cjs/resources/stripe_payments.d.ts +34 -35
- package/lib/cjs/resources/stripe_payments.js +11 -9
- 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 +13 -14
- package/lib/cjs/resources/tax_calculators.js +8 -0
- package/lib/cjs/resources/tax_categories.d.ts +30 -31
- package/lib/cjs/resources/tax_categories.js +11 -3
- package/lib/cjs/resources/tax_rules.d.ts +51 -52
- package/lib/cjs/resources/tax_rules.js +11 -3
- package/lib/cjs/resources/taxjar_accounts.d.ts +21 -22
- package/lib/cjs/resources/taxjar_accounts.js +11 -3
- package/lib/cjs/resources/transactions.d.ts +26 -24
- package/lib/cjs/resources/transactions.js +12 -0
- package/lib/cjs/resources/versions.d.ts +14 -14
- package/lib/cjs/resources/versions.js +8 -0
- package/lib/cjs/resources/voids.d.ts +27 -28
- package/lib/cjs/resources/voids.js +12 -4
- package/lib/cjs/resources/webhooks.d.ts +31 -28
- package/lib/cjs/resources/webhooks.js +11 -6
- package/lib/cjs/resources/wire_transfers.d.ts +16 -17
- package/lib/cjs/resources/wire_transfers.js +11 -3
- package/lib/cjs/static.d.ts +1 -1
- package/lib/cjs/util.d.ts +8 -1
- package/lib/esm/api.d.ts +1 -38
- package/lib/esm/api.js +14 -1
- package/lib/esm/client.d.ts +8 -15
- package/lib/esm/client.js +40 -40
- package/lib/esm/commercelayer.d.ts +6 -5
- package/lib/esm/commercelayer.js +4 -8
- 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 -3
- package/lib/esm/debug.js +4 -0
- package/lib/esm/error.d.ts +3 -6
- package/lib/esm/error.js +6 -37
- 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 +2 -9
- package/lib/esm/model.d.ts +1 -1
- package/lib/esm/query.d.ts +15 -9
- package/lib/esm/query.js +2 -2
- package/lib/esm/resource.d.ts +20 -31
- package/lib/esm/resource.js +10 -56
- package/lib/esm/resources/addresses.d.ts +73 -74
- package/lib/esm/resources/addresses.js +11 -3
- package/lib/esm/resources/adjustments.d.ts +19 -20
- package/lib/esm/resources/adjustments.js +11 -3
- package/lib/esm/resources/adyen_gateways.d.ts +34 -35
- package/lib/esm/resources/adyen_gateways.js +11 -3
- package/lib/esm/resources/adyen_payments.d.ts +27 -29
- package/lib/esm/resources/adyen_payments.js +11 -6
- 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 +45 -49
- package/lib/esm/resources/authorizations.js +13 -14
- package/lib/esm/resources/avalara_accounts.d.ts +31 -32
- package/lib/esm/resources/avalara_accounts.js +11 -3
- package/lib/esm/resources/axerve_gateways.d.ts +23 -24
- package/lib/esm/resources/axerve_gateways.js +11 -3
- package/lib/esm/resources/axerve_payments.d.ts +32 -32
- package/lib/esm/resources/axerve_payments.js +11 -6
- package/lib/esm/resources/billing_info_validation_rules.d.ts +16 -17
- package/lib/esm/resources/billing_info_validation_rules.js +11 -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 +33 -34
- package/lib/esm/resources/braintree_gateways.js +11 -3
- package/lib/esm/resources/braintree_payments.d.ts +29 -30
- package/lib/esm/resources/braintree_payments.js +11 -3
- package/lib/esm/resources/bundles.d.ts +56 -59
- package/lib/esm/resources/bundles.js +11 -9
- package/lib/esm/resources/buy_x_pay_y_promotions.d.ts +85 -86
- package/lib/esm/resources/buy_x_pay_y_promotions.js +11 -9
- package/lib/esm/resources/captures.d.ts +36 -39
- package/lib/esm/resources/captures.js +13 -11
- package/lib/esm/resources/carrier_accounts.d.ts +15 -16
- package/lib/esm/resources/carrier_accounts.js +8 -0
- package/lib/esm/resources/checkout_com_gateways.d.ts +24 -25
- package/lib/esm/resources/checkout_com_gateways.js +11 -3
- package/lib/esm/resources/checkout_com_payments.d.ts +38 -41
- package/lib/esm/resources/checkout_com_payments.js +11 -9
- package/lib/esm/resources/cleanups.d.ts +23 -24
- package/lib/esm/resources/cleanups.js +10 -2
- package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +32 -33
- package/lib/esm/resources/coupon_codes_promotion_rules.js +11 -3
- package/lib/esm/resources/coupon_recipients.d.ts +25 -26
- package/lib/esm/resources/coupon_recipients.js +11 -3
- package/lib/esm/resources/coupons.d.ts +41 -42
- package/lib/esm/resources/coupons.js +11 -3
- package/lib/esm/resources/custom_promotion_rules.d.ts +30 -31
- package/lib/esm/resources/custom_promotion_rules.js +11 -3
- package/lib/esm/resources/customer_addresses.d.ts +22 -23
- package/lib/esm/resources/customer_addresses.js +11 -3
- package/lib/esm/resources/customer_groups.d.ts +16 -17
- package/lib/esm/resources/customer_groups.js +11 -3
- package/lib/esm/resources/customer_password_resets.d.ts +17 -19
- package/lib/esm/resources/customer_password_resets.js +11 -6
- package/lib/esm/resources/customer_payment_sources.d.ts +49 -38
- package/lib/esm/resources/customer_payment_sources.js +15 -3
- package/lib/esm/resources/customer_subscriptions.d.ts +14 -15
- package/lib/esm/resources/customer_subscriptions.js +11 -3
- package/lib/esm/resources/customers.d.ts +36 -37
- package/lib/esm/resources/customers.js +11 -3
- package/lib/esm/resources/delivery_lead_times.d.ts +26 -27
- package/lib/esm/resources/delivery_lead_times.js +11 -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 +31 -32
- package/lib/esm/resources/external_gateways.js +11 -3
- package/lib/esm/resources/external_payments.d.ts +22 -23
- package/lib/esm/resources/external_payments.js +11 -3
- package/lib/esm/resources/external_promotions.d.ts +82 -83
- package/lib/esm/resources/external_promotions.js +11 -9
- package/lib/esm/resources/external_tax_calculators.d.ts +18 -19
- package/lib/esm/resources/external_tax_calculators.js +11 -3
- package/lib/esm/resources/fixed_amount_promotions.d.ts +83 -84
- package/lib/esm/resources/fixed_amount_promotions.js +11 -9
- package/lib/esm/resources/fixed_price_promotions.d.ts +82 -83
- package/lib/esm/resources/fixed_price_promotions.js +11 -9
- package/lib/esm/resources/free_gift_promotions.d.ts +81 -82
- package/lib/esm/resources/free_gift_promotions.js +11 -9
- package/lib/esm/resources/free_shipping_promotions.d.ts +74 -75
- package/lib/esm/resources/free_shipping_promotions.js +11 -9
- 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 +25 -26
- package/lib/esm/resources/gift_card_recipients.js +11 -3
- package/lib/esm/resources/gift_cards.d.ts +66 -71
- package/lib/esm/resources/gift_cards.js +11 -15
- 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 +35 -38
- package/lib/esm/resources/in_stock_subscriptions.js +11 -9
- package/lib/esm/resources/inventory_models.d.ts +28 -29
- package/lib/esm/resources/inventory_models.js +11 -3
- package/lib/esm/resources/inventory_return_locations.d.ts +21 -22
- package/lib/esm/resources/inventory_return_locations.js +11 -3
- package/lib/esm/resources/inventory_stock_locations.d.ts +24 -25
- package/lib/esm/resources/inventory_stock_locations.js +11 -3
- package/lib/esm/resources/klarna_gateways.d.ts +22 -23
- package/lib/esm/resources/klarna_gateways.js +11 -3
- package/lib/esm/resources/klarna_payments.d.ts +27 -29
- package/lib/esm/resources/klarna_payments.js +11 -6
- 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 +100 -97
- package/lib/esm/resources/line_items.js +11 -9
- package/lib/esm/resources/manual_gateways.d.ts +14 -15
- package/lib/esm/resources/manual_gateways.js +11 -3
- package/lib/esm/resources/manual_tax_calculators.d.ts +20 -21
- package/lib/esm/resources/manual_tax_calculators.js +11 -3
- package/lib/esm/resources/markets.d.ts +64 -62
- package/lib/esm/resources/markets.js +11 -9
- package/lib/esm/resources/merchants.d.ts +18 -19
- package/lib/esm/resources/merchants.js +11 -3
- package/lib/esm/resources/order_amount_promotion_rules.d.ts +35 -36
- package/lib/esm/resources/order_amount_promotion_rules.js +11 -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 +39 -40
- package/lib/esm/resources/order_subscription_items.js +11 -3
- package/lib/esm/resources/order_subscriptions.d.ts +51 -55
- package/lib/esm/resources/order_subscriptions.js +11 -12
- package/lib/esm/resources/order_validation_rules.d.ts +12 -13
- package/lib/esm/resources/order_validation_rules.js +8 -0
- package/lib/esm/resources/orders.d.ts +251 -277
- package/lib/esm/resources/orders.js +11 -84
- package/lib/esm/resources/organization.d.ts +24 -25
- package/lib/esm/resources/organization.js +7 -2
- package/lib/esm/resources/packages.d.ts +30 -31
- package/lib/esm/resources/packages.js +11 -3
- package/lib/esm/resources/parcel_line_items.d.ts +22 -23
- package/lib/esm/resources/parcel_line_items.js +11 -3
- package/lib/esm/resources/parcels.d.ts +93 -94
- package/lib/esm/resources/parcels.js +11 -3
- package/lib/esm/resources/payment_gateways.d.ts +12 -13
- package/lib/esm/resources/payment_gateways.js +8 -0
- package/lib/esm/resources/payment_methods.d.ts +51 -52
- package/lib/esm/resources/payment_methods.js +11 -9
- package/lib/esm/resources/payment_options.d.ts +23 -24
- package/lib/esm/resources/payment_options.js +11 -3
- package/lib/esm/resources/paypal_gateways.d.ts +17 -18
- package/lib/esm/resources/paypal_gateways.js +11 -3
- package/lib/esm/resources/paypal_payments.d.ts +31 -32
- package/lib/esm/resources/paypal_payments.js +11 -3
- package/lib/esm/resources/percentage_discount_promotions.d.ts +81 -82
- package/lib/esm/resources/percentage_discount_promotions.js +11 -9
- package/lib/esm/resources/price_frequency_tiers.d.ts +26 -27
- package/lib/esm/resources/price_frequency_tiers.js +11 -3
- package/lib/esm/resources/price_lists.d.ts +23 -21
- package/lib/esm/resources/price_lists.js +11 -3
- package/lib/esm/resources/price_tiers.d.ts +17 -18
- package/lib/esm/resources/price_tiers.js +8 -0
- package/lib/esm/resources/price_volume_tiers.d.ts +26 -27
- package/lib/esm/resources/price_volume_tiers.js +11 -3
- package/lib/esm/resources/prices.d.ts +40 -41
- package/lib/esm/resources/prices.js +11 -3
- package/lib/esm/resources/promotion_rules.d.ts +11 -12
- package/lib/esm/resources/promotion_rules.js +8 -0
- package/lib/esm/resources/promotions.d.ts +30 -31
- package/lib/esm/resources/promotions.js +8 -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 +27 -28
- package/lib/esm/resources/refunds.js +12 -4
- package/lib/esm/resources/reserved_stocks.d.ts +13 -14
- package/lib/esm/resources/reserved_stocks.js +8 -0
- package/lib/esm/resources/return_line_items.d.ts +27 -29
- package/lib/esm/resources/return_line_items.js +11 -6
- package/lib/esm/resources/returns.d.ts +49 -59
- package/lib/esm/resources/returns.js +11 -30
- package/lib/esm/resources/satispay_gateways.d.ts +22 -23
- package/lib/esm/resources/satispay_gateways.js +11 -3
- package/lib/esm/resources/satispay_payments.d.ts +29 -31
- package/lib/esm/resources/satispay_payments.js +11 -6
- package/lib/esm/resources/shipments.d.ts +86 -88
- package/lib/esm/resources/shipments.js +15 -33
- package/lib/esm/resources/shipping_categories.d.ts +18 -16
- package/lib/esm/resources/shipping_categories.js +11 -3
- package/lib/esm/resources/shipping_method_tiers.d.ts +17 -18
- package/lib/esm/resources/shipping_method_tiers.js +8 -0
- package/lib/esm/resources/shipping_methods.d.ts +79 -80
- package/lib/esm/resources/shipping_methods.js +11 -9
- package/lib/esm/resources/shipping_weight_tiers.d.ts +25 -26
- package/lib/esm/resources/shipping_weight_tiers.js +11 -3
- package/lib/esm/resources/shipping_zones.d.ts +32 -33
- package/lib/esm/resources/shipping_zones.js +11 -3
- package/lib/esm/resources/sku_list_items.d.ts +26 -27
- package/lib/esm/resources/sku_list_items.js +11 -3
- package/lib/esm/resources/sku_list_promotion_rules.d.ts +39 -40
- package/lib/esm/resources/sku_list_promotion_rules.js +11 -3
- package/lib/esm/resources/sku_lists.d.ts +35 -36
- package/lib/esm/resources/sku_lists.js +11 -3
- package/lib/esm/resources/sku_options.d.ts +43 -44
- package/lib/esm/resources/sku_options.js +11 -3
- package/lib/esm/resources/skus.d.ts +56 -57
- package/lib/esm/resources/skus.js +11 -3
- package/lib/esm/resources/stock_items.d.ts +28 -29
- package/lib/esm/resources/stock_items.js +11 -3
- package/lib/esm/resources/stock_line_items.d.ts +37 -37
- package/lib/esm/resources/stock_line_items.js +11 -3
- package/lib/esm/resources/stock_locations.d.ts +32 -30
- package/lib/esm/resources/stock_locations.js +11 -3
- package/lib/esm/resources/stock_reservations.d.ts +23 -25
- package/lib/esm/resources/stock_reservations.js +11 -6
- package/lib/esm/resources/stock_transfers.d.ts +44 -50
- package/lib/esm/resources/stock_transfers.js +11 -21
- package/lib/esm/resources/stripe_gateways.d.ts +22 -23
- package/lib/esm/resources/stripe_gateways.js +11 -3
- package/lib/esm/resources/stripe_payments.d.ts +34 -35
- package/lib/esm/resources/stripe_payments.js +11 -9
- 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 +13 -14
- package/lib/esm/resources/tax_calculators.js +8 -0
- package/lib/esm/resources/tax_categories.d.ts +30 -31
- package/lib/esm/resources/tax_categories.js +11 -3
- package/lib/esm/resources/tax_rules.d.ts +51 -52
- package/lib/esm/resources/tax_rules.js +11 -3
- package/lib/esm/resources/taxjar_accounts.d.ts +21 -22
- package/lib/esm/resources/taxjar_accounts.js +11 -3
- package/lib/esm/resources/transactions.d.ts +26 -24
- package/lib/esm/resources/transactions.js +12 -0
- package/lib/esm/resources/versions.d.ts +14 -14
- package/lib/esm/resources/versions.js +8 -0
- package/lib/esm/resources/voids.d.ts +27 -28
- package/lib/esm/resources/voids.js +12 -4
- package/lib/esm/resources/webhooks.d.ts +31 -28
- package/lib/esm/resources/webhooks.js +11 -6
- package/lib/esm/resources/wire_transfers.d.ts +16 -17
- package/lib/esm/resources/wire_transfers.js +11 -3
- package/lib/esm/static.d.ts +1 -1
- package/lib/esm/util.d.ts +8 -1
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
@@ -1,50 +1,49 @@
|
|
1
|
-
import { ApiResource } from '../resource';
|
2
|
-
import type {
|
3
|
-
import type {
|
4
|
-
import type {
|
5
|
-
import type { Sku, SkuType } from './skus';
|
1
|
+
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
+
import type { StockLocation } from './stock_locations';
|
4
|
+
import type { Sku } from './skus';
|
6
5
|
import type { ReservedStock } from './reserved_stocks';
|
7
6
|
import type { StockReservation } from './stock_reservations';
|
8
7
|
import type { Attachment } from './attachments';
|
9
8
|
import type { Version } from './versions';
|
10
|
-
type StockItemType = 'stock_items';
|
11
9
|
type StockItemRel = ResourceRel & {
|
12
|
-
type:
|
10
|
+
type: typeof StockItems.TYPE;
|
13
11
|
};
|
14
12
|
type StockLocationRel = ResourceRel & {
|
15
|
-
type:
|
13
|
+
type: 'stock_locations';
|
16
14
|
};
|
17
15
|
type SkuRel = ResourceRel & {
|
18
|
-
type:
|
16
|
+
type: 'skus';
|
19
17
|
};
|
20
18
|
interface StockItem extends Resource {
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
versions?: Version[] | null;
|
19
|
+
sku_code?: string;
|
20
|
+
quantity?: number;
|
21
|
+
stock_location?: StockLocation;
|
22
|
+
sku?: Sku;
|
23
|
+
reserved_stock?: ReservedStock;
|
24
|
+
stock_reservations?: StockReservation[];
|
25
|
+
attachments?: Attachment[];
|
26
|
+
versions?: Version[];
|
30
27
|
}
|
31
28
|
interface StockItemCreate extends ResourceCreate {
|
32
|
-
sku_code?: string
|
29
|
+
sku_code?: string;
|
33
30
|
quantity: number;
|
34
31
|
stock_location: StockLocationRel;
|
35
|
-
sku?: SkuRel
|
32
|
+
sku?: SkuRel;
|
36
33
|
}
|
37
34
|
interface StockItemUpdate extends ResourceUpdate {
|
38
|
-
sku_code?: string
|
39
|
-
quantity?: number
|
40
|
-
stock_location?: StockLocationRel
|
41
|
-
sku?: SkuRel
|
35
|
+
sku_code?: string;
|
36
|
+
quantity?: number;
|
37
|
+
stock_location?: StockLocationRel;
|
38
|
+
sku?: SkuRel;
|
42
39
|
}
|
43
|
-
declare class StockItems extends ApiResource
|
44
|
-
static readonly TYPE:
|
40
|
+
declare class StockItems extends ApiResource {
|
41
|
+
static readonly TYPE: 'stock_items';
|
42
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockItem>>;
|
45
43
|
create(resource: StockItemCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockItem>;
|
44
|
+
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockItem>;
|
46
45
|
update(resource: StockItemUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockItem>;
|
47
|
-
delete(id: string
|
46
|
+
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
48
47
|
stock_location(stockItemId: string | StockItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
|
49
48
|
sku(stockItemId: string | StockItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
|
50
49
|
reserved_stock(stockItemId: string | StockItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ReservedStock>;
|
@@ -53,7 +52,7 @@ declare class StockItems extends ApiResource<StockItem> {
|
|
53
52
|
versions(stockItemId: string | StockItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
54
53
|
isStockItem(resource: any): resource is StockItem;
|
55
54
|
relationship(id: string | ResourceId | null): StockItemRel;
|
56
|
-
type():
|
55
|
+
type(): string;
|
57
56
|
}
|
58
57
|
export default StockItems;
|
59
|
-
export
|
58
|
+
export { StockItem, StockItemCreate, StockItemUpdate };
|
@@ -1,13 +1,20 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class StockItems extends ApiResource {
|
3
|
+
// static readonly PATH = 'stock_items'
|
4
|
+
async list(params, options) {
|
5
|
+
return this.resources.list({ type: StockItems.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: StockItems.TYPE }), params, options);
|
9
|
+
}
|
10
|
+
async retrieve(id, params, options) {
|
11
|
+
return this.resources.retrieve({ type: StockItems.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: StockItems.TYPE }), params, options);
|
8
15
|
}
|
9
16
|
async delete(id, options) {
|
10
|
-
await this.resources.delete(
|
17
|
+
await this.resources.delete({ type: StockItems.TYPE, id }, options);
|
11
18
|
}
|
12
19
|
async stock_location(stockItemId, params, options) {
|
13
20
|
const _stockItemId = stockItemId.id || stockItemId;
|
@@ -33,6 +40,7 @@ class StockItems extends ApiResource {
|
|
33
40
|
const _stockItemId = stockItemId.id || stockItemId;
|
34
41
|
return this.resources.fetch({ type: 'versions' }, `stock_items/${_stockItemId}/versions`, params, options);
|
35
42
|
}
|
43
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
36
44
|
isStockItem(resource) {
|
37
45
|
return resource.type && (resource.type === StockItems.TYPE);
|
38
46
|
}
|
@@ -1,58 +1,58 @@
|
|
1
|
-
import { ApiResource } from '../resource';
|
2
|
-
import type {
|
3
|
-
import type {
|
4
|
-
import type {
|
5
|
-
import type {
|
6
|
-
import type {
|
7
|
-
import type { Sku, SkuType } from './skus';
|
1
|
+
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
+
import type { Shipment } from './shipments';
|
4
|
+
import type { LineItem } from './line_items';
|
5
|
+
import type { StockItem } from './stock_items';
|
6
|
+
import type { Sku } from './skus';
|
8
7
|
import type { Version } from './versions';
|
9
|
-
type StockLineItemType = 'stock_line_items';
|
10
8
|
type StockLineItemRel = ResourceRel & {
|
11
|
-
type:
|
9
|
+
type: typeof StockLineItems.TYPE;
|
12
10
|
};
|
13
11
|
type ShipmentRel = ResourceRel & {
|
14
|
-
type:
|
12
|
+
type: 'shipments';
|
15
13
|
};
|
16
14
|
type LineItemRel = ResourceRel & {
|
17
|
-
type:
|
15
|
+
type: 'line_items';
|
18
16
|
};
|
19
17
|
type StockItemRel = ResourceRel & {
|
20
|
-
type:
|
18
|
+
type: 'stock_items';
|
21
19
|
};
|
22
20
|
type SkuRel = ResourceRel & {
|
23
|
-
type:
|
21
|
+
type: 'skus';
|
24
22
|
};
|
25
23
|
interface StockLineItem extends Resource {
|
26
|
-
|
27
|
-
|
28
|
-
quantity
|
29
|
-
shipment?: Shipment
|
30
|
-
line_item?: LineItem
|
31
|
-
stock_item?: StockItem
|
32
|
-
sku?: Sku
|
33
|
-
versions?: Version[]
|
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[];
|
34
32
|
}
|
35
33
|
interface StockLineItemCreate extends ResourceCreate {
|
36
|
-
sku_code?: string
|
34
|
+
sku_code?: string;
|
37
35
|
quantity: number;
|
38
|
-
shipment?: ShipmentRel
|
39
|
-
line_item?: LineItemRel
|
40
|
-
stock_item?: StockItemRel
|
41
|
-
sku?: SkuRel
|
36
|
+
shipment?: ShipmentRel;
|
37
|
+
line_item?: LineItemRel;
|
38
|
+
stock_item?: StockItemRel;
|
39
|
+
sku?: SkuRel;
|
42
40
|
}
|
43
41
|
interface StockLineItemUpdate extends ResourceUpdate {
|
44
|
-
sku_code?: string
|
45
|
-
quantity?: number
|
46
|
-
shipment?: ShipmentRel
|
47
|
-
line_item?: LineItemRel
|
48
|
-
stock_item?: StockItemRel
|
49
|
-
sku?: SkuRel
|
42
|
+
sku_code?: string;
|
43
|
+
quantity?: number;
|
44
|
+
shipment?: ShipmentRel;
|
45
|
+
line_item?: LineItemRel;
|
46
|
+
stock_item?: StockItemRel;
|
47
|
+
sku?: SkuRel;
|
50
48
|
}
|
51
|
-
declare class StockLineItems extends ApiResource
|
52
|
-
static readonly TYPE:
|
49
|
+
declare class StockLineItems extends ApiResource {
|
50
|
+
static readonly TYPE: 'stock_line_items';
|
51
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockLineItem>>;
|
53
52
|
create(resource: StockLineItemCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLineItem>;
|
53
|
+
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLineItem>;
|
54
54
|
update(resource: StockLineItemUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLineItem>;
|
55
|
-
delete(id: string
|
55
|
+
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
56
56
|
shipment(stockLineItemId: string | StockLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Shipment>;
|
57
57
|
line_item(stockLineItemId: string | StockLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
|
58
58
|
stock_item(stockLineItemId: string | StockLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockItem>;
|
@@ -60,7 +60,7 @@ declare class StockLineItems extends ApiResource<StockLineItem> {
|
|
60
60
|
versions(stockLineItemId: string | StockLineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
61
61
|
isStockLineItem(resource: any): resource is StockLineItem;
|
62
62
|
relationship(id: string | ResourceId | null): StockLineItemRel;
|
63
|
-
type():
|
63
|
+
type(): string;
|
64
64
|
}
|
65
65
|
export default StockLineItems;
|
66
|
-
export
|
66
|
+
export { StockLineItem, StockLineItemCreate, StockLineItemUpdate };
|
@@ -1,13 +1,20 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class StockLineItems extends ApiResource {
|
3
|
+
// static readonly PATH = 'stock_line_items'
|
4
|
+
async list(params, options) {
|
5
|
+
return this.resources.list({ type: StockLineItems.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: StockLineItems.TYPE }), params, options);
|
9
|
+
}
|
10
|
+
async retrieve(id, params, options) {
|
11
|
+
return this.resources.retrieve({ type: StockLineItems.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: StockLineItems.TYPE }), params, options);
|
8
15
|
}
|
9
16
|
async delete(id, options) {
|
10
|
-
await this.resources.delete(
|
17
|
+
await this.resources.delete({ type: StockLineItems.TYPE, id }, options);
|
11
18
|
}
|
12
19
|
async shipment(stockLineItemId, params, options) {
|
13
20
|
const _stockLineItemId = stockLineItemId.id || stockLineItemId;
|
@@ -29,6 +36,7 @@ class StockLineItems extends ApiResource {
|
|
29
36
|
const _stockLineItemId = stockLineItemId.id || stockLineItemId;
|
30
37
|
return this.resources.fetch({ type: 'versions' }, `stock_line_items/${_stockLineItemId}/versions`, params, options);
|
31
38
|
}
|
39
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
32
40
|
isStockLineItem(resource) {
|
33
41
|
return resource.type && (resource.type === StockLineItems.TYPE);
|
34
42
|
}
|
@@ -1,51 +1,53 @@
|
|
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
9
|
import type { Version } from './versions';
|
11
|
-
type StockLocationType = 'stock_locations';
|
12
10
|
type StockLocationRel = ResourceRel & {
|
13
|
-
type:
|
11
|
+
type: typeof StockLocations.TYPE;
|
14
12
|
};
|
15
13
|
type AddressRel = ResourceRel & {
|
16
|
-
type:
|
14
|
+
type: 'addresses';
|
17
15
|
};
|
18
16
|
interface StockLocation extends Resource {
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
label_format?: string
|
23
|
-
suppress_etd?: boolean
|
24
|
-
address?: Address
|
25
|
-
inventory_stock_locations?: InventoryStockLocation[]
|
26
|
-
inventory_return_locations?: InventoryReturnLocation[]
|
27
|
-
stock_items?: StockItem[]
|
28
|
-
stock_transfers?: StockTransfer[]
|
29
|
-
attachments?: Attachment[]
|
30
|
-
versions?: Version[]
|
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[];
|
31
29
|
}
|
32
30
|
interface StockLocationCreate extends ResourceCreate {
|
33
31
|
name: string;
|
34
|
-
|
35
|
-
|
32
|
+
code?: string;
|
33
|
+
label_format?: string;
|
34
|
+
suppress_etd?: boolean;
|
36
35
|
address: AddressRel;
|
37
36
|
}
|
38
37
|
interface StockLocationUpdate extends ResourceUpdate {
|
39
|
-
name?: string
|
40
|
-
|
41
|
-
|
42
|
-
|
38
|
+
name?: string;
|
39
|
+
code?: string;
|
40
|
+
label_format?: string;
|
41
|
+
suppress_etd?: boolean;
|
42
|
+
address?: AddressRel;
|
43
43
|
}
|
44
|
-
declare class StockLocations extends ApiResource
|
45
|
-
static readonly TYPE:
|
44
|
+
declare class StockLocations extends ApiResource {
|
45
|
+
static readonly TYPE: 'stock_locations';
|
46
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockLocation>>;
|
46
47
|
create(resource: StockLocationCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
|
48
|
+
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
|
47
49
|
update(resource: StockLocationUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
|
48
|
-
delete(id: string
|
50
|
+
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
49
51
|
address(stockLocationId: string | StockLocation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Address>;
|
50
52
|
inventory_stock_locations(stockLocationId: string | StockLocation, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<InventoryStockLocation>>;
|
51
53
|
inventory_return_locations(stockLocationId: string | StockLocation, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<InventoryReturnLocation>>;
|
@@ -55,7 +57,7 @@ declare class StockLocations extends ApiResource<StockLocation> {
|
|
55
57
|
versions(stockLocationId: string | StockLocation, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
56
58
|
isStockLocation(resource: any): resource is StockLocation;
|
57
59
|
relationship(id: string | ResourceId | null): StockLocationRel;
|
58
|
-
type():
|
60
|
+
type(): string;
|
59
61
|
}
|
60
62
|
export default StockLocations;
|
61
|
-
export
|
63
|
+
export { StockLocation, StockLocationCreate, StockLocationUpdate };
|
@@ -1,13 +1,20 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class StockLocations extends ApiResource {
|
3
|
+
// static readonly PATH = 'stock_locations'
|
4
|
+
async list(params, options) {
|
5
|
+
return this.resources.list({ type: StockLocations.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: StockLocations.TYPE }), params, options);
|
9
|
+
}
|
10
|
+
async retrieve(id, params, options) {
|
11
|
+
return this.resources.retrieve({ type: StockLocations.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: StockLocations.TYPE }), params, options);
|
8
15
|
}
|
9
16
|
async delete(id, options) {
|
10
|
-
await this.resources.delete(
|
17
|
+
await this.resources.delete({ type: StockLocations.TYPE, id }, options);
|
11
18
|
}
|
12
19
|
async address(stockLocationId, params, options) {
|
13
20
|
const _stockLocationId = stockLocationId.id || stockLocationId;
|
@@ -37,6 +44,7 @@ class StockLocations extends ApiResource {
|
|
37
44
|
const _stockLocationId = stockLocationId.id || stockLocationId;
|
38
45
|
return this.resources.fetch({ type: 'versions' }, `stock_locations/${_stockLocationId}/versions`, params, options);
|
39
46
|
}
|
47
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
40
48
|
isStockLocation(resource) {
|
41
49
|
return resource.type && (resource.type === StockLocations.TYPE);
|
42
50
|
}
|
@@ -1,52 +1,50 @@
|
|
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 { LineItem } from './line_items';
|
5
4
|
import type { Order } from './orders';
|
6
|
-
import type { StockItem
|
5
|
+
import type { StockItem } from './stock_items';
|
7
6
|
import type { ReservedStock } from './reserved_stocks';
|
8
7
|
import type { Sku } from './skus';
|
9
|
-
type StockReservationType = 'stock_reservations';
|
10
8
|
type StockReservationRel = ResourceRel & {
|
11
|
-
type:
|
9
|
+
type: typeof StockReservations.TYPE;
|
12
10
|
};
|
13
11
|
type StockItemRel = ResourceRel & {
|
14
|
-
type:
|
12
|
+
type: 'stock_items';
|
15
13
|
};
|
16
14
|
interface StockReservation extends Resource {
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
sku?: Sku | null;
|
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;
|
26
23
|
}
|
27
24
|
interface StockReservationCreate extends ResourceCreate {
|
28
25
|
quantity: number;
|
29
26
|
stock_item: StockItemRel;
|
30
27
|
}
|
31
28
|
interface StockReservationUpdate extends ResourceUpdate {
|
32
|
-
quantity?: number
|
33
|
-
_pending?: boolean
|
34
|
-
stock_item?: StockItemRel
|
29
|
+
quantity?: number;
|
30
|
+
_pending?: boolean;
|
31
|
+
stock_item?: StockItemRel;
|
35
32
|
}
|
36
|
-
declare class StockReservations extends ApiResource
|
37
|
-
static readonly TYPE:
|
33
|
+
declare class StockReservations extends ApiResource {
|
34
|
+
static readonly TYPE: 'stock_reservations';
|
35
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockReservation>>;
|
38
36
|
create(resource: StockReservationCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockReservation>;
|
37
|
+
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockReservation>;
|
39
38
|
update(resource: StockReservationUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockReservation>;
|
40
|
-
delete(id: string
|
39
|
+
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
41
40
|
line_item(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
|
42
41
|
order(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
43
42
|
stock_item(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockItem>;
|
44
43
|
reserved_stock(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ReservedStock>;
|
45
44
|
sku(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
|
46
|
-
_pending(id: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockReservation>;
|
47
45
|
isStockReservation(resource: any): resource is StockReservation;
|
48
46
|
relationship(id: string | ResourceId | null): StockReservationRel;
|
49
|
-
type():
|
47
|
+
type(): string;
|
50
48
|
}
|
51
49
|
export default StockReservations;
|
52
|
-
export
|
50
|
+
export { StockReservation, StockReservationCreate, StockReservationUpdate };
|
@@ -1,13 +1,20 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class StockReservations extends ApiResource {
|
3
|
+
// static readonly PATH = 'stock_reservations'
|
4
|
+
async list(params, options) {
|
5
|
+
return this.resources.list({ type: StockReservations.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: StockReservations.TYPE }), params, options);
|
9
|
+
}
|
10
|
+
async retrieve(id, params, options) {
|
11
|
+
return this.resources.retrieve({ type: StockReservations.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: StockReservations.TYPE }), params, options);
|
8
15
|
}
|
9
16
|
async delete(id, options) {
|
10
|
-
await this.resources.delete(
|
17
|
+
await this.resources.delete({ type: StockReservations.TYPE, id }, options);
|
11
18
|
}
|
12
19
|
async line_item(stockReservationId, params, options) {
|
13
20
|
const _stockReservationId = stockReservationId.id || stockReservationId;
|
@@ -29,9 +36,7 @@ class StockReservations extends ApiResource {
|
|
29
36
|
const _stockReservationId = stockReservationId.id || stockReservationId;
|
30
37
|
return this.resources.fetch({ type: 'skus' }, `stock_reservations/${_stockReservationId}/sku`, params, options);
|
31
38
|
}
|
32
|
-
|
33
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: StockReservations.TYPE, _pending: true }, params, options);
|
34
|
-
}
|
39
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
35
40
|
isStockReservation(resource) {
|
36
41
|
return resource.type && (resource.type === StockReservations.TYPE);
|
37
42
|
}
|
@@ -1,69 +1,69 @@
|
|
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
8
|
import type { Version } from './versions';
|
10
|
-
type StockTransferType = 'stock_transfers';
|
11
9
|
type StockTransferRel = ResourceRel & {
|
12
|
-
type:
|
10
|
+
type: typeof StockTransfers.TYPE;
|
13
11
|
};
|
14
12
|
type SkuRel = ResourceRel & {
|
15
|
-
type:
|
13
|
+
type: 'skus';
|
16
14
|
};
|
17
15
|
type StockLocationRel = ResourceRel & {
|
18
|
-
type:
|
16
|
+
type: 'stock_locations';
|
19
17
|
};
|
20
18
|
type ShipmentRel = ResourceRel & {
|
21
|
-
type:
|
19
|
+
type: 'shipments';
|
22
20
|
};
|
23
21
|
type LineItemRel = ResourceRel & {
|
24
|
-
type:
|
22
|
+
type: 'line_items';
|
25
23
|
};
|
26
24
|
interface StockTransfer extends Resource {
|
27
|
-
|
28
|
-
sku_code?: string
|
29
|
-
status
|
30
|
-
quantity
|
31
|
-
completed_at?: string
|
32
|
-
cancelled_at?: string
|
33
|
-
sku?: Sku
|
34
|
-
origin_stock_location?: StockLocation
|
35
|
-
destination_stock_location?: StockLocation
|
36
|
-
shipment?: Shipment
|
37
|
-
line_item?: LineItem
|
38
|
-
events?: Event[]
|
39
|
-
versions?: Version[]
|
25
|
+
number?: number;
|
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[];
|
40
38
|
}
|
41
39
|
interface StockTransferCreate extends ResourceCreate {
|
42
|
-
sku_code?: string
|
40
|
+
sku_code?: string;
|
43
41
|
quantity: number;
|
44
42
|
sku: SkuRel;
|
45
43
|
origin_stock_location: StockLocationRel;
|
46
44
|
destination_stock_location: StockLocationRel;
|
47
|
-
shipment?: ShipmentRel
|
48
|
-
line_item?: LineItemRel
|
45
|
+
shipment?: ShipmentRel;
|
46
|
+
line_item?: LineItemRel;
|
49
47
|
}
|
50
48
|
interface StockTransferUpdate extends ResourceUpdate {
|
51
|
-
sku_code?: string
|
52
|
-
_upcoming?: boolean
|
53
|
-
_on_hold?: boolean
|
54
|
-
_picking?: boolean
|
55
|
-
_in_transit?: boolean
|
56
|
-
_complete?: boolean
|
57
|
-
_cancel?: boolean
|
58
|
-
sku?: SkuRel
|
59
|
-
origin_stock_location?: StockLocationRel
|
60
|
-
destination_stock_location?: StockLocationRel
|
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;
|
61
59
|
}
|
62
|
-
declare class StockTransfers extends ApiResource
|
63
|
-
static readonly TYPE:
|
60
|
+
declare class StockTransfers extends ApiResource {
|
61
|
+
static readonly TYPE: 'stock_transfers';
|
62
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockTransfer>>;
|
64
63
|
create(resource: StockTransferCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
|
64
|
+
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
|
65
65
|
update(resource: StockTransferUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
|
66
|
-
delete(id: string
|
66
|
+
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
67
67
|
sku(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
|
68
68
|
origin_stock_location(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
|
69
69
|
destination_stock_location(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
|
@@ -71,15 +71,9 @@ declare class StockTransfers extends ApiResource<StockTransfer> {
|
|
71
71
|
line_item(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
|
72
72
|
events(stockTransferId: string | StockTransfer, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
73
73
|
versions(stockTransferId: string | StockTransfer, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
74
|
-
_upcoming(id: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
|
75
|
-
_on_hold(id: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
|
76
|
-
_picking(id: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
|
77
|
-
_in_transit(id: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
|
78
|
-
_complete(id: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
|
79
|
-
_cancel(id: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
|
80
74
|
isStockTransfer(resource: any): resource is StockTransfer;
|
81
75
|
relationship(id: string | ResourceId | null): StockTransferRel;
|
82
|
-
type():
|
76
|
+
type(): string;
|
83
77
|
}
|
84
78
|
export default StockTransfers;
|
85
|
-
export
|
79
|
+
export { StockTransfer, StockTransferCreate, StockTransferUpdate };
|