@commercelayer/sdk 5.0.0-alpha.5 → 5.0.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +201 -123
- package/lib/cjs/api.d.ts +128 -0
- package/lib/cjs/api.js +342 -0
- package/lib/cjs/client.d.ts +33 -0
- package/lib/cjs/client.js +126 -0
- package/lib/cjs/commercelayer.d.ts +139 -0
- package/lib/cjs/commercelayer.js +230 -0
- package/lib/cjs/common.d.ts +4 -0
- package/lib/cjs/common.js +12 -0
- package/lib/cjs/config.d.ts +12 -0
- package/lib/cjs/config.js +14 -0
- package/lib/cjs/debug.d.ts +3 -0
- package/lib/cjs/debug.js +38 -0
- package/lib/cjs/error.d.ts +28 -0
- package/lib/cjs/error.js +40 -0
- package/lib/cjs/index.d.ts +8 -0
- package/lib/cjs/index.js +29 -0
- package/lib/cjs/interceptor.d.ts +25 -0
- package/lib/cjs/interceptor.js +2 -0
- package/lib/cjs/jsonapi.d.ts +5 -0
- package/lib/cjs/jsonapi.js +86 -0
- package/lib/cjs/model.d.ts +111 -0
- package/lib/cjs/model.js +3 -0
- package/lib/cjs/query.d.ts +25 -0
- package/lib/cjs/query.js +52 -0
- package/lib/cjs/resource.d.ts +87 -0
- package/lib/cjs/resource.js +170 -0
- package/lib/cjs/resources/addresses.d.ts +88 -0
- package/lib/cjs/resources/addresses.js +29 -0
- package/lib/cjs/resources/adjustments.d.ts +35 -0
- package/lib/cjs/resources/adjustments.js +25 -0
- package/lib/cjs/resources/adyen_gateways.d.ts +56 -0
- package/lib/cjs/resources/adyen_gateways.js +33 -0
- package/lib/cjs/resources/adyen_payments.d.ts +46 -0
- package/lib/cjs/resources/adyen_payments.js +33 -0
- package/lib/cjs/resources/application.d.ts +21 -0
- package/lib/cjs/resources/application.js +16 -0
- package/lib/cjs/resources/attachments.d.ts +156 -0
- package/lib/cjs/resources/attachments.js +25 -0
- package/lib/cjs/resources/authorizations.d.ts +60 -0
- package/lib/cjs/resources/authorizations.js +35 -0
- package/lib/cjs/resources/avalara_accounts.d.ts +55 -0
- package/lib/cjs/resources/avalara_accounts.js +37 -0
- package/lib/cjs/resources/axerve_gateways.d.ts +43 -0
- package/lib/cjs/resources/axerve_gateways.js +33 -0
- package/lib/cjs/resources/axerve_payments.d.ts +46 -0
- package/lib/cjs/resources/axerve_payments.js +33 -0
- package/lib/cjs/resources/billing_info_validation_rules.d.ts +35 -0
- package/lib/cjs/resources/billing_info_validation_rules.js +33 -0
- package/lib/cjs/resources/bing_geocoders.d.ts +35 -0
- package/lib/cjs/resources/bing_geocoders.js +33 -0
- package/lib/cjs/resources/braintree_gateways.d.ts +56 -0
- package/lib/cjs/resources/braintree_gateways.js +33 -0
- package/lib/cjs/resources/braintree_payments.d.ts +48 -0
- package/lib/cjs/resources/braintree_payments.js +33 -0
- package/lib/cjs/resources/bundles.d.ts +76 -0
- package/lib/cjs/resources/bundles.js +41 -0
- package/lib/cjs/resources/captures.d.ts +51 -0
- package/lib/cjs/resources/captures.js +35 -0
- package/lib/cjs/resources/carrier_accounts.d.ts +26 -0
- package/lib/cjs/resources/carrier_accounts.js +24 -0
- package/lib/cjs/resources/checkout_com_gateways.d.ts +45 -0
- package/lib/cjs/resources/checkout_com_gateways.js +33 -0
- package/lib/cjs/resources/checkout_com_payments.d.ts +59 -0
- package/lib/cjs/resources/checkout_com_payments.js +33 -0
- package/lib/cjs/resources/cleanups.d.ts +36 -0
- package/lib/cjs/resources/cleanups.js +26 -0
- package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +59 -0
- package/lib/cjs/resources/coupon_codes_promotion_rules.js +29 -0
- package/lib/cjs/resources/coupon_recipients.d.ts +44 -0
- package/lib/cjs/resources/coupon_recipients.js +33 -0
- package/lib/cjs/resources/coupons.d.ts +45 -0
- package/lib/cjs/resources/coupons.js +29 -0
- package/lib/cjs/resources/customer_addresses.d.ts +44 -0
- package/lib/cjs/resources/customer_addresses.js +37 -0
- package/lib/cjs/resources/customer_groups.d.ts +36 -0
- package/lib/cjs/resources/customer_groups.js +37 -0
- package/lib/cjs/resources/customer_password_resets.d.ts +36 -0
- package/lib/cjs/resources/customer_password_resets.js +33 -0
- package/lib/cjs/resources/customer_payment_sources.d.ts +78 -0
- package/lib/cjs/resources/customer_payment_sources.js +29 -0
- package/lib/cjs/resources/customer_subscriptions.d.ts +31 -0
- package/lib/cjs/resources/customer_subscriptions.js +33 -0
- package/lib/cjs/resources/customers.d.ts +66 -0
- package/lib/cjs/resources/customers.js +65 -0
- package/lib/cjs/resources/delivery_lead_times.d.ts +51 -0
- package/lib/cjs/resources/delivery_lead_times.js +37 -0
- package/lib/cjs/resources/event_callbacks.d.ts +24 -0
- package/lib/cjs/resources/event_callbacks.js +20 -0
- package/lib/cjs/resources/events.d.ts +24 -0
- package/lib/cjs/resources/events.js +24 -0
- package/lib/cjs/resources/exports.d.ts +40 -0
- package/lib/cjs/resources/exports.js +26 -0
- package/lib/cjs/resources/external_gateways.d.ts +49 -0
- package/lib/cjs/resources/external_gateways.js +33 -0
- package/lib/cjs/resources/external_payments.d.ts +44 -0
- package/lib/cjs/resources/external_payments.js +37 -0
- package/lib/cjs/resources/external_promotions.d.ts +90 -0
- package/lib/cjs/resources/external_promotions.js +49 -0
- package/lib/cjs/resources/external_tax_calculators.d.ts +37 -0
- package/lib/cjs/resources/external_tax_calculators.js +33 -0
- package/lib/cjs/resources/fixed_amount_promotions.d.ts +91 -0
- package/lib/cjs/resources/fixed_amount_promotions.js +49 -0
- package/lib/cjs/resources/fixed_price_promotions.d.ts +102 -0
- package/lib/cjs/resources/fixed_price_promotions.js +57 -0
- package/lib/cjs/resources/free_gift_promotions.d.ts +100 -0
- package/lib/cjs/resources/free_gift_promotions.js +57 -0
- package/lib/cjs/resources/free_shipping_promotions.d.ts +83 -0
- package/lib/cjs/resources/free_shipping_promotions.js +45 -0
- package/lib/cjs/resources/geocoders.d.ts +24 -0
- package/lib/cjs/resources/geocoders.js +24 -0
- package/lib/cjs/resources/gift_card_recipients.d.ts +44 -0
- package/lib/cjs/resources/gift_card_recipients.js +33 -0
- package/lib/cjs/resources/gift_cards.d.ts +85 -0
- package/lib/cjs/resources/gift_cards.js +41 -0
- package/lib/cjs/resources/google_geocoders.d.ts +35 -0
- package/lib/cjs/resources/google_geocoders.js +33 -0
- package/lib/cjs/resources/imports.d.ts +45 -0
- package/lib/cjs/resources/imports.js +26 -0
- package/lib/cjs/resources/in_stock_subscriptions.d.ts +62 -0
- package/lib/cjs/resources/in_stock_subscriptions.js +41 -0
- package/lib/cjs/resources/inventory_models.d.ts +42 -0
- package/lib/cjs/resources/inventory_models.js +37 -0
- package/lib/cjs/resources/inventory_return_locations.d.ts +43 -0
- package/lib/cjs/resources/inventory_return_locations.js +33 -0
- package/lib/cjs/resources/inventory_stock_locations.d.ts +46 -0
- package/lib/cjs/resources/inventory_stock_locations.js +33 -0
- package/lib/cjs/resources/klarna_gateways.d.ts +44 -0
- package/lib/cjs/resources/klarna_gateways.js +33 -0
- package/lib/cjs/resources/klarna_payments.d.ts +46 -0
- package/lib/cjs/resources/klarna_payments.js +33 -0
- package/lib/cjs/resources/line_item_options.d.ts +57 -0
- package/lib/cjs/resources/line_item_options.js +33 -0
- package/lib/cjs/resources/line_items.d.ts +126 -0
- package/lib/cjs/resources/line_items.js +41 -0
- package/lib/cjs/resources/manual_gateways.d.ts +30 -0
- package/lib/cjs/resources/manual_gateways.js +29 -0
- package/lib/cjs/resources/manual_tax_calculators.d.ts +41 -0
- package/lib/cjs/resources/manual_tax_calculators.js +37 -0
- package/lib/cjs/resources/markets.d.ts +88 -0
- package/lib/cjs/resources/markets.js +49 -0
- package/lib/cjs/resources/merchants.d.ts +38 -0
- package/lib/cjs/resources/merchants.js +33 -0
- package/lib/cjs/resources/order_amount_promotion_rules.d.ts +56 -0
- package/lib/cjs/resources/order_amount_promotion_rules.js +25 -0
- package/lib/cjs/resources/order_copies.d.ts +48 -0
- package/lib/cjs/resources/order_copies.js +38 -0
- package/lib/cjs/resources/order_subscriptions.d.ts +70 -0
- package/lib/cjs/resources/order_subscriptions.js +49 -0
- package/lib/cjs/resources/order_validation_rules.d.ts +23 -0
- package/lib/cjs/resources/order_validation_rules.js +24 -0
- package/lib/cjs/resources/orders.d.ts +296 -0
- package/lib/cjs/resources/orders.js +105 -0
- package/lib/cjs/resources/organization.d.ts +32 -0
- package/lib/cjs/resources/organization.js +16 -0
- package/lib/cjs/resources/packages.d.ts +56 -0
- package/lib/cjs/resources/packages.js +37 -0
- package/lib/cjs/resources/parcel_line_items.d.ts +51 -0
- package/lib/cjs/resources/parcel_line_items.js +33 -0
- package/lib/cjs/resources/parcels.d.ts +119 -0
- package/lib/cjs/resources/parcels.js +45 -0
- package/lib/cjs/resources/payment_gateways.d.ts +21 -0
- package/lib/cjs/resources/payment_gateways.js +20 -0
- package/lib/cjs/resources/payment_methods.d.ts +72 -0
- package/lib/cjs/resources/payment_methods.js +37 -0
- package/lib/cjs/resources/paypal_gateways.d.ts +37 -0
- package/lib/cjs/resources/paypal_gateways.js +33 -0
- package/lib/cjs/resources/paypal_payments.d.ts +52 -0
- package/lib/cjs/resources/paypal_payments.js +33 -0
- package/lib/cjs/resources/percentage_discount_promotions.d.ts +100 -0
- package/lib/cjs/resources/percentage_discount_promotions.js +57 -0
- package/lib/cjs/resources/price_lists.d.ts +39 -0
- package/lib/cjs/resources/price_lists.js +33 -0
- package/lib/cjs/resources/price_tiers.d.ts +28 -0
- package/lib/cjs/resources/price_tiers.js +24 -0
- package/lib/cjs/resources/price_volume_tiers.d.ts +46 -0
- package/lib/cjs/resources/price_volume_tiers.js +33 -0
- package/lib/cjs/resources/prices.d.ts +68 -0
- package/lib/cjs/resources/prices.js +45 -0
- package/lib/cjs/resources/promotion_rules.d.ts +23 -0
- package/lib/cjs/resources/promotion_rules.js +16 -0
- package/lib/cjs/resources/promotions.d.ts +41 -0
- package/lib/cjs/resources/promotions.js +36 -0
- package/lib/cjs/resources/refunds.d.ts +37 -0
- package/lib/cjs/resources/refunds.js +28 -0
- package/lib/cjs/resources/return_line_items.d.ts +49 -0
- package/lib/cjs/resources/return_line_items.js +33 -0
- package/lib/cjs/resources/returns.d.ts +75 -0
- package/lib/cjs/resources/returns.js +57 -0
- package/lib/cjs/resources/satispay_gateways.d.ts +39 -0
- package/lib/cjs/resources/satispay_gateways.js +33 -0
- package/lib/cjs/resources/satispay_payments.d.ts +43 -0
- package/lib/cjs/resources/satispay_payments.js +33 -0
- package/lib/cjs/resources/shipments.d.ts +93 -0
- package/lib/cjs/resources/shipments.js +75 -0
- package/lib/cjs/resources/shipping_categories.d.ts +33 -0
- package/lib/cjs/resources/shipping_categories.js +33 -0
- package/lib/cjs/resources/shipping_method_tiers.d.ts +28 -0
- package/lib/cjs/resources/shipping_method_tiers.js +24 -0
- package/lib/cjs/resources/shipping_methods.d.ts +107 -0
- package/lib/cjs/resources/shipping_methods.js +57 -0
- package/lib/cjs/resources/shipping_weight_tiers.d.ts +46 -0
- package/lib/cjs/resources/shipping_weight_tiers.js +33 -0
- package/lib/cjs/resources/shipping_zones.d.ts +48 -0
- package/lib/cjs/resources/shipping_zones.js +29 -0
- package/lib/cjs/resources/sku_list_items.d.ts +47 -0
- package/lib/cjs/resources/sku_list_items.js +33 -0
- package/lib/cjs/resources/sku_list_promotion_rules.d.ts +68 -0
- package/lib/cjs/resources/sku_list_promotion_rules.js +33 -0
- package/lib/cjs/resources/sku_lists.d.ts +60 -0
- package/lib/cjs/resources/sku_lists.js +45 -0
- package/lib/cjs/resources/sku_options.d.ts +56 -0
- package/lib/cjs/resources/sku_options.js +33 -0
- package/lib/cjs/resources/skus.d.ts +78 -0
- package/lib/cjs/resources/skus.js +49 -0
- package/lib/cjs/resources/stock_items.d.ts +49 -0
- package/lib/cjs/resources/stock_items.js +37 -0
- package/lib/cjs/resources/stock_line_items.d.ts +29 -0
- package/lib/cjs/resources/stock_line_items.js +28 -0
- package/lib/cjs/resources/stock_locations.d.ts +57 -0
- package/lib/cjs/resources/stock_locations.js +49 -0
- package/lib/cjs/resources/stock_transfers.d.ts +74 -0
- package/lib/cjs/resources/stock_transfers.js +49 -0
- package/lib/cjs/resources/stripe_gateways.d.ts +41 -0
- package/lib/cjs/resources/stripe_gateways.js +33 -0
- package/lib/cjs/resources/stripe_payments.d.ts +47 -0
- package/lib/cjs/resources/stripe_payments.js +33 -0
- package/lib/cjs/resources/tax_calculators.d.ts +24 -0
- package/lib/cjs/resources/tax_calculators.js +24 -0
- package/lib/cjs/resources/tax_categories.d.ts +59 -0
- package/lib/cjs/resources/tax_categories.js +33 -0
- package/lib/cjs/resources/tax_rules.d.ts +69 -0
- package/lib/cjs/resources/tax_rules.js +29 -0
- package/lib/cjs/resources/taxjar_accounts.d.ts +43 -0
- package/lib/cjs/resources/taxjar_accounts.js +37 -0
- package/lib/cjs/resources/transactions.d.ts +31 -0
- package/lib/cjs/resources/transactions.js +20 -0
- package/lib/cjs/resources/voids.d.ts +37 -0
- package/lib/cjs/resources/voids.js +28 -0
- package/lib/cjs/resources/webhooks.d.ts +43 -0
- package/lib/cjs/resources/webhooks.js +29 -0
- package/lib/cjs/resources/wire_transfers.d.ts +33 -0
- package/lib/cjs/resources/wire_transfers.js +29 -0
- package/lib/cjs/static.d.ts +9 -0
- package/lib/cjs/static.js +45 -0
- package/lib/cjs/util.d.ts +10 -0
- package/lib/cjs/util.js +15 -0
- package/lib/esm/api.d.ts +128 -0
- package/lib/esm/api.js +226 -0
- package/lib/esm/client.d.ts +33 -0
- package/lib/esm/client.js +121 -0
- package/lib/esm/commercelayer.d.ts +139 -0
- package/lib/esm/commercelayer.js +201 -0
- package/lib/esm/common.d.ts +4 -0
- package/lib/esm/common.js +8 -0
- package/lib/esm/config.d.ts +12 -0
- package/lib/esm/config.js +12 -0
- package/lib/esm/debug.d.ts +3 -0
- package/lib/esm/debug.js +36 -0
- package/lib/esm/error.d.ts +28 -0
- package/lib/esm/error.js +35 -0
- package/lib/esm/index.d.ts +8 -0
- package/lib/esm/index.js +6 -0
- package/lib/esm/interceptor.d.ts +25 -0
- package/lib/esm/interceptor.js +1 -0
- package/lib/esm/jsonapi.d.ts +5 -0
- package/lib/esm/jsonapi.js +79 -0
- package/lib/esm/model.d.ts +111 -0
- package/lib/esm/model.js +2 -0
- package/lib/esm/query.d.ts +25 -0
- package/lib/esm/query.js +45 -0
- package/lib/esm/resource.d.ts +87 -0
- package/lib/esm/resource.js +163 -0
- package/lib/esm/resources/addresses.d.ts +88 -0
- package/lib/esm/resources/addresses.js +27 -0
- package/lib/esm/resources/adjustments.d.ts +35 -0
- package/lib/esm/resources/adjustments.js +23 -0
- package/lib/esm/resources/adyen_gateways.d.ts +56 -0
- package/lib/esm/resources/adyen_gateways.js +31 -0
- package/lib/esm/resources/adyen_payments.d.ts +46 -0
- package/lib/esm/resources/adyen_payments.js +31 -0
- package/lib/esm/resources/application.d.ts +21 -0
- package/lib/esm/resources/application.js +14 -0
- package/lib/esm/resources/attachments.d.ts +156 -0
- package/lib/esm/resources/attachments.js +23 -0
- package/lib/esm/resources/authorizations.d.ts +60 -0
- package/lib/esm/resources/authorizations.js +33 -0
- package/lib/esm/resources/avalara_accounts.d.ts +55 -0
- package/lib/esm/resources/avalara_accounts.js +35 -0
- package/lib/esm/resources/axerve_gateways.d.ts +43 -0
- package/lib/esm/resources/axerve_gateways.js +31 -0
- package/lib/esm/resources/axerve_payments.d.ts +46 -0
- package/lib/esm/resources/axerve_payments.js +31 -0
- package/lib/esm/resources/billing_info_validation_rules.d.ts +35 -0
- package/lib/esm/resources/billing_info_validation_rules.js +31 -0
- package/lib/esm/resources/bing_geocoders.d.ts +35 -0
- package/lib/esm/resources/bing_geocoders.js +31 -0
- package/lib/esm/resources/braintree_gateways.d.ts +56 -0
- package/lib/esm/resources/braintree_gateways.js +31 -0
- package/lib/esm/resources/braintree_payments.d.ts +48 -0
- package/lib/esm/resources/braintree_payments.js +31 -0
- package/lib/esm/resources/bundles.d.ts +76 -0
- package/lib/esm/resources/bundles.js +39 -0
- package/lib/esm/resources/captures.d.ts +51 -0
- package/lib/esm/resources/captures.js +33 -0
- package/lib/esm/resources/carrier_accounts.d.ts +26 -0
- package/lib/esm/resources/carrier_accounts.js +22 -0
- package/lib/esm/resources/checkout_com_gateways.d.ts +45 -0
- package/lib/esm/resources/checkout_com_gateways.js +31 -0
- package/lib/esm/resources/checkout_com_payments.d.ts +59 -0
- package/lib/esm/resources/checkout_com_payments.js +31 -0
- package/lib/esm/resources/cleanups.d.ts +36 -0
- package/lib/esm/resources/cleanups.js +24 -0
- package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +59 -0
- package/lib/esm/resources/coupon_codes_promotion_rules.js +27 -0
- package/lib/esm/resources/coupon_recipients.d.ts +44 -0
- package/lib/esm/resources/coupon_recipients.js +31 -0
- package/lib/esm/resources/coupons.d.ts +45 -0
- package/lib/esm/resources/coupons.js +27 -0
- package/lib/esm/resources/customer_addresses.d.ts +44 -0
- package/lib/esm/resources/customer_addresses.js +35 -0
- package/lib/esm/resources/customer_groups.d.ts +36 -0
- package/lib/esm/resources/customer_groups.js +35 -0
- package/lib/esm/resources/customer_password_resets.d.ts +36 -0
- package/lib/esm/resources/customer_password_resets.js +31 -0
- package/lib/esm/resources/customer_payment_sources.d.ts +78 -0
- package/lib/esm/resources/customer_payment_sources.js +27 -0
- package/lib/esm/resources/customer_subscriptions.d.ts +31 -0
- package/lib/esm/resources/customer_subscriptions.js +31 -0
- package/lib/esm/resources/customers.d.ts +66 -0
- package/lib/esm/resources/customers.js +63 -0
- package/lib/esm/resources/delivery_lead_times.d.ts +51 -0
- package/lib/esm/resources/delivery_lead_times.js +35 -0
- package/lib/esm/resources/event_callbacks.d.ts +24 -0
- package/lib/esm/resources/event_callbacks.js +18 -0
- package/lib/esm/resources/events.d.ts +24 -0
- package/lib/esm/resources/events.js +22 -0
- package/lib/esm/resources/exports.d.ts +40 -0
- package/lib/esm/resources/exports.js +24 -0
- package/lib/esm/resources/external_gateways.d.ts +49 -0
- package/lib/esm/resources/external_gateways.js +31 -0
- package/lib/esm/resources/external_payments.d.ts +44 -0
- package/lib/esm/resources/external_payments.js +35 -0
- package/lib/esm/resources/external_promotions.d.ts +90 -0
- package/lib/esm/resources/external_promotions.js +47 -0
- package/lib/esm/resources/external_tax_calculators.d.ts +37 -0
- package/lib/esm/resources/external_tax_calculators.js +31 -0
- package/lib/esm/resources/fixed_amount_promotions.d.ts +91 -0
- package/lib/esm/resources/fixed_amount_promotions.js +47 -0
- package/lib/esm/resources/fixed_price_promotions.d.ts +102 -0
- package/lib/esm/resources/fixed_price_promotions.js +55 -0
- package/lib/esm/resources/free_gift_promotions.d.ts +100 -0
- package/lib/esm/resources/free_gift_promotions.js +55 -0
- package/lib/esm/resources/free_shipping_promotions.d.ts +83 -0
- package/lib/esm/resources/free_shipping_promotions.js +43 -0
- package/lib/esm/resources/geocoders.d.ts +24 -0
- package/lib/esm/resources/geocoders.js +22 -0
- package/lib/esm/resources/gift_card_recipients.d.ts +44 -0
- package/lib/esm/resources/gift_card_recipients.js +31 -0
- package/lib/esm/resources/gift_cards.d.ts +85 -0
- package/lib/esm/resources/gift_cards.js +39 -0
- package/lib/esm/resources/google_geocoders.d.ts +35 -0
- package/lib/esm/resources/google_geocoders.js +31 -0
- package/lib/esm/resources/imports.d.ts +45 -0
- package/lib/esm/resources/imports.js +24 -0
- package/lib/esm/resources/in_stock_subscriptions.d.ts +62 -0
- package/lib/esm/resources/in_stock_subscriptions.js +39 -0
- package/lib/esm/resources/inventory_models.d.ts +42 -0
- package/lib/esm/resources/inventory_models.js +35 -0
- package/lib/esm/resources/inventory_return_locations.d.ts +43 -0
- package/lib/esm/resources/inventory_return_locations.js +31 -0
- package/lib/esm/resources/inventory_stock_locations.d.ts +46 -0
- package/lib/esm/resources/inventory_stock_locations.js +31 -0
- package/lib/esm/resources/klarna_gateways.d.ts +44 -0
- package/lib/esm/resources/klarna_gateways.js +31 -0
- package/lib/esm/resources/klarna_payments.d.ts +46 -0
- package/lib/esm/resources/klarna_payments.js +31 -0
- package/lib/esm/resources/line_item_options.d.ts +57 -0
- package/lib/esm/resources/line_item_options.js +31 -0
- package/lib/esm/resources/line_items.d.ts +126 -0
- package/lib/esm/resources/line_items.js +39 -0
- package/lib/esm/resources/manual_gateways.d.ts +30 -0
- package/lib/esm/resources/manual_gateways.js +27 -0
- package/lib/esm/resources/manual_tax_calculators.d.ts +41 -0
- package/lib/esm/resources/manual_tax_calculators.js +35 -0
- package/lib/esm/resources/markets.d.ts +88 -0
- package/lib/esm/resources/markets.js +47 -0
- package/lib/esm/resources/merchants.d.ts +38 -0
- package/lib/esm/resources/merchants.js +31 -0
- package/lib/esm/resources/order_amount_promotion_rules.d.ts +56 -0
- package/lib/esm/resources/order_amount_promotion_rules.js +23 -0
- package/lib/esm/resources/order_copies.d.ts +48 -0
- package/lib/esm/resources/order_copies.js +36 -0
- package/lib/esm/resources/order_subscriptions.d.ts +70 -0
- package/lib/esm/resources/order_subscriptions.js +47 -0
- package/lib/esm/resources/order_validation_rules.d.ts +23 -0
- package/lib/esm/resources/order_validation_rules.js +22 -0
- package/lib/esm/resources/orders.d.ts +296 -0
- package/lib/esm/resources/orders.js +103 -0
- package/lib/esm/resources/organization.d.ts +32 -0
- package/lib/esm/resources/organization.js +14 -0
- package/lib/esm/resources/packages.d.ts +56 -0
- package/lib/esm/resources/packages.js +35 -0
- package/lib/esm/resources/parcel_line_items.d.ts +51 -0
- package/lib/esm/resources/parcel_line_items.js +31 -0
- package/lib/esm/resources/parcels.d.ts +119 -0
- package/lib/esm/resources/parcels.js +43 -0
- package/lib/esm/resources/payment_gateways.d.ts +21 -0
- package/lib/esm/resources/payment_gateways.js +18 -0
- package/lib/esm/resources/payment_methods.d.ts +72 -0
- package/lib/esm/resources/payment_methods.js +35 -0
- package/lib/esm/resources/paypal_gateways.d.ts +37 -0
- package/lib/esm/resources/paypal_gateways.js +31 -0
- package/lib/esm/resources/paypal_payments.d.ts +52 -0
- package/lib/esm/resources/paypal_payments.js +31 -0
- package/lib/esm/resources/percentage_discount_promotions.d.ts +100 -0
- package/lib/esm/resources/percentage_discount_promotions.js +55 -0
- package/lib/esm/resources/price_lists.d.ts +39 -0
- package/lib/esm/resources/price_lists.js +31 -0
- package/lib/esm/resources/price_tiers.d.ts +28 -0
- package/lib/esm/resources/price_tiers.js +22 -0
- package/lib/esm/resources/price_volume_tiers.d.ts +46 -0
- package/lib/esm/resources/price_volume_tiers.js +31 -0
- package/lib/esm/resources/prices.d.ts +68 -0
- package/lib/esm/resources/prices.js +43 -0
- package/lib/esm/resources/promotion_rules.d.ts +23 -0
- package/lib/esm/resources/promotion_rules.js +14 -0
- package/lib/esm/resources/promotions.d.ts +41 -0
- package/lib/esm/resources/promotions.js +34 -0
- package/lib/esm/resources/refunds.d.ts +37 -0
- package/lib/esm/resources/refunds.js +26 -0
- package/lib/esm/resources/return_line_items.d.ts +49 -0
- package/lib/esm/resources/return_line_items.js +31 -0
- package/lib/esm/resources/returns.d.ts +75 -0
- package/lib/esm/resources/returns.js +55 -0
- package/lib/esm/resources/satispay_gateways.d.ts +39 -0
- package/lib/esm/resources/satispay_gateways.js +31 -0
- package/lib/esm/resources/satispay_payments.d.ts +43 -0
- package/lib/esm/resources/satispay_payments.js +31 -0
- package/lib/esm/resources/shipments.d.ts +93 -0
- package/lib/esm/resources/shipments.js +73 -0
- package/lib/esm/resources/shipping_categories.d.ts +33 -0
- package/lib/esm/resources/shipping_categories.js +31 -0
- package/lib/esm/resources/shipping_method_tiers.d.ts +28 -0
- package/lib/esm/resources/shipping_method_tiers.js +22 -0
- package/lib/esm/resources/shipping_methods.d.ts +107 -0
- package/lib/esm/resources/shipping_methods.js +55 -0
- package/lib/esm/resources/shipping_weight_tiers.d.ts +46 -0
- package/lib/esm/resources/shipping_weight_tiers.js +31 -0
- package/lib/esm/resources/shipping_zones.d.ts +48 -0
- package/lib/esm/resources/shipping_zones.js +27 -0
- package/lib/esm/resources/sku_list_items.d.ts +47 -0
- package/lib/esm/resources/sku_list_items.js +31 -0
- package/lib/esm/resources/sku_list_promotion_rules.d.ts +68 -0
- package/lib/esm/resources/sku_list_promotion_rules.js +31 -0
- package/lib/esm/resources/sku_lists.d.ts +60 -0
- package/lib/esm/resources/sku_lists.js +43 -0
- package/lib/esm/resources/sku_options.d.ts +56 -0
- package/lib/esm/resources/sku_options.js +31 -0
- package/lib/esm/resources/skus.d.ts +78 -0
- package/lib/esm/resources/skus.js +47 -0
- package/lib/esm/resources/stock_items.d.ts +49 -0
- package/lib/esm/resources/stock_items.js +35 -0
- package/lib/esm/resources/stock_line_items.d.ts +29 -0
- package/lib/esm/resources/stock_line_items.js +26 -0
- package/lib/esm/resources/stock_locations.d.ts +57 -0
- package/lib/esm/resources/stock_locations.js +47 -0
- package/lib/esm/resources/stock_transfers.d.ts +74 -0
- package/lib/esm/resources/stock_transfers.js +47 -0
- package/lib/esm/resources/stripe_gateways.d.ts +41 -0
- package/lib/esm/resources/stripe_gateways.js +31 -0
- package/lib/esm/resources/stripe_payments.d.ts +47 -0
- package/lib/esm/resources/stripe_payments.js +31 -0
- package/lib/esm/resources/tax_calculators.d.ts +24 -0
- package/lib/esm/resources/tax_calculators.js +22 -0
- package/lib/esm/resources/tax_categories.d.ts +59 -0
- package/lib/esm/resources/tax_categories.js +31 -0
- package/lib/esm/resources/tax_rules.d.ts +69 -0
- package/lib/esm/resources/tax_rules.js +27 -0
- package/lib/esm/resources/taxjar_accounts.d.ts +43 -0
- package/lib/esm/resources/taxjar_accounts.js +35 -0
- package/lib/esm/resources/transactions.d.ts +31 -0
- package/lib/esm/resources/transactions.js +18 -0
- package/lib/esm/resources/voids.d.ts +37 -0
- package/lib/esm/resources/voids.js +26 -0
- package/lib/esm/resources/webhooks.d.ts +43 -0
- package/lib/esm/resources/webhooks.js +27 -0
- package/lib/esm/resources/wire_transfers.d.ts +33 -0
- package/lib/esm/resources/wire_transfers.js +27 -0
- package/lib/esm/static.d.ts +9 -0
- package/lib/esm/static.js +19 -0
- package/lib/esm/util.d.ts +10 -0
- package/lib/esm/util.js +11 -0
- package/lib/tsconfig.esm.tsbuildinfo +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/package.json +27 -36
- package/lib/api.d.ts +0 -1
- package/lib/api.js +0 -1
- package/lib/client.d.ts +0 -2
- package/lib/client.js +0 -1
- package/lib/commercelayer.d.ts +0 -1
- package/lib/commercelayer.js +0 -1
- package/lib/common.d.ts +0 -1
- package/lib/common.js +0 -1
- package/lib/config.d.ts +0 -1
- package/lib/config.js +0 -1
- package/lib/debug.d.ts +0 -1
- package/lib/debug.js +0 -1
- package/lib/error.d.ts +0 -1
- package/lib/error.js +0 -1
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -1
- package/lib/interceptor.d.ts +0 -1
- package/lib/interceptor.js +0 -1
- package/lib/jsonapi.d.ts +0 -1
- package/lib/jsonapi.js +0 -1
- package/lib/model.d.ts +0 -1
- package/lib/model.js +0 -1
- package/lib/query.d.ts +0 -1
- package/lib/query.js +0 -1
- package/lib/resource.d.ts +0 -1
- package/lib/resource.js +0 -1
- package/lib/resources/addresses.d.ts +0 -1
- package/lib/resources/addresses.js +0 -1
- package/lib/resources/adjustments.d.ts +0 -1
- package/lib/resources/adjustments.js +0 -1
- package/lib/resources/adyen_gateways.d.ts +0 -1
- package/lib/resources/adyen_gateways.js +0 -1
- package/lib/resources/adyen_payments.d.ts +0 -1
- package/lib/resources/adyen_payments.js +0 -1
- package/lib/resources/application.d.ts +0 -1
- package/lib/resources/application.js +0 -1
- package/lib/resources/attachments.d.ts +0 -1
- package/lib/resources/attachments.js +0 -1
- package/lib/resources/authorizations.d.ts +0 -1
- package/lib/resources/authorizations.js +0 -1
- package/lib/resources/avalara_accounts.d.ts +0 -1
- package/lib/resources/avalara_accounts.js +0 -1
- package/lib/resources/billing_info_validation_rules.d.ts +0 -1
- package/lib/resources/billing_info_validation_rules.js +0 -1
- package/lib/resources/bing_geocoders.d.ts +0 -1
- package/lib/resources/bing_geocoders.js +0 -1
- package/lib/resources/braintree_gateways.d.ts +0 -1
- package/lib/resources/braintree_gateways.js +0 -1
- package/lib/resources/braintree_payments.d.ts +0 -1
- package/lib/resources/braintree_payments.js +0 -1
- package/lib/resources/bundles.d.ts +0 -1
- package/lib/resources/bundles.js +0 -1
- package/lib/resources/captures.d.ts +0 -1
- package/lib/resources/captures.js +0 -1
- package/lib/resources/carrier_accounts.d.ts +0 -1
- package/lib/resources/carrier_accounts.js +0 -1
- package/lib/resources/checkout_com_gateways.d.ts +0 -1
- package/lib/resources/checkout_com_gateways.js +0 -1
- package/lib/resources/checkout_com_payments.d.ts +0 -1
- package/lib/resources/checkout_com_payments.js +0 -1
- package/lib/resources/coupon_codes_promotion_rules.d.ts +0 -1
- package/lib/resources/coupon_codes_promotion_rules.js +0 -1
- package/lib/resources/coupon_recipients.d.ts +0 -1
- package/lib/resources/coupon_recipients.js +0 -1
- package/lib/resources/coupons.d.ts +0 -1
- package/lib/resources/coupons.js +0 -1
- package/lib/resources/customer_addresses.d.ts +0 -1
- package/lib/resources/customer_addresses.js +0 -1
- package/lib/resources/customer_groups.d.ts +0 -1
- package/lib/resources/customer_groups.js +0 -1
- package/lib/resources/customer_password_resets.d.ts +0 -1
- package/lib/resources/customer_password_resets.js +0 -1
- package/lib/resources/customer_payment_sources.d.ts +0 -1
- package/lib/resources/customer_payment_sources.js +0 -1
- package/lib/resources/customer_subscriptions.d.ts +0 -1
- package/lib/resources/customer_subscriptions.js +0 -1
- package/lib/resources/customers.d.ts +0 -1
- package/lib/resources/customers.js +0 -1
- package/lib/resources/delivery_lead_times.d.ts +0 -1
- package/lib/resources/delivery_lead_times.js +0 -1
- package/lib/resources/event_callbacks.d.ts +0 -1
- package/lib/resources/event_callbacks.js +0 -1
- package/lib/resources/external_gateways.d.ts +0 -1
- package/lib/resources/external_gateways.js +0 -1
- package/lib/resources/external_payments.d.ts +0 -1
- package/lib/resources/external_payments.js +0 -1
- package/lib/resources/external_promotions.d.ts +0 -1
- package/lib/resources/external_promotions.js +0 -1
- package/lib/resources/external_tax_calculators.d.ts +0 -1
- package/lib/resources/external_tax_calculators.js +0 -1
- package/lib/resources/fixed_amount_promotions.d.ts +0 -1
- package/lib/resources/fixed_amount_promotions.js +0 -1
- package/lib/resources/fixed_price_promotions.d.ts +0 -1
- package/lib/resources/fixed_price_promotions.js +0 -1
- package/lib/resources/free_gift_promotions.d.ts +0 -1
- package/lib/resources/free_gift_promotions.js +0 -1
- package/lib/resources/free_shipping_promotions.d.ts +0 -1
- package/lib/resources/free_shipping_promotions.js +0 -1
- package/lib/resources/geocoders.d.ts +0 -1
- package/lib/resources/geocoders.js +0 -1
- package/lib/resources/gift_card_recipients.d.ts +0 -1
- package/lib/resources/gift_card_recipients.js +0 -1
- package/lib/resources/gift_cards.d.ts +0 -1
- package/lib/resources/gift_cards.js +0 -1
- package/lib/resources/google_geocoders.d.ts +0 -1
- package/lib/resources/google_geocoders.js +0 -1
- package/lib/resources/imports.d.ts +0 -1
- package/lib/resources/imports.js +0 -1
- package/lib/resources/in_stock_subscriptions.d.ts +0 -1
- package/lib/resources/in_stock_subscriptions.js +0 -1
- package/lib/resources/inventory_models.d.ts +0 -1
- package/lib/resources/inventory_models.js +0 -1
- package/lib/resources/inventory_return_locations.d.ts +0 -1
- package/lib/resources/inventory_return_locations.js +0 -1
- package/lib/resources/inventory_stock_locations.d.ts +0 -1
- package/lib/resources/inventory_stock_locations.js +0 -1
- package/lib/resources/klarna_gateways.d.ts +0 -1
- package/lib/resources/klarna_gateways.js +0 -1
- package/lib/resources/klarna_payments.d.ts +0 -1
- package/lib/resources/klarna_payments.js +0 -1
- package/lib/resources/line_item_options.d.ts +0 -1
- package/lib/resources/line_item_options.js +0 -1
- package/lib/resources/line_items.d.ts +0 -1
- package/lib/resources/line_items.js +0 -1
- package/lib/resources/manual_gateways.d.ts +0 -1
- package/lib/resources/manual_gateways.js +0 -1
- package/lib/resources/manual_tax_calculators.d.ts +0 -1
- package/lib/resources/manual_tax_calculators.js +0 -1
- package/lib/resources/markets.d.ts +0 -1
- package/lib/resources/markets.js +0 -1
- package/lib/resources/merchants.d.ts +0 -1
- package/lib/resources/merchants.js +0 -1
- package/lib/resources/order_amount_promotion_rules.d.ts +0 -1
- package/lib/resources/order_amount_promotion_rules.js +0 -1
- package/lib/resources/order_copies.d.ts +0 -1
- package/lib/resources/order_copies.js +0 -1
- package/lib/resources/order_subscriptions.d.ts +0 -1
- package/lib/resources/order_subscriptions.js +0 -1
- package/lib/resources/order_validation_rules.d.ts +0 -1
- package/lib/resources/order_validation_rules.js +0 -1
- package/lib/resources/orders.d.ts +0 -1
- package/lib/resources/orders.js +0 -1
- package/lib/resources/organization.d.ts +0 -1
- package/lib/resources/organization.js +0 -1
- package/lib/resources/packages.d.ts +0 -1
- package/lib/resources/packages.js +0 -1
- package/lib/resources/parcel_line_items.d.ts +0 -1
- package/lib/resources/parcel_line_items.js +0 -1
- package/lib/resources/parcels.d.ts +0 -1
- package/lib/resources/parcels.js +0 -1
- package/lib/resources/payment_gateways.d.ts +0 -1
- package/lib/resources/payment_gateways.js +0 -1
- package/lib/resources/payment_methods.d.ts +0 -1
- package/lib/resources/payment_methods.js +0 -1
- package/lib/resources/paypal_gateways.d.ts +0 -1
- package/lib/resources/paypal_gateways.js +0 -1
- package/lib/resources/paypal_payments.d.ts +0 -1
- package/lib/resources/paypal_payments.js +0 -1
- package/lib/resources/percentage_discount_promotions.d.ts +0 -1
- package/lib/resources/percentage_discount_promotions.js +0 -1
- package/lib/resources/price_lists.d.ts +0 -1
- package/lib/resources/price_lists.js +0 -1
- package/lib/resources/prices.d.ts +0 -1
- package/lib/resources/prices.js +0 -1
- package/lib/resources/promotion_rules.d.ts +0 -1
- package/lib/resources/promotion_rules.js +0 -1
- package/lib/resources/promotions.d.ts +0 -1
- package/lib/resources/promotions.js +0 -1
- package/lib/resources/refunds.d.ts +0 -1
- package/lib/resources/refunds.js +0 -1
- package/lib/resources/return_line_items.d.ts +0 -1
- package/lib/resources/return_line_items.js +0 -1
- package/lib/resources/returns.d.ts +0 -1
- package/lib/resources/returns.js +0 -1
- package/lib/resources/shipments.d.ts +0 -1
- package/lib/resources/shipments.js +0 -1
- package/lib/resources/shipping_categories.d.ts +0 -1
- package/lib/resources/shipping_categories.js +0 -1
- package/lib/resources/shipping_methods.d.ts +0 -1
- package/lib/resources/shipping_methods.js +0 -1
- package/lib/resources/shipping_zones.d.ts +0 -1
- package/lib/resources/shipping_zones.js +0 -1
- package/lib/resources/sku_list_items.d.ts +0 -1
- package/lib/resources/sku_list_items.js +0 -1
- package/lib/resources/sku_list_promotion_rules.d.ts +0 -1
- package/lib/resources/sku_list_promotion_rules.js +0 -1
- package/lib/resources/sku_lists.d.ts +0 -1
- package/lib/resources/sku_lists.js +0 -1
- package/lib/resources/sku_options.d.ts +0 -1
- package/lib/resources/sku_options.js +0 -1
- package/lib/resources/skus.d.ts +0 -1
- package/lib/resources/skus.js +0 -1
- package/lib/resources/stock_items.d.ts +0 -1
- package/lib/resources/stock_items.js +0 -1
- package/lib/resources/stock_line_items.d.ts +0 -1
- package/lib/resources/stock_line_items.js +0 -1
- package/lib/resources/stock_locations.d.ts +0 -1
- package/lib/resources/stock_locations.js +0 -1
- package/lib/resources/stock_transfers.d.ts +0 -1
- package/lib/resources/stock_transfers.js +0 -1
- package/lib/resources/stripe_gateways.d.ts +0 -1
- package/lib/resources/stripe_gateways.js +0 -1
- package/lib/resources/stripe_payments.d.ts +0 -1
- package/lib/resources/stripe_payments.js +0 -1
- package/lib/resources/tax_calculators.d.ts +0 -1
- package/lib/resources/tax_calculators.js +0 -1
- package/lib/resources/tax_categories.d.ts +0 -1
- package/lib/resources/tax_categories.js +0 -1
- package/lib/resources/tax_rules.d.ts +0 -1
- package/lib/resources/tax_rules.js +0 -1
- package/lib/resources/taxjar_accounts.d.ts +0 -1
- package/lib/resources/taxjar_accounts.js +0 -1
- package/lib/resources/transactions.d.ts +0 -1
- package/lib/resources/transactions.js +0 -1
- package/lib/resources/voids.d.ts +0 -1
- package/lib/resources/voids.js +0 -1
- package/lib/resources/webhooks.d.ts +0 -1
- package/lib/resources/webhooks.js +0 -1
- package/lib/resources/wire_transfers.d.ts +0 -1
- package/lib/resources/wire_transfers.js +0 -1
- package/lib/static.d.ts +0 -1
- package/lib/static.js +0 -1
- package/lib/util.d.ts +0 -2
- package/lib/util.js +0 -1
@@ -0,0 +1,105 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const resource_1 = require("../resource");
|
4
|
+
class Orders extends resource_1.ApiResource {
|
5
|
+
async create(resource, params, options) {
|
6
|
+
return this.resources.create({ ...resource, type: Orders.TYPE }, params, options);
|
7
|
+
}
|
8
|
+
async update(resource, params, options) {
|
9
|
+
return this.resources.update({ ...resource, type: Orders.TYPE }, params, options);
|
10
|
+
}
|
11
|
+
async delete(id, options) {
|
12
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: Orders.TYPE } : id, options);
|
13
|
+
}
|
14
|
+
async market(orderId, params, options) {
|
15
|
+
const _orderId = orderId.id || orderId;
|
16
|
+
return this.resources.fetch({ type: 'markets' }, `orders/${_orderId}/market`, params, options);
|
17
|
+
}
|
18
|
+
async customer(orderId, params, options) {
|
19
|
+
const _orderId = orderId.id || orderId;
|
20
|
+
return this.resources.fetch({ type: 'customers' }, `orders/${_orderId}/customer`, params, options);
|
21
|
+
}
|
22
|
+
async shipping_address(orderId, params, options) {
|
23
|
+
const _orderId = orderId.id || orderId;
|
24
|
+
return this.resources.fetch({ type: 'addresses' }, `orders/${_orderId}/shipping_address`, params, options);
|
25
|
+
}
|
26
|
+
async billing_address(orderId, params, options) {
|
27
|
+
const _orderId = orderId.id || orderId;
|
28
|
+
return this.resources.fetch({ type: 'addresses' }, `orders/${_orderId}/billing_address`, params, options);
|
29
|
+
}
|
30
|
+
async available_payment_methods(orderId, params, options) {
|
31
|
+
const _orderId = orderId.id || orderId;
|
32
|
+
return this.resources.fetch({ type: 'payment_methods' }, `orders/${_orderId}/available_payment_methods`, params, options);
|
33
|
+
}
|
34
|
+
async available_customer_payment_sources(orderId, params, options) {
|
35
|
+
const _orderId = orderId.id || orderId;
|
36
|
+
return this.resources.fetch({ type: 'customer_payment_sources' }, `orders/${_orderId}/available_customer_payment_sources`, params, options);
|
37
|
+
}
|
38
|
+
async available_free_skus(orderId, params, options) {
|
39
|
+
const _orderId = orderId.id || orderId;
|
40
|
+
return this.resources.fetch({ type: 'skus' }, `orders/${_orderId}/available_free_skus`, params, options);
|
41
|
+
}
|
42
|
+
async available_free_bundles(orderId, params, options) {
|
43
|
+
const _orderId = orderId.id || orderId;
|
44
|
+
return this.resources.fetch({ type: 'bundles' }, `orders/${_orderId}/available_free_bundles`, params, options);
|
45
|
+
}
|
46
|
+
async payment_method(orderId, params, options) {
|
47
|
+
const _orderId = orderId.id || orderId;
|
48
|
+
return this.resources.fetch({ type: 'payment_methods' }, `orders/${_orderId}/payment_method`, params, options);
|
49
|
+
}
|
50
|
+
async line_items(orderId, params, options) {
|
51
|
+
const _orderId = orderId.id || orderId;
|
52
|
+
return this.resources.fetch({ type: 'line_items' }, `orders/${_orderId}/line_items`, params, options);
|
53
|
+
}
|
54
|
+
async shipments(orderId, params, options) {
|
55
|
+
const _orderId = orderId.id || orderId;
|
56
|
+
return this.resources.fetch({ type: 'shipments' }, `orders/${_orderId}/shipments`, params, options);
|
57
|
+
}
|
58
|
+
async authorizations(orderId, params, options) {
|
59
|
+
const _orderId = orderId.id || orderId;
|
60
|
+
return this.resources.fetch({ type: 'authorizations' }, `orders/${_orderId}/authorizations`, params, options);
|
61
|
+
}
|
62
|
+
async captures(orderId, params, options) {
|
63
|
+
const _orderId = orderId.id || orderId;
|
64
|
+
return this.resources.fetch({ type: 'captures' }, `orders/${_orderId}/captures`, params, options);
|
65
|
+
}
|
66
|
+
async voids(orderId, params, options) {
|
67
|
+
const _orderId = orderId.id || orderId;
|
68
|
+
return this.resources.fetch({ type: 'voids' }, `orders/${_orderId}/voids`, params, options);
|
69
|
+
}
|
70
|
+
async refunds(orderId, params, options) {
|
71
|
+
const _orderId = orderId.id || orderId;
|
72
|
+
return this.resources.fetch({ type: 'refunds' }, `orders/${_orderId}/refunds`, params, options);
|
73
|
+
}
|
74
|
+
async returns(orderId, params, options) {
|
75
|
+
const _orderId = orderId.id || orderId;
|
76
|
+
return this.resources.fetch({ type: 'returns' }, `orders/${_orderId}/returns`, params, options);
|
77
|
+
}
|
78
|
+
async order_subscriptions(orderId, params, options) {
|
79
|
+
const _orderId = orderId.id || orderId;
|
80
|
+
return this.resources.fetch({ type: 'order_subscriptions' }, `orders/${_orderId}/order_subscriptions`, params, options);
|
81
|
+
}
|
82
|
+
async order_copies(orderId, params, options) {
|
83
|
+
const _orderId = orderId.id || orderId;
|
84
|
+
return this.resources.fetch({ type: 'order_copies' }, `orders/${_orderId}/order_copies`, params, options);
|
85
|
+
}
|
86
|
+
async attachments(orderId, params, options) {
|
87
|
+
const _orderId = orderId.id || orderId;
|
88
|
+
return this.resources.fetch({ type: 'attachments' }, `orders/${_orderId}/attachments`, params, options);
|
89
|
+
}
|
90
|
+
async events(orderId, params, options) {
|
91
|
+
const _orderId = orderId.id || orderId;
|
92
|
+
return this.resources.fetch({ type: 'events' }, `orders/${_orderId}/events`, params, options);
|
93
|
+
}
|
94
|
+
isOrder(resource) {
|
95
|
+
return resource.type && (resource.type === Orders.TYPE);
|
96
|
+
}
|
97
|
+
relationship(id) {
|
98
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: Orders.TYPE } : { id: id.id, type: Orders.TYPE };
|
99
|
+
}
|
100
|
+
type() {
|
101
|
+
return Orders.TYPE;
|
102
|
+
}
|
103
|
+
}
|
104
|
+
Orders.TYPE = 'orders';
|
105
|
+
exports.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 | null;
|
9
|
+
slug?: string | null;
|
10
|
+
domain?: string | null;
|
11
|
+
support_phone?: string | null;
|
12
|
+
support_email?: string | null;
|
13
|
+
logo_url?: string | null;
|
14
|
+
favicon_url?: string | null;
|
15
|
+
primary_color?: string | null;
|
16
|
+
contrast_color?: string | null;
|
17
|
+
gtm_id?: string | null;
|
18
|
+
gtm_id_test?: string | null;
|
19
|
+
discount_disabled?: boolean | null;
|
20
|
+
account_disabled?: boolean | null;
|
21
|
+
acceptance_disabled?: boolean | null;
|
22
|
+
max_concurrent_promotions?: number | null;
|
23
|
+
max_concurrent_imports?: number | null;
|
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,16 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const resource_1 = require("../resource");
|
4
|
+
class Organizations extends resource_1.ApiSingleton {
|
5
|
+
isOrganization(resource) {
|
6
|
+
return resource.type && (resource.type === Organizations.TYPE);
|
7
|
+
}
|
8
|
+
relationship(id) {
|
9
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: Organizations.TYPE } : { id: id.id, type: Organizations.TYPE };
|
10
|
+
}
|
11
|
+
type() {
|
12
|
+
return Organizations.TYPE;
|
13
|
+
}
|
14
|
+
}
|
15
|
+
Organizations.TYPE = 'organization';
|
16
|
+
exports.default = Organizations;
|
@@ -0,0 +1,56 @@
|
|
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 | null;
|
17
|
+
length: number;
|
18
|
+
width: number;
|
19
|
+
height: number;
|
20
|
+
unit_of_length: string;
|
21
|
+
stock_location?: StockLocation | null;
|
22
|
+
parcels?: Parcel[] | null;
|
23
|
+
attachments?: Attachment[] | null;
|
24
|
+
}
|
25
|
+
interface PackageCreate extends ResourceCreate {
|
26
|
+
name: string;
|
27
|
+
code?: string | null;
|
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 | null;
|
36
|
+
code?: string | null;
|
37
|
+
length?: number | null;
|
38
|
+
width?: number | null;
|
39
|
+
height?: number | null;
|
40
|
+
unit_of_length?: string | null;
|
41
|
+
stock_location?: StockLocationRel | null;
|
42
|
+
}
|
43
|
+
declare class Packages extends ApiResource<Package> {
|
44
|
+
static readonly TYPE: PackageType;
|
45
|
+
create(resource: PackageCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Package>;
|
46
|
+
update(resource: PackageUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Package>;
|
47
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
48
|
+
stock_location(packageId: string | Package, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
|
49
|
+
parcels(packageId: string | Package, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Parcel>>;
|
50
|
+
attachments(packageId: string | Package, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
51
|
+
isPackage(resource: any): resource is Package;
|
52
|
+
relationship(id: string | ResourceId | null): PackageRel;
|
53
|
+
type(): PackageType;
|
54
|
+
}
|
55
|
+
export default Packages;
|
56
|
+
export type { Package, PackageCreate, PackageUpdate, PackageType };
|
@@ -0,0 +1,37 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const resource_1 = require("../resource");
|
4
|
+
class Packages extends resource_1.ApiResource {
|
5
|
+
async create(resource, params, options) {
|
6
|
+
return this.resources.create({ ...resource, type: Packages.TYPE }, params, options);
|
7
|
+
}
|
8
|
+
async update(resource, params, options) {
|
9
|
+
return this.resources.update({ ...resource, type: Packages.TYPE }, params, options);
|
10
|
+
}
|
11
|
+
async delete(id, options) {
|
12
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: Packages.TYPE } : id, options);
|
13
|
+
}
|
14
|
+
async stock_location(packageId, params, options) {
|
15
|
+
const _packageId = packageId.id || packageId;
|
16
|
+
return this.resources.fetch({ type: 'stock_locations' }, `packages/${_packageId}/stock_location`, params, options);
|
17
|
+
}
|
18
|
+
async parcels(packageId, params, options) {
|
19
|
+
const _packageId = packageId.id || packageId;
|
20
|
+
return this.resources.fetch({ type: 'parcels' }, `packages/${_packageId}/parcels`, params, options);
|
21
|
+
}
|
22
|
+
async attachments(packageId, params, options) {
|
23
|
+
const _packageId = packageId.id || packageId;
|
24
|
+
return this.resources.fetch({ type: 'attachments' }, `packages/${_packageId}/attachments`, params, options);
|
25
|
+
}
|
26
|
+
isPackage(resource) {
|
27
|
+
return resource.type && (resource.type === Packages.TYPE);
|
28
|
+
}
|
29
|
+
relationship(id) {
|
30
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: Packages.TYPE } : { id: id.id, type: Packages.TYPE };
|
31
|
+
}
|
32
|
+
type() {
|
33
|
+
return Packages.TYPE;
|
34
|
+
}
|
35
|
+
}
|
36
|
+
Packages.TYPE = 'packages';
|
37
|
+
exports.default = Packages;
|
@@ -0,0 +1,51 @@
|
|
1
|
+
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel } from '../resource';
|
2
|
+
import type { QueryParamsRetrieve } 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 | null;
|
18
|
+
quantity: number;
|
19
|
+
name: string;
|
20
|
+
image_url?: string | null;
|
21
|
+
parcel?: Parcel | null;
|
22
|
+
stock_line_item?: StockLineItem | null;
|
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 | null;
|
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
|
+
create(resource: ParcelLineItemCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ParcelLineItem>;
|
42
|
+
update(resource: ParcelLineItemUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ParcelLineItem>;
|
43
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
44
|
+
parcel(parcelLineItemId: string | ParcelLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Parcel>;
|
45
|
+
stock_line_item(parcelLineItemId: string | ParcelLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLineItem>;
|
46
|
+
isParcelLineItem(resource: any): resource is ParcelLineItem;
|
47
|
+
relationship(id: string | ResourceId | null): ParcelLineItemRel;
|
48
|
+
type(): ParcelLineItemType;
|
49
|
+
}
|
50
|
+
export default ParcelLineItems;
|
51
|
+
export type { ParcelLineItem, ParcelLineItemCreate, ParcelLineItemUpdate, ParcelLineItemType };
|
@@ -0,0 +1,33 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const resource_1 = require("../resource");
|
4
|
+
class ParcelLineItems extends resource_1.ApiResource {
|
5
|
+
async create(resource, params, options) {
|
6
|
+
return this.resources.create({ ...resource, type: ParcelLineItems.TYPE }, params, options);
|
7
|
+
}
|
8
|
+
async update(resource, params, options) {
|
9
|
+
return this.resources.update({ ...resource, type: ParcelLineItems.TYPE }, params, options);
|
10
|
+
}
|
11
|
+
async delete(id, options) {
|
12
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: ParcelLineItems.TYPE } : id, options);
|
13
|
+
}
|
14
|
+
async parcel(parcelLineItemId, params, options) {
|
15
|
+
const _parcelLineItemId = parcelLineItemId.id || parcelLineItemId;
|
16
|
+
return this.resources.fetch({ type: 'parcels' }, `parcel_line_items/${_parcelLineItemId}/parcel`, params, options);
|
17
|
+
}
|
18
|
+
async stock_line_item(parcelLineItemId, params, options) {
|
19
|
+
const _parcelLineItemId = parcelLineItemId.id || parcelLineItemId;
|
20
|
+
return this.resources.fetch({ type: 'stock_line_items' }, `parcel_line_items/${_parcelLineItemId}/stock_line_item`, params, options);
|
21
|
+
}
|
22
|
+
isParcelLineItem(resource) {
|
23
|
+
return resource.type && (resource.type === ParcelLineItems.TYPE);
|
24
|
+
}
|
25
|
+
relationship(id) {
|
26
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: ParcelLineItems.TYPE } : { id: id.id, type: ParcelLineItems.TYPE };
|
27
|
+
}
|
28
|
+
type() {
|
29
|
+
return ParcelLineItems.TYPE;
|
30
|
+
}
|
31
|
+
}
|
32
|
+
ParcelLineItems.TYPE = 'parcel_line_items';
|
33
|
+
exports.default = ParcelLineItems;
|
@@ -0,0 +1,119 @@
|
|
1
|
+
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
3
|
+
import type { Shipment, ShipmentType } from './shipments';
|
4
|
+
import type { Package, PackageType } from './packages';
|
5
|
+
import type { ParcelLineItem } from './parcel_line_items';
|
6
|
+
import type { Attachment } from './attachments';
|
7
|
+
import type { Event } from './events';
|
8
|
+
type ParcelType = 'parcels';
|
9
|
+
type ParcelRel = ResourceRel & {
|
10
|
+
type: ParcelType;
|
11
|
+
};
|
12
|
+
type ShipmentRel = ResourceRel & {
|
13
|
+
type: ShipmentType;
|
14
|
+
};
|
15
|
+
type PackageRel = ResourceRel & {
|
16
|
+
type: PackageType;
|
17
|
+
};
|
18
|
+
interface Parcel extends Resource {
|
19
|
+
readonly type: ParcelType;
|
20
|
+
number?: string | null;
|
21
|
+
weight: number;
|
22
|
+
unit_of_weight: string;
|
23
|
+
eel_pfc?: string | null;
|
24
|
+
contents_type?: string | null;
|
25
|
+
contents_explanation?: string | null;
|
26
|
+
customs_certify?: boolean | null;
|
27
|
+
customs_signer?: string | null;
|
28
|
+
non_delivery_option?: string | null;
|
29
|
+
restriction_type?: string | null;
|
30
|
+
restriction_comments?: string | null;
|
31
|
+
customs_info_required?: boolean | null;
|
32
|
+
shipping_label_url?: string | null;
|
33
|
+
shipping_label_file_type?: string | null;
|
34
|
+
shipping_label_size?: string | null;
|
35
|
+
shipping_label_resolution?: string | null;
|
36
|
+
tracking_number?: string | null;
|
37
|
+
tracking_status?: string | null;
|
38
|
+
tracking_status_detail?: string | null;
|
39
|
+
tracking_status_updated_at?: string | null;
|
40
|
+
tracking_details?: string | null;
|
41
|
+
carrier_weight_oz?: string | null;
|
42
|
+
signed_by?: string | null;
|
43
|
+
incoterm?: string | null;
|
44
|
+
shipment?: Shipment | null;
|
45
|
+
package?: Package | null;
|
46
|
+
parcel_line_items?: ParcelLineItem[] | null;
|
47
|
+
attachments?: Attachment[] | null;
|
48
|
+
events?: Event[] | null;
|
49
|
+
}
|
50
|
+
interface ParcelCreate extends ResourceCreate {
|
51
|
+
weight: number;
|
52
|
+
unit_of_weight: string;
|
53
|
+
eel_pfc?: string | null;
|
54
|
+
contents_type?: string | null;
|
55
|
+
contents_explanation?: string | null;
|
56
|
+
customs_certify?: boolean | null;
|
57
|
+
customs_signer?: string | null;
|
58
|
+
non_delivery_option?: string | null;
|
59
|
+
restriction_type?: string | null;
|
60
|
+
restriction_comments?: string | null;
|
61
|
+
customs_info_required?: boolean | null;
|
62
|
+
shipping_label_url?: string | null;
|
63
|
+
shipping_label_file_type?: string | null;
|
64
|
+
shipping_label_size?: string | null;
|
65
|
+
shipping_label_resolution?: string | null;
|
66
|
+
tracking_number?: string | null;
|
67
|
+
tracking_status?: string | null;
|
68
|
+
tracking_status_detail?: string | null;
|
69
|
+
tracking_status_updated_at?: string | null;
|
70
|
+
tracking_details?: string | null;
|
71
|
+
carrier_weight_oz?: string | null;
|
72
|
+
signed_by?: string | null;
|
73
|
+
incoterm?: string | null;
|
74
|
+
shipment: ShipmentRel;
|
75
|
+
package: PackageRel;
|
76
|
+
}
|
77
|
+
interface ParcelUpdate extends ResourceUpdate {
|
78
|
+
weight?: number | null;
|
79
|
+
unit_of_weight?: string | null;
|
80
|
+
eel_pfc?: string | null;
|
81
|
+
contents_type?: string | null;
|
82
|
+
contents_explanation?: string | null;
|
83
|
+
customs_certify?: boolean | null;
|
84
|
+
customs_signer?: string | null;
|
85
|
+
non_delivery_option?: string | null;
|
86
|
+
restriction_type?: string | null;
|
87
|
+
restriction_comments?: string | null;
|
88
|
+
customs_info_required?: boolean | null;
|
89
|
+
shipping_label_url?: string | null;
|
90
|
+
shipping_label_file_type?: string | null;
|
91
|
+
shipping_label_size?: string | null;
|
92
|
+
shipping_label_resolution?: string | null;
|
93
|
+
tracking_number?: string | null;
|
94
|
+
tracking_status?: string | null;
|
95
|
+
tracking_status_detail?: string | null;
|
96
|
+
tracking_status_updated_at?: string | null;
|
97
|
+
tracking_details?: string | null;
|
98
|
+
carrier_weight_oz?: string | null;
|
99
|
+
signed_by?: string | null;
|
100
|
+
incoterm?: string | null;
|
101
|
+
shipment?: ShipmentRel | null;
|
102
|
+
package?: PackageRel | null;
|
103
|
+
}
|
104
|
+
declare class Parcels extends ApiResource<Parcel> {
|
105
|
+
static readonly TYPE: ParcelType;
|
106
|
+
create(resource: ParcelCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Parcel>;
|
107
|
+
update(resource: ParcelUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Parcel>;
|
108
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
109
|
+
shipment(parcelId: string | Parcel, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Shipment>;
|
110
|
+
package(parcelId: string | Parcel, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Package>;
|
111
|
+
parcel_line_items(parcelId: string | Parcel, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ParcelLineItem>>;
|
112
|
+
attachments(parcelId: string | Parcel, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
113
|
+
events(parcelId: string | Parcel, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
114
|
+
isParcel(resource: any): resource is Parcel;
|
115
|
+
relationship(id: string | ResourceId | null): ParcelRel;
|
116
|
+
type(): ParcelType;
|
117
|
+
}
|
118
|
+
export default Parcels;
|
119
|
+
export type { Parcel, ParcelCreate, ParcelUpdate, ParcelType };
|
@@ -0,0 +1,45 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const resource_1 = require("../resource");
|
4
|
+
class Parcels extends resource_1.ApiResource {
|
5
|
+
async create(resource, params, options) {
|
6
|
+
return this.resources.create({ ...resource, type: Parcels.TYPE }, params, options);
|
7
|
+
}
|
8
|
+
async update(resource, params, options) {
|
9
|
+
return this.resources.update({ ...resource, type: Parcels.TYPE }, params, options);
|
10
|
+
}
|
11
|
+
async delete(id, options) {
|
12
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: Parcels.TYPE } : id, options);
|
13
|
+
}
|
14
|
+
async shipment(parcelId, params, options) {
|
15
|
+
const _parcelId = parcelId.id || parcelId;
|
16
|
+
return this.resources.fetch({ type: 'shipments' }, `parcels/${_parcelId}/shipment`, params, options);
|
17
|
+
}
|
18
|
+
async package(parcelId, params, options) {
|
19
|
+
const _parcelId = parcelId.id || parcelId;
|
20
|
+
return this.resources.fetch({ type: 'packages' }, `parcels/${_parcelId}/package`, params, options);
|
21
|
+
}
|
22
|
+
async parcel_line_items(parcelId, params, options) {
|
23
|
+
const _parcelId = parcelId.id || parcelId;
|
24
|
+
return this.resources.fetch({ type: 'parcel_line_items' }, `parcels/${_parcelId}/parcel_line_items`, params, options);
|
25
|
+
}
|
26
|
+
async attachments(parcelId, params, options) {
|
27
|
+
const _parcelId = parcelId.id || parcelId;
|
28
|
+
return this.resources.fetch({ type: 'attachments' }, `parcels/${_parcelId}/attachments`, params, options);
|
29
|
+
}
|
30
|
+
async events(parcelId, params, options) {
|
31
|
+
const _parcelId = parcelId.id || parcelId;
|
32
|
+
return this.resources.fetch({ type: 'events' }, `parcels/${_parcelId}/events`, params, options);
|
33
|
+
}
|
34
|
+
isParcel(resource) {
|
35
|
+
return resource.type && (resource.type === Parcels.TYPE);
|
36
|
+
}
|
37
|
+
relationship(id) {
|
38
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: Parcels.TYPE } : { id: id.id, type: Parcels.TYPE };
|
39
|
+
}
|
40
|
+
type() {
|
41
|
+
return Parcels.TYPE;
|
42
|
+
}
|
43
|
+
}
|
44
|
+
Parcels.TYPE = 'parcels';
|
45
|
+
exports.default = Parcels;
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { ApiResource, Resource, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsList } from '../query';
|
3
|
+
import type { PaymentMethod } from './payment_methods';
|
4
|
+
type PaymentGatewayType = 'payment_gateways';
|
5
|
+
type PaymentGatewayRel = ResourceRel & {
|
6
|
+
type: PaymentGatewayType;
|
7
|
+
};
|
8
|
+
interface PaymentGateway extends Resource {
|
9
|
+
readonly type: PaymentGatewayType;
|
10
|
+
name: string;
|
11
|
+
payment_methods?: PaymentMethod[] | null;
|
12
|
+
}
|
13
|
+
declare class PaymentGateways extends ApiResource<PaymentGateway> {
|
14
|
+
static readonly TYPE: PaymentGatewayType;
|
15
|
+
payment_methods(paymentGatewayId: string | PaymentGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>>;
|
16
|
+
isPaymentGateway(resource: any): resource is PaymentGateway;
|
17
|
+
relationship(id: string | ResourceId | null): PaymentGatewayRel;
|
18
|
+
type(): PaymentGatewayType;
|
19
|
+
}
|
20
|
+
export default PaymentGateways;
|
21
|
+
export type { PaymentGateway, PaymentGatewayType };
|
@@ -0,0 +1,20 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const resource_1 = require("../resource");
|
4
|
+
class PaymentGateways extends resource_1.ApiResource {
|
5
|
+
async payment_methods(paymentGatewayId, params, options) {
|
6
|
+
const _paymentGatewayId = paymentGatewayId.id || paymentGatewayId;
|
7
|
+
return this.resources.fetch({ type: 'payment_methods' }, `payment_gateways/${_paymentGatewayId}/payment_methods`, params, options);
|
8
|
+
}
|
9
|
+
isPaymentGateway(resource) {
|
10
|
+
return resource.type && (resource.type === PaymentGateways.TYPE);
|
11
|
+
}
|
12
|
+
relationship(id) {
|
13
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: PaymentGateways.TYPE } : { id: id.id, type: PaymentGateways.TYPE };
|
14
|
+
}
|
15
|
+
type() {
|
16
|
+
return PaymentGateways.TYPE;
|
17
|
+
}
|
18
|
+
}
|
19
|
+
PaymentGateways.TYPE = 'payment_gateways';
|
20
|
+
exports.default = PaymentGateways;
|
@@ -0,0 +1,72 @@
|
|
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 { PaymentGateway, PaymentGatewayType } from './payment_gateways';
|
5
|
+
import type { Attachment } from './attachments';
|
6
|
+
type PaymentMethodType = 'payment_methods';
|
7
|
+
type PaymentMethodRel = ResourceRel & {
|
8
|
+
type: PaymentMethodType;
|
9
|
+
};
|
10
|
+
type MarketRel = ResourceRel & {
|
11
|
+
type: MarketType;
|
12
|
+
};
|
13
|
+
type PaymentGatewayRel = ResourceRel & {
|
14
|
+
type: PaymentGatewayType;
|
15
|
+
};
|
16
|
+
interface PaymentMethod extends Resource {
|
17
|
+
readonly type: PaymentMethodType;
|
18
|
+
payment_source_type: string;
|
19
|
+
name?: string | null;
|
20
|
+
currency_code?: string | null;
|
21
|
+
moto?: boolean | null;
|
22
|
+
require_capture?: boolean | null;
|
23
|
+
auto_capture?: boolean | null;
|
24
|
+
disabled_at?: string | null;
|
25
|
+
price_amount_cents: number;
|
26
|
+
price_amount_float?: number | null;
|
27
|
+
formatted_price_amount?: string | null;
|
28
|
+
auto_capture_max_amount_cents?: number | null;
|
29
|
+
auto_capture_max_amount_float?: number | null;
|
30
|
+
formatted_auto_capture_max_amount?: string | null;
|
31
|
+
market?: Market | null;
|
32
|
+
payment_gateway?: PaymentGateway | null;
|
33
|
+
attachments?: Attachment[] | null;
|
34
|
+
}
|
35
|
+
interface PaymentMethodCreate extends ResourceCreate {
|
36
|
+
payment_source_type: string;
|
37
|
+
currency_code?: string | null;
|
38
|
+
moto?: boolean | null;
|
39
|
+
require_capture?: boolean | null;
|
40
|
+
auto_capture?: boolean | null;
|
41
|
+
price_amount_cents: number;
|
42
|
+
auto_capture_max_amount_cents?: number | null;
|
43
|
+
market?: MarketRel | null;
|
44
|
+
payment_gateway: PaymentGatewayRel;
|
45
|
+
}
|
46
|
+
interface PaymentMethodUpdate extends ResourceUpdate {
|
47
|
+
payment_source_type?: string | null;
|
48
|
+
currency_code?: string | null;
|
49
|
+
moto?: boolean | null;
|
50
|
+
require_capture?: boolean | null;
|
51
|
+
auto_capture?: boolean | null;
|
52
|
+
_disable?: boolean | null;
|
53
|
+
_enable?: boolean | null;
|
54
|
+
price_amount_cents?: number | null;
|
55
|
+
auto_capture_max_amount_cents?: number | null;
|
56
|
+
market?: MarketRel | null;
|
57
|
+
payment_gateway?: PaymentGatewayRel | null;
|
58
|
+
}
|
59
|
+
declare class PaymentMethods extends ApiResource<PaymentMethod> {
|
60
|
+
static readonly TYPE: PaymentMethodType;
|
61
|
+
create(resource: PaymentMethodCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentMethod>;
|
62
|
+
update(resource: PaymentMethodUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentMethod>;
|
63
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
64
|
+
market(paymentMethodId: string | PaymentMethod, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
|
65
|
+
payment_gateway(paymentMethodId: string | PaymentMethod, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentGateway>;
|
66
|
+
attachments(paymentMethodId: string | PaymentMethod, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
67
|
+
isPaymentMethod(resource: any): resource is PaymentMethod;
|
68
|
+
relationship(id: string | ResourceId | null): PaymentMethodRel;
|
69
|
+
type(): PaymentMethodType;
|
70
|
+
}
|
71
|
+
export default PaymentMethods;
|
72
|
+
export type { PaymentMethod, PaymentMethodCreate, PaymentMethodUpdate, PaymentMethodType };
|
@@ -0,0 +1,37 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const resource_1 = require("../resource");
|
4
|
+
class PaymentMethods extends resource_1.ApiResource {
|
5
|
+
async create(resource, params, options) {
|
6
|
+
return this.resources.create({ ...resource, type: PaymentMethods.TYPE }, params, options);
|
7
|
+
}
|
8
|
+
async update(resource, params, options) {
|
9
|
+
return this.resources.update({ ...resource, type: PaymentMethods.TYPE }, params, options);
|
10
|
+
}
|
11
|
+
async delete(id, options) {
|
12
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: PaymentMethods.TYPE } : id, options);
|
13
|
+
}
|
14
|
+
async market(paymentMethodId, params, options) {
|
15
|
+
const _paymentMethodId = paymentMethodId.id || paymentMethodId;
|
16
|
+
return this.resources.fetch({ type: 'markets' }, `payment_methods/${_paymentMethodId}/market`, params, options);
|
17
|
+
}
|
18
|
+
async payment_gateway(paymentMethodId, params, options) {
|
19
|
+
const _paymentMethodId = paymentMethodId.id || paymentMethodId;
|
20
|
+
return this.resources.fetch({ type: 'payment_gateways' }, `payment_methods/${_paymentMethodId}/payment_gateway`, params, options);
|
21
|
+
}
|
22
|
+
async attachments(paymentMethodId, params, options) {
|
23
|
+
const _paymentMethodId = paymentMethodId.id || paymentMethodId;
|
24
|
+
return this.resources.fetch({ type: 'attachments' }, `payment_methods/${_paymentMethodId}/attachments`, params, options);
|
25
|
+
}
|
26
|
+
isPaymentMethod(resource) {
|
27
|
+
return resource.type && (resource.type === PaymentMethods.TYPE);
|
28
|
+
}
|
29
|
+
relationship(id) {
|
30
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: PaymentMethods.TYPE } : { id: id.id, type: PaymentMethods.TYPE };
|
31
|
+
}
|
32
|
+
type() {
|
33
|
+
return PaymentMethods.TYPE;
|
34
|
+
}
|
35
|
+
}
|
36
|
+
PaymentMethods.TYPE = 'payment_methods';
|
37
|
+
exports.default = PaymentMethods;
|