@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,4 @@
|
|
1
|
+
export { gQ as PriceVolumeTier, gR as PriceVolumeTierCreate, gT as PriceVolumeTierSort, kN as PriceVolumeTierType, gS as PriceVolumeTierUpdate, b5 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 { gQ as PriceVolumeTier, gR as PriceVolumeTierCreate, gT as PriceVolumeTierSort, kN as PriceVolumeTierType, gS as PriceVolumeTierUpdate, b5 as default } from '../api-DDgIE2i8.js';
|
2
|
+
import '../client.js';
|
3
|
+
import '../interceptor-5MISI1yn.js';
|
4
|
+
import '../types.js';
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
|
3
|
+
class PriceVolumeTiers extends ApiResource {
|
4
|
+
static TYPE = "price_volume_tiers";
|
5
|
+
async create(resource, params, options) {
|
6
|
+
return this.resources.create({ ...resource, type: PriceVolumeTiers.TYPE }, params, options);
|
7
|
+
}
|
8
|
+
async update(resource, params, options) {
|
9
|
+
return this.resources.update({ ...resource, type: PriceVolumeTiers.TYPE }, params, options);
|
10
|
+
}
|
11
|
+
async delete(id, options) {
|
12
|
+
await this.resources.delete(typeof id === "string" ? { id, type: PriceVolumeTiers.TYPE } : id, options);
|
13
|
+
}
|
14
|
+
async price(priceVolumeTierId, params, options) {
|
15
|
+
const _priceVolumeTierId = priceVolumeTierId.id || priceVolumeTierId;
|
16
|
+
return this.resources.fetch({ type: "prices" }, `price_volume_tiers/${_priceVolumeTierId}/price`, params, options);
|
17
|
+
}
|
18
|
+
async attachments(priceVolumeTierId, params, options) {
|
19
|
+
const _priceVolumeTierId = priceVolumeTierId.id || priceVolumeTierId;
|
20
|
+
return this.resources.fetch({ type: "attachments" }, `price_volume_tiers/${_priceVolumeTierId}/attachments`, params, options);
|
21
|
+
}
|
22
|
+
async versions(priceVolumeTierId, params, options) {
|
23
|
+
const _priceVolumeTierId = priceVolumeTierId.id || priceVolumeTierId;
|
24
|
+
return this.resources.fetch({ type: "versions" }, `price_volume_tiers/${_priceVolumeTierId}/versions`, params, options);
|
25
|
+
}
|
26
|
+
async events(priceVolumeTierId, params, options) {
|
27
|
+
const _priceVolumeTierId = priceVolumeTierId.id || priceVolumeTierId;
|
28
|
+
return this.resources.fetch({ type: "events" }, `price_volume_tiers/${_priceVolumeTierId}/events`, params, options);
|
29
|
+
}
|
30
|
+
isPriceVolumeTier(resource) {
|
31
|
+
return resource.type && resource.type === PriceVolumeTiers.TYPE;
|
32
|
+
}
|
33
|
+
relationship(id) {
|
34
|
+
return super.relationshipOneToOne(id);
|
35
|
+
}
|
36
|
+
relationshipToMany(...ids) {
|
37
|
+
return super.relationshipOneToMany(...ids);
|
38
|
+
}
|
39
|
+
type() {
|
40
|
+
return PriceVolumeTiers.TYPE;
|
41
|
+
}
|
42
|
+
}
|
43
|
+
const instance = new PriceVolumeTiers();
|
44
|
+
var price_volume_tiers_default = instance;
|
45
|
+
|
46
|
+
export { price_volume_tiers_default as default };
|
47
|
+
//# sourceMappingURL=price_volume_tiers.js.map
|
48
|
+
//# sourceMappingURL=price_volume_tiers.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../src/resources/price_volume_tiers.ts"],"names":[],"mappings":";;AAuGA,MAAM,yBAAyB,WAA6B,CAAA;AAAA,EAE3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{ Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Price, PriceType } from './prices'\nimport type { Attachment } from './attachments'\nimport type { Version } from './versions'\nimport type { Event } from './events'\n\n\ntype PriceVolumeTierType = 'price_volume_tiers'\ntype PriceVolumeTierRel = ResourceRel & { type: PriceVolumeTierType }\ntype PriceRel = ResourceRel & { type: PriceType }\n\n\nexport type PriceVolumeTierSort = Pick<PriceVolumeTier, 'id' | 'name' | 'up_to' | 'price_amount_cents'> & ResourceSort\n// export type PriceVolumeTierFilter = Pick<PriceVolumeTier, 'id' | 'name' | 'up_to' | 'price_amount_cents'> & ResourceFilter\n\n\ninterface PriceVolumeTier extends Resource {\n\t\n\treadonly type: PriceVolumeTierType\n\n\t/** \n\t * The price tier's name.\n\t * @example ```\"six pack\"```\n\t */\n\tname: string\n\t/** \n\t * The tier upper limit, expressed as the line item quantity. When 'null' it means infinity (useful to have an always matching tier).\n\t * @example ```15```\n\t */\n\tup_to?: number | null\n\t/** \n\t * The price of this price tier, in cents.\n\t * @example ```1000```\n\t */\n\tprice_amount_cents: number\n\t/** \n\t * The price of this price tier, float.\n\t * @example ```10```\n\t */\n\tprice_amount_float?: number | null\n\t/** \n\t * The price of this price tier, formatted.\n\t * @example ```\"€10,00\"```\n\t */\n\tformatted_price_amount?: string | null\n\n\tprice?: Price | null\n\tattachments?: Attachment[] | null\n\tversions?: Version[] | null\n\tevents?: Event[] | null\n\n}\n\n\ninterface PriceVolumeTierCreate extends ResourceCreate {\n\t\n\t/** \n\t * The price tier's name.\n\t * @example ```\"six pack\"```\n\t */\n\tname: string\n\t/** \n\t * The tier upper limit, expressed as the line item quantity. When 'null' it means infinity (useful to have an always matching tier).\n\t * @example ```15```\n\t */\n\tup_to?: number | null\n\t/** \n\t * The price of this price tier, in cents.\n\t * @example ```1000```\n\t */\n\tprice_amount_cents: number\n\n\tprice: PriceRel\n\n}\n\n\ninterface PriceVolumeTierUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The price tier's name.\n\t * @example ```\"six pack\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The tier upper limit, expressed as the line item quantity. When 'null' it means infinity (useful to have an always matching tier).\n\t * @example ```15```\n\t */\n\tup_to?: number | null\n\t/** \n\t * The price of this price tier, in cents.\n\t * @example ```1000```\n\t */\n\tprice_amount_cents?: number | null\n\n\tprice?: PriceRel | null\n\n}\n\n\nclass PriceVolumeTiers extends ApiResource<PriceVolumeTier> {\n\n\tstatic readonly TYPE: PriceVolumeTierType = 'price_volume_tiers' as const\n\n\tasync create(resource: PriceVolumeTierCreate, params?: QueryParamsRetrieve<PriceVolumeTier>, options?: ResourcesConfig): Promise<PriceVolumeTier> {\n\t\treturn this.resources.create<PriceVolumeTierCreate, PriceVolumeTier>({ ...resource, type: PriceVolumeTiers.TYPE }, params, options)\n\t}\n\n\tasync update(resource: PriceVolumeTierUpdate, params?: QueryParamsRetrieve<PriceVolumeTier>, options?: ResourcesConfig): Promise<PriceVolumeTier> {\n\t\treturn this.resources.update<PriceVolumeTierUpdate, PriceVolumeTier>({ ...resource, type: PriceVolumeTiers.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: PriceVolumeTiers.TYPE } : id, options)\n\t}\n\n\tasync price(priceVolumeTierId: string | PriceVolumeTier, params?: QueryParamsRetrieve<Price>, options?: ResourcesConfig): Promise<Price> {\n\t\tconst _priceVolumeTierId = (priceVolumeTierId as PriceVolumeTier).id || priceVolumeTierId as string\n\t\treturn this.resources.fetch<Price>({ type: 'prices' }, `price_volume_tiers/${_priceVolumeTierId}/price`, params, options) as unknown as Price\n\t}\n\n\tasync attachments(priceVolumeTierId: string | PriceVolumeTier, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _priceVolumeTierId = (priceVolumeTierId as PriceVolumeTier).id || priceVolumeTierId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `price_volume_tiers/${_priceVolumeTierId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync versions(priceVolumeTierId: string | PriceVolumeTier, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _priceVolumeTierId = (priceVolumeTierId as PriceVolumeTier).id || priceVolumeTierId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `price_volume_tiers/${_priceVolumeTierId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync events(priceVolumeTierId: string | PriceVolumeTier, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _priceVolumeTierId = (priceVolumeTierId as PriceVolumeTier).id || priceVolumeTierId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `price_volume_tiers/${_priceVolumeTierId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\n\tisPriceVolumeTier(resource: any): resource is PriceVolumeTier {\n\t\treturn resource.type && (resource.type === PriceVolumeTiers.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): PriceVolumeTierRel {\n\t\treturn super.relationshipOneToOne<PriceVolumeTierRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): PriceVolumeTierRel[] {\n\t\treturn super.relationshipOneToMany<PriceVolumeTierRel>(...ids)\n\t}\n\n\n\ttype(): PriceVolumeTierType {\n\t\treturn PriceVolumeTiers.TYPE\n\t}\n\n}\n\n\nconst instance = new PriceVolumeTiers()\nexport default instance\n\nexport type { PriceVolumeTier, PriceVolumeTierCreate, PriceVolumeTierUpdate, PriceVolumeTierType }\n"]}
|
@@ -0,0 +1,76 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var resource = require('../resource');
|
4
|
+
|
5
|
+
class Prices extends resource.ApiResource {
|
6
|
+
static TYPE = "prices";
|
7
|
+
async create(resource, params, options) {
|
8
|
+
return this.resources.create({ ...resource, type: Prices.TYPE }, params, options);
|
9
|
+
}
|
10
|
+
async update(resource, params, options) {
|
11
|
+
return this.resources.update({ ...resource, type: Prices.TYPE }, params, options);
|
12
|
+
}
|
13
|
+
async delete(id, options) {
|
14
|
+
await this.resources.delete(typeof id === "string" ? { id, type: Prices.TYPE } : id, options);
|
15
|
+
}
|
16
|
+
async price_list(priceId, params, options) {
|
17
|
+
const _priceId = priceId.id || priceId;
|
18
|
+
return this.resources.fetch({ type: "price_lists" }, `prices/${_priceId}/price_list`, params, options);
|
19
|
+
}
|
20
|
+
async sku(priceId, params, options) {
|
21
|
+
const _priceId = priceId.id || priceId;
|
22
|
+
return this.resources.fetch({ type: "skus" }, `prices/${_priceId}/sku`, params, options);
|
23
|
+
}
|
24
|
+
async price_tiers(priceId, params, options) {
|
25
|
+
const _priceId = priceId.id || priceId;
|
26
|
+
return this.resources.fetch({ type: "price_tiers" }, `prices/${_priceId}/price_tiers`, params, options);
|
27
|
+
}
|
28
|
+
async price_volume_tiers(priceId, params, options) {
|
29
|
+
const _priceId = priceId.id || priceId;
|
30
|
+
return this.resources.fetch({ type: "price_volume_tiers" }, `prices/${_priceId}/price_volume_tiers`, params, options);
|
31
|
+
}
|
32
|
+
async price_frequency_tiers(priceId, params, options) {
|
33
|
+
const _priceId = priceId.id || priceId;
|
34
|
+
return this.resources.fetch({ type: "price_frequency_tiers" }, `prices/${_priceId}/price_frequency_tiers`, params, options);
|
35
|
+
}
|
36
|
+
async attachments(priceId, params, options) {
|
37
|
+
const _priceId = priceId.id || priceId;
|
38
|
+
return this.resources.fetch({ type: "attachments" }, `prices/${_priceId}/attachments`, params, options);
|
39
|
+
}
|
40
|
+
async versions(priceId, params, options) {
|
41
|
+
const _priceId = priceId.id || priceId;
|
42
|
+
return this.resources.fetch({ type: "versions" }, `prices/${_priceId}/versions`, params, options);
|
43
|
+
}
|
44
|
+
async jwt_customer(priceId, params, options) {
|
45
|
+
const _priceId = priceId.id || priceId;
|
46
|
+
return this.resources.fetch({ type: "customers" }, `prices/${_priceId}/jwt_customer`, params, options);
|
47
|
+
}
|
48
|
+
async jwt_markets(priceId, params, options) {
|
49
|
+
const _priceId = priceId.id || priceId;
|
50
|
+
return this.resources.fetch({ type: "markets" }, `prices/${_priceId}/jwt_markets`, params, options);
|
51
|
+
}
|
52
|
+
async jwt_stock_locations(priceId, params, options) {
|
53
|
+
const _priceId = priceId.id || priceId;
|
54
|
+
return this.resources.fetch({ type: "stock_locations" }, `prices/${_priceId}/jwt_stock_locations`, params, options);
|
55
|
+
}
|
56
|
+
isPrice(resource) {
|
57
|
+
return resource.type && resource.type === Prices.TYPE;
|
58
|
+
}
|
59
|
+
relationship(id) {
|
60
|
+
return super.relationshipOneToOne(id);
|
61
|
+
}
|
62
|
+
relationshipToMany(...ids) {
|
63
|
+
return super.relationshipOneToMany(...ids);
|
64
|
+
}
|
65
|
+
type() {
|
66
|
+
return Prices.TYPE;
|
67
|
+
}
|
68
|
+
}
|
69
|
+
const instance = new Prices();
|
70
|
+
var prices_default = instance;
|
71
|
+
|
72
|
+
module.exports = prices_default;
|
73
|
+
//# sourceMappingURL=prices.cjs.map
|
74
|
+
|
75
|
+
module.exports = exports.default;
|
76
|
+
//# sourceMappingURL=prices.cjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../src/resources/prices.ts"],"names":["ApiResource"],"mappings":";;;;AA0LA,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;AAC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AsB,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":"prices.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 { PriceList, PriceListType } from './price_lists'\nimport type { Sku, SkuType } from './skus'\nimport type { PriceTier, PriceTierType } from './price_tiers'\nimport type { PriceVolumeTier } from './price_volume_tiers'\nimport type { PriceFrequencyTier } from './price_frequency_tiers'\nimport type { Attachment } from './attachments'\nimport type { Version } from './versions'\nimport type { Customer } from './customers'\nimport type { Market } from './markets'\nimport type { StockLocation } from './stock_locations'\n\n\ntype PriceType = 'prices'\ntype PriceRel = ResourceRel & { type: PriceType }\ntype PriceListRel = ResourceRel & { type: PriceListType }\ntype SkuRel = ResourceRel & { type: SkuType }\ntype PriceTierRel = ResourceRel & { type: PriceTierType }\n\n\nexport type PriceSort = Pick<Price, 'id' | 'currency_code' | 'amount_cents' | 'compare_at_amount_cents'> & ResourceSort\n// export type PriceFilter = Pick<Price, 'id' | 'currency_code' | 'amount_cents' | 'compare_at_amount_cents' | 'rules'> & ResourceFilter\n\n\ninterface Price extends Resource {\n\t\n\treadonly type: PriceType\n\n\t/** \n\t * The international 3-letter currency code as defined by the ISO 4217 standard, inherited from the associated price list.\n\t * @example ```\"EUR\"```\n\t */\n\tcurrency_code?: string | null\n\t/** \n\t * The code of the associated SKU. When creating a price, either a valid sku_code or a SKU relationship must be present.\n\t * @example ```\"TSHIRTMM000000FFFFFFXLXX\"```\n\t */\n\tsku_code?: string | null\n\t/** \n\t * The SKU price amount for the associated price list, in cents.\n\t * @example ```10000```\n\t */\n\tamount_cents: number\n\t/** \n\t * The SKU price amount for the associated price list, float.\n\t * @example ```100```\n\t */\n\tamount_float?: number | null\n\t/** \n\t * The SKU price amount for the associated price list, formatted.\n\t * @example ```\"€100,00\"```\n\t */\n\tformatted_amount?: string | null\n\t/** \n\t * The SKU price amount for the associated price list, in cents before any applied rule.\n\t * @example ```10000```\n\t */\n\toriginal_amount_cents?: number | null\n\t/** \n\t * The SKU price amount for the associated price list, in cents before any applied rule, formatted.\n\t * @example ```\"€100,00\"```\n\t */\n\tformatted_original_amount?: string | null\n\t/** \n\t * The compared price amount, in cents. Useful to display a percentage discount.\n\t * @example ```13000```\n\t */\n\tcompare_at_amount_cents?: number | null\n\t/** \n\t * The compared price amount, float.\n\t * @example ```130```\n\t */\n\tcompare_at_amount_float?: number | null\n\t/** \n\t * The compared price amount, formatted.\n\t * @example ```\"€130,00\"```\n\t */\n\tformatted_compare_at_amount?: string | null\n\t/** \n\t * Time at which the resource was processed by API.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tprocessed_at?: string | null\n\t/** \n\t * The rules (using Rules Engine) to be applied.\n\t * @example ```{}```\n\t */\n\trules?: Record<string, any> | null\n\t/** \n\t * The rule outcomes.\n\t * @example ```{}```\n\t */\n\trule_outcomes?: Record<string, any> | null\n\t/** \n\t * The payload used to evaluate the rules.\n\t * @example ```{}```\n\t */\n\tresource_payload?: Record<string, any> | null\n\t/** \n\t * The custom_claim attached to the current JWT (if any).\n\t * @example ```{}```\n\t */\n\tjwt_custom_claim?: Record<string, any> | null\n\n\tprice_list?: PriceList | null\n\tsku?: Sku | null\n\tprice_tiers?: PriceTier[] | null\n\tprice_volume_tiers?: PriceVolumeTier[] | null\n\tprice_frequency_tiers?: PriceFrequencyTier[] | null\n\tattachments?: Attachment[] | null\n\tversions?: Version[] | null\n\tjwt_customer?: Customer | null\n\tjwt_markets?: Market[] | null\n\tjwt_stock_locations?: StockLocation[] | null\n\n}\n\n\ninterface PriceCreate extends ResourceCreate {\n\t\n\t/** \n\t * The code of the associated SKU. When creating a price, either a valid sku_code or a SKU relationship must be present.\n\t * @example ```\"TSHIRTMM000000FFFFFFXLXX\"```\n\t */\n\tsku_code?: string | null\n\t/** \n\t * The SKU price amount for the associated price list, in cents.\n\t * @example ```10000```\n\t */\n\tamount_cents: number\n\t/** \n\t * The compared price amount, in cents. Useful to display a percentage discount.\n\t * @example ```13000```\n\t */\n\tcompare_at_amount_cents?: number | null\n\t/** \n\t * The rules (using Rules Engine) to be applied.\n\t * @example ```{}```\n\t */\n\trules?: Record<string, any> | null\n\n\tprice_list: PriceListRel\n\tsku: SkuRel\n\tprice_tiers?: PriceTierRel[] | null\n\n}\n\n\ninterface PriceUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The code of the associated SKU. When creating a price, either a valid sku_code or a SKU relationship must be present.\n\t * @example ```\"TSHIRTMM000000FFFFFFXLXX\"```\n\t */\n\tsku_code?: string | null\n\t/** \n\t * The SKU price amount for the associated price list, in cents.\n\t * @example ```10000```\n\t */\n\tamount_cents?: number | null\n\t/** \n\t * The compared price amount, in cents. Useful to display a percentage discount.\n\t * @example ```13000```\n\t */\n\tcompare_at_amount_cents?: number | null\n\t/** \n\t * Time at which the resource was processed by API.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tprocessed_at?: string | null\n\t/** \n\t * The rules (using Rules Engine) to be applied.\n\t * @example ```{}```\n\t */\n\trules?: Record<string, any> | null\n\n\tprice_list?: PriceListRel | null\n\tsku?: SkuRel | null\n\tprice_tiers?: PriceTierRel[] | null\n\n}\n\n\nclass Prices extends ApiResource<Price> {\n\n\tstatic readonly TYPE: PriceType = 'prices' as const\n\n\tasync create(resource: PriceCreate, params?: QueryParamsRetrieve<Price>, options?: ResourcesConfig): Promise<Price> {\n\t\treturn this.resources.create<PriceCreate, Price>({ ...resource, type: Prices.TYPE }, params, options)\n\t}\n\n\tasync update(resource: PriceUpdate, params?: QueryParamsRetrieve<Price>, options?: ResourcesConfig): Promise<Price> {\n\t\treturn this.resources.update<PriceUpdate, Price>({ ...resource, type: Prices.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: Prices.TYPE } : id, options)\n\t}\n\n\tasync price_list(priceId: string | Price, params?: QueryParamsRetrieve<PriceList>, options?: ResourcesConfig): Promise<PriceList> {\n\t\tconst _priceId = (priceId as Price).id || priceId as string\n\t\treturn this.resources.fetch<PriceList>({ type: 'price_lists' }, `prices/${_priceId}/price_list`, params, options) as unknown as PriceList\n\t}\n\n\tasync sku(priceId: string | Price, params?: QueryParamsRetrieve<Sku>, options?: ResourcesConfig): Promise<Sku> {\n\t\tconst _priceId = (priceId as Price).id || priceId as string\n\t\treturn this.resources.fetch<Sku>({ type: 'skus' }, `prices/${_priceId}/sku`, params, options) as unknown as Sku\n\t}\n\n\tasync price_tiers(priceId: string | Price, params?: QueryParamsList<PriceTier>, options?: ResourcesConfig): Promise<ListResponse<PriceTier>> {\n\t\tconst _priceId = (priceId as Price).id || priceId as string\n\t\treturn this.resources.fetch<PriceTier>({ type: 'price_tiers' }, `prices/${_priceId}/price_tiers`, params, options) as unknown as ListResponse<PriceTier>\n\t}\n\n\tasync price_volume_tiers(priceId: string | Price, params?: QueryParamsList<PriceVolumeTier>, options?: ResourcesConfig): Promise<ListResponse<PriceVolumeTier>> {\n\t\tconst _priceId = (priceId as Price).id || priceId as string\n\t\treturn this.resources.fetch<PriceVolumeTier>({ type: 'price_volume_tiers' }, `prices/${_priceId}/price_volume_tiers`, params, options) as unknown as ListResponse<PriceVolumeTier>\n\t}\n\n\tasync price_frequency_tiers(priceId: string | Price, params?: QueryParamsList<PriceFrequencyTier>, options?: ResourcesConfig): Promise<ListResponse<PriceFrequencyTier>> {\n\t\tconst _priceId = (priceId as Price).id || priceId as string\n\t\treturn this.resources.fetch<PriceFrequencyTier>({ type: 'price_frequency_tiers' }, `prices/${_priceId}/price_frequency_tiers`, params, options) as unknown as ListResponse<PriceFrequencyTier>\n\t}\n\n\tasync attachments(priceId: string | Price, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _priceId = (priceId as Price).id || priceId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `prices/${_priceId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync versions(priceId: string | Price, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _priceId = (priceId as Price).id || priceId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `prices/${_priceId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync jwt_customer(priceId: string | Price, params?: QueryParamsRetrieve<Customer>, options?: ResourcesConfig): Promise<Customer> {\n\t\tconst _priceId = (priceId as Price).id || priceId as string\n\t\treturn this.resources.fetch<Customer>({ type: 'customers' }, `prices/${_priceId}/jwt_customer`, params, options) as unknown as Customer\n\t}\n\n\tasync jwt_markets(priceId: string | Price, params?: QueryParamsList<Market>, options?: ResourcesConfig): Promise<ListResponse<Market>> {\n\t\tconst _priceId = (priceId as Price).id || priceId as string\n\t\treturn this.resources.fetch<Market>({ type: 'markets' }, `prices/${_priceId}/jwt_markets`, params, options) as unknown as ListResponse<Market>\n\t}\n\n\tasync jwt_stock_locations(priceId: string | Price, params?: QueryParamsList<StockLocation>, options?: ResourcesConfig): Promise<ListResponse<StockLocation>> {\n\t\tconst _priceId = (priceId as Price).id || priceId as string\n\t\treturn this.resources.fetch<StockLocation>({ type: 'stock_locations' }, `prices/${_priceId}/jwt_stock_locations`, params, options) as unknown as ListResponse<StockLocation>\n\t}\n\n\n\tisPrice(resource: any): resource is Price {\n\t\treturn resource.type && (resource.type === Prices.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): PriceRel {\n\t\treturn super.relationshipOneToOne<PriceRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): PriceRel[] {\n\t\treturn super.relationshipOneToMany<PriceRel>(...ids)\n\t}\n\n\n\ttype(): PriceType {\n\t\treturn Prices.TYPE\n\t}\n\n}\n\n\nconst instance = new Prices()\nexport default instance\n\nexport type { Price, PriceCreate, PriceUpdate, PriceType }\n"]}
|
@@ -0,0 +1,72 @@
|
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
|
3
|
+
class Prices extends ApiResource {
|
4
|
+
static TYPE = "prices";
|
5
|
+
async create(resource, params, options) {
|
6
|
+
return this.resources.create({ ...resource, type: Prices.TYPE }, params, options);
|
7
|
+
}
|
8
|
+
async update(resource, params, options) {
|
9
|
+
return this.resources.update({ ...resource, type: Prices.TYPE }, params, options);
|
10
|
+
}
|
11
|
+
async delete(id, options) {
|
12
|
+
await this.resources.delete(typeof id === "string" ? { id, type: Prices.TYPE } : id, options);
|
13
|
+
}
|
14
|
+
async price_list(priceId, params, options) {
|
15
|
+
const _priceId = priceId.id || priceId;
|
16
|
+
return this.resources.fetch({ type: "price_lists" }, `prices/${_priceId}/price_list`, params, options);
|
17
|
+
}
|
18
|
+
async sku(priceId, params, options) {
|
19
|
+
const _priceId = priceId.id || priceId;
|
20
|
+
return this.resources.fetch({ type: "skus" }, `prices/${_priceId}/sku`, params, options);
|
21
|
+
}
|
22
|
+
async price_tiers(priceId, params, options) {
|
23
|
+
const _priceId = priceId.id || priceId;
|
24
|
+
return this.resources.fetch({ type: "price_tiers" }, `prices/${_priceId}/price_tiers`, params, options);
|
25
|
+
}
|
26
|
+
async price_volume_tiers(priceId, params, options) {
|
27
|
+
const _priceId = priceId.id || priceId;
|
28
|
+
return this.resources.fetch({ type: "price_volume_tiers" }, `prices/${_priceId}/price_volume_tiers`, params, options);
|
29
|
+
}
|
30
|
+
async price_frequency_tiers(priceId, params, options) {
|
31
|
+
const _priceId = priceId.id || priceId;
|
32
|
+
return this.resources.fetch({ type: "price_frequency_tiers" }, `prices/${_priceId}/price_frequency_tiers`, params, options);
|
33
|
+
}
|
34
|
+
async attachments(priceId, params, options) {
|
35
|
+
const _priceId = priceId.id || priceId;
|
36
|
+
return this.resources.fetch({ type: "attachments" }, `prices/${_priceId}/attachments`, params, options);
|
37
|
+
}
|
38
|
+
async versions(priceId, params, options) {
|
39
|
+
const _priceId = priceId.id || priceId;
|
40
|
+
return this.resources.fetch({ type: "versions" }, `prices/${_priceId}/versions`, params, options);
|
41
|
+
}
|
42
|
+
async jwt_customer(priceId, params, options) {
|
43
|
+
const _priceId = priceId.id || priceId;
|
44
|
+
return this.resources.fetch({ type: "customers" }, `prices/${_priceId}/jwt_customer`, params, options);
|
45
|
+
}
|
46
|
+
async jwt_markets(priceId, params, options) {
|
47
|
+
const _priceId = priceId.id || priceId;
|
48
|
+
return this.resources.fetch({ type: "markets" }, `prices/${_priceId}/jwt_markets`, params, options);
|
49
|
+
}
|
50
|
+
async jwt_stock_locations(priceId, params, options) {
|
51
|
+
const _priceId = priceId.id || priceId;
|
52
|
+
return this.resources.fetch({ type: "stock_locations" }, `prices/${_priceId}/jwt_stock_locations`, params, options);
|
53
|
+
}
|
54
|
+
isPrice(resource) {
|
55
|
+
return resource.type && resource.type === Prices.TYPE;
|
56
|
+
}
|
57
|
+
relationship(id) {
|
58
|
+
return super.relationshipOneToOne(id);
|
59
|
+
}
|
60
|
+
relationshipToMany(...ids) {
|
61
|
+
return super.relationshipOneToMany(...ids);
|
62
|
+
}
|
63
|
+
type() {
|
64
|
+
return Prices.TYPE;
|
65
|
+
}
|
66
|
+
}
|
67
|
+
const instance = new Prices();
|
68
|
+
var prices_default = instance;
|
69
|
+
|
70
|
+
export { prices_default as default };
|
71
|
+
//# sourceMappingURL=prices.js.map
|
72
|
+
//# sourceMappingURL=prices.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../src/resources/prices.ts"],"names":[],"mappings":";;AA0LA,MAAM,eAAe,WAAmB,CAAA;AA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AAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAClI,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":"prices.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 { PriceList, PriceListType } from './price_lists'\nimport type { Sku, SkuType } from './skus'\nimport type { PriceTier, PriceTierType } from './price_tiers'\nimport type { PriceVolumeTier } from './price_volume_tiers'\nimport type { PriceFrequencyTier } from './price_frequency_tiers'\nimport type { Attachment } from './attachments'\nimport type { Version } from './versions'\nimport type { Customer } from './customers'\nimport type { Market } from './markets'\nimport type { StockLocation } from './stock_locations'\n\n\ntype PriceType = 'prices'\ntype PriceRel = ResourceRel & { type: PriceType }\ntype PriceListRel = ResourceRel & { type: PriceListType }\ntype SkuRel = ResourceRel & { type: SkuType }\ntype PriceTierRel = ResourceRel & { type: PriceTierType }\n\n\nexport type PriceSort = Pick<Price, 'id' | 'currency_code' | 'amount_cents' | 'compare_at_amount_cents'> & ResourceSort\n// export type PriceFilter = Pick<Price, 'id' | 'currency_code' | 'amount_cents' | 'compare_at_amount_cents' | 'rules'> & ResourceFilter\n\n\ninterface Price extends Resource {\n\t\n\treadonly type: PriceType\n\n\t/** \n\t * The international 3-letter currency code as defined by the ISO 4217 standard, inherited from the associated price list.\n\t * @example ```\"EUR\"```\n\t */\n\tcurrency_code?: string | null\n\t/** \n\t * The code of the associated SKU. When creating a price, either a valid sku_code or a SKU relationship must be present.\n\t * @example ```\"TSHIRTMM000000FFFFFFXLXX\"```\n\t */\n\tsku_code?: string | null\n\t/** \n\t * The SKU price amount for the associated price list, in cents.\n\t * @example ```10000```\n\t */\n\tamount_cents: number\n\t/** \n\t * The SKU price amount for the associated price list, float.\n\t * @example ```100```\n\t */\n\tamount_float?: number | null\n\t/** \n\t * The SKU price amount for the associated price list, formatted.\n\t * @example ```\"€100,00\"```\n\t */\n\tformatted_amount?: string | null\n\t/** \n\t * The SKU price amount for the associated price list, in cents before any applied rule.\n\t * @example ```10000```\n\t */\n\toriginal_amount_cents?: number | null\n\t/** \n\t * The SKU price amount for the associated price list, in cents before any applied rule, formatted.\n\t * @example ```\"€100,00\"```\n\t */\n\tformatted_original_amount?: string | null\n\t/** \n\t * The compared price amount, in cents. Useful to display a percentage discount.\n\t * @example ```13000```\n\t */\n\tcompare_at_amount_cents?: number | null\n\t/** \n\t * The compared price amount, float.\n\t * @example ```130```\n\t */\n\tcompare_at_amount_float?: number | null\n\t/** \n\t * The compared price amount, formatted.\n\t * @example ```\"€130,00\"```\n\t */\n\tformatted_compare_at_amount?: string | null\n\t/** \n\t * Time at which the resource was processed by API.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tprocessed_at?: string | null\n\t/** \n\t * The rules (using Rules Engine) to be applied.\n\t * @example ```{}```\n\t */\n\trules?: Record<string, any> | null\n\t/** \n\t * The rule outcomes.\n\t * @example ```{}```\n\t */\n\trule_outcomes?: Record<string, any> | null\n\t/** \n\t * The payload used to evaluate the rules.\n\t * @example ```{}```\n\t */\n\tresource_payload?: Record<string, any> | null\n\t/** \n\t * The custom_claim attached to the current JWT (if any).\n\t * @example ```{}```\n\t */\n\tjwt_custom_claim?: Record<string, any> | null\n\n\tprice_list?: PriceList | null\n\tsku?: Sku | null\n\tprice_tiers?: PriceTier[] | null\n\tprice_volume_tiers?: PriceVolumeTier[] | null\n\tprice_frequency_tiers?: PriceFrequencyTier[] | null\n\tattachments?: Attachment[] | null\n\tversions?: Version[] | null\n\tjwt_customer?: Customer | null\n\tjwt_markets?: Market[] | null\n\tjwt_stock_locations?: StockLocation[] | null\n\n}\n\n\ninterface PriceCreate extends ResourceCreate {\n\t\n\t/** \n\t * The code of the associated SKU. When creating a price, either a valid sku_code or a SKU relationship must be present.\n\t * @example ```\"TSHIRTMM000000FFFFFFXLXX\"```\n\t */\n\tsku_code?: string | null\n\t/** \n\t * The SKU price amount for the associated price list, in cents.\n\t * @example ```10000```\n\t */\n\tamount_cents: number\n\t/** \n\t * The compared price amount, in cents. Useful to display a percentage discount.\n\t * @example ```13000```\n\t */\n\tcompare_at_amount_cents?: number | null\n\t/** \n\t * The rules (using Rules Engine) to be applied.\n\t * @example ```{}```\n\t */\n\trules?: Record<string, any> | null\n\n\tprice_list: PriceListRel\n\tsku: SkuRel\n\tprice_tiers?: PriceTierRel[] | null\n\n}\n\n\ninterface PriceUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The code of the associated SKU. When creating a price, either a valid sku_code or a SKU relationship must be present.\n\t * @example ```\"TSHIRTMM000000FFFFFFXLXX\"```\n\t */\n\tsku_code?: string | null\n\t/** \n\t * The SKU price amount for the associated price list, in cents.\n\t * @example ```10000```\n\t */\n\tamount_cents?: number | null\n\t/** \n\t * The compared price amount, in cents. Useful to display a percentage discount.\n\t * @example ```13000```\n\t */\n\tcompare_at_amount_cents?: number | null\n\t/** \n\t * Time at which the resource was processed by API.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tprocessed_at?: string | null\n\t/** \n\t * The rules (using Rules Engine) to be applied.\n\t * @example ```{}```\n\t */\n\trules?: Record<string, any> | null\n\n\tprice_list?: PriceListRel | null\n\tsku?: SkuRel | null\n\tprice_tiers?: PriceTierRel[] | null\n\n}\n\n\nclass Prices extends ApiResource<Price> {\n\n\tstatic readonly TYPE: PriceType = 'prices' as const\n\n\tasync create(resource: PriceCreate, params?: QueryParamsRetrieve<Price>, options?: ResourcesConfig): Promise<Price> {\n\t\treturn this.resources.create<PriceCreate, Price>({ ...resource, type: Prices.TYPE }, params, options)\n\t}\n\n\tasync update(resource: PriceUpdate, params?: QueryParamsRetrieve<Price>, options?: ResourcesConfig): Promise<Price> {\n\t\treturn this.resources.update<PriceUpdate, Price>({ ...resource, type: Prices.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: Prices.TYPE } : id, options)\n\t}\n\n\tasync price_list(priceId: string | Price, params?: QueryParamsRetrieve<PriceList>, options?: ResourcesConfig): Promise<PriceList> {\n\t\tconst _priceId = (priceId as Price).id || priceId as string\n\t\treturn this.resources.fetch<PriceList>({ type: 'price_lists' }, `prices/${_priceId}/price_list`, params, options) as unknown as PriceList\n\t}\n\n\tasync sku(priceId: string | Price, params?: QueryParamsRetrieve<Sku>, options?: ResourcesConfig): Promise<Sku> {\n\t\tconst _priceId = (priceId as Price).id || priceId as string\n\t\treturn this.resources.fetch<Sku>({ type: 'skus' }, `prices/${_priceId}/sku`, params, options) as unknown as Sku\n\t}\n\n\tasync price_tiers(priceId: string | Price, params?: QueryParamsList<PriceTier>, options?: ResourcesConfig): Promise<ListResponse<PriceTier>> {\n\t\tconst _priceId = (priceId as Price).id || priceId as string\n\t\treturn this.resources.fetch<PriceTier>({ type: 'price_tiers' }, `prices/${_priceId}/price_tiers`, params, options) as unknown as ListResponse<PriceTier>\n\t}\n\n\tasync price_volume_tiers(priceId: string | Price, params?: QueryParamsList<PriceVolumeTier>, options?: ResourcesConfig): Promise<ListResponse<PriceVolumeTier>> {\n\t\tconst _priceId = (priceId as Price).id || priceId as string\n\t\treturn this.resources.fetch<PriceVolumeTier>({ type: 'price_volume_tiers' }, `prices/${_priceId}/price_volume_tiers`, params, options) as unknown as ListResponse<PriceVolumeTier>\n\t}\n\n\tasync price_frequency_tiers(priceId: string | Price, params?: QueryParamsList<PriceFrequencyTier>, options?: ResourcesConfig): Promise<ListResponse<PriceFrequencyTier>> {\n\t\tconst _priceId = (priceId as Price).id || priceId as string\n\t\treturn this.resources.fetch<PriceFrequencyTier>({ type: 'price_frequency_tiers' }, `prices/${_priceId}/price_frequency_tiers`, params, options) as unknown as ListResponse<PriceFrequencyTier>\n\t}\n\n\tasync attachments(priceId: string | Price, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _priceId = (priceId as Price).id || priceId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `prices/${_priceId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync versions(priceId: string | Price, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _priceId = (priceId as Price).id || priceId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `prices/${_priceId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync jwt_customer(priceId: string | Price, params?: QueryParamsRetrieve<Customer>, options?: ResourcesConfig): Promise<Customer> {\n\t\tconst _priceId = (priceId as Price).id || priceId as string\n\t\treturn this.resources.fetch<Customer>({ type: 'customers' }, `prices/${_priceId}/jwt_customer`, params, options) as unknown as Customer\n\t}\n\n\tasync jwt_markets(priceId: string | Price, params?: QueryParamsList<Market>, options?: ResourcesConfig): Promise<ListResponse<Market>> {\n\t\tconst _priceId = (priceId as Price).id || priceId as string\n\t\treturn this.resources.fetch<Market>({ type: 'markets' }, `prices/${_priceId}/jwt_markets`, params, options) as unknown as ListResponse<Market>\n\t}\n\n\tasync jwt_stock_locations(priceId: string | Price, params?: QueryParamsList<StockLocation>, options?: ResourcesConfig): Promise<ListResponse<StockLocation>> {\n\t\tconst _priceId = (priceId as Price).id || priceId as string\n\t\treturn this.resources.fetch<StockLocation>({ type: 'stock_locations' }, `prices/${_priceId}/jwt_stock_locations`, params, options) as unknown as ListResponse<StockLocation>\n\t}\n\n\n\tisPrice(resource: any): resource is Price {\n\t\treturn resource.type && (resource.type === Prices.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): PriceRel {\n\t\treturn super.relationshipOneToOne<PriceRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): PriceRel[] {\n\t\treturn super.relationshipOneToMany<PriceRel>(...ids)\n\t}\n\n\n\ttype(): PriceType {\n\t\treturn Prices.TYPE\n\t}\n\n}\n\n\nconst instance = new Prices()\nexport default instance\n\nexport type { Price, PriceCreate, PriceUpdate, PriceType }\n"]}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var resource = require('../resource');
|
4
|
+
|
5
|
+
class PromotionRules extends resource.ApiResource {
|
6
|
+
static TYPE = "promotion_rules";
|
7
|
+
async versions(promotionRuleId, params, options) {
|
8
|
+
const _promotionRuleId = promotionRuleId.id || promotionRuleId;
|
9
|
+
return this.resources.fetch({ type: "versions" }, `promotion_rules/${_promotionRuleId}/versions`, params, options);
|
10
|
+
}
|
11
|
+
isPromotionRule(resource) {
|
12
|
+
return resource.type && resource.type === PromotionRules.TYPE;
|
13
|
+
}
|
14
|
+
relationship(id) {
|
15
|
+
return super.relationshipOneToOne(id);
|
16
|
+
}
|
17
|
+
relationshipToMany(...ids) {
|
18
|
+
return super.relationshipOneToMany(...ids);
|
19
|
+
}
|
20
|
+
type() {
|
21
|
+
return PromotionRules.TYPE;
|
22
|
+
}
|
23
|
+
}
|
24
|
+
const instance = new PromotionRules();
|
25
|
+
var promotion_rules_default = instance;
|
26
|
+
|
27
|
+
module.exports = promotion_rules_default;
|
28
|
+
//# sourceMappingURL=promotion_rules.cjs.map
|
29
|
+
|
30
|
+
module.exports = exports.default;
|
31
|
+
//# sourceMappingURL=promotion_rules.cjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../src/resources/promotion_rules.ts"],"names":["ApiResource"],"mappings":";;;;AAkCA,MAAM,uBAAuBA,oBAA2B,CAAA;AAAA,EAEvD,OAAgB,IAA0B,GAAA,iBAAA;AAAA,EAE1C,MAAM,QAAA,CAAS,eAAyC,EAAA,MAAA,EAAmC,OAA2D,EAAA;AACrJ,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,CAAa,SAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC3H,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":"promotion_rules.cjs","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsList } from '../query'\n\nimport type { Version } from './versions'\nimport type { PercentageDiscountPromotion } from './percentage_discount_promotions'\nimport type { FreeShippingPromotion } from './free_shipping_promotions'\nimport type { BuyXPayYPromotion } from './buy_x_pay_y_promotions'\nimport type { FreeGiftPromotion } from './free_gift_promotions'\nimport type { FixedPricePromotion } from './fixed_price_promotions'\nimport type { ExternalPromotion } from './external_promotions'\nimport type { FixedAmountPromotion } from './fixed_amount_promotions'\nimport type { FlexPromotion } from './flex_promotions'\n\n\ntype PromotionRuleType = 'promotion_rules'\ntype PromotionRuleRel = ResourceRel & { type: PromotionRuleType }\n\n\nexport type PromotionRuleSort = Pick<PromotionRule, 'id'> & ResourceSort\n// export type PromotionRuleFilter = Pick<PromotionRule, 'id'> & ResourceFilter\n\n\ninterface PromotionRule extends Resource {\n\t\n\treadonly type: PromotionRuleType\n\n\n\tpromotion?: PercentageDiscountPromotion | FreeShippingPromotion | BuyXPayYPromotion | FreeGiftPromotion | FixedPricePromotion | ExternalPromotion | FixedAmountPromotion | FlexPromotion | null\n\tversions?: Version[] | null\n\n}\n\n\nclass PromotionRules extends ApiResource<PromotionRule> {\n\n\tstatic readonly TYPE: PromotionRuleType = 'promotion_rules' as const\n\n\tasync versions(promotionRuleId: string | PromotionRule, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _promotionRuleId = (promotionRuleId as PromotionRule).id || promotionRuleId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `promotion_rules/${_promotionRuleId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\n\tisPromotionRule(resource: any): resource is PromotionRule {\n\t\treturn resource.type && (resource.type === PromotionRules.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): PromotionRuleRel {\n\t\treturn super.relationshipOneToOne<PromotionRuleRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): PromotionRuleRel[] {\n\t\treturn super.relationshipOneToMany<PromotionRuleRel>(...ids)\n\t}\n\n\n\ttype(): PromotionRuleType {\n\t\treturn PromotionRules.TYPE\n\t}\n\n}\n\n\nconst instance = new PromotionRules()\nexport default instance\n\nexport type { PromotionRule, PromotionRuleType }\n"]}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
|
3
|
+
class PromotionRules extends ApiResource {
|
4
|
+
static TYPE = "promotion_rules";
|
5
|
+
async versions(promotionRuleId, params, options) {
|
6
|
+
const _promotionRuleId = promotionRuleId.id || promotionRuleId;
|
7
|
+
return this.resources.fetch({ type: "versions" }, `promotion_rules/${_promotionRuleId}/versions`, params, options);
|
8
|
+
}
|
9
|
+
isPromotionRule(resource) {
|
10
|
+
return resource.type && resource.type === PromotionRules.TYPE;
|
11
|
+
}
|
12
|
+
relationship(id) {
|
13
|
+
return super.relationshipOneToOne(id);
|
14
|
+
}
|
15
|
+
relationshipToMany(...ids) {
|
16
|
+
return super.relationshipOneToMany(...ids);
|
17
|
+
}
|
18
|
+
type() {
|
19
|
+
return PromotionRules.TYPE;
|
20
|
+
}
|
21
|
+
}
|
22
|
+
const instance = new PromotionRules();
|
23
|
+
var promotion_rules_default = instance;
|
24
|
+
|
25
|
+
export { promotion_rules_default as default };
|
26
|
+
//# sourceMappingURL=promotion_rules.js.map
|
27
|
+
//# sourceMappingURL=promotion_rules.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../src/resources/promotion_rules.ts"],"names":[],"mappings":";;AAkCA,MAAM,uBAAuB,WAA2B,CAAA;AAAA,EAEvD,OAAgB,IAA0B,GAAA,iBAAA;AAAA,EAE1C,MAAM,QAAA,CAAS,eAAyC,EAAA,MAAA,EAAmC,OAA2D,EAAA;AACrJ,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,CAAa,SAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC3H,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":"promotion_rules.js","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsList } from '../query'\n\nimport type { Version } from './versions'\nimport type { PercentageDiscountPromotion } from './percentage_discount_promotions'\nimport type { FreeShippingPromotion } from './free_shipping_promotions'\nimport type { BuyXPayYPromotion } from './buy_x_pay_y_promotions'\nimport type { FreeGiftPromotion } from './free_gift_promotions'\nimport type { FixedPricePromotion } from './fixed_price_promotions'\nimport type { ExternalPromotion } from './external_promotions'\nimport type { FixedAmountPromotion } from './fixed_amount_promotions'\nimport type { FlexPromotion } from './flex_promotions'\n\n\ntype PromotionRuleType = 'promotion_rules'\ntype PromotionRuleRel = ResourceRel & { type: PromotionRuleType }\n\n\nexport type PromotionRuleSort = Pick<PromotionRule, 'id'> & ResourceSort\n// export type PromotionRuleFilter = Pick<PromotionRule, 'id'> & ResourceFilter\n\n\ninterface PromotionRule extends Resource {\n\t\n\treadonly type: PromotionRuleType\n\n\n\tpromotion?: PercentageDiscountPromotion | FreeShippingPromotion | BuyXPayYPromotion | FreeGiftPromotion | FixedPricePromotion | ExternalPromotion | FixedAmountPromotion | FlexPromotion | null\n\tversions?: Version[] | null\n\n}\n\n\nclass PromotionRules extends ApiResource<PromotionRule> {\n\n\tstatic readonly TYPE: PromotionRuleType = 'promotion_rules' as const\n\n\tasync versions(promotionRuleId: string | PromotionRule, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _promotionRuleId = (promotionRuleId as PromotionRule).id || promotionRuleId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `promotion_rules/${_promotionRuleId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\n\tisPromotionRule(resource: any): resource is PromotionRule {\n\t\treturn resource.type && (resource.type === PromotionRules.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): PromotionRuleRel {\n\t\treturn super.relationshipOneToOne<PromotionRuleRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): PromotionRuleRel[] {\n\t\treturn super.relationshipOneToMany<PromotionRuleRel>(...ids)\n\t}\n\n\n\ttype(): PromotionRuleType {\n\t\treturn PromotionRules.TYPE\n\t}\n\n}\n\n\nconst instance = new PromotionRules()\nexport default instance\n\nexport type { PromotionRule, PromotionRuleType }\n"]}
|
@@ -0,0 +1,71 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var resource = require('../resource');
|
4
|
+
|
5
|
+
class Promotions extends resource.ApiResource {
|
6
|
+
static TYPE = "promotions";
|
7
|
+
async market(promotionId, params, options) {
|
8
|
+
const _promotionId = promotionId.id || promotionId;
|
9
|
+
return this.resources.fetch({ type: "markets" }, `promotions/${_promotionId}/market`, params, options);
|
10
|
+
}
|
11
|
+
async order_amount_promotion_rule(promotionId, params, options) {
|
12
|
+
const _promotionId = promotionId.id || promotionId;
|
13
|
+
return this.resources.fetch({ type: "order_amount_promotion_rules" }, `promotions/${_promotionId}/order_amount_promotion_rule`, params, options);
|
14
|
+
}
|
15
|
+
async sku_list_promotion_rule(promotionId, params, options) {
|
16
|
+
const _promotionId = promotionId.id || promotionId;
|
17
|
+
return this.resources.fetch({ type: "sku_list_promotion_rules" }, `promotions/${_promotionId}/sku_list_promotion_rule`, params, options);
|
18
|
+
}
|
19
|
+
async coupon_codes_promotion_rule(promotionId, params, options) {
|
20
|
+
const _promotionId = promotionId.id || promotionId;
|
21
|
+
return this.resources.fetch({ type: "coupon_codes_promotion_rules" }, `promotions/${_promotionId}/coupon_codes_promotion_rule`, params, options);
|
22
|
+
}
|
23
|
+
async custom_promotion_rule(promotionId, params, options) {
|
24
|
+
const _promotionId = promotionId.id || promotionId;
|
25
|
+
return this.resources.fetch({ type: "custom_promotion_rules" }, `promotions/${_promotionId}/custom_promotion_rule`, params, options);
|
26
|
+
}
|
27
|
+
async sku_list(promotionId, params, options) {
|
28
|
+
const _promotionId = promotionId.id || promotionId;
|
29
|
+
return this.resources.fetch({ type: "sku_lists" }, `promotions/${_promotionId}/sku_list`, params, options);
|
30
|
+
}
|
31
|
+
async coupons(promotionId, params, options) {
|
32
|
+
const _promotionId = promotionId.id || promotionId;
|
33
|
+
return this.resources.fetch({ type: "coupons" }, `promotions/${_promotionId}/coupons`, params, options);
|
34
|
+
}
|
35
|
+
async attachments(promotionId, params, options) {
|
36
|
+
const _promotionId = promotionId.id || promotionId;
|
37
|
+
return this.resources.fetch({ type: "attachments" }, `promotions/${_promotionId}/attachments`, params, options);
|
38
|
+
}
|
39
|
+
async events(promotionId, params, options) {
|
40
|
+
const _promotionId = promotionId.id || promotionId;
|
41
|
+
return this.resources.fetch({ type: "events" }, `promotions/${_promotionId}/events`, params, options);
|
42
|
+
}
|
43
|
+
async tags(promotionId, params, options) {
|
44
|
+
const _promotionId = promotionId.id || promotionId;
|
45
|
+
return this.resources.fetch({ type: "tags" }, `promotions/${_promotionId}/tags`, params, options);
|
46
|
+
}
|
47
|
+
async versions(promotionId, params, options) {
|
48
|
+
const _promotionId = promotionId.id || promotionId;
|
49
|
+
return this.resources.fetch({ type: "versions" }, `promotions/${_promotionId}/versions`, params, options);
|
50
|
+
}
|
51
|
+
isPromotion(resource) {
|
52
|
+
return resource.type && resource.type === Promotions.TYPE;
|
53
|
+
}
|
54
|
+
relationship(id) {
|
55
|
+
return super.relationshipOneToOne(id);
|
56
|
+
}
|
57
|
+
relationshipToMany(...ids) {
|
58
|
+
return super.relationshipOneToMany(...ids);
|
59
|
+
}
|
60
|
+
type() {
|
61
|
+
return Promotions.TYPE;
|
62
|
+
}
|
63
|
+
}
|
64
|
+
const instance = new Promotions();
|
65
|
+
var promotions_default = instance;
|
66
|
+
|
67
|
+
module.exports = promotions_default;
|
68
|
+
//# sourceMappingURL=promotions.cjs.map
|
69
|
+
|
70
|
+
module.exports = exports.default;
|
71
|
+
//# sourceMappingURL=promotions.cjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../src/resources/promotions.ts"],"names":["ApiResource"],"mappings":";;;;AAsGA,MAAM,mBAAmBA,oBAAuB,CAAA;AAAA,EAE/C,OAAgB,IAAsB,GAAA,YAAA;AAAA,EAEtC,MAAM,MAAA,CAAO,WAAiC,EAAA,MAAA,EAAsC,OAA4C,EAAA;AAC/H,IAAM,MAAA,YAAA,GAAgB,YAA0B,EAAM,IAAA,WAAA;AACtD,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAc,EAAE,IAAA,EAAM,SAAU,EAAA,EAAG,CAAc,WAAA,EAAA,YAAY,CAAW,OAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC9G,EAEA,MAAM,2BAAA,CAA4B,WAAiC,EAAA,MAAA,EAAwD,OAA8D,EAAA;AACxL,IAAM,MAAA,YAAA,GAAgB,YAA0B,EAAM,IAAA,WAAA;AACtD,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAgC,EAAE,IAAA,EAAM,8BAA+B,EAAA,EAAG,CAAc,WAAA,EAAA,YAAY,CAAgC,4BAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC1K,EAEA,MAAM,uBAAA,CAAwB,WAAiC,EAAA,MAAA,EAAoD,OAA0D,EAAA;AAC5K,IAAM,MAAA,YAAA,GAAgB,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U,CAAA,KAAA,CAAe,EAAE,IAAA,EAAM,UAAW,EAAA,EAAG,CAAc,WAAA,EAAA,YAAY,CAAa,SAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAClH,EAGA,YAAY,QAAsC,EAAA;AACjD,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,UAAW,CAAA,IAAA;AAAA;AACvD,EAGA,aAAa,EAA8C,EAAA;AAC1D,IAAO,OAAA,KAAA,CAAM,qBAAmC,EAAE,CAAA;AAAA;AACnD,EAEA,sBAAsB,GAA+B,EAAA;AACpD,IAAO,OAAA,KAAA,CAAM,qBAAoC,CAAA,GAAG,GAAG,CAAA;AAAA;AACxD,EAGA,IAAsB,GAAA;AACrB,IAAA,OAAO,UAAW,CAAA,IAAA;AAAA;AAGpB;AAGA,MAAM,QAAA,GAAW,IAAI,UAAW,EAAA;AAChC,IAAO,kBAAQ,GAAA","file":"promotions.cjs","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Market } from './markets'\nimport type { OrderAmountPromotionRule } from './order_amount_promotion_rules'\nimport type { SkuListPromotionRule } from './sku_list_promotion_rules'\nimport type { CouponCodesPromotionRule } from './coupon_codes_promotion_rules'\nimport type { CustomPromotionRule } from './custom_promotion_rules'\nimport type { SkuList } from './sku_lists'\nimport type { Coupon } from './coupons'\nimport type { Attachment } from './attachments'\nimport type { Event } from './events'\nimport type { Tag } from './tags'\nimport type { Version } from './versions'\nimport type { PromotionRule } from './promotion_rules'\n\n\ntype PromotionType = 'promotions'\ntype PromotionRel = ResourceRel & { type: PromotionType }\n\n\nexport type PromotionSort = Pick<Promotion, 'id' | 'name' | 'currency_code' | 'exclusive' | 'priority' | 'starts_at' | 'expires_at' | 'total_usage_limit' | 'total_usage_count' | 'disabled_at'> & ResourceSort\n// export type PromotionFilter = Pick<Promotion, 'id' | 'name' | 'currency_code' | 'priority' | 'starts_at' | 'expires_at' | 'total_usage_limit' | 'total_usage_count' | 'disabled_at'> & ResourceFilter\n\n\ninterface Promotion extends Resource {\n\t\n\treadonly type: PromotionType\n\n\t/** \n\t * The promotion's internal name.\n\t * @example ```\"Personal promotion\"```\n\t */\n\tname: string\n\t/** \n\t * The international 3-letter currency code as defined by the ISO 4217 standard.\n\t * @example ```\"EUR\"```\n\t */\n\tcurrency_code?: string | null\n\t/** \n\t * Indicates if the promotion will be applied exclusively, based on its priority score.\n\t * @example ```true```\n\t */\n\texclusive?: boolean | null\n\t/** \n\t * The priority assigned to the promotion (lower means higher priority).\n\t * @example ```2```\n\t */\n\tpriority?: number | null\n\t/** \n\t * The activation date/time of this promotion.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at: string\n\t/** \n\t * The expiration date/time of this promotion (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at: string\n\t/** \n\t * The total number of times this promotion can be applied. When 'null' it means promotion can be applied infinite times.\n\t * @example ```5```\n\t */\n\ttotal_usage_limit?: number | null\n\t/** \n\t * The number of times this promotion has been applied.\n\t * @example ```2```\n\t */\n\ttotal_usage_count?: number | null\n\t/** \n\t * Indicates if the promotion is active (enabled and not expired).\n\t * @example ```true```\n\t */\n\tactive?: boolean | null\n\t/** \n\t * The promotion status. One of 'disabled', 'expired', 'pending', 'active', or 'inactive'.\n\t * @example ```\"pending\"```\n\t */\n\tstatus?: 'disabled' | 'expired' | 'pending' | 'active' | 'inactive' | null\n\t/** \n\t * Time at which this resource was disabled.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tdisabled_at?: string | null\n\n\tmarket?: Market | null\n\tpromotion_rules?: PromotionRule[] | null\n\torder_amount_promotion_rule?: OrderAmountPromotionRule | null\n\tsku_list_promotion_rule?: SkuListPromotionRule | null\n\tcoupon_codes_promotion_rule?: CouponCodesPromotionRule | null\n\tcustom_promotion_rule?: CustomPromotionRule | null\n\tsku_list?: SkuList | null\n\tcoupons?: Coupon[] | null\n\tattachments?: Attachment[] | null\n\tevents?: Event[] | null\n\ttags?: Tag[] | null\n\tversions?: Version[] | null\n\n}\n\n\nclass Promotions extends ApiResource<Promotion> {\n\n\tstatic readonly TYPE: PromotionType = 'promotions' as const\n\n\tasync market(promotionId: string | Promotion, params?: QueryParamsRetrieve<Market>, options?: ResourcesConfig): Promise<Market> {\n\t\tconst _promotionId = (promotionId as Promotion).id || promotionId as string\n\t\treturn this.resources.fetch<Market>({ type: 'markets' }, `promotions/${_promotionId}/market`, params, options) as unknown as Market\n\t}\n\n\tasync order_amount_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve<OrderAmountPromotionRule>, options?: ResourcesConfig): Promise<OrderAmountPromotionRule> {\n\t\tconst _promotionId = (promotionId as Promotion).id || promotionId as string\n\t\treturn this.resources.fetch<OrderAmountPromotionRule>({ type: 'order_amount_promotion_rules' }, `promotions/${_promotionId}/order_amount_promotion_rule`, params, options) as unknown as OrderAmountPromotionRule\n\t}\n\n\tasync sku_list_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve<SkuListPromotionRule>, options?: ResourcesConfig): Promise<SkuListPromotionRule> {\n\t\tconst _promotionId = (promotionId as Promotion).id || promotionId as string\n\t\treturn this.resources.fetch<SkuListPromotionRule>({ type: 'sku_list_promotion_rules' }, `promotions/${_promotionId}/sku_list_promotion_rule`, params, options) as unknown as SkuListPromotionRule\n\t}\n\n\tasync coupon_codes_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve<CouponCodesPromotionRule>, options?: ResourcesConfig): Promise<CouponCodesPromotionRule> {\n\t\tconst _promotionId = (promotionId as Promotion).id || promotionId as string\n\t\treturn this.resources.fetch<CouponCodesPromotionRule>({ type: 'coupon_codes_promotion_rules' }, `promotions/${_promotionId}/coupon_codes_promotion_rule`, params, options) as unknown as CouponCodesPromotionRule\n\t}\n\n\tasync custom_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve<CustomPromotionRule>, options?: ResourcesConfig): Promise<CustomPromotionRule> {\n\t\tconst _promotionId = (promotionId as Promotion).id || promotionId as string\n\t\treturn this.resources.fetch<CustomPromotionRule>({ type: 'custom_promotion_rules' }, `promotions/${_promotionId}/custom_promotion_rule`, params, options) as unknown as CustomPromotionRule\n\t}\n\n\tasync sku_list(promotionId: string | Promotion, params?: QueryParamsRetrieve<SkuList>, options?: ResourcesConfig): Promise<SkuList> {\n\t\tconst _promotionId = (promotionId as Promotion).id || promotionId as string\n\t\treturn this.resources.fetch<SkuList>({ type: 'sku_lists' }, `promotions/${_promotionId}/sku_list`, params, options) as unknown as SkuList\n\t}\n\n\tasync coupons(promotionId: string | Promotion, params?: QueryParamsList<Coupon>, options?: ResourcesConfig): Promise<ListResponse<Coupon>> {\n\t\tconst _promotionId = (promotionId as Promotion).id || promotionId as string\n\t\treturn this.resources.fetch<Coupon>({ type: 'coupons' }, `promotions/${_promotionId}/coupons`, params, options) as unknown as ListResponse<Coupon>\n\t}\n\n\tasync attachments(promotionId: string | Promotion, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _promotionId = (promotionId as Promotion).id || promotionId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `promotions/${_promotionId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync events(promotionId: string | Promotion, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _promotionId = (promotionId as Promotion).id || promotionId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `promotions/${_promotionId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync tags(promotionId: string | Promotion, params?: QueryParamsList<Tag>, options?: ResourcesConfig): Promise<ListResponse<Tag>> {\n\t\tconst _promotionId = (promotionId as Promotion).id || promotionId as string\n\t\treturn this.resources.fetch<Tag>({ type: 'tags' }, `promotions/${_promotionId}/tags`, params, options) as unknown as ListResponse<Tag>\n\t}\n\n\tasync versions(promotionId: string | Promotion, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _promotionId = (promotionId as Promotion).id || promotionId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `promotions/${_promotionId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\n\tisPromotion(resource: any): resource is Promotion {\n\t\treturn resource.type && (resource.type === Promotions.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): PromotionRel {\n\t\treturn super.relationshipOneToOne<PromotionRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): PromotionRel[] {\n\t\treturn super.relationshipOneToMany<PromotionRel>(...ids)\n\t}\n\n\n\ttype(): PromotionType {\n\t\treturn Promotions.TYPE\n\t}\n\n}\n\n\nconst instance = new Promotions()\nexport default instance\n\nexport type { Promotion, PromotionType }\n"]}
|
@@ -0,0 +1,67 @@
|
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
|
3
|
+
class Promotions extends ApiResource {
|
4
|
+
static TYPE = "promotions";
|
5
|
+
async market(promotionId, params, options) {
|
6
|
+
const _promotionId = promotionId.id || promotionId;
|
7
|
+
return this.resources.fetch({ type: "markets" }, `promotions/${_promotionId}/market`, params, options);
|
8
|
+
}
|
9
|
+
async order_amount_promotion_rule(promotionId, params, options) {
|
10
|
+
const _promotionId = promotionId.id || promotionId;
|
11
|
+
return this.resources.fetch({ type: "order_amount_promotion_rules" }, `promotions/${_promotionId}/order_amount_promotion_rule`, params, options);
|
12
|
+
}
|
13
|
+
async sku_list_promotion_rule(promotionId, params, options) {
|
14
|
+
const _promotionId = promotionId.id || promotionId;
|
15
|
+
return this.resources.fetch({ type: "sku_list_promotion_rules" }, `promotions/${_promotionId}/sku_list_promotion_rule`, params, options);
|
16
|
+
}
|
17
|
+
async coupon_codes_promotion_rule(promotionId, params, options) {
|
18
|
+
const _promotionId = promotionId.id || promotionId;
|
19
|
+
return this.resources.fetch({ type: "coupon_codes_promotion_rules" }, `promotions/${_promotionId}/coupon_codes_promotion_rule`, params, options);
|
20
|
+
}
|
21
|
+
async custom_promotion_rule(promotionId, params, options) {
|
22
|
+
const _promotionId = promotionId.id || promotionId;
|
23
|
+
return this.resources.fetch({ type: "custom_promotion_rules" }, `promotions/${_promotionId}/custom_promotion_rule`, params, options);
|
24
|
+
}
|
25
|
+
async sku_list(promotionId, params, options) {
|
26
|
+
const _promotionId = promotionId.id || promotionId;
|
27
|
+
return this.resources.fetch({ type: "sku_lists" }, `promotions/${_promotionId}/sku_list`, params, options);
|
28
|
+
}
|
29
|
+
async coupons(promotionId, params, options) {
|
30
|
+
const _promotionId = promotionId.id || promotionId;
|
31
|
+
return this.resources.fetch({ type: "coupons" }, `promotions/${_promotionId}/coupons`, params, options);
|
32
|
+
}
|
33
|
+
async attachments(promotionId, params, options) {
|
34
|
+
const _promotionId = promotionId.id || promotionId;
|
35
|
+
return this.resources.fetch({ type: "attachments" }, `promotions/${_promotionId}/attachments`, params, options);
|
36
|
+
}
|
37
|
+
async events(promotionId, params, options) {
|
38
|
+
const _promotionId = promotionId.id || promotionId;
|
39
|
+
return this.resources.fetch({ type: "events" }, `promotions/${_promotionId}/events`, params, options);
|
40
|
+
}
|
41
|
+
async tags(promotionId, params, options) {
|
42
|
+
const _promotionId = promotionId.id || promotionId;
|
43
|
+
return this.resources.fetch({ type: "tags" }, `promotions/${_promotionId}/tags`, params, options);
|
44
|
+
}
|
45
|
+
async versions(promotionId, params, options) {
|
46
|
+
const _promotionId = promotionId.id || promotionId;
|
47
|
+
return this.resources.fetch({ type: "versions" }, `promotions/${_promotionId}/versions`, params, options);
|
48
|
+
}
|
49
|
+
isPromotion(resource) {
|
50
|
+
return resource.type && resource.type === Promotions.TYPE;
|
51
|
+
}
|
52
|
+
relationship(id) {
|
53
|
+
return super.relationshipOneToOne(id);
|
54
|
+
}
|
55
|
+
relationshipToMany(...ids) {
|
56
|
+
return super.relationshipOneToMany(...ids);
|
57
|
+
}
|
58
|
+
type() {
|
59
|
+
return Promotions.TYPE;
|
60
|
+
}
|
61
|
+
}
|
62
|
+
const instance = new Promotions();
|
63
|
+
var promotions_default = instance;
|
64
|
+
|
65
|
+
export { promotions_default as default };
|
66
|
+
//# sourceMappingURL=promotions.js.map
|
67
|
+
//# sourceMappingURL=promotions.js.map
|