@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,45 @@
|
|
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 { CheckoutComPayment, CheckoutComPaymentType } from './checkout_com_payments';
|
5
|
+
type CheckoutComGatewayType = 'checkout_com_gateways';
|
6
|
+
type CheckoutComGatewayRel = ResourceRel & {
|
7
|
+
type: CheckoutComGatewayType;
|
8
|
+
};
|
9
|
+
type CheckoutComPaymentRel = ResourceRel & {
|
10
|
+
type: CheckoutComPaymentType;
|
11
|
+
};
|
12
|
+
interface CheckoutComGateway extends Resource {
|
13
|
+
readonly type: CheckoutComGatewayType;
|
14
|
+
name: string;
|
15
|
+
webhook_endpoint_id?: string | null;
|
16
|
+
webhook_endpoint_secret?: string | null;
|
17
|
+
webhook_endpoint_url?: string | null;
|
18
|
+
payment_methods?: PaymentMethod[] | null;
|
19
|
+
checkout_com_payments?: CheckoutComPayment[] | null;
|
20
|
+
}
|
21
|
+
interface CheckoutComGatewayCreate extends ResourceCreate {
|
22
|
+
name: string;
|
23
|
+
secret_key: string;
|
24
|
+
public_key: string;
|
25
|
+
checkout_com_payments?: CheckoutComPaymentRel[] | null;
|
26
|
+
}
|
27
|
+
interface CheckoutComGatewayUpdate extends ResourceUpdate {
|
28
|
+
name?: string | null;
|
29
|
+
secret_key?: string | null;
|
30
|
+
public_key?: string | null;
|
31
|
+
checkout_com_payments?: CheckoutComPaymentRel[] | null;
|
32
|
+
}
|
33
|
+
declare class CheckoutComGateways extends ApiResource<CheckoutComGateway> {
|
34
|
+
static readonly TYPE: CheckoutComGatewayType;
|
35
|
+
create(resource: CheckoutComGatewayCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CheckoutComGateway>;
|
36
|
+
update(resource: CheckoutComGatewayUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CheckoutComGateway>;
|
37
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
38
|
+
payment_methods(checkoutComGatewayId: string | CheckoutComGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>>;
|
39
|
+
checkout_com_payments(checkoutComGatewayId: string | CheckoutComGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<CheckoutComPayment>>;
|
40
|
+
isCheckoutComGateway(resource: any): resource is CheckoutComGateway;
|
41
|
+
relationship(id: string | ResourceId | null): CheckoutComGatewayRel;
|
42
|
+
type(): CheckoutComGatewayType;
|
43
|
+
}
|
44
|
+
export default CheckoutComGateways;
|
45
|
+
export type { CheckoutComGateway, CheckoutComGatewayCreate, CheckoutComGatewayUpdate, CheckoutComGatewayType };
|
@@ -0,0 +1,33 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const resource_1 = require("../resource");
|
4
|
+
class CheckoutComGateways extends resource_1.ApiResource {
|
5
|
+
async create(resource, params, options) {
|
6
|
+
return this.resources.create({ ...resource, type: CheckoutComGateways.TYPE }, params, options);
|
7
|
+
}
|
8
|
+
async update(resource, params, options) {
|
9
|
+
return this.resources.update({ ...resource, type: CheckoutComGateways.TYPE }, params, options);
|
10
|
+
}
|
11
|
+
async delete(id, options) {
|
12
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: CheckoutComGateways.TYPE } : id, options);
|
13
|
+
}
|
14
|
+
async payment_methods(checkoutComGatewayId, params, options) {
|
15
|
+
const _checkoutComGatewayId = checkoutComGatewayId.id || checkoutComGatewayId;
|
16
|
+
return this.resources.fetch({ type: 'payment_methods' }, `checkout_com_gateways/${_checkoutComGatewayId}/payment_methods`, params, options);
|
17
|
+
}
|
18
|
+
async checkout_com_payments(checkoutComGatewayId, params, options) {
|
19
|
+
const _checkoutComGatewayId = checkoutComGatewayId.id || checkoutComGatewayId;
|
20
|
+
return this.resources.fetch({ type: 'checkout_com_payments' }, `checkout_com_gateways/${_checkoutComGatewayId}/checkout_com_payments`, params, options);
|
21
|
+
}
|
22
|
+
isCheckoutComGateway(resource) {
|
23
|
+
return resource.type && (resource.type === CheckoutComGateways.TYPE);
|
24
|
+
}
|
25
|
+
relationship(id) {
|
26
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: CheckoutComGateways.TYPE } : { id: id.id, type: CheckoutComGateways.TYPE };
|
27
|
+
}
|
28
|
+
type() {
|
29
|
+
return CheckoutComGateways.TYPE;
|
30
|
+
}
|
31
|
+
}
|
32
|
+
CheckoutComGateways.TYPE = 'checkout_com_gateways';
|
33
|
+
exports.default = CheckoutComGateways;
|
@@ -0,0 +1,59 @@
|
|
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
|
+
type CheckoutComPaymentType = 'checkout_com_payments';
|
6
|
+
type CheckoutComPaymentRel = ResourceRel & {
|
7
|
+
type: CheckoutComPaymentType;
|
8
|
+
};
|
9
|
+
type OrderRel = ResourceRel & {
|
10
|
+
type: OrderType;
|
11
|
+
};
|
12
|
+
interface CheckoutComPayment extends Resource {
|
13
|
+
readonly type: CheckoutComPaymentType;
|
14
|
+
public_key?: string | null;
|
15
|
+
payment_type: string;
|
16
|
+
token: string;
|
17
|
+
session_id?: string | null;
|
18
|
+
success_url?: string | null;
|
19
|
+
failure_url?: string | null;
|
20
|
+
source_id?: string | null;
|
21
|
+
customer_token?: string | null;
|
22
|
+
redirect_uri?: string | null;
|
23
|
+
payment_response?: object | null;
|
24
|
+
mismatched_amounts?: boolean | null;
|
25
|
+
payment_instrument?: object | null;
|
26
|
+
order?: Order | null;
|
27
|
+
payment_gateway?: PaymentGateway | null;
|
28
|
+
}
|
29
|
+
interface CheckoutComPaymentCreate extends ResourceCreate {
|
30
|
+
payment_type: string;
|
31
|
+
token: string;
|
32
|
+
session_id?: string | null;
|
33
|
+
success_url?: string | null;
|
34
|
+
failure_url?: string | null;
|
35
|
+
order: OrderRel;
|
36
|
+
}
|
37
|
+
interface CheckoutComPaymentUpdate extends ResourceUpdate {
|
38
|
+
payment_type?: string | null;
|
39
|
+
token?: string | null;
|
40
|
+
session_id?: string | null;
|
41
|
+
success_url?: string | null;
|
42
|
+
failure_url?: string | null;
|
43
|
+
_details?: boolean | null;
|
44
|
+
_refresh?: boolean | null;
|
45
|
+
order?: OrderRel | null;
|
46
|
+
}
|
47
|
+
declare class CheckoutComPayments extends ApiResource<CheckoutComPayment> {
|
48
|
+
static readonly TYPE: CheckoutComPaymentType;
|
49
|
+
create(resource: CheckoutComPaymentCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CheckoutComPayment>;
|
50
|
+
update(resource: CheckoutComPaymentUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CheckoutComPayment>;
|
51
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
52
|
+
order(checkoutComPaymentId: string | CheckoutComPayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
53
|
+
payment_gateway(checkoutComPaymentId: string | CheckoutComPayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentGateway>;
|
54
|
+
isCheckoutComPayment(resource: any): resource is CheckoutComPayment;
|
55
|
+
relationship(id: string | ResourceId | null): CheckoutComPaymentRel;
|
56
|
+
type(): CheckoutComPaymentType;
|
57
|
+
}
|
58
|
+
export default CheckoutComPayments;
|
59
|
+
export type { CheckoutComPayment, CheckoutComPaymentCreate, CheckoutComPaymentUpdate, CheckoutComPaymentType };
|
@@ -0,0 +1,33 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const resource_1 = require("../resource");
|
4
|
+
class CheckoutComPayments extends resource_1.ApiResource {
|
5
|
+
async create(resource, params, options) {
|
6
|
+
return this.resources.create({ ...resource, type: CheckoutComPayments.TYPE }, params, options);
|
7
|
+
}
|
8
|
+
async update(resource, params, options) {
|
9
|
+
return this.resources.update({ ...resource, type: CheckoutComPayments.TYPE }, params, options);
|
10
|
+
}
|
11
|
+
async delete(id, options) {
|
12
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: CheckoutComPayments.TYPE } : id, options);
|
13
|
+
}
|
14
|
+
async order(checkoutComPaymentId, params, options) {
|
15
|
+
const _checkoutComPaymentId = checkoutComPaymentId.id || checkoutComPaymentId;
|
16
|
+
return this.resources.fetch({ type: 'orders' }, `checkout_com_payments/${_checkoutComPaymentId}/order`, params, options);
|
17
|
+
}
|
18
|
+
async payment_gateway(checkoutComPaymentId, params, options) {
|
19
|
+
const _checkoutComPaymentId = checkoutComPaymentId.id || checkoutComPaymentId;
|
20
|
+
return this.resources.fetch({ type: 'payment_gateways' }, `checkout_com_payments/${_checkoutComPaymentId}/payment_gateway`, params, options);
|
21
|
+
}
|
22
|
+
isCheckoutComPayment(resource) {
|
23
|
+
return resource.type && (resource.type === CheckoutComPayments.TYPE);
|
24
|
+
}
|
25
|
+
relationship(id) {
|
26
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: CheckoutComPayments.TYPE } : { id: id.id, type: CheckoutComPayments.TYPE };
|
27
|
+
}
|
28
|
+
type() {
|
29
|
+
return CheckoutComPayments.TYPE;
|
30
|
+
}
|
31
|
+
}
|
32
|
+
CheckoutComPayments.TYPE = 'checkout_com_payments';
|
33
|
+
exports.default = CheckoutComPayments;
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import { ApiResource, Resource, ResourceCreate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
3
|
+
import type { Event } from './events';
|
4
|
+
type CleanupType = 'cleanups';
|
5
|
+
type CleanupRel = ResourceRel & {
|
6
|
+
type: CleanupType;
|
7
|
+
};
|
8
|
+
interface Cleanup extends Resource {
|
9
|
+
readonly type: CleanupType;
|
10
|
+
resource_type: string;
|
11
|
+
status?: 'pending' | 'in_progress' | 'interrupted' | 'completed' | null;
|
12
|
+
started_at?: string | null;
|
13
|
+
completed_at?: string | null;
|
14
|
+
interrupted_at?: string | null;
|
15
|
+
filters?: object | null;
|
16
|
+
records_count?: number | null;
|
17
|
+
errors_count?: number | null;
|
18
|
+
processed_count?: number | null;
|
19
|
+
errors_log?: object | null;
|
20
|
+
events?: Event[] | null;
|
21
|
+
}
|
22
|
+
interface CleanupCreate extends ResourceCreate {
|
23
|
+
resource_type: string;
|
24
|
+
filters?: object | null;
|
25
|
+
}
|
26
|
+
declare class Cleanups extends ApiResource<Cleanup> {
|
27
|
+
static readonly TYPE: CleanupType;
|
28
|
+
create(resource: CleanupCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Cleanup>;
|
29
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
30
|
+
events(cleanupId: string | Cleanup, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
31
|
+
isCleanup(resource: any): resource is Cleanup;
|
32
|
+
relationship(id: string | ResourceId | null): CleanupRel;
|
33
|
+
type(): CleanupType;
|
34
|
+
}
|
35
|
+
export default Cleanups;
|
36
|
+
export type { Cleanup, CleanupCreate, CleanupType };
|
@@ -0,0 +1,26 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const resource_1 = require("../resource");
|
4
|
+
class Cleanups extends resource_1.ApiResource {
|
5
|
+
async create(resource, params, options) {
|
6
|
+
return this.resources.create({ ...resource, type: Cleanups.TYPE }, params, options);
|
7
|
+
}
|
8
|
+
async delete(id, options) {
|
9
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: Cleanups.TYPE } : id, options);
|
10
|
+
}
|
11
|
+
async events(cleanupId, params, options) {
|
12
|
+
const _cleanupId = cleanupId.id || cleanupId;
|
13
|
+
return this.resources.fetch({ type: 'events' }, `cleanups/${_cleanupId}/events`, params, options);
|
14
|
+
}
|
15
|
+
isCleanup(resource) {
|
16
|
+
return resource.type && (resource.type === Cleanups.TYPE);
|
17
|
+
}
|
18
|
+
relationship(id) {
|
19
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: Cleanups.TYPE } : { id: id.id, type: Cleanups.TYPE };
|
20
|
+
}
|
21
|
+
type() {
|
22
|
+
return Cleanups.TYPE;
|
23
|
+
}
|
24
|
+
}
|
25
|
+
Cleanups.TYPE = 'cleanups';
|
26
|
+
exports.default = Cleanups;
|
@@ -0,0 +1,59 @@
|
|
1
|
+
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
3
|
+
import type { PercentageDiscountPromotion, PercentageDiscountPromotionType } from './percentage_discount_promotions';
|
4
|
+
import type { FreeShippingPromotion, FreeShippingPromotionType } from './free_shipping_promotions';
|
5
|
+
import type { FreeGiftPromotion, FreeGiftPromotionType } from './free_gift_promotions';
|
6
|
+
import type { FixedPricePromotion, FixedPricePromotionType } from './fixed_price_promotions';
|
7
|
+
import type { ExternalPromotion, ExternalPromotionType } from './external_promotions';
|
8
|
+
import type { FixedAmountPromotion, FixedAmountPromotionType } from './fixed_amount_promotions';
|
9
|
+
import type { Coupon, CouponType } from './coupons';
|
10
|
+
type CouponCodesPromotionRuleType = 'coupon_codes_promotion_rules';
|
11
|
+
type CouponCodesPromotionRuleRel = ResourceRel & {
|
12
|
+
type: CouponCodesPromotionRuleType;
|
13
|
+
};
|
14
|
+
type PercentageDiscountPromotionRel = ResourceRel & {
|
15
|
+
type: PercentageDiscountPromotionType;
|
16
|
+
};
|
17
|
+
type FreeShippingPromotionRel = ResourceRel & {
|
18
|
+
type: FreeShippingPromotionType;
|
19
|
+
};
|
20
|
+
type FreeGiftPromotionRel = ResourceRel & {
|
21
|
+
type: FreeGiftPromotionType;
|
22
|
+
};
|
23
|
+
type FixedPricePromotionRel = ResourceRel & {
|
24
|
+
type: FixedPricePromotionType;
|
25
|
+
};
|
26
|
+
type ExternalPromotionRel = ResourceRel & {
|
27
|
+
type: ExternalPromotionType;
|
28
|
+
};
|
29
|
+
type FixedAmountPromotionRel = ResourceRel & {
|
30
|
+
type: FixedAmountPromotionType;
|
31
|
+
};
|
32
|
+
type CouponRel = ResourceRel & {
|
33
|
+
type: CouponType;
|
34
|
+
};
|
35
|
+
interface CouponCodesPromotionRule extends Resource {
|
36
|
+
readonly type: CouponCodesPromotionRuleType;
|
37
|
+
promotion?: PercentageDiscountPromotion | FreeShippingPromotion | FreeGiftPromotion | FixedPricePromotion | ExternalPromotion | FixedAmountPromotion | null;
|
38
|
+
coupons?: Coupon[] | null;
|
39
|
+
}
|
40
|
+
interface CouponCodesPromotionRuleCreate extends ResourceCreate {
|
41
|
+
promotion: PercentageDiscountPromotionRel | FreeShippingPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel | FixedAmountPromotionRel;
|
42
|
+
coupons?: CouponRel[] | null;
|
43
|
+
}
|
44
|
+
interface CouponCodesPromotionRuleUpdate extends ResourceUpdate {
|
45
|
+
promotion?: PercentageDiscountPromotionRel | FreeShippingPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel | FixedAmountPromotionRel | null;
|
46
|
+
coupons?: CouponRel[] | null;
|
47
|
+
}
|
48
|
+
declare class CouponCodesPromotionRules extends ApiResource<CouponCodesPromotionRule> {
|
49
|
+
static readonly TYPE: CouponCodesPromotionRuleType;
|
50
|
+
create(resource: CouponCodesPromotionRuleCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
51
|
+
update(resource: CouponCodesPromotionRuleUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
52
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
53
|
+
coupons(couponCodesPromotionRuleId: string | CouponCodesPromotionRule, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
|
54
|
+
isCouponCodesPromotionRule(resource: any): resource is CouponCodesPromotionRule;
|
55
|
+
relationship(id: string | ResourceId | null): CouponCodesPromotionRuleRel;
|
56
|
+
type(): CouponCodesPromotionRuleType;
|
57
|
+
}
|
58
|
+
export default CouponCodesPromotionRules;
|
59
|
+
export type { CouponCodesPromotionRule, CouponCodesPromotionRuleCreate, CouponCodesPromotionRuleUpdate, CouponCodesPromotionRuleType };
|
@@ -0,0 +1,29 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const resource_1 = require("../resource");
|
4
|
+
class CouponCodesPromotionRules extends resource_1.ApiResource {
|
5
|
+
async create(resource, params, options) {
|
6
|
+
return this.resources.create({ ...resource, type: CouponCodesPromotionRules.TYPE }, params, options);
|
7
|
+
}
|
8
|
+
async update(resource, params, options) {
|
9
|
+
return this.resources.update({ ...resource, type: CouponCodesPromotionRules.TYPE }, params, options);
|
10
|
+
}
|
11
|
+
async delete(id, options) {
|
12
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: CouponCodesPromotionRules.TYPE } : id, options);
|
13
|
+
}
|
14
|
+
async coupons(couponCodesPromotionRuleId, params, options) {
|
15
|
+
const _couponCodesPromotionRuleId = couponCodesPromotionRuleId.id || couponCodesPromotionRuleId;
|
16
|
+
return this.resources.fetch({ type: 'coupons' }, `coupon_codes_promotion_rules/${_couponCodesPromotionRuleId}/coupons`, params, options);
|
17
|
+
}
|
18
|
+
isCouponCodesPromotionRule(resource) {
|
19
|
+
return resource.type && (resource.type === CouponCodesPromotionRules.TYPE);
|
20
|
+
}
|
21
|
+
relationship(id) {
|
22
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: CouponCodesPromotionRules.TYPE } : { id: id.id, type: CouponCodesPromotionRules.TYPE };
|
23
|
+
}
|
24
|
+
type() {
|
25
|
+
return CouponCodesPromotionRules.TYPE;
|
26
|
+
}
|
27
|
+
}
|
28
|
+
CouponCodesPromotionRules.TYPE = 'coupon_codes_promotion_rules';
|
29
|
+
exports.default = CouponCodesPromotionRules;
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
3
|
+
import type { Customer, CustomerType } from './customers';
|
4
|
+
import type { Attachment } from './attachments';
|
5
|
+
type CouponRecipientType = 'coupon_recipients';
|
6
|
+
type CouponRecipientRel = ResourceRel & {
|
7
|
+
type: CouponRecipientType;
|
8
|
+
};
|
9
|
+
type CustomerRel = ResourceRel & {
|
10
|
+
type: CustomerType;
|
11
|
+
};
|
12
|
+
interface CouponRecipient extends Resource {
|
13
|
+
readonly type: CouponRecipientType;
|
14
|
+
email: string;
|
15
|
+
first_name?: string | null;
|
16
|
+
last_name?: string | null;
|
17
|
+
customer?: Customer | null;
|
18
|
+
attachments?: Attachment[] | null;
|
19
|
+
}
|
20
|
+
interface CouponRecipientCreate extends ResourceCreate {
|
21
|
+
email: string;
|
22
|
+
first_name?: string | null;
|
23
|
+
last_name?: string | null;
|
24
|
+
customer?: CustomerRel | null;
|
25
|
+
}
|
26
|
+
interface CouponRecipientUpdate extends ResourceUpdate {
|
27
|
+
email?: string | null;
|
28
|
+
first_name?: string | null;
|
29
|
+
last_name?: string | null;
|
30
|
+
customer?: CustomerRel | null;
|
31
|
+
}
|
32
|
+
declare class CouponRecipients extends ApiResource<CouponRecipient> {
|
33
|
+
static readonly TYPE: CouponRecipientType;
|
34
|
+
create(resource: CouponRecipientCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponRecipient>;
|
35
|
+
update(resource: CouponRecipientUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponRecipient>;
|
36
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
37
|
+
customer(couponRecipientId: string | CouponRecipient, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Customer>;
|
38
|
+
attachments(couponRecipientId: string | CouponRecipient, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
39
|
+
isCouponRecipient(resource: any): resource is CouponRecipient;
|
40
|
+
relationship(id: string | ResourceId | null): CouponRecipientRel;
|
41
|
+
type(): CouponRecipientType;
|
42
|
+
}
|
43
|
+
export default CouponRecipients;
|
44
|
+
export type { CouponRecipient, CouponRecipientCreate, CouponRecipientUpdate, CouponRecipientType };
|
@@ -0,0 +1,33 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const resource_1 = require("../resource");
|
4
|
+
class CouponRecipients extends resource_1.ApiResource {
|
5
|
+
async create(resource, params, options) {
|
6
|
+
return this.resources.create({ ...resource, type: CouponRecipients.TYPE }, params, options);
|
7
|
+
}
|
8
|
+
async update(resource, params, options) {
|
9
|
+
return this.resources.update({ ...resource, type: CouponRecipients.TYPE }, params, options);
|
10
|
+
}
|
11
|
+
async delete(id, options) {
|
12
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: CouponRecipients.TYPE } : id, options);
|
13
|
+
}
|
14
|
+
async customer(couponRecipientId, params, options) {
|
15
|
+
const _couponRecipientId = couponRecipientId.id || couponRecipientId;
|
16
|
+
return this.resources.fetch({ type: 'customers' }, `coupon_recipients/${_couponRecipientId}/customer`, params, options);
|
17
|
+
}
|
18
|
+
async attachments(couponRecipientId, params, options) {
|
19
|
+
const _couponRecipientId = couponRecipientId.id || couponRecipientId;
|
20
|
+
return this.resources.fetch({ type: 'attachments' }, `coupon_recipients/${_couponRecipientId}/attachments`, params, options);
|
21
|
+
}
|
22
|
+
isCouponRecipient(resource) {
|
23
|
+
return resource.type && (resource.type === CouponRecipients.TYPE);
|
24
|
+
}
|
25
|
+
relationship(id) {
|
26
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: CouponRecipients.TYPE } : { id: id.id, type: CouponRecipients.TYPE };
|
27
|
+
}
|
28
|
+
type() {
|
29
|
+
return CouponRecipients.TYPE;
|
30
|
+
}
|
31
|
+
}
|
32
|
+
CouponRecipients.TYPE = 'coupon_recipients';
|
33
|
+
exports.default = CouponRecipients;
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel } from '../resource';
|
2
|
+
import type { QueryParamsRetrieve } from '../query';
|
3
|
+
import type { CouponCodesPromotionRule, CouponCodesPromotionRuleType } from './coupon_codes_promotion_rules';
|
4
|
+
type CouponType = 'coupons';
|
5
|
+
type CouponRel = ResourceRel & {
|
6
|
+
type: CouponType;
|
7
|
+
};
|
8
|
+
type CouponCodesPromotionRuleRel = ResourceRel & {
|
9
|
+
type: CouponCodesPromotionRuleType;
|
10
|
+
};
|
11
|
+
interface Coupon extends Resource {
|
12
|
+
readonly type: CouponType;
|
13
|
+
code: string;
|
14
|
+
customer_single_use?: boolean | null;
|
15
|
+
usage_limit: number;
|
16
|
+
usage_count?: number | null;
|
17
|
+
recipient_email?: string | null;
|
18
|
+
promotion_rule?: CouponCodesPromotionRule | null;
|
19
|
+
}
|
20
|
+
interface CouponCreate extends ResourceCreate {
|
21
|
+
code: string;
|
22
|
+
customer_single_use?: boolean | null;
|
23
|
+
usage_limit: number;
|
24
|
+
recipient_email?: string | null;
|
25
|
+
promotion_rule: CouponCodesPromotionRuleRel;
|
26
|
+
}
|
27
|
+
interface CouponUpdate extends ResourceUpdate {
|
28
|
+
code?: string | null;
|
29
|
+
customer_single_use?: boolean | null;
|
30
|
+
usage_limit?: number | null;
|
31
|
+
recipient_email?: string | null;
|
32
|
+
promotion_rule?: CouponCodesPromotionRuleRel | null;
|
33
|
+
}
|
34
|
+
declare class Coupons extends ApiResource<Coupon> {
|
35
|
+
static readonly TYPE: CouponType;
|
36
|
+
create(resource: CouponCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Coupon>;
|
37
|
+
update(resource: CouponUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Coupon>;
|
38
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
39
|
+
promotion_rule(couponId: string | Coupon, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
40
|
+
isCoupon(resource: any): resource is Coupon;
|
41
|
+
relationship(id: string | ResourceId | null): CouponRel;
|
42
|
+
type(): CouponType;
|
43
|
+
}
|
44
|
+
export default Coupons;
|
45
|
+
export type { Coupon, CouponCreate, CouponUpdate, CouponType };
|
@@ -0,0 +1,29 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const resource_1 = require("../resource");
|
4
|
+
class Coupons extends resource_1.ApiResource {
|
5
|
+
async create(resource, params, options) {
|
6
|
+
return this.resources.create({ ...resource, type: Coupons.TYPE }, params, options);
|
7
|
+
}
|
8
|
+
async update(resource, params, options) {
|
9
|
+
return this.resources.update({ ...resource, type: Coupons.TYPE }, params, options);
|
10
|
+
}
|
11
|
+
async delete(id, options) {
|
12
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: Coupons.TYPE } : id, options);
|
13
|
+
}
|
14
|
+
async promotion_rule(couponId, params, options) {
|
15
|
+
const _couponId = couponId.id || couponId;
|
16
|
+
return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `coupons/${_couponId}/promotion_rule`, params, options);
|
17
|
+
}
|
18
|
+
isCoupon(resource) {
|
19
|
+
return resource.type && (resource.type === Coupons.TYPE);
|
20
|
+
}
|
21
|
+
relationship(id) {
|
22
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: Coupons.TYPE } : { id: id.id, type: Coupons.TYPE };
|
23
|
+
}
|
24
|
+
type() {
|
25
|
+
return Coupons.TYPE;
|
26
|
+
}
|
27
|
+
}
|
28
|
+
Coupons.TYPE = 'coupons';
|
29
|
+
exports.default = Coupons;
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
3
|
+
import type { Customer, CustomerType } from './customers';
|
4
|
+
import type { Address, AddressType } from './addresses';
|
5
|
+
import type { Event } from './events';
|
6
|
+
type CustomerAddressType = 'customer_addresses';
|
7
|
+
type CustomerAddressRel = ResourceRel & {
|
8
|
+
type: CustomerAddressType;
|
9
|
+
};
|
10
|
+
type CustomerRel = ResourceRel & {
|
11
|
+
type: CustomerType;
|
12
|
+
};
|
13
|
+
type AddressRel = ResourceRel & {
|
14
|
+
type: AddressType;
|
15
|
+
};
|
16
|
+
interface CustomerAddress extends Resource {
|
17
|
+
readonly type: CustomerAddressType;
|
18
|
+
name?: string | null;
|
19
|
+
customer?: Customer | null;
|
20
|
+
address?: Address | null;
|
21
|
+
events?: Event[] | null;
|
22
|
+
}
|
23
|
+
interface CustomerAddressCreate extends ResourceCreate {
|
24
|
+
customer: CustomerRel;
|
25
|
+
address: AddressRel;
|
26
|
+
}
|
27
|
+
interface CustomerAddressUpdate extends ResourceUpdate {
|
28
|
+
customer?: CustomerRel | null;
|
29
|
+
address?: AddressRel | null;
|
30
|
+
}
|
31
|
+
declare class CustomerAddresses extends ApiResource<CustomerAddress> {
|
32
|
+
static readonly TYPE: CustomerAddressType;
|
33
|
+
create(resource: CustomerAddressCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomerAddress>;
|
34
|
+
update(resource: CustomerAddressUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomerAddress>;
|
35
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
36
|
+
customer(customerAddressId: string | CustomerAddress, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Customer>;
|
37
|
+
address(customerAddressId: string | CustomerAddress, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Address>;
|
38
|
+
events(customerAddressId: string | CustomerAddress, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
39
|
+
isCustomerAddress(resource: any): resource is CustomerAddress;
|
40
|
+
relationship(id: string | ResourceId | null): CustomerAddressRel;
|
41
|
+
type(): CustomerAddressType;
|
42
|
+
}
|
43
|
+
export default CustomerAddresses;
|
44
|
+
export type { CustomerAddress, CustomerAddressCreate, CustomerAddressUpdate, CustomerAddressType };
|
@@ -0,0 +1,37 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const resource_1 = require("../resource");
|
4
|
+
class CustomerAddresses extends resource_1.ApiResource {
|
5
|
+
async create(resource, params, options) {
|
6
|
+
return this.resources.create({ ...resource, type: CustomerAddresses.TYPE }, params, options);
|
7
|
+
}
|
8
|
+
async update(resource, params, options) {
|
9
|
+
return this.resources.update({ ...resource, type: CustomerAddresses.TYPE }, params, options);
|
10
|
+
}
|
11
|
+
async delete(id, options) {
|
12
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: CustomerAddresses.TYPE } : id, options);
|
13
|
+
}
|
14
|
+
async customer(customerAddressId, params, options) {
|
15
|
+
const _customerAddressId = customerAddressId.id || customerAddressId;
|
16
|
+
return this.resources.fetch({ type: 'customers' }, `customer_addresses/${_customerAddressId}/customer`, params, options);
|
17
|
+
}
|
18
|
+
async address(customerAddressId, params, options) {
|
19
|
+
const _customerAddressId = customerAddressId.id || customerAddressId;
|
20
|
+
return this.resources.fetch({ type: 'addresses' }, `customer_addresses/${_customerAddressId}/address`, params, options);
|
21
|
+
}
|
22
|
+
async events(customerAddressId, params, options) {
|
23
|
+
const _customerAddressId = customerAddressId.id || customerAddressId;
|
24
|
+
return this.resources.fetch({ type: 'events' }, `customer_addresses/${_customerAddressId}/events`, params, options);
|
25
|
+
}
|
26
|
+
isCustomerAddress(resource) {
|
27
|
+
return resource.type && (resource.type === CustomerAddresses.TYPE);
|
28
|
+
}
|
29
|
+
relationship(id) {
|
30
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: CustomerAddresses.TYPE } : { id: id.id, type: CustomerAddresses.TYPE };
|
31
|
+
}
|
32
|
+
type() {
|
33
|
+
return CustomerAddresses.TYPE;
|
34
|
+
}
|
35
|
+
}
|
36
|
+
CustomerAddresses.TYPE = 'customer_addresses';
|
37
|
+
exports.default = CustomerAddresses;
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
3
|
+
import type { Customer } from './customers';
|
4
|
+
import type { Market } from './markets';
|
5
|
+
import type { Attachment } from './attachments';
|
6
|
+
type CustomerGroupType = 'customer_groups';
|
7
|
+
type CustomerGroupRel = ResourceRel & {
|
8
|
+
type: CustomerGroupType;
|
9
|
+
};
|
10
|
+
interface CustomerGroup extends Resource {
|
11
|
+
readonly type: CustomerGroupType;
|
12
|
+
name: string;
|
13
|
+
customers?: Customer[] | null;
|
14
|
+
markets?: Market[] | null;
|
15
|
+
attachments?: Attachment[] | null;
|
16
|
+
}
|
17
|
+
interface CustomerGroupCreate extends ResourceCreate {
|
18
|
+
name: string;
|
19
|
+
}
|
20
|
+
interface CustomerGroupUpdate extends ResourceUpdate {
|
21
|
+
name?: string | null;
|
22
|
+
}
|
23
|
+
declare class CustomerGroups extends ApiResource<CustomerGroup> {
|
24
|
+
static readonly TYPE: CustomerGroupType;
|
25
|
+
create(resource: CustomerGroupCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomerGroup>;
|
26
|
+
update(resource: CustomerGroupUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomerGroup>;
|
27
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
28
|
+
customers(customerGroupId: string | CustomerGroup, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Customer>>;
|
29
|
+
markets(customerGroupId: string | CustomerGroup, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Market>>;
|
30
|
+
attachments(customerGroupId: string | CustomerGroup, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
31
|
+
isCustomerGroup(resource: any): resource is CustomerGroup;
|
32
|
+
relationship(id: string | ResourceId | null): CustomerGroupRel;
|
33
|
+
type(): CustomerGroupType;
|
34
|
+
}
|
35
|
+
export default CustomerGroups;
|
36
|
+
export type { CustomerGroup, CustomerGroupCreate, CustomerGroupUpdate, CustomerGroupType };
|
@@ -0,0 +1,37 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const resource_1 = require("../resource");
|
4
|
+
class CustomerGroups extends resource_1.ApiResource {
|
5
|
+
async create(resource, params, options) {
|
6
|
+
return this.resources.create({ ...resource, type: CustomerGroups.TYPE }, params, options);
|
7
|
+
}
|
8
|
+
async update(resource, params, options) {
|
9
|
+
return this.resources.update({ ...resource, type: CustomerGroups.TYPE }, params, options);
|
10
|
+
}
|
11
|
+
async delete(id, options) {
|
12
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: CustomerGroups.TYPE } : id, options);
|
13
|
+
}
|
14
|
+
async customers(customerGroupId, params, options) {
|
15
|
+
const _customerGroupId = customerGroupId.id || customerGroupId;
|
16
|
+
return this.resources.fetch({ type: 'customers' }, `customer_groups/${_customerGroupId}/customers`, params, options);
|
17
|
+
}
|
18
|
+
async markets(customerGroupId, params, options) {
|
19
|
+
const _customerGroupId = customerGroupId.id || customerGroupId;
|
20
|
+
return this.resources.fetch({ type: 'markets' }, `customer_groups/${_customerGroupId}/markets`, params, options);
|
21
|
+
}
|
22
|
+
async attachments(customerGroupId, params, options) {
|
23
|
+
const _customerGroupId = customerGroupId.id || customerGroupId;
|
24
|
+
return this.resources.fetch({ type: 'attachments' }, `customer_groups/${_customerGroupId}/attachments`, params, options);
|
25
|
+
}
|
26
|
+
isCustomerGroup(resource) {
|
27
|
+
return resource.type && (resource.type === CustomerGroups.TYPE);
|
28
|
+
}
|
29
|
+
relationship(id) {
|
30
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: CustomerGroups.TYPE } : { id: id.id, type: CustomerGroups.TYPE };
|
31
|
+
}
|
32
|
+
type() {
|
33
|
+
return CustomerGroups.TYPE;
|
34
|
+
}
|
35
|
+
}
|
36
|
+
CustomerGroups.TYPE = 'customer_groups';
|
37
|
+
exports.default = CustomerGroups;
|