@commercelayer/sdk 5.0.0-alpha.5 → 5.0.0-beta.10
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/README.md +201 -123
- package/lib/cjs/api.d.ts +128 -0
- package/lib/cjs/api.js +342 -0
- package/lib/cjs/client.d.ts +33 -0
- package/lib/cjs/client.js +126 -0
- package/lib/cjs/commercelayer.d.ts +139 -0
- package/lib/cjs/commercelayer.js +230 -0
- package/lib/cjs/common.d.ts +4 -0
- package/lib/cjs/common.js +12 -0
- package/lib/cjs/config.d.ts +12 -0
- package/lib/cjs/config.js +14 -0
- package/lib/cjs/debug.d.ts +3 -0
- package/lib/cjs/debug.js +38 -0
- package/lib/cjs/error.d.ts +28 -0
- package/lib/cjs/error.js +40 -0
- package/lib/cjs/index.d.ts +8 -0
- package/lib/cjs/index.js +29 -0
- package/lib/cjs/interceptor.d.ts +25 -0
- package/lib/cjs/interceptor.js +2 -0
- package/lib/cjs/jsonapi.d.ts +5 -0
- package/lib/cjs/jsonapi.js +86 -0
- package/lib/cjs/model.d.ts +111 -0
- package/lib/cjs/model.js +3 -0
- package/lib/cjs/query.d.ts +25 -0
- package/lib/cjs/query.js +52 -0
- package/lib/cjs/resource.d.ts +87 -0
- package/lib/cjs/resource.js +170 -0
- package/lib/cjs/resources/addresses.d.ts +88 -0
- package/lib/cjs/resources/addresses.js +29 -0
- package/lib/cjs/resources/adjustments.d.ts +35 -0
- package/lib/cjs/resources/adjustments.js +25 -0
- package/lib/cjs/resources/adyen_gateways.d.ts +56 -0
- package/lib/cjs/resources/adyen_gateways.js +33 -0
- package/lib/cjs/resources/adyen_payments.d.ts +46 -0
- package/lib/cjs/resources/adyen_payments.js +33 -0
- package/lib/cjs/resources/application.d.ts +21 -0
- package/lib/cjs/resources/application.js +16 -0
- package/lib/cjs/resources/attachments.d.ts +156 -0
- package/lib/cjs/resources/attachments.js +25 -0
- package/lib/cjs/resources/authorizations.d.ts +60 -0
- package/lib/cjs/resources/authorizations.js +35 -0
- package/lib/cjs/resources/avalara_accounts.d.ts +55 -0
- package/lib/cjs/resources/avalara_accounts.js +37 -0
- package/lib/cjs/resources/axerve_gateways.d.ts +43 -0
- package/lib/cjs/resources/axerve_gateways.js +33 -0
- package/lib/cjs/resources/axerve_payments.d.ts +46 -0
- package/lib/cjs/resources/axerve_payments.js +33 -0
- package/lib/cjs/resources/billing_info_validation_rules.d.ts +35 -0
- package/lib/cjs/resources/billing_info_validation_rules.js +33 -0
- package/lib/cjs/resources/bing_geocoders.d.ts +35 -0
- package/lib/cjs/resources/bing_geocoders.js +33 -0
- package/lib/cjs/resources/braintree_gateways.d.ts +56 -0
- package/lib/cjs/resources/braintree_gateways.js +33 -0
- package/lib/cjs/resources/braintree_payments.d.ts +48 -0
- package/lib/cjs/resources/braintree_payments.js +33 -0
- package/lib/cjs/resources/bundles.d.ts +76 -0
- package/lib/cjs/resources/bundles.js +41 -0
- package/lib/cjs/resources/captures.d.ts +51 -0
- package/lib/cjs/resources/captures.js +35 -0
- package/lib/cjs/resources/carrier_accounts.d.ts +26 -0
- package/lib/cjs/resources/carrier_accounts.js +24 -0
- package/lib/cjs/resources/checkout_com_gateways.d.ts +45 -0
- package/lib/cjs/resources/checkout_com_gateways.js +33 -0
- package/lib/cjs/resources/checkout_com_payments.d.ts +59 -0
- package/lib/cjs/resources/checkout_com_payments.js +33 -0
- package/lib/cjs/resources/cleanups.d.ts +36 -0
- package/lib/cjs/resources/cleanups.js +26 -0
- package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +59 -0
- package/lib/cjs/resources/coupon_codes_promotion_rules.js +29 -0
- package/lib/cjs/resources/coupon_recipients.d.ts +44 -0
- package/lib/cjs/resources/coupon_recipients.js +33 -0
- package/lib/cjs/resources/coupons.d.ts +45 -0
- package/lib/cjs/resources/coupons.js +29 -0
- package/lib/cjs/resources/customer_addresses.d.ts +44 -0
- package/lib/cjs/resources/customer_addresses.js +37 -0
- package/lib/cjs/resources/customer_groups.d.ts +36 -0
- package/lib/cjs/resources/customer_groups.js +37 -0
- package/lib/cjs/resources/customer_password_resets.d.ts +36 -0
- package/lib/cjs/resources/customer_password_resets.js +33 -0
- package/lib/cjs/resources/customer_payment_sources.d.ts +78 -0
- package/lib/cjs/resources/customer_payment_sources.js +29 -0
- package/lib/cjs/resources/customer_subscriptions.d.ts +31 -0
- package/lib/cjs/resources/customer_subscriptions.js +33 -0
- package/lib/cjs/resources/customers.d.ts +66 -0
- package/lib/cjs/resources/customers.js +65 -0
- package/lib/cjs/resources/delivery_lead_times.d.ts +51 -0
- package/lib/cjs/resources/delivery_lead_times.js +37 -0
- package/lib/cjs/resources/event_callbacks.d.ts +24 -0
- package/lib/cjs/resources/event_callbacks.js +20 -0
- package/lib/cjs/resources/events.d.ts +24 -0
- package/lib/cjs/resources/events.js +24 -0
- package/lib/cjs/resources/exports.d.ts +40 -0
- package/lib/cjs/resources/exports.js +26 -0
- package/lib/cjs/resources/external_gateways.d.ts +49 -0
- package/lib/cjs/resources/external_gateways.js +33 -0
- package/lib/cjs/resources/external_payments.d.ts +44 -0
- package/lib/cjs/resources/external_payments.js +37 -0
- package/lib/cjs/resources/external_promotions.d.ts +90 -0
- package/lib/cjs/resources/external_promotions.js +49 -0
- package/lib/cjs/resources/external_tax_calculators.d.ts +37 -0
- package/lib/cjs/resources/external_tax_calculators.js +33 -0
- package/lib/cjs/resources/fixed_amount_promotions.d.ts +91 -0
- package/lib/cjs/resources/fixed_amount_promotions.js +49 -0
- package/lib/cjs/resources/fixed_price_promotions.d.ts +102 -0
- package/lib/cjs/resources/fixed_price_promotions.js +57 -0
- package/lib/cjs/resources/free_gift_promotions.d.ts +100 -0
- package/lib/cjs/resources/free_gift_promotions.js +57 -0
- package/lib/cjs/resources/free_shipping_promotions.d.ts +83 -0
- package/lib/cjs/resources/free_shipping_promotions.js +45 -0
- package/lib/cjs/resources/geocoders.d.ts +24 -0
- package/lib/cjs/resources/geocoders.js +24 -0
- package/lib/cjs/resources/gift_card_recipients.d.ts +44 -0
- package/lib/cjs/resources/gift_card_recipients.js +33 -0
- package/lib/cjs/resources/gift_cards.d.ts +85 -0
- package/lib/cjs/resources/gift_cards.js +41 -0
- package/lib/cjs/resources/google_geocoders.d.ts +35 -0
- package/lib/cjs/resources/google_geocoders.js +33 -0
- package/lib/cjs/resources/imports.d.ts +45 -0
- package/lib/cjs/resources/imports.js +26 -0
- package/lib/cjs/resources/in_stock_subscriptions.d.ts +62 -0
- package/lib/cjs/resources/in_stock_subscriptions.js +41 -0
- package/lib/cjs/resources/inventory_models.d.ts +42 -0
- package/lib/cjs/resources/inventory_models.js +37 -0
- package/lib/cjs/resources/inventory_return_locations.d.ts +43 -0
- package/lib/cjs/resources/inventory_return_locations.js +33 -0
- package/lib/cjs/resources/inventory_stock_locations.d.ts +46 -0
- package/lib/cjs/resources/inventory_stock_locations.js +33 -0
- package/lib/cjs/resources/klarna_gateways.d.ts +44 -0
- package/lib/cjs/resources/klarna_gateways.js +33 -0
- package/lib/cjs/resources/klarna_payments.d.ts +46 -0
- package/lib/cjs/resources/klarna_payments.js +33 -0
- package/lib/cjs/resources/line_item_options.d.ts +57 -0
- package/lib/cjs/resources/line_item_options.js +33 -0
- package/lib/cjs/resources/line_items.d.ts +126 -0
- package/lib/cjs/resources/line_items.js +41 -0
- package/lib/cjs/resources/manual_gateways.d.ts +30 -0
- package/lib/cjs/resources/manual_gateways.js +29 -0
- package/lib/cjs/resources/manual_tax_calculators.d.ts +41 -0
- package/lib/cjs/resources/manual_tax_calculators.js +37 -0
- package/lib/cjs/resources/markets.d.ts +88 -0
- package/lib/cjs/resources/markets.js +49 -0
- package/lib/cjs/resources/merchants.d.ts +38 -0
- package/lib/cjs/resources/merchants.js +33 -0
- package/lib/cjs/resources/order_amount_promotion_rules.d.ts +56 -0
- package/lib/cjs/resources/order_amount_promotion_rules.js +25 -0
- package/lib/cjs/resources/order_copies.d.ts +48 -0
- package/lib/cjs/resources/order_copies.js +38 -0
- package/lib/cjs/resources/order_subscriptions.d.ts +70 -0
- package/lib/cjs/resources/order_subscriptions.js +49 -0
- package/lib/cjs/resources/order_validation_rules.d.ts +23 -0
- package/lib/cjs/resources/order_validation_rules.js +24 -0
- package/lib/cjs/resources/orders.d.ts +296 -0
- package/lib/cjs/resources/orders.js +105 -0
- package/lib/cjs/resources/organization.d.ts +32 -0
- package/lib/cjs/resources/organization.js +16 -0
- package/lib/cjs/resources/packages.d.ts +56 -0
- package/lib/cjs/resources/packages.js +37 -0
- package/lib/cjs/resources/parcel_line_items.d.ts +51 -0
- package/lib/cjs/resources/parcel_line_items.js +33 -0
- package/lib/cjs/resources/parcels.d.ts +119 -0
- package/lib/cjs/resources/parcels.js +45 -0
- package/lib/cjs/resources/payment_gateways.d.ts +21 -0
- package/lib/cjs/resources/payment_gateways.js +20 -0
- package/lib/cjs/resources/payment_methods.d.ts +72 -0
- package/lib/cjs/resources/payment_methods.js +37 -0
- package/lib/cjs/resources/paypal_gateways.d.ts +37 -0
- package/lib/cjs/resources/paypal_gateways.js +33 -0
- package/lib/cjs/resources/paypal_payments.d.ts +52 -0
- package/lib/cjs/resources/paypal_payments.js +33 -0
- package/lib/cjs/resources/percentage_discount_promotions.d.ts +100 -0
- package/lib/cjs/resources/percentage_discount_promotions.js +57 -0
- package/lib/cjs/resources/price_lists.d.ts +39 -0
- package/lib/cjs/resources/price_lists.js +33 -0
- package/lib/cjs/resources/price_tiers.d.ts +28 -0
- package/lib/cjs/resources/price_tiers.js +24 -0
- package/lib/cjs/resources/price_volume_tiers.d.ts +46 -0
- package/lib/cjs/resources/price_volume_tiers.js +33 -0
- package/lib/cjs/resources/prices.d.ts +68 -0
- package/lib/cjs/resources/prices.js +45 -0
- package/lib/cjs/resources/promotion_rules.d.ts +23 -0
- package/lib/cjs/resources/promotion_rules.js +16 -0
- package/lib/cjs/resources/promotions.d.ts +41 -0
- package/lib/cjs/resources/promotions.js +36 -0
- package/lib/cjs/resources/refunds.d.ts +37 -0
- package/lib/cjs/resources/refunds.js +28 -0
- package/lib/cjs/resources/return_line_items.d.ts +49 -0
- package/lib/cjs/resources/return_line_items.js +33 -0
- package/lib/cjs/resources/returns.d.ts +75 -0
- package/lib/cjs/resources/returns.js +57 -0
- package/lib/cjs/resources/satispay_gateways.d.ts +39 -0
- package/lib/cjs/resources/satispay_gateways.js +33 -0
- package/lib/cjs/resources/satispay_payments.d.ts +43 -0
- package/lib/cjs/resources/satispay_payments.js +33 -0
- package/lib/cjs/resources/shipments.d.ts +93 -0
- package/lib/cjs/resources/shipments.js +75 -0
- package/lib/cjs/resources/shipping_categories.d.ts +33 -0
- package/lib/cjs/resources/shipping_categories.js +33 -0
- package/lib/cjs/resources/shipping_method_tiers.d.ts +28 -0
- package/lib/cjs/resources/shipping_method_tiers.js +24 -0
- package/lib/cjs/resources/shipping_methods.d.ts +107 -0
- package/lib/cjs/resources/shipping_methods.js +57 -0
- package/lib/cjs/resources/shipping_weight_tiers.d.ts +46 -0
- package/lib/cjs/resources/shipping_weight_tiers.js +33 -0
- package/lib/cjs/resources/shipping_zones.d.ts +48 -0
- package/lib/cjs/resources/shipping_zones.js +29 -0
- package/lib/cjs/resources/sku_list_items.d.ts +47 -0
- package/lib/cjs/resources/sku_list_items.js +33 -0
- package/lib/cjs/resources/sku_list_promotion_rules.d.ts +68 -0
- package/lib/cjs/resources/sku_list_promotion_rules.js +33 -0
- package/lib/cjs/resources/sku_lists.d.ts +60 -0
- package/lib/cjs/resources/sku_lists.js +45 -0
- package/lib/cjs/resources/sku_options.d.ts +56 -0
- package/lib/cjs/resources/sku_options.js +33 -0
- package/lib/cjs/resources/skus.d.ts +78 -0
- package/lib/cjs/resources/skus.js +49 -0
- package/lib/cjs/resources/stock_items.d.ts +49 -0
- package/lib/cjs/resources/stock_items.js +37 -0
- package/lib/cjs/resources/stock_line_items.d.ts +29 -0
- package/lib/cjs/resources/stock_line_items.js +28 -0
- package/lib/cjs/resources/stock_locations.d.ts +57 -0
- package/lib/cjs/resources/stock_locations.js +49 -0
- package/lib/cjs/resources/stock_transfers.d.ts +74 -0
- package/lib/cjs/resources/stock_transfers.js +49 -0
- package/lib/cjs/resources/stripe_gateways.d.ts +41 -0
- package/lib/cjs/resources/stripe_gateways.js +33 -0
- package/lib/cjs/resources/stripe_payments.d.ts +47 -0
- package/lib/cjs/resources/stripe_payments.js +33 -0
- package/lib/cjs/resources/tax_calculators.d.ts +24 -0
- package/lib/cjs/resources/tax_calculators.js +24 -0
- package/lib/cjs/resources/tax_categories.d.ts +59 -0
- package/lib/cjs/resources/tax_categories.js +33 -0
- package/lib/cjs/resources/tax_rules.d.ts +69 -0
- package/lib/cjs/resources/tax_rules.js +29 -0
- package/lib/cjs/resources/taxjar_accounts.d.ts +43 -0
- package/lib/cjs/resources/taxjar_accounts.js +37 -0
- package/lib/cjs/resources/transactions.d.ts +31 -0
- package/lib/cjs/resources/transactions.js +20 -0
- package/lib/cjs/resources/voids.d.ts +37 -0
- package/lib/cjs/resources/voids.js +28 -0
- package/lib/cjs/resources/webhooks.d.ts +43 -0
- package/lib/cjs/resources/webhooks.js +29 -0
- package/lib/cjs/resources/wire_transfers.d.ts +33 -0
- package/lib/cjs/resources/wire_transfers.js +29 -0
- package/lib/cjs/static.d.ts +9 -0
- package/lib/cjs/static.js +45 -0
- package/lib/cjs/util.d.ts +10 -0
- package/lib/cjs/util.js +15 -0
- package/lib/esm/api.d.ts +128 -0
- package/lib/esm/api.js +226 -0
- package/lib/esm/client.d.ts +33 -0
- package/lib/esm/client.js +121 -0
- package/lib/esm/commercelayer.d.ts +139 -0
- package/lib/esm/commercelayer.js +201 -0
- package/lib/esm/common.d.ts +4 -0
- package/lib/esm/common.js +8 -0
- package/lib/esm/config.d.ts +12 -0
- package/lib/esm/config.js +12 -0
- package/lib/esm/debug.d.ts +3 -0
- package/lib/esm/debug.js +36 -0
- package/lib/esm/error.d.ts +28 -0
- package/lib/esm/error.js +35 -0
- package/lib/esm/index.d.ts +8 -0
- package/lib/esm/index.js +6 -0
- package/lib/esm/interceptor.d.ts +25 -0
- package/lib/esm/interceptor.js +1 -0
- package/lib/esm/jsonapi.d.ts +5 -0
- package/lib/esm/jsonapi.js +79 -0
- package/lib/esm/model.d.ts +111 -0
- package/lib/esm/model.js +2 -0
- package/lib/esm/query.d.ts +25 -0
- package/lib/esm/query.js +45 -0
- package/lib/esm/resource.d.ts +87 -0
- package/lib/esm/resource.js +163 -0
- package/lib/esm/resources/addresses.d.ts +88 -0
- package/lib/esm/resources/addresses.js +27 -0
- package/lib/esm/resources/adjustments.d.ts +35 -0
- package/lib/esm/resources/adjustments.js +23 -0
- package/lib/esm/resources/adyen_gateways.d.ts +56 -0
- package/lib/esm/resources/adyen_gateways.js +31 -0
- package/lib/esm/resources/adyen_payments.d.ts +46 -0
- package/lib/esm/resources/adyen_payments.js +31 -0
- package/lib/esm/resources/application.d.ts +21 -0
- package/lib/esm/resources/application.js +14 -0
- package/lib/esm/resources/attachments.d.ts +156 -0
- package/lib/esm/resources/attachments.js +23 -0
- package/lib/esm/resources/authorizations.d.ts +60 -0
- package/lib/esm/resources/authorizations.js +33 -0
- package/lib/esm/resources/avalara_accounts.d.ts +55 -0
- package/lib/esm/resources/avalara_accounts.js +35 -0
- package/lib/esm/resources/axerve_gateways.d.ts +43 -0
- package/lib/esm/resources/axerve_gateways.js +31 -0
- package/lib/esm/resources/axerve_payments.d.ts +46 -0
- package/lib/esm/resources/axerve_payments.js +31 -0
- package/lib/esm/resources/billing_info_validation_rules.d.ts +35 -0
- package/lib/esm/resources/billing_info_validation_rules.js +31 -0
- package/lib/esm/resources/bing_geocoders.d.ts +35 -0
- package/lib/esm/resources/bing_geocoders.js +31 -0
- package/lib/esm/resources/braintree_gateways.d.ts +56 -0
- package/lib/esm/resources/braintree_gateways.js +31 -0
- package/lib/esm/resources/braintree_payments.d.ts +48 -0
- package/lib/esm/resources/braintree_payments.js +31 -0
- package/lib/esm/resources/bundles.d.ts +76 -0
- package/lib/esm/resources/bundles.js +39 -0
- package/lib/esm/resources/captures.d.ts +51 -0
- package/lib/esm/resources/captures.js +33 -0
- package/lib/esm/resources/carrier_accounts.d.ts +26 -0
- package/lib/esm/resources/carrier_accounts.js +22 -0
- package/lib/esm/resources/checkout_com_gateways.d.ts +45 -0
- package/lib/esm/resources/checkout_com_gateways.js +31 -0
- package/lib/esm/resources/checkout_com_payments.d.ts +59 -0
- package/lib/esm/resources/checkout_com_payments.js +31 -0
- package/lib/esm/resources/cleanups.d.ts +36 -0
- package/lib/esm/resources/cleanups.js +24 -0
- package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +59 -0
- package/lib/esm/resources/coupon_codes_promotion_rules.js +27 -0
- package/lib/esm/resources/coupon_recipients.d.ts +44 -0
- package/lib/esm/resources/coupon_recipients.js +31 -0
- package/lib/esm/resources/coupons.d.ts +45 -0
- package/lib/esm/resources/coupons.js +27 -0
- package/lib/esm/resources/customer_addresses.d.ts +44 -0
- package/lib/esm/resources/customer_addresses.js +35 -0
- package/lib/esm/resources/customer_groups.d.ts +36 -0
- package/lib/esm/resources/customer_groups.js +35 -0
- package/lib/esm/resources/customer_password_resets.d.ts +36 -0
- package/lib/esm/resources/customer_password_resets.js +31 -0
- package/lib/esm/resources/customer_payment_sources.d.ts +78 -0
- package/lib/esm/resources/customer_payment_sources.js +27 -0
- package/lib/esm/resources/customer_subscriptions.d.ts +31 -0
- package/lib/esm/resources/customer_subscriptions.js +31 -0
- package/lib/esm/resources/customers.d.ts +66 -0
- package/lib/esm/resources/customers.js +63 -0
- package/lib/esm/resources/delivery_lead_times.d.ts +51 -0
- package/lib/esm/resources/delivery_lead_times.js +35 -0
- package/lib/esm/resources/event_callbacks.d.ts +24 -0
- package/lib/esm/resources/event_callbacks.js +18 -0
- package/lib/esm/resources/events.d.ts +24 -0
- package/lib/esm/resources/events.js +22 -0
- package/lib/esm/resources/exports.d.ts +40 -0
- package/lib/esm/resources/exports.js +24 -0
- package/lib/esm/resources/external_gateways.d.ts +49 -0
- package/lib/esm/resources/external_gateways.js +31 -0
- package/lib/esm/resources/external_payments.d.ts +44 -0
- package/lib/esm/resources/external_payments.js +35 -0
- package/lib/esm/resources/external_promotions.d.ts +90 -0
- package/lib/esm/resources/external_promotions.js +47 -0
- package/lib/esm/resources/external_tax_calculators.d.ts +37 -0
- package/lib/esm/resources/external_tax_calculators.js +31 -0
- package/lib/esm/resources/fixed_amount_promotions.d.ts +91 -0
- package/lib/esm/resources/fixed_amount_promotions.js +47 -0
- package/lib/esm/resources/fixed_price_promotions.d.ts +102 -0
- package/lib/esm/resources/fixed_price_promotions.js +55 -0
- package/lib/esm/resources/free_gift_promotions.d.ts +100 -0
- package/lib/esm/resources/free_gift_promotions.js +55 -0
- package/lib/esm/resources/free_shipping_promotions.d.ts +83 -0
- package/lib/esm/resources/free_shipping_promotions.js +43 -0
- package/lib/esm/resources/geocoders.d.ts +24 -0
- package/lib/esm/resources/geocoders.js +22 -0
- package/lib/esm/resources/gift_card_recipients.d.ts +44 -0
- package/lib/esm/resources/gift_card_recipients.js +31 -0
- package/lib/esm/resources/gift_cards.d.ts +85 -0
- package/lib/esm/resources/gift_cards.js +39 -0
- package/lib/esm/resources/google_geocoders.d.ts +35 -0
- package/lib/esm/resources/google_geocoders.js +31 -0
- package/lib/esm/resources/imports.d.ts +45 -0
- package/lib/esm/resources/imports.js +24 -0
- package/lib/esm/resources/in_stock_subscriptions.d.ts +62 -0
- package/lib/esm/resources/in_stock_subscriptions.js +39 -0
- package/lib/esm/resources/inventory_models.d.ts +42 -0
- package/lib/esm/resources/inventory_models.js +35 -0
- package/lib/esm/resources/inventory_return_locations.d.ts +43 -0
- package/lib/esm/resources/inventory_return_locations.js +31 -0
- package/lib/esm/resources/inventory_stock_locations.d.ts +46 -0
- package/lib/esm/resources/inventory_stock_locations.js +31 -0
- package/lib/esm/resources/klarna_gateways.d.ts +44 -0
- package/lib/esm/resources/klarna_gateways.js +31 -0
- package/lib/esm/resources/klarna_payments.d.ts +46 -0
- package/lib/esm/resources/klarna_payments.js +31 -0
- package/lib/esm/resources/line_item_options.d.ts +57 -0
- package/lib/esm/resources/line_item_options.js +31 -0
- package/lib/esm/resources/line_items.d.ts +126 -0
- package/lib/esm/resources/line_items.js +39 -0
- package/lib/esm/resources/manual_gateways.d.ts +30 -0
- package/lib/esm/resources/manual_gateways.js +27 -0
- package/lib/esm/resources/manual_tax_calculators.d.ts +41 -0
- package/lib/esm/resources/manual_tax_calculators.js +35 -0
- package/lib/esm/resources/markets.d.ts +88 -0
- package/lib/esm/resources/markets.js +47 -0
- package/lib/esm/resources/merchants.d.ts +38 -0
- package/lib/esm/resources/merchants.js +31 -0
- package/lib/esm/resources/order_amount_promotion_rules.d.ts +56 -0
- package/lib/esm/resources/order_amount_promotion_rules.js +23 -0
- package/lib/esm/resources/order_copies.d.ts +48 -0
- package/lib/esm/resources/order_copies.js +36 -0
- package/lib/esm/resources/order_subscriptions.d.ts +70 -0
- package/lib/esm/resources/order_subscriptions.js +47 -0
- package/lib/esm/resources/order_validation_rules.d.ts +23 -0
- package/lib/esm/resources/order_validation_rules.js +22 -0
- package/lib/esm/resources/orders.d.ts +296 -0
- package/lib/esm/resources/orders.js +103 -0
- package/lib/esm/resources/organization.d.ts +32 -0
- package/lib/esm/resources/organization.js +14 -0
- package/lib/esm/resources/packages.d.ts +56 -0
- package/lib/esm/resources/packages.js +35 -0
- package/lib/esm/resources/parcel_line_items.d.ts +51 -0
- package/lib/esm/resources/parcel_line_items.js +31 -0
- package/lib/esm/resources/parcels.d.ts +119 -0
- package/lib/esm/resources/parcels.js +43 -0
- package/lib/esm/resources/payment_gateways.d.ts +21 -0
- package/lib/esm/resources/payment_gateways.js +18 -0
- package/lib/esm/resources/payment_methods.d.ts +72 -0
- package/lib/esm/resources/payment_methods.js +35 -0
- package/lib/esm/resources/paypal_gateways.d.ts +37 -0
- package/lib/esm/resources/paypal_gateways.js +31 -0
- package/lib/esm/resources/paypal_payments.d.ts +52 -0
- package/lib/esm/resources/paypal_payments.js +31 -0
- package/lib/esm/resources/percentage_discount_promotions.d.ts +100 -0
- package/lib/esm/resources/percentage_discount_promotions.js +55 -0
- package/lib/esm/resources/price_lists.d.ts +39 -0
- package/lib/esm/resources/price_lists.js +31 -0
- package/lib/esm/resources/price_tiers.d.ts +28 -0
- package/lib/esm/resources/price_tiers.js +22 -0
- package/lib/esm/resources/price_volume_tiers.d.ts +46 -0
- package/lib/esm/resources/price_volume_tiers.js +31 -0
- package/lib/esm/resources/prices.d.ts +68 -0
- package/lib/esm/resources/prices.js +43 -0
- package/lib/esm/resources/promotion_rules.d.ts +23 -0
- package/lib/esm/resources/promotion_rules.js +14 -0
- package/lib/esm/resources/promotions.d.ts +41 -0
- package/lib/esm/resources/promotions.js +34 -0
- package/lib/esm/resources/refunds.d.ts +37 -0
- package/lib/esm/resources/refunds.js +26 -0
- package/lib/esm/resources/return_line_items.d.ts +49 -0
- package/lib/esm/resources/return_line_items.js +31 -0
- package/lib/esm/resources/returns.d.ts +75 -0
- package/lib/esm/resources/returns.js +55 -0
- package/lib/esm/resources/satispay_gateways.d.ts +39 -0
- package/lib/esm/resources/satispay_gateways.js +31 -0
- package/lib/esm/resources/satispay_payments.d.ts +43 -0
- package/lib/esm/resources/satispay_payments.js +31 -0
- package/lib/esm/resources/shipments.d.ts +93 -0
- package/lib/esm/resources/shipments.js +73 -0
- package/lib/esm/resources/shipping_categories.d.ts +33 -0
- package/lib/esm/resources/shipping_categories.js +31 -0
- package/lib/esm/resources/shipping_method_tiers.d.ts +28 -0
- package/lib/esm/resources/shipping_method_tiers.js +22 -0
- package/lib/esm/resources/shipping_methods.d.ts +107 -0
- package/lib/esm/resources/shipping_methods.js +55 -0
- package/lib/esm/resources/shipping_weight_tiers.d.ts +46 -0
- package/lib/esm/resources/shipping_weight_tiers.js +31 -0
- package/lib/esm/resources/shipping_zones.d.ts +48 -0
- package/lib/esm/resources/shipping_zones.js +27 -0
- package/lib/esm/resources/sku_list_items.d.ts +47 -0
- package/lib/esm/resources/sku_list_items.js +31 -0
- package/lib/esm/resources/sku_list_promotion_rules.d.ts +68 -0
- package/lib/esm/resources/sku_list_promotion_rules.js +31 -0
- package/lib/esm/resources/sku_lists.d.ts +60 -0
- package/lib/esm/resources/sku_lists.js +43 -0
- package/lib/esm/resources/sku_options.d.ts +56 -0
- package/lib/esm/resources/sku_options.js +31 -0
- package/lib/esm/resources/skus.d.ts +78 -0
- package/lib/esm/resources/skus.js +47 -0
- package/lib/esm/resources/stock_items.d.ts +49 -0
- package/lib/esm/resources/stock_items.js +35 -0
- package/lib/esm/resources/stock_line_items.d.ts +29 -0
- package/lib/esm/resources/stock_line_items.js +26 -0
- package/lib/esm/resources/stock_locations.d.ts +57 -0
- package/lib/esm/resources/stock_locations.js +47 -0
- package/lib/esm/resources/stock_transfers.d.ts +74 -0
- package/lib/esm/resources/stock_transfers.js +47 -0
- package/lib/esm/resources/stripe_gateways.d.ts +41 -0
- package/lib/esm/resources/stripe_gateways.js +31 -0
- package/lib/esm/resources/stripe_payments.d.ts +47 -0
- package/lib/esm/resources/stripe_payments.js +31 -0
- package/lib/esm/resources/tax_calculators.d.ts +24 -0
- package/lib/esm/resources/tax_calculators.js +22 -0
- package/lib/esm/resources/tax_categories.d.ts +59 -0
- package/lib/esm/resources/tax_categories.js +31 -0
- package/lib/esm/resources/tax_rules.d.ts +69 -0
- package/lib/esm/resources/tax_rules.js +27 -0
- package/lib/esm/resources/taxjar_accounts.d.ts +43 -0
- package/lib/esm/resources/taxjar_accounts.js +35 -0
- package/lib/esm/resources/transactions.d.ts +31 -0
- package/lib/esm/resources/transactions.js +18 -0
- package/lib/esm/resources/voids.d.ts +37 -0
- package/lib/esm/resources/voids.js +26 -0
- package/lib/esm/resources/webhooks.d.ts +43 -0
- package/lib/esm/resources/webhooks.js +27 -0
- package/lib/esm/resources/wire_transfers.d.ts +33 -0
- package/lib/esm/resources/wire_transfers.js +27 -0
- package/lib/esm/static.d.ts +9 -0
- package/lib/esm/static.js +19 -0
- package/lib/esm/util.d.ts +10 -0
- package/lib/esm/util.js +11 -0
- package/lib/tsconfig.esm.tsbuildinfo +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/package.json +27 -36
- package/lib/api.d.ts +0 -1
- package/lib/api.js +0 -1
- package/lib/client.d.ts +0 -2
- package/lib/client.js +0 -1
- package/lib/commercelayer.d.ts +0 -1
- package/lib/commercelayer.js +0 -1
- package/lib/common.d.ts +0 -1
- package/lib/common.js +0 -1
- package/lib/config.d.ts +0 -1
- package/lib/config.js +0 -1
- package/lib/debug.d.ts +0 -1
- package/lib/debug.js +0 -1
- package/lib/error.d.ts +0 -1
- package/lib/error.js +0 -1
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -1
- package/lib/interceptor.d.ts +0 -1
- package/lib/interceptor.js +0 -1
- package/lib/jsonapi.d.ts +0 -1
- package/lib/jsonapi.js +0 -1
- package/lib/model.d.ts +0 -1
- package/lib/model.js +0 -1
- package/lib/query.d.ts +0 -1
- package/lib/query.js +0 -1
- package/lib/resource.d.ts +0 -1
- package/lib/resource.js +0 -1
- package/lib/resources/addresses.d.ts +0 -1
- package/lib/resources/addresses.js +0 -1
- package/lib/resources/adjustments.d.ts +0 -1
- package/lib/resources/adjustments.js +0 -1
- package/lib/resources/adyen_gateways.d.ts +0 -1
- package/lib/resources/adyen_gateways.js +0 -1
- package/lib/resources/adyen_payments.d.ts +0 -1
- package/lib/resources/adyen_payments.js +0 -1
- package/lib/resources/application.d.ts +0 -1
- package/lib/resources/application.js +0 -1
- package/lib/resources/attachments.d.ts +0 -1
- package/lib/resources/attachments.js +0 -1
- package/lib/resources/authorizations.d.ts +0 -1
- package/lib/resources/authorizations.js +0 -1
- package/lib/resources/avalara_accounts.d.ts +0 -1
- package/lib/resources/avalara_accounts.js +0 -1
- package/lib/resources/billing_info_validation_rules.d.ts +0 -1
- package/lib/resources/billing_info_validation_rules.js +0 -1
- package/lib/resources/bing_geocoders.d.ts +0 -1
- package/lib/resources/bing_geocoders.js +0 -1
- package/lib/resources/braintree_gateways.d.ts +0 -1
- package/lib/resources/braintree_gateways.js +0 -1
- package/lib/resources/braintree_payments.d.ts +0 -1
- package/lib/resources/braintree_payments.js +0 -1
- package/lib/resources/bundles.d.ts +0 -1
- package/lib/resources/bundles.js +0 -1
- package/lib/resources/captures.d.ts +0 -1
- package/lib/resources/captures.js +0 -1
- package/lib/resources/carrier_accounts.d.ts +0 -1
- package/lib/resources/carrier_accounts.js +0 -1
- package/lib/resources/checkout_com_gateways.d.ts +0 -1
- package/lib/resources/checkout_com_gateways.js +0 -1
- package/lib/resources/checkout_com_payments.d.ts +0 -1
- package/lib/resources/checkout_com_payments.js +0 -1
- package/lib/resources/coupon_codes_promotion_rules.d.ts +0 -1
- package/lib/resources/coupon_codes_promotion_rules.js +0 -1
- package/lib/resources/coupon_recipients.d.ts +0 -1
- package/lib/resources/coupon_recipients.js +0 -1
- package/lib/resources/coupons.d.ts +0 -1
- package/lib/resources/coupons.js +0 -1
- package/lib/resources/customer_addresses.d.ts +0 -1
- package/lib/resources/customer_addresses.js +0 -1
- package/lib/resources/customer_groups.d.ts +0 -1
- package/lib/resources/customer_groups.js +0 -1
- package/lib/resources/customer_password_resets.d.ts +0 -1
- package/lib/resources/customer_password_resets.js +0 -1
- package/lib/resources/customer_payment_sources.d.ts +0 -1
- package/lib/resources/customer_payment_sources.js +0 -1
- package/lib/resources/customer_subscriptions.d.ts +0 -1
- package/lib/resources/customer_subscriptions.js +0 -1
- package/lib/resources/customers.d.ts +0 -1
- package/lib/resources/customers.js +0 -1
- package/lib/resources/delivery_lead_times.d.ts +0 -1
- package/lib/resources/delivery_lead_times.js +0 -1
- package/lib/resources/event_callbacks.d.ts +0 -1
- package/lib/resources/event_callbacks.js +0 -1
- package/lib/resources/external_gateways.d.ts +0 -1
- package/lib/resources/external_gateways.js +0 -1
- package/lib/resources/external_payments.d.ts +0 -1
- package/lib/resources/external_payments.js +0 -1
- package/lib/resources/external_promotions.d.ts +0 -1
- package/lib/resources/external_promotions.js +0 -1
- package/lib/resources/external_tax_calculators.d.ts +0 -1
- package/lib/resources/external_tax_calculators.js +0 -1
- package/lib/resources/fixed_amount_promotions.d.ts +0 -1
- package/lib/resources/fixed_amount_promotions.js +0 -1
- package/lib/resources/fixed_price_promotions.d.ts +0 -1
- package/lib/resources/fixed_price_promotions.js +0 -1
- package/lib/resources/free_gift_promotions.d.ts +0 -1
- package/lib/resources/free_gift_promotions.js +0 -1
- package/lib/resources/free_shipping_promotions.d.ts +0 -1
- package/lib/resources/free_shipping_promotions.js +0 -1
- package/lib/resources/geocoders.d.ts +0 -1
- package/lib/resources/geocoders.js +0 -1
- package/lib/resources/gift_card_recipients.d.ts +0 -1
- package/lib/resources/gift_card_recipients.js +0 -1
- package/lib/resources/gift_cards.d.ts +0 -1
- package/lib/resources/gift_cards.js +0 -1
- package/lib/resources/google_geocoders.d.ts +0 -1
- package/lib/resources/google_geocoders.js +0 -1
- package/lib/resources/imports.d.ts +0 -1
- package/lib/resources/imports.js +0 -1
- package/lib/resources/in_stock_subscriptions.d.ts +0 -1
- package/lib/resources/in_stock_subscriptions.js +0 -1
- package/lib/resources/inventory_models.d.ts +0 -1
- package/lib/resources/inventory_models.js +0 -1
- package/lib/resources/inventory_return_locations.d.ts +0 -1
- package/lib/resources/inventory_return_locations.js +0 -1
- package/lib/resources/inventory_stock_locations.d.ts +0 -1
- package/lib/resources/inventory_stock_locations.js +0 -1
- package/lib/resources/klarna_gateways.d.ts +0 -1
- package/lib/resources/klarna_gateways.js +0 -1
- package/lib/resources/klarna_payments.d.ts +0 -1
- package/lib/resources/klarna_payments.js +0 -1
- package/lib/resources/line_item_options.d.ts +0 -1
- package/lib/resources/line_item_options.js +0 -1
- package/lib/resources/line_items.d.ts +0 -1
- package/lib/resources/line_items.js +0 -1
- package/lib/resources/manual_gateways.d.ts +0 -1
- package/lib/resources/manual_gateways.js +0 -1
- package/lib/resources/manual_tax_calculators.d.ts +0 -1
- package/lib/resources/manual_tax_calculators.js +0 -1
- package/lib/resources/markets.d.ts +0 -1
- package/lib/resources/markets.js +0 -1
- package/lib/resources/merchants.d.ts +0 -1
- package/lib/resources/merchants.js +0 -1
- package/lib/resources/order_amount_promotion_rules.d.ts +0 -1
- package/lib/resources/order_amount_promotion_rules.js +0 -1
- package/lib/resources/order_copies.d.ts +0 -1
- package/lib/resources/order_copies.js +0 -1
- package/lib/resources/order_subscriptions.d.ts +0 -1
- package/lib/resources/order_subscriptions.js +0 -1
- package/lib/resources/order_validation_rules.d.ts +0 -1
- package/lib/resources/order_validation_rules.js +0 -1
- package/lib/resources/orders.d.ts +0 -1
- package/lib/resources/orders.js +0 -1
- package/lib/resources/organization.d.ts +0 -1
- package/lib/resources/organization.js +0 -1
- package/lib/resources/packages.d.ts +0 -1
- package/lib/resources/packages.js +0 -1
- package/lib/resources/parcel_line_items.d.ts +0 -1
- package/lib/resources/parcel_line_items.js +0 -1
- package/lib/resources/parcels.d.ts +0 -1
- package/lib/resources/parcels.js +0 -1
- package/lib/resources/payment_gateways.d.ts +0 -1
- package/lib/resources/payment_gateways.js +0 -1
- package/lib/resources/payment_methods.d.ts +0 -1
- package/lib/resources/payment_methods.js +0 -1
- package/lib/resources/paypal_gateways.d.ts +0 -1
- package/lib/resources/paypal_gateways.js +0 -1
- package/lib/resources/paypal_payments.d.ts +0 -1
- package/lib/resources/paypal_payments.js +0 -1
- package/lib/resources/percentage_discount_promotions.d.ts +0 -1
- package/lib/resources/percentage_discount_promotions.js +0 -1
- package/lib/resources/price_lists.d.ts +0 -1
- package/lib/resources/price_lists.js +0 -1
- package/lib/resources/prices.d.ts +0 -1
- package/lib/resources/prices.js +0 -1
- package/lib/resources/promotion_rules.d.ts +0 -1
- package/lib/resources/promotion_rules.js +0 -1
- package/lib/resources/promotions.d.ts +0 -1
- package/lib/resources/promotions.js +0 -1
- package/lib/resources/refunds.d.ts +0 -1
- package/lib/resources/refunds.js +0 -1
- package/lib/resources/return_line_items.d.ts +0 -1
- package/lib/resources/return_line_items.js +0 -1
- package/lib/resources/returns.d.ts +0 -1
- package/lib/resources/returns.js +0 -1
- package/lib/resources/shipments.d.ts +0 -1
- package/lib/resources/shipments.js +0 -1
- package/lib/resources/shipping_categories.d.ts +0 -1
- package/lib/resources/shipping_categories.js +0 -1
- package/lib/resources/shipping_methods.d.ts +0 -1
- package/lib/resources/shipping_methods.js +0 -1
- package/lib/resources/shipping_zones.d.ts +0 -1
- package/lib/resources/shipping_zones.js +0 -1
- package/lib/resources/sku_list_items.d.ts +0 -1
- package/lib/resources/sku_list_items.js +0 -1
- package/lib/resources/sku_list_promotion_rules.d.ts +0 -1
- package/lib/resources/sku_list_promotion_rules.js +0 -1
- package/lib/resources/sku_lists.d.ts +0 -1
- package/lib/resources/sku_lists.js +0 -1
- package/lib/resources/sku_options.d.ts +0 -1
- package/lib/resources/sku_options.js +0 -1
- package/lib/resources/skus.d.ts +0 -1
- package/lib/resources/skus.js +0 -1
- package/lib/resources/stock_items.d.ts +0 -1
- package/lib/resources/stock_items.js +0 -1
- package/lib/resources/stock_line_items.d.ts +0 -1
- package/lib/resources/stock_line_items.js +0 -1
- package/lib/resources/stock_locations.d.ts +0 -1
- package/lib/resources/stock_locations.js +0 -1
- package/lib/resources/stock_transfers.d.ts +0 -1
- package/lib/resources/stock_transfers.js +0 -1
- package/lib/resources/stripe_gateways.d.ts +0 -1
- package/lib/resources/stripe_gateways.js +0 -1
- package/lib/resources/stripe_payments.d.ts +0 -1
- package/lib/resources/stripe_payments.js +0 -1
- package/lib/resources/tax_calculators.d.ts +0 -1
- package/lib/resources/tax_calculators.js +0 -1
- package/lib/resources/tax_categories.d.ts +0 -1
- package/lib/resources/tax_categories.js +0 -1
- package/lib/resources/tax_rules.d.ts +0 -1
- package/lib/resources/tax_rules.js +0 -1
- package/lib/resources/taxjar_accounts.d.ts +0 -1
- package/lib/resources/taxjar_accounts.js +0 -1
- package/lib/resources/transactions.d.ts +0 -1
- package/lib/resources/transactions.js +0 -1
- package/lib/resources/voids.d.ts +0 -1
- package/lib/resources/voids.js +0 -1
- package/lib/resources/webhooks.d.ts +0 -1
- package/lib/resources/webhooks.js +0 -1
- package/lib/resources/wire_transfers.d.ts +0 -1
- package/lib/resources/wire_transfers.js +0 -1
- package/lib/static.d.ts +0 -1
- package/lib/static.js +0 -1
- package/lib/util.d.ts +0 -2
- package/lib/util.js +0 -1
@@ -0,0 +1,75 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const resource_1 = require("../resource");
|
4
|
+
class Shipments extends resource_1.ApiResource {
|
5
|
+
async update(resource, params, options) {
|
6
|
+
return this.resources.update({ ...resource, type: Shipments.TYPE }, params, options);
|
7
|
+
}
|
8
|
+
async order(shipmentId, params, options) {
|
9
|
+
const _shipmentId = shipmentId.id || shipmentId;
|
10
|
+
return this.resources.fetch({ type: 'orders' }, `shipments/${_shipmentId}/order`, params, options);
|
11
|
+
}
|
12
|
+
async shipping_category(shipmentId, params, options) {
|
13
|
+
const _shipmentId = shipmentId.id || shipmentId;
|
14
|
+
return this.resources.fetch({ type: 'shipping_categories' }, `shipments/${_shipmentId}/shipping_category`, params, options);
|
15
|
+
}
|
16
|
+
async stock_location(shipmentId, params, options) {
|
17
|
+
const _shipmentId = shipmentId.id || shipmentId;
|
18
|
+
return this.resources.fetch({ type: 'stock_locations' }, `shipments/${_shipmentId}/stock_location`, params, options);
|
19
|
+
}
|
20
|
+
async origin_address(shipmentId, params, options) {
|
21
|
+
const _shipmentId = shipmentId.id || shipmentId;
|
22
|
+
return this.resources.fetch({ type: 'addresses' }, `shipments/${_shipmentId}/origin_address`, params, options);
|
23
|
+
}
|
24
|
+
async shipping_address(shipmentId, params, options) {
|
25
|
+
const _shipmentId = shipmentId.id || shipmentId;
|
26
|
+
return this.resources.fetch({ type: 'addresses' }, `shipments/${_shipmentId}/shipping_address`, params, options);
|
27
|
+
}
|
28
|
+
async shipping_method(shipmentId, params, options) {
|
29
|
+
const _shipmentId = shipmentId.id || shipmentId;
|
30
|
+
return this.resources.fetch({ type: 'shipping_methods' }, `shipments/${_shipmentId}/shipping_method`, params, options);
|
31
|
+
}
|
32
|
+
async delivery_lead_time(shipmentId, params, options) {
|
33
|
+
const _shipmentId = shipmentId.id || shipmentId;
|
34
|
+
return this.resources.fetch({ type: 'delivery_lead_times' }, `shipments/${_shipmentId}/delivery_lead_time`, params, options);
|
35
|
+
}
|
36
|
+
async stock_line_items(shipmentId, params, options) {
|
37
|
+
const _shipmentId = shipmentId.id || shipmentId;
|
38
|
+
return this.resources.fetch({ type: 'stock_line_items' }, `shipments/${_shipmentId}/stock_line_items`, params, options);
|
39
|
+
}
|
40
|
+
async stock_transfers(shipmentId, params, options) {
|
41
|
+
const _shipmentId = shipmentId.id || shipmentId;
|
42
|
+
return this.resources.fetch({ type: 'stock_transfers' }, `shipments/${_shipmentId}/stock_transfers`, params, options);
|
43
|
+
}
|
44
|
+
async available_shipping_methods(shipmentId, params, options) {
|
45
|
+
const _shipmentId = shipmentId.id || shipmentId;
|
46
|
+
return this.resources.fetch({ type: 'shipping_methods' }, `shipments/${_shipmentId}/available_shipping_methods`, params, options);
|
47
|
+
}
|
48
|
+
async carrier_accounts(shipmentId, params, options) {
|
49
|
+
const _shipmentId = shipmentId.id || shipmentId;
|
50
|
+
return this.resources.fetch({ type: 'carrier_accounts' }, `shipments/${_shipmentId}/carrier_accounts`, params, options);
|
51
|
+
}
|
52
|
+
async parcels(shipmentId, params, options) {
|
53
|
+
const _shipmentId = shipmentId.id || shipmentId;
|
54
|
+
return this.resources.fetch({ type: 'parcels' }, `shipments/${_shipmentId}/parcels`, params, options);
|
55
|
+
}
|
56
|
+
async attachments(shipmentId, params, options) {
|
57
|
+
const _shipmentId = shipmentId.id || shipmentId;
|
58
|
+
return this.resources.fetch({ type: 'attachments' }, `shipments/${_shipmentId}/attachments`, params, options);
|
59
|
+
}
|
60
|
+
async events(shipmentId, params, options) {
|
61
|
+
const _shipmentId = shipmentId.id || shipmentId;
|
62
|
+
return this.resources.fetch({ type: 'events' }, `shipments/${_shipmentId}/events`, params, options);
|
63
|
+
}
|
64
|
+
isShipment(resource) {
|
65
|
+
return resource.type && (resource.type === Shipments.TYPE);
|
66
|
+
}
|
67
|
+
relationship(id) {
|
68
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: Shipments.TYPE } : { id: id.id, type: Shipments.TYPE };
|
69
|
+
}
|
70
|
+
type() {
|
71
|
+
return Shipments.TYPE;
|
72
|
+
}
|
73
|
+
}
|
74
|
+
Shipments.TYPE = 'shipments';
|
75
|
+
exports.default = Shipments;
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
3
|
+
import type { Sku } from './skus';
|
4
|
+
import type { Attachment } from './attachments';
|
5
|
+
type ShippingCategoryType = 'shipping_categories';
|
6
|
+
type ShippingCategoryRel = ResourceRel & {
|
7
|
+
type: ShippingCategoryType;
|
8
|
+
};
|
9
|
+
interface ShippingCategory extends Resource {
|
10
|
+
readonly type: ShippingCategoryType;
|
11
|
+
name: string;
|
12
|
+
skus?: Sku[] | null;
|
13
|
+
attachments?: Attachment[] | null;
|
14
|
+
}
|
15
|
+
interface ShippingCategoryCreate extends ResourceCreate {
|
16
|
+
name: string;
|
17
|
+
}
|
18
|
+
interface ShippingCategoryUpdate extends ResourceUpdate {
|
19
|
+
name?: string | null;
|
20
|
+
}
|
21
|
+
declare class ShippingCategories extends ApiResource<ShippingCategory> {
|
22
|
+
static readonly TYPE: ShippingCategoryType;
|
23
|
+
create(resource: ShippingCategoryCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingCategory>;
|
24
|
+
update(resource: ShippingCategoryUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingCategory>;
|
25
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
26
|
+
skus(shippingCategoryId: string | ShippingCategory, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Sku>>;
|
27
|
+
attachments(shippingCategoryId: string | ShippingCategory, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
28
|
+
isShippingCategory(resource: any): resource is ShippingCategory;
|
29
|
+
relationship(id: string | ResourceId | null): ShippingCategoryRel;
|
30
|
+
type(): ShippingCategoryType;
|
31
|
+
}
|
32
|
+
export default ShippingCategories;
|
33
|
+
export type { ShippingCategory, ShippingCategoryCreate, ShippingCategoryUpdate, ShippingCategoryType };
|
@@ -0,0 +1,33 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const resource_1 = require("../resource");
|
4
|
+
class ShippingCategories extends resource_1.ApiResource {
|
5
|
+
async create(resource, params, options) {
|
6
|
+
return this.resources.create({ ...resource, type: ShippingCategories.TYPE }, params, options);
|
7
|
+
}
|
8
|
+
async update(resource, params, options) {
|
9
|
+
return this.resources.update({ ...resource, type: ShippingCategories.TYPE }, params, options);
|
10
|
+
}
|
11
|
+
async delete(id, options) {
|
12
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: ShippingCategories.TYPE } : id, options);
|
13
|
+
}
|
14
|
+
async skus(shippingCategoryId, params, options) {
|
15
|
+
const _shippingCategoryId = shippingCategoryId.id || shippingCategoryId;
|
16
|
+
return this.resources.fetch({ type: 'skus' }, `shipping_categories/${_shippingCategoryId}/skus`, params, options);
|
17
|
+
}
|
18
|
+
async attachments(shippingCategoryId, params, options) {
|
19
|
+
const _shippingCategoryId = shippingCategoryId.id || shippingCategoryId;
|
20
|
+
return this.resources.fetch({ type: 'attachments' }, `shipping_categories/${_shippingCategoryId}/attachments`, params, options);
|
21
|
+
}
|
22
|
+
isShippingCategory(resource) {
|
23
|
+
return resource.type && (resource.type === ShippingCategories.TYPE);
|
24
|
+
}
|
25
|
+
relationship(id) {
|
26
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: ShippingCategories.TYPE } : { id: id.id, type: ShippingCategories.TYPE };
|
27
|
+
}
|
28
|
+
type() {
|
29
|
+
return ShippingCategories.TYPE;
|
30
|
+
}
|
31
|
+
}
|
32
|
+
ShippingCategories.TYPE = 'shipping_categories';
|
33
|
+
exports.default = ShippingCategories;
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { ApiResource, Resource, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
3
|
+
import type { ShippingMethod } from './shipping_methods';
|
4
|
+
import type { Attachment } from './attachments';
|
5
|
+
type ShippingMethodTierType = 'shipping_method_tiers';
|
6
|
+
type ShippingMethodTierRel = ResourceRel & {
|
7
|
+
type: ShippingMethodTierType;
|
8
|
+
};
|
9
|
+
interface ShippingMethodTier extends Resource {
|
10
|
+
readonly type: ShippingMethodTierType;
|
11
|
+
name: string;
|
12
|
+
up_to?: number | null;
|
13
|
+
price_amount_cents: number;
|
14
|
+
price_amount_float?: number | null;
|
15
|
+
formatted_price_amount?: string | null;
|
16
|
+
shipping_method?: ShippingMethod | null;
|
17
|
+
attachments?: Attachment[] | null;
|
18
|
+
}
|
19
|
+
declare class ShippingMethodTiers extends ApiResource<ShippingMethodTier> {
|
20
|
+
static readonly TYPE: ShippingMethodTierType;
|
21
|
+
shipping_method(shippingMethodTierId: string | ShippingMethodTier, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingMethod>;
|
22
|
+
attachments(shippingMethodTierId: string | ShippingMethodTier, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
23
|
+
isShippingMethodTier(resource: any): resource is ShippingMethodTier;
|
24
|
+
relationship(id: string | ResourceId | null): ShippingMethodTierRel;
|
25
|
+
type(): ShippingMethodTierType;
|
26
|
+
}
|
27
|
+
export default ShippingMethodTiers;
|
28
|
+
export type { ShippingMethodTier, ShippingMethodTierType };
|
@@ -0,0 +1,24 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const resource_1 = require("../resource");
|
4
|
+
class ShippingMethodTiers extends resource_1.ApiResource {
|
5
|
+
async shipping_method(shippingMethodTierId, params, options) {
|
6
|
+
const _shippingMethodTierId = shippingMethodTierId.id || shippingMethodTierId;
|
7
|
+
return this.resources.fetch({ type: 'shipping_methods' }, `shipping_method_tiers/${_shippingMethodTierId}/shipping_method`, params, options);
|
8
|
+
}
|
9
|
+
async attachments(shippingMethodTierId, params, options) {
|
10
|
+
const _shippingMethodTierId = shippingMethodTierId.id || shippingMethodTierId;
|
11
|
+
return this.resources.fetch({ type: 'attachments' }, `shipping_method_tiers/${_shippingMethodTierId}/attachments`, params, options);
|
12
|
+
}
|
13
|
+
isShippingMethodTier(resource) {
|
14
|
+
return resource.type && (resource.type === ShippingMethodTiers.TYPE);
|
15
|
+
}
|
16
|
+
relationship(id) {
|
17
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: ShippingMethodTiers.TYPE } : { id: id.id, type: ShippingMethodTiers.TYPE };
|
18
|
+
}
|
19
|
+
type() {
|
20
|
+
return ShippingMethodTiers.TYPE;
|
21
|
+
}
|
22
|
+
}
|
23
|
+
ShippingMethodTiers.TYPE = 'shipping_method_tiers';
|
24
|
+
exports.default = ShippingMethodTiers;
|
@@ -0,0 +1,107 @@
|
|
1
|
+
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
3
|
+
import type { Market, MarketType } from './markets';
|
4
|
+
import type { ShippingZone, ShippingZoneType } from './shipping_zones';
|
5
|
+
import type { ShippingCategory, ShippingCategoryType } from './shipping_categories';
|
6
|
+
import type { StockLocation, StockLocationType } from './stock_locations';
|
7
|
+
import type { DeliveryLeadTime } from './delivery_lead_times';
|
8
|
+
import type { ShippingMethodTier, ShippingMethodTierType } from './shipping_method_tiers';
|
9
|
+
import type { ShippingWeightTier } from './shipping_weight_tiers';
|
10
|
+
import type { Attachment } from './attachments';
|
11
|
+
type ShippingMethodType = 'shipping_methods';
|
12
|
+
type ShippingMethodRel = ResourceRel & {
|
13
|
+
type: ShippingMethodType;
|
14
|
+
};
|
15
|
+
type MarketRel = ResourceRel & {
|
16
|
+
type: MarketType;
|
17
|
+
};
|
18
|
+
type ShippingZoneRel = ResourceRel & {
|
19
|
+
type: ShippingZoneType;
|
20
|
+
};
|
21
|
+
type ShippingCategoryRel = ResourceRel & {
|
22
|
+
type: ShippingCategoryType;
|
23
|
+
};
|
24
|
+
type StockLocationRel = ResourceRel & {
|
25
|
+
type: StockLocationType;
|
26
|
+
};
|
27
|
+
type ShippingMethodTierRel = ResourceRel & {
|
28
|
+
type: ShippingMethodTierType;
|
29
|
+
};
|
30
|
+
interface ShippingMethod extends Resource {
|
31
|
+
readonly type: ShippingMethodType;
|
32
|
+
name: string;
|
33
|
+
scheme?: string | null;
|
34
|
+
currency_code?: string | null;
|
35
|
+
disabled_at?: string | null;
|
36
|
+
price_amount_cents: number;
|
37
|
+
price_amount_float?: number | null;
|
38
|
+
formatted_price_amount?: string | null;
|
39
|
+
free_over_amount_cents?: number | null;
|
40
|
+
free_over_amount_float?: number | null;
|
41
|
+
formatted_free_over_amount?: string | null;
|
42
|
+
price_amount_for_shipment_cents?: number | null;
|
43
|
+
price_amount_for_shipment_float?: number | null;
|
44
|
+
formatted_price_amount_for_shipment?: string | null;
|
45
|
+
min_weight?: number | null;
|
46
|
+
max_weight?: number | null;
|
47
|
+
unit_of_weight?: string | null;
|
48
|
+
market?: Market | null;
|
49
|
+
shipping_zone?: ShippingZone | null;
|
50
|
+
shipping_category?: ShippingCategory | null;
|
51
|
+
stock_location?: StockLocation | null;
|
52
|
+
delivery_lead_time_for_shipment?: DeliveryLeadTime | null;
|
53
|
+
shipping_method_tiers?: ShippingMethodTier[] | null;
|
54
|
+
shipping_weight_tiers?: ShippingWeightTier[] | null;
|
55
|
+
attachments?: Attachment[] | null;
|
56
|
+
}
|
57
|
+
interface ShippingMethodCreate extends ResourceCreate {
|
58
|
+
name: string;
|
59
|
+
scheme?: string | null;
|
60
|
+
currency_code?: string | null;
|
61
|
+
price_amount_cents: number;
|
62
|
+
free_over_amount_cents?: number | null;
|
63
|
+
min_weight?: number | null;
|
64
|
+
max_weight?: number | null;
|
65
|
+
unit_of_weight?: string | null;
|
66
|
+
market?: MarketRel | null;
|
67
|
+
shipping_zone?: ShippingZoneRel | null;
|
68
|
+
shipping_category?: ShippingCategoryRel | null;
|
69
|
+
stock_location?: StockLocationRel | null;
|
70
|
+
shipping_method_tiers?: ShippingMethodTierRel[] | null;
|
71
|
+
}
|
72
|
+
interface ShippingMethodUpdate extends ResourceUpdate {
|
73
|
+
name?: string | null;
|
74
|
+
scheme?: string | null;
|
75
|
+
currency_code?: string | null;
|
76
|
+
_disable?: boolean | null;
|
77
|
+
_enable?: boolean | null;
|
78
|
+
price_amount_cents?: number | null;
|
79
|
+
free_over_amount_cents?: number | null;
|
80
|
+
min_weight?: number | null;
|
81
|
+
max_weight?: number | null;
|
82
|
+
unit_of_weight?: string | null;
|
83
|
+
market?: MarketRel | null;
|
84
|
+
shipping_zone?: ShippingZoneRel | null;
|
85
|
+
shipping_category?: ShippingCategoryRel | null;
|
86
|
+
stock_location?: StockLocationRel | null;
|
87
|
+
shipping_method_tiers?: ShippingMethodTierRel[] | null;
|
88
|
+
}
|
89
|
+
declare class ShippingMethods extends ApiResource<ShippingMethod> {
|
90
|
+
static readonly TYPE: ShippingMethodType;
|
91
|
+
create(resource: ShippingMethodCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingMethod>;
|
92
|
+
update(resource: ShippingMethodUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingMethod>;
|
93
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
94
|
+
market(shippingMethodId: string | ShippingMethod, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
|
95
|
+
shipping_zone(shippingMethodId: string | ShippingMethod, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingZone>;
|
96
|
+
shipping_category(shippingMethodId: string | ShippingMethod, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingCategory>;
|
97
|
+
stock_location(shippingMethodId: string | ShippingMethod, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
|
98
|
+
delivery_lead_time_for_shipment(shippingMethodId: string | ShippingMethod, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<DeliveryLeadTime>;
|
99
|
+
shipping_method_tiers(shippingMethodId: string | ShippingMethod, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ShippingMethodTier>>;
|
100
|
+
shipping_weight_tiers(shippingMethodId: string | ShippingMethod, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ShippingWeightTier>>;
|
101
|
+
attachments(shippingMethodId: string | ShippingMethod, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
102
|
+
isShippingMethod(resource: any): resource is ShippingMethod;
|
103
|
+
relationship(id: string | ResourceId | null): ShippingMethodRel;
|
104
|
+
type(): ShippingMethodType;
|
105
|
+
}
|
106
|
+
export default ShippingMethods;
|
107
|
+
export type { ShippingMethod, ShippingMethodCreate, ShippingMethodUpdate, ShippingMethodType };
|
@@ -0,0 +1,57 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const resource_1 = require("../resource");
|
4
|
+
class ShippingMethods extends resource_1.ApiResource {
|
5
|
+
async create(resource, params, options) {
|
6
|
+
return this.resources.create({ ...resource, type: ShippingMethods.TYPE }, params, options);
|
7
|
+
}
|
8
|
+
async update(resource, params, options) {
|
9
|
+
return this.resources.update({ ...resource, type: ShippingMethods.TYPE }, params, options);
|
10
|
+
}
|
11
|
+
async delete(id, options) {
|
12
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: ShippingMethods.TYPE } : id, options);
|
13
|
+
}
|
14
|
+
async market(shippingMethodId, params, options) {
|
15
|
+
const _shippingMethodId = shippingMethodId.id || shippingMethodId;
|
16
|
+
return this.resources.fetch({ type: 'markets' }, `shipping_methods/${_shippingMethodId}/market`, params, options);
|
17
|
+
}
|
18
|
+
async shipping_zone(shippingMethodId, params, options) {
|
19
|
+
const _shippingMethodId = shippingMethodId.id || shippingMethodId;
|
20
|
+
return this.resources.fetch({ type: 'shipping_zones' }, `shipping_methods/${_shippingMethodId}/shipping_zone`, params, options);
|
21
|
+
}
|
22
|
+
async shipping_category(shippingMethodId, params, options) {
|
23
|
+
const _shippingMethodId = shippingMethodId.id || shippingMethodId;
|
24
|
+
return this.resources.fetch({ type: 'shipping_categories' }, `shipping_methods/${_shippingMethodId}/shipping_category`, params, options);
|
25
|
+
}
|
26
|
+
async stock_location(shippingMethodId, params, options) {
|
27
|
+
const _shippingMethodId = shippingMethodId.id || shippingMethodId;
|
28
|
+
return this.resources.fetch({ type: 'stock_locations' }, `shipping_methods/${_shippingMethodId}/stock_location`, params, options);
|
29
|
+
}
|
30
|
+
async delivery_lead_time_for_shipment(shippingMethodId, params, options) {
|
31
|
+
const _shippingMethodId = shippingMethodId.id || shippingMethodId;
|
32
|
+
return this.resources.fetch({ type: 'delivery_lead_times' }, `shipping_methods/${_shippingMethodId}/delivery_lead_time_for_shipment`, params, options);
|
33
|
+
}
|
34
|
+
async shipping_method_tiers(shippingMethodId, params, options) {
|
35
|
+
const _shippingMethodId = shippingMethodId.id || shippingMethodId;
|
36
|
+
return this.resources.fetch({ type: 'shipping_method_tiers' }, `shipping_methods/${_shippingMethodId}/shipping_method_tiers`, params, options);
|
37
|
+
}
|
38
|
+
async shipping_weight_tiers(shippingMethodId, params, options) {
|
39
|
+
const _shippingMethodId = shippingMethodId.id || shippingMethodId;
|
40
|
+
return this.resources.fetch({ type: 'shipping_weight_tiers' }, `shipping_methods/${_shippingMethodId}/shipping_weight_tiers`, params, options);
|
41
|
+
}
|
42
|
+
async attachments(shippingMethodId, params, options) {
|
43
|
+
const _shippingMethodId = shippingMethodId.id || shippingMethodId;
|
44
|
+
return this.resources.fetch({ type: 'attachments' }, `shipping_methods/${_shippingMethodId}/attachments`, params, options);
|
45
|
+
}
|
46
|
+
isShippingMethod(resource) {
|
47
|
+
return resource.type && (resource.type === ShippingMethods.TYPE);
|
48
|
+
}
|
49
|
+
relationship(id) {
|
50
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: ShippingMethods.TYPE } : { id: id.id, type: ShippingMethods.TYPE };
|
51
|
+
}
|
52
|
+
type() {
|
53
|
+
return ShippingMethods.TYPE;
|
54
|
+
}
|
55
|
+
}
|
56
|
+
ShippingMethods.TYPE = 'shipping_methods';
|
57
|
+
exports.default = ShippingMethods;
|
@@ -0,0 +1,46 @@
|
|
1
|
+
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
3
|
+
import type { ShippingMethod, ShippingMethodType } from './shipping_methods';
|
4
|
+
import type { Attachment } from './attachments';
|
5
|
+
type ShippingWeightTierType = 'shipping_weight_tiers';
|
6
|
+
type ShippingWeightTierRel = ResourceRel & {
|
7
|
+
type: ShippingWeightTierType;
|
8
|
+
};
|
9
|
+
type ShippingMethodRel = ResourceRel & {
|
10
|
+
type: ShippingMethodType;
|
11
|
+
};
|
12
|
+
interface ShippingWeightTier extends Resource {
|
13
|
+
readonly type: ShippingWeightTierType;
|
14
|
+
name: string;
|
15
|
+
up_to?: number | null;
|
16
|
+
price_amount_cents: number;
|
17
|
+
price_amount_float?: number | null;
|
18
|
+
formatted_price_amount?: string | null;
|
19
|
+
shipping_method?: ShippingMethod | null;
|
20
|
+
attachments?: Attachment[] | null;
|
21
|
+
}
|
22
|
+
interface ShippingWeightTierCreate extends ResourceCreate {
|
23
|
+
name: string;
|
24
|
+
up_to?: number | null;
|
25
|
+
price_amount_cents: number;
|
26
|
+
shipping_method: ShippingMethodRel;
|
27
|
+
}
|
28
|
+
interface ShippingWeightTierUpdate extends ResourceUpdate {
|
29
|
+
name?: string | null;
|
30
|
+
up_to?: number | null;
|
31
|
+
price_amount_cents?: number | null;
|
32
|
+
shipping_method?: ShippingMethodRel | null;
|
33
|
+
}
|
34
|
+
declare class ShippingWeightTiers extends ApiResource<ShippingWeightTier> {
|
35
|
+
static readonly TYPE: ShippingWeightTierType;
|
36
|
+
create(resource: ShippingWeightTierCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingWeightTier>;
|
37
|
+
update(resource: ShippingWeightTierUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingWeightTier>;
|
38
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
39
|
+
shipping_method(shippingWeightTierId: string | ShippingWeightTier, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingMethod>;
|
40
|
+
attachments(shippingWeightTierId: string | ShippingWeightTier, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
41
|
+
isShippingWeightTier(resource: any): resource is ShippingWeightTier;
|
42
|
+
relationship(id: string | ResourceId | null): ShippingWeightTierRel;
|
43
|
+
type(): ShippingWeightTierType;
|
44
|
+
}
|
45
|
+
export default ShippingWeightTiers;
|
46
|
+
export type { ShippingWeightTier, ShippingWeightTierCreate, ShippingWeightTierUpdate, ShippingWeightTierType };
|
@@ -0,0 +1,33 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const resource_1 = require("../resource");
|
4
|
+
class ShippingWeightTiers extends resource_1.ApiResource {
|
5
|
+
async create(resource, params, options) {
|
6
|
+
return this.resources.create({ ...resource, type: ShippingWeightTiers.TYPE }, params, options);
|
7
|
+
}
|
8
|
+
async update(resource, params, options) {
|
9
|
+
return this.resources.update({ ...resource, type: ShippingWeightTiers.TYPE }, params, options);
|
10
|
+
}
|
11
|
+
async delete(id, options) {
|
12
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: ShippingWeightTiers.TYPE } : id, options);
|
13
|
+
}
|
14
|
+
async shipping_method(shippingWeightTierId, params, options) {
|
15
|
+
const _shippingWeightTierId = shippingWeightTierId.id || shippingWeightTierId;
|
16
|
+
return this.resources.fetch({ type: 'shipping_methods' }, `shipping_weight_tiers/${_shippingWeightTierId}/shipping_method`, params, options);
|
17
|
+
}
|
18
|
+
async attachments(shippingWeightTierId, params, options) {
|
19
|
+
const _shippingWeightTierId = shippingWeightTierId.id || shippingWeightTierId;
|
20
|
+
return this.resources.fetch({ type: 'attachments' }, `shipping_weight_tiers/${_shippingWeightTierId}/attachments`, params, options);
|
21
|
+
}
|
22
|
+
isShippingWeightTier(resource) {
|
23
|
+
return resource.type && (resource.type === ShippingWeightTiers.TYPE);
|
24
|
+
}
|
25
|
+
relationship(id) {
|
26
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: ShippingWeightTiers.TYPE } : { id: id.id, type: ShippingWeightTiers.TYPE };
|
27
|
+
}
|
28
|
+
type() {
|
29
|
+
return ShippingWeightTiers.TYPE;
|
30
|
+
}
|
31
|
+
}
|
32
|
+
ShippingWeightTiers.TYPE = 'shipping_weight_tiers';
|
33
|
+
exports.default = ShippingWeightTiers;
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
3
|
+
import type { Attachment } from './attachments';
|
4
|
+
type ShippingZoneType = 'shipping_zones';
|
5
|
+
type ShippingZoneRel = ResourceRel & {
|
6
|
+
type: ShippingZoneType;
|
7
|
+
};
|
8
|
+
interface ShippingZone extends Resource {
|
9
|
+
readonly type: ShippingZoneType;
|
10
|
+
name: string;
|
11
|
+
country_code_regex?: string | null;
|
12
|
+
not_country_code_regex?: string | null;
|
13
|
+
state_code_regex?: string | null;
|
14
|
+
not_state_code_regex?: string | null;
|
15
|
+
zip_code_regex?: string | null;
|
16
|
+
not_zip_code_regex?: string | null;
|
17
|
+
attachments?: Attachment[] | null;
|
18
|
+
}
|
19
|
+
interface ShippingZoneCreate extends ResourceCreate {
|
20
|
+
name: string;
|
21
|
+
country_code_regex?: string | null;
|
22
|
+
not_country_code_regex?: string | null;
|
23
|
+
state_code_regex?: string | null;
|
24
|
+
not_state_code_regex?: string | null;
|
25
|
+
zip_code_regex?: string | null;
|
26
|
+
not_zip_code_regex?: string | null;
|
27
|
+
}
|
28
|
+
interface ShippingZoneUpdate extends ResourceUpdate {
|
29
|
+
name?: string | null;
|
30
|
+
country_code_regex?: string | null;
|
31
|
+
not_country_code_regex?: string | null;
|
32
|
+
state_code_regex?: string | null;
|
33
|
+
not_state_code_regex?: string | null;
|
34
|
+
zip_code_regex?: string | null;
|
35
|
+
not_zip_code_regex?: string | null;
|
36
|
+
}
|
37
|
+
declare class ShippingZones extends ApiResource<ShippingZone> {
|
38
|
+
static readonly TYPE: ShippingZoneType;
|
39
|
+
create(resource: ShippingZoneCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingZone>;
|
40
|
+
update(resource: ShippingZoneUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingZone>;
|
41
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
42
|
+
attachments(shippingZoneId: string | ShippingZone, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
43
|
+
isShippingZone(resource: any): resource is ShippingZone;
|
44
|
+
relationship(id: string | ResourceId | null): ShippingZoneRel;
|
45
|
+
type(): ShippingZoneType;
|
46
|
+
}
|
47
|
+
export default ShippingZones;
|
48
|
+
export type { ShippingZone, ShippingZoneCreate, ShippingZoneUpdate, ShippingZoneType };
|
@@ -0,0 +1,29 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const resource_1 = require("../resource");
|
4
|
+
class ShippingZones extends resource_1.ApiResource {
|
5
|
+
async create(resource, params, options) {
|
6
|
+
return this.resources.create({ ...resource, type: ShippingZones.TYPE }, params, options);
|
7
|
+
}
|
8
|
+
async update(resource, params, options) {
|
9
|
+
return this.resources.update({ ...resource, type: ShippingZones.TYPE }, params, options);
|
10
|
+
}
|
11
|
+
async delete(id, options) {
|
12
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: ShippingZones.TYPE } : id, options);
|
13
|
+
}
|
14
|
+
async attachments(shippingZoneId, params, options) {
|
15
|
+
const _shippingZoneId = shippingZoneId.id || shippingZoneId;
|
16
|
+
return this.resources.fetch({ type: 'attachments' }, `shipping_zones/${_shippingZoneId}/attachments`, params, options);
|
17
|
+
}
|
18
|
+
isShippingZone(resource) {
|
19
|
+
return resource.type && (resource.type === ShippingZones.TYPE);
|
20
|
+
}
|
21
|
+
relationship(id) {
|
22
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: ShippingZones.TYPE } : { id: id.id, type: ShippingZones.TYPE };
|
23
|
+
}
|
24
|
+
type() {
|
25
|
+
return ShippingZones.TYPE;
|
26
|
+
}
|
27
|
+
}
|
28
|
+
ShippingZones.TYPE = 'shipping_zones';
|
29
|
+
exports.default = ShippingZones;
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel } from '../resource';
|
2
|
+
import type { QueryParamsRetrieve } from '../query';
|
3
|
+
import type { SkuList, SkuListType } from './sku_lists';
|
4
|
+
import type { Sku, SkuType } from './skus';
|
5
|
+
type SkuListItemType = 'sku_list_items';
|
6
|
+
type SkuListItemRel = ResourceRel & {
|
7
|
+
type: SkuListItemType;
|
8
|
+
};
|
9
|
+
type SkuListRel = ResourceRel & {
|
10
|
+
type: SkuListType;
|
11
|
+
};
|
12
|
+
type SkuRel = ResourceRel & {
|
13
|
+
type: SkuType;
|
14
|
+
};
|
15
|
+
interface SkuListItem extends Resource {
|
16
|
+
readonly type: SkuListItemType;
|
17
|
+
position?: number | null;
|
18
|
+
sku_code?: string | null;
|
19
|
+
quantity?: number | null;
|
20
|
+
sku_list?: SkuList | null;
|
21
|
+
sku?: Sku | null;
|
22
|
+
}
|
23
|
+
interface SkuListItemCreate extends ResourceCreate {
|
24
|
+
position?: number | null;
|
25
|
+
sku_code?: string | null;
|
26
|
+
quantity?: number | null;
|
27
|
+
sku_list: SkuListRel;
|
28
|
+
sku: SkuRel;
|
29
|
+
}
|
30
|
+
interface SkuListItemUpdate extends ResourceUpdate {
|
31
|
+
position?: number | null;
|
32
|
+
sku_code?: string | null;
|
33
|
+
quantity?: number | null;
|
34
|
+
}
|
35
|
+
declare class SkuListItems extends ApiResource<SkuListItem> {
|
36
|
+
static readonly TYPE: SkuListItemType;
|
37
|
+
create(resource: SkuListItemCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListItem>;
|
38
|
+
update(resource: SkuListItemUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListItem>;
|
39
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
40
|
+
sku_list(skuListItemId: string | SkuListItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
41
|
+
sku(skuListItemId: string | SkuListItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
|
42
|
+
isSkuListItem(resource: any): resource is SkuListItem;
|
43
|
+
relationship(id: string | ResourceId | null): SkuListItemRel;
|
44
|
+
type(): SkuListItemType;
|
45
|
+
}
|
46
|
+
export default SkuListItems;
|
47
|
+
export type { SkuListItem, SkuListItemCreate, SkuListItemUpdate, SkuListItemType };
|
@@ -0,0 +1,33 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const resource_1 = require("../resource");
|
4
|
+
class SkuListItems extends resource_1.ApiResource {
|
5
|
+
async create(resource, params, options) {
|
6
|
+
return this.resources.create({ ...resource, type: SkuListItems.TYPE }, params, options);
|
7
|
+
}
|
8
|
+
async update(resource, params, options) {
|
9
|
+
return this.resources.update({ ...resource, type: SkuListItems.TYPE }, params, options);
|
10
|
+
}
|
11
|
+
async delete(id, options) {
|
12
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: SkuListItems.TYPE } : id, options);
|
13
|
+
}
|
14
|
+
async sku_list(skuListItemId, params, options) {
|
15
|
+
const _skuListItemId = skuListItemId.id || skuListItemId;
|
16
|
+
return this.resources.fetch({ type: 'sku_lists' }, `sku_list_items/${_skuListItemId}/sku_list`, params, options);
|
17
|
+
}
|
18
|
+
async sku(skuListItemId, params, options) {
|
19
|
+
const _skuListItemId = skuListItemId.id || skuListItemId;
|
20
|
+
return this.resources.fetch({ type: 'skus' }, `sku_list_items/${_skuListItemId}/sku`, params, options);
|
21
|
+
}
|
22
|
+
isSkuListItem(resource) {
|
23
|
+
return resource.type && (resource.type === SkuListItems.TYPE);
|
24
|
+
}
|
25
|
+
relationship(id) {
|
26
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: SkuListItems.TYPE } : { id: id.id, type: SkuListItems.TYPE };
|
27
|
+
}
|
28
|
+
type() {
|
29
|
+
return SkuListItems.TYPE;
|
30
|
+
}
|
31
|
+
}
|
32
|
+
SkuListItems.TYPE = 'sku_list_items';
|
33
|
+
exports.default = SkuListItems;
|