@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,49 @@
|
|
1
|
+
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
3
|
+
import type { PaymentMethod } from './payment_methods';
|
4
|
+
import type { ExternalPayment } from './external_payments';
|
5
|
+
type ExternalGatewayType = 'external_gateways';
|
6
|
+
type ExternalGatewayRel = ResourceRel & {
|
7
|
+
type: ExternalGatewayType;
|
8
|
+
};
|
9
|
+
interface ExternalGateway extends Resource {
|
10
|
+
readonly type: ExternalGatewayType;
|
11
|
+
name: string;
|
12
|
+
shared_secret: string;
|
13
|
+
authorize_url?: string | null;
|
14
|
+
capture_url?: string | null;
|
15
|
+
void_url?: string | null;
|
16
|
+
refund_url?: string | null;
|
17
|
+
token_url?: string | null;
|
18
|
+
payment_methods?: PaymentMethod[] | null;
|
19
|
+
external_payments?: ExternalPayment[] | null;
|
20
|
+
}
|
21
|
+
interface ExternalGatewayCreate extends ResourceCreate {
|
22
|
+
name: string;
|
23
|
+
authorize_url?: string | null;
|
24
|
+
capture_url?: string | null;
|
25
|
+
void_url?: string | null;
|
26
|
+
refund_url?: string | null;
|
27
|
+
token_url?: string | null;
|
28
|
+
}
|
29
|
+
interface ExternalGatewayUpdate extends ResourceUpdate {
|
30
|
+
name?: string | null;
|
31
|
+
authorize_url?: string | null;
|
32
|
+
capture_url?: string | null;
|
33
|
+
void_url?: string | null;
|
34
|
+
refund_url?: string | null;
|
35
|
+
token_url?: string | null;
|
36
|
+
}
|
37
|
+
declare class ExternalGateways extends ApiResource<ExternalGateway> {
|
38
|
+
static readonly TYPE: ExternalGatewayType;
|
39
|
+
create(resource: ExternalGatewayCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ExternalGateway>;
|
40
|
+
update(resource: ExternalGatewayUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ExternalGateway>;
|
41
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
42
|
+
payment_methods(externalGatewayId: string | ExternalGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>>;
|
43
|
+
external_payments(externalGatewayId: string | ExternalGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ExternalPayment>>;
|
44
|
+
isExternalGateway(resource: any): resource is ExternalGateway;
|
45
|
+
relationship(id: string | ResourceId | null): ExternalGatewayRel;
|
46
|
+
type(): ExternalGatewayType;
|
47
|
+
}
|
48
|
+
export default ExternalGateways;
|
49
|
+
export type { ExternalGateway, ExternalGatewayCreate, ExternalGatewayUpdate, ExternalGatewayType };
|
@@ -0,0 +1,33 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const resource_1 = require("../resource");
|
4
|
+
class ExternalGateways extends resource_1.ApiResource {
|
5
|
+
async create(resource, params, options) {
|
6
|
+
return this.resources.create({ ...resource, type: ExternalGateways.TYPE }, params, options);
|
7
|
+
}
|
8
|
+
async update(resource, params, options) {
|
9
|
+
return this.resources.update({ ...resource, type: ExternalGateways.TYPE }, params, options);
|
10
|
+
}
|
11
|
+
async delete(id, options) {
|
12
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: ExternalGateways.TYPE } : id, options);
|
13
|
+
}
|
14
|
+
async payment_methods(externalGatewayId, params, options) {
|
15
|
+
const _externalGatewayId = externalGatewayId.id || externalGatewayId;
|
16
|
+
return this.resources.fetch({ type: 'payment_methods' }, `external_gateways/${_externalGatewayId}/payment_methods`, params, options);
|
17
|
+
}
|
18
|
+
async external_payments(externalGatewayId, params, options) {
|
19
|
+
const _externalGatewayId = externalGatewayId.id || externalGatewayId;
|
20
|
+
return this.resources.fetch({ type: 'external_payments' }, `external_gateways/${_externalGatewayId}/external_payments`, params, options);
|
21
|
+
}
|
22
|
+
isExternalGateway(resource) {
|
23
|
+
return resource.type && (resource.type === ExternalGateways.TYPE);
|
24
|
+
}
|
25
|
+
relationship(id) {
|
26
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: ExternalGateways.TYPE } : { id: id.id, type: ExternalGateways.TYPE };
|
27
|
+
}
|
28
|
+
type() {
|
29
|
+
return ExternalGateways.TYPE;
|
30
|
+
}
|
31
|
+
}
|
32
|
+
ExternalGateways.TYPE = 'external_gateways';
|
33
|
+
exports.default = ExternalGateways;
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel } from '../resource';
|
2
|
+
import type { QueryParamsRetrieve } from '../query';
|
3
|
+
import type { Order, OrderType } from './orders';
|
4
|
+
import type { PaymentGateway } from './payment_gateways';
|
5
|
+
import type { CustomerPaymentSource } from './customer_payment_sources';
|
6
|
+
type ExternalPaymentType = 'external_payments';
|
7
|
+
type ExternalPaymentRel = ResourceRel & {
|
8
|
+
type: ExternalPaymentType;
|
9
|
+
};
|
10
|
+
type OrderRel = ResourceRel & {
|
11
|
+
type: OrderType;
|
12
|
+
};
|
13
|
+
interface ExternalPayment extends Resource {
|
14
|
+
readonly type: ExternalPaymentType;
|
15
|
+
payment_source_token: string;
|
16
|
+
options?: object | null;
|
17
|
+
payment_instrument?: object | null;
|
18
|
+
order?: Order | null;
|
19
|
+
payment_gateway?: PaymentGateway | null;
|
20
|
+
wallet?: CustomerPaymentSource | null;
|
21
|
+
}
|
22
|
+
interface ExternalPaymentCreate extends ResourceCreate {
|
23
|
+
payment_source_token: string;
|
24
|
+
options?: object | null;
|
25
|
+
order: OrderRel;
|
26
|
+
}
|
27
|
+
interface ExternalPaymentUpdate extends ResourceUpdate {
|
28
|
+
options?: object | null;
|
29
|
+
order?: OrderRel | null;
|
30
|
+
}
|
31
|
+
declare class ExternalPayments extends ApiResource<ExternalPayment> {
|
32
|
+
static readonly TYPE: ExternalPaymentType;
|
33
|
+
create(resource: ExternalPaymentCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ExternalPayment>;
|
34
|
+
update(resource: ExternalPaymentUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ExternalPayment>;
|
35
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
36
|
+
order(externalPaymentId: string | ExternalPayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
37
|
+
payment_gateway(externalPaymentId: string | ExternalPayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentGateway>;
|
38
|
+
wallet(externalPaymentId: string | ExternalPayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomerPaymentSource>;
|
39
|
+
isExternalPayment(resource: any): resource is ExternalPayment;
|
40
|
+
relationship(id: string | ResourceId | null): ExternalPaymentRel;
|
41
|
+
type(): ExternalPaymentType;
|
42
|
+
}
|
43
|
+
export default ExternalPayments;
|
44
|
+
export type { ExternalPayment, ExternalPaymentCreate, ExternalPaymentUpdate, ExternalPaymentType };
|
@@ -0,0 +1,37 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const resource_1 = require("../resource");
|
4
|
+
class ExternalPayments extends resource_1.ApiResource {
|
5
|
+
async create(resource, params, options) {
|
6
|
+
return this.resources.create({ ...resource, type: ExternalPayments.TYPE }, params, options);
|
7
|
+
}
|
8
|
+
async update(resource, params, options) {
|
9
|
+
return this.resources.update({ ...resource, type: ExternalPayments.TYPE }, params, options);
|
10
|
+
}
|
11
|
+
async delete(id, options) {
|
12
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: ExternalPayments.TYPE } : id, options);
|
13
|
+
}
|
14
|
+
async order(externalPaymentId, params, options) {
|
15
|
+
const _externalPaymentId = externalPaymentId.id || externalPaymentId;
|
16
|
+
return this.resources.fetch({ type: 'orders' }, `external_payments/${_externalPaymentId}/order`, params, options);
|
17
|
+
}
|
18
|
+
async payment_gateway(externalPaymentId, params, options) {
|
19
|
+
const _externalPaymentId = externalPaymentId.id || externalPaymentId;
|
20
|
+
return this.resources.fetch({ type: 'payment_gateways' }, `external_payments/${_externalPaymentId}/payment_gateway`, params, options);
|
21
|
+
}
|
22
|
+
async wallet(externalPaymentId, params, options) {
|
23
|
+
const _externalPaymentId = externalPaymentId.id || externalPaymentId;
|
24
|
+
return this.resources.fetch({ type: 'customer_payment_sources' }, `external_payments/${_externalPaymentId}/wallet`, params, options);
|
25
|
+
}
|
26
|
+
isExternalPayment(resource) {
|
27
|
+
return resource.type && (resource.type === ExternalPayments.TYPE);
|
28
|
+
}
|
29
|
+
relationship(id) {
|
30
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: ExternalPayments.TYPE } : { id: id.id, type: ExternalPayments.TYPE };
|
31
|
+
}
|
32
|
+
type() {
|
33
|
+
return ExternalPayments.TYPE;
|
34
|
+
}
|
35
|
+
}
|
36
|
+
ExternalPayments.TYPE = 'external_payments';
|
37
|
+
exports.default = ExternalPayments;
|
@@ -0,0 +1,90 @@
|
|
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 { PromotionRule, PromotionRuleType } from './promotion_rules';
|
5
|
+
import type { OrderAmountPromotionRule, OrderAmountPromotionRuleType } from './order_amount_promotion_rules';
|
6
|
+
import type { SkuListPromotionRule, SkuListPromotionRuleType } from './sku_list_promotion_rules';
|
7
|
+
import type { CouponCodesPromotionRule, CouponCodesPromotionRuleType } from './coupon_codes_promotion_rules';
|
8
|
+
import type { Attachment } from './attachments';
|
9
|
+
import type { Event } from './events';
|
10
|
+
type ExternalPromotionType = 'external_promotions';
|
11
|
+
type ExternalPromotionRel = ResourceRel & {
|
12
|
+
type: ExternalPromotionType;
|
13
|
+
};
|
14
|
+
type MarketRel = ResourceRel & {
|
15
|
+
type: MarketType;
|
16
|
+
};
|
17
|
+
type PromotionRuleRel = ResourceRel & {
|
18
|
+
type: PromotionRuleType;
|
19
|
+
};
|
20
|
+
type OrderAmountPromotionRuleRel = ResourceRel & {
|
21
|
+
type: OrderAmountPromotionRuleType;
|
22
|
+
};
|
23
|
+
type SkuListPromotionRuleRel = ResourceRel & {
|
24
|
+
type: SkuListPromotionRuleType;
|
25
|
+
};
|
26
|
+
type CouponCodesPromotionRuleRel = ResourceRel & {
|
27
|
+
type: CouponCodesPromotionRuleType;
|
28
|
+
};
|
29
|
+
interface ExternalPromotion extends Resource {
|
30
|
+
readonly type: ExternalPromotionType;
|
31
|
+
name: string;
|
32
|
+
currency_code?: string | null;
|
33
|
+
starts_at: string;
|
34
|
+
expires_at: string;
|
35
|
+
total_usage_limit: number;
|
36
|
+
total_usage_count?: number | null;
|
37
|
+
active?: boolean | null;
|
38
|
+
promotion_url: string;
|
39
|
+
shared_secret: string;
|
40
|
+
market?: Market | null;
|
41
|
+
promotion_rules?: PromotionRule[] | null;
|
42
|
+
order_amount_promotion_rule?: OrderAmountPromotionRule | null;
|
43
|
+
sku_list_promotion_rule?: SkuListPromotionRule | null;
|
44
|
+
coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
|
45
|
+
attachments?: Attachment[] | null;
|
46
|
+
events?: Event[] | null;
|
47
|
+
}
|
48
|
+
interface ExternalPromotionCreate extends ResourceCreate {
|
49
|
+
name: string;
|
50
|
+
currency_code?: string | null;
|
51
|
+
starts_at: string;
|
52
|
+
expires_at: string;
|
53
|
+
total_usage_limit: number;
|
54
|
+
promotion_url: string;
|
55
|
+
market?: MarketRel | null;
|
56
|
+
promotion_rules?: PromotionRuleRel[] | null;
|
57
|
+
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
58
|
+
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
59
|
+
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
60
|
+
}
|
61
|
+
interface ExternalPromotionUpdate extends ResourceUpdate {
|
62
|
+
name?: string | null;
|
63
|
+
currency_code?: string | null;
|
64
|
+
starts_at?: string | null;
|
65
|
+
expires_at?: string | null;
|
66
|
+
total_usage_limit?: number | null;
|
67
|
+
promotion_url?: string | null;
|
68
|
+
market?: MarketRel | null;
|
69
|
+
promotion_rules?: PromotionRuleRel[] | null;
|
70
|
+
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
71
|
+
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
72
|
+
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
73
|
+
}
|
74
|
+
declare class ExternalPromotions extends ApiResource<ExternalPromotion> {
|
75
|
+
static readonly TYPE: ExternalPromotionType;
|
76
|
+
create(resource: ExternalPromotionCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ExternalPromotion>;
|
77
|
+
update(resource: ExternalPromotionUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ExternalPromotion>;
|
78
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
79
|
+
market(externalPromotionId: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
|
80
|
+
order_amount_promotion_rule(externalPromotionId: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
81
|
+
sku_list_promotion_rule(externalPromotionId: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
82
|
+
coupon_codes_promotion_rule(externalPromotionId: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
83
|
+
attachments(externalPromotionId: string | ExternalPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
84
|
+
events(externalPromotionId: string | ExternalPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
85
|
+
isExternalPromotion(resource: any): resource is ExternalPromotion;
|
86
|
+
relationship(id: string | ResourceId | null): ExternalPromotionRel;
|
87
|
+
type(): ExternalPromotionType;
|
88
|
+
}
|
89
|
+
export default ExternalPromotions;
|
90
|
+
export type { ExternalPromotion, ExternalPromotionCreate, ExternalPromotionUpdate, ExternalPromotionType };
|
@@ -0,0 +1,49 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const resource_1 = require("../resource");
|
4
|
+
class ExternalPromotions extends resource_1.ApiResource {
|
5
|
+
async create(resource, params, options) {
|
6
|
+
return this.resources.create({ ...resource, type: ExternalPromotions.TYPE }, params, options);
|
7
|
+
}
|
8
|
+
async update(resource, params, options) {
|
9
|
+
return this.resources.update({ ...resource, type: ExternalPromotions.TYPE }, params, options);
|
10
|
+
}
|
11
|
+
async delete(id, options) {
|
12
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: ExternalPromotions.TYPE } : id, options);
|
13
|
+
}
|
14
|
+
async market(externalPromotionId, params, options) {
|
15
|
+
const _externalPromotionId = externalPromotionId.id || externalPromotionId;
|
16
|
+
return this.resources.fetch({ type: 'markets' }, `external_promotions/${_externalPromotionId}/market`, params, options);
|
17
|
+
}
|
18
|
+
async order_amount_promotion_rule(externalPromotionId, params, options) {
|
19
|
+
const _externalPromotionId = externalPromotionId.id || externalPromotionId;
|
20
|
+
return this.resources.fetch({ type: 'order_amount_promotion_rules' }, `external_promotions/${_externalPromotionId}/order_amount_promotion_rule`, params, options);
|
21
|
+
}
|
22
|
+
async sku_list_promotion_rule(externalPromotionId, params, options) {
|
23
|
+
const _externalPromotionId = externalPromotionId.id || externalPromotionId;
|
24
|
+
return this.resources.fetch({ type: 'sku_list_promotion_rules' }, `external_promotions/${_externalPromotionId}/sku_list_promotion_rule`, params, options);
|
25
|
+
}
|
26
|
+
async coupon_codes_promotion_rule(externalPromotionId, params, options) {
|
27
|
+
const _externalPromotionId = externalPromotionId.id || externalPromotionId;
|
28
|
+
return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `external_promotions/${_externalPromotionId}/coupon_codes_promotion_rule`, params, options);
|
29
|
+
}
|
30
|
+
async attachments(externalPromotionId, params, options) {
|
31
|
+
const _externalPromotionId = externalPromotionId.id || externalPromotionId;
|
32
|
+
return this.resources.fetch({ type: 'attachments' }, `external_promotions/${_externalPromotionId}/attachments`, params, options);
|
33
|
+
}
|
34
|
+
async events(externalPromotionId, params, options) {
|
35
|
+
const _externalPromotionId = externalPromotionId.id || externalPromotionId;
|
36
|
+
return this.resources.fetch({ type: 'events' }, `external_promotions/${_externalPromotionId}/events`, params, options);
|
37
|
+
}
|
38
|
+
isExternalPromotion(resource) {
|
39
|
+
return resource.type && (resource.type === ExternalPromotions.TYPE);
|
40
|
+
}
|
41
|
+
relationship(id) {
|
42
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: ExternalPromotions.TYPE } : { id: id.id, type: ExternalPromotions.TYPE };
|
43
|
+
}
|
44
|
+
type() {
|
45
|
+
return ExternalPromotions.TYPE;
|
46
|
+
}
|
47
|
+
}
|
48
|
+
ExternalPromotions.TYPE = 'external_promotions';
|
49
|
+
exports.default = ExternalPromotions;
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
3
|
+
import type { Market } from './markets';
|
4
|
+
import type { Attachment } from './attachments';
|
5
|
+
type ExternalTaxCalculatorType = 'external_tax_calculators';
|
6
|
+
type ExternalTaxCalculatorRel = ResourceRel & {
|
7
|
+
type: ExternalTaxCalculatorType;
|
8
|
+
};
|
9
|
+
interface ExternalTaxCalculator extends Resource {
|
10
|
+
readonly type: ExternalTaxCalculatorType;
|
11
|
+
name: string;
|
12
|
+
tax_calculator_url: string;
|
13
|
+
shared_secret: string;
|
14
|
+
markets?: Market[] | null;
|
15
|
+
attachments?: Attachment[] | null;
|
16
|
+
}
|
17
|
+
interface ExternalTaxCalculatorCreate extends ResourceCreate {
|
18
|
+
name: string;
|
19
|
+
tax_calculator_url: string;
|
20
|
+
}
|
21
|
+
interface ExternalTaxCalculatorUpdate extends ResourceUpdate {
|
22
|
+
name?: string | null;
|
23
|
+
tax_calculator_url?: string | null;
|
24
|
+
}
|
25
|
+
declare class ExternalTaxCalculators extends ApiResource<ExternalTaxCalculator> {
|
26
|
+
static readonly TYPE: ExternalTaxCalculatorType;
|
27
|
+
create(resource: ExternalTaxCalculatorCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ExternalTaxCalculator>;
|
28
|
+
update(resource: ExternalTaxCalculatorUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ExternalTaxCalculator>;
|
29
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
30
|
+
markets(externalTaxCalculatorId: string | ExternalTaxCalculator, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Market>>;
|
31
|
+
attachments(externalTaxCalculatorId: string | ExternalTaxCalculator, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
32
|
+
isExternalTaxCalculator(resource: any): resource is ExternalTaxCalculator;
|
33
|
+
relationship(id: string | ResourceId | null): ExternalTaxCalculatorRel;
|
34
|
+
type(): ExternalTaxCalculatorType;
|
35
|
+
}
|
36
|
+
export default ExternalTaxCalculators;
|
37
|
+
export type { ExternalTaxCalculator, ExternalTaxCalculatorCreate, ExternalTaxCalculatorUpdate, ExternalTaxCalculatorType };
|
@@ -0,0 +1,33 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const resource_1 = require("../resource");
|
4
|
+
class ExternalTaxCalculators extends resource_1.ApiResource {
|
5
|
+
async create(resource, params, options) {
|
6
|
+
return this.resources.create({ ...resource, type: ExternalTaxCalculators.TYPE }, params, options);
|
7
|
+
}
|
8
|
+
async update(resource, params, options) {
|
9
|
+
return this.resources.update({ ...resource, type: ExternalTaxCalculators.TYPE }, params, options);
|
10
|
+
}
|
11
|
+
async delete(id, options) {
|
12
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: ExternalTaxCalculators.TYPE } : id, options);
|
13
|
+
}
|
14
|
+
async markets(externalTaxCalculatorId, params, options) {
|
15
|
+
const _externalTaxCalculatorId = externalTaxCalculatorId.id || externalTaxCalculatorId;
|
16
|
+
return this.resources.fetch({ type: 'markets' }, `external_tax_calculators/${_externalTaxCalculatorId}/markets`, params, options);
|
17
|
+
}
|
18
|
+
async attachments(externalTaxCalculatorId, params, options) {
|
19
|
+
const _externalTaxCalculatorId = externalTaxCalculatorId.id || externalTaxCalculatorId;
|
20
|
+
return this.resources.fetch({ type: 'attachments' }, `external_tax_calculators/${_externalTaxCalculatorId}/attachments`, params, options);
|
21
|
+
}
|
22
|
+
isExternalTaxCalculator(resource) {
|
23
|
+
return resource.type && (resource.type === ExternalTaxCalculators.TYPE);
|
24
|
+
}
|
25
|
+
relationship(id) {
|
26
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: ExternalTaxCalculators.TYPE } : { id: id.id, type: ExternalTaxCalculators.TYPE };
|
27
|
+
}
|
28
|
+
type() {
|
29
|
+
return ExternalTaxCalculators.TYPE;
|
30
|
+
}
|
31
|
+
}
|
32
|
+
ExternalTaxCalculators.TYPE = 'external_tax_calculators';
|
33
|
+
exports.default = ExternalTaxCalculators;
|
@@ -0,0 +1,91 @@
|
|
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 { PromotionRule, PromotionRuleType } from './promotion_rules';
|
5
|
+
import type { OrderAmountPromotionRule, OrderAmountPromotionRuleType } from './order_amount_promotion_rules';
|
6
|
+
import type { SkuListPromotionRule, SkuListPromotionRuleType } from './sku_list_promotion_rules';
|
7
|
+
import type { CouponCodesPromotionRule, CouponCodesPromotionRuleType } from './coupon_codes_promotion_rules';
|
8
|
+
import type { Attachment } from './attachments';
|
9
|
+
import type { Event } from './events';
|
10
|
+
type FixedAmountPromotionType = 'fixed_amount_promotions';
|
11
|
+
type FixedAmountPromotionRel = ResourceRel & {
|
12
|
+
type: FixedAmountPromotionType;
|
13
|
+
};
|
14
|
+
type MarketRel = ResourceRel & {
|
15
|
+
type: MarketType;
|
16
|
+
};
|
17
|
+
type PromotionRuleRel = ResourceRel & {
|
18
|
+
type: PromotionRuleType;
|
19
|
+
};
|
20
|
+
type OrderAmountPromotionRuleRel = ResourceRel & {
|
21
|
+
type: OrderAmountPromotionRuleType;
|
22
|
+
};
|
23
|
+
type SkuListPromotionRuleRel = ResourceRel & {
|
24
|
+
type: SkuListPromotionRuleType;
|
25
|
+
};
|
26
|
+
type CouponCodesPromotionRuleRel = ResourceRel & {
|
27
|
+
type: CouponCodesPromotionRuleType;
|
28
|
+
};
|
29
|
+
interface FixedAmountPromotion extends Resource {
|
30
|
+
readonly type: FixedAmountPromotionType;
|
31
|
+
name: string;
|
32
|
+
currency_code?: string | null;
|
33
|
+
starts_at: string;
|
34
|
+
expires_at: string;
|
35
|
+
total_usage_limit: number;
|
36
|
+
total_usage_count?: number | null;
|
37
|
+
active?: boolean | null;
|
38
|
+
fixed_amount_cents: number;
|
39
|
+
fixed_amount_float?: number | null;
|
40
|
+
formatted_fixed_amount?: string | null;
|
41
|
+
market?: Market | null;
|
42
|
+
promotion_rules?: PromotionRule[] | null;
|
43
|
+
order_amount_promotion_rule?: OrderAmountPromotionRule | null;
|
44
|
+
sku_list_promotion_rule?: SkuListPromotionRule | null;
|
45
|
+
coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
|
46
|
+
attachments?: Attachment[] | null;
|
47
|
+
events?: Event[] | null;
|
48
|
+
}
|
49
|
+
interface FixedAmountPromotionCreate extends ResourceCreate {
|
50
|
+
name: string;
|
51
|
+
currency_code?: string | null;
|
52
|
+
starts_at: string;
|
53
|
+
expires_at: string;
|
54
|
+
total_usage_limit: number;
|
55
|
+
fixed_amount_cents: number;
|
56
|
+
market?: MarketRel | null;
|
57
|
+
promotion_rules?: PromotionRuleRel[] | null;
|
58
|
+
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
59
|
+
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
60
|
+
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
61
|
+
}
|
62
|
+
interface FixedAmountPromotionUpdate extends ResourceUpdate {
|
63
|
+
name?: string | null;
|
64
|
+
currency_code?: string | null;
|
65
|
+
starts_at?: string | null;
|
66
|
+
expires_at?: string | null;
|
67
|
+
total_usage_limit?: number | null;
|
68
|
+
fixed_amount_cents?: number | null;
|
69
|
+
market?: MarketRel | null;
|
70
|
+
promotion_rules?: PromotionRuleRel[] | null;
|
71
|
+
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
72
|
+
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
73
|
+
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
74
|
+
}
|
75
|
+
declare class FixedAmountPromotions extends ApiResource<FixedAmountPromotion> {
|
76
|
+
static readonly TYPE: FixedAmountPromotionType;
|
77
|
+
create(resource: FixedAmountPromotionCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<FixedAmountPromotion>;
|
78
|
+
update(resource: FixedAmountPromotionUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<FixedAmountPromotion>;
|
79
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
80
|
+
market(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
|
81
|
+
order_amount_promotion_rule(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
82
|
+
sku_list_promotion_rule(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
83
|
+
coupon_codes_promotion_rule(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
84
|
+
attachments(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
85
|
+
events(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
86
|
+
isFixedAmountPromotion(resource: any): resource is FixedAmountPromotion;
|
87
|
+
relationship(id: string | ResourceId | null): FixedAmountPromotionRel;
|
88
|
+
type(): FixedAmountPromotionType;
|
89
|
+
}
|
90
|
+
export default FixedAmountPromotions;
|
91
|
+
export type { FixedAmountPromotion, FixedAmountPromotionCreate, FixedAmountPromotionUpdate, FixedAmountPromotionType };
|
@@ -0,0 +1,49 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const resource_1 = require("../resource");
|
4
|
+
class FixedAmountPromotions extends resource_1.ApiResource {
|
5
|
+
async create(resource, params, options) {
|
6
|
+
return this.resources.create({ ...resource, type: FixedAmountPromotions.TYPE }, params, options);
|
7
|
+
}
|
8
|
+
async update(resource, params, options) {
|
9
|
+
return this.resources.update({ ...resource, type: FixedAmountPromotions.TYPE }, params, options);
|
10
|
+
}
|
11
|
+
async delete(id, options) {
|
12
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: FixedAmountPromotions.TYPE } : id, options);
|
13
|
+
}
|
14
|
+
async market(fixedAmountPromotionId, params, options) {
|
15
|
+
const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
|
16
|
+
return this.resources.fetch({ type: 'markets' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/market`, params, options);
|
17
|
+
}
|
18
|
+
async order_amount_promotion_rule(fixedAmountPromotionId, params, options) {
|
19
|
+
const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
|
20
|
+
return this.resources.fetch({ type: 'order_amount_promotion_rules' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/order_amount_promotion_rule`, params, options);
|
21
|
+
}
|
22
|
+
async sku_list_promotion_rule(fixedAmountPromotionId, params, options) {
|
23
|
+
const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
|
24
|
+
return this.resources.fetch({ type: 'sku_list_promotion_rules' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/sku_list_promotion_rule`, params, options);
|
25
|
+
}
|
26
|
+
async coupon_codes_promotion_rule(fixedAmountPromotionId, params, options) {
|
27
|
+
const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
|
28
|
+
return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/coupon_codes_promotion_rule`, params, options);
|
29
|
+
}
|
30
|
+
async attachments(fixedAmountPromotionId, params, options) {
|
31
|
+
const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
|
32
|
+
return this.resources.fetch({ type: 'attachments' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/attachments`, params, options);
|
33
|
+
}
|
34
|
+
async events(fixedAmountPromotionId, params, options) {
|
35
|
+
const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
|
36
|
+
return this.resources.fetch({ type: 'events' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/events`, params, options);
|
37
|
+
}
|
38
|
+
isFixedAmountPromotion(resource) {
|
39
|
+
return resource.type && (resource.type === FixedAmountPromotions.TYPE);
|
40
|
+
}
|
41
|
+
relationship(id) {
|
42
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: FixedAmountPromotions.TYPE } : { id: id.id, type: FixedAmountPromotions.TYPE };
|
43
|
+
}
|
44
|
+
type() {
|
45
|
+
return FixedAmountPromotions.TYPE;
|
46
|
+
}
|
47
|
+
}
|
48
|
+
FixedAmountPromotions.TYPE = 'fixed_amount_promotions';
|
49
|
+
exports.default = FixedAmountPromotions;
|
@@ -0,0 +1,102 @@
|
|
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 { PromotionRule, PromotionRuleType } from './promotion_rules';
|
5
|
+
import type { OrderAmountPromotionRule, OrderAmountPromotionRuleType } from './order_amount_promotion_rules';
|
6
|
+
import type { SkuListPromotionRule, SkuListPromotionRuleType } from './sku_list_promotion_rules';
|
7
|
+
import type { CouponCodesPromotionRule, CouponCodesPromotionRuleType } from './coupon_codes_promotion_rules';
|
8
|
+
import type { Attachment } from './attachments';
|
9
|
+
import type { SkuList, SkuListType } from './sku_lists';
|
10
|
+
import type { Sku } from './skus';
|
11
|
+
import type { Event } from './events';
|
12
|
+
type FixedPricePromotionType = 'fixed_price_promotions';
|
13
|
+
type FixedPricePromotionRel = ResourceRel & {
|
14
|
+
type: FixedPricePromotionType;
|
15
|
+
};
|
16
|
+
type MarketRel = ResourceRel & {
|
17
|
+
type: MarketType;
|
18
|
+
};
|
19
|
+
type PromotionRuleRel = ResourceRel & {
|
20
|
+
type: PromotionRuleType;
|
21
|
+
};
|
22
|
+
type OrderAmountPromotionRuleRel = ResourceRel & {
|
23
|
+
type: OrderAmountPromotionRuleType;
|
24
|
+
};
|
25
|
+
type SkuListPromotionRuleRel = ResourceRel & {
|
26
|
+
type: SkuListPromotionRuleType;
|
27
|
+
};
|
28
|
+
type CouponCodesPromotionRuleRel = ResourceRel & {
|
29
|
+
type: CouponCodesPromotionRuleType;
|
30
|
+
};
|
31
|
+
type SkuListRel = ResourceRel & {
|
32
|
+
type: SkuListType;
|
33
|
+
};
|
34
|
+
interface FixedPricePromotion extends Resource {
|
35
|
+
readonly type: FixedPricePromotionType;
|
36
|
+
name: string;
|
37
|
+
currency_code?: string | null;
|
38
|
+
starts_at: string;
|
39
|
+
expires_at: string;
|
40
|
+
total_usage_limit: number;
|
41
|
+
total_usage_count?: number | null;
|
42
|
+
active?: boolean | null;
|
43
|
+
fixed_amount_cents: number;
|
44
|
+
fixed_amount_float?: number | null;
|
45
|
+
formatted_fixed_amount?: string | null;
|
46
|
+
market?: Market | null;
|
47
|
+
promotion_rules?: PromotionRule[] | null;
|
48
|
+
order_amount_promotion_rule?: OrderAmountPromotionRule | null;
|
49
|
+
sku_list_promotion_rule?: SkuListPromotionRule | null;
|
50
|
+
coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
|
51
|
+
attachments?: Attachment[] | null;
|
52
|
+
sku_list?: SkuList | null;
|
53
|
+
skus?: Sku[] | null;
|
54
|
+
events?: Event[] | null;
|
55
|
+
}
|
56
|
+
interface FixedPricePromotionCreate extends ResourceCreate {
|
57
|
+
name: string;
|
58
|
+
currency_code?: string | null;
|
59
|
+
starts_at: string;
|
60
|
+
expires_at: string;
|
61
|
+
total_usage_limit: number;
|
62
|
+
fixed_amount_cents: number;
|
63
|
+
market?: MarketRel | null;
|
64
|
+
promotion_rules?: PromotionRuleRel[] | null;
|
65
|
+
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
66
|
+
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
67
|
+
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
68
|
+
sku_list: SkuListRel;
|
69
|
+
}
|
70
|
+
interface FixedPricePromotionUpdate extends ResourceUpdate {
|
71
|
+
name?: string | null;
|
72
|
+
currency_code?: string | null;
|
73
|
+
starts_at?: string | null;
|
74
|
+
expires_at?: string | null;
|
75
|
+
total_usage_limit?: number | null;
|
76
|
+
fixed_amount_cents?: number | null;
|
77
|
+
market?: MarketRel | null;
|
78
|
+
promotion_rules?: PromotionRuleRel[] | null;
|
79
|
+
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
80
|
+
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
81
|
+
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
82
|
+
sku_list?: SkuListRel | null;
|
83
|
+
}
|
84
|
+
declare class FixedPricePromotions extends ApiResource<FixedPricePromotion> {
|
85
|
+
static readonly TYPE: FixedPricePromotionType;
|
86
|
+
create(resource: FixedPricePromotionCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<FixedPricePromotion>;
|
87
|
+
update(resource: FixedPricePromotionUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<FixedPricePromotion>;
|
88
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
89
|
+
market(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
|
90
|
+
order_amount_promotion_rule(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
91
|
+
sku_list_promotion_rule(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
92
|
+
coupon_codes_promotion_rule(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
93
|
+
attachments(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
94
|
+
sku_list(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
95
|
+
skus(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Sku>>;
|
96
|
+
events(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
97
|
+
isFixedPricePromotion(resource: any): resource is FixedPricePromotion;
|
98
|
+
relationship(id: string | ResourceId | null): FixedPricePromotionRel;
|
99
|
+
type(): FixedPricePromotionType;
|
100
|
+
}
|
101
|
+
export default FixedPricePromotions;
|
102
|
+
export type { FixedPricePromotion, FixedPricePromotionCreate, FixedPricePromotionUpdate, FixedPricePromotionType };
|