@commercelayer/sdk 5.0.0-alpha.5 → 5.0.0-beta.1
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 +113 -0
- package/lib/cjs/api.js +355 -0
- package/lib/cjs/client.d.ts +33 -0
- package/lib/cjs/client.js +123 -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 +14 -0
- package/lib/cjs/config.d.ts +11 -0
- package/lib/cjs/config.js +13 -0
- package/lib/cjs/debug.d.ts +3 -0
- package/lib/cjs/debug.js +42 -0
- package/lib/cjs/error.d.ts +28 -0
- package/lib/cjs/error.js +43 -0
- package/lib/cjs/index.d.ts +7 -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 +82 -0
- package/lib/cjs/model.d.ts +111 -0
- package/lib/cjs/model.js +3 -0
- package/lib/cjs/query.d.ts +24 -0
- package/lib/cjs/query.js +51 -0
- package/lib/cjs/resource.d.ts +90 -0
- package/lib/cjs/resource.js +167 -0
- package/lib/cjs/resources/addresses.d.ts +89 -0
- package/lib/cjs/resources/addresses.js +33 -0
- package/lib/cjs/resources/adjustments.d.ts +36 -0
- package/lib/cjs/resources/adjustments.js +29 -0
- package/lib/cjs/resources/adyen_gateways.d.ts +57 -0
- package/lib/cjs/resources/adyen_gateways.js +37 -0
- package/lib/cjs/resources/adyen_payments.d.ts +47 -0
- package/lib/cjs/resources/adyen_payments.js +37 -0
- package/lib/cjs/resources/application.d.ts +21 -0
- package/lib/cjs/resources/application.js +17 -0
- package/lib/cjs/resources/attachments.d.ts +157 -0
- package/lib/cjs/resources/attachments.js +29 -0
- package/lib/cjs/resources/authorizations.d.ts +61 -0
- package/lib/cjs/resources/authorizations.js +39 -0
- package/lib/cjs/resources/avalara_accounts.d.ts +56 -0
- package/lib/cjs/resources/avalara_accounts.js +41 -0
- package/lib/cjs/resources/axerve_gateways.d.ts +44 -0
- package/lib/cjs/resources/axerve_gateways.js +37 -0
- package/lib/cjs/resources/axerve_payments.d.ts +47 -0
- package/lib/cjs/resources/axerve_payments.js +37 -0
- package/lib/cjs/resources/billing_info_validation_rules.d.ts +36 -0
- package/lib/cjs/resources/billing_info_validation_rules.js +37 -0
- package/lib/cjs/resources/bing_geocoders.d.ts +36 -0
- package/lib/cjs/resources/bing_geocoders.js +37 -0
- package/lib/cjs/resources/braintree_gateways.d.ts +57 -0
- package/lib/cjs/resources/braintree_gateways.js +37 -0
- package/lib/cjs/resources/braintree_payments.d.ts +49 -0
- package/lib/cjs/resources/braintree_payments.js +37 -0
- package/lib/cjs/resources/bundles.d.ts +77 -0
- package/lib/cjs/resources/bundles.js +45 -0
- package/lib/cjs/resources/captures.d.ts +52 -0
- package/lib/cjs/resources/captures.js +39 -0
- package/lib/cjs/resources/carrier_accounts.d.ts +27 -0
- package/lib/cjs/resources/carrier_accounts.js +28 -0
- package/lib/cjs/resources/checkout_com_gateways.d.ts +46 -0
- package/lib/cjs/resources/checkout_com_gateways.js +37 -0
- package/lib/cjs/resources/checkout_com_payments.d.ts +60 -0
- package/lib/cjs/resources/checkout_com_payments.js +37 -0
- package/lib/cjs/resources/cleanups.d.ts +37 -0
- package/lib/cjs/resources/cleanups.js +30 -0
- package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +60 -0
- package/lib/cjs/resources/coupon_codes_promotion_rules.js +33 -0
- package/lib/cjs/resources/coupon_recipients.d.ts +45 -0
- package/lib/cjs/resources/coupon_recipients.js +37 -0
- package/lib/cjs/resources/coupons.d.ts +46 -0
- package/lib/cjs/resources/coupons.js +33 -0
- package/lib/cjs/resources/customer_addresses.d.ts +45 -0
- package/lib/cjs/resources/customer_addresses.js +41 -0
- package/lib/cjs/resources/customer_groups.d.ts +37 -0
- package/lib/cjs/resources/customer_groups.js +41 -0
- package/lib/cjs/resources/customer_password_resets.d.ts +37 -0
- package/lib/cjs/resources/customer_password_resets.js +37 -0
- package/lib/cjs/resources/customer_payment_sources.d.ts +79 -0
- package/lib/cjs/resources/customer_payment_sources.js +33 -0
- package/lib/cjs/resources/customer_subscriptions.d.ts +32 -0
- package/lib/cjs/resources/customer_subscriptions.js +37 -0
- package/lib/cjs/resources/customers.d.ts +67 -0
- package/lib/cjs/resources/customers.js +69 -0
- package/lib/cjs/resources/delivery_lead_times.d.ts +52 -0
- package/lib/cjs/resources/delivery_lead_times.js +41 -0
- package/lib/cjs/resources/event_callbacks.d.ts +25 -0
- package/lib/cjs/resources/event_callbacks.js +24 -0
- package/lib/cjs/resources/events.d.ts +25 -0
- package/lib/cjs/resources/events.js +28 -0
- package/lib/cjs/resources/exports.d.ts +41 -0
- package/lib/cjs/resources/exports.js +30 -0
- package/lib/cjs/resources/external_gateways.d.ts +50 -0
- package/lib/cjs/resources/external_gateways.js +37 -0
- package/lib/cjs/resources/external_payments.d.ts +45 -0
- package/lib/cjs/resources/external_payments.js +41 -0
- package/lib/cjs/resources/external_promotions.d.ts +91 -0
- package/lib/cjs/resources/external_promotions.js +53 -0
- package/lib/cjs/resources/external_tax_calculators.d.ts +38 -0
- package/lib/cjs/resources/external_tax_calculators.js +37 -0
- package/lib/cjs/resources/fixed_amount_promotions.d.ts +92 -0
- package/lib/cjs/resources/fixed_amount_promotions.js +53 -0
- package/lib/cjs/resources/fixed_price_promotions.d.ts +103 -0
- package/lib/cjs/resources/fixed_price_promotions.js +61 -0
- package/lib/cjs/resources/free_gift_promotions.d.ts +101 -0
- package/lib/cjs/resources/free_gift_promotions.js +61 -0
- package/lib/cjs/resources/free_shipping_promotions.d.ts +84 -0
- package/lib/cjs/resources/free_shipping_promotions.js +49 -0
- package/lib/cjs/resources/geocoders.d.ts +25 -0
- package/lib/cjs/resources/geocoders.js +28 -0
- package/lib/cjs/resources/gift_card_recipients.d.ts +45 -0
- package/lib/cjs/resources/gift_card_recipients.js +37 -0
- package/lib/cjs/resources/gift_cards.d.ts +86 -0
- package/lib/cjs/resources/gift_cards.js +45 -0
- package/lib/cjs/resources/google_geocoders.d.ts +36 -0
- package/lib/cjs/resources/google_geocoders.js +37 -0
- package/lib/cjs/resources/imports.d.ts +46 -0
- package/lib/cjs/resources/imports.js +30 -0
- package/lib/cjs/resources/in_stock_subscriptions.d.ts +63 -0
- package/lib/cjs/resources/in_stock_subscriptions.js +45 -0
- package/lib/cjs/resources/inventory_models.d.ts +43 -0
- package/lib/cjs/resources/inventory_models.js +41 -0
- package/lib/cjs/resources/inventory_return_locations.d.ts +44 -0
- package/lib/cjs/resources/inventory_return_locations.js +37 -0
- package/lib/cjs/resources/inventory_stock_locations.d.ts +47 -0
- package/lib/cjs/resources/inventory_stock_locations.js +37 -0
- package/lib/cjs/resources/klarna_gateways.d.ts +45 -0
- package/lib/cjs/resources/klarna_gateways.js +37 -0
- package/lib/cjs/resources/klarna_payments.d.ts +47 -0
- package/lib/cjs/resources/klarna_payments.js +37 -0
- package/lib/cjs/resources/line_item_options.d.ts +58 -0
- package/lib/cjs/resources/line_item_options.js +37 -0
- package/lib/cjs/resources/line_items.d.ts +127 -0
- package/lib/cjs/resources/line_items.js +45 -0
- package/lib/cjs/resources/manual_gateways.d.ts +31 -0
- package/lib/cjs/resources/manual_gateways.js +33 -0
- package/lib/cjs/resources/manual_tax_calculators.d.ts +42 -0
- package/lib/cjs/resources/manual_tax_calculators.js +41 -0
- package/lib/cjs/resources/markets.d.ts +89 -0
- package/lib/cjs/resources/markets.js +53 -0
- package/lib/cjs/resources/merchants.d.ts +39 -0
- package/lib/cjs/resources/merchants.js +37 -0
- package/lib/cjs/resources/order_amount_promotion_rules.d.ts +57 -0
- package/lib/cjs/resources/order_amount_promotion_rules.js +29 -0
- package/lib/cjs/resources/order_copies.d.ts +49 -0
- package/lib/cjs/resources/order_copies.js +42 -0
- package/lib/cjs/resources/order_subscriptions.d.ts +71 -0
- package/lib/cjs/resources/order_subscriptions.js +53 -0
- package/lib/cjs/resources/order_validation_rules.d.ts +24 -0
- package/lib/cjs/resources/order_validation_rules.js +28 -0
- package/lib/cjs/resources/orders.d.ts +297 -0
- package/lib/cjs/resources/orders.js +109 -0
- package/lib/cjs/resources/organization.d.ts +32 -0
- package/lib/cjs/resources/organization.js +17 -0
- package/lib/cjs/resources/packages.d.ts +57 -0
- package/lib/cjs/resources/packages.js +41 -0
- package/lib/cjs/resources/parcel_line_items.d.ts +52 -0
- package/lib/cjs/resources/parcel_line_items.js +37 -0
- package/lib/cjs/resources/parcels.d.ts +120 -0
- package/lib/cjs/resources/parcels.js +49 -0
- package/lib/cjs/resources/payment_gateways.d.ts +22 -0
- package/lib/cjs/resources/payment_gateways.js +24 -0
- package/lib/cjs/resources/payment_methods.d.ts +73 -0
- package/lib/cjs/resources/payment_methods.js +41 -0
- package/lib/cjs/resources/paypal_gateways.d.ts +38 -0
- package/lib/cjs/resources/paypal_gateways.js +37 -0
- package/lib/cjs/resources/paypal_payments.d.ts +53 -0
- package/lib/cjs/resources/paypal_payments.js +37 -0
- package/lib/cjs/resources/percentage_discount_promotions.d.ts +101 -0
- package/lib/cjs/resources/percentage_discount_promotions.js +61 -0
- package/lib/cjs/resources/price_lists.d.ts +40 -0
- package/lib/cjs/resources/price_lists.js +37 -0
- package/lib/cjs/resources/price_tiers.d.ts +29 -0
- package/lib/cjs/resources/price_tiers.js +28 -0
- package/lib/cjs/resources/price_volume_tiers.d.ts +47 -0
- package/lib/cjs/resources/price_volume_tiers.js +37 -0
- package/lib/cjs/resources/prices.d.ts +69 -0
- package/lib/cjs/resources/prices.js +49 -0
- package/lib/cjs/resources/promotion_rules.d.ts +25 -0
- package/lib/cjs/resources/promotion_rules.js +20 -0
- package/lib/cjs/resources/promotions.d.ts +42 -0
- package/lib/cjs/resources/promotions.js +40 -0
- package/lib/cjs/resources/refunds.d.ts +38 -0
- package/lib/cjs/resources/refunds.js +32 -0
- package/lib/cjs/resources/return_line_items.d.ts +50 -0
- package/lib/cjs/resources/return_line_items.js +37 -0
- package/lib/cjs/resources/returns.d.ts +76 -0
- package/lib/cjs/resources/returns.js +61 -0
- package/lib/cjs/resources/satispay_gateways.d.ts +40 -0
- package/lib/cjs/resources/satispay_gateways.js +37 -0
- package/lib/cjs/resources/satispay_payments.d.ts +44 -0
- package/lib/cjs/resources/satispay_payments.js +37 -0
- package/lib/cjs/resources/shipments.d.ts +94 -0
- package/lib/cjs/resources/shipments.js +79 -0
- package/lib/cjs/resources/shipping_categories.d.ts +34 -0
- package/lib/cjs/resources/shipping_categories.js +37 -0
- package/lib/cjs/resources/shipping_method_tiers.d.ts +29 -0
- package/lib/cjs/resources/shipping_method_tiers.js +28 -0
- package/lib/cjs/resources/shipping_methods.d.ts +108 -0
- package/lib/cjs/resources/shipping_methods.js +61 -0
- package/lib/cjs/resources/shipping_weight_tiers.d.ts +47 -0
- package/lib/cjs/resources/shipping_weight_tiers.js +37 -0
- package/lib/cjs/resources/shipping_zones.d.ts +49 -0
- package/lib/cjs/resources/shipping_zones.js +33 -0
- package/lib/cjs/resources/sku_list_items.d.ts +48 -0
- package/lib/cjs/resources/sku_list_items.js +37 -0
- package/lib/cjs/resources/sku_list_promotion_rules.d.ts +69 -0
- package/lib/cjs/resources/sku_list_promotion_rules.js +37 -0
- package/lib/cjs/resources/sku_lists.d.ts +61 -0
- package/lib/cjs/resources/sku_lists.js +49 -0
- package/lib/cjs/resources/sku_options.d.ts +57 -0
- package/lib/cjs/resources/sku_options.js +37 -0
- package/lib/cjs/resources/skus.d.ts +79 -0
- package/lib/cjs/resources/skus.js +53 -0
- package/lib/cjs/resources/stock_items.d.ts +50 -0
- package/lib/cjs/resources/stock_items.js +41 -0
- package/lib/cjs/resources/stock_line_items.d.ts +30 -0
- package/lib/cjs/resources/stock_line_items.js +32 -0
- package/lib/cjs/resources/stock_locations.d.ts +58 -0
- package/lib/cjs/resources/stock_locations.js +53 -0
- package/lib/cjs/resources/stock_transfers.d.ts +75 -0
- package/lib/cjs/resources/stock_transfers.js +53 -0
- package/lib/cjs/resources/stripe_gateways.d.ts +42 -0
- package/lib/cjs/resources/stripe_gateways.js +37 -0
- package/lib/cjs/resources/stripe_payments.d.ts +48 -0
- package/lib/cjs/resources/stripe_payments.js +37 -0
- package/lib/cjs/resources/tax_calculators.d.ts +25 -0
- package/lib/cjs/resources/tax_calculators.js +28 -0
- package/lib/cjs/resources/tax_categories.d.ts +60 -0
- package/lib/cjs/resources/tax_categories.js +37 -0
- package/lib/cjs/resources/tax_rules.d.ts +70 -0
- package/lib/cjs/resources/tax_rules.js +33 -0
- package/lib/cjs/resources/taxjar_accounts.d.ts +44 -0
- package/lib/cjs/resources/taxjar_accounts.js +41 -0
- package/lib/cjs/resources/transactions.d.ts +32 -0
- package/lib/cjs/resources/transactions.js +24 -0
- package/lib/cjs/resources/voids.d.ts +38 -0
- package/lib/cjs/resources/voids.js +32 -0
- package/lib/cjs/resources/webhooks.d.ts +44 -0
- package/lib/cjs/resources/webhooks.js +33 -0
- package/lib/cjs/resources/wire_transfers.d.ts +34 -0
- package/lib/cjs/resources/wire_transfers.js +33 -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 +113 -0
- package/lib/esm/api.js +239 -0
- package/lib/esm/client.d.ts +33 -0
- package/lib/esm/client.js +118 -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 +10 -0
- package/lib/esm/config.d.ts +11 -0
- package/lib/esm/config.js +11 -0
- package/lib/esm/debug.d.ts +3 -0
- package/lib/esm/debug.js +40 -0
- package/lib/esm/error.d.ts +28 -0
- package/lib/esm/error.js +38 -0
- package/lib/esm/index.d.ts +7 -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 +75 -0
- package/lib/esm/model.d.ts +111 -0
- package/lib/esm/model.js +2 -0
- package/lib/esm/query.d.ts +24 -0
- package/lib/esm/query.js +45 -0
- package/lib/esm/resource.d.ts +90 -0
- package/lib/esm/resource.js +160 -0
- package/lib/esm/resources/addresses.d.ts +89 -0
- package/lib/esm/resources/addresses.js +31 -0
- package/lib/esm/resources/adjustments.d.ts +36 -0
- package/lib/esm/resources/adjustments.js +27 -0
- package/lib/esm/resources/adyen_gateways.d.ts +57 -0
- package/lib/esm/resources/adyen_gateways.js +35 -0
- package/lib/esm/resources/adyen_payments.d.ts +47 -0
- package/lib/esm/resources/adyen_payments.js +35 -0
- package/lib/esm/resources/application.d.ts +21 -0
- package/lib/esm/resources/application.js +15 -0
- package/lib/esm/resources/attachments.d.ts +157 -0
- package/lib/esm/resources/attachments.js +27 -0
- package/lib/esm/resources/authorizations.d.ts +61 -0
- package/lib/esm/resources/authorizations.js +37 -0
- package/lib/esm/resources/avalara_accounts.d.ts +56 -0
- package/lib/esm/resources/avalara_accounts.js +39 -0
- package/lib/esm/resources/axerve_gateways.d.ts +44 -0
- package/lib/esm/resources/axerve_gateways.js +35 -0
- package/lib/esm/resources/axerve_payments.d.ts +47 -0
- package/lib/esm/resources/axerve_payments.js +35 -0
- package/lib/esm/resources/billing_info_validation_rules.d.ts +36 -0
- package/lib/esm/resources/billing_info_validation_rules.js +35 -0
- package/lib/esm/resources/bing_geocoders.d.ts +36 -0
- package/lib/esm/resources/bing_geocoders.js +35 -0
- package/lib/esm/resources/braintree_gateways.d.ts +57 -0
- package/lib/esm/resources/braintree_gateways.js +35 -0
- package/lib/esm/resources/braintree_payments.d.ts +49 -0
- package/lib/esm/resources/braintree_payments.js +35 -0
- package/lib/esm/resources/bundles.d.ts +77 -0
- package/lib/esm/resources/bundles.js +43 -0
- package/lib/esm/resources/captures.d.ts +52 -0
- package/lib/esm/resources/captures.js +37 -0
- package/lib/esm/resources/carrier_accounts.d.ts +27 -0
- package/lib/esm/resources/carrier_accounts.js +26 -0
- package/lib/esm/resources/checkout_com_gateways.d.ts +46 -0
- package/lib/esm/resources/checkout_com_gateways.js +35 -0
- package/lib/esm/resources/checkout_com_payments.d.ts +60 -0
- package/lib/esm/resources/checkout_com_payments.js +35 -0
- package/lib/esm/resources/cleanups.d.ts +37 -0
- package/lib/esm/resources/cleanups.js +28 -0
- package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +60 -0
- package/lib/esm/resources/coupon_codes_promotion_rules.js +31 -0
- package/lib/esm/resources/coupon_recipients.d.ts +45 -0
- package/lib/esm/resources/coupon_recipients.js +35 -0
- package/lib/esm/resources/coupons.d.ts +46 -0
- package/lib/esm/resources/coupons.js +31 -0
- package/lib/esm/resources/customer_addresses.d.ts +45 -0
- package/lib/esm/resources/customer_addresses.js +39 -0
- package/lib/esm/resources/customer_groups.d.ts +37 -0
- package/lib/esm/resources/customer_groups.js +39 -0
- package/lib/esm/resources/customer_password_resets.d.ts +37 -0
- package/lib/esm/resources/customer_password_resets.js +35 -0
- package/lib/esm/resources/customer_payment_sources.d.ts +79 -0
- package/lib/esm/resources/customer_payment_sources.js +31 -0
- package/lib/esm/resources/customer_subscriptions.d.ts +32 -0
- package/lib/esm/resources/customer_subscriptions.js +35 -0
- package/lib/esm/resources/customers.d.ts +67 -0
- package/lib/esm/resources/customers.js +67 -0
- package/lib/esm/resources/delivery_lead_times.d.ts +52 -0
- package/lib/esm/resources/delivery_lead_times.js +39 -0
- package/lib/esm/resources/event_callbacks.d.ts +25 -0
- package/lib/esm/resources/event_callbacks.js +22 -0
- package/lib/esm/resources/events.d.ts +25 -0
- package/lib/esm/resources/events.js +26 -0
- package/lib/esm/resources/exports.d.ts +41 -0
- package/lib/esm/resources/exports.js +28 -0
- package/lib/esm/resources/external_gateways.d.ts +50 -0
- package/lib/esm/resources/external_gateways.js +35 -0
- package/lib/esm/resources/external_payments.d.ts +45 -0
- package/lib/esm/resources/external_payments.js +39 -0
- package/lib/esm/resources/external_promotions.d.ts +91 -0
- package/lib/esm/resources/external_promotions.js +51 -0
- package/lib/esm/resources/external_tax_calculators.d.ts +38 -0
- package/lib/esm/resources/external_tax_calculators.js +35 -0
- package/lib/esm/resources/fixed_amount_promotions.d.ts +92 -0
- package/lib/esm/resources/fixed_amount_promotions.js +51 -0
- package/lib/esm/resources/fixed_price_promotions.d.ts +103 -0
- package/lib/esm/resources/fixed_price_promotions.js +59 -0
- package/lib/esm/resources/free_gift_promotions.d.ts +101 -0
- package/lib/esm/resources/free_gift_promotions.js +59 -0
- package/lib/esm/resources/free_shipping_promotions.d.ts +84 -0
- package/lib/esm/resources/free_shipping_promotions.js +47 -0
- package/lib/esm/resources/geocoders.d.ts +25 -0
- package/lib/esm/resources/geocoders.js +26 -0
- package/lib/esm/resources/gift_card_recipients.d.ts +45 -0
- package/lib/esm/resources/gift_card_recipients.js +35 -0
- package/lib/esm/resources/gift_cards.d.ts +86 -0
- package/lib/esm/resources/gift_cards.js +43 -0
- package/lib/esm/resources/google_geocoders.d.ts +36 -0
- package/lib/esm/resources/google_geocoders.js +35 -0
- package/lib/esm/resources/imports.d.ts +46 -0
- package/lib/esm/resources/imports.js +28 -0
- package/lib/esm/resources/in_stock_subscriptions.d.ts +63 -0
- package/lib/esm/resources/in_stock_subscriptions.js +43 -0
- package/lib/esm/resources/inventory_models.d.ts +43 -0
- package/lib/esm/resources/inventory_models.js +39 -0
- package/lib/esm/resources/inventory_return_locations.d.ts +44 -0
- package/lib/esm/resources/inventory_return_locations.js +35 -0
- package/lib/esm/resources/inventory_stock_locations.d.ts +47 -0
- package/lib/esm/resources/inventory_stock_locations.js +35 -0
- package/lib/esm/resources/klarna_gateways.d.ts +45 -0
- package/lib/esm/resources/klarna_gateways.js +35 -0
- package/lib/esm/resources/klarna_payments.d.ts +47 -0
- package/lib/esm/resources/klarna_payments.js +35 -0
- package/lib/esm/resources/line_item_options.d.ts +58 -0
- package/lib/esm/resources/line_item_options.js +35 -0
- package/lib/esm/resources/line_items.d.ts +127 -0
- package/lib/esm/resources/line_items.js +43 -0
- package/lib/esm/resources/manual_gateways.d.ts +31 -0
- package/lib/esm/resources/manual_gateways.js +31 -0
- package/lib/esm/resources/manual_tax_calculators.d.ts +42 -0
- package/lib/esm/resources/manual_tax_calculators.js +39 -0
- package/lib/esm/resources/markets.d.ts +89 -0
- package/lib/esm/resources/markets.js +51 -0
- package/lib/esm/resources/merchants.d.ts +39 -0
- package/lib/esm/resources/merchants.js +35 -0
- package/lib/esm/resources/order_amount_promotion_rules.d.ts +57 -0
- package/lib/esm/resources/order_amount_promotion_rules.js +27 -0
- package/lib/esm/resources/order_copies.d.ts +49 -0
- package/lib/esm/resources/order_copies.js +40 -0
- package/lib/esm/resources/order_subscriptions.d.ts +71 -0
- package/lib/esm/resources/order_subscriptions.js +51 -0
- package/lib/esm/resources/order_validation_rules.d.ts +24 -0
- package/lib/esm/resources/order_validation_rules.js +26 -0
- package/lib/esm/resources/orders.d.ts +297 -0
- package/lib/esm/resources/orders.js +107 -0
- package/lib/esm/resources/organization.d.ts +32 -0
- package/lib/esm/resources/organization.js +15 -0
- package/lib/esm/resources/packages.d.ts +57 -0
- package/lib/esm/resources/packages.js +39 -0
- package/lib/esm/resources/parcel_line_items.d.ts +52 -0
- package/lib/esm/resources/parcel_line_items.js +35 -0
- package/lib/esm/resources/parcels.d.ts +120 -0
- package/lib/esm/resources/parcels.js +47 -0
- package/lib/esm/resources/payment_gateways.d.ts +22 -0
- package/lib/esm/resources/payment_gateways.js +22 -0
- package/lib/esm/resources/payment_methods.d.ts +73 -0
- package/lib/esm/resources/payment_methods.js +39 -0
- package/lib/esm/resources/paypal_gateways.d.ts +38 -0
- package/lib/esm/resources/paypal_gateways.js +35 -0
- package/lib/esm/resources/paypal_payments.d.ts +53 -0
- package/lib/esm/resources/paypal_payments.js +35 -0
- package/lib/esm/resources/percentage_discount_promotions.d.ts +101 -0
- package/lib/esm/resources/percentage_discount_promotions.js +59 -0
- package/lib/esm/resources/price_lists.d.ts +40 -0
- package/lib/esm/resources/price_lists.js +35 -0
- package/lib/esm/resources/price_tiers.d.ts +29 -0
- package/lib/esm/resources/price_tiers.js +26 -0
- package/lib/esm/resources/price_volume_tiers.d.ts +47 -0
- package/lib/esm/resources/price_volume_tiers.js +35 -0
- package/lib/esm/resources/prices.d.ts +69 -0
- package/lib/esm/resources/prices.js +47 -0
- package/lib/esm/resources/promotion_rules.d.ts +25 -0
- package/lib/esm/resources/promotion_rules.js +18 -0
- package/lib/esm/resources/promotions.d.ts +42 -0
- package/lib/esm/resources/promotions.js +38 -0
- package/lib/esm/resources/refunds.d.ts +38 -0
- package/lib/esm/resources/refunds.js +30 -0
- package/lib/esm/resources/return_line_items.d.ts +50 -0
- package/lib/esm/resources/return_line_items.js +35 -0
- package/lib/esm/resources/returns.d.ts +76 -0
- package/lib/esm/resources/returns.js +59 -0
- package/lib/esm/resources/satispay_gateways.d.ts +40 -0
- package/lib/esm/resources/satispay_gateways.js +35 -0
- package/lib/esm/resources/satispay_payments.d.ts +44 -0
- package/lib/esm/resources/satispay_payments.js +35 -0
- package/lib/esm/resources/shipments.d.ts +94 -0
- package/lib/esm/resources/shipments.js +77 -0
- package/lib/esm/resources/shipping_categories.d.ts +34 -0
- package/lib/esm/resources/shipping_categories.js +35 -0
- package/lib/esm/resources/shipping_method_tiers.d.ts +29 -0
- package/lib/esm/resources/shipping_method_tiers.js +26 -0
- package/lib/esm/resources/shipping_methods.d.ts +108 -0
- package/lib/esm/resources/shipping_methods.js +59 -0
- package/lib/esm/resources/shipping_weight_tiers.d.ts +47 -0
- package/lib/esm/resources/shipping_weight_tiers.js +35 -0
- package/lib/esm/resources/shipping_zones.d.ts +49 -0
- package/lib/esm/resources/shipping_zones.js +31 -0
- package/lib/esm/resources/sku_list_items.d.ts +48 -0
- package/lib/esm/resources/sku_list_items.js +35 -0
- package/lib/esm/resources/sku_list_promotion_rules.d.ts +69 -0
- package/lib/esm/resources/sku_list_promotion_rules.js +35 -0
- package/lib/esm/resources/sku_lists.d.ts +61 -0
- package/lib/esm/resources/sku_lists.js +47 -0
- package/lib/esm/resources/sku_options.d.ts +57 -0
- package/lib/esm/resources/sku_options.js +35 -0
- package/lib/esm/resources/skus.d.ts +79 -0
- package/lib/esm/resources/skus.js +51 -0
- package/lib/esm/resources/stock_items.d.ts +50 -0
- package/lib/esm/resources/stock_items.js +39 -0
- package/lib/esm/resources/stock_line_items.d.ts +30 -0
- package/lib/esm/resources/stock_line_items.js +30 -0
- package/lib/esm/resources/stock_locations.d.ts +58 -0
- package/lib/esm/resources/stock_locations.js +51 -0
- package/lib/esm/resources/stock_transfers.d.ts +75 -0
- package/lib/esm/resources/stock_transfers.js +51 -0
- package/lib/esm/resources/stripe_gateways.d.ts +42 -0
- package/lib/esm/resources/stripe_gateways.js +35 -0
- package/lib/esm/resources/stripe_payments.d.ts +48 -0
- package/lib/esm/resources/stripe_payments.js +35 -0
- package/lib/esm/resources/tax_calculators.d.ts +25 -0
- package/lib/esm/resources/tax_calculators.js +26 -0
- package/lib/esm/resources/tax_categories.d.ts +60 -0
- package/lib/esm/resources/tax_categories.js +35 -0
- package/lib/esm/resources/tax_rules.d.ts +70 -0
- package/lib/esm/resources/tax_rules.js +31 -0
- package/lib/esm/resources/taxjar_accounts.d.ts +44 -0
- package/lib/esm/resources/taxjar_accounts.js +39 -0
- package/lib/esm/resources/transactions.d.ts +32 -0
- package/lib/esm/resources/transactions.js +22 -0
- package/lib/esm/resources/voids.d.ts +38 -0
- package/lib/esm/resources/voids.js +30 -0
- package/lib/esm/resources/webhooks.d.ts +44 -0
- package/lib/esm/resources/webhooks.js +31 -0
- package/lib/esm/resources/wire_transfers.d.ts +34 -0
- package/lib/esm/resources/wire_transfers.js +31 -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,297 @@
|
|
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 { Customer, CustomerType } from './customers';
|
5
|
+
import type { Address, AddressType } from './addresses';
|
6
|
+
import type { PaymentMethod, PaymentMethodType } from './payment_methods';
|
7
|
+
import type { CustomerPaymentSource } from './customer_payment_sources';
|
8
|
+
import type { Sku } from './skus';
|
9
|
+
import type { Bundle } from './bundles';
|
10
|
+
import type { AdyenPayment, AdyenPaymentType } from './adyen_payments';
|
11
|
+
import type { AxervePayment, AxervePaymentType } from './axerve_payments';
|
12
|
+
import type { BraintreePayment, BraintreePaymentType } from './braintree_payments';
|
13
|
+
import type { CheckoutComPayment, CheckoutComPaymentType } from './checkout_com_payments';
|
14
|
+
import type { ExternalPayment, ExternalPaymentType } from './external_payments';
|
15
|
+
import type { KlarnaPayment, KlarnaPaymentType } from './klarna_payments';
|
16
|
+
import type { PaypalPayment, PaypalPaymentType } from './paypal_payments';
|
17
|
+
import type { SatispayPayment, SatispayPaymentType } from './satispay_payments';
|
18
|
+
import type { StripePayment, StripePaymentType } from './stripe_payments';
|
19
|
+
import type { WireTransfer, WireTransferType } from './wire_transfers';
|
20
|
+
import type { LineItem } from './line_items';
|
21
|
+
import type { Shipment } from './shipments';
|
22
|
+
import type { Authorization } from './authorizations';
|
23
|
+
import type { Void } from './voids';
|
24
|
+
import type { Capture } from './captures';
|
25
|
+
import type { Refund } from './refunds';
|
26
|
+
import type { Return } from './returns';
|
27
|
+
import type { OrderSubscription } from './order_subscriptions';
|
28
|
+
import type { OrderCopy } from './order_copies';
|
29
|
+
import type { Attachment } from './attachments';
|
30
|
+
import type { Event } from './events';
|
31
|
+
type OrderType = 'orders';
|
32
|
+
type OrderRel = ResourceRel & {
|
33
|
+
type: OrderType;
|
34
|
+
};
|
35
|
+
type MarketRel = ResourceRel & {
|
36
|
+
type: MarketType;
|
37
|
+
};
|
38
|
+
type CustomerRel = ResourceRel & {
|
39
|
+
type: CustomerType;
|
40
|
+
};
|
41
|
+
type AddressRel = ResourceRel & {
|
42
|
+
type: AddressType;
|
43
|
+
};
|
44
|
+
type PaymentMethodRel = ResourceRel & {
|
45
|
+
type: PaymentMethodType;
|
46
|
+
};
|
47
|
+
type AdyenPaymentRel = ResourceRel & {
|
48
|
+
type: AdyenPaymentType;
|
49
|
+
};
|
50
|
+
type AxervePaymentRel = ResourceRel & {
|
51
|
+
type: AxervePaymentType;
|
52
|
+
};
|
53
|
+
type BraintreePaymentRel = ResourceRel & {
|
54
|
+
type: BraintreePaymentType;
|
55
|
+
};
|
56
|
+
type CheckoutComPaymentRel = ResourceRel & {
|
57
|
+
type: CheckoutComPaymentType;
|
58
|
+
};
|
59
|
+
type ExternalPaymentRel = ResourceRel & {
|
60
|
+
type: ExternalPaymentType;
|
61
|
+
};
|
62
|
+
type KlarnaPaymentRel = ResourceRel & {
|
63
|
+
type: KlarnaPaymentType;
|
64
|
+
};
|
65
|
+
type PaypalPaymentRel = ResourceRel & {
|
66
|
+
type: PaypalPaymentType;
|
67
|
+
};
|
68
|
+
type SatispayPaymentRel = ResourceRel & {
|
69
|
+
type: SatispayPaymentType;
|
70
|
+
};
|
71
|
+
type StripePaymentRel = ResourceRel & {
|
72
|
+
type: StripePaymentType;
|
73
|
+
};
|
74
|
+
type WireTransferRel = ResourceRel & {
|
75
|
+
type: WireTransferType;
|
76
|
+
};
|
77
|
+
interface Order extends Resource {
|
78
|
+
readonly type: OrderType;
|
79
|
+
number?: number;
|
80
|
+
autorefresh?: boolean;
|
81
|
+
status?: 'draft' | 'pending' | 'placed' | 'approved' | 'cancelled';
|
82
|
+
payment_status?: 'unpaid' | 'authorized' | 'paid' | 'voided' | 'refunded';
|
83
|
+
fulfillment_status?: 'unfulfilled' | 'in_progress' | 'fulfilled';
|
84
|
+
guest?: boolean;
|
85
|
+
editable?: boolean;
|
86
|
+
customer_email?: string;
|
87
|
+
language_code?: string;
|
88
|
+
currency_code?: string;
|
89
|
+
tax_included?: boolean;
|
90
|
+
tax_rate?: number;
|
91
|
+
freight_taxable?: boolean;
|
92
|
+
requires_billing_info?: boolean;
|
93
|
+
country_code?: string;
|
94
|
+
shipping_country_code_lock?: string;
|
95
|
+
coupon_code?: string;
|
96
|
+
gift_card_code?: string;
|
97
|
+
gift_card_or_coupon_code?: string;
|
98
|
+
subtotal_amount_cents?: number;
|
99
|
+
subtotal_amount_float?: number;
|
100
|
+
formatted_subtotal_amount?: string;
|
101
|
+
shipping_amount_cents?: number;
|
102
|
+
shipping_amount_float?: number;
|
103
|
+
formatted_shipping_amount?: string;
|
104
|
+
payment_method_amount_cents?: number;
|
105
|
+
payment_method_amount_float?: number;
|
106
|
+
formatted_payment_method_amount?: string;
|
107
|
+
discount_amount_cents?: number;
|
108
|
+
discount_amount_float?: number;
|
109
|
+
formatted_discount_amount?: string;
|
110
|
+
adjustment_amount_cents?: number;
|
111
|
+
adjustment_amount_float?: number;
|
112
|
+
formatted_adjustment_amount?: string;
|
113
|
+
gift_card_amount_cents?: number;
|
114
|
+
gift_card_amount_float?: number;
|
115
|
+
formatted_gift_card_amount?: string;
|
116
|
+
total_tax_amount_cents?: number;
|
117
|
+
total_tax_amount_float?: number;
|
118
|
+
formatted_total_tax_amount?: string;
|
119
|
+
subtotal_tax_amount_cents?: number;
|
120
|
+
subtotal_tax_amount_float?: number;
|
121
|
+
formatted_subtotal_tax_amount?: string;
|
122
|
+
shipping_tax_amount_cents?: number;
|
123
|
+
shipping_tax_amount_float?: number;
|
124
|
+
formatted_shipping_tax_amount?: string;
|
125
|
+
payment_method_tax_amount_cents?: number;
|
126
|
+
payment_method_tax_amount_float?: number;
|
127
|
+
formatted_payment_method_tax_amount?: string;
|
128
|
+
adjustment_tax_amount_cents?: number;
|
129
|
+
adjustment_tax_amount_float?: number;
|
130
|
+
formatted_adjustment_tax_amount?: string;
|
131
|
+
total_amount_cents?: number;
|
132
|
+
total_amount_float?: number;
|
133
|
+
formatted_total_amount?: string;
|
134
|
+
total_taxable_amount_cents?: number;
|
135
|
+
total_taxable_amount_float?: number;
|
136
|
+
formatted_total_taxable_amount?: string;
|
137
|
+
subtotal_taxable_amount_cents?: number;
|
138
|
+
subtotal_taxable_amount_float?: number;
|
139
|
+
formatted_subtotal_taxable_amount?: string;
|
140
|
+
shipping_taxable_amount_cents?: number;
|
141
|
+
shipping_taxable_amount_float?: number;
|
142
|
+
formatted_shipping_taxable_amount?: string;
|
143
|
+
payment_method_taxable_amount_cents?: number;
|
144
|
+
payment_method_taxable_amount_float?: number;
|
145
|
+
formatted_payment_method_taxable_amount?: string;
|
146
|
+
adjustment_taxable_amount_cents?: number;
|
147
|
+
adjustment_taxable_amount_float?: number;
|
148
|
+
formatted_adjustment_taxable_amount?: string;
|
149
|
+
total_amount_with_taxes_cents?: number;
|
150
|
+
total_amount_with_taxes_float?: number;
|
151
|
+
formatted_total_amount_with_taxes?: string;
|
152
|
+
fees_amount_cents?: number;
|
153
|
+
fees_amount_float?: number;
|
154
|
+
formatted_fees_amount?: string;
|
155
|
+
duty_amount_cents?: number;
|
156
|
+
duty_amount_float?: number;
|
157
|
+
formatted_duty_amount?: string;
|
158
|
+
skus_count?: number;
|
159
|
+
line_item_options_count?: number;
|
160
|
+
shipments_count?: number;
|
161
|
+
tax_calculations_count?: number;
|
162
|
+
payment_source_details?: object;
|
163
|
+
token?: string;
|
164
|
+
cart_url?: string;
|
165
|
+
return_url?: string;
|
166
|
+
terms_url?: string;
|
167
|
+
privacy_url?: string;
|
168
|
+
checkout_url?: string;
|
169
|
+
placed_at?: string;
|
170
|
+
approved_at?: string;
|
171
|
+
cancelled_at?: string;
|
172
|
+
payment_updated_at?: string;
|
173
|
+
fulfillment_updated_at?: string;
|
174
|
+
refreshed_at?: string;
|
175
|
+
archived_at?: string;
|
176
|
+
expires_at?: string;
|
177
|
+
market?: Market;
|
178
|
+
customer?: Customer;
|
179
|
+
shipping_address?: Address;
|
180
|
+
billing_address?: Address;
|
181
|
+
available_payment_methods?: PaymentMethod[];
|
182
|
+
available_customer_payment_sources?: CustomerPaymentSource[];
|
183
|
+
available_free_skus?: Sku[];
|
184
|
+
available_free_bundles?: Bundle[];
|
185
|
+
payment_method?: PaymentMethod;
|
186
|
+
payment_source?: AdyenPayment | AxervePayment | BraintreePayment | CheckoutComPayment | ExternalPayment | KlarnaPayment | PaypalPayment | SatispayPayment | StripePayment | WireTransfer;
|
187
|
+
line_items?: LineItem[];
|
188
|
+
shipments?: Shipment[];
|
189
|
+
transactions?: Array<Authorization | Void | Capture | Refund>;
|
190
|
+
authorizations?: Authorization[];
|
191
|
+
captures?: Capture[];
|
192
|
+
voids?: Void[];
|
193
|
+
refunds?: Refund[];
|
194
|
+
returns?: Return[];
|
195
|
+
order_subscriptions?: OrderSubscription[];
|
196
|
+
order_copies?: OrderCopy[];
|
197
|
+
attachments?: Attachment[];
|
198
|
+
events?: Event[];
|
199
|
+
}
|
200
|
+
interface OrderCreate extends ResourceCreate {
|
201
|
+
autorefresh?: boolean;
|
202
|
+
guest?: boolean;
|
203
|
+
customer_email?: string;
|
204
|
+
customer_password?: string;
|
205
|
+
language_code?: string;
|
206
|
+
shipping_country_code_lock?: string;
|
207
|
+
coupon_code?: string;
|
208
|
+
gift_card_code?: string;
|
209
|
+
gift_card_or_coupon_code?: string;
|
210
|
+
cart_url?: string;
|
211
|
+
return_url?: string;
|
212
|
+
terms_url?: string;
|
213
|
+
privacy_url?: string;
|
214
|
+
market?: MarketRel;
|
215
|
+
customer?: CustomerRel;
|
216
|
+
shipping_address?: AddressRel;
|
217
|
+
billing_address?: AddressRel;
|
218
|
+
payment_method?: PaymentMethodRel;
|
219
|
+
payment_source?: AdyenPaymentRel | AxervePaymentRel | BraintreePaymentRel | CheckoutComPaymentRel | ExternalPaymentRel | KlarnaPaymentRel | PaypalPaymentRel | SatispayPaymentRel | StripePaymentRel | WireTransferRel;
|
220
|
+
}
|
221
|
+
interface OrderUpdate extends ResourceUpdate {
|
222
|
+
autorefresh?: boolean;
|
223
|
+
guest?: boolean;
|
224
|
+
customer_email?: string;
|
225
|
+
customer_password?: string;
|
226
|
+
language_code?: string;
|
227
|
+
shipping_country_code_lock?: string;
|
228
|
+
coupon_code?: string;
|
229
|
+
gift_card_code?: string;
|
230
|
+
gift_card_or_coupon_code?: string;
|
231
|
+
cart_url?: string;
|
232
|
+
return_url?: string;
|
233
|
+
terms_url?: string;
|
234
|
+
privacy_url?: string;
|
235
|
+
_archive?: boolean;
|
236
|
+
_unarchive?: boolean;
|
237
|
+
_place?: boolean;
|
238
|
+
_cancel?: boolean;
|
239
|
+
_approve?: boolean;
|
240
|
+
_approve_and_capture?: boolean;
|
241
|
+
_authorize?: boolean;
|
242
|
+
_authorization_amount_cents?: number;
|
243
|
+
_capture?: boolean;
|
244
|
+
_refund?: boolean;
|
245
|
+
_update_taxes?: boolean;
|
246
|
+
_nullify_payment_source?: boolean;
|
247
|
+
_billing_address_clone_id?: string;
|
248
|
+
_shipping_address_clone_id?: string;
|
249
|
+
_customer_payment_source_id?: string;
|
250
|
+
_shipping_address_same_as_billing?: boolean;
|
251
|
+
_billing_address_same_as_shipping?: boolean;
|
252
|
+
_commit_invoice?: boolean;
|
253
|
+
_refund_invoice?: boolean;
|
254
|
+
_save_payment_source_to_customer_wallet?: boolean;
|
255
|
+
_save_shipping_address_to_customer_address_book?: boolean;
|
256
|
+
_save_billing_address_to_customer_address_book?: boolean;
|
257
|
+
_refresh?: boolean;
|
258
|
+
_validate?: boolean;
|
259
|
+
market?: MarketRel;
|
260
|
+
customer?: CustomerRel;
|
261
|
+
shipping_address?: AddressRel;
|
262
|
+
billing_address?: AddressRel;
|
263
|
+
payment_method?: PaymentMethodRel;
|
264
|
+
payment_source?: AdyenPaymentRel | AxervePaymentRel | BraintreePaymentRel | CheckoutComPaymentRel | ExternalPaymentRel | KlarnaPaymentRel | PaypalPaymentRel | SatispayPaymentRel | StripePaymentRel | WireTransferRel;
|
265
|
+
}
|
266
|
+
declare class Orders extends ApiResource<Order> {
|
267
|
+
static readonly TYPE: OrderType;
|
268
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Order>>;
|
269
|
+
create(resource: OrderCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
270
|
+
update(resource: OrderUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
271
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
272
|
+
market(orderId: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
|
273
|
+
customer(orderId: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Customer>;
|
274
|
+
shipping_address(orderId: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Address>;
|
275
|
+
billing_address(orderId: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Address>;
|
276
|
+
available_payment_methods(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>>;
|
277
|
+
available_customer_payment_sources(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<CustomerPaymentSource>>;
|
278
|
+
available_free_skus(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Sku>>;
|
279
|
+
available_free_bundles(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Bundle>>;
|
280
|
+
payment_method(orderId: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentMethod>;
|
281
|
+
line_items(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<LineItem>>;
|
282
|
+
shipments(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Shipment>>;
|
283
|
+
authorizations(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Authorization>>;
|
284
|
+
captures(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Capture>>;
|
285
|
+
voids(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Void>>;
|
286
|
+
refunds(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Refund>>;
|
287
|
+
returns(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Return>>;
|
288
|
+
order_subscriptions(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<OrderSubscription>>;
|
289
|
+
order_copies(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<OrderCopy>>;
|
290
|
+
attachments(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
291
|
+
events(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
292
|
+
isOrder(resource: any): resource is Order;
|
293
|
+
relationship(id: string | ResourceId | null): OrderRel;
|
294
|
+
type(): OrderType;
|
295
|
+
}
|
296
|
+
export default Orders;
|
297
|
+
export type { Order, OrderCreate, OrderUpdate, OrderType };
|
@@ -0,0 +1,107 @@
|
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
class Orders extends ApiResource {
|
3
|
+
// static readonly PATH = 'orders'
|
4
|
+
async list(params, options) {
|
5
|
+
return this.resources.list({ type: Orders.TYPE }, params, options);
|
6
|
+
}
|
7
|
+
async create(resource, params, options) {
|
8
|
+
return this.resources.create(Object.assign(Object.assign({}, resource), { type: Orders.TYPE }), params, options);
|
9
|
+
}
|
10
|
+
async update(resource, params, options) {
|
11
|
+
return this.resources.update(Object.assign(Object.assign({}, resource), { type: Orders.TYPE }), params, options);
|
12
|
+
}
|
13
|
+
async delete(id, options) {
|
14
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: Orders.TYPE } : id, options);
|
15
|
+
}
|
16
|
+
async market(orderId, params, options) {
|
17
|
+
const _orderId = orderId.id || orderId;
|
18
|
+
return this.resources.fetch({ type: 'markets' }, `orders/${_orderId}/market`, params, options);
|
19
|
+
}
|
20
|
+
async customer(orderId, params, options) {
|
21
|
+
const _orderId = orderId.id || orderId;
|
22
|
+
return this.resources.fetch({ type: 'customers' }, `orders/${_orderId}/customer`, params, options);
|
23
|
+
}
|
24
|
+
async shipping_address(orderId, params, options) {
|
25
|
+
const _orderId = orderId.id || orderId;
|
26
|
+
return this.resources.fetch({ type: 'addresses' }, `orders/${_orderId}/shipping_address`, params, options);
|
27
|
+
}
|
28
|
+
async billing_address(orderId, params, options) {
|
29
|
+
const _orderId = orderId.id || orderId;
|
30
|
+
return this.resources.fetch({ type: 'addresses' }, `orders/${_orderId}/billing_address`, params, options);
|
31
|
+
}
|
32
|
+
async available_payment_methods(orderId, params, options) {
|
33
|
+
const _orderId = orderId.id || orderId;
|
34
|
+
return this.resources.fetch({ type: 'payment_methods' }, `orders/${_orderId}/available_payment_methods`, params, options);
|
35
|
+
}
|
36
|
+
async available_customer_payment_sources(orderId, params, options) {
|
37
|
+
const _orderId = orderId.id || orderId;
|
38
|
+
return this.resources.fetch({ type: 'customer_payment_sources' }, `orders/${_orderId}/available_customer_payment_sources`, params, options);
|
39
|
+
}
|
40
|
+
async available_free_skus(orderId, params, options) {
|
41
|
+
const _orderId = orderId.id || orderId;
|
42
|
+
return this.resources.fetch({ type: 'skus' }, `orders/${_orderId}/available_free_skus`, params, options);
|
43
|
+
}
|
44
|
+
async available_free_bundles(orderId, params, options) {
|
45
|
+
const _orderId = orderId.id || orderId;
|
46
|
+
return this.resources.fetch({ type: 'bundles' }, `orders/${_orderId}/available_free_bundles`, params, options);
|
47
|
+
}
|
48
|
+
async payment_method(orderId, params, options) {
|
49
|
+
const _orderId = orderId.id || orderId;
|
50
|
+
return this.resources.fetch({ type: 'payment_methods' }, `orders/${_orderId}/payment_method`, params, options);
|
51
|
+
}
|
52
|
+
async line_items(orderId, params, options) {
|
53
|
+
const _orderId = orderId.id || orderId;
|
54
|
+
return this.resources.fetch({ type: 'line_items' }, `orders/${_orderId}/line_items`, params, options);
|
55
|
+
}
|
56
|
+
async shipments(orderId, params, options) {
|
57
|
+
const _orderId = orderId.id || orderId;
|
58
|
+
return this.resources.fetch({ type: 'shipments' }, `orders/${_orderId}/shipments`, params, options);
|
59
|
+
}
|
60
|
+
async authorizations(orderId, params, options) {
|
61
|
+
const _orderId = orderId.id || orderId;
|
62
|
+
return this.resources.fetch({ type: 'authorizations' }, `orders/${_orderId}/authorizations`, params, options);
|
63
|
+
}
|
64
|
+
async captures(orderId, params, options) {
|
65
|
+
const _orderId = orderId.id || orderId;
|
66
|
+
return this.resources.fetch({ type: 'captures' }, `orders/${_orderId}/captures`, params, options);
|
67
|
+
}
|
68
|
+
async voids(orderId, params, options) {
|
69
|
+
const _orderId = orderId.id || orderId;
|
70
|
+
return this.resources.fetch({ type: 'voids' }, `orders/${_orderId}/voids`, params, options);
|
71
|
+
}
|
72
|
+
async refunds(orderId, params, options) {
|
73
|
+
const _orderId = orderId.id || orderId;
|
74
|
+
return this.resources.fetch({ type: 'refunds' }, `orders/${_orderId}/refunds`, params, options);
|
75
|
+
}
|
76
|
+
async returns(orderId, params, options) {
|
77
|
+
const _orderId = orderId.id || orderId;
|
78
|
+
return this.resources.fetch({ type: 'returns' }, `orders/${_orderId}/returns`, params, options);
|
79
|
+
}
|
80
|
+
async order_subscriptions(orderId, params, options) {
|
81
|
+
const _orderId = orderId.id || orderId;
|
82
|
+
return this.resources.fetch({ type: 'order_subscriptions' }, `orders/${_orderId}/order_subscriptions`, params, options);
|
83
|
+
}
|
84
|
+
async order_copies(orderId, params, options) {
|
85
|
+
const _orderId = orderId.id || orderId;
|
86
|
+
return this.resources.fetch({ type: 'order_copies' }, `orders/${_orderId}/order_copies`, params, options);
|
87
|
+
}
|
88
|
+
async attachments(orderId, params, options) {
|
89
|
+
const _orderId = orderId.id || orderId;
|
90
|
+
return this.resources.fetch({ type: 'attachments' }, `orders/${_orderId}/attachments`, params, options);
|
91
|
+
}
|
92
|
+
async events(orderId, params, options) {
|
93
|
+
const _orderId = orderId.id || orderId;
|
94
|
+
return this.resources.fetch({ type: 'events' }, `orders/${_orderId}/events`, params, options);
|
95
|
+
}
|
96
|
+
isOrder(resource) {
|
97
|
+
return resource.type && (resource.type === Orders.TYPE);
|
98
|
+
}
|
99
|
+
relationship(id) {
|
100
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: Orders.TYPE } : { id: id.id, type: Orders.TYPE };
|
101
|
+
}
|
102
|
+
type() {
|
103
|
+
return Orders.TYPE;
|
104
|
+
}
|
105
|
+
}
|
106
|
+
Orders.TYPE = 'orders';
|
107
|
+
export default Orders;
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import { ApiSingleton, Resource, ResourceId, ResourceRel } from '../resource';
|
2
|
+
type OrganizationType = 'organization';
|
3
|
+
type OrganizationRel = ResourceRel & {
|
4
|
+
type: OrganizationType;
|
5
|
+
};
|
6
|
+
interface Organization extends Resource {
|
7
|
+
readonly type: OrganizationType;
|
8
|
+
name?: string;
|
9
|
+
slug?: string;
|
10
|
+
domain?: string;
|
11
|
+
support_phone?: string;
|
12
|
+
support_email?: string;
|
13
|
+
logo_url?: string;
|
14
|
+
favicon_url?: string;
|
15
|
+
primary_color?: string;
|
16
|
+
contrast_color?: string;
|
17
|
+
gtm_id?: string;
|
18
|
+
gtm_id_test?: string;
|
19
|
+
discount_disabled?: boolean;
|
20
|
+
account_disabled?: boolean;
|
21
|
+
acceptance_disabled?: boolean;
|
22
|
+
max_concurrent_promotions?: number;
|
23
|
+
max_concurrent_imports?: number;
|
24
|
+
}
|
25
|
+
declare class Organizations extends ApiSingleton<Organization> {
|
26
|
+
static readonly TYPE: OrganizationType;
|
27
|
+
isOrganization(resource: any): resource is Organization;
|
28
|
+
relationship(id: string | ResourceId | null): OrganizationRel;
|
29
|
+
type(): OrganizationType;
|
30
|
+
}
|
31
|
+
export default Organizations;
|
32
|
+
export type { Organization, OrganizationType };
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { ApiSingleton } from '../resource';
|
2
|
+
class Organizations extends ApiSingleton {
|
3
|
+
// static readonly PATH = 'organization'
|
4
|
+
isOrganization(resource) {
|
5
|
+
return resource.type && (resource.type === Organizations.TYPE);
|
6
|
+
}
|
7
|
+
relationship(id) {
|
8
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: Organizations.TYPE } : { id: id.id, type: Organizations.TYPE };
|
9
|
+
}
|
10
|
+
type() {
|
11
|
+
return Organizations.TYPE;
|
12
|
+
}
|
13
|
+
}
|
14
|
+
Organizations.TYPE = 'organization';
|
15
|
+
export default Organizations;
|
@@ -0,0 +1,57 @@
|
|
1
|
+
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
3
|
+
import type { StockLocation, StockLocationType } from './stock_locations';
|
4
|
+
import type { Parcel } from './parcels';
|
5
|
+
import type { Attachment } from './attachments';
|
6
|
+
type PackageType = 'packages';
|
7
|
+
type PackageRel = ResourceRel & {
|
8
|
+
type: PackageType;
|
9
|
+
};
|
10
|
+
type StockLocationRel = ResourceRel & {
|
11
|
+
type: StockLocationType;
|
12
|
+
};
|
13
|
+
interface Package extends Resource {
|
14
|
+
readonly type: PackageType;
|
15
|
+
name?: string;
|
16
|
+
code?: string;
|
17
|
+
length?: number;
|
18
|
+
width?: number;
|
19
|
+
height?: number;
|
20
|
+
unit_of_length?: string;
|
21
|
+
stock_location?: StockLocation;
|
22
|
+
parcels?: Parcel[];
|
23
|
+
attachments?: Attachment[];
|
24
|
+
}
|
25
|
+
interface PackageCreate extends ResourceCreate {
|
26
|
+
name: string;
|
27
|
+
code?: string;
|
28
|
+
length: number;
|
29
|
+
width: number;
|
30
|
+
height: number;
|
31
|
+
unit_of_length: string;
|
32
|
+
stock_location: StockLocationRel;
|
33
|
+
}
|
34
|
+
interface PackageUpdate extends ResourceUpdate {
|
35
|
+
name?: string;
|
36
|
+
code?: string;
|
37
|
+
length?: number;
|
38
|
+
width?: number;
|
39
|
+
height?: number;
|
40
|
+
unit_of_length?: string;
|
41
|
+
stock_location?: StockLocationRel;
|
42
|
+
}
|
43
|
+
declare class Packages extends ApiResource<Package> {
|
44
|
+
static readonly TYPE: PackageType;
|
45
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Package>>;
|
46
|
+
create(resource: PackageCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Package>;
|
47
|
+
update(resource: PackageUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Package>;
|
48
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
49
|
+
stock_location(packageId: string | Package, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
|
50
|
+
parcels(packageId: string | Package, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Parcel>>;
|
51
|
+
attachments(packageId: string | Package, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
52
|
+
isPackage(resource: any): resource is Package;
|
53
|
+
relationship(id: string | ResourceId | null): PackageRel;
|
54
|
+
type(): PackageType;
|
55
|
+
}
|
56
|
+
export default Packages;
|
57
|
+
export type { Package, PackageCreate, PackageUpdate, PackageType };
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
class Packages extends ApiResource {
|
3
|
+
// static readonly PATH = 'packages'
|
4
|
+
async list(params, options) {
|
5
|
+
return this.resources.list({ type: Packages.TYPE }, params, options);
|
6
|
+
}
|
7
|
+
async create(resource, params, options) {
|
8
|
+
return this.resources.create(Object.assign(Object.assign({}, resource), { type: Packages.TYPE }), params, options);
|
9
|
+
}
|
10
|
+
async update(resource, params, options) {
|
11
|
+
return this.resources.update(Object.assign(Object.assign({}, resource), { type: Packages.TYPE }), params, options);
|
12
|
+
}
|
13
|
+
async delete(id, options) {
|
14
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: Packages.TYPE } : id, options);
|
15
|
+
}
|
16
|
+
async stock_location(packageId, params, options) {
|
17
|
+
const _packageId = packageId.id || packageId;
|
18
|
+
return this.resources.fetch({ type: 'stock_locations' }, `packages/${_packageId}/stock_location`, params, options);
|
19
|
+
}
|
20
|
+
async parcels(packageId, params, options) {
|
21
|
+
const _packageId = packageId.id || packageId;
|
22
|
+
return this.resources.fetch({ type: 'parcels' }, `packages/${_packageId}/parcels`, params, options);
|
23
|
+
}
|
24
|
+
async attachments(packageId, params, options) {
|
25
|
+
const _packageId = packageId.id || packageId;
|
26
|
+
return this.resources.fetch({ type: 'attachments' }, `packages/${_packageId}/attachments`, params, options);
|
27
|
+
}
|
28
|
+
isPackage(resource) {
|
29
|
+
return resource.type && (resource.type === Packages.TYPE);
|
30
|
+
}
|
31
|
+
relationship(id) {
|
32
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: Packages.TYPE } : { id: id.id, type: Packages.TYPE };
|
33
|
+
}
|
34
|
+
type() {
|
35
|
+
return Packages.TYPE;
|
36
|
+
}
|
37
|
+
}
|
38
|
+
Packages.TYPE = 'packages';
|
39
|
+
export default Packages;
|
@@ -0,0 +1,52 @@
|
|
1
|
+
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
3
|
+
import type { Parcel, ParcelType } from './parcels';
|
4
|
+
import type { StockLineItem, StockLineItemType } from './stock_line_items';
|
5
|
+
type ParcelLineItemType = 'parcel_line_items';
|
6
|
+
type ParcelLineItemRel = ResourceRel & {
|
7
|
+
type: ParcelLineItemType;
|
8
|
+
};
|
9
|
+
type ParcelRel = ResourceRel & {
|
10
|
+
type: ParcelType;
|
11
|
+
};
|
12
|
+
type StockLineItemRel = ResourceRel & {
|
13
|
+
type: StockLineItemType;
|
14
|
+
};
|
15
|
+
interface ParcelLineItem extends Resource {
|
16
|
+
readonly type: ParcelLineItemType;
|
17
|
+
sku_code?: string;
|
18
|
+
quantity?: number;
|
19
|
+
name?: string;
|
20
|
+
image_url?: string;
|
21
|
+
parcel?: Parcel;
|
22
|
+
stock_line_item?: StockLineItem;
|
23
|
+
/**
|
24
|
+
* @deprecated This field should not be used as it may be removed in the future without notice
|
25
|
+
*/
|
26
|
+
shipment_line_item?: object;
|
27
|
+
}
|
28
|
+
interface ParcelLineItemCreate extends ResourceCreate {
|
29
|
+
sku_code?: string;
|
30
|
+
quantity: number;
|
31
|
+
parcel: ParcelRel;
|
32
|
+
stock_line_item: StockLineItemRel;
|
33
|
+
/**
|
34
|
+
* @deprecated This field should not be used as it may be removed in the future without notice
|
35
|
+
*/
|
36
|
+
shipment_line_item?: object;
|
37
|
+
}
|
38
|
+
type ParcelLineItemUpdate = ResourceUpdate;
|
39
|
+
declare class ParcelLineItems extends ApiResource<ParcelLineItem> {
|
40
|
+
static readonly TYPE: ParcelLineItemType;
|
41
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ParcelLineItem>>;
|
42
|
+
create(resource: ParcelLineItemCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ParcelLineItem>;
|
43
|
+
update(resource: ParcelLineItemUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ParcelLineItem>;
|
44
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
45
|
+
parcel(parcelLineItemId: string | ParcelLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Parcel>;
|
46
|
+
stock_line_item(parcelLineItemId: string | ParcelLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLineItem>;
|
47
|
+
isParcelLineItem(resource: any): resource is ParcelLineItem;
|
48
|
+
relationship(id: string | ResourceId | null): ParcelLineItemRel;
|
49
|
+
type(): ParcelLineItemType;
|
50
|
+
}
|
51
|
+
export default ParcelLineItems;
|
52
|
+
export type { ParcelLineItem, ParcelLineItemCreate, ParcelLineItemUpdate, ParcelLineItemType };
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
class ParcelLineItems extends ApiResource {
|
3
|
+
// static readonly PATH = 'parcel_line_items'
|
4
|
+
async list(params, options) {
|
5
|
+
return this.resources.list({ type: ParcelLineItems.TYPE }, params, options);
|
6
|
+
}
|
7
|
+
async create(resource, params, options) {
|
8
|
+
return this.resources.create(Object.assign(Object.assign({}, resource), { type: ParcelLineItems.TYPE }), params, options);
|
9
|
+
}
|
10
|
+
async update(resource, params, options) {
|
11
|
+
return this.resources.update(Object.assign(Object.assign({}, resource), { type: ParcelLineItems.TYPE }), params, options);
|
12
|
+
}
|
13
|
+
async delete(id, options) {
|
14
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: ParcelLineItems.TYPE } : id, options);
|
15
|
+
}
|
16
|
+
async parcel(parcelLineItemId, params, options) {
|
17
|
+
const _parcelLineItemId = parcelLineItemId.id || parcelLineItemId;
|
18
|
+
return this.resources.fetch({ type: 'parcels' }, `parcel_line_items/${_parcelLineItemId}/parcel`, params, options);
|
19
|
+
}
|
20
|
+
async stock_line_item(parcelLineItemId, params, options) {
|
21
|
+
const _parcelLineItemId = parcelLineItemId.id || parcelLineItemId;
|
22
|
+
return this.resources.fetch({ type: 'stock_line_items' }, `parcel_line_items/${_parcelLineItemId}/stock_line_item`, params, options);
|
23
|
+
}
|
24
|
+
isParcelLineItem(resource) {
|
25
|
+
return resource.type && (resource.type === ParcelLineItems.TYPE);
|
26
|
+
}
|
27
|
+
relationship(id) {
|
28
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: ParcelLineItems.TYPE } : { id: id.id, type: ParcelLineItems.TYPE };
|
29
|
+
}
|
30
|
+
type() {
|
31
|
+
return ParcelLineItems.TYPE;
|
32
|
+
}
|
33
|
+
}
|
34
|
+
ParcelLineItems.TYPE = 'parcel_line_items';
|
35
|
+
export default ParcelLineItems;
|