@commercelayer/sdk 5.0.0-beta.2 → 5.0.0-beta.20
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/LICENSE +2 -2
- package/README.md +18 -0
- package/lib/cjs/api.d.ts +27 -2
- package/lib/cjs/api.js +17 -15
- package/lib/cjs/client.d.ts +3 -5
- package/lib/cjs/client.js +11 -7
- package/lib/cjs/commercelayer.d.ts +10 -5
- package/lib/cjs/commercelayer.js +8 -3
- package/lib/cjs/common.d.ts +1 -0
- package/lib/cjs/common.js +11 -0
- package/lib/cjs/config.d.ts +1 -0
- package/lib/cjs/config.js +1 -0
- package/lib/cjs/debug.js +0 -1
- package/lib/cjs/error.js +1 -3
- package/lib/cjs/index.d.ts +1 -1
- package/lib/cjs/index.js +0 -16
- package/lib/cjs/interceptor.d.ts +1 -1
- package/lib/cjs/jsonapi.js +5 -1
- package/lib/cjs/model.d.ts +6 -1
- package/lib/cjs/query.d.ts +8 -15
- package/lib/cjs/query.js +3 -2
- package/lib/cjs/resource.d.ts +17 -22
- package/lib/cjs/resource.js +11 -8
- package/lib/cjs/resources/addresses.d.ts +52 -52
- package/lib/cjs/resources/addresses.js +2 -6
- package/lib/cjs/resources/adjustments.d.ts +6 -6
- package/lib/cjs/resources/adjustments.js +2 -6
- package/lib/cjs/resources/adyen_gateways.d.ts +21 -21
- package/lib/cjs/resources/adyen_gateways.js +2 -6
- package/lib/cjs/resources/adyen_payments.d.ts +16 -16
- package/lib/cjs/resources/adyen_payments.js +2 -6
- package/lib/cjs/resources/application.d.ts +7 -6
- package/lib/cjs/resources/application.js +0 -1
- package/lib/cjs/resources/attachments.d.ts +12 -12
- package/lib/cjs/resources/attachments.js +2 -6
- package/lib/cjs/resources/authorizations.d.ts +28 -28
- package/lib/cjs/resources/authorizations.js +1 -5
- package/lib/cjs/resources/avalara_accounts.d.ts +17 -17
- package/lib/cjs/resources/avalara_accounts.js +2 -6
- package/lib/cjs/resources/axerve_gateways.d.ts +9 -9
- package/lib/cjs/resources/axerve_gateways.js +2 -6
- package/lib/cjs/resources/axerve_payments.d.ts +13 -13
- package/lib/cjs/resources/axerve_payments.js +2 -6
- package/lib/cjs/resources/billing_info_validation_rules.d.ts +5 -5
- package/lib/cjs/resources/billing_info_validation_rules.js +2 -6
- package/lib/cjs/resources/bing_geocoders.d.ts +6 -6
- package/lib/cjs/resources/bing_geocoders.js +2 -6
- package/lib/cjs/resources/braintree_gateways.d.ts +21 -21
- package/lib/cjs/resources/braintree_gateways.js +2 -6
- package/lib/cjs/resources/braintree_payments.d.ts +18 -18
- package/lib/cjs/resources/braintree_payments.js +2 -6
- package/lib/cjs/resources/bundles.d.ts +27 -27
- package/lib/cjs/resources/bundles.js +2 -6
- package/lib/cjs/resources/captures.d.ts +19 -19
- package/lib/cjs/resources/captures.js +1 -5
- package/lib/cjs/resources/carrier_accounts.d.ts +7 -7
- package/lib/cjs/resources/carrier_accounts.js +0 -4
- package/lib/cjs/resources/checkout_com_gateways.d.ts +12 -12
- package/lib/cjs/resources/checkout_com_gateways.js +2 -6
- package/lib/cjs/resources/checkout_com_payments.d.ts +26 -26
- package/lib/cjs/resources/checkout_com_payments.js +2 -6
- package/lib/cjs/resources/cleanups.d.ts +13 -13
- package/lib/cjs/resources/cleanups.js +1 -5
- package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +7 -7
- package/lib/cjs/resources/coupon_codes_promotion_rules.js +2 -6
- package/lib/cjs/resources/coupon_recipients.d.ts +13 -13
- package/lib/cjs/resources/coupon_recipients.js +2 -6
- package/lib/cjs/resources/coupons.d.ts +14 -14
- package/lib/cjs/resources/coupons.js +2 -6
- package/lib/cjs/resources/customer_addresses.d.ts +8 -8
- package/lib/cjs/resources/customer_addresses.js +2 -6
- package/lib/cjs/resources/customer_groups.d.ts +6 -6
- package/lib/cjs/resources/customer_groups.js +2 -6
- package/lib/cjs/resources/customer_password_resets.d.ts +8 -8
- package/lib/cjs/resources/customer_password_resets.js +2 -6
- package/lib/cjs/resources/customer_payment_sources.d.ts +10 -10
- package/lib/cjs/resources/customer_payment_sources.js +2 -6
- package/lib/cjs/resources/customer_subscriptions.d.ts +4 -4
- package/lib/cjs/resources/customer_subscriptions.js +2 -6
- package/lib/cjs/resources/customers.d.ts +19 -19
- package/lib/cjs/resources/customers.js +2 -6
- package/lib/cjs/resources/delivery_lead_times.d.ts +11 -11
- package/lib/cjs/resources/delivery_lead_times.js +2 -6
- package/lib/cjs/resources/event_callbacks.d.ts +7 -7
- package/lib/cjs/resources/event_callbacks.js +0 -4
- package/lib/cjs/resources/events.d.ts +4 -4
- package/lib/cjs/resources/events.js +0 -4
- package/lib/cjs/resources/exports.d.ts +17 -17
- package/lib/cjs/resources/exports.js +1 -5
- package/lib/cjs/resources/external_gateways.d.ts +20 -20
- package/lib/cjs/resources/external_gateways.js +2 -6
- package/lib/cjs/resources/external_payments.d.ts +11 -11
- package/lib/cjs/resources/external_payments.js +2 -6
- package/lib/cjs/resources/external_promotions.d.ts +29 -29
- package/lib/cjs/resources/external_promotions.js +2 -6
- package/lib/cjs/resources/external_tax_calculators.d.ts +6 -6
- package/lib/cjs/resources/external_tax_calculators.js +2 -6
- package/lib/cjs/resources/fixed_amount_promotions.d.ts +31 -31
- package/lib/cjs/resources/fixed_amount_promotions.js +2 -6
- package/lib/cjs/resources/fixed_price_promotions.d.ts +36 -36
- package/lib/cjs/resources/fixed_price_promotions.js +6 -10
- package/lib/cjs/resources/free_gift_promotions.d.ts +36 -36
- package/lib/cjs/resources/free_gift_promotions.js +6 -10
- package/lib/cjs/resources/free_shipping_promotions.d.ts +30 -27
- package/lib/cjs/resources/free_shipping_promotions.js +6 -6
- package/lib/cjs/resources/geocoders.d.ts +4 -4
- package/lib/cjs/resources/geocoders.js +0 -4
- package/lib/cjs/resources/gift_card_recipients.d.ts +13 -13
- package/lib/cjs/resources/gift_card_recipients.js +2 -6
- package/lib/cjs/resources/gift_cards.d.ts +41 -41
- package/lib/cjs/resources/gift_cards.js +2 -6
- package/lib/cjs/resources/google_geocoders.d.ts +6 -6
- package/lib/cjs/resources/google_geocoders.js +2 -6
- package/lib/cjs/resources/imports.d.ts +20 -20
- package/lib/cjs/resources/imports.js +1 -5
- package/lib/cjs/resources/in_stock_subscriptions.d.ts +20 -20
- package/lib/cjs/resources/in_stock_subscriptions.js +2 -6
- package/lib/cjs/resources/inventory_models.d.ts +12 -12
- package/lib/cjs/resources/inventory_models.js +2 -6
- package/lib/cjs/resources/inventory_return_locations.d.ts +8 -8
- package/lib/cjs/resources/inventory_return_locations.js +2 -6
- package/lib/cjs/resources/inventory_stock_locations.d.ts +11 -11
- package/lib/cjs/resources/inventory_stock_locations.js +2 -6
- package/lib/cjs/resources/klarna_gateways.d.ts +10 -10
- package/lib/cjs/resources/klarna_gateways.js +2 -6
- package/lib/cjs/resources/klarna_payments.d.ts +15 -15
- package/lib/cjs/resources/klarna_payments.js +2 -6
- package/lib/cjs/resources/line_item_options.d.ts +19 -19
- package/lib/cjs/resources/line_item_options.js +2 -6
- package/lib/cjs/resources/line_items.d.ts +47 -44
- package/lib/cjs/resources/line_items.js +2 -6
- package/lib/cjs/resources/manual_gateways.d.ts +4 -4
- package/lib/cjs/resources/manual_gateways.js +2 -6
- package/lib/cjs/resources/manual_tax_calculators.d.ts +8 -8
- package/lib/cjs/resources/manual_tax_calculators.js +2 -6
- package/lib/cjs/resources/markets.d.ts +41 -33
- package/lib/cjs/resources/markets.js +6 -6
- package/lib/cjs/resources/merchants.d.ts +6 -6
- package/lib/cjs/resources/merchants.js +2 -6
- package/lib/cjs/resources/order_amount_promotion_rules.d.ts +10 -10
- package/lib/cjs/resources/order_amount_promotion_rules.js +2 -6
- package/lib/cjs/resources/order_copies.d.ts +23 -21
- package/lib/cjs/resources/order_copies.js +8 -9
- package/lib/cjs/resources/order_factories.d.ts +34 -0
- package/lib/cjs/resources/order_factories.js +28 -0
- package/lib/cjs/resources/order_subscription_items.d.ts +61 -0
- package/lib/cjs/resources/order_subscription_items.js +29 -0
- package/lib/cjs/resources/order_subscriptions.d.ts +52 -30
- package/lib/cjs/resources/order_subscriptions.js +20 -8
- package/lib/cjs/resources/order_validation_rules.d.ts +4 -4
- package/lib/cjs/resources/order_validation_rules.js +0 -4
- package/lib/cjs/resources/orders.d.ts +192 -184
- package/lib/cjs/resources/orders.js +10 -6
- package/lib/cjs/resources/organization.d.ts +18 -17
- package/lib/cjs/resources/organization.js +0 -1
- package/lib/cjs/resources/packages.d.ts +14 -14
- package/lib/cjs/resources/packages.js +2 -6
- package/lib/cjs/resources/parcel_line_items.d.ts +8 -8
- package/lib/cjs/resources/parcel_line_items.js +2 -6
- package/lib/cjs/resources/parcels.d.ts +75 -75
- package/lib/cjs/resources/parcels.js +2 -6
- package/lib/cjs/resources/payment_gateways.d.ts +3 -3
- package/lib/cjs/resources/payment_gateways.js +0 -4
- package/lib/cjs/resources/payment_methods.d.ts +33 -33
- package/lib/cjs/resources/payment_methods.js +2 -6
- package/lib/cjs/resources/paypal_gateways.d.ts +7 -7
- package/lib/cjs/resources/paypal_gateways.js +2 -6
- package/lib/cjs/resources/paypal_payments.d.ts +18 -18
- package/lib/cjs/resources/paypal_payments.js +2 -6
- package/lib/cjs/resources/percentage_discount_promotions.d.ts +35 -35
- package/lib/cjs/resources/percentage_discount_promotions.js +6 -10
- package/lib/cjs/resources/price_frequency_tiers.d.ts +50 -0
- package/lib/cjs/resources/price_frequency_tiers.js +37 -0
- package/lib/cjs/resources/price_lists.d.ts +9 -9
- package/lib/cjs/resources/price_lists.js +2 -6
- package/lib/cjs/resources/price_tiers.d.ts +7 -7
- package/lib/cjs/resources/price_tiers.js +0 -4
- package/lib/cjs/resources/price_volume_tiers.d.ts +15 -12
- package/lib/cjs/resources/price_volume_tiers.js +6 -6
- package/lib/cjs/resources/prices.d.ts +20 -17
- package/lib/cjs/resources/prices.js +6 -6
- package/lib/cjs/resources/promotion_rules.d.ts +3 -4
- package/lib/cjs/resources/promotion_rules.js +0 -4
- package/lib/cjs/resources/promotions.d.ts +14 -11
- package/lib/cjs/resources/promotions.js +4 -4
- package/lib/cjs/resources/recurring_order_copies.d.ts +53 -0
- package/lib/cjs/resources/recurring_order_copies.js +41 -0
- package/lib/cjs/resources/refunds.d.ts +10 -10
- package/lib/cjs/resources/refunds.js +0 -4
- package/lib/cjs/resources/return_line_items.d.ts +14 -14
- package/lib/cjs/resources/return_line_items.js +2 -6
- package/lib/cjs/resources/returns.d.ts +31 -31
- package/lib/cjs/resources/returns.js +2 -6
- package/lib/cjs/resources/satispay_gateways.d.ts +8 -8
- package/lib/cjs/resources/satispay_gateways.js +2 -6
- package/lib/cjs/resources/satispay_payments.d.ts +13 -13
- package/lib/cjs/resources/satispay_payments.js +2 -6
- package/lib/cjs/resources/shipments.d.ts +42 -42
- package/lib/cjs/resources/shipments.js +1 -5
- package/lib/cjs/resources/shipping_categories.d.ts +5 -5
- package/lib/cjs/resources/shipping_categories.js +2 -6
- package/lib/cjs/resources/shipping_method_tiers.d.ts +7 -7
- package/lib/cjs/resources/shipping_method_tiers.js +0 -4
- package/lib/cjs/resources/shipping_methods.d.ts +50 -50
- package/lib/cjs/resources/shipping_methods.js +2 -6
- package/lib/cjs/resources/shipping_weight_tiers.d.ts +12 -12
- package/lib/cjs/resources/shipping_weight_tiers.js +2 -6
- package/lib/cjs/resources/shipping_zones.d.ts +22 -22
- package/lib/cjs/resources/shipping_zones.js +2 -6
- package/lib/cjs/resources/sku_list_items.d.ts +14 -14
- package/lib/cjs/resources/sku_list_items.js +2 -6
- package/lib/cjs/resources/sku_list_promotion_rules.d.ts +14 -14
- package/lib/cjs/resources/sku_list_promotion_rules.js +2 -6
- package/lib/cjs/resources/sku_lists.d.ts +22 -22
- package/lib/cjs/resources/sku_lists.js +2 -6
- package/lib/cjs/resources/sku_options.d.ts +25 -25
- package/lib/cjs/resources/sku_options.js +2 -6
- package/lib/cjs/resources/skus.d.ts +36 -36
- package/lib/cjs/resources/skus.js +2 -6
- package/lib/cjs/resources/stock_items.d.ts +12 -12
- package/lib/cjs/resources/stock_items.js +2 -6
- package/lib/cjs/resources/stock_line_items.d.ts +8 -8
- package/lib/cjs/resources/stock_line_items.js +0 -4
- package/lib/cjs/resources/stock_locations.d.ts +17 -17
- package/lib/cjs/resources/stock_locations.js +2 -6
- package/lib/cjs/resources/stock_transfers.d.ts +24 -24
- package/lib/cjs/resources/stock_transfers.js +2 -6
- package/lib/cjs/resources/stripe_gateways.d.ts +12 -12
- package/lib/cjs/resources/stripe_gateways.js +2 -6
- package/lib/cjs/resources/stripe_payments.d.ts +16 -16
- package/lib/cjs/resources/stripe_payments.js +2 -6
- package/lib/cjs/resources/subscription_models.d.ts +49 -0
- package/lib/cjs/resources/subscription_models.js +37 -0
- package/lib/cjs/resources/tax_calculators.d.ts +4 -4
- package/lib/cjs/resources/tax_calculators.js +0 -4
- package/lib/cjs/resources/tax_categories.d.ts +10 -10
- package/lib/cjs/resources/tax_categories.js +2 -6
- package/lib/cjs/resources/tax_rules.d.ts +40 -40
- package/lib/cjs/resources/tax_rules.js +2 -6
- package/lib/cjs/resources/taxjar_accounts.d.ts +9 -9
- package/lib/cjs/resources/taxjar_accounts.js +2 -6
- package/lib/cjs/resources/transactions.d.ts +9 -9
- package/lib/cjs/resources/transactions.js +0 -4
- package/lib/cjs/resources/voids.d.ts +10 -10
- package/lib/cjs/resources/voids.js +0 -4
- package/lib/cjs/resources/webhooks.d.ts +14 -14
- package/lib/cjs/resources/webhooks.js +2 -6
- package/lib/cjs/resources/wire_transfers.d.ts +6 -6
- package/lib/cjs/resources/wire_transfers.js +2 -6
- package/lib/cjs/static.d.ts +1 -1
- package/lib/cjs/util.d.ts +1 -3
- package/lib/esm/api.d.ts +27 -2
- package/lib/esm/api.js +10 -13
- package/lib/esm/client.d.ts +3 -5
- package/lib/esm/client.js +11 -7
- package/lib/esm/commercelayer.d.ts +10 -5
- package/lib/esm/commercelayer.js +8 -3
- package/lib/esm/common.d.ts +1 -0
- package/lib/esm/common.js +11 -0
- package/lib/esm/config.d.ts +1 -0
- package/lib/esm/config.js +1 -0
- package/lib/esm/debug.js +0 -1
- package/lib/esm/error.js +1 -3
- package/lib/esm/index.d.ts +1 -1
- package/lib/esm/index.js +0 -2
- package/lib/esm/interceptor.d.ts +1 -1
- package/lib/esm/jsonapi.js +5 -1
- package/lib/esm/model.d.ts +6 -1
- package/lib/esm/query.d.ts +8 -15
- package/lib/esm/query.js +2 -2
- package/lib/esm/resource.d.ts +17 -22
- package/lib/esm/resource.js +12 -9
- package/lib/esm/resources/addresses.d.ts +52 -52
- package/lib/esm/resources/addresses.js +2 -6
- package/lib/esm/resources/adjustments.d.ts +6 -6
- package/lib/esm/resources/adjustments.js +2 -6
- package/lib/esm/resources/adyen_gateways.d.ts +21 -21
- package/lib/esm/resources/adyen_gateways.js +2 -6
- package/lib/esm/resources/adyen_payments.d.ts +16 -16
- package/lib/esm/resources/adyen_payments.js +2 -6
- package/lib/esm/resources/application.d.ts +7 -6
- package/lib/esm/resources/application.js +0 -1
- package/lib/esm/resources/attachments.d.ts +12 -12
- package/lib/esm/resources/attachments.js +2 -6
- package/lib/esm/resources/authorizations.d.ts +28 -28
- package/lib/esm/resources/authorizations.js +1 -5
- package/lib/esm/resources/avalara_accounts.d.ts +17 -17
- package/lib/esm/resources/avalara_accounts.js +2 -6
- package/lib/esm/resources/axerve_gateways.d.ts +9 -9
- package/lib/esm/resources/axerve_gateways.js +2 -6
- package/lib/esm/resources/axerve_payments.d.ts +13 -13
- package/lib/esm/resources/axerve_payments.js +2 -6
- package/lib/esm/resources/billing_info_validation_rules.d.ts +5 -5
- package/lib/esm/resources/billing_info_validation_rules.js +2 -6
- package/lib/esm/resources/bing_geocoders.d.ts +6 -6
- package/lib/esm/resources/bing_geocoders.js +2 -6
- package/lib/esm/resources/braintree_gateways.d.ts +21 -21
- package/lib/esm/resources/braintree_gateways.js +2 -6
- package/lib/esm/resources/braintree_payments.d.ts +18 -18
- package/lib/esm/resources/braintree_payments.js +2 -6
- package/lib/esm/resources/bundles.d.ts +27 -27
- package/lib/esm/resources/bundles.js +2 -6
- package/lib/esm/resources/captures.d.ts +19 -19
- package/lib/esm/resources/captures.js +1 -5
- package/lib/esm/resources/carrier_accounts.d.ts +7 -7
- package/lib/esm/resources/carrier_accounts.js +0 -4
- package/lib/esm/resources/checkout_com_gateways.d.ts +12 -12
- package/lib/esm/resources/checkout_com_gateways.js +2 -6
- package/lib/esm/resources/checkout_com_payments.d.ts +26 -26
- package/lib/esm/resources/checkout_com_payments.js +2 -6
- package/lib/esm/resources/cleanups.d.ts +13 -13
- package/lib/esm/resources/cleanups.js +1 -5
- package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +7 -7
- package/lib/esm/resources/coupon_codes_promotion_rules.js +2 -6
- package/lib/esm/resources/coupon_recipients.d.ts +13 -13
- package/lib/esm/resources/coupon_recipients.js +2 -6
- package/lib/esm/resources/coupons.d.ts +14 -14
- package/lib/esm/resources/coupons.js +2 -6
- package/lib/esm/resources/customer_addresses.d.ts +8 -8
- package/lib/esm/resources/customer_addresses.js +2 -6
- package/lib/esm/resources/customer_groups.d.ts +6 -6
- package/lib/esm/resources/customer_groups.js +2 -6
- package/lib/esm/resources/customer_password_resets.d.ts +8 -8
- package/lib/esm/resources/customer_password_resets.js +2 -6
- package/lib/esm/resources/customer_payment_sources.d.ts +10 -10
- package/lib/esm/resources/customer_payment_sources.js +2 -6
- package/lib/esm/resources/customer_subscriptions.d.ts +4 -4
- package/lib/esm/resources/customer_subscriptions.js +2 -6
- package/lib/esm/resources/customers.d.ts +19 -19
- package/lib/esm/resources/customers.js +2 -6
- package/lib/esm/resources/delivery_lead_times.d.ts +11 -11
- package/lib/esm/resources/delivery_lead_times.js +2 -6
- package/lib/esm/resources/event_callbacks.d.ts +7 -7
- package/lib/esm/resources/event_callbacks.js +0 -4
- package/lib/esm/resources/events.d.ts +4 -4
- package/lib/esm/resources/events.js +0 -4
- package/lib/esm/resources/exports.d.ts +17 -17
- package/lib/esm/resources/exports.js +1 -5
- package/lib/esm/resources/external_gateways.d.ts +20 -20
- package/lib/esm/resources/external_gateways.js +2 -6
- package/lib/esm/resources/external_payments.d.ts +11 -11
- package/lib/esm/resources/external_payments.js +2 -6
- package/lib/esm/resources/external_promotions.d.ts +29 -29
- package/lib/esm/resources/external_promotions.js +2 -6
- package/lib/esm/resources/external_tax_calculators.d.ts +6 -6
- package/lib/esm/resources/external_tax_calculators.js +2 -6
- package/lib/esm/resources/fixed_amount_promotions.d.ts +31 -31
- package/lib/esm/resources/fixed_amount_promotions.js +2 -6
- package/lib/esm/resources/fixed_price_promotions.d.ts +36 -36
- package/lib/esm/resources/fixed_price_promotions.js +6 -10
- package/lib/esm/resources/free_gift_promotions.d.ts +36 -36
- package/lib/esm/resources/free_gift_promotions.js +6 -10
- package/lib/esm/resources/free_shipping_promotions.d.ts +30 -27
- package/lib/esm/resources/free_shipping_promotions.js +6 -6
- package/lib/esm/resources/geocoders.d.ts +4 -4
- package/lib/esm/resources/geocoders.js +0 -4
- package/lib/esm/resources/gift_card_recipients.d.ts +13 -13
- package/lib/esm/resources/gift_card_recipients.js +2 -6
- package/lib/esm/resources/gift_cards.d.ts +41 -41
- package/lib/esm/resources/gift_cards.js +2 -6
- package/lib/esm/resources/google_geocoders.d.ts +6 -6
- package/lib/esm/resources/google_geocoders.js +2 -6
- package/lib/esm/resources/imports.d.ts +20 -20
- package/lib/esm/resources/imports.js +1 -5
- package/lib/esm/resources/in_stock_subscriptions.d.ts +20 -20
- package/lib/esm/resources/in_stock_subscriptions.js +2 -6
- package/lib/esm/resources/inventory_models.d.ts +12 -12
- package/lib/esm/resources/inventory_models.js +2 -6
- package/lib/esm/resources/inventory_return_locations.d.ts +8 -8
- package/lib/esm/resources/inventory_return_locations.js +2 -6
- package/lib/esm/resources/inventory_stock_locations.d.ts +11 -11
- package/lib/esm/resources/inventory_stock_locations.js +2 -6
- package/lib/esm/resources/klarna_gateways.d.ts +10 -10
- package/lib/esm/resources/klarna_gateways.js +2 -6
- package/lib/esm/resources/klarna_payments.d.ts +15 -15
- package/lib/esm/resources/klarna_payments.js +2 -6
- package/lib/esm/resources/line_item_options.d.ts +19 -19
- package/lib/esm/resources/line_item_options.js +2 -6
- package/lib/esm/resources/line_items.d.ts +47 -44
- package/lib/esm/resources/line_items.js +2 -6
- package/lib/esm/resources/manual_gateways.d.ts +4 -4
- package/lib/esm/resources/manual_gateways.js +2 -6
- package/lib/esm/resources/manual_tax_calculators.d.ts +8 -8
- package/lib/esm/resources/manual_tax_calculators.js +2 -6
- package/lib/esm/resources/markets.d.ts +41 -33
- package/lib/esm/resources/markets.js +6 -6
- package/lib/esm/resources/merchants.d.ts +6 -6
- package/lib/esm/resources/merchants.js +2 -6
- package/lib/esm/resources/order_amount_promotion_rules.d.ts +10 -10
- package/lib/esm/resources/order_amount_promotion_rules.js +2 -6
- package/lib/esm/resources/order_copies.d.ts +23 -21
- package/lib/esm/resources/order_copies.js +8 -9
- package/lib/esm/resources/order_factories.d.ts +34 -0
- package/lib/esm/resources/order_factories.js +26 -0
- package/lib/esm/resources/order_subscription_items.d.ts +61 -0
- package/lib/esm/resources/order_subscription_items.js +27 -0
- package/lib/esm/resources/order_subscriptions.d.ts +52 -30
- package/lib/esm/resources/order_subscriptions.js +20 -8
- package/lib/esm/resources/order_validation_rules.d.ts +4 -4
- package/lib/esm/resources/order_validation_rules.js +0 -4
- package/lib/esm/resources/orders.d.ts +192 -184
- package/lib/esm/resources/orders.js +10 -6
- package/lib/esm/resources/organization.d.ts +18 -17
- package/lib/esm/resources/organization.js +0 -1
- package/lib/esm/resources/packages.d.ts +14 -14
- package/lib/esm/resources/packages.js +2 -6
- package/lib/esm/resources/parcel_line_items.d.ts +8 -8
- package/lib/esm/resources/parcel_line_items.js +2 -6
- package/lib/esm/resources/parcels.d.ts +75 -75
- package/lib/esm/resources/parcels.js +2 -6
- package/lib/esm/resources/payment_gateways.d.ts +3 -3
- package/lib/esm/resources/payment_gateways.js +0 -4
- package/lib/esm/resources/payment_methods.d.ts +33 -33
- package/lib/esm/resources/payment_methods.js +2 -6
- package/lib/esm/resources/paypal_gateways.d.ts +7 -7
- package/lib/esm/resources/paypal_gateways.js +2 -6
- package/lib/esm/resources/paypal_payments.d.ts +18 -18
- package/lib/esm/resources/paypal_payments.js +2 -6
- package/lib/esm/resources/percentage_discount_promotions.d.ts +35 -35
- package/lib/esm/resources/percentage_discount_promotions.js +6 -10
- package/lib/esm/resources/price_frequency_tiers.d.ts +50 -0
- package/lib/esm/resources/price_frequency_tiers.js +35 -0
- package/lib/esm/resources/price_lists.d.ts +9 -9
- package/lib/esm/resources/price_lists.js +2 -6
- package/lib/esm/resources/price_tiers.d.ts +7 -7
- package/lib/esm/resources/price_tiers.js +0 -4
- package/lib/esm/resources/price_volume_tiers.d.ts +15 -12
- package/lib/esm/resources/price_volume_tiers.js +6 -6
- package/lib/esm/resources/prices.d.ts +20 -17
- package/lib/esm/resources/prices.js +6 -6
- package/lib/esm/resources/promotion_rules.d.ts +3 -4
- package/lib/esm/resources/promotion_rules.js +0 -4
- package/lib/esm/resources/promotions.d.ts +14 -11
- package/lib/esm/resources/promotions.js +4 -4
- package/lib/esm/resources/recurring_order_copies.d.ts +53 -0
- package/lib/esm/resources/recurring_order_copies.js +39 -0
- package/lib/esm/resources/refunds.d.ts +10 -10
- package/lib/esm/resources/refunds.js +0 -4
- package/lib/esm/resources/return_line_items.d.ts +14 -14
- package/lib/esm/resources/return_line_items.js +2 -6
- package/lib/esm/resources/returns.d.ts +31 -31
- package/lib/esm/resources/returns.js +2 -6
- package/lib/esm/resources/satispay_gateways.d.ts +8 -8
- package/lib/esm/resources/satispay_gateways.js +2 -6
- package/lib/esm/resources/satispay_payments.d.ts +13 -13
- package/lib/esm/resources/satispay_payments.js +2 -6
- package/lib/esm/resources/shipments.d.ts +42 -42
- package/lib/esm/resources/shipments.js +1 -5
- package/lib/esm/resources/shipping_categories.d.ts +5 -5
- package/lib/esm/resources/shipping_categories.js +2 -6
- package/lib/esm/resources/shipping_method_tiers.d.ts +7 -7
- package/lib/esm/resources/shipping_method_tiers.js +0 -4
- package/lib/esm/resources/shipping_methods.d.ts +50 -50
- package/lib/esm/resources/shipping_methods.js +2 -6
- package/lib/esm/resources/shipping_weight_tiers.d.ts +12 -12
- package/lib/esm/resources/shipping_weight_tiers.js +2 -6
- package/lib/esm/resources/shipping_zones.d.ts +22 -22
- package/lib/esm/resources/shipping_zones.js +2 -6
- package/lib/esm/resources/sku_list_items.d.ts +14 -14
- package/lib/esm/resources/sku_list_items.js +2 -6
- package/lib/esm/resources/sku_list_promotion_rules.d.ts +14 -14
- package/lib/esm/resources/sku_list_promotion_rules.js +2 -6
- package/lib/esm/resources/sku_lists.d.ts +22 -22
- package/lib/esm/resources/sku_lists.js +2 -6
- package/lib/esm/resources/sku_options.d.ts +25 -25
- package/lib/esm/resources/sku_options.js +2 -6
- package/lib/esm/resources/skus.d.ts +36 -36
- package/lib/esm/resources/skus.js +2 -6
- package/lib/esm/resources/stock_items.d.ts +12 -12
- package/lib/esm/resources/stock_items.js +2 -6
- package/lib/esm/resources/stock_line_items.d.ts +8 -8
- package/lib/esm/resources/stock_line_items.js +0 -4
- package/lib/esm/resources/stock_locations.d.ts +17 -17
- package/lib/esm/resources/stock_locations.js +2 -6
- package/lib/esm/resources/stock_transfers.d.ts +24 -24
- package/lib/esm/resources/stock_transfers.js +2 -6
- package/lib/esm/resources/stripe_gateways.d.ts +12 -12
- package/lib/esm/resources/stripe_gateways.js +2 -6
- package/lib/esm/resources/stripe_payments.d.ts +16 -16
- package/lib/esm/resources/stripe_payments.js +2 -6
- package/lib/esm/resources/subscription_models.d.ts +49 -0
- package/lib/esm/resources/subscription_models.js +35 -0
- package/lib/esm/resources/tax_calculators.d.ts +4 -4
- package/lib/esm/resources/tax_calculators.js +0 -4
- package/lib/esm/resources/tax_categories.d.ts +10 -10
- package/lib/esm/resources/tax_categories.js +2 -6
- package/lib/esm/resources/tax_rules.d.ts +40 -40
- package/lib/esm/resources/tax_rules.js +2 -6
- package/lib/esm/resources/taxjar_accounts.d.ts +9 -9
- package/lib/esm/resources/taxjar_accounts.js +2 -6
- package/lib/esm/resources/transactions.d.ts +9 -9
- package/lib/esm/resources/transactions.js +0 -4
- package/lib/esm/resources/voids.d.ts +10 -10
- package/lib/esm/resources/voids.js +0 -4
- package/lib/esm/resources/webhooks.d.ts +14 -14
- package/lib/esm/resources/webhooks.js +2 -6
- package/lib/esm/resources/wire_transfers.d.ts +6 -6
- package/lib/esm/resources/wire_transfers.js +2 -6
- package/lib/esm/static.d.ts +1 -1
- package/lib/esm/util.d.ts +1 -3
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
package/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
MIT License
|
2
2
|
|
3
|
-
Copyright (c) [
|
3
|
+
Copyright (c) [2023] [Commerce Layer]
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
18
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
SOFTWARE.
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
@@ -6,6 +6,7 @@
|
|
6
6
|
[](https://github.com/semantic-release/semantic-release)
|
7
7
|
[](https://github.com/commercelayer/commercelayer-sdk/actions/workflows/semantic-release.yml)
|
8
8
|
[](https://github.com/commercelayer/commercelayer-cli/actions/workflows/codeql-analysis.yml)
|
9
|
+
[](https://www.typescriptlang.org/)
|
9
10
|
|
10
11
|
A JavaScript Library wrapper that makes it quick and easy to interact with the [Commerce Layer API](https://docs.commercelayer.io/developers).
|
11
12
|
|
@@ -279,6 +280,23 @@ In general:
|
|
279
280
|
ℹ️ Check our API reference for more information on how to [fetch relationships](https://docs.commercelayer.io/core/fetching-relationships).
|
280
281
|
</details>
|
281
282
|
|
283
|
+
<details>
|
284
|
+
<summary>How to count resources</summary>
|
285
|
+
<br />
|
286
|
+
|
287
|
+
Many times you simply need to count how many resources exist with
|
288
|
+
certain characteristics. You can then call the special `count`
|
289
|
+
function passing a filter to get as result the total number of
|
290
|
+
resources.
|
291
|
+
|
292
|
+
```javascript
|
293
|
+
// Get the total number of placed orders
|
294
|
+
const placedOrders = cl.orders.count({ filters: { status_eq: 'placed' } })
|
295
|
+
|
296
|
+
```
|
297
|
+
|
298
|
+
</details>
|
299
|
+
|
282
300
|
### Update
|
283
301
|
|
284
302
|
<details>
|
package/lib/cjs/api.d.ts
CHANGED
@@ -61,6 +61,8 @@ export { default as Markets } from './resources/markets';
|
|
61
61
|
export { default as Merchants } from './resources/merchants';
|
62
62
|
export { default as OrderAmountPromotionRules } from './resources/order_amount_promotion_rules';
|
63
63
|
export { default as OrderCopies } from './resources/order_copies';
|
64
|
+
export { default as OrderFactories } from './resources/order_factories';
|
65
|
+
export { default as OrderSubscriptionItems } from './resources/order_subscription_items';
|
64
66
|
export { default as OrderSubscriptions } from './resources/order_subscriptions';
|
65
67
|
export { default as OrderValidationRules } from './resources/order_validation_rules';
|
66
68
|
export { default as Orders } from './resources/orders';
|
@@ -73,12 +75,14 @@ export { default as PaymentMethods } from './resources/payment_methods';
|
|
73
75
|
export { default as PaypalGateways } from './resources/paypal_gateways';
|
74
76
|
export { default as PaypalPayments } from './resources/paypal_payments';
|
75
77
|
export { default as PercentageDiscountPromotions } from './resources/percentage_discount_promotions';
|
78
|
+
export { default as PriceFrequencyTiers } from './resources/price_frequency_tiers';
|
76
79
|
export { default as PriceLists } from './resources/price_lists';
|
77
80
|
export { default as PriceTiers } from './resources/price_tiers';
|
78
81
|
export { default as PriceVolumeTiers } from './resources/price_volume_tiers';
|
79
82
|
export { default as Prices } from './resources/prices';
|
80
83
|
export { default as PromotionRules } from './resources/promotion_rules';
|
81
84
|
export { default as Promotions } from './resources/promotions';
|
85
|
+
export { default as RecurringOrderCopies } from './resources/recurring_order_copies';
|
82
86
|
export { default as Refunds } from './resources/refunds';
|
83
87
|
export { default as ReturnLineItems } from './resources/return_line_items';
|
84
88
|
export { default as Returns } from './resources/returns';
|
@@ -101,6 +105,7 @@ export { default as StockLocations } from './resources/stock_locations';
|
|
101
105
|
export { default as StockTransfers } from './resources/stock_transfers';
|
102
106
|
export { default as StripeGateways } from './resources/stripe_gateways';
|
103
107
|
export { default as StripePayments } from './resources/stripe_payments';
|
108
|
+
export { default as SubscriptionModels } from './resources/subscription_models';
|
104
109
|
export { default as TaxCalculators } from './resources/tax_calculators';
|
105
110
|
export { default as TaxCategories } from './resources/tax_categories';
|
106
111
|
export { default as TaxRules } from './resources/tax_rules';
|
@@ -109,5 +114,25 @@ export { default as Transactions } from './resources/transactions';
|
|
109
114
|
export { default as Voids } from './resources/voids';
|
110
115
|
export { default as Webhooks } from './resources/webhooks';
|
111
116
|
export { default as WireTransfers } from './resources/wire_transfers';
|
112
|
-
export type ResourceTypeLock = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'application' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'captures' | 'carrier_accounts' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'event_callbacks' | 'events' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'geocoders' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_subscriptions' | 'order_validation_rules' | 'orders' | 'organization' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_gateways' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_lists' | 'price_tiers' | 'price_volume_tiers' | 'prices' | 'promotion_rules' | 'promotions' | 'refunds' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_method_tiers' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_line_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'tax_calculators' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'transactions' | 'voids' | 'webhooks' | 'wire_transfers';
|
113
|
-
export declare const resourceList: readonly ["addresses", "adjustments", "adyen_gateways", "adyen_payments", "application", "attachments", "authorizations", "avalara_accounts", "axerve_gateways", "axerve_payments", "billing_info_validation_rules", "bing_geocoders", "braintree_gateways", "braintree_payments", "bundles", "captures", "carrier_accounts", "checkout_com_gateways", "checkout_com_payments", "cleanups", "coupon_codes_promotion_rules", "coupon_recipients", "coupons", "customer_addresses", "customer_groups", "customer_password_resets", "customer_payment_sources", "customer_subscriptions", "customers", "delivery_lead_times", "event_callbacks", "events", "exports", "external_gateways", "external_payments", "external_promotions", "external_tax_calculators", "fixed_amount_promotions", "fixed_price_promotions", "free_gift_promotions", "free_shipping_promotions", "geocoders", "gift_card_recipients", "gift_cards", "google_geocoders", "imports", "in_stock_subscriptions", "inventory_models", "inventory_return_locations", "inventory_stock_locations", "klarna_gateways", "klarna_payments", "line_item_options", "line_items", "manual_gateways", "manual_tax_calculators", "markets", "merchants", "order_amount_promotion_rules", "order_copies", "order_subscriptions", "order_validation_rules", "orders", "organization", "packages", "parcel_line_items", "parcels", "payment_gateways", "payment_methods", "paypal_gateways", "paypal_payments", "percentage_discount_promotions", "price_lists", "price_tiers", "price_volume_tiers", "prices", "promotion_rules", "promotions", "refunds", "return_line_items", "returns", "satispay_gateways", "satispay_payments", "shipments", "shipping_categories", "shipping_method_tiers", "shipping_methods", "shipping_weight_tiers", "shipping_zones", "sku_list_items", "sku_list_promotion_rules", "sku_lists", "sku_options", "skus", "stock_items", "stock_line_items", "stock_locations", "stock_transfers", "stripe_gateways", "stripe_payments", "tax_calculators", "tax_categories", "tax_rules", "taxjar_accounts", "transactions", "voids", "webhooks", "wire_transfers"];
|
117
|
+
export type ResourceTypeLock = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'application' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'captures' | 'carrier_accounts' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'event_callbacks' | 'events' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'geocoders' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_factories' | 'order_subscription_items' | 'order_subscriptions' | 'order_validation_rules' | 'orders' | 'organization' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_gateways' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_tiers' | 'price_volume_tiers' | 'prices' | 'promotion_rules' | 'promotions' | 'recurring_order_copies' | 'refunds' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_method_tiers' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_line_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tax_calculators' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'transactions' | 'voids' | 'webhooks' | 'wire_transfers';
|
118
|
+
export declare const resourceList: readonly ["addresses", "adjustments", "adyen_gateways", "adyen_payments", "application", "attachments", "authorizations", "avalara_accounts", "axerve_gateways", "axerve_payments", "billing_info_validation_rules", "bing_geocoders", "braintree_gateways", "braintree_payments", "bundles", "captures", "carrier_accounts", "checkout_com_gateways", "checkout_com_payments", "cleanups", "coupon_codes_promotion_rules", "coupon_recipients", "coupons", "customer_addresses", "customer_groups", "customer_password_resets", "customer_payment_sources", "customer_subscriptions", "customers", "delivery_lead_times", "event_callbacks", "events", "exports", "external_gateways", "external_payments", "external_promotions", "external_tax_calculators", "fixed_amount_promotions", "fixed_price_promotions", "free_gift_promotions", "free_shipping_promotions", "geocoders", "gift_card_recipients", "gift_cards", "google_geocoders", "imports", "in_stock_subscriptions", "inventory_models", "inventory_return_locations", "inventory_stock_locations", "klarna_gateways", "klarna_payments", "line_item_options", "line_items", "manual_gateways", "manual_tax_calculators", "markets", "merchants", "order_amount_promotion_rules", "order_copies", "order_factories", "order_subscription_items", "order_subscriptions", "order_validation_rules", "orders", "organization", "packages", "parcel_line_items", "parcels", "payment_gateways", "payment_methods", "paypal_gateways", "paypal_payments", "percentage_discount_promotions", "price_frequency_tiers", "price_lists", "price_tiers", "price_volume_tiers", "prices", "promotion_rules", "promotions", "recurring_order_copies", "refunds", "return_line_items", "returns", "satispay_gateways", "satispay_payments", "shipments", "shipping_categories", "shipping_method_tiers", "shipping_methods", "shipping_weight_tiers", "shipping_zones", "sku_list_items", "sku_list_promotion_rules", "sku_lists", "sku_options", "skus", "stock_items", "stock_line_items", "stock_locations", "stock_transfers", "stripe_gateways", "stripe_payments", "subscription_models", "tax_calculators", "tax_categories", "tax_rules", "taxjar_accounts", "transactions", "voids", "webhooks", "wire_transfers"];
|
119
|
+
export type RetrievableResourceType = ResourceTypeLock;
|
120
|
+
export type RetrievableResource = {
|
121
|
+
type: RetrievableResourceType;
|
122
|
+
};
|
123
|
+
export type ListableResourceType = Exclude<ResourceTypeLock, 'application' | 'organization'>;
|
124
|
+
export type ListableResource = {
|
125
|
+
type: ListableResourceType;
|
126
|
+
};
|
127
|
+
export type CreatableResourceType = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'attachments' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_subscription_items' | 'order_subscriptions' | 'orders' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_volume_tiers' | 'prices' | 'recurring_order_copies' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipping_categories' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'webhooks' | 'wire_transfers';
|
128
|
+
export type CreatableResource = {
|
129
|
+
type: CreatableResourceType;
|
130
|
+
};
|
131
|
+
export type UpdatableResourceType = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'captures' | 'checkout_com_gateways' | 'checkout_com_payments' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_subscription_items' | 'order_subscriptions' | 'orders' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_volume_tiers' | 'prices' | 'recurring_order_copies' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'webhooks' | 'wire_transfers';
|
132
|
+
export type UpdatableResource = {
|
133
|
+
type: UpdatableResourceType;
|
134
|
+
};
|
135
|
+
export type DeletableResourceType = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'attachments' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_subscription_items' | 'order_subscriptions' | 'orders' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_volume_tiers' | 'prices' | 'recurring_order_copies' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipping_categories' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'webhooks' | 'wire_transfers';
|
136
|
+
export type DeletableResource = {
|
137
|
+
type: DeletableResourceType;
|
138
|
+
};
|
package/lib/cjs/api.js
CHANGED
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
6
|
exports.InventoryStockLocations = exports.InventoryReturnLocations = exports.InventoryModels = exports.InStockSubscriptions = exports.Imports = exports.GoogleGeocoders = exports.GiftCards = exports.GiftCardRecipients = exports.Geocoders = exports.FreeShippingPromotions = exports.FreeGiftPromotions = exports.FixedPricePromotions = exports.FixedAmountPromotions = exports.ExternalTaxCalculators = exports.ExternalPromotions = exports.ExternalPayments = exports.ExternalGateways = exports.Exports = exports.Events = exports.EventCallbacks = exports.DeliveryLeadTimes = exports.Customers = exports.CustomerSubscriptions = exports.CustomerPaymentSources = exports.CustomerPasswordResets = exports.CustomerGroups = exports.CustomerAddresses = exports.Coupons = exports.CouponRecipients = exports.CouponCodesPromotionRules = exports.Cleanups = exports.CheckoutComPayments = exports.CheckoutComGateways = exports.CarrierAccounts = exports.Captures = exports.Bundles = exports.BraintreePayments = exports.BraintreeGateways = exports.BingGeocoders = exports.BillingInfoValidationRules = exports.AxervePayments = exports.AxerveGateways = exports.AvalaraAccounts = exports.Authorizations = exports.Attachments = exports.Applications = exports.AdyenPayments = exports.AdyenGateways = exports.Adjustments = exports.Addresses = void 0;
|
7
|
-
exports.
|
8
|
-
exports.resourceList = exports.WireTransfers = exports.Webhooks = exports.Voids = exports.Transactions = exports.TaxjarAccounts = exports.TaxRules = exports.TaxCategories = exports.TaxCalculators = void 0;
|
7
|
+
exports.StockLineItems = exports.StockItems = exports.Skus = exports.SkuOptions = exports.SkuLists = exports.SkuListPromotionRules = exports.SkuListItems = exports.ShippingZones = exports.ShippingWeightTiers = exports.ShippingMethods = exports.ShippingMethodTiers = exports.ShippingCategories = exports.Shipments = exports.SatispayPayments = exports.SatispayGateways = exports.Returns = exports.ReturnLineItems = exports.Refunds = exports.RecurringOrderCopies = exports.Promotions = exports.PromotionRules = exports.Prices = exports.PriceVolumeTiers = exports.PriceTiers = exports.PriceLists = exports.PriceFrequencyTiers = exports.PercentageDiscountPromotions = exports.PaypalPayments = exports.PaypalGateways = exports.PaymentMethods = exports.PaymentGateways = exports.Parcels = exports.ParcelLineItems = exports.Packages = exports.Organizations = exports.Orders = exports.OrderValidationRules = exports.OrderSubscriptions = exports.OrderSubscriptionItems = exports.OrderFactories = exports.OrderCopies = exports.OrderAmountPromotionRules = exports.Merchants = exports.Markets = exports.ManualTaxCalculators = exports.ManualGateways = exports.LineItems = exports.LineItemOptions = exports.KlarnaPayments = exports.KlarnaGateways = void 0;
|
8
|
+
exports.resourceList = exports.WireTransfers = exports.Webhooks = exports.Voids = exports.Transactions = exports.TaxjarAccounts = exports.TaxRules = exports.TaxCategories = exports.TaxCalculators = exports.SubscriptionModels = exports.StripePayments = exports.StripeGateways = exports.StockTransfers = exports.StockLocations = void 0;
|
9
9
|
// ##__API_RESOURCES_START__##
|
10
10
|
// ##__API_RESOURCES_TEMPLATE:: export { default as ##__RESOURCE_CLASS__## } from './resources/##__RESOURCE_TYPE__##'
|
11
11
|
/**
|
@@ -131,6 +131,10 @@ var order_amount_promotion_rules_1 = require("./resources/order_amount_promotion
|
|
131
131
|
Object.defineProperty(exports, "OrderAmountPromotionRules", { enumerable: true, get: function () { return __importDefault(order_amount_promotion_rules_1).default; } });
|
132
132
|
var order_copies_1 = require("./resources/order_copies");
|
133
133
|
Object.defineProperty(exports, "OrderCopies", { enumerable: true, get: function () { return __importDefault(order_copies_1).default; } });
|
134
|
+
var order_factories_1 = require("./resources/order_factories");
|
135
|
+
Object.defineProperty(exports, "OrderFactories", { enumerable: true, get: function () { return __importDefault(order_factories_1).default; } });
|
136
|
+
var order_subscription_items_1 = require("./resources/order_subscription_items");
|
137
|
+
Object.defineProperty(exports, "OrderSubscriptionItems", { enumerable: true, get: function () { return __importDefault(order_subscription_items_1).default; } });
|
134
138
|
var order_subscriptions_1 = require("./resources/order_subscriptions");
|
135
139
|
Object.defineProperty(exports, "OrderSubscriptions", { enumerable: true, get: function () { return __importDefault(order_subscriptions_1).default; } });
|
136
140
|
var order_validation_rules_1 = require("./resources/order_validation_rules");
|
@@ -155,6 +159,8 @@ var paypal_payments_1 = require("./resources/paypal_payments");
|
|
155
159
|
Object.defineProperty(exports, "PaypalPayments", { enumerable: true, get: function () { return __importDefault(paypal_payments_1).default; } });
|
156
160
|
var percentage_discount_promotions_1 = require("./resources/percentage_discount_promotions");
|
157
161
|
Object.defineProperty(exports, "PercentageDiscountPromotions", { enumerable: true, get: function () { return __importDefault(percentage_discount_promotions_1).default; } });
|
162
|
+
var price_frequency_tiers_1 = require("./resources/price_frequency_tiers");
|
163
|
+
Object.defineProperty(exports, "PriceFrequencyTiers", { enumerable: true, get: function () { return __importDefault(price_frequency_tiers_1).default; } });
|
158
164
|
var price_lists_1 = require("./resources/price_lists");
|
159
165
|
Object.defineProperty(exports, "PriceLists", { enumerable: true, get: function () { return __importDefault(price_lists_1).default; } });
|
160
166
|
var price_tiers_1 = require("./resources/price_tiers");
|
@@ -167,6 +173,8 @@ var promotion_rules_1 = require("./resources/promotion_rules");
|
|
167
173
|
Object.defineProperty(exports, "PromotionRules", { enumerable: true, get: function () { return __importDefault(promotion_rules_1).default; } });
|
168
174
|
var promotions_1 = require("./resources/promotions");
|
169
175
|
Object.defineProperty(exports, "Promotions", { enumerable: true, get: function () { return __importDefault(promotions_1).default; } });
|
176
|
+
var recurring_order_copies_1 = require("./resources/recurring_order_copies");
|
177
|
+
Object.defineProperty(exports, "RecurringOrderCopies", { enumerable: true, get: function () { return __importDefault(recurring_order_copies_1).default; } });
|
170
178
|
var refunds_1 = require("./resources/refunds");
|
171
179
|
Object.defineProperty(exports, "Refunds", { enumerable: true, get: function () { return __importDefault(refunds_1).default; } });
|
172
180
|
var return_line_items_1 = require("./resources/return_line_items");
|
@@ -211,6 +219,8 @@ var stripe_gateways_1 = require("./resources/stripe_gateways");
|
|
211
219
|
Object.defineProperty(exports, "StripeGateways", { enumerable: true, get: function () { return __importDefault(stripe_gateways_1).default; } });
|
212
220
|
var stripe_payments_1 = require("./resources/stripe_payments");
|
213
221
|
Object.defineProperty(exports, "StripePayments", { enumerable: true, get: function () { return __importDefault(stripe_payments_1).default; } });
|
222
|
+
var subscription_models_1 = require("./resources/subscription_models");
|
223
|
+
Object.defineProperty(exports, "SubscriptionModels", { enumerable: true, get: function () { return __importDefault(subscription_models_1).default; } });
|
214
224
|
var tax_calculators_1 = require("./resources/tax_calculators");
|
215
225
|
Object.defineProperty(exports, "TaxCalculators", { enumerable: true, get: function () { return __importDefault(tax_calculators_1).default; } });
|
216
226
|
var tax_categories_1 = require("./resources/tax_categories");
|
@@ -290,6 +300,8 @@ exports.resourceList = [
|
|
290
300
|
'merchants',
|
291
301
|
'order_amount_promotion_rules',
|
292
302
|
'order_copies',
|
303
|
+
'order_factories',
|
304
|
+
'order_subscription_items',
|
293
305
|
'order_subscriptions',
|
294
306
|
'order_validation_rules',
|
295
307
|
'orders',
|
@@ -302,12 +314,14 @@ exports.resourceList = [
|
|
302
314
|
'paypal_gateways',
|
303
315
|
'paypal_payments',
|
304
316
|
'percentage_discount_promotions',
|
317
|
+
'price_frequency_tiers',
|
305
318
|
'price_lists',
|
306
319
|
'price_tiers',
|
307
320
|
'price_volume_tiers',
|
308
321
|
'prices',
|
309
322
|
'promotion_rules',
|
310
323
|
'promotions',
|
324
|
+
'recurring_order_copies',
|
311
325
|
'refunds',
|
312
326
|
'return_line_items',
|
313
327
|
'returns',
|
@@ -330,6 +344,7 @@ exports.resourceList = [
|
|
330
344
|
'stock_transfers',
|
331
345
|
'stripe_gateways',
|
332
346
|
'stripe_payments',
|
347
|
+
'subscription_models',
|
333
348
|
'tax_calculators',
|
334
349
|
'tax_categories',
|
335
350
|
'tax_rules',
|
@@ -340,16 +355,3 @@ exports.resourceList = [
|
|
340
355
|
'wire_transfers'
|
341
356
|
// ##__API_RESOURCE_LIST_STOP__##
|
342
357
|
];
|
343
|
-
/*
|
344
|
-
type ResourceInfo = {
|
345
|
-
name: string;
|
346
|
-
type: string;
|
347
|
-
api: string;
|
348
|
-
}
|
349
|
-
|
350
|
-
|
351
|
-
export const resourceMap: { [res: string]: ResourceInfo } = {
|
352
|
-
// ##__API_RESOURCE_MAP_START__##
|
353
|
-
// ##__API_RESOURCE_MAP_STOP__##
|
354
|
-
} as const
|
355
|
-
*/
|
package/lib/cjs/client.d.ts
CHANGED
@@ -1,15 +1,13 @@
|
|
1
1
|
/// <reference types="node" />
|
2
2
|
/// <reference types="node" />
|
3
|
-
import { AxiosProxyConfig, Method } from 'axios';
|
3
|
+
import { type AxiosProxyConfig, type Method } from 'axios';
|
4
4
|
import type { InterceptorManager } from './interceptor';
|
5
5
|
import type { Agent as HttpAgent } from 'http';
|
6
6
|
import type { Agent as HttpsAgent } from 'https';
|
7
7
|
type ProxyConfig = AxiosProxyConfig | false;
|
8
8
|
type RequestConfig = {
|
9
9
|
timeout?: number;
|
10
|
-
params?:
|
11
|
-
[key: string]: string | number | boolean;
|
12
|
-
};
|
10
|
+
params?: Record<string, string | number | boolean>;
|
13
11
|
httpAgent?: HttpAgent;
|
14
12
|
httpsAgent?: HttpsAgent;
|
15
13
|
proxy?: ProxyConfig;
|
@@ -30,4 +28,4 @@ declare class ApiClient {
|
|
30
28
|
request(method: Method, path: string, body?: any, options?: ApiClientConfig): Promise<any>;
|
31
29
|
}
|
32
30
|
export default ApiClient;
|
33
|
-
export { ApiClientInitConfig, ApiClientConfig, RequestConfig };
|
31
|
+
export type { ApiClientInitConfig, ApiClientConfig, RequestConfig };
|
package/lib/cjs/client.js
CHANGED
@@ -54,10 +54,9 @@ const handleError = (error) => {
|
|
54
54
|
};
|
55
55
|
class ApiClient {
|
56
56
|
static create(options) {
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
throw new Error("Undefined 'accessToken' parameter");
|
57
|
+
for (const attr of config_1.default.client.requiredAttributes)
|
58
|
+
if (!options || !options[attr])
|
59
|
+
throw new error_1.SdkError({ message: `Undefined '${attr}' parameter` });
|
61
60
|
return new ApiClient(options);
|
62
61
|
}
|
63
62
|
constructor(options) {
|
@@ -72,11 +71,16 @@ class ApiClient {
|
|
72
71
|
httpAgent: options.httpAgent,
|
73
72
|
httpsAgent: options.httpsAgent,
|
74
73
|
};
|
75
|
-
const axiosOptions =
|
74
|
+
const axiosOptions = {
|
75
|
+
baseURL: this.baseUrl,
|
76
|
+
timeout: config_1.default.client.timeout,
|
77
|
+
headers: {
|
76
78
|
'Accept': 'application/vnd.api+json',
|
77
79
|
'Content-Type': 'application/vnd.api+json',
|
78
80
|
'Authorization': 'Bearer ' + __classPrivateFieldGet(this, _ApiClient_accessToken, "f"),
|
79
|
-
}
|
81
|
+
},
|
82
|
+
...axiosConfig
|
83
|
+
};
|
80
84
|
debug('axios options: %O', axiosOptions);
|
81
85
|
__classPrivateFieldSet(this, _ApiClient_client, axios_1.default.create(axiosOptions), "f");
|
82
86
|
this.interceptors = __classPrivateFieldGet(this, _ApiClient_client, "f").interceptors;
|
@@ -109,7 +113,7 @@ class ApiClient {
|
|
109
113
|
const baseUrl = (options === null || options === void 0 ? void 0 : options.organization) ? baseURL(options.organization, options.domain) : undefined;
|
110
114
|
const accessToken = (options === null || options === void 0 ? void 0 : options.accessToken) || __classPrivateFieldGet(this, _ApiClient_accessToken, "f");
|
111
115
|
const headers = accessToken ? { 'Authorization': 'Bearer ' + accessToken } : undefined;
|
112
|
-
const requestParams =
|
116
|
+
const requestParams = { method, baseURL: baseUrl, url, data, headers, ...options };
|
113
117
|
debug('request params: %O', requestParams);
|
114
118
|
// const start = Date.now()
|
115
119
|
return __classPrivateFieldGet(this, _ApiClient_client, "f").request(requestParams)
|
@@ -1,16 +1,16 @@
|
|
1
1
|
import * as api from './api';
|
2
|
-
import { ApiError } from './error';
|
2
|
+
import type { ApiError } from './error';
|
3
3
|
import type { ErrorInterceptor, InterceptorType, RawResponseReader, RequestInterceptor, ResponseInterceptor } from './interceptor';
|
4
|
-
import { ResourcesInitConfig } from './resource';
|
5
|
-
declare const OPEN_API_SCHEMA_VERSION = "4.
|
4
|
+
import { type ResourcesInitConfig } from './resource';
|
5
|
+
declare const OPEN_API_SCHEMA_VERSION = "4.1.3";
|
6
6
|
export { OPEN_API_SCHEMA_VERSION };
|
7
|
-
type SdkConfig =
|
7
|
+
type SdkConfig = Record<string, unknown>;
|
8
8
|
type CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig;
|
9
9
|
type CommerceLayerConfig = Partial<CommerceLayerInitConfig>;
|
10
10
|
declare class CommerceLayerClient {
|
11
11
|
#private;
|
12
12
|
static get openApiSchemaVersion(): string;
|
13
|
-
readonly openApiSchemaVersion = "4.
|
13
|
+
readonly openApiSchemaVersion = "4.1.3";
|
14
14
|
addresses: api.Addresses;
|
15
15
|
adjustments: api.Adjustments;
|
16
16
|
adyen_gateways: api.AdyenGateways;
|
@@ -71,6 +71,8 @@ declare class CommerceLayerClient {
|
|
71
71
|
merchants: api.Merchants;
|
72
72
|
order_amount_promotion_rules: api.OrderAmountPromotionRules;
|
73
73
|
order_copies: api.OrderCopies;
|
74
|
+
order_factories: api.OrderFactories;
|
75
|
+
order_subscription_items: api.OrderSubscriptionItems;
|
74
76
|
order_subscriptions: api.OrderSubscriptions;
|
75
77
|
order_validation_rules: api.OrderValidationRules;
|
76
78
|
orders: api.Orders;
|
@@ -83,12 +85,14 @@ declare class CommerceLayerClient {
|
|
83
85
|
paypal_gateways: api.PaypalGateways;
|
84
86
|
paypal_payments: api.PaypalPayments;
|
85
87
|
percentage_discount_promotions: api.PercentageDiscountPromotions;
|
88
|
+
price_frequency_tiers: api.PriceFrequencyTiers;
|
86
89
|
price_lists: api.PriceLists;
|
87
90
|
price_tiers: api.PriceTiers;
|
88
91
|
price_volume_tiers: api.PriceVolumeTiers;
|
89
92
|
prices: api.Prices;
|
90
93
|
promotion_rules: api.PromotionRules;
|
91
94
|
promotions: api.Promotions;
|
95
|
+
recurring_order_copies: api.RecurringOrderCopies;
|
92
96
|
refunds: api.Refunds;
|
93
97
|
return_line_items: api.ReturnLineItems;
|
94
98
|
returns: api.Returns;
|
@@ -111,6 +115,7 @@ declare class CommerceLayerClient {
|
|
111
115
|
stock_transfers: api.StockTransfers;
|
112
116
|
stripe_gateways: api.StripeGateways;
|
113
117
|
stripe_payments: api.StripePayments;
|
118
|
+
subscription_models: api.SubscriptionModels;
|
114
119
|
tax_calculators: api.TaxCalculators;
|
115
120
|
tax_categories: api.TaxCategories;
|
116
121
|
tax_rules: api.TaxRules;
|
package/lib/cjs/commercelayer.js
CHANGED
@@ -45,7 +45,7 @@ const resource_1 = __importDefault(require("./resource"));
|
|
45
45
|
const debug_1 = __importDefault(require("./debug"));
|
46
46
|
const debug = (0, debug_1.default)('commercelayer');
|
47
47
|
// Autogenerated schema version number, do not remove this line
|
48
|
-
const OPEN_API_SCHEMA_VERSION = '4.
|
48
|
+
const OPEN_API_SCHEMA_VERSION = '4.1.3';
|
49
49
|
exports.OPEN_API_SCHEMA_VERSION = OPEN_API_SCHEMA_VERSION;
|
50
50
|
class CommerceLayerClient {
|
51
51
|
static get openApiSchemaVersion() { return OPEN_API_SCHEMA_VERSION; }
|
@@ -119,6 +119,8 @@ class CommerceLayerClient {
|
|
119
119
|
this.merchants = new api.Merchants(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
120
120
|
this.order_amount_promotion_rules = new api.OrderAmountPromotionRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
121
121
|
this.order_copies = new api.OrderCopies(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
122
|
+
this.order_factories = new api.OrderFactories(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
123
|
+
this.order_subscription_items = new api.OrderSubscriptionItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
122
124
|
this.order_subscriptions = new api.OrderSubscriptions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
123
125
|
this.order_validation_rules = new api.OrderValidationRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
124
126
|
this.orders = new api.Orders(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
@@ -131,12 +133,14 @@ class CommerceLayerClient {
|
|
131
133
|
this.paypal_gateways = new api.PaypalGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
132
134
|
this.paypal_payments = new api.PaypalPayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
133
135
|
this.percentage_discount_promotions = new api.PercentageDiscountPromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
136
|
+
this.price_frequency_tiers = new api.PriceFrequencyTiers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
134
137
|
this.price_lists = new api.PriceLists(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
135
138
|
this.price_tiers = new api.PriceTiers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
136
139
|
this.price_volume_tiers = new api.PriceVolumeTiers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
137
140
|
this.prices = new api.Prices(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
138
141
|
this.promotion_rules = new api.PromotionRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
139
142
|
this.promotions = new api.Promotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
143
|
+
this.recurring_order_copies = new api.RecurringOrderCopies(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
140
144
|
this.refunds = new api.Refunds(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
141
145
|
this.return_line_items = new api.ReturnLineItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
142
146
|
this.returns = new api.Returns(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
@@ -159,6 +163,7 @@ class CommerceLayerClient {
|
|
159
163
|
this.stock_transfers = new api.StockTransfers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
160
164
|
this.stripe_gateways = new api.StripeGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
161
165
|
this.stripe_payments = new api.StripePayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
166
|
+
this.subscription_models = new api.SubscriptionModels(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
162
167
|
this.tax_calculators = new api.TaxCalculators(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
163
168
|
this.tax_categories = new api.TaxCategories(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
164
169
|
this.tax_rules = new api.TaxRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
@@ -198,7 +203,7 @@ class CommerceLayerClient {
|
|
198
203
|
return __classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f").interceptors.response.use(onFulfilled, onRejected);
|
199
204
|
}
|
200
205
|
removeInterceptor(type, id) {
|
201
|
-
|
206
|
+
__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f").interceptors[type].eject(id);
|
202
207
|
}
|
203
208
|
addRawResponseReader(options) {
|
204
209
|
const reader = {
|
@@ -219,7 +224,7 @@ class CommerceLayerClient {
|
|
219
224
|
removeRawResponseReader(reader) {
|
220
225
|
const id = (typeof reader === 'number') ? reader : reader === null || reader === void 0 ? void 0 : reader.id;
|
221
226
|
if (id && (id >= 0))
|
222
|
-
|
227
|
+
this.removeInterceptor('response', id);
|
223
228
|
}
|
224
229
|
}
|
225
230
|
_CommerceLayerClient_adapter = new WeakMap(), _CommerceLayerClient_organization = new WeakMap();
|
package/lib/cjs/common.d.ts
CHANGED
@@ -2,3 +2,4 @@ import type { ResourceId, ResourceType } from './resource';
|
|
2
2
|
declare const isResourceId: (resource: any) => resource is ResourceId;
|
3
3
|
declare const isResourceType: (resource: any) => resource is ResourceType;
|
4
4
|
export { isResourceId, isResourceType };
|
5
|
+
export type ObjectType = Record<string, any>;
|
package/lib/cjs/common.js
CHANGED
@@ -10,3 +10,14 @@ const isResourceType = (resource) => {
|
|
10
10
|
return resource && (typeof resource.type !== 'undefined') && resource.type && api_1.resourceList.includes(resource.type);
|
11
11
|
};
|
12
12
|
exports.isResourceType = isResourceType;
|
13
|
+
/*
|
14
|
+
// Nullable types
|
15
|
+
type StringNullable = string | null
|
16
|
+
type NumberNullable = number | null
|
17
|
+
type BooleanNullable = boolean | null
|
18
|
+
type ResourceNullable<R extends Resource> = R | null
|
19
|
+
type ResourceArrayNullable<R extends Resource> = R[] | null
|
20
|
+
|
21
|
+
|
22
|
+
export type { StringNullable, NumberNullable, BooleanNullable, ResourceNullable, ResourceArrayNullable }
|
23
|
+
*/
|
package/lib/cjs/config.d.ts
CHANGED
package/lib/cjs/config.js
CHANGED
package/lib/cjs/debug.js
CHANGED
@@ -7,7 +7,6 @@ const debuggerFunction = (_pattern, ..._args) => {
|
|
7
7
|
let debuggerFactory = (_namespace) => debuggerFunction;
|
8
8
|
/* Try loading 'debug' module */
|
9
9
|
try {
|
10
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
11
10
|
const debugModule = require('debug');
|
12
11
|
if (debugModule && (typeof debugModule === 'function'))
|
13
12
|
debuggerFactory = debugModule;
|
package/lib/cjs/error.js
CHANGED
@@ -11,7 +11,6 @@ var ErrorType;
|
|
11
11
|
})(ErrorType || (ErrorType = {}));
|
12
12
|
exports.ErrorType = ErrorType;
|
13
13
|
class SdkError extends Error {
|
14
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
15
14
|
static isSdkError(error) {
|
16
15
|
return error && [SdkError.NAME, ApiError.NAME].includes(error.name) && Object.values(ErrorType).includes(error.type);
|
17
16
|
}
|
@@ -24,12 +23,11 @@ class SdkError extends Error {
|
|
24
23
|
exports.SdkError = SdkError;
|
25
24
|
SdkError.NAME = 'SdkError';
|
26
25
|
class ApiError extends SdkError {
|
27
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
28
26
|
static isApiError(error) {
|
29
27
|
return SdkError.isSdkError(error) && (error.name === ApiError.NAME) && (error.type === ErrorType.RESPONSE);
|
30
28
|
}
|
31
29
|
constructor(error) {
|
32
|
-
super(
|
30
|
+
super({ ...error, type: ErrorType.RESPONSE });
|
33
31
|
this.errors = [];
|
34
32
|
this.name = ApiError.NAME; // this.constructor.name
|
35
33
|
}
|
package/lib/cjs/index.d.ts
CHANGED
@@ -2,6 +2,6 @@ export { default, CommerceLayer } from './commercelayer';
|
|
2
2
|
export type { CommerceLayerClient } from './commercelayer';
|
3
3
|
export { CommerceLayerStatic } from './static';
|
4
4
|
export type { QueryParamsRetrieve, QueryParamsList, QueryParams } from './query';
|
5
|
-
export * from './model';
|
5
|
+
export type * from './model';
|
6
6
|
export type { RequestObj, ResponseObj, ErrorObj, HeadersObj } from './interceptor';
|
7
7
|
export type { SdkError, ApiError, ErrorType } from './error';
|
package/lib/cjs/index.js
CHANGED
@@ -1,18 +1,4 @@
|
|
1
1
|
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
-
};
|
16
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
17
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
18
4
|
};
|
@@ -25,5 +11,3 @@ Object.defineProperty(exports, "CommerceLayer", { enumerable: true, get: functio
|
|
25
11
|
// Commerce Layer static functions
|
26
12
|
var static_1 = require("./static");
|
27
13
|
Object.defineProperty(exports, "CommerceLayerStatic", { enumerable: true, get: function () { return static_1.CommerceLayerStatic; } });
|
28
|
-
// Resource model types
|
29
|
-
__exportStar(require("./model"), exports);
|
package/lib/cjs/interceptor.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { AxiosError, AxiosInterceptorManager, AxiosRequestConfig, AxiosResponse, AxiosResponseHeaders, RawAxiosResponseHeaders } from 'axios';
|
1
|
+
import type { AxiosError, AxiosInterceptorManager, AxiosRequestConfig, AxiosResponse, AxiosResponseHeaders, RawAxiosResponseHeaders } from 'axios';
|
2
2
|
type InterceptorManager = {
|
3
3
|
request: AxiosInterceptorManager<AxiosRequestConfig>;
|
4
4
|
response: AxiosInterceptorManager<any>;
|
package/lib/cjs/jsonapi.js
CHANGED
@@ -35,7 +35,11 @@ const denormalizeResource = (res, included) => {
|
|
35
35
|
debug('denormalize resource: %O, %o', res, included || {});
|
36
36
|
if (!res)
|
37
37
|
return res;
|
38
|
-
const resource =
|
38
|
+
const resource = {
|
39
|
+
id: res.id,
|
40
|
+
type: res.type,
|
41
|
+
...res.attributes,
|
42
|
+
};
|
39
43
|
if (res.relationships)
|
40
44
|
Object.keys(res.relationships).forEach(key => {
|
41
45
|
const rel = res.relationships[key].data;
|
package/lib/cjs/model.d.ts
CHANGED
@@ -60,7 +60,9 @@ export type { ManualTaxCalculator, ManualTaxCalculatorCreate, ManualTaxCalculato
|
|
60
60
|
export type { Market, MarketCreate, MarketUpdate } from './resources/markets';
|
61
61
|
export type { Merchant, MerchantCreate, MerchantUpdate } from './resources/merchants';
|
62
62
|
export type { OrderAmountPromotionRule, OrderAmountPromotionRuleCreate, OrderAmountPromotionRuleUpdate } from './resources/order_amount_promotion_rules';
|
63
|
-
export type { OrderCopy, OrderCopyCreate } from './resources/order_copies';
|
63
|
+
export type { OrderCopy, OrderCopyCreate, OrderCopyUpdate } from './resources/order_copies';
|
64
|
+
export type { OrderFactory } from './resources/order_factories';
|
65
|
+
export type { OrderSubscriptionItem, OrderSubscriptionItemCreate, OrderSubscriptionItemUpdate } from './resources/order_subscription_items';
|
64
66
|
export type { OrderSubscription, OrderSubscriptionCreate, OrderSubscriptionUpdate } from './resources/order_subscriptions';
|
65
67
|
export type { OrderValidationRule } from './resources/order_validation_rules';
|
66
68
|
export type { Order, OrderCreate, OrderUpdate } from './resources/orders';
|
@@ -73,12 +75,14 @@ export type { PaymentMethod, PaymentMethodCreate, PaymentMethodUpdate } from './
|
|
73
75
|
export type { PaypalGateway, PaypalGatewayCreate, PaypalGatewayUpdate } from './resources/paypal_gateways';
|
74
76
|
export type { PaypalPayment, PaypalPaymentCreate, PaypalPaymentUpdate } from './resources/paypal_payments';
|
75
77
|
export type { PercentageDiscountPromotion, PercentageDiscountPromotionCreate, PercentageDiscountPromotionUpdate } from './resources/percentage_discount_promotions';
|
78
|
+
export type { PriceFrequencyTier, PriceFrequencyTierCreate, PriceFrequencyTierUpdate } from './resources/price_frequency_tiers';
|
76
79
|
export type { PriceList, PriceListCreate, PriceListUpdate } from './resources/price_lists';
|
77
80
|
export type { PriceTier } from './resources/price_tiers';
|
78
81
|
export type { PriceVolumeTier, PriceVolumeTierCreate, PriceVolumeTierUpdate } from './resources/price_volume_tiers';
|
79
82
|
export type { Price, PriceCreate, PriceUpdate } from './resources/prices';
|
80
83
|
export type { PromotionRule } from './resources/promotion_rules';
|
81
84
|
export type { Promotion } from './resources/promotions';
|
85
|
+
export type { RecurringOrderCopy, RecurringOrderCopyCreate, RecurringOrderCopyUpdate } from './resources/recurring_order_copies';
|
82
86
|
export type { Refund } from './resources/refunds';
|
83
87
|
export type { ReturnLineItem, ReturnLineItemCreate, ReturnLineItemUpdate } from './resources/return_line_items';
|
84
88
|
export type { Return, ReturnCreate, ReturnUpdate } from './resources/returns';
|
@@ -101,6 +105,7 @@ export type { StockLocation, StockLocationCreate, StockLocationUpdate } from './
|
|
101
105
|
export type { StockTransfer, StockTransferCreate, StockTransferUpdate } from './resources/stock_transfers';
|
102
106
|
export type { StripeGateway, StripeGatewayCreate, StripeGatewayUpdate } from './resources/stripe_gateways';
|
103
107
|
export type { StripePayment, StripePaymentCreate, StripePaymentUpdate } from './resources/stripe_payments';
|
108
|
+
export type { SubscriptionModel, SubscriptionModelCreate, SubscriptionModelUpdate } from './resources/subscription_models';
|
104
109
|
export type { TaxCalculator } from './resources/tax_calculators';
|
105
110
|
export type { TaxCategory, TaxCategoryCreate, TaxCategoryUpdate } from './resources/tax_categories';
|
106
111
|
export type { TaxRule, TaxRuleCreate, TaxRuleUpdate } from './resources/tax_rules';
|