@commercelayer/sdk 4.22.0 → 4.23.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 +109 -1
- package/lib/cjs/api.js +343 -1
- package/lib/cjs/client.d.ts +31 -1
- package/lib/cjs/client.js +123 -1
- package/lib/cjs/commercelayer.d.ts +133 -1
- package/lib/cjs/commercelayer.js +224 -1
- package/lib/cjs/common.d.ts +4 -1
- package/lib/cjs/common.js +14 -1
- package/lib/cjs/config.d.ts +11 -1
- package/lib/cjs/config.js +13 -1
- package/lib/cjs/debug.d.ts +3 -1
- package/lib/cjs/debug.js +42 -1
- package/lib/cjs/error.d.ts +28 -1
- package/lib/cjs/error.js +43 -1
- package/lib/cjs/index.d.ts +7 -1
- package/lib/cjs/index.js +29 -1
- package/lib/cjs/interceptor.d.ts +21 -1
- package/lib/cjs/interceptor.js +2 -1
- package/lib/cjs/jsonapi.d.ts +5 -1
- package/lib/cjs/jsonapi.js +82 -1
- package/lib/cjs/model.d.ts +107 -1
- package/lib/cjs/model.js +3 -1
- package/lib/cjs/query.d.ts +23 -1
- package/lib/cjs/query.js +51 -1
- package/lib/cjs/resource.d.ts +77 -1
- package/lib/cjs/resource.js +145 -1
- package/lib/cjs/resources/addresses.d.ts +88 -1
- package/lib/cjs/resources/addresses.js +37 -1
- package/lib/cjs/resources/adjustments.d.ts +35 -1
- package/lib/cjs/resources/adjustments.js +33 -1
- package/lib/cjs/resources/adyen_gateways.d.ts +56 -1
- package/lib/cjs/resources/adyen_gateways.js +41 -1
- package/lib/cjs/resources/adyen_payments.d.ts +45 -1
- package/lib/cjs/resources/adyen_payments.js +41 -1
- package/lib/cjs/resources/application.d.ts +21 -1
- package/lib/cjs/resources/application.js +21 -1
- package/lib/cjs/resources/attachments.d.ts +156 -1
- package/lib/cjs/resources/attachments.js +33 -1
- package/lib/cjs/resources/authorizations.d.ts +60 -1
- package/lib/cjs/resources/authorizations.js +43 -1
- package/lib/cjs/resources/avalara_accounts.d.ts +55 -1
- package/lib/cjs/resources/avalara_accounts.js +45 -1
- package/lib/cjs/resources/billing_info_validation_rules.d.ts +35 -1
- package/lib/cjs/resources/billing_info_validation_rules.js +41 -1
- package/lib/cjs/resources/bing_geocoders.d.ts +35 -1
- package/lib/cjs/resources/bing_geocoders.js +41 -1
- package/lib/cjs/resources/braintree_gateways.d.ts +56 -1
- package/lib/cjs/resources/braintree_gateways.js +41 -1
- package/lib/cjs/resources/braintree_payments.d.ts +47 -1
- package/lib/cjs/resources/braintree_payments.js +41 -1
- package/lib/cjs/resources/bundles.d.ts +76 -1
- package/lib/cjs/resources/bundles.js +49 -1
- package/lib/cjs/resources/captures.d.ts +51 -1
- package/lib/cjs/resources/captures.js +43 -1
- package/lib/cjs/resources/carrier_accounts.d.ts +26 -1
- package/lib/cjs/resources/carrier_accounts.js +32 -1
- package/lib/cjs/resources/checkout_com_gateways.d.ts +45 -1
- package/lib/cjs/resources/checkout_com_gateways.js +41 -1
- package/lib/cjs/resources/checkout_com_payments.d.ts +58 -1
- package/lib/cjs/resources/checkout_com_payments.js +41 -1
- package/lib/cjs/resources/cleanups.d.ts +36 -1
- package/lib/cjs/resources/cleanups.js +34 -1
- package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +59 -1
- package/lib/cjs/resources/coupon_codes_promotion_rules.js +37 -1
- package/lib/cjs/resources/coupon_recipients.d.ts +44 -1
- package/lib/cjs/resources/coupon_recipients.js +41 -1
- package/lib/cjs/resources/coupons.d.ts +45 -1
- package/lib/cjs/resources/coupons.js +37 -1
- package/lib/cjs/resources/customer_addresses.d.ts +44 -1
- package/lib/cjs/resources/customer_addresses.js +45 -1
- package/lib/cjs/resources/customer_groups.d.ts +36 -1
- package/lib/cjs/resources/customer_groups.js +45 -1
- package/lib/cjs/resources/customer_password_resets.d.ts +36 -1
- package/lib/cjs/resources/customer_password_resets.js +41 -1
- package/lib/cjs/resources/customer_payment_sources.d.ts +70 -1
- package/lib/cjs/resources/customer_payment_sources.js +37 -1
- package/lib/cjs/resources/customer_subscriptions.d.ts +31 -1
- package/lib/cjs/resources/customer_subscriptions.js +41 -1
- package/lib/cjs/resources/customers.d.ts +66 -1
- package/lib/cjs/resources/customers.js +73 -1
- package/lib/cjs/resources/delivery_lead_times.d.ts +51 -1
- package/lib/cjs/resources/delivery_lead_times.js +45 -1
- package/lib/cjs/resources/event_callbacks.d.ts +24 -1
- package/lib/cjs/resources/event_callbacks.js +28 -1
- package/lib/cjs/resources/events.d.ts +24 -1
- package/lib/cjs/resources/events.js +32 -1
- package/lib/cjs/resources/exports.d.ts +40 -1
- package/lib/cjs/resources/exports.js +34 -1
- package/lib/cjs/resources/external_gateways.d.ts +49 -1
- package/lib/cjs/resources/external_gateways.js +41 -1
- package/lib/cjs/resources/external_payments.d.ts +43 -1
- package/lib/cjs/resources/external_payments.js +45 -1
- package/lib/cjs/resources/external_promotions.d.ts +90 -1
- package/lib/cjs/resources/external_promotions.js +57 -1
- package/lib/cjs/resources/external_tax_calculators.d.ts +37 -1
- package/lib/cjs/resources/external_tax_calculators.js +41 -1
- package/lib/cjs/resources/fixed_amount_promotions.d.ts +91 -1
- package/lib/cjs/resources/fixed_amount_promotions.js +57 -1
- package/lib/cjs/resources/fixed_price_promotions.d.ts +102 -1
- package/lib/cjs/resources/fixed_price_promotions.js +65 -1
- package/lib/cjs/resources/free_gift_promotions.d.ts +100 -1
- package/lib/cjs/resources/free_gift_promotions.js +65 -1
- package/lib/cjs/resources/free_shipping_promotions.d.ts +83 -1
- package/lib/cjs/resources/free_shipping_promotions.js +53 -1
- package/lib/cjs/resources/geocoders.d.ts +24 -1
- package/lib/cjs/resources/geocoders.js +32 -1
- package/lib/cjs/resources/gift_card_recipients.d.ts +44 -1
- package/lib/cjs/resources/gift_card_recipients.js +41 -1
- package/lib/cjs/resources/gift_cards.d.ts +85 -1
- package/lib/cjs/resources/gift_cards.js +49 -1
- package/lib/cjs/resources/google_geocoders.d.ts +35 -1
- package/lib/cjs/resources/google_geocoders.js +41 -1
- package/lib/cjs/resources/imports.d.ts +45 -1
- package/lib/cjs/resources/imports.js +34 -1
- package/lib/cjs/resources/in_stock_subscriptions.d.ts +62 -1
- package/lib/cjs/resources/in_stock_subscriptions.js +49 -1
- package/lib/cjs/resources/inventory_models.d.ts +42 -1
- package/lib/cjs/resources/inventory_models.js +45 -1
- package/lib/cjs/resources/inventory_return_locations.d.ts +43 -1
- package/lib/cjs/resources/inventory_return_locations.js +41 -1
- package/lib/cjs/resources/inventory_stock_locations.d.ts +46 -1
- package/lib/cjs/resources/inventory_stock_locations.js +41 -1
- package/lib/cjs/resources/klarna_gateways.d.ts +44 -1
- package/lib/cjs/resources/klarna_gateways.js +41 -1
- package/lib/cjs/resources/klarna_payments.d.ts +45 -1
- package/lib/cjs/resources/klarna_payments.js +41 -1
- package/lib/cjs/resources/line_item_options.d.ts +57 -1
- package/lib/cjs/resources/line_item_options.js +41 -1
- package/lib/cjs/resources/line_items.d.ts +126 -1
- package/lib/cjs/resources/line_items.js +49 -1
- package/lib/cjs/resources/manual_gateways.d.ts +33 -1
- package/lib/cjs/resources/manual_gateways.js +37 -1
- package/lib/cjs/resources/manual_tax_calculators.d.ts +41 -1
- package/lib/cjs/resources/manual_tax_calculators.js +45 -1
- package/lib/cjs/resources/markets.d.ts +88 -1
- package/lib/cjs/resources/markets.js +57 -1
- package/lib/cjs/resources/merchants.d.ts +38 -1
- package/lib/cjs/resources/merchants.js +41 -1
- package/lib/cjs/resources/order_amount_promotion_rules.d.ts +56 -1
- package/lib/cjs/resources/order_amount_promotion_rules.js +33 -1
- package/lib/cjs/resources/order_copies.d.ts +48 -1
- package/lib/cjs/resources/order_copies.js +46 -1
- package/lib/cjs/resources/order_subscriptions.d.ts +70 -1
- package/lib/cjs/resources/order_subscriptions.js +57 -1
- package/lib/cjs/resources/order_validation_rules.d.ts +23 -1
- package/lib/cjs/resources/order_validation_rules.js +32 -1
- package/lib/cjs/resources/orders.d.ts +288 -1
- package/lib/cjs/resources/orders.js +113 -1
- package/lib/cjs/resources/organization.d.ts +32 -1
- package/lib/cjs/resources/organization.js +21 -1
- package/lib/cjs/resources/packages.d.ts +56 -1
- package/lib/cjs/resources/packages.js +45 -1
- package/lib/cjs/resources/parcel_line_items.d.ts +51 -1
- package/lib/cjs/resources/parcel_line_items.js +41 -1
- package/lib/cjs/resources/parcels.d.ts +119 -1
- package/lib/cjs/resources/parcels.js +53 -1
- package/lib/cjs/resources/payment_gateways.d.ts +21 -1
- package/lib/cjs/resources/payment_gateways.js +28 -1
- package/lib/cjs/resources/payment_methods.d.ts +61 -1
- package/lib/cjs/resources/payment_methods.js +45 -1
- package/lib/cjs/resources/paypal_gateways.d.ts +37 -1
- package/lib/cjs/resources/paypal_gateways.js +41 -1
- package/lib/cjs/resources/paypal_payments.d.ts +51 -1
- package/lib/cjs/resources/paypal_payments.js +41 -1
- package/lib/cjs/resources/percentage_discount_promotions.d.ts +100 -1
- package/lib/cjs/resources/percentage_discount_promotions.js +65 -1
- package/lib/cjs/resources/price_lists.d.ts +39 -1
- package/lib/cjs/resources/price_lists.js +41 -1
- package/lib/cjs/resources/price_tiers.d.ts +28 -1
- package/lib/cjs/resources/price_tiers.js +32 -1
- package/lib/cjs/resources/price_volume_tiers.d.ts +46 -1
- package/lib/cjs/resources/price_volume_tiers.js +41 -1
- package/lib/cjs/resources/prices.d.ts +68 -1
- package/lib/cjs/resources/prices.js +53 -1
- package/lib/cjs/resources/promotion_rules.d.ts +24 -1
- package/lib/cjs/resources/promotion_rules.js +24 -1
- package/lib/cjs/resources/promotions.d.ts +41 -1
- package/lib/cjs/resources/promotions.js +44 -1
- package/lib/cjs/resources/refunds.d.ts +37 -1
- package/lib/cjs/resources/refunds.js +36 -1
- package/lib/cjs/resources/return_line_items.d.ts +49 -1
- package/lib/cjs/resources/return_line_items.js +41 -1
- package/lib/cjs/resources/returns.d.ts +75 -1
- package/lib/cjs/resources/returns.js +65 -1
- package/lib/cjs/resources/shipments.d.ts +93 -1
- package/lib/cjs/resources/shipments.js +83 -1
- package/lib/cjs/resources/shipping_categories.d.ts +33 -1
- package/lib/cjs/resources/shipping_categories.js +41 -1
- package/lib/cjs/resources/shipping_method_tiers.d.ts +28 -1
- package/lib/cjs/resources/shipping_method_tiers.js +32 -1
- package/lib/cjs/resources/shipping_methods.d.ts +107 -1
- package/lib/cjs/resources/shipping_methods.js +65 -1
- package/lib/cjs/resources/shipping_weight_tiers.d.ts +46 -1
- package/lib/cjs/resources/shipping_weight_tiers.js +41 -1
- package/lib/cjs/resources/shipping_zones.d.ts +48 -1
- package/lib/cjs/resources/shipping_zones.js +37 -1
- package/lib/cjs/resources/sku_list_items.d.ts +47 -1
- package/lib/cjs/resources/sku_list_items.js +41 -1
- package/lib/cjs/resources/sku_list_promotion_rules.d.ts +68 -1
- package/lib/cjs/resources/sku_list_promotion_rules.js +41 -1
- package/lib/cjs/resources/sku_lists.d.ts +60 -1
- package/lib/cjs/resources/sku_lists.js +53 -1
- package/lib/cjs/resources/sku_options.d.ts +56 -1
- package/lib/cjs/resources/sku_options.js +41 -1
- package/lib/cjs/resources/skus.d.ts +78 -1
- package/lib/cjs/resources/skus.js +57 -1
- package/lib/cjs/resources/stock_items.d.ts +49 -1
- package/lib/cjs/resources/stock_items.js +45 -1
- package/lib/cjs/resources/stock_line_items.d.ts +29 -1
- package/lib/cjs/resources/stock_line_items.js +36 -1
- package/lib/cjs/resources/stock_locations.d.ts +57 -1
- package/lib/cjs/resources/stock_locations.js +57 -1
- package/lib/cjs/resources/stock_transfers.d.ts +74 -1
- package/lib/cjs/resources/stock_transfers.js +57 -1
- package/lib/cjs/resources/stripe_gateways.d.ts +41 -1
- package/lib/cjs/resources/stripe_gateways.js +41 -1
- package/lib/cjs/resources/stripe_payments.d.ts +46 -1
- package/lib/cjs/resources/stripe_payments.js +41 -1
- package/lib/cjs/resources/tax_calculators.d.ts +24 -1
- package/lib/cjs/resources/tax_calculators.js +32 -1
- package/lib/cjs/resources/tax_categories.d.ts +59 -1
- package/lib/cjs/resources/tax_categories.js +41 -1
- package/lib/cjs/resources/tax_rules.d.ts +69 -1
- package/lib/cjs/resources/tax_rules.js +37 -1
- package/lib/cjs/resources/taxjar_accounts.d.ts +43 -1
- package/lib/cjs/resources/taxjar_accounts.js +45 -1
- package/lib/cjs/resources/transactions.d.ts +31 -1
- package/lib/cjs/resources/transactions.js +28 -1
- package/lib/cjs/resources/voids.d.ts +37 -1
- package/lib/cjs/resources/voids.js +36 -1
- package/lib/cjs/resources/webhooks.d.ts +43 -1
- package/lib/cjs/resources/webhooks.js +37 -1
- package/lib/cjs/resources/wire_transfers.d.ts +32 -1
- package/lib/cjs/resources/wire_transfers.js +37 -1
- package/lib/cjs/static.d.ts +8 -1
- package/lib/cjs/static.js +47 -1
- package/lib/cjs/util.d.ts +6 -1
- package/lib/cjs/util.js +15 -1
- package/lib/esm/api.d.ts +109 -1
- package/lib/esm/api.js +231 -1
- package/lib/esm/client.d.ts +31 -1
- package/lib/esm/client.js +118 -1
- package/lib/esm/commercelayer.d.ts +133 -1
- package/lib/esm/commercelayer.js +195 -1
- package/lib/esm/common.d.ts +4 -1
- package/lib/esm/common.js +10 -1
- package/lib/esm/config.d.ts +11 -1
- package/lib/esm/config.js +11 -1
- package/lib/esm/debug.d.ts +3 -1
- package/lib/esm/debug.js +40 -1
- package/lib/esm/error.d.ts +28 -1
- package/lib/esm/error.js +38 -1
- package/lib/esm/index.d.ts +7 -1
- package/lib/esm/index.js +6 -1
- package/lib/esm/interceptor.d.ts +21 -1
- package/lib/esm/interceptor.js +1 -1
- package/lib/esm/jsonapi.d.ts +5 -1
- package/lib/esm/jsonapi.js +75 -1
- package/lib/esm/model.d.ts +107 -1
- package/lib/esm/model.js +2 -1
- package/lib/esm/query.d.ts +23 -1
- package/lib/esm/query.js +45 -1
- package/lib/esm/resource.d.ts +77 -1
- package/lib/esm/resource.js +139 -1
- package/lib/esm/resources/addresses.d.ts +88 -1
- package/lib/esm/resources/addresses.js +35 -1
- package/lib/esm/resources/adjustments.d.ts +35 -1
- package/lib/esm/resources/adjustments.js +31 -1
- package/lib/esm/resources/adyen_gateways.d.ts +56 -1
- package/lib/esm/resources/adyen_gateways.js +39 -1
- package/lib/esm/resources/adyen_payments.d.ts +45 -1
- package/lib/esm/resources/adyen_payments.js +39 -1
- package/lib/esm/resources/application.d.ts +21 -1
- package/lib/esm/resources/application.js +19 -1
- package/lib/esm/resources/attachments.d.ts +156 -1
- package/lib/esm/resources/attachments.js +31 -1
- package/lib/esm/resources/authorizations.d.ts +60 -1
- package/lib/esm/resources/authorizations.js +41 -1
- package/lib/esm/resources/avalara_accounts.d.ts +55 -1
- package/lib/esm/resources/avalara_accounts.js +43 -1
- package/lib/esm/resources/billing_info_validation_rules.d.ts +35 -1
- package/lib/esm/resources/billing_info_validation_rules.js +39 -1
- package/lib/esm/resources/bing_geocoders.d.ts +35 -1
- package/lib/esm/resources/bing_geocoders.js +39 -1
- package/lib/esm/resources/braintree_gateways.d.ts +56 -1
- package/lib/esm/resources/braintree_gateways.js +39 -1
- package/lib/esm/resources/braintree_payments.d.ts +47 -1
- package/lib/esm/resources/braintree_payments.js +39 -1
- package/lib/esm/resources/bundles.d.ts +76 -1
- package/lib/esm/resources/bundles.js +47 -1
- package/lib/esm/resources/captures.d.ts +51 -1
- package/lib/esm/resources/captures.js +41 -1
- package/lib/esm/resources/carrier_accounts.d.ts +26 -1
- package/lib/esm/resources/carrier_accounts.js +30 -1
- package/lib/esm/resources/checkout_com_gateways.d.ts +45 -1
- package/lib/esm/resources/checkout_com_gateways.js +39 -1
- package/lib/esm/resources/checkout_com_payments.d.ts +58 -1
- package/lib/esm/resources/checkout_com_payments.js +39 -1
- package/lib/esm/resources/cleanups.d.ts +36 -1
- package/lib/esm/resources/cleanups.js +32 -1
- package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +59 -1
- package/lib/esm/resources/coupon_codes_promotion_rules.js +35 -1
- package/lib/esm/resources/coupon_recipients.d.ts +44 -1
- package/lib/esm/resources/coupon_recipients.js +39 -1
- package/lib/esm/resources/coupons.d.ts +45 -1
- package/lib/esm/resources/coupons.js +35 -1
- package/lib/esm/resources/customer_addresses.d.ts +44 -1
- package/lib/esm/resources/customer_addresses.js +43 -1
- package/lib/esm/resources/customer_groups.d.ts +36 -1
- package/lib/esm/resources/customer_groups.js +43 -1
- package/lib/esm/resources/customer_password_resets.d.ts +36 -1
- package/lib/esm/resources/customer_password_resets.js +39 -1
- package/lib/esm/resources/customer_payment_sources.d.ts +70 -1
- package/lib/esm/resources/customer_payment_sources.js +35 -1
- package/lib/esm/resources/customer_subscriptions.d.ts +31 -1
- package/lib/esm/resources/customer_subscriptions.js +39 -1
- package/lib/esm/resources/customers.d.ts +66 -1
- package/lib/esm/resources/customers.js +71 -1
- package/lib/esm/resources/delivery_lead_times.d.ts +51 -1
- package/lib/esm/resources/delivery_lead_times.js +43 -1
- package/lib/esm/resources/event_callbacks.d.ts +24 -1
- package/lib/esm/resources/event_callbacks.js +26 -1
- package/lib/esm/resources/events.d.ts +24 -1
- package/lib/esm/resources/events.js +30 -1
- package/lib/esm/resources/exports.d.ts +40 -1
- package/lib/esm/resources/exports.js +32 -1
- package/lib/esm/resources/external_gateways.d.ts +49 -1
- package/lib/esm/resources/external_gateways.js +39 -1
- package/lib/esm/resources/external_payments.d.ts +43 -1
- package/lib/esm/resources/external_payments.js +43 -1
- package/lib/esm/resources/external_promotions.d.ts +90 -1
- package/lib/esm/resources/external_promotions.js +55 -1
- package/lib/esm/resources/external_tax_calculators.d.ts +37 -1
- package/lib/esm/resources/external_tax_calculators.js +39 -1
- package/lib/esm/resources/fixed_amount_promotions.d.ts +91 -1
- package/lib/esm/resources/fixed_amount_promotions.js +55 -1
- package/lib/esm/resources/fixed_price_promotions.d.ts +102 -1
- package/lib/esm/resources/fixed_price_promotions.js +63 -1
- package/lib/esm/resources/free_gift_promotions.d.ts +100 -1
- package/lib/esm/resources/free_gift_promotions.js +63 -1
- package/lib/esm/resources/free_shipping_promotions.d.ts +83 -1
- package/lib/esm/resources/free_shipping_promotions.js +51 -1
- package/lib/esm/resources/geocoders.d.ts +24 -1
- package/lib/esm/resources/geocoders.js +30 -1
- package/lib/esm/resources/gift_card_recipients.d.ts +44 -1
- package/lib/esm/resources/gift_card_recipients.js +39 -1
- package/lib/esm/resources/gift_cards.d.ts +85 -1
- package/lib/esm/resources/gift_cards.js +47 -1
- package/lib/esm/resources/google_geocoders.d.ts +35 -1
- package/lib/esm/resources/google_geocoders.js +39 -1
- package/lib/esm/resources/imports.d.ts +45 -1
- package/lib/esm/resources/imports.js +32 -1
- package/lib/esm/resources/in_stock_subscriptions.d.ts +62 -1
- package/lib/esm/resources/in_stock_subscriptions.js +47 -1
- package/lib/esm/resources/inventory_models.d.ts +42 -1
- package/lib/esm/resources/inventory_models.js +43 -1
- package/lib/esm/resources/inventory_return_locations.d.ts +43 -1
- package/lib/esm/resources/inventory_return_locations.js +39 -1
- package/lib/esm/resources/inventory_stock_locations.d.ts +46 -1
- package/lib/esm/resources/inventory_stock_locations.js +39 -1
- package/lib/esm/resources/klarna_gateways.d.ts +44 -1
- package/lib/esm/resources/klarna_gateways.js +39 -1
- package/lib/esm/resources/klarna_payments.d.ts +45 -1
- package/lib/esm/resources/klarna_payments.js +39 -1
- package/lib/esm/resources/line_item_options.d.ts +57 -1
- package/lib/esm/resources/line_item_options.js +39 -1
- package/lib/esm/resources/line_items.d.ts +126 -1
- package/lib/esm/resources/line_items.js +47 -1
- package/lib/esm/resources/manual_gateways.d.ts +33 -1
- package/lib/esm/resources/manual_gateways.js +35 -1
- package/lib/esm/resources/manual_tax_calculators.d.ts +41 -1
- package/lib/esm/resources/manual_tax_calculators.js +43 -1
- package/lib/esm/resources/markets.d.ts +88 -1
- package/lib/esm/resources/markets.js +55 -1
- package/lib/esm/resources/merchants.d.ts +38 -1
- package/lib/esm/resources/merchants.js +39 -1
- package/lib/esm/resources/order_amount_promotion_rules.d.ts +56 -1
- package/lib/esm/resources/order_amount_promotion_rules.js +31 -1
- package/lib/esm/resources/order_copies.d.ts +48 -1
- package/lib/esm/resources/order_copies.js +44 -1
- package/lib/esm/resources/order_subscriptions.d.ts +70 -1
- package/lib/esm/resources/order_subscriptions.js +55 -1
- package/lib/esm/resources/order_validation_rules.d.ts +23 -1
- package/lib/esm/resources/order_validation_rules.js +30 -1
- package/lib/esm/resources/orders.d.ts +288 -1
- package/lib/esm/resources/orders.js +111 -1
- package/lib/esm/resources/organization.d.ts +32 -1
- package/lib/esm/resources/organization.js +19 -1
- package/lib/esm/resources/packages.d.ts +56 -1
- package/lib/esm/resources/packages.js +43 -1
- package/lib/esm/resources/parcel_line_items.d.ts +51 -1
- package/lib/esm/resources/parcel_line_items.js +39 -1
- package/lib/esm/resources/parcels.d.ts +119 -1
- package/lib/esm/resources/parcels.js +51 -1
- package/lib/esm/resources/payment_gateways.d.ts +21 -1
- package/lib/esm/resources/payment_gateways.js +26 -1
- package/lib/esm/resources/payment_methods.d.ts +61 -1
- package/lib/esm/resources/payment_methods.js +43 -1
- package/lib/esm/resources/paypal_gateways.d.ts +37 -1
- package/lib/esm/resources/paypal_gateways.js +39 -1
- package/lib/esm/resources/paypal_payments.d.ts +51 -1
- package/lib/esm/resources/paypal_payments.js +39 -1
- package/lib/esm/resources/percentage_discount_promotions.d.ts +100 -1
- package/lib/esm/resources/percentage_discount_promotions.js +63 -1
- package/lib/esm/resources/price_lists.d.ts +39 -1
- package/lib/esm/resources/price_lists.js +39 -1
- package/lib/esm/resources/price_tiers.d.ts +28 -1
- package/lib/esm/resources/price_tiers.js +30 -1
- package/lib/esm/resources/price_volume_tiers.d.ts +46 -1
- package/lib/esm/resources/price_volume_tiers.js +39 -1
- package/lib/esm/resources/prices.d.ts +68 -1
- package/lib/esm/resources/prices.js +51 -1
- package/lib/esm/resources/promotion_rules.d.ts +24 -1
- package/lib/esm/resources/promotion_rules.js +22 -1
- package/lib/esm/resources/promotions.d.ts +41 -1
- package/lib/esm/resources/promotions.js +42 -1
- package/lib/esm/resources/refunds.d.ts +37 -1
- package/lib/esm/resources/refunds.js +34 -1
- package/lib/esm/resources/return_line_items.d.ts +49 -1
- package/lib/esm/resources/return_line_items.js +39 -1
- package/lib/esm/resources/returns.d.ts +75 -1
- package/lib/esm/resources/returns.js +63 -1
- package/lib/esm/resources/shipments.d.ts +93 -1
- package/lib/esm/resources/shipments.js +81 -1
- package/lib/esm/resources/shipping_categories.d.ts +33 -1
- package/lib/esm/resources/shipping_categories.js +39 -1
- package/lib/esm/resources/shipping_method_tiers.d.ts +28 -1
- package/lib/esm/resources/shipping_method_tiers.js +30 -1
- package/lib/esm/resources/shipping_methods.d.ts +107 -1
- package/lib/esm/resources/shipping_methods.js +63 -1
- package/lib/esm/resources/shipping_weight_tiers.d.ts +46 -1
- package/lib/esm/resources/shipping_weight_tiers.js +39 -1
- package/lib/esm/resources/shipping_zones.d.ts +48 -1
- package/lib/esm/resources/shipping_zones.js +35 -1
- package/lib/esm/resources/sku_list_items.d.ts +47 -1
- package/lib/esm/resources/sku_list_items.js +39 -1
- package/lib/esm/resources/sku_list_promotion_rules.d.ts +68 -1
- package/lib/esm/resources/sku_list_promotion_rules.js +39 -1
- package/lib/esm/resources/sku_lists.d.ts +60 -1
- package/lib/esm/resources/sku_lists.js +51 -1
- package/lib/esm/resources/sku_options.d.ts +56 -1
- package/lib/esm/resources/sku_options.js +39 -1
- package/lib/esm/resources/skus.d.ts +78 -1
- package/lib/esm/resources/skus.js +55 -1
- package/lib/esm/resources/stock_items.d.ts +49 -1
- package/lib/esm/resources/stock_items.js +43 -1
- package/lib/esm/resources/stock_line_items.d.ts +29 -1
- package/lib/esm/resources/stock_line_items.js +34 -1
- package/lib/esm/resources/stock_locations.d.ts +57 -1
- package/lib/esm/resources/stock_locations.js +55 -1
- package/lib/esm/resources/stock_transfers.d.ts +74 -1
- package/lib/esm/resources/stock_transfers.js +55 -1
- package/lib/esm/resources/stripe_gateways.d.ts +41 -1
- package/lib/esm/resources/stripe_gateways.js +39 -1
- package/lib/esm/resources/stripe_payments.d.ts +46 -1
- package/lib/esm/resources/stripe_payments.js +39 -1
- package/lib/esm/resources/tax_calculators.d.ts +24 -1
- package/lib/esm/resources/tax_calculators.js +30 -1
- package/lib/esm/resources/tax_categories.d.ts +59 -1
- package/lib/esm/resources/tax_categories.js +39 -1
- package/lib/esm/resources/tax_rules.d.ts +69 -1
- package/lib/esm/resources/tax_rules.js +35 -1
- package/lib/esm/resources/taxjar_accounts.d.ts +43 -1
- package/lib/esm/resources/taxjar_accounts.js +43 -1
- package/lib/esm/resources/transactions.d.ts +31 -1
- package/lib/esm/resources/transactions.js +26 -1
- package/lib/esm/resources/voids.d.ts +37 -1
- package/lib/esm/resources/voids.js +34 -1
- package/lib/esm/resources/webhooks.d.ts +43 -1
- package/lib/esm/resources/webhooks.js +35 -1
- package/lib/esm/resources/wire_transfers.d.ts +32 -1
- package/lib/esm/resources/wire_transfers.js +35 -1
- package/lib/esm/static.d.ts +8 -1
- package/lib/esm/static.js +18 -1
- package/lib/esm/util.d.ts +6 -1
- package/lib/esm/util.js +11 -1
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -15
@@ -1 +1,41 @@
|
|
1
|
-
import{ApiResource,Resource,ResourcesConfig,ResourceId,ResourceRel,ListResponse
|
1
|
+
import { ApiResource, Resource, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
+
import type { Market } from './markets';
|
4
|
+
import type { PromotionRule } from './promotion_rules';
|
5
|
+
import type { OrderAmountPromotionRule } from './order_amount_promotion_rules';
|
6
|
+
import type { SkuListPromotionRule } from './sku_list_promotion_rules';
|
7
|
+
import type { CouponCodesPromotionRule } from './coupon_codes_promotion_rules';
|
8
|
+
import type { Attachment } from './attachments';
|
9
|
+
type PromotionRel = ResourceRel & {
|
10
|
+
type: typeof Promotions.TYPE;
|
11
|
+
};
|
12
|
+
interface Promotion extends Resource {
|
13
|
+
name?: string;
|
14
|
+
currency_code?: string;
|
15
|
+
starts_at?: string;
|
16
|
+
expires_at?: string;
|
17
|
+
total_usage_limit?: number;
|
18
|
+
total_usage_count?: number;
|
19
|
+
active?: boolean;
|
20
|
+
market?: Market;
|
21
|
+
promotion_rules?: PromotionRule[];
|
22
|
+
order_amount_promotion_rule?: OrderAmountPromotionRule;
|
23
|
+
sku_list_promotion_rule?: SkuListPromotionRule;
|
24
|
+
coupon_codes_promotion_rule?: CouponCodesPromotionRule;
|
25
|
+
attachments?: Attachment[];
|
26
|
+
}
|
27
|
+
declare class Promotions extends ApiResource {
|
28
|
+
static readonly TYPE: 'promotions';
|
29
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Promotion>>;
|
30
|
+
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Promotion>;
|
31
|
+
market(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
|
32
|
+
order_amount_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
33
|
+
sku_list_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
34
|
+
coupon_codes_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
35
|
+
attachments(promotionId: string | Promotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
36
|
+
isPromotion(resource: any): resource is Promotion;
|
37
|
+
relationship(id: string | ResourceId | null): PromotionRel;
|
38
|
+
type(): string;
|
39
|
+
}
|
40
|
+
export default Promotions;
|
41
|
+
export { Promotion };
|
@@ -1 +1,42 @@
|
|
1
|
-
import{ApiResource
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
class Promotions extends ApiResource {
|
3
|
+
// static readonly PATH = 'promotions'
|
4
|
+
async list(params, options) {
|
5
|
+
return this.resources.list({ type: Promotions.TYPE }, params, options);
|
6
|
+
}
|
7
|
+
async retrieve(id, params, options) {
|
8
|
+
return this.resources.retrieve({ type: Promotions.TYPE, id }, params, options);
|
9
|
+
}
|
10
|
+
async market(promotionId, params, options) {
|
11
|
+
const _promotionId = promotionId.id || promotionId;
|
12
|
+
return this.resources.fetch({ type: 'markets' }, `promotions/${_promotionId}/market`, params, options);
|
13
|
+
}
|
14
|
+
async order_amount_promotion_rule(promotionId, params, options) {
|
15
|
+
const _promotionId = promotionId.id || promotionId;
|
16
|
+
return this.resources.fetch({ type: 'order_amount_promotion_rules' }, `promotions/${_promotionId}/order_amount_promotion_rule`, params, options);
|
17
|
+
}
|
18
|
+
async sku_list_promotion_rule(promotionId, params, options) {
|
19
|
+
const _promotionId = promotionId.id || promotionId;
|
20
|
+
return this.resources.fetch({ type: 'sku_list_promotion_rules' }, `promotions/${_promotionId}/sku_list_promotion_rule`, params, options);
|
21
|
+
}
|
22
|
+
async coupon_codes_promotion_rule(promotionId, params, options) {
|
23
|
+
const _promotionId = promotionId.id || promotionId;
|
24
|
+
return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `promotions/${_promotionId}/coupon_codes_promotion_rule`, params, options);
|
25
|
+
}
|
26
|
+
async attachments(promotionId, params, options) {
|
27
|
+
const _promotionId = promotionId.id || promotionId;
|
28
|
+
return this.resources.fetch({ type: 'attachments' }, `promotions/${_promotionId}/attachments`, params, options);
|
29
|
+
}
|
30
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
31
|
+
isPromotion(resource) {
|
32
|
+
return resource.type && (resource.type === Promotions.TYPE);
|
33
|
+
}
|
34
|
+
relationship(id) {
|
35
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: Promotions.TYPE } : { id: id.id, type: Promotions.TYPE };
|
36
|
+
}
|
37
|
+
type() {
|
38
|
+
return Promotions.TYPE;
|
39
|
+
}
|
40
|
+
}
|
41
|
+
Promotions.TYPE = 'promotions';
|
42
|
+
export default Promotions;
|
@@ -1 +1,37 @@
|
|
1
|
-
import{ApiResource,Resource,ResourcesConfig,ResourceId,ResourceRel,ListResponse
|
1
|
+
import { ApiResource, Resource, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
+
import type { Order } from './orders';
|
4
|
+
import type { Capture } from './captures';
|
5
|
+
import type { Event } from './events';
|
6
|
+
type RefundRel = ResourceRel & {
|
7
|
+
type: typeof Refunds.TYPE;
|
8
|
+
};
|
9
|
+
interface Refund extends Resource {
|
10
|
+
number?: string;
|
11
|
+
currency_code?: string;
|
12
|
+
amount_cents?: number;
|
13
|
+
amount_float?: number;
|
14
|
+
formatted_amount?: string;
|
15
|
+
succeeded?: boolean;
|
16
|
+
message?: string;
|
17
|
+
error_code?: string;
|
18
|
+
error_detail?: string;
|
19
|
+
token?: string;
|
20
|
+
gateway_transaction_id?: string;
|
21
|
+
order?: Order;
|
22
|
+
reference_capture?: Capture;
|
23
|
+
events?: Event[];
|
24
|
+
}
|
25
|
+
declare class Refunds extends ApiResource {
|
26
|
+
static readonly TYPE: 'refunds';
|
27
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Refund>>;
|
28
|
+
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Refund>;
|
29
|
+
order(refundId: string | Refund, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
30
|
+
reference_capture(refundId: string | Refund, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Capture>;
|
31
|
+
events(refundId: string | Refund, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
32
|
+
isRefund(resource: any): resource is Refund;
|
33
|
+
relationship(id: string | ResourceId | null): RefundRel;
|
34
|
+
type(): string;
|
35
|
+
}
|
36
|
+
export default Refunds;
|
37
|
+
export { Refund };
|
@@ -1 +1,34 @@
|
|
1
|
-
import{ApiResource
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
class Refunds extends ApiResource {
|
3
|
+
// static readonly PATH = 'refunds'
|
4
|
+
async list(params, options) {
|
5
|
+
return this.resources.list({ type: Refunds.TYPE }, params, options);
|
6
|
+
}
|
7
|
+
async retrieve(id, params, options) {
|
8
|
+
return this.resources.retrieve({ type: Refunds.TYPE, id }, params, options);
|
9
|
+
}
|
10
|
+
async order(refundId, params, options) {
|
11
|
+
const _refundId = refundId.id || refundId;
|
12
|
+
return this.resources.fetch({ type: 'orders' }, `refunds/${_refundId}/order`, params, options);
|
13
|
+
}
|
14
|
+
async reference_capture(refundId, params, options) {
|
15
|
+
const _refundId = refundId.id || refundId;
|
16
|
+
return this.resources.fetch({ type: 'captures' }, `refunds/${_refundId}/reference_capture`, params, options);
|
17
|
+
}
|
18
|
+
async events(refundId, params, options) {
|
19
|
+
const _refundId = refundId.id || refundId;
|
20
|
+
return this.resources.fetch({ type: 'events' }, `refunds/${_refundId}/events`, params, options);
|
21
|
+
}
|
22
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
23
|
+
isRefund(resource) {
|
24
|
+
return resource.type && (resource.type === Refunds.TYPE);
|
25
|
+
}
|
26
|
+
relationship(id) {
|
27
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: Refunds.TYPE } : { id: id.id, type: Refunds.TYPE };
|
28
|
+
}
|
29
|
+
type() {
|
30
|
+
return Refunds.TYPE;
|
31
|
+
}
|
32
|
+
}
|
33
|
+
Refunds.TYPE = 'refunds';
|
34
|
+
export default Refunds;
|
@@ -1 +1,49 @@
|
|
1
|
-
import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse
|
1
|
+
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
+
import type { Return } from './returns';
|
4
|
+
import type { LineItem } from './line_items';
|
5
|
+
type ReturnLineItemRel = ResourceRel & {
|
6
|
+
type: typeof ReturnLineItems.TYPE;
|
7
|
+
};
|
8
|
+
type ReturnRel = ResourceRel & {
|
9
|
+
type: 'returns';
|
10
|
+
};
|
11
|
+
type LineItemRel = ResourceRel & {
|
12
|
+
type: 'line_items';
|
13
|
+
};
|
14
|
+
interface ReturnLineItem extends Resource {
|
15
|
+
sku_code?: string;
|
16
|
+
bundle_code?: string;
|
17
|
+
name?: string;
|
18
|
+
quantity?: number;
|
19
|
+
return_reason?: object;
|
20
|
+
restocked_at?: string;
|
21
|
+
return?: Return;
|
22
|
+
line_item?: LineItem;
|
23
|
+
}
|
24
|
+
interface ReturnLineItemCreate extends ResourceCreate {
|
25
|
+
quantity: number;
|
26
|
+
return_reason?: object;
|
27
|
+
return: ReturnRel;
|
28
|
+
line_item: LineItemRel;
|
29
|
+
}
|
30
|
+
interface ReturnLineItemUpdate extends ResourceUpdate {
|
31
|
+
quantity?: number;
|
32
|
+
_restock?: boolean;
|
33
|
+
return_reason?: object;
|
34
|
+
}
|
35
|
+
declare class ReturnLineItems extends ApiResource {
|
36
|
+
static readonly TYPE: 'return_line_items';
|
37
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ReturnLineItem>>;
|
38
|
+
create(resource: ReturnLineItemCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ReturnLineItem>;
|
39
|
+
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ReturnLineItem>;
|
40
|
+
update(resource: ReturnLineItemUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ReturnLineItem>;
|
41
|
+
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
42
|
+
return(returnLineItemId: string | ReturnLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Return>;
|
43
|
+
line_item(returnLineItemId: string | ReturnLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
|
44
|
+
isReturnLineItem(resource: any): resource is ReturnLineItem;
|
45
|
+
relationship(id: string | ResourceId | null): ReturnLineItemRel;
|
46
|
+
type(): string;
|
47
|
+
}
|
48
|
+
export default ReturnLineItems;
|
49
|
+
export { ReturnLineItem, ReturnLineItemCreate, ReturnLineItemUpdate };
|
@@ -1 +1,39 @@
|
|
1
|
-
import{ApiResource
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
class ReturnLineItems extends ApiResource {
|
3
|
+
// static readonly PATH = 'return_line_items'
|
4
|
+
async list(params, options) {
|
5
|
+
return this.resources.list({ type: ReturnLineItems.TYPE }, params, options);
|
6
|
+
}
|
7
|
+
async create(resource, params, options) {
|
8
|
+
return this.resources.create(Object.assign(Object.assign({}, resource), { type: ReturnLineItems.TYPE }), params, options);
|
9
|
+
}
|
10
|
+
async retrieve(id, params, options) {
|
11
|
+
return this.resources.retrieve({ type: ReturnLineItems.TYPE, id }, params, options);
|
12
|
+
}
|
13
|
+
async update(resource, params, options) {
|
14
|
+
return this.resources.update(Object.assign(Object.assign({}, resource), { type: ReturnLineItems.TYPE }), params, options);
|
15
|
+
}
|
16
|
+
async delete(id, options) {
|
17
|
+
await this.resources.delete({ type: ReturnLineItems.TYPE, id }, options);
|
18
|
+
}
|
19
|
+
async return(returnLineItemId, params, options) {
|
20
|
+
const _returnLineItemId = returnLineItemId.id || returnLineItemId;
|
21
|
+
return this.resources.fetch({ type: 'returns' }, `return_line_items/${_returnLineItemId}/return`, params, options);
|
22
|
+
}
|
23
|
+
async line_item(returnLineItemId, params, options) {
|
24
|
+
const _returnLineItemId = returnLineItemId.id || returnLineItemId;
|
25
|
+
return this.resources.fetch({ type: 'line_items' }, `return_line_items/${_returnLineItemId}/line_item`, params, options);
|
26
|
+
}
|
27
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
28
|
+
isReturnLineItem(resource) {
|
29
|
+
return resource.type && (resource.type === ReturnLineItems.TYPE);
|
30
|
+
}
|
31
|
+
relationship(id) {
|
32
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: ReturnLineItems.TYPE } : { id: id.id, type: ReturnLineItems.TYPE };
|
33
|
+
}
|
34
|
+
type() {
|
35
|
+
return ReturnLineItems.TYPE;
|
36
|
+
}
|
37
|
+
}
|
38
|
+
ReturnLineItems.TYPE = 'return_line_items';
|
39
|
+
export default ReturnLineItems;
|
@@ -1 +1,75 @@
|
|
1
|
-
import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse
|
1
|
+
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
+
import type { Order } from './orders';
|
4
|
+
import type { Customer } from './customers';
|
5
|
+
import type { StockLocation } from './stock_locations';
|
6
|
+
import type { Address } from './addresses';
|
7
|
+
import type { ReturnLineItem } from './return_line_items';
|
8
|
+
import type { Attachment } from './attachments';
|
9
|
+
import type { Event } from './events';
|
10
|
+
type ReturnRel = ResourceRel & {
|
11
|
+
type: typeof Returns.TYPE;
|
12
|
+
};
|
13
|
+
type OrderRel = ResourceRel & {
|
14
|
+
type: 'orders';
|
15
|
+
};
|
16
|
+
type StockLocationRel = ResourceRel & {
|
17
|
+
type: 'stock_locations';
|
18
|
+
};
|
19
|
+
interface Return extends Resource {
|
20
|
+
number?: string;
|
21
|
+
status?: string;
|
22
|
+
customer_email?: string;
|
23
|
+
skus_count?: number;
|
24
|
+
approved_at?: string;
|
25
|
+
cancelled_at?: string;
|
26
|
+
shipped_at?: string;
|
27
|
+
rejected_at?: string;
|
28
|
+
received_at?: string;
|
29
|
+
archived_at?: string;
|
30
|
+
order?: Order;
|
31
|
+
customer?: Customer;
|
32
|
+
stock_location?: StockLocation;
|
33
|
+
origin_address?: Address;
|
34
|
+
destination_address?: Address;
|
35
|
+
return_line_items?: ReturnLineItem[];
|
36
|
+
attachments?: Attachment[];
|
37
|
+
events?: Event[];
|
38
|
+
}
|
39
|
+
interface ReturnCreate extends ResourceCreate {
|
40
|
+
order: OrderRel;
|
41
|
+
stock_location?: StockLocationRel;
|
42
|
+
}
|
43
|
+
interface ReturnUpdate extends ResourceUpdate {
|
44
|
+
_request?: boolean;
|
45
|
+
_approve?: boolean;
|
46
|
+
_cancel?: boolean;
|
47
|
+
_ship?: boolean;
|
48
|
+
_reject?: boolean;
|
49
|
+
_receive?: boolean;
|
50
|
+
_restock?: boolean;
|
51
|
+
_archive?: boolean;
|
52
|
+
_unarchive?: boolean;
|
53
|
+
stock_location?: StockLocationRel;
|
54
|
+
}
|
55
|
+
declare class Returns extends ApiResource {
|
56
|
+
static readonly TYPE: 'returns';
|
57
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Return>>;
|
58
|
+
create(resource: ReturnCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Return>;
|
59
|
+
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Return>;
|
60
|
+
update(resource: ReturnUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Return>;
|
61
|
+
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
62
|
+
order(returnId: string | Return, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
63
|
+
customer(returnId: string | Return, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Customer>;
|
64
|
+
stock_location(returnId: string | Return, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
|
65
|
+
origin_address(returnId: string | Return, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Address>;
|
66
|
+
destination_address(returnId: string | Return, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Address>;
|
67
|
+
return_line_items(returnId: string | Return, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ReturnLineItem>>;
|
68
|
+
attachments(returnId: string | Return, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
69
|
+
events(returnId: string | Return, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
70
|
+
isReturn(resource: any): resource is Return;
|
71
|
+
relationship(id: string | ResourceId | null): ReturnRel;
|
72
|
+
type(): string;
|
73
|
+
}
|
74
|
+
export default Returns;
|
75
|
+
export { Return, ReturnCreate, ReturnUpdate };
|
@@ -1 +1,63 @@
|
|
1
|
-
import{ApiResource
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
class Returns extends ApiResource {
|
3
|
+
// static readonly PATH = 'returns'
|
4
|
+
async list(params, options) {
|
5
|
+
return this.resources.list({ type: Returns.TYPE }, params, options);
|
6
|
+
}
|
7
|
+
async create(resource, params, options) {
|
8
|
+
return this.resources.create(Object.assign(Object.assign({}, resource), { type: Returns.TYPE }), params, options);
|
9
|
+
}
|
10
|
+
async retrieve(id, params, options) {
|
11
|
+
return this.resources.retrieve({ type: Returns.TYPE, id }, params, options);
|
12
|
+
}
|
13
|
+
async update(resource, params, options) {
|
14
|
+
return this.resources.update(Object.assign(Object.assign({}, resource), { type: Returns.TYPE }), params, options);
|
15
|
+
}
|
16
|
+
async delete(id, options) {
|
17
|
+
await this.resources.delete({ type: Returns.TYPE, id }, options);
|
18
|
+
}
|
19
|
+
async order(returnId, params, options) {
|
20
|
+
const _returnId = returnId.id || returnId;
|
21
|
+
return this.resources.fetch({ type: 'orders' }, `returns/${_returnId}/order`, params, options);
|
22
|
+
}
|
23
|
+
async customer(returnId, params, options) {
|
24
|
+
const _returnId = returnId.id || returnId;
|
25
|
+
return this.resources.fetch({ type: 'customers' }, `returns/${_returnId}/customer`, params, options);
|
26
|
+
}
|
27
|
+
async stock_location(returnId, params, options) {
|
28
|
+
const _returnId = returnId.id || returnId;
|
29
|
+
return this.resources.fetch({ type: 'stock_locations' }, `returns/${_returnId}/stock_location`, params, options);
|
30
|
+
}
|
31
|
+
async origin_address(returnId, params, options) {
|
32
|
+
const _returnId = returnId.id || returnId;
|
33
|
+
return this.resources.fetch({ type: 'addresses' }, `returns/${_returnId}/origin_address`, params, options);
|
34
|
+
}
|
35
|
+
async destination_address(returnId, params, options) {
|
36
|
+
const _returnId = returnId.id || returnId;
|
37
|
+
return this.resources.fetch({ type: 'addresses' }, `returns/${_returnId}/destination_address`, params, options);
|
38
|
+
}
|
39
|
+
async return_line_items(returnId, params, options) {
|
40
|
+
const _returnId = returnId.id || returnId;
|
41
|
+
return this.resources.fetch({ type: 'return_line_items' }, `returns/${_returnId}/return_line_items`, params, options);
|
42
|
+
}
|
43
|
+
async attachments(returnId, params, options) {
|
44
|
+
const _returnId = returnId.id || returnId;
|
45
|
+
return this.resources.fetch({ type: 'attachments' }, `returns/${_returnId}/attachments`, params, options);
|
46
|
+
}
|
47
|
+
async events(returnId, params, options) {
|
48
|
+
const _returnId = returnId.id || returnId;
|
49
|
+
return this.resources.fetch({ type: 'events' }, `returns/${_returnId}/events`, params, options);
|
50
|
+
}
|
51
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
52
|
+
isReturn(resource) {
|
53
|
+
return resource.type && (resource.type === Returns.TYPE);
|
54
|
+
}
|
55
|
+
relationship(id) {
|
56
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: Returns.TYPE } : { id: id.id, type: Returns.TYPE };
|
57
|
+
}
|
58
|
+
type() {
|
59
|
+
return Returns.TYPE;
|
60
|
+
}
|
61
|
+
}
|
62
|
+
Returns.TYPE = 'returns';
|
63
|
+
export default Returns;
|
@@ -1 +1,93 @@
|
|
1
|
-
import{ApiResource,Resource,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse
|
1
|
+
import { ApiResource, Resource, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
+
import type { Order } from './orders';
|
4
|
+
import type { ShippingCategory } from './shipping_categories';
|
5
|
+
import type { StockLocation } from './stock_locations';
|
6
|
+
import type { Address } from './addresses';
|
7
|
+
import type { ShippingMethod } from './shipping_methods';
|
8
|
+
import type { DeliveryLeadTime } from './delivery_lead_times';
|
9
|
+
import type { StockLineItem } from './stock_line_items';
|
10
|
+
import type { StockTransfer } from './stock_transfers';
|
11
|
+
import type { CarrierAccount } from './carrier_accounts';
|
12
|
+
import type { Parcel } from './parcels';
|
13
|
+
import type { Attachment } from './attachments';
|
14
|
+
import type { Event } from './events';
|
15
|
+
type ShipmentRel = ResourceRel & {
|
16
|
+
type: typeof Shipments.TYPE;
|
17
|
+
};
|
18
|
+
type ShippingMethodRel = ResourceRel & {
|
19
|
+
type: 'shipping_methods';
|
20
|
+
};
|
21
|
+
interface Shipment extends Resource {
|
22
|
+
number?: string;
|
23
|
+
status?: string;
|
24
|
+
currency_code?: string;
|
25
|
+
cost_amount_cents?: number;
|
26
|
+
cost_amount_float?: number;
|
27
|
+
formatted_cost_amount?: string;
|
28
|
+
skus_count?: number;
|
29
|
+
selected_rate_id?: string;
|
30
|
+
rates?: object[];
|
31
|
+
purchase_error_code?: string;
|
32
|
+
purchase_error_message?: string;
|
33
|
+
get_rates_errors?: object[];
|
34
|
+
get_rates_started_at?: string;
|
35
|
+
get_rates_completed_at?: string;
|
36
|
+
purchase_started_at?: string;
|
37
|
+
purchase_completed_at?: string;
|
38
|
+
purchase_failed_at?: string;
|
39
|
+
order?: Order;
|
40
|
+
shipping_category?: ShippingCategory;
|
41
|
+
stock_location?: StockLocation;
|
42
|
+
origin_address?: Address;
|
43
|
+
shipping_address?: Address;
|
44
|
+
shipping_method?: ShippingMethod;
|
45
|
+
delivery_lead_time?: DeliveryLeadTime;
|
46
|
+
/**
|
47
|
+
* @deprecated This field should not be used as it may be removed in the future without notice
|
48
|
+
*/
|
49
|
+
shipment_line_items?: object[];
|
50
|
+
stock_line_items?: StockLineItem[];
|
51
|
+
stock_transfers?: StockTransfer[];
|
52
|
+
available_shipping_methods?: ShippingMethod[];
|
53
|
+
carrier_accounts?: CarrierAccount[];
|
54
|
+
parcels?: Parcel[];
|
55
|
+
attachments?: Attachment[];
|
56
|
+
events?: Event[];
|
57
|
+
}
|
58
|
+
interface ShipmentUpdate extends ResourceUpdate {
|
59
|
+
_on_hold?: boolean;
|
60
|
+
_picking?: boolean;
|
61
|
+
_packing?: boolean;
|
62
|
+
_ready_to_ship?: boolean;
|
63
|
+
_ship?: boolean;
|
64
|
+
_get_rates?: boolean;
|
65
|
+
selected_rate_id?: string;
|
66
|
+
_purchase?: boolean;
|
67
|
+
shipping_method?: ShippingMethodRel;
|
68
|
+
}
|
69
|
+
declare class Shipments extends ApiResource {
|
70
|
+
static readonly TYPE: 'shipments';
|
71
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Shipment>>;
|
72
|
+
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Shipment>;
|
73
|
+
update(resource: ShipmentUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Shipment>;
|
74
|
+
order(shipmentId: string | Shipment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
75
|
+
shipping_category(shipmentId: string | Shipment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingCategory>;
|
76
|
+
stock_location(shipmentId: string | Shipment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
|
77
|
+
origin_address(shipmentId: string | Shipment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Address>;
|
78
|
+
shipping_address(shipmentId: string | Shipment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Address>;
|
79
|
+
shipping_method(shipmentId: string | Shipment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingMethod>;
|
80
|
+
delivery_lead_time(shipmentId: string | Shipment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<DeliveryLeadTime>;
|
81
|
+
stock_line_items(shipmentId: string | Shipment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockLineItem>>;
|
82
|
+
stock_transfers(shipmentId: string | Shipment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockTransfer>>;
|
83
|
+
available_shipping_methods(shipmentId: string | Shipment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ShippingMethod>>;
|
84
|
+
carrier_accounts(shipmentId: string | Shipment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<CarrierAccount>>;
|
85
|
+
parcels(shipmentId: string | Shipment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Parcel>>;
|
86
|
+
attachments(shipmentId: string | Shipment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
87
|
+
events(shipmentId: string | Shipment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
88
|
+
isShipment(resource: any): resource is Shipment;
|
89
|
+
relationship(id: string | ResourceId | null): ShipmentRel;
|
90
|
+
type(): string;
|
91
|
+
}
|
92
|
+
export default Shipments;
|
93
|
+
export { Shipment, ShipmentUpdate };
|
@@ -1 +1,81 @@
|
|
1
|
-
import{ApiResource
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
class Shipments extends ApiResource {
|
3
|
+
// static readonly PATH = 'shipments'
|
4
|
+
async list(params, options) {
|
5
|
+
return this.resources.list({ type: Shipments.TYPE }, params, options);
|
6
|
+
}
|
7
|
+
async retrieve(id, params, options) {
|
8
|
+
return this.resources.retrieve({ type: Shipments.TYPE, id }, params, options);
|
9
|
+
}
|
10
|
+
async update(resource, params, options) {
|
11
|
+
return this.resources.update(Object.assign(Object.assign({}, resource), { type: Shipments.TYPE }), params, options);
|
12
|
+
}
|
13
|
+
async order(shipmentId, params, options) {
|
14
|
+
const _shipmentId = shipmentId.id || shipmentId;
|
15
|
+
return this.resources.fetch({ type: 'orders' }, `shipments/${_shipmentId}/order`, params, options);
|
16
|
+
}
|
17
|
+
async shipping_category(shipmentId, params, options) {
|
18
|
+
const _shipmentId = shipmentId.id || shipmentId;
|
19
|
+
return this.resources.fetch({ type: 'shipping_categories' }, `shipments/${_shipmentId}/shipping_category`, params, options);
|
20
|
+
}
|
21
|
+
async stock_location(shipmentId, params, options) {
|
22
|
+
const _shipmentId = shipmentId.id || shipmentId;
|
23
|
+
return this.resources.fetch({ type: 'stock_locations' }, `shipments/${_shipmentId}/stock_location`, params, options);
|
24
|
+
}
|
25
|
+
async origin_address(shipmentId, params, options) {
|
26
|
+
const _shipmentId = shipmentId.id || shipmentId;
|
27
|
+
return this.resources.fetch({ type: 'addresses' }, `shipments/${_shipmentId}/origin_address`, params, options);
|
28
|
+
}
|
29
|
+
async shipping_address(shipmentId, params, options) {
|
30
|
+
const _shipmentId = shipmentId.id || shipmentId;
|
31
|
+
return this.resources.fetch({ type: 'addresses' }, `shipments/${_shipmentId}/shipping_address`, params, options);
|
32
|
+
}
|
33
|
+
async shipping_method(shipmentId, params, options) {
|
34
|
+
const _shipmentId = shipmentId.id || shipmentId;
|
35
|
+
return this.resources.fetch({ type: 'shipping_methods' }, `shipments/${_shipmentId}/shipping_method`, params, options);
|
36
|
+
}
|
37
|
+
async delivery_lead_time(shipmentId, params, options) {
|
38
|
+
const _shipmentId = shipmentId.id || shipmentId;
|
39
|
+
return this.resources.fetch({ type: 'delivery_lead_times' }, `shipments/${_shipmentId}/delivery_lead_time`, params, options);
|
40
|
+
}
|
41
|
+
async stock_line_items(shipmentId, params, options) {
|
42
|
+
const _shipmentId = shipmentId.id || shipmentId;
|
43
|
+
return this.resources.fetch({ type: 'stock_line_items' }, `shipments/${_shipmentId}/stock_line_items`, params, options);
|
44
|
+
}
|
45
|
+
async stock_transfers(shipmentId, params, options) {
|
46
|
+
const _shipmentId = shipmentId.id || shipmentId;
|
47
|
+
return this.resources.fetch({ type: 'stock_transfers' }, `shipments/${_shipmentId}/stock_transfers`, params, options);
|
48
|
+
}
|
49
|
+
async available_shipping_methods(shipmentId, params, options) {
|
50
|
+
const _shipmentId = shipmentId.id || shipmentId;
|
51
|
+
return this.resources.fetch({ type: 'shipping_methods' }, `shipments/${_shipmentId}/available_shipping_methods`, params, options);
|
52
|
+
}
|
53
|
+
async carrier_accounts(shipmentId, params, options) {
|
54
|
+
const _shipmentId = shipmentId.id || shipmentId;
|
55
|
+
return this.resources.fetch({ type: 'carrier_accounts' }, `shipments/${_shipmentId}/carrier_accounts`, params, options);
|
56
|
+
}
|
57
|
+
async parcels(shipmentId, params, options) {
|
58
|
+
const _shipmentId = shipmentId.id || shipmentId;
|
59
|
+
return this.resources.fetch({ type: 'parcels' }, `shipments/${_shipmentId}/parcels`, params, options);
|
60
|
+
}
|
61
|
+
async attachments(shipmentId, params, options) {
|
62
|
+
const _shipmentId = shipmentId.id || shipmentId;
|
63
|
+
return this.resources.fetch({ type: 'attachments' }, `shipments/${_shipmentId}/attachments`, params, options);
|
64
|
+
}
|
65
|
+
async events(shipmentId, params, options) {
|
66
|
+
const _shipmentId = shipmentId.id || shipmentId;
|
67
|
+
return this.resources.fetch({ type: 'events' }, `shipments/${_shipmentId}/events`, params, options);
|
68
|
+
}
|
69
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
70
|
+
isShipment(resource) {
|
71
|
+
return resource.type && (resource.type === Shipments.TYPE);
|
72
|
+
}
|
73
|
+
relationship(id) {
|
74
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: Shipments.TYPE } : { id: id.id, type: Shipments.TYPE };
|
75
|
+
}
|
76
|
+
type() {
|
77
|
+
return Shipments.TYPE;
|
78
|
+
}
|
79
|
+
}
|
80
|
+
Shipments.TYPE = 'shipments';
|
81
|
+
export default Shipments;
|