@commercelayer/sdk 7.0.0-beta.8 → 7.0.0-rc.1
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 +48 -35
- package/lib/api-DDgIE2i8.d.ts +17175 -0
- package/lib/api-DmIZO_Np.d.cts +17175 -0
- package/lib/api.cjs +796 -0
- package/lib/api.cjs.map +1 -0
- package/lib/api.d.cts +4 -0
- package/lib/api.d.ts +4 -0
- package/lib/api.js +133 -0
- package/lib/api.js.map +1 -0
- package/lib/client.cjs +160 -0
- package/lib/client.cjs.map +1 -0
- package/lib/client.d.cts +36 -0
- package/lib/client.d.ts +36 -0
- package/lib/client.js +151 -0
- package/lib/client.js.map +1 -0
- package/lib/commercelayer.cjs +114 -0
- package/lib/commercelayer.cjs.map +1 -0
- package/lib/commercelayer.d.cts +36 -0
- package/lib/commercelayer.d.ts +36 -0
- package/lib/commercelayer.js +104 -0
- package/lib/commercelayer.js.map +1 -0
- package/lib/config.cjs +23 -0
- package/lib/config.cjs.map +1 -0
- package/lib/config.d.cts +19 -0
- package/lib/config.d.ts +19 -0
- package/lib/config.js +19 -0
- package/lib/config.js.map +1 -0
- package/lib/debug.cjs +21 -0
- package/lib/debug.cjs.map +1 -0
- package/lib/debug.d.cts +4 -0
- package/lib/debug.d.ts +4 -0
- package/lib/debug.js +17 -0
- package/lib/debug.js.map +1 -0
- package/lib/enum.cjs +659 -0
- package/lib/enum.cjs.map +1 -0
- package/lib/enum.d.cts +4 -0
- package/lib/enum.d.ts +4 -0
- package/lib/enum.js +643 -0
- package/lib/enum.js.map +1 -0
- package/lib/error.cjs +101 -0
- package/lib/error.cjs.map +1 -0
- package/lib/error.d.cts +38 -0
- package/lib/error.d.ts +38 -0
- package/lib/error.js +93 -0
- package/lib/error.js.map +1 -0
- package/lib/fetch.cjs +69 -0
- package/lib/fetch.cjs.map +1 -0
- package/lib/fetch.d.cts +1 -0
- package/lib/fetch.d.ts +1 -0
- package/lib/fetch.js +62 -0
- package/lib/fetch.js.map +1 -0
- package/lib/index.cjs +34 -2
- package/lib/index.cjs.map +1 -0
- package/lib/index.d.cts +7 -17201
- package/lib/index.d.ts +7 -17201
- package/lib/index.js +5 -2
- package/lib/index.js.map +1 -0
- package/lib/interceptor-5MISI1yn.d.cts +54 -0
- package/lib/interceptor-5MISI1yn.d.ts +54 -0
- package/lib/interceptor.cjs +4 -0
- package/lib/interceptor.cjs.map +1 -0
- package/lib/interceptor.d.cts +1 -0
- package/lib/interceptor.d.ts +1 -0
- package/lib/interceptor.js +3 -0
- package/lib/interceptor.js.map +1 -0
- package/lib/jsonapi.cjs +81 -0
- package/lib/jsonapi.cjs.map +1 -0
- package/lib/jsonapi.d.cts +11 -0
- package/lib/jsonapi.d.ts +11 -0
- package/lib/jsonapi.js +73 -0
- package/lib/jsonapi.js.map +1 -0
- package/lib/model.cjs +4 -0
- package/lib/model.cjs.map +1 -0
- package/lib/model.d.cts +4 -0
- package/lib/model.d.ts +4 -0
- package/lib/model.js +3 -0
- package/lib/model.js.map +1 -0
- package/lib/query.cjs +66 -0
- package/lib/query.cjs.map +1 -0
- package/lib/query.d.cts +4 -0
- package/lib/query.d.ts +4 -0
- package/lib/query.js +58 -0
- package/lib/query.js.map +1 -0
- package/lib/resource.cjs +218 -0
- package/lib/resource.cjs.map +1 -0
- package/lib/resource.d.cts +4 -0
- package/lib/resource.d.ts +4 -0
- package/lib/resource.js +206 -0
- package/lib/resource.js.map +1 -0
- package/lib/resources/addresses.cjs +58 -0
- package/lib/resources/addresses.cjs.map +1 -0
- package/lib/resources/addresses.d.cts +4 -0
- package/lib/resources/addresses.d.ts +4 -0
- package/lib/resources/addresses.js +54 -0
- package/lib/resources/addresses.js.map +1 -0
- package/lib/resources/adjustments.cjs +40 -0
- package/lib/resources/adjustments.cjs.map +1 -0
- package/lib/resources/adjustments.d.cts +4 -0
- package/lib/resources/adjustments.d.ts +4 -0
- package/lib/resources/adjustments.js +36 -0
- package/lib/resources/adjustments.js.map +1 -0
- package/lib/resources/adyen_gateways.cjs +48 -0
- package/lib/resources/adyen_gateways.cjs.map +1 -0
- package/lib/resources/adyen_gateways.d.cts +4 -0
- package/lib/resources/adyen_gateways.d.ts +4 -0
- package/lib/resources/adyen_gateways.js +44 -0
- package/lib/resources/adyen_gateways.js.map +1 -0
- package/lib/resources/adyen_payments.cjs +54 -0
- package/lib/resources/adyen_payments.cjs.map +1 -0
- package/lib/resources/adyen_payments.d.cts +4 -0
- package/lib/resources/adyen_payments.d.ts +4 -0
- package/lib/resources/adyen_payments.js +50 -0
- package/lib/resources/adyen_payments.js.map +1 -0
- package/lib/resources/applications.cjs +30 -0
- package/lib/resources/applications.cjs.map +1 -0
- package/lib/resources/applications.d.cts +4 -0
- package/lib/resources/applications.d.ts +4 -0
- package/lib/resources/applications.js +26 -0
- package/lib/resources/applications.js.map +1 -0
- package/lib/resources/attachments.cjs +36 -0
- package/lib/resources/attachments.cjs.map +1 -0
- package/lib/resources/attachments.d.cts +4 -0
- package/lib/resources/attachments.d.ts +4 -0
- package/lib/resources/attachments.js +32 -0
- package/lib/resources/attachments.js.map +1 -0
- package/lib/resources/authorizations.cjs +69 -0
- package/lib/resources/authorizations.cjs.map +1 -0
- package/lib/resources/authorizations.d.cts +4 -0
- package/lib/resources/authorizations.d.ts +4 -0
- package/lib/resources/authorizations.js +65 -0
- package/lib/resources/authorizations.js.map +1 -0
- package/lib/resources/avalara_accounts.cjs +56 -0
- package/lib/resources/avalara_accounts.cjs.map +1 -0
- package/lib/resources/avalara_accounts.d.cts +4 -0
- package/lib/resources/avalara_accounts.d.ts +4 -0
- package/lib/resources/avalara_accounts.js +52 -0
- package/lib/resources/avalara_accounts.js.map +1 -0
- package/lib/resources/axerve_gateways.cjs +48 -0
- package/lib/resources/axerve_gateways.cjs.map +1 -0
- package/lib/resources/axerve_gateways.d.cts +4 -0
- package/lib/resources/axerve_gateways.d.ts +4 -0
- package/lib/resources/axerve_gateways.js +44 -0
- package/lib/resources/axerve_gateways.js.map +1 -0
- package/lib/resources/axerve_payments.cjs +51 -0
- package/lib/resources/axerve_payments.cjs.map +1 -0
- package/lib/resources/axerve_payments.d.cts +4 -0
- package/lib/resources/axerve_payments.d.ts +4 -0
- package/lib/resources/axerve_payments.js +47 -0
- package/lib/resources/axerve_payments.js.map +1 -0
- package/lib/resources/bing_geocoders.cjs +48 -0
- package/lib/resources/bing_geocoders.cjs.map +1 -0
- package/lib/resources/bing_geocoders.d.cts +4 -0
- package/lib/resources/bing_geocoders.d.ts +4 -0
- package/lib/resources/bing_geocoders.js +44 -0
- package/lib/resources/bing_geocoders.js.map +1 -0
- package/lib/resources/braintree_gateways.cjs +48 -0
- package/lib/resources/braintree_gateways.cjs.map +1 -0
- package/lib/resources/braintree_gateways.d.cts +4 -0
- package/lib/resources/braintree_gateways.d.ts +4 -0
- package/lib/resources/braintree_gateways.js +44 -0
- package/lib/resources/braintree_gateways.js.map +1 -0
- package/lib/resources/braintree_payments.cjs +48 -0
- package/lib/resources/braintree_payments.cjs.map +1 -0
- package/lib/resources/braintree_payments.d.cts +4 -0
- package/lib/resources/braintree_payments.d.ts +4 -0
- package/lib/resources/braintree_payments.js +44 -0
- package/lib/resources/braintree_payments.js.map +1 -0
- package/lib/resources/bundles.cjs +76 -0
- package/lib/resources/bundles.cjs.map +1 -0
- package/lib/resources/bundles.d.cts +4 -0
- package/lib/resources/bundles.d.ts +4 -0
- package/lib/resources/bundles.js +72 -0
- package/lib/resources/bundles.js.map +1 -0
- package/lib/resources/buy_x_pay_y_promotions.cjs +96 -0
- package/lib/resources/buy_x_pay_y_promotions.cjs.map +1 -0
- package/lib/resources/buy_x_pay_y_promotions.d.cts +4 -0
- package/lib/resources/buy_x_pay_y_promotions.d.ts +4 -0
- package/lib/resources/buy_x_pay_y_promotions.js +92 -0
- package/lib/resources/buy_x_pay_y_promotions.js.map +1 -0
- package/lib/resources/captures.cjs +70 -0
- package/lib/resources/captures.cjs.map +1 -0
- package/lib/resources/captures.d.cts +4 -0
- package/lib/resources/captures.d.ts +4 -0
- package/lib/resources/captures.js +66 -0
- package/lib/resources/captures.js.map +1 -0
- package/lib/resources/carrier_accounts.cjs +48 -0
- package/lib/resources/carrier_accounts.cjs.map +1 -0
- package/lib/resources/carrier_accounts.d.cts +4 -0
- package/lib/resources/carrier_accounts.d.ts +4 -0
- package/lib/resources/carrier_accounts.js +44 -0
- package/lib/resources/carrier_accounts.js.map +1 -0
- package/lib/resources/checkout_com_gateways.cjs +48 -0
- package/lib/resources/checkout_com_gateways.cjs.map +1 -0
- package/lib/resources/checkout_com_gateways.d.cts +4 -0
- package/lib/resources/checkout_com_gateways.d.ts +4 -0
- package/lib/resources/checkout_com_gateways.js +44 -0
- package/lib/resources/checkout_com_gateways.js.map +1 -0
- package/lib/resources/checkout_com_payments.cjs +54 -0
- package/lib/resources/checkout_com_payments.cjs.map +1 -0
- package/lib/resources/checkout_com_payments.d.cts +4 -0
- package/lib/resources/checkout_com_payments.d.ts +4 -0
- package/lib/resources/checkout_com_payments.js +50 -0
- package/lib/resources/checkout_com_payments.js.map +1 -0
- package/lib/resources/cleanups.cjs +47 -0
- package/lib/resources/cleanups.cjs.map +1 -0
- package/lib/resources/cleanups.d.cts +4 -0
- package/lib/resources/cleanups.d.ts +4 -0
- package/lib/resources/cleanups.js +43 -0
- package/lib/resources/cleanups.js.map +1 -0
- package/lib/resources/coupon_codes_promotion_rules.cjs +44 -0
- package/lib/resources/coupon_codes_promotion_rules.cjs.map +1 -0
- package/lib/resources/coupon_codes_promotion_rules.d.cts +4 -0
- package/lib/resources/coupon_codes_promotion_rules.d.ts +4 -0
- package/lib/resources/coupon_codes_promotion_rules.js +40 -0
- package/lib/resources/coupon_codes_promotion_rules.js.map +1 -0
- package/lib/resources/coupon_recipients.cjs +48 -0
- package/lib/resources/coupon_recipients.cjs.map +1 -0
- package/lib/resources/coupon_recipients.d.cts +4 -0
- package/lib/resources/coupon_recipients.d.ts +4 -0
- package/lib/resources/coupon_recipients.js +44 -0
- package/lib/resources/coupon_recipients.js.map +1 -0
- package/lib/resources/coupons.cjs +62 -0
- package/lib/resources/coupons.cjs.map +1 -0
- package/lib/resources/coupons.d.cts +4 -0
- package/lib/resources/coupons.d.ts +4 -0
- package/lib/resources/coupons.js +58 -0
- package/lib/resources/coupons.js.map +1 -0
- package/lib/resources/custom_promotion_rules.cjs +40 -0
- package/lib/resources/custom_promotion_rules.cjs.map +1 -0
- package/lib/resources/custom_promotion_rules.d.cts +4 -0
- package/lib/resources/custom_promotion_rules.d.ts +4 -0
- package/lib/resources/custom_promotion_rules.js +36 -0
- package/lib/resources/custom_promotion_rules.js.map +1 -0
- package/lib/resources/customer_addresses.cjs +52 -0
- package/lib/resources/customer_addresses.cjs.map +1 -0
- package/lib/resources/customer_addresses.d.cts +4 -0
- package/lib/resources/customer_addresses.d.ts +4 -0
- package/lib/resources/customer_addresses.js +48 -0
- package/lib/resources/customer_addresses.js.map +1 -0
- package/lib/resources/customer_groups.cjs +52 -0
- package/lib/resources/customer_groups.cjs.map +1 -0
- package/lib/resources/customer_groups.d.cts +4 -0
- package/lib/resources/customer_groups.d.ts +4 -0
- package/lib/resources/customer_groups.js +48 -0
- package/lib/resources/customer_groups.js.map +1 -0
- package/lib/resources/customer_password_resets.cjs +47 -0
- package/lib/resources/customer_password_resets.cjs.map +1 -0
- package/lib/resources/customer_password_resets.d.cts +4 -0
- package/lib/resources/customer_password_resets.d.ts +4 -0
- package/lib/resources/customer_password_resets.js +43 -0
- package/lib/resources/customer_password_resets.js.map +1 -0
- package/lib/resources/customer_payment_sources.cjs +48 -0
- package/lib/resources/customer_payment_sources.cjs.map +1 -0
- package/lib/resources/customer_payment_sources.d.cts +4 -0
- package/lib/resources/customer_payment_sources.d.ts +4 -0
- package/lib/resources/customer_payment_sources.js +44 -0
- package/lib/resources/customer_payment_sources.js.map +1 -0
- package/lib/resources/customer_subscriptions.cjs +48 -0
- package/lib/resources/customer_subscriptions.cjs.map +1 -0
- package/lib/resources/customer_subscriptions.d.cts +4 -0
- package/lib/resources/customer_subscriptions.d.ts +4 -0
- package/lib/resources/customer_subscriptions.js +44 -0
- package/lib/resources/customer_subscriptions.js.map +1 -0
- package/lib/resources/customers.cjs +86 -0
- package/lib/resources/customers.cjs.map +1 -0
- package/lib/resources/customers.d.cts +4 -0
- package/lib/resources/customers.d.ts +4 -0
- package/lib/resources/customers.js +82 -0
- package/lib/resources/customers.js.map +1 -0
- package/lib/resources/delivery_lead_times.cjs +52 -0
- package/lib/resources/delivery_lead_times.cjs.map +1 -0
- package/lib/resources/delivery_lead_times.d.cts +4 -0
- package/lib/resources/delivery_lead_times.d.ts +4 -0
- package/lib/resources/delivery_lead_times.js +48 -0
- package/lib/resources/delivery_lead_times.js.map +1 -0
- package/lib/resources/discount_engine_items.cjs +35 -0
- package/lib/resources/discount_engine_items.cjs.map +1 -0
- package/lib/resources/discount_engine_items.d.cts +4 -0
- package/lib/resources/discount_engine_items.d.ts +4 -0
- package/lib/resources/discount_engine_items.js +31 -0
- package/lib/resources/discount_engine_items.js.map +1 -0
- package/lib/resources/discount_engines.cjs +43 -0
- package/lib/resources/discount_engines.cjs.map +1 -0
- package/lib/resources/discount_engines.d.cts +4 -0
- package/lib/resources/discount_engines.d.ts +4 -0
- package/lib/resources/discount_engines.js +39 -0
- package/lib/resources/discount_engines.js.map +1 -0
- package/lib/resources/easypost_pickups.cjs +51 -0
- package/lib/resources/easypost_pickups.cjs.map +1 -0
- package/lib/resources/easypost_pickups.d.cts +4 -0
- package/lib/resources/easypost_pickups.d.ts +4 -0
- package/lib/resources/easypost_pickups.js +47 -0
- package/lib/resources/easypost_pickups.js.map +1 -0
- package/lib/resources/event_callbacks.cjs +31 -0
- package/lib/resources/event_callbacks.cjs.map +1 -0
- package/lib/resources/event_callbacks.d.cts +4 -0
- package/lib/resources/event_callbacks.d.ts +4 -0
- package/lib/resources/event_callbacks.js +27 -0
- package/lib/resources/event_callbacks.js.map +1 -0
- package/lib/resources/events.cjs +41 -0
- package/lib/resources/events.cjs.map +1 -0
- package/lib/resources/events.d.cts +4 -0
- package/lib/resources/events.d.ts +4 -0
- package/lib/resources/events.js +37 -0
- package/lib/resources/events.js.map +1 -0
- package/lib/resources/exports.cjs +47 -0
- package/lib/resources/exports.cjs.map +1 -0
- package/lib/resources/exports.d.cts +4 -0
- package/lib/resources/exports.d.ts +4 -0
- package/lib/resources/exports.js +43 -0
- package/lib/resources/exports.js.map +1 -0
- package/lib/resources/external_gateways.cjs +51 -0
- package/lib/resources/external_gateways.cjs.map +1 -0
- package/lib/resources/external_gateways.d.cts +4 -0
- package/lib/resources/external_gateways.d.ts +4 -0
- package/lib/resources/external_gateways.js +47 -0
- package/lib/resources/external_gateways.js.map +1 -0
- package/lib/resources/external_payments.cjs +52 -0
- package/lib/resources/external_payments.cjs.map +1 -0
- package/lib/resources/external_payments.d.cts +4 -0
- package/lib/resources/external_payments.d.ts +4 -0
- package/lib/resources/external_payments.js +48 -0
- package/lib/resources/external_payments.js.map +1 -0
- package/lib/resources/external_promotions.cjs +99 -0
- package/lib/resources/external_promotions.cjs.map +1 -0
- package/lib/resources/external_promotions.d.cts +4 -0
- package/lib/resources/external_promotions.d.ts +4 -0
- package/lib/resources/external_promotions.js +95 -0
- package/lib/resources/external_promotions.js.map +1 -0
- package/lib/resources/external_tax_calculators.cjs +55 -0
- package/lib/resources/external_tax_calculators.cjs.map +1 -0
- package/lib/resources/external_tax_calculators.d.cts +4 -0
- package/lib/resources/external_tax_calculators.d.ts +4 -0
- package/lib/resources/external_tax_calculators.js +51 -0
- package/lib/resources/external_tax_calculators.js.map +1 -0
- package/lib/resources/fixed_amount_promotions.cjs +96 -0
- package/lib/resources/fixed_amount_promotions.cjs.map +1 -0
- package/lib/resources/fixed_amount_promotions.d.cts +4 -0
- package/lib/resources/fixed_amount_promotions.d.ts +4 -0
- package/lib/resources/fixed_amount_promotions.js +92 -0
- package/lib/resources/fixed_amount_promotions.js.map +1 -0
- package/lib/resources/fixed_price_promotions.cjs +96 -0
- package/lib/resources/fixed_price_promotions.cjs.map +1 -0
- package/lib/resources/fixed_price_promotions.d.cts +4 -0
- package/lib/resources/fixed_price_promotions.d.ts +4 -0
- package/lib/resources/fixed_price_promotions.js +92 -0
- package/lib/resources/fixed_price_promotions.js.map +1 -0
- package/lib/resources/flex_promotions.cjs +72 -0
- package/lib/resources/flex_promotions.cjs.map +1 -0
- package/lib/resources/flex_promotions.d.cts +4 -0
- package/lib/resources/flex_promotions.d.ts +4 -0
- package/lib/resources/flex_promotions.js +68 -0
- package/lib/resources/flex_promotions.js.map +1 -0
- package/lib/resources/free_gift_promotions.cjs +96 -0
- package/lib/resources/free_gift_promotions.cjs.map +1 -0
- package/lib/resources/free_gift_promotions.d.cts +4 -0
- package/lib/resources/free_gift_promotions.d.ts +4 -0
- package/lib/resources/free_gift_promotions.js +92 -0
- package/lib/resources/free_gift_promotions.js.map +1 -0
- package/lib/resources/free_shipping_promotions.cjs +92 -0
- package/lib/resources/free_shipping_promotions.cjs.map +1 -0
- package/lib/resources/free_shipping_promotions.d.cts +4 -0
- package/lib/resources/free_shipping_promotions.d.ts +4 -0
- package/lib/resources/free_shipping_promotions.js +88 -0
- package/lib/resources/free_shipping_promotions.js.map +1 -0
- package/lib/resources/geocoders.cjs +39 -0
- package/lib/resources/geocoders.cjs.map +1 -0
- package/lib/resources/geocoders.d.cts +4 -0
- package/lib/resources/geocoders.d.ts +4 -0
- package/lib/resources/geocoders.js +35 -0
- package/lib/resources/geocoders.js.map +1 -0
- package/lib/resources/gift_card_recipients.cjs +48 -0
- package/lib/resources/gift_card_recipients.cjs.map +1 -0
- package/lib/resources/gift_card_recipients.d.cts +4 -0
- package/lib/resources/gift_card_recipients.d.ts +4 -0
- package/lib/resources/gift_card_recipients.js +44 -0
- package/lib/resources/gift_card_recipients.js.map +1 -0
- package/lib/resources/gift_cards.cjs +78 -0
- package/lib/resources/gift_cards.cjs.map +1 -0
- package/lib/resources/gift_cards.d.cts +4 -0
- package/lib/resources/gift_cards.d.ts +4 -0
- package/lib/resources/gift_cards.js +74 -0
- package/lib/resources/gift_cards.js.map +1 -0
- package/lib/resources/google_geocoders.cjs +48 -0
- package/lib/resources/google_geocoders.cjs.map +1 -0
- package/lib/resources/google_geocoders.d.cts +4 -0
- package/lib/resources/google_geocoders.d.ts +4 -0
- package/lib/resources/google_geocoders.js +44 -0
- package/lib/resources/google_geocoders.js.map +1 -0
- package/lib/resources/imports.cjs +43 -0
- package/lib/resources/imports.cjs.map +1 -0
- package/lib/resources/imports.d.cts +4 -0
- package/lib/resources/imports.d.ts +4 -0
- package/lib/resources/imports.js +39 -0
- package/lib/resources/imports.js.map +1 -0
- package/lib/resources/in_stock_subscriptions.cjs +62 -0
- package/lib/resources/in_stock_subscriptions.cjs.map +1 -0
- package/lib/resources/in_stock_subscriptions.d.cts +4 -0
- package/lib/resources/in_stock_subscriptions.d.ts +4 -0
- package/lib/resources/in_stock_subscriptions.js +58 -0
- package/lib/resources/in_stock_subscriptions.js.map +1 -0
- package/lib/resources/inventory_models.cjs +52 -0
- package/lib/resources/inventory_models.cjs.map +1 -0
- package/lib/resources/inventory_models.d.cts +4 -0
- package/lib/resources/inventory_models.d.ts +4 -0
- package/lib/resources/inventory_models.js +48 -0
- package/lib/resources/inventory_models.js.map +1 -0
- package/lib/resources/inventory_return_locations.cjs +48 -0
- package/lib/resources/inventory_return_locations.cjs.map +1 -0
- package/lib/resources/inventory_return_locations.d.cts +4 -0
- package/lib/resources/inventory_return_locations.d.ts +4 -0
- package/lib/resources/inventory_return_locations.js +44 -0
- package/lib/resources/inventory_return_locations.js.map +1 -0
- package/lib/resources/inventory_stock_locations.cjs +48 -0
- package/lib/resources/inventory_stock_locations.cjs.map +1 -0
- package/lib/resources/inventory_stock_locations.d.cts +4 -0
- package/lib/resources/inventory_stock_locations.d.ts +4 -0
- package/lib/resources/inventory_stock_locations.js +44 -0
- package/lib/resources/inventory_stock_locations.js.map +1 -0
- package/lib/resources/klarna_gateways.cjs +48 -0
- package/lib/resources/klarna_gateways.cjs.map +1 -0
- package/lib/resources/klarna_gateways.d.cts +4 -0
- package/lib/resources/klarna_gateways.d.ts +4 -0
- package/lib/resources/klarna_gateways.js +44 -0
- package/lib/resources/klarna_gateways.js.map +1 -0
- package/lib/resources/klarna_payments.cjs +51 -0
- package/lib/resources/klarna_payments.cjs.map +1 -0
- package/lib/resources/klarna_payments.d.cts +4 -0
- package/lib/resources/klarna_payments.d.ts +4 -0
- package/lib/resources/klarna_payments.js +47 -0
- package/lib/resources/klarna_payments.js.map +1 -0
- package/lib/resources/line_item_options.cjs +58 -0
- package/lib/resources/line_item_options.cjs.map +1 -0
- package/lib/resources/line_item_options.d.cts +4 -0
- package/lib/resources/line_item_options.d.ts +4 -0
- package/lib/resources/line_item_options.js +54 -0
- package/lib/resources/line_item_options.js.map +1 -0
- package/lib/resources/line_items.cjs +87 -0
- package/lib/resources/line_items.cjs.map +1 -0
- package/lib/resources/line_items.d.cts +4 -0
- package/lib/resources/line_items.d.ts +4 -0
- package/lib/resources/line_items.js +83 -0
- package/lib/resources/line_items.js.map +1 -0
- package/lib/resources/links.cjs +46 -0
- package/lib/resources/links.cjs.map +1 -0
- package/lib/resources/links.d.cts +4 -0
- package/lib/resources/links.d.ts +4 -0
- package/lib/resources/links.js +42 -0
- package/lib/resources/links.js.map +1 -0
- package/lib/resources/manual_gateways.cjs +44 -0
- package/lib/resources/manual_gateways.cjs.map +1 -0
- package/lib/resources/manual_gateways.d.cts +4 -0
- package/lib/resources/manual_gateways.d.ts +4 -0
- package/lib/resources/manual_gateways.js +40 -0
- package/lib/resources/manual_gateways.js.map +1 -0
- package/lib/resources/manual_tax_calculators.cjs +56 -0
- package/lib/resources/manual_tax_calculators.cjs.map +1 -0
- package/lib/resources/manual_tax_calculators.d.cts +4 -0
- package/lib/resources/manual_tax_calculators.d.ts +4 -0
- package/lib/resources/manual_tax_calculators.js +52 -0
- package/lib/resources/manual_tax_calculators.js.map +1 -0
- package/lib/resources/markets.cjs +98 -0
- package/lib/resources/markets.cjs.map +1 -0
- package/lib/resources/markets.d.cts +4 -0
- package/lib/resources/markets.d.ts +4 -0
- package/lib/resources/markets.js +94 -0
- package/lib/resources/markets.js.map +1 -0
- package/lib/resources/merchants.cjs +48 -0
- package/lib/resources/merchants.cjs.map +1 -0
- package/lib/resources/merchants.d.cts +4 -0
- package/lib/resources/merchants.d.ts +4 -0
- package/lib/resources/merchants.js +44 -0
- package/lib/resources/merchants.js.map +1 -0
- package/lib/resources/notifications.cjs +36 -0
- package/lib/resources/notifications.cjs.map +1 -0
- package/lib/resources/notifications.d.cts +4 -0
- package/lib/resources/notifications.d.ts +4 -0
- package/lib/resources/notifications.js +32 -0
- package/lib/resources/notifications.js.map +1 -0
- package/lib/resources/order_amount_promotion_rules.cjs +40 -0
- package/lib/resources/order_amount_promotion_rules.cjs.map +1 -0
- package/lib/resources/order_amount_promotion_rules.d.cts +4 -0
- package/lib/resources/order_amount_promotion_rules.d.ts +4 -0
- package/lib/resources/order_amount_promotion_rules.js +36 -0
- package/lib/resources/order_amount_promotion_rules.js.map +1 -0
- package/lib/resources/order_copies.cjs +52 -0
- package/lib/resources/order_copies.cjs.map +1 -0
- package/lib/resources/order_copies.d.cts +4 -0
- package/lib/resources/order_copies.d.ts +4 -0
- package/lib/resources/order_copies.js +48 -0
- package/lib/resources/order_copies.js.map +1 -0
- package/lib/resources/order_factories.cjs +39 -0
- package/lib/resources/order_factories.cjs.map +1 -0
- package/lib/resources/order_factories.d.cts +4 -0
- package/lib/resources/order_factories.d.ts +4 -0
- package/lib/resources/order_factories.js +35 -0
- package/lib/resources/order_factories.js.map +1 -0
- package/lib/resources/order_subscription_items.cjs +44 -0
- package/lib/resources/order_subscription_items.cjs.map +1 -0
- package/lib/resources/order_subscription_items.d.cts +4 -0
- package/lib/resources/order_subscription_items.d.ts +4 -0
- package/lib/resources/order_subscription_items.js +40 -0
- package/lib/resources/order_subscription_items.js.map +1 -0
- package/lib/resources/order_subscriptions.cjs +102 -0
- package/lib/resources/order_subscriptions.cjs.map +1 -0
- package/lib/resources/order_subscriptions.d.cts +4 -0
- package/lib/resources/order_subscriptions.d.ts +4 -0
- package/lib/resources/order_subscriptions.js +98 -0
- package/lib/resources/order_subscriptions.js.map +1 -0
- package/lib/resources/orders.cjs +279 -0
- package/lib/resources/orders.cjs.map +1 -0
- package/lib/resources/orders.d.cts +4 -0
- package/lib/resources/orders.d.ts +4 -0
- package/lib/resources/orders.js +275 -0
- package/lib/resources/orders.js.map +1 -0
- package/lib/resources/organizations.cjs +30 -0
- package/lib/resources/organizations.cjs.map +1 -0
- package/lib/resources/organizations.d.cts +4 -0
- package/lib/resources/organizations.d.ts +4 -0
- package/lib/resources/organizations.js +26 -0
- package/lib/resources/organizations.js.map +1 -0
- package/lib/resources/packages.cjs +52 -0
- package/lib/resources/packages.cjs.map +1 -0
- package/lib/resources/packages.d.cts +4 -0
- package/lib/resources/packages.d.ts +4 -0
- package/lib/resources/packages.js +48 -0
- package/lib/resources/packages.js.map +1 -0
- package/lib/resources/parcel_line_items.cjs +48 -0
- package/lib/resources/parcel_line_items.cjs.map +1 -0
- package/lib/resources/parcel_line_items.d.cts +4 -0
- package/lib/resources/parcel_line_items.d.ts +4 -0
- package/lib/resources/parcel_line_items.js +44 -0
- package/lib/resources/parcel_line_items.js.map +1 -0
- package/lib/resources/parcels.cjs +60 -0
- package/lib/resources/parcels.cjs.map +1 -0
- package/lib/resources/parcels.d.cts +4 -0
- package/lib/resources/parcels.d.ts +4 -0
- package/lib/resources/parcels.js +56 -0
- package/lib/resources/parcels.js.map +1 -0
- package/lib/resources/payment_gateways.cjs +35 -0
- package/lib/resources/payment_gateways.cjs.map +1 -0
- package/lib/resources/payment_gateways.d.cts +4 -0
- package/lib/resources/payment_gateways.d.ts +4 -0
- package/lib/resources/payment_gateways.js +31 -0
- package/lib/resources/payment_gateways.js.map +1 -0
- package/lib/resources/payment_methods.cjs +66 -0
- package/lib/resources/payment_methods.cjs.map +1 -0
- package/lib/resources/payment_methods.d.cts +4 -0
- package/lib/resources/payment_methods.d.ts +4 -0
- package/lib/resources/payment_methods.js +62 -0
- package/lib/resources/payment_methods.js.map +1 -0
- package/lib/resources/payment_options.cjs +44 -0
- package/lib/resources/payment_options.cjs.map +1 -0
- package/lib/resources/payment_options.d.cts +4 -0
- package/lib/resources/payment_options.d.ts +4 -0
- package/lib/resources/payment_options.js +40 -0
- package/lib/resources/payment_options.js.map +1 -0
- package/lib/resources/paypal_gateways.cjs +48 -0
- package/lib/resources/paypal_gateways.cjs.map +1 -0
- package/lib/resources/paypal_gateways.d.cts +4 -0
- package/lib/resources/paypal_gateways.d.ts +4 -0
- package/lib/resources/paypal_gateways.js +44 -0
- package/lib/resources/paypal_gateways.js.map +1 -0
- package/lib/resources/paypal_payments.cjs +48 -0
- package/lib/resources/paypal_payments.cjs.map +1 -0
- package/lib/resources/paypal_payments.d.cts +4 -0
- package/lib/resources/paypal_payments.d.ts +4 -0
- package/lib/resources/paypal_payments.js +44 -0
- package/lib/resources/paypal_payments.js.map +1 -0
- package/lib/resources/percentage_discount_promotions.cjs +96 -0
- package/lib/resources/percentage_discount_promotions.cjs.map +1 -0
- package/lib/resources/percentage_discount_promotions.d.cts +4 -0
- package/lib/resources/percentage_discount_promotions.d.ts +4 -0
- package/lib/resources/percentage_discount_promotions.js +92 -0
- package/lib/resources/percentage_discount_promotions.js.map +1 -0
- package/lib/resources/pickups.cjs +39 -0
- package/lib/resources/pickups.cjs.map +1 -0
- package/lib/resources/pickups.d.cts +4 -0
- package/lib/resources/pickups.d.ts +4 -0
- package/lib/resources/pickups.js +35 -0
- package/lib/resources/pickups.js.map +1 -0
- package/lib/resources/price_frequency_tiers.cjs +52 -0
- package/lib/resources/price_frequency_tiers.cjs.map +1 -0
- package/lib/resources/price_frequency_tiers.d.cts +4 -0
- package/lib/resources/price_frequency_tiers.d.ts +4 -0
- package/lib/resources/price_frequency_tiers.js +48 -0
- package/lib/resources/price_frequency_tiers.js.map +1 -0
- package/lib/resources/price_list_schedulers.cjs +58 -0
- package/lib/resources/price_list_schedulers.cjs.map +1 -0
- package/lib/resources/price_list_schedulers.d.cts +4 -0
- package/lib/resources/price_list_schedulers.d.ts +4 -0
- package/lib/resources/price_list_schedulers.js +54 -0
- package/lib/resources/price_list_schedulers.js.map +1 -0
- package/lib/resources/price_lists.cjs +52 -0
- package/lib/resources/price_lists.cjs.map +1 -0
- package/lib/resources/price_lists.d.cts +4 -0
- package/lib/resources/price_lists.d.ts +4 -0
- package/lib/resources/price_lists.js +48 -0
- package/lib/resources/price_lists.js.map +1 -0
- package/lib/resources/price_tiers.cjs +39 -0
- package/lib/resources/price_tiers.cjs.map +1 -0
- package/lib/resources/price_tiers.d.cts +4 -0
- package/lib/resources/price_tiers.d.ts +4 -0
- package/lib/resources/price_tiers.js +35 -0
- package/lib/resources/price_tiers.js.map +1 -0
- package/lib/resources/price_volume_tiers.cjs +52 -0
- package/lib/resources/price_volume_tiers.cjs.map +1 -0
- package/lib/resources/price_volume_tiers.d.cts +4 -0
- package/lib/resources/price_volume_tiers.d.ts +4 -0
- package/lib/resources/price_volume_tiers.js +48 -0
- package/lib/resources/price_volume_tiers.js.map +1 -0
- package/lib/resources/prices.cjs +76 -0
- package/lib/resources/prices.cjs.map +1 -0
- package/lib/resources/prices.d.cts +4 -0
- package/lib/resources/prices.d.ts +4 -0
- package/lib/resources/prices.js +72 -0
- package/lib/resources/prices.js.map +1 -0
- package/lib/resources/promotion_rules.cjs +31 -0
- package/lib/resources/promotion_rules.cjs.map +1 -0
- package/lib/resources/promotion_rules.d.cts +4 -0
- package/lib/resources/promotion_rules.d.ts +4 -0
- package/lib/resources/promotion_rules.js +27 -0
- package/lib/resources/promotion_rules.js.map +1 -0
- package/lib/resources/promotions.cjs +71 -0
- package/lib/resources/promotions.cjs.map +1 -0
- package/lib/resources/promotions.d.cts +4 -0
- package/lib/resources/promotions.d.ts +4 -0
- package/lib/resources/promotions.js +67 -0
- package/lib/resources/promotions.js.map +1 -0
- package/lib/resources/recurring_order_copies.cjs +52 -0
- package/lib/resources/recurring_order_copies.cjs.map +1 -0
- package/lib/resources/recurring_order_copies.d.cts +4 -0
- package/lib/resources/recurring_order_copies.d.ts +4 -0
- package/lib/resources/recurring_order_copies.js +48 -0
- package/lib/resources/recurring_order_copies.js.map +1 -0
- package/lib/resources/refunds.cjs +57 -0
- package/lib/resources/refunds.cjs.map +1 -0
- package/lib/resources/refunds.d.cts +4 -0
- package/lib/resources/refunds.d.ts +4 -0
- package/lib/resources/refunds.js +53 -0
- package/lib/resources/refunds.js.map +1 -0
- package/lib/resources/reserved_stocks.cjs +43 -0
- package/lib/resources/reserved_stocks.cjs.map +1 -0
- package/lib/resources/reserved_stocks.d.cts +4 -0
- package/lib/resources/reserved_stocks.d.ts +4 -0
- package/lib/resources/reserved_stocks.js +39 -0
- package/lib/resources/reserved_stocks.js.map +1 -0
- package/lib/resources/resource_errors.cjs +27 -0
- package/lib/resources/resource_errors.cjs.map +1 -0
- package/lib/resources/resource_errors.d.cts +4 -0
- package/lib/resources/resource_errors.d.ts +4 -0
- package/lib/resources/resource_errors.js +23 -0
- package/lib/resources/resource_errors.js.map +1 -0
- package/lib/resources/return_line_items.cjs +47 -0
- package/lib/resources/return_line_items.cjs.map +1 -0
- package/lib/resources/return_line_items.d.cts +4 -0
- package/lib/resources/return_line_items.d.ts +4 -0
- package/lib/resources/return_line_items.js +43 -0
- package/lib/resources/return_line_items.js.map +1 -0
- package/lib/resources/returns.cjs +127 -0
- package/lib/resources/returns.cjs.map +1 -0
- package/lib/resources/returns.d.cts +4 -0
- package/lib/resources/returns.d.ts +4 -0
- package/lib/resources/returns.js +123 -0
- package/lib/resources/returns.js.map +1 -0
- package/lib/resources/satispay_gateways.cjs +48 -0
- package/lib/resources/satispay_gateways.cjs.map +1 -0
- package/lib/resources/satispay_gateways.d.cts +4 -0
- package/lib/resources/satispay_gateways.d.ts +4 -0
- package/lib/resources/satispay_gateways.js +44 -0
- package/lib/resources/satispay_gateways.js.map +1 -0
- package/lib/resources/satispay_payments.cjs +51 -0
- package/lib/resources/satispay_payments.cjs.map +1 -0
- package/lib/resources/satispay_payments.d.cts +4 -0
- package/lib/resources/satispay_payments.d.ts +4 -0
- package/lib/resources/satispay_payments.js +47 -0
- package/lib/resources/satispay_payments.js.map +1 -0
- package/lib/resources/shipments.cjs +157 -0
- package/lib/resources/shipments.cjs.map +1 -0
- package/lib/resources/shipments.d.cts +4 -0
- package/lib/resources/shipments.d.ts +4 -0
- package/lib/resources/shipments.js +153 -0
- package/lib/resources/shipments.js.map +1 -0
- package/lib/resources/shipping_categories.cjs +48 -0
- package/lib/resources/shipping_categories.cjs.map +1 -0
- package/lib/resources/shipping_categories.d.cts +4 -0
- package/lib/resources/shipping_categories.d.ts +4 -0
- package/lib/resources/shipping_categories.js +44 -0
- package/lib/resources/shipping_categories.js.map +1 -0
- package/lib/resources/shipping_method_tiers.cjs +39 -0
- package/lib/resources/shipping_method_tiers.cjs.map +1 -0
- package/lib/resources/shipping_method_tiers.d.cts +4 -0
- package/lib/resources/shipping_method_tiers.d.ts +4 -0
- package/lib/resources/shipping_method_tiers.js +35 -0
- package/lib/resources/shipping_method_tiers.js.map +1 -0
- package/lib/resources/shipping_methods.cjs +85 -0
- package/lib/resources/shipping_methods.cjs.map +1 -0
- package/lib/resources/shipping_methods.d.cts +4 -0
- package/lib/resources/shipping_methods.d.ts +4 -0
- package/lib/resources/shipping_methods.js +81 -0
- package/lib/resources/shipping_methods.js.map +1 -0
- package/lib/resources/shipping_weight_tiers.cjs +48 -0
- package/lib/resources/shipping_weight_tiers.cjs.map +1 -0
- package/lib/resources/shipping_weight_tiers.d.cts +4 -0
- package/lib/resources/shipping_weight_tiers.d.ts +4 -0
- package/lib/resources/shipping_weight_tiers.js +44 -0
- package/lib/resources/shipping_weight_tiers.js.map +1 -0
- package/lib/resources/shipping_zones.cjs +44 -0
- package/lib/resources/shipping_zones.cjs.map +1 -0
- package/lib/resources/shipping_zones.d.cts +4 -0
- package/lib/resources/shipping_zones.d.ts +4 -0
- package/lib/resources/shipping_zones.js +40 -0
- package/lib/resources/shipping_zones.js.map +1 -0
- package/lib/resources/sku_list_items.cjs +48 -0
- package/lib/resources/sku_list_items.cjs.map +1 -0
- package/lib/resources/sku_list_items.d.cts +4 -0
- package/lib/resources/sku_list_items.d.ts +4 -0
- package/lib/resources/sku_list_items.js +44 -0
- package/lib/resources/sku_list_items.js.map +1 -0
- package/lib/resources/sku_list_promotion_rules.cjs +48 -0
- package/lib/resources/sku_list_promotion_rules.cjs.map +1 -0
- package/lib/resources/sku_list_promotion_rules.d.cts +4 -0
- package/lib/resources/sku_list_promotion_rules.d.ts +4 -0
- package/lib/resources/sku_list_promotion_rules.js +44 -0
- package/lib/resources/sku_list_promotion_rules.js.map +1 -0
- package/lib/resources/sku_lists.cjs +64 -0
- package/lib/resources/sku_lists.cjs.map +1 -0
- package/lib/resources/sku_lists.d.cts +4 -0
- package/lib/resources/sku_lists.d.ts +4 -0
- package/lib/resources/sku_lists.js +60 -0
- package/lib/resources/sku_lists.js.map +1 -0
- package/lib/resources/sku_options.cjs +62 -0
- package/lib/resources/sku_options.cjs.map +1 -0
- package/lib/resources/sku_options.d.cts +4 -0
- package/lib/resources/sku_options.d.ts +4 -0
- package/lib/resources/sku_options.js +58 -0
- package/lib/resources/sku_options.js.map +1 -0
- package/lib/resources/skus.cjs +106 -0
- package/lib/resources/skus.cjs.map +1 -0
- package/lib/resources/skus.d.cts +4 -0
- package/lib/resources/skus.d.ts +4 -0
- package/lib/resources/skus.js +102 -0
- package/lib/resources/skus.js.map +1 -0
- package/lib/resources/stock_items.cjs +63 -0
- package/lib/resources/stock_items.cjs.map +1 -0
- package/lib/resources/stock_items.d.cts +4 -0
- package/lib/resources/stock_items.d.ts +4 -0
- package/lib/resources/stock_items.js +59 -0
- package/lib/resources/stock_items.js.map +1 -0
- package/lib/resources/stock_line_items.cjs +69 -0
- package/lib/resources/stock_line_items.cjs.map +1 -0
- package/lib/resources/stock_line_items.d.cts +4 -0
- package/lib/resources/stock_line_items.d.ts +4 -0
- package/lib/resources/stock_line_items.js +65 -0
- package/lib/resources/stock_line_items.js.map +1 -0
- package/lib/resources/stock_locations.cjs +68 -0
- package/lib/resources/stock_locations.cjs.map +1 -0
- package/lib/resources/stock_locations.d.cts +4 -0
- package/lib/resources/stock_locations.d.ts +4 -0
- package/lib/resources/stock_locations.js +64 -0
- package/lib/resources/stock_locations.js.map +1 -0
- package/lib/resources/stock_reservations.cjs +67 -0
- package/lib/resources/stock_reservations.cjs.map +1 -0
- package/lib/resources/stock_reservations.d.cts +4 -0
- package/lib/resources/stock_reservations.d.ts +4 -0
- package/lib/resources/stock_reservations.js +63 -0
- package/lib/resources/stock_reservations.js.map +1 -0
- package/lib/resources/stock_transfers.cjs +90 -0
- package/lib/resources/stock_transfers.cjs.map +1 -0
- package/lib/resources/stock_transfers.d.cts +4 -0
- package/lib/resources/stock_transfers.d.ts +4 -0
- package/lib/resources/stock_transfers.js +86 -0
- package/lib/resources/stock_transfers.js.map +1 -0
- package/lib/resources/stores.cjs +64 -0
- package/lib/resources/stores.cjs.map +1 -0
- package/lib/resources/stores.d.cts +4 -0
- package/lib/resources/stores.d.ts +4 -0
- package/lib/resources/stores.js +60 -0
- package/lib/resources/stores.js.map +1 -0
- package/lib/resources/stripe_gateways.cjs +48 -0
- package/lib/resources/stripe_gateways.cjs.map +1 -0
- package/lib/resources/stripe_gateways.d.cts +4 -0
- package/lib/resources/stripe_gateways.d.ts +4 -0
- package/lib/resources/stripe_gateways.js +44 -0
- package/lib/resources/stripe_gateways.js.map +1 -0
- package/lib/resources/stripe_payments.cjs +54 -0
- package/lib/resources/stripe_payments.cjs.map +1 -0
- package/lib/resources/stripe_payments.d.cts +4 -0
- package/lib/resources/stripe_payments.d.ts +4 -0
- package/lib/resources/stripe_payments.js +50 -0
- package/lib/resources/stripe_payments.js.map +1 -0
- package/lib/resources/stripe_tax_accounts.cjs +56 -0
- package/lib/resources/stripe_tax_accounts.cjs.map +1 -0
- package/lib/resources/stripe_tax_accounts.d.cts +4 -0
- package/lib/resources/stripe_tax_accounts.d.ts +4 -0
- package/lib/resources/stripe_tax_accounts.js +52 -0
- package/lib/resources/stripe_tax_accounts.js.map +1 -0
- package/lib/resources/subscription_models.cjs +48 -0
- package/lib/resources/subscription_models.cjs.map +1 -0
- package/lib/resources/subscription_models.d.cts +4 -0
- package/lib/resources/subscription_models.d.ts +4 -0
- package/lib/resources/subscription_models.js +44 -0
- package/lib/resources/subscription_models.js.map +1 -0
- package/lib/resources/tags.cjs +36 -0
- package/lib/resources/tags.cjs.map +1 -0
- package/lib/resources/tags.d.cts +4 -0
- package/lib/resources/tags.d.ts +4 -0
- package/lib/resources/tags.js +32 -0
- package/lib/resources/tags.js.map +1 -0
- package/lib/resources/talon_one_accounts.cjs +52 -0
- package/lib/resources/talon_one_accounts.cjs.map +1 -0
- package/lib/resources/talon_one_accounts.d.cts +4 -0
- package/lib/resources/talon_one_accounts.d.ts +4 -0
- package/lib/resources/talon_one_accounts.js +48 -0
- package/lib/resources/talon_one_accounts.js.map +1 -0
- package/lib/resources/tax_calculators.cjs +43 -0
- package/lib/resources/tax_calculators.cjs.map +1 -0
- package/lib/resources/tax_calculators.d.cts +4 -0
- package/lib/resources/tax_calculators.d.ts +4 -0
- package/lib/resources/tax_calculators.js +39 -0
- package/lib/resources/tax_calculators.js.map +1 -0
- package/lib/resources/tax_categories.cjs +48 -0
- package/lib/resources/tax_categories.cjs.map +1 -0
- package/lib/resources/tax_categories.d.cts +4 -0
- package/lib/resources/tax_categories.d.ts +4 -0
- package/lib/resources/tax_categories.js +44 -0
- package/lib/resources/tax_categories.js.map +1 -0
- package/lib/resources/tax_rules.cjs +44 -0
- package/lib/resources/tax_rules.cjs.map +1 -0
- package/lib/resources/tax_rules.d.cts +4 -0
- package/lib/resources/tax_rules.d.ts +4 -0
- package/lib/resources/tax_rules.js +40 -0
- package/lib/resources/tax_rules.js.map +1 -0
- package/lib/resources/taxjar_accounts.cjs +56 -0
- package/lib/resources/taxjar_accounts.cjs.map +1 -0
- package/lib/resources/taxjar_accounts.d.cts +4 -0
- package/lib/resources/taxjar_accounts.d.ts +4 -0
- package/lib/resources/taxjar_accounts.js +52 -0
- package/lib/resources/taxjar_accounts.js.map +1 -0
- package/lib/resources/transactions.cjs +43 -0
- package/lib/resources/transactions.cjs.map +1 -0
- package/lib/resources/transactions.d.cts +4 -0
- package/lib/resources/transactions.d.ts +4 -0
- package/lib/resources/transactions.js +39 -0
- package/lib/resources/transactions.js.map +1 -0
- package/lib/resources/versions.cjs +27 -0
- package/lib/resources/versions.cjs.map +1 -0
- package/lib/resources/versions.d.cts +4 -0
- package/lib/resources/versions.d.ts +4 -0
- package/lib/resources/versions.js +23 -0
- package/lib/resources/versions.js.map +1 -0
- package/lib/resources/vertex_accounts.cjs +55 -0
- package/lib/resources/vertex_accounts.cjs.map +1 -0
- package/lib/resources/vertex_accounts.d.cts +4 -0
- package/lib/resources/vertex_accounts.d.ts +4 -0
- package/lib/resources/vertex_accounts.js +51 -0
- package/lib/resources/vertex_accounts.js.map +1 -0
- package/lib/resources/voids.cjs +53 -0
- package/lib/resources/voids.cjs.map +1 -0
- package/lib/resources/voids.d.cts +4 -0
- package/lib/resources/voids.d.ts +4 -0
- package/lib/resources/voids.js +49 -0
- package/lib/resources/voids.js.map +1 -0
- package/lib/resources/webhooks.cjs +53 -0
- package/lib/resources/webhooks.cjs.map +1 -0
- package/lib/resources/webhooks.d.cts +4 -0
- package/lib/resources/webhooks.d.ts +4 -0
- package/lib/resources/webhooks.js +49 -0
- package/lib/resources/webhooks.js.map +1 -0
- package/lib/resources/wire_transfers.cjs +44 -0
- package/lib/resources/wire_transfers.cjs.map +1 -0
- package/lib/resources/wire_transfers.d.cts +4 -0
- package/lib/resources/wire_transfers.d.ts +4 -0
- package/lib/resources/wire_transfers.js +40 -0
- package/lib/resources/wire_transfers.js.map +1 -0
- package/lib/static.cjs +49 -0
- package/lib/static.cjs.map +1 -0
- package/lib/static.d.cts +22 -0
- package/lib/static.d.ts +22 -0
- package/lib/static.js +47 -0
- package/lib/static.js.map +1 -0
- package/lib/types.cjs +4 -0
- package/lib/types.cjs.map +1 -0
- package/lib/types.d.cts +7 -0
- package/lib/types.d.ts +7 -0
- package/lib/types.js +3 -0
- package/lib/types.js.map +1 -0
- package/lib/util.cjs +39 -0
- package/lib/util.cjs.map +1 -0
- package/lib/util.d.cts +13 -0
- package/lib/util.d.ts +13 -0
- package/lib/util.js +34 -0
- package/lib/util.js.map +1 -0
- package/package.json +8 -10
package/lib/enum.js.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/enum.ts"],"names":[],"mappings":"AAOA,MAAM,YAAe,GAAA;AAAA;AAAA,EAEpB,WAAA;AAAA,EACA,aAAA;AAAA,EACA,gBAAA;AAAA,EACA,gBAAA;AAAA,EACA,cAAA;AAAA,EACA,aAAA;AAAA,EACA,gBAAA;AAAA,EACA,kBAAA;AAAA,EACA,iBAAA;AAAA,EACA,iBAAA;AAAA,EACA,gBAAA;AAAA,EACA,oBAAA;AAAA,EACA,oBAAA;AAAA,EACA,SAAA;AAAA,EACA,wBAAA;AAAA,EACA,UAAA;AAAA,EACA,kBAAA;AAAA,EACA,uBAAA;AAAA,EACA,uBAAA;AAAA,EACA,UAAA;AAAA,EACA,8BAAA;AAAA,EACA,mBAAA;AAAA,EACA,SAAA;AAAA,EACA,wBAAA;AAAA,EACA,oBAAA;AAAA,EACA,iBAAA;AAAA,EACA,0BAAA;AAAA,EACA,0BAAA;AAAA,EACA,wBAAA;AAAA,EACA,WAAA;AAAA,EACA,qBAAA;AAAA,EACA,uBAAA;AAAA,EACA,kBAAA;AAAA,EACA,kBAAA;AAAA,EACA,iBAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA;AAAA,EACA,mBAAA;AAAA,EACA,mBAAA;AAAA,EACA,qBAAA;AAAA,EACA,0BAAA;AAAA,EACA,yBAAA;AAAA,EACA,wBAAA;AAAA,EACA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aAAa,IAAmC,EAAA;AAC/D,EAAA,OAAO,OAAM,CAAE,GAAG,YAAa,CAAA,CAAE,MAAS,GAAA,YAAA;AAC3C;AAEO,SAAS,cAAc,IAAmC,EAAA;AAChE,EAAA,OAAO,OAAM,CAAE,GAAG,aAAc,CAAA,CAAE,MAAS,GAAA,aAAA;AAC5C;AAEO,SAAS,YAAY,QAAqC,EAAA;AAChE,EAAO,OAAA,aAAA,CAAc,SAAS,QAAQ,CAAA;AACvC;AAEO,SAAS,YAAY,QAAqC,EAAA;AAChE,EAAO,OAAA,kBAAA,CAAmB,SAAS,QAAQ,CAAA;AAC5C;AAEO,SAAS,YAAY,QAAqC,EAAA;AAChE,EAAO,OAAA,kBAAA,CAAmB,SAAS,QAAQ,CAAA;AAC5C;AAEO,SAAS,YAAY,QAAqC,EAAA;AAChE,EAAO,OAAA,kBAAA,CAAmB,SAAS,QAAQ,CAAA;AAC5C;AAEO,SAAS,WAAW,QAAqC,EAAA;AAC/D,EAAO,OAAA,iBAAA,CAAkB,SAAS,QAAQ,CAAA;AAC3C;AAEO,SAAS,cAAc,QAAqC,EAAA;AAClE,EAAO,OAAA,oBAAA,CAAqB,SAAS,QAAQ,CAAA;AAC9C","file":"enum.js","sourcesContent":["import type { Resource, ResourceRel } from './resource'\nimport type { TagType } from './resources/tags'\nimport type { VersionType } from './resources/versions'\nimport type * as models from './model'\n\n\n\nconst apiResources = [\n\t// ##__API_RESOURCE_LIST_START__##\n\t'addresses',\n\t'adjustments',\n\t'adyen_gateways',\n\t'adyen_payments',\n\t'applications',\n\t'attachments',\n\t'authorizations',\n\t'avalara_accounts',\n\t'axerve_gateways',\n\t'axerve_payments',\n\t'bing_geocoders',\n\t'braintree_gateways',\n\t'braintree_payments',\n\t'bundles',\n\t'buy_x_pay_y_promotions',\n\t'captures',\n\t'carrier_accounts',\n\t'checkout_com_gateways',\n\t'checkout_com_payments',\n\t'cleanups',\n\t'coupon_codes_promotion_rules',\n\t'coupon_recipients',\n\t'coupons',\n\t'custom_promotion_rules',\n\t'customer_addresses',\n\t'customer_groups',\n\t'customer_password_resets',\n\t'customer_payment_sources',\n\t'customer_subscriptions',\n\t'customers',\n\t'delivery_lead_times',\n\t'discount_engine_items',\n\t'discount_engines',\n\t'easypost_pickups',\n\t'event_callbacks',\n\t'events',\n\t'exports',\n\t'external_gateways',\n\t'external_payments',\n\t'external_promotions',\n\t'external_tax_calculators',\n\t'fixed_amount_promotions',\n\t'fixed_price_promotions',\n\t'flex_promotions',\n\t'free_gift_promotions',\n\t'free_shipping_promotions',\n\t'geocoders',\n\t'gift_card_recipients',\n\t'gift_cards',\n\t'google_geocoders',\n\t'imports',\n\t'in_stock_subscriptions',\n\t'inventory_models',\n\t'inventory_return_locations',\n\t'inventory_stock_locations',\n\t'klarna_gateways',\n\t'klarna_payments',\n\t'line_item_options',\n\t'line_items',\n\t'links',\n\t'manual_gateways',\n\t'manual_tax_calculators',\n\t'markets',\n\t'merchants',\n\t'notifications',\n\t'order_amount_promotion_rules',\n\t'order_copies',\n\t'order_factories',\n\t'order_subscription_items',\n\t'order_subscriptions',\n\t'orders',\n\t'organizations',\n\t'packages',\n\t'parcel_line_items',\n\t'parcels',\n\t'payment_gateways',\n\t'payment_methods',\n\t'payment_options',\n\t'paypal_gateways',\n\t'paypal_payments',\n\t'percentage_discount_promotions',\n\t'pickups',\n\t'price_frequency_tiers',\n\t'price_list_schedulers',\n\t'price_lists',\n\t'price_tiers',\n\t'price_volume_tiers',\n\t'prices',\n\t'promotion_rules',\n\t'promotions',\n\t'recurring_order_copies',\n\t'refunds',\n\t'reserved_stocks',\n\t'resource_errors',\n\t'return_line_items',\n\t'returns',\n\t'satispay_gateways',\n\t'satispay_payments',\n\t'shipments',\n\t'shipping_categories',\n\t'shipping_method_tiers',\n\t'shipping_methods',\n\t'shipping_weight_tiers',\n\t'shipping_zones',\n\t'sku_list_items',\n\t'sku_list_promotion_rules',\n\t'sku_lists',\n\t'sku_options',\n\t'skus',\n\t'stock_items',\n\t'stock_line_items',\n\t'stock_locations',\n\t'stock_reservations',\n\t'stock_transfers',\n\t'stores',\n\t'stripe_gateways',\n\t'stripe_payments',\n\t'stripe_tax_accounts',\n\t'subscription_models',\n\t'tags',\n\t'talon_one_accounts',\n\t'tax_calculators',\n\t'tax_categories',\n\t'tax_rules',\n\t'taxjar_accounts',\n\t'transactions',\n\t'versions',\n\t'vertex_accounts',\n\t'voids',\n\t'webhooks',\n\t'wire_transfers'\n\t// ##__API_RESOURCE_LIST_STOP__##\n] as const\n\nexport type ResourceTypeLock = typeof apiResources[number]\nexport const resourceList: Readonly<ResourceTypeLock[]> = apiResources\n\n\n// Singleton resources\nexport const singletonList: ResourceTypeLock[] = [\n\t// ##__API_RESOURCE_SINGLETON_START__##\n\t'applications',\n\t'organizations'\n\t// ##__API_RESOURCE_SINGLETON_STOP__##\n] as const\n\n\n// Retrievable resources\nexport type RetrievableResourceType = ResourceTypeLock\n\nexport type RetrievableResource = Resource & {\n\ttype: RetrievableResourceType\n}\n\n\n// Listable resources\nexport type ListableResourceType = Exclude<ResourceTypeLock,\n\t// ##__API_RESOURCE_NOT_LISTABLE_START__##\n\t'applications'\n|\t'organizations'\n// ##__API_RESOURCE_NOT_LISTABLE_STOP__##\n>\n\nexport type ListableResource = Resource & {\n\ttype: ListableResourceType\n}\n\n\n// Creatable resources\nexport const creatableResources: ResourceTypeLock[] = [\n\t// ##__API_RESOURCE_CREATABLE_START__##\n\t'addresses',\n\t'adjustments',\n\t'adyen_gateways',\n\t'adyen_payments',\n\t'attachments',\n\t'avalara_accounts',\n\t'axerve_gateways',\n\t'axerve_payments',\n\t'bing_geocoders',\n\t'braintree_gateways',\n\t'braintree_payments',\n\t'bundles',\n\t'buy_x_pay_y_promotions',\n\t'carrier_accounts',\n\t'checkout_com_gateways',\n\t'checkout_com_payments',\n\t'cleanups',\n\t'coupon_codes_promotion_rules',\n\t'coupon_recipients',\n\t'coupons',\n\t'custom_promotion_rules',\n\t'customer_addresses',\n\t'customer_groups',\n\t'customer_password_resets',\n\t'customer_payment_sources',\n\t'customer_subscriptions',\n\t'customers',\n\t'delivery_lead_times',\n\t'easypost_pickups',\n\t'exports',\n\t'external_gateways',\n\t'external_payments',\n\t'external_promotions',\n\t'external_tax_calculators',\n\t'fixed_amount_promotions',\n\t'fixed_price_promotions',\n\t'flex_promotions',\n\t'free_gift_promotions',\n\t'free_shipping_promotions',\n\t'gift_card_recipients',\n\t'gift_cards',\n\t'google_geocoders',\n\t'imports',\n\t'in_stock_subscriptions',\n\t'inventory_models',\n\t'inventory_return_locations',\n\t'inventory_stock_locations',\n\t'klarna_gateways',\n\t'klarna_payments',\n\t'line_item_options',\n\t'line_items',\n\t'links',\n\t'manual_gateways',\n\t'manual_tax_calculators',\n\t'markets',\n\t'merchants',\n\t'notifications',\n\t'order_amount_promotion_rules',\n\t'order_copies',\n\t'order_subscription_items',\n\t'order_subscriptions',\n\t'orders',\n\t'packages',\n\t'parcel_line_items',\n\t'parcels',\n\t'payment_methods',\n\t'payment_options',\n\t'paypal_gateways',\n\t'paypal_payments',\n\t'percentage_discount_promotions',\n\t'price_frequency_tiers',\n\t'price_list_schedulers',\n\t'price_lists',\n\t'price_volume_tiers',\n\t'prices',\n\t'recurring_order_copies',\n\t'return_line_items',\n\t'returns',\n\t'satispay_gateways',\n\t'satispay_payments',\n\t'shipments',\n\t'shipping_categories',\n\t'shipping_methods',\n\t'shipping_weight_tiers',\n\t'shipping_zones',\n\t'sku_list_items',\n\t'sku_list_promotion_rules',\n\t'sku_lists',\n\t'sku_options',\n\t'skus',\n\t'stock_items',\n\t'stock_line_items',\n\t'stock_locations',\n\t'stock_reservations',\n\t'stock_transfers',\n\t'stores',\n\t'stripe_gateways',\n\t'stripe_payments',\n\t'stripe_tax_accounts',\n\t'subscription_models',\n\t'tags',\n\t'talon_one_accounts',\n\t'tax_categories',\n\t'tax_rules',\n\t'taxjar_accounts',\n\t'vertex_accounts',\n\t'webhooks',\n\t'wire_transfers'\n\t// ##__API_RESOURCE_CREATABLE_STOP__##\n] as const\n\nexport type CreatableResourceType = typeof creatableResources[number]\nexport type CreatableResource = Resource & {\n\ttype: CreatableResourceType\n}\n\n\n// Updatable resources\nexport const updatableResources: ResourceTypeLock[] = [\n\t// ##__API_RESOURCE_UPDATABLE_START__##\n\t'addresses',\n\t'adjustments',\n\t'adyen_gateways',\n\t'adyen_payments',\n\t'attachments',\n\t'authorizations',\n\t'avalara_accounts',\n\t'axerve_gateways',\n\t'axerve_payments',\n\t'bing_geocoders',\n\t'braintree_gateways',\n\t'braintree_payments',\n\t'bundles',\n\t'buy_x_pay_y_promotions',\n\t'captures',\n\t'carrier_accounts',\n\t'checkout_com_gateways',\n\t'checkout_com_payments',\n\t'cleanups',\n\t'coupon_codes_promotion_rules',\n\t'coupon_recipients',\n\t'coupons',\n\t'custom_promotion_rules',\n\t'customer_addresses',\n\t'customer_groups',\n\t'customer_password_resets',\n\t'customer_payment_sources',\n\t'customer_subscriptions',\n\t'customers',\n\t'delivery_lead_times',\n\t'easypost_pickups',\n\t'events',\n\t'exports',\n\t'external_gateways',\n\t'external_payments',\n\t'external_promotions',\n\t'external_tax_calculators',\n\t'fixed_amount_promotions',\n\t'fixed_price_promotions',\n\t'flex_promotions',\n\t'free_gift_promotions',\n\t'free_shipping_promotions',\n\t'gift_card_recipients',\n\t'gift_cards',\n\t'google_geocoders',\n\t'imports',\n\t'in_stock_subscriptions',\n\t'inventory_models',\n\t'inventory_return_locations',\n\t'inventory_stock_locations',\n\t'klarna_gateways',\n\t'klarna_payments',\n\t'line_item_options',\n\t'line_items',\n\t'links',\n\t'manual_gateways',\n\t'manual_tax_calculators',\n\t'markets',\n\t'merchants',\n\t'notifications',\n\t'order_amount_promotion_rules',\n\t'order_copies',\n\t'order_subscription_items',\n\t'order_subscriptions',\n\t'orders',\n\t'packages',\n\t'parcel_line_items',\n\t'parcels',\n\t'payment_methods',\n\t'payment_options',\n\t'paypal_gateways',\n\t'paypal_payments',\n\t'percentage_discount_promotions',\n\t'price_frequency_tiers',\n\t'price_list_schedulers',\n\t'price_lists',\n\t'price_volume_tiers',\n\t'prices',\n\t'recurring_order_copies',\n\t'refunds',\n\t'return_line_items',\n\t'returns',\n\t'satispay_gateways',\n\t'satispay_payments',\n\t'shipments',\n\t'shipping_categories',\n\t'shipping_methods',\n\t'shipping_weight_tiers',\n\t'shipping_zones',\n\t'sku_list_items',\n\t'sku_list_promotion_rules',\n\t'sku_lists',\n\t'sku_options',\n\t'skus',\n\t'stock_items',\n\t'stock_line_items',\n\t'stock_locations',\n\t'stock_reservations',\n\t'stock_transfers',\n\t'stores',\n\t'stripe_gateways',\n\t'stripe_payments',\n\t'stripe_tax_accounts',\n\t'subscription_models',\n\t'tags',\n\t'talon_one_accounts',\n\t'tax_categories',\n\t'tax_rules',\n\t'taxjar_accounts',\n\t'vertex_accounts',\n\t'voids',\n\t'webhooks',\n\t'wire_transfers'\n\t// ##__API_RESOURCE_UPDATABLE_STOP__##\n] as const\n\nexport type UpdatableResourceType = typeof updatableResources[number]\nexport type UpdatableResource = Resource & {\n\ttype: UpdatableResourceType\n}\n\n\n// Deletable resources\nexport const deletableResources: ResourceTypeLock[] = [\n\t// ##__API_RESOURCE_DELETABLE_START__##\n\t'addresses',\n\t'adjustments',\n\t'adyen_gateways',\n\t'adyen_payments',\n\t'attachments',\n\t'avalara_accounts',\n\t'axerve_gateways',\n\t'axerve_payments',\n\t'bing_geocoders',\n\t'braintree_gateways',\n\t'braintree_payments',\n\t'bundles',\n\t'buy_x_pay_y_promotions',\n\t'carrier_accounts',\n\t'checkout_com_gateways',\n\t'checkout_com_payments',\n\t'cleanups',\n\t'coupon_codes_promotion_rules',\n\t'coupon_recipients',\n\t'coupons',\n\t'custom_promotion_rules',\n\t'customer_addresses',\n\t'customer_groups',\n\t'customer_password_resets',\n\t'customer_payment_sources',\n\t'customer_subscriptions',\n\t'customers',\n\t'delivery_lead_times',\n\t'easypost_pickups',\n\t'exports',\n\t'external_gateways',\n\t'external_payments',\n\t'external_promotions',\n\t'external_tax_calculators',\n\t'fixed_amount_promotions',\n\t'fixed_price_promotions',\n\t'flex_promotions',\n\t'free_gift_promotions',\n\t'free_shipping_promotions',\n\t'gift_card_recipients',\n\t'gift_cards',\n\t'google_geocoders',\n\t'imports',\n\t'in_stock_subscriptions',\n\t'inventory_models',\n\t'inventory_return_locations',\n\t'inventory_stock_locations',\n\t'klarna_gateways',\n\t'klarna_payments',\n\t'line_item_options',\n\t'line_items',\n\t'links',\n\t'manual_gateways',\n\t'manual_tax_calculators',\n\t'markets',\n\t'merchants',\n\t'notifications',\n\t'order_amount_promotion_rules',\n\t'order_copies',\n\t'order_subscription_items',\n\t'order_subscriptions',\n\t'orders',\n\t'packages',\n\t'parcel_line_items',\n\t'parcels',\n\t'payment_methods',\n\t'payment_options',\n\t'paypal_gateways',\n\t'paypal_payments',\n\t'percentage_discount_promotions',\n\t'price_frequency_tiers',\n\t'price_list_schedulers',\n\t'price_lists',\n\t'price_volume_tiers',\n\t'prices',\n\t'recurring_order_copies',\n\t'return_line_items',\n\t'returns',\n\t'satispay_gateways',\n\t'satispay_payments',\n\t'shipments',\n\t'shipping_categories',\n\t'shipping_methods',\n\t'shipping_weight_tiers',\n\t'shipping_zones',\n\t'sku_list_items',\n\t'sku_list_promotion_rules',\n\t'sku_lists',\n\t'sku_options',\n\t'skus',\n\t'stock_items',\n\t'stock_line_items',\n\t'stock_locations',\n\t'stock_reservations',\n\t'stock_transfers',\n\t'stores',\n\t'stripe_gateways',\n\t'stripe_payments',\n\t'stripe_tax_accounts',\n\t'subscription_models',\n\t'tags',\n\t'talon_one_accounts',\n\t'tax_categories',\n\t'tax_rules',\n\t'taxjar_accounts',\n\t'vertex_accounts',\n\t'webhooks',\n\t'wire_transfers'\n\t// ##__API_RESOURCE_DELETABLE_STOP__##\n] as const\n\nexport type DeletableResourceType = typeof deletableResources[number]\nexport type DeletableResource = Resource & {\n\ttype: DeletableResourceType\n}\n\n\n// Taggable resources\nexport const taggableResources: ResourceTypeLock[] = [\n\t// ##__API_RESOURCE_TAGGABLE_START__##\n\t'addresses',\n\t'bundles',\n\t'buy_x_pay_y_promotions',\n\t'coupons',\n\t'customers',\n\t'external_promotions',\n\t'fixed_amount_promotions',\n\t'fixed_price_promotions',\n\t'flex_promotions',\n\t'free_gift_promotions',\n\t'free_shipping_promotions',\n\t'gift_cards',\n\t'line_item_options',\n\t'line_items',\n\t'order_subscriptions',\n\t'orders',\n\t'percentage_discount_promotions',\n\t'promotions',\n\t'returns',\n\t'shipments',\n\t'sku_options',\n\t'skus'\n\t// ##__API_RESOURCE_TAGGABLE_STOP__##\n] as const\n\nexport type TaggableResourceType = typeof taggableResources[number]\nexport type TaggableResource = Resource & {\n\ttype: TaggableResourceType,\n\ttags?: Array<ResourceRel & { type: TagType }> | null\n}\n\n\n// Versionable resources\nexport const versionableResources: ResourceTypeLock[] = [\n\t// ##__API_RESOURCE_VERSIONABLE_START__##\n\t'addresses',\n\t'adjustments',\n\t'adyen_gateways',\n\t'adyen_payments',\n\t'authorizations',\n\t'avalara_accounts',\n\t'axerve_gateways',\n\t'axerve_payments',\n\t'braintree_gateways',\n\t'braintree_payments',\n\t'bundles',\n\t'buy_x_pay_y_promotions',\n\t'captures',\n\t'carrier_accounts',\n\t'checkout_com_gateways',\n\t'checkout_com_payments',\n\t'cleanups',\n\t'coupon_codes_promotion_rules',\n\t'coupon_recipients',\n\t'coupons',\n\t'custom_promotion_rules',\n\t'customer_addresses',\n\t'customer_groups',\n\t'customer_payment_sources',\n\t'customer_subscriptions',\n\t'delivery_lead_times',\n\t'discount_engines',\n\t'exports',\n\t'external_gateways',\n\t'external_payments',\n\t'external_promotions',\n\t'external_tax_calculators',\n\t'fixed_amount_promotions',\n\t'fixed_price_promotions',\n\t'flex_promotions',\n\t'free_gift_promotions',\n\t'free_shipping_promotions',\n\t'gift_card_recipients',\n\t'gift_cards',\n\t'in_stock_subscriptions',\n\t'inventory_models',\n\t'inventory_return_locations',\n\t'inventory_stock_locations',\n\t'klarna_gateways',\n\t'klarna_payments',\n\t'manual_gateways',\n\t'manual_tax_calculators',\n\t'markets',\n\t'merchants',\n\t'order_amount_promotion_rules',\n\t'order_subscriptions',\n\t'orders',\n\t'packages',\n\t'parcel_line_items',\n\t'parcels',\n\t'payment_gateways',\n\t'payment_methods',\n\t'paypal_gateways',\n\t'paypal_payments',\n\t'percentage_discount_promotions',\n\t'price_frequency_tiers',\n\t'price_list_schedulers',\n\t'price_lists',\n\t'price_tiers',\n\t'price_volume_tiers',\n\t'prices',\n\t'promotion_rules',\n\t'promotions',\n\t'refunds',\n\t'reserved_stocks',\n\t'returns',\n\t'satispay_gateways',\n\t'satispay_payments',\n\t'shipments',\n\t'shipping_categories',\n\t'shipping_method_tiers',\n\t'shipping_methods',\n\t'shipping_weight_tiers',\n\t'shipping_zones',\n\t'sku_list_items',\n\t'sku_list_promotion_rules',\n\t'sku_lists',\n\t'sku_options',\n\t'skus',\n\t'stock_items',\n\t'stock_line_items',\n\t'stock_locations',\n\t'stock_transfers',\n\t'stores',\n\t'stripe_gateways',\n\t'stripe_payments',\n\t'stripe_tax_accounts',\n\t'talon_one_accounts',\n\t'tax_calculators',\n\t'tax_categories',\n\t'tax_rules',\n\t'taxjar_accounts',\n\t'transactions',\n\t'vertex_accounts',\n\t'voids',\n\t'webhooks',\n\t'wire_transfers'\n\t// ##__API_RESOURCE_VERSIONABLE_STOP__##\n] as const\n\nexport type VersionableResourceType = typeof versionableResources[number]\nexport type VersionableResource = Resource & {\n\ttype: VersionableResourceType,\n\tversions?: Array<ResourceRel & { type: VersionType }> | null\n}\n\n\n\n// Utility functions\nexport function getResources(sort?: boolean): readonly string[] {\n\treturn sort? [ ...resourceList ].sort() : resourceList\n}\n\nexport function getSingletons(sort?: boolean): readonly string[] {\n\treturn sort? [ ...singletonList ].sort() : singletonList\n}\n\nexport function isSingleton(resource: ResourceTypeLock): boolean {\n\treturn singletonList.includes(resource)\n}\n\nexport function isCreatable(resource: ResourceTypeLock): boolean {\n\treturn creatableResources.includes(resource)\n}\n\nexport function isUpdatable(resource: ResourceTypeLock): boolean {\n\treturn updatableResources.includes(resource)\n}\n\nexport function isDeletable(resource: ResourceTypeLock): boolean {\n\treturn deletableResources.includes(resource)\n}\n\nexport function isTaggable(resource: ResourceTypeLock): boolean {\n\treturn taggableResources.includes(resource)\n}\n\nexport function isVersionable(resource: ResourceTypeLock): boolean {\n\treturn versionableResources.includes(resource)\n}\n\n\n\n// Helper types\nexport type ResourceFields = {\n\t// ##__API_RESOURCE_FIELDS_START__##\n\taddresses: models.Address,\n\tadjustments: models.Adjustment,\n\tadyen_gateways: models.AdyenGateway,\n\tadyen_payments: models.AdyenPayment,\n\tapplications: models.Application,\n\tattachments: models.Attachment,\n\tauthorizations: models.Authorization,\n\tavalara_accounts: models.AvalaraAccount,\n\taxerve_gateways: models.AxerveGateway,\n\taxerve_payments: models.AxervePayment,\n\tbing_geocoders: models.BingGeocoder,\n\tbraintree_gateways: models.BraintreeGateway,\n\tbraintree_payments: models.BraintreePayment,\n\tbundles: models.Bundle,\n\tbuy_x_pay_y_promotions: models.BuyXPayYPromotion,\n\tcaptures: models.Capture,\n\tcarrier_accounts: models.CarrierAccount,\n\tcheckout_com_gateways: models.CheckoutComGateway,\n\tcheckout_com_payments: models.CheckoutComPayment,\n\tcleanups: models.Cleanup,\n\tcoupon_codes_promotion_rules: models.CouponCodesPromotionRule,\n\tcoupon_recipients: models.CouponRecipient,\n\tcoupons: models.Coupon,\n\tcustom_promotion_rules: models.CustomPromotionRule,\n\tcustomer_addresses: models.CustomerAddress,\n\tcustomer_groups: models.CustomerGroup,\n\tcustomer_password_resets: models.CustomerPasswordReset,\n\tcustomer_payment_sources: models.CustomerPaymentSource,\n\tcustomer_subscriptions: models.CustomerSubscription,\n\tcustomers: models.Customer,\n\tdelivery_lead_times: models.DeliveryLeadTime,\n\tdiscount_engine_items: models.DiscountEngineItem,\n\tdiscount_engines: models.DiscountEngine,\n\teasypost_pickups: models.EasypostPickup,\n\tevent_callbacks: models.EventCallback,\n\tevents: models.Event,\n\texports: models.Export,\n\texternal_gateways: models.ExternalGateway,\n\texternal_payments: models.ExternalPayment,\n\texternal_promotions: models.ExternalPromotion,\n\texternal_tax_calculators: models.ExternalTaxCalculator,\n\tfixed_amount_promotions: models.FixedAmountPromotion,\n\tfixed_price_promotions: models.FixedPricePromotion,\n\tflex_promotions: models.FlexPromotion,\n\tfree_gift_promotions: models.FreeGiftPromotion,\n\tfree_shipping_promotions: models.FreeShippingPromotion,\n\tgeocoders: models.Geocoder,\n\tgift_card_recipients: models.GiftCardRecipient,\n\tgift_cards: models.GiftCard,\n\tgoogle_geocoders: models.GoogleGeocoder,\n\timports: models.Import,\n\tin_stock_subscriptions: models.InStockSubscription,\n\tinventory_models: models.InventoryModel,\n\tinventory_return_locations: models.InventoryReturnLocation,\n\tinventory_stock_locations: models.InventoryStockLocation,\n\tklarna_gateways: models.KlarnaGateway,\n\tklarna_payments: models.KlarnaPayment,\n\tline_item_options: models.LineItemOption,\n\tline_items: models.LineItem,\n\tlinks: models.Link,\n\tmanual_gateways: models.ManualGateway,\n\tmanual_tax_calculators: models.ManualTaxCalculator,\n\tmarkets: models.Market,\n\tmerchants: models.Merchant,\n\tnotifications: models.Notification,\n\torder_amount_promotion_rules: models.OrderAmountPromotionRule,\n\torder_copies: models.OrderCopy,\n\torder_factories: models.OrderFactory,\n\torder_subscription_items: models.OrderSubscriptionItem,\n\torder_subscriptions: models.OrderSubscription,\n\torders: models.Order,\n\torganizations: models.Organization,\n\tpackages: models.Package,\n\tparcel_line_items: models.ParcelLineItem,\n\tparcels: models.Parcel,\n\tpayment_gateways: models.PaymentGateway,\n\tpayment_methods: models.PaymentMethod,\n\tpayment_options: models.PaymentOption,\n\tpaypal_gateways: models.PaypalGateway,\n\tpaypal_payments: models.PaypalPayment,\n\tpercentage_discount_promotions: models.PercentageDiscountPromotion,\n\tpickups: models.Pickup,\n\tprice_frequency_tiers: models.PriceFrequencyTier,\n\tprice_list_schedulers: models.PriceListScheduler,\n\tprice_lists: models.PriceList,\n\tprice_tiers: models.PriceTier,\n\tprice_volume_tiers: models.PriceVolumeTier,\n\tprices: models.Price,\n\tpromotion_rules: models.PromotionRule,\n\tpromotions: models.Promotion,\n\trecurring_order_copies: models.RecurringOrderCopy,\n\trefunds: models.Refund,\n\treserved_stocks: models.ReservedStock,\n\tresource_errors: models.ResourceError,\n\treturn_line_items: models.ReturnLineItem,\n\treturns: models.Return,\n\tsatispay_gateways: models.SatispayGateway,\n\tsatispay_payments: models.SatispayPayment,\n\tshipments: models.Shipment,\n\tshipping_categories: models.ShippingCategory,\n\tshipping_method_tiers: models.ShippingMethodTier,\n\tshipping_methods: models.ShippingMethod,\n\tshipping_weight_tiers: models.ShippingWeightTier,\n\tshipping_zones: models.ShippingZone,\n\tsku_list_items: models.SkuListItem,\n\tsku_list_promotion_rules: models.SkuListPromotionRule,\n\tsku_lists: models.SkuList,\n\tsku_options: models.SkuOption,\n\tskus: models.Sku,\n\tstock_items: models.StockItem,\n\tstock_line_items: models.StockLineItem,\n\tstock_locations: models.StockLocation,\n\tstock_reservations: models.StockReservation,\n\tstock_transfers: models.StockTransfer,\n\tstores: models.Store,\n\tstripe_gateways: models.StripeGateway,\n\tstripe_payments: models.StripePayment,\n\tstripe_tax_accounts: models.StripeTaxAccount,\n\tsubscription_models: models.SubscriptionModel,\n\ttags: models.Tag,\n\ttalon_one_accounts: models.TalonOneAccount,\n\ttax_calculators: models.TaxCalculator,\n\ttax_categories: models.TaxCategory,\n\ttax_rules: models.TaxRule,\n\ttaxjar_accounts: models.TaxjarAccount,\n\ttransactions: models.Transaction,\n\tversions: models.Version,\n\tvertex_accounts: models.VertexAccount,\n\tvoids: models.Void,\n\twebhooks: models.Webhook,\n\twire_transfers: models.WireTransfer\n\t// ##__API_RESOURCE_FIELDS_STOP__##\n}\n\n\nexport type ResourceSortFields = {\n\t// ##__API_RESOURCE_SORTABLE_FIELDS_START__##\n\taddresses: models.AddressSort,\n\tadjustments: models.AdjustmentSort,\n\tadyen_gateways: models.AdyenGatewaySort,\n\tadyen_payments: models.AdyenPaymentSort,\n\tapplications: models.ApplicationSort,\n\tattachments: models.AttachmentSort,\n\tauthorizations: models.AuthorizationSort,\n\tavalara_accounts: models.AvalaraAccountSort,\n\taxerve_gateways: models.AxerveGatewaySort,\n\taxerve_payments: models.AxervePaymentSort,\n\tbing_geocoders: models.BingGeocoderSort,\n\tbraintree_gateways: models.BraintreeGatewaySort,\n\tbraintree_payments: models.BraintreePaymentSort,\n\tbundles: models.BundleSort,\n\tbuy_x_pay_y_promotions: models.BuyXPayYPromotionSort,\n\tcaptures: models.CaptureSort,\n\tcarrier_accounts: models.CarrierAccountSort,\n\tcheckout_com_gateways: models.CheckoutComGatewaySort,\n\tcheckout_com_payments: models.CheckoutComPaymentSort,\n\tcleanups: models.CleanupSort,\n\tcoupon_codes_promotion_rules: models.CouponCodesPromotionRuleSort,\n\tcoupon_recipients: models.CouponRecipientSort,\n\tcoupons: models.CouponSort,\n\tcustom_promotion_rules: models.CustomPromotionRuleSort,\n\tcustomer_addresses: models.CustomerAddressSort,\n\tcustomer_groups: models.CustomerGroupSort,\n\tcustomer_password_resets: models.CustomerPasswordResetSort,\n\tcustomer_payment_sources: models.CustomerPaymentSourceSort,\n\tcustomer_subscriptions: models.CustomerSubscriptionSort,\n\tcustomers: models.CustomerSort,\n\tdelivery_lead_times: models.DeliveryLeadTimeSort,\n\tdiscount_engine_items: models.DiscountEngineItemSort,\n\tdiscount_engines: models.DiscountEngineSort,\n\teasypost_pickups: models.EasypostPickupSort,\n\tevent_callbacks: models.EventCallbackSort,\n\tevents: models.EventSort,\n\texports: models.ExportSort,\n\texternal_gateways: models.ExternalGatewaySort,\n\texternal_payments: models.ExternalPaymentSort,\n\texternal_promotions: models.ExternalPromotionSort,\n\texternal_tax_calculators: models.ExternalTaxCalculatorSort,\n\tfixed_amount_promotions: models.FixedAmountPromotionSort,\n\tfixed_price_promotions: models.FixedPricePromotionSort,\n\tflex_promotions: models.FlexPromotionSort,\n\tfree_gift_promotions: models.FreeGiftPromotionSort,\n\tfree_shipping_promotions: models.FreeShippingPromotionSort,\n\tgeocoders: models.GeocoderSort,\n\tgift_card_recipients: models.GiftCardRecipientSort,\n\tgift_cards: models.GiftCardSort,\n\tgoogle_geocoders: models.GoogleGeocoderSort,\n\timports: models.ImportSort,\n\tin_stock_subscriptions: models.InStockSubscriptionSort,\n\tinventory_models: models.InventoryModelSort,\n\tinventory_return_locations: models.InventoryReturnLocationSort,\n\tinventory_stock_locations: models.InventoryStockLocationSort,\n\tklarna_gateways: models.KlarnaGatewaySort,\n\tklarna_payments: models.KlarnaPaymentSort,\n\tline_item_options: models.LineItemOptionSort,\n\tline_items: models.LineItemSort,\n\tlinks: models.LinkSort,\n\tmanual_gateways: models.ManualGatewaySort,\n\tmanual_tax_calculators: models.ManualTaxCalculatorSort,\n\tmarkets: models.MarketSort,\n\tmerchants: models.MerchantSort,\n\tnotifications: models.NotificationSort,\n\torder_amount_promotion_rules: models.OrderAmountPromotionRuleSort,\n\torder_copies: models.OrderCopySort,\n\torder_factories: models.OrderFactorySort,\n\torder_subscription_items: models.OrderSubscriptionItemSort,\n\torder_subscriptions: models.OrderSubscriptionSort,\n\torders: models.OrderSort,\n\torganizations: models.OrganizationSort,\n\tpackages: models.PackageSort,\n\tparcel_line_items: models.ParcelLineItemSort,\n\tparcels: models.ParcelSort,\n\tpayment_gateways: models.PaymentGatewaySort,\n\tpayment_methods: models.PaymentMethodSort,\n\tpayment_options: models.PaymentOptionSort,\n\tpaypal_gateways: models.PaypalGatewaySort,\n\tpaypal_payments: models.PaypalPaymentSort,\n\tpercentage_discount_promotions: models.PercentageDiscountPromotionSort,\n\tpickups: models.PickupSort,\n\tprice_frequency_tiers: models.PriceFrequencyTierSort,\n\tprice_list_schedulers: models.PriceListSchedulerSort,\n\tprice_lists: models.PriceListSort,\n\tprice_tiers: models.PriceTierSort,\n\tprice_volume_tiers: models.PriceVolumeTierSort,\n\tprices: models.PriceSort,\n\tpromotion_rules: models.PromotionRuleSort,\n\tpromotions: models.PromotionSort,\n\trecurring_order_copies: models.RecurringOrderCopySort,\n\trefunds: models.RefundSort,\n\treserved_stocks: models.ReservedStockSort,\n\tresource_errors: models.ResourceErrorSort,\n\treturn_line_items: models.ReturnLineItemSort,\n\treturns: models.ReturnSort,\n\tsatispay_gateways: models.SatispayGatewaySort,\n\tsatispay_payments: models.SatispayPaymentSort,\n\tshipments: models.ShipmentSort,\n\tshipping_categories: models.ShippingCategorySort,\n\tshipping_method_tiers: models.ShippingMethodTierSort,\n\tshipping_methods: models.ShippingMethodSort,\n\tshipping_weight_tiers: models.ShippingWeightTierSort,\n\tshipping_zones: models.ShippingZoneSort,\n\tsku_list_items: models.SkuListItemSort,\n\tsku_list_promotion_rules: models.SkuListPromotionRuleSort,\n\tsku_lists: models.SkuListSort,\n\tsku_options: models.SkuOptionSort,\n\tskus: models.SkuSort,\n\tstock_items: models.StockItemSort,\n\tstock_line_items: models.StockLineItemSort,\n\tstock_locations: models.StockLocationSort,\n\tstock_reservations: models.StockReservationSort,\n\tstock_transfers: models.StockTransferSort,\n\tstores: models.StoreSort,\n\tstripe_gateways: models.StripeGatewaySort,\n\tstripe_payments: models.StripePaymentSort,\n\tstripe_tax_accounts: models.StripeTaxAccountSort,\n\tsubscription_models: models.SubscriptionModelSort,\n\ttags: models.TagSort,\n\ttalon_one_accounts: models.TalonOneAccountSort,\n\ttax_calculators: models.TaxCalculatorSort,\n\ttax_categories: models.TaxCategorySort,\n\ttax_rules: models.TaxRuleSort,\n\ttaxjar_accounts: models.TaxjarAccountSort,\n\ttransactions: models.TransactionSort,\n\tversions: models.VersionSort,\n\tvertex_accounts: models.VertexAccountSort,\n\tvoids: models.VoidSort,\n\twebhooks: models.WebhookSort,\n\twire_transfers: models.WireTransferSort\n\t// ##__API_RESOURCE_SORTABLE_FIELDS_STOP__##\n}\n"]}
|
package/lib/error.cjs
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var fetch = require('./fetch');
|
4
|
+
|
5
|
+
var ErrorType = /* @__PURE__ */ ((ErrorType2) => {
|
6
|
+
ErrorType2["CLIENT"] = "client";
|
7
|
+
ErrorType2["REQUEST"] = "request";
|
8
|
+
ErrorType2["RESPONSE"] = "response";
|
9
|
+
ErrorType2["CANCEL"] = "cancel";
|
10
|
+
ErrorType2["PARSE"] = "parse";
|
11
|
+
ErrorType2["TIMEOUT"] = "timeout";
|
12
|
+
ErrorType2["TOKEN_REFRESH"] = "token-refresh";
|
13
|
+
return ErrorType2;
|
14
|
+
})(ErrorType || {});
|
15
|
+
class SdkError extends Error {
|
16
|
+
static NAME = "SdkError";
|
17
|
+
static isSdkError(error) {
|
18
|
+
return error && [SdkError.NAME, ApiError.NAME].includes(error.name) && Object.values(ErrorType).includes(error.type);
|
19
|
+
}
|
20
|
+
type;
|
21
|
+
code;
|
22
|
+
source;
|
23
|
+
constructor(error) {
|
24
|
+
super(error.message);
|
25
|
+
this.name = SdkError.NAME;
|
26
|
+
this.type = error.type || "client" /* CLIENT */;
|
27
|
+
}
|
28
|
+
}
|
29
|
+
class ApiError extends SdkError {
|
30
|
+
static NAME = "ApiError";
|
31
|
+
static isApiError(error) {
|
32
|
+
return SdkError.isSdkError(error) && error.name === ApiError.NAME && error.type === "response" /* RESPONSE */;
|
33
|
+
}
|
34
|
+
errors = [];
|
35
|
+
status;
|
36
|
+
statusText;
|
37
|
+
// constructor(error: SdkError)
|
38
|
+
constructor(error) {
|
39
|
+
super({ ...error, type: "response" /* RESPONSE */ });
|
40
|
+
this.name = ApiError.NAME;
|
41
|
+
}
|
42
|
+
first() {
|
43
|
+
return this.errors?.length > 0 ? this.errors[0] : void 0;
|
44
|
+
}
|
45
|
+
}
|
46
|
+
const isRequestError = (error) => {
|
47
|
+
return error instanceof TypeError && error.message !== "fetch failed";
|
48
|
+
};
|
49
|
+
const isCancelError = (error) => {
|
50
|
+
return error instanceof DOMException && error.name === "AbortError";
|
51
|
+
};
|
52
|
+
const isTimeoutError = (error) => {
|
53
|
+
return error instanceof DOMException && error.name === "TimeoutError";
|
54
|
+
};
|
55
|
+
const isExpiredTokenError = (error) => {
|
56
|
+
const invalidTokenCodes = [
|
57
|
+
"INVALID_TOKEN"
|
58
|
+
/*, 'UNAUTHORIZED' */
|
59
|
+
];
|
60
|
+
return ApiError.isApiError(error) && error.status === 401 && (invalidTokenCodes.includes(error.code || "") || error.errors && error.errors.length > 0 && invalidTokenCodes.includes(error.errors[0].code));
|
61
|
+
};
|
62
|
+
const handleError = (error) => {
|
63
|
+
if (SdkError.isSdkError(error) || ApiError.isApiError(error)) throw error;
|
64
|
+
let sdkError = new SdkError({ message: error.message });
|
65
|
+
if (fetch.FetchError.isFetchError(error)) {
|
66
|
+
const apiError = new ApiError(sdkError);
|
67
|
+
apiError.type = "response" /* RESPONSE */;
|
68
|
+
apiError.status = error.status;
|
69
|
+
apiError.statusText = error.statusText;
|
70
|
+
apiError.code = String(apiError.status);
|
71
|
+
apiError.errors = error.errors || [];
|
72
|
+
if (!apiError.message && apiError.statusText) apiError.message = apiError.statusText;
|
73
|
+
sdkError = apiError;
|
74
|
+
} else if (isRequestError(error)) {
|
75
|
+
sdkError.type = "request" /* REQUEST */;
|
76
|
+
} else if (isCancelError(error)) {
|
77
|
+
sdkError.type = "cancel" /* CANCEL */;
|
78
|
+
} else if (isTimeoutError(error)) {
|
79
|
+
sdkError.type = "timeout" /* TIMEOUT */;
|
80
|
+
} else {
|
81
|
+
sdkError.type = "client" /* CLIENT */;
|
82
|
+
sdkError.source = error;
|
83
|
+
}
|
84
|
+
throw sdkError;
|
85
|
+
};
|
86
|
+
function isSdkError(error) {
|
87
|
+
return SdkError.isSdkError(error);
|
88
|
+
}
|
89
|
+
function isApiError(error) {
|
90
|
+
return ApiError.isApiError(error);
|
91
|
+
}
|
92
|
+
|
93
|
+
exports.ApiError = ApiError;
|
94
|
+
exports.ErrorType = ErrorType;
|
95
|
+
exports.SdkError = SdkError;
|
96
|
+
exports.handleError = handleError;
|
97
|
+
exports.isApiError = isApiError;
|
98
|
+
exports.isExpiredTokenError = isExpiredTokenError;
|
99
|
+
exports.isSdkError = isSdkError;
|
100
|
+
//# sourceMappingURL=error.cjs.map
|
101
|
+
//# sourceMappingURL=error.cjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/error.ts"],"names":["ErrorType","FetchError"],"mappings":";;;;AAGK,IAAA,SAAA,qBAAAA,UAAL,KAAA;AACC,EAAAA,WAAA,QAAS,CAAA,GAAA,QAAA;AACT,EAAAA,WAAA,SAAU,CAAA,GAAA,SAAA;AACV,EAAAA,WAAA,UAAW,CAAA,GAAA,UAAA;AACX,EAAAA,WAAA,QAAS,CAAA,GAAA,QAAA;AACT,EAAAA,WAAA,OAAQ,CAAA,GAAA,OAAA;AACP,EAAAA,WAAA,SAAU,CAAA,GAAA,SAAA;AACX,EAAAA,WAAA,eAAgB,CAAA,GAAA,eAAA;AAPZ,EAAAA,OAAAA,UAAAA;AAAA,CAAA,EAAA,SAAA,IAAA,EAAA;AAWL,MAAM,iBAAiB,KAAM,CAAA;AAAA,EAE5B,OAAO,IAAO,GAAA,UAAA;AAAA,EAEd,OAAO,WAAW,KAA+B,EAAA;AAChD,IAAA,OAAO,SAAS,CAAC,QAAA,CAAS,IAAM,EAAA,QAAA,CAAS,IAAI,CAAE,CAAA,QAAA,CAAS,KAAM,CAAA,IAAc,KAAK,MAAO,CAAA,MAAA,CAAO,SAAS,CAAE,CAAA,QAAA,CAAS,MAAM,IAAiB,CAAA;AAAA;AAC3I,EAEA,IAAA;AAAA,EACA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAY,KAA8C,EAAA;AACzD,IAAA,KAAA,CAAM,MAAM,OAAO,CAAA;AACnB,IAAA,IAAA,CAAK,OAAO,QAAS,CAAA,IAAA;AACrB,IAAK,IAAA,CAAA,IAAA,GAAO,MAAM,IAAQ,IAAA,QAAA;AAA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;AAE9B,IAAA,QAAA,CAAS,IAAO,GAAA,SAAA;AAAA,GAEd,MAAA;AAEJ,IAAA,QAAA,CAAS,IAAO,GAAA,QAAA;AAChB,IAAA,QAAA,CAAS,MAAS,GAAA,KAAA;AAAA;AAGnB,EAAM,MAAA,QAAA;AAEP;AAMO,SAAS,WAAW,KAAmC,EAAA;AAC7D,EAAO,OAAA,QAAA,CAAS,WAAW,KAAK,CAAA;AACjC;AAEO,SAAS,WAAW,KAAmC,EAAA;AAC7D,EAAO,OAAA,QAAA,CAAS,WAAW,KAAK,CAAA;AACjC","file":"error.cjs","sourcesContent":["import { FetchError } from './fetch'\n\n\nenum ErrorType {\n\tCLIENT = 'client',\t\t \t\t\t\t// Generic Client error\n\tREQUEST = 'request',\t\t\t\t\t\t// Error preparing API request\n\tRESPONSE = 'response',\t\t\t\t\t// Error response from API\n\tCANCEL = 'cancel',\t\t \t\t\t\t// Forced request abort using interceptor\n\tPARSE = 'parse',\t\t \t\t\t\t// Error parsing API resource\n TIMEOUT = 'timeout', \t\t\t\t// Timeout error\n\tTOKEN_REFRESH = 'token-refresh'\t// Error calling refresh token function\n}\n\n\nclass SdkError extends Error {\n\n\tstatic NAME = 'SdkError'\n\n\tstatic isSdkError(error: any): error is SdkError {\n\t\treturn error && [SdkError.NAME, ApiError.NAME].includes(error.name as string) && Object.values(ErrorType).includes(error.type as ErrorType)\n\t}\n\n\ttype: ErrorType\n\tcode?: string\n\tsource?: Error\n\n\tconstructor(error: { message: string, type?: ErrorType }) {\n\t\tsuper(error.message)\n\t\tthis.name = SdkError.NAME\n\t\tthis.type = error.type || ErrorType.CLIENT\n\t}\n\n}\n\nclass ApiError extends SdkError {\n\n\tstatic NAME = 'ApiError'\n\n\tstatic isApiError(error: any): error is ApiError {\n\t\treturn SdkError.isSdkError(error) && (error.name === ApiError.NAME) && (error.type === ErrorType.RESPONSE)\n\t}\n\n\terrors: any[] = []\n\tstatus?: number\n\tstatusText?: string\n\n\t// constructor(error: SdkError)\n\tconstructor(error: { message: string }) {\n\t\tsuper({ ...error, type: ErrorType.RESPONSE })\n\t\tthis.name = ApiError.NAME\n\t}\n\n\tfirst(): any {\n\t\treturn (this.errors?.length > 0) ? this.errors[0] : undefined\n\t}\n\n}\n\n\nconst isRequestError = (error: any): error is TypeError => {\n\treturn (error instanceof TypeError) && (error.message !== 'fetch failed')\n}\n\nconst isCancelError = (error: any): boolean => {\n\treturn (error instanceof DOMException) && (error.name === 'AbortError')\n}\n\nconst isTimeoutError = (error: any): boolean => {\n\treturn (error instanceof DOMException) && (error.name === 'TimeoutError')\n}\n\nconst isExpiredTokenError = (error: any): boolean => {\n\tconst invalidTokenCodes = ['INVALID_TOKEN'/*, 'UNAUTHORIZED' */]\n\treturn (ApiError.isApiError(error) && (error.status === 401) && (\n\t\tinvalidTokenCodes.includes(error.code || '') ||\n\t\t(error.errors && (error.errors.length > 0) && invalidTokenCodes.includes(error.errors[0].code as string))\n\t))\n}\n\n\nconst handleError = (error: Error): never => {\n\n\tif (SdkError.isSdkError(error) || ApiError.isApiError(error)) throw error\n\n\tlet sdkError = new SdkError({ message: error.message })\n\n\tif (FetchError.isFetchError(error)) {\n\t\t// console.log('Fetch Error')\n\t\tconst apiError = new ApiError(sdkError)\n\t\tapiError.type = ErrorType.RESPONSE\n\t\tapiError.status = error.status\n\t\tapiError.statusText = error.statusText\n\t\tapiError.code = String(apiError.status)\n\t\tapiError.errors = error.errors || []\n\t\tif (!apiError.message && apiError.statusText) apiError.message = apiError.statusText\n\t\tsdkError = apiError\n\t}\n\telse if (isRequestError(error)) {\n\t\t// console.log('Request Error')\n sdkError.type = ErrorType.REQUEST\n }\n\telse if (isCancelError(error)) {\n\t\t// console.log('Cancel Error')\n sdkError.type = ErrorType.CANCEL\n }\n else if (isTimeoutError(error)) {\n\t\t// console.log('Timeout Error')\n sdkError.type = ErrorType.TIMEOUT\n }\n\telse {\n\t\t// console.log('Generic Error')\n\t\tsdkError.type = ErrorType.CLIENT\n\t\tsdkError.source = error\n\t}\n\n\tthrow sdkError\n\n}\n\n\nexport { SdkError, ApiError, ErrorType, handleError, isExpiredTokenError }\n\n\nexport function isSdkError(error: unknown): error is SdkError {\n\treturn SdkError.isSdkError(error)\n}\n\nexport function isApiError(error: unknown): error is ApiError {\n\treturn ApiError.isApiError(error)\n}\n"]}
|
package/lib/error.d.cts
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
declare enum ErrorType {
|
2
|
+
CLIENT = "client",// Generic Client error
|
3
|
+
REQUEST = "request",// Error preparing API request
|
4
|
+
RESPONSE = "response",// Error response from API
|
5
|
+
CANCEL = "cancel",// Forced request abort using interceptor
|
6
|
+
PARSE = "parse",// Error parsing API resource
|
7
|
+
TIMEOUT = "timeout",// Timeout error
|
8
|
+
TOKEN_REFRESH = "token-refresh"
|
9
|
+
}
|
10
|
+
declare class SdkError extends Error {
|
11
|
+
static NAME: string;
|
12
|
+
static isSdkError(error: any): error is SdkError;
|
13
|
+
type: ErrorType;
|
14
|
+
code?: string;
|
15
|
+
source?: Error;
|
16
|
+
constructor(error: {
|
17
|
+
message: string;
|
18
|
+
type?: ErrorType;
|
19
|
+
});
|
20
|
+
}
|
21
|
+
declare class ApiError extends SdkError {
|
22
|
+
static NAME: string;
|
23
|
+
static isApiError(error: any): error is ApiError;
|
24
|
+
errors: any[];
|
25
|
+
status?: number;
|
26
|
+
statusText?: string;
|
27
|
+
constructor(error: {
|
28
|
+
message: string;
|
29
|
+
});
|
30
|
+
first(): any;
|
31
|
+
}
|
32
|
+
declare const isExpiredTokenError: (error: any) => boolean;
|
33
|
+
declare const handleError: (error: Error) => never;
|
34
|
+
|
35
|
+
declare function isSdkError(error: unknown): error is SdkError;
|
36
|
+
declare function isApiError(error: unknown): error is ApiError;
|
37
|
+
|
38
|
+
export { ApiError, ErrorType, SdkError, handleError, isApiError, isExpiredTokenError, isSdkError };
|
package/lib/error.d.ts
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
declare enum ErrorType {
|
2
|
+
CLIENT = "client",// Generic Client error
|
3
|
+
REQUEST = "request",// Error preparing API request
|
4
|
+
RESPONSE = "response",// Error response from API
|
5
|
+
CANCEL = "cancel",// Forced request abort using interceptor
|
6
|
+
PARSE = "parse",// Error parsing API resource
|
7
|
+
TIMEOUT = "timeout",// Timeout error
|
8
|
+
TOKEN_REFRESH = "token-refresh"
|
9
|
+
}
|
10
|
+
declare class SdkError extends Error {
|
11
|
+
static NAME: string;
|
12
|
+
static isSdkError(error: any): error is SdkError;
|
13
|
+
type: ErrorType;
|
14
|
+
code?: string;
|
15
|
+
source?: Error;
|
16
|
+
constructor(error: {
|
17
|
+
message: string;
|
18
|
+
type?: ErrorType;
|
19
|
+
});
|
20
|
+
}
|
21
|
+
declare class ApiError extends SdkError {
|
22
|
+
static NAME: string;
|
23
|
+
static isApiError(error: any): error is ApiError;
|
24
|
+
errors: any[];
|
25
|
+
status?: number;
|
26
|
+
statusText?: string;
|
27
|
+
constructor(error: {
|
28
|
+
message: string;
|
29
|
+
});
|
30
|
+
first(): any;
|
31
|
+
}
|
32
|
+
declare const isExpiredTokenError: (error: any) => boolean;
|
33
|
+
declare const handleError: (error: Error) => never;
|
34
|
+
|
35
|
+
declare function isSdkError(error: unknown): error is SdkError;
|
36
|
+
declare function isApiError(error: unknown): error is ApiError;
|
37
|
+
|
38
|
+
export { ApiError, ErrorType, SdkError, handleError, isApiError, isExpiredTokenError, isSdkError };
|
package/lib/error.js
ADDED
@@ -0,0 +1,93 @@
|
|
1
|
+
import { FetchError } from './fetch';
|
2
|
+
|
3
|
+
var ErrorType = /* @__PURE__ */ ((ErrorType2) => {
|
4
|
+
ErrorType2["CLIENT"] = "client";
|
5
|
+
ErrorType2["REQUEST"] = "request";
|
6
|
+
ErrorType2["RESPONSE"] = "response";
|
7
|
+
ErrorType2["CANCEL"] = "cancel";
|
8
|
+
ErrorType2["PARSE"] = "parse";
|
9
|
+
ErrorType2["TIMEOUT"] = "timeout";
|
10
|
+
ErrorType2["TOKEN_REFRESH"] = "token-refresh";
|
11
|
+
return ErrorType2;
|
12
|
+
})(ErrorType || {});
|
13
|
+
class SdkError extends Error {
|
14
|
+
static NAME = "SdkError";
|
15
|
+
static isSdkError(error) {
|
16
|
+
return error && [SdkError.NAME, ApiError.NAME].includes(error.name) && Object.values(ErrorType).includes(error.type);
|
17
|
+
}
|
18
|
+
type;
|
19
|
+
code;
|
20
|
+
source;
|
21
|
+
constructor(error) {
|
22
|
+
super(error.message);
|
23
|
+
this.name = SdkError.NAME;
|
24
|
+
this.type = error.type || "client" /* CLIENT */;
|
25
|
+
}
|
26
|
+
}
|
27
|
+
class ApiError extends SdkError {
|
28
|
+
static NAME = "ApiError";
|
29
|
+
static isApiError(error) {
|
30
|
+
return SdkError.isSdkError(error) && error.name === ApiError.NAME && error.type === "response" /* RESPONSE */;
|
31
|
+
}
|
32
|
+
errors = [];
|
33
|
+
status;
|
34
|
+
statusText;
|
35
|
+
// constructor(error: SdkError)
|
36
|
+
constructor(error) {
|
37
|
+
super({ ...error, type: "response" /* RESPONSE */ });
|
38
|
+
this.name = ApiError.NAME;
|
39
|
+
}
|
40
|
+
first() {
|
41
|
+
return this.errors?.length > 0 ? this.errors[0] : void 0;
|
42
|
+
}
|
43
|
+
}
|
44
|
+
const isRequestError = (error) => {
|
45
|
+
return error instanceof TypeError && error.message !== "fetch failed";
|
46
|
+
};
|
47
|
+
const isCancelError = (error) => {
|
48
|
+
return error instanceof DOMException && error.name === "AbortError";
|
49
|
+
};
|
50
|
+
const isTimeoutError = (error) => {
|
51
|
+
return error instanceof DOMException && error.name === "TimeoutError";
|
52
|
+
};
|
53
|
+
const isExpiredTokenError = (error) => {
|
54
|
+
const invalidTokenCodes = [
|
55
|
+
"INVALID_TOKEN"
|
56
|
+
/*, 'UNAUTHORIZED' */
|
57
|
+
];
|
58
|
+
return ApiError.isApiError(error) && error.status === 401 && (invalidTokenCodes.includes(error.code || "") || error.errors && error.errors.length > 0 && invalidTokenCodes.includes(error.errors[0].code));
|
59
|
+
};
|
60
|
+
const handleError = (error) => {
|
61
|
+
if (SdkError.isSdkError(error) || ApiError.isApiError(error)) throw error;
|
62
|
+
let sdkError = new SdkError({ message: error.message });
|
63
|
+
if (FetchError.isFetchError(error)) {
|
64
|
+
const apiError = new ApiError(sdkError);
|
65
|
+
apiError.type = "response" /* RESPONSE */;
|
66
|
+
apiError.status = error.status;
|
67
|
+
apiError.statusText = error.statusText;
|
68
|
+
apiError.code = String(apiError.status);
|
69
|
+
apiError.errors = error.errors || [];
|
70
|
+
if (!apiError.message && apiError.statusText) apiError.message = apiError.statusText;
|
71
|
+
sdkError = apiError;
|
72
|
+
} else if (isRequestError(error)) {
|
73
|
+
sdkError.type = "request" /* REQUEST */;
|
74
|
+
} else if (isCancelError(error)) {
|
75
|
+
sdkError.type = "cancel" /* CANCEL */;
|
76
|
+
} else if (isTimeoutError(error)) {
|
77
|
+
sdkError.type = "timeout" /* TIMEOUT */;
|
78
|
+
} else {
|
79
|
+
sdkError.type = "client" /* CLIENT */;
|
80
|
+
sdkError.source = error;
|
81
|
+
}
|
82
|
+
throw sdkError;
|
83
|
+
};
|
84
|
+
function isSdkError(error) {
|
85
|
+
return SdkError.isSdkError(error);
|
86
|
+
}
|
87
|
+
function isApiError(error) {
|
88
|
+
return ApiError.isApiError(error);
|
89
|
+
}
|
90
|
+
|
91
|
+
export { ApiError, ErrorType, SdkError, handleError, isApiError, isExpiredTokenError, isSdkError };
|
92
|
+
//# sourceMappingURL=error.js.map
|
93
|
+
//# sourceMappingURL=error.js.map
|
package/lib/error.js.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/error.ts"],"names":["ErrorType"],"mappings":";;AAGK,IAAA,SAAA,qBAAAA,UAAL,KAAA;AACC,EAAAA,WAAA,QAAS,CAAA,GAAA,QAAA;AACT,EAAAA,WAAA,SAAU,CAAA,GAAA,SAAA;AACV,EAAAA,WAAA,UAAW,CAAA,GAAA,UAAA;AACX,EAAAA,WAAA,QAAS,CAA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// Error preparing API request\n\tRESPONSE = 'response',\t\t\t\t\t// Error response from API\n\tCANCEL = 'cancel',\t\t \t\t\t\t// Forced request abort using interceptor\n\tPARSE = 'parse',\t\t \t\t\t\t// Error parsing API resource\n TIMEOUT = 'timeout', \t\t\t\t// Timeout error\n\tTOKEN_REFRESH = 'token-refresh'\t// Error calling refresh token function\n}\n\n\nclass SdkError extends Error {\n\n\tstatic NAME = 'SdkError'\n\n\tstatic isSdkError(error: any): error is SdkError {\n\t\treturn error && [SdkError.NAME, ApiError.NAME].includes(error.name as string) && Object.values(ErrorType).includes(error.type as ErrorType)\n\t}\n\n\ttype: ErrorType\n\tcode?: string\n\tsource?: Error\n\n\tconstructor(error: { message: string, type?: ErrorType }) {\n\t\tsuper(error.message)\n\t\tthis.name = SdkError.NAME\n\t\tthis.type = error.type || ErrorType.CLIENT\n\t}\n\n}\n\nclass ApiError extends SdkError {\n\n\tstatic NAME = 'ApiError'\n\n\tstatic isApiError(error: any): error is ApiError {\n\t\treturn SdkError.isSdkError(error) && (error.name === ApiError.NAME) && (error.type === ErrorType.RESPONSE)\n\t}\n\n\terrors: any[] = []\n\tstatus?: number\n\tstatusText?: string\n\n\t// constructor(error: SdkError)\n\tconstructor(error: { message: string }) {\n\t\tsuper({ ...error, type: ErrorType.RESPONSE })\n\t\tthis.name = ApiError.NAME\n\t}\n\n\tfirst(): any {\n\t\treturn (this.errors?.length > 0) ? this.errors[0] : undefined\n\t}\n\n}\n\n\nconst isRequestError = (error: any): error is TypeError => {\n\treturn (error instanceof TypeError) && (error.message !== 'fetch failed')\n}\n\nconst isCancelError = (error: any): boolean => {\n\treturn (error instanceof DOMException) && (error.name === 'AbortError')\n}\n\nconst isTimeoutError = (error: any): boolean => {\n\treturn (error instanceof DOMException) && (error.name === 'TimeoutError')\n}\n\nconst isExpiredTokenError = (error: any): boolean => {\n\tconst invalidTokenCodes = ['INVALID_TOKEN'/*, 'UNAUTHORIZED' */]\n\treturn (ApiError.isApiError(error) && (error.status === 401) && (\n\t\tinvalidTokenCodes.includes(error.code || '') ||\n\t\t(error.errors && (error.errors.length > 0) && invalidTokenCodes.includes(error.errors[0].code as string))\n\t))\n}\n\n\nconst handleError = (error: Error): never => {\n\n\tif (SdkError.isSdkError(error) || ApiError.isApiError(error)) throw error\n\n\tlet sdkError = new SdkError({ message: error.message })\n\n\tif (FetchError.isFetchError(error)) {\n\t\t// console.log('Fetch Error')\n\t\tconst apiError = new ApiError(sdkError)\n\t\tapiError.type = ErrorType.RESPONSE\n\t\tapiError.status = error.status\n\t\tapiError.statusText = error.statusText\n\t\tapiError.code = String(apiError.status)\n\t\tapiError.errors = error.errors || []\n\t\tif (!apiError.message && apiError.statusText) apiError.message = apiError.statusText\n\t\tsdkError = apiError\n\t}\n\telse if (isRequestError(error)) {\n\t\t// console.log('Request Error')\n sdkError.type = ErrorType.REQUEST\n }\n\telse if (isCancelError(error)) {\n\t\t// console.log('Cancel Error')\n sdkError.type = ErrorType.CANCEL\n }\n else if (isTimeoutError(error)) {\n\t\t// console.log('Timeout Error')\n sdkError.type = ErrorType.TIMEOUT\n }\n\telse {\n\t\t// console.log('Generic Error')\n\t\tsdkError.type = ErrorType.CLIENT\n\t\tsdkError.source = error\n\t}\n\n\tthrow sdkError\n\n}\n\n\nexport { SdkError, ApiError, ErrorType, handleError, isExpiredTokenError }\n\n\nexport function isSdkError(error: unknown): error is SdkError {\n\treturn SdkError.isSdkError(error)\n}\n\nexport function isApiError(error: unknown): error is ApiError {\n\treturn ApiError.isApiError(error)\n}\n"]}
|
package/lib/fetch.cjs
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var error = require('./error');
|
4
|
+
var Debug = require('./debug');
|
5
|
+
|
6
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
7
|
+
|
8
|
+
var Debug__default = /*#__PURE__*/_interopDefault(Debug);
|
9
|
+
|
10
|
+
const debug = Debug__default.default("fetch");
|
11
|
+
class FetchError extends Error {
|
12
|
+
static isFetchError = (error) => {
|
13
|
+
return error instanceof FetchError;
|
14
|
+
};
|
15
|
+
#errors;
|
16
|
+
#status;
|
17
|
+
#statusText;
|
18
|
+
#request;
|
19
|
+
constructor(status, statusText, body, request) {
|
20
|
+
super(statusText);
|
21
|
+
this.#status = status;
|
22
|
+
this.#statusText = statusText;
|
23
|
+
if (body) this.#errors = body.errors;
|
24
|
+
if (request) this.#request = request;
|
25
|
+
}
|
26
|
+
get errors() {
|
27
|
+
return this.#errors;
|
28
|
+
}
|
29
|
+
get status() {
|
30
|
+
return this.#status;
|
31
|
+
}
|
32
|
+
get statusText() {
|
33
|
+
return this.#statusText;
|
34
|
+
}
|
35
|
+
get request() {
|
36
|
+
return this.#request;
|
37
|
+
}
|
38
|
+
}
|
39
|
+
const fetchURL = async (url, requestOptions, clientOptions) => {
|
40
|
+
debug("fetch: %s, %O, native[%s]", url, requestOptions || {}, clientOptions?.fetch ? "no" : "yes");
|
41
|
+
const interceptors = clientOptions?.interceptors;
|
42
|
+
if (interceptors?.request?.onSuccess) ({ url, options: requestOptions } = await interceptors.request.onSuccess({ url, options: requestOptions }));
|
43
|
+
const fetchClient = clientOptions?.fetch || fetch;
|
44
|
+
let response = await fetchClient(url, requestOptions);
|
45
|
+
if (response.ok) {
|
46
|
+
if (interceptors?.rawReader?.onSuccess) await interceptors.rawReader.onSuccess(response);
|
47
|
+
if (interceptors?.response?.onSuccess) response = await interceptors.response.onSuccess(response);
|
48
|
+
} else {
|
49
|
+
if (interceptors?.rawReader?.onFailure) await interceptors.rawReader.onFailure(response);
|
50
|
+
}
|
51
|
+
const responseBody = response.body && response.status !== 204 ? await response.json().then((json) => {
|
52
|
+
debug("response: %O", json);
|
53
|
+
return json;
|
54
|
+
}).catch((err) => {
|
55
|
+
debug("error: %s", err.message);
|
56
|
+
if (response.ok) throw new error.SdkError({ message: "Error parsing API response body", type: error.ErrorType.PARSE });
|
57
|
+
}) : void 0;
|
58
|
+
if (!response.ok) {
|
59
|
+
let error = new FetchError(response.status, response.statusText, responseBody, requestOptions);
|
60
|
+
if (interceptors?.response?.onFailure) error = await interceptors.response.onFailure(error);
|
61
|
+
if (error) throw error;
|
62
|
+
}
|
63
|
+
return responseBody;
|
64
|
+
};
|
65
|
+
|
66
|
+
exports.FetchError = FetchError;
|
67
|
+
exports.fetchURL = fetchURL;
|
68
|
+
//# sourceMappingURL=fetch.cjs.map
|
69
|
+
//# sourceMappingURL=fetch.cjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/fetch.ts"],"names":["Debug","SdkError","ErrorType"],"mappings":";;;;;;;;;AAMA,MAAM,KAAA,GAAQA,uBAAM,OAAO,CAAA;AAapB,MAAM,mBAAmB,KAAM,CAAA;AAAA,EAEpC,OAAO,YAAe,GAAA,CAAC,KAAoC,KAAA;AACzD,IAAA,OAAO,KAAiB,YAAA,UAAA;AAAA,GAC1B;AAAA,EAES,OAAA;AAAA,EACA,OAAA;AAAA,EACA,WAAA;AAAA,EACA,QAAA;AAAA,EAET,WAAY,CAAA,MAAA,EAAgB,UAAoB,EAAA,IAAA,EAAY,OAA+B,EAAA;AACzF,IAAA,KAAA,CAAM,UAAU,CAAA;AAChB,IAAA,IAAA,CAAK,OAAU,GAAA,MAAA;AACf,IAAA,IAAA,CAAK,WAAc,GAAA,UAAA;AACnB,IAAI,IAAA,IAAA,EAAW,IAAA,CAAA,OAAA,GAAU,IAAK,CAAA,MAAA;AAC9B,IAAI,IAAA,OAAA,OAAc,QAAW,GAAA,OAAA;AAAA;AAC/B,EAGA,IAAI,MAA4B,GAAA;AAAE,IAAA,OAAO,IAAK,CAAA,OAAA;AAAA;AAAQ,EAEtD,IAAI,MAAiB,GAAA;AAAE,IAAA,OAAO,IAAK,CAAA,OAAA;AAAA;AAAQ,EAE3C,IAAI,UAAqB,GAAA;AAAE,IAAA,OAAO,IAAK,CAAA,WAAA;AAAA;AAAY,EAEnD,IAAI,OAAoD,GAAA;AAAE,IAAA,OA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AAa,IAAI,OAAO,CAAA;AAC9B,IAAI,IAAA,QAAA,CAAS,EAAI,EAAA,MAAM,IAAIC,cAAA,CAAS,EAAE,OAAA,EAAS,iCAAmC,EAAA,IAAA,EAAMC,eAAU,CAAA,KAAA,EAAO,CAAA;AAAA,GAC1G,CACC,GAAA,MAAA;AAEJ,EAAI,IAAA,CAAC,SAAS,EAAI,EAAA;AAChB,IAAI,IAAA,KAAA,GAAQ,IAAI,UAAW,CAAA,QAAA,CAAS,QAAQ,QAAS,CAAA,UAAA,EAAY,cAAc,cAAc,CAAA;AAC7F,IAAI,IAAA,YAAA,EAAc,UAAU,SAAW,EAAA,KAAA,GAAQ,MAAM,YAAa,CAAA,QAAA,CAAS,UAAU,KAAK,CAAA;AAC1F,IAAA,IAAI,OAAa,MAAA,KAAA;AAAA;AAGnB,EAAO,OAAA,YAAA;AAET","file":"fetch.cjs","sourcesContent":["\nimport type { InterceptorManager } from './interceptor'\nimport { ErrorType, SdkError } from './error'\n\n\nimport Debug from './debug'\nconst debug = Debug('fetch')\n\n\nexport type Fetch = (input: string | URL | Request, init?: RequestInit) => Promise<Response>\n\nexport type FetchResponse = any\nexport type FetchRequestOptions = RequestInit\nexport type FetchClientOptions = {\n interceptors?: InterceptorManager,\n fetch?: Fetch\n}\n\n\nexport class FetchError extends Error {\n\n static isFetchError = (error: any): error is FetchError => {\n return error instanceof FetchError\n }\n\n readonly #errors?: any[]\n readonly #status: number\n readonly #statusText: string\n readonly #request?: Partial<FetchRequestOptions>\n\n constructor(status: number, statusText: string, body?: any, request?: FetchRequestOptions) {\n super(statusText)\n this.#status = status\n this.#statusText = statusText\n if (body) this.#errors = body.errors\n if (request) this.#request = request\n }\n\n\n get errors(): any[] | undefined { return this.#errors }\n\n get status(): number { return this.#status }\n\n get statusText(): string { return this.#statusText }\n\n get request(): Partial<FetchRequestOptions> | undefined { return this.#request }\n\n}\n\n\n\nexport const fetchURL = async (url: URL, requestOptions: FetchRequestOptions, clientOptions?: FetchClientOptions): Promise<FetchResponse> => {\n\n debug('fetch: %s, %O, native[%s]', url, requestOptions || {}, (clientOptions?.fetch? 'no' : 'yes'))\n\n const interceptors = clientOptions?.interceptors\n\n if (interceptors?.request?.onSuccess) ( { url, options: requestOptions } = await interceptors.request.onSuccess({ url, options: requestOptions }) )\n\n // const request: Request = new Request(url, requestOptions) // not supported by all fetch implementations\n\n const fetchClient = clientOptions?.fetch || fetch\n\n let response = await fetchClient(url, requestOptions)\n\n if (response.ok) {\n if (interceptors?.rawReader?.onSuccess) await interceptors.rawReader.onSuccess(response)\n if (interceptors?.response?.onSuccess) response = await interceptors.response.onSuccess(response)\n } else {\n if (interceptors?.rawReader?.onFailure) await interceptors.rawReader.onFailure(response)\n }\n\n const responseBody = (response.body && (response.status !== 204)) ? await response.json()\n .then(json => { debug('response: %O', json); return json })\n .catch((err: Error) => {\n debug('error: %s', err.message)\n if (response.ok) throw new SdkError({ message: 'Error parsing API response body', type: ErrorType.PARSE })\n })\n : undefined\n \n if (!response.ok) {\n let error = new FetchError(response.status, response.statusText, responseBody, requestOptions)\n if (interceptors?.response?.onFailure) error = await interceptors.response.onFailure(error)\n if (error) throw error\n }\n\n return responseBody\n\n}"]}
|
package/lib/fetch.d.cts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export { F as Fetch, i as FetchClientOptions, j as FetchError, h as FetchRequestOptions, g as FetchResponse, k as fetchURL } from './interceptor-5MISI1yn.cjs';
|
package/lib/fetch.d.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export { F as Fetch, i as FetchClientOptions, j as FetchError, h as FetchRequestOptions, g as FetchResponse, k as fetchURL } from './interceptor-5MISI1yn.js';
|
package/lib/fetch.js
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
import { SdkError, ErrorType } from './error';
|
2
|
+
import Debug from './debug';
|
3
|
+
|
4
|
+
const debug = Debug("fetch");
|
5
|
+
class FetchError extends Error {
|
6
|
+
static isFetchError = (error) => {
|
7
|
+
return error instanceof FetchError;
|
8
|
+
};
|
9
|
+
#errors;
|
10
|
+
#status;
|
11
|
+
#statusText;
|
12
|
+
#request;
|
13
|
+
constructor(status, statusText, body, request) {
|
14
|
+
super(statusText);
|
15
|
+
this.#status = status;
|
16
|
+
this.#statusText = statusText;
|
17
|
+
if (body) this.#errors = body.errors;
|
18
|
+
if (request) this.#request = request;
|
19
|
+
}
|
20
|
+
get errors() {
|
21
|
+
return this.#errors;
|
22
|
+
}
|
23
|
+
get status() {
|
24
|
+
return this.#status;
|
25
|
+
}
|
26
|
+
get statusText() {
|
27
|
+
return this.#statusText;
|
28
|
+
}
|
29
|
+
get request() {
|
30
|
+
return this.#request;
|
31
|
+
}
|
32
|
+
}
|
33
|
+
const fetchURL = async (url, requestOptions, clientOptions) => {
|
34
|
+
debug("fetch: %s, %O, native[%s]", url, requestOptions || {}, clientOptions?.fetch ? "no" : "yes");
|
35
|
+
const interceptors = clientOptions?.interceptors;
|
36
|
+
if (interceptors?.request?.onSuccess) ({ url, options: requestOptions } = await interceptors.request.onSuccess({ url, options: requestOptions }));
|
37
|
+
const fetchClient = clientOptions?.fetch || fetch;
|
38
|
+
let response = await fetchClient(url, requestOptions);
|
39
|
+
if (response.ok) {
|
40
|
+
if (interceptors?.rawReader?.onSuccess) await interceptors.rawReader.onSuccess(response);
|
41
|
+
if (interceptors?.response?.onSuccess) response = await interceptors.response.onSuccess(response);
|
42
|
+
} else {
|
43
|
+
if (interceptors?.rawReader?.onFailure) await interceptors.rawReader.onFailure(response);
|
44
|
+
}
|
45
|
+
const responseBody = response.body && response.status !== 204 ? await response.json().then((json) => {
|
46
|
+
debug("response: %O", json);
|
47
|
+
return json;
|
48
|
+
}).catch((err) => {
|
49
|
+
debug("error: %s", err.message);
|
50
|
+
if (response.ok) throw new SdkError({ message: "Error parsing API response body", type: ErrorType.PARSE });
|
51
|
+
}) : void 0;
|
52
|
+
if (!response.ok) {
|
53
|
+
let error = new FetchError(response.status, response.statusText, responseBody, requestOptions);
|
54
|
+
if (interceptors?.response?.onFailure) error = await interceptors.response.onFailure(error);
|
55
|
+
if (error) throw error;
|
56
|
+
}
|
57
|
+
return responseBody;
|
58
|
+
};
|
59
|
+
|
60
|
+
export { FetchError, fetchURL };
|
61
|
+
//# sourceMappingURL=fetch.js.map
|
62
|
+
//# sourceMappingURL=fetch.js.map
|
package/lib/fetch.js.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/fetch.ts"],"names":[],"mappings":";;;AAMA,MAAM,KAAA,GAAQ,MAAM,OAAO,CAAA;AAapB,MAAM,mBAAmB,KAAM,CAAA;AAAA,EAEpC,OAAO,YAAe,GAAA,CAAC,KAAoC,KAAA;AACzD,IAAA,OAAO,KAAiB,YAAA,UAAA;AAAA,GAC1B;AAAA,EAES,OAAA;AAAA,EACA,OAAA;AAAA,EACA,WAAA;AAAA,EACA,QAAA;AAAA,EAET,WAAY,CAAA,MAAA,EAAgB,UAAoB,EAAA,IAAA,EAAY,OAA+B,EAAA;AACzF,IAAA,KAAA,CAAM,UAAU,CAAA;AAChB,IAAA,IAAA,CAAK,OAAU,GAAA,MAAA;AACf,IAAA,IAAA,CAAK,WAAc,GAAA,UAAA;AACnB,IAAI,IAAA,IAAA,EAAW,IAAA,CAAA,OAAA,GAAU,IAAK,CAAA,MAAA;AAC9B,IAAI,IAAA,OAAA,OAAc,QAAW,GAAA,OAAA;AAAA;AAC/B,EAGA,IAAI,MAA4B,GAAA;AAAE,IAAA,OAAO,IAAK,CAAA,OAAA;AAAA;AAAQ,EAEtD,IAAI,MAAiB,GAAA;AAAE,IAAA,OAAO,IAAK,CAAA,OAAA;AAAA;AAAQ,EAE3C,IAAI,UAAqB,GAAA;AAAE,IAAA,OAAO,IAAK,CAAA,WAAA;AAAA;AAAY,EAEnD,IAAI,OAAoD,GAAA;AAAE,IAAA,OAAO,IAAK,CAAA,QAAA;AAAA;AAExE;AAIO,MAAM,QAAW,GAAA,OAAO,GAAU,EAAA,cAAA,EAAqC,aAA+D,K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AAA,EAAS,iCAAmC,EAAA,IAAA,EAAM,SAAU,CAAA,KAAA,EAAO,CAAA;AAAA,GAC1G,CACC,GAAA,MAAA;AAEJ,EAAI,IAAA,CAAC,SAAS,EAAI,EAAA;AAChB,IAAI,IAAA,KAAA,GAAQ,IAAI,UAAW,CAAA,QAAA,CAAS,QAAQ,QAAS,CAAA,UAAA,EAAY,cAAc,cAAc,CAAA;AAC7F,IAAI,IAAA,YAAA,EAAc,UAAU,SAAW,EAAA,KAAA,GAAQ,MAAM,YAAa,CAAA,QAAA,CAAS,UAAU,KAAK,CAAA;AAC1F,IAAA,IAAI,OAAa,MAAA,KAAA;AAAA;AAGnB,EAAO,OAAA,YAAA;AAET","file":"fetch.js","sourcesContent":["\nimport type { InterceptorManager } from './interceptor'\nimport { ErrorType, SdkError } from './error'\n\n\nimport Debug from './debug'\nconst debug = Debug('fetch')\n\n\nexport type Fetch = (input: string | URL | Request, init?: RequestInit) => Promise<Response>\n\nexport type FetchResponse = any\nexport type FetchRequestOptions = RequestInit\nexport type FetchClientOptions = {\n interceptors?: InterceptorManager,\n fetch?: Fetch\n}\n\n\nexport class FetchError extends Error {\n\n static isFetchError = (error: any): error is FetchError => {\n return error instanceof FetchError\n }\n\n readonly #errors?: any[]\n readonly #status: number\n readonly #statusText: string\n readonly #request?: Partial<FetchRequestOptions>\n\n constructor(status: number, statusText: string, body?: any, request?: FetchRequestOptions) {\n super(statusText)\n this.#status = status\n this.#statusText = statusText\n if (body) this.#errors = body.errors\n if (request) this.#request = request\n }\n\n\n get errors(): any[] | undefined { return this.#errors }\n\n get status(): number { return this.#status }\n\n get statusText(): string { return this.#statusText }\n\n get request(): Partial<FetchRequestOptions> | undefined { return this.#request }\n\n}\n\n\n\nexport const fetchURL = async (url: URL, requestOptions: FetchRequestOptions, clientOptions?: FetchClientOptions): Promise<FetchResponse> => {\n\n debug('fetch: %s, %O, native[%s]', url, requestOptions || {}, (clientOptions?.fetch? 'no' : 'yes'))\n\n const interceptors = clientOptions?.interceptors\n\n if (interceptors?.request?.onSuccess) ( { url, options: requestOptions } = await interceptors.request.onSuccess({ url, options: requestOptions }) )\n\n // const request: Request = new Request(url, requestOptions) // not supported by all fetch implementations\n\n const fetchClient = clientOptions?.fetch || fetch\n\n let response = await fetchClient(url, requestOptions)\n\n if (response.ok) {\n if (interceptors?.rawReader?.onSuccess) await interceptors.rawReader.onSuccess(response)\n if (interceptors?.response?.onSuccess) response = await interceptors.response.onSuccess(response)\n } else {\n if (interceptors?.rawReader?.onFailure) await interceptors.rawReader.onFailure(response)\n }\n\n const responseBody = (response.body && (response.status !== 204)) ? await response.json()\n .then(json => { debug('response: %O', json); return json })\n .catch((err: Error) => {\n debug('error: %s', err.message)\n if (response.ok) throw new SdkError({ message: 'Error parsing API response body', type: ErrorType.PARSE })\n })\n : undefined\n \n if (!response.ok) {\n let error = new FetchError(response.status, response.statusText, responseBody, requestOptions)\n if (interceptors?.response?.onFailure) error = await interceptors.response.onFailure(error)\n if (error) throw error\n }\n\n return responseBody\n\n}"]}
|