@commercelayer/sdk 4.33.0 → 4.35.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 -22
- package/lib/cjs/api.js +17 -1
- package/lib/cjs/client.d.ts +8 -15
- package/lib/cjs/client.js +10 -42
- package/lib/cjs/commercelayer.d.ts +5 -4
- package/lib/cjs/commercelayer.js +4 -3
- package/lib/cjs/common.d.ts +0 -1
- package/lib/cjs/common.js +2 -11
- package/lib/cjs/config.d.ts +0 -1
- package/lib/cjs/config.js +0 -1
- package/lib/cjs/debug.js +4 -0
- package/lib/cjs/error.d.ts +0 -1
- package/lib/cjs/error.js +6 -2
- 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 -0
- package/lib/cjs/query.d.ts +15 -9
- package/lib/cjs/query.js +2 -3
- package/lib/cjs/resource.d.ts +19 -29
- package/lib/cjs/resource.js +9 -34
- package/lib/cjs/resources/addresses.d.ts +75 -73
- package/lib/cjs/resources/addresses.js +15 -3
- package/lib/cjs/resources/adjustments.d.ts +21 -19
- package/lib/cjs/resources/adjustments.js +15 -3
- package/lib/cjs/resources/adyen_gateways.d.ts +36 -34
- package/lib/cjs/resources/adyen_gateways.js +15 -3
- package/lib/cjs/resources/adyen_payments.d.ts +29 -27
- package/lib/cjs/resources/adyen_payments.js +15 -3
- package/lib/cjs/resources/application.d.ts +13 -14
- package/lib/cjs/resources/application.js +6 -1
- package/lib/cjs/resources/attachments.d.ts +80 -81
- package/lib/cjs/resources/attachments.js +11 -3
- package/lib/cjs/resources/authorizations.d.ts +45 -43
- package/lib/cjs/resources/authorizations.js +13 -1
- package/lib/cjs/resources/avalara_accounts.d.ts +33 -31
- package/lib/cjs/resources/avalara_accounts.js +15 -3
- package/lib/cjs/resources/axerve_gateways.d.ts +25 -22
- package/lib/cjs/resources/axerve_gateways.js +15 -3
- package/lib/cjs/resources/axerve_payments.d.ts +28 -26
- package/lib/cjs/resources/axerve_payments.js +15 -3
- package/lib/cjs/resources/billing_info_validation_rules.d.ts +18 -16
- package/lib/cjs/resources/billing_info_validation_rules.js +15 -3
- package/lib/cjs/resources/bing_geocoders.d.ts +15 -16
- package/lib/cjs/resources/bing_geocoders.js +11 -3
- package/lib/cjs/resources/braintree_gateways.d.ts +35 -33
- package/lib/cjs/resources/braintree_gateways.js +15 -3
- package/lib/cjs/resources/braintree_payments.d.ts +31 -29
- package/lib/cjs/resources/braintree_payments.js +15 -3
- package/lib/cjs/resources/bundles.d.ts +56 -54
- package/lib/cjs/resources/bundles.js +15 -3
- package/lib/cjs/resources/captures.d.ts +36 -34
- package/lib/cjs/resources/captures.js +13 -1
- package/lib/cjs/resources/carrier_accounts.d.ts +17 -15
- package/lib/cjs/resources/carrier_accounts.js +12 -0
- package/lib/cjs/resources/checkout_com_gateways.d.ts +26 -24
- package/lib/cjs/resources/checkout_com_gateways.js +15 -3
- package/lib/cjs/resources/checkout_com_payments.d.ts +40 -38
- package/lib/cjs/resources/checkout_com_payments.js +15 -3
- package/lib/cjs/resources/cleanups.d.ts +25 -23
- package/lib/cjs/resources/cleanups.js +14 -2
- package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +32 -30
- package/lib/cjs/resources/coupon_codes_promotion_rules.js +15 -3
- package/lib/cjs/resources/coupon_recipients.d.ts +27 -25
- package/lib/cjs/resources/coupon_recipients.js +15 -3
- package/lib/cjs/resources/coupons.d.ts +40 -38
- package/lib/cjs/resources/coupons.js +15 -3
- package/lib/cjs/resources/customer_addresses.d.ts +24 -22
- package/lib/cjs/resources/customer_addresses.js +15 -3
- package/lib/cjs/resources/customer_groups.d.ts +18 -16
- package/lib/cjs/resources/customer_groups.js +15 -3
- package/lib/cjs/resources/customer_password_resets.d.ts +17 -18
- package/lib/cjs/resources/customer_password_resets.js +11 -3
- package/lib/cjs/resources/customer_payment_sources.d.ts +39 -45
- package/lib/cjs/resources/customer_payment_sources.js +15 -3
- package/lib/cjs/resources/customer_subscriptions.d.ts +16 -14
- package/lib/cjs/resources/customer_subscriptions.js +15 -3
- package/lib/cjs/resources/customers.d.ts +36 -37
- package/lib/cjs/resources/customers.js +11 -3
- package/lib/cjs/resources/delivery_lead_times.d.ts +28 -26
- package/lib/cjs/resources/delivery_lead_times.js +15 -3
- package/lib/cjs/resources/event_callbacks.d.ts +14 -15
- package/lib/cjs/resources/event_callbacks.js +8 -0
- package/lib/cjs/resources/events.d.ts +12 -13
- package/lib/cjs/resources/events.js +8 -0
- package/lib/cjs/resources/exports.d.ts +26 -27
- package/lib/cjs/resources/exports.js +10 -2
- package/lib/cjs/resources/external_gateways.d.ts +33 -31
- package/lib/cjs/resources/external_gateways.js +15 -3
- package/lib/cjs/resources/external_payments.d.ts +24 -22
- package/lib/cjs/resources/external_payments.js +15 -3
- package/lib/cjs/resources/external_promotions.d.ts +70 -60
- package/lib/cjs/resources/external_promotions.js +19 -3
- package/lib/cjs/resources/external_tax_calculators.d.ts +20 -18
- package/lib/cjs/resources/external_tax_calculators.js +15 -3
- package/lib/cjs/resources/fixed_amount_promotions.d.ts +71 -61
- package/lib/cjs/resources/fixed_amount_promotions.js +19 -3
- package/lib/cjs/resources/fixed_price_promotions.d.ts +75 -65
- package/lib/cjs/resources/fixed_price_promotions.js +19 -3
- package/lib/cjs/resources/free_gift_promotions.d.ts +74 -64
- package/lib/cjs/resources/free_gift_promotions.js +19 -3
- package/lib/cjs/resources/free_shipping_promotions.d.ts +67 -57
- package/lib/cjs/resources/free_shipping_promotions.js +19 -3
- package/lib/cjs/resources/geocoders.d.ts +12 -13
- package/lib/cjs/resources/geocoders.js +8 -0
- package/lib/cjs/resources/gift_card_recipients.d.ts +27 -25
- package/lib/cjs/resources/gift_card_recipients.js +15 -3
- package/lib/cjs/resources/gift_cards.d.ts +68 -66
- package/lib/cjs/resources/gift_cards.js +15 -3
- package/lib/cjs/resources/google_geocoders.d.ts +15 -16
- package/lib/cjs/resources/google_geocoders.js +11 -3
- package/lib/cjs/resources/imports.d.ts +31 -29
- package/lib/cjs/resources/imports.js +10 -2
- package/lib/cjs/resources/in_stock_subscriptions.d.ts +37 -35
- package/lib/cjs/resources/in_stock_subscriptions.js +15 -3
- package/lib/cjs/resources/inventory_models.d.ts +27 -25
- package/lib/cjs/resources/inventory_models.js +15 -3
- package/lib/cjs/resources/inventory_return_locations.d.ts +23 -21
- package/lib/cjs/resources/inventory_return_locations.js +15 -3
- package/lib/cjs/resources/inventory_stock_locations.d.ts +26 -24
- package/lib/cjs/resources/inventory_stock_locations.js +15 -3
- package/lib/cjs/resources/klarna_gateways.d.ts +24 -22
- package/lib/cjs/resources/klarna_gateways.js +15 -3
- package/lib/cjs/resources/klarna_payments.d.ts +29 -27
- package/lib/cjs/resources/klarna_payments.js +15 -3
- package/lib/cjs/resources/line_item_options.d.ts +40 -41
- package/lib/cjs/resources/line_item_options.js +11 -3
- package/lib/cjs/resources/line_items.d.ts +93 -90
- package/lib/cjs/resources/line_items.js +11 -3
- package/lib/cjs/resources/manual_gateways.d.ts +16 -14
- package/lib/cjs/resources/manual_gateways.js +15 -3
- package/lib/cjs/resources/manual_tax_calculators.d.ts +22 -20
- package/lib/cjs/resources/manual_tax_calculators.js +15 -3
- package/lib/cjs/resources/markets.d.ts +61 -59
- package/lib/cjs/resources/markets.js +15 -3
- package/lib/cjs/resources/merchants.d.ts +20 -18
- package/lib/cjs/resources/merchants.js +15 -3
- package/lib/cjs/resources/order_amount_promotion_rules.d.ts +35 -33
- package/lib/cjs/resources/order_amount_promotion_rules.js +15 -3
- package/lib/cjs/resources/order_copies.d.ts +28 -29
- package/lib/cjs/resources/order_copies.js +11 -3
- package/lib/cjs/resources/order_factories.d.ts +20 -21
- package/lib/cjs/resources/order_factories.js +8 -0
- package/lib/cjs/resources/order_subscription_items.d.ts +41 -35
- package/lib/cjs/resources/order_subscription_items.js +15 -3
- package/lib/cjs/resources/order_subscriptions.d.ts +53 -51
- package/lib/cjs/resources/order_subscriptions.js +15 -3
- package/lib/cjs/resources/order_validation_rules.d.ts +14 -12
- package/lib/cjs/resources/order_validation_rules.js +12 -0
- package/lib/cjs/resources/orders.d.ts +238 -231
- package/lib/cjs/resources/orders.js +15 -3
- package/lib/cjs/resources/organization.d.ts +24 -25
- package/lib/cjs/resources/organization.js +6 -1
- package/lib/cjs/resources/packages.d.ts +32 -30
- package/lib/cjs/resources/packages.js +15 -3
- package/lib/cjs/resources/parcel_line_items.d.ts +24 -22
- package/lib/cjs/resources/parcel_line_items.js +15 -3
- package/lib/cjs/resources/parcels.d.ts +95 -93
- package/lib/cjs/resources/parcels.js +15 -3
- package/lib/cjs/resources/payment_gateways.d.ts +14 -12
- package/lib/cjs/resources/payment_gateways.js +12 -0
- package/lib/cjs/resources/payment_methods.d.ts +50 -48
- package/lib/cjs/resources/payment_methods.js +15 -3
- package/lib/cjs/resources/paypal_gateways.d.ts +19 -17
- package/lib/cjs/resources/paypal_gateways.js +15 -3
- package/lib/cjs/resources/paypal_payments.d.ts +33 -31
- package/lib/cjs/resources/paypal_payments.js +15 -3
- package/lib/cjs/resources/percentage_discount_promotions.d.ts +74 -64
- package/lib/cjs/resources/percentage_discount_promotions.js +19 -3
- package/lib/cjs/resources/price_frequency_tiers.d.ts +28 -26
- package/lib/cjs/resources/price_frequency_tiers.js +15 -3
- package/lib/cjs/resources/price_lists.d.ts +22 -20
- package/lib/cjs/resources/price_lists.js +15 -3
- package/lib/cjs/resources/price_tiers.d.ts +19 -17
- package/lib/cjs/resources/price_tiers.js +12 -0
- package/lib/cjs/resources/price_volume_tiers.d.ts +28 -26
- package/lib/cjs/resources/price_volume_tiers.js +15 -3
- package/lib/cjs/resources/prices.d.ts +41 -39
- package/lib/cjs/resources/prices.js +15 -3
- package/lib/cjs/resources/promotion_rules.d.ts +13 -10
- package/lib/cjs/resources/promotion_rules.js +12 -0
- package/lib/cjs/resources/promotions.d.ts +31 -26
- package/lib/cjs/resources/promotions.js +16 -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 -25
- package/lib/cjs/resources/refunds.js +12 -0
- 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 -28
- package/lib/cjs/resources/return_line_items.js +11 -3
- package/lib/cjs/resources/returns.d.ts +51 -49
- package/lib/cjs/resources/returns.js +15 -3
- package/lib/cjs/resources/satispay_gateways.d.ts +24 -22
- package/lib/cjs/resources/satispay_gateways.js +15 -3
- package/lib/cjs/resources/satispay_payments.d.ts +31 -28
- package/lib/cjs/resources/satispay_payments.js +15 -3
- package/lib/cjs/resources/shipments.d.ts +59 -52
- package/lib/cjs/resources/shipments.js +13 -1
- package/lib/cjs/resources/shipping_categories.d.ts +17 -15
- package/lib/cjs/resources/shipping_categories.js +15 -3
- package/lib/cjs/resources/shipping_method_tiers.d.ts +19 -17
- package/lib/cjs/resources/shipping_method_tiers.js +12 -0
- package/lib/cjs/resources/shipping_methods.d.ts +79 -77
- package/lib/cjs/resources/shipping_methods.js +15 -3
- package/lib/cjs/resources/shipping_weight_tiers.d.ts +27 -25
- package/lib/cjs/resources/shipping_weight_tiers.js +15 -3
- package/lib/cjs/resources/shipping_zones.d.ts +34 -32
- package/lib/cjs/resources/shipping_zones.js +15 -3
- package/lib/cjs/resources/sku_list_items.d.ts +28 -26
- package/lib/cjs/resources/sku_list_items.js +15 -3
- package/lib/cjs/resources/sku_list_promotion_rules.d.ts +39 -37
- package/lib/cjs/resources/sku_list_promotion_rules.js +15 -3
- package/lib/cjs/resources/sku_lists.d.ts +37 -35
- package/lib/cjs/resources/sku_lists.js +15 -3
- package/lib/cjs/resources/sku_options.d.ts +45 -43
- package/lib/cjs/resources/sku_options.js +15 -3
- package/lib/cjs/resources/skus.d.ts +58 -56
- package/lib/cjs/resources/skus.js +15 -3
- package/lib/cjs/resources/stock_items.d.ts +30 -28
- package/lib/cjs/resources/stock_items.js +15 -3
- package/lib/cjs/resources/stock_line_items.d.ts +19 -17
- package/lib/cjs/resources/stock_line_items.js +12 -0
- package/lib/cjs/resources/stock_locations.d.ts +31 -29
- package/lib/cjs/resources/stock_locations.js +15 -3
- package/lib/cjs/resources/stock_reservations.d.ts +17 -18
- package/lib/cjs/resources/stock_reservations.js +8 -0
- package/lib/cjs/resources/stock_transfers.d.ts +44 -42
- package/lib/cjs/resources/stock_transfers.js +15 -3
- package/lib/cjs/resources/stripe_gateways.d.ts +24 -22
- package/lib/cjs/resources/stripe_gateways.js +15 -3
- package/lib/cjs/resources/stripe_payments.d.ts +34 -29
- package/lib/cjs/resources/stripe_payments.js +15 -3
- package/lib/cjs/resources/subscription_models.d.ts +26 -27
- package/lib/cjs/resources/subscription_models.js +11 -3
- package/lib/cjs/resources/tags.d.ts +12 -13
- package/lib/cjs/resources/tags.js +11 -3
- package/lib/cjs/resources/tax_calculators.d.ts +15 -13
- package/lib/cjs/resources/tax_calculators.js +12 -0
- package/lib/cjs/resources/tax_categories.d.ts +32 -30
- package/lib/cjs/resources/tax_categories.js +15 -3
- package/lib/cjs/resources/tax_rules.d.ts +53 -51
- package/lib/cjs/resources/tax_rules.js +15 -3
- package/lib/cjs/resources/taxjar_accounts.d.ts +23 -21
- package/lib/cjs/resources/taxjar_accounts.js +15 -3
- package/lib/cjs/resources/transactions.d.ts +25 -23
- package/lib/cjs/resources/transactions.js +12 -0
- package/lib/cjs/resources/versions.d.ts +22 -0
- package/lib/cjs/resources/versions.js +24 -0
- package/lib/cjs/resources/voids.d.ts +27 -25
- package/lib/cjs/resources/voids.js +12 -0
- package/lib/cjs/resources/webhooks.d.ts +28 -26
- package/lib/cjs/resources/webhooks.js +15 -3
- package/lib/cjs/resources/wire_transfers.d.ts +18 -16
- package/lib/cjs/resources/wire_transfers.js +15 -3
- package/lib/cjs/static.d.ts +1 -1
- package/lib/cjs/util.d.ts +3 -1
- package/lib/esm/api.d.ts +3 -22
- package/lib/esm/api.js +15 -0
- package/lib/esm/client.d.ts +8 -15
- package/lib/esm/client.js +10 -42
- package/lib/esm/commercelayer.d.ts +5 -4
- package/lib/esm/commercelayer.js +4 -3
- package/lib/esm/common.d.ts +0 -1
- package/lib/esm/common.js +2 -11
- package/lib/esm/config.d.ts +0 -1
- package/lib/esm/config.js +0 -1
- package/lib/esm/debug.js +4 -0
- package/lib/esm/error.d.ts +0 -1
- package/lib/esm/error.js +4 -1
- package/lib/esm/index.d.ts +1 -1
- package/lib/esm/index.js +2 -0
- package/lib/esm/interceptor.d.ts +2 -6
- package/lib/esm/jsonapi.js +2 -9
- 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 +19 -29
- package/lib/esm/resource.js +10 -34
- package/lib/esm/resources/addresses.d.ts +75 -73
- package/lib/esm/resources/addresses.js +15 -3
- package/lib/esm/resources/adjustments.d.ts +21 -19
- package/lib/esm/resources/adjustments.js +15 -3
- package/lib/esm/resources/adyen_gateways.d.ts +36 -34
- package/lib/esm/resources/adyen_gateways.js +15 -3
- package/lib/esm/resources/adyen_payments.d.ts +29 -27
- package/lib/esm/resources/adyen_payments.js +15 -3
- package/lib/esm/resources/application.d.ts +13 -14
- package/lib/esm/resources/application.js +7 -2
- package/lib/esm/resources/attachments.d.ts +80 -81
- package/lib/esm/resources/attachments.js +11 -3
- package/lib/esm/resources/authorizations.d.ts +45 -43
- package/lib/esm/resources/authorizations.js +13 -1
- package/lib/esm/resources/avalara_accounts.d.ts +33 -31
- package/lib/esm/resources/avalara_accounts.js +15 -3
- package/lib/esm/resources/axerve_gateways.d.ts +25 -22
- package/lib/esm/resources/axerve_gateways.js +15 -3
- package/lib/esm/resources/axerve_payments.d.ts +28 -26
- package/lib/esm/resources/axerve_payments.js +15 -3
- package/lib/esm/resources/billing_info_validation_rules.d.ts +18 -16
- package/lib/esm/resources/billing_info_validation_rules.js +15 -3
- package/lib/esm/resources/bing_geocoders.d.ts +15 -16
- package/lib/esm/resources/bing_geocoders.js +11 -3
- package/lib/esm/resources/braintree_gateways.d.ts +35 -33
- package/lib/esm/resources/braintree_gateways.js +15 -3
- package/lib/esm/resources/braintree_payments.d.ts +31 -29
- package/lib/esm/resources/braintree_payments.js +15 -3
- package/lib/esm/resources/bundles.d.ts +56 -54
- package/lib/esm/resources/bundles.js +15 -3
- package/lib/esm/resources/captures.d.ts +36 -34
- package/lib/esm/resources/captures.js +13 -1
- package/lib/esm/resources/carrier_accounts.d.ts +17 -15
- package/lib/esm/resources/carrier_accounts.js +12 -0
- package/lib/esm/resources/checkout_com_gateways.d.ts +26 -24
- package/lib/esm/resources/checkout_com_gateways.js +15 -3
- package/lib/esm/resources/checkout_com_payments.d.ts +40 -38
- package/lib/esm/resources/checkout_com_payments.js +15 -3
- package/lib/esm/resources/cleanups.d.ts +25 -23
- package/lib/esm/resources/cleanups.js +14 -2
- package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +32 -30
- package/lib/esm/resources/coupon_codes_promotion_rules.js +15 -3
- package/lib/esm/resources/coupon_recipients.d.ts +27 -25
- package/lib/esm/resources/coupon_recipients.js +15 -3
- package/lib/esm/resources/coupons.d.ts +40 -38
- package/lib/esm/resources/coupons.js +15 -3
- package/lib/esm/resources/customer_addresses.d.ts +24 -22
- package/lib/esm/resources/customer_addresses.js +15 -3
- package/lib/esm/resources/customer_groups.d.ts +18 -16
- package/lib/esm/resources/customer_groups.js +15 -3
- package/lib/esm/resources/customer_password_resets.d.ts +17 -18
- package/lib/esm/resources/customer_password_resets.js +11 -3
- package/lib/esm/resources/customer_payment_sources.d.ts +39 -45
- package/lib/esm/resources/customer_payment_sources.js +15 -3
- package/lib/esm/resources/customer_subscriptions.d.ts +16 -14
- package/lib/esm/resources/customer_subscriptions.js +15 -3
- package/lib/esm/resources/customers.d.ts +36 -37
- package/lib/esm/resources/customers.js +11 -3
- package/lib/esm/resources/delivery_lead_times.d.ts +28 -26
- package/lib/esm/resources/delivery_lead_times.js +15 -3
- package/lib/esm/resources/event_callbacks.d.ts +14 -15
- package/lib/esm/resources/event_callbacks.js +8 -0
- package/lib/esm/resources/events.d.ts +12 -13
- package/lib/esm/resources/events.js +8 -0
- package/lib/esm/resources/exports.d.ts +26 -27
- package/lib/esm/resources/exports.js +10 -2
- package/lib/esm/resources/external_gateways.d.ts +33 -31
- package/lib/esm/resources/external_gateways.js +15 -3
- package/lib/esm/resources/external_payments.d.ts +24 -22
- package/lib/esm/resources/external_payments.js +15 -3
- package/lib/esm/resources/external_promotions.d.ts +70 -60
- package/lib/esm/resources/external_promotions.js +19 -3
- package/lib/esm/resources/external_tax_calculators.d.ts +20 -18
- package/lib/esm/resources/external_tax_calculators.js +15 -3
- package/lib/esm/resources/fixed_amount_promotions.d.ts +71 -61
- package/lib/esm/resources/fixed_amount_promotions.js +19 -3
- package/lib/esm/resources/fixed_price_promotions.d.ts +75 -65
- package/lib/esm/resources/fixed_price_promotions.js +19 -3
- package/lib/esm/resources/free_gift_promotions.d.ts +74 -64
- package/lib/esm/resources/free_gift_promotions.js +19 -3
- package/lib/esm/resources/free_shipping_promotions.d.ts +67 -57
- package/lib/esm/resources/free_shipping_promotions.js +19 -3
- package/lib/esm/resources/geocoders.d.ts +12 -13
- package/lib/esm/resources/geocoders.js +8 -0
- package/lib/esm/resources/gift_card_recipients.d.ts +27 -25
- package/lib/esm/resources/gift_card_recipients.js +15 -3
- package/lib/esm/resources/gift_cards.d.ts +68 -66
- package/lib/esm/resources/gift_cards.js +15 -3
- package/lib/esm/resources/google_geocoders.d.ts +15 -16
- package/lib/esm/resources/google_geocoders.js +11 -3
- package/lib/esm/resources/imports.d.ts +31 -29
- package/lib/esm/resources/imports.js +10 -2
- package/lib/esm/resources/in_stock_subscriptions.d.ts +37 -35
- package/lib/esm/resources/in_stock_subscriptions.js +15 -3
- package/lib/esm/resources/inventory_models.d.ts +27 -25
- package/lib/esm/resources/inventory_models.js +15 -3
- package/lib/esm/resources/inventory_return_locations.d.ts +23 -21
- package/lib/esm/resources/inventory_return_locations.js +15 -3
- package/lib/esm/resources/inventory_stock_locations.d.ts +26 -24
- package/lib/esm/resources/inventory_stock_locations.js +15 -3
- package/lib/esm/resources/klarna_gateways.d.ts +24 -22
- package/lib/esm/resources/klarna_gateways.js +15 -3
- package/lib/esm/resources/klarna_payments.d.ts +29 -27
- package/lib/esm/resources/klarna_payments.js +15 -3
- package/lib/esm/resources/line_item_options.d.ts +40 -41
- package/lib/esm/resources/line_item_options.js +11 -3
- package/lib/esm/resources/line_items.d.ts +93 -90
- package/lib/esm/resources/line_items.js +11 -3
- package/lib/esm/resources/manual_gateways.d.ts +16 -14
- package/lib/esm/resources/manual_gateways.js +15 -3
- package/lib/esm/resources/manual_tax_calculators.d.ts +22 -20
- package/lib/esm/resources/manual_tax_calculators.js +15 -3
- package/lib/esm/resources/markets.d.ts +61 -59
- package/lib/esm/resources/markets.js +15 -3
- package/lib/esm/resources/merchants.d.ts +20 -18
- package/lib/esm/resources/merchants.js +15 -3
- package/lib/esm/resources/order_amount_promotion_rules.d.ts +35 -33
- package/lib/esm/resources/order_amount_promotion_rules.js +15 -3
- package/lib/esm/resources/order_copies.d.ts +28 -29
- package/lib/esm/resources/order_copies.js +11 -3
- package/lib/esm/resources/order_factories.d.ts +20 -21
- package/lib/esm/resources/order_factories.js +8 -0
- package/lib/esm/resources/order_subscription_items.d.ts +41 -35
- package/lib/esm/resources/order_subscription_items.js +15 -3
- package/lib/esm/resources/order_subscriptions.d.ts +53 -51
- package/lib/esm/resources/order_subscriptions.js +15 -3
- package/lib/esm/resources/order_validation_rules.d.ts +14 -12
- package/lib/esm/resources/order_validation_rules.js +12 -0
- package/lib/esm/resources/orders.d.ts +238 -231
- package/lib/esm/resources/orders.js +15 -3
- package/lib/esm/resources/organization.d.ts +24 -25
- package/lib/esm/resources/organization.js +7 -2
- package/lib/esm/resources/packages.d.ts +32 -30
- package/lib/esm/resources/packages.js +15 -3
- package/lib/esm/resources/parcel_line_items.d.ts +24 -22
- package/lib/esm/resources/parcel_line_items.js +15 -3
- package/lib/esm/resources/parcels.d.ts +95 -93
- package/lib/esm/resources/parcels.js +15 -3
- package/lib/esm/resources/payment_gateways.d.ts +14 -12
- package/lib/esm/resources/payment_gateways.js +12 -0
- package/lib/esm/resources/payment_methods.d.ts +50 -48
- package/lib/esm/resources/payment_methods.js +15 -3
- package/lib/esm/resources/paypal_gateways.d.ts +19 -17
- package/lib/esm/resources/paypal_gateways.js +15 -3
- package/lib/esm/resources/paypal_payments.d.ts +33 -31
- package/lib/esm/resources/paypal_payments.js +15 -3
- package/lib/esm/resources/percentage_discount_promotions.d.ts +74 -64
- package/lib/esm/resources/percentage_discount_promotions.js +19 -3
- package/lib/esm/resources/price_frequency_tiers.d.ts +28 -26
- package/lib/esm/resources/price_frequency_tiers.js +15 -3
- package/lib/esm/resources/price_lists.d.ts +22 -20
- package/lib/esm/resources/price_lists.js +15 -3
- package/lib/esm/resources/price_tiers.d.ts +19 -17
- package/lib/esm/resources/price_tiers.js +12 -0
- package/lib/esm/resources/price_volume_tiers.d.ts +28 -26
- package/lib/esm/resources/price_volume_tiers.js +15 -3
- package/lib/esm/resources/prices.d.ts +41 -39
- package/lib/esm/resources/prices.js +15 -3
- package/lib/esm/resources/promotion_rules.d.ts +13 -10
- package/lib/esm/resources/promotion_rules.js +12 -0
- package/lib/esm/resources/promotions.d.ts +31 -26
- package/lib/esm/resources/promotions.js +16 -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 -25
- package/lib/esm/resources/refunds.js +12 -0
- 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 -28
- package/lib/esm/resources/return_line_items.js +11 -3
- package/lib/esm/resources/returns.d.ts +51 -49
- package/lib/esm/resources/returns.js +15 -3
- package/lib/esm/resources/satispay_gateways.d.ts +24 -22
- package/lib/esm/resources/satispay_gateways.js +15 -3
- package/lib/esm/resources/satispay_payments.d.ts +31 -28
- package/lib/esm/resources/satispay_payments.js +15 -3
- package/lib/esm/resources/shipments.d.ts +59 -52
- package/lib/esm/resources/shipments.js +13 -1
- package/lib/esm/resources/shipping_categories.d.ts +17 -15
- package/lib/esm/resources/shipping_categories.js +15 -3
- package/lib/esm/resources/shipping_method_tiers.d.ts +19 -17
- package/lib/esm/resources/shipping_method_tiers.js +12 -0
- package/lib/esm/resources/shipping_methods.d.ts +79 -77
- package/lib/esm/resources/shipping_methods.js +15 -3
- package/lib/esm/resources/shipping_weight_tiers.d.ts +27 -25
- package/lib/esm/resources/shipping_weight_tiers.js +15 -3
- package/lib/esm/resources/shipping_zones.d.ts +34 -32
- package/lib/esm/resources/shipping_zones.js +15 -3
- package/lib/esm/resources/sku_list_items.d.ts +28 -26
- package/lib/esm/resources/sku_list_items.js +15 -3
- package/lib/esm/resources/sku_list_promotion_rules.d.ts +39 -37
- package/lib/esm/resources/sku_list_promotion_rules.js +15 -3
- package/lib/esm/resources/sku_lists.d.ts +37 -35
- package/lib/esm/resources/sku_lists.js +15 -3
- package/lib/esm/resources/sku_options.d.ts +45 -43
- package/lib/esm/resources/sku_options.js +15 -3
- package/lib/esm/resources/skus.d.ts +58 -56
- package/lib/esm/resources/skus.js +15 -3
- package/lib/esm/resources/stock_items.d.ts +30 -28
- package/lib/esm/resources/stock_items.js +15 -3
- package/lib/esm/resources/stock_line_items.d.ts +19 -17
- package/lib/esm/resources/stock_line_items.js +12 -0
- package/lib/esm/resources/stock_locations.d.ts +31 -29
- package/lib/esm/resources/stock_locations.js +15 -3
- package/lib/esm/resources/stock_reservations.d.ts +17 -18
- package/lib/esm/resources/stock_reservations.js +8 -0
- package/lib/esm/resources/stock_transfers.d.ts +44 -42
- package/lib/esm/resources/stock_transfers.js +15 -3
- package/lib/esm/resources/stripe_gateways.d.ts +24 -22
- package/lib/esm/resources/stripe_gateways.js +15 -3
- package/lib/esm/resources/stripe_payments.d.ts +34 -29
- package/lib/esm/resources/stripe_payments.js +15 -3
- package/lib/esm/resources/subscription_models.d.ts +26 -27
- package/lib/esm/resources/subscription_models.js +11 -3
- package/lib/esm/resources/tags.d.ts +12 -13
- package/lib/esm/resources/tags.js +11 -3
- package/lib/esm/resources/tax_calculators.d.ts +15 -13
- package/lib/esm/resources/tax_calculators.js +12 -0
- package/lib/esm/resources/tax_categories.d.ts +32 -30
- package/lib/esm/resources/tax_categories.js +15 -3
- package/lib/esm/resources/tax_rules.d.ts +53 -51
- package/lib/esm/resources/tax_rules.js +15 -3
- package/lib/esm/resources/taxjar_accounts.d.ts +23 -21
- package/lib/esm/resources/taxjar_accounts.js +15 -3
- package/lib/esm/resources/transactions.d.ts +25 -23
- package/lib/esm/resources/transactions.js +12 -0
- package/lib/esm/resources/versions.d.ts +22 -0
- package/lib/esm/resources/versions.js +22 -0
- package/lib/esm/resources/voids.d.ts +27 -25
- package/lib/esm/resources/voids.js +12 -0
- package/lib/esm/resources/webhooks.d.ts +28 -26
- package/lib/esm/resources/webhooks.js +15 -3
- package/lib/esm/resources/wire_transfers.d.ts +18 -16
- package/lib/esm/resources/wire_transfers.js +15 -3
- package/lib/esm/static.d.ts +1 -1
- package/lib/esm/util.d.ts +3 -1
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
@@ -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,31 +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
|
-
type
|
6
|
+
import type { Version } from './versions';
|
8
7
|
type PackageRel = ResourceRel & {
|
9
|
-
type:
|
8
|
+
type: typeof Packages.TYPE;
|
10
9
|
};
|
11
10
|
type StockLocationRel = ResourceRel & {
|
12
|
-
type:
|
11
|
+
type: 'stock_locations';
|
13
12
|
};
|
14
13
|
interface Package extends Resource {
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
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[];
|
25
24
|
}
|
26
25
|
interface PackageCreate extends ResourceCreate {
|
27
26
|
name: string;
|
28
|
-
code?: string
|
27
|
+
code?: string;
|
29
28
|
length: number;
|
30
29
|
width: number;
|
31
30
|
height: number;
|
@@ -33,25 +32,28 @@ interface PackageCreate extends ResourceCreate {
|
|
33
32
|
stock_location: StockLocationRel;
|
34
33
|
}
|
35
34
|
interface PackageUpdate extends ResourceUpdate {
|
36
|
-
name?: string
|
37
|
-
code?: string
|
38
|
-
length?: number
|
39
|
-
width?: number
|
40
|
-
height?: number
|
41
|
-
unit_of_length?: string
|
42
|
-
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;
|
43
42
|
}
|
44
|
-
declare class Packages extends ApiResource
|
45
|
-
static readonly TYPE:
|
43
|
+
declare class Packages extends ApiResource {
|
44
|
+
static readonly TYPE: 'packages';
|
45
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Package>>;
|
46
46
|
create(resource: PackageCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Package>;
|
47
|
+
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Package>;
|
47
48
|
update(resource: PackageUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Package>;
|
48
|
-
delete(id: string
|
49
|
+
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
49
50
|
stock_location(packageId: string | Package, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
|
50
51
|
parcels(packageId: string | Package, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Parcel>>;
|
51
52
|
attachments(packageId: string | Package, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
53
|
+
versions(packageId: string | Package, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
52
54
|
isPackage(resource: any): resource is Package;
|
53
55
|
relationship(id: string | ResourceId | null): PackageRel;
|
54
|
-
type():
|
56
|
+
type(): string;
|
55
57
|
}
|
56
58
|
export default Packages;
|
57
|
-
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;
|
@@ -21,6 +28,11 @@ class Packages extends ApiResource {
|
|
21
28
|
const _packageId = packageId.id || packageId;
|
22
29
|
return this.resources.fetch({ type: 'attachments' }, `packages/${_packageId}/attachments`, params, options);
|
23
30
|
}
|
31
|
+
async versions(packageId, params, options) {
|
32
|
+
const _packageId = packageId.id || packageId;
|
33
|
+
return this.resources.fetch({ type: 'versions' }, `packages/${_packageId}/versions`, params, options);
|
34
|
+
}
|
35
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
24
36
|
isPackage(resource) {
|
25
37
|
return resource.type && (resource.type === Packages.TYPE);
|
26
38
|
}
|
@@ -1,31 +1,30 @@
|
|
1
|
-
import { ApiResource } from '../resource';
|
2
|
-
import type {
|
3
|
-
import type {
|
4
|
-
import type {
|
5
|
-
import type {
|
6
|
-
type ParcelLineItemType = 'parcel_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';
|
5
|
+
import type { Version } from './versions';
|
7
6
|
type ParcelLineItemRel = ResourceRel & {
|
8
|
-
type:
|
7
|
+
type: typeof ParcelLineItems.TYPE;
|
9
8
|
};
|
10
9
|
type ParcelRel = ResourceRel & {
|
11
|
-
type:
|
10
|
+
type: 'parcels';
|
12
11
|
};
|
13
12
|
type StockLineItemRel = ResourceRel & {
|
14
|
-
type:
|
13
|
+
type: 'stock_line_items';
|
15
14
|
};
|
16
15
|
interface ParcelLineItem extends Resource {
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
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;
|
25
23
|
/**
|
26
24
|
* @deprecated This field should not be used as it may be removed in the future without notice
|
27
25
|
*/
|
28
26
|
shipment_line_item?: object;
|
27
|
+
versions?: Version[];
|
29
28
|
}
|
30
29
|
interface ParcelLineItemCreate extends ResourceCreate {
|
31
30
|
quantity: number;
|
@@ -37,16 +36,19 @@ interface ParcelLineItemCreate extends ResourceCreate {
|
|
37
36
|
shipment_line_item?: object;
|
38
37
|
}
|
39
38
|
type ParcelLineItemUpdate = ResourceUpdate;
|
40
|
-
declare class ParcelLineItems extends ApiResource
|
41
|
-
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>>;
|
42
42
|
create(resource: ParcelLineItemCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ParcelLineItem>;
|
43
|
+
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ParcelLineItem>;
|
43
44
|
update(resource: ParcelLineItemUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ParcelLineItem>;
|
44
|
-
delete(id: string
|
45
|
+
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
45
46
|
parcel(parcelLineItemId: string | ParcelLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Parcel>;
|
46
47
|
stock_line_item(parcelLineItemId: string | ParcelLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLineItem>;
|
48
|
+
versions(parcelLineItemId: string | ParcelLineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
47
49
|
isParcelLineItem(resource: any): resource is ParcelLineItem;
|
48
50
|
relationship(id: string | ResourceId | null): ParcelLineItemRel;
|
49
|
-
type():
|
51
|
+
type(): string;
|
50
52
|
}
|
51
53
|
export default ParcelLineItems;
|
52
|
-
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;
|
@@ -17,6 +24,11 @@ class ParcelLineItems extends ApiResource {
|
|
17
24
|
const _parcelLineItemId = parcelLineItemId.id || parcelLineItemId;
|
18
25
|
return this.resources.fetch({ type: 'stock_line_items' }, `parcel_line_items/${_parcelLineItemId}/stock_line_item`, params, options);
|
19
26
|
}
|
27
|
+
async versions(parcelLineItemId, params, options) {
|
28
|
+
const _parcelLineItemId = parcelLineItemId.id || parcelLineItemId;
|
29
|
+
return this.resources.fetch({ type: 'versions' }, `parcel_line_items/${_parcelLineItemId}/versions`, params, options);
|
30
|
+
}
|
31
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
20
32
|
isParcelLineItem(resource) {
|
21
33
|
return resource.type && (resource.type === ParcelLineItems.TYPE);
|
22
34
|
}
|
@@ -1,123 +1,125 @@
|
|
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
|
-
type
|
8
|
+
import type { Version } from './versions';
|
10
9
|
type ParcelRel = ResourceRel & {
|
11
|
-
type:
|
10
|
+
type: typeof Parcels.TYPE;
|
12
11
|
};
|
13
12
|
type ShipmentRel = ResourceRel & {
|
14
|
-
type:
|
13
|
+
type: 'shipments';
|
15
14
|
};
|
16
15
|
type PackageRel = ResourceRel & {
|
17
|
-
type:
|
16
|
+
type: 'packages';
|
18
17
|
};
|
19
18
|
interface Parcel extends Resource {
|
20
|
-
|
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
|
-
|
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[];
|
51
50
|
}
|
52
51
|
interface ParcelCreate extends ResourceCreate {
|
53
52
|
weight: number;
|
54
53
|
unit_of_weight: string;
|
55
|
-
eel_pfc?: string
|
56
|
-
contents_type?: string
|
57
|
-
contents_explanation?: string
|
58
|
-
customs_certify?: boolean
|
59
|
-
customs_signer?: string
|
60
|
-
non_delivery_option?: string
|
61
|
-
restriction_type?: string
|
62
|
-
restriction_comments?: string
|
63
|
-
customs_info_required?: boolean
|
64
|
-
shipping_label_url?: string
|
65
|
-
shipping_label_file_type?: string
|
66
|
-
shipping_label_size?: string
|
67
|
-
shipping_label_resolution?: string
|
68
|
-
tracking_number?: string
|
69
|
-
tracking_status?: string
|
70
|
-
tracking_status_detail?: string
|
71
|
-
tracking_status_updated_at?: string
|
72
|
-
tracking_details?:
|
73
|
-
carrier_weight_oz?: string
|
74
|
-
signed_by?: string
|
75
|
-
incoterm?: string
|
76
|
-
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;
|
77
76
|
shipment: ShipmentRel;
|
78
77
|
package: PackageRel;
|
79
78
|
}
|
80
79
|
interface ParcelUpdate extends ResourceUpdate {
|
81
|
-
weight?: number
|
82
|
-
unit_of_weight?: string
|
83
|
-
eel_pfc?: string
|
84
|
-
contents_type?: string
|
85
|
-
contents_explanation?: string
|
86
|
-
customs_certify?: boolean
|
87
|
-
customs_signer?: string
|
88
|
-
non_delivery_option?: string
|
89
|
-
restriction_type?: string
|
90
|
-
restriction_comments?: string
|
91
|
-
customs_info_required?: boolean
|
92
|
-
shipping_label_url?: string
|
93
|
-
shipping_label_file_type?: string
|
94
|
-
shipping_label_size?: string
|
95
|
-
shipping_label_resolution?: string
|
96
|
-
tracking_number?: string
|
97
|
-
tracking_status?: string
|
98
|
-
tracking_status_detail?: string
|
99
|
-
tracking_status_updated_at?: string
|
100
|
-
tracking_details?:
|
101
|
-
carrier_weight_oz?: string
|
102
|
-
signed_by?: string
|
103
|
-
incoterm?: string
|
104
|
-
delivery_confirmation?: string
|
105
|
-
shipment?: ShipmentRel
|
106
|
-
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;
|
107
106
|
}
|
108
|
-
declare class Parcels extends ApiResource
|
109
|
-
static readonly TYPE:
|
107
|
+
declare class Parcels extends ApiResource {
|
108
|
+
static readonly TYPE: 'parcels';
|
109
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Parcel>>;
|
110
110
|
create(resource: ParcelCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Parcel>;
|
111
|
+
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Parcel>;
|
111
112
|
update(resource: ParcelUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Parcel>;
|
112
|
-
delete(id: string
|
113
|
+
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
113
114
|
shipment(parcelId: string | Parcel, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Shipment>;
|
114
115
|
package(parcelId: string | Parcel, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Package>;
|
115
116
|
parcel_line_items(parcelId: string | Parcel, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ParcelLineItem>>;
|
116
117
|
attachments(parcelId: string | Parcel, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
117
118
|
events(parcelId: string | Parcel, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
119
|
+
versions(parcelId: string | Parcel, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
118
120
|
isParcel(resource: any): resource is Parcel;
|
119
121
|
relationship(id: string | ResourceId | null): ParcelRel;
|
120
|
-
type():
|
122
|
+
type(): string;
|
121
123
|
}
|
122
124
|
export default Parcels;
|
123
|
-
export
|
125
|
+
export { Parcel, ParcelCreate, ParcelUpdate };
|
@@ -1,13 +1,20 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class Parcels extends ApiResource {
|
3
|
+
// static readonly PATH = 'parcels'
|
4
|
+
async list(params, options) {
|
5
|
+
return this.resources.list({ type: Parcels.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: Parcels.TYPE }), params, options);
|
9
|
+
}
|
10
|
+
async retrieve(id, params, options) {
|
11
|
+
return this.resources.retrieve({ type: Parcels.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: Parcels.TYPE }), params, options);
|
8
15
|
}
|
9
16
|
async delete(id, options) {
|
10
|
-
await this.resources.delete(
|
17
|
+
await this.resources.delete({ type: Parcels.TYPE, id }, options);
|
11
18
|
}
|
12
19
|
async shipment(parcelId, params, options) {
|
13
20
|
const _parcelId = parcelId.id || parcelId;
|
@@ -29,6 +36,11 @@ class Parcels extends ApiResource {
|
|
29
36
|
const _parcelId = parcelId.id || parcelId;
|
30
37
|
return this.resources.fetch({ type: 'events' }, `parcels/${_parcelId}/events`, params, options);
|
31
38
|
}
|
39
|
+
async versions(parcelId, params, options) {
|
40
|
+
const _parcelId = parcelId.id || parcelId;
|
41
|
+
return this.resources.fetch({ type: 'versions' }, `parcels/${_parcelId}/versions`, params, options);
|
42
|
+
}
|
43
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
32
44
|
isParcel(resource) {
|
33
45
|
return resource.type && (resource.type === Parcels.TYPE);
|
34
46
|
}
|
@@ -1,22 +1,24 @@
|
|
1
|
-
import { ApiResource } from '../resource';
|
2
|
-
import type {
|
3
|
-
import type { QueryParamsList } from '../query';
|
1
|
+
import { ApiResource, Resource, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
4
3
|
import type { PaymentMethod } from './payment_methods';
|
5
|
-
type
|
4
|
+
import type { Version } from './versions';
|
6
5
|
type PaymentGatewayRel = ResourceRel & {
|
7
|
-
type:
|
6
|
+
type: typeof PaymentGateways.TYPE;
|
8
7
|
};
|
9
8
|
interface PaymentGateway extends Resource {
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
name?: string;
|
10
|
+
payment_methods?: PaymentMethod[];
|
11
|
+
versions?: Version[];
|
13
12
|
}
|
14
|
-
declare class PaymentGateways extends ApiResource
|
15
|
-
static readonly TYPE:
|
13
|
+
declare class PaymentGateways extends ApiResource {
|
14
|
+
static readonly TYPE: 'payment_gateways';
|
15
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaymentGateway>>;
|
16
|
+
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentGateway>;
|
16
17
|
payment_methods(paymentGatewayId: string | PaymentGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>>;
|
18
|
+
versions(paymentGatewayId: string | PaymentGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
17
19
|
isPaymentGateway(resource: any): resource is PaymentGateway;
|
18
20
|
relationship(id: string | ResourceId | null): PaymentGatewayRel;
|
19
|
-
type():
|
21
|
+
type(): string;
|
20
22
|
}
|
21
23
|
export default PaymentGateways;
|
22
|
-
export
|
24
|
+
export { PaymentGateway };
|
@@ -1,9 +1,21 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class PaymentGateways extends ApiResource {
|
3
|
+
// static readonly PATH = 'payment_gateways'
|
4
|
+
async list(params, options) {
|
5
|
+
return this.resources.list({ type: PaymentGateways.TYPE }, params, options);
|
6
|
+
}
|
7
|
+
async retrieve(id, params, options) {
|
8
|
+
return this.resources.retrieve({ type: PaymentGateways.TYPE, id }, params, options);
|
9
|
+
}
|
3
10
|
async payment_methods(paymentGatewayId, params, options) {
|
4
11
|
const _paymentGatewayId = paymentGatewayId.id || paymentGatewayId;
|
5
12
|
return this.resources.fetch({ type: 'payment_methods' }, `payment_gateways/${_paymentGatewayId}/payment_methods`, params, options);
|
6
13
|
}
|
14
|
+
async versions(paymentGatewayId, params, options) {
|
15
|
+
const _paymentGatewayId = paymentGatewayId.id || paymentGatewayId;
|
16
|
+
return this.resources.fetch({ type: 'versions' }, `payment_gateways/${_paymentGatewayId}/versions`, params, options);
|
17
|
+
}
|
18
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
7
19
|
isPaymentGateway(resource) {
|
8
20
|
return resource.type && (resource.type === PaymentGateways.TYPE);
|
9
21
|
}
|