@commercelayer/sdk 7.0.0-rc.2 → 7.0.0-rc.4
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 +2 -1
- package/lib/{api-DDgIE2i8.d.ts → api-F1F37Dud.d.ts} +27 -8
- package/lib/{api-DmIZO_Np.d.cts → api-IwWtsAqE.d.cts} +27 -8
- package/lib/api.d.cts +2 -2
- package/lib/api.d.ts +2 -2
- package/lib/bundle.cjs +568 -0
- package/lib/bundle.cjs.map +1 -0
- package/lib/bundle.d.cts +145 -0
- package/lib/bundle.d.ts +145 -0
- package/lib/bundle.js +546 -0
- package/lib/bundle.js.map +1 -0
- package/lib/client.d.cts +1 -1
- package/lib/client.d.ts +1 -1
- package/lib/commercelayer.cjs +2 -1
- package/lib/commercelayer.cjs.map +1 -1
- package/lib/commercelayer.d.cts +5 -6
- package/lib/commercelayer.d.ts +5 -6
- package/lib/commercelayer.js +2 -2
- package/lib/commercelayer.js.map +1 -1
- package/lib/config.d.cts +1 -1
- package/lib/config.d.ts +1 -1
- package/lib/enum.d.cts +2 -2
- package/lib/enum.d.ts +2 -2
- package/lib/error.cjs.map +1 -1
- package/lib/error.js.map +1 -1
- package/lib/fetch.cjs +2 -0
- package/lib/fetch.cjs.map +1 -1
- package/lib/fetch.d.cts +1 -1
- package/lib/fetch.d.ts +1 -1
- package/lib/fetch.js +2 -0
- package/lib/fetch.js.map +1 -1
- package/lib/index.d.cts +2 -2
- package/lib/index.d.ts +2 -2
- package/lib/{interceptor-5MISI1yn.d.cts → interceptor-k15jXzf0.d.cts} +3 -2
- package/lib/{interceptor-5MISI1yn.d.ts → interceptor-k15jXzf0.d.ts} +3 -2
- package/lib/interceptor.d.cts +1 -1
- package/lib/interceptor.d.ts +1 -1
- package/lib/jsonapi.d.cts +2 -2
- package/lib/jsonapi.d.ts +2 -2
- package/lib/model.d.cts +2 -2
- package/lib/model.d.ts +2 -2
- package/lib/query.d.cts +2 -2
- package/lib/query.d.ts +2 -2
- package/lib/resource.cjs +7 -6
- package/lib/resource.cjs.map +1 -1
- package/lib/resource.d.cts +2 -2
- package/lib/resource.d.ts +2 -2
- package/lib/resource.js +7 -6
- package/lib/resource.js.map +1 -1
- package/lib/resources/addresses.cjs.map +1 -1
- package/lib/resources/addresses.d.cts +2 -2
- package/lib/resources/addresses.d.ts +2 -2
- package/lib/resources/addresses.js.map +1 -1
- package/lib/resources/adjustments.cjs.map +1 -1
- package/lib/resources/adjustments.d.cts +2 -2
- package/lib/resources/adjustments.d.ts +2 -2
- package/lib/resources/adjustments.js.map +1 -1
- package/lib/resources/adyen_gateways.cjs.map +1 -1
- package/lib/resources/adyen_gateways.d.cts +2 -2
- package/lib/resources/adyen_gateways.d.ts +2 -2
- package/lib/resources/adyen_gateways.js.map +1 -1
- package/lib/resources/adyen_payments.cjs.map +1 -1
- package/lib/resources/adyen_payments.d.cts +2 -2
- package/lib/resources/adyen_payments.d.ts +2 -2
- package/lib/resources/adyen_payments.js.map +1 -1
- package/lib/resources/applications.cjs.map +1 -1
- package/lib/resources/applications.d.cts +2 -2
- package/lib/resources/applications.d.ts +2 -2
- package/lib/resources/applications.js.map +1 -1
- package/lib/resources/attachments.cjs.map +1 -1
- package/lib/resources/attachments.d.cts +2 -2
- package/lib/resources/attachments.d.ts +2 -2
- package/lib/resources/attachments.js.map +1 -1
- package/lib/resources/authorizations.cjs.map +1 -1
- package/lib/resources/authorizations.d.cts +2 -2
- package/lib/resources/authorizations.d.ts +2 -2
- package/lib/resources/authorizations.js.map +1 -1
- package/lib/resources/avalara_accounts.cjs.map +1 -1
- package/lib/resources/avalara_accounts.d.cts +2 -2
- package/lib/resources/avalara_accounts.d.ts +2 -2
- package/lib/resources/avalara_accounts.js.map +1 -1
- package/lib/resources/axerve_gateways.cjs.map +1 -1
- package/lib/resources/axerve_gateways.d.cts +2 -2
- package/lib/resources/axerve_gateways.d.ts +2 -2
- package/lib/resources/axerve_gateways.js.map +1 -1
- package/lib/resources/axerve_payments.cjs.map +1 -1
- package/lib/resources/axerve_payments.d.cts +2 -2
- package/lib/resources/axerve_payments.d.ts +2 -2
- package/lib/resources/axerve_payments.js.map +1 -1
- package/lib/resources/bing_geocoders.cjs.map +1 -1
- package/lib/resources/bing_geocoders.d.cts +2 -2
- package/lib/resources/bing_geocoders.d.ts +2 -2
- package/lib/resources/bing_geocoders.js.map +1 -1
- package/lib/resources/braintree_gateways.cjs.map +1 -1
- package/lib/resources/braintree_gateways.d.cts +2 -2
- package/lib/resources/braintree_gateways.d.ts +2 -2
- package/lib/resources/braintree_gateways.js.map +1 -1
- package/lib/resources/braintree_payments.cjs.map +1 -1
- package/lib/resources/braintree_payments.d.cts +2 -2
- package/lib/resources/braintree_payments.d.ts +2 -2
- package/lib/resources/braintree_payments.js.map +1 -1
- package/lib/resources/bundles.cjs.map +1 -1
- package/lib/resources/bundles.d.cts +2 -2
- package/lib/resources/bundles.d.ts +2 -2
- package/lib/resources/bundles.js.map +1 -1
- package/lib/resources/buy_x_pay_y_promotions.cjs.map +1 -1
- package/lib/resources/buy_x_pay_y_promotions.d.cts +2 -2
- package/lib/resources/buy_x_pay_y_promotions.d.ts +2 -2
- package/lib/resources/buy_x_pay_y_promotions.js.map +1 -1
- package/lib/resources/captures.cjs.map +1 -1
- package/lib/resources/captures.d.cts +2 -2
- package/lib/resources/captures.d.ts +2 -2
- package/lib/resources/captures.js.map +1 -1
- package/lib/resources/carrier_accounts.cjs.map +1 -1
- package/lib/resources/carrier_accounts.d.cts +2 -2
- package/lib/resources/carrier_accounts.d.ts +2 -2
- package/lib/resources/carrier_accounts.js.map +1 -1
- package/lib/resources/checkout_com_gateways.cjs.map +1 -1
- package/lib/resources/checkout_com_gateways.d.cts +2 -2
- package/lib/resources/checkout_com_gateways.d.ts +2 -2
- package/lib/resources/checkout_com_gateways.js.map +1 -1
- package/lib/resources/checkout_com_payments.cjs.map +1 -1
- package/lib/resources/checkout_com_payments.d.cts +2 -2
- package/lib/resources/checkout_com_payments.d.ts +2 -2
- package/lib/resources/checkout_com_payments.js.map +1 -1
- package/lib/resources/cleanups.cjs.map +1 -1
- package/lib/resources/cleanups.d.cts +2 -2
- package/lib/resources/cleanups.d.ts +2 -2
- package/lib/resources/cleanups.js.map +1 -1
- package/lib/resources/coupon_codes_promotion_rules.cjs.map +1 -1
- package/lib/resources/coupon_codes_promotion_rules.d.cts +2 -2
- package/lib/resources/coupon_codes_promotion_rules.d.ts +2 -2
- package/lib/resources/coupon_codes_promotion_rules.js.map +1 -1
- package/lib/resources/coupon_recipients.cjs.map +1 -1
- package/lib/resources/coupon_recipients.d.cts +2 -2
- package/lib/resources/coupon_recipients.d.ts +2 -2
- package/lib/resources/coupon_recipients.js.map +1 -1
- package/lib/resources/coupons.cjs.map +1 -1
- package/lib/resources/coupons.d.cts +2 -2
- package/lib/resources/coupons.d.ts +2 -2
- package/lib/resources/coupons.js.map +1 -1
- package/lib/resources/custom_promotion_rules.cjs.map +1 -1
- package/lib/resources/custom_promotion_rules.d.cts +2 -2
- package/lib/resources/custom_promotion_rules.d.ts +2 -2
- package/lib/resources/custom_promotion_rules.js.map +1 -1
- package/lib/resources/customer_addresses.cjs.map +1 -1
- package/lib/resources/customer_addresses.d.cts +2 -2
- package/lib/resources/customer_addresses.d.ts +2 -2
- package/lib/resources/customer_addresses.js.map +1 -1
- package/lib/resources/customer_groups.cjs.map +1 -1
- package/lib/resources/customer_groups.d.cts +2 -2
- package/lib/resources/customer_groups.d.ts +2 -2
- package/lib/resources/customer_groups.js.map +1 -1
- package/lib/resources/customer_password_resets.cjs.map +1 -1
- package/lib/resources/customer_password_resets.d.cts +2 -2
- package/lib/resources/customer_password_resets.d.ts +2 -2
- package/lib/resources/customer_password_resets.js.map +1 -1
- package/lib/resources/customer_payment_sources.cjs.map +1 -1
- package/lib/resources/customer_payment_sources.d.cts +2 -2
- package/lib/resources/customer_payment_sources.d.ts +2 -2
- package/lib/resources/customer_payment_sources.js.map +1 -1
- package/lib/resources/customer_subscriptions.cjs.map +1 -1
- package/lib/resources/customer_subscriptions.d.cts +2 -2
- package/lib/resources/customer_subscriptions.d.ts +2 -2
- package/lib/resources/customer_subscriptions.js.map +1 -1
- package/lib/resources/customers.cjs.map +1 -1
- package/lib/resources/customers.d.cts +2 -2
- package/lib/resources/customers.d.ts +2 -2
- package/lib/resources/customers.js.map +1 -1
- package/lib/resources/delivery_lead_times.cjs.map +1 -1
- package/lib/resources/delivery_lead_times.d.cts +2 -2
- package/lib/resources/delivery_lead_times.d.ts +2 -2
- package/lib/resources/delivery_lead_times.js.map +1 -1
- package/lib/resources/discount_engine_items.cjs.map +1 -1
- package/lib/resources/discount_engine_items.d.cts +2 -2
- package/lib/resources/discount_engine_items.d.ts +2 -2
- package/lib/resources/discount_engine_items.js.map +1 -1
- package/lib/resources/discount_engines.cjs.map +1 -1
- package/lib/resources/discount_engines.d.cts +2 -2
- package/lib/resources/discount_engines.d.ts +2 -2
- package/lib/resources/discount_engines.js.map +1 -1
- package/lib/resources/easypost_pickups.cjs.map +1 -1
- package/lib/resources/easypost_pickups.d.cts +2 -2
- package/lib/resources/easypost_pickups.d.ts +2 -2
- package/lib/resources/easypost_pickups.js.map +1 -1
- package/lib/resources/event_callbacks.cjs.map +1 -1
- package/lib/resources/event_callbacks.d.cts +2 -2
- package/lib/resources/event_callbacks.d.ts +2 -2
- package/lib/resources/event_callbacks.js.map +1 -1
- package/lib/resources/events.cjs.map +1 -1
- package/lib/resources/events.d.cts +2 -2
- package/lib/resources/events.d.ts +2 -2
- package/lib/resources/events.js.map +1 -1
- package/lib/resources/exports.cjs.map +1 -1
- package/lib/resources/exports.d.cts +2 -2
- package/lib/resources/exports.d.ts +2 -2
- package/lib/resources/exports.js.map +1 -1
- package/lib/resources/external_gateways.cjs.map +1 -1
- package/lib/resources/external_gateways.d.cts +2 -2
- package/lib/resources/external_gateways.d.ts +2 -2
- package/lib/resources/external_gateways.js.map +1 -1
- package/lib/resources/external_payments.cjs.map +1 -1
- package/lib/resources/external_payments.d.cts +2 -2
- package/lib/resources/external_payments.d.ts +2 -2
- package/lib/resources/external_payments.js.map +1 -1
- package/lib/resources/external_promotions.cjs.map +1 -1
- package/lib/resources/external_promotions.d.cts +2 -2
- package/lib/resources/external_promotions.d.ts +2 -2
- package/lib/resources/external_promotions.js.map +1 -1
- package/lib/resources/external_tax_calculators.cjs.map +1 -1
- package/lib/resources/external_tax_calculators.d.cts +2 -2
- package/lib/resources/external_tax_calculators.d.ts +2 -2
- package/lib/resources/external_tax_calculators.js.map +1 -1
- package/lib/resources/fixed_amount_promotions.cjs.map +1 -1
- package/lib/resources/fixed_amount_promotions.d.cts +2 -2
- package/lib/resources/fixed_amount_promotions.d.ts +2 -2
- package/lib/resources/fixed_amount_promotions.js.map +1 -1
- package/lib/resources/fixed_price_promotions.cjs.map +1 -1
- package/lib/resources/fixed_price_promotions.d.cts +2 -2
- package/lib/resources/fixed_price_promotions.d.ts +2 -2
- package/lib/resources/fixed_price_promotions.js.map +1 -1
- package/lib/resources/flex_promotions.cjs.map +1 -1
- package/lib/resources/flex_promotions.d.cts +2 -2
- package/lib/resources/flex_promotions.d.ts +2 -2
- package/lib/resources/flex_promotions.js.map +1 -1
- package/lib/resources/free_gift_promotions.cjs.map +1 -1
- package/lib/resources/free_gift_promotions.d.cts +2 -2
- package/lib/resources/free_gift_promotions.d.ts +2 -2
- package/lib/resources/free_gift_promotions.js.map +1 -1
- package/lib/resources/free_shipping_promotions.cjs.map +1 -1
- package/lib/resources/free_shipping_promotions.d.cts +2 -2
- package/lib/resources/free_shipping_promotions.d.ts +2 -2
- package/lib/resources/free_shipping_promotions.js.map +1 -1
- package/lib/resources/geocoders.cjs.map +1 -1
- package/lib/resources/geocoders.d.cts +2 -2
- package/lib/resources/geocoders.d.ts +2 -2
- package/lib/resources/geocoders.js.map +1 -1
- package/lib/resources/gift_card_recipients.cjs.map +1 -1
- package/lib/resources/gift_card_recipients.d.cts +2 -2
- package/lib/resources/gift_card_recipients.d.ts +2 -2
- package/lib/resources/gift_card_recipients.js.map +1 -1
- package/lib/resources/gift_cards.cjs.map +1 -1
- package/lib/resources/gift_cards.d.cts +2 -2
- package/lib/resources/gift_cards.d.ts +2 -2
- package/lib/resources/gift_cards.js.map +1 -1
- package/lib/resources/google_geocoders.cjs.map +1 -1
- package/lib/resources/google_geocoders.d.cts +2 -2
- package/lib/resources/google_geocoders.d.ts +2 -2
- package/lib/resources/google_geocoders.js.map +1 -1
- package/lib/resources/imports.cjs.map +1 -1
- package/lib/resources/imports.d.cts +2 -2
- package/lib/resources/imports.d.ts +2 -2
- package/lib/resources/imports.js.map +1 -1
- package/lib/resources/in_stock_subscriptions.cjs.map +1 -1
- package/lib/resources/in_stock_subscriptions.d.cts +2 -2
- package/lib/resources/in_stock_subscriptions.d.ts +2 -2
- package/lib/resources/in_stock_subscriptions.js.map +1 -1
- package/lib/resources/inventory_models.cjs.map +1 -1
- package/lib/resources/inventory_models.d.cts +2 -2
- package/lib/resources/inventory_models.d.ts +2 -2
- package/lib/resources/inventory_models.js.map +1 -1
- package/lib/resources/inventory_return_locations.cjs.map +1 -1
- package/lib/resources/inventory_return_locations.d.cts +2 -2
- package/lib/resources/inventory_return_locations.d.ts +2 -2
- package/lib/resources/inventory_return_locations.js.map +1 -1
- package/lib/resources/inventory_stock_locations.cjs.map +1 -1
- package/lib/resources/inventory_stock_locations.d.cts +2 -2
- package/lib/resources/inventory_stock_locations.d.ts +2 -2
- package/lib/resources/inventory_stock_locations.js.map +1 -1
- package/lib/resources/klarna_gateways.cjs.map +1 -1
- package/lib/resources/klarna_gateways.d.cts +2 -2
- package/lib/resources/klarna_gateways.d.ts +2 -2
- package/lib/resources/klarna_gateways.js.map +1 -1
- package/lib/resources/klarna_payments.cjs.map +1 -1
- package/lib/resources/klarna_payments.d.cts +2 -2
- package/lib/resources/klarna_payments.d.ts +2 -2
- package/lib/resources/klarna_payments.js.map +1 -1
- package/lib/resources/line_item_options.cjs.map +1 -1
- package/lib/resources/line_item_options.d.cts +2 -2
- package/lib/resources/line_item_options.d.ts +2 -2
- package/lib/resources/line_item_options.js.map +1 -1
- package/lib/resources/line_items.cjs.map +1 -1
- package/lib/resources/line_items.d.cts +2 -2
- package/lib/resources/line_items.d.ts +2 -2
- package/lib/resources/line_items.js.map +1 -1
- package/lib/resources/links.cjs.map +1 -1
- package/lib/resources/links.d.cts +2 -2
- package/lib/resources/links.d.ts +2 -2
- package/lib/resources/links.js.map +1 -1
- package/lib/resources/manual_gateways.cjs.map +1 -1
- package/lib/resources/manual_gateways.d.cts +2 -2
- package/lib/resources/manual_gateways.d.ts +2 -2
- package/lib/resources/manual_gateways.js.map +1 -1
- package/lib/resources/manual_tax_calculators.cjs.map +1 -1
- package/lib/resources/manual_tax_calculators.d.cts +2 -2
- package/lib/resources/manual_tax_calculators.d.ts +2 -2
- package/lib/resources/manual_tax_calculators.js.map +1 -1
- package/lib/resources/markets.cjs +4 -0
- package/lib/resources/markets.cjs.map +1 -1
- package/lib/resources/markets.d.cts +2 -2
- package/lib/resources/markets.d.ts +2 -2
- package/lib/resources/markets.js +4 -0
- package/lib/resources/markets.js.map +1 -1
- package/lib/resources/merchants.cjs.map +1 -1
- package/lib/resources/merchants.d.cts +2 -2
- package/lib/resources/merchants.d.ts +2 -2
- package/lib/resources/merchants.js.map +1 -1
- package/lib/resources/notifications.cjs.map +1 -1
- package/lib/resources/notifications.d.cts +2 -2
- package/lib/resources/notifications.d.ts +2 -2
- package/lib/resources/notifications.js.map +1 -1
- package/lib/resources/order_amount_promotion_rules.cjs.map +1 -1
- package/lib/resources/order_amount_promotion_rules.d.cts +2 -2
- package/lib/resources/order_amount_promotion_rules.d.ts +2 -2
- package/lib/resources/order_amount_promotion_rules.js.map +1 -1
- package/lib/resources/order_copies.cjs.map +1 -1
- package/lib/resources/order_copies.d.cts +2 -2
- package/lib/resources/order_copies.d.ts +2 -2
- package/lib/resources/order_copies.js.map +1 -1
- package/lib/resources/order_factories.cjs.map +1 -1
- package/lib/resources/order_factories.d.cts +2 -2
- package/lib/resources/order_factories.d.ts +2 -2
- package/lib/resources/order_factories.js.map +1 -1
- package/lib/resources/order_subscription_items.cjs.map +1 -1
- package/lib/resources/order_subscription_items.d.cts +2 -2
- package/lib/resources/order_subscription_items.d.ts +2 -2
- package/lib/resources/order_subscription_items.js.map +1 -1
- package/lib/resources/order_subscriptions.cjs.map +1 -1
- package/lib/resources/order_subscriptions.d.cts +2 -2
- package/lib/resources/order_subscriptions.d.ts +2 -2
- package/lib/resources/order_subscriptions.js.map +1 -1
- package/lib/resources/orders.cjs +4 -0
- package/lib/resources/orders.cjs.map +1 -1
- package/lib/resources/orders.d.cts +2 -2
- package/lib/resources/orders.d.ts +2 -2
- package/lib/resources/orders.js +4 -0
- package/lib/resources/orders.js.map +1 -1
- package/lib/resources/organizations.cjs.map +1 -1
- package/lib/resources/organizations.d.cts +2 -2
- package/lib/resources/organizations.d.ts +2 -2
- package/lib/resources/organizations.js.map +1 -1
- package/lib/resources/packages.cjs.map +1 -1
- package/lib/resources/packages.d.cts +2 -2
- package/lib/resources/packages.d.ts +2 -2
- package/lib/resources/packages.js.map +1 -1
- package/lib/resources/parcel_line_items.cjs.map +1 -1
- package/lib/resources/parcel_line_items.d.cts +2 -2
- package/lib/resources/parcel_line_items.d.ts +2 -2
- package/lib/resources/parcel_line_items.js.map +1 -1
- package/lib/resources/parcels.cjs.map +1 -1
- package/lib/resources/parcels.d.cts +2 -2
- package/lib/resources/parcels.d.ts +2 -2
- package/lib/resources/parcels.js.map +1 -1
- package/lib/resources/payment_gateways.cjs.map +1 -1
- package/lib/resources/payment_gateways.d.cts +2 -2
- package/lib/resources/payment_gateways.d.ts +2 -2
- package/lib/resources/payment_gateways.js.map +1 -1
- package/lib/resources/payment_methods.cjs.map +1 -1
- package/lib/resources/payment_methods.d.cts +2 -2
- package/lib/resources/payment_methods.d.ts +2 -2
- package/lib/resources/payment_methods.js.map +1 -1
- package/lib/resources/payment_options.cjs.map +1 -1
- package/lib/resources/payment_options.d.cts +2 -2
- package/lib/resources/payment_options.d.ts +2 -2
- package/lib/resources/payment_options.js.map +1 -1
- package/lib/resources/paypal_gateways.cjs.map +1 -1
- package/lib/resources/paypal_gateways.d.cts +2 -2
- package/lib/resources/paypal_gateways.d.ts +2 -2
- package/lib/resources/paypal_gateways.js.map +1 -1
- package/lib/resources/paypal_payments.cjs.map +1 -1
- package/lib/resources/paypal_payments.d.cts +2 -2
- package/lib/resources/paypal_payments.d.ts +2 -2
- package/lib/resources/paypal_payments.js.map +1 -1
- package/lib/resources/percentage_discount_promotions.cjs.map +1 -1
- package/lib/resources/percentage_discount_promotions.d.cts +2 -2
- package/lib/resources/percentage_discount_promotions.d.ts +2 -2
- package/lib/resources/percentage_discount_promotions.js.map +1 -1
- package/lib/resources/pickups.cjs.map +1 -1
- package/lib/resources/pickups.d.cts +2 -2
- package/lib/resources/pickups.d.ts +2 -2
- package/lib/resources/pickups.js.map +1 -1
- package/lib/resources/price_frequency_tiers.cjs.map +1 -1
- package/lib/resources/price_frequency_tiers.d.cts +2 -2
- package/lib/resources/price_frequency_tiers.d.ts +2 -2
- package/lib/resources/price_frequency_tiers.js.map +1 -1
- package/lib/resources/price_list_schedulers.cjs.map +1 -1
- package/lib/resources/price_list_schedulers.d.cts +2 -2
- package/lib/resources/price_list_schedulers.d.ts +2 -2
- package/lib/resources/price_list_schedulers.js.map +1 -1
- package/lib/resources/price_lists.cjs.map +1 -1
- package/lib/resources/price_lists.d.cts +2 -2
- package/lib/resources/price_lists.d.ts +2 -2
- package/lib/resources/price_lists.js.map +1 -1
- package/lib/resources/price_tiers.cjs.map +1 -1
- package/lib/resources/price_tiers.d.cts +2 -2
- package/lib/resources/price_tiers.d.ts +2 -2
- package/lib/resources/price_tiers.js.map +1 -1
- package/lib/resources/price_volume_tiers.cjs.map +1 -1
- package/lib/resources/price_volume_tiers.d.cts +2 -2
- package/lib/resources/price_volume_tiers.d.ts +2 -2
- package/lib/resources/price_volume_tiers.js.map +1 -1
- package/lib/resources/prices.cjs.map +1 -1
- package/lib/resources/prices.d.cts +2 -2
- package/lib/resources/prices.d.ts +2 -2
- package/lib/resources/prices.js.map +1 -1
- package/lib/resources/promotion_rules.cjs.map +1 -1
- package/lib/resources/promotion_rules.d.cts +2 -2
- package/lib/resources/promotion_rules.d.ts +2 -2
- package/lib/resources/promotion_rules.js.map +1 -1
- package/lib/resources/promotions.cjs.map +1 -1
- package/lib/resources/promotions.d.cts +2 -2
- package/lib/resources/promotions.d.ts +2 -2
- package/lib/resources/promotions.js.map +1 -1
- package/lib/resources/recurring_order_copies.cjs.map +1 -1
- package/lib/resources/recurring_order_copies.d.cts +2 -2
- package/lib/resources/recurring_order_copies.d.ts +2 -2
- package/lib/resources/recurring_order_copies.js.map +1 -1
- package/lib/resources/refunds.cjs.map +1 -1
- package/lib/resources/refunds.d.cts +2 -2
- package/lib/resources/refunds.d.ts +2 -2
- package/lib/resources/refunds.js.map +1 -1
- package/lib/resources/reserved_stocks.cjs.map +1 -1
- package/lib/resources/reserved_stocks.d.cts +2 -2
- package/lib/resources/reserved_stocks.d.ts +2 -2
- package/lib/resources/reserved_stocks.js.map +1 -1
- package/lib/resources/resource_errors.cjs.map +1 -1
- package/lib/resources/resource_errors.d.cts +2 -2
- package/lib/resources/resource_errors.d.ts +2 -2
- package/lib/resources/resource_errors.js.map +1 -1
- package/lib/resources/return_line_items.cjs.map +1 -1
- package/lib/resources/return_line_items.d.cts +2 -2
- package/lib/resources/return_line_items.d.ts +2 -2
- package/lib/resources/return_line_items.js.map +1 -1
- package/lib/resources/returns.cjs.map +1 -1
- package/lib/resources/returns.d.cts +2 -2
- package/lib/resources/returns.d.ts +2 -2
- package/lib/resources/returns.js.map +1 -1
- package/lib/resources/satispay_gateways.cjs.map +1 -1
- package/lib/resources/satispay_gateways.d.cts +2 -2
- package/lib/resources/satispay_gateways.d.ts +2 -2
- package/lib/resources/satispay_gateways.js.map +1 -1
- package/lib/resources/satispay_payments.cjs.map +1 -1
- package/lib/resources/satispay_payments.d.cts +2 -2
- package/lib/resources/satispay_payments.d.ts +2 -2
- package/lib/resources/satispay_payments.js.map +1 -1
- package/lib/resources/shipments.cjs.map +1 -1
- package/lib/resources/shipments.d.cts +2 -2
- package/lib/resources/shipments.d.ts +2 -2
- package/lib/resources/shipments.js.map +1 -1
- package/lib/resources/shipping_categories.cjs.map +1 -1
- package/lib/resources/shipping_categories.d.cts +2 -2
- package/lib/resources/shipping_categories.d.ts +2 -2
- package/lib/resources/shipping_categories.js.map +1 -1
- package/lib/resources/shipping_method_tiers.cjs.map +1 -1
- package/lib/resources/shipping_method_tiers.d.cts +2 -2
- package/lib/resources/shipping_method_tiers.d.ts +2 -2
- package/lib/resources/shipping_method_tiers.js.map +1 -1
- package/lib/resources/shipping_methods.cjs.map +1 -1
- package/lib/resources/shipping_methods.d.cts +2 -2
- package/lib/resources/shipping_methods.d.ts +2 -2
- package/lib/resources/shipping_methods.js.map +1 -1
- package/lib/resources/shipping_weight_tiers.cjs.map +1 -1
- package/lib/resources/shipping_weight_tiers.d.cts +2 -2
- package/lib/resources/shipping_weight_tiers.d.ts +2 -2
- package/lib/resources/shipping_weight_tiers.js.map +1 -1
- package/lib/resources/shipping_zones.cjs.map +1 -1
- package/lib/resources/shipping_zones.d.cts +2 -2
- package/lib/resources/shipping_zones.d.ts +2 -2
- package/lib/resources/shipping_zones.js.map +1 -1
- package/lib/resources/sku_list_items.cjs.map +1 -1
- package/lib/resources/sku_list_items.d.cts +2 -2
- package/lib/resources/sku_list_items.d.ts +2 -2
- package/lib/resources/sku_list_items.js.map +1 -1
- package/lib/resources/sku_list_promotion_rules.cjs.map +1 -1
- package/lib/resources/sku_list_promotion_rules.d.cts +2 -2
- package/lib/resources/sku_list_promotion_rules.d.ts +2 -2
- package/lib/resources/sku_list_promotion_rules.js.map +1 -1
- package/lib/resources/sku_lists.cjs.map +1 -1
- package/lib/resources/sku_lists.d.cts +2 -2
- package/lib/resources/sku_lists.d.ts +2 -2
- package/lib/resources/sku_lists.js.map +1 -1
- package/lib/resources/sku_options.cjs.map +1 -1
- package/lib/resources/sku_options.d.cts +2 -2
- package/lib/resources/sku_options.d.ts +2 -2
- package/lib/resources/sku_options.js.map +1 -1
- package/lib/resources/skus.cjs.map +1 -1
- package/lib/resources/skus.d.cts +2 -2
- package/lib/resources/skus.d.ts +2 -2
- package/lib/resources/skus.js.map +1 -1
- package/lib/resources/stock_items.cjs.map +1 -1
- package/lib/resources/stock_items.d.cts +2 -2
- package/lib/resources/stock_items.d.ts +2 -2
- package/lib/resources/stock_items.js.map +1 -1
- package/lib/resources/stock_line_items.cjs.map +1 -1
- package/lib/resources/stock_line_items.d.cts +2 -2
- package/lib/resources/stock_line_items.d.ts +2 -2
- package/lib/resources/stock_line_items.js.map +1 -1
- package/lib/resources/stock_locations.cjs.map +1 -1
- package/lib/resources/stock_locations.d.cts +2 -2
- package/lib/resources/stock_locations.d.ts +2 -2
- package/lib/resources/stock_locations.js.map +1 -1
- package/lib/resources/stock_reservations.cjs.map +1 -1
- package/lib/resources/stock_reservations.d.cts +2 -2
- package/lib/resources/stock_reservations.d.ts +2 -2
- package/lib/resources/stock_reservations.js.map +1 -1
- package/lib/resources/stock_transfers.cjs.map +1 -1
- package/lib/resources/stock_transfers.d.cts +2 -2
- package/lib/resources/stock_transfers.d.ts +2 -2
- package/lib/resources/stock_transfers.js.map +1 -1
- package/lib/resources/stores.cjs.map +1 -1
- package/lib/resources/stores.d.cts +2 -2
- package/lib/resources/stores.d.ts +2 -2
- package/lib/resources/stores.js.map +1 -1
- package/lib/resources/stripe_gateways.cjs.map +1 -1
- package/lib/resources/stripe_gateways.d.cts +2 -2
- package/lib/resources/stripe_gateways.d.ts +2 -2
- package/lib/resources/stripe_gateways.js.map +1 -1
- package/lib/resources/stripe_payments.cjs.map +1 -1
- package/lib/resources/stripe_payments.d.cts +2 -2
- package/lib/resources/stripe_payments.d.ts +2 -2
- package/lib/resources/stripe_payments.js.map +1 -1
- package/lib/resources/stripe_tax_accounts.cjs.map +1 -1
- package/lib/resources/stripe_tax_accounts.d.cts +2 -2
- package/lib/resources/stripe_tax_accounts.d.ts +2 -2
- package/lib/resources/stripe_tax_accounts.js.map +1 -1
- package/lib/resources/subscription_models.cjs.map +1 -1
- package/lib/resources/subscription_models.d.cts +2 -2
- package/lib/resources/subscription_models.d.ts +2 -2
- package/lib/resources/subscription_models.js.map +1 -1
- package/lib/resources/tags.cjs.map +1 -1
- package/lib/resources/tags.d.cts +2 -2
- package/lib/resources/tags.d.ts +2 -2
- package/lib/resources/tags.js.map +1 -1
- package/lib/resources/talon_one_accounts.cjs.map +1 -1
- package/lib/resources/talon_one_accounts.d.cts +2 -2
- package/lib/resources/talon_one_accounts.d.ts +2 -2
- package/lib/resources/talon_one_accounts.js.map +1 -1
- package/lib/resources/tax_calculators.cjs.map +1 -1
- package/lib/resources/tax_calculators.d.cts +2 -2
- package/lib/resources/tax_calculators.d.ts +2 -2
- package/lib/resources/tax_calculators.js.map +1 -1
- package/lib/resources/tax_categories.cjs.map +1 -1
- package/lib/resources/tax_categories.d.cts +2 -2
- package/lib/resources/tax_categories.d.ts +2 -2
- package/lib/resources/tax_categories.js.map +1 -1
- package/lib/resources/tax_rules.cjs.map +1 -1
- package/lib/resources/tax_rules.d.cts +2 -2
- package/lib/resources/tax_rules.d.ts +2 -2
- package/lib/resources/tax_rules.js.map +1 -1
- package/lib/resources/taxjar_accounts.cjs.map +1 -1
- package/lib/resources/taxjar_accounts.d.cts +2 -2
- package/lib/resources/taxjar_accounts.d.ts +2 -2
- package/lib/resources/taxjar_accounts.js.map +1 -1
- package/lib/resources/transactions.cjs.map +1 -1
- package/lib/resources/transactions.d.cts +2 -2
- package/lib/resources/transactions.d.ts +2 -2
- package/lib/resources/transactions.js.map +1 -1
- package/lib/resources/versions.cjs.map +1 -1
- package/lib/resources/versions.d.cts +2 -2
- package/lib/resources/versions.d.ts +2 -2
- package/lib/resources/versions.js.map +1 -1
- package/lib/resources/vertex_accounts.cjs.map +1 -1
- package/lib/resources/vertex_accounts.d.cts +2 -2
- package/lib/resources/vertex_accounts.d.ts +2 -2
- package/lib/resources/vertex_accounts.js.map +1 -1
- package/lib/resources/voids.cjs.map +1 -1
- package/lib/resources/voids.d.cts +2 -2
- package/lib/resources/voids.d.ts +2 -2
- package/lib/resources/voids.js.map +1 -1
- package/lib/resources/webhooks.cjs.map +1 -1
- package/lib/resources/webhooks.d.cts +2 -2
- package/lib/resources/webhooks.d.ts +2 -2
- package/lib/resources/webhooks.js.map +1 -1
- package/lib/resources/wire_transfers.cjs.map +1 -1
- package/lib/resources/wire_transfers.d.cts +2 -2
- package/lib/resources/wire_transfers.d.ts +2 -2
- package/lib/resources/wire_transfers.js.map +1 -1
- package/lib/static.d.cts +2 -2
- package/lib/static.d.ts +2 -2
- package/package.json +15 -4
@@ -1 +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,EA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AiC,EAAA,MAAA,EAAmC,OAA2D,EAAA;AAC7I,IAAM,MAAA,YAAA,GAAgB,YAA0B,EAAM,IAAA,WAAA;AACtD,IAAO,OAAA,IAAA,CAAK,SAAU,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"]}
|
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,M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uD,EAAA;AACjI,IAAM,MAAA,YAAA,GAAgB,YAA0B,EAAM,IAAA,WAAA;AACtD,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAW,EAAE,IAAA,EAAM,MAAO,EAAA,EAAG,CAAc,WAAA,EAAA,YAAY,CAAS,KAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACtG,EAEA,MAAM,QAAA,CAAS,WAAiC,EAAA,MAAA,EAAmC,OAA2D,EAAA;AAC7I,IAAM,MAAA,YAAA,GAAgB,YAA0B,EAAM,IAAA,WAAA;AACtD,IAAO,OAAA,IAAA,CAAK,SAAU,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 { Promotions, Promotion, PromotionType }\n"]}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export {
|
1
|
+
export { j3 as Promotion, j4 as PromotionSort, mW as PromotionType, cy as Promotions, cx as default } from '../api-IwWtsAqE.cjs';
|
2
2
|
import '../client.cjs';
|
3
|
-
import '../interceptor-
|
3
|
+
import '../interceptor-k15jXzf0.cjs';
|
4
4
|
import '../types.cjs';
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export {
|
1
|
+
export { j3 as Promotion, j4 as PromotionSort, mW as PromotionType, cy as Promotions, cx as default } from '../api-F1F37Dud.js';
|
2
2
|
import '../client.js';
|
3
|
-
import '../interceptor-
|
3
|
+
import '../interceptor-k15jXzf0.js';
|
4
4
|
import '../types.js';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/resources/promotions.ts"],"names":[],"mappings":";;AAsGA,MAAM,mBAAmB,WAAuB,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,YAA0B,EAAM,IAAA,WAAA;AACtD,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAA4B,EAAE,IAAA,EAAM,0BAA2B,EAAA,EAAG,CA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O,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.js","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"]}
|
1
|
+
{"version":3,"sources":["../../src/resources/promotions.ts"],"names":[],"mappings":";;AAsGA,MAAM,mBAAmB,WAAuB,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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,WAAiC,EAAA,MAAA,EAAmC,OAA2D,EAAA;AAC7I,IAAM,MAAA,YAAA,GAAgB,YAA0B,EAAM,IAAA,WAAA;AACtD,IAAO,OAAA,IAAA,CAAK,SAAU,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.js","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 { Promotions, Promotion, PromotionType }\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/resources/recurring_order_copies.ts"],"names":["ApiResource"],"mappings":";;;;AA8FA,MAAM,6BAA6BA,oBAAgC,CAAA;AAAA,EAElE,OAAgB,IAA+B,GAAA,wBAAA;AAAA,EAE/C,MAAM,MAAA,CAAO,QAAoC,EAAA,MAAA,EAAkD,OAAwD,EAAA;AAC1J,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAAqD,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,oBAAqB,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC7I,EAEA,MAAM,MAAA,CAAO,QAAoC,EAAA,MAAA,E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AS,EAAA,EAAG,CAA0B,uBAAA,EAAA,qBAAqB,CAAW,OAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACjI,EAEA,MAAM,kBAAA,CAAmB,oBAAmD,EAAA,MAAA,EAAiD,OAAuD,EAAA;AACnL,IAAM,MAAA,qBAAA,GAAyB,qBAA4C,EAAM,IAAA,oBAAA;AACjF,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAyB,EAAE,IAAA,EAAM,qBAAsB,EAAA,EAAG,CAA0B,uBAAA,EAAA,qBAAqB,CAAuB,mBAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACtK,EAGA,qBAAqB,QAA+C,EAAA;AACnE,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,oBAAqB,CAAA,IAAA;AAAA;AACjE,EAGA,aAAa,EAAuD,EAAA;AACnE,IAAO,OAAA,KAAA,CAAM,qBAA4C,EAAE,CAAA;AAAA;AAC5D,EAEA,sBAAsB,GAAwC,EAAA;AAC7D,IAAO,OAAA,KAAA,CAAM,qBAA6C,CAAA,GAAG,GAAG,CAAA;AAAA;AACjE,EAGA,IAA+B,GAAA;AAC9B,IAAA,OAAO,oBAAqB,CAAA,IAAA;AAAA;AAG9B;AAGA,MAAM,QAAA,GAAW,IAAI,oBAAqB,EAAA;AAC1C,IAAO,8BAAQ,GAAA","file":"recurring_order_copies.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 { Order, OrderType } from './orders'\nimport type { Event } from './events'\nimport type { OrderSubscription, OrderSubscriptionType } from './order_subscriptions'\n\n\ntype RecurringOrderCopyType = 'recurring_order_copies'\ntype RecurringOrderCopyRel = ResourceRel & { type: RecurringOrderCopyType }\ntype OrderRel = ResourceRel & { type: OrderType }\ntype OrderSubscriptionRel = ResourceRel & { type: OrderSubscriptionType }\n\n\nexport type RecurringOrderCopySort = Pick<RecurringOrderCopy, 'id' | 'status' | 'started_at' | 'completed_at' | 'failed_at' | 'errors_count'> & ResourceSort\n// export type RecurringOrderCopyFilter = Pick<RecurringOrderCopy, 'id' | 'status' | 'started_at' | 'completed_at' | 'failed_at' | 'errors_count'> & ResourceFilter\n\n\ninterface RecurringOrderCopy extends Resource {\n\t\n\treadonly type: RecurringOrderCopyType\n\n\t/** \n\t * The order factory status. One of 'pending' (default), 'in_progress', 'aborted', 'failed', or 'completed'.\n\t * @example ```\"in_progress\"```\n\t */\n\tstatus: 'pending' | 'in_progress' | 'aborted' | 'failed' | 'completed'\n\t/** \n\t * Time at which the order copy was started.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarted_at?: string | null\n\t/** \n\t * Time at which the order copy was completed.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tcompleted_at?: string | null\n\t/** \n\t * Time at which the order copy has failed.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tfailed_at?: string | null\n\t/** \n\t * Contains the order copy errors, if any.\n\t * @example ```{\"status\":[\"cannot transition from draft to placed\"]}```\n\t */\n\terrors_log?: Record<string, any> | null\n\t/** \n\t * Indicates the number of copy errors, if any.\n\t * @example ```2```\n\t */\n\terrors_count?: number | null\n\t/** \n\t * Indicates if the target order must be placed upon copy.\n\t * @example ```true```\n\t */\n\tplace_target_order?: boolean | null\n\t/** \n\t * Indicates if the payment source within the source order customer's wallet must be copied.\n\t * @example ```true```\n\t */\n\treuse_wallet?: boolean | null\n\n\tsource_order?: Order | null\n\ttarget_order?: Order | null\n\tevents?: Event[] | null\n\torder_subscription?: OrderSubscription | null\n\n}\n\n\ninterface RecurringOrderCopyCreate extends ResourceCreate {\n\t\n\t/** \n\t * Indicates if the target order must be placed upon copy.\n\t * @example ```true```\n\t */\n\tplace_target_order?: boolean | null\n\t/** \n\t * Indicates if the payment source within the source order customer's wallet must be copied.\n\t * @example ```true```\n\t */\n\treuse_wallet?: boolean | null\n\n\tsource_order: OrderRel\n\torder_subscription: OrderSubscriptionRel\n\n}\n\n\ntype RecurringOrderCopyUpdate = ResourceUpdate\n\n\nclass RecurringOrderCopies extends ApiResource<RecurringOrderCopy> {\n\n\tstatic readonly TYPE: RecurringOrderCopyType = 'recurring_order_copies' as const\n\n\tasync create(resource: RecurringOrderCopyCreate, params?: QueryParamsRetrieve<RecurringOrderCopy>, options?: ResourcesConfig): Promise<RecurringOrderCopy> {\n\t\treturn this.resources.create<RecurringOrderCopyCreate, RecurringOrderCopy>({ ...resource, type: RecurringOrderCopies.TYPE }, params, options)\n\t}\n\n\tasync update(resource: RecurringOrderCopyUpdate, params?: QueryParamsRetrieve<RecurringOrderCopy>, options?: ResourcesConfig): Promise<RecurringOrderCopy> {\n\t\treturn this.resources.update<RecurringOrderCopyUpdate, RecurringOrderCopy>({ ...resource, type: RecurringOrderCopies.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: RecurringOrderCopies.TYPE } : id, options)\n\t}\n\n\tasync source_order(recurringOrderCopyId: string | RecurringOrderCopy, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _recurringOrderCopyId = (recurringOrderCopyId as RecurringOrderCopy).id || recurringOrderCopyId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `recurring_order_copies/${_recurringOrderCopyId}/source_order`, params, options) as unknown as Order\n\t}\n\n\tasync target_order(recurringOrderCopyId: string | RecurringOrderCopy, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _recurringOrderCopyId = (recurringOrderCopyId as RecurringOrderCopy).id || recurringOrderCopyId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `recurring_order_copies/${_recurringOrderCopyId}/target_order`, params, options) as unknown as Order\n\t}\n\n\tasync events(recurringOrderCopyId: string | RecurringOrderCopy, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _recurringOrderCopyId = (recurringOrderCopyId as RecurringOrderCopy).id || recurringOrderCopyId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `recurring_order_copies/${_recurringOrderCopyId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync order_subscription(recurringOrderCopyId: string | RecurringOrderCopy, params?: QueryParamsRetrieve<OrderSubscription>, options?: ResourcesConfig): Promise<OrderSubscription> {\n\t\tconst _recurringOrderCopyId = (recurringOrderCopyId as RecurringOrderCopy).id || recurringOrderCopyId as string\n\t\treturn this.resources.fetch<OrderSubscription>({ type: 'order_subscriptions' }, `recurring_order_copies/${_recurringOrderCopyId}/order_subscription`, params, options) as unknown as OrderSubscription\n\t}\n\n\n\tisRecurringOrderCopy(resource: any): resource is RecurringOrderCopy {\n\t\treturn resource.type && (resource.type === RecurringOrderCopies.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): RecurringOrderCopyRel {\n\t\treturn super.relationshipOneToOne<RecurringOrderCopyRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): RecurringOrderCopyRel[] {\n\t\treturn super.relationshipOneToMany<RecurringOrderCopyRel>(...ids)\n\t}\n\n\n\ttype(): RecurringOrderCopyType {\n\t\treturn RecurringOrderCopies.TYPE\n\t}\n\n}\n\n\nconst instance = new RecurringOrderCopies()\nexport default instance\n\nexport type { RecurringOrderCopy, RecurringOrderCopyCreate, RecurringOrderCopyUpdate, RecurringOrderCopyType }\n"]}
|
1
|
+
{"version":3,"sources":["../../src/resources/recurring_order_copies.ts"],"names":["ApiResource"],"mappings":";;;;AA8FA,MAAM,6BAA6BA,oBAAgC,CAAA;AAAA,EAElE,OAAgB,IAA+B,GAAA,wBAAA;AAAA,EAE/C,MAAM,M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iB,aAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACvI,EAEA,MAAM,MAAA,CAAO,oBAAmD,EAAA,MAAA,EAAiC,OAAyD,EAAA;AACzJ,IAAM,MAAA,qBAAA,GAAyB,qBAA4C,EAAM,IAAA,oBAAA;AACjF,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAa,EAAE,IAAA,EAAM,QAAS,EAAA,EAAG,CAA0B,uBAAA,EAAA,qBAAqB,CAAW,OAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACjI,EAEA,MAAM,kBAAA,CAAmB,oBAAmD,EAAA,MAAA,EAAiD,OAAuD,EAAA;AACnL,IAAM,MAAA,qBAAA,GAAyB,qBAA4C,EAAM,IAAA,oBAAA;AACjF,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAyB,EAAE,IAAA,EAAM,qBAAsB,EAAA,EAAG,CAA0B,uBAAA,EAAA,qBAAqB,CAAuB,mBAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACtK,EAGA,qBAAqB,QAA+C,EAAA;AACnE,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,oBAAqB,CAAA,IAAA;AAAA;AACjE,EAGA,aAAa,EAAuD,EAAA;AACnE,IAAO,OAAA,KAAA,CAAM,qBAA4C,EAAE,CAAA;AAAA;AAC5D,EAEA,sBAAsB,GAAwC,EAAA;AAC7D,IAAO,OAAA,KAAA,CAAM,qBAA6C,CAAA,GAAG,GAAG,CAAA;AAAA;AACjE,EAGA,IAA+B,GAAA;AAC9B,IAAA,OAAO,oBAAqB,CAAA,IAAA;AAAA;AAG9B;AAGA,MAAM,QAAA,GAAW,IAAI,oBAAqB,EAAA;AAC1C,IAAO,8BAAQ,GAAA","file":"recurring_order_copies.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 { Order, OrderType } from './orders'\nimport type { Event } from './events'\nimport type { OrderSubscription, OrderSubscriptionType } from './order_subscriptions'\n\n\ntype RecurringOrderCopyType = 'recurring_order_copies'\ntype RecurringOrderCopyRel = ResourceRel & { type: RecurringOrderCopyType }\ntype OrderRel = ResourceRel & { type: OrderType }\ntype OrderSubscriptionRel = ResourceRel & { type: OrderSubscriptionType }\n\n\nexport type RecurringOrderCopySort = Pick<RecurringOrderCopy, 'id' | 'status' | 'started_at' | 'completed_at' | 'failed_at' | 'errors_count'> & ResourceSort\n// export type RecurringOrderCopyFilter = Pick<RecurringOrderCopy, 'id' | 'status' | 'started_at' | 'completed_at' | 'failed_at' | 'errors_count'> & ResourceFilter\n\n\ninterface RecurringOrderCopy extends Resource {\n\t\n\treadonly type: RecurringOrderCopyType\n\n\t/** \n\t * The order factory status. One of 'pending' (default), 'in_progress', 'aborted', 'failed', or 'completed'.\n\t * @example ```\"in_progress\"```\n\t */\n\tstatus: 'pending' | 'in_progress' | 'aborted' | 'failed' | 'completed'\n\t/** \n\t * Time at which the order copy was started.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarted_at?: string | null\n\t/** \n\t * Time at which the order copy was completed.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tcompleted_at?: string | null\n\t/** \n\t * Time at which the order copy has failed.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tfailed_at?: string | null\n\t/** \n\t * Contains the order copy errors, if any.\n\t * @example ```{\"status\":[\"cannot transition from draft to placed\"]}```\n\t */\n\terrors_log?: Record<string, any> | null\n\t/** \n\t * Indicates the number of copy errors, if any.\n\t * @example ```2```\n\t */\n\terrors_count?: number | null\n\t/** \n\t * Indicates if the target order must be placed upon copy.\n\t * @example ```true```\n\t */\n\tplace_target_order?: boolean | null\n\t/** \n\t * Indicates if the payment source within the source order customer's wallet must be copied.\n\t * @example ```true```\n\t */\n\treuse_wallet?: boolean | null\n\n\tsource_order?: Order | null\n\ttarget_order?: Order | null\n\tevents?: Event[] | null\n\torder_subscription?: OrderSubscription | null\n\n}\n\n\ninterface RecurringOrderCopyCreate extends ResourceCreate {\n\t\n\t/** \n\t * Indicates if the target order must be placed upon copy.\n\t * @example ```true```\n\t */\n\tplace_target_order?: boolean | null\n\t/** \n\t * Indicates if the payment source within the source order customer's wallet must be copied.\n\t * @example ```true```\n\t */\n\treuse_wallet?: boolean | null\n\n\tsource_order: OrderRel\n\torder_subscription: OrderSubscriptionRel\n\n}\n\n\ntype RecurringOrderCopyUpdate = ResourceUpdate\n\n\nclass RecurringOrderCopies extends ApiResource<RecurringOrderCopy> {\n\n\tstatic readonly TYPE: RecurringOrderCopyType = 'recurring_order_copies' as const\n\n\tasync create(resource: RecurringOrderCopyCreate, params?: QueryParamsRetrieve<RecurringOrderCopy>, options?: ResourcesConfig): Promise<RecurringOrderCopy> {\n\t\treturn this.resources.create<RecurringOrderCopyCreate, RecurringOrderCopy>({ ...resource, type: RecurringOrderCopies.TYPE }, params, options)\n\t}\n\n\tasync update(resource: RecurringOrderCopyUpdate, params?: QueryParamsRetrieve<RecurringOrderCopy>, options?: ResourcesConfig): Promise<RecurringOrderCopy> {\n\t\treturn this.resources.update<RecurringOrderCopyUpdate, RecurringOrderCopy>({ ...resource, type: RecurringOrderCopies.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: RecurringOrderCopies.TYPE } : id, options)\n\t}\n\n\tasync source_order(recurringOrderCopyId: string | RecurringOrderCopy, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _recurringOrderCopyId = (recurringOrderCopyId as RecurringOrderCopy).id || recurringOrderCopyId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `recurring_order_copies/${_recurringOrderCopyId}/source_order`, params, options) as unknown as Order\n\t}\n\n\tasync target_order(recurringOrderCopyId: string | RecurringOrderCopy, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _recurringOrderCopyId = (recurringOrderCopyId as RecurringOrderCopy).id || recurringOrderCopyId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `recurring_order_copies/${_recurringOrderCopyId}/target_order`, params, options) as unknown as Order\n\t}\n\n\tasync events(recurringOrderCopyId: string | RecurringOrderCopy, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _recurringOrderCopyId = (recurringOrderCopyId as RecurringOrderCopy).id || recurringOrderCopyId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `recurring_order_copies/${_recurringOrderCopyId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync order_subscription(recurringOrderCopyId: string | RecurringOrderCopy, params?: QueryParamsRetrieve<OrderSubscription>, options?: ResourcesConfig): Promise<OrderSubscription> {\n\t\tconst _recurringOrderCopyId = (recurringOrderCopyId as RecurringOrderCopy).id || recurringOrderCopyId as string\n\t\treturn this.resources.fetch<OrderSubscription>({ type: 'order_subscriptions' }, `recurring_order_copies/${_recurringOrderCopyId}/order_subscription`, params, options) as unknown as OrderSubscription\n\t}\n\n\n\tisRecurringOrderCopy(resource: any): resource is RecurringOrderCopy {\n\t\treturn resource.type && (resource.type === RecurringOrderCopies.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): RecurringOrderCopyRel {\n\t\treturn super.relationshipOneToOne<RecurringOrderCopyRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): RecurringOrderCopyRel[] {\n\t\treturn super.relationshipOneToMany<RecurringOrderCopyRel>(...ids)\n\t}\n\n\n\ttype(): RecurringOrderCopyType {\n\t\treturn RecurringOrderCopies.TYPE\n\t}\n\n}\n\n\nconst instance = new RecurringOrderCopies()\nexport default instance\n\nexport type { RecurringOrderCopies, RecurringOrderCopy, RecurringOrderCopyCreate, RecurringOrderCopyUpdate, RecurringOrderCopyType }\n"]}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export {
|
1
|
+
export { cA as RecurringOrderCopies, j5 as RecurringOrderCopy, j6 as RecurringOrderCopyCreate, j8 as RecurringOrderCopySort, my as RecurringOrderCopyType, j7 as RecurringOrderCopyUpdate, cz as default } from '../api-IwWtsAqE.cjs';
|
2
2
|
import '../client.cjs';
|
3
|
-
import '../interceptor-
|
3
|
+
import '../interceptor-k15jXzf0.cjs';
|
4
4
|
import '../types.cjs';
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export {
|
1
|
+
export { cA as RecurringOrderCopies, j5 as RecurringOrderCopy, j6 as RecurringOrderCopyCreate, j8 as RecurringOrderCopySort, my as RecurringOrderCopyType, j7 as RecurringOrderCopyUpdate, cz as default } from '../api-F1F37Dud.js';
|
2
2
|
import '../client.js';
|
3
|
-
import '../interceptor-
|
3
|
+
import '../interceptor-k15jXzf0.js';
|
4
4
|
import '../types.js';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/resources/recurring_order_copies.ts"],"names":[],"mappings":";;AA8FA,MAAM,6BAA6B,WAAgC,CAAA;AAAA,EAElE,OAAgB,IAA+B,GAAA,wBAAA;AAAA,EAE/C,MAAM,MAAA,CAAO,QAAoC,EAAA,MAAA,EAAkD,OAAwD,EAAA;AAC1J,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAAqD,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,oBAAqB,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC7I,EAEA,MAAM,MAAA,CAAO,QAAoC,EAAA,MAAA,EAAkD,OAAwD,EAAA;AAC1J,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAAqD,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,oBAAq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kBAAA,CAAmB,oBAAmD,EAAA,MAAA,EAAiD,OAAuD,EAAA;AACnL,IAAM,MAAA,qBAAA,GAAyB,qBAA4C,EAAM,IAAA,oBAAA;AACjF,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAyB,EAAE,IAAA,EAAM,qBAAsB,EAAA,EAAG,CAA0B,uBAAA,EAAA,qBAAqB,CAAuB,mBAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACtK,EAGA,qBAAqB,QAA+C,EAAA;AACnE,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,oBAAqB,CAAA,IAAA;AAAA;AACjE,EAGA,aAAa,EAAuD,EAAA;AACnE,IAAO,OAAA,KAAA,CAAM,qBAA4C,EAAE,CAAA;AAAA;AAC5D,EAEA,sBAAsB,GAAwC,EAAA;AAC7D,IAAO,OAAA,KAAA,CAAM,qBAA6C,CAAA,GAAG,GAAG,CAAA;AAAA;AACjE,EAGA,IAA+B,GAAA;AAC9B,IAAA,OAAO,oBAAqB,CAAA,IAAA;AAAA;AAG9B;AAGA,MAAM,QAAA,GAAW,IAAI,oBAAqB,EAAA;AAC1C,IAAO,8BAAQ,GAAA","file":"recurring_order_copies.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 { Order, OrderType } from './orders'\nimport type { Event } from './events'\nimport type { OrderSubscription, OrderSubscriptionType } from './order_subscriptions'\n\n\ntype RecurringOrderCopyType = 'recurring_order_copies'\ntype RecurringOrderCopyRel = ResourceRel & { type: RecurringOrderCopyType }\ntype OrderRel = ResourceRel & { type: OrderType }\ntype OrderSubscriptionRel = ResourceRel & { type: OrderSubscriptionType }\n\n\nexport type RecurringOrderCopySort = Pick<RecurringOrderCopy, 'id' | 'status' | 'started_at' | 'completed_at' | 'failed_at' | 'errors_count'> & ResourceSort\n// export type RecurringOrderCopyFilter = Pick<RecurringOrderCopy, 'id' | 'status' | 'started_at' | 'completed_at' | 'failed_at' | 'errors_count'> & ResourceFilter\n\n\ninterface RecurringOrderCopy extends Resource {\n\t\n\treadonly type: RecurringOrderCopyType\n\n\t/** \n\t * The order factory status. One of 'pending' (default), 'in_progress', 'aborted', 'failed', or 'completed'.\n\t * @example ```\"in_progress\"```\n\t */\n\tstatus: 'pending' | 'in_progress' | 'aborted' | 'failed' | 'completed'\n\t/** \n\t * Time at which the order copy was started.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarted_at?: string | null\n\t/** \n\t * Time at which the order copy was completed.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tcompleted_at?: string | null\n\t/** \n\t * Time at which the order copy has failed.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tfailed_at?: string | null\n\t/** \n\t * Contains the order copy errors, if any.\n\t * @example ```{\"status\":[\"cannot transition from draft to placed\"]}```\n\t */\n\terrors_log?: Record<string, any> | null\n\t/** \n\t * Indicates the number of copy errors, if any.\n\t * @example ```2```\n\t */\n\terrors_count?: number | null\n\t/** \n\t * Indicates if the target order must be placed upon copy.\n\t * @example ```true```\n\t */\n\tplace_target_order?: boolean | null\n\t/** \n\t * Indicates if the payment source within the source order customer's wallet must be copied.\n\t * @example ```true```\n\t */\n\treuse_wallet?: boolean | null\n\n\tsource_order?: Order | null\n\ttarget_order?: Order | null\n\tevents?: Event[] | null\n\torder_subscription?: OrderSubscription | null\n\n}\n\n\ninterface RecurringOrderCopyCreate extends ResourceCreate {\n\t\n\t/** \n\t * Indicates if the target order must be placed upon copy.\n\t * @example ```true```\n\t */\n\tplace_target_order?: boolean | null\n\t/** \n\t * Indicates if the payment source within the source order customer's wallet must be copied.\n\t * @example ```true```\n\t */\n\treuse_wallet?: boolean | null\n\n\tsource_order: OrderRel\n\torder_subscription: OrderSubscriptionRel\n\n}\n\n\ntype RecurringOrderCopyUpdate = ResourceUpdate\n\n\nclass RecurringOrderCopies extends ApiResource<RecurringOrderCopy> {\n\n\tstatic readonly TYPE: RecurringOrderCopyType = 'recurring_order_copies' as const\n\n\tasync create(resource: RecurringOrderCopyCreate, params?: QueryParamsRetrieve<RecurringOrderCopy>, options?: ResourcesConfig): Promise<RecurringOrderCopy> {\n\t\treturn this.resources.create<RecurringOrderCopyCreate, RecurringOrderCopy>({ ...resource, type: RecurringOrderCopies.TYPE }, params, options)\n\t}\n\n\tasync update(resource: RecurringOrderCopyUpdate, params?: QueryParamsRetrieve<RecurringOrderCopy>, options?: ResourcesConfig): Promise<RecurringOrderCopy> {\n\t\treturn this.resources.update<RecurringOrderCopyUpdate, RecurringOrderCopy>({ ...resource, type: RecurringOrderCopies.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: RecurringOrderCopies.TYPE } : id, options)\n\t}\n\n\tasync source_order(recurringOrderCopyId: string | RecurringOrderCopy, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _recurringOrderCopyId = (recurringOrderCopyId as RecurringOrderCopy).id || recurringOrderCopyId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `recurring_order_copies/${_recurringOrderCopyId}/source_order`, params, options) as unknown as Order\n\t}\n\n\tasync target_order(recurringOrderCopyId: string | RecurringOrderCopy, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _recurringOrderCopyId = (recurringOrderCopyId as RecurringOrderCopy).id || recurringOrderCopyId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `recurring_order_copies/${_recurringOrderCopyId}/target_order`, params, options) as unknown as Order\n\t}\n\n\tasync events(recurringOrderCopyId: string | RecurringOrderCopy, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _recurringOrderCopyId = (recurringOrderCopyId as RecurringOrderCopy).id || recurringOrderCopyId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `recurring_order_copies/${_recurringOrderCopyId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync order_subscription(recurringOrderCopyId: string | RecurringOrderCopy, params?: QueryParamsRetrieve<OrderSubscription>, options?: ResourcesConfig): Promise<OrderSubscription> {\n\t\tconst _recurringOrderCopyId = (recurringOrderCopyId as RecurringOrderCopy).id || recurringOrderCopyId as string\n\t\treturn this.resources.fetch<OrderSubscription>({ type: 'order_subscriptions' }, `recurring_order_copies/${_recurringOrderCopyId}/order_subscription`, params, options) as unknown as OrderSubscription\n\t}\n\n\n\tisRecurringOrderCopy(resource: any): resource is RecurringOrderCopy {\n\t\treturn resource.type && (resource.type === RecurringOrderCopies.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): RecurringOrderCopyRel {\n\t\treturn super.relationshipOneToOne<RecurringOrderCopyRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): RecurringOrderCopyRel[] {\n\t\treturn super.relationshipOneToMany<RecurringOrderCopyRel>(...ids)\n\t}\n\n\n\ttype(): RecurringOrderCopyType {\n\t\treturn RecurringOrderCopies.TYPE\n\t}\n\n}\n\n\nconst instance = new RecurringOrderCopies()\nexport default instance\n\nexport type { RecurringOrderCopy, RecurringOrderCopyCreate, RecurringOrderCopyUpdate, RecurringOrderCopyType }\n"]}
|
1
|
+
{"version":3,"sources":["../../src/resources/recurring_order_copies.ts"],"names":[],"mappings":";;AA8FA,MAAM,6BAA6B,WAAgC,CAAA;AAAA,EAElE,OAAgB,IAA+B,GAAA,wBAAA;AAAA,EAE/C,MAAM,MAAA,CAAO,QAAoC,EAAA,MAAA,EAAkD,OAAwD,EAAA;AAC1J,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAAqD,EAAE,GAAG,QAAU,EAAA,I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AAM,MAAA,qBAAA,GAAyB,qBAA4C,EAAM,IAAA,oBAAA;AACjF,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAa,EAAE,IAAA,EAAM,QAAS,EAAA,EAAG,CAA0B,uBAAA,EAAA,qBAAqB,CAAW,OAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACjI,EAEA,MAAM,kBAAA,CAAmB,oBAAmD,EAAA,MAAA,EAAiD,OAAuD,EAAA;AACnL,IAAM,MAAA,qBAAA,GAAyB,qBAA4C,EAAM,IAAA,oBAAA;AACjF,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAyB,EAAE,IAAA,EAAM,qBAAsB,EAAA,EAAG,CAA0B,uBAAA,EAAA,qBAAqB,CAAuB,mBAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACtK,EAGA,qBAAqB,QAA+C,EAAA;AACnE,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,oBAAqB,CAAA,IAAA;AAAA;AACjE,EAGA,aAAa,EAAuD,EAAA;AACnE,IAAO,OAAA,KAAA,CAAM,qBAA4C,EAAE,CAAA;AAAA;AAC5D,EAEA,sBAAsB,GAAwC,EAAA;AAC7D,IAAO,OAAA,KAAA,CAAM,qBAA6C,CAAA,GAAG,GAAG,CAAA;AAAA;AACjE,EAGA,IAA+B,GAAA;AAC9B,IAAA,OAAO,oBAAqB,CAAA,IAAA;AAAA;AAG9B;AAGA,MAAM,QAAA,GAAW,IAAI,oBAAqB,EAAA;AAC1C,IAAO,8BAAQ,GAAA","file":"recurring_order_copies.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 { Order, OrderType } from './orders'\nimport type { Event } from './events'\nimport type { OrderSubscription, OrderSubscriptionType } from './order_subscriptions'\n\n\ntype RecurringOrderCopyType = 'recurring_order_copies'\ntype RecurringOrderCopyRel = ResourceRel & { type: RecurringOrderCopyType }\ntype OrderRel = ResourceRel & { type: OrderType }\ntype OrderSubscriptionRel = ResourceRel & { type: OrderSubscriptionType }\n\n\nexport type RecurringOrderCopySort = Pick<RecurringOrderCopy, 'id' | 'status' | 'started_at' | 'completed_at' | 'failed_at' | 'errors_count'> & ResourceSort\n// export type RecurringOrderCopyFilter = Pick<RecurringOrderCopy, 'id' | 'status' | 'started_at' | 'completed_at' | 'failed_at' | 'errors_count'> & ResourceFilter\n\n\ninterface RecurringOrderCopy extends Resource {\n\t\n\treadonly type: RecurringOrderCopyType\n\n\t/** \n\t * The order factory status. One of 'pending' (default), 'in_progress', 'aborted', 'failed', or 'completed'.\n\t * @example ```\"in_progress\"```\n\t */\n\tstatus: 'pending' | 'in_progress' | 'aborted' | 'failed' | 'completed'\n\t/** \n\t * Time at which the order copy was started.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarted_at?: string | null\n\t/** \n\t * Time at which the order copy was completed.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tcompleted_at?: string | null\n\t/** \n\t * Time at which the order copy has failed.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tfailed_at?: string | null\n\t/** \n\t * Contains the order copy errors, if any.\n\t * @example ```{\"status\":[\"cannot transition from draft to placed\"]}```\n\t */\n\terrors_log?: Record<string, any> | null\n\t/** \n\t * Indicates the number of copy errors, if any.\n\t * @example ```2```\n\t */\n\terrors_count?: number | null\n\t/** \n\t * Indicates if the target order must be placed upon copy.\n\t * @example ```true```\n\t */\n\tplace_target_order?: boolean | null\n\t/** \n\t * Indicates if the payment source within the source order customer's wallet must be copied.\n\t * @example ```true```\n\t */\n\treuse_wallet?: boolean | null\n\n\tsource_order?: Order | null\n\ttarget_order?: Order | null\n\tevents?: Event[] | null\n\torder_subscription?: OrderSubscription | null\n\n}\n\n\ninterface RecurringOrderCopyCreate extends ResourceCreate {\n\t\n\t/** \n\t * Indicates if the target order must be placed upon copy.\n\t * @example ```true```\n\t */\n\tplace_target_order?: boolean | null\n\t/** \n\t * Indicates if the payment source within the source order customer's wallet must be copied.\n\t * @example ```true```\n\t */\n\treuse_wallet?: boolean | null\n\n\tsource_order: OrderRel\n\torder_subscription: OrderSubscriptionRel\n\n}\n\n\ntype RecurringOrderCopyUpdate = ResourceUpdate\n\n\nclass RecurringOrderCopies extends ApiResource<RecurringOrderCopy> {\n\n\tstatic readonly TYPE: RecurringOrderCopyType = 'recurring_order_copies' as const\n\n\tasync create(resource: RecurringOrderCopyCreate, params?: QueryParamsRetrieve<RecurringOrderCopy>, options?: ResourcesConfig): Promise<RecurringOrderCopy> {\n\t\treturn this.resources.create<RecurringOrderCopyCreate, RecurringOrderCopy>({ ...resource, type: RecurringOrderCopies.TYPE }, params, options)\n\t}\n\n\tasync update(resource: RecurringOrderCopyUpdate, params?: QueryParamsRetrieve<RecurringOrderCopy>, options?: ResourcesConfig): Promise<RecurringOrderCopy> {\n\t\treturn this.resources.update<RecurringOrderCopyUpdate, RecurringOrderCopy>({ ...resource, type: RecurringOrderCopies.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: RecurringOrderCopies.TYPE } : id, options)\n\t}\n\n\tasync source_order(recurringOrderCopyId: string | RecurringOrderCopy, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _recurringOrderCopyId = (recurringOrderCopyId as RecurringOrderCopy).id || recurringOrderCopyId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `recurring_order_copies/${_recurringOrderCopyId}/source_order`, params, options) as unknown as Order\n\t}\n\n\tasync target_order(recurringOrderCopyId: string | RecurringOrderCopy, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _recurringOrderCopyId = (recurringOrderCopyId as RecurringOrderCopy).id || recurringOrderCopyId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `recurring_order_copies/${_recurringOrderCopyId}/target_order`, params, options) as unknown as Order\n\t}\n\n\tasync events(recurringOrderCopyId: string | RecurringOrderCopy, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _recurringOrderCopyId = (recurringOrderCopyId as RecurringOrderCopy).id || recurringOrderCopyId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `recurring_order_copies/${_recurringOrderCopyId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync order_subscription(recurringOrderCopyId: string | RecurringOrderCopy, params?: QueryParamsRetrieve<OrderSubscription>, options?: ResourcesConfig): Promise<OrderSubscription> {\n\t\tconst _recurringOrderCopyId = (recurringOrderCopyId as RecurringOrderCopy).id || recurringOrderCopyId as string\n\t\treturn this.resources.fetch<OrderSubscription>({ type: 'order_subscriptions' }, `recurring_order_copies/${_recurringOrderCopyId}/order_subscription`, params, options) as unknown as OrderSubscription\n\t}\n\n\n\tisRecurringOrderCopy(resource: any): resource is RecurringOrderCopy {\n\t\treturn resource.type && (resource.type === RecurringOrderCopies.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): RecurringOrderCopyRel {\n\t\treturn super.relationshipOneToOne<RecurringOrderCopyRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): RecurringOrderCopyRel[] {\n\t\treturn super.relationshipOneToMany<RecurringOrderCopyRel>(...ids)\n\t}\n\n\n\ttype(): RecurringOrderCopyType {\n\t\treturn RecurringOrderCopies.TYPE\n\t}\n\n}\n\n\nconst instance = new RecurringOrderCopies()\nexport default instance\n\nexport type { RecurringOrderCopies, RecurringOrderCopy, RecurringOrderCopyCreate, RecurringOrderCopyUpdate, RecurringOrderCopyType }\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{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A,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,OAAQ,CAAA,IAAA;AAAA;AACpD,EAGA,aAAa,EAA2C,EAAA;AACvD,IAAO,OAAA,KAAA,CAAM,qBAAgC,EAAE,CAAA;AAAA;AAChD,EAEA,sBAAsB,GAA4B,EAAA;AACjD,IAAO,OAAA,KAAA,CAAM,qBAAiC,CAAA,GAAG,GAAG,CAAA;AAAA;AACrD,EAGA,IAAmB,GAAA;AAClB,IAAA,OAAO,OAAQ,CAAA,IAAA;AAAA;AAGjB;AAGA,MAAM,QAAA,GAAW,IAAI,OAAQ,EAAA;AAC7B,IAAO,eAAQ,GAAA","file":"refunds.cjs","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Order } from './orders'\nimport type { Attachment } from './attachments'\nimport type { Event } from './events'\nimport type { Version } from './versions'\nimport type { Capture } from './captures'\nimport type { Return } from './returns'\nimport type { AdyenPayment } from './adyen_payments'\nimport type { AxervePayment } from './axerve_payments'\nimport type { BraintreePayment } from './braintree_payments'\nimport type { CheckoutComPayment } from './checkout_com_payments'\nimport type { ExternalPayment } from './external_payments'\nimport type { KlarnaPayment } from './klarna_payments'\nimport type { PaypalPayment } from './paypal_payments'\nimport type { SatispayPayment } from './satispay_payments'\nimport type { StripePayment } from './stripe_payments'\nimport type { WireTransfer } from './wire_transfers'\n\n\ntype RefundType = 'refunds'\ntype RefundRel = ResourceRel & { type: RefundType }\n\n\nexport type RefundSort = Pick<Refund, 'id' | 'number' | 'amount_cents'> & ResourceSort\n// export type RefundFilter = Pick<Refund, 'id' | 'number' | 'currency_code' | 'amount_cents' | 'succeeded' | 'message' | 'error_code' | 'error_detail' | 'token' | 'gateway_transaction_id'> & ResourceFilter\n\n\ninterface Refund extends Resource {\n\t\n\treadonly type: RefundType\n\n\t/** \n\t * The transaction number, auto generated.\n\t * @example ```\"42/T/001\"```\n\t */\n\tnumber: string\n\t/** \n\t * The international 3-letter currency code as defined by the ISO 4217 standard, inherited from the associated order.\n\t * @example ```\"EUR\"```\n\t */\n\tcurrency_code: string\n\t/** \n\t * The transaction amount, in cents.\n\t * @example ```1500```\n\t */\n\tamount_cents: number\n\t/** \n\t * The transaction amount, float.\n\t * @example ```15```\n\t */\n\tamount_float: number\n\t/** \n\t * The transaction amount, formatted.\n\t * @example ```\"€15,00\"```\n\t */\n\tformatted_amount: string\n\t/** \n\t * Indicates if the transaction is successful.\n\t */\n\tsucceeded: boolean\n\t/** \n\t * The message returned by the payment gateway.\n\t * @example ```\"Accepted\"```\n\t */\n\tmessage?: string | null\n\t/** \n\t * The error code, if any, returned by the payment gateway.\n\t * @example ```\"00001\"```\n\t */\n\terror_code?: string | null\n\t/** \n\t * The error detail, if any, returned by the payment gateway.\n\t * @example ```\"Already settled\"```\n\t */\n\terror_detail?: string | null\n\t/** \n\t * The token identifying the transaction, returned by the payment gateway.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\ttoken?: string | null\n\t/** \n\t * The ID identifying the transaction, returned by the payment gateway.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tgateway_transaction_id?: string | null\n\n\torder?: Order | null\n\tpayment_source?: AdyenPayment | AxervePayment | BraintreePayment | CheckoutComPayment | ExternalPayment | KlarnaPayment | PaypalPayment | SatispayPayment | StripePayment | WireTransfer | null\n\tattachments?: Attachment[] | null\n\tevents?: Event[] | null\n\tversions?: Version[] | null\n\treference_capture?: Capture | null\n\treturn?: Return | null\n\n}\n\n\ninterface RefundUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * Indicates if the transaction is successful.\n\t */\n\tsucceeded?: boolean | null\n\t/** \n\t * Send this attribute if you want to forward a stuck transaction to succeeded and update associated order states accordingly.\n\t * @example ```true```\n\t */\n\t_forward?: boolean | null\n\t\n}\n\n\nclass Refunds extends ApiResource<Refund> {\n\n\tstatic readonly TYPE: RefundType = 'refunds' as const\n\n\tasync update(resource: RefundUpdate, params?: QueryParamsRetrieve<Refund>, options?: ResourcesConfig): Promise<Refund> {\n\t\treturn this.resources.update<RefundUpdate, Refund>({ ...resource, type: Refunds.TYPE }, params, options)\n\t}\n\n\tasync order(refundId: string | Refund, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _refundId = (refundId as Refund).id || refundId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `refunds/${_refundId}/order`, params, options) as unknown as Order\n\t}\n\n\tasync attachments(refundId: string | Refund, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _refundId = (refundId as Refund).id || refundId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `refunds/${_refundId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync events(refundId: string | Refund, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _refundId = (refundId as Refund).id || refundId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `refunds/${_refundId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync versions(refundId: string | Refund, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _refundId = (refundId as Refund).id || refundId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `refunds/${_refundId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync reference_capture(refundId: string | Refund, params?: QueryParamsRetrieve<Capture>, options?: ResourcesConfig): Promise<Capture> {\n\t\tconst _refundId = (refundId as Refund).id || refundId as string\n\t\treturn this.resources.fetch<Capture>({ type: 'captures' }, `refunds/${_refundId}/reference_capture`, params, options) as unknown as Capture\n\t}\n\n\tasync return(refundId: string | Refund, params?: QueryParamsRetrieve<Return>, options?: ResourcesConfig): Promise<Return> {\n\t\tconst _refundId = (refundId as Refund).id || refundId as string\n\t\treturn this.resources.fetch<Return>({ type: 'returns' }, `refunds/${_refundId}/return`, params, options) as unknown as Return\n\t}\n\n\tasync _forward(id: string | Refund, params?: QueryParamsRetrieve<Refund>, options?: ResourcesConfig): Promise<Refund> {\n\t\treturn this.resources.update<RefundUpdate, Refund>({ id: (typeof id === 'string')? id: id.id, type: Refunds.TYPE, _forward: true }, params, options)\n\t}\n\n\n\tisRefund(resource: any): resource is Refund {\n\t\treturn resource.type && (resource.type === Refunds.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): RefundRel {\n\t\treturn super.relationshipOneToOne<RefundRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): RefundRel[] {\n\t\treturn super.relationshipOneToMany<RefundRel>(...ids)\n\t}\n\n\n\ttype(): RefundType {\n\t\treturn Refunds.TYPE\n\t}\n\n}\n\n\nconst instance = new Refunds()\nexport default instance\n\nexport type { Refund, RefundUpdate, RefundType }\n"]}
|
1
|
+
{"version":3,"sources":["../../src/resources/refunds.ts"],"names":["ApiResource"],"mappings":";;;;AAmHA,MAAM,gBAAgBA,oBAAoB,CAAA;AAAA,EAEzC,OAAgB,IAAmB,GAAA,SAAA;AAAA,EAEnC,MAAM,MAAA,CAAO,QAAwB,EAAA,MAAA,EAAsC,OAA4C,EAAA;AACtH,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA6B,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,OAAQ,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACxG,EAEA,MAAM,KAAA,CAAM,QAA2B,EAAA,MAAA,EAAqC,OAA2C,EAAA;AACtH,IAAM,MAAA,SAAA,GAAa,SAAoB,EAAM,IAAA,QAAA;AAC7C,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAa,EAAE,IAAA,EAAM,QAAS,EAAA,EAAG,CAAW,QAAA,EA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,EAAQ,OAAO,CAAA;AAAA;AACrH,EAEA,MAAM,MAAA,CAAO,QAA2B,EAAA,MAAA,EAAsC,OAA4C,EAAA;AACzH,IAAM,MAAA,SAAA,GAAa,SAAoB,EAAM,IAAA,QAAA;AAC7C,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAc,EAAE,IAAA,EAAM,SAAU,EAAA,EAAG,CAAW,QAAA,EAAA,SAAS,CAAW,OAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACxG,EAEA,MAAM,QAAA,CAAS,EAAqB,EAAA,MAAA,EAAsC,OAA4C,EAAA;AACrH,IAAA,OAAO,KAAK,SAAU,CAAA,MAAA,CAA6B,EAAE,EAAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,OAAQ,CAAA,IAAA,EAAM,UAAU,IAAK,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AACpJ,EAGA,SAAS,QAAmC,EAAA;AAC3C,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,OAAQ,CAAA,IAAA;AAAA;AACpD,EAGA,aAAa,EAA2C,EAAA;AACvD,IAAO,OAAA,KAAA,CAAM,qBAAgC,EAAE,CAAA;AAAA;AAChD,EAEA,sBAAsB,GAA4B,EAAA;AACjD,IAAO,OAAA,KAAA,CAAM,qBAAiC,CAAA,GAAG,GAAG,CAAA;AAAA;AACrD,EAGA,IAAmB,GAAA;AAClB,IAAA,OAAO,OAAQ,CAAA,IAAA;AAAA;AAGjB;AAGA,MAAM,QAAA,GAAW,IAAI,OAAQ,EAAA;AAC7B,IAAO,eAAQ,GAAA","file":"refunds.cjs","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Order } from './orders'\nimport type { Attachment } from './attachments'\nimport type { Event } from './events'\nimport type { Version } from './versions'\nimport type { Capture } from './captures'\nimport type { Return } from './returns'\nimport type { AdyenPayment } from './adyen_payments'\nimport type { AxervePayment } from './axerve_payments'\nimport type { BraintreePayment } from './braintree_payments'\nimport type { CheckoutComPayment } from './checkout_com_payments'\nimport type { ExternalPayment } from './external_payments'\nimport type { KlarnaPayment } from './klarna_payments'\nimport type { PaypalPayment } from './paypal_payments'\nimport type { SatispayPayment } from './satispay_payments'\nimport type { StripePayment } from './stripe_payments'\nimport type { WireTransfer } from './wire_transfers'\n\n\ntype RefundType = 'refunds'\ntype RefundRel = ResourceRel & { type: RefundType }\n\n\nexport type RefundSort = Pick<Refund, 'id' | 'number' | 'amount_cents'> & ResourceSort\n// export type RefundFilter = Pick<Refund, 'id' | 'number' | 'currency_code' | 'amount_cents' | 'succeeded' | 'message' | 'error_code' | 'error_detail' | 'token' | 'gateway_transaction_id'> & ResourceFilter\n\n\ninterface Refund extends Resource {\n\t\n\treadonly type: RefundType\n\n\t/** \n\t * The transaction number, auto generated.\n\t * @example ```\"42/T/001\"```\n\t */\n\tnumber: string\n\t/** \n\t * The international 3-letter currency code as defined by the ISO 4217 standard, inherited from the associated order.\n\t * @example ```\"EUR\"```\n\t */\n\tcurrency_code: string\n\t/** \n\t * The transaction amount, in cents.\n\t * @example ```1500```\n\t */\n\tamount_cents: number\n\t/** \n\t * The transaction amount, float.\n\t * @example ```15```\n\t */\n\tamount_float: number\n\t/** \n\t * The transaction amount, formatted.\n\t * @example ```\"€15,00\"```\n\t */\n\tformatted_amount: string\n\t/** \n\t * Indicates if the transaction is successful.\n\t */\n\tsucceeded: boolean\n\t/** \n\t * The message returned by the payment gateway.\n\t * @example ```\"Accepted\"```\n\t */\n\tmessage?: string | null\n\t/** \n\t * The error code, if any, returned by the payment gateway.\n\t * @example ```\"00001\"```\n\t */\n\terror_code?: string | null\n\t/** \n\t * The error detail, if any, returned by the payment gateway.\n\t * @example ```\"Already settled\"```\n\t */\n\terror_detail?: string | null\n\t/** \n\t * The token identifying the transaction, returned by the payment gateway.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\ttoken?: string | null\n\t/** \n\t * The ID identifying the transaction, returned by the payment gateway.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tgateway_transaction_id?: string | null\n\n\torder?: Order | null\n\tpayment_source?: AdyenPayment | AxervePayment | BraintreePayment | CheckoutComPayment | ExternalPayment | KlarnaPayment | PaypalPayment | SatispayPayment | StripePayment | WireTransfer | null\n\tattachments?: Attachment[] | null\n\tevents?: Event[] | null\n\tversions?: Version[] | null\n\treference_capture?: Capture | null\n\treturn?: Return | null\n\n}\n\n\ninterface RefundUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * Indicates if the transaction is successful.\n\t */\n\tsucceeded?: boolean | null\n\t/** \n\t * Send this attribute if you want to forward a stuck transaction to succeeded and update associated order states accordingly.\n\t * @example ```true```\n\t */\n\t_forward?: boolean | null\n\t\n}\n\n\nclass Refunds extends ApiResource<Refund> {\n\n\tstatic readonly TYPE: RefundType = 'refunds' as const\n\n\tasync update(resource: RefundUpdate, params?: QueryParamsRetrieve<Refund>, options?: ResourcesConfig): Promise<Refund> {\n\t\treturn this.resources.update<RefundUpdate, Refund>({ ...resource, type: Refunds.TYPE }, params, options)\n\t}\n\n\tasync order(refundId: string | Refund, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _refundId = (refundId as Refund).id || refundId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `refunds/${_refundId}/order`, params, options) as unknown as Order\n\t}\n\n\tasync attachments(refundId: string | Refund, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _refundId = (refundId as Refund).id || refundId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `refunds/${_refundId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync events(refundId: string | Refund, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _refundId = (refundId as Refund).id || refundId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `refunds/${_refundId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync versions(refundId: string | Refund, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _refundId = (refundId as Refund).id || refundId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `refunds/${_refundId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync reference_capture(refundId: string | Refund, params?: QueryParamsRetrieve<Capture>, options?: ResourcesConfig): Promise<Capture> {\n\t\tconst _refundId = (refundId as Refund).id || refundId as string\n\t\treturn this.resources.fetch<Capture>({ type: 'captures' }, `refunds/${_refundId}/reference_capture`, params, options) as unknown as Capture\n\t}\n\n\tasync return(refundId: string | Refund, params?: QueryParamsRetrieve<Return>, options?: ResourcesConfig): Promise<Return> {\n\t\tconst _refundId = (refundId as Refund).id || refundId as string\n\t\treturn this.resources.fetch<Return>({ type: 'returns' }, `refunds/${_refundId}/return`, params, options) as unknown as Return\n\t}\n\n\tasync _forward(id: string | Refund, params?: QueryParamsRetrieve<Refund>, options?: ResourcesConfig): Promise<Refund> {\n\t\treturn this.resources.update<RefundUpdate, Refund>({ id: (typeof id === 'string')? id: id.id, type: Refunds.TYPE, _forward: true }, params, options)\n\t}\n\n\n\tisRefund(resource: any): resource is Refund {\n\t\treturn resource.type && (resource.type === Refunds.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): RefundRel {\n\t\treturn super.relationshipOneToOne<RefundRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): RefundRel[] {\n\t\treturn super.relationshipOneToMany<RefundRel>(...ids)\n\t}\n\n\n\ttype(): RefundType {\n\t\treturn Refunds.TYPE\n\t}\n\n}\n\n\nconst instance = new Refunds()\nexport default instance\n\nexport type { Refunds, Refund, RefundUpdate, RefundType }\n"]}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export {
|
1
|
+
export { j9 as Refund, jb as RefundSort, lW as RefundType, ja as RefundUpdate, cC as Refunds, cB as default } from '../api-IwWtsAqE.cjs';
|
2
2
|
import '../client.cjs';
|
3
|
-
import '../interceptor-
|
3
|
+
import '../interceptor-k15jXzf0.cjs';
|
4
4
|
import '../types.cjs';
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export {
|
1
|
+
export { j9 as Refund, jb as RefundSort, lW as RefundType, ja as RefundUpdate, cC as Refunds, cB as default } from '../api-F1F37Dud.js';
|
2
2
|
import '../client.js';
|
3
|
-
import '../interceptor-
|
3
|
+
import '../interceptor-k15jXzf0.js';
|
4
4
|
import '../types.js';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/resources/refunds.ts"],"names":[],"mappings":";;AAmHA,MAAM,gBAAgB,WAAoB,CAAA;AAAA,EAEzC,OAAgB,IAAmB,GAAA,SAAA;AAAA,EAEnC,MAAM,MAAA,CAAO,QAAwB,EAAA,MAAA,EAAsC,OAA4C,EAAA;AACtH,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA6B,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,OAAQ,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACxG,EAEA,MAAM,KAAA,CAAM,QAA2B,EAAA,MAAA,EAAqC,OAA2C,EAAA;AACtH,IAAM,MAAA,SAAA,GAAa,SAAoB,EAAM,IAAA,QAAA;AAC7C,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAa,EAAE,IAAA,EAAM,QAAS,EAAA,EAAG,CAAW,QAAA,EAAA,SAAS,CAAU,MAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACrG,EAEA,MAAM,WAAA,CAAY,QAA2B,EAAA,MAAA,EAAsC,OAA8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SAAoB,EAAM,IAAA,QAAA;AAC7C,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAc,EAAE,IAAA,EAAM,SAAU,EAAA,EAAG,CAAW,QAAA,EAAA,SAAS,CAAW,OAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACxG,EAEA,MAAM,QAAA,CAAS,EAAqB,EAAA,MAAA,EAAsC,OAA4C,EAAA;AACrH,IAAA,OAAO,KAAK,SAAU,CAAA,MAAA,CAA6B,EAAE,EAAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,OAAQ,CAAA,IAAA,EAAM,UAAU,IAAK,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AACpJ,EAGA,SAAS,QAAmC,EAAA;AAC3C,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,OAAQ,CAAA,IAAA;AAAA;AACpD,EAGA,aAAa,EAA2C,EAAA;AACvD,IAAO,OAAA,KAAA,CAAM,qBAAgC,EAAE,CAAA;AAAA;AAChD,EAEA,sBAAsB,GAA4B,EAAA;AACjD,IAAO,OAAA,KAAA,CAAM,qBAAiC,CAAA,GAAG,GAAG,CAAA;AAAA;AACrD,EAGA,IAAmB,GAAA;AAClB,IAAA,OAAO,OAAQ,CAAA,IAAA;AAAA;AAGjB;AAGA,MAAM,QAAA,GAAW,IAAI,OAAQ,EAAA;AAC7B,IAAO,eAAQ,GAAA","file":"refunds.js","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Order } from './orders'\nimport type { Attachment } from './attachments'\nimport type { Event } from './events'\nimport type { Version } from './versions'\nimport type { Capture } from './captures'\nimport type { Return } from './returns'\nimport type { AdyenPayment } from './adyen_payments'\nimport type { AxervePayment } from './axerve_payments'\nimport type { BraintreePayment } from './braintree_payments'\nimport type { CheckoutComPayment } from './checkout_com_payments'\nimport type { ExternalPayment } from './external_payments'\nimport type { KlarnaPayment } from './klarna_payments'\nimport type { PaypalPayment } from './paypal_payments'\nimport type { SatispayPayment } from './satispay_payments'\nimport type { StripePayment } from './stripe_payments'\nimport type { WireTransfer } from './wire_transfers'\n\n\ntype RefundType = 'refunds'\ntype RefundRel = ResourceRel & { type: RefundType }\n\n\nexport type RefundSort = Pick<Refund, 'id' | 'number' | 'amount_cents'> & ResourceSort\n// export type RefundFilter = Pick<Refund, 'id' | 'number' | 'currency_code' | 'amount_cents' | 'succeeded' | 'message' | 'error_code' | 'error_detail' | 'token' | 'gateway_transaction_id'> & ResourceFilter\n\n\ninterface Refund extends Resource {\n\t\n\treadonly type: RefundType\n\n\t/** \n\t * The transaction number, auto generated.\n\t * @example ```\"42/T/001\"```\n\t */\n\tnumber: string\n\t/** \n\t * The international 3-letter currency code as defined by the ISO 4217 standard, inherited from the associated order.\n\t * @example ```\"EUR\"```\n\t */\n\tcurrency_code: string\n\t/** \n\t * The transaction amount, in cents.\n\t * @example ```1500```\n\t */\n\tamount_cents: number\n\t/** \n\t * The transaction amount, float.\n\t * @example ```15```\n\t */\n\tamount_float: number\n\t/** \n\t * The transaction amount, formatted.\n\t * @example ```\"€15,00\"```\n\t */\n\tformatted_amount: string\n\t/** \n\t * Indicates if the transaction is successful.\n\t */\n\tsucceeded: boolean\n\t/** \n\t * The message returned by the payment gateway.\n\t * @example ```\"Accepted\"```\n\t */\n\tmessage?: string | null\n\t/** \n\t * The error code, if any, returned by the payment gateway.\n\t * @example ```\"00001\"```\n\t */\n\terror_code?: string | null\n\t/** \n\t * The error detail, if any, returned by the payment gateway.\n\t * @example ```\"Already settled\"```\n\t */\n\terror_detail?: string | null\n\t/** \n\t * The token identifying the transaction, returned by the payment gateway.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\ttoken?: string | null\n\t/** \n\t * The ID identifying the transaction, returned by the payment gateway.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tgateway_transaction_id?: string | null\n\n\torder?: Order | null\n\tpayment_source?: AdyenPayment | AxervePayment | BraintreePayment | CheckoutComPayment | ExternalPayment | KlarnaPayment | PaypalPayment | SatispayPayment | StripePayment | WireTransfer | null\n\tattachments?: Attachment[] | null\n\tevents?: Event[] | null\n\tversions?: Version[] | null\n\treference_capture?: Capture | null\n\treturn?: Return | null\n\n}\n\n\ninterface RefundUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * Indicates if the transaction is successful.\n\t */\n\tsucceeded?: boolean | null\n\t/** \n\t * Send this attribute if you want to forward a stuck transaction to succeeded and update associated order states accordingly.\n\t * @example ```true```\n\t */\n\t_forward?: boolean | null\n\t\n}\n\n\nclass Refunds extends ApiResource<Refund> {\n\n\tstatic readonly TYPE: RefundType = 'refunds' as const\n\n\tasync update(resource: RefundUpdate, params?: QueryParamsRetrieve<Refund>, options?: ResourcesConfig): Promise<Refund> {\n\t\treturn this.resources.update<RefundUpdate, Refund>({ ...resource, type: Refunds.TYPE }, params, options)\n\t}\n\n\tasync order(refundId: string | Refund, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _refundId = (refundId as Refund).id || refundId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `refunds/${_refundId}/order`, params, options) as unknown as Order\n\t}\n\n\tasync attachments(refundId: string | Refund, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _refundId = (refundId as Refund).id || refundId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `refunds/${_refundId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync events(refundId: string | Refund, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _refundId = (refundId as Refund).id || refundId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `refunds/${_refundId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync versions(refundId: string | Refund, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _refundId = (refundId as Refund).id || refundId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `refunds/${_refundId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync reference_capture(refundId: string | Refund, params?: QueryParamsRetrieve<Capture>, options?: ResourcesConfig): Promise<Capture> {\n\t\tconst _refundId = (refundId as Refund).id || refundId as string\n\t\treturn this.resources.fetch<Capture>({ type: 'captures' }, `refunds/${_refundId}/reference_capture`, params, options) as unknown as Capture\n\t}\n\n\tasync return(refundId: string | Refund, params?: QueryParamsRetrieve<Return>, options?: ResourcesConfig): Promise<Return> {\n\t\tconst _refundId = (refundId as Refund).id || refundId as string\n\t\treturn this.resources.fetch<Return>({ type: 'returns' }, `refunds/${_refundId}/return`, params, options) as unknown as Return\n\t}\n\n\tasync _forward(id: string | Refund, params?: QueryParamsRetrieve<Refund>, options?: ResourcesConfig): Promise<Refund> {\n\t\treturn this.resources.update<RefundUpdate, Refund>({ id: (typeof id === 'string')? id: id.id, type: Refunds.TYPE, _forward: true }, params, options)\n\t}\n\n\n\tisRefund(resource: any): resource is Refund {\n\t\treturn resource.type && (resource.type === Refunds.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): RefundRel {\n\t\treturn super.relationshipOneToOne<RefundRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): RefundRel[] {\n\t\treturn super.relationshipOneToMany<RefundRel>(...ids)\n\t}\n\n\n\ttype(): RefundType {\n\t\treturn Refunds.TYPE\n\t}\n\n}\n\n\nconst instance = new Refunds()\nexport default instance\n\nexport type { Refund, RefundUpdate, RefundType }\n"]}
|
1
|
+
{"version":3,"sources":["../../src/resources/refunds.ts"],"names":[],"mappings":";;AAmHA,MAAM,gBAAgB,WAAoB,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D,EAGA,aAAa,EAA2C,EAAA;AACvD,IAAO,OAAA,KAAA,CAAM,qBAAgC,EAAE,CAAA;AAAA;AAChD,EAEA,sBAAsB,GAA4B,EAAA;AACjD,IAAO,OAAA,KAAA,CAAM,qBAAiC,CAAA,GAAG,GAAG,CAAA;AAAA;AACrD,EAGA,IAAmB,GAAA;AAClB,IAAA,OAAO,OAAQ,CAAA,IAAA;AAAA;AAGjB;AAGA,MAAM,QAAA,GAAW,IAAI,OAAQ,EAAA;AAC7B,IAAO,eAAQ,GAAA","file":"refunds.js","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Order } from './orders'\nimport type { Attachment } from './attachments'\nimport type { Event } from './events'\nimport type { Version } from './versions'\nimport type { Capture } from './captures'\nimport type { Return } from './returns'\nimport type { AdyenPayment } from './adyen_payments'\nimport type { AxervePayment } from './axerve_payments'\nimport type { BraintreePayment } from './braintree_payments'\nimport type { CheckoutComPayment } from './checkout_com_payments'\nimport type { ExternalPayment } from './external_payments'\nimport type { KlarnaPayment } from './klarna_payments'\nimport type { PaypalPayment } from './paypal_payments'\nimport type { SatispayPayment } from './satispay_payments'\nimport type { StripePayment } from './stripe_payments'\nimport type { WireTransfer } from './wire_transfers'\n\n\ntype RefundType = 'refunds'\ntype RefundRel = ResourceRel & { type: RefundType }\n\n\nexport type RefundSort = Pick<Refund, 'id' | 'number' | 'amount_cents'> & ResourceSort\n// export type RefundFilter = Pick<Refund, 'id' | 'number' | 'currency_code' | 'amount_cents' | 'succeeded' | 'message' | 'error_code' | 'error_detail' | 'token' | 'gateway_transaction_id'> & ResourceFilter\n\n\ninterface Refund extends Resource {\n\t\n\treadonly type: RefundType\n\n\t/** \n\t * The transaction number, auto generated.\n\t * @example ```\"42/T/001\"```\n\t */\n\tnumber: string\n\t/** \n\t * The international 3-letter currency code as defined by the ISO 4217 standard, inherited from the associated order.\n\t * @example ```\"EUR\"```\n\t */\n\tcurrency_code: string\n\t/** \n\t * The transaction amount, in cents.\n\t * @example ```1500```\n\t */\n\tamount_cents: number\n\t/** \n\t * The transaction amount, float.\n\t * @example ```15```\n\t */\n\tamount_float: number\n\t/** \n\t * The transaction amount, formatted.\n\t * @example ```\"€15,00\"```\n\t */\n\tformatted_amount: string\n\t/** \n\t * Indicates if the transaction is successful.\n\t */\n\tsucceeded: boolean\n\t/** \n\t * The message returned by the payment gateway.\n\t * @example ```\"Accepted\"```\n\t */\n\tmessage?: string | null\n\t/** \n\t * The error code, if any, returned by the payment gateway.\n\t * @example ```\"00001\"```\n\t */\n\terror_code?: string | null\n\t/** \n\t * The error detail, if any, returned by the payment gateway.\n\t * @example ```\"Already settled\"```\n\t */\n\terror_detail?: string | null\n\t/** \n\t * The token identifying the transaction, returned by the payment gateway.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\ttoken?: string | null\n\t/** \n\t * The ID identifying the transaction, returned by the payment gateway.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tgateway_transaction_id?: string | null\n\n\torder?: Order | null\n\tpayment_source?: AdyenPayment | AxervePayment | BraintreePayment | CheckoutComPayment | ExternalPayment | KlarnaPayment | PaypalPayment | SatispayPayment | StripePayment | WireTransfer | null\n\tattachments?: Attachment[] | null\n\tevents?: Event[] | null\n\tversions?: Version[] | null\n\treference_capture?: Capture | null\n\treturn?: Return | null\n\n}\n\n\ninterface RefundUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * Indicates if the transaction is successful.\n\t */\n\tsucceeded?: boolean | null\n\t/** \n\t * Send this attribute if you want to forward a stuck transaction to succeeded and update associated order states accordingly.\n\t * @example ```true```\n\t */\n\t_forward?: boolean | null\n\t\n}\n\n\nclass Refunds extends ApiResource<Refund> {\n\n\tstatic readonly TYPE: RefundType = 'refunds' as const\n\n\tasync update(resource: RefundUpdate, params?: QueryParamsRetrieve<Refund>, options?: ResourcesConfig): Promise<Refund> {\n\t\treturn this.resources.update<RefundUpdate, Refund>({ ...resource, type: Refunds.TYPE }, params, options)\n\t}\n\n\tasync order(refundId: string | Refund, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _refundId = (refundId as Refund).id || refundId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `refunds/${_refundId}/order`, params, options) as unknown as Order\n\t}\n\n\tasync attachments(refundId: string | Refund, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _refundId = (refundId as Refund).id || refundId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `refunds/${_refundId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync events(refundId: string | Refund, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _refundId = (refundId as Refund).id || refundId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `refunds/${_refundId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync versions(refundId: string | Refund, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _refundId = (refundId as Refund).id || refundId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `refunds/${_refundId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync reference_capture(refundId: string | Refund, params?: QueryParamsRetrieve<Capture>, options?: ResourcesConfig): Promise<Capture> {\n\t\tconst _refundId = (refundId as Refund).id || refundId as string\n\t\treturn this.resources.fetch<Capture>({ type: 'captures' }, `refunds/${_refundId}/reference_capture`, params, options) as unknown as Capture\n\t}\n\n\tasync return(refundId: string | Refund, params?: QueryParamsRetrieve<Return>, options?: ResourcesConfig): Promise<Return> {\n\t\tconst _refundId = (refundId as Refund).id || refundId as string\n\t\treturn this.resources.fetch<Return>({ type: 'returns' }, `refunds/${_refundId}/return`, params, options) as unknown as Return\n\t}\n\n\tasync _forward(id: string | Refund, params?: QueryParamsRetrieve<Refund>, options?: ResourcesConfig): Promise<Refund> {\n\t\treturn this.resources.update<RefundUpdate, Refund>({ id: (typeof id === 'string')? id: id.id, type: Refunds.TYPE, _forward: true }, params, options)\n\t}\n\n\n\tisRefund(resource: any): resource is Refund {\n\t\treturn resource.type && (resource.type === Refunds.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): RefundRel {\n\t\treturn super.relationshipOneToOne<RefundRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): RefundRel[] {\n\t\treturn super.relationshipOneToMany<RefundRel>(...ids)\n\t}\n\n\n\ttype(): RefundType {\n\t\treturn Refunds.TYPE\n\t}\n\n}\n\n\nconst instance = new Refunds()\nexport default instance\n\nexport type { Refunds, Refund, RefundUpdate, RefundType }\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/resources/reserved_stocks.ts"],"names":["ApiResource"],"mappings":";;;;AAoCA,MAAM,uBAAuBA,oBAA2B,CAAA;AAAA,EAEvD,OAAgB,IAA0B,GAAA,iBAAA;AAAA,EAE1C,MAAM,UAAA,CAAW,eAAyC,EAAA,MAAA,EAAyC,OAA+C,EAAA;AACjJ,IAAM,MAAA,gBAAA,GAAoB,gBAAkC,EAAM,IAAA,eAAA;AAClE,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAiB,EAAE,IAAA,EAAM,aAAc,EAAA,EAAG,CAAmB,gBAAA,EAAA,gBAAgB,CAAe,WAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAClI,EAEA,MAAM,GAAA,CAAI,eAAyC,EAAA,MAAA,EAAmC,OAAyC,EAAA;AAC9H,IAAM,MAAA,gBAAA,GAAoB,gBAAkC,EAAM,IAAA,eAAA;AAClE,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAW,EAAE,IAAA,EAAM,MAAO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resource, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { StockItem } from './stock_items'\nimport type { Sku } from './skus'\nimport type { StockReservation } from './stock_reservations'\nimport type { Version } from './versions'\n\n\ntype ReservedStockType = 'reserved_stocks'\ntype ReservedStockRel = ResourceRel & { type: ReservedStockType }\n\n\nexport type ReservedStockSort = Pick<ReservedStock, 'id' | 'quantity'> & ResourceSort\n// export type ReservedStockFilter = Pick<ReservedStock, 'id' | 'quantity'> & ResourceFilter\n\n\ninterface ReservedStock extends Resource {\n\t\n\treadonly type: ReservedStockType\n\n\t/** \n\t * The stock item reserved quantity.\n\t * @example ```100```\n\t */\n\tquantity: number\n\n\tstock_item?: StockItem | null\n\tsku?: Sku | null\n\tstock_reservations?: StockReservation[] | null\n\tversions?: Version[] | null\n\n}\n\n\nclass ReservedStocks extends ApiResource<ReservedStock> {\n\n\tstatic readonly TYPE: ReservedStockType = 'reserved_stocks' as const\n\n\tasync stock_item(reservedStockId: string | ReservedStock, params?: QueryParamsRetrieve<StockItem>, options?: ResourcesConfig): Promise<StockItem> {\n\t\tconst _reservedStockId = (reservedStockId as ReservedStock).id || reservedStockId as string\n\t\treturn this.resources.fetch<StockItem>({ type: 'stock_items' }, `reserved_stocks/${_reservedStockId}/stock_item`, params, options) as unknown as StockItem\n\t}\n\n\tasync sku(reservedStockId: string | ReservedStock, params?: QueryParamsRetrieve<Sku>, options?: ResourcesConfig): Promise<Sku> {\n\t\tconst _reservedStockId = (reservedStockId as ReservedStock).id || reservedStockId as string\n\t\treturn this.resources.fetch<Sku>({ type: 'skus' }, `reserved_stocks/${_reservedStockId}/sku`, params, options) as unknown as Sku\n\t}\n\n\tasync stock_reservations(reservedStockId: string | ReservedStock, params?: QueryParamsList<StockReservation>, options?: ResourcesConfig): Promise<ListResponse<StockReservation>> {\n\t\tconst _reservedStockId = (reservedStockId as ReservedStock).id || reservedStockId as string\n\t\treturn this.resources.fetch<StockReservation>({ type: 'stock_reservations' }, `reserved_stocks/${_reservedStockId}/stock_reservations`, params, options) as unknown as ListResponse<StockReservation>\n\t}\n\n\tasync versions(reservedStockId: string | ReservedStock, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _reservedStockId = (reservedStockId as ReservedStock).id || reservedStockId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `reserved_stocks/${_reservedStockId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\n\tisReservedStock(resource: any): resource is ReservedStock {\n\t\treturn resource.type && (resource.type === ReservedStocks.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): ReservedStockRel {\n\t\treturn super.relationshipOneToOne<ReservedStockRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): ReservedStockRel[] {\n\t\treturn super.relationshipOneToMany<ReservedStockRel>(...ids)\n\t}\n\n\n\ttype(): ReservedStockType {\n\t\treturn ReservedStocks.TYPE\n\t}\n\n}\n\n\nconst instance = new ReservedStocks()\nexport default instance\n\nexport type { ReservedStock, ReservedStockType }\n"]}
|
1
|
+
{"version":3,"sources":["../../src/resources/reserved_stocks.ts"],"names":["ApiResource"],"mappings":";;;;AAoCA,MAAM,uBAAuBA,oBAA2B,CAAA;AAAA,EAEvD,OAAgB,IAA0B,GAAA,iBAAA;AAAA,EAE1C,MAAM,UAAA,CAAW,eAAyC,EAAA,MAAA,EAAyC,OAA+C,EAAA;AACjJ,IAAM,MAAA,gBAAA,GAAoB,gBAAkC,EAAM,IAAA,eAAA;AAClE,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAiB,EAAE,IAAA,EAAM,aAAc,EAAA,EAAG,CAAmB,gBAAA,EAAA,gBAAgB,CAAe,WAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAClI,EAEA,MAAM,GAAA,CAAI,eAAyC,EAAA,MAAA,EAAmC,O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e,CAAA,IAAA;AAAA;AAGxB;AAGA,MAAM,QAAA,GAAW,IAAI,cAAe,EAAA;AACpC,IAAO,uBAAQ,GAAA","file":"reserved_stocks.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 { StockItem } from './stock_items'\nimport type { Sku } from './skus'\nimport type { StockReservation } from './stock_reservations'\nimport type { Version } from './versions'\n\n\ntype ReservedStockType = 'reserved_stocks'\ntype ReservedStockRel = ResourceRel & { type: ReservedStockType }\n\n\nexport type ReservedStockSort = Pick<ReservedStock, 'id' | 'quantity'> & ResourceSort\n// export type ReservedStockFilter = Pick<ReservedStock, 'id' | 'quantity'> & ResourceFilter\n\n\ninterface ReservedStock extends Resource {\n\t\n\treadonly type: ReservedStockType\n\n\t/** \n\t * The stock item reserved quantity.\n\t * @example ```100```\n\t */\n\tquantity: number\n\n\tstock_item?: StockItem | null\n\tsku?: Sku | null\n\tstock_reservations?: StockReservation[] | null\n\tversions?: Version[] | null\n\n}\n\n\nclass ReservedStocks extends ApiResource<ReservedStock> {\n\n\tstatic readonly TYPE: ReservedStockType = 'reserved_stocks' as const\n\n\tasync stock_item(reservedStockId: string | ReservedStock, params?: QueryParamsRetrieve<StockItem>, options?: ResourcesConfig): Promise<StockItem> {\n\t\tconst _reservedStockId = (reservedStockId as ReservedStock).id || reservedStockId as string\n\t\treturn this.resources.fetch<StockItem>({ type: 'stock_items' }, `reserved_stocks/${_reservedStockId}/stock_item`, params, options) as unknown as StockItem\n\t}\n\n\tasync sku(reservedStockId: string | ReservedStock, params?: QueryParamsRetrieve<Sku>, options?: ResourcesConfig): Promise<Sku> {\n\t\tconst _reservedStockId = (reservedStockId as ReservedStock).id || reservedStockId as string\n\t\treturn this.resources.fetch<Sku>({ type: 'skus' }, `reserved_stocks/${_reservedStockId}/sku`, params, options) as unknown as Sku\n\t}\n\n\tasync stock_reservations(reservedStockId: string | ReservedStock, params?: QueryParamsList<StockReservation>, options?: ResourcesConfig): Promise<ListResponse<StockReservation>> {\n\t\tconst _reservedStockId = (reservedStockId as ReservedStock).id || reservedStockId as string\n\t\treturn this.resources.fetch<StockReservation>({ type: 'stock_reservations' }, `reserved_stocks/${_reservedStockId}/stock_reservations`, params, options) as unknown as ListResponse<StockReservation>\n\t}\n\n\tasync versions(reservedStockId: string | ReservedStock, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _reservedStockId = (reservedStockId as ReservedStock).id || reservedStockId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `reserved_stocks/${_reservedStockId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\n\tisReservedStock(resource: any): resource is ReservedStock {\n\t\treturn resource.type && (resource.type === ReservedStocks.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): ReservedStockRel {\n\t\treturn super.relationshipOneToOne<ReservedStockRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): ReservedStockRel[] {\n\t\treturn super.relationshipOneToMany<ReservedStockRel>(...ids)\n\t}\n\n\n\ttype(): ReservedStockType {\n\t\treturn ReservedStocks.TYPE\n\t}\n\n}\n\n\nconst instance = new ReservedStocks()\nexport default instance\n\nexport type { ReservedStocks, ReservedStock, ReservedStockType }\n"]}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export {
|
1
|
+
export { jc as ReservedStock, jd as ReservedStockSort, m0 as ReservedStockType, cE as ReservedStocks, cD as default } from '../api-IwWtsAqE.cjs';
|
2
2
|
import '../client.cjs';
|
3
|
-
import '../interceptor-
|
3
|
+
import '../interceptor-k15jXzf0.cjs';
|
4
4
|
import '../types.cjs';
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export {
|
1
|
+
export { jc as ReservedStock, jd as ReservedStockSort, m0 as ReservedStockType, cE as ReservedStocks, cD as default } from '../api-F1F37Dud.js';
|
2
2
|
import '../client.js';
|
3
|
-
import '../interceptor-
|
3
|
+
import '../interceptor-k15jXzf0.js';
|
4
4
|
import '../types.js';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/resources/reserved_stocks.ts"],"names":[],"mappings":";;AAoCA,MAAM,uBAAuB,WAA2B,CAAA;AAAA,EAEvD,OAAgB,IAA0B,GAAA,iBAAA;AAAA,EAE1C,MAAM,UAAA,CAAW,eAAyC,EAAA,MAAA,EAAyC,OAA+C,EAAA;AACjJ,IAAM,MAAA,gBAAA,GAAoB,gBAAkC,EAAM,IAAA,eAAA;AAClE,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAiB,EAAE,IAAA,EAAM,aAAc,EAAA,EAAG,CAAmB,gBAAA,EAAA,gBAAgB,CAAe,WAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAClI,EAEA,MAAM,GAAA,CAAI,eAAyC,EAAA,MAAA,EAAmC,OAAyC,EAAA;AAC9H,IAAM,MAAA,gBAAA,GAAoB,gBAAkC,EAAM,IAAA,eAAA;AAClE,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAW,EAAE,IAAA,EAAM,MAAO,EAAA,EAAG,CAAmB,gBAAA,EAAA,gBAAgB,CAAQ,IAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC9G,EAEA,MAAM,kBAAA,CAAmB,eAAyC,EAAA,MAAA,EAA4C,OAAoE,EAAA;AACjL,IAAM,MAAA,gBAAA,GAAoB,gBAAkC,EAAM,IAAA,eAAA;AAClE,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAwB,EAAE,IAAA,EAAM,oBAAqB,EAAA,EAAG,CAAmB,gBAAA,EAAA,gBAAgB,CAAuB,mBAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACxJ,EAEA,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":"reserved_stocks.js","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 { StockItem } from './stock_items'\nimport type { Sku } from './skus'\nimport type { StockReservation } from './stock_reservations'\nimport type { Version } from './versions'\n\n\ntype ReservedStockType = 'reserved_stocks'\ntype ReservedStockRel = ResourceRel & { type: ReservedStockType }\n\n\nexport type ReservedStockSort = Pick<ReservedStock, 'id' | 'quantity'> & ResourceSort\n// export type ReservedStockFilter = Pick<ReservedStock, 'id' | 'quantity'> & ResourceFilter\n\n\ninterface ReservedStock extends Resource {\n\t\n\treadonly type: ReservedStockType\n\n\t/** \n\t * The stock item reserved quantity.\n\t * @example ```100```\n\t */\n\tquantity: number\n\n\tstock_item?: StockItem | null\n\tsku?: Sku | null\n\tstock_reservations?: StockReservation[] | null\n\tversions?: Version[] | null\n\n}\n\n\nclass ReservedStocks extends ApiResource<ReservedStock> {\n\n\tstatic readonly TYPE: ReservedStockType = 'reserved_stocks' as const\n\n\tasync stock_item(reservedStockId: string | ReservedStock, params?: QueryParamsRetrieve<StockItem>, options?: ResourcesConfig): Promise<StockItem> {\n\t\tconst _reservedStockId = (reservedStockId as ReservedStock).id || reservedStockId as string\n\t\treturn this.resources.fetch<StockItem>({ type: 'stock_items' }, `reserved_stocks/${_reservedStockId}/stock_item`, params, options) as unknown as StockItem\n\t}\n\n\tasync sku(reservedStockId: string | ReservedStock, params?: QueryParamsRetrieve<Sku>, options?: ResourcesConfig): Promise<Sku> {\n\t\tconst _reservedStockId = (reservedStockId as ReservedStock).id || reservedStockId as string\n\t\treturn this.resources.fetch<Sku>({ type: 'skus' }, `reserved_stocks/${_reservedStockId}/sku`, params, options) as unknown as Sku\n\t}\n\n\tasync stock_reservations(reservedStockId: string | ReservedStock, params?: QueryParamsList<StockReservation>, options?: ResourcesConfig): Promise<ListResponse<StockReservation>> {\n\t\tconst _reservedStockId = (reservedStockId as ReservedStock).id || reservedStockId as string\n\t\treturn this.resources.fetch<StockReservation>({ type: 'stock_reservations' }, `reserved_stocks/${_reservedStockId}/stock_reservations`, params, options) as unknown as ListResponse<StockReservation>\n\t}\n\n\tasync versions(reservedStockId: string | ReservedStock, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _reservedStockId = (reservedStockId as ReservedStock).id || reservedStockId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `reserved_stocks/${_reservedStockId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\n\tisReservedStock(resource: any): resource is ReservedStock {\n\t\treturn resource.type && (resource.type === ReservedStocks.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): ReservedStockRel {\n\t\treturn super.relationshipOneToOne<ReservedStockRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): ReservedStockRel[] {\n\t\treturn super.relationshipOneToMany<ReservedStockRel>(...ids)\n\t}\n\n\n\ttype(): ReservedStockType {\n\t\treturn ReservedStocks.TYPE\n\t}\n\n}\n\n\nconst instance = new ReservedStocks()\nexport default instance\n\nexport type { ReservedStock, ReservedStockType }\n"]}
|
1
|
+
{"version":3,"sources":["../../src/resources/reserved_stocks.ts"],"names":[],"mappings":";;AAoCA,MAAM,uBAAuB,WAA2B,CAAA;AAAA,EAEvD,OAAgB,IAA0B,GAAA,iBAAA;AAAA,EAE1C,MAAM,UAAA,CAAW,eAAyC,EAAA,MAAA,EAAyC,OAA+C,EAAA;AACjJ,IAAM,MAAA,gBAAA,GAAoB,gBAAkC,EAAM,IAAA,eAAA;AAClE,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAiB,EAAE,IAAA,EAAM,aAAc,EAAA,EAAG,CAAmB,gBAAA,EAAA,gBAAgB,CAAe,WAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAClI,EAEA,MAAM,GAAA,CAAI,eAAyC,EAAA,MAAA,EAAmC,OAAyC,EAAA;AAC9H,IAAM,MAAA,gBAAA,GAAoB,gBAAkC,EAAM,IAAA,eAAA;AAClE,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAW,EAAE,IAAA,EAAM,MAAO,EAAA,EAAG,CAAmB,gBAAA,EAAA,gBAAgB,CAAQ,IAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC9G,EAEA,MAAM,kBAAA,CAAmB,eAAyC,EAAA,MAAA,EAA4C,OAAoE,EAAA;AACjL,IAAM,MAAA,gBAAA,GAAoB,gBAAkC,EAAM,IAAA,eAAA;AAClE,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAwB,EAAE,IAAA,EAAM,oBAAqB,EAAA,EAAG,CAAmB,gBAAA,EAAA,gBAAgB,CAAuB,mBAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACxJ,EAEA,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":"reserved_stocks.js","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 { StockItem } from './stock_items'\nimport type { Sku } from './skus'\nimport type { StockReservation } from './stock_reservations'\nimport type { Version } from './versions'\n\n\ntype ReservedStockType = 'reserved_stocks'\ntype ReservedStockRel = ResourceRel & { type: ReservedStockType }\n\n\nexport type ReservedStockSort = Pick<ReservedStock, 'id' | 'quantity'> & ResourceSort\n// export type ReservedStockFilter = Pick<ReservedStock, 'id' | 'quantity'> & ResourceFilter\n\n\ninterface ReservedStock extends Resource {\n\t\n\treadonly type: ReservedStockType\n\n\t/** \n\t * The stock item reserved quantity.\n\t * @example ```100```\n\t */\n\tquantity: number\n\n\tstock_item?: StockItem | null\n\tsku?: Sku | null\n\tstock_reservations?: StockReservation[] | null\n\tversions?: Version[] | null\n\n}\n\n\nclass ReservedStocks extends ApiResource<ReservedStock> {\n\n\tstatic readonly TYPE: ReservedStockType = 'reserved_stocks' as const\n\n\tasync stock_item(reservedStockId: string | ReservedStock, params?: QueryParamsRetrieve<StockItem>, options?: ResourcesConfig): Promise<StockItem> {\n\t\tconst _reservedStockId = (reservedStockId as ReservedStock).id || reservedStockId as string\n\t\treturn this.resources.fetch<StockItem>({ type: 'stock_items' }, `reserved_stocks/${_reservedStockId}/stock_item`, params, options) as unknown as StockItem\n\t}\n\n\tasync sku(reservedStockId: string | ReservedStock, params?: QueryParamsRetrieve<Sku>, options?: ResourcesConfig): Promise<Sku> {\n\t\tconst _reservedStockId = (reservedStockId as ReservedStock).id || reservedStockId as string\n\t\treturn this.resources.fetch<Sku>({ type: 'skus' }, `reserved_stocks/${_reservedStockId}/sku`, params, options) as unknown as Sku\n\t}\n\n\tasync stock_reservations(reservedStockId: string | ReservedStock, params?: QueryParamsList<StockReservation>, options?: ResourcesConfig): Promise<ListResponse<StockReservation>> {\n\t\tconst _reservedStockId = (reservedStockId as ReservedStock).id || reservedStockId as string\n\t\treturn this.resources.fetch<StockReservation>({ type: 'stock_reservations' }, `reserved_stocks/${_reservedStockId}/stock_reservations`, params, options) as unknown as ListResponse<StockReservation>\n\t}\n\n\tasync versions(reservedStockId: string | ReservedStock, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _reservedStockId = (reservedStockId as ReservedStock).id || reservedStockId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `reserved_stocks/${_reservedStockId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\n\tisReservedStock(resource: any): resource is ReservedStock {\n\t\treturn resource.type && (resource.type === ReservedStocks.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): ReservedStockRel {\n\t\treturn super.relationshipOneToOne<ReservedStockRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): ReservedStockRel[] {\n\t\treturn super.relationshipOneToMany<ReservedStockRel>(...ids)\n\t}\n\n\n\ttype(): ReservedStockType {\n\t\treturn ReservedStocks.TYPE\n\t}\n\n}\n\n\nconst instance = new ReservedStocks()\nexport default instance\n\nexport type { ReservedStocks, ReservedStock, ReservedStockType }\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/resources/resource_errors.ts"],"names":["ApiResource"],"mappings":";;;;AAyCA,MAAM,uBAAuBA,oBAA2B,CAAA;AAAA,EAEvD,OAAgB,IAA0B,GAAA,iBAAA;AAAA,EAK1C,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":"resource_errors.cjs","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceId, ResourceRel, ResourceSort, /* ResourceFilter */ } from '../resource'\n\n\nimport type { Order } from './orders'\nimport type { Return } from './returns'\n\n\ntype ResourceErrorType = 'resource_errors'\ntype ResourceErrorRel = ResourceRel & { type: ResourceErrorType }\n\n\nexport type ResourceErrorSort = Pick<ResourceError, 'id' | 'name' | 'code'> & ResourceSort\n// export type ResourceErrorFilter = Pick<ResourceError, 'id' | 'name' | 'code' | 'message'> & ResourceFilter\n\n\ninterface ResourceError extends Resource {\n\t\n\treadonly type: ResourceErrorType\n\n\t/** \n\t * The resource attribute name related to the error.\n\t * @example ```\"number\"```\n\t */\n\tname: string\n\t/** \n\t * The error code.\n\t * @example ```\"BLANK\"```\n\t */\n\tcode: string\n\t/** \n\t * The error message.\n\t * @example ```\"can't be blank\"```\n\t */\n\tmessage: string\n\n\tresource?: Order | Return | null\n\n}\n\n\nclass ResourceErrors extends ApiResource<ResourceError> {\n\n\tstatic readonly TYPE: ResourceErrorType = 'resource_errors' as const\n\n\t\n\n\n\tisResourceError(resource: any): resource is ResourceError {\n\t\treturn resource.type && (resource.type === ResourceErrors.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): ResourceErrorRel {\n\t\treturn super.relationshipOneToOne<ResourceErrorRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): ResourceErrorRel[] {\n\t\treturn super.relationshipOneToMany<ResourceErrorRel>(...ids)\n\t}\n\n\n\ttype(): ResourceErrorType {\n\t\treturn ResourceErrors.TYPE\n\t}\n\n}\n\n\nconst instance = new ResourceErrors()\nexport default instance\n\nexport type { ResourceError, ResourceErrorType }\n"]}
|
1
|
+
{"version":3,"sources":["../../src/resources/resource_errors.ts"],"names":["ApiResource"],"mappings":";;;;AAyCA,MAAM,uBAAuBA,oBAA2B,CAAA;AAAA,EAEvD,OAAgB,IAA0B,GAAA,iBAAA;AAAA,EAK1C,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":"resource_errors.cjs","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceId, ResourceRel, ResourceSort, /* ResourceFilter */ } from '../resource'\n\n\nimport type { Order } from './orders'\nimport type { Return } from './returns'\n\n\ntype ResourceErrorType = 'resource_errors'\ntype ResourceErrorRel = ResourceRel & { type: ResourceErrorType }\n\n\nexport type ResourceErrorSort = Pick<ResourceError, 'id' | 'name' | 'code'> & ResourceSort\n// export type ResourceErrorFilter = Pick<ResourceError, 'id' | 'name' | 'code' | 'message'> & ResourceFilter\n\n\ninterface ResourceError extends Resource {\n\t\n\treadonly type: ResourceErrorType\n\n\t/** \n\t * The resource attribute name related to the error.\n\t * @example ```\"number\"```\n\t */\n\tname: string\n\t/** \n\t * The error code.\n\t * @example ```\"BLANK\"```\n\t */\n\tcode: string\n\t/** \n\t * The error message.\n\t * @example ```\"can't be blank\"```\n\t */\n\tmessage: string\n\n\tresource?: Order | Return | null\n\n}\n\n\nclass ResourceErrors extends ApiResource<ResourceError> {\n\n\tstatic readonly TYPE: ResourceErrorType = 'resource_errors' as const\n\n\t\n\n\n\tisResourceError(resource: any): resource is ResourceError {\n\t\treturn resource.type && (resource.type === ResourceErrors.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): ResourceErrorRel {\n\t\treturn super.relationshipOneToOne<ResourceErrorRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): ResourceErrorRel[] {\n\t\treturn super.relationshipOneToMany<ResourceErrorRel>(...ids)\n\t}\n\n\n\ttype(): ResourceErrorType {\n\t\treturn ResourceErrors.TYPE\n\t}\n\n}\n\n\nconst instance = new ResourceErrors()\nexport default instance\n\nexport type { ResourceErrors, ResourceError, ResourceErrorType }\n"]}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export {
|
1
|
+
export { je as ResourceError, jf as ResourceErrorSort, lY as ResourceErrorType, cG as ResourceErrors, cF as default } from '../api-IwWtsAqE.cjs';
|
2
2
|
import '../client.cjs';
|
3
|
-
import '../interceptor-
|
3
|
+
import '../interceptor-k15jXzf0.cjs';
|
4
4
|
import '../types.cjs';
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export {
|
1
|
+
export { je as ResourceError, jf as ResourceErrorSort, lY as ResourceErrorType, cG as ResourceErrors, cF as default } from '../api-F1F37Dud.js';
|
2
2
|
import '../client.js';
|
3
|
-
import '../interceptor-
|
3
|
+
import '../interceptor-k15jXzf0.js';
|
4
4
|
import '../types.js';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/resources/resource_errors.ts"],"names":[],"mappings":";;AAyCA,MAAM,uBAAuB,WAA2B,CAAA;AAAA,EAEvD,OAAgB,IAA0B,GAAA,iBAAA;AAAA,EAK1C,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":"resource_errors.js","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceId, ResourceRel, ResourceSort, /* ResourceFilter */ } from '../resource'\n\n\nimport type { Order } from './orders'\nimport type { Return } from './returns'\n\n\ntype ResourceErrorType = 'resource_errors'\ntype ResourceErrorRel = ResourceRel & { type: ResourceErrorType }\n\n\nexport type ResourceErrorSort = Pick<ResourceError, 'id' | 'name' | 'code'> & ResourceSort\n// export type ResourceErrorFilter = Pick<ResourceError, 'id' | 'name' | 'code' | 'message'> & ResourceFilter\n\n\ninterface ResourceError extends Resource {\n\t\n\treadonly type: ResourceErrorType\n\n\t/** \n\t * The resource attribute name related to the error.\n\t * @example ```\"number\"```\n\t */\n\tname: string\n\t/** \n\t * The error code.\n\t * @example ```\"BLANK\"```\n\t */\n\tcode: string\n\t/** \n\t * The error message.\n\t * @example ```\"can't be blank\"```\n\t */\n\tmessage: string\n\n\tresource?: Order | Return | null\n\n}\n\n\nclass ResourceErrors extends ApiResource<ResourceError> {\n\n\tstatic readonly TYPE: ResourceErrorType = 'resource_errors' as const\n\n\t\n\n\n\tisResourceError(resource: any): resource is ResourceError {\n\t\treturn resource.type && (resource.type === ResourceErrors.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): ResourceErrorRel {\n\t\treturn super.relationshipOneToOne<ResourceErrorRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): ResourceErrorRel[] {\n\t\treturn super.relationshipOneToMany<ResourceErrorRel>(...ids)\n\t}\n\n\n\ttype(): ResourceErrorType {\n\t\treturn ResourceErrors.TYPE\n\t}\n\n}\n\n\nconst instance = new ResourceErrors()\nexport default instance\n\nexport type { ResourceError, ResourceErrorType }\n"]}
|
1
|
+
{"version":3,"sources":["../../src/resources/resource_errors.ts"],"names":[],"mappings":";;AAyCA,MAAM,uBAAuB,WAA2B,CAAA;AAAA,EAEvD,OAAgB,IAA0B,GAAA,iBAAA;AAAA,EAK1C,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":"resource_errors.js","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceId, ResourceRel, ResourceSort, /* ResourceFilter */ } from '../resource'\n\n\nimport type { Order } from './orders'\nimport type { Return } from './returns'\n\n\ntype ResourceErrorType = 'resource_errors'\ntype ResourceErrorRel = ResourceRel & { type: ResourceErrorType }\n\n\nexport type ResourceErrorSort = Pick<ResourceError, 'id' | 'name' | 'code'> & ResourceSort\n// export type ResourceErrorFilter = Pick<ResourceError, 'id' | 'name' | 'code' | 'message'> & ResourceFilter\n\n\ninterface ResourceError extends Resource {\n\t\n\treadonly type: ResourceErrorType\n\n\t/** \n\t * The resource attribute name related to the error.\n\t * @example ```\"number\"```\n\t */\n\tname: string\n\t/** \n\t * The error code.\n\t * @example ```\"BLANK\"```\n\t */\n\tcode: string\n\t/** \n\t * The error message.\n\t * @example ```\"can't be blank\"```\n\t */\n\tmessage: string\n\n\tresource?: Order | Return | null\n\n}\n\n\nclass ResourceErrors extends ApiResource<ResourceError> {\n\n\tstatic readonly TYPE: ResourceErrorType = 'resource_errors' as const\n\n\t\n\n\n\tisResourceError(resource: any): resource is ResourceError {\n\t\treturn resource.type && (resource.type === ResourceErrors.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): ResourceErrorRel {\n\t\treturn super.relationshipOneToOne<ResourceErrorRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): ResourceErrorRel[] {\n\t\treturn super.relationshipOneToMany<ResourceErrorRel>(...ids)\n\t}\n\n\n\ttype(): ResourceErrorType {\n\t\treturn ResourceErrors.TYPE\n\t}\n\n}\n\n\nconst instance = new ResourceErrors()\nexport default instance\n\nexport type { ResourceErrors, ResourceError, ResourceErrorType }\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/resources/return_line_items.ts"],"names":["ApiResource"],"mappings":";;;;AAuHA,MAAM,wBAAwBA,oBAA4B,CAAA;AAAA,EAEzD,OAAgB,IAA2B,GAAA,mBAAA;AAAA,EAE3C,MAAM,MAAA,CAAO,QAAgC,EAAA,MAAA,EAA8C,OAAoD,EAAA;AAC9I,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA6C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,eAAgB,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAChI,EAEA,MAAM,MAAA,CAAO,QAAgC,EAAA,MAAA,EAA8C,OAAoD,EAAA;AAC9I,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA6C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,eAAgB,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAChI,EAEA,MAAM,MAAO,CAAA,EAAA,EAAyB,OAA0C,EAAA;AAC/E,IAAA,MAAM,IAAK,CAAA,SAAA,CAAU,MAAQ,CAAA,OAAO,EAAO,KAAA,QAAA,GAAW,EAAE,EAAA,EAAI,IAAM,EAAA,eAAA,CAAgB,IAAK,EAAA,GAAI,IAAI,OAAO,CAAA;AAAA;AACvG,EAEA,MAAM,MAAA,CAAO,gBAA2C,EAAA,MAAA,EAAsC,OAA4C,EAAA;AACzI,IAAM,MAAA,iBAAA,GAAqB,iBAAoC,EAAM,IAAA,gBAAA;AACrE,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAc,EAAE,IAAA,EAAM,SAAU,EAAA,EAAG,CAAqB,kBAAA,EAAA,iBAAiB,CAAW,OAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC1H,EAEA,MAAM,SAAA,CAAU,gBAA2C,EAAA,MAAA,EAAwC,OAA8C,EAAA;AAChJ,IAAM,MAAA,iBAAA,GAAqB,iBAAoC,EAAM,IAAA,gBAAA;AACrE,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAgB,EAAE,IAAA,EAAM,YAAa,EAAA,EAAG,CAAqB,kBAAA,EAAA,iBAAiB,CAAc,UAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAClI,EAEA,MAAM,QAAA,CAAS,EAA6B,EAAA,MAAA,EAA8C,OAAoD,EAAA;AAC7I,IAAA,OAAO,KAAK,SAAU,CAAA,MAAA,CAA6C,EAAE,EAAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,eAAgB,CAAA,IAAA,EAAM,UAAU,IAAK,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AAC5K,EAGA,iBAAiB,QAA2C,EAAA;AAC3D,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,eAAgB,CAAA,IAAA;AAAA;AAC5D,EAGA,aAAa,EAAmD,EAAA;AAC/D,IAAO,OAAA,KAAA,CAAM,qBAAwC,EAAE,CAAA;AAAA;AACxD,EAEA,sBAAsB,GAAoC,EAAA;AACzD,IAAO,OAAA,KAAA,CAAM,qBAAyC,CAAA,GAAG,GAAG,CAAA;AAAA;AAC7D,EAGA,IAA2B,GAAA;AAC1B,IAAA,OAAO,eAAgB,CAAA,IAAA;AAAA;AAGzB;AAGA,MAAM,QAAA,GAAW,IAAI,eAAgB,EAAA;AACrC,IAAO,yBAAQ,GAAA","file":"return_line_items.cjs","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve } from '../query'\n\nimport type { Return, ReturnType } from './returns'\nimport type { LineItem, LineItemType } from './line_items'\n\n\ntype ReturnLineItemType = 'return_line_items'\ntype ReturnLineItemRel = ResourceRel & { type: ReturnLineItemType }\ntype ReturnRel = ResourceRel & { type: ReturnType }\ntype LineItemRel = ResourceRel & { type: LineItemType }\n\n\nexport type ReturnLineItemSort = Pick<ReturnLineItem, 'id' | 'quantity' | 'total_amount_cents' | 'restocked_at'> & ResourceSort\n// export type ReturnLineItemFilter = Pick<ReturnLineItem, 'id' | 'quantity' | 'total_amount_cents' | 'return_reason' | 'restocked_at'> & ResourceFilter\n\n\ninterface ReturnLineItem extends Resource {\n\t\n\treadonly type: ReturnLineItemType\n\n\t/** \n\t * The code of the associated SKU.\n\t * @example ```\"TSHIRTMM000000FFFFFFXLXX\"```\n\t */\n\tsku_code?: string | null\n\t/** \n\t * The code of the associated bundle.\n\t * @example ```\"BUNDLEMM000000FFFFFFXLXX\"```\n\t */\n\tbundle_code?: string | null\n\t/** \n\t * The return line item quantity.\n\t * @example ```4```\n\t */\n\tquantity: number\n\t/** \n\t * The name of the line item.\n\t * @example ```\"Men's Black T-shirt with White Logo (XL)\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The image_url of the associated line item.\n\t * @example ```\"https://img.yourdomain.com/skus/xYZkjABcde.png\"```\n\t */\n\timage_url?: string | null\n\t/** \n\t * Calculated as line item unit amount x returned quantity and applied discounts, if any.\n\t * @example ```8800```\n\t */\n\ttotal_amount_cents?: number | null\n\t/** \n\t * The return line item total amount, float. This can be useful to track the purchase on thrid party systems, e.g Google Analyitcs Enhanced Ecommerce.\n\t * @example ```88```\n\t */\n\ttotal_amount_float: number\n\t/** \n\t * The return line item total amount, formatted. This can be useful to display the amount with currency in you views.\n\t * @example ```\"€88,00\"```\n\t */\n\tformatted_total_amount?: string | null\n\t/** \n\t * Set of key-value pairs that you can use to add details about return reason.\n\t * @example ```{\"size\":\"was wrong\"}```\n\t */\n\treturn_reason?: Record<string, any> | null\n\t/** \n\t * Time at which the return line item was restocked.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\trestocked_at?: string | null\n\n\treturn?: Return | null\n\tline_item?: LineItem | null\n\n}\n\n\ninterface ReturnLineItemCreate extends ResourceCreate {\n\t\n\t/** \n\t * The return line item quantity.\n\t * @example ```4```\n\t */\n\tquantity: number\n\t/** \n\t * Set of key-value pairs that you can use to add details about return reason.\n\t * @example ```{\"size\":\"was wrong\"}```\n\t */\n\treturn_reason?: Record<string, any> | null\n\n\treturn: ReturnRel\n\tline_item: LineItemRel\n\n}\n\n\ninterface ReturnLineItemUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The return line item quantity.\n\t * @example ```4```\n\t */\n\tquantity?: number | null\n\t/** \n\t * Send this attribute if you want to restock the line item.\n\t * @example ```true```\n\t */\n\t_restock?: boolean | null\n\t/** \n\t * Set of key-value pairs that you can use to add details about return reason.\n\t * @example ```{\"size\":\"was wrong\"}```\n\t */\n\treturn_reason?: Record<string, any> | null\n\t\n}\n\n\nclass ReturnLineItems extends ApiResource<ReturnLineItem> {\n\n\tstatic readonly TYPE: ReturnLineItemType = 'return_line_items' as const\n\n\tasync create(resource: ReturnLineItemCreate, params?: QueryParamsRetrieve<ReturnLineItem>, options?: ResourcesConfig): Promise<ReturnLineItem> {\n\t\treturn this.resources.create<ReturnLineItemCreate, ReturnLineItem>({ ...resource, type: ReturnLineItems.TYPE }, params, options)\n\t}\n\n\tasync update(resource: ReturnLineItemUpdate, params?: QueryParamsRetrieve<ReturnLineItem>, options?: ResourcesConfig): Promise<ReturnLineItem> {\n\t\treturn this.resources.update<ReturnLineItemUpdate, ReturnLineItem>({ ...resource, type: ReturnLineItems.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: ReturnLineItems.TYPE } : id, options)\n\t}\n\n\tasync return(returnLineItemId: string | ReturnLineItem, params?: QueryParamsRetrieve<Return>, options?: ResourcesConfig): Promise<Return> {\n\t\tconst _returnLineItemId = (returnLineItemId as ReturnLineItem).id || returnLineItemId as string\n\t\treturn this.resources.fetch<Return>({ type: 'returns' }, `return_line_items/${_returnLineItemId}/return`, params, options) as unknown as Return\n\t}\n\n\tasync line_item(returnLineItemId: string | ReturnLineItem, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\tconst _returnLineItemId = (returnLineItemId as ReturnLineItem).id || returnLineItemId as string\n\t\treturn this.resources.fetch<LineItem>({ type: 'line_items' }, `return_line_items/${_returnLineItemId}/line_item`, params, options) as unknown as LineItem\n\t}\n\n\tasync _restock(id: string | ReturnLineItem, params?: QueryParamsRetrieve<ReturnLineItem>, options?: ResourcesConfig): Promise<ReturnLineItem> {\n\t\treturn this.resources.update<ReturnLineItemUpdate, ReturnLineItem>({ id: (typeof id === 'string')? id: id.id, type: ReturnLineItems.TYPE, _restock: true }, params, options)\n\t}\n\n\n\tisReturnLineItem(resource: any): resource is ReturnLineItem {\n\t\treturn resource.type && (resource.type === ReturnLineItems.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): ReturnLineItemRel {\n\t\treturn super.relationshipOneToOne<ReturnLineItemRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): ReturnLineItemRel[] {\n\t\treturn super.relationshipOneToMany<ReturnLineItemRel>(...ids)\n\t}\n\n\n\ttype(): ReturnLineItemType {\n\t\treturn ReturnLineItems.TYPE\n\t}\n\n}\n\n\nconst instance = new ReturnLineItems()\nexport default instance\n\nexport type { ReturnLineItem, ReturnLineItemCreate, ReturnLineItemUpdate, ReturnLineItemType }\n"]}
|
1
|
+
{"version":3,"sources":["../../src/resources/return_line_items.ts"],"names":["ApiResource"],"mappings":";;;;AAuHA,MAAM,wBAAwBA,oBAA4B,CAAA;AAAA,EAEzD,OAAgB,IAA2B,GAAA,mBAAA;AAAA,EAE3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AAc,UAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAClI,EAEA,MAAM,QAAA,CAAS,EAA6B,EAAA,MAAA,EAA8C,OAAoD,EAAA;AAC7I,IAAA,OAAO,KAAK,SAAU,CAAA,MAAA,CAA6C,EAAE,EAAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,eAAgB,CAAA,IAAA,EAAM,UAAU,IAAK,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AAC5K,EAGA,iBAAiB,QAA2C,EAAA;AAC3D,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,eAAgB,CAAA,IAAA;AAAA;AAC5D,EAGA,aAAa,EAAmD,EAAA;AAC/D,IAAO,OAAA,KAAA,CAAM,qBAAwC,EAAE,CAAA;AAAA;AACxD,EAEA,sBAAsB,GAAoC,EAAA;AACzD,IAAO,OAAA,KAAA,CAAM,qBAAyC,CAAA,GAAG,GAAG,CAAA;AAAA;AAC7D,EAGA,IAA2B,GAAA;AAC1B,IAAA,OAAO,eAAgB,CAAA,IAAA;AAAA;AAGzB;AAGA,MAAM,QAAA,GAAW,IAAI,eAAgB,EAAA;AACrC,IAAO,yBAAQ,GAAA","file":"return_line_items.cjs","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve } from '../query'\n\nimport type { Return, ReturnType } from './returns'\nimport type { LineItem, LineItemType } from './line_items'\n\n\ntype ReturnLineItemType = 'return_line_items'\ntype ReturnLineItemRel = ResourceRel & { type: ReturnLineItemType }\ntype ReturnRel = ResourceRel & { type: ReturnType }\ntype LineItemRel = ResourceRel & { type: LineItemType }\n\n\nexport type ReturnLineItemSort = Pick<ReturnLineItem, 'id' | 'quantity' | 'total_amount_cents' | 'restocked_at'> & ResourceSort\n// export type ReturnLineItemFilter = Pick<ReturnLineItem, 'id' | 'quantity' | 'total_amount_cents' | 'return_reason' | 'restocked_at'> & ResourceFilter\n\n\ninterface ReturnLineItem extends Resource {\n\t\n\treadonly type: ReturnLineItemType\n\n\t/** \n\t * The code of the associated SKU.\n\t * @example ```\"TSHIRTMM000000FFFFFFXLXX\"```\n\t */\n\tsku_code?: string | null\n\t/** \n\t * The code of the associated bundle.\n\t * @example ```\"BUNDLEMM000000FFFFFFXLXX\"```\n\t */\n\tbundle_code?: string | null\n\t/** \n\t * The return line item quantity.\n\t * @example ```4```\n\t */\n\tquantity: number\n\t/** \n\t * The name of the line item.\n\t * @example ```\"Men's Black T-shirt with White Logo (XL)\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The image_url of the associated line item.\n\t * @example ```\"https://img.yourdomain.com/skus/xYZkjABcde.png\"```\n\t */\n\timage_url?: string | null\n\t/** \n\t * Calculated as line item unit amount x returned quantity and applied discounts, if any.\n\t * @example ```8800```\n\t */\n\ttotal_amount_cents?: number | null\n\t/** \n\t * The return line item total amount, float. This can be useful to track the purchase on thrid party systems, e.g Google Analyitcs Enhanced Ecommerce.\n\t * @example ```88```\n\t */\n\ttotal_amount_float: number\n\t/** \n\t * The return line item total amount, formatted. This can be useful to display the amount with currency in you views.\n\t * @example ```\"€88,00\"```\n\t */\n\tformatted_total_amount?: string | null\n\t/** \n\t * Set of key-value pairs that you can use to add details about return reason.\n\t * @example ```{\"size\":\"was wrong\"}```\n\t */\n\treturn_reason?: Record<string, any> | null\n\t/** \n\t * Time at which the return line item was restocked.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\trestocked_at?: string | null\n\n\treturn?: Return | null\n\tline_item?: LineItem | null\n\n}\n\n\ninterface ReturnLineItemCreate extends ResourceCreate {\n\t\n\t/** \n\t * The return line item quantity.\n\t * @example ```4```\n\t */\n\tquantity: number\n\t/** \n\t * Set of key-value pairs that you can use to add details about return reason.\n\t * @example ```{\"size\":\"was wrong\"}```\n\t */\n\treturn_reason?: Record<string, any> | null\n\n\treturn: ReturnRel\n\tline_item: LineItemRel\n\n}\n\n\ninterface ReturnLineItemUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The return line item quantity.\n\t * @example ```4```\n\t */\n\tquantity?: number | null\n\t/** \n\t * Send this attribute if you want to restock the line item.\n\t * @example ```true```\n\t */\n\t_restock?: boolean | null\n\t/** \n\t * Set of key-value pairs that you can use to add details about return reason.\n\t * @example ```{\"size\":\"was wrong\"}```\n\t */\n\treturn_reason?: Record<string, any> | null\n\t\n}\n\n\nclass ReturnLineItems extends ApiResource<ReturnLineItem> {\n\n\tstatic readonly TYPE: ReturnLineItemType = 'return_line_items' as const\n\n\tasync create(resource: ReturnLineItemCreate, params?: QueryParamsRetrieve<ReturnLineItem>, options?: ResourcesConfig): Promise<ReturnLineItem> {\n\t\treturn this.resources.create<ReturnLineItemCreate, ReturnLineItem>({ ...resource, type: ReturnLineItems.TYPE }, params, options)\n\t}\n\n\tasync update(resource: ReturnLineItemUpdate, params?: QueryParamsRetrieve<ReturnLineItem>, options?: ResourcesConfig): Promise<ReturnLineItem> {\n\t\treturn this.resources.update<ReturnLineItemUpdate, ReturnLineItem>({ ...resource, type: ReturnLineItems.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: ReturnLineItems.TYPE } : id, options)\n\t}\n\n\tasync return(returnLineItemId: string | ReturnLineItem, params?: QueryParamsRetrieve<Return>, options?: ResourcesConfig): Promise<Return> {\n\t\tconst _returnLineItemId = (returnLineItemId as ReturnLineItem).id || returnLineItemId as string\n\t\treturn this.resources.fetch<Return>({ type: 'returns' }, `return_line_items/${_returnLineItemId}/return`, params, options) as unknown as Return\n\t}\n\n\tasync line_item(returnLineItemId: string | ReturnLineItem, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\tconst _returnLineItemId = (returnLineItemId as ReturnLineItem).id || returnLineItemId as string\n\t\treturn this.resources.fetch<LineItem>({ type: 'line_items' }, `return_line_items/${_returnLineItemId}/line_item`, params, options) as unknown as LineItem\n\t}\n\n\tasync _restock(id: string | ReturnLineItem, params?: QueryParamsRetrieve<ReturnLineItem>, options?: ResourcesConfig): Promise<ReturnLineItem> {\n\t\treturn this.resources.update<ReturnLineItemUpdate, ReturnLineItem>({ id: (typeof id === 'string')? id: id.id, type: ReturnLineItems.TYPE, _restock: true }, params, options)\n\t}\n\n\n\tisReturnLineItem(resource: any): resource is ReturnLineItem {\n\t\treturn resource.type && (resource.type === ReturnLineItems.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): ReturnLineItemRel {\n\t\treturn super.relationshipOneToOne<ReturnLineItemRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): ReturnLineItemRel[] {\n\t\treturn super.relationshipOneToMany<ReturnLineItemRel>(...ids)\n\t}\n\n\n\ttype(): ReturnLineItemType {\n\t\treturn ReturnLineItems.TYPE\n\t}\n\n}\n\n\nconst instance = new ReturnLineItems()\nexport default instance\n\nexport type { ReturnLineItems, ReturnLineItem, ReturnLineItemCreate, ReturnLineItemUpdate, ReturnLineItemType }\n"]}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export {
|
1
|
+
export { jg as ReturnLineItem, jh as ReturnLineItemCreate, jj as ReturnLineItemSort, l_ as ReturnLineItemType, ji as ReturnLineItemUpdate, cI as ReturnLineItems, cH as default } from '../api-IwWtsAqE.cjs';
|
2
2
|
import '../client.cjs';
|
3
|
-
import '../interceptor-
|
3
|
+
import '../interceptor-k15jXzf0.cjs';
|
4
4
|
import '../types.cjs';
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export {
|
1
|
+
export { jg as ReturnLineItem, jh as ReturnLineItemCreate, jj as ReturnLineItemSort, l_ as ReturnLineItemType, ji as ReturnLineItemUpdate, cI as ReturnLineItems, cH as default } from '../api-F1F37Dud.js';
|
2
2
|
import '../client.js';
|
3
|
-
import '../interceptor-
|
3
|
+
import '../interceptor-k15jXzf0.js';
|
4
4
|
import '../types.js';
|