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