@commercelayer/sdk 4.42.0 → 4.45.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 +3 -40
- package/lib/cjs/api.js +18 -8
- package/lib/cjs/client.d.ts +14 -20
- package/lib/cjs/client.js +43 -74
- package/lib/cjs/commercelayer.d.ts +7 -7
- package/lib/cjs/commercelayer.js +5 -14
- 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 +8 -11
- 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.d.ts +0 -1
- package/lib/cjs/jsonapi.js +3 -10
- package/lib/cjs/model.d.ts +1 -0
- 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 +10 -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 +43 -47
- package/lib/cjs/resources/authorizations.js +9 -10
- 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 -34
- 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 -98
- package/lib/cjs/resources/buy_x_pay_y_promotions.js +15 -13
- package/lib/cjs/resources/captures.d.ts +34 -37
- package/lib/cjs/resources/captures.js +9 -7
- 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 +46 -47
- package/lib/cjs/resources/customer_payment_sources.js +11 -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 -95
- package/lib/cjs/resources/external_promotions.js +15 -13
- 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 -96
- package/lib/cjs/resources/fixed_amount_promotions.js +15 -13
- package/lib/cjs/resources/fixed_price_promotions.d.ts +82 -95
- package/lib/cjs/resources/fixed_price_promotions.js +15 -13
- package/lib/cjs/resources/free_gift_promotions.d.ts +81 -94
- package/lib/cjs/resources/free_gift_promotions.js +15 -13
- package/lib/cjs/resources/free_shipping_promotions.d.ts +78 -86
- package/lib/cjs/resources/free_shipping_promotions.js +15 -13
- 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 +69 -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 -30
- 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 +31 -32
- 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 +101 -104
- 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 -67
- 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 +52 -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 +260 -280
- package/lib/cjs/resources/orders.js +15 -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 +54 -54
- 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 -94
- package/lib/cjs/resources/percentage_discount_promotions.js +15 -13
- 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 -24
- 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 +33 -34
- package/lib/cjs/resources/promotions.js +12 -4
- 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 +25 -26
- package/lib/cjs/resources/refunds.js +8 -0
- package/lib/cjs/resources/reserved_stocks.d.ts +13 -14
- package/lib/cjs/resources/reserved_stocks.js +8 -0
- package/lib/cjs/resources/resource_errors.d.ts +22 -0
- package/lib/cjs/resources/resource_errors.js +24 -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 +82 -94
- package/lib/cjs/resources/shipments.js +11 -36
- package/lib/cjs/resources/shipping_categories.d.ts +18 -19
- 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 -82
- 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 +40 -44
- package/lib/cjs/resources/stock_line_items.js +11 -12
- package/lib/cjs/resources/stock_locations.d.ts +32 -33
- package/lib/cjs/resources/stock_locations.js +11 -3
- package/lib/cjs/resources/stock_reservations.d.ts +22 -24
- package/lib/cjs/resources/stock_reservations.js +11 -6
- package/lib/cjs/resources/stock_transfers.d.ts +44 -51
- 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 +37 -37
- 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 +24 -25
- package/lib/cjs/resources/transactions.js +8 -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 +25 -26
- package/lib/cjs/resources/voids.js +8 -0
- package/lib/cjs/resources/webhooks.d.ts +31 -35
- package/lib/cjs/resources/webhooks.js +11 -12
- 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 +2 -5
- package/lib/cjs/static.js +2 -8
- package/lib/cjs/util.d.ts +4 -2
- package/lib/cjs/util.js +0 -1
- package/lib/esm/api.d.ts +3 -40
- package/lib/esm/api.js +15 -6
- package/lib/esm/client.d.ts +14 -20
- package/lib/esm/client.js +44 -75
- package/lib/esm/commercelayer.d.ts +7 -7
- package/lib/esm/commercelayer.js +5 -14
- 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 +8 -11
- 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.d.ts +0 -1
- package/lib/esm/jsonapi.js +3 -10
- package/lib/esm/model.d.ts +1 -0
- 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 +11 -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 +43 -47
- package/lib/esm/resources/authorizations.js +9 -10
- 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 -34
- 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 -98
- package/lib/esm/resources/buy_x_pay_y_promotions.js +15 -13
- package/lib/esm/resources/captures.d.ts +34 -37
- package/lib/esm/resources/captures.js +9 -7
- 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 +46 -47
- package/lib/esm/resources/customer_payment_sources.js +11 -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 -95
- package/lib/esm/resources/external_promotions.js +15 -13
- 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 -96
- package/lib/esm/resources/fixed_amount_promotions.js +15 -13
- package/lib/esm/resources/fixed_price_promotions.d.ts +82 -95
- package/lib/esm/resources/fixed_price_promotions.js +15 -13
- package/lib/esm/resources/free_gift_promotions.d.ts +81 -94
- package/lib/esm/resources/free_gift_promotions.js +15 -13
- package/lib/esm/resources/free_shipping_promotions.d.ts +78 -86
- package/lib/esm/resources/free_shipping_promotions.js +15 -13
- 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 +69 -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 -30
- 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 +31 -32
- 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 +101 -104
- 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 -67
- 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 +52 -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 +260 -280
- package/lib/esm/resources/orders.js +15 -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 +54 -54
- 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 -94
- package/lib/esm/resources/percentage_discount_promotions.js +15 -13
- 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 -24
- 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 +33 -34
- package/lib/esm/resources/promotions.js +12 -4
- 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 +25 -26
- package/lib/esm/resources/refunds.js +8 -0
- package/lib/esm/resources/reserved_stocks.d.ts +13 -14
- package/lib/esm/resources/reserved_stocks.js +8 -0
- package/lib/esm/resources/resource_errors.d.ts +22 -0
- package/lib/esm/resources/resource_errors.js +22 -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 +82 -94
- package/lib/esm/resources/shipments.js +11 -36
- package/lib/esm/resources/shipping_categories.d.ts +18 -19
- 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 -82
- 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 +40 -44
- package/lib/esm/resources/stock_line_items.js +11 -12
- package/lib/esm/resources/stock_locations.d.ts +32 -33
- package/lib/esm/resources/stock_locations.js +11 -3
- package/lib/esm/resources/stock_reservations.d.ts +22 -24
- package/lib/esm/resources/stock_reservations.js +11 -6
- package/lib/esm/resources/stock_transfers.d.ts +44 -51
- 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 +37 -37
- 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 +24 -25
- package/lib/esm/resources/transactions.js +8 -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 +25 -26
- package/lib/esm/resources/voids.js +8 -0
- package/lib/esm/resources/webhooks.d.ts +31 -35
- package/lib/esm/resources/webhooks.js +11 -12
- 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 +2 -5
- package/lib/esm/static.js +2 -8
- package/lib/esm/util.d.ts +4 -2
- package/lib/esm/util.js +1 -27
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +19 -19
@@ -1,13 +1,20 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class Orders extends ApiResource {
|
3
|
+
// static readonly PATH = 'orders'
|
4
|
+
async list(params, options) {
|
5
|
+
return this.resources.list({ type: Orders.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: Orders.TYPE }), params, options);
|
9
|
+
}
|
10
|
+
async retrieve(id, params, options) {
|
11
|
+
return this.resources.retrieve({ type: Orders.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: Orders.TYPE }), params, options);
|
8
15
|
}
|
9
16
|
async delete(id, options) {
|
10
|
-
await this.resources.delete(
|
17
|
+
await this.resources.delete({ type: Orders.TYPE, id }, options);
|
11
18
|
}
|
12
19
|
async market(orderId, params, options) {
|
13
20
|
const _orderId = orderId.id || orderId;
|
@@ -117,6 +124,10 @@ class Orders extends ApiResource {
|
|
117
124
|
const _orderId = orderId.id || orderId;
|
118
125
|
return this.resources.fetch({ type: 'attachments' }, `orders/${_orderId}/attachments`, params, options);
|
119
126
|
}
|
127
|
+
async resource_errors(orderId, params, options) {
|
128
|
+
const _orderId = orderId.id || orderId;
|
129
|
+
return this.resources.fetch({ type: 'resource_errors' }, `orders/${_orderId}/resource_errors`, params, options);
|
130
|
+
}
|
120
131
|
async events(orderId, params, options) {
|
121
132
|
const _orderId = orderId.id || orderId;
|
122
133
|
return this.resources.fetch({ type: 'events' }, `orders/${_orderId}/events`, params, options);
|
@@ -129,87 +140,7 @@ class Orders extends ApiResource {
|
|
129
140
|
const _orderId = orderId.id || orderId;
|
130
141
|
return this.resources.fetch({ type: 'versions' }, `orders/${_orderId}/versions`, params, options);
|
131
142
|
}
|
132
|
-
|
133
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _archive: true }, params, options);
|
134
|
-
}
|
135
|
-
async _unarchive(id, params, options) {
|
136
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _unarchive: true }, params, options);
|
137
|
-
}
|
138
|
-
async _place(id, params, options) {
|
139
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _place: true }, params, options);
|
140
|
-
}
|
141
|
-
async _cancel(id, params, options) {
|
142
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _cancel: true }, params, options);
|
143
|
-
}
|
144
|
-
async _approve(id, params, options) {
|
145
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _approve: true }, params, options);
|
146
|
-
}
|
147
|
-
async _approve_and_capture(id, params, options) {
|
148
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _approve_and_capture: true }, params, options);
|
149
|
-
}
|
150
|
-
async _authorize(id, params, options) {
|
151
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _authorize: true }, params, options);
|
152
|
-
}
|
153
|
-
async _authorization_amount_cents(id, triggerValue, params, options) {
|
154
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _authorization_amount_cents: triggerValue }, params, options);
|
155
|
-
}
|
156
|
-
async _capture(id, params, options) {
|
157
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _capture: true }, params, options);
|
158
|
-
}
|
159
|
-
async _refund(id, params, options) {
|
160
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _refund: true }, params, options);
|
161
|
-
}
|
162
|
-
async _update_taxes(id, params, options) {
|
163
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _update_taxes: true }, params, options);
|
164
|
-
}
|
165
|
-
async _nullify_payment_source(id, params, options) {
|
166
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _nullify_payment_source: true }, params, options);
|
167
|
-
}
|
168
|
-
async _billing_address_clone_id(id, triggerValue, params, options) {
|
169
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _billing_address_clone_id: triggerValue }, params, options);
|
170
|
-
}
|
171
|
-
async _shipping_address_clone_id(id, triggerValue, params, options) {
|
172
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _shipping_address_clone_id: triggerValue }, params, options);
|
173
|
-
}
|
174
|
-
async _customer_payment_source_id(id, triggerValue, params, options) {
|
175
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _customer_payment_source_id: triggerValue }, params, options);
|
176
|
-
}
|
177
|
-
async _shipping_address_same_as_billing(id, params, options) {
|
178
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _shipping_address_same_as_billing: true }, params, options);
|
179
|
-
}
|
180
|
-
async _billing_address_same_as_shipping(id, params, options) {
|
181
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _billing_address_same_as_shipping: true }, params, options);
|
182
|
-
}
|
183
|
-
async _commit_invoice(id, params, options) {
|
184
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _commit_invoice: true }, params, options);
|
185
|
-
}
|
186
|
-
async _refund_invoice(id, params, options) {
|
187
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _refund_invoice: true }, params, options);
|
188
|
-
}
|
189
|
-
async _save_payment_source_to_customer_wallet(id, params, options) {
|
190
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _save_payment_source_to_customer_wallet: true }, params, options);
|
191
|
-
}
|
192
|
-
async _save_shipping_address_to_customer_address_book(id, params, options) {
|
193
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _save_shipping_address_to_customer_address_book: true }, params, options);
|
194
|
-
}
|
195
|
-
async _save_billing_address_to_customer_address_book(id, params, options) {
|
196
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _save_billing_address_to_customer_address_book: true }, params, options);
|
197
|
-
}
|
198
|
-
async _refresh(id, params, options) {
|
199
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _refresh: true }, params, options);
|
200
|
-
}
|
201
|
-
async _validate(id, params, options) {
|
202
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _validate: true }, params, options);
|
203
|
-
}
|
204
|
-
async _create_subscriptions(id, params, options) {
|
205
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _create_subscriptions: true }, params, options);
|
206
|
-
}
|
207
|
-
async _start_editing(id, params, options) {
|
208
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _start_editing: true }, params, options);
|
209
|
-
}
|
210
|
-
async _stop_editing(id, params, options) {
|
211
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _stop_editing: true }, params, options);
|
212
|
-
}
|
143
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
213
144
|
isOrder(resource) {
|
214
145
|
return resource.type && (resource.type === Orders.TYPE);
|
215
146
|
}
|
@@ -1,33 +1,32 @@
|
|
1
|
-
import {
|
2
|
-
import type {
|
3
|
-
type OrganizationType = 'organization';
|
1
|
+
import { ApiResource, Resource, ResourcesConfig, ResourceId, ResourceRel } from '../resource';
|
2
|
+
import type { QueryParamsRetrieve } from '../query';
|
4
3
|
type OrganizationRel = ResourceRel & {
|
5
|
-
type:
|
4
|
+
type: typeof Organizations.TYPE;
|
6
5
|
};
|
7
6
|
interface Organization extends Resource {
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
order_number_editable_live?: boolean | null;
|
7
|
+
name?: string;
|
8
|
+
slug?: string;
|
9
|
+
domain?: string;
|
10
|
+
support_phone?: string;
|
11
|
+
support_email?: string;
|
12
|
+
logo_url?: string;
|
13
|
+
favicon_url?: string;
|
14
|
+
primary_color?: string;
|
15
|
+
gtm_id?: string;
|
16
|
+
gtm_id_test?: string;
|
17
|
+
max_concurrent_promotions?: number;
|
18
|
+
max_concurrent_imports?: number;
|
19
|
+
max_concurrent_exports?: number;
|
20
|
+
max_concurrent_cleanups?: number;
|
21
|
+
order_number_editable_test?: boolean;
|
22
|
+
order_number_editable_live?: boolean;
|
25
23
|
}
|
26
|
-
declare class Organizations extends
|
27
|
-
static readonly TYPE:
|
24
|
+
declare class Organizations extends ApiResource {
|
25
|
+
static readonly TYPE: 'organization';
|
26
|
+
retrieve(params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Organization>;
|
28
27
|
isOrganization(resource: any): resource is Organization;
|
29
28
|
relationship(id: string | ResourceId | null): OrganizationRel;
|
30
|
-
type():
|
29
|
+
type(): string;
|
31
30
|
}
|
32
31
|
export default Organizations;
|
33
|
-
export
|
32
|
+
export { Organization };
|
@@ -1,5 +1,10 @@
|
|
1
|
-
import {
|
2
|
-
class Organizations extends
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
class Organizations extends ApiResource {
|
3
|
+
// static readonly PATH = 'organization'
|
4
|
+
async retrieve(params, options) {
|
5
|
+
return this.resources.singleton({ type: Organizations.TYPE }, params, options);
|
6
|
+
}
|
7
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
3
8
|
isOrganization(resource) {
|
4
9
|
return resource.type && (resource.type === Organizations.TYPE);
|
5
10
|
}
|
@@ -1,33 +1,30 @@
|
|
1
|
-
import { ApiResource } from '../resource';
|
2
|
-
import type {
|
3
|
-
import type {
|
4
|
-
import type { StockLocation, StockLocationType } from './stock_locations';
|
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';
|
5
4
|
import type { Parcel } from './parcels';
|
6
5
|
import type { Attachment } from './attachments';
|
7
6
|
import type { Version } from './versions';
|
8
|
-
type PackageType = 'packages';
|
9
7
|
type PackageRel = ResourceRel & {
|
10
|
-
type:
|
8
|
+
type: typeof Packages.TYPE;
|
11
9
|
};
|
12
10
|
type StockLocationRel = ResourceRel & {
|
13
|
-
type:
|
11
|
+
type: 'stock_locations';
|
14
12
|
};
|
15
13
|
interface Package extends Resource {
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
versions?: Version[] | null;
|
14
|
+
name?: string;
|
15
|
+
code?: string;
|
16
|
+
length?: number;
|
17
|
+
width?: number;
|
18
|
+
height?: number;
|
19
|
+
unit_of_length?: string;
|
20
|
+
stock_location?: StockLocation;
|
21
|
+
parcels?: Parcel[];
|
22
|
+
attachments?: Attachment[];
|
23
|
+
versions?: Version[];
|
27
24
|
}
|
28
25
|
interface PackageCreate extends ResourceCreate {
|
29
26
|
name: string;
|
30
|
-
code?: string
|
27
|
+
code?: string;
|
31
28
|
length: number;
|
32
29
|
width: number;
|
33
30
|
height: number;
|
@@ -35,26 +32,28 @@ interface PackageCreate extends ResourceCreate {
|
|
35
32
|
stock_location: StockLocationRel;
|
36
33
|
}
|
37
34
|
interface PackageUpdate extends ResourceUpdate {
|
38
|
-
name?: string
|
39
|
-
code?: string
|
40
|
-
length?: number
|
41
|
-
width?: number
|
42
|
-
height?: number
|
43
|
-
unit_of_length?: string
|
44
|
-
stock_location?: StockLocationRel
|
35
|
+
name?: string;
|
36
|
+
code?: string;
|
37
|
+
length?: number;
|
38
|
+
width?: number;
|
39
|
+
height?: number;
|
40
|
+
unit_of_length?: string;
|
41
|
+
stock_location?: StockLocationRel;
|
45
42
|
}
|
46
|
-
declare class Packages extends ApiResource
|
47
|
-
static readonly TYPE:
|
43
|
+
declare class Packages extends ApiResource {
|
44
|
+
static readonly TYPE: 'packages';
|
45
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Package>>;
|
48
46
|
create(resource: PackageCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Package>;
|
47
|
+
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Package>;
|
49
48
|
update(resource: PackageUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Package>;
|
50
|
-
delete(id: string
|
49
|
+
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
51
50
|
stock_location(packageId: string | Package, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
|
52
51
|
parcels(packageId: string | Package, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Parcel>>;
|
53
52
|
attachments(packageId: string | Package, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
54
53
|
versions(packageId: string | Package, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
55
54
|
isPackage(resource: any): resource is Package;
|
56
55
|
relationship(id: string | ResourceId | null): PackageRel;
|
57
|
-
type():
|
56
|
+
type(): string;
|
58
57
|
}
|
59
58
|
export default Packages;
|
60
|
-
export
|
59
|
+
export { Package, PackageCreate, PackageUpdate };
|
@@ -1,13 +1,20 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class Packages extends ApiResource {
|
3
|
+
// static readonly PATH = 'packages'
|
4
|
+
async list(params, options) {
|
5
|
+
return this.resources.list({ type: Packages.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: Packages.TYPE }), params, options);
|
9
|
+
}
|
10
|
+
async retrieve(id, params, options) {
|
11
|
+
return this.resources.retrieve({ type: Packages.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: Packages.TYPE }), params, options);
|
8
15
|
}
|
9
16
|
async delete(id, options) {
|
10
|
-
await this.resources.delete(
|
17
|
+
await this.resources.delete({ type: Packages.TYPE, id }, options);
|
11
18
|
}
|
12
19
|
async stock_location(packageId, params, options) {
|
13
20
|
const _packageId = packageId.id || packageId;
|
@@ -25,6 +32,7 @@ class Packages extends ApiResource {
|
|
25
32
|
const _packageId = packageId.id || packageId;
|
26
33
|
return this.resources.fetch({ type: 'versions' }, `packages/${_packageId}/versions`, params, options);
|
27
34
|
}
|
35
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
28
36
|
isPackage(resource) {
|
29
37
|
return resource.type && (resource.type === Packages.TYPE);
|
30
38
|
}
|
@@ -1,33 +1,30 @@
|
|
1
|
-
import { ApiResource } from '../resource';
|
2
|
-
import type {
|
3
|
-
import type {
|
4
|
-
import type {
|
5
|
-
import type { StockLineItem, StockLineItemType } from './stock_line_items';
|
1
|
+
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
+
import type { Parcel } from './parcels';
|
4
|
+
import type { StockLineItem } from './stock_line_items';
|
6
5
|
import type { Version } from './versions';
|
7
|
-
type ParcelLineItemType = 'parcel_line_items';
|
8
6
|
type ParcelLineItemRel = ResourceRel & {
|
9
|
-
type:
|
7
|
+
type: typeof ParcelLineItems.TYPE;
|
10
8
|
};
|
11
9
|
type ParcelRel = ResourceRel & {
|
12
|
-
type:
|
10
|
+
type: 'parcels';
|
13
11
|
};
|
14
12
|
type StockLineItemRel = ResourceRel & {
|
15
|
-
type:
|
13
|
+
type: 'stock_line_items';
|
16
14
|
};
|
17
15
|
interface ParcelLineItem extends Resource {
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
stock_line_item?: StockLineItem | null;
|
16
|
+
sku_code?: string;
|
17
|
+
bundle_code?: string;
|
18
|
+
quantity?: number;
|
19
|
+
name?: string;
|
20
|
+
image_url?: string;
|
21
|
+
parcel?: Parcel;
|
22
|
+
stock_line_item?: StockLineItem;
|
26
23
|
/**
|
27
24
|
* @deprecated This field should not be used as it may be removed in the future without notice
|
28
25
|
*/
|
29
26
|
shipment_line_item?: object;
|
30
|
-
versions?: Version[]
|
27
|
+
versions?: Version[];
|
31
28
|
}
|
32
29
|
interface ParcelLineItemCreate extends ResourceCreate {
|
33
30
|
quantity: number;
|
@@ -39,17 +36,19 @@ interface ParcelLineItemCreate extends ResourceCreate {
|
|
39
36
|
shipment_line_item?: object;
|
40
37
|
}
|
41
38
|
type ParcelLineItemUpdate = ResourceUpdate;
|
42
|
-
declare class ParcelLineItems extends ApiResource
|
43
|
-
static readonly TYPE:
|
39
|
+
declare class ParcelLineItems extends ApiResource {
|
40
|
+
static readonly TYPE: 'parcel_line_items';
|
41
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ParcelLineItem>>;
|
44
42
|
create(resource: ParcelLineItemCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ParcelLineItem>;
|
43
|
+
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ParcelLineItem>;
|
45
44
|
update(resource: ParcelLineItemUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ParcelLineItem>;
|
46
|
-
delete(id: string
|
45
|
+
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
47
46
|
parcel(parcelLineItemId: string | ParcelLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Parcel>;
|
48
47
|
stock_line_item(parcelLineItemId: string | ParcelLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLineItem>;
|
49
48
|
versions(parcelLineItemId: string | ParcelLineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
50
49
|
isParcelLineItem(resource: any): resource is ParcelLineItem;
|
51
50
|
relationship(id: string | ResourceId | null): ParcelLineItemRel;
|
52
|
-
type():
|
51
|
+
type(): string;
|
53
52
|
}
|
54
53
|
export default ParcelLineItems;
|
55
|
-
export
|
54
|
+
export { ParcelLineItem, ParcelLineItemCreate, ParcelLineItemUpdate };
|
@@ -1,13 +1,20 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class ParcelLineItems extends ApiResource {
|
3
|
+
// static readonly PATH = 'parcel_line_items'
|
4
|
+
async list(params, options) {
|
5
|
+
return this.resources.list({ type: ParcelLineItems.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: ParcelLineItems.TYPE }), params, options);
|
9
|
+
}
|
10
|
+
async retrieve(id, params, options) {
|
11
|
+
return this.resources.retrieve({ type: ParcelLineItems.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: ParcelLineItems.TYPE }), params, options);
|
8
15
|
}
|
9
16
|
async delete(id, options) {
|
10
|
-
await this.resources.delete(
|
17
|
+
await this.resources.delete({ type: ParcelLineItems.TYPE, id }, options);
|
11
18
|
}
|
12
19
|
async parcel(parcelLineItemId, params, options) {
|
13
20
|
const _parcelLineItemId = parcelLineItemId.id || parcelLineItemId;
|
@@ -21,6 +28,7 @@ class ParcelLineItems extends ApiResource {
|
|
21
28
|
const _parcelLineItemId = parcelLineItemId.id || parcelLineItemId;
|
22
29
|
return this.resources.fetch({ type: 'versions' }, `parcel_line_items/${_parcelLineItemId}/versions`, params, options);
|
23
30
|
}
|
31
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
24
32
|
isParcelLineItem(resource) {
|
25
33
|
return resource.type && (resource.type === ParcelLineItems.TYPE);
|
26
34
|
}
|
@@ -1,117 +1,116 @@
|
|
1
|
-
import { ApiResource } from '../resource';
|
2
|
-
import type {
|
3
|
-
import type {
|
4
|
-
import type {
|
5
|
-
import type { Package, PackageType } from './packages';
|
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 { Package } from './packages';
|
6
5
|
import type { ParcelLineItem } from './parcel_line_items';
|
7
6
|
import type { Attachment } from './attachments';
|
8
7
|
import type { Event } from './events';
|
9
8
|
import type { Version } from './versions';
|
10
|
-
type ParcelType = 'parcels';
|
11
9
|
type ParcelRel = ResourceRel & {
|
12
|
-
type:
|
10
|
+
type: typeof Parcels.TYPE;
|
13
11
|
};
|
14
12
|
type ShipmentRel = ResourceRel & {
|
15
|
-
type:
|
13
|
+
type: 'shipments';
|
16
14
|
};
|
17
15
|
type PackageRel = ResourceRel & {
|
18
|
-
type:
|
16
|
+
type: 'packages';
|
19
17
|
};
|
20
18
|
interface Parcel extends Resource {
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
versions?: Version[] | null;
|
19
|
+
number?: string;
|
20
|
+
weight?: number;
|
21
|
+
unit_of_weight?: string;
|
22
|
+
eel_pfc?: string;
|
23
|
+
contents_type?: string;
|
24
|
+
contents_explanation?: string;
|
25
|
+
customs_certify?: boolean;
|
26
|
+
customs_signer?: string;
|
27
|
+
non_delivery_option?: string;
|
28
|
+
restriction_type?: string;
|
29
|
+
restriction_comments?: string;
|
30
|
+
customs_info_required?: boolean;
|
31
|
+
shipping_label_url?: string;
|
32
|
+
shipping_label_file_type?: string;
|
33
|
+
shipping_label_size?: string;
|
34
|
+
shipping_label_resolution?: string;
|
35
|
+
tracking_number?: string;
|
36
|
+
tracking_status?: string;
|
37
|
+
tracking_status_detail?: string;
|
38
|
+
tracking_status_updated_at?: string;
|
39
|
+
tracking_details?: object;
|
40
|
+
carrier_weight_oz?: string;
|
41
|
+
signed_by?: string;
|
42
|
+
incoterm?: string;
|
43
|
+
delivery_confirmation?: string;
|
44
|
+
shipment?: Shipment;
|
45
|
+
package?: Package;
|
46
|
+
parcel_line_items?: ParcelLineItem[];
|
47
|
+
attachments?: Attachment[];
|
48
|
+
events?: Event[];
|
49
|
+
versions?: Version[];
|
53
50
|
}
|
54
51
|
interface ParcelCreate extends ResourceCreate {
|
55
52
|
weight: number;
|
56
53
|
unit_of_weight: string;
|
57
|
-
eel_pfc?: string
|
58
|
-
contents_type?: string
|
59
|
-
contents_explanation?: string
|
60
|
-
customs_certify?: boolean
|
61
|
-
customs_signer?: string
|
62
|
-
non_delivery_option?: string
|
63
|
-
restriction_type?: string
|
64
|
-
restriction_comments?: string
|
65
|
-
customs_info_required?: boolean
|
66
|
-
shipping_label_url?: string
|
67
|
-
shipping_label_file_type?: string
|
68
|
-
shipping_label_size?: string
|
69
|
-
shipping_label_resolution?: string
|
70
|
-
tracking_number?: string
|
71
|
-
tracking_status?: string
|
72
|
-
tracking_status_detail?: string
|
73
|
-
tracking_status_updated_at?: string
|
74
|
-
tracking_details?:
|
75
|
-
carrier_weight_oz?: string
|
76
|
-
signed_by?: string
|
77
|
-
incoterm?: string
|
78
|
-
delivery_confirmation?: string
|
54
|
+
eel_pfc?: string;
|
55
|
+
contents_type?: string;
|
56
|
+
contents_explanation?: string;
|
57
|
+
customs_certify?: boolean;
|
58
|
+
customs_signer?: string;
|
59
|
+
non_delivery_option?: string;
|
60
|
+
restriction_type?: string;
|
61
|
+
restriction_comments?: string;
|
62
|
+
customs_info_required?: boolean;
|
63
|
+
shipping_label_url?: string;
|
64
|
+
shipping_label_file_type?: string;
|
65
|
+
shipping_label_size?: string;
|
66
|
+
shipping_label_resolution?: string;
|
67
|
+
tracking_number?: string;
|
68
|
+
tracking_status?: string;
|
69
|
+
tracking_status_detail?: string;
|
70
|
+
tracking_status_updated_at?: string;
|
71
|
+
tracking_details?: object;
|
72
|
+
carrier_weight_oz?: string;
|
73
|
+
signed_by?: string;
|
74
|
+
incoterm?: string;
|
75
|
+
delivery_confirmation?: string;
|
79
76
|
shipment: ShipmentRel;
|
80
77
|
package: PackageRel;
|
81
78
|
}
|
82
79
|
interface ParcelUpdate extends ResourceUpdate {
|
83
|
-
weight?: number
|
84
|
-
unit_of_weight?: string
|
85
|
-
eel_pfc?: string
|
86
|
-
contents_type?: string
|
87
|
-
contents_explanation?: string
|
88
|
-
customs_certify?: boolean
|
89
|
-
customs_signer?: string
|
90
|
-
non_delivery_option?: string
|
91
|
-
restriction_type?: string
|
92
|
-
restriction_comments?: string
|
93
|
-
customs_info_required?: boolean
|
94
|
-
shipping_label_url?: string
|
95
|
-
shipping_label_file_type?: string
|
96
|
-
shipping_label_size?: string
|
97
|
-
shipping_label_resolution?: string
|
98
|
-
tracking_number?: string
|
99
|
-
tracking_status?: string
|
100
|
-
tracking_status_detail?: string
|
101
|
-
tracking_status_updated_at?: string
|
102
|
-
tracking_details?:
|
103
|
-
carrier_weight_oz?: string
|
104
|
-
signed_by?: string
|
105
|
-
incoterm?: string
|
106
|
-
delivery_confirmation?: string
|
107
|
-
shipment?: ShipmentRel
|
108
|
-
package?: PackageRel
|
80
|
+
weight?: number;
|
81
|
+
unit_of_weight?: string;
|
82
|
+
eel_pfc?: string;
|
83
|
+
contents_type?: string;
|
84
|
+
contents_explanation?: string;
|
85
|
+
customs_certify?: boolean;
|
86
|
+
customs_signer?: string;
|
87
|
+
non_delivery_option?: string;
|
88
|
+
restriction_type?: string;
|
89
|
+
restriction_comments?: string;
|
90
|
+
customs_info_required?: boolean;
|
91
|
+
shipping_label_url?: string;
|
92
|
+
shipping_label_file_type?: string;
|
93
|
+
shipping_label_size?: string;
|
94
|
+
shipping_label_resolution?: string;
|
95
|
+
tracking_number?: string;
|
96
|
+
tracking_status?: string;
|
97
|
+
tracking_status_detail?: string;
|
98
|
+
tracking_status_updated_at?: string;
|
99
|
+
tracking_details?: object;
|
100
|
+
carrier_weight_oz?: string;
|
101
|
+
signed_by?: string;
|
102
|
+
incoterm?: string;
|
103
|
+
delivery_confirmation?: string;
|
104
|
+
shipment?: ShipmentRel;
|
105
|
+
package?: PackageRel;
|
109
106
|
}
|
110
|
-
declare class Parcels extends ApiResource
|
111
|
-
static readonly TYPE:
|
107
|
+
declare class Parcels extends ApiResource {
|
108
|
+
static readonly TYPE: 'parcels';
|
109
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Parcel>>;
|
112
110
|
create(resource: ParcelCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Parcel>;
|
111
|
+
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Parcel>;
|
113
112
|
update(resource: ParcelUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Parcel>;
|
114
|
-
delete(id: string
|
113
|
+
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
115
114
|
shipment(parcelId: string | Parcel, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Shipment>;
|
116
115
|
package(parcelId: string | Parcel, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Package>;
|
117
116
|
parcel_line_items(parcelId: string | Parcel, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ParcelLineItem>>;
|
@@ -120,7 +119,7 @@ declare class Parcels extends ApiResource<Parcel> {
|
|
120
119
|
versions(parcelId: string | Parcel, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
121
120
|
isParcel(resource: any): resource is Parcel;
|
122
121
|
relationship(id: string | ResourceId | null): ParcelRel;
|
123
|
-
type():
|
122
|
+
type(): string;
|
124
123
|
}
|
125
124
|
export default Parcels;
|
126
|
-
export
|
125
|
+
export { Parcel, ParcelCreate, ParcelUpdate };
|