@commercelayer/sdk 5.0.0-alpha.5 → 5.0.0-beta.2
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 +122 -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 +11 -0
- package/lib/cjs/config.js +13 -0
- package/lib/cjs/debug.d.ts +3 -0
- package/lib/cjs/debug.js +39 -0
- package/lib/cjs/error.d.ts +28 -0
- package/lib/cjs/error.js +42 -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 +117 -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 +11 -0
- package/lib/esm/config.js +11 -0
- package/lib/esm/debug.d.ts +3 -0
- package/lib/esm/debug.js +37 -0
- package/lib/esm/error.d.ts +28 -0
- package/lib/esm/error.js +37 -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,108 @@
|
|
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;
|
34
|
+
currency_code?: string;
|
35
|
+
disabled_at?: string;
|
36
|
+
price_amount_cents: number;
|
37
|
+
price_amount_float?: number;
|
38
|
+
formatted_price_amount?: string;
|
39
|
+
free_over_amount_cents?: number;
|
40
|
+
free_over_amount_float?: number;
|
41
|
+
formatted_free_over_amount?: string;
|
42
|
+
price_amount_for_shipment_cents?: number;
|
43
|
+
price_amount_for_shipment_float?: number;
|
44
|
+
formatted_price_amount_for_shipment?: string;
|
45
|
+
min_weight?: number;
|
46
|
+
max_weight?: number;
|
47
|
+
unit_of_weight?: string;
|
48
|
+
market?: Market;
|
49
|
+
shipping_zone?: ShippingZone;
|
50
|
+
shipping_category?: ShippingCategory;
|
51
|
+
stock_location?: StockLocation;
|
52
|
+
delivery_lead_time_for_shipment?: DeliveryLeadTime;
|
53
|
+
shipping_method_tiers?: ShippingMethodTier[];
|
54
|
+
shipping_weight_tiers?: ShippingWeightTier[];
|
55
|
+
attachments?: Attachment[];
|
56
|
+
}
|
57
|
+
interface ShippingMethodCreate extends ResourceCreate {
|
58
|
+
name: string;
|
59
|
+
scheme?: string;
|
60
|
+
currency_code?: string;
|
61
|
+
price_amount_cents: number;
|
62
|
+
free_over_amount_cents?: number;
|
63
|
+
min_weight?: number;
|
64
|
+
max_weight?: number;
|
65
|
+
unit_of_weight?: string;
|
66
|
+
market?: MarketRel;
|
67
|
+
shipping_zone?: ShippingZoneRel;
|
68
|
+
shipping_category?: ShippingCategoryRel;
|
69
|
+
stock_location?: StockLocationRel;
|
70
|
+
shipping_method_tiers?: ShippingMethodTierRel[];
|
71
|
+
}
|
72
|
+
interface ShippingMethodUpdate extends ResourceUpdate {
|
73
|
+
name: string;
|
74
|
+
scheme?: string;
|
75
|
+
currency_code?: string;
|
76
|
+
_disable?: boolean;
|
77
|
+
_enable?: boolean;
|
78
|
+
price_amount_cents: number;
|
79
|
+
free_over_amount_cents?: number;
|
80
|
+
min_weight?: number;
|
81
|
+
max_weight?: number;
|
82
|
+
unit_of_weight?: string;
|
83
|
+
market?: MarketRel;
|
84
|
+
shipping_zone?: ShippingZoneRel;
|
85
|
+
shipping_category?: ShippingCategoryRel;
|
86
|
+
stock_location?: StockLocationRel;
|
87
|
+
shipping_method_tiers?: ShippingMethodTierRel[];
|
88
|
+
}
|
89
|
+
declare class ShippingMethods extends ApiResource<ShippingMethod> {
|
90
|
+
static readonly TYPE: ShippingMethodType;
|
91
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ShippingMethod>>;
|
92
|
+
create(resource: ShippingMethodCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingMethod>;
|
93
|
+
update(resource: ShippingMethodUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingMethod>;
|
94
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
95
|
+
market(shippingMethodId: string | ShippingMethod, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
|
96
|
+
shipping_zone(shippingMethodId: string | ShippingMethod, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingZone>;
|
97
|
+
shipping_category(shippingMethodId: string | ShippingMethod, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingCategory>;
|
98
|
+
stock_location(shippingMethodId: string | ShippingMethod, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
|
99
|
+
delivery_lead_time_for_shipment(shippingMethodId: string | ShippingMethod, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<DeliveryLeadTime>;
|
100
|
+
shipping_method_tiers(shippingMethodId: string | ShippingMethod, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ShippingMethodTier>>;
|
101
|
+
shipping_weight_tiers(shippingMethodId: string | ShippingMethod, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ShippingWeightTier>>;
|
102
|
+
attachments(shippingMethodId: string | ShippingMethod, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
103
|
+
isShippingMethod(resource: any): resource is ShippingMethod;
|
104
|
+
relationship(id: string | ResourceId | null): ShippingMethodRel;
|
105
|
+
type(): ShippingMethodType;
|
106
|
+
}
|
107
|
+
export default ShippingMethods;
|
108
|
+
export type { ShippingMethod, ShippingMethodCreate, ShippingMethodUpdate, ShippingMethodType };
|
@@ -0,0 +1,59 @@
|
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
class ShippingMethods extends ApiResource {
|
3
|
+
// static readonly PATH = 'shipping_methods'
|
4
|
+
async list(params, options) {
|
5
|
+
return this.resources.list({ type: ShippingMethods.TYPE }, params, options);
|
6
|
+
}
|
7
|
+
async create(resource, params, options) {
|
8
|
+
return this.resources.create(Object.assign(Object.assign({}, resource), { type: ShippingMethods.TYPE }), params, options);
|
9
|
+
}
|
10
|
+
async update(resource, params, options) {
|
11
|
+
return this.resources.update(Object.assign(Object.assign({}, resource), { type: ShippingMethods.TYPE }), params, options);
|
12
|
+
}
|
13
|
+
async delete(id, options) {
|
14
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: ShippingMethods.TYPE } : id, options);
|
15
|
+
}
|
16
|
+
async market(shippingMethodId, params, options) {
|
17
|
+
const _shippingMethodId = shippingMethodId.id || shippingMethodId;
|
18
|
+
return this.resources.fetch({ type: 'markets' }, `shipping_methods/${_shippingMethodId}/market`, params, options);
|
19
|
+
}
|
20
|
+
async shipping_zone(shippingMethodId, params, options) {
|
21
|
+
const _shippingMethodId = shippingMethodId.id || shippingMethodId;
|
22
|
+
return this.resources.fetch({ type: 'shipping_zones' }, `shipping_methods/${_shippingMethodId}/shipping_zone`, params, options);
|
23
|
+
}
|
24
|
+
async shipping_category(shippingMethodId, params, options) {
|
25
|
+
const _shippingMethodId = shippingMethodId.id || shippingMethodId;
|
26
|
+
return this.resources.fetch({ type: 'shipping_categories' }, `shipping_methods/${_shippingMethodId}/shipping_category`, params, options);
|
27
|
+
}
|
28
|
+
async stock_location(shippingMethodId, params, options) {
|
29
|
+
const _shippingMethodId = shippingMethodId.id || shippingMethodId;
|
30
|
+
return this.resources.fetch({ type: 'stock_locations' }, `shipping_methods/${_shippingMethodId}/stock_location`, params, options);
|
31
|
+
}
|
32
|
+
async delivery_lead_time_for_shipment(shippingMethodId, params, options) {
|
33
|
+
const _shippingMethodId = shippingMethodId.id || shippingMethodId;
|
34
|
+
return this.resources.fetch({ type: 'delivery_lead_times' }, `shipping_methods/${_shippingMethodId}/delivery_lead_time_for_shipment`, params, options);
|
35
|
+
}
|
36
|
+
async shipping_method_tiers(shippingMethodId, params, options) {
|
37
|
+
const _shippingMethodId = shippingMethodId.id || shippingMethodId;
|
38
|
+
return this.resources.fetch({ type: 'shipping_method_tiers' }, `shipping_methods/${_shippingMethodId}/shipping_method_tiers`, params, options);
|
39
|
+
}
|
40
|
+
async shipping_weight_tiers(shippingMethodId, params, options) {
|
41
|
+
const _shippingMethodId = shippingMethodId.id || shippingMethodId;
|
42
|
+
return this.resources.fetch({ type: 'shipping_weight_tiers' }, `shipping_methods/${_shippingMethodId}/shipping_weight_tiers`, params, options);
|
43
|
+
}
|
44
|
+
async attachments(shippingMethodId, params, options) {
|
45
|
+
const _shippingMethodId = shippingMethodId.id || shippingMethodId;
|
46
|
+
return this.resources.fetch({ type: 'attachments' }, `shipping_methods/${_shippingMethodId}/attachments`, params, options);
|
47
|
+
}
|
48
|
+
isShippingMethod(resource) {
|
49
|
+
return resource.type && (resource.type === ShippingMethods.TYPE);
|
50
|
+
}
|
51
|
+
relationship(id) {
|
52
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: ShippingMethods.TYPE } : { id: id.id, type: ShippingMethods.TYPE };
|
53
|
+
}
|
54
|
+
type() {
|
55
|
+
return ShippingMethods.TYPE;
|
56
|
+
}
|
57
|
+
}
|
58
|
+
ShippingMethods.TYPE = 'shipping_methods';
|
59
|
+
export default ShippingMethods;
|
@@ -0,0 +1,47 @@
|
|
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;
|
16
|
+
price_amount_cents: number;
|
17
|
+
price_amount_float?: number;
|
18
|
+
formatted_price_amount?: string;
|
19
|
+
shipping_method?: ShippingMethod;
|
20
|
+
attachments?: Attachment[];
|
21
|
+
}
|
22
|
+
interface ShippingWeightTierCreate extends ResourceCreate {
|
23
|
+
name: string;
|
24
|
+
up_to?: number;
|
25
|
+
price_amount_cents: number;
|
26
|
+
shipping_method: ShippingMethodRel;
|
27
|
+
}
|
28
|
+
interface ShippingWeightTierUpdate extends ResourceUpdate {
|
29
|
+
name: string;
|
30
|
+
up_to?: number;
|
31
|
+
price_amount_cents: number;
|
32
|
+
shipping_method?: ShippingMethodRel;
|
33
|
+
}
|
34
|
+
declare class ShippingWeightTiers extends ApiResource<ShippingWeightTier> {
|
35
|
+
static readonly TYPE: ShippingWeightTierType;
|
36
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ShippingWeightTier>>;
|
37
|
+
create(resource: ShippingWeightTierCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingWeightTier>;
|
38
|
+
update(resource: ShippingWeightTierUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingWeightTier>;
|
39
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
40
|
+
shipping_method(shippingWeightTierId: string | ShippingWeightTier, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingMethod>;
|
41
|
+
attachments(shippingWeightTierId: string | ShippingWeightTier, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
42
|
+
isShippingWeightTier(resource: any): resource is ShippingWeightTier;
|
43
|
+
relationship(id: string | ResourceId | null): ShippingWeightTierRel;
|
44
|
+
type(): ShippingWeightTierType;
|
45
|
+
}
|
46
|
+
export default ShippingWeightTiers;
|
47
|
+
export type { ShippingWeightTier, ShippingWeightTierCreate, ShippingWeightTierUpdate, ShippingWeightTierType };
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
class ShippingWeightTiers extends ApiResource {
|
3
|
+
// static readonly PATH = 'shipping_weight_tiers'
|
4
|
+
async list(params, options) {
|
5
|
+
return this.resources.list({ type: ShippingWeightTiers.TYPE }, params, options);
|
6
|
+
}
|
7
|
+
async create(resource, params, options) {
|
8
|
+
return this.resources.create(Object.assign(Object.assign({}, resource), { type: ShippingWeightTiers.TYPE }), params, options);
|
9
|
+
}
|
10
|
+
async update(resource, params, options) {
|
11
|
+
return this.resources.update(Object.assign(Object.assign({}, resource), { type: ShippingWeightTiers.TYPE }), params, options);
|
12
|
+
}
|
13
|
+
async delete(id, options) {
|
14
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: ShippingWeightTiers.TYPE } : id, options);
|
15
|
+
}
|
16
|
+
async shipping_method(shippingWeightTierId, params, options) {
|
17
|
+
const _shippingWeightTierId = shippingWeightTierId.id || shippingWeightTierId;
|
18
|
+
return this.resources.fetch({ type: 'shipping_methods' }, `shipping_weight_tiers/${_shippingWeightTierId}/shipping_method`, params, options);
|
19
|
+
}
|
20
|
+
async attachments(shippingWeightTierId, params, options) {
|
21
|
+
const _shippingWeightTierId = shippingWeightTierId.id || shippingWeightTierId;
|
22
|
+
return this.resources.fetch({ type: 'attachments' }, `shipping_weight_tiers/${_shippingWeightTierId}/attachments`, params, options);
|
23
|
+
}
|
24
|
+
isShippingWeightTier(resource) {
|
25
|
+
return resource.type && (resource.type === ShippingWeightTiers.TYPE);
|
26
|
+
}
|
27
|
+
relationship(id) {
|
28
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: ShippingWeightTiers.TYPE } : { id: id.id, type: ShippingWeightTiers.TYPE };
|
29
|
+
}
|
30
|
+
type() {
|
31
|
+
return ShippingWeightTiers.TYPE;
|
32
|
+
}
|
33
|
+
}
|
34
|
+
ShippingWeightTiers.TYPE = 'shipping_weight_tiers';
|
35
|
+
export default ShippingWeightTiers;
|
@@ -0,0 +1,49 @@
|
|
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;
|
12
|
+
not_country_code_regex?: string;
|
13
|
+
state_code_regex?: string;
|
14
|
+
not_state_code_regex?: string;
|
15
|
+
zip_code_regex?: string;
|
16
|
+
not_zip_code_regex?: string;
|
17
|
+
attachments?: Attachment[];
|
18
|
+
}
|
19
|
+
interface ShippingZoneCreate extends ResourceCreate {
|
20
|
+
name: string;
|
21
|
+
country_code_regex?: string;
|
22
|
+
not_country_code_regex?: string;
|
23
|
+
state_code_regex?: string;
|
24
|
+
not_state_code_regex?: string;
|
25
|
+
zip_code_regex?: string;
|
26
|
+
not_zip_code_regex?: string;
|
27
|
+
}
|
28
|
+
interface ShippingZoneUpdate extends ResourceUpdate {
|
29
|
+
name: string;
|
30
|
+
country_code_regex?: string;
|
31
|
+
not_country_code_regex?: string;
|
32
|
+
state_code_regex?: string;
|
33
|
+
not_state_code_regex?: string;
|
34
|
+
zip_code_regex?: string;
|
35
|
+
not_zip_code_regex?: string;
|
36
|
+
}
|
37
|
+
declare class ShippingZones extends ApiResource<ShippingZone> {
|
38
|
+
static readonly TYPE: ShippingZoneType;
|
39
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ShippingZone>>;
|
40
|
+
create(resource: ShippingZoneCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingZone>;
|
41
|
+
update(resource: ShippingZoneUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingZone>;
|
42
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
43
|
+
attachments(shippingZoneId: string | ShippingZone, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
44
|
+
isShippingZone(resource: any): resource is ShippingZone;
|
45
|
+
relationship(id: string | ResourceId | null): ShippingZoneRel;
|
46
|
+
type(): ShippingZoneType;
|
47
|
+
}
|
48
|
+
export default ShippingZones;
|
49
|
+
export type { ShippingZone, ShippingZoneCreate, ShippingZoneUpdate, ShippingZoneType };
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
class ShippingZones extends ApiResource {
|
3
|
+
// static readonly PATH = 'shipping_zones'
|
4
|
+
async list(params, options) {
|
5
|
+
return this.resources.list({ type: ShippingZones.TYPE }, params, options);
|
6
|
+
}
|
7
|
+
async create(resource, params, options) {
|
8
|
+
return this.resources.create(Object.assign(Object.assign({}, resource), { type: ShippingZones.TYPE }), params, options);
|
9
|
+
}
|
10
|
+
async update(resource, params, options) {
|
11
|
+
return this.resources.update(Object.assign(Object.assign({}, resource), { type: ShippingZones.TYPE }), params, options);
|
12
|
+
}
|
13
|
+
async delete(id, options) {
|
14
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: ShippingZones.TYPE } : id, options);
|
15
|
+
}
|
16
|
+
async attachments(shippingZoneId, params, options) {
|
17
|
+
const _shippingZoneId = shippingZoneId.id || shippingZoneId;
|
18
|
+
return this.resources.fetch({ type: 'attachments' }, `shipping_zones/${_shippingZoneId}/attachments`, params, options);
|
19
|
+
}
|
20
|
+
isShippingZone(resource) {
|
21
|
+
return resource.type && (resource.type === ShippingZones.TYPE);
|
22
|
+
}
|
23
|
+
relationship(id) {
|
24
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: ShippingZones.TYPE } : { id: id.id, type: ShippingZones.TYPE };
|
25
|
+
}
|
26
|
+
type() {
|
27
|
+
return ShippingZones.TYPE;
|
28
|
+
}
|
29
|
+
}
|
30
|
+
ShippingZones.TYPE = 'shipping_zones';
|
31
|
+
export default ShippingZones;
|
@@ -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 { 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;
|
18
|
+
sku_code?: string;
|
19
|
+
quantity?: number;
|
20
|
+
sku_list?: SkuList;
|
21
|
+
sku?: Sku;
|
22
|
+
}
|
23
|
+
interface SkuListItemCreate extends ResourceCreate {
|
24
|
+
position?: number;
|
25
|
+
sku_code?: string;
|
26
|
+
quantity?: number;
|
27
|
+
sku_list: SkuListRel;
|
28
|
+
sku: SkuRel;
|
29
|
+
}
|
30
|
+
interface SkuListItemUpdate extends ResourceUpdate {
|
31
|
+
position?: number;
|
32
|
+
sku_code?: string;
|
33
|
+
quantity?: number;
|
34
|
+
}
|
35
|
+
declare class SkuListItems extends ApiResource<SkuListItem> {
|
36
|
+
static readonly TYPE: SkuListItemType;
|
37
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<SkuListItem>>;
|
38
|
+
create(resource: SkuListItemCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListItem>;
|
39
|
+
update(resource: SkuListItemUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListItem>;
|
40
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
41
|
+
sku_list(skuListItemId: string | SkuListItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
42
|
+
sku(skuListItemId: string | SkuListItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
|
43
|
+
isSkuListItem(resource: any): resource is SkuListItem;
|
44
|
+
relationship(id: string | ResourceId | null): SkuListItemRel;
|
45
|
+
type(): SkuListItemType;
|
46
|
+
}
|
47
|
+
export default SkuListItems;
|
48
|
+
export type { SkuListItem, SkuListItemCreate, SkuListItemUpdate, SkuListItemType };
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
class SkuListItems extends ApiResource {
|
3
|
+
// static readonly PATH = 'sku_list_items'
|
4
|
+
async list(params, options) {
|
5
|
+
return this.resources.list({ type: SkuListItems.TYPE }, params, options);
|
6
|
+
}
|
7
|
+
async create(resource, params, options) {
|
8
|
+
return this.resources.create(Object.assign(Object.assign({}, resource), { type: SkuListItems.TYPE }), params, options);
|
9
|
+
}
|
10
|
+
async update(resource, params, options) {
|
11
|
+
return this.resources.update(Object.assign(Object.assign({}, resource), { type: SkuListItems.TYPE }), params, options);
|
12
|
+
}
|
13
|
+
async delete(id, options) {
|
14
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: SkuListItems.TYPE } : id, options);
|
15
|
+
}
|
16
|
+
async sku_list(skuListItemId, params, options) {
|
17
|
+
const _skuListItemId = skuListItemId.id || skuListItemId;
|
18
|
+
return this.resources.fetch({ type: 'sku_lists' }, `sku_list_items/${_skuListItemId}/sku_list`, params, options);
|
19
|
+
}
|
20
|
+
async sku(skuListItemId, params, options) {
|
21
|
+
const _skuListItemId = skuListItemId.id || skuListItemId;
|
22
|
+
return this.resources.fetch({ type: 'skus' }, `sku_list_items/${_skuListItemId}/sku`, params, options);
|
23
|
+
}
|
24
|
+
isSkuListItem(resource) {
|
25
|
+
return resource.type && (resource.type === SkuListItems.TYPE);
|
26
|
+
}
|
27
|
+
relationship(id) {
|
28
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: SkuListItems.TYPE } : { id: id.id, type: SkuListItems.TYPE };
|
29
|
+
}
|
30
|
+
type() {
|
31
|
+
return SkuListItems.TYPE;
|
32
|
+
}
|
33
|
+
}
|
34
|
+
SkuListItems.TYPE = 'sku_list_items';
|
35
|
+
export default SkuListItems;
|
@@ -0,0 +1,69 @@
|
|
1
|
+
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
3
|
+
import type { PercentageDiscountPromotion, PercentageDiscountPromotionType } from './percentage_discount_promotions';
|
4
|
+
import type { FreeShippingPromotion, FreeShippingPromotionType } from './free_shipping_promotions';
|
5
|
+
import type { FreeGiftPromotion, FreeGiftPromotionType } from './free_gift_promotions';
|
6
|
+
import type { FixedPricePromotion, FixedPricePromotionType } from './fixed_price_promotions';
|
7
|
+
import type { ExternalPromotion, ExternalPromotionType } from './external_promotions';
|
8
|
+
import type { FixedAmountPromotion, FixedAmountPromotionType } from './fixed_amount_promotions';
|
9
|
+
import type { SkuList, SkuListType } from './sku_lists';
|
10
|
+
import type { Sku } from './skus';
|
11
|
+
type SkuListPromotionRuleType = 'sku_list_promotion_rules';
|
12
|
+
type SkuListPromotionRuleRel = ResourceRel & {
|
13
|
+
type: SkuListPromotionRuleType;
|
14
|
+
};
|
15
|
+
type PercentageDiscountPromotionRel = ResourceRel & {
|
16
|
+
type: PercentageDiscountPromotionType;
|
17
|
+
};
|
18
|
+
type FreeShippingPromotionRel = ResourceRel & {
|
19
|
+
type: FreeShippingPromotionType;
|
20
|
+
};
|
21
|
+
type FreeGiftPromotionRel = ResourceRel & {
|
22
|
+
type: FreeGiftPromotionType;
|
23
|
+
};
|
24
|
+
type FixedPricePromotionRel = ResourceRel & {
|
25
|
+
type: FixedPricePromotionType;
|
26
|
+
};
|
27
|
+
type ExternalPromotionRel = ResourceRel & {
|
28
|
+
type: ExternalPromotionType;
|
29
|
+
};
|
30
|
+
type FixedAmountPromotionRel = ResourceRel & {
|
31
|
+
type: FixedAmountPromotionType;
|
32
|
+
};
|
33
|
+
type SkuListRel = ResourceRel & {
|
34
|
+
type: SkuListType;
|
35
|
+
};
|
36
|
+
interface SkuListPromotionRule extends Resource {
|
37
|
+
readonly type: SkuListPromotionRuleType;
|
38
|
+
all_skus?: boolean;
|
39
|
+
min_quantity?: number;
|
40
|
+
promotion?: PercentageDiscountPromotion | FreeShippingPromotion | FreeGiftPromotion | FixedPricePromotion | ExternalPromotion | FixedAmountPromotion;
|
41
|
+
sku_list?: SkuList;
|
42
|
+
skus?: Sku[];
|
43
|
+
}
|
44
|
+
interface SkuListPromotionRuleCreate extends ResourceCreate {
|
45
|
+
all_skus?: boolean;
|
46
|
+
min_quantity?: number;
|
47
|
+
promotion: PercentageDiscountPromotionRel | FreeShippingPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel | FixedAmountPromotionRel;
|
48
|
+
sku_list?: SkuListRel;
|
49
|
+
}
|
50
|
+
interface SkuListPromotionRuleUpdate extends ResourceUpdate {
|
51
|
+
all_skus?: boolean;
|
52
|
+
min_quantity?: number;
|
53
|
+
promotion?: PercentageDiscountPromotionRel | FreeShippingPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel | FixedAmountPromotionRel;
|
54
|
+
sku_list?: SkuListRel;
|
55
|
+
}
|
56
|
+
declare class SkuListPromotionRules extends ApiResource<SkuListPromotionRule> {
|
57
|
+
static readonly TYPE: SkuListPromotionRuleType;
|
58
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<SkuListPromotionRule>>;
|
59
|
+
create(resource: SkuListPromotionRuleCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
60
|
+
update(resource: SkuListPromotionRuleUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
61
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
62
|
+
sku_list(skuListPromotionRuleId: string | SkuListPromotionRule, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
63
|
+
skus(skuListPromotionRuleId: string | SkuListPromotionRule, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Sku>>;
|
64
|
+
isSkuListPromotionRule(resource: any): resource is SkuListPromotionRule;
|
65
|
+
relationship(id: string | ResourceId | null): SkuListPromotionRuleRel;
|
66
|
+
type(): SkuListPromotionRuleType;
|
67
|
+
}
|
68
|
+
export default SkuListPromotionRules;
|
69
|
+
export type { SkuListPromotionRule, SkuListPromotionRuleCreate, SkuListPromotionRuleUpdate, SkuListPromotionRuleType };
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
class SkuListPromotionRules extends ApiResource {
|
3
|
+
// static readonly PATH = 'sku_list_promotion_rules'
|
4
|
+
async list(params, options) {
|
5
|
+
return this.resources.list({ type: SkuListPromotionRules.TYPE }, params, options);
|
6
|
+
}
|
7
|
+
async create(resource, params, options) {
|
8
|
+
return this.resources.create(Object.assign(Object.assign({}, resource), { type: SkuListPromotionRules.TYPE }), params, options);
|
9
|
+
}
|
10
|
+
async update(resource, params, options) {
|
11
|
+
return this.resources.update(Object.assign(Object.assign({}, resource), { type: SkuListPromotionRules.TYPE }), params, options);
|
12
|
+
}
|
13
|
+
async delete(id, options) {
|
14
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: SkuListPromotionRules.TYPE } : id, options);
|
15
|
+
}
|
16
|
+
async sku_list(skuListPromotionRuleId, params, options) {
|
17
|
+
const _skuListPromotionRuleId = skuListPromotionRuleId.id || skuListPromotionRuleId;
|
18
|
+
return this.resources.fetch({ type: 'sku_lists' }, `sku_list_promotion_rules/${_skuListPromotionRuleId}/sku_list`, params, options);
|
19
|
+
}
|
20
|
+
async skus(skuListPromotionRuleId, params, options) {
|
21
|
+
const _skuListPromotionRuleId = skuListPromotionRuleId.id || skuListPromotionRuleId;
|
22
|
+
return this.resources.fetch({ type: 'skus' }, `sku_list_promotion_rules/${_skuListPromotionRuleId}/skus`, params, options);
|
23
|
+
}
|
24
|
+
isSkuListPromotionRule(resource) {
|
25
|
+
return resource.type && (resource.type === SkuListPromotionRules.TYPE);
|
26
|
+
}
|
27
|
+
relationship(id) {
|
28
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: SkuListPromotionRules.TYPE } : { id: id.id, type: SkuListPromotionRules.TYPE };
|
29
|
+
}
|
30
|
+
type() {
|
31
|
+
return SkuListPromotionRules.TYPE;
|
32
|
+
}
|
33
|
+
}
|
34
|
+
SkuListPromotionRules.TYPE = 'sku_list_promotion_rules';
|
35
|
+
export default SkuListPromotionRules;
|
@@ -0,0 +1,61 @@
|
|
1
|
+
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
3
|
+
import type { Customer, CustomerType } from './customers';
|
4
|
+
import type { Sku } from './skus';
|
5
|
+
import type { SkuListItem } from './sku_list_items';
|
6
|
+
import type { Bundle } from './bundles';
|
7
|
+
import type { Attachment } from './attachments';
|
8
|
+
type SkuListType = 'sku_lists';
|
9
|
+
type SkuListRel = ResourceRel & {
|
10
|
+
type: SkuListType;
|
11
|
+
};
|
12
|
+
type CustomerRel = ResourceRel & {
|
13
|
+
type: CustomerType;
|
14
|
+
};
|
15
|
+
interface SkuList extends Resource {
|
16
|
+
readonly type: SkuListType;
|
17
|
+
name: string;
|
18
|
+
slug: string;
|
19
|
+
description?: string;
|
20
|
+
image_url?: string;
|
21
|
+
manual?: boolean;
|
22
|
+
sku_code_regex?: string;
|
23
|
+
customer?: Customer;
|
24
|
+
skus?: Sku[];
|
25
|
+
sku_list_items?: SkuListItem[];
|
26
|
+
bundles?: Bundle[];
|
27
|
+
attachments?: Attachment[];
|
28
|
+
}
|
29
|
+
interface SkuListCreate extends ResourceCreate {
|
30
|
+
name: string;
|
31
|
+
description?: string;
|
32
|
+
image_url?: string;
|
33
|
+
manual?: boolean;
|
34
|
+
sku_code_regex?: string;
|
35
|
+
customer?: CustomerRel;
|
36
|
+
}
|
37
|
+
interface SkuListUpdate extends ResourceUpdate {
|
38
|
+
name: string;
|
39
|
+
description?: string;
|
40
|
+
image_url?: string;
|
41
|
+
manual?: boolean;
|
42
|
+
sku_code_regex?: string;
|
43
|
+
customer?: CustomerRel;
|
44
|
+
}
|
45
|
+
declare class SkuLists extends ApiResource<SkuList> {
|
46
|
+
static readonly TYPE: SkuListType;
|
47
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<SkuList>>;
|
48
|
+
create(resource: SkuListCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
49
|
+
update(resource: SkuListUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
50
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
51
|
+
customer(skuListId: string | SkuList, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Customer>;
|
52
|
+
skus(skuListId: string | SkuList, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Sku>>;
|
53
|
+
sku_list_items(skuListId: string | SkuList, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<SkuListItem>>;
|
54
|
+
bundles(skuListId: string | SkuList, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Bundle>>;
|
55
|
+
attachments(skuListId: string | SkuList, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
56
|
+
isSkuList(resource: any): resource is SkuList;
|
57
|
+
relationship(id: string | ResourceId | null): SkuListRel;
|
58
|
+
type(): SkuListType;
|
59
|
+
}
|
60
|
+
export default SkuLists;
|
61
|
+
export type { SkuList, SkuListCreate, SkuListUpdate, SkuListType };
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
class SkuLists extends ApiResource {
|
3
|
+
// static readonly PATH = 'sku_lists'
|
4
|
+
async list(params, options) {
|
5
|
+
return this.resources.list({ type: SkuLists.TYPE }, params, options);
|
6
|
+
}
|
7
|
+
async create(resource, params, options) {
|
8
|
+
return this.resources.create(Object.assign(Object.assign({}, resource), { type: SkuLists.TYPE }), params, options);
|
9
|
+
}
|
10
|
+
async update(resource, params, options) {
|
11
|
+
return this.resources.update(Object.assign(Object.assign({}, resource), { type: SkuLists.TYPE }), params, options);
|
12
|
+
}
|
13
|
+
async delete(id, options) {
|
14
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: SkuLists.TYPE } : id, options);
|
15
|
+
}
|
16
|
+
async customer(skuListId, params, options) {
|
17
|
+
const _skuListId = skuListId.id || skuListId;
|
18
|
+
return this.resources.fetch({ type: 'customers' }, `sku_lists/${_skuListId}/customer`, params, options);
|
19
|
+
}
|
20
|
+
async skus(skuListId, params, options) {
|
21
|
+
const _skuListId = skuListId.id || skuListId;
|
22
|
+
return this.resources.fetch({ type: 'skus' }, `sku_lists/${_skuListId}/skus`, params, options);
|
23
|
+
}
|
24
|
+
async sku_list_items(skuListId, params, options) {
|
25
|
+
const _skuListId = skuListId.id || skuListId;
|
26
|
+
return this.resources.fetch({ type: 'sku_list_items' }, `sku_lists/${_skuListId}/sku_list_items`, params, options);
|
27
|
+
}
|
28
|
+
async bundles(skuListId, params, options) {
|
29
|
+
const _skuListId = skuListId.id || skuListId;
|
30
|
+
return this.resources.fetch({ type: 'bundles' }, `sku_lists/${_skuListId}/bundles`, params, options);
|
31
|
+
}
|
32
|
+
async attachments(skuListId, params, options) {
|
33
|
+
const _skuListId = skuListId.id || skuListId;
|
34
|
+
return this.resources.fetch({ type: 'attachments' }, `sku_lists/${_skuListId}/attachments`, params, options);
|
35
|
+
}
|
36
|
+
isSkuList(resource) {
|
37
|
+
return resource.type && (resource.type === SkuLists.TYPE);
|
38
|
+
}
|
39
|
+
relationship(id) {
|
40
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: SkuLists.TYPE } : { id: id.id, type: SkuLists.TYPE };
|
41
|
+
}
|
42
|
+
type() {
|
43
|
+
return SkuLists.TYPE;
|
44
|
+
}
|
45
|
+
}
|
46
|
+
SkuLists.TYPE = 'sku_lists';
|
47
|
+
export default SkuLists;
|