@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,4 +1,4 @@
|
|
1
|
-
export {
|
1
|
+
export { km as StockReservation, kn as StockReservationCreate, kp as StockReservationSort, m1 as StockReservationType, ko as StockReservationUpdate, dg as StockReservations, df 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 { km as StockReservation, kn as StockReservationCreate, kp as StockReservationSort, m1 as StockReservationType, ko as StockReservationUpdate, dg as StockReservations, df 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/stock_reservations.ts"],"names":[],"mappings":";;AAkFA,MAAM,0BAA0B,WAA8B,CAAA;AAAA,EAE7D,OAAgB,IAA6B,GAAA,oBAAA;AAAA,EAE7C,MAAM,MAAA,CAAO,QAAkC,EAAA,MAAA,EAAgD,OAAsD,EAAA;AACpJ,IAAO,OAAA,IAA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,EAEA,MAAM,GAAA,CAAI,kBAA+C,EAAA,MAAA,EAAmC,OAAyC,EAAA;AACpI,IAAM,MAAA,mBAAA,GAAuB,mBAAwC,EAAM,IAAA,kBAAA;AAC3E,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAW,EAAE,IAAA,EAAM,MAAO,EAAA,EAAG,CAAsB,mBAAA,EAAA,mBAAmB,CAAQ,IAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACpH,EAEA,MAAM,QAAA,CAAS,EAA+B,EAAA,MAAA,EAAgD,OAAsD,EAAA;AACnJ,IAAA,OAAO,KAAK,SAAU,CAAA,MAAA,CAAiD,EAAE,EAAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,iBAAkB,CAAA,IAAA,EAAM,UAAU,IAAK,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AAClL,EAGA,mBAAmB,QAA6C,EAAA;AAC/D,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,iBAAkB,CAAA,IAAA;AAAA;AAC9D,EAGA,aAAa,EAAqD,EAAA;AACjE,IAAO,OAAA,KAAA,CAAM,qBAA0C,EAAE,CAAA;AAAA;AAC1D,EAEA,sBAAsB,GAAsC,EAAA;AAC3D,IAAO,OAAA,KAAA,CAAM,qBAA2C,CAAA,GAAG,GAAG,CAAA;AAAA;AAC/D,EAGA,IAA6B,GAAA;AAC5B,IAAA,OAAO,iBAAkB,CAAA,IAAA;AAAA;AAG3B;AAGA,MAAM,QAAA,GAAW,IAAI,iBAAkB,EAAA;AACvC,IAAO,0BAAQ,GAAA","file":"stock_reservations.js","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 { LineItem } from './line_items'\nimport type { Order } from './orders'\nimport type { StockLineItem } from './stock_line_items'\nimport type { StockTransfer } from './stock_transfers'\nimport type { StockItem, StockItemType } from './stock_items'\nimport type { ReservedStock } from './reserved_stocks'\nimport type { Sku } from './skus'\n\n\ntype StockReservationType = 'stock_reservations'\ntype StockReservationRel = ResourceRel & { type: StockReservationType }\ntype StockItemRel = ResourceRel & { type: StockItemType }\n\n\nexport type StockReservationSort = Pick<StockReservation, 'id' | 'status' | 'quantity' | 'expires_at'> & ResourceSort\n// export type StockReservationFilter = Pick<StockReservation, 'id' | 'status' | 'quantity' | 'expires_at'> & ResourceFilter\n\n\ninterface StockReservation extends Resource {\n\t\n\treadonly type: StockReservationType\n\n\t/** \n\t * The stock reservation status. One of 'draft' (default), or 'pending'.\n\t * @example ```\"draft\"```\n\t */\n\tstatus: 'draft' | 'pending'\n\t/** \n\t * The stock reservation quantity.\n\t * @example ```4```\n\t */\n\tquantity: number\n\t/** \n\t * The expiration date/time of this stock reservation.\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at: string\n\n\tline_item?: LineItem | null\n\torder?: Order | null\n\tstock_line_item?: StockLineItem | null\n\tstock_transfer?: StockTransfer | null\n\tstock_item?: StockItem | null\n\treserved_stock?: ReservedStock | null\n\tsku?: Sku | null\n\n}\n\n\ninterface StockReservationCreate extends ResourceCreate {\n\t\n\t/** \n\t * The stock reservation quantity.\n\t * @example ```4```\n\t */\n\tquantity: number\n\n\tstock_item: StockItemRel\n\n}\n\n\ninterface StockReservationUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The stock reservation quantity.\n\t * @example ```4```\n\t */\n\tquantity?: number | null\n\t/** \n\t * Send this attribute if you want to mark this stock reservation as pending.\n\t * @example ```true```\n\t */\n\t_pending?: boolean | null\n\t\n}\n\n\nclass StockReservations extends ApiResource<StockReservation> {\n\n\tstatic readonly TYPE: StockReservationType = 'stock_reservations' as const\n\n\tasync create(resource: StockReservationCreate, params?: QueryParamsRetrieve<StockReservation>, options?: ResourcesConfig): Promise<StockReservation> {\n\t\treturn this.resources.create<StockReservationCreate, StockReservation>({ ...resource, type: StockReservations.TYPE }, params, options)\n\t}\n\n\tasync update(resource: StockReservationUpdate, params?: QueryParamsRetrieve<StockReservation>, options?: ResourcesConfig): Promise<StockReservation> {\n\t\treturn this.resources.update<StockReservationUpdate, StockReservation>({ ...resource, type: StockReservations.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: StockReservations.TYPE } : id, options)\n\t}\n\n\tasync line_item(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\tconst _stockReservationId = (stockReservationId as StockReservation).id || stockReservationId as string\n\t\treturn this.resources.fetch<LineItem>({ type: 'line_items' }, `stock_reservations/${_stockReservationId}/line_item`, params, options) as unknown as LineItem\n\t}\n\n\tasync order(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _stockReservationId = (stockReservationId as StockReservation).id || stockReservationId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `stock_reservations/${_stockReservationId}/order`, params, options) as unknown as Order\n\t}\n\n\tasync stock_line_item(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<StockLineItem>, options?: ResourcesConfig): Promise<StockLineItem> {\n\t\tconst _stockReservationId = (stockReservationId as StockReservation).id || stockReservationId as string\n\t\treturn this.resources.fetch<StockLineItem>({ type: 'stock_line_items' }, `stock_reservations/${_stockReservationId}/stock_line_item`, params, options) as unknown as StockLineItem\n\t}\n\n\tasync stock_transfer(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<StockTransfer>, options?: ResourcesConfig): Promise<StockTransfer> {\n\t\tconst _stockReservationId = (stockReservationId as StockReservation).id || stockReservationId as string\n\t\treturn this.resources.fetch<StockTransfer>({ type: 'stock_transfers' }, `stock_reservations/${_stockReservationId}/stock_transfer`, params, options) as unknown as StockTransfer\n\t}\n\n\tasync stock_item(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<StockItem>, options?: ResourcesConfig): Promise<StockItem> {\n\t\tconst _stockReservationId = (stockReservationId as StockReservation).id || stockReservationId as string\n\t\treturn this.resources.fetch<StockItem>({ type: 'stock_items' }, `stock_reservations/${_stockReservationId}/stock_item`, params, options) as unknown as StockItem\n\t}\n\n\tasync reserved_stock(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<ReservedStock>, options?: ResourcesConfig): Promise<ReservedStock> {\n\t\tconst _stockReservationId = (stockReservationId as StockReservation).id || stockReservationId as string\n\t\treturn this.resources.fetch<ReservedStock>({ type: 'reserved_stocks' }, `stock_reservations/${_stockReservationId}/reserved_stock`, params, options) as unknown as ReservedStock\n\t}\n\n\tasync sku(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<Sku>, options?: ResourcesConfig): Promise<Sku> {\n\t\tconst _stockReservationId = (stockReservationId as StockReservation).id || stockReservationId as string\n\t\treturn this.resources.fetch<Sku>({ type: 'skus' }, `stock_reservations/${_stockReservationId}/sku`, params, options) as unknown as Sku\n\t}\n\n\tasync _pending(id: string | StockReservation, params?: QueryParamsRetrieve<StockReservation>, options?: ResourcesConfig): Promise<StockReservation> {\n\t\treturn this.resources.update<StockReservationUpdate, StockReservation>({ id: (typeof id === 'string')? id: id.id, type: StockReservations.TYPE, _pending: true }, params, options)\n\t}\n\n\n\tisStockReservation(resource: any): resource is StockReservation {\n\t\treturn resource.type && (resource.type === StockReservations.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): StockReservationRel {\n\t\treturn super.relationshipOneToOne<StockReservationRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): StockReservationRel[] {\n\t\treturn super.relationshipOneToMany<StockReservationRel>(...ids)\n\t}\n\n\n\ttype(): StockReservationType {\n\t\treturn StockReservations.TYPE\n\t}\n\n}\n\n\nconst instance = new StockReservations()\nexport default instance\n\nexport type { StockReservation, StockReservationCreate, StockReservationUpdate, StockReservationType }\n"]}
|
1
|
+
{"version":3,"sources":["../../src/resources/stock_reservations.ts"],"names":[],"mappings":";;AAkFA,MAAM,0BAA0B,WAA8B,CAAA;AAAA,EAE7D,OAAgB,IAA6B,GAAA,oBAAA;AAAA,EAE7C,MAAM,MAAA,CAAO,QAAkC,EAAA,MAAA,EAAgD,OAAsD,EAAA;AACpJ,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAAiD,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,iBAAkB,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACtI,EAEA,MAAM,MAAA,CAAO,QAAkC,EAAA,MAAA,EAAgD,OAAsD,EAAA;AACpJ,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAAiD,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,iBAAkB,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACtI,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,iBAAA,CAAkB,IAAK,EAAA,GAAI,IAAI,OAAO,CAAA;AAAA;AACzG,EAEA,MAAM,SAAA,CAAU,kBAA+C,EAAA,MAAA,EAAwC,OAA8C,EAAA;AACpJ,IAAM,MAAA,mBAAA,GAAuB,mBAAwC,EAAM,IAAA,kBAAA;AAC3E,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAgB,EAAE,IAAA,EAAM,YAAa,EAAA,EAAG,CAAsB,mBAAA,EAAA,mBAAmB,CAAc,UAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACrI,EAEA,MAAM,KAAA,CA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AAA;AAC5B,IAAA,OAAO,iBAAkB,CAAA,IAAA;AAAA;AAG3B;AAGA,MAAM,QAAA,GAAW,IAAI,iBAAkB,EAAA;AACvC,IAAO,0BAAQ,GAAA","file":"stock_reservations.js","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 { LineItem } from './line_items'\nimport type { Order } from './orders'\nimport type { StockLineItem } from './stock_line_items'\nimport type { StockTransfer } from './stock_transfers'\nimport type { StockItem, StockItemType } from './stock_items'\nimport type { ReservedStock } from './reserved_stocks'\nimport type { Sku } from './skus'\n\n\ntype StockReservationType = 'stock_reservations'\ntype StockReservationRel = ResourceRel & { type: StockReservationType }\ntype StockItemRel = ResourceRel & { type: StockItemType }\n\n\nexport type StockReservationSort = Pick<StockReservation, 'id' | 'status' | 'quantity' | 'expires_at'> & ResourceSort\n// export type StockReservationFilter = Pick<StockReservation, 'id' | 'status' | 'quantity' | 'expires_at'> & ResourceFilter\n\n\ninterface StockReservation extends Resource {\n\t\n\treadonly type: StockReservationType\n\n\t/** \n\t * The stock reservation status. One of 'draft' (default), or 'pending'.\n\t * @example ```\"draft\"```\n\t */\n\tstatus: 'draft' | 'pending'\n\t/** \n\t * The stock reservation quantity.\n\t * @example ```4```\n\t */\n\tquantity: number\n\t/** \n\t * The expiration date/time of this stock reservation.\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at: string\n\n\tline_item?: LineItem | null\n\torder?: Order | null\n\tstock_line_item?: StockLineItem | null\n\tstock_transfer?: StockTransfer | null\n\tstock_item?: StockItem | null\n\treserved_stock?: ReservedStock | null\n\tsku?: Sku | null\n\n}\n\n\ninterface StockReservationCreate extends ResourceCreate {\n\t\n\t/** \n\t * The stock reservation quantity.\n\t * @example ```4```\n\t */\n\tquantity: number\n\n\tstock_item: StockItemRel\n\n}\n\n\ninterface StockReservationUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The stock reservation quantity.\n\t * @example ```4```\n\t */\n\tquantity?: number | null\n\t/** \n\t * Send this attribute if you want to mark this stock reservation as pending.\n\t * @example ```true```\n\t */\n\t_pending?: boolean | null\n\t\n}\n\n\nclass StockReservations extends ApiResource<StockReservation> {\n\n\tstatic readonly TYPE: StockReservationType = 'stock_reservations' as const\n\n\tasync create(resource: StockReservationCreate, params?: QueryParamsRetrieve<StockReservation>, options?: ResourcesConfig): Promise<StockReservation> {\n\t\treturn this.resources.create<StockReservationCreate, StockReservation>({ ...resource, type: StockReservations.TYPE }, params, options)\n\t}\n\n\tasync update(resource: StockReservationUpdate, params?: QueryParamsRetrieve<StockReservation>, options?: ResourcesConfig): Promise<StockReservation> {\n\t\treturn this.resources.update<StockReservationUpdate, StockReservation>({ ...resource, type: StockReservations.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: StockReservations.TYPE } : id, options)\n\t}\n\n\tasync line_item(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\tconst _stockReservationId = (stockReservationId as StockReservation).id || stockReservationId as string\n\t\treturn this.resources.fetch<LineItem>({ type: 'line_items' }, `stock_reservations/${_stockReservationId}/line_item`, params, options) as unknown as LineItem\n\t}\n\n\tasync order(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _stockReservationId = (stockReservationId as StockReservation).id || stockReservationId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `stock_reservations/${_stockReservationId}/order`, params, options) as unknown as Order\n\t}\n\n\tasync stock_line_item(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<StockLineItem>, options?: ResourcesConfig): Promise<StockLineItem> {\n\t\tconst _stockReservationId = (stockReservationId as StockReservation).id || stockReservationId as string\n\t\treturn this.resources.fetch<StockLineItem>({ type: 'stock_line_items' }, `stock_reservations/${_stockReservationId}/stock_line_item`, params, options) as unknown as StockLineItem\n\t}\n\n\tasync stock_transfer(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<StockTransfer>, options?: ResourcesConfig): Promise<StockTransfer> {\n\t\tconst _stockReservationId = (stockReservationId as StockReservation).id || stockReservationId as string\n\t\treturn this.resources.fetch<StockTransfer>({ type: 'stock_transfers' }, `stock_reservations/${_stockReservationId}/stock_transfer`, params, options) as unknown as StockTransfer\n\t}\n\n\tasync stock_item(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<StockItem>, options?: ResourcesConfig): Promise<StockItem> {\n\t\tconst _stockReservationId = (stockReservationId as StockReservation).id || stockReservationId as string\n\t\treturn this.resources.fetch<StockItem>({ type: 'stock_items' }, `stock_reservations/${_stockReservationId}/stock_item`, params, options) as unknown as StockItem\n\t}\n\n\tasync reserved_stock(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<ReservedStock>, options?: ResourcesConfig): Promise<ReservedStock> {\n\t\tconst _stockReservationId = (stockReservationId as StockReservation).id || stockReservationId as string\n\t\treturn this.resources.fetch<ReservedStock>({ type: 'reserved_stocks' }, `stock_reservations/${_stockReservationId}/reserved_stock`, params, options) as unknown as ReservedStock\n\t}\n\n\tasync sku(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<Sku>, options?: ResourcesConfig): Promise<Sku> {\n\t\tconst _stockReservationId = (stockReservationId as StockReservation).id || stockReservationId as string\n\t\treturn this.resources.fetch<Sku>({ type: 'skus' }, `stock_reservations/${_stockReservationId}/sku`, params, options) as unknown as Sku\n\t}\n\n\tasync _pending(id: string | StockReservation, params?: QueryParamsRetrieve<StockReservation>, options?: ResourcesConfig): Promise<StockReservation> {\n\t\treturn this.resources.update<StockReservationUpdate, StockReservation>({ id: (typeof id === 'string')? id: id.id, type: StockReservations.TYPE, _pending: true }, params, options)\n\t}\n\n\n\tisStockReservation(resource: any): resource is StockReservation {\n\t\treturn resource.type && (resource.type === StockReservations.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): StockReservationRel {\n\t\treturn super.relationshipOneToOne<StockReservationRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): StockReservationRel[] {\n\t\treturn super.relationshipOneToMany<StockReservationRel>(...ids)\n\t}\n\n\n\ttype(): StockReservationType {\n\t\treturn StockReservations.TYPE\n\t}\n\n}\n\n\nconst instance = new StockReservations()\nexport default instance\n\nexport type { StockReservations, StockReservation, StockReservationCreate, StockReservationUpdate, StockReservationType }\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/resources/stock_transfers.ts"],"names":["ApiResource"],"mappings":";;;;AA6KA,MAAM,uBAAuBA,oBAA2B,CAAA;AAAA,EAEvD,OAAgB,IAA0B,GAAA,iBAAA;AAAA,EAE1C,MAAM,MAAA,CAAO,QAA+B,EAAA,MAAA,EAA6C,OAAmD,EAAA;AAC3I,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA2C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,cAAe,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC7H,EAEA,MAAM,MAAA,CAAO,QAA+B,EAAA,MAAA,EAA6C,OAAmD,EAAA;AAC3I,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA2C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,cAAe,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC7H,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,cAAA,CAAe,IAAK,EAAA,GAAI,IAAI,OAAO,CAAA;AAA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ourcesContent":["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 { Sku, SkuType } from './skus'\nimport type { StockLocation, StockLocationType } from './stock_locations'\nimport type { Shipment, ShipmentType } from './shipments'\nimport type { LineItem, LineItemType } from './line_items'\nimport type { StockReservation } from './stock_reservations'\nimport type { Attachment } from './attachments'\nimport type { Event } from './events'\nimport type { Version } from './versions'\n\n\ntype StockTransferType = 'stock_transfers'\ntype StockTransferRel = ResourceRel & { type: StockTransferType }\ntype SkuRel = ResourceRel & { type: SkuType }\ntype StockLocationRel = ResourceRel & { type: StockLocationType }\ntype ShipmentRel = ResourceRel & { type: ShipmentType }\ntype LineItemRel = ResourceRel & { type: LineItemType }\n\n\nexport type StockTransferSort = Pick<StockTransfer, 'id' | 'number' | 'status' | 'quantity' | 'on_hold_at' | 'picking_at' | 'in_transit_at' | 'completed_at' | 'cancelled_at'> & ResourceSort\n// export type StockTransferFilter = Pick<StockTransfer, 'id' | 'number' | 'status' | 'quantity' | 'on_hold_at' | 'picking_at' | 'in_transit_at' | 'completed_at' | 'cancelled_at'> & ResourceFilter\n\n\ninterface StockTransfer extends Resource {\n\t\n\treadonly type: StockTransferType\n\n\t/** \n\t * Unique identifier for the stock transfer (numeric).\n\t * @example ```\"1234\"```\n\t */\n\tnumber?: string | null\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 stock transfer status. One of 'draft' (default), 'upcoming', 'on_hold', 'picking', 'in_transit', 'completed', or 'cancelled'.\n\t * @example ```\"draft\"```\n\t */\n\tstatus: 'draft' | 'upcoming' | 'on_hold' | 'picking' | 'in_transit' | 'completed' | 'cancelled'\n\t/** \n\t * The stock quantity to be transferred from the origin stock location to destination one. Updatable unless stock transfer is completed or cancelled and depending on origin stock availability.\n\t * @example ```2```\n\t */\n\tquantity: number\n\t/** \n\t * Time at which the stock transfer was put on hold.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\ton_hold_at?: string | null\n\t/** \n\t * Time at which the stock transfer was picking.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tpicking_at?: string | null\n\t/** \n\t * Time at which the stock transfer was in transit.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tin_transit_at?: string | null\n\t/** \n\t * Time at which the stock transfer 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 stock transfer was cancelled.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tcancelled_at?: string | null\n\n\tsku?: Sku | null\n\torigin_stock_location?: StockLocation | null\n\tdestination_stock_location?: StockLocation | null\n\tshipment?: Shipment | null\n\tline_item?: LineItem | null\n\tstock_reservation?: StockReservation | null\n\tattachments?: Attachment[] | null\n\tevents?: Event[] | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface StockTransferCreate extends ResourceCreate {\n\t\n\t/** \n\t * Unique identifier for the stock transfer (numeric).\n\t * @example ```\"1234\"```\n\t */\n\tnumber?: string | null\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 stock quantity to be transferred from the origin stock location to destination one. Updatable unless stock transfer is completed or cancelled and depending on origin stock availability.\n\t * @example ```2```\n\t */\n\tquantity: number\n\n\tsku: SkuRel\n\torigin_stock_location: StockLocationRel\n\tdestination_stock_location: StockLocationRel\n\tshipment?: ShipmentRel | null\n\tline_item?: LineItemRel | null\n\n}\n\n\ninterface StockTransferUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * Unique identifier for the stock transfer (numeric).\n\t * @example ```\"1234\"```\n\t */\n\tnumber?: string | null\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 stock quantity to be transferred from the origin stock location to destination one. Updatable unless stock transfer is completed or cancelled and depending on origin stock availability.\n\t * @example ```2```\n\t */\n\tquantity?: number | null\n\t/** \n\t * Send this attribute if you want to mark this stock transfer as upcoming.\n\t * @example ```true```\n\t */\n\t_upcoming?: boolean | null\n\t/** \n\t * Send this attribute if you want to put this stock transfer on hold.\n\t * @example ```true```\n\t */\n\t_on_hold?: boolean | null\n\t/** \n\t * Send this attribute if you want to start picking this stock transfer.\n\t * @example ```true```\n\t */\n\t_picking?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this stock transfer as in transit.\n\t * @example ```true```\n\t */\n\t_in_transit?: boolean | null\n\t/** \n\t * Send this attribute if you want to complete this stock transfer.\n\t * @example ```true```\n\t */\n\t_complete?: boolean | null\n\t/** \n\t * Send this attribute if you want to cancel this stock transfer.\n\t * @example ```true```\n\t */\n\t_cancel?: boolean | null\n\n\tsku?: SkuRel | null\n\torigin_stock_location?: StockLocationRel | null\n\tdestination_stock_location?: StockLocationRel | null\n\tshipment?: ShipmentRel | null\n\tline_item?: LineItemRel | null\n\n}\n\n\nclass StockTransfers extends ApiResource<StockTransfer> {\n\n\tstatic readonly TYPE: StockTransferType = 'stock_transfers' as const\n\n\tasync create(resource: StockTransferCreate, params?: QueryParamsRetrieve<StockTransfer>, options?: ResourcesConfig): Promise<StockTransfer> {\n\t\treturn this.resources.create<StockTransferCreate, StockTransfer>({ ...resource, type: StockTransfers.TYPE }, params, options)\n\t}\n\n\tasync update(resource: StockTransferUpdate, params?: QueryParamsRetrieve<StockTransfer>, options?: ResourcesConfig): Promise<StockTransfer> {\n\t\treturn this.resources.update<StockTransferUpdate, StockTransfer>({ ...resource, type: StockTransfers.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: StockTransfers.TYPE } : id, options)\n\t}\n\n\tasync sku(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve<Sku>, options?: ResourcesConfig): Promise<Sku> {\n\t\tconst _stockTransferId = (stockTransferId as StockTransfer).id || stockTransferId as string\n\t\treturn this.resources.fetch<Sku>({ type: 'skus' }, `stock_transfers/${_stockTransferId}/sku`, params, options) as unknown as Sku\n\t}\n\n\tasync origin_stock_location(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve<StockLocation>, options?: ResourcesConfig): Promise<StockLocation> {\n\t\tconst _stockTransferId = (stockTransferId as StockTransfer).id || stockTransferId as string\n\t\treturn this.resources.fetch<StockLocation>({ type: 'stock_locations' }, `stock_transfers/${_stockTransferId}/origin_stock_location`, params, options) as unknown as StockLocation\n\t}\n\n\tasync destination_stock_location(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve<StockLocation>, options?: ResourcesConfig): Promise<StockLocation> {\n\t\tconst _stockTransferId = (stockTransferId as StockTransfer).id || stockTransferId as string\n\t\treturn this.resources.fetch<StockLocation>({ type: 'stock_locations' }, `stock_transfers/${_stockTransferId}/destination_stock_location`, params, options) as unknown as StockLocation\n\t}\n\n\tasync shipment(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve<Shipment>, options?: ResourcesConfig): Promise<Shipment> {\n\t\tconst _stockTransferId = (stockTransferId as StockTransfer).id || stockTransferId as string\n\t\treturn this.resources.fetch<Shipment>({ type: 'shipments' }, `stock_transfers/${_stockTransferId}/shipment`, params, options) as unknown as Shipment\n\t}\n\n\tasync line_item(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\tconst _stockTransferId = (stockTransferId as StockTransfer).id || stockTransferId as string\n\t\treturn this.resources.fetch<LineItem>({ type: 'line_items' }, `stock_transfers/${_stockTransferId}/line_item`, params, options) as unknown as LineItem\n\t}\n\n\tasync stock_reservation(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve<StockReservation>, options?: ResourcesConfig): Promise<StockReservation> {\n\t\tconst _stockTransferId = (stockTransferId as StockTransfer).id || stockTransferId as string\n\t\treturn this.resources.fetch<StockReservation>({ type: 'stock_reservations' }, `stock_transfers/${_stockTransferId}/stock_reservation`, params, options) as unknown as StockReservation\n\t}\n\n\tasync attachments(stockTransferId: string | StockTransfer, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _stockTransferId = (stockTransferId as StockTransfer).id || stockTransferId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `stock_transfers/${_stockTransferId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync events(stockTransferId: string | StockTransfer, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _stockTransferId = (stockTransferId as StockTransfer).id || stockTransferId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `stock_transfers/${_stockTransferId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync versions(stockTransferId: string | StockTransfer, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _stockTransferId = (stockTransferId as StockTransfer).id || stockTransferId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `stock_transfers/${_stockTransferId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync _upcoming(id: string | StockTransfer, params?: QueryParamsRetrieve<StockTransfer>, options?: ResourcesConfig): Promise<StockTransfer> {\n\t\treturn this.resources.update<StockTransferUpdate, StockTransfer>({ id: (typeof id === 'string')? id: id.id, type: StockTransfers.TYPE, _upcoming: true }, params, options)\n\t}\n\n\tasync _on_hold(id: string | StockTransfer, params?: QueryParamsRetrieve<StockTransfer>, options?: ResourcesConfig): Promise<StockTransfer> {\n\t\treturn this.resources.update<StockTransferUpdate, StockTransfer>({ id: (typeof id === 'string')? id: id.id, type: StockTransfers.TYPE, _on_hold: true }, params, options)\n\t}\n\n\tasync _picking(id: string | StockTransfer, params?: QueryParamsRetrieve<StockTransfer>, options?: ResourcesConfig): Promise<StockTransfer> {\n\t\treturn this.resources.update<StockTransferUpdate, StockTransfer>({ id: (typeof id === 'string')? id: id.id, type: StockTransfers.TYPE, _picking: true }, params, options)\n\t}\n\n\tasync _in_transit(id: string | StockTransfer, params?: QueryParamsRetrieve<StockTransfer>, options?: ResourcesConfig): Promise<StockTransfer> {\n\t\treturn this.resources.update<StockTransferUpdate, StockTransfer>({ id: (typeof id === 'string')? id: id.id, type: StockTransfers.TYPE, _in_transit: true }, params, options)\n\t}\n\n\tasync _complete(id: string | StockTransfer, params?: QueryParamsRetrieve<StockTransfer>, options?: ResourcesConfig): Promise<StockTransfer> {\n\t\treturn this.resources.update<StockTransferUpdate, StockTransfer>({ id: (typeof id === 'string')? id: id.id, type: StockTransfers.TYPE, _complete: true }, params, options)\n\t}\n\n\tasync _cancel(id: string | StockTransfer, params?: QueryParamsRetrieve<StockTransfer>, options?: ResourcesConfig): Promise<StockTransfer> {\n\t\treturn this.resources.update<StockTransferUpdate, StockTransfer>({ id: (typeof id === 'string')? id: id.id, type: StockTransfers.TYPE, _cancel: true }, params, options)\n\t}\n\n\n\tisStockTransfer(resource: any): resource is StockTransfer {\n\t\treturn resource.type && (resource.type === StockTransfers.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): StockTransferRel {\n\t\treturn super.relationshipOneToOne<StockTransferRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): StockTransferRel[] {\n\t\treturn super.relationshipOneToMany<StockTransferRel>(...ids)\n\t}\n\n\n\ttype(): StockTransferType {\n\t\treturn StockTransfers.TYPE\n\t}\n\n}\n\n\nconst instance = new StockTransfers()\nexport default instance\n\nexport type { StockTransfer, StockTransferCreate, StockTransferUpdate, StockTransferType }\n"]}
|
1
|
+
{"version":3,"sources":["../../src/resources/stock_transfers.ts"],"names":["ApiRes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,CAAA;AAAA;AAC1K,EAEA,MAAM,OAAA,CAAQ,EAA4B,EAAA,MAAA,EAA6C,OAAmD,EAAA;AACzI,IAAA,OAAO,KAAK,SAAU,CAAA,MAAA,CAA2C,EAAE,EAAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,cAAe,CAAA,IAAA,EAAM,SAAS,IAAK,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AACxK,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":"stock_transfers.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 { Sku, SkuType } from './skus'\nimport type { StockLocation, StockLocationType } from './stock_locations'\nimport type { Shipment, ShipmentType } from './shipments'\nimport type { LineItem, LineItemType } from './line_items'\nimport type { StockReservation } from './stock_reservations'\nimport type { Attachment } from './attachments'\nimport type { Event } from './events'\nimport type { Version } from './versions'\n\n\ntype StockTransferType = 'stock_transfers'\ntype StockTransferRel = ResourceRel & { type: StockTransferType }\ntype SkuRel = ResourceRel & { type: SkuType }\ntype StockLocationRel = ResourceRel & { type: StockLocationType }\ntype ShipmentRel = ResourceRel & { type: ShipmentType }\ntype LineItemRel = ResourceRel & { type: LineItemType }\n\n\nexport type StockTransferSort = Pick<StockTransfer, 'id' | 'number' | 'status' | 'quantity' | 'on_hold_at' | 'picking_at' | 'in_transit_at' | 'completed_at' | 'cancelled_at'> & ResourceSort\n// export type StockTransferFilter = Pick<StockTransfer, 'id' | 'number' | 'status' | 'quantity' | 'on_hold_at' | 'picking_at' | 'in_transit_at' | 'completed_at' | 'cancelled_at'> & ResourceFilter\n\n\ninterface StockTransfer extends Resource {\n\t\n\treadonly type: StockTransferType\n\n\t/** \n\t * Unique identifier for the stock transfer (numeric).\n\t * @example ```\"1234\"```\n\t */\n\tnumber?: string | null\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 stock transfer status. One of 'draft' (default), 'upcoming', 'on_hold', 'picking', 'in_transit', 'completed', or 'cancelled'.\n\t * @example ```\"draft\"```\n\t */\n\tstatus: 'draft' | 'upcoming' | 'on_hold' | 'picking' | 'in_transit' | 'completed' | 'cancelled'\n\t/** \n\t * The stock quantity to be transferred from the origin stock location to destination one. Updatable unless stock transfer is completed or cancelled and depending on origin stock availability.\n\t * @example ```2```\n\t */\n\tquantity: number\n\t/** \n\t * Time at which the stock transfer was put on hold.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\ton_hold_at?: string | null\n\t/** \n\t * Time at which the stock transfer was picking.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tpicking_at?: string | null\n\t/** \n\t * Time at which the stock transfer was in transit.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tin_transit_at?: string | null\n\t/** \n\t * Time at which the stock transfer 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 stock transfer was cancelled.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tcancelled_at?: string | null\n\n\tsku?: Sku | null\n\torigin_stock_location?: StockLocation | null\n\tdestination_stock_location?: StockLocation | null\n\tshipment?: Shipment | null\n\tline_item?: LineItem | null\n\tstock_reservation?: StockReservation | null\n\tattachments?: Attachment[] | null\n\tevents?: Event[] | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface StockTransferCreate extends ResourceCreate {\n\t\n\t/** \n\t * Unique identifier for the stock transfer (numeric).\n\t * @example ```\"1234\"```\n\t */\n\tnumber?: string | null\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 stock quantity to be transferred from the origin stock location to destination one. Updatable unless stock transfer is completed or cancelled and depending on origin stock availability.\n\t * @example ```2```\n\t */\n\tquantity: number\n\n\tsku: SkuRel\n\torigin_stock_location: StockLocationRel\n\tdestination_stock_location: StockLocationRel\n\tshipment?: ShipmentRel | null\n\tline_item?: LineItemRel | null\n\n}\n\n\ninterface StockTransferUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * Unique identifier for the stock transfer (numeric).\n\t * @example ```\"1234\"```\n\t */\n\tnumber?: string | null\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 stock quantity to be transferred from the origin stock location to destination one. Updatable unless stock transfer is completed or cancelled and depending on origin stock availability.\n\t * @example ```2```\n\t */\n\tquantity?: number | null\n\t/** \n\t * Send this attribute if you want to mark this stock transfer as upcoming.\n\t * @example ```true```\n\t */\n\t_upcoming?: boolean | null\n\t/** \n\t * Send this attribute if you want to put this stock transfer on hold.\n\t * @example ```true```\n\t */\n\t_on_hold?: boolean | null\n\t/** \n\t * Send this attribute if you want to start picking this stock transfer.\n\t * @example ```true```\n\t */\n\t_picking?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this stock transfer as in transit.\n\t * @example ```true```\n\t */\n\t_in_transit?: boolean | null\n\t/** \n\t * Send this attribute if you want to complete this stock transfer.\n\t * @example ```true```\n\t */\n\t_complete?: boolean | null\n\t/** \n\t * Send this attribute if you want to cancel this stock transfer.\n\t * @example ```true```\n\t */\n\t_cancel?: boolean | null\n\n\tsku?: SkuRel | null\n\torigin_stock_location?: StockLocationRel | null\n\tdestination_stock_location?: StockLocationRel | null\n\tshipment?: ShipmentRel | null\n\tline_item?: LineItemRel | null\n\n}\n\n\nclass StockTransfers extends ApiResource<StockTransfer> {\n\n\tstatic readonly TYPE: StockTransferType = 'stock_transfers' as const\n\n\tasync create(resource: StockTransferCreate, params?: QueryParamsRetrieve<StockTransfer>, options?: ResourcesConfig): Promise<StockTransfer> {\n\t\treturn this.resources.create<StockTransferCreate, StockTransfer>({ ...resource, type: StockTransfers.TYPE }, params, options)\n\t}\n\n\tasync update(resource: StockTransferUpdate, params?: QueryParamsRetrieve<StockTransfer>, options?: ResourcesConfig): Promise<StockTransfer> {\n\t\treturn this.resources.update<StockTransferUpdate, StockTransfer>({ ...resource, type: StockTransfers.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: StockTransfers.TYPE } : id, options)\n\t}\n\n\tasync sku(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve<Sku>, options?: ResourcesConfig): Promise<Sku> {\n\t\tconst _stockTransferId = (stockTransferId as StockTransfer).id || stockTransferId as string\n\t\treturn this.resources.fetch<Sku>({ type: 'skus' }, `stock_transfers/${_stockTransferId}/sku`, params, options) as unknown as Sku\n\t}\n\n\tasync origin_stock_location(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve<StockLocation>, options?: ResourcesConfig): Promise<StockLocation> {\n\t\tconst _stockTransferId = (stockTransferId as StockTransfer).id || stockTransferId as string\n\t\treturn this.resources.fetch<StockLocation>({ type: 'stock_locations' }, `stock_transfers/${_stockTransferId}/origin_stock_location`, params, options) as unknown as StockLocation\n\t}\n\n\tasync destination_stock_location(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve<StockLocation>, options?: ResourcesConfig): Promise<StockLocation> {\n\t\tconst _stockTransferId = (stockTransferId as StockTransfer).id || stockTransferId as string\n\t\treturn this.resources.fetch<StockLocation>({ type: 'stock_locations' }, `stock_transfers/${_stockTransferId}/destination_stock_location`, params, options) as unknown as StockLocation\n\t}\n\n\tasync shipment(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve<Shipment>, options?: ResourcesConfig): Promise<Shipment> {\n\t\tconst _stockTransferId = (stockTransferId as StockTransfer).id || stockTransferId as string\n\t\treturn this.resources.fetch<Shipment>({ type: 'shipments' }, `stock_transfers/${_stockTransferId}/shipment`, params, options) as unknown as Shipment\n\t}\n\n\tasync line_item(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\tconst _stockTransferId = (stockTransferId as StockTransfer).id || stockTransferId as string\n\t\treturn this.resources.fetch<LineItem>({ type: 'line_items' }, `stock_transfers/${_stockTransferId}/line_item`, params, options) as unknown as LineItem\n\t}\n\n\tasync stock_reservation(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve<StockReservation>, options?: ResourcesConfig): Promise<StockReservation> {\n\t\tconst _stockTransferId = (stockTransferId as StockTransfer).id || stockTransferId as string\n\t\treturn this.resources.fetch<StockReservation>({ type: 'stock_reservations' }, `stock_transfers/${_stockTransferId}/stock_reservation`, params, options) as unknown as StockReservation\n\t}\n\n\tasync attachments(stockTransferId: string | StockTransfer, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _stockTransferId = (stockTransferId as StockTransfer).id || stockTransferId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `stock_transfers/${_stockTransferId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync events(stockTransferId: string | StockTransfer, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _stockTransferId = (stockTransferId as StockTransfer).id || stockTransferId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `stock_transfers/${_stockTransferId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync versions(stockTransferId: string | StockTransfer, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _stockTransferId = (stockTransferId as StockTransfer).id || stockTransferId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `stock_transfers/${_stockTransferId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync _upcoming(id: string | StockTransfer, params?: QueryParamsRetrieve<StockTransfer>, options?: ResourcesConfig): Promise<StockTransfer> {\n\t\treturn this.resources.update<StockTransferUpdate, StockTransfer>({ id: (typeof id === 'string')? id: id.id, type: StockTransfers.TYPE, _upcoming: true }, params, options)\n\t}\n\n\tasync _on_hold(id: string | StockTransfer, params?: QueryParamsRetrieve<StockTransfer>, options?: ResourcesConfig): Promise<StockTransfer> {\n\t\treturn this.resources.update<StockTransferUpdate, StockTransfer>({ id: (typeof id === 'string')? id: id.id, type: StockTransfers.TYPE, _on_hold: true }, params, options)\n\t}\n\n\tasync _picking(id: string | StockTransfer, params?: QueryParamsRetrieve<StockTransfer>, options?: ResourcesConfig): Promise<StockTransfer> {\n\t\treturn this.resources.update<StockTransferUpdate, StockTransfer>({ id: (typeof id === 'string')? id: id.id, type: StockTransfers.TYPE, _picking: true }, params, options)\n\t}\n\n\tasync _in_transit(id: string | StockTransfer, params?: QueryParamsRetrieve<StockTransfer>, options?: ResourcesConfig): Promise<StockTransfer> {\n\t\treturn this.resources.update<StockTransferUpdate, StockTransfer>({ id: (typeof id === 'string')? id: id.id, type: StockTransfers.TYPE, _in_transit: true }, params, options)\n\t}\n\n\tasync _complete(id: string | StockTransfer, params?: QueryParamsRetrieve<StockTransfer>, options?: ResourcesConfig): Promise<StockTransfer> {\n\t\treturn this.resources.update<StockTransferUpdate, StockTransfer>({ id: (typeof id === 'string')? id: id.id, type: StockTransfers.TYPE, _complete: true }, params, options)\n\t}\n\n\tasync _cancel(id: string | StockTransfer, params?: QueryParamsRetrieve<StockTransfer>, options?: ResourcesConfig): Promise<StockTransfer> {\n\t\treturn this.resources.update<StockTransferUpdate, StockTransfer>({ id: (typeof id === 'string')? id: id.id, type: StockTransfers.TYPE, _cancel: true }, params, options)\n\t}\n\n\n\tisStockTransfer(resource: any): resource is StockTransfer {\n\t\treturn resource.type && (resource.type === StockTransfers.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): StockTransferRel {\n\t\treturn super.relationshipOneToOne<StockTransferRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): StockTransferRel[] {\n\t\treturn super.relationshipOneToMany<StockTransferRel>(...ids)\n\t}\n\n\n\ttype(): StockTransferType {\n\t\treturn StockTransfers.TYPE\n\t}\n\n}\n\n\nconst instance = new StockTransfers()\nexport default instance\n\nexport type { StockTransfers, StockTransfer, StockTransferCreate, StockTransferUpdate, StockTransferType }\n"]}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export {
|
1
|
+
export { kq as StockTransfer, kr as StockTransferCreate, kt as StockTransferSort, mL as StockTransferType, ks as StockTransferUpdate, di as StockTransfers, dh 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 { kq as StockTransfer, kr as StockTransferCreate, kt as StockTransferSort, mL as StockTransferType, ks as StockTransferUpdate, di as StockTransfers, dh as default } from '../api-F1F37Dud.js';
|
2
2
|
import '../client.js';
|
3
|
-
import '../interceptor-
|
3
|
+
import '../interceptor-k15jXzf0.js';
|
4
4
|
import '../types.js';
|
@@ -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CAAA,IAAA,EAAM,WAAW,IAAK,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AAC1K,EAEA,MAAM,OAAA,CAAQ,EAA4B,EAAA,MAAA,EAA6C,OAAmD,EAAA;AACzI,IAAA,OAAO,KAAK,SAAU,CAAA,MAAA,CAA2C,EAAE,EAAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,cAAe,CAAA,IAAA,EAAM,SAAS,IAAK,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AACxK,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":"stock_transfers.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 { Sku, SkuType } from './skus'\nimport type { StockLocation, StockLocationType } from './stock_locations'\nimport type { Shipment, ShipmentType } from './shipments'\nimport type { LineItem, LineItemType } from './line_items'\nimport type { StockReservation } from './stock_reservations'\nimport type { Attachment } from './attachments'\nimport type { Event } from './events'\nimport type { Version } from './versions'\n\n\ntype StockTransferType = 'stock_transfers'\ntype StockTransferRel = ResourceRel & { type: StockTransferType }\ntype SkuRel = ResourceRel & { type: SkuType }\ntype StockLocationRel = ResourceRel & { type: StockLocationType }\ntype ShipmentRel = ResourceRel & { type: ShipmentType }\ntype LineItemRel = ResourceRel & { type: LineItemType }\n\n\nexport type StockTransferSort = Pick<StockTransfer, 'id' | 'number' | 'status' | 'quantity' | 'on_hold_at' | 'picking_at' | 'in_transit_at' | 'completed_at' | 'cancelled_at'> & ResourceSort\n// export type StockTransferFilter = Pick<StockTransfer, 'id' | 'number' | 'status' | 'quantity' | 'on_hold_at' | 'picking_at' | 'in_transit_at' | 'completed_at' | 'cancelled_at'> & ResourceFilter\n\n\ninterface StockTransfer extends Resource {\n\t\n\treadonly type: StockTransferType\n\n\t/** \n\t * Unique identifier for the stock transfer (numeric).\n\t * @example ```\"1234\"```\n\t */\n\tnumber?: string | null\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 stock transfer status. One of 'draft' (default), 'upcoming', 'on_hold', 'picking', 'in_transit', 'completed', or 'cancelled'.\n\t * @example ```\"draft\"```\n\t */\n\tstatus: 'draft' | 'upcoming' | 'on_hold' | 'picking' | 'in_transit' | 'completed' | 'cancelled'\n\t/** \n\t * The stock quantity to be transferred from the origin stock location to destination one. Updatable unless stock transfer is completed or cancelled and depending on origin stock availability.\n\t * @example ```2```\n\t */\n\tquantity: number\n\t/** \n\t * Time at which the stock transfer was put on hold.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\ton_hold_at?: string | null\n\t/** \n\t * Time at which the stock transfer was picking.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tpicking_at?: string | null\n\t/** \n\t * Time at which the stock transfer was in transit.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tin_transit_at?: string | null\n\t/** \n\t * Time at which the stock transfer 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 stock transfer was cancelled.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tcancelled_at?: string | null\n\n\tsku?: Sku | null\n\torigin_stock_location?: StockLocation | null\n\tdestination_stock_location?: StockLocation | null\n\tshipment?: Shipment | null\n\tline_item?: LineItem | null\n\tstock_reservation?: StockReservation | null\n\tattachments?: Attachment[] | null\n\tevents?: Event[] | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface StockTransferCreate extends ResourceCreate {\n\t\n\t/** \n\t * Unique identifier for the stock transfer (numeric).\n\t * @example ```\"1234\"```\n\t */\n\tnumber?: string | null\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 stock quantity to be transferred from the origin stock location to destination one. Updatable unless stock transfer is completed or cancelled and depending on origin stock availability.\n\t * @example ```2```\n\t */\n\tquantity: number\n\n\tsku: SkuRel\n\torigin_stock_location: StockLocationRel\n\tdestination_stock_location: StockLocationRel\n\tshipment?: ShipmentRel | null\n\tline_item?: LineItemRel | null\n\n}\n\n\ninterface StockTransferUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * Unique identifier for the stock transfer (numeric).\n\t * @example ```\"1234\"```\n\t */\n\tnumber?: string | null\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 stock quantity to be transferred from the origin stock location to destination one. Updatable unless stock transfer is completed or cancelled and depending on origin stock availability.\n\t * @example ```2```\n\t */\n\tquantity?: number | null\n\t/** \n\t * Send this attribute if you want to mark this stock transfer as upcoming.\n\t * @example ```true```\n\t */\n\t_upcoming?: boolean | null\n\t/** \n\t * Send this attribute if you want to put this stock transfer on hold.\n\t * @example ```true```\n\t */\n\t_on_hold?: boolean | null\n\t/** \n\t * Send this attribute if you want to start picking this stock transfer.\n\t * @example ```true```\n\t */\n\t_picking?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this stock transfer as in transit.\n\t * @example ```true```\n\t */\n\t_in_transit?: boolean | null\n\t/** \n\t * Send this attribute if you want to complete this stock transfer.\n\t * @example ```true```\n\t */\n\t_complete?: boolean | null\n\t/** \n\t * Send this attribute if you want to cancel this stock transfer.\n\t * @example ```true```\n\t */\n\t_cancel?: boolean | null\n\n\tsku?: SkuRel | null\n\torigin_stock_location?: StockLocationRel | null\n\tdestination_stock_location?: StockLocationRel | null\n\tshipment?: ShipmentRel | null\n\tline_item?: LineItemRel | null\n\n}\n\n\nclass StockTransfers extends ApiResource<StockTransfer> {\n\n\tstatic readonly TYPE: StockTransferType = 'stock_transfers' as const\n\n\tasync create(resource: StockTransferCreate, params?: QueryParamsRetrieve<StockTransfer>, options?: ResourcesConfig): Promise<StockTransfer> {\n\t\treturn this.resources.create<StockTransferCreate, StockTransfer>({ ...resource, type: StockTransfers.TYPE }, params, options)\n\t}\n\n\tasync update(resource: StockTransferUpdate, params?: QueryParamsRetrieve<StockTransfer>, options?: ResourcesConfig): Promise<StockTransfer> {\n\t\treturn this.resources.update<StockTransferUpdate, StockTransfer>({ ...resource, type: StockTransfers.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: StockTransfers.TYPE } : id, options)\n\t}\n\n\tasync sku(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve<Sku>, options?: ResourcesConfig): Promise<Sku> {\n\t\tconst _stockTransferId = (stockTransferId as StockTransfer).id || stockTransferId as string\n\t\treturn this.resources.fetch<Sku>({ type: 'skus' }, `stock_transfers/${_stockTransferId}/sku`, params, options) as unknown as Sku\n\t}\n\n\tasync origin_stock_location(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve<StockLocation>, options?: ResourcesConfig): Promise<StockLocation> {\n\t\tconst _stockTransferId = (stockTransferId as StockTransfer).id || stockTransferId as string\n\t\treturn this.resources.fetch<StockLocation>({ type: 'stock_locations' }, `stock_transfers/${_stockTransferId}/origin_stock_location`, params, options) as unknown as StockLocation\n\t}\n\n\tasync destination_stock_location(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve<StockLocation>, options?: ResourcesConfig): Promise<StockLocation> {\n\t\tconst _stockTransferId = (stockTransferId as StockTransfer).id || stockTransferId as string\n\t\treturn this.resources.fetch<StockLocation>({ type: 'stock_locations' }, `stock_transfers/${_stockTransferId}/destination_stock_location`, params, options) as unknown as StockLocation\n\t}\n\n\tasync shipment(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve<Shipment>, options?: ResourcesConfig): Promise<Shipment> {\n\t\tconst _stockTransferId = (stockTransferId as StockTransfer).id || stockTransferId as string\n\t\treturn this.resources.fetch<Shipment>({ type: 'shipments' }, `stock_transfers/${_stockTransferId}/shipment`, params, options) as unknown as Shipment\n\t}\n\n\tasync line_item(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\tconst _stockTransferId = (stockTransferId as StockTransfer).id || stockTransferId as string\n\t\treturn this.resources.fetch<LineItem>({ type: 'line_items' }, `stock_transfers/${_stockTransferId}/line_item`, params, options) as unknown as LineItem\n\t}\n\n\tasync stock_reservation(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve<StockReservation>, options?: ResourcesConfig): Promise<StockReservation> {\n\t\tconst _stockTransferId = (stockTransferId as StockTransfer).id || stockTransferId as string\n\t\treturn this.resources.fetch<StockReservation>({ type: 'stock_reservations' }, `stock_transfers/${_stockTransferId}/stock_reservation`, params, options) as unknown as StockReservation\n\t}\n\n\tasync attachments(stockTransferId: string | StockTransfer, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _stockTransferId = (stockTransferId as StockTransfer).id || stockTransferId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `stock_transfers/${_stockTransferId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync events(stockTransferId: string | StockTransfer, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _stockTransferId = (stockTransferId as StockTransfer).id || stockTransferId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `stock_transfers/${_stockTransferId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync versions(stockTransferId: string | StockTransfer, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _stockTransferId = (stockTransferId as StockTransfer).id || stockTransferId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `stock_transfers/${_stockTransferId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync _upcoming(id: string | StockTransfer, params?: QueryParamsRetrieve<StockTransfer>, options?: ResourcesConfig): Promise<StockTransfer> {\n\t\treturn this.resources.update<StockTransferUpdate, StockTransfer>({ id: (typeof id === 'string')? id: id.id, type: StockTransfers.TYPE, _upcoming: true }, params, options)\n\t}\n\n\tasync _on_hold(id: string | StockTransfer, params?: QueryParamsRetrieve<StockTransfer>, options?: ResourcesConfig): Promise<StockTransfer> {\n\t\treturn this.resources.update<StockTransferUpdate, StockTransfer>({ id: (typeof id === 'string')? id: id.id, type: StockTransfers.TYPE, _on_hold: true }, params, options)\n\t}\n\n\tasync _picking(id: string | StockTransfer, params?: QueryParamsRetrieve<StockTransfer>, options?: ResourcesConfig): Promise<StockTransfer> {\n\t\treturn this.resources.update<StockTransferUpdate, StockTransfer>({ id: (typeof id === 'string')? id: id.id, type: StockTransfers.TYPE, _picking: true }, params, options)\n\t}\n\n\tasync _in_transit(id: string | StockTransfer, params?: QueryParamsRetrieve<StockTransfer>, options?: ResourcesConfig): Promise<StockTransfer> {\n\t\treturn this.resources.update<StockTransferUpdate, StockTransfer>({ id: (typeof id === 'string')? id: id.id, type: StockTransfers.TYPE, _in_transit: true }, params, options)\n\t}\n\n\tasync _complete(id: string | StockTransfer, params?: QueryParamsRetrieve<StockTransfer>, options?: ResourcesConfig): Promise<StockTransfer> {\n\t\treturn this.resources.update<StockTransferUpdate, StockTransfer>({ id: (typeof id === 'string')? id: id.id, type: StockTransfers.TYPE, _complete: true }, params, options)\n\t}\n\n\tasync _cancel(id: string | StockTransfer, params?: QueryParamsRetrieve<StockTransfer>, options?: ResourcesConfig): Promise<StockTransfer> {\n\t\treturn this.resources.update<StockTransferUpdate, StockTransfer>({ id: (typeof id === 'string')? id: id.id, type: StockTransfers.TYPE, _cancel: true }, params, options)\n\t}\n\n\n\tisStockTransfer(resource: any): resource is StockTransfer {\n\t\treturn resource.type && (resource.type === StockTransfers.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): StockTransferRel {\n\t\treturn super.relationshipOneToOne<StockTransferRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): StockTransferRel[] {\n\t\treturn super.relationshipOneToMany<StockTransferRel>(...ids)\n\t}\n\n\n\ttype(): StockTransferType {\n\t\treturn StockTransfers.TYPE\n\t}\n\n}\n\n\nconst instance = new StockTransfers()\nexport default instance\n\nexport type { StockTransfer, StockTransferCreate, StockTransferUpdate, StockTransferType }\n"]}
|
1
|
+
{"version":3,"sources":["../../src/resources/stock_transfers.ts"],"names":[],"mappings":";;AA6KA,MAAM,uBAAuB,WAA2B,CAAA;AAAA,EAEvD,OAAgB,IAA0B,GAAA,iBAAA;AAAA,EAE1C,MAAM,MAAA,CAAO,QAA+B,EAAA,MAAA,EAA6C,OAAmD,EAAA;AAC3I,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA2C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,cAAe,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC7H,EAEA,MAAM,MAAA,CAAO,QAA+B,EAAA,MAAA,EAA6C,OAAmD,EAAA;AAC3I,IAAO,OAAA,IAAA,CAAK,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D,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":"stock_transfers.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 { Sku, SkuType } from './skus'\nimport type { StockLocation, StockLocationType } from './stock_locations'\nimport type { Shipment, ShipmentType } from './shipments'\nimport type { LineItem, LineItemType } from './line_items'\nimport type { StockReservation } from './stock_reservations'\nimport type { Attachment } from './attachments'\nimport type { Event } from './events'\nimport type { Version } from './versions'\n\n\ntype StockTransferType = 'stock_transfers'\ntype StockTransferRel = ResourceRel & { type: StockTransferType }\ntype SkuRel = ResourceRel & { type: SkuType }\ntype StockLocationRel = ResourceRel & { type: StockLocationType }\ntype ShipmentRel = ResourceRel & { type: ShipmentType }\ntype LineItemRel = ResourceRel & { type: LineItemType }\n\n\nexport type StockTransferSort = Pick<StockTransfer, 'id' | 'number' | 'status' | 'quantity' | 'on_hold_at' | 'picking_at' | 'in_transit_at' | 'completed_at' | 'cancelled_at'> & ResourceSort\n// export type StockTransferFilter = Pick<StockTransfer, 'id' | 'number' | 'status' | 'quantity' | 'on_hold_at' | 'picking_at' | 'in_transit_at' | 'completed_at' | 'cancelled_at'> & ResourceFilter\n\n\ninterface StockTransfer extends Resource {\n\t\n\treadonly type: StockTransferType\n\n\t/** \n\t * Unique identifier for the stock transfer (numeric).\n\t * @example ```\"1234\"```\n\t */\n\tnumber?: string | null\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 stock transfer status. One of 'draft' (default), 'upcoming', 'on_hold', 'picking', 'in_transit', 'completed', or 'cancelled'.\n\t * @example ```\"draft\"```\n\t */\n\tstatus: 'draft' | 'upcoming' | 'on_hold' | 'picking' | 'in_transit' | 'completed' | 'cancelled'\n\t/** \n\t * The stock quantity to be transferred from the origin stock location to destination one. Updatable unless stock transfer is completed or cancelled and depending on origin stock availability.\n\t * @example ```2```\n\t */\n\tquantity: number\n\t/** \n\t * Time at which the stock transfer was put on hold.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\ton_hold_at?: string | null\n\t/** \n\t * Time at which the stock transfer was picking.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tpicking_at?: string | null\n\t/** \n\t * Time at which the stock transfer was in transit.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tin_transit_at?: string | null\n\t/** \n\t * Time at which the stock transfer 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 stock transfer was cancelled.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tcancelled_at?: string | null\n\n\tsku?: Sku | null\n\torigin_stock_location?: StockLocation | null\n\tdestination_stock_location?: StockLocation | null\n\tshipment?: Shipment | null\n\tline_item?: LineItem | null\n\tstock_reservation?: StockReservation | null\n\tattachments?: Attachment[] | null\n\tevents?: Event[] | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface StockTransferCreate extends ResourceCreate {\n\t\n\t/** \n\t * Unique identifier for the stock transfer (numeric).\n\t * @example ```\"1234\"```\n\t */\n\tnumber?: string | null\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 stock quantity to be transferred from the origin stock location to destination one. Updatable unless stock transfer is completed or cancelled and depending on origin stock availability.\n\t * @example ```2```\n\t */\n\tquantity: number\n\n\tsku: SkuRel\n\torigin_stock_location: StockLocationRel\n\tdestination_stock_location: StockLocationRel\n\tshipment?: ShipmentRel | null\n\tline_item?: LineItemRel | null\n\n}\n\n\ninterface StockTransferUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * Unique identifier for the stock transfer (numeric).\n\t * @example ```\"1234\"```\n\t */\n\tnumber?: string | null\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 stock quantity to be transferred from the origin stock location to destination one. Updatable unless stock transfer is completed or cancelled and depending on origin stock availability.\n\t * @example ```2```\n\t */\n\tquantity?: number | null\n\t/** \n\t * Send this attribute if you want to mark this stock transfer as upcoming.\n\t * @example ```true```\n\t */\n\t_upcoming?: boolean | null\n\t/** \n\t * Send this attribute if you want to put this stock transfer on hold.\n\t * @example ```true```\n\t */\n\t_on_hold?: boolean | null\n\t/** \n\t * Send this attribute if you want to start picking this stock transfer.\n\t * @example ```true```\n\t */\n\t_picking?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this stock transfer as in transit.\n\t * @example ```true```\n\t */\n\t_in_transit?: boolean | null\n\t/** \n\t * Send this attribute if you want to complete this stock transfer.\n\t * @example ```true```\n\t */\n\t_complete?: boolean | null\n\t/** \n\t * Send this attribute if you want to cancel this stock transfer.\n\t * @example ```true```\n\t */\n\t_cancel?: boolean | null\n\n\tsku?: SkuRel | null\n\torigin_stock_location?: StockLocationRel | null\n\tdestination_stock_location?: StockLocationRel | null\n\tshipment?: ShipmentRel | null\n\tline_item?: LineItemRel | null\n\n}\n\n\nclass StockTransfers extends ApiResource<StockTransfer> {\n\n\tstatic readonly TYPE: StockTransferType = 'stock_transfers' as const\n\n\tasync create(resource: StockTransferCreate, params?: QueryParamsRetrieve<StockTransfer>, options?: ResourcesConfig): Promise<StockTransfer> {\n\t\treturn this.resources.create<StockTransferCreate, StockTransfer>({ ...resource, type: StockTransfers.TYPE }, params, options)\n\t}\n\n\tasync update(resource: StockTransferUpdate, params?: QueryParamsRetrieve<StockTransfer>, options?: ResourcesConfig): Promise<StockTransfer> {\n\t\treturn this.resources.update<StockTransferUpdate, StockTransfer>({ ...resource, type: StockTransfers.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: StockTransfers.TYPE } : id, options)\n\t}\n\n\tasync sku(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve<Sku>, options?: ResourcesConfig): Promise<Sku> {\n\t\tconst _stockTransferId = (stockTransferId as StockTransfer).id || stockTransferId as string\n\t\treturn this.resources.fetch<Sku>({ type: 'skus' }, `stock_transfers/${_stockTransferId}/sku`, params, options) as unknown as Sku\n\t}\n\n\tasync origin_stock_location(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve<StockLocation>, options?: ResourcesConfig): Promise<StockLocation> {\n\t\tconst _stockTransferId = (stockTransferId as StockTransfer).id || stockTransferId as string\n\t\treturn this.resources.fetch<StockLocation>({ type: 'stock_locations' }, `stock_transfers/${_stockTransferId}/origin_stock_location`, params, options) as unknown as StockLocation\n\t}\n\n\tasync destination_stock_location(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve<StockLocation>, options?: ResourcesConfig): Promise<StockLocation> {\n\t\tconst _stockTransferId = (stockTransferId as StockTransfer).id || stockTransferId as string\n\t\treturn this.resources.fetch<StockLocation>({ type: 'stock_locations' }, `stock_transfers/${_stockTransferId}/destination_stock_location`, params, options) as unknown as StockLocation\n\t}\n\n\tasync shipment(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve<Shipment>, options?: ResourcesConfig): Promise<Shipment> {\n\t\tconst _stockTransferId = (stockTransferId as StockTransfer).id || stockTransferId as string\n\t\treturn this.resources.fetch<Shipment>({ type: 'shipments' }, `stock_transfers/${_stockTransferId}/shipment`, params, options) as unknown as Shipment\n\t}\n\n\tasync line_item(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\tconst _stockTransferId = (stockTransferId as StockTransfer).id || stockTransferId as string\n\t\treturn this.resources.fetch<LineItem>({ type: 'line_items' }, `stock_transfers/${_stockTransferId}/line_item`, params, options) as unknown as LineItem\n\t}\n\n\tasync stock_reservation(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve<StockReservation>, options?: ResourcesConfig): Promise<StockReservation> {\n\t\tconst _stockTransferId = (stockTransferId as StockTransfer).id || stockTransferId as string\n\t\treturn this.resources.fetch<StockReservation>({ type: 'stock_reservations' }, `stock_transfers/${_stockTransferId}/stock_reservation`, params, options) as unknown as StockReservation\n\t}\n\n\tasync attachments(stockTransferId: string | StockTransfer, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _stockTransferId = (stockTransferId as StockTransfer).id || stockTransferId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `stock_transfers/${_stockTransferId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync events(stockTransferId: string | StockTransfer, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _stockTransferId = (stockTransferId as StockTransfer).id || stockTransferId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `stock_transfers/${_stockTransferId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync versions(stockTransferId: string | StockTransfer, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _stockTransferId = (stockTransferId as StockTransfer).id || stockTransferId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `stock_transfers/${_stockTransferId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync _upcoming(id: string | StockTransfer, params?: QueryParamsRetrieve<StockTransfer>, options?: ResourcesConfig): Promise<StockTransfer> {\n\t\treturn this.resources.update<StockTransferUpdate, StockTransfer>({ id: (typeof id === 'string')? id: id.id, type: StockTransfers.TYPE, _upcoming: true }, params, options)\n\t}\n\n\tasync _on_hold(id: string | StockTransfer, params?: QueryParamsRetrieve<StockTransfer>, options?: ResourcesConfig): Promise<StockTransfer> {\n\t\treturn this.resources.update<StockTransferUpdate, StockTransfer>({ id: (typeof id === 'string')? id: id.id, type: StockTransfers.TYPE, _on_hold: true }, params, options)\n\t}\n\n\tasync _picking(id: string | StockTransfer, params?: QueryParamsRetrieve<StockTransfer>, options?: ResourcesConfig): Promise<StockTransfer> {\n\t\treturn this.resources.update<StockTransferUpdate, StockTransfer>({ id: (typeof id === 'string')? id: id.id, type: StockTransfers.TYPE, _picking: true }, params, options)\n\t}\n\n\tasync _in_transit(id: string | StockTransfer, params?: QueryParamsRetrieve<StockTransfer>, options?: ResourcesConfig): Promise<StockTransfer> {\n\t\treturn this.resources.update<StockTransferUpdate, StockTransfer>({ id: (typeof id === 'string')? id: id.id, type: StockTransfers.TYPE, _in_transit: true }, params, options)\n\t}\n\n\tasync _complete(id: string | StockTransfer, params?: QueryParamsRetrieve<StockTransfer>, options?: ResourcesConfig): Promise<StockTransfer> {\n\t\treturn this.resources.update<StockTransferUpdate, StockTransfer>({ id: (typeof id === 'string')? id: id.id, type: StockTransfers.TYPE, _complete: true }, params, options)\n\t}\n\n\tasync _cancel(id: string | StockTransfer, params?: QueryParamsRetrieve<StockTransfer>, options?: ResourcesConfig): Promise<StockTransfer> {\n\t\treturn this.resources.update<StockTransferUpdate, StockTransfer>({ id: (typeof id === 'string')? id: id.id, type: StockTransfers.TYPE, _cancel: true }, params, options)\n\t}\n\n\n\tisStockTransfer(resource: any): resource is StockTransfer {\n\t\treturn resource.type && (resource.type === StockTransfers.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): StockTransferRel {\n\t\treturn super.relationshipOneToOne<StockTransferRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): StockTransferRel[] {\n\t\treturn super.relationshipOneToMany<StockTransferRel>(...ids)\n\t}\n\n\n\ttype(): StockTransferType {\n\t\treturn StockTransfers.TYPE\n\t}\n\n}\n\n\nconst instance = new StockTransfers()\nexport default instance\n\nexport type { StockTransfers, StockTransfer, StockTransferCreate, StockTransferUpdate, StockTransferType }\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/resources/stores.ts"],"names":["ApiResource"],"mappings":";;;;AA0FA,MAAM,eAAeA,oBAAmB,CAAA;AAAA,EAEvC,OAAgB,IAAkB,GAAA,QAAA;AAAA,EAElC,MAAM,MAAA,CAAO,QAAuB,EAAA,MAAA,EAAqC,OAA2C,EAAA;AACnH,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA2B,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,MAAO,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACrG,EAEA,MAAM,MAAA,CAAO,QAAuB,EAAA,MAAA,EAAqC,OAA2C,EAAA;AACnH,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA2B,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,MAAO,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACrG,EAEA,MAAM,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,MAAA,CAAO,IAAK,EAAA,GAAI,IAAI,OAAO,CAAA;AAAA;AAC9F,EAEA,MAAM,MAAA,CAAO,OAAyB,EAAA,MAAA,EAAsC,OAA4C,EAAA;AACvH,IAAM,MAAA,QAAA,GA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","file":"stores.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 { Market, MarketType } from './markets'\nimport type { Merchant, MerchantType } from './merchants'\nimport type { StockLocation, StockLocationType } from './stock_locations'\nimport type { Order } from './orders'\nimport type { PaymentMethod } from './payment_methods'\nimport type { Event } from './events'\nimport type { Version } from './versions'\n\n\ntype StoreType = 'stores'\ntype StoreRel = ResourceRel & { type: StoreType }\ntype MarketRel = ResourceRel & { type: MarketType }\ntype MerchantRel = ResourceRel & { type: MerchantType }\ntype StockLocationRel = ResourceRel & { type: StockLocationType }\n\n\nexport type StoreSort = Pick<Store, 'id' | 'name' | 'code'> & ResourceSort\n// export type StoreFilter = Pick<Store, 'id' | 'name' | 'code'> & ResourceFilter\n\n\ninterface Store extends Resource {\n\t\n\treadonly type: StoreType\n\n\t/** \n\t * The store's internal name.\n\t * @example ```\"Rome Shop\"```\n\t */\n\tname: string\n\t/** \n\t * A string that you can use to identify the store (must be unique within the environment).\n\t * @example ```\"europe1\"```\n\t */\n\tcode?: string | null\n\n\tmarket?: Market | null\n\tmerchant?: Merchant | null\n\tstock_location?: StockLocation | null\n\torders?: Order[] | null\n\tpayment_methods?: PaymentMethod[] | null\n\tevents?: Event[] | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface StoreCreate extends ResourceCreate {\n\t\n\t/** \n\t * The store's internal name.\n\t * @example ```\"Rome Shop\"```\n\t */\n\tname: string\n\t/** \n\t * A string that you can use to identify the store (must be unique within the environment).\n\t * @example ```\"europe1\"```\n\t */\n\tcode?: string | null\n\n\tmarket: MarketRel\n\tmerchant?: MerchantRel | null\n\tstock_location?: StockLocationRel | null\n\n}\n\n\ninterface StoreUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The store's internal name.\n\t * @example ```\"Rome Shop\"```\n\t */\n\tname?: string | null\n\t/** \n\t * A string that you can use to identify the store (must be unique within the environment).\n\t * @example ```\"europe1\"```\n\t */\n\tcode?: string | null\n\n\tmarket?: MarketRel | null\n\tmerchant?: MerchantRel | null\n\tstock_location?: StockLocationRel | null\n\n}\n\n\nclass Stores extends ApiResource<Store> {\n\n\tstatic readonly TYPE: StoreType = 'stores' as const\n\n\tasync create(resource: StoreCreate, params?: QueryParamsRetrieve<Store>, options?: ResourcesConfig): Promise<Store> {\n\t\treturn this.resources.create<StoreCreate, Store>({ ...resource, type: Stores.TYPE }, params, options)\n\t}\n\n\tasync update(resource: StoreUpdate, params?: QueryParamsRetrieve<Store>, options?: ResourcesConfig): Promise<Store> {\n\t\treturn this.resources.update<StoreUpdate, Store>({ ...resource, type: Stores.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: Stores.TYPE } : id, options)\n\t}\n\n\tasync market(storeId: string | Store, params?: QueryParamsRetrieve<Market>, options?: ResourcesConfig): Promise<Market> {\n\t\tconst _storeId = (storeId as Store).id || storeId as string\n\t\treturn this.resources.fetch<Market>({ type: 'markets' }, `stores/${_storeId}/market`, params, options) as unknown as Market\n\t}\n\n\tasync merchant(storeId: string | Store, params?: QueryParamsRetrieve<Merchant>, options?: ResourcesConfig): Promise<Merchant> {\n\t\tconst _storeId = (storeId as Store).id || storeId as string\n\t\treturn this.resources.fetch<Merchant>({ type: 'merchants' }, `stores/${_storeId}/merchant`, params, options) as unknown as Merchant\n\t}\n\n\tasync stock_location(storeId: string | Store, params?: QueryParamsRetrieve<StockLocation>, options?: ResourcesConfig): Promise<StockLocation> {\n\t\tconst _storeId = (storeId as Store).id || storeId as string\n\t\treturn this.resources.fetch<StockLocation>({ type: 'stock_locations' }, `stores/${_storeId}/stock_location`, params, options) as unknown as StockLocation\n\t}\n\n\tasync orders(storeId: string | Store, params?: QueryParamsList<Order>, options?: ResourcesConfig): Promise<ListResponse<Order>> {\n\t\tconst _storeId = (storeId as Store).id || storeId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `stores/${_storeId}/orders`, params, options) as unknown as ListResponse<Order>\n\t}\n\n\tasync payment_methods(storeId: string | Store, params?: QueryParamsList<PaymentMethod>, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>> {\n\t\tconst _storeId = (storeId as Store).id || storeId as string\n\t\treturn this.resources.fetch<PaymentMethod>({ type: 'payment_methods' }, `stores/${_storeId}/payment_methods`, params, options) as unknown as ListResponse<PaymentMethod>\n\t}\n\n\tasync events(storeId: string | Store, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _storeId = (storeId as Store).id || storeId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `stores/${_storeId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync versions(storeId: string | Store, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _storeId = (storeId as Store).id || storeId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `stores/${_storeId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\n\tisStore(resource: any): resource is Store {\n\t\treturn resource.type && (resource.type === Stores.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): StoreRel {\n\t\treturn super.relationshipOneToOne<StoreRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): StoreRel[] {\n\t\treturn super.relationshipOneToMany<StoreRel>(...ids)\n\t}\n\n\n\ttype(): StoreType {\n\t\treturn Stores.TYPE\n\t}\n\n}\n\n\nconst instance = new Stores()\nexport default instance\n\nexport type { Store, StoreCreate, StoreUpdate, StoreType }\n"]}
|
1
|
+
{"version":3,"sources":["../../src/resources/stores.ts"],"names":["ApiResource"],"mappings":";;;;AA0FA,MAAM,eAAeA,oBAAmB,CAAA;AAAA,EAEvC,OAAgB,IAAkB,GAAA,QA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Q,OAAO,CAAA;AAAA;AACpG,EAEA,MAAM,QAAA,CAAS,OAAyB,EAAA,MAAA,EAAmC,OAA2D,EAAA;AACrI,IAAM,MAAA,QAAA,GAAY,QAAkB,EAAM,IAAA,OAAA;AAC1C,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAe,EAAE,IAAA,EAAM,UAAW,EAAA,EAAG,CAAU,OAAA,EAAA,QAAQ,CAAa,SAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC1G,EAGA,QAAQ,QAAkC,EAAA;AACzC,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,MAAO,CAAA,IAAA;AAAA;AACnD,EAGA,aAAa,EAA0C,EAAA;AACtD,IAAO,OAAA,KAAA,CAAM,qBAA+B,EAAE,CAAA;AAAA;AAC/C,EAEA,sBAAsB,GAA2B,EAAA;AAChD,IAAO,OAAA,KAAA,CAAM,qBAAgC,CAAA,GAAG,GAAG,CAAA;AAAA;AACpD,EAGA,IAAkB,GAAA;AACjB,IAAA,OAAO,MAAO,CAAA,IAAA;AAAA;AAGhB;AAGA,MAAM,QAAA,GAAW,IAAI,MAAO,EAAA;AAC5B,IAAO,cAAQ,GAAA","file":"stores.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 { Market, MarketType } from './markets'\nimport type { Merchant, MerchantType } from './merchants'\nimport type { StockLocation, StockLocationType } from './stock_locations'\nimport type { Order } from './orders'\nimport type { PaymentMethod } from './payment_methods'\nimport type { Event } from './events'\nimport type { Version } from './versions'\n\n\ntype StoreType = 'stores'\ntype StoreRel = ResourceRel & { type: StoreType }\ntype MarketRel = ResourceRel & { type: MarketType }\ntype MerchantRel = ResourceRel & { type: MerchantType }\ntype StockLocationRel = ResourceRel & { type: StockLocationType }\n\n\nexport type StoreSort = Pick<Store, 'id' | 'name' | 'code'> & ResourceSort\n// export type StoreFilter = Pick<Store, 'id' | 'name' | 'code'> & ResourceFilter\n\n\ninterface Store extends Resource {\n\t\n\treadonly type: StoreType\n\n\t/** \n\t * The store's internal name.\n\t * @example ```\"Rome Shop\"```\n\t */\n\tname: string\n\t/** \n\t * A string that you can use to identify the store (must be unique within the environment).\n\t * @example ```\"europe1\"```\n\t */\n\tcode?: string | null\n\n\tmarket?: Market | null\n\tmerchant?: Merchant | null\n\tstock_location?: StockLocation | null\n\torders?: Order[] | null\n\tpayment_methods?: PaymentMethod[] | null\n\tevents?: Event[] | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface StoreCreate extends ResourceCreate {\n\t\n\t/** \n\t * The store's internal name.\n\t * @example ```\"Rome Shop\"```\n\t */\n\tname: string\n\t/** \n\t * A string that you can use to identify the store (must be unique within the environment).\n\t * @example ```\"europe1\"```\n\t */\n\tcode?: string | null\n\n\tmarket: MarketRel\n\tmerchant?: MerchantRel | null\n\tstock_location?: StockLocationRel | null\n\n}\n\n\ninterface StoreUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The store's internal name.\n\t * @example ```\"Rome Shop\"```\n\t */\n\tname?: string | null\n\t/** \n\t * A string that you can use to identify the store (must be unique within the environment).\n\t * @example ```\"europe1\"```\n\t */\n\tcode?: string | null\n\n\tmarket?: MarketRel | null\n\tmerchant?: MerchantRel | null\n\tstock_location?: StockLocationRel | null\n\n}\n\n\nclass Stores extends ApiResource<Store> {\n\n\tstatic readonly TYPE: StoreType = 'stores' as const\n\n\tasync create(resource: StoreCreate, params?: QueryParamsRetrieve<Store>, options?: ResourcesConfig): Promise<Store> {\n\t\treturn this.resources.create<StoreCreate, Store>({ ...resource, type: Stores.TYPE }, params, options)\n\t}\n\n\tasync update(resource: StoreUpdate, params?: QueryParamsRetrieve<Store>, options?: ResourcesConfig): Promise<Store> {\n\t\treturn this.resources.update<StoreUpdate, Store>({ ...resource, type: Stores.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: Stores.TYPE } : id, options)\n\t}\n\n\tasync market(storeId: string | Store, params?: QueryParamsRetrieve<Market>, options?: ResourcesConfig): Promise<Market> {\n\t\tconst _storeId = (storeId as Store).id || storeId as string\n\t\treturn this.resources.fetch<Market>({ type: 'markets' }, `stores/${_storeId}/market`, params, options) as unknown as Market\n\t}\n\n\tasync merchant(storeId: string | Store, params?: QueryParamsRetrieve<Merchant>, options?: ResourcesConfig): Promise<Merchant> {\n\t\tconst _storeId = (storeId as Store).id || storeId as string\n\t\treturn this.resources.fetch<Merchant>({ type: 'merchants' }, `stores/${_storeId}/merchant`, params, options) as unknown as Merchant\n\t}\n\n\tasync stock_location(storeId: string | Store, params?: QueryParamsRetrieve<StockLocation>, options?: ResourcesConfig): Promise<StockLocation> {\n\t\tconst _storeId = (storeId as Store).id || storeId as string\n\t\treturn this.resources.fetch<StockLocation>({ type: 'stock_locations' }, `stores/${_storeId}/stock_location`, params, options) as unknown as StockLocation\n\t}\n\n\tasync orders(storeId: string | Store, params?: QueryParamsList<Order>, options?: ResourcesConfig): Promise<ListResponse<Order>> {\n\t\tconst _storeId = (storeId as Store).id || storeId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `stores/${_storeId}/orders`, params, options) as unknown as ListResponse<Order>\n\t}\n\n\tasync payment_methods(storeId: string | Store, params?: QueryParamsList<PaymentMethod>, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>> {\n\t\tconst _storeId = (storeId as Store).id || storeId as string\n\t\treturn this.resources.fetch<PaymentMethod>({ type: 'payment_methods' }, `stores/${_storeId}/payment_methods`, params, options) as unknown as ListResponse<PaymentMethod>\n\t}\n\n\tasync events(storeId: string | Store, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _storeId = (storeId as Store).id || storeId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `stores/${_storeId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync versions(storeId: string | Store, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _storeId = (storeId as Store).id || storeId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `stores/${_storeId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\n\tisStore(resource: any): resource is Store {\n\t\treturn resource.type && (resource.type === Stores.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): StoreRel {\n\t\treturn super.relationshipOneToOne<StoreRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): StoreRel[] {\n\t\treturn super.relationshipOneToMany<StoreRel>(...ids)\n\t}\n\n\n\ttype(): StoreType {\n\t\treturn Stores.TYPE\n\t}\n\n}\n\n\nconst instance = new Stores()\nexport default instance\n\nexport type { Stores, Store, StoreCreate, StoreUpdate, StoreType }\n"]}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export {
|
1
|
+
export { ku as Store, kv as StoreCreate, kx as StoreSort, mB as StoreType, kw as StoreUpdate, dk as Stores, dj 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 { ku as Store, kv as StoreCreate, kx as StoreSort, mB as StoreType, kw as StoreUpdate, dk as Stores, dj 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/stores.ts"],"names":[],"mappings":";;AA0FA,MAAM,eAAe,WAAmB,CAAA;AAAA,EAEvC,O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CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACpG,EAEA,MAAM,QAAA,CAAS,OAAyB,EAAA,MAAA,EAAmC,OAA2D,EAAA;AACrI,IAAM,MAAA,QAAA,GAAY,QAAkB,EAAM,IAAA,OAAA;AAC1C,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAe,EAAE,IAAA,EAAM,UAAW,EAAA,EAAG,CAAU,OAAA,EAAA,QAAQ,CAAa,SAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC1G,EAGA,QAAQ,QAAkC,EAAA;AACzC,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,MAAO,CAAA,IAAA;AAAA;AACnD,EAGA,aAAa,EAA0C,EAAA;AACtD,IAAO,OAAA,KAAA,CAAM,qBAA+B,EAAE,CAAA;AAAA;AAC/C,EAEA,sBAAsB,GAA2B,EAAA;AAChD,IAAO,OAAA,KAAA,CAAM,qBAAgC,CAAA,GAAG,GAAG,CAAA;AAAA;AACpD,EAGA,IAAkB,GAAA;AACjB,IAAA,OAAO,MAAO,CAAA,IAAA;AAAA;AAGhB;AAGA,MAAM,QAAA,GAAW,IAAI,MAAO,EAAA;AAC5B,IAAO,cAAQ,GAAA","file":"stores.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 { Market, MarketType } from './markets'\nimport type { Merchant, MerchantType } from './merchants'\nimport type { StockLocation, StockLocationType } from './stock_locations'\nimport type { Order } from './orders'\nimport type { PaymentMethod } from './payment_methods'\nimport type { Event } from './events'\nimport type { Version } from './versions'\n\n\ntype StoreType = 'stores'\ntype StoreRel = ResourceRel & { type: StoreType }\ntype MarketRel = ResourceRel & { type: MarketType }\ntype MerchantRel = ResourceRel & { type: MerchantType }\ntype StockLocationRel = ResourceRel & { type: StockLocationType }\n\n\nexport type StoreSort = Pick<Store, 'id' | 'name' | 'code'> & ResourceSort\n// export type StoreFilter = Pick<Store, 'id' | 'name' | 'code'> & ResourceFilter\n\n\ninterface Store extends Resource {\n\t\n\treadonly type: StoreType\n\n\t/** \n\t * The store's internal name.\n\t * @example ```\"Rome Shop\"```\n\t */\n\tname: string\n\t/** \n\t * A string that you can use to identify the store (must be unique within the environment).\n\t * @example ```\"europe1\"```\n\t */\n\tcode?: string | null\n\n\tmarket?: Market | null\n\tmerchant?: Merchant | null\n\tstock_location?: StockLocation | null\n\torders?: Order[] | null\n\tpayment_methods?: PaymentMethod[] | null\n\tevents?: Event[] | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface StoreCreate extends ResourceCreate {\n\t\n\t/** \n\t * The store's internal name.\n\t * @example ```\"Rome Shop\"```\n\t */\n\tname: string\n\t/** \n\t * A string that you can use to identify the store (must be unique within the environment).\n\t * @example ```\"europe1\"```\n\t */\n\tcode?: string | null\n\n\tmarket: MarketRel\n\tmerchant?: MerchantRel | null\n\tstock_location?: StockLocationRel | null\n\n}\n\n\ninterface StoreUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The store's internal name.\n\t * @example ```\"Rome Shop\"```\n\t */\n\tname?: string | null\n\t/** \n\t * A string that you can use to identify the store (must be unique within the environment).\n\t * @example ```\"europe1\"```\n\t */\n\tcode?: string | null\n\n\tmarket?: MarketRel | null\n\tmerchant?: MerchantRel | null\n\tstock_location?: StockLocationRel | null\n\n}\n\n\nclass Stores extends ApiResource<Store> {\n\n\tstatic readonly TYPE: StoreType = 'stores' as const\n\n\tasync create(resource: StoreCreate, params?: QueryParamsRetrieve<Store>, options?: ResourcesConfig): Promise<Store> {\n\t\treturn this.resources.create<StoreCreate, Store>({ ...resource, type: Stores.TYPE }, params, options)\n\t}\n\n\tasync update(resource: StoreUpdate, params?: QueryParamsRetrieve<Store>, options?: ResourcesConfig): Promise<Store> {\n\t\treturn this.resources.update<StoreUpdate, Store>({ ...resource, type: Stores.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: Stores.TYPE } : id, options)\n\t}\n\n\tasync market(storeId: string | Store, params?: QueryParamsRetrieve<Market>, options?: ResourcesConfig): Promise<Market> {\n\t\tconst _storeId = (storeId as Store).id || storeId as string\n\t\treturn this.resources.fetch<Market>({ type: 'markets' }, `stores/${_storeId}/market`, params, options) as unknown as Market\n\t}\n\n\tasync merchant(storeId: string | Store, params?: QueryParamsRetrieve<Merchant>, options?: ResourcesConfig): Promise<Merchant> {\n\t\tconst _storeId = (storeId as Store).id || storeId as string\n\t\treturn this.resources.fetch<Merchant>({ type: 'merchants' }, `stores/${_storeId}/merchant`, params, options) as unknown as Merchant\n\t}\n\n\tasync stock_location(storeId: string | Store, params?: QueryParamsRetrieve<StockLocation>, options?: ResourcesConfig): Promise<StockLocation> {\n\t\tconst _storeId = (storeId as Store).id || storeId as string\n\t\treturn this.resources.fetch<StockLocation>({ type: 'stock_locations' }, `stores/${_storeId}/stock_location`, params, options) as unknown as StockLocation\n\t}\n\n\tasync orders(storeId: string | Store, params?: QueryParamsList<Order>, options?: ResourcesConfig): Promise<ListResponse<Order>> {\n\t\tconst _storeId = (storeId as Store).id || storeId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `stores/${_storeId}/orders`, params, options) as unknown as ListResponse<Order>\n\t}\n\n\tasync payment_methods(storeId: string | Store, params?: QueryParamsList<PaymentMethod>, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>> {\n\t\tconst _storeId = (storeId as Store).id || storeId as string\n\t\treturn this.resources.fetch<PaymentMethod>({ type: 'payment_methods' }, `stores/${_storeId}/payment_methods`, params, options) as unknown as ListResponse<PaymentMethod>\n\t}\n\n\tasync events(storeId: string | Store, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _storeId = (storeId as Store).id || storeId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `stores/${_storeId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync versions(storeId: string | Store, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _storeId = (storeId as Store).id || storeId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `stores/${_storeId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\n\tisStore(resource: any): resource is Store {\n\t\treturn resource.type && (resource.type === Stores.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): StoreRel {\n\t\treturn super.relationshipOneToOne<StoreRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): StoreRel[] {\n\t\treturn super.relationshipOneToMany<StoreRel>(...ids)\n\t}\n\n\n\ttype(): StoreType {\n\t\treturn Stores.TYPE\n\t}\n\n}\n\n\nconst instance = new Stores()\nexport default instance\n\nexport type { Store, StoreCreate, StoreUpdate, StoreType }\n"]}
|
1
|
+
{"version":3,"sources":["../../src/resources/stores.ts"],"names":[],"mappings":";;AA0FA,MAAM,eAAe,WAAmB,CAAA;AAAA,EAEvC,OAAgB,IAAkB,GAAA,QAAA;AAAA,EAElC,MAAM,MAAA,CAAO,QAAuB,EAAA,MAAA,EAAqC,OAA2C,EAAA;AACnH,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA2B,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,MAAO,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACrG,EAEA,MAAM,MAAA,CAAO,QAAuB,EAAA,MAAA,EAAqC,OAA2C,EAAA;AACnH,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA2B,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,MAAO,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAA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EAGA,aAAa,EAA0C,EAAA;AACtD,IAAO,OAAA,KAAA,CAAM,qBAA+B,EAAE,CAAA;AAAA;AAC/C,EAEA,sBAAsB,GAA2B,EAAA;AAChD,IAAO,OAAA,KAAA,CAAM,qBAAgC,CAAA,GAAG,GAAG,CAAA;AAAA;AACpD,EAGA,IAAkB,GAAA;AACjB,IAAA,OAAO,MAAO,CAAA,IAAA;AAAA;AAGhB;AAGA,MAAM,QAAA,GAAW,IAAI,MAAO,EAAA;AAC5B,IAAO,cAAQ,GAAA","file":"stores.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 { Market, MarketType } from './markets'\nimport type { Merchant, MerchantType } from './merchants'\nimport type { StockLocation, StockLocationType } from './stock_locations'\nimport type { Order } from './orders'\nimport type { PaymentMethod } from './payment_methods'\nimport type { Event } from './events'\nimport type { Version } from './versions'\n\n\ntype StoreType = 'stores'\ntype StoreRel = ResourceRel & { type: StoreType }\ntype MarketRel = ResourceRel & { type: MarketType }\ntype MerchantRel = ResourceRel & { type: MerchantType }\ntype StockLocationRel = ResourceRel & { type: StockLocationType }\n\n\nexport type StoreSort = Pick<Store, 'id' | 'name' | 'code'> & ResourceSort\n// export type StoreFilter = Pick<Store, 'id' | 'name' | 'code'> & ResourceFilter\n\n\ninterface Store extends Resource {\n\t\n\treadonly type: StoreType\n\n\t/** \n\t * The store's internal name.\n\t * @example ```\"Rome Shop\"```\n\t */\n\tname: string\n\t/** \n\t * A string that you can use to identify the store (must be unique within the environment).\n\t * @example ```\"europe1\"```\n\t */\n\tcode?: string | null\n\n\tmarket?: Market | null\n\tmerchant?: Merchant | null\n\tstock_location?: StockLocation | null\n\torders?: Order[] | null\n\tpayment_methods?: PaymentMethod[] | null\n\tevents?: Event[] | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface StoreCreate extends ResourceCreate {\n\t\n\t/** \n\t * The store's internal name.\n\t * @example ```\"Rome Shop\"```\n\t */\n\tname: string\n\t/** \n\t * A string that you can use to identify the store (must be unique within the environment).\n\t * @example ```\"europe1\"```\n\t */\n\tcode?: string | null\n\n\tmarket: MarketRel\n\tmerchant?: MerchantRel | null\n\tstock_location?: StockLocationRel | null\n\n}\n\n\ninterface StoreUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The store's internal name.\n\t * @example ```\"Rome Shop\"```\n\t */\n\tname?: string | null\n\t/** \n\t * A string that you can use to identify the store (must be unique within the environment).\n\t * @example ```\"europe1\"```\n\t */\n\tcode?: string | null\n\n\tmarket?: MarketRel | null\n\tmerchant?: MerchantRel | null\n\tstock_location?: StockLocationRel | null\n\n}\n\n\nclass Stores extends ApiResource<Store> {\n\n\tstatic readonly TYPE: StoreType = 'stores' as const\n\n\tasync create(resource: StoreCreate, params?: QueryParamsRetrieve<Store>, options?: ResourcesConfig): Promise<Store> {\n\t\treturn this.resources.create<StoreCreate, Store>({ ...resource, type: Stores.TYPE }, params, options)\n\t}\n\n\tasync update(resource: StoreUpdate, params?: QueryParamsRetrieve<Store>, options?: ResourcesConfig): Promise<Store> {\n\t\treturn this.resources.update<StoreUpdate, Store>({ ...resource, type: Stores.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: Stores.TYPE } : id, options)\n\t}\n\n\tasync market(storeId: string | Store, params?: QueryParamsRetrieve<Market>, options?: ResourcesConfig): Promise<Market> {\n\t\tconst _storeId = (storeId as Store).id || storeId as string\n\t\treturn this.resources.fetch<Market>({ type: 'markets' }, `stores/${_storeId}/market`, params, options) as unknown as Market\n\t}\n\n\tasync merchant(storeId: string | Store, params?: QueryParamsRetrieve<Merchant>, options?: ResourcesConfig): Promise<Merchant> {\n\t\tconst _storeId = (storeId as Store).id || storeId as string\n\t\treturn this.resources.fetch<Merchant>({ type: 'merchants' }, `stores/${_storeId}/merchant`, params, options) as unknown as Merchant\n\t}\n\n\tasync stock_location(storeId: string | Store, params?: QueryParamsRetrieve<StockLocation>, options?: ResourcesConfig): Promise<StockLocation> {\n\t\tconst _storeId = (storeId as Store).id || storeId as string\n\t\treturn this.resources.fetch<StockLocation>({ type: 'stock_locations' }, `stores/${_storeId}/stock_location`, params, options) as unknown as StockLocation\n\t}\n\n\tasync orders(storeId: string | Store, params?: QueryParamsList<Order>, options?: ResourcesConfig): Promise<ListResponse<Order>> {\n\t\tconst _storeId = (storeId as Store).id || storeId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `stores/${_storeId}/orders`, params, options) as unknown as ListResponse<Order>\n\t}\n\n\tasync payment_methods(storeId: string | Store, params?: QueryParamsList<PaymentMethod>, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>> {\n\t\tconst _storeId = (storeId as Store).id || storeId as string\n\t\treturn this.resources.fetch<PaymentMethod>({ type: 'payment_methods' }, `stores/${_storeId}/payment_methods`, params, options) as unknown as ListResponse<PaymentMethod>\n\t}\n\n\tasync events(storeId: string | Store, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _storeId = (storeId as Store).id || storeId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `stores/${_storeId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync versions(storeId: string | Store, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _storeId = (storeId as Store).id || storeId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `stores/${_storeId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\n\tisStore(resource: any): resource is Store {\n\t\treturn resource.type && (resource.type === Stores.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): StoreRel {\n\t\treturn super.relationshipOneToOne<StoreRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): StoreRel[] {\n\t\treturn super.relationshipOneToMany<StoreRel>(...ids)\n\t}\n\n\n\ttype(): StoreType {\n\t\treturn Stores.TYPE\n\t}\n\n}\n\n\nconst instance = new Stores()\nexport default instance\n\nexport type { Stores, Store, StoreCreate, StoreUpdate, StoreType }\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/resources/stripe_gateways.ts"],"names":["ApiResource"],"mappings":";;;;AA8HA,MAAM,uBAAuBA,oBAA2B,CAAA;AAAA,EAEvD,OAAgB,IAA0B,GAAA,iBAAA;AAAA,EAE1C,MAAM,MAAA,CAAO,QAA+B,EAAA,MAAA,EAA6C,OAAmD,EAAA;AAC3I,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA2C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,cAAe,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC7H,EAEA,MAAM,MAAA,CAAO,QAA+B,EAAA,MAAA,EAA6C,OAAmD,EAAA;AAC3I,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA2C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,cAAe,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC7H,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,cAAA,CAAe,IAAK,EAAA,GAAI,IAAI,OAAO,CAAA;AAAA;AACtG,EAEA,MAAM,eAAA,CAAgB,eAAyC,EAAA,MAAA,EAAyC,OAAiE,EAAA;AACxK,IAAM,MAAA,gBAAA,GAAoB,gBAAkC,EAAM,IAAA,eAAA;AAClE,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAqB,EAA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ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { PaymentMethod } from './payment_methods'\nimport type { Version } from './versions'\nimport type { StripePayment } from './stripe_payments'\n\n\ntype StripeGatewayType = 'stripe_gateways'\ntype StripeGatewayRel = ResourceRel & { type: StripeGatewayType }\n\n\nexport type StripeGatewaySort = Pick<StripeGateway, 'id' | 'name'> & ResourceSort\n// export type StripeGatewayFilter = Pick<StripeGateway, 'id' | 'name'> & ResourceFilter\n\n\ninterface StripeGateway extends Resource {\n\t\n\treadonly type: StripeGatewayType\n\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname: string\n\t/** \n\t * The account (if any) for which the funds of the PaymentIntent are intended.\n\t * @example ```\"acct_xxxx-yyyy-zzzz\"```\n\t */\n\tconnected_account?: string | null\n\t/** \n\t * Indicates if the gateway will accept payment methods enabled in the Stripe dashboard.\n\t * @example ```true```\n\t */\n\tauto_payments?: boolean | null\n\t/** \n\t * Indicates if the payment source is forced on the editable order upon receiving a successful event from Stripe.\n\t * @example ```true```\n\t */\n\tforce_payments?: boolean | null\n\t/** \n\t * The gateway webhook endpoint ID, generated automatically.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\twebhook_endpoint_id?: string | null\n\t/** \n\t * The gateway webhook endpoint secret, generated automatically.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\twebhook_endpoint_secret?: string | null\n\t/** \n\t * The gateway webhook URL, generated automatically.\n\t * @example ```\"https://core.commercelayer.co/webhook_callbacks/stripe_gateways/xxxxx\"```\n\t */\n\twebhook_endpoint_url?: string | null\n\n\tpayment_methods?: PaymentMethod[] | null\n\tversions?: Version[] | null\n\tstripe_payments?: StripePayment[] | null\n\n}\n\n\ninterface StripeGatewayCreate extends ResourceCreate {\n\t\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname: string\n\t/** \n\t * The gateway login.\n\t * @example ```\"sk_live_xxxx-yyyy-zzzz\"```\n\t */\n\tlogin: string\n\t/** \n\t * The gateway publishable API key.\n\t * @example ```\"pk_live_xxxx-yyyy-zzzz\"```\n\t */\n\tpublishable_key?: string | null\n\t/** \n\t * The account (if any) for which the funds of the PaymentIntent are intended.\n\t * @example ```\"acct_xxxx-yyyy-zzzz\"```\n\t */\n\tconnected_account?: string | null\n\t/** \n\t * Indicates if the gateway will accept payment methods enabled in the Stripe dashboard.\n\t * @example ```true```\n\t */\n\tauto_payments?: boolean | null\n\t/** \n\t * Indicates if the payment source is forced on the editable order upon receiving a successful event from Stripe.\n\t * @example ```true```\n\t */\n\tforce_payments?: boolean | null\n\t\n}\n\n\ninterface StripeGatewayUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The account (if any) for which the funds of the PaymentIntent are intended.\n\t * @example ```\"acct_xxxx-yyyy-zzzz\"```\n\t */\n\tconnected_account?: string | null\n\t/** \n\t * Indicates if the gateway will accept payment methods enabled in the Stripe dashboard.\n\t * @example ```true```\n\t */\n\tauto_payments?: boolean | null\n\t/** \n\t * Indicates if the payment source is forced on the editable order upon receiving a successful event from Stripe.\n\t * @example ```true```\n\t */\n\tforce_payments?: boolean | null\n\t\n}\n\n\nclass StripeGateways extends ApiResource<StripeGateway> {\n\n\tstatic readonly TYPE: StripeGatewayType = 'stripe_gateways' as const\n\n\tasync create(resource: StripeGatewayCreate, params?: QueryParamsRetrieve<StripeGateway>, options?: ResourcesConfig): Promise<StripeGateway> {\n\t\treturn this.resources.create<StripeGatewayCreate, StripeGateway>({ ...resource, type: StripeGateways.TYPE }, params, options)\n\t}\n\n\tasync update(resource: StripeGatewayUpdate, params?: QueryParamsRetrieve<StripeGateway>, options?: ResourcesConfig): Promise<StripeGateway> {\n\t\treturn this.resources.update<StripeGatewayUpdate, StripeGateway>({ ...resource, type: StripeGateways.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: StripeGateways.TYPE } : id, options)\n\t}\n\n\tasync payment_methods(stripeGatewayId: string | StripeGateway, params?: QueryParamsList<PaymentMethod>, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>> {\n\t\tconst _stripeGatewayId = (stripeGatewayId as StripeGateway).id || stripeGatewayId as string\n\t\treturn this.resources.fetch<PaymentMethod>({ type: 'payment_methods' }, `stripe_gateways/${_stripeGatewayId}/payment_methods`, params, options) as unknown as ListResponse<PaymentMethod>\n\t}\n\n\tasync versions(stripeGatewayId: string | StripeGateway, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _stripeGatewayId = (stripeGatewayId as StripeGateway).id || stripeGatewayId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `stripe_gateways/${_stripeGatewayId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync stripe_payments(stripeGatewayId: string | StripeGateway, params?: QueryParamsList<StripePayment>, options?: ResourcesConfig): Promise<ListResponse<StripePayment>> {\n\t\tconst _stripeGatewayId = (stripeGatewayId as StripeGateway).id || stripeGatewayId as string\n\t\treturn this.resources.fetch<StripePayment>({ type: 'stripe_payments' }, `stripe_gateways/${_stripeGatewayId}/stripe_payments`, params, options) as unknown as ListResponse<StripePayment>\n\t}\n\n\n\tisStripeGateway(resource: any): resource is StripeGateway {\n\t\treturn resource.type && (resource.type === StripeGateways.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): StripeGatewayRel {\n\t\treturn super.relationshipOneToOne<StripeGatewayRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): StripeGatewayRel[] {\n\t\treturn super.relationshipOneToMany<StripeGatewayRel>(...ids)\n\t}\n\n\n\ttype(): StripeGatewayType {\n\t\treturn StripeGateways.TYPE\n\t}\n\n}\n\n\nconst instance = new StripeGateways()\nexport default instance\n\nexport type { StripeGateway, StripeGatewayCreate, StripeGatewayUpdate, StripeGatewayType }\n"]}
|
1
|
+
{"version":3,"sources":["../../src/resources/stripe_gateways.ts"],"names":["ApiResource"],"mappings":";;;;AA8HA,MAAM,uBAAuBA,oBAA2B,CAAA;AAAA,EAEvD,OAAgB,IAA0B,GAAA,iBAAA;AAAA,EAE1C,MAAM,MAAA,CAAO,QAA+B,EAAA,MAAA,EAA6C,OAAmD,EAAA;AAC3I,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA2C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,cAAe,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC7H,EAEA,MAAM,MAAA,CAAO,QAA+B,EAAA,MAAA,EAA6C,OAAmD,EAAA;AAC3I,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA2C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,cAAe,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC7H,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,cAAA,CAAe,IAAK,EAAA,GAAI,IAAI,OAAO,CAAA;AAAA;AACtG,EAEA,MAAM,eAAA,CAAgB,eAAyC,EAAA,MAAA,EAAyC,OAAiE,EAAA;AACxK,IAAM,MAAA,gBAAA,GAAoB,gBAAkC,EAAM,IAAA,eAAA;AAClE,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAqB,EAAE,IAAA,EAAM,iBAAkB,EAAA,EAAG,CAAmB,gBAA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ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { PaymentMethod } from './payment_methods'\nimport type { Version } from './versions'\nimport type { StripePayment } from './stripe_payments'\n\n\ntype StripeGatewayType = 'stripe_gateways'\ntype StripeGatewayRel = ResourceRel & { type: StripeGatewayType }\n\n\nexport type StripeGatewaySort = Pick<StripeGateway, 'id' | 'name'> & ResourceSort\n// export type StripeGatewayFilter = Pick<StripeGateway, 'id' | 'name'> & ResourceFilter\n\n\ninterface StripeGateway extends Resource {\n\t\n\treadonly type: StripeGatewayType\n\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname: string\n\t/** \n\t * The account (if any) for which the funds of the PaymentIntent are intended.\n\t * @example ```\"acct_xxxx-yyyy-zzzz\"```\n\t */\n\tconnected_account?: string | null\n\t/** \n\t * Indicates if the gateway will accept payment methods enabled in the Stripe dashboard.\n\t * @example ```true```\n\t */\n\tauto_payments?: boolean | null\n\t/** \n\t * Indicates if the payment source is forced on the editable order upon receiving a successful event from Stripe.\n\t * @example ```true```\n\t */\n\tforce_payments?: boolean | null\n\t/** \n\t * The gateway webhook endpoint ID, generated automatically.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\twebhook_endpoint_id?: string | null\n\t/** \n\t * The gateway webhook endpoint secret, generated automatically.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\twebhook_endpoint_secret?: string | null\n\t/** \n\t * The gateway webhook URL, generated automatically.\n\t * @example ```\"https://core.commercelayer.co/webhook_callbacks/stripe_gateways/xxxxx\"```\n\t */\n\twebhook_endpoint_url?: string | null\n\n\tpayment_methods?: PaymentMethod[] | null\n\tversions?: Version[] | null\n\tstripe_payments?: StripePayment[] | null\n\n}\n\n\ninterface StripeGatewayCreate extends ResourceCreate {\n\t\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname: string\n\t/** \n\t * The gateway login.\n\t * @example ```\"sk_live_xxxx-yyyy-zzzz\"```\n\t */\n\tlogin: string\n\t/** \n\t * The gateway publishable API key.\n\t * @example ```\"pk_live_xxxx-yyyy-zzzz\"```\n\t */\n\tpublishable_key?: string | null\n\t/** \n\t * The account (if any) for which the funds of the PaymentIntent are intended.\n\t * @example ```\"acct_xxxx-yyyy-zzzz\"```\n\t */\n\tconnected_account?: string | null\n\t/** \n\t * Indicates if the gateway will accept payment methods enabled in the Stripe dashboard.\n\t * @example ```true```\n\t */\n\tauto_payments?: boolean | null\n\t/** \n\t * Indicates if the payment source is forced on the editable order upon receiving a successful event from Stripe.\n\t * @example ```true```\n\t */\n\tforce_payments?: boolean | null\n\t\n}\n\n\ninterface StripeGatewayUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The account (if any) for which the funds of the PaymentIntent are intended.\n\t * @example ```\"acct_xxxx-yyyy-zzzz\"```\n\t */\n\tconnected_account?: string | null\n\t/** \n\t * Indicates if the gateway will accept payment methods enabled in the Stripe dashboard.\n\t * @example ```true```\n\t */\n\tauto_payments?: boolean | null\n\t/** \n\t * Indicates if the payment source is forced on the editable order upon receiving a successful event from Stripe.\n\t * @example ```true```\n\t */\n\tforce_payments?: boolean | null\n\t\n}\n\n\nclass StripeGateways extends ApiResource<StripeGateway> {\n\n\tstatic readonly TYPE: StripeGatewayType = 'stripe_gateways' as const\n\n\tasync create(resource: StripeGatewayCreate, params?: QueryParamsRetrieve<StripeGateway>, options?: ResourcesConfig): Promise<StripeGateway> {\n\t\treturn this.resources.create<StripeGatewayCreate, StripeGateway>({ ...resource, type: StripeGateways.TYPE }, params, options)\n\t}\n\n\tasync update(resource: StripeGatewayUpdate, params?: QueryParamsRetrieve<StripeGateway>, options?: ResourcesConfig): Promise<StripeGateway> {\n\t\treturn this.resources.update<StripeGatewayUpdate, StripeGateway>({ ...resource, type: StripeGateways.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: StripeGateways.TYPE } : id, options)\n\t}\n\n\tasync payment_methods(stripeGatewayId: string | StripeGateway, params?: QueryParamsList<PaymentMethod>, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>> {\n\t\tconst _stripeGatewayId = (stripeGatewayId as StripeGateway).id || stripeGatewayId as string\n\t\treturn this.resources.fetch<PaymentMethod>({ type: 'payment_methods' }, `stripe_gateways/${_stripeGatewayId}/payment_methods`, params, options) as unknown as ListResponse<PaymentMethod>\n\t}\n\n\tasync versions(stripeGatewayId: string | StripeGateway, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _stripeGatewayId = (stripeGatewayId as StripeGateway).id || stripeGatewayId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `stripe_gateways/${_stripeGatewayId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync stripe_payments(stripeGatewayId: string | StripeGateway, params?: QueryParamsList<StripePayment>, options?: ResourcesConfig): Promise<ListResponse<StripePayment>> {\n\t\tconst _stripeGatewayId = (stripeGatewayId as StripeGateway).id || stripeGatewayId as string\n\t\treturn this.resources.fetch<StripePayment>({ type: 'stripe_payments' }, `stripe_gateways/${_stripeGatewayId}/stripe_payments`, params, options) as unknown as ListResponse<StripePayment>\n\t}\n\n\n\tisStripeGateway(resource: any): resource is StripeGateway {\n\t\treturn resource.type && (resource.type === StripeGateways.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): StripeGatewayRel {\n\t\treturn super.relationshipOneToOne<StripeGatewayRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): StripeGatewayRel[] {\n\t\treturn super.relationshipOneToMany<StripeGatewayRel>(...ids)\n\t}\n\n\n\ttype(): StripeGatewayType {\n\t\treturn StripeGateways.TYPE\n\t}\n\n}\n\n\nconst instance = new StripeGateways()\nexport default instance\n\nexport type { StripeGateways, StripeGateway, StripeGatewayCreate, StripeGatewayUpdate, StripeGatewayType }\n"]}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export {
|
1
|
+
export { ky as StripeGateway, kz as StripeGatewayCreate, kB as StripeGatewaySort, nr as StripeGatewayType, kA as StripeGatewayUpdate, dm as StripeGateways, dl 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 { ky as StripeGateway, kz as StripeGatewayCreate, kB as StripeGatewaySort, nr as StripeGatewayType, kA as StripeGatewayUpdate, dm as StripeGateways, dl 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/stripe_gateways.ts"],"names":[],"mappings":";;AA8HA,MAAM,uBAAuB,WAA2B,CAAA;AAAA,EAEvD,OAAgB,IAA0B,GAAA,iBAAA;AAAA,EAE1C,MAAM,MAAA,CAAO,QAA+B,EAAA,MAAA,EAA6C,OAAmD,EAAA;AAC3I,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA2C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,cAAe,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC7H,EAEA,MAAM,MAAA,CAAO,QAA+B,EAAA,MAAA,EAA6C,OAAmD,EAAA;AAC3I,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA2C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,cAAe,CAAA,IAAA,EAAQ,EAAA,MAAA,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O,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":"stripe_gateways.js","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { PaymentMethod } from './payment_methods'\nimport type { Version } from './versions'\nimport type { StripePayment } from './stripe_payments'\n\n\ntype StripeGatewayType = 'stripe_gateways'\ntype StripeGatewayRel = ResourceRel & { type: StripeGatewayType }\n\n\nexport type StripeGatewaySort = Pick<StripeGateway, 'id' | 'name'> & ResourceSort\n// export type StripeGatewayFilter = Pick<StripeGateway, 'id' | 'name'> & ResourceFilter\n\n\ninterface StripeGateway extends Resource {\n\t\n\treadonly type: StripeGatewayType\n\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname: string\n\t/** \n\t * The account (if any) for which the funds of the PaymentIntent are intended.\n\t * @example ```\"acct_xxxx-yyyy-zzzz\"```\n\t */\n\tconnected_account?: string | null\n\t/** \n\t * Indicates if the gateway will accept payment methods enabled in the Stripe dashboard.\n\t * @example ```true```\n\t */\n\tauto_payments?: boolean | null\n\t/** \n\t * Indicates if the payment source is forced on the editable order upon receiving a successful event from Stripe.\n\t * @example ```true```\n\t */\n\tforce_payments?: boolean | null\n\t/** \n\t * The gateway webhook endpoint ID, generated automatically.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\twebhook_endpoint_id?: string | null\n\t/** \n\t * The gateway webhook endpoint secret, generated automatically.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\twebhook_endpoint_secret?: string | null\n\t/** \n\t * The gateway webhook URL, generated automatically.\n\t * @example ```\"https://core.commercelayer.co/webhook_callbacks/stripe_gateways/xxxxx\"```\n\t */\n\twebhook_endpoint_url?: string | null\n\n\tpayment_methods?: PaymentMethod[] | null\n\tversions?: Version[] | null\n\tstripe_payments?: StripePayment[] | null\n\n}\n\n\ninterface StripeGatewayCreate extends ResourceCreate {\n\t\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname: string\n\t/** \n\t * The gateway login.\n\t * @example ```\"sk_live_xxxx-yyyy-zzzz\"```\n\t */\n\tlogin: string\n\t/** \n\t * The gateway publishable API key.\n\t * @example ```\"pk_live_xxxx-yyyy-zzzz\"```\n\t */\n\tpublishable_key?: string | null\n\t/** \n\t * The account (if any) for which the funds of the PaymentIntent are intended.\n\t * @example ```\"acct_xxxx-yyyy-zzzz\"```\n\t */\n\tconnected_account?: string | null\n\t/** \n\t * Indicates if the gateway will accept payment methods enabled in the Stripe dashboard.\n\t * @example ```true```\n\t */\n\tauto_payments?: boolean | null\n\t/** \n\t * Indicates if the payment source is forced on the editable order upon receiving a successful event from Stripe.\n\t * @example ```true```\n\t */\n\tforce_payments?: boolean | null\n\t\n}\n\n\ninterface StripeGatewayUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The account (if any) for which the funds of the PaymentIntent are intended.\n\t * @example ```\"acct_xxxx-yyyy-zzzz\"```\n\t */\n\tconnected_account?: string | null\n\t/** \n\t * Indicates if the gateway will accept payment methods enabled in the Stripe dashboard.\n\t * @example ```true```\n\t */\n\tauto_payments?: boolean | null\n\t/** \n\t * Indicates if the payment source is forced on the editable order upon receiving a successful event from Stripe.\n\t * @example ```true```\n\t */\n\tforce_payments?: boolean | null\n\t\n}\n\n\nclass StripeGateways extends ApiResource<StripeGateway> {\n\n\tstatic readonly TYPE: StripeGatewayType = 'stripe_gateways' as const\n\n\tasync create(resource: StripeGatewayCreate, params?: QueryParamsRetrieve<StripeGateway>, options?: ResourcesConfig): Promise<StripeGateway> {\n\t\treturn this.resources.create<StripeGatewayCreate, StripeGateway>({ ...resource, type: StripeGateways.TYPE }, params, options)\n\t}\n\n\tasync update(resource: StripeGatewayUpdate, params?: QueryParamsRetrieve<StripeGateway>, options?: ResourcesConfig): Promise<StripeGateway> {\n\t\treturn this.resources.update<StripeGatewayUpdate, StripeGateway>({ ...resource, type: StripeGateways.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: StripeGateways.TYPE } : id, options)\n\t}\n\n\tasync payment_methods(stripeGatewayId: string | StripeGateway, params?: QueryParamsList<PaymentMethod>, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>> {\n\t\tconst _stripeGatewayId = (stripeGatewayId as StripeGateway).id || stripeGatewayId as string\n\t\treturn this.resources.fetch<PaymentMethod>({ type: 'payment_methods' }, `stripe_gateways/${_stripeGatewayId}/payment_methods`, params, options) as unknown as ListResponse<PaymentMethod>\n\t}\n\n\tasync versions(stripeGatewayId: string | StripeGateway, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _stripeGatewayId = (stripeGatewayId as StripeGateway).id || stripeGatewayId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `stripe_gateways/${_stripeGatewayId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync stripe_payments(stripeGatewayId: string | StripeGateway, params?: QueryParamsList<StripePayment>, options?: ResourcesConfig): Promise<ListResponse<StripePayment>> {\n\t\tconst _stripeGatewayId = (stripeGatewayId as StripeGateway).id || stripeGatewayId as string\n\t\treturn this.resources.fetch<StripePayment>({ type: 'stripe_payments' }, `stripe_gateways/${_stripeGatewayId}/stripe_payments`, params, options) as unknown as ListResponse<StripePayment>\n\t}\n\n\n\tisStripeGateway(resource: any): resource is StripeGateway {\n\t\treturn resource.type && (resource.type === StripeGateways.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): StripeGatewayRel {\n\t\treturn super.relationshipOneToOne<StripeGatewayRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): StripeGatewayRel[] {\n\t\treturn super.relationshipOneToMany<StripeGatewayRel>(...ids)\n\t}\n\n\n\ttype(): StripeGatewayType {\n\t\treturn StripeGateways.TYPE\n\t}\n\n}\n\n\nconst instance = new StripeGateways()\nexport default instance\n\nexport type { StripeGateway, StripeGatewayCreate, StripeGatewayUpdate, StripeGatewayType }\n"]}
|
1
|
+
{"version":3,"sources":["../../src/resources/stripe_gateways.ts"],"names":[],"mappings":";;AA8HA,MAAM,uBAAuB,WAA2B,CAAA;AAAA,EAEvD,OAAgB,IAA0B,GAAA,iBAAA;AAAA,EAE1C,MAAM,MAAA,CAAO,QAA+B,EAAA,MAAA,EAA6C,OAAmD,EAAA;AAC3I,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA2C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,cAAe,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC7H,EAEA,MAAM,MAAA,CAAO,QAA+B,EAAA,MAAA,EAA6C,OAAmD,EAAA;AAC3I,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA2C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,cAAe,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC7H,EAEA,MAAM,MAAO,CAAA,EAAA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,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":"stripe_gateways.js","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { PaymentMethod } from './payment_methods'\nimport type { Version } from './versions'\nimport type { StripePayment } from './stripe_payments'\n\n\ntype StripeGatewayType = 'stripe_gateways'\ntype StripeGatewayRel = ResourceRel & { type: StripeGatewayType }\n\n\nexport type StripeGatewaySort = Pick<StripeGateway, 'id' | 'name'> & ResourceSort\n// export type StripeGatewayFilter = Pick<StripeGateway, 'id' | 'name'> & ResourceFilter\n\n\ninterface StripeGateway extends Resource {\n\t\n\treadonly type: StripeGatewayType\n\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname: string\n\t/** \n\t * The account (if any) for which the funds of the PaymentIntent are intended.\n\t * @example ```\"acct_xxxx-yyyy-zzzz\"```\n\t */\n\tconnected_account?: string | null\n\t/** \n\t * Indicates if the gateway will accept payment methods enabled in the Stripe dashboard.\n\t * @example ```true```\n\t */\n\tauto_payments?: boolean | null\n\t/** \n\t * Indicates if the payment source is forced on the editable order upon receiving a successful event from Stripe.\n\t * @example ```true```\n\t */\n\tforce_payments?: boolean | null\n\t/** \n\t * The gateway webhook endpoint ID, generated automatically.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\twebhook_endpoint_id?: string | null\n\t/** \n\t * The gateway webhook endpoint secret, generated automatically.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\twebhook_endpoint_secret?: string | null\n\t/** \n\t * The gateway webhook URL, generated automatically.\n\t * @example ```\"https://core.commercelayer.co/webhook_callbacks/stripe_gateways/xxxxx\"```\n\t */\n\twebhook_endpoint_url?: string | null\n\n\tpayment_methods?: PaymentMethod[] | null\n\tversions?: Version[] | null\n\tstripe_payments?: StripePayment[] | null\n\n}\n\n\ninterface StripeGatewayCreate extends ResourceCreate {\n\t\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname: string\n\t/** \n\t * The gateway login.\n\t * @example ```\"sk_live_xxxx-yyyy-zzzz\"```\n\t */\n\tlogin: string\n\t/** \n\t * The gateway publishable API key.\n\t * @example ```\"pk_live_xxxx-yyyy-zzzz\"```\n\t */\n\tpublishable_key?: string | null\n\t/** \n\t * The account (if any) for which the funds of the PaymentIntent are intended.\n\t * @example ```\"acct_xxxx-yyyy-zzzz\"```\n\t */\n\tconnected_account?: string | null\n\t/** \n\t * Indicates if the gateway will accept payment methods enabled in the Stripe dashboard.\n\t * @example ```true```\n\t */\n\tauto_payments?: boolean | null\n\t/** \n\t * Indicates if the payment source is forced on the editable order upon receiving a successful event from Stripe.\n\t * @example ```true```\n\t */\n\tforce_payments?: boolean | null\n\t\n}\n\n\ninterface StripeGatewayUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The account (if any) for which the funds of the PaymentIntent are intended.\n\t * @example ```\"acct_xxxx-yyyy-zzzz\"```\n\t */\n\tconnected_account?: string | null\n\t/** \n\t * Indicates if the gateway will accept payment methods enabled in the Stripe dashboard.\n\t * @example ```true```\n\t */\n\tauto_payments?: boolean | null\n\t/** \n\t * Indicates if the payment source is forced on the editable order upon receiving a successful event from Stripe.\n\t * @example ```true```\n\t */\n\tforce_payments?: boolean | null\n\t\n}\n\n\nclass StripeGateways extends ApiResource<StripeGateway> {\n\n\tstatic readonly TYPE: StripeGatewayType = 'stripe_gateways' as const\n\n\tasync create(resource: StripeGatewayCreate, params?: QueryParamsRetrieve<StripeGateway>, options?: ResourcesConfig): Promise<StripeGateway> {\n\t\treturn this.resources.create<StripeGatewayCreate, StripeGateway>({ ...resource, type: StripeGateways.TYPE }, params, options)\n\t}\n\n\tasync update(resource: StripeGatewayUpdate, params?: QueryParamsRetrieve<StripeGateway>, options?: ResourcesConfig): Promise<StripeGateway> {\n\t\treturn this.resources.update<StripeGatewayUpdate, StripeGateway>({ ...resource, type: StripeGateways.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: StripeGateways.TYPE } : id, options)\n\t}\n\n\tasync payment_methods(stripeGatewayId: string | StripeGateway, params?: QueryParamsList<PaymentMethod>, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>> {\n\t\tconst _stripeGatewayId = (stripeGatewayId as StripeGateway).id || stripeGatewayId as string\n\t\treturn this.resources.fetch<PaymentMethod>({ type: 'payment_methods' }, `stripe_gateways/${_stripeGatewayId}/payment_methods`, params, options) as unknown as ListResponse<PaymentMethod>\n\t}\n\n\tasync versions(stripeGatewayId: string | StripeGateway, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _stripeGatewayId = (stripeGatewayId as StripeGateway).id || stripeGatewayId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `stripe_gateways/${_stripeGatewayId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync stripe_payments(stripeGatewayId: string | StripeGateway, params?: QueryParamsList<StripePayment>, options?: ResourcesConfig): Promise<ListResponse<StripePayment>> {\n\t\tconst _stripeGatewayId = (stripeGatewayId as StripeGateway).id || stripeGatewayId as string\n\t\treturn this.resources.fetch<StripePayment>({ type: 'stripe_payments' }, `stripe_gateways/${_stripeGatewayId}/stripe_payments`, params, options) as unknown as ListResponse<StripePayment>\n\t}\n\n\n\tisStripeGateway(resource: any): resource is StripeGateway {\n\t\treturn resource.type && (resource.type === StripeGateways.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): StripeGatewayRel {\n\t\treturn super.relationshipOneToOne<StripeGatewayRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): StripeGatewayRel[] {\n\t\treturn super.relationshipOneToMany<StripeGatewayRel>(...ids)\n\t}\n\n\n\ttype(): StripeGatewayType {\n\t\treturn StripeGateways.TYPE\n\t}\n\n}\n\n\nconst instance = new StripeGateways()\nexport default instance\n\nexport type { StripeGateways, StripeGateway, StripeGatewayCreate, StripeGatewayUpdate, StripeGatewayType }\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/resources/stripe_payments.ts"],"names":["ApiResource"],"mappings":";;;;AAsJA,MAAM,uBAAuBA,oBAA2B,CAAA;AAAA,EAEvD,OAAgB,IAA0B,GAAA,iBAAA;AAAA,EAE1C,MAAM,MAAA,CAAO,QAA+B,EAAA,MAAA,EAA6C,OAAmD,EAAA;AAC3I,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA2C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,cAAe,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC7H,EAEA,MAAM,MAAA,CAAO,QAA+B,EAAA,MAAA,EAA6C,OAAmD,EAAA;AAC3I,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA2C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,cAAe,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC7H,EAEA,MAAM,MAAO,CAAA,EAAA,EAAyB,OAA0C,EAAA;A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O,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,cAAe,CAAA,IAAA,EAAM,SAAS,IAAK,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AACxK,EAEA,MAAM,QAAA,CAAS,EAA4B,EAAA,MAAA,EAA6C,OAAmD,EAAA;AAC1I,IAAA,OAAO,KAAK,SAAU,CAAA,MAAA,CAA2C,EAAE,EAAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,cAAe,CAAA,IAAA,EAAM,UAAU,IAAK,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AACzK,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":"stripe_payments.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 { PaymentGateway } from './payment_gateways'\nimport type { Version } from './versions'\n\n\ntype StripePaymentType = 'stripe_payments'\ntype StripePaymentRel = ResourceRel & { type: StripePaymentType }\ntype OrderRel = ResourceRel & { type: OrderType }\n\n\nexport type StripePaymentSort = Pick<StripePayment, 'id'> & ResourceSort\n// export type StripePaymentFilter = Pick<StripePayment, 'id'> & ResourceFilter\n\n\ninterface StripePayment extends Resource {\n\t\n\treadonly type: StripePaymentType\n\n\t/** \n\t * The Stripe payment intent ID. Required to identify a payment session on stripe.\n\t * @example ```\"pi_1234XXX\"```\n\t */\n\tstripe_id?: string | null\n\t/** \n\t * The Stripe payment intent client secret. Required to create a charge through Stripe.js.\n\t * @example ```\"pi_1234XXX_secret_5678YYY\"```\n\t */\n\tclient_secret?: string | null\n\t/** \n\t * The Stripe charge ID. Identifies money movement upon the payment intent confirmation.\n\t * @example ```\"ch_1234XXX\"```\n\t */\n\tcharge_id?: string | null\n\t/** \n\t * The Stripe publishable API key.\n\t * @example ```\"pk_live_xxxx-yyyy-zzzz\"```\n\t */\n\tpublishable_key?: string | null\n\t/** \n\t * The Stripe account ID that these funds are intended for.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\ton_behalf_of?: string | null\n\t/** \n\t * A string that identifies the resulting payment as part of a group.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\ttransfer_group?: string | null\n\t/** \n\t * Stripe payment options: 'customer', 'payment_method', 'return_url', etc. Check Stripe payment intent API for more details.\n\t * @example ```{\"customer\":\"cus_xxx\",\"payment_method\":\"pm_xxx\"}```\n\t */\n\toptions?: Record<string, any> | null\n\t/** \n\t * Stripe 'payment_method', set by webhook.\n\t * @example ```{\"id\":\"pm_xxx\"}```\n\t */\n\tpayment_method?: Record<string, any> | null\n\t/** \n\t * Indicates if the order current amount differs form the one of the created payment intent.\n\t */\n\tmismatched_amounts?: boolean | null\n\t/** \n\t * The URL to return to when a redirect payment is completed.\n\t * @example ```\"https://yourdomain.com/thankyou\"```\n\t */\n\treturn_url?: string | null\n\t/** \n\t * The email address to send the receipt to.\n\t * @example ```\"john@example.com\"```\n\t */\n\treceipt_email?: string | null\n\t/** \n\t * Information about the payment instrument used in the transaction.\n\t * @example ```{\"issuer\":\"cl bank\",\"card_type\":\"visa\"}```\n\t */\n\tpayment_instrument?: Record<string, any> | null\n\n\torder?: Order | null\n\tpayment_gateway?: PaymentGateway | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface StripePaymentCreate extends ResourceCreate {\n\t\n\t/** \n\t * The Stripe payment intent ID. Required to identify a payment session on stripe.\n\t * @example ```\"pi_1234XXX\"```\n\t */\n\tstripe_id?: string | null\n\t/** \n\t * The Stripe payment intent client secret. Required to create a charge through Stripe.js.\n\t * @example ```\"pi_1234XXX_secret_5678YYY\"```\n\t */\n\tclient_secret?: string | null\n\t/** \n\t * Stripe payment options: 'customer', 'payment_method', 'return_url', etc. Check Stripe payment intent API for more details.\n\t * @example ```{\"customer\":\"cus_xxx\",\"payment_method\":\"pm_xxx\"}```\n\t */\n\toptions?: Record<string, any> | null\n\t/** \n\t * The URL to return to when a redirect payment is completed.\n\t * @example ```\"https://yourdomain.com/thankyou\"```\n\t */\n\treturn_url?: string | null\n\t/** \n\t * The email address to send the receipt to.\n\t * @example ```\"john@example.com\"```\n\t */\n\treceipt_email?: string | null\n\n\torder: OrderRel\n\n}\n\n\ninterface StripePaymentUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * Stripe payment options: 'customer', 'payment_method', 'return_url', etc. Check Stripe payment intent API for more details.\n\t * @example ```{\"customer\":\"cus_xxx\",\"payment_method\":\"pm_xxx\"}```\n\t */\n\toptions?: Record<string, any> | null\n\t/** \n\t * The URL to return to when a redirect payment is completed.\n\t * @example ```\"https://yourdomain.com/thankyou\"```\n\t */\n\treturn_url?: string | null\n\t/** \n\t * Send this attribute if you want to update the created payment intent with fresh order data.\n\t * @example ```true```\n\t */\n\t_update?: boolean | null\n\t/** \n\t * Send this attribute if you want to refresh the payment status, can be used as webhooks fallback logic.\n\t * @example ```true```\n\t */\n\t_refresh?: boolean | null\n\n\torder?: OrderRel | null\n\n}\n\n\nclass StripePayments extends ApiResource<StripePayment> {\n\n\tstatic readonly TYPE: StripePaymentType = 'stripe_payments' as const\n\n\tasync create(resource: StripePaymentCreate, params?: QueryParamsRetrieve<StripePayment>, options?: ResourcesConfig): Promise<StripePayment> {\n\t\treturn this.resources.create<StripePaymentCreate, StripePayment>({ ...resource, type: StripePayments.TYPE }, params, options)\n\t}\n\n\tasync update(resource: StripePaymentUpdate, params?: QueryParamsRetrieve<StripePayment>, options?: ResourcesConfig): Promise<StripePayment> {\n\t\treturn this.resources.update<StripePaymentUpdate, StripePayment>({ ...resource, type: StripePayments.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: StripePayments.TYPE } : id, options)\n\t}\n\n\tasync order(stripePaymentId: string | StripePayment, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _stripePaymentId = (stripePaymentId as StripePayment).id || stripePaymentId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `stripe_payments/${_stripePaymentId}/order`, params, options) as unknown as Order\n\t}\n\n\tasync payment_gateway(stripePaymentId: string | StripePayment, params?: QueryParamsRetrieve<PaymentGateway>, options?: ResourcesConfig): Promise<PaymentGateway> {\n\t\tconst _stripePaymentId = (stripePaymentId as StripePayment).id || stripePaymentId as string\n\t\treturn this.resources.fetch<PaymentGateway>({ type: 'payment_gateways' }, `stripe_payments/${_stripePaymentId}/payment_gateway`, params, options) as unknown as PaymentGateway\n\t}\n\n\tasync versions(stripePaymentId: string | StripePayment, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _stripePaymentId = (stripePaymentId as StripePayment).id || stripePaymentId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `stripe_payments/${_stripePaymentId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync _update(id: string | StripePayment, params?: QueryParamsRetrieve<StripePayment>, options?: ResourcesConfig): Promise<StripePayment> {\n\t\treturn this.resources.update<StripePaymentUpdate, StripePayment>({ id: (typeof id === 'string')? id: id.id, type: StripePayments.TYPE, _update: true }, params, options)\n\t}\n\n\tasync _refresh(id: string | StripePayment, params?: QueryParamsRetrieve<StripePayment>, options?: ResourcesConfig): Promise<StripePayment> {\n\t\treturn this.resources.update<StripePaymentUpdate, StripePayment>({ id: (typeof id === 'string')? id: id.id, type: StripePayments.TYPE, _refresh: true }, params, options)\n\t}\n\n\n\tisStripePayment(resource: any): resource is StripePayment {\n\t\treturn resource.type && (resource.type === StripePayments.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): StripePaymentRel {\n\t\treturn super.relationshipOneToOne<StripePaymentRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): StripePaymentRel[] {\n\t\treturn super.relationshipOneToMany<StripePaymentRel>(...ids)\n\t}\n\n\n\ttype(): StripePaymentType {\n\t\treturn StripePayments.TYPE\n\t}\n\n}\n\n\nconst instance = new StripePayments()\nexport default instance\n\nexport type { StripePayment, StripePaymentCreate, StripePaymentUpdate, StripePaymentType }\n"]}
|
1
|
+
{"version":3,"sources":["../../src/resources/stripe_payments.ts"],"names":["ApiResource"],"mappings":";;;;AA2JA,MAAM,uBAAuBA,oBAA2B,CAAA;AAAA,EAEvD,OAAgB,IAA0B,GAAA,iBAAA;AAAA,EAE1C,MAAM,MAAA,CAAO,QAA+B,EAAA,MAAA,EAA6C,OAAmD,EAAA;AAC3I,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA2C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,cAAe,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC7H,EAEA,MAAM,MAAA,CAAO,QAA+B,EAAA,MAAA,EAA6C,OAAmD,EAAA;AAC3I,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA2C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,cAAe,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,O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AAA;AACzI,IAAA,OAAO,KAAK,SAAU,CAAA,MAAA,CAA2C,EAAE,EAAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,cAAe,CAAA,IAAA,EAAM,SAAS,IAAK,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AACxK,EAEA,MAAM,QAAA,CAAS,EAA4B,EAAA,MAAA,EAA6C,OAAmD,EAAA;AAC1I,IAAA,OAAO,KAAK,SAAU,CAAA,MAAA,CAA2C,EAAE,EAAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,cAAe,CAAA,IAAA,EAAM,UAAU,IAAK,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AACzK,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":"stripe_payments.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 { PaymentGateway } from './payment_gateways'\nimport type { Version } from './versions'\n\n\ntype StripePaymentType = 'stripe_payments'\ntype StripePaymentRel = ResourceRel & { type: StripePaymentType }\ntype OrderRel = ResourceRel & { type: OrderType }\n\n\nexport type StripePaymentSort = Pick<StripePayment, 'id'> & ResourceSort\n// export type StripePaymentFilter = Pick<StripePayment, 'id'> & ResourceFilter\n\n\ninterface StripePayment extends Resource {\n\t\n\treadonly type: StripePaymentType\n\n\t/** \n\t * The Stripe payment intent ID. Required to identify a payment session on stripe.\n\t * @example ```\"pi_1234XXX\"```\n\t */\n\tstripe_id?: string | null\n\t/** \n\t * The Stripe payment intent client secret. Required to create a charge through Stripe.js.\n\t * @example ```\"pi_1234XXX_secret_5678YYY\"```\n\t */\n\tclient_secret?: string | null\n\t/** \n\t * The account (if any) for which the funds of the PaymentIntent are intended.\n\t * @example ```\"acct_xxxx-yyyy-zzzz\"```\n\t */\n\tconnected_account?: string | null\n\t/** \n\t * The Stripe charge ID. Identifies money movement upon the payment intent confirmation.\n\t * @example ```\"ch_1234XXX\"```\n\t */\n\tcharge_id?: string | null\n\t/** \n\t * The Stripe publishable API key.\n\t * @example ```\"pk_live_xxxx-yyyy-zzzz\"```\n\t */\n\tpublishable_key?: string | null\n\t/** \n\t * The Stripe account ID that these funds are intended for.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\ton_behalf_of?: string | null\n\t/** \n\t * A string that identifies the resulting payment as part of a group.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\ttransfer_group?: string | null\n\t/** \n\t * Stripe payment options: 'customer', 'payment_method', 'return_url', etc. Check Stripe payment intent API for more details.\n\t * @example ```{\"customer\":\"cus_xxx\",\"payment_method\":\"pm_xxx\"}```\n\t */\n\toptions?: Record<string, any> | null\n\t/** \n\t * Stripe 'payment_method', set by webhook.\n\t * @example ```{\"id\":\"pm_xxx\"}```\n\t */\n\tpayment_method?: Record<string, any> | null\n\t/** \n\t * Indicates if the order current amount differs form the one of the created payment intent.\n\t */\n\tmismatched_amounts?: boolean | null\n\t/** \n\t * The URL to return to when a redirect payment is completed.\n\t * @example ```\"https://yourdomain.com/thankyou\"```\n\t */\n\treturn_url?: string | null\n\t/** \n\t * The email address to send the receipt to.\n\t * @example ```\"john@example.com\"```\n\t */\n\treceipt_email?: string | null\n\t/** \n\t * Information about the payment instrument used in the transaction.\n\t * @example ```{\"issuer\":\"cl bank\",\"card_type\":\"visa\"}```\n\t */\n\tpayment_instrument?: Record<string, any> | null\n\n\torder?: Order | null\n\tpayment_gateway?: PaymentGateway | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface StripePaymentCreate extends ResourceCreate {\n\t\n\t/** \n\t * The Stripe payment intent ID. Required to identify a payment session on stripe.\n\t * @example ```\"pi_1234XXX\"```\n\t */\n\tstripe_id?: string | null\n\t/** \n\t * The Stripe payment intent client secret. Required to create a charge through Stripe.js.\n\t * @example ```\"pi_1234XXX_secret_5678YYY\"```\n\t */\n\tclient_secret?: string | null\n\t/** \n\t * Stripe payment options: 'customer', 'payment_method', 'return_url', etc. Check Stripe payment intent API for more details.\n\t * @example ```{\"customer\":\"cus_xxx\",\"payment_method\":\"pm_xxx\"}```\n\t */\n\toptions?: Record<string, any> | null\n\t/** \n\t * The URL to return to when a redirect payment is completed.\n\t * @example ```\"https://yourdomain.com/thankyou\"```\n\t */\n\treturn_url?: string | null\n\t/** \n\t * The email address to send the receipt to.\n\t * @example ```\"john@example.com\"```\n\t */\n\treceipt_email?: string | null\n\n\torder: OrderRel\n\n}\n\n\ninterface StripePaymentUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * Stripe payment options: 'customer', 'payment_method', 'return_url', etc. Check Stripe payment intent API for more details.\n\t * @example ```{\"customer\":\"cus_xxx\",\"payment_method\":\"pm_xxx\"}```\n\t */\n\toptions?: Record<string, any> | null\n\t/** \n\t * The URL to return to when a redirect payment is completed.\n\t * @example ```\"https://yourdomain.com/thankyou\"```\n\t */\n\treturn_url?: string | null\n\t/** \n\t * Send this attribute if you want to update the created payment intent with fresh order data.\n\t * @example ```true```\n\t */\n\t_update?: boolean | null\n\t/** \n\t * Send this attribute if you want to refresh the payment status, can be used as webhooks fallback logic.\n\t * @example ```true```\n\t */\n\t_refresh?: boolean | null\n\n\torder?: OrderRel | null\n\n}\n\n\nclass StripePayments extends ApiResource<StripePayment> {\n\n\tstatic readonly TYPE: StripePaymentType = 'stripe_payments' as const\n\n\tasync create(resource: StripePaymentCreate, params?: QueryParamsRetrieve<StripePayment>, options?: ResourcesConfig): Promise<StripePayment> {\n\t\treturn this.resources.create<StripePaymentCreate, StripePayment>({ ...resource, type: StripePayments.TYPE }, params, options)\n\t}\n\n\tasync update(resource: StripePaymentUpdate, params?: QueryParamsRetrieve<StripePayment>, options?: ResourcesConfig): Promise<StripePayment> {\n\t\treturn this.resources.update<StripePaymentUpdate, StripePayment>({ ...resource, type: StripePayments.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: StripePayments.TYPE } : id, options)\n\t}\n\n\tasync order(stripePaymentId: string | StripePayment, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _stripePaymentId = (stripePaymentId as StripePayment).id || stripePaymentId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `stripe_payments/${_stripePaymentId}/order`, params, options) as unknown as Order\n\t}\n\n\tasync payment_gateway(stripePaymentId: string | StripePayment, params?: QueryParamsRetrieve<PaymentGateway>, options?: ResourcesConfig): Promise<PaymentGateway> {\n\t\tconst _stripePaymentId = (stripePaymentId as StripePayment).id || stripePaymentId as string\n\t\treturn this.resources.fetch<PaymentGateway>({ type: 'payment_gateways' }, `stripe_payments/${_stripePaymentId}/payment_gateway`, params, options) as unknown as PaymentGateway\n\t}\n\n\tasync versions(stripePaymentId: string | StripePayment, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _stripePaymentId = (stripePaymentId as StripePayment).id || stripePaymentId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `stripe_payments/${_stripePaymentId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync _update(id: string | StripePayment, params?: QueryParamsRetrieve<StripePayment>, options?: ResourcesConfig): Promise<StripePayment> {\n\t\treturn this.resources.update<StripePaymentUpdate, StripePayment>({ id: (typeof id === 'string')? id: id.id, type: StripePayments.TYPE, _update: true }, params, options)\n\t}\n\n\tasync _refresh(id: string | StripePayment, params?: QueryParamsRetrieve<StripePayment>, options?: ResourcesConfig): Promise<StripePayment> {\n\t\treturn this.resources.update<StripePaymentUpdate, StripePayment>({ id: (typeof id === 'string')? id: id.id, type: StripePayments.TYPE, _refresh: true }, params, options)\n\t}\n\n\n\tisStripePayment(resource: any): resource is StripePayment {\n\t\treturn resource.type && (resource.type === StripePayments.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): StripePaymentRel {\n\t\treturn super.relationshipOneToOne<StripePaymentRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): StripePaymentRel[] {\n\t\treturn super.relationshipOneToMany<StripePaymentRel>(...ids)\n\t}\n\n\n\ttype(): StripePaymentType {\n\t\treturn StripePayments.TYPE\n\t}\n\n}\n\n\nconst instance = new StripePayments()\nexport default instance\n\nexport type { StripePayments, StripePayment, StripePaymentCreate, StripePaymentUpdate, StripePaymentType }\n"]}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export {
|
1
|
+
export { kC as StripePayment, kD as StripePaymentCreate, kF as StripePaymentSort, lN as StripePaymentType, kE as StripePaymentUpdate, dp as StripePayments, dn 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 { kC as StripePayment, kD as StripePaymentCreate, kF as StripePaymentSort, lN as StripePaymentType, kE as StripePaymentUpdate, dp as StripePayments, dn as default } from '../api-F1F37Dud.js';
|
2
2
|
import '../client.js';
|
3
|
-
import '../interceptor-
|
3
|
+
import '../interceptor-k15jXzf0.js';
|
4
4
|
import '../types.js';
|