@commercelayer/sdk 7.0.0-beta.9 → 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
@@ -0,0 +1,47 @@
|
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
|
3
|
+
class EasypostPickups extends ApiResource {
|
4
|
+
static TYPE = "easypost_pickups";
|
5
|
+
async create(resource, params, options) {
|
6
|
+
return this.resources.create({ ...resource, type: EasypostPickups.TYPE }, params, options);
|
7
|
+
}
|
8
|
+
async update(resource, params, options) {
|
9
|
+
return this.resources.update({ ...resource, type: EasypostPickups.TYPE }, params, options);
|
10
|
+
}
|
11
|
+
async delete(id, options) {
|
12
|
+
await this.resources.delete(typeof id === "string" ? { id, type: EasypostPickups.TYPE } : id, options);
|
13
|
+
}
|
14
|
+
async shipment(easypostPickupId, params, options) {
|
15
|
+
const _easypostPickupId = easypostPickupId.id || easypostPickupId;
|
16
|
+
return this.resources.fetch({ type: "shipments" }, `easypost_pickups/${_easypostPickupId}/shipment`, params, options);
|
17
|
+
}
|
18
|
+
async parcels(easypostPickupId, params, options) {
|
19
|
+
const _easypostPickupId = easypostPickupId.id || easypostPickupId;
|
20
|
+
return this.resources.fetch({ type: "parcels" }, `easypost_pickups/${_easypostPickupId}/parcels`, params, options);
|
21
|
+
}
|
22
|
+
async events(easypostPickupId, params, options) {
|
23
|
+
const _easypostPickupId = easypostPickupId.id || easypostPickupId;
|
24
|
+
return this.resources.fetch({ type: "events" }, `easypost_pickups/${_easypostPickupId}/events`, params, options);
|
25
|
+
}
|
26
|
+
async _purchase(id, params, options) {
|
27
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: EasypostPickups.TYPE, _purchase: true }, params, options);
|
28
|
+
}
|
29
|
+
isEasypostPickup(resource) {
|
30
|
+
return resource.type && resource.type === EasypostPickups.TYPE;
|
31
|
+
}
|
32
|
+
relationship(id) {
|
33
|
+
return super.relationshipOneToOne(id);
|
34
|
+
}
|
35
|
+
relationshipToMany(...ids) {
|
36
|
+
return super.relationshipOneToMany(...ids);
|
37
|
+
}
|
38
|
+
type() {
|
39
|
+
return EasypostPickups.TYPE;
|
40
|
+
}
|
41
|
+
}
|
42
|
+
const instance = new EasypostPickups();
|
43
|
+
var easypost_pickups_default = instance;
|
44
|
+
|
45
|
+
export { easypost_pickups_default as default };
|
46
|
+
//# sourceMappingURL=easypost_pickups.js.map
|
47
|
+
//# sourceMappingURL=easypost_pickups.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../src/resources/easypost_pickups.ts"],"names":[],"mappings":"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","file":"easypost_pickups.js","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Shipment, ShipmentType } from './shipments'\nimport type { Parcel } from './parcels'\nimport type { Event } from './events'\n\n\ntype EasypostPickupType = 'easypost_pickups'\ntype EasypostPickupRel = ResourceRel & { type: EasypostPickupType }\ntype ShipmentRel = ResourceRel & { type: ShipmentType }\n\n\nexport type EasypostPickupSort = Pick<EasypostPickup, 'id' | 'status' | 'min_datetime' | 'max_datetime' | 'purchase_started_at' | 'purchase_completed_at'> & ResourceSort\n// export type EasypostPickupFilter = Pick<EasypostPickup, 'id' | 'status' | 'min_datetime' | 'max_datetime' | 'purchase_started_at' | 'purchase_completed_at'> & ResourceFilter\n\n\ninterface EasypostPickup extends Resource {\n\t\n\treadonly type: EasypostPickupType\n\n\t/** \n\t * The pick up status.\n\t * @example ```\"unknown\"```\n\t */\n\tstatus?: string | null\n\t/** \n\t * The pick up service internal ID.\n\t * @example ```\"pickup_13e5d7e2a7824432a07975bc553944bc\"```\n\t */\n\tinternal_id: string\n\t/** \n\t * The selected purchase rate from the available pick up rates.\n\t * @example ```\"pickuprate_a6cd2647a898410aa5d33febde44e1b2\"```\n\t */\n\tselected_rate_id?: string | null\n\t/** \n\t * The available pick up rates.\n\t * @example ```[{\"id\":\"pickuprate_a6cd2647a898410aa5d33febde44e1b2\",\"rate\":\"45.59\",\"carrier\":\"USPS\",\"service\":\"NextDay\"}]```\n\t */\n\trates: Array<Record<string, any>>\n\t/** \n\t * Additional text to help the driver successfully obtain the package, automatically enriched with parcels and package informations.\n\t * @example ```\"Knock loudly\"```\n\t */\n\tinstructions?: string | null\n\t/** \n\t * The earliest time at which the package is available to pick up, must be larger than 2 hours from creation time.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tmin_datetime: string\n\t/** \n\t * The latest time at which the package is available to pick up, must be smaller than 24 hours from creation time.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tmax_datetime: string\n\t/** \n\t * Time at which the purchasing of the pick up rate started.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tpurchase_started_at?: string | null\n\t/** \n\t * Time at which the purchasing of the pick up rate completed.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tpurchase_completed_at?: string | null\n\n\tshipment?: Shipment | null\n\tparcels?: Parcel[] | null\n\tevents?: Event[] | null\n\n}\n\n\ninterface EasypostPickupCreate extends ResourceCreate {\n\t\n\t/** \n\t * Additional text to help the driver successfully obtain the package, automatically enriched with parcels and package informations.\n\t * @example ```\"Knock loudly\"```\n\t */\n\tinstructions?: string | null\n\t/** \n\t * The earliest time at which the package is available to pick up, must be larger than 2 hours from creation time.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tmin_datetime: string\n\t/** \n\t * The latest time at which the package is available to pick up, must be smaller than 24 hours from creation time.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tmax_datetime: string\n\n\tshipment: ShipmentRel\n\n}\n\n\ninterface EasypostPickupUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The selected purchase rate from the available pick up rates.\n\t * @example ```\"pickuprate_a6cd2647a898410aa5d33febde44e1b2\"```\n\t */\n\tselected_rate_id?: string | null\n\t/** \n\t * Send this attribute if you want to purchase this pick up with the selected rate.\n\t * @example ```true```\n\t */\n\t_purchase?: boolean | null\n\n\tshipment?: ShipmentRel | null\n\n}\n\n\nclass EasypostPickups extends ApiResource<EasypostPickup> {\n\n\tstatic readonly TYPE: EasypostPickupType = 'easypost_pickups' as const\n\n\tasync create(resource: EasypostPickupCreate, params?: QueryParamsRetrieve<EasypostPickup>, options?: ResourcesConfig): Promise<EasypostPickup> {\n\t\treturn this.resources.create<EasypostPickupCreate, EasypostPickup>({ ...resource, type: EasypostPickups.TYPE }, params, options)\n\t}\n\n\tasync update(resource: EasypostPickupUpdate, params?: QueryParamsRetrieve<EasypostPickup>, options?: ResourcesConfig): Promise<EasypostPickup> {\n\t\treturn this.resources.update<EasypostPickupUpdate, EasypostPickup>({ ...resource, type: EasypostPickups.TYPE }, params, options)\n\t}\n\n\tasync delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void> {\n\t\tawait this.resources.delete((typeof id === 'string')? { id, type: EasypostPickups.TYPE } : id, options)\n\t}\n\n\tasync shipment(easypostPickupId: string | EasypostPickup, params?: QueryParamsRetrieve<Shipment>, options?: ResourcesConfig): Promise<Shipment> {\n\t\tconst _easypostPickupId = (easypostPickupId as EasypostPickup).id || easypostPickupId as string\n\t\treturn this.resources.fetch<Shipment>({ type: 'shipments' }, `easypost_pickups/${_easypostPickupId}/shipment`, params, options) as unknown as Shipment\n\t}\n\n\tasync parcels(easypostPickupId: string | EasypostPickup, params?: QueryParamsList<Parcel>, options?: ResourcesConfig): Promise<ListResponse<Parcel>> {\n\t\tconst _easypostPickupId = (easypostPickupId as EasypostPickup).id || easypostPickupId as string\n\t\treturn this.resources.fetch<Parcel>({ type: 'parcels' }, `easypost_pickups/${_easypostPickupId}/parcels`, params, options) as unknown as ListResponse<Parcel>\n\t}\n\n\tasync events(easypostPickupId: string | EasypostPickup, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _easypostPickupId = (easypostPickupId as EasypostPickup).id || easypostPickupId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `easypost_pickups/${_easypostPickupId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync _purchase(id: string | EasypostPickup, params?: QueryParamsRetrieve<EasypostPickup>, options?: ResourcesConfig): Promise<EasypostPickup> {\n\t\treturn this.resources.update<EasypostPickupUpdate, EasypostPickup>({ id: (typeof id === 'string')? id: id.id, type: EasypostPickups.TYPE, _purchase: true }, params, options)\n\t}\n\n\n\tisEasypostPickup(resource: any): resource is EasypostPickup {\n\t\treturn resource.type && (resource.type === EasypostPickups.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): EasypostPickupRel {\n\t\treturn super.relationshipOneToOne<EasypostPickupRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): EasypostPickupRel[] {\n\t\treturn super.relationshipOneToMany<EasypostPickupRel>(...ids)\n\t}\n\n\n\ttype(): EasypostPickupType {\n\t\treturn EasypostPickups.TYPE\n\t}\n\n}\n\n\nconst instance = new EasypostPickups()\nexport default instance\n\nexport type { EasypostPickup, EasypostPickupCreate, EasypostPickupUpdate, EasypostPickupType }\n"]}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var resource = require('../resource');
|
4
|
+
|
5
|
+
class EventCallbacks extends resource.ApiResource {
|
6
|
+
static TYPE = "event_callbacks";
|
7
|
+
async webhook(eventCallbackId, params, options) {
|
8
|
+
const _eventCallbackId = eventCallbackId.id || eventCallbackId;
|
9
|
+
return this.resources.fetch({ type: "webhooks" }, `event_callbacks/${_eventCallbackId}/webhook`, params, options);
|
10
|
+
}
|
11
|
+
isEventCallback(resource) {
|
12
|
+
return resource.type && resource.type === EventCallbacks.TYPE;
|
13
|
+
}
|
14
|
+
relationship(id) {
|
15
|
+
return super.relationshipOneToOne(id);
|
16
|
+
}
|
17
|
+
relationshipToMany(...ids) {
|
18
|
+
return super.relationshipOneToMany(...ids);
|
19
|
+
}
|
20
|
+
type() {
|
21
|
+
return EventCallbacks.TYPE;
|
22
|
+
}
|
23
|
+
}
|
24
|
+
const instance = new EventCallbacks();
|
25
|
+
var event_callbacks_default = instance;
|
26
|
+
|
27
|
+
module.exports = event_callbacks_default;
|
28
|
+
//# sourceMappingURL=event_callbacks.cjs.map
|
29
|
+
|
30
|
+
module.exports = exports.default;
|
31
|
+
//# sourceMappingURL=event_callbacks.cjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../src/resources/event_callbacks.ts"],"names":["ApiResource"],"mappings":";;;;AA6CA,MAAM,uBAAuBA,oBAA2B,CAAA;AAAA,EAEvD,OAAgB,IAA0B,GAAA,iBAAA;AAAA,EAE1C,MAAM,OAAA,CAAQ,eAAyC,EAAA,MAAA,EAAuC,OAA6C,EAAA;AAC1I,IAAM,MAAA,gBAAA,GAAoB,gBAAkC,EAAM,IAAA,eAAA;AAClE,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAe,EAAE,IAAA,EAAM,UAAW,EAAA,EAAG,CAAmB,gBAAA,EAAA,gBAAgB,CAAY,QAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC1H,EAGA,gBAAgB,QAA0C,EAAA;AACzD,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,cAAe,CAAA,IAAA;AAAA;AAC3D,EAGA,aAAa,EAAkD,EAAA;AAC9D,IAAO,OAAA,KAAA,CAAM,qBAAuC,EAAE,CAAA;AAAA;AACvD,EAEA,sBAAsB,GAAmC,EAAA;AACxD,IAAO,OAAA,KAAA,CAAM,qBAAwC,CAAA,GAAG,GAAG,CAAA;AAAA;AAC5D,EAGA,IAA0B,GAAA;AACzB,IAAA,OAAO,cAAe,CAAA,IAAA;AAAA;AAGxB;AAGA,MAAM,QAAA,GAAW,IAAI,cAAe,EAAA;AACpC,IAAO,uBAAQ,GAAA","file":"event_callbacks.cjs","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceId, ResourcesConfig, ResourceRel, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve } from '../query'\n\nimport type { Webhook } from './webhooks'\n\n\ntype EventCallbackType = 'event_callbacks'\ntype EventCallbackRel = ResourceRel & { type: EventCallbackType }\n\n\nexport type EventCallbackSort = Pick<EventCallback, 'id' | 'response_code' | 'response_message'> & ResourceSort\n// export type EventCallbackFilter = Pick<EventCallback, 'id' | 'callback_url' | 'response_code' | 'response_message'> & ResourceFilter\n\n\ninterface EventCallback extends Resource {\n\t\n\treadonly type: EventCallbackType\n\n\t/** \n\t * The URI of the callback, inherited by the associated webhook.\n\t * @example ```\"https://yourapp.com/webhooks\"```\n\t */\n\tcallback_url: string\n\t/** \n\t * The payload sent to the callback endpoint, including the event affected resource and the specified includes.\n\t * @example ```{\"data\":{\"attributes\":{\"id\":\"PYWehaoXJj\",\"type\":\"orders\"}}}```\n\t */\n\tpayload?: Record<string, any> | null\n\t/** \n\t * The HTTP response code of the callback endpoint.\n\t * @example ```\"200\"```\n\t */\n\tresponse_code?: string | null\n\t/** \n\t * The HTTP response message of the callback endpoint.\n\t * @example ```\"OK\"```\n\t */\n\tresponse_message?: string | null\n\n\twebhook?: Webhook | null\n\n}\n\n\nclass EventCallbacks extends ApiResource<EventCallback> {\n\n\tstatic readonly TYPE: EventCallbackType = 'event_callbacks' as const\n\n\tasync webhook(eventCallbackId: string | EventCallback, params?: QueryParamsRetrieve<Webhook>, options?: ResourcesConfig): Promise<Webhook> {\n\t\tconst _eventCallbackId = (eventCallbackId as EventCallback).id || eventCallbackId as string\n\t\treturn this.resources.fetch<Webhook>({ type: 'webhooks' }, `event_callbacks/${_eventCallbackId}/webhook`, params, options) as unknown as Webhook\n\t}\n\n\n\tisEventCallback(resource: any): resource is EventCallback {\n\t\treturn resource.type && (resource.type === EventCallbacks.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): EventCallbackRel {\n\t\treturn super.relationshipOneToOne<EventCallbackRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): EventCallbackRel[] {\n\t\treturn super.relationshipOneToMany<EventCallbackRel>(...ids)\n\t}\n\n\n\ttype(): EventCallbackType {\n\t\treturn EventCallbacks.TYPE\n\t}\n\n}\n\n\nconst instance = new EventCallbacks()\nexport default instance\n\nexport type { EventCallback, EventCallbackType }\n"]}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
|
3
|
+
class EventCallbacks extends ApiResource {
|
4
|
+
static TYPE = "event_callbacks";
|
5
|
+
async webhook(eventCallbackId, params, options) {
|
6
|
+
const _eventCallbackId = eventCallbackId.id || eventCallbackId;
|
7
|
+
return this.resources.fetch({ type: "webhooks" }, `event_callbacks/${_eventCallbackId}/webhook`, params, options);
|
8
|
+
}
|
9
|
+
isEventCallback(resource) {
|
10
|
+
return resource.type && resource.type === EventCallbacks.TYPE;
|
11
|
+
}
|
12
|
+
relationship(id) {
|
13
|
+
return super.relationshipOneToOne(id);
|
14
|
+
}
|
15
|
+
relationshipToMany(...ids) {
|
16
|
+
return super.relationshipOneToMany(...ids);
|
17
|
+
}
|
18
|
+
type() {
|
19
|
+
return EventCallbacks.TYPE;
|
20
|
+
}
|
21
|
+
}
|
22
|
+
const instance = new EventCallbacks();
|
23
|
+
var event_callbacks_default = instance;
|
24
|
+
|
25
|
+
export { event_callbacks_default as default };
|
26
|
+
//# sourceMappingURL=event_callbacks.js.map
|
27
|
+
//# sourceMappingURL=event_callbacks.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../src/resources/event_callbacks.ts"],"names":[],"mappings":";;AA6CA,MAAM,uBAAuB,WAA2B,CAAA;AAAA,EAEvD,OAAgB,IAA0B,GAAA,iBAAA;AAAA,EAE1C,MAAM,OAAA,CAAQ,eAAyC,EAAA,MAAA,EAAuC,OAA6C,EAAA;AAC1I,IAAM,MAAA,gBAAA,GAAoB,gBAAkC,EAAM,IAAA,eAAA;AAClE,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAe,EAAE,IAAA,EAAM,UAAW,EAAA,EAAG,CAAmB,gBAAA,EAAA,gBAAgB,CAAY,QAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC1H,EAGA,gBAAgB,QAA0C,EAAA;AACzD,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,cAAe,CAAA,IAAA;AAAA;AAC3D,EAGA,aAAa,EAAkD,EAAA;AAC9D,IAAO,OAAA,KAAA,CAAM,qBAAuC,EAAE,CAAA;AAAA;AACvD,EAEA,sBAAsB,GAAmC,EAAA;AACxD,IAAO,OAAA,KAAA,CAAM,qBAAwC,CAAA,GAAG,GAAG,CAAA;AAAA;AAC5D,EAGA,IAA0B,GAAA;AACzB,IAAA,OAAO,cAAe,CAAA,IAAA;AAAA;AAGxB;AAGA,MAAM,QAAA,GAAW,IAAI,cAAe,EAAA;AACpC,IAAO,uBAAQ,GAAA","file":"event_callbacks.js","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceId, ResourcesConfig, ResourceRel, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve } from '../query'\n\nimport type { Webhook } from './webhooks'\n\n\ntype EventCallbackType = 'event_callbacks'\ntype EventCallbackRel = ResourceRel & { type: EventCallbackType }\n\n\nexport type EventCallbackSort = Pick<EventCallback, 'id' | 'response_code' | 'response_message'> & ResourceSort\n// export type EventCallbackFilter = Pick<EventCallback, 'id' | 'callback_url' | 'response_code' | 'response_message'> & ResourceFilter\n\n\ninterface EventCallback extends Resource {\n\t\n\treadonly type: EventCallbackType\n\n\t/** \n\t * The URI of the callback, inherited by the associated webhook.\n\t * @example ```\"https://yourapp.com/webhooks\"```\n\t */\n\tcallback_url: string\n\t/** \n\t * The payload sent to the callback endpoint, including the event affected resource and the specified includes.\n\t * @example ```{\"data\":{\"attributes\":{\"id\":\"PYWehaoXJj\",\"type\":\"orders\"}}}```\n\t */\n\tpayload?: Record<string, any> | null\n\t/** \n\t * The HTTP response code of the callback endpoint.\n\t * @example ```\"200\"```\n\t */\n\tresponse_code?: string | null\n\t/** \n\t * The HTTP response message of the callback endpoint.\n\t * @example ```\"OK\"```\n\t */\n\tresponse_message?: string | null\n\n\twebhook?: Webhook | null\n\n}\n\n\nclass EventCallbacks extends ApiResource<EventCallback> {\n\n\tstatic readonly TYPE: EventCallbackType = 'event_callbacks' as const\n\n\tasync webhook(eventCallbackId: string | EventCallback, params?: QueryParamsRetrieve<Webhook>, options?: ResourcesConfig): Promise<Webhook> {\n\t\tconst _eventCallbackId = (eventCallbackId as EventCallback).id || eventCallbackId as string\n\t\treturn this.resources.fetch<Webhook>({ type: 'webhooks' }, `event_callbacks/${_eventCallbackId}/webhook`, params, options) as unknown as Webhook\n\t}\n\n\n\tisEventCallback(resource: any): resource is EventCallback {\n\t\treturn resource.type && (resource.type === EventCallbacks.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): EventCallbackRel {\n\t\treturn super.relationshipOneToOne<EventCallbackRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): EventCallbackRel[] {\n\t\treturn super.relationshipOneToMany<EventCallbackRel>(...ids)\n\t}\n\n\n\ttype(): EventCallbackType {\n\t\treturn EventCallbacks.TYPE\n\t}\n\n}\n\n\nconst instance = new EventCallbacks()\nexport default instance\n\nexport type { EventCallback, EventCallbackType }\n"]}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var resource = require('../resource');
|
4
|
+
|
5
|
+
class Events extends resource.ApiResource {
|
6
|
+
static TYPE = "events";
|
7
|
+
async update(resource, params, options) {
|
8
|
+
return this.resources.update({ ...resource, type: Events.TYPE }, params, options);
|
9
|
+
}
|
10
|
+
async webhooks(eventId, params, options) {
|
11
|
+
const _eventId = eventId.id || eventId;
|
12
|
+
return this.resources.fetch({ type: "webhooks" }, `events/${_eventId}/webhooks`, params, options);
|
13
|
+
}
|
14
|
+
async last_event_callbacks(eventId, params, options) {
|
15
|
+
const _eventId = eventId.id || eventId;
|
16
|
+
return this.resources.fetch({ type: "event_callbacks" }, `events/${_eventId}/last_event_callbacks`, params, options);
|
17
|
+
}
|
18
|
+
async _trigger(id, params, options) {
|
19
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Events.TYPE, _trigger: true }, params, options);
|
20
|
+
}
|
21
|
+
isEvent(resource) {
|
22
|
+
return resource.type && resource.type === Events.TYPE;
|
23
|
+
}
|
24
|
+
relationship(id) {
|
25
|
+
return super.relationshipOneToOne(id);
|
26
|
+
}
|
27
|
+
relationshipToMany(...ids) {
|
28
|
+
return super.relationshipOneToMany(...ids);
|
29
|
+
}
|
30
|
+
type() {
|
31
|
+
return Events.TYPE;
|
32
|
+
}
|
33
|
+
}
|
34
|
+
const instance = new Events();
|
35
|
+
var events_default = instance;
|
36
|
+
|
37
|
+
module.exports = events_default;
|
38
|
+
//# sourceMappingURL=events.cjs.map
|
39
|
+
|
40
|
+
module.exports = exports.default;
|
41
|
+
//# sourceMappingURL=events.cjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../src/resources/events.ts"],"names":["ApiResource"],"mappings":";;;;AA2CA,MAAM,eAAeA,oBAAmB,CAAA;AAAA,EAEvC,OAAgB,IAAkB,GAAA,QAAA;AAAA,EAElC,MAAM,MAAA,CAAO,QAAuB,EAAA,MAAA,EAAqC,OAA2C,EAAA;AACnH,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA2B,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,MAAO,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACrG,EAEA,MAAM,QAAA,CAAS,OAAyB,EAAA,MAAA,EAAmC,OAA2D,EAAA;AACrI,IAAM,MAAA,QAAA,GAAY,QAAkB,EAAM,IAAA,OAAA;AAC1C,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAe,EAAE,IAAA,EAAM,UAAW,EAAA,EAAG,CAAU,OAAA,EAAA,QAAQ,CAAa,SAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC1G,EAEA,MAAM,oBAAA,CAAqB,OAAyB,EAAA,MAAA,EAAyC,OAAiE,EAAA;AAC7J,IAAM,MAAA,QAAA,GAAY,QAAkB,EAAM,IAAA,OAAA;AAC1C,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAqB,EAAE,IAAA,EAAM,iBAAkB,EAAA,EAAG,CAAU,OAAA,EAAA,QAAQ,CAAyB,qBAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACnI,EAEA,MAAM,QAAA,CAAS,EAAoB,EAAA,MAAA,EAAqC,OAA2C,EAAA;AAClH,IAAA,OAAO,KAAK,SAAU,CAAA,MAAA,CAA2B,EAAE,EAAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,MAAO,CAAA,IAAA,EAAM,UAAU,IAAK,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AACjJ,EAGA,QAAQ,QAAkC,EAAA;AACzC,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,MAAO,CAAA,IAAA;AAAA;AACnD,EAGA,aAAa,EAA0C,EAAA;AACtD,IAAO,OAAA,KAAA,CAAM,qBAA+B,EAAE,CAAA;AAAA;AAC/C,EAEA,sBAAsB,GAA2B,EAAA;AAChD,IAAO,OAAA,KAAA,CAAM,qBAAgC,CAAA,GAAG,GAAG,CAAA;AAAA;AACpD,EAGA,IAAkB,GAAA;AACjB,IAAA,OAAO,MAAO,CAAA,IAAA;AAAA;AAGhB;AAGA,MAAM,QAAA,GAAW,IAAI,MAAO,EAAA;AAC5B,IAAO,cAAQ,GAAA","file":"events.cjs","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Webhook } from './webhooks'\nimport type { EventCallback } from './event_callbacks'\n\n\ntype EventType = 'events'\ntype EventRel = ResourceRel & { type: EventType }\n\n\nexport type EventSort = Pick<Event, 'id' | 'name'> & ResourceSort\n// export type EventFilter = Pick<Event, 'id' | 'name'> & ResourceFilter\n\n\ninterface Event extends Resource {\n\t\n\treadonly type: EventType\n\n\t/** \n\t * The event's internal name.\n\t * @example ```\"orders.create\"```\n\t */\n\tname: string\n\n\twebhooks?: Webhook[] | null\n\tlast_event_callbacks?: EventCallback[] | null\n\n}\n\n\ninterface EventUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * Send this attribute if you want to force webhooks execution for this event. Cannot be passed by sales channels.\n\t * @example ```true```\n\t */\n\t_trigger?: boolean | null\n\t\n}\n\n\nclass Events extends ApiResource<Event> {\n\n\tstatic readonly TYPE: EventType = 'events' as const\n\n\tasync update(resource: EventUpdate, params?: QueryParamsRetrieve<Event>, options?: ResourcesConfig): Promise<Event> {\n\t\treturn this.resources.update<EventUpdate, Event>({ ...resource, type: Events.TYPE }, params, options)\n\t}\n\n\tasync webhooks(eventId: string | Event, params?: QueryParamsList<Webhook>, options?: ResourcesConfig): Promise<ListResponse<Webhook>> {\n\t\tconst _eventId = (eventId as Event).id || eventId as string\n\t\treturn this.resources.fetch<Webhook>({ type: 'webhooks' }, `events/${_eventId}/webhooks`, params, options) as unknown as ListResponse<Webhook>\n\t}\n\n\tasync last_event_callbacks(eventId: string | Event, params?: QueryParamsList<EventCallback>, options?: ResourcesConfig): Promise<ListResponse<EventCallback>> {\n\t\tconst _eventId = (eventId as Event).id || eventId as string\n\t\treturn this.resources.fetch<EventCallback>({ type: 'event_callbacks' }, `events/${_eventId}/last_event_callbacks`, params, options) as unknown as ListResponse<EventCallback>\n\t}\n\n\tasync _trigger(id: string | Event, params?: QueryParamsRetrieve<Event>, options?: ResourcesConfig): Promise<Event> {\n\t\treturn this.resources.update<EventUpdate, Event>({ id: (typeof id === 'string')? id: id.id, type: Events.TYPE, _trigger: true }, params, options)\n\t}\n\n\n\tisEvent(resource: any): resource is Event {\n\t\treturn resource.type && (resource.type === Events.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): EventRel {\n\t\treturn super.relationshipOneToOne<EventRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): EventRel[] {\n\t\treturn super.relationshipOneToMany<EventRel>(...ids)\n\t}\n\n\n\ttype(): EventType {\n\t\treturn Events.TYPE\n\t}\n\n}\n\n\nconst instance = new Events()\nexport default instance\n\nexport type { Event, EventUpdate, EventType }\n"]}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
|
3
|
+
class Events extends ApiResource {
|
4
|
+
static TYPE = "events";
|
5
|
+
async update(resource, params, options) {
|
6
|
+
return this.resources.update({ ...resource, type: Events.TYPE }, params, options);
|
7
|
+
}
|
8
|
+
async webhooks(eventId, params, options) {
|
9
|
+
const _eventId = eventId.id || eventId;
|
10
|
+
return this.resources.fetch({ type: "webhooks" }, `events/${_eventId}/webhooks`, params, options);
|
11
|
+
}
|
12
|
+
async last_event_callbacks(eventId, params, options) {
|
13
|
+
const _eventId = eventId.id || eventId;
|
14
|
+
return this.resources.fetch({ type: "event_callbacks" }, `events/${_eventId}/last_event_callbacks`, params, options);
|
15
|
+
}
|
16
|
+
async _trigger(id, params, options) {
|
17
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Events.TYPE, _trigger: true }, params, options);
|
18
|
+
}
|
19
|
+
isEvent(resource) {
|
20
|
+
return resource.type && resource.type === Events.TYPE;
|
21
|
+
}
|
22
|
+
relationship(id) {
|
23
|
+
return super.relationshipOneToOne(id);
|
24
|
+
}
|
25
|
+
relationshipToMany(...ids) {
|
26
|
+
return super.relationshipOneToMany(...ids);
|
27
|
+
}
|
28
|
+
type() {
|
29
|
+
return Events.TYPE;
|
30
|
+
}
|
31
|
+
}
|
32
|
+
const instance = new Events();
|
33
|
+
var events_default = instance;
|
34
|
+
|
35
|
+
export { events_default as default };
|
36
|
+
//# sourceMappingURL=events.js.map
|
37
|
+
//# sourceMappingURL=events.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../src/resources/events.ts"],"names":[],"mappings":";;AA2CA,MAAM,eAAe,WAAmB,CAAA;AAAA,EAEvC,OAAgB,IAAkB,GAAA,QAAA;AAAA,EAElC,MAAM,MAAA,CAAO,QAAuB,EAAA,MAAA,EAAqC,OAA2C,EAAA;AACnH,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA2B,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,MAAO,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACrG,EAEA,MAAM,QAAA,CAAS,OAAyB,EAAA,MAAA,EAAmC,OAA2D,EAAA;AACrI,IAAM,MAAA,QAAA,GAAY,QAAkB,EAAM,IAAA,OAAA;AAC1C,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAe,EAAE,IAAA,EAAM,UAAW,EAAA,EAAG,CAAU,OAAA,EAAA,QAAQ,CAAa,SAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC1G,EAEA,MAAM,oBAAA,CAAqB,OAAyB,EAAA,MAAA,EAAyC,OAAiE,EAAA;AAC7J,IAAM,MAAA,QAAA,GAAY,QAAkB,EAAM,IAAA,OAAA;AAC1C,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAqB,EAAE,IAAA,EAAM,iBAAkB,EAAA,EAAG,CAAU,OAAA,EAAA,QAAQ,CAAyB,qBAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACnI,EAEA,MAAM,QAAA,CAAS,EAAoB,EAAA,MAAA,EAAqC,OAA2C,EAAA;AAClH,IAAA,OAAO,KAAK,SAAU,CAAA,MAAA,CAA2B,EAAE,EAAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,MAAO,CAAA,IAAA,EAAM,UAAU,IAAK,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AACjJ,EAGA,QAAQ,QAAkC,EAAA;AACzC,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,MAAO,CAAA,IAAA;AAAA;AACnD,EAGA,aAAa,EAA0C,EAAA;AACtD,IAAO,OAAA,KAAA,CAAM,qBAA+B,EAAE,CAAA;AAAA;AAC/C,EAEA,sBAAsB,GAA2B,EAAA;AAChD,IAAO,OAAA,KAAA,CAAM,qBAAgC,CAAA,GAAG,GAAG,CAAA;AAAA;AACpD,EAGA,IAAkB,GAAA;AACjB,IAAA,OAAO,MAAO,CAAA,IAAA;AAAA;AAGhB;AAGA,MAAM,QAAA,GAAW,IAAI,MAAO,EAAA;AAC5B,IAAO,cAAQ,GAAA","file":"events.js","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Webhook } from './webhooks'\nimport type { EventCallback } from './event_callbacks'\n\n\ntype EventType = 'events'\ntype EventRel = ResourceRel & { type: EventType }\n\n\nexport type EventSort = Pick<Event, 'id' | 'name'> & ResourceSort\n// export type EventFilter = Pick<Event, 'id' | 'name'> & ResourceFilter\n\n\ninterface Event extends Resource {\n\t\n\treadonly type: EventType\n\n\t/** \n\t * The event's internal name.\n\t * @example ```\"orders.create\"```\n\t */\n\tname: string\n\n\twebhooks?: Webhook[] | null\n\tlast_event_callbacks?: EventCallback[] | null\n\n}\n\n\ninterface EventUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * Send this attribute if you want to force webhooks execution for this event. Cannot be passed by sales channels.\n\t * @example ```true```\n\t */\n\t_trigger?: boolean | null\n\t\n}\n\n\nclass Events extends ApiResource<Event> {\n\n\tstatic readonly TYPE: EventType = 'events' as const\n\n\tasync update(resource: EventUpdate, params?: QueryParamsRetrieve<Event>, options?: ResourcesConfig): Promise<Event> {\n\t\treturn this.resources.update<EventUpdate, Event>({ ...resource, type: Events.TYPE }, params, options)\n\t}\n\n\tasync webhooks(eventId: string | Event, params?: QueryParamsList<Webhook>, options?: ResourcesConfig): Promise<ListResponse<Webhook>> {\n\t\tconst _eventId = (eventId as Event).id || eventId as string\n\t\treturn this.resources.fetch<Webhook>({ type: 'webhooks' }, `events/${_eventId}/webhooks`, params, options) as unknown as ListResponse<Webhook>\n\t}\n\n\tasync last_event_callbacks(eventId: string | Event, params?: QueryParamsList<EventCallback>, options?: ResourcesConfig): Promise<ListResponse<EventCallback>> {\n\t\tconst _eventId = (eventId as Event).id || eventId as string\n\t\treturn this.resources.fetch<EventCallback>({ type: 'event_callbacks' }, `events/${_eventId}/last_event_callbacks`, params, options) as unknown as ListResponse<EventCallback>\n\t}\n\n\tasync _trigger(id: string | Event, params?: QueryParamsRetrieve<Event>, options?: ResourcesConfig): Promise<Event> {\n\t\treturn this.resources.update<EventUpdate, Event>({ id: (typeof id === 'string')? id: id.id, type: Events.TYPE, _trigger: true }, params, options)\n\t}\n\n\n\tisEvent(resource: any): resource is Event {\n\t\treturn resource.type && (resource.type === Events.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): EventRel {\n\t\treturn super.relationshipOneToOne<EventRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): EventRel[] {\n\t\treturn super.relationshipOneToMany<EventRel>(...ids)\n\t}\n\n\n\ttype(): EventType {\n\t\treturn Events.TYPE\n\t}\n\n}\n\n\nconst instance = new Events()\nexport default instance\n\nexport type { Event, EventUpdate, EventType }\n"]}
|
@@ -0,0 +1,47 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var resource = require('../resource');
|
4
|
+
|
5
|
+
class Exports extends resource.ApiResource {
|
6
|
+
static TYPE = "exports";
|
7
|
+
async create(resource, params, options) {
|
8
|
+
return this.resources.create({ ...resource, type: Exports.TYPE }, params, options);
|
9
|
+
}
|
10
|
+
async update(resource, params, options) {
|
11
|
+
return this.resources.update({ ...resource, type: Exports.TYPE }, params, options);
|
12
|
+
}
|
13
|
+
async delete(id, options) {
|
14
|
+
await this.resources.delete(typeof id === "string" ? { id, type: Exports.TYPE } : id, options);
|
15
|
+
}
|
16
|
+
async events(exportId, params, options) {
|
17
|
+
const _exportId = exportId.id || exportId;
|
18
|
+
return this.resources.fetch({ type: "events" }, `exports/${_exportId}/events`, params, options);
|
19
|
+
}
|
20
|
+
async versions(exportId, params, options) {
|
21
|
+
const _exportId = exportId.id || exportId;
|
22
|
+
return this.resources.fetch({ type: "versions" }, `exports/${_exportId}/versions`, params, options);
|
23
|
+
}
|
24
|
+
async _interrupt(id, params, options) {
|
25
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Exports.TYPE, _interrupt: true }, params, options);
|
26
|
+
}
|
27
|
+
isExport(resource) {
|
28
|
+
return resource.type && resource.type === Exports.TYPE;
|
29
|
+
}
|
30
|
+
relationship(id) {
|
31
|
+
return super.relationshipOneToOne(id);
|
32
|
+
}
|
33
|
+
relationshipToMany(...ids) {
|
34
|
+
return super.relationshipOneToMany(...ids);
|
35
|
+
}
|
36
|
+
type() {
|
37
|
+
return Exports.TYPE;
|
38
|
+
}
|
39
|
+
}
|
40
|
+
const instance = new Exports();
|
41
|
+
var exports_default = instance;
|
42
|
+
|
43
|
+
module.exports = exports_default;
|
44
|
+
//# sourceMappingURL=exports.cjs.map
|
45
|
+
|
46
|
+
module.exports = exports.default;
|
47
|
+
//# sourceMappingURL=exports.cjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../src/resources/exports.ts"],"names":["ApiResource"],"mappings":";;;;AAyIA,MAAM,gBAAgBA,oBAAoB,CAAA;AAAA,EAEzC,OAAgB,IAAmB,GAAA,SAAA;AAAA,EAEnC,MAAM,MAAA,CAAO,QAAwB,EAAA,MAAA,EAAsC,OAA4C,EAAA;AACtH,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA6B,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,OAAQ,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACxG,EAEA,MAAM,MAAA,CAAO,QAAwB,EAAA,MAAA,EAAsC,OAA4C,EAAA;AACtH,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA6B,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,OAAQ,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACxG,EAEA,MAAM,MAAO,CAAA,EAAA,EAAyB,OAA0C,EAAA;AAC/E,IAAA,MAAM,IAAK,CAAA,SAAA,CAAU,MAAQ,CAAA,OAAO,EAAO,KAAA,QAAA,GAAW,EAAE,EAAA,EAAI,IAAM,EAAA,OAAA,CAAQ,IAAK,EAAA,GAAI,IAAI,OAAO,CAAA;AAAA;AAC/F,EAEA,MAAM,MAAA,CAAO,QAA2B,EAAA,MAAA,EAAiC,OAAyD,EAAA;AACjI,IAAM,MAAA,SAAA,GAAa,SAAoB,EAAM,IAAA,QAAA;AAC7C,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAa,EAAE,IAAA,EAAM,QAAS,EAAA,EAAG,CAAW,QAAA,EAAA,SAAS,CAAW,OAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACtG,EAEA,MAAM,QAAA,CAAS,QAA2B,EAAA,MAAA,EAAmC,OAA2D,EAAA;AACvI,IAAM,MAAA,SAAA,GAAa,SAAoB,EAAM,IAAA,QAAA;AAC7C,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAe,EAAE,IAAA,EAAM,UAAW,EAAA,EAAG,CAAW,QAAA,EAAA,SAAS,CAAa,SAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC5G,EAEA,MAAM,UAAA,CAAW,EAAqB,EAAA,MAAA,EAAsC,OAA4C,EAAA;AACvH,IAAA,OAAO,KAAK,SAAU,CAAA,MAAA,CAA6B,EAAE,EAAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,OAAQ,CAAA,IAAA,EAAM,YAAY,IAAK,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AACtJ,EAGA,SAAS,QAAmC,EAAA;AAC3C,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,OAAQ,CAAA,IAAA;AAAA;AACpD,EAGA,aAAa,EAA2C,EAAA;AACvD,IAAO,OAAA,KAAA,CAAM,qBAAgC,EAAE,CAAA;AAAA;AAChD,EAEA,sBAAsB,GAA4B,EAAA;AACjD,IAAO,OAAA,KAAA,CAAM,qBAAiC,CAAA,GAAG,GAAG,CAAA;AAAA;AACrD,EAGA,IAAmB,GAAA;AAClB,IAAA,OAAO,OAAQ,CAAA,IAAA;AAAA;AAGjB;AAGA,MAAM,QAAA,GAAW,IAAI,OAAQ,EAAA;AAC7B,IAAO,eAAQ,GAAA","file":"exports.cjs","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Event } from './events'\nimport type { Version } from './versions'\n\n\ntype ExportType = 'exports'\ntype ExportRel = ResourceRel & { type: ExportType }\n\n\nexport type ExportSort = Pick<Export, 'id' | 'resource_type' | 'format' | 'status' | 'started_at' | 'completed_at' | 'interrupted_at' | 'records_count' | 'attachment_url'> & ResourceSort\n// export type ExportFilter = Pick<Export, 'id' | 'resource_type' | 'format' | 'status' | 'started_at' | 'completed_at' | 'interrupted_at' | 'records_count' | 'attachment_url' | 'errors_log'> & ResourceFilter\n\n\ninterface Export extends Resource {\n\t\n\treadonly type: ExportType\n\n\t/** \n\t * The type of resource being exported.\n\t * @example ```\"skus\"```\n\t */\n\tresource_type: string\n\t/** \n\t * The format of the export one of 'json' (default) or 'csv'.\n\t * @example ```\"json\"```\n\t */\n\tformat?: string | null\n\t/** \n\t * The export job status. One of 'pending' (default), 'in_progress', 'interrupted', or 'completed'.\n\t * @example ```\"in_progress\"```\n\t */\n\tstatus: 'pending' | 'in_progress' | 'interrupted' | 'completed'\n\t/** \n\t * List of related resources that should be included in the export (redundant when 'fields' are specified).\n\t * @example ```[\"prices.price_tiers\"]```\n\t */\n\tincludes?: string[] | null\n\t/** \n\t * List of fields to export for the main and related resources (automatically included). Pass the asterisk '*' to include all exportable fields for the main and related resources.\n\t * @example ```[\"code\",\"name\",\"prices.*\",\"prices.price_tiers.price_amount_cents\"]```\n\t */\n\tfields?: string[] | null\n\t/** \n\t * The filters used to select the records to be exported.\n\t * @example ```{\"code_eq\":\"AAA\"}```\n\t */\n\tfilters?: Record<string, any> | null\n\t/** \n\t * Send this attribute if you want to skip exporting redundant attributes (IDs, timestamps, blanks, etc.), useful when combining export and import to duplicate your dataset.\n\t */\n\tdry_data?: boolean | null\n\t/** \n\t * Time at which the export was started.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarted_at?: string | null\n\t/** \n\t * Time at which the export was completed.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tcompleted_at?: string | null\n\t/** \n\t * Time at which the export was interrupted.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tinterrupted_at?: string | null\n\t/** \n\t * Indicates the number of records to be exported.\n\t * @example ```300```\n\t */\n\trecords_count?: number | null\n\t/** \n\t * The URL to the output file, which will be generated upon export completion.\n\t * @example ```\"http://cl_exports.s3.amazonaws.com/\"```\n\t */\n\tattachment_url?: string | null\n\t/** \n\t * Contains the exports errors, if any.\n\t * @example ```{\"RuntimeError\":\"query timeout\"}```\n\t */\n\terrors_log?: Record<string, any> | null\n\n\tevents?: Event[] | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface ExportCreate extends ResourceCreate {\n\t\n\t/** \n\t * The type of resource being exported.\n\t * @example ```\"skus\"```\n\t */\n\tresource_type: string\n\t/** \n\t * The format of the export one of 'json' (default) or 'csv'.\n\t * @example ```\"json\"```\n\t */\n\tformat?: string | null\n\t/** \n\t * List of related resources that should be included in the export (redundant when 'fields' are specified).\n\t * @example ```[\"prices.price_tiers\"]```\n\t */\n\tincludes?: string[] | null\n\t/** \n\t * List of fields to export for the main and related resources (automatically included). Pass the asterisk '*' to include all exportable fields for the main and related resources.\n\t * @example ```[\"code\",\"name\",\"prices.*\",\"prices.price_tiers.price_amount_cents\"]```\n\t */\n\tfields?: string[] | null\n\t/** \n\t * The filters used to select the records to be exported.\n\t * @example ```{\"code_eq\":\"AAA\"}```\n\t */\n\tfilters?: Record<string, any> | null\n\t/** \n\t * Send this attribute if you want to skip exporting redundant attributes (IDs, timestamps, blanks, etc.), useful when combining export and import to duplicate your dataset.\n\t */\n\tdry_data?: boolean | null\n\t\n}\n\n\ninterface ExportUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * Send this attribute if you want to mark status as 'interrupted'.\n\t * @example ```true```\n\t */\n\t_interrupt?: boolean | null\n\t\n}\n\n\nclass Exports extends ApiResource<Export> {\n\n\tstatic readonly TYPE: ExportType = 'exports' as const\n\n\tasync create(resource: ExportCreate, params?: QueryParamsRetrieve<Export>, options?: ResourcesConfig): Promise<Export> {\n\t\treturn this.resources.create<ExportCreate, Export>({ ...resource, type: Exports.TYPE }, params, options)\n\t}\n\n\tasync update(resource: ExportUpdate, params?: QueryParamsRetrieve<Export>, options?: ResourcesConfig): Promise<Export> {\n\t\treturn this.resources.update<ExportUpdate, Export>({ ...resource, type: Exports.TYPE }, params, options)\n\t}\n\n\tasync delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void> {\n\t\tawait this.resources.delete((typeof id === 'string')? { id, type: Exports.TYPE } : id, options)\n\t}\n\n\tasync events(exportId: string | Export, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _exportId = (exportId as Export).id || exportId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `exports/${_exportId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync versions(exportId: string | Export, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _exportId = (exportId as Export).id || exportId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `exports/${_exportId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync _interrupt(id: string | Export, params?: QueryParamsRetrieve<Export>, options?: ResourcesConfig): Promise<Export> {\n\t\treturn this.resources.update<ExportUpdate, Export>({ id: (typeof id === 'string')? id: id.id, type: Exports.TYPE, _interrupt: true }, params, options)\n\t}\n\n\n\tisExport(resource: any): resource is Export {\n\t\treturn resource.type && (resource.type === Exports.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): ExportRel {\n\t\treturn super.relationshipOneToOne<ExportRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): ExportRel[] {\n\t\treturn super.relationshipOneToMany<ExportRel>(...ids)\n\t}\n\n\n\ttype(): ExportType {\n\t\treturn Exports.TYPE\n\t}\n\n}\n\n\nconst instance = new Exports()\nexport default instance\n\nexport type { Export, ExportCreate, ExportUpdate, ExportType }\n"]}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
|
3
|
+
class Exports extends ApiResource {
|
4
|
+
static TYPE = "exports";
|
5
|
+
async create(resource, params, options) {
|
6
|
+
return this.resources.create({ ...resource, type: Exports.TYPE }, params, options);
|
7
|
+
}
|
8
|
+
async update(resource, params, options) {
|
9
|
+
return this.resources.update({ ...resource, type: Exports.TYPE }, params, options);
|
10
|
+
}
|
11
|
+
async delete(id, options) {
|
12
|
+
await this.resources.delete(typeof id === "string" ? { id, type: Exports.TYPE } : id, options);
|
13
|
+
}
|
14
|
+
async events(exportId, params, options) {
|
15
|
+
const _exportId = exportId.id || exportId;
|
16
|
+
return this.resources.fetch({ type: "events" }, `exports/${_exportId}/events`, params, options);
|
17
|
+
}
|
18
|
+
async versions(exportId, params, options) {
|
19
|
+
const _exportId = exportId.id || exportId;
|
20
|
+
return this.resources.fetch({ type: "versions" }, `exports/${_exportId}/versions`, params, options);
|
21
|
+
}
|
22
|
+
async _interrupt(id, params, options) {
|
23
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Exports.TYPE, _interrupt: true }, params, options);
|
24
|
+
}
|
25
|
+
isExport(resource) {
|
26
|
+
return resource.type && resource.type === Exports.TYPE;
|
27
|
+
}
|
28
|
+
relationship(id) {
|
29
|
+
return super.relationshipOneToOne(id);
|
30
|
+
}
|
31
|
+
relationshipToMany(...ids) {
|
32
|
+
return super.relationshipOneToMany(...ids);
|
33
|
+
}
|
34
|
+
type() {
|
35
|
+
return Exports.TYPE;
|
36
|
+
}
|
37
|
+
}
|
38
|
+
const instance = new Exports();
|
39
|
+
var exports_default = instance;
|
40
|
+
|
41
|
+
export { exports_default as default };
|
42
|
+
//# sourceMappingURL=exports.js.map
|
43
|
+
//# sourceMappingURL=exports.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../src/resources/exports.ts"],"names":[],"mappings":";;AAyIA,MAAM,gBAAgB,WAAoB,CAAA;AAAA,EAEzC,OAAgB,IAAmB,GAAA,SAAA;AAAA,EAEnC,MAAM,MAAA,CAAO,QAAwB,EAAA,MAAA,EAAsC,OAA4C,EAAA;AACtH,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA6B,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,OAAQ,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACxG,EAEA,MAAM,MAAA,CAAO,QAAwB,EAAA,MAAA,EAAsC,OAA4C,EAAA;AACtH,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA6B,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,OAAQ,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACxG,EAEA,MAAM,MAAO,CAAA,EAAA,EAAyB,OAA0C,EAAA;AAC/E,IAAA,MAAM,IAAK,CAAA,SAAA,CAAU,MAAQ,CAAA,OAAO,EAAO,KAAA,QAAA,GAAW,EAAE,EAAA,EAAI,IAAM,EAAA,OAAA,CAAQ,IAAK,EAAA,GAAI,IAAI,OAAO,CAAA;AAAA;AAC/F,EAEA,MAAM,MAAA,CAAO,QAA2B,EAAA,MAAA,EAAiC,OAAyD,EAAA;AACjI,IAAM,MAAA,SAAA,GAAa,SAAoB,EAAM,IAAA,QAAA;AAC7C,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAa,EAAE,IAAA,EAAM,QAAS,EAAA,EAAG,CAAW,QAAA,EAAA,SAAS,CAAW,OAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACtG,EAEA,MAAM,QAAA,CAAS,QAA2B,EAAA,MAAA,EAAmC,OAA2D,EAAA;AACvI,IAAM,MAAA,SAAA,GAAa,SAAoB,EAAM,IAAA,QAAA;AAC7C,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAe,EAAE,IAAA,EAAM,UAAW,EAAA,EAAG,CAAW,QAAA,EAAA,SAAS,CAAa,SAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC5G,EAEA,MAAM,UAAA,CAAW,EAAqB,EAAA,MAAA,EAAsC,OAA4C,EAAA;AACvH,IAAA,OAAO,KAAK,SAAU,CAAA,MAAA,CAA6B,EAAE,EAAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,OAAQ,CAAA,IAAA,EAAM,YAAY,IAAK,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AACtJ,EAGA,SAAS,QAAmC,EAAA;AAC3C,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,OAAQ,CAAA,IAAA;AAAA;AACpD,EAGA,aAAa,EAA2C,EAAA;AACvD,IAAO,OAAA,KAAA,CAAM,qBAAgC,EAAE,CAAA;AAAA;AAChD,EAEA,sBAAsB,GAA4B,EAAA;AACjD,IAAO,OAAA,KAAA,CAAM,qBAAiC,CAAA,GAAG,GAAG,CAAA;AAAA;AACrD,EAGA,IAAmB,GAAA;AAClB,IAAA,OAAO,OAAQ,CAAA,IAAA;AAAA;AAGjB;AAGA,MAAM,QAAA,GAAW,IAAI,OAAQ,EAAA;AAC7B,IAAO,eAAQ,GAAA","file":"exports.js","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Event } from './events'\nimport type { Version } from './versions'\n\n\ntype ExportType = 'exports'\ntype ExportRel = ResourceRel & { type: ExportType }\n\n\nexport type ExportSort = Pick<Export, 'id' | 'resource_type' | 'format' | 'status' | 'started_at' | 'completed_at' | 'interrupted_at' | 'records_count' | 'attachment_url'> & ResourceSort\n// export type ExportFilter = Pick<Export, 'id' | 'resource_type' | 'format' | 'status' | 'started_at' | 'completed_at' | 'interrupted_at' | 'records_count' | 'attachment_url' | 'errors_log'> & ResourceFilter\n\n\ninterface Export extends Resource {\n\t\n\treadonly type: ExportType\n\n\t/** \n\t * The type of resource being exported.\n\t * @example ```\"skus\"```\n\t */\n\tresource_type: string\n\t/** \n\t * The format of the export one of 'json' (default) or 'csv'.\n\t * @example ```\"json\"```\n\t */\n\tformat?: string | null\n\t/** \n\t * The export job status. One of 'pending' (default), 'in_progress', 'interrupted', or 'completed'.\n\t * @example ```\"in_progress\"```\n\t */\n\tstatus: 'pending' | 'in_progress' | 'interrupted' | 'completed'\n\t/** \n\t * List of related resources that should be included in the export (redundant when 'fields' are specified).\n\t * @example ```[\"prices.price_tiers\"]```\n\t */\n\tincludes?: string[] | null\n\t/** \n\t * List of fields to export for the main and related resources (automatically included). Pass the asterisk '*' to include all exportable fields for the main and related resources.\n\t * @example ```[\"code\",\"name\",\"prices.*\",\"prices.price_tiers.price_amount_cents\"]```\n\t */\n\tfields?: string[] | null\n\t/** \n\t * The filters used to select the records to be exported.\n\t * @example ```{\"code_eq\":\"AAA\"}```\n\t */\n\tfilters?: Record<string, any> | null\n\t/** \n\t * Send this attribute if you want to skip exporting redundant attributes (IDs, timestamps, blanks, etc.), useful when combining export and import to duplicate your dataset.\n\t */\n\tdry_data?: boolean | null\n\t/** \n\t * Time at which the export was started.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarted_at?: string | null\n\t/** \n\t * Time at which the export was completed.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tcompleted_at?: string | null\n\t/** \n\t * Time at which the export was interrupted.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tinterrupted_at?: string | null\n\t/** \n\t * Indicates the number of records to be exported.\n\t * @example ```300```\n\t */\n\trecords_count?: number | null\n\t/** \n\t * The URL to the output file, which will be generated upon export completion.\n\t * @example ```\"http://cl_exports.s3.amazonaws.com/\"```\n\t */\n\tattachment_url?: string | null\n\t/** \n\t * Contains the exports errors, if any.\n\t * @example ```{\"RuntimeError\":\"query timeout\"}```\n\t */\n\terrors_log?: Record<string, any> | null\n\n\tevents?: Event[] | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface ExportCreate extends ResourceCreate {\n\t\n\t/** \n\t * The type of resource being exported.\n\t * @example ```\"skus\"```\n\t */\n\tresource_type: string\n\t/** \n\t * The format of the export one of 'json' (default) or 'csv'.\n\t * @example ```\"json\"```\n\t */\n\tformat?: string | null\n\t/** \n\t * List of related resources that should be included in the export (redundant when 'fields' are specified).\n\t * @example ```[\"prices.price_tiers\"]```\n\t */\n\tincludes?: string[] | null\n\t/** \n\t * List of fields to export for the main and related resources (automatically included). Pass the asterisk '*' to include all exportable fields for the main and related resources.\n\t * @example ```[\"code\",\"name\",\"prices.*\",\"prices.price_tiers.price_amount_cents\"]```\n\t */\n\tfields?: string[] | null\n\t/** \n\t * The filters used to select the records to be exported.\n\t * @example ```{\"code_eq\":\"AAA\"}```\n\t */\n\tfilters?: Record<string, any> | null\n\t/** \n\t * Send this attribute if you want to skip exporting redundant attributes (IDs, timestamps, blanks, etc.), useful when combining export and import to duplicate your dataset.\n\t */\n\tdry_data?: boolean | null\n\t\n}\n\n\ninterface ExportUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * Send this attribute if you want to mark status as 'interrupted'.\n\t * @example ```true```\n\t */\n\t_interrupt?: boolean | null\n\t\n}\n\n\nclass Exports extends ApiResource<Export> {\n\n\tstatic readonly TYPE: ExportType = 'exports' as const\n\n\tasync create(resource: ExportCreate, params?: QueryParamsRetrieve<Export>, options?: ResourcesConfig): Promise<Export> {\n\t\treturn this.resources.create<ExportCreate, Export>({ ...resource, type: Exports.TYPE }, params, options)\n\t}\n\n\tasync update(resource: ExportUpdate, params?: QueryParamsRetrieve<Export>, options?: ResourcesConfig): Promise<Export> {\n\t\treturn this.resources.update<ExportUpdate, Export>({ ...resource, type: Exports.TYPE }, params, options)\n\t}\n\n\tasync delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void> {\n\t\tawait this.resources.delete((typeof id === 'string')? { id, type: Exports.TYPE } : id, options)\n\t}\n\n\tasync events(exportId: string | Export, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _exportId = (exportId as Export).id || exportId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `exports/${_exportId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync versions(exportId: string | Export, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _exportId = (exportId as Export).id || exportId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `exports/${_exportId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync _interrupt(id: string | Export, params?: QueryParamsRetrieve<Export>, options?: ResourcesConfig): Promise<Export> {\n\t\treturn this.resources.update<ExportUpdate, Export>({ id: (typeof id === 'string')? id: id.id, type: Exports.TYPE, _interrupt: true }, params, options)\n\t}\n\n\n\tisExport(resource: any): resource is Export {\n\t\treturn resource.type && (resource.type === Exports.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): ExportRel {\n\t\treturn super.relationshipOneToOne<ExportRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): ExportRel[] {\n\t\treturn super.relationshipOneToMany<ExportRel>(...ids)\n\t}\n\n\n\ttype(): ExportType {\n\t\treturn Exports.TYPE\n\t}\n\n}\n\n\nconst instance = new Exports()\nexport default instance\n\nexport type { Export, ExportCreate, ExportUpdate, ExportType }\n"]}
|
@@ -0,0 +1,51 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var resource = require('../resource');
|
4
|
+
|
5
|
+
class ExternalGateways extends resource.ApiResource {
|
6
|
+
static TYPE = "external_gateways";
|
7
|
+
async create(resource, params, options) {
|
8
|
+
return this.resources.create({ ...resource, type: ExternalGateways.TYPE }, params, options);
|
9
|
+
}
|
10
|
+
async update(resource, params, options) {
|
11
|
+
return this.resources.update({ ...resource, type: ExternalGateways.TYPE }, params, options);
|
12
|
+
}
|
13
|
+
async delete(id, options) {
|
14
|
+
await this.resources.delete(typeof id === "string" ? { id, type: ExternalGateways.TYPE } : id, options);
|
15
|
+
}
|
16
|
+
async payment_methods(externalGatewayId, params, options) {
|
17
|
+
const _externalGatewayId = externalGatewayId.id || externalGatewayId;
|
18
|
+
return this.resources.fetch({ type: "payment_methods" }, `external_gateways/${_externalGatewayId}/payment_methods`, params, options);
|
19
|
+
}
|
20
|
+
async versions(externalGatewayId, params, options) {
|
21
|
+
const _externalGatewayId = externalGatewayId.id || externalGatewayId;
|
22
|
+
return this.resources.fetch({ type: "versions" }, `external_gateways/${_externalGatewayId}/versions`, params, options);
|
23
|
+
}
|
24
|
+
async external_payments(externalGatewayId, params, options) {
|
25
|
+
const _externalGatewayId = externalGatewayId.id || externalGatewayId;
|
26
|
+
return this.resources.fetch({ type: "external_payments" }, `external_gateways/${_externalGatewayId}/external_payments`, params, options);
|
27
|
+
}
|
28
|
+
async _reset_circuit(id, params, options) {
|
29
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: ExternalGateways.TYPE, _reset_circuit: true }, params, options);
|
30
|
+
}
|
31
|
+
isExternalGateway(resource) {
|
32
|
+
return resource.type && resource.type === ExternalGateways.TYPE;
|
33
|
+
}
|
34
|
+
relationship(id) {
|
35
|
+
return super.relationshipOneToOne(id);
|
36
|
+
}
|
37
|
+
relationshipToMany(...ids) {
|
38
|
+
return super.relationshipOneToMany(...ids);
|
39
|
+
}
|
40
|
+
type() {
|
41
|
+
return ExternalGateways.TYPE;
|
42
|
+
}
|
43
|
+
}
|
44
|
+
const instance = new ExternalGateways();
|
45
|
+
var external_gateways_default = instance;
|
46
|
+
|
47
|
+
module.exports = external_gateways_default;
|
48
|
+
//# sourceMappingURL=external_gateways.cjs.map
|
49
|
+
|
50
|
+
module.exports = exports.default;
|
51
|
+
//# sourceMappingURL=external_gateways.cjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../src/resources/external_gateways.ts"],"names":["ApiResource"],"mappings":"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","file":"external_gateways.cjs","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { PaymentMethod } from './payment_methods'\nimport type { Version } from './versions'\nimport type { ExternalPayment } from './external_payments'\n\n\ntype ExternalGatewayType = 'external_gateways'\ntype ExternalGatewayRel = ResourceRel & { type: ExternalGatewayType }\n\n\nexport type ExternalGatewaySort = Pick<ExternalGateway, 'id' | 'name' | 'circuit_state' | 'circuit_failure_count'> & ResourceSort\n// export type ExternalGatewayFilter = Pick<ExternalGateway, 'id' | 'name' | 'circuit_state' | 'circuit_failure_count'> & ResourceFilter\n\n\ninterface ExternalGateway extends Resource {\n\t\n\treadonly type: ExternalGatewayType\n\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname: string\n\t/** \n\t * The endpoint used by the external gateway to authorize payments.\n\t * @example ```\"https://external_gateway.com/authorize\"```\n\t */\n\tauthorize_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to capture payments.\n\t * @example ```\"https://external_gateway.com/capture\"```\n\t */\n\tcapture_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to void payments.\n\t * @example ```\"https://external_gateway.com/void\"```\n\t */\n\tvoid_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to refund payments.\n\t * @example ```\"https://external_gateway.com/refund\"```\n\t */\n\trefund_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to create a customer payment token.\n\t * @example ```\"https://external_gateway.com/token\"```\n\t */\n\ttoken_url?: string | null\n\t/** \n\t * The circuit breaker state, by default it is 'closed'. It can become 'open' once the number of consecutive failures overlaps the specified threshold, in such case no further calls to the failing callback are made.\n\t * @example ```\"closed\"```\n\t */\n\tcircuit_state?: string | null\n\t/** \n\t * The number of consecutive failures recorded by the circuit breaker associated to this resource, will be reset on first successful call to callback.\n\t * @example ```5```\n\t */\n\tcircuit_failure_count?: number | null\n\t/** \n\t * The shared secret used to sign the external request payload.\n\t * @example ```\"1c0994cc4e996e8c6ee56a2198f66f3c\"```\n\t */\n\tshared_secret: string\n\n\tpayment_methods?: PaymentMethod[] | null\n\tversions?: Version[] | null\n\texternal_payments?: ExternalPayment[] | null\n\n}\n\n\ninterface ExternalGatewayCreate extends ResourceCreate {\n\t\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname: string\n\t/** \n\t * The endpoint used by the external gateway to authorize payments.\n\t * @example ```\"https://external_gateway.com/authorize\"```\n\t */\n\tauthorize_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to capture payments.\n\t * @example ```\"https://external_gateway.com/capture\"```\n\t */\n\tcapture_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to void payments.\n\t * @example ```\"https://external_gateway.com/void\"```\n\t */\n\tvoid_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to refund payments.\n\t * @example ```\"https://external_gateway.com/refund\"```\n\t */\n\trefund_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to create a customer payment token.\n\t * @example ```\"https://external_gateway.com/token\"```\n\t */\n\ttoken_url?: string | null\n\t\n}\n\n\ninterface ExternalGatewayUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The endpoint used by the external gateway to authorize payments.\n\t * @example ```\"https://external_gateway.com/authorize\"```\n\t */\n\tauthorize_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to capture payments.\n\t * @example ```\"https://external_gateway.com/capture\"```\n\t */\n\tcapture_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to void payments.\n\t * @example ```\"https://external_gateway.com/void\"```\n\t */\n\tvoid_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to refund payments.\n\t * @example ```\"https://external_gateway.com/refund\"```\n\t */\n\trefund_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to create a customer payment token.\n\t * @example ```\"https://external_gateway.com/token\"```\n\t */\n\ttoken_url?: string | null\n\t/** \n\t * Send this attribute if you want to reset the circuit breaker associated to this resource to 'closed' state and zero failures count. Cannot be passed by sales channels.\n\t * @example ```true```\n\t */\n\t_reset_circuit?: boolean | null\n\t\n}\n\n\nclass ExternalGateways extends ApiResource<ExternalGateway> {\n\n\tstatic readonly TYPE: ExternalGatewayType = 'external_gateways' as const\n\n\tasync create(resource: ExternalGatewayCreate, params?: QueryParamsRetrieve<ExternalGateway>, options?: ResourcesConfig): Promise<ExternalGateway> {\n\t\treturn this.resources.create<ExternalGatewayCreate, ExternalGateway>({ ...resource, type: ExternalGateways.TYPE }, params, options)\n\t}\n\n\tasync update(resource: ExternalGatewayUpdate, params?: QueryParamsRetrieve<ExternalGateway>, options?: ResourcesConfig): Promise<ExternalGateway> {\n\t\treturn this.resources.update<ExternalGatewayUpdate, ExternalGateway>({ ...resource, type: ExternalGateways.TYPE }, params, options)\n\t}\n\n\tasync delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void> {\n\t\tawait this.resources.delete((typeof id === 'string')? { id, type: ExternalGateways.TYPE } : id, options)\n\t}\n\n\tasync payment_methods(externalGatewayId: string | ExternalGateway, params?: QueryParamsList<PaymentMethod>, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>> {\n\t\tconst _externalGatewayId = (externalGatewayId as ExternalGateway).id || externalGatewayId as string\n\t\treturn this.resources.fetch<PaymentMethod>({ type: 'payment_methods' }, `external_gateways/${_externalGatewayId}/payment_methods`, params, options) as unknown as ListResponse<PaymentMethod>\n\t}\n\n\tasync versions(externalGatewayId: string | ExternalGateway, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _externalGatewayId = (externalGatewayId as ExternalGateway).id || externalGatewayId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `external_gateways/${_externalGatewayId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync external_payments(externalGatewayId: string | ExternalGateway, params?: QueryParamsList<ExternalPayment>, options?: ResourcesConfig): Promise<ListResponse<ExternalPayment>> {\n\t\tconst _externalGatewayId = (externalGatewayId as ExternalGateway).id || externalGatewayId as string\n\t\treturn this.resources.fetch<ExternalPayment>({ type: 'external_payments' }, `external_gateways/${_externalGatewayId}/external_payments`, params, options) as unknown as ListResponse<ExternalPayment>\n\t}\n\n\tasync _reset_circuit(id: string | ExternalGateway, params?: QueryParamsRetrieve<ExternalGateway>, options?: ResourcesConfig): Promise<ExternalGateway> {\n\t\treturn this.resources.update<ExternalGatewayUpdate, ExternalGateway>({ id: (typeof id === 'string')? id: id.id, type: ExternalGateways.TYPE, _reset_circuit: true }, params, options)\n\t}\n\n\n\tisExternalGateway(resource: any): resource is ExternalGateway {\n\t\treturn resource.type && (resource.type === ExternalGateways.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): ExternalGatewayRel {\n\t\treturn super.relationshipOneToOne<ExternalGatewayRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): ExternalGatewayRel[] {\n\t\treturn super.relationshipOneToMany<ExternalGatewayRel>(...ids)\n\t}\n\n\n\ttype(): ExternalGatewayType {\n\t\treturn ExternalGateways.TYPE\n\t}\n\n}\n\n\nconst instance = new ExternalGateways()\nexport default instance\n\nexport type { ExternalGateway, ExternalGatewayCreate, ExternalGatewayUpdate, ExternalGatewayType }\n"]}
|
@@ -0,0 +1,4 @@
|
|
1
|
+
export { dY as ExternalGateway, dZ as ExternalGatewayCreate, d$ as ExternalGatewaySort, lf as ExternalGatewayType, d_ as ExternalGatewayUpdate, ak as default } from '../api-DmIZO_Np.cjs';
|
2
|
+
import '../client.cjs';
|
3
|
+
import '../interceptor-5MISI1yn.cjs';
|
4
|
+
import '../types.cjs';
|
@@ -0,0 +1,4 @@
|
|
1
|
+
export { dY as ExternalGateway, dZ as ExternalGatewayCreate, d$ as ExternalGatewaySort, lf as ExternalGatewayType, d_ as ExternalGatewayUpdate, ak as default } from '../api-DDgIE2i8.js';
|
2
|
+
import '../client.js';
|
3
|
+
import '../interceptor-5MISI1yn.js';
|
4
|
+
import '../types.js';
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
|
3
|
+
class ExternalGateways extends ApiResource {
|
4
|
+
static TYPE = "external_gateways";
|
5
|
+
async create(resource, params, options) {
|
6
|
+
return this.resources.create({ ...resource, type: ExternalGateways.TYPE }, params, options);
|
7
|
+
}
|
8
|
+
async update(resource, params, options) {
|
9
|
+
return this.resources.update({ ...resource, type: ExternalGateways.TYPE }, params, options);
|
10
|
+
}
|
11
|
+
async delete(id, options) {
|
12
|
+
await this.resources.delete(typeof id === "string" ? { id, type: ExternalGateways.TYPE } : id, options);
|
13
|
+
}
|
14
|
+
async payment_methods(externalGatewayId, params, options) {
|
15
|
+
const _externalGatewayId = externalGatewayId.id || externalGatewayId;
|
16
|
+
return this.resources.fetch({ type: "payment_methods" }, `external_gateways/${_externalGatewayId}/payment_methods`, params, options);
|
17
|
+
}
|
18
|
+
async versions(externalGatewayId, params, options) {
|
19
|
+
const _externalGatewayId = externalGatewayId.id || externalGatewayId;
|
20
|
+
return this.resources.fetch({ type: "versions" }, `external_gateways/${_externalGatewayId}/versions`, params, options);
|
21
|
+
}
|
22
|
+
async external_payments(externalGatewayId, params, options) {
|
23
|
+
const _externalGatewayId = externalGatewayId.id || externalGatewayId;
|
24
|
+
return this.resources.fetch({ type: "external_payments" }, `external_gateways/${_externalGatewayId}/external_payments`, params, options);
|
25
|
+
}
|
26
|
+
async _reset_circuit(id, params, options) {
|
27
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: ExternalGateways.TYPE, _reset_circuit: true }, params, options);
|
28
|
+
}
|
29
|
+
isExternalGateway(resource) {
|
30
|
+
return resource.type && resource.type === ExternalGateways.TYPE;
|
31
|
+
}
|
32
|
+
relationship(id) {
|
33
|
+
return super.relationshipOneToOne(id);
|
34
|
+
}
|
35
|
+
relationshipToMany(...ids) {
|
36
|
+
return super.relationshipOneToMany(...ids);
|
37
|
+
}
|
38
|
+
type() {
|
39
|
+
return ExternalGateways.TYPE;
|
40
|
+
}
|
41
|
+
}
|
42
|
+
const instance = new ExternalGateways();
|
43
|
+
var external_gateways_default = instance;
|
44
|
+
|
45
|
+
export { external_gateways_default as default };
|
46
|
+
//# sourceMappingURL=external_gateways.js.map
|
47
|
+
//# sourceMappingURL=external_gateways.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../src/resources/external_gateways.ts"],"names":[],"mappings":"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","file":"external_gateways.js","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { PaymentMethod } from './payment_methods'\nimport type { Version } from './versions'\nimport type { ExternalPayment } from './external_payments'\n\n\ntype ExternalGatewayType = 'external_gateways'\ntype ExternalGatewayRel = ResourceRel & { type: ExternalGatewayType }\n\n\nexport type ExternalGatewaySort = Pick<ExternalGateway, 'id' | 'name' | 'circuit_state' | 'circuit_failure_count'> & ResourceSort\n// export type ExternalGatewayFilter = Pick<ExternalGateway, 'id' | 'name' | 'circuit_state' | 'circuit_failure_count'> & ResourceFilter\n\n\ninterface ExternalGateway extends Resource {\n\t\n\treadonly type: ExternalGatewayType\n\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname: string\n\t/** \n\t * The endpoint used by the external gateway to authorize payments.\n\t * @example ```\"https://external_gateway.com/authorize\"```\n\t */\n\tauthorize_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to capture payments.\n\t * @example ```\"https://external_gateway.com/capture\"```\n\t */\n\tcapture_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to void payments.\n\t * @example ```\"https://external_gateway.com/void\"```\n\t */\n\tvoid_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to refund payments.\n\t * @example ```\"https://external_gateway.com/refund\"```\n\t */\n\trefund_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to create a customer payment token.\n\t * @example ```\"https://external_gateway.com/token\"```\n\t */\n\ttoken_url?: string | null\n\t/** \n\t * The circuit breaker state, by default it is 'closed'. It can become 'open' once the number of consecutive failures overlaps the specified threshold, in such case no further calls to the failing callback are made.\n\t * @example ```\"closed\"```\n\t */\n\tcircuit_state?: string | null\n\t/** \n\t * The number of consecutive failures recorded by the circuit breaker associated to this resource, will be reset on first successful call to callback.\n\t * @example ```5```\n\t */\n\tcircuit_failure_count?: number | null\n\t/** \n\t * The shared secret used to sign the external request payload.\n\t * @example ```\"1c0994cc4e996e8c6ee56a2198f66f3c\"```\n\t */\n\tshared_secret: string\n\n\tpayment_methods?: PaymentMethod[] | null\n\tversions?: Version[] | null\n\texternal_payments?: ExternalPayment[] | null\n\n}\n\n\ninterface ExternalGatewayCreate extends ResourceCreate {\n\t\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname: string\n\t/** \n\t * The endpoint used by the external gateway to authorize payments.\n\t * @example ```\"https://external_gateway.com/authorize\"```\n\t */\n\tauthorize_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to capture payments.\n\t * @example ```\"https://external_gateway.com/capture\"```\n\t */\n\tcapture_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to void payments.\n\t * @example ```\"https://external_gateway.com/void\"```\n\t */\n\tvoid_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to refund payments.\n\t * @example ```\"https://external_gateway.com/refund\"```\n\t */\n\trefund_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to create a customer payment token.\n\t * @example ```\"https://external_gateway.com/token\"```\n\t */\n\ttoken_url?: string | null\n\t\n}\n\n\ninterface ExternalGatewayUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The endpoint used by the external gateway to authorize payments.\n\t * @example ```\"https://external_gateway.com/authorize\"```\n\t */\n\tauthorize_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to capture payments.\n\t * @example ```\"https://external_gateway.com/capture\"```\n\t */\n\tcapture_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to void payments.\n\t * @example ```\"https://external_gateway.com/void\"```\n\t */\n\tvoid_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to refund payments.\n\t * @example ```\"https://external_gateway.com/refund\"```\n\t */\n\trefund_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to create a customer payment token.\n\t * @example ```\"https://external_gateway.com/token\"```\n\t */\n\ttoken_url?: string | null\n\t/** \n\t * Send this attribute if you want to reset the circuit breaker associated to this resource to 'closed' state and zero failures count. Cannot be passed by sales channels.\n\t * @example ```true```\n\t */\n\t_reset_circuit?: boolean | null\n\t\n}\n\n\nclass ExternalGateways extends ApiResource<ExternalGateway> {\n\n\tstatic readonly TYPE: ExternalGatewayType = 'external_gateways' as const\n\n\tasync create(resource: ExternalGatewayCreate, params?: QueryParamsRetrieve<ExternalGateway>, options?: ResourcesConfig): Promise<ExternalGateway> {\n\t\treturn this.resources.create<ExternalGatewayCreate, ExternalGateway>({ ...resource, type: ExternalGateways.TYPE }, params, options)\n\t}\n\n\tasync update(resource: ExternalGatewayUpdate, params?: QueryParamsRetrieve<ExternalGateway>, options?: ResourcesConfig): Promise<ExternalGateway> {\n\t\treturn this.resources.update<ExternalGatewayUpdate, ExternalGateway>({ ...resource, type: ExternalGateways.TYPE }, params, options)\n\t}\n\n\tasync delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void> {\n\t\tawait this.resources.delete((typeof id === 'string')? { id, type: ExternalGateways.TYPE } : id, options)\n\t}\n\n\tasync payment_methods(externalGatewayId: string | ExternalGateway, params?: QueryParamsList<PaymentMethod>, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>> {\n\t\tconst _externalGatewayId = (externalGatewayId as ExternalGateway).id || externalGatewayId as string\n\t\treturn this.resources.fetch<PaymentMethod>({ type: 'payment_methods' }, `external_gateways/${_externalGatewayId}/payment_methods`, params, options) as unknown as ListResponse<PaymentMethod>\n\t}\n\n\tasync versions(externalGatewayId: string | ExternalGateway, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _externalGatewayId = (externalGatewayId as ExternalGateway).id || externalGatewayId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `external_gateways/${_externalGatewayId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync external_payments(externalGatewayId: string | ExternalGateway, params?: QueryParamsList<ExternalPayment>, options?: ResourcesConfig): Promise<ListResponse<ExternalPayment>> {\n\t\tconst _externalGatewayId = (externalGatewayId as ExternalGateway).id || externalGatewayId as string\n\t\treturn this.resources.fetch<ExternalPayment>({ type: 'external_payments' }, `external_gateways/${_externalGatewayId}/external_payments`, params, options) as unknown as ListResponse<ExternalPayment>\n\t}\n\n\tasync _reset_circuit(id: string | ExternalGateway, params?: QueryParamsRetrieve<ExternalGateway>, options?: ResourcesConfig): Promise<ExternalGateway> {\n\t\treturn this.resources.update<ExternalGatewayUpdate, ExternalGateway>({ id: (typeof id === 'string')? id: id.id, type: ExternalGateways.TYPE, _reset_circuit: true }, params, options)\n\t}\n\n\n\tisExternalGateway(resource: any): resource is ExternalGateway {\n\t\treturn resource.type && (resource.type === ExternalGateways.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): ExternalGatewayRel {\n\t\treturn super.relationshipOneToOne<ExternalGatewayRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): ExternalGatewayRel[] {\n\t\treturn super.relationshipOneToMany<ExternalGatewayRel>(...ids)\n\t}\n\n\n\ttype(): ExternalGatewayType {\n\t\treturn ExternalGateways.TYPE\n\t}\n\n}\n\n\nconst instance = new ExternalGateways()\nexport default instance\n\nexport type { ExternalGateway, ExternalGatewayCreate, ExternalGatewayUpdate, ExternalGatewayType }\n"]}
|