@commercelayer/sdk 7.0.0-rc.2 → 7.0.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/lib/{api-DDgIE2i8.d.ts → api-F1F37Dud.d.ts} +27 -8
- package/lib/{api-DmIZO_Np.d.cts → api-IwWtsAqE.d.cts} +27 -8
- package/lib/api.d.cts +2 -2
- package/lib/api.d.ts +2 -2
- package/lib/bundle.cjs +568 -0
- package/lib/bundle.cjs.map +1 -0
- package/lib/bundle.d.cts +145 -0
- package/lib/bundle.d.ts +145 -0
- package/lib/bundle.js +546 -0
- package/lib/bundle.js.map +1 -0
- package/lib/client.d.cts +1 -1
- package/lib/client.d.ts +1 -1
- package/lib/commercelayer.cjs +2 -1
- package/lib/commercelayer.cjs.map +1 -1
- package/lib/commercelayer.d.cts +5 -6
- package/lib/commercelayer.d.ts +5 -6
- package/lib/commercelayer.js +2 -2
- package/lib/commercelayer.js.map +1 -1
- package/lib/config.d.cts +1 -1
- package/lib/config.d.ts +1 -1
- package/lib/enum.d.cts +2 -2
- package/lib/enum.d.ts +2 -2
- package/lib/error.cjs.map +1 -1
- package/lib/error.js.map +1 -1
- package/lib/fetch.cjs +2 -0
- package/lib/fetch.cjs.map +1 -1
- package/lib/fetch.d.cts +1 -1
- package/lib/fetch.d.ts +1 -1
- package/lib/fetch.js +2 -0
- package/lib/fetch.js.map +1 -1
- package/lib/index.d.cts +2 -2
- package/lib/index.d.ts +2 -2
- package/lib/{interceptor-5MISI1yn.d.cts → interceptor-k15jXzf0.d.cts} +3 -2
- package/lib/{interceptor-5MISI1yn.d.ts → interceptor-k15jXzf0.d.ts} +3 -2
- package/lib/interceptor.d.cts +1 -1
- package/lib/interceptor.d.ts +1 -1
- package/lib/jsonapi.d.cts +2 -2
- package/lib/jsonapi.d.ts +2 -2
- package/lib/model.d.cts +2 -2
- package/lib/model.d.ts +2 -2
- package/lib/query.d.cts +2 -2
- package/lib/query.d.ts +2 -2
- package/lib/resource.cjs +7 -6
- package/lib/resource.cjs.map +1 -1
- package/lib/resource.d.cts +2 -2
- package/lib/resource.d.ts +2 -2
- package/lib/resource.js +7 -6
- package/lib/resource.js.map +1 -1
- package/lib/resources/addresses.cjs.map +1 -1
- package/lib/resources/addresses.d.cts +2 -2
- package/lib/resources/addresses.d.ts +2 -2
- package/lib/resources/addresses.js.map +1 -1
- package/lib/resources/adjustments.cjs.map +1 -1
- package/lib/resources/adjustments.d.cts +2 -2
- package/lib/resources/adjustments.d.ts +2 -2
- package/lib/resources/adjustments.js.map +1 -1
- package/lib/resources/adyen_gateways.cjs.map +1 -1
- package/lib/resources/adyen_gateways.d.cts +2 -2
- package/lib/resources/adyen_gateways.d.ts +2 -2
- package/lib/resources/adyen_gateways.js.map +1 -1
- package/lib/resources/adyen_payments.cjs.map +1 -1
- package/lib/resources/adyen_payments.d.cts +2 -2
- package/lib/resources/adyen_payments.d.ts +2 -2
- package/lib/resources/adyen_payments.js.map +1 -1
- package/lib/resources/applications.cjs.map +1 -1
- package/lib/resources/applications.d.cts +2 -2
- package/lib/resources/applications.d.ts +2 -2
- package/lib/resources/applications.js.map +1 -1
- package/lib/resources/attachments.cjs.map +1 -1
- package/lib/resources/attachments.d.cts +2 -2
- package/lib/resources/attachments.d.ts +2 -2
- package/lib/resources/attachments.js.map +1 -1
- package/lib/resources/authorizations.cjs.map +1 -1
- package/lib/resources/authorizations.d.cts +2 -2
- package/lib/resources/authorizations.d.ts +2 -2
- package/lib/resources/authorizations.js.map +1 -1
- package/lib/resources/avalara_accounts.cjs.map +1 -1
- package/lib/resources/avalara_accounts.d.cts +2 -2
- package/lib/resources/avalara_accounts.d.ts +2 -2
- package/lib/resources/avalara_accounts.js.map +1 -1
- package/lib/resources/axerve_gateways.cjs.map +1 -1
- package/lib/resources/axerve_gateways.d.cts +2 -2
- package/lib/resources/axerve_gateways.d.ts +2 -2
- package/lib/resources/axerve_gateways.js.map +1 -1
- package/lib/resources/axerve_payments.cjs.map +1 -1
- package/lib/resources/axerve_payments.d.cts +2 -2
- package/lib/resources/axerve_payments.d.ts +2 -2
- package/lib/resources/axerve_payments.js.map +1 -1
- package/lib/resources/bing_geocoders.cjs.map +1 -1
- package/lib/resources/bing_geocoders.d.cts +2 -2
- package/lib/resources/bing_geocoders.d.ts +2 -2
- package/lib/resources/bing_geocoders.js.map +1 -1
- package/lib/resources/braintree_gateways.cjs.map +1 -1
- package/lib/resources/braintree_gateways.d.cts +2 -2
- package/lib/resources/braintree_gateways.d.ts +2 -2
- package/lib/resources/braintree_gateways.js.map +1 -1
- package/lib/resources/braintree_payments.cjs.map +1 -1
- package/lib/resources/braintree_payments.d.cts +2 -2
- package/lib/resources/braintree_payments.d.ts +2 -2
- package/lib/resources/braintree_payments.js.map +1 -1
- package/lib/resources/bundles.cjs.map +1 -1
- package/lib/resources/bundles.d.cts +2 -2
- package/lib/resources/bundles.d.ts +2 -2
- package/lib/resources/bundles.js.map +1 -1
- package/lib/resources/buy_x_pay_y_promotions.cjs.map +1 -1
- package/lib/resources/buy_x_pay_y_promotions.d.cts +2 -2
- package/lib/resources/buy_x_pay_y_promotions.d.ts +2 -2
- package/lib/resources/buy_x_pay_y_promotions.js.map +1 -1
- package/lib/resources/captures.cjs.map +1 -1
- package/lib/resources/captures.d.cts +2 -2
- package/lib/resources/captures.d.ts +2 -2
- package/lib/resources/captures.js.map +1 -1
- package/lib/resources/carrier_accounts.cjs.map +1 -1
- package/lib/resources/carrier_accounts.d.cts +2 -2
- package/lib/resources/carrier_accounts.d.ts +2 -2
- package/lib/resources/carrier_accounts.js.map +1 -1
- package/lib/resources/checkout_com_gateways.cjs.map +1 -1
- package/lib/resources/checkout_com_gateways.d.cts +2 -2
- package/lib/resources/checkout_com_gateways.d.ts +2 -2
- package/lib/resources/checkout_com_gateways.js.map +1 -1
- package/lib/resources/checkout_com_payments.cjs.map +1 -1
- package/lib/resources/checkout_com_payments.d.cts +2 -2
- package/lib/resources/checkout_com_payments.d.ts +2 -2
- package/lib/resources/checkout_com_payments.js.map +1 -1
- package/lib/resources/cleanups.cjs.map +1 -1
- package/lib/resources/cleanups.d.cts +2 -2
- package/lib/resources/cleanups.d.ts +2 -2
- package/lib/resources/cleanups.js.map +1 -1
- package/lib/resources/coupon_codes_promotion_rules.cjs.map +1 -1
- package/lib/resources/coupon_codes_promotion_rules.d.cts +2 -2
- package/lib/resources/coupon_codes_promotion_rules.d.ts +2 -2
- package/lib/resources/coupon_codes_promotion_rules.js.map +1 -1
- package/lib/resources/coupon_recipients.cjs.map +1 -1
- package/lib/resources/coupon_recipients.d.cts +2 -2
- package/lib/resources/coupon_recipients.d.ts +2 -2
- package/lib/resources/coupon_recipients.js.map +1 -1
- package/lib/resources/coupons.cjs.map +1 -1
- package/lib/resources/coupons.d.cts +2 -2
- package/lib/resources/coupons.d.ts +2 -2
- package/lib/resources/coupons.js.map +1 -1
- package/lib/resources/custom_promotion_rules.cjs.map +1 -1
- package/lib/resources/custom_promotion_rules.d.cts +2 -2
- package/lib/resources/custom_promotion_rules.d.ts +2 -2
- package/lib/resources/custom_promotion_rules.js.map +1 -1
- package/lib/resources/customer_addresses.cjs.map +1 -1
- package/lib/resources/customer_addresses.d.cts +2 -2
- package/lib/resources/customer_addresses.d.ts +2 -2
- package/lib/resources/customer_addresses.js.map +1 -1
- package/lib/resources/customer_groups.cjs.map +1 -1
- package/lib/resources/customer_groups.d.cts +2 -2
- package/lib/resources/customer_groups.d.ts +2 -2
- package/lib/resources/customer_groups.js.map +1 -1
- package/lib/resources/customer_password_resets.cjs.map +1 -1
- package/lib/resources/customer_password_resets.d.cts +2 -2
- package/lib/resources/customer_password_resets.d.ts +2 -2
- package/lib/resources/customer_password_resets.js.map +1 -1
- package/lib/resources/customer_payment_sources.cjs.map +1 -1
- package/lib/resources/customer_payment_sources.d.cts +2 -2
- package/lib/resources/customer_payment_sources.d.ts +2 -2
- package/lib/resources/customer_payment_sources.js.map +1 -1
- package/lib/resources/customer_subscriptions.cjs.map +1 -1
- package/lib/resources/customer_subscriptions.d.cts +2 -2
- package/lib/resources/customer_subscriptions.d.ts +2 -2
- package/lib/resources/customer_subscriptions.js.map +1 -1
- package/lib/resources/customers.cjs.map +1 -1
- package/lib/resources/customers.d.cts +2 -2
- package/lib/resources/customers.d.ts +2 -2
- package/lib/resources/customers.js.map +1 -1
- package/lib/resources/delivery_lead_times.cjs.map +1 -1
- package/lib/resources/delivery_lead_times.d.cts +2 -2
- package/lib/resources/delivery_lead_times.d.ts +2 -2
- package/lib/resources/delivery_lead_times.js.map +1 -1
- package/lib/resources/discount_engine_items.cjs.map +1 -1
- package/lib/resources/discount_engine_items.d.cts +2 -2
- package/lib/resources/discount_engine_items.d.ts +2 -2
- package/lib/resources/discount_engine_items.js.map +1 -1
- package/lib/resources/discount_engines.cjs.map +1 -1
- package/lib/resources/discount_engines.d.cts +2 -2
- package/lib/resources/discount_engines.d.ts +2 -2
- package/lib/resources/discount_engines.js.map +1 -1
- package/lib/resources/easypost_pickups.cjs.map +1 -1
- package/lib/resources/easypost_pickups.d.cts +2 -2
- package/lib/resources/easypost_pickups.d.ts +2 -2
- package/lib/resources/easypost_pickups.js.map +1 -1
- package/lib/resources/event_callbacks.cjs.map +1 -1
- package/lib/resources/event_callbacks.d.cts +2 -2
- package/lib/resources/event_callbacks.d.ts +2 -2
- package/lib/resources/event_callbacks.js.map +1 -1
- package/lib/resources/events.cjs.map +1 -1
- package/lib/resources/events.d.cts +2 -2
- package/lib/resources/events.d.ts +2 -2
- package/lib/resources/events.js.map +1 -1
- package/lib/resources/exports.cjs.map +1 -1
- package/lib/resources/exports.d.cts +2 -2
- package/lib/resources/exports.d.ts +2 -2
- package/lib/resources/exports.js.map +1 -1
- package/lib/resources/external_gateways.cjs.map +1 -1
- package/lib/resources/external_gateways.d.cts +2 -2
- package/lib/resources/external_gateways.d.ts +2 -2
- package/lib/resources/external_gateways.js.map +1 -1
- package/lib/resources/external_payments.cjs.map +1 -1
- package/lib/resources/external_payments.d.cts +2 -2
- package/lib/resources/external_payments.d.ts +2 -2
- package/lib/resources/external_payments.js.map +1 -1
- package/lib/resources/external_promotions.cjs.map +1 -1
- package/lib/resources/external_promotions.d.cts +2 -2
- package/lib/resources/external_promotions.d.ts +2 -2
- package/lib/resources/external_promotions.js.map +1 -1
- package/lib/resources/external_tax_calculators.cjs.map +1 -1
- package/lib/resources/external_tax_calculators.d.cts +2 -2
- package/lib/resources/external_tax_calculators.d.ts +2 -2
- package/lib/resources/external_tax_calculators.js.map +1 -1
- package/lib/resources/fixed_amount_promotions.cjs.map +1 -1
- package/lib/resources/fixed_amount_promotions.d.cts +2 -2
- package/lib/resources/fixed_amount_promotions.d.ts +2 -2
- package/lib/resources/fixed_amount_promotions.js.map +1 -1
- package/lib/resources/fixed_price_promotions.cjs.map +1 -1
- package/lib/resources/fixed_price_promotions.d.cts +2 -2
- package/lib/resources/fixed_price_promotions.d.ts +2 -2
- package/lib/resources/fixed_price_promotions.js.map +1 -1
- package/lib/resources/flex_promotions.cjs.map +1 -1
- package/lib/resources/flex_promotions.d.cts +2 -2
- package/lib/resources/flex_promotions.d.ts +2 -2
- package/lib/resources/flex_promotions.js.map +1 -1
- package/lib/resources/free_gift_promotions.cjs.map +1 -1
- package/lib/resources/free_gift_promotions.d.cts +2 -2
- package/lib/resources/free_gift_promotions.d.ts +2 -2
- package/lib/resources/free_gift_promotions.js.map +1 -1
- package/lib/resources/free_shipping_promotions.cjs.map +1 -1
- package/lib/resources/free_shipping_promotions.d.cts +2 -2
- package/lib/resources/free_shipping_promotions.d.ts +2 -2
- package/lib/resources/free_shipping_promotions.js.map +1 -1
- package/lib/resources/geocoders.cjs.map +1 -1
- package/lib/resources/geocoders.d.cts +2 -2
- package/lib/resources/geocoders.d.ts +2 -2
- package/lib/resources/geocoders.js.map +1 -1
- package/lib/resources/gift_card_recipients.cjs.map +1 -1
- package/lib/resources/gift_card_recipients.d.cts +2 -2
- package/lib/resources/gift_card_recipients.d.ts +2 -2
- package/lib/resources/gift_card_recipients.js.map +1 -1
- package/lib/resources/gift_cards.cjs.map +1 -1
- package/lib/resources/gift_cards.d.cts +2 -2
- package/lib/resources/gift_cards.d.ts +2 -2
- package/lib/resources/gift_cards.js.map +1 -1
- package/lib/resources/google_geocoders.cjs.map +1 -1
- package/lib/resources/google_geocoders.d.cts +2 -2
- package/lib/resources/google_geocoders.d.ts +2 -2
- package/lib/resources/google_geocoders.js.map +1 -1
- package/lib/resources/imports.cjs.map +1 -1
- package/lib/resources/imports.d.cts +2 -2
- package/lib/resources/imports.d.ts +2 -2
- package/lib/resources/imports.js.map +1 -1
- package/lib/resources/in_stock_subscriptions.cjs.map +1 -1
- package/lib/resources/in_stock_subscriptions.d.cts +2 -2
- package/lib/resources/in_stock_subscriptions.d.ts +2 -2
- package/lib/resources/in_stock_subscriptions.js.map +1 -1
- package/lib/resources/inventory_models.cjs.map +1 -1
- package/lib/resources/inventory_models.d.cts +2 -2
- package/lib/resources/inventory_models.d.ts +2 -2
- package/lib/resources/inventory_models.js.map +1 -1
- package/lib/resources/inventory_return_locations.cjs.map +1 -1
- package/lib/resources/inventory_return_locations.d.cts +2 -2
- package/lib/resources/inventory_return_locations.d.ts +2 -2
- package/lib/resources/inventory_return_locations.js.map +1 -1
- package/lib/resources/inventory_stock_locations.cjs.map +1 -1
- package/lib/resources/inventory_stock_locations.d.cts +2 -2
- package/lib/resources/inventory_stock_locations.d.ts +2 -2
- package/lib/resources/inventory_stock_locations.js.map +1 -1
- package/lib/resources/klarna_gateways.cjs.map +1 -1
- package/lib/resources/klarna_gateways.d.cts +2 -2
- package/lib/resources/klarna_gateways.d.ts +2 -2
- package/lib/resources/klarna_gateways.js.map +1 -1
- package/lib/resources/klarna_payments.cjs.map +1 -1
- package/lib/resources/klarna_payments.d.cts +2 -2
- package/lib/resources/klarna_payments.d.ts +2 -2
- package/lib/resources/klarna_payments.js.map +1 -1
- package/lib/resources/line_item_options.cjs.map +1 -1
- package/lib/resources/line_item_options.d.cts +2 -2
- package/lib/resources/line_item_options.d.ts +2 -2
- package/lib/resources/line_item_options.js.map +1 -1
- package/lib/resources/line_items.cjs.map +1 -1
- package/lib/resources/line_items.d.cts +2 -2
- package/lib/resources/line_items.d.ts +2 -2
- package/lib/resources/line_items.js.map +1 -1
- package/lib/resources/links.cjs.map +1 -1
- package/lib/resources/links.d.cts +2 -2
- package/lib/resources/links.d.ts +2 -2
- package/lib/resources/links.js.map +1 -1
- package/lib/resources/manual_gateways.cjs.map +1 -1
- package/lib/resources/manual_gateways.d.cts +2 -2
- package/lib/resources/manual_gateways.d.ts +2 -2
- package/lib/resources/manual_gateways.js.map +1 -1
- package/lib/resources/manual_tax_calculators.cjs.map +1 -1
- package/lib/resources/manual_tax_calculators.d.cts +2 -2
- package/lib/resources/manual_tax_calculators.d.ts +2 -2
- package/lib/resources/manual_tax_calculators.js.map +1 -1
- package/lib/resources/markets.cjs +4 -0
- package/lib/resources/markets.cjs.map +1 -1
- package/lib/resources/markets.d.cts +2 -2
- package/lib/resources/markets.d.ts +2 -2
- package/lib/resources/markets.js +4 -0
- package/lib/resources/markets.js.map +1 -1
- package/lib/resources/merchants.cjs.map +1 -1
- package/lib/resources/merchants.d.cts +2 -2
- package/lib/resources/merchants.d.ts +2 -2
- package/lib/resources/merchants.js.map +1 -1
- package/lib/resources/notifications.cjs.map +1 -1
- package/lib/resources/notifications.d.cts +2 -2
- package/lib/resources/notifications.d.ts +2 -2
- package/lib/resources/notifications.js.map +1 -1
- package/lib/resources/order_amount_promotion_rules.cjs.map +1 -1
- package/lib/resources/order_amount_promotion_rules.d.cts +2 -2
- package/lib/resources/order_amount_promotion_rules.d.ts +2 -2
- package/lib/resources/order_amount_promotion_rules.js.map +1 -1
- package/lib/resources/order_copies.cjs.map +1 -1
- package/lib/resources/order_copies.d.cts +2 -2
- package/lib/resources/order_copies.d.ts +2 -2
- package/lib/resources/order_copies.js.map +1 -1
- package/lib/resources/order_factories.cjs.map +1 -1
- package/lib/resources/order_factories.d.cts +2 -2
- package/lib/resources/order_factories.d.ts +2 -2
- package/lib/resources/order_factories.js.map +1 -1
- package/lib/resources/order_subscription_items.cjs.map +1 -1
- package/lib/resources/order_subscription_items.d.cts +2 -2
- package/lib/resources/order_subscription_items.d.ts +2 -2
- package/lib/resources/order_subscription_items.js.map +1 -1
- package/lib/resources/order_subscriptions.cjs.map +1 -1
- package/lib/resources/order_subscriptions.d.cts +2 -2
- package/lib/resources/order_subscriptions.d.ts +2 -2
- package/lib/resources/order_subscriptions.js.map +1 -1
- package/lib/resources/orders.cjs +4 -0
- package/lib/resources/orders.cjs.map +1 -1
- package/lib/resources/orders.d.cts +2 -2
- package/lib/resources/orders.d.ts +2 -2
- package/lib/resources/orders.js +4 -0
- package/lib/resources/orders.js.map +1 -1
- package/lib/resources/organizations.cjs.map +1 -1
- package/lib/resources/organizations.d.cts +2 -2
- package/lib/resources/organizations.d.ts +2 -2
- package/lib/resources/organizations.js.map +1 -1
- package/lib/resources/packages.cjs.map +1 -1
- package/lib/resources/packages.d.cts +2 -2
- package/lib/resources/packages.d.ts +2 -2
- package/lib/resources/packages.js.map +1 -1
- package/lib/resources/parcel_line_items.cjs.map +1 -1
- package/lib/resources/parcel_line_items.d.cts +2 -2
- package/lib/resources/parcel_line_items.d.ts +2 -2
- package/lib/resources/parcel_line_items.js.map +1 -1
- package/lib/resources/parcels.cjs.map +1 -1
- package/lib/resources/parcels.d.cts +2 -2
- package/lib/resources/parcels.d.ts +2 -2
- package/lib/resources/parcels.js.map +1 -1
- package/lib/resources/payment_gateways.cjs.map +1 -1
- package/lib/resources/payment_gateways.d.cts +2 -2
- package/lib/resources/payment_gateways.d.ts +2 -2
- package/lib/resources/payment_gateways.js.map +1 -1
- package/lib/resources/payment_methods.cjs.map +1 -1
- package/lib/resources/payment_methods.d.cts +2 -2
- package/lib/resources/payment_methods.d.ts +2 -2
- package/lib/resources/payment_methods.js.map +1 -1
- package/lib/resources/payment_options.cjs.map +1 -1
- package/lib/resources/payment_options.d.cts +2 -2
- package/lib/resources/payment_options.d.ts +2 -2
- package/lib/resources/payment_options.js.map +1 -1
- package/lib/resources/paypal_gateways.cjs.map +1 -1
- package/lib/resources/paypal_gateways.d.cts +2 -2
- package/lib/resources/paypal_gateways.d.ts +2 -2
- package/lib/resources/paypal_gateways.js.map +1 -1
- package/lib/resources/paypal_payments.cjs.map +1 -1
- package/lib/resources/paypal_payments.d.cts +2 -2
- package/lib/resources/paypal_payments.d.ts +2 -2
- package/lib/resources/paypal_payments.js.map +1 -1
- package/lib/resources/percentage_discount_promotions.cjs.map +1 -1
- package/lib/resources/percentage_discount_promotions.d.cts +2 -2
- package/lib/resources/percentage_discount_promotions.d.ts +2 -2
- package/lib/resources/percentage_discount_promotions.js.map +1 -1
- package/lib/resources/pickups.cjs.map +1 -1
- package/lib/resources/pickups.d.cts +2 -2
- package/lib/resources/pickups.d.ts +2 -2
- package/lib/resources/pickups.js.map +1 -1
- package/lib/resources/price_frequency_tiers.cjs.map +1 -1
- package/lib/resources/price_frequency_tiers.d.cts +2 -2
- package/lib/resources/price_frequency_tiers.d.ts +2 -2
- package/lib/resources/price_frequency_tiers.js.map +1 -1
- package/lib/resources/price_list_schedulers.cjs.map +1 -1
- package/lib/resources/price_list_schedulers.d.cts +2 -2
- package/lib/resources/price_list_schedulers.d.ts +2 -2
- package/lib/resources/price_list_schedulers.js.map +1 -1
- package/lib/resources/price_lists.cjs.map +1 -1
- package/lib/resources/price_lists.d.cts +2 -2
- package/lib/resources/price_lists.d.ts +2 -2
- package/lib/resources/price_lists.js.map +1 -1
- package/lib/resources/price_tiers.cjs.map +1 -1
- package/lib/resources/price_tiers.d.cts +2 -2
- package/lib/resources/price_tiers.d.ts +2 -2
- package/lib/resources/price_tiers.js.map +1 -1
- package/lib/resources/price_volume_tiers.cjs.map +1 -1
- package/lib/resources/price_volume_tiers.d.cts +2 -2
- package/lib/resources/price_volume_tiers.d.ts +2 -2
- package/lib/resources/price_volume_tiers.js.map +1 -1
- package/lib/resources/prices.cjs.map +1 -1
- package/lib/resources/prices.d.cts +2 -2
- package/lib/resources/prices.d.ts +2 -2
- package/lib/resources/prices.js.map +1 -1
- package/lib/resources/promotion_rules.cjs.map +1 -1
- package/lib/resources/promotion_rules.d.cts +2 -2
- package/lib/resources/promotion_rules.d.ts +2 -2
- package/lib/resources/promotion_rules.js.map +1 -1
- package/lib/resources/promotions.cjs.map +1 -1
- package/lib/resources/promotions.d.cts +2 -2
- package/lib/resources/promotions.d.ts +2 -2
- package/lib/resources/promotions.js.map +1 -1
- package/lib/resources/recurring_order_copies.cjs.map +1 -1
- package/lib/resources/recurring_order_copies.d.cts +2 -2
- package/lib/resources/recurring_order_copies.d.ts +2 -2
- package/lib/resources/recurring_order_copies.js.map +1 -1
- package/lib/resources/refunds.cjs.map +1 -1
- package/lib/resources/refunds.d.cts +2 -2
- package/lib/resources/refunds.d.ts +2 -2
- package/lib/resources/refunds.js.map +1 -1
- package/lib/resources/reserved_stocks.cjs.map +1 -1
- package/lib/resources/reserved_stocks.d.cts +2 -2
- package/lib/resources/reserved_stocks.d.ts +2 -2
- package/lib/resources/reserved_stocks.js.map +1 -1
- package/lib/resources/resource_errors.cjs.map +1 -1
- package/lib/resources/resource_errors.d.cts +2 -2
- package/lib/resources/resource_errors.d.ts +2 -2
- package/lib/resources/resource_errors.js.map +1 -1
- package/lib/resources/return_line_items.cjs.map +1 -1
- package/lib/resources/return_line_items.d.cts +2 -2
- package/lib/resources/return_line_items.d.ts +2 -2
- package/lib/resources/return_line_items.js.map +1 -1
- package/lib/resources/returns.cjs.map +1 -1
- package/lib/resources/returns.d.cts +2 -2
- package/lib/resources/returns.d.ts +2 -2
- package/lib/resources/returns.js.map +1 -1
- package/lib/resources/satispay_gateways.cjs.map +1 -1
- package/lib/resources/satispay_gateways.d.cts +2 -2
- package/lib/resources/satispay_gateways.d.ts +2 -2
- package/lib/resources/satispay_gateways.js.map +1 -1
- package/lib/resources/satispay_payments.cjs.map +1 -1
- package/lib/resources/satispay_payments.d.cts +2 -2
- package/lib/resources/satispay_payments.d.ts +2 -2
- package/lib/resources/satispay_payments.js.map +1 -1
- package/lib/resources/shipments.cjs.map +1 -1
- package/lib/resources/shipments.d.cts +2 -2
- package/lib/resources/shipments.d.ts +2 -2
- package/lib/resources/shipments.js.map +1 -1
- package/lib/resources/shipping_categories.cjs.map +1 -1
- package/lib/resources/shipping_categories.d.cts +2 -2
- package/lib/resources/shipping_categories.d.ts +2 -2
- package/lib/resources/shipping_categories.js.map +1 -1
- package/lib/resources/shipping_method_tiers.cjs.map +1 -1
- package/lib/resources/shipping_method_tiers.d.cts +2 -2
- package/lib/resources/shipping_method_tiers.d.ts +2 -2
- package/lib/resources/shipping_method_tiers.js.map +1 -1
- package/lib/resources/shipping_methods.cjs.map +1 -1
- package/lib/resources/shipping_methods.d.cts +2 -2
- package/lib/resources/shipping_methods.d.ts +2 -2
- package/lib/resources/shipping_methods.js.map +1 -1
- package/lib/resources/shipping_weight_tiers.cjs.map +1 -1
- package/lib/resources/shipping_weight_tiers.d.cts +2 -2
- package/lib/resources/shipping_weight_tiers.d.ts +2 -2
- package/lib/resources/shipping_weight_tiers.js.map +1 -1
- package/lib/resources/shipping_zones.cjs.map +1 -1
- package/lib/resources/shipping_zones.d.cts +2 -2
- package/lib/resources/shipping_zones.d.ts +2 -2
- package/lib/resources/shipping_zones.js.map +1 -1
- package/lib/resources/sku_list_items.cjs.map +1 -1
- package/lib/resources/sku_list_items.d.cts +2 -2
- package/lib/resources/sku_list_items.d.ts +2 -2
- package/lib/resources/sku_list_items.js.map +1 -1
- package/lib/resources/sku_list_promotion_rules.cjs.map +1 -1
- package/lib/resources/sku_list_promotion_rules.d.cts +2 -2
- package/lib/resources/sku_list_promotion_rules.d.ts +2 -2
- package/lib/resources/sku_list_promotion_rules.js.map +1 -1
- package/lib/resources/sku_lists.cjs.map +1 -1
- package/lib/resources/sku_lists.d.cts +2 -2
- package/lib/resources/sku_lists.d.ts +2 -2
- package/lib/resources/sku_lists.js.map +1 -1
- package/lib/resources/sku_options.cjs.map +1 -1
- package/lib/resources/sku_options.d.cts +2 -2
- package/lib/resources/sku_options.d.ts +2 -2
- package/lib/resources/sku_options.js.map +1 -1
- package/lib/resources/skus.cjs.map +1 -1
- package/lib/resources/skus.d.cts +2 -2
- package/lib/resources/skus.d.ts +2 -2
- package/lib/resources/skus.js.map +1 -1
- package/lib/resources/stock_items.cjs.map +1 -1
- package/lib/resources/stock_items.d.cts +2 -2
- package/lib/resources/stock_items.d.ts +2 -2
- package/lib/resources/stock_items.js.map +1 -1
- package/lib/resources/stock_line_items.cjs.map +1 -1
- package/lib/resources/stock_line_items.d.cts +2 -2
- package/lib/resources/stock_line_items.d.ts +2 -2
- package/lib/resources/stock_line_items.js.map +1 -1
- package/lib/resources/stock_locations.cjs.map +1 -1
- package/lib/resources/stock_locations.d.cts +2 -2
- package/lib/resources/stock_locations.d.ts +2 -2
- package/lib/resources/stock_locations.js.map +1 -1
- package/lib/resources/stock_reservations.cjs.map +1 -1
- package/lib/resources/stock_reservations.d.cts +2 -2
- package/lib/resources/stock_reservations.d.ts +2 -2
- package/lib/resources/stock_reservations.js.map +1 -1
- package/lib/resources/stock_transfers.cjs.map +1 -1
- package/lib/resources/stock_transfers.d.cts +2 -2
- package/lib/resources/stock_transfers.d.ts +2 -2
- package/lib/resources/stock_transfers.js.map +1 -1
- package/lib/resources/stores.cjs.map +1 -1
- package/lib/resources/stores.d.cts +2 -2
- package/lib/resources/stores.d.ts +2 -2
- package/lib/resources/stores.js.map +1 -1
- package/lib/resources/stripe_gateways.cjs.map +1 -1
- package/lib/resources/stripe_gateways.d.cts +2 -2
- package/lib/resources/stripe_gateways.d.ts +2 -2
- package/lib/resources/stripe_gateways.js.map +1 -1
- package/lib/resources/stripe_payments.cjs.map +1 -1
- package/lib/resources/stripe_payments.d.cts +2 -2
- package/lib/resources/stripe_payments.d.ts +2 -2
- package/lib/resources/stripe_payments.js.map +1 -1
- package/lib/resources/stripe_tax_accounts.cjs.map +1 -1
- package/lib/resources/stripe_tax_accounts.d.cts +2 -2
- package/lib/resources/stripe_tax_accounts.d.ts +2 -2
- package/lib/resources/stripe_tax_accounts.js.map +1 -1
- package/lib/resources/subscription_models.cjs.map +1 -1
- package/lib/resources/subscription_models.d.cts +2 -2
- package/lib/resources/subscription_models.d.ts +2 -2
- package/lib/resources/subscription_models.js.map +1 -1
- package/lib/resources/tags.cjs.map +1 -1
- package/lib/resources/tags.d.cts +2 -2
- package/lib/resources/tags.d.ts +2 -2
- package/lib/resources/tags.js.map +1 -1
- package/lib/resources/talon_one_accounts.cjs.map +1 -1
- package/lib/resources/talon_one_accounts.d.cts +2 -2
- package/lib/resources/talon_one_accounts.d.ts +2 -2
- package/lib/resources/talon_one_accounts.js.map +1 -1
- package/lib/resources/tax_calculators.cjs.map +1 -1
- package/lib/resources/tax_calculators.d.cts +2 -2
- package/lib/resources/tax_calculators.d.ts +2 -2
- package/lib/resources/tax_calculators.js.map +1 -1
- package/lib/resources/tax_categories.cjs.map +1 -1
- package/lib/resources/tax_categories.d.cts +2 -2
- package/lib/resources/tax_categories.d.ts +2 -2
- package/lib/resources/tax_categories.js.map +1 -1
- package/lib/resources/tax_rules.cjs.map +1 -1
- package/lib/resources/tax_rules.d.cts +2 -2
- package/lib/resources/tax_rules.d.ts +2 -2
- package/lib/resources/tax_rules.js.map +1 -1
- package/lib/resources/taxjar_accounts.cjs.map +1 -1
- package/lib/resources/taxjar_accounts.d.cts +2 -2
- package/lib/resources/taxjar_accounts.d.ts +2 -2
- package/lib/resources/taxjar_accounts.js.map +1 -1
- package/lib/resources/transactions.cjs.map +1 -1
- package/lib/resources/transactions.d.cts +2 -2
- package/lib/resources/transactions.d.ts +2 -2
- package/lib/resources/transactions.js.map +1 -1
- package/lib/resources/versions.cjs.map +1 -1
- package/lib/resources/versions.d.cts +2 -2
- package/lib/resources/versions.d.ts +2 -2
- package/lib/resources/versions.js.map +1 -1
- package/lib/resources/vertex_accounts.cjs.map +1 -1
- package/lib/resources/vertex_accounts.d.cts +2 -2
- package/lib/resources/vertex_accounts.d.ts +2 -2
- package/lib/resources/vertex_accounts.js.map +1 -1
- package/lib/resources/voids.cjs.map +1 -1
- package/lib/resources/voids.d.cts +2 -2
- package/lib/resources/voids.d.ts +2 -2
- package/lib/resources/voids.js.map +1 -1
- package/lib/resources/webhooks.cjs.map +1 -1
- package/lib/resources/webhooks.d.cts +2 -2
- package/lib/resources/webhooks.d.ts +2 -2
- package/lib/resources/webhooks.js.map +1 -1
- package/lib/resources/wire_transfers.cjs.map +1 -1
- package/lib/resources/wire_transfers.d.cts +2 -2
- package/lib/resources/wire_transfers.d.ts +2 -2
- package/lib/resources/wire_transfers.js.map +1 -1
- package/lib/static.d.cts +2 -2
- package/lib/static.d.ts +2 -2
- package/package.json +15 -4
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/resources/klarna_payments.ts"],"names":[],"mappings":";;AAoFA,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,EAAyB,OAA0C,EAAA;AAC/E,IAAA,MAAM,IAAK,CAAA,SAAA,CAAU,MAAQ,CAAA,OAAO,EAAO,KAAA,QAA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AA,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":"klarna_payments.js","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Order, OrderType } from './orders'\nimport type { PaymentGateway } from './payment_gateways'\nimport type { Version } from './versions'\n\n\ntype KlarnaPaymentType = 'klarna_payments'\ntype KlarnaPaymentRel = ResourceRel & { type: KlarnaPaymentType }\ntype OrderRel = ResourceRel & { type: OrderType }\n\n\nexport type KlarnaPaymentSort = Pick<KlarnaPayment, 'id'> & ResourceSort\n// export type KlarnaPaymentFilter = Pick<KlarnaPayment, 'id' | 'mismatched_amounts'> & ResourceFilter\n\n\ninterface KlarnaPayment extends Resource {\n\t\n\treadonly type: KlarnaPaymentType\n\n\t/** \n\t * The identifier of the payment session.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tsession_id?: string | null\n\t/** \n\t * The public token linked to your API credential. Available upon session creation.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tclient_token?: string | null\n\t/** \n\t * The merchant available payment methods for the assoiated order. Available upon session creation.\n\t * @example ```[{\"foo\":\"bar\"}]```\n\t */\n\tpayment_methods: Array<Record<string, any>>\n\t/** \n\t * The token returned by a successful client authorization, mandatory to place the order.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tauth_token?: string | 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 * 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 KlarnaPaymentCreate extends ResourceCreate {\n\t\n\torder: OrderRel\n\n}\n\n\ninterface KlarnaPaymentUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The token returned by a successful client authorization, mandatory to place the order.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tauth_token?: string | null\n\t/** \n\t * Send this attribute if you want to update the payment session with fresh order data.\n\t * @example ```true```\n\t */\n\t_update?: boolean | null\n\n\torder?: OrderRel | null\n\n}\n\n\nclass KlarnaPayments extends ApiResource<KlarnaPayment> {\n\n\tstatic readonly TYPE: KlarnaPaymentType = 'klarna_payments' as const\n\n\tasync create(resource: KlarnaPaymentCreate, params?: QueryParamsRetrieve<KlarnaPayment>, options?: ResourcesConfig): Promise<KlarnaPayment> {\n\t\treturn this.resources.create<KlarnaPaymentCreate, KlarnaPayment>({ ...resource, type: KlarnaPayments.TYPE }, params, options)\n\t}\n\n\tasync update(resource: KlarnaPaymentUpdate, params?: QueryParamsRetrieve<KlarnaPayment>, options?: ResourcesConfig): Promise<KlarnaPayment> {\n\t\treturn this.resources.update<KlarnaPaymentUpdate, KlarnaPayment>({ ...resource, type: KlarnaPayments.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: KlarnaPayments.TYPE } : id, options)\n\t}\n\n\tasync order(klarnaPaymentId: string | KlarnaPayment, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _klarnaPaymentId = (klarnaPaymentId as KlarnaPayment).id || klarnaPaymentId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `klarna_payments/${_klarnaPaymentId}/order`, params, options) as unknown as Order\n\t}\n\n\tasync payment_gateway(klarnaPaymentId: string | KlarnaPayment, params?: QueryParamsRetrieve<PaymentGateway>, options?: ResourcesConfig): Promise<PaymentGateway> {\n\t\tconst _klarnaPaymentId = (klarnaPaymentId as KlarnaPayment).id || klarnaPaymentId as string\n\t\treturn this.resources.fetch<PaymentGateway>({ type: 'payment_gateways' }, `klarna_payments/${_klarnaPaymentId}/payment_gateway`, params, options) as unknown as PaymentGateway\n\t}\n\n\tasync versions(klarnaPaymentId: string | KlarnaPayment, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _klarnaPaymentId = (klarnaPaymentId as KlarnaPayment).id || klarnaPaymentId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `klarna_payments/${_klarnaPaymentId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync _update(id: string | KlarnaPayment, params?: QueryParamsRetrieve<KlarnaPayment>, options?: ResourcesConfig): Promise<KlarnaPayment> {\n\t\treturn this.resources.update<KlarnaPaymentUpdate, KlarnaPayment>({ id: (typeof id === 'string')? id: id.id, type: KlarnaPayments.TYPE, _update: true }, params, options)\n\t}\n\n\n\tisKlarnaPayment(resource: any): resource is KlarnaPayment {\n\t\treturn resource.type && (resource.type === KlarnaPayments.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): KlarnaPaymentRel {\n\t\treturn super.relationshipOneToOne<KlarnaPaymentRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): KlarnaPaymentRel[] {\n\t\treturn super.relationshipOneToMany<KlarnaPaymentRel>(...ids)\n\t}\n\n\n\ttype(): KlarnaPaymentType {\n\t\treturn KlarnaPayments.TYPE\n\t}\n\n}\n\n\nconst instance = new KlarnaPayments()\nexport default instance\n\nexport type { KlarnaPayment, KlarnaPaymentCreate, KlarnaPaymentUpdate, KlarnaPaymentType }\n"]}
|
1
|
+
{"version":3,"sources":["../../src/resources/klarna_payments.ts"],"names":[],"mappings":";;AAoFA,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,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,KAAA,CAAM,eAAyC,EAAA,MAAA,EAAqC,OAA2C,EAAA;AACpI,IAAM,MAAA,gBAAA,GAAoB,gBAAkC,EAAM,IAAA,eAAA;AAClE,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAa,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vD,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":"klarna_payments.js","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Order, OrderType } from './orders'\nimport type { PaymentGateway } from './payment_gateways'\nimport type { Version } from './versions'\n\n\ntype KlarnaPaymentType = 'klarna_payments'\ntype KlarnaPaymentRel = ResourceRel & { type: KlarnaPaymentType }\ntype OrderRel = ResourceRel & { type: OrderType }\n\n\nexport type KlarnaPaymentSort = Pick<KlarnaPayment, 'id'> & ResourceSort\n// export type KlarnaPaymentFilter = Pick<KlarnaPayment, 'id' | 'mismatched_amounts'> & ResourceFilter\n\n\ninterface KlarnaPayment extends Resource {\n\t\n\treadonly type: KlarnaPaymentType\n\n\t/** \n\t * The identifier of the payment session.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tsession_id?: string | null\n\t/** \n\t * The public token linked to your API credential. Available upon session creation.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tclient_token?: string | null\n\t/** \n\t * The merchant available payment methods for the assoiated order. Available upon session creation.\n\t * @example ```[{\"foo\":\"bar\"}]```\n\t */\n\tpayment_methods: Array<Record<string, any>>\n\t/** \n\t * The token returned by a successful client authorization, mandatory to place the order.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tauth_token?: string | 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 * 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 KlarnaPaymentCreate extends ResourceCreate {\n\t\n\torder: OrderRel\n\n}\n\n\ninterface KlarnaPaymentUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The token returned by a successful client authorization, mandatory to place the order.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tauth_token?: string | null\n\t/** \n\t * Send this attribute if you want to update the payment session with fresh order data.\n\t * @example ```true```\n\t */\n\t_update?: boolean | null\n\n\torder?: OrderRel | null\n\n}\n\n\nclass KlarnaPayments extends ApiResource<KlarnaPayment> {\n\n\tstatic readonly TYPE: KlarnaPaymentType = 'klarna_payments' as const\n\n\tasync create(resource: KlarnaPaymentCreate, params?: QueryParamsRetrieve<KlarnaPayment>, options?: ResourcesConfig): Promise<KlarnaPayment> {\n\t\treturn this.resources.create<KlarnaPaymentCreate, KlarnaPayment>({ ...resource, type: KlarnaPayments.TYPE }, params, options)\n\t}\n\n\tasync update(resource: KlarnaPaymentUpdate, params?: QueryParamsRetrieve<KlarnaPayment>, options?: ResourcesConfig): Promise<KlarnaPayment> {\n\t\treturn this.resources.update<KlarnaPaymentUpdate, KlarnaPayment>({ ...resource, type: KlarnaPayments.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: KlarnaPayments.TYPE } : id, options)\n\t}\n\n\tasync order(klarnaPaymentId: string | KlarnaPayment, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _klarnaPaymentId = (klarnaPaymentId as KlarnaPayment).id || klarnaPaymentId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `klarna_payments/${_klarnaPaymentId}/order`, params, options) as unknown as Order\n\t}\n\n\tasync payment_gateway(klarnaPaymentId: string | KlarnaPayment, params?: QueryParamsRetrieve<PaymentGateway>, options?: ResourcesConfig): Promise<PaymentGateway> {\n\t\tconst _klarnaPaymentId = (klarnaPaymentId as KlarnaPayment).id || klarnaPaymentId as string\n\t\treturn this.resources.fetch<PaymentGateway>({ type: 'payment_gateways' }, `klarna_payments/${_klarnaPaymentId}/payment_gateway`, params, options) as unknown as PaymentGateway\n\t}\n\n\tasync versions(klarnaPaymentId: string | KlarnaPayment, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _klarnaPaymentId = (klarnaPaymentId as KlarnaPayment).id || klarnaPaymentId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `klarna_payments/${_klarnaPaymentId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync _update(id: string | KlarnaPayment, params?: QueryParamsRetrieve<KlarnaPayment>, options?: ResourcesConfig): Promise<KlarnaPayment> {\n\t\treturn this.resources.update<KlarnaPaymentUpdate, KlarnaPayment>({ id: (typeof id === 'string')? id: id.id, type: KlarnaPayments.TYPE, _update: true }, params, options)\n\t}\n\n\n\tisKlarnaPayment(resource: any): resource is KlarnaPayment {\n\t\treturn resource.type && (resource.type === KlarnaPayments.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): KlarnaPaymentRel {\n\t\treturn super.relationshipOneToOne<KlarnaPaymentRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): KlarnaPaymentRel[] {\n\t\treturn super.relationshipOneToMany<KlarnaPaymentRel>(...ids)\n\t}\n\n\n\ttype(): KlarnaPaymentType {\n\t\treturn KlarnaPayments.TYPE\n\t}\n\n}\n\n\nconst instance = new KlarnaPayments()\nexport default instance\n\nexport type { KlarnaPayments, KlarnaPayment, KlarnaPaymentCreate, KlarnaPaymentUpdate, KlarnaPaymentType }\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"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AAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,eAAgB,CAAA,IAAA,EAAM,cAAc,YAAa,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AACxL,EAGA,iBAAiB,QAA2C,EAAA;AAC3D,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,eAAgB,CAAA,IAAA;AAAA;AAC5D,EAGA,aAAa,EAAmD,EAAA;AAC/D,IAAO,OAAA,KAAA,CAAM,qBAAwC,EAAE,CAAA;AAAA;AACxD,EAEA,sBAAsB,GAAoC,EAAA;AACzD,IAAO,OAAA,KAAA,CAAM,qBAAyC,CAAA,GAAG,GAAG,CAAA;AAAA;AAC7D,EAGA,IAA2B,GAAA;AAC1B,IAAA,OAAO,eAAgB,CAAA,IAAA;AAAA;AAGzB;AAGA,MAAM,QAAA,GAAW,IAAI,eAAgB,EAAA;AACrC,IAAO,yBAAQ,GAAA","file":"line_item_options.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 { LineItem, LineItemType } from './line_items'\nimport type { SkuOption, SkuOptionType } from './sku_options'\nimport type { Event } from './events'\nimport type { Tag, TagType } from './tags'\n\n\ntype LineItemOptionType = 'line_item_options'\ntype LineItemOptionRel = ResourceRel & { type: LineItemOptionType }\ntype LineItemRel = ResourceRel & { type: LineItemType }\ntype SkuOptionRel = ResourceRel & { type: SkuOptionType }\ntype TagRel = ResourceRel & { type: TagType }\n\n\nexport type LineItemOptionSort = Pick<LineItemOption, 'id' | 'name' | 'quantity' | 'currency_code' | 'unit_amount_cents' | 'delay_hours'> & ResourceSort\n// export type LineItemOptionFilter = Pick<LineItemOption, 'id' | 'name' | 'quantity' | 'currency_code' | 'unit_amount_cents' | 'delay_hours' | 'delay_days'> & ResourceFilter\n\n\ninterface LineItemOption extends Resource {\n\t\n\treadonly type: LineItemOptionType\n\n\t/** \n\t * The name of the line item option. When blank, it gets populated with the name of the associated SKU option.\n\t * @example ```\"Embossing\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The line item option's quantity.\n\t * @example ```2```\n\t */\n\tquantity: number\n\t/** \n\t * The international 3-letter currency code as defined by the ISO 4217 standard, automatically inherited from the order's market.\n\t * @example ```\"EUR\"```\n\t */\n\tcurrency_code?: string | null\n\t/** \n\t * The unit amount of the line item option, in cents. When you add a line item option to an order, this is automatically populated from associated SKU option's price. Cannot be passed by sales channels.\n\t * @example ```990```\n\t */\n\tunit_amount_cents?: number | null\n\t/** \n\t * The unit amount of the line item option, float. This can be useful to track the purchase on thrid party systems, e.g Google Analyitcs Enhanced Ecommerce.\n\t * @example ```9.9```\n\t */\n\tunit_amount_float?: number | null\n\t/** \n\t * The unit amount of the line item option, formatted. This can be useful to display the amount with currency in you views.\n\t * @example ```\"€9,90\"```\n\t */\n\tformatted_unit_amount?: string | null\n\t/** \n\t * The unit amount x quantity, in cents.\n\t * @example ```1880```\n\t */\n\ttotal_amount_cents?: number | null\n\t/** \n\t * The unit amount x quantity, float. This can be useful to track the purchase on thrid party systems, e.g Google Analyitcs Enhanced Ecommerce.\n\t * @example ```18.8```\n\t */\n\ttotal_amount_float: number\n\t/** \n\t * The unit amount x quantity, formatted. This can be useful to display the amount with currency in you views.\n\t * @example ```\"€18,80\"```\n\t */\n\tformatted_total_amount?: string | null\n\t/** \n\t * The shipping delay that the customer can expect when adding this option (hours). Inherited from the associated SKU option.\n\t * @example ```48```\n\t */\n\tdelay_hours?: number | null\n\t/** \n\t * The shipping delay that the customer can expect when adding this option (days, rounded).\n\t * @example ```2```\n\t */\n\tdelay_days?: number | null\n\t/** \n\t * Set of key-value pairs that represent the selected options.\n\t * @example ```{\"embossing_text\":\"Happy Birthday!\"}```\n\t */\n\toptions: Record<string, any>\n\n\tline_item?: LineItem | null\n\tsku_option?: SkuOption | null\n\tevents?: Event[] | null\n\ttags?: Tag[] | null\n\n}\n\n\ninterface LineItemOptionCreate extends ResourceCreate {\n\t\n\t/** \n\t * The name of the line item option. When blank, it gets populated with the name of the associated SKU option.\n\t * @example ```\"Embossing\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The line item option's quantity.\n\t * @example ```2```\n\t */\n\tquantity: number\n\t/** \n\t * The unit amount of the line item option, in cents. When you add a line item option to an order, this is automatically populated from associated SKU option's price. Cannot be passed by sales channels.\n\t * @example ```990```\n\t */\n\tunit_amount_cents?: number | null\n\t/** \n\t * Set of key-value pairs that represent the selected options.\n\t * @example ```{\"embossing_text\":\"Happy Birthday!\"}```\n\t */\n\toptions: Record<string, any>\n\n\tline_item: LineItemRel\n\tsku_option: SkuOptionRel\n\ttags?: TagRel[] | null\n\n}\n\n\ninterface LineItemOptionUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The name of the line item option. When blank, it gets populated with the name of the associated SKU option.\n\t * @example ```\"Embossing\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The line item option's quantity.\n\t * @example ```2```\n\t */\n\tquantity?: number | null\n\t/** \n\t * The unit amount of the line item option, in cents. When you add a line item option to an order, this is automatically populated from associated SKU option's price. Cannot be passed by sales channels.\n\t * @example ```990```\n\t */\n\tunit_amount_cents?: number | null\n\t/** \n\t * Set of key-value pairs that represent the selected options.\n\t * @example ```{\"embossing_text\":\"Happy Birthday!\"}```\n\t */\n\toptions?: Record<string, any> | null\n\t/** \n\t * Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_add_tags?: string | null\n\t/** \n\t * Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_remove_tags?: string | null\n\n\tsku_option?: SkuOptionRel | null\n\ttags?: TagRel[] | null\n\n}\n\n\nclass LineItemOptions extends ApiResource<LineItemOption> {\n\n\tstatic readonly TYPE: LineItemOptionType = 'line_item_options' as const\n\n\tasync create(resource: LineItemOptionCreate, params?: QueryParamsRetrieve<LineItemOption>, options?: ResourcesConfig): Promise<LineItemOption> {\n\t\treturn this.resources.create<LineItemOptionCreate, LineItemOption>({ ...resource, type: LineItemOptions.TYPE }, params, options)\n\t}\n\n\tasync update(resource: LineItemOptionUpdate, params?: QueryParamsRetrieve<LineItemOption>, options?: ResourcesConfig): Promise<LineItemOption> {\n\t\treturn this.resources.update<LineItemOptionUpdate, LineItemOption>({ ...resource, type: LineItemOptions.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: LineItemOptions.TYPE } : id, options)\n\t}\n\n\tasync line_item(lineItemOptionId: string | LineItemOption, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\tconst _lineItemOptionId = (lineItemOptionId as LineItemOption).id || lineItemOptionId as string\n\t\treturn this.resources.fetch<LineItem>({ type: 'line_items' }, `line_item_options/${_lineItemOptionId}/line_item`, params, options) as unknown as LineItem\n\t}\n\n\tasync sku_option(lineItemOptionId: string | LineItemOption, params?: QueryParamsRetrieve<SkuOption>, options?: ResourcesConfig): Promise<SkuOption> {\n\t\tconst _lineItemOptionId = (lineItemOptionId as LineItemOption).id || lineItemOptionId as string\n\t\treturn this.resources.fetch<SkuOption>({ type: 'sku_options' }, `line_item_options/${_lineItemOptionId}/sku_option`, params, options) as unknown as SkuOption\n\t}\n\n\tasync events(lineItemOptionId: string | LineItemOption, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _lineItemOptionId = (lineItemOptionId as LineItemOption).id || lineItemOptionId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `line_item_options/${_lineItemOptionId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync tags(lineItemOptionId: string | LineItemOption, params?: QueryParamsList<Tag>, options?: ResourcesConfig): Promise<ListResponse<Tag>> {\n\t\tconst _lineItemOptionId = (lineItemOptionId as LineItemOption).id || lineItemOptionId as string\n\t\treturn this.resources.fetch<Tag>({ type: 'tags' }, `line_item_options/${_lineItemOptionId}/tags`, params, options) as unknown as ListResponse<Tag>\n\t}\n\n\tasync _add_tags(id: string | LineItemOption, triggerValue: string, params?: QueryParamsRetrieve<LineItemOption>, options?: ResourcesConfig): Promise<LineItemOption> {\n\t\treturn this.resources.update<LineItemOptionUpdate, LineItemOption>({ id: (typeof id === 'string')? id: id.id, type: LineItemOptions.TYPE, _add_tags: triggerValue }, params, options)\n\t}\n\n\tasync _remove_tags(id: string | LineItemOption, triggerValue: string, params?: QueryParamsRetrieve<LineItemOption>, options?: ResourcesConfig): Promise<LineItemOption> {\n\t\treturn this.resources.update<LineItemOptionUpdate, LineItemOption>({ id: (typeof id === 'string')? id: id.id, type: LineItemOptions.TYPE, _remove_tags: triggerValue }, params, options)\n\t}\n\n\n\tisLineItemOption(resource: any): resource is LineItemOption {\n\t\treturn resource.type && (resource.type === LineItemOptions.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): LineItemOptionRel {\n\t\treturn super.relationshipOneToOne<LineItemOptionRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): LineItemOptionRel[] {\n\t\treturn super.relationshipOneToMany<LineItemOptionRel>(...ids)\n\t}\n\n\n\ttype(): LineItemOptionType {\n\t\treturn LineItemOptions.TYPE\n\t}\n\n}\n\n\nconst instance = new LineItemOptions()\nexport default instance\n\nexport type { LineItemOption, LineItemOptionCreate, LineItemOptionUpdate, LineItemOptionType }\n"]}
|
1
|
+
{"version":3,"sources":["../../src/resources/line_item_options.ts"],"names":["ApiResource"],"mappings":";;;;AAiKA,MAAM,wBAAwBA,oBAA4B,CAAA;AAAA,EAEzD,OAAgB,IAA2B,GAAA,mBAAA;AAAA,EAE3C,MAAM,MAAA,CAAO,QAAgC,EAAA,MAAA,EAA8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3D,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,eAAgB,CAAA,IAAA;AAAA;AAC5D,EAGA,aAAa,EAAmD,EAAA;AAC/D,IAAO,OAAA,KAAA,CAAM,qBAAwC,EAAE,CAAA;AAAA;AACxD,EAEA,sBAAsB,GAAoC,EAAA;AACzD,IAAO,OAAA,KAAA,CAAM,qBAAyC,CAAA,GAAG,GAAG,CAAA;AAAA;AAC7D,EAGA,IAA2B,GAAA;AAC1B,IAAA,OAAO,eAAgB,CAAA,IAAA;AAAA;AAGzB;AAGA,MAAM,QAAA,GAAW,IAAI,eAAgB,EAAA;AACrC,IAAO,yBAAQ,GAAA","file":"line_item_options.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 { LineItem, LineItemType } from './line_items'\nimport type { SkuOption, SkuOptionType } from './sku_options'\nimport type { Event } from './events'\nimport type { Tag, TagType } from './tags'\n\n\ntype LineItemOptionType = 'line_item_options'\ntype LineItemOptionRel = ResourceRel & { type: LineItemOptionType }\ntype LineItemRel = ResourceRel & { type: LineItemType }\ntype SkuOptionRel = ResourceRel & { type: SkuOptionType }\ntype TagRel = ResourceRel & { type: TagType }\n\n\nexport type LineItemOptionSort = Pick<LineItemOption, 'id' | 'name' | 'quantity' | 'currency_code' | 'unit_amount_cents' | 'delay_hours'> & ResourceSort\n// export type LineItemOptionFilter = Pick<LineItemOption, 'id' | 'name' | 'quantity' | 'currency_code' | 'unit_amount_cents' | 'delay_hours' | 'delay_days'> & ResourceFilter\n\n\ninterface LineItemOption extends Resource {\n\t\n\treadonly type: LineItemOptionType\n\n\t/** \n\t * The name of the line item option. When blank, it gets populated with the name of the associated SKU option.\n\t * @example ```\"Embossing\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The line item option's quantity.\n\t * @example ```2```\n\t */\n\tquantity: number\n\t/** \n\t * The international 3-letter currency code as defined by the ISO 4217 standard, automatically inherited from the order's market.\n\t * @example ```\"EUR\"```\n\t */\n\tcurrency_code?: string | null\n\t/** \n\t * The unit amount of the line item option, in cents. When you add a line item option to an order, this is automatically populated from associated SKU option's price. Cannot be passed by sales channels.\n\t * @example ```990```\n\t */\n\tunit_amount_cents?: number | null\n\t/** \n\t * The unit amount of the line item option, float. This can be useful to track the purchase on thrid party systems, e.g Google Analyitcs Enhanced Ecommerce.\n\t * @example ```9.9```\n\t */\n\tunit_amount_float?: number | null\n\t/** \n\t * The unit amount of the line item option, formatted. This can be useful to display the amount with currency in you views.\n\t * @example ```\"€9,90\"```\n\t */\n\tformatted_unit_amount?: string | null\n\t/** \n\t * The unit amount x quantity, in cents.\n\t * @example ```1880```\n\t */\n\ttotal_amount_cents?: number | null\n\t/** \n\t * The unit amount x quantity, float. This can be useful to track the purchase on thrid party systems, e.g Google Analyitcs Enhanced Ecommerce.\n\t * @example ```18.8```\n\t */\n\ttotal_amount_float: number\n\t/** \n\t * The unit amount x quantity, formatted. This can be useful to display the amount with currency in you views.\n\t * @example ```\"€18,80\"```\n\t */\n\tformatted_total_amount?: string | null\n\t/** \n\t * The shipping delay that the customer can expect when adding this option (hours). Inherited from the associated SKU option.\n\t * @example ```48```\n\t */\n\tdelay_hours?: number | null\n\t/** \n\t * The shipping delay that the customer can expect when adding this option (days, rounded).\n\t * @example ```2```\n\t */\n\tdelay_days?: number | null\n\t/** \n\t * Set of key-value pairs that represent the selected options.\n\t * @example ```{\"embossing_text\":\"Happy Birthday!\"}```\n\t */\n\toptions: Record<string, any>\n\n\tline_item?: LineItem | null\n\tsku_option?: SkuOption | null\n\tevents?: Event[] | null\n\ttags?: Tag[] | null\n\n}\n\n\ninterface LineItemOptionCreate extends ResourceCreate {\n\t\n\t/** \n\t * The name of the line item option. When blank, it gets populated with the name of the associated SKU option.\n\t * @example ```\"Embossing\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The line item option's quantity.\n\t * @example ```2```\n\t */\n\tquantity: number\n\t/** \n\t * The unit amount of the line item option, in cents. When you add a line item option to an order, this is automatically populated from associated SKU option's price. Cannot be passed by sales channels.\n\t * @example ```990```\n\t */\n\tunit_amount_cents?: number | null\n\t/** \n\t * Set of key-value pairs that represent the selected options.\n\t * @example ```{\"embossing_text\":\"Happy Birthday!\"}```\n\t */\n\toptions: Record<string, any>\n\n\tline_item: LineItemRel\n\tsku_option: SkuOptionRel\n\ttags?: TagRel[] | null\n\n}\n\n\ninterface LineItemOptionUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The name of the line item option. When blank, it gets populated with the name of the associated SKU option.\n\t * @example ```\"Embossing\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The line item option's quantity.\n\t * @example ```2```\n\t */\n\tquantity?: number | null\n\t/** \n\t * The unit amount of the line item option, in cents. When you add a line item option to an order, this is automatically populated from associated SKU option's price. Cannot be passed by sales channels.\n\t * @example ```990```\n\t */\n\tunit_amount_cents?: number | null\n\t/** \n\t * Set of key-value pairs that represent the selected options.\n\t * @example ```{\"embossing_text\":\"Happy Birthday!\"}```\n\t */\n\toptions?: Record<string, any> | null\n\t/** \n\t * Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_add_tags?: string | null\n\t/** \n\t * Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_remove_tags?: string | null\n\n\tsku_option?: SkuOptionRel | null\n\ttags?: TagRel[] | null\n\n}\n\n\nclass LineItemOptions extends ApiResource<LineItemOption> {\n\n\tstatic readonly TYPE: LineItemOptionType = 'line_item_options' as const\n\n\tasync create(resource: LineItemOptionCreate, params?: QueryParamsRetrieve<LineItemOption>, options?: ResourcesConfig): Promise<LineItemOption> {\n\t\treturn this.resources.create<LineItemOptionCreate, LineItemOption>({ ...resource, type: LineItemOptions.TYPE }, params, options)\n\t}\n\n\tasync update(resource: LineItemOptionUpdate, params?: QueryParamsRetrieve<LineItemOption>, options?: ResourcesConfig): Promise<LineItemOption> {\n\t\treturn this.resources.update<LineItemOptionUpdate, LineItemOption>({ ...resource, type: LineItemOptions.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: LineItemOptions.TYPE } : id, options)\n\t}\n\n\tasync line_item(lineItemOptionId: string | LineItemOption, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\tconst _lineItemOptionId = (lineItemOptionId as LineItemOption).id || lineItemOptionId as string\n\t\treturn this.resources.fetch<LineItem>({ type: 'line_items' }, `line_item_options/${_lineItemOptionId}/line_item`, params, options) as unknown as LineItem\n\t}\n\n\tasync sku_option(lineItemOptionId: string | LineItemOption, params?: QueryParamsRetrieve<SkuOption>, options?: ResourcesConfig): Promise<SkuOption> {\n\t\tconst _lineItemOptionId = (lineItemOptionId as LineItemOption).id || lineItemOptionId as string\n\t\treturn this.resources.fetch<SkuOption>({ type: 'sku_options' }, `line_item_options/${_lineItemOptionId}/sku_option`, params, options) as unknown as SkuOption\n\t}\n\n\tasync events(lineItemOptionId: string | LineItemOption, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _lineItemOptionId = (lineItemOptionId as LineItemOption).id || lineItemOptionId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `line_item_options/${_lineItemOptionId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync tags(lineItemOptionId: string | LineItemOption, params?: QueryParamsList<Tag>, options?: ResourcesConfig): Promise<ListResponse<Tag>> {\n\t\tconst _lineItemOptionId = (lineItemOptionId as LineItemOption).id || lineItemOptionId as string\n\t\treturn this.resources.fetch<Tag>({ type: 'tags' }, `line_item_options/${_lineItemOptionId}/tags`, params, options) as unknown as ListResponse<Tag>\n\t}\n\n\tasync _add_tags(id: string | LineItemOption, triggerValue: string, params?: QueryParamsRetrieve<LineItemOption>, options?: ResourcesConfig): Promise<LineItemOption> {\n\t\treturn this.resources.update<LineItemOptionUpdate, LineItemOption>({ id: (typeof id === 'string')? id: id.id, type: LineItemOptions.TYPE, _add_tags: triggerValue }, params, options)\n\t}\n\n\tasync _remove_tags(id: string | LineItemOption, triggerValue: string, params?: QueryParamsRetrieve<LineItemOption>, options?: ResourcesConfig): Promise<LineItemOption> {\n\t\treturn this.resources.update<LineItemOptionUpdate, LineItemOption>({ id: (typeof id === 'string')? id: id.id, type: LineItemOptions.TYPE, _remove_tags: triggerValue }, params, options)\n\t}\n\n\n\tisLineItemOption(resource: any): resource is LineItemOption {\n\t\treturn resource.type && (resource.type === LineItemOptions.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): LineItemOptionRel {\n\t\treturn super.relationshipOneToOne<LineItemOptionRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): LineItemOptionRel[] {\n\t\treturn super.relationshipOneToMany<LineItemOptionRel>(...ids)\n\t}\n\n\n\ttype(): LineItemOptionType {\n\t\treturn LineItemOptions.TYPE\n\t}\n\n}\n\n\nconst instance = new LineItemOptions()\nexport default instance\n\nexport type { LineItemOptions, LineItemOption, LineItemOptionCreate, LineItemOptionUpdate, LineItemOptionType }\n"]}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export {
|
1
|
+
export { hd as LineItemOption, he as LineItemOptionCreate, hg as LineItemOptionSort, lT as LineItemOptionType, hf as LineItemOptionUpdate, by as LineItemOptions, bx 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 { hd as LineItemOption, he as LineItemOptionCreate, hg as LineItemOptionSort, lT as LineItemOptionType, hf as LineItemOptionUpdate, by as LineItemOptions, bx 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/line_item_options.ts"],"names":[],"mappings":";;AAiKA,MAAM,wBAAwB,WAA4B,CAAA;AAAA,EAEzD,OAAgB,IAA2B,GAAA,mBAAA;AAAA,EAE3C,MAAM,MAAA,CAAO,QAAgC,EAAA,MAAA,EAA8C,OAAoD,EAAA;AAC9I,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA6C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,eAAgB,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAChI,EAEA,MAAM,MAAA,CAAO,QAAgC,EAAA,MAAA,EAA8C,OAAoD,EAAA;AAC9I,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA6C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,eAAgB,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAChI,EAEA,MAAM,MAAO,CAAA,EAAA,EAAyB,OAA0C,EAAA;AAC/E,IAAA,MAAM,IAAK,CAAA,SAAA,CAAU,MAAQ,CAAA,OAAO,EAAO,KAAA,QAAA,GAAW,EAAE,EAAA,EAAI,IAAM,EAAA,eAAA,CAAgB,IAAK,EAAA,GAAI,IAAI,OAAO,CAAA;AAAA;AACvG,EAEA,MAAM,SAAA,CAAU,gBAA2C,EAAA,MAAA,EAAwC,OAA8C,EAAA;AAChJ,IAAM,MAAA,iBAAA,GAAqB,iBAAoC,EAAM,IAAA,gBAAA;AACrE,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAgB,EAAE,IAAA,EAAM,YAAa,EAAA,EAAG,CAAqB,kBAAA,EAAA,iBAAiB,CAAc,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AAQ,OAAO,CAAA;AAAA;AACrL,EAEA,MAAM,YAAA,CAAa,EAA6B,EAAA,YAAA,EAAsB,QAA8C,OAAoD,EAAA;AACvK,IAAA,OAAO,KAAK,SAAU,CAAA,MAAA,CAA6C,EAAE,EAAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,eAAgB,CAAA,IAAA,EAAM,cAAc,YAAa,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AACxL,EAGA,iBAAiB,QAA2C,EAAA;AAC3D,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,eAAgB,CAAA,IAAA;AAAA;AAC5D,EAGA,aAAa,EAAmD,EAAA;AAC/D,IAAO,OAAA,KAAA,CAAM,qBAAwC,EAAE,CAAA;AAAA;AACxD,EAEA,sBAAsB,GAAoC,EAAA;AACzD,IAAO,OAAA,KAAA,CAAM,qBAAyC,CAAA,GAAG,GAAG,CAAA;AAAA;AAC7D,EAGA,IAA2B,GAAA;AAC1B,IAAA,OAAO,eAAgB,CAAA,IAAA;AAAA;AAGzB;AAGA,MAAM,QAAA,GAAW,IAAI,eAAgB,EAAA;AACrC,IAAO,yBAAQ,GAAA","file":"line_item_options.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 { LineItem, LineItemType } from './line_items'\nimport type { SkuOption, SkuOptionType } from './sku_options'\nimport type { Event } from './events'\nimport type { Tag, TagType } from './tags'\n\n\ntype LineItemOptionType = 'line_item_options'\ntype LineItemOptionRel = ResourceRel & { type: LineItemOptionType }\ntype LineItemRel = ResourceRel & { type: LineItemType }\ntype SkuOptionRel = ResourceRel & { type: SkuOptionType }\ntype TagRel = ResourceRel & { type: TagType }\n\n\nexport type LineItemOptionSort = Pick<LineItemOption, 'id' | 'name' | 'quantity' | 'currency_code' | 'unit_amount_cents' | 'delay_hours'> & ResourceSort\n// export type LineItemOptionFilter = Pick<LineItemOption, 'id' | 'name' | 'quantity' | 'currency_code' | 'unit_amount_cents' | 'delay_hours' | 'delay_days'> & ResourceFilter\n\n\ninterface LineItemOption extends Resource {\n\t\n\treadonly type: LineItemOptionType\n\n\t/** \n\t * The name of the line item option. When blank, it gets populated with the name of the associated SKU option.\n\t * @example ```\"Embossing\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The line item option's quantity.\n\t * @example ```2```\n\t */\n\tquantity: number\n\t/** \n\t * The international 3-letter currency code as defined by the ISO 4217 standard, automatically inherited from the order's market.\n\t * @example ```\"EUR\"```\n\t */\n\tcurrency_code?: string | null\n\t/** \n\t * The unit amount of the line item option, in cents. When you add a line item option to an order, this is automatically populated from associated SKU option's price. Cannot be passed by sales channels.\n\t * @example ```990```\n\t */\n\tunit_amount_cents?: number | null\n\t/** \n\t * The unit amount of the line item option, float. This can be useful to track the purchase on thrid party systems, e.g Google Analyitcs Enhanced Ecommerce.\n\t * @example ```9.9```\n\t */\n\tunit_amount_float?: number | null\n\t/** \n\t * The unit amount of the line item option, formatted. This can be useful to display the amount with currency in you views.\n\t * @example ```\"€9,90\"```\n\t */\n\tformatted_unit_amount?: string | null\n\t/** \n\t * The unit amount x quantity, in cents.\n\t * @example ```1880```\n\t */\n\ttotal_amount_cents?: number | null\n\t/** \n\t * The unit amount x quantity, float. This can be useful to track the purchase on thrid party systems, e.g Google Analyitcs Enhanced Ecommerce.\n\t * @example ```18.8```\n\t */\n\ttotal_amount_float: number\n\t/** \n\t * The unit amount x quantity, formatted. This can be useful to display the amount with currency in you views.\n\t * @example ```\"€18,80\"```\n\t */\n\tformatted_total_amount?: string | null\n\t/** \n\t * The shipping delay that the customer can expect when adding this option (hours). Inherited from the associated SKU option.\n\t * @example ```48```\n\t */\n\tdelay_hours?: number | null\n\t/** \n\t * The shipping delay that the customer can expect when adding this option (days, rounded).\n\t * @example ```2```\n\t */\n\tdelay_days?: number | null\n\t/** \n\t * Set of key-value pairs that represent the selected options.\n\t * @example ```{\"embossing_text\":\"Happy Birthday!\"}```\n\t */\n\toptions: Record<string, any>\n\n\tline_item?: LineItem | null\n\tsku_option?: SkuOption | null\n\tevents?: Event[] | null\n\ttags?: Tag[] | null\n\n}\n\n\ninterface LineItemOptionCreate extends ResourceCreate {\n\t\n\t/** \n\t * The name of the line item option. When blank, it gets populated with the name of the associated SKU option.\n\t * @example ```\"Embossing\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The line item option's quantity.\n\t * @example ```2```\n\t */\n\tquantity: number\n\t/** \n\t * The unit amount of the line item option, in cents. When you add a line item option to an order, this is automatically populated from associated SKU option's price. Cannot be passed by sales channels.\n\t * @example ```990```\n\t */\n\tunit_amount_cents?: number | null\n\t/** \n\t * Set of key-value pairs that represent the selected options.\n\t * @example ```{\"embossing_text\":\"Happy Birthday!\"}```\n\t */\n\toptions: Record<string, any>\n\n\tline_item: LineItemRel\n\tsku_option: SkuOptionRel\n\ttags?: TagRel[] | null\n\n}\n\n\ninterface LineItemOptionUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The name of the line item option. When blank, it gets populated with the name of the associated SKU option.\n\t * @example ```\"Embossing\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The line item option's quantity.\n\t * @example ```2```\n\t */\n\tquantity?: number | null\n\t/** \n\t * The unit amount of the line item option, in cents. When you add a line item option to an order, this is automatically populated from associated SKU option's price. Cannot be passed by sales channels.\n\t * @example ```990```\n\t */\n\tunit_amount_cents?: number | null\n\t/** \n\t * Set of key-value pairs that represent the selected options.\n\t * @example ```{\"embossing_text\":\"Happy Birthday!\"}```\n\t */\n\toptions?: Record<string, any> | null\n\t/** \n\t * Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_add_tags?: string | null\n\t/** \n\t * Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_remove_tags?: string | null\n\n\tsku_option?: SkuOptionRel | null\n\ttags?: TagRel[] | null\n\n}\n\n\nclass LineItemOptions extends ApiResource<LineItemOption> {\n\n\tstatic readonly TYPE: LineItemOptionType = 'line_item_options' as const\n\n\tasync create(resource: LineItemOptionCreate, params?: QueryParamsRetrieve<LineItemOption>, options?: ResourcesConfig): Promise<LineItemOption> {\n\t\treturn this.resources.create<LineItemOptionCreate, LineItemOption>({ ...resource, type: LineItemOptions.TYPE }, params, options)\n\t}\n\n\tasync update(resource: LineItemOptionUpdate, params?: QueryParamsRetrieve<LineItemOption>, options?: ResourcesConfig): Promise<LineItemOption> {\n\t\treturn this.resources.update<LineItemOptionUpdate, LineItemOption>({ ...resource, type: LineItemOptions.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: LineItemOptions.TYPE } : id, options)\n\t}\n\n\tasync line_item(lineItemOptionId: string | LineItemOption, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\tconst _lineItemOptionId = (lineItemOptionId as LineItemOption).id || lineItemOptionId as string\n\t\treturn this.resources.fetch<LineItem>({ type: 'line_items' }, `line_item_options/${_lineItemOptionId}/line_item`, params, options) as unknown as LineItem\n\t}\n\n\tasync sku_option(lineItemOptionId: string | LineItemOption, params?: QueryParamsRetrieve<SkuOption>, options?: ResourcesConfig): Promise<SkuOption> {\n\t\tconst _lineItemOptionId = (lineItemOptionId as LineItemOption).id || lineItemOptionId as string\n\t\treturn this.resources.fetch<SkuOption>({ type: 'sku_options' }, `line_item_options/${_lineItemOptionId}/sku_option`, params, options) as unknown as SkuOption\n\t}\n\n\tasync events(lineItemOptionId: string | LineItemOption, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _lineItemOptionId = (lineItemOptionId as LineItemOption).id || lineItemOptionId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `line_item_options/${_lineItemOptionId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync tags(lineItemOptionId: string | LineItemOption, params?: QueryParamsList<Tag>, options?: ResourcesConfig): Promise<ListResponse<Tag>> {\n\t\tconst _lineItemOptionId = (lineItemOptionId as LineItemOption).id || lineItemOptionId as string\n\t\treturn this.resources.fetch<Tag>({ type: 'tags' }, `line_item_options/${_lineItemOptionId}/tags`, params, options) as unknown as ListResponse<Tag>\n\t}\n\n\tasync _add_tags(id: string | LineItemOption, triggerValue: string, params?: QueryParamsRetrieve<LineItemOption>, options?: ResourcesConfig): Promise<LineItemOption> {\n\t\treturn this.resources.update<LineItemOptionUpdate, LineItemOption>({ id: (typeof id === 'string')? id: id.id, type: LineItemOptions.TYPE, _add_tags: triggerValue }, params, options)\n\t}\n\n\tasync _remove_tags(id: string | LineItemOption, triggerValue: string, params?: QueryParamsRetrieve<LineItemOption>, options?: ResourcesConfig): Promise<LineItemOption> {\n\t\treturn this.resources.update<LineItemOptionUpdate, LineItemOption>({ id: (typeof id === 'string')? id: id.id, type: LineItemOptions.TYPE, _remove_tags: triggerValue }, params, options)\n\t}\n\n\n\tisLineItemOption(resource: any): resource is LineItemOption {\n\t\treturn resource.type && (resource.type === LineItemOptions.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): LineItemOptionRel {\n\t\treturn super.relationshipOneToOne<LineItemOptionRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): LineItemOptionRel[] {\n\t\treturn super.relationshipOneToMany<LineItemOptionRel>(...ids)\n\t}\n\n\n\ttype(): LineItemOptionType {\n\t\treturn LineItemOptions.TYPE\n\t}\n\n}\n\n\nconst instance = new LineItemOptions()\nexport default instance\n\nexport type { LineItemOption, LineItemOptionCreate, LineItemOptionUpdate, LineItemOptionType }\n"]}
|
1
|
+
{"version":3,"sources":["../../src/resources/line_item_options.ts"],"names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,EAAG,CAAA,EAAA,EAAI,MAAM,eAAgB,CAAA,IAAA,EAAM,cAAc,YAAa,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AACxL,EAGA,iBAAiB,QAA2C,EAAA;AAC3D,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,eAAgB,CAAA,IAAA;AAAA;AAC5D,EAGA,aAAa,EAAmD,EAAA;AAC/D,IAAO,OAAA,KAAA,CAAM,qBAAwC,EAAE,CAAA;AAAA;AACxD,EAEA,sBAAsB,GAAoC,EAAA;AACzD,IAAO,OAAA,KAAA,CAAM,qBAAyC,CAAA,GAAG,GAAG,CAAA;AAAA;AAC7D,EAGA,IAA2B,GAAA;AAC1B,IAAA,OAAO,eAAgB,CAAA,IAAA;AAAA;AAGzB;AAGA,MAAM,QAAA,GAAW,IAAI,eAAgB,EAAA;AACrC,IAAO,yBAAQ,GAAA","file":"line_item_options.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 { LineItem, LineItemType } from './line_items'\nimport type { SkuOption, SkuOptionType } from './sku_options'\nimport type { Event } from './events'\nimport type { Tag, TagType } from './tags'\n\n\ntype LineItemOptionType = 'line_item_options'\ntype LineItemOptionRel = ResourceRel & { type: LineItemOptionType }\ntype LineItemRel = ResourceRel & { type: LineItemType }\ntype SkuOptionRel = ResourceRel & { type: SkuOptionType }\ntype TagRel = ResourceRel & { type: TagType }\n\n\nexport type LineItemOptionSort = Pick<LineItemOption, 'id' | 'name' | 'quantity' | 'currency_code' | 'unit_amount_cents' | 'delay_hours'> & ResourceSort\n// export type LineItemOptionFilter = Pick<LineItemOption, 'id' | 'name' | 'quantity' | 'currency_code' | 'unit_amount_cents' | 'delay_hours' | 'delay_days'> & ResourceFilter\n\n\ninterface LineItemOption extends Resource {\n\t\n\treadonly type: LineItemOptionType\n\n\t/** \n\t * The name of the line item option. When blank, it gets populated with the name of the associated SKU option.\n\t * @example ```\"Embossing\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The line item option's quantity.\n\t * @example ```2```\n\t */\n\tquantity: number\n\t/** \n\t * The international 3-letter currency code as defined by the ISO 4217 standard, automatically inherited from the order's market.\n\t * @example ```\"EUR\"```\n\t */\n\tcurrency_code?: string | null\n\t/** \n\t * The unit amount of the line item option, in cents. When you add a line item option to an order, this is automatically populated from associated SKU option's price. Cannot be passed by sales channels.\n\t * @example ```990```\n\t */\n\tunit_amount_cents?: number | null\n\t/** \n\t * The unit amount of the line item option, float. This can be useful to track the purchase on thrid party systems, e.g Google Analyitcs Enhanced Ecommerce.\n\t * @example ```9.9```\n\t */\n\tunit_amount_float?: number | null\n\t/** \n\t * The unit amount of the line item option, formatted. This can be useful to display the amount with currency in you views.\n\t * @example ```\"€9,90\"```\n\t */\n\tformatted_unit_amount?: string | null\n\t/** \n\t * The unit amount x quantity, in cents.\n\t * @example ```1880```\n\t */\n\ttotal_amount_cents?: number | null\n\t/** \n\t * The unit amount x quantity, float. This can be useful to track the purchase on thrid party systems, e.g Google Analyitcs Enhanced Ecommerce.\n\t * @example ```18.8```\n\t */\n\ttotal_amount_float: number\n\t/** \n\t * The unit amount x quantity, formatted. This can be useful to display the amount with currency in you views.\n\t * @example ```\"€18,80\"```\n\t */\n\tformatted_total_amount?: string | null\n\t/** \n\t * The shipping delay that the customer can expect when adding this option (hours). Inherited from the associated SKU option.\n\t * @example ```48```\n\t */\n\tdelay_hours?: number | null\n\t/** \n\t * The shipping delay that the customer can expect when adding this option (days, rounded).\n\t * @example ```2```\n\t */\n\tdelay_days?: number | null\n\t/** \n\t * Set of key-value pairs that represent the selected options.\n\t * @example ```{\"embossing_text\":\"Happy Birthday!\"}```\n\t */\n\toptions: Record<string, any>\n\n\tline_item?: LineItem | null\n\tsku_option?: SkuOption | null\n\tevents?: Event[] | null\n\ttags?: Tag[] | null\n\n}\n\n\ninterface LineItemOptionCreate extends ResourceCreate {\n\t\n\t/** \n\t * The name of the line item option. When blank, it gets populated with the name of the associated SKU option.\n\t * @example ```\"Embossing\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The line item option's quantity.\n\t * @example ```2```\n\t */\n\tquantity: number\n\t/** \n\t * The unit amount of the line item option, in cents. When you add a line item option to an order, this is automatically populated from associated SKU option's price. Cannot be passed by sales channels.\n\t * @example ```990```\n\t */\n\tunit_amount_cents?: number | null\n\t/** \n\t * Set of key-value pairs that represent the selected options.\n\t * @example ```{\"embossing_text\":\"Happy Birthday!\"}```\n\t */\n\toptions: Record<string, any>\n\n\tline_item: LineItemRel\n\tsku_option: SkuOptionRel\n\ttags?: TagRel[] | null\n\n}\n\n\ninterface LineItemOptionUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The name of the line item option. When blank, it gets populated with the name of the associated SKU option.\n\t * @example ```\"Embossing\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The line item option's quantity.\n\t * @example ```2```\n\t */\n\tquantity?: number | null\n\t/** \n\t * The unit amount of the line item option, in cents. When you add a line item option to an order, this is automatically populated from associated SKU option's price. Cannot be passed by sales channels.\n\t * @example ```990```\n\t */\n\tunit_amount_cents?: number | null\n\t/** \n\t * Set of key-value pairs that represent the selected options.\n\t * @example ```{\"embossing_text\":\"Happy Birthday!\"}```\n\t */\n\toptions?: Record<string, any> | null\n\t/** \n\t * Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_add_tags?: string | null\n\t/** \n\t * Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_remove_tags?: string | null\n\n\tsku_option?: SkuOptionRel | null\n\ttags?: TagRel[] | null\n\n}\n\n\nclass LineItemOptions extends ApiResource<LineItemOption> {\n\n\tstatic readonly TYPE: LineItemOptionType = 'line_item_options' as const\n\n\tasync create(resource: LineItemOptionCreate, params?: QueryParamsRetrieve<LineItemOption>, options?: ResourcesConfig): Promise<LineItemOption> {\n\t\treturn this.resources.create<LineItemOptionCreate, LineItemOption>({ ...resource, type: LineItemOptions.TYPE }, params, options)\n\t}\n\n\tasync update(resource: LineItemOptionUpdate, params?: QueryParamsRetrieve<LineItemOption>, options?: ResourcesConfig): Promise<LineItemOption> {\n\t\treturn this.resources.update<LineItemOptionUpdate, LineItemOption>({ ...resource, type: LineItemOptions.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: LineItemOptions.TYPE } : id, options)\n\t}\n\n\tasync line_item(lineItemOptionId: string | LineItemOption, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\tconst _lineItemOptionId = (lineItemOptionId as LineItemOption).id || lineItemOptionId as string\n\t\treturn this.resources.fetch<LineItem>({ type: 'line_items' }, `line_item_options/${_lineItemOptionId}/line_item`, params, options) as unknown as LineItem\n\t}\n\n\tasync sku_option(lineItemOptionId: string | LineItemOption, params?: QueryParamsRetrieve<SkuOption>, options?: ResourcesConfig): Promise<SkuOption> {\n\t\tconst _lineItemOptionId = (lineItemOptionId as LineItemOption).id || lineItemOptionId as string\n\t\treturn this.resources.fetch<SkuOption>({ type: 'sku_options' }, `line_item_options/${_lineItemOptionId}/sku_option`, params, options) as unknown as SkuOption\n\t}\n\n\tasync events(lineItemOptionId: string | LineItemOption, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _lineItemOptionId = (lineItemOptionId as LineItemOption).id || lineItemOptionId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `line_item_options/${_lineItemOptionId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync tags(lineItemOptionId: string | LineItemOption, params?: QueryParamsList<Tag>, options?: ResourcesConfig): Promise<ListResponse<Tag>> {\n\t\tconst _lineItemOptionId = (lineItemOptionId as LineItemOption).id || lineItemOptionId as string\n\t\treturn this.resources.fetch<Tag>({ type: 'tags' }, `line_item_options/${_lineItemOptionId}/tags`, params, options) as unknown as ListResponse<Tag>\n\t}\n\n\tasync _add_tags(id: string | LineItemOption, triggerValue: string, params?: QueryParamsRetrieve<LineItemOption>, options?: ResourcesConfig): Promise<LineItemOption> {\n\t\treturn this.resources.update<LineItemOptionUpdate, LineItemOption>({ id: (typeof id === 'string')? id: id.id, type: LineItemOptions.TYPE, _add_tags: triggerValue }, params, options)\n\t}\n\n\tasync _remove_tags(id: string | LineItemOption, triggerValue: string, params?: QueryParamsRetrieve<LineItemOption>, options?: ResourcesConfig): Promise<LineItemOption> {\n\t\treturn this.resources.update<LineItemOptionUpdate, LineItemOption>({ id: (typeof id === 'string')? id: id.id, type: LineItemOptions.TYPE, _remove_tags: triggerValue }, params, options)\n\t}\n\n\n\tisLineItemOption(resource: any): resource is LineItemOption {\n\t\treturn resource.type && (resource.type === LineItemOptions.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): LineItemOptionRel {\n\t\treturn super.relationshipOneToOne<LineItemOptionRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): LineItemOptionRel[] {\n\t\treturn super.relationshipOneToMany<LineItemOptionRel>(...ids)\n\t}\n\n\n\ttype(): LineItemOptionType {\n\t\treturn LineItemOptions.TYPE\n\t}\n\n}\n\n\nconst instance = new LineItemOptions()\nexport default instance\n\nexport type { LineItemOptions, LineItemOption, LineItemOptionCreate, LineItemOptionUpdate, LineItemOptionType }\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/resources/line_items.ts"],"names":["ApiResource"],"mappings":";;;;AAuYA,MAAM,kBAAkBA,oBAAsB,CAAA;AAAA,EAE7C,OAAgB,IAAqB,GAAA,YAAA;AAAA,EAErC,MAAM,MAAA,CAAO,QAA0B,EAAA,MAAA,EAAwC,OAA8C,EAAA;AAC5H,I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A;AAClD,EAEA,sBAAsB,GAA8B,EAAA;AACnD,IAAO,OAAA,KAAA,CAAM,qBAAmC,CAAA,GAAG,GAAG,CAAA;AAAA;AACvD,EAGA,IAAqB,GAAA;AACpB,IAAA,OAAO,SAAU,CAAA,IAAA;AAAA;AAGnB;AAGA,MAAM,QAAA,GAAW,IAAI,SAAU,EAAA;AAC/B,IAAO,kBAAQ,GAAA","file":"line_items.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 { LineItemOption } from './line_item_options'\nimport type { ReturnLineItem } from './return_line_items'\nimport type { StockReservation } from './stock_reservations'\nimport type { StockLineItem } from './stock_line_items'\nimport type { StockTransfer } from './stock_transfers'\nimport type { Notification } from './notifications'\nimport type { Event } from './events'\nimport type { Tag, TagType } from './tags'\nimport type { Sku, SkuType } from './skus'\nimport type { Bundle, BundleType } from './bundles'\nimport type { GiftCard, GiftCardType } from './gift_cards'\nimport type { Shipment, ShipmentType } from './shipments'\nimport type { PaymentMethod, PaymentMethodType } from './payment_methods'\nimport type { Adjustment, AdjustmentType } from './adjustments'\nimport type { DiscountEngineItem, DiscountEngineItemType } from './discount_engine_items'\nimport type { PercentageDiscountPromotion, PercentageDiscountPromotionType } from './percentage_discount_promotions'\nimport type { FreeShippingPromotion, FreeShippingPromotionType } from './free_shipping_promotions'\nimport type { BuyXPayYPromotion, BuyXPayYPromotionType } from './buy_x_pay_y_promotions'\nimport type { FreeGiftPromotion, FreeGiftPromotionType } from './free_gift_promotions'\nimport type { FixedPricePromotion, FixedPricePromotionType } from './fixed_price_promotions'\nimport type { ExternalPromotion, ExternalPromotionType } from './external_promotions'\nimport type { FixedAmountPromotion, FixedAmountPromotionType } from './fixed_amount_promotions'\nimport type { FlexPromotion, FlexPromotionType } from './flex_promotions'\n\n\ntype LineItemType = 'line_items'\ntype LineItemRel = ResourceRel & { type: LineItemType }\ntype OrderRel = ResourceRel & { type: OrderType }\ntype SkuRel = ResourceRel & { type: SkuType }\ntype BundleRel = ResourceRel & { type: BundleType }\ntype GiftCardRel = ResourceRel & { type: GiftCardType }\ntype ShipmentRel = ResourceRel & { type: ShipmentType }\ntype PaymentMethodRel = ResourceRel & { type: PaymentMethodType }\ntype AdjustmentRel = ResourceRel & { type: AdjustmentType }\ntype DiscountEngineItemRel = ResourceRel & { type: DiscountEngineItemType }\ntype PercentageDiscountPromotionRel = ResourceRel & { type: PercentageDiscountPromotionType }\ntype FreeShippingPromotionRel = ResourceRel & { type: FreeShippingPromotionType }\ntype BuyXPayYPromotionRel = ResourceRel & { type: BuyXPayYPromotionType }\ntype FreeGiftPromotionRel = ResourceRel & { type: FreeGiftPromotionType }\ntype FixedPricePromotionRel = ResourceRel & { type: FixedPricePromotionType }\ntype ExternalPromotionRel = ResourceRel & { type: ExternalPromotionType }\ntype FixedAmountPromotionRel = ResourceRel & { type: FixedAmountPromotionType }\ntype FlexPromotionRel = ResourceRel & { type: FlexPromotionType }\ntype TagRel = ResourceRel & { type: TagType }\n\n\nexport type LineItemSort = Pick<LineItem, 'id' | 'currency_code' | 'unit_amount_cents' | 'compare_at_amount_cents' | 'options_amount_cents' | 'discount_cents' | 'total_amount_cents' | 'tax_amount_cents' | 'name' | 'item_type' | 'circuit_state' | 'circuit_failure_count'> & ResourceSort\n// export type LineItemFilter = Pick<LineItem, 'id' | 'sku_code' | 'quantity' | 'currency_code' | 'unit_amount_cents' | 'compare_at_amount_cents' | 'options_amount_cents' | 'discount_cents' | 'total_amount_cents' | 'tax_amount_cents' | 'name' | 'image_url' | 'item_type' | 'circuit_state' | 'circuit_failure_count'> & ResourceFilter\n\n\ninterface LineItem extends Resource {\n\t\n\treadonly type: LineItemType\n\n\t/** \n\t * The code of the associated SKU.\n\t * @example ```\"TSHIRTMM000000FFFFFFXLXX\"```\n\t */\n\tsku_code?: string | null\n\t/** \n\t * The code of the associated bundle.\n\t * @example ```\"BUNDLEMM000000FFFFFFXLXX\"```\n\t */\n\tbundle_code?: string | null\n\t/** \n\t * The line item quantity.\n\t * @example ```4```\n\t */\n\tquantity: number\n\t/** \n\t * When creating or updating a new line item, set this attribute to '1' if you want to inject the unit_amount_cents price from an external source. Any successive price computation will be done externally, until the attribute is reset to '0'.\n\t * @example ```true```\n\t */\n\t_external_price?: boolean | null\n\t/** \n\t * The international 3-letter currency code as defined by the ISO 4217 standard, automatically inherited from the order's market.\n\t * @example ```\"EUR\"```\n\t */\n\tcurrency_code?: string | null\n\t/** \n\t * The unit amount of the line item, in cents. Can be specified only via an integration application, or when the item is missing, otherwise is automatically computed by using one of the available methods. Cannot be passed by sales channels.\n\t * @example ```10000```\n\t */\n\tunit_amount_cents?: number | null\n\t/** \n\t * The unit amount of the line item, float. This can be useful to track the purchase on thrid party systems, e.g Google Analyitcs Enhanced Ecommerce.\n\t * @example ```100```\n\t */\n\tunit_amount_float?: number | null\n\t/** \n\t * The unit amount of the line item, formatted. This can be useful to display the amount with currency in you views.\n\t * @example ```\"€100,00\"```\n\t */\n\tformatted_unit_amount?: string | null\n\t/** \n\t * The compared price amount, in cents. Useful to display a percentage discount.\n\t * @example ```13000```\n\t */\n\tcompare_at_amount_cents?: number | null\n\t/** \n\t * The compared price amount, float.\n\t * @example ```130```\n\t */\n\tcompare_at_amount_float?: number | null\n\t/** \n\t * The compared price amount, formatted.\n\t * @example ```\"€130,00\"```\n\t */\n\tformatted_compare_at_amount?: string | null\n\t/** \n\t * The options amount of the line item, in cents. Cannot be passed by sales channels.\n\t * @example ```1000```\n\t */\n\toptions_amount_cents?: number | null\n\t/** \n\t * The options amount of the line item, float.\n\t * @example ```10```\n\t */\n\toptions_amount_float?: number | null\n\t/** \n\t * The options amount of the line item, formatted.\n\t * @example ```\"€10,00\"```\n\t */\n\tformatted_options_amount?: string | null\n\t/** \n\t * The discount applied to the line item, in cents. When you apply a discount to an order, this is automatically calculated basing on the line item total_amount_cents value.\n\t * @example ```-1000```\n\t */\n\tdiscount_cents?: number | null\n\t/** \n\t * The discount applied to the line item, float. When you apply a discount to an order, this is automatically calculated basing on the line item total_amount_cents value.\n\t * @example ```10```\n\t */\n\tdiscount_float?: number | null\n\t/** \n\t * The discount applied to the line item, fromatted. When you apply a discount to an order, this is automatically calculated basing on the line item total_amount_cents value.\n\t * @example ```\"€10,00\"```\n\t */\n\tformatted_discount?: string | null\n\t/** \n\t * Calculated as unit amount x quantity + options amount, in cents.\n\t * @example ```18800```\n\t */\n\ttotal_amount_cents?: number | null\n\t/** \n\t * Calculated as unit amount x quantity + options amount, float. This can be useful to track the purchase on thrid party systems, e.g Google Analyitcs Enhanced Ecommerce.\n\t * @example ```188```\n\t */\n\ttotal_amount_float: number\n\t/** \n\t * Calculated as unit amount x quantity + options amount, formatted. This can be useful to display the amount with currency in you views.\n\t * @example ```\"€188,00\"```\n\t */\n\tformatted_total_amount?: string | null\n\t/** \n\t * The collected tax amount, otherwise calculated as total amount cents - discount cent * tax rate, in cents.\n\t * @example ```1880```\n\t */\n\ttax_amount_cents?: number | null\n\t/** \n\t * The collected tax amount, otherwise calculated as total amount cents - discount cent * tax rate, float.\n\t * @example ```18.8```\n\t */\n\ttax_amount_float: number\n\t/** \n\t * The collected tax amount, otherwise calculated as total amount cents - discount cent * tax rate, formatted.\n\t * @example ```\"€18,80\"```\n\t */\n\tformatted_tax_amount?: string | null\n\t/** \n\t * The name of the line item. When blank, it gets populated with the name of the associated item (if present).\n\t * @example ```\"Men's Black T-shirt with White Logo (XL)\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The image_url of the line item. When blank, it gets populated with the image_url of the associated item (if present, SKU only).\n\t * @example ```\"https://img.yourdomain.com/skus/xYZkjABcde.png\"```\n\t */\n\timage_url?: string | null\n\t/** \n\t * The discount breakdown for this line item (if calculated).\n\t * @example ```{\"41\":{\"name\":\"10% ALL\",\"cents\":-900,\"weight\":0.416,\"coupon_code\":\"XXXXXXXX\"}}```\n\t */\n\tdiscount_breakdown?: Record<string, any> | null\n\t/** \n\t * The tax rate for this line item (if calculated).\n\t * @example ```0.22```\n\t */\n\ttax_rate?: number | null\n\t/** \n\t * The tax breakdown for this line item (if calculated).\n\t * @example ```{\"id\":\"1234\",\"city_amount\":\"0.0\",\"state_amount\":6.6,\"city_tax_rate\":0,\"county_amount\":2.78,\"taxable_amount\":139,\"county_tax_rate\":0.02,\"tax_collectable\":10.08,\"special_tax_rate\":0.005,\"combined_tax_rate\":0.0725,\"city_taxable_amount\":0,\"state_sales_tax_rate\":0.0475,\"state_taxable_amount\":139,\"county_taxable_amount\":139,\"special_district_amount\":0.7,\"special_district_taxable_amount\":139}```\n\t */\n\ttax_breakdown?: Record<string, any> | null\n\t/** \n\t * The type of the associated item. One of 'skus', 'bundles', 'gift_cards', 'shipments', 'payment_methods', 'adjustments', 'discount_engine_items', 'percentage_discount_promotions', 'free_shipping_promotions', 'buy_x_pay_y_promotions', 'free_gift_promotions', 'fixed_price_promotions', 'external_promotions', 'fixed_amount_promotions', or 'flex_promotions'.\n\t * @example ```\"skus\"```\n\t */\n\titem_type?: 'skus' | 'bundles' | 'gift_cards' | 'shipments' | 'payment_methods' | 'adjustments' | 'discount_engine_items' | 'percentage_discount_promotions' | 'free_shipping_promotions' | 'buy_x_pay_y_promotions' | 'free_gift_promotions' | 'fixed_price_promotions' | 'external_promotions' | 'fixed_amount_promotions' | 'flex_promotions' | null\n\t/** \n\t * The frequency which generates a subscription. Must be supported by existing associated subscription_model.\n\t * @example ```\"monthly\"```\n\t */\n\tfrequency?: string | null\n\t/** \n\t * The coupon code, if any, used to trigger this promotion line item. null for other line item types or if the promotion line item wasn't triggered by a coupon.\n\t * @example ```\"SUMMERDISCOUNT\"```\n\t */\n\tcoupon_code?: string | null\n\t/** \n\t * The circuit breaker state, by default it is 'closed'. It can become 'open' once the number of consecutive failures overlaps the specified threshold, in such case no further calls to the failing callback are made.\n\t * @example ```\"closed\"```\n\t */\n\tcircuit_state?: string | null\n\t/** \n\t * The number of consecutive failures recorded by the circuit breaker associated to this resource, will be reset on first successful call to callback.\n\t * @example ```5```\n\t */\n\tcircuit_failure_count?: number | null\n\n\torder?: Order | null\n\titem?: Sku | Bundle | GiftCard | Shipment | PaymentMethod | Adjustment | DiscountEngineItem | PercentageDiscountPromotion | FreeShippingPromotion | BuyXPayYPromotion | FreeGiftPromotion | FixedPricePromotion | ExternalPromotion | FixedAmountPromotion | FlexPromotion | null\n\tsku?: Sku | null\n\tbundle?: Bundle | null\n\tadjustment?: Adjustment | null\n\tgift_card?: GiftCard | null\n\tshipment?: Shipment | null\n\tpayment_method?: PaymentMethod | null\n\tline_item_options?: LineItemOption[] | null\n\treturn_line_items?: ReturnLineItem[] | null\n\tstock_reservations?: StockReservation[] | null\n\tstock_line_items?: StockLineItem[] | null\n\tstock_transfers?: StockTransfer[] | null\n\tnotifications?: Notification[] | null\n\tevents?: Event[] | null\n\ttags?: Tag[] | null\n\n}\n\n\ninterface LineItemCreate extends ResourceCreate {\n\t\n\t/** \n\t * The code of the associated SKU.\n\t * @example ```\"TSHIRTMM000000FFFFFFXLXX\"```\n\t */\n\tsku_code?: string | null\n\t/** \n\t * The code of the associated bundle.\n\t * @example ```\"BUNDLEMM000000FFFFFFXLXX\"```\n\t */\n\tbundle_code?: string | null\n\t/** \n\t * The line item quantity.\n\t * @example ```4```\n\t */\n\tquantity: number\n\t/** \n\t * When creating or updating a new line item, set this attribute to '1' if you want to inject the unit_amount_cents price from an external source. Any successive price computation will be done externally, until the attribute is reset to '0'.\n\t * @example ```true```\n\t */\n\t_external_price?: boolean | null\n\t/** \n\t * When creating a new line item, set this attribute to '1' if you want to update the line item quantity (if present) instead of creating a new line item for the same SKU.\n\t * @example ```true```\n\t */\n\t_update_quantity?: boolean | null\n\t/** \n\t * Send this attribute if you want to reserve the stock for the line item's SKUs quantity. Stock reservations expiration depends on the inventory model's cutoff. When used on update the existing active stock reservations are renewed. Cannot be passed by sales channels.\n\t * @example ```true```\n\t */\n\t_reserve_stock?: boolean | null\n\t/** \n\t * The unit amount of the line item, in cents. Can be specified only via an integration application, or when the item is missing, otherwise is automatically computed by using one of the available methods. Cannot be passed by sales channels.\n\t * @example ```10000```\n\t */\n\tunit_amount_cents?: number | null\n\t/** \n\t * The compared price amount, in cents. Useful to display a percentage discount.\n\t * @example ```13000```\n\t */\n\tcompare_at_amount_cents?: number | null\n\t/** \n\t * The name of the line item. When blank, it gets populated with the name of the associated item (if present).\n\t * @example ```\"Men's Black T-shirt with White Logo (XL)\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The image_url of the line item. When blank, it gets populated with the image_url of the associated item (if present, SKU only).\n\t * @example ```\"https://img.yourdomain.com/skus/xYZkjABcde.png\"```\n\t */\n\timage_url?: string | null\n\t/** \n\t * The type of the associated item. One of 'skus', 'bundles', 'gift_cards', 'shipments', 'payment_methods', 'adjustments', 'discount_engine_items', 'percentage_discount_promotions', 'free_shipping_promotions', 'buy_x_pay_y_promotions', 'free_gift_promotions', 'fixed_price_promotions', 'external_promotions', 'fixed_amount_promotions', or 'flex_promotions'.\n\t * @example ```\"skus\"```\n\t */\n\titem_type?: 'skus' | 'bundles' | 'gift_cards' | 'shipments' | 'payment_methods' | 'adjustments' | 'discount_engine_items' | 'percentage_discount_promotions' | 'free_shipping_promotions' | 'buy_x_pay_y_promotions' | 'free_gift_promotions' | 'fixed_price_promotions' | 'external_promotions' | 'fixed_amount_promotions' | 'flex_promotions' | null\n\t/** \n\t * The frequency which generates a subscription. Must be supported by existing associated subscription_model.\n\t * @example ```\"monthly\"```\n\t */\n\tfrequency?: string | null\n\n\torder: OrderRel\n\titem?: SkuRel | BundleRel | GiftCardRel | ShipmentRel | PaymentMethodRel | AdjustmentRel | DiscountEngineItemRel | PercentageDiscountPromotionRel | FreeShippingPromotionRel | BuyXPayYPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel | FixedAmountPromotionRel | FlexPromotionRel | null\n\ttags?: TagRel[] | null\n\n}\n\n\ninterface LineItemUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The code of the associated SKU.\n\t * @example ```\"TSHIRTMM000000FFFFFFXLXX\"```\n\t */\n\tsku_code?: string | null\n\t/** \n\t * The code of the associated bundle.\n\t * @example ```\"BUNDLEMM000000FFFFFFXLXX\"```\n\t */\n\tbundle_code?: string | null\n\t/** \n\t * The line item quantity.\n\t * @example ```4```\n\t */\n\tquantity?: number | null\n\t/** \n\t * When creating or updating a new line item, set this attribute to '1' if you want to inject the unit_amount_cents price from an external source. Any successive price computation will be done externally, until the attribute is reset to '0'.\n\t * @example ```true```\n\t */\n\t_external_price?: boolean | null\n\t/** \n\t * Send this attribute if you want to reserve the stock for the line item's SKUs quantity. Stock reservations expiration depends on the inventory model's cutoff. When used on update the existing active stock reservations are renewed. Cannot be passed by sales channels.\n\t * @example ```true```\n\t */\n\t_reserve_stock?: boolean | null\n\t/** \n\t * The unit amount of the line item, in cents. Can be specified only via an integration application, or when the item is missing, otherwise is automatically computed by using one of the available methods. Cannot be passed by sales channels.\n\t * @example ```10000```\n\t */\n\tunit_amount_cents?: number | null\n\t/** \n\t * The compared price amount, in cents. Useful to display a percentage discount.\n\t * @example ```13000```\n\t */\n\tcompare_at_amount_cents?: number | null\n\t/** \n\t * The options amount of the line item, in cents. Cannot be passed by sales channels.\n\t * @example ```1000```\n\t */\n\toptions_amount_cents?: number | null\n\t/** \n\t * The name of the line item. When blank, it gets populated with the name of the associated item (if present).\n\t * @example ```\"Men's Black T-shirt with White Logo (XL)\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The image_url of the line item. When blank, it gets populated with the image_url of the associated item (if present, SKU only).\n\t * @example ```\"https://img.yourdomain.com/skus/xYZkjABcde.png\"```\n\t */\n\timage_url?: string | null\n\t/** \n\t * The frequency which generates a subscription. Must be supported by existing associated subscription_model.\n\t * @example ```\"monthly\"```\n\t */\n\tfrequency?: string | null\n\t/** \n\t * Send this attribute if you want to reset the circuit breaker associated to this resource to 'closed' state and zero failures count. Cannot be passed by sales channels.\n\t * @example ```true```\n\t */\n\t_reset_circuit?: boolean | null\n\t/** \n\t * Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_add_tags?: string | null\n\t/** \n\t * Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_remove_tags?: string | null\n\n\ttags?: TagRel[] | null\n\n}\n\n\nclass LineItems extends ApiResource<LineItem> {\n\n\tstatic readonly TYPE: LineItemType = 'line_items' as const\n\n\tasync create(resource: LineItemCreate, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\treturn this.resources.create<LineItemCreate, LineItem>({ ...resource, type: LineItems.TYPE }, params, options)\n\t}\n\n\tasync update(resource: LineItemUpdate, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\treturn this.resources.update<LineItemUpdate, LineItem>({ ...resource, type: LineItems.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: LineItems.TYPE } : id, options)\n\t}\n\n\tasync order(lineItemId: string | LineItem, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _lineItemId = (lineItemId as LineItem).id || lineItemId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `line_items/${_lineItemId}/order`, params, options) as unknown as Order\n\t}\n\n\tasync line_item_options(lineItemId: string | LineItem, params?: QueryParamsList<LineItemOption>, options?: ResourcesConfig): Promise<ListResponse<LineItemOption>> {\n\t\tconst _lineItemId = (lineItemId as LineItem).id || lineItemId as string\n\t\treturn this.resources.fetch<LineItemOption>({ type: 'line_item_options' }, `line_items/${_lineItemId}/line_item_options`, params, options) as unknown as ListResponse<LineItemOption>\n\t}\n\n\tasync return_line_items(lineItemId: string | LineItem, params?: QueryParamsList<ReturnLineItem>, options?: ResourcesConfig): Promise<ListResponse<ReturnLineItem>> {\n\t\tconst _lineItemId = (lineItemId as LineItem).id || lineItemId as string\n\t\treturn this.resources.fetch<ReturnLineItem>({ type: 'return_line_items' }, `line_items/${_lineItemId}/return_line_items`, params, options) as unknown as ListResponse<ReturnLineItem>\n\t}\n\n\tasync stock_reservations(lineItemId: string | LineItem, params?: QueryParamsList<StockReservation>, options?: ResourcesConfig): Promise<ListResponse<StockReservation>> {\n\t\tconst _lineItemId = (lineItemId as LineItem).id || lineItemId as string\n\t\treturn this.resources.fetch<StockReservation>({ type: 'stock_reservations' }, `line_items/${_lineItemId}/stock_reservations`, params, options) as unknown as ListResponse<StockReservation>\n\t}\n\n\tasync stock_line_items(lineItemId: string | LineItem, params?: QueryParamsList<StockLineItem>, options?: ResourcesConfig): Promise<ListResponse<StockLineItem>> {\n\t\tconst _lineItemId = (lineItemId as LineItem).id || lineItemId as string\n\t\treturn this.resources.fetch<StockLineItem>({ type: 'stock_line_items' }, `line_items/${_lineItemId}/stock_line_items`, params, options) as unknown as ListResponse<StockLineItem>\n\t}\n\n\tasync stock_transfers(lineItemId: string | LineItem, params?: QueryParamsList<StockTransfer>, options?: ResourcesConfig): Promise<ListResponse<StockTransfer>> {\n\t\tconst _lineItemId = (lineItemId as LineItem).id || lineItemId as string\n\t\treturn this.resources.fetch<StockTransfer>({ type: 'stock_transfers' }, `line_items/${_lineItemId}/stock_transfers`, params, options) as unknown as ListResponse<StockTransfer>\n\t}\n\n\tasync notifications(lineItemId: string | LineItem, params?: QueryParamsList<Notification>, options?: ResourcesConfig): Promise<ListResponse<Notification>> {\n\t\tconst _lineItemId = (lineItemId as LineItem).id || lineItemId as string\n\t\treturn this.resources.fetch<Notification>({ type: 'notifications' }, `line_items/${_lineItemId}/notifications`, params, options) as unknown as ListResponse<Notification>\n\t}\n\n\tasync events(lineItemId: string | LineItem, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _lineItemId = (lineItemId as LineItem).id || lineItemId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `line_items/${_lineItemId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync tags(lineItemId: string | LineItem, params?: QueryParamsList<Tag>, options?: ResourcesConfig): Promise<ListResponse<Tag>> {\n\t\tconst _lineItemId = (lineItemId as LineItem).id || lineItemId as string\n\t\treturn this.resources.fetch<Tag>({ type: 'tags' }, `line_items/${_lineItemId}/tags`, params, options) as unknown as ListResponse<Tag>\n\t}\n\n\tasync _external_price(id: string | LineItem, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\treturn this.resources.update<LineItemUpdate, LineItem>({ id: (typeof id === 'string')? id: id.id, type: LineItems.TYPE, _external_price: true }, params, options)\n\t}\n\n\tasync _reserve_stock(id: string | LineItem, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\treturn this.resources.update<LineItemUpdate, LineItem>({ id: (typeof id === 'string')? id: id.id, type: LineItems.TYPE, _reserve_stock: true }, params, options)\n\t}\n\n\tasync _reset_circuit(id: string | LineItem, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\treturn this.resources.update<LineItemUpdate, LineItem>({ id: (typeof id === 'string')? id: id.id, type: LineItems.TYPE, _reset_circuit: true }, params, options)\n\t}\n\n\tasync _add_tags(id: string | LineItem, triggerValue: string, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\treturn this.resources.update<LineItemUpdate, LineItem>({ id: (typeof id === 'string')? id: id.id, type: LineItems.TYPE, _add_tags: triggerValue }, params, options)\n\t}\n\n\tasync _remove_tags(id: string | LineItem, triggerValue: string, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\treturn this.resources.update<LineItemUpdate, LineItem>({ id: (typeof id === 'string')? id: id.id, type: LineItems.TYPE, _remove_tags: triggerValue }, params, options)\n\t}\n\n\n\tisLineItem(resource: any): resource is LineItem {\n\t\treturn resource.type && (resource.type === LineItems.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): LineItemRel {\n\t\treturn super.relationshipOneToOne<LineItemRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): LineItemRel[] {\n\t\treturn super.relationshipOneToMany<LineItemRel>(...ids)\n\t}\n\n\n\ttype(): LineItemType {\n\t\treturn LineItems.TYPE\n\t}\n\n}\n\n\nconst instance = new LineItems()\nexport default instance\n\nexport type { LineItem, LineItemCreate, LineItemUpdate, LineItemType }\n"]}
|
1
|
+
{"version":3,"sources":["../../src/resources/line_items.ts"],"names":["ApiResource"],"mappings":";;;;AAuYA,MAAM,kBAAkBA,oBAAsB,CAAA;AAAA,EAE7C,OAAgB,IAAqB,GAAA,YAAA;AAAA,EAErC,MAAM,MAAA,CAAO,QAA0B,EAAA,MAAA,EAAwC,OAA8C,EAAA;AAC5H,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAAiC,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,SAAU,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC9G,EAEA,MAAM,MAAA,CAAO,QAA0B,EAAA,MAAA,EAAwC,OAA8C,EAAA;AAC5H,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAAiC,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,SAAU,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC9G,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,SAAA,CAAU,IAAK,EAAA,GAAI,IAAI,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AE,EAAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,SAAU,CAAA,IAAA,EAAM,WAAW,YAAa,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AACnK,EAEA,MAAM,YAAA,CAAa,EAAuB,EAAA,YAAA,EAAsB,QAAwC,OAA8C,EAAA;AACrJ,IAAA,OAAO,KAAK,SAAU,CAAA,MAAA,CAAiC,EAAE,EAAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,SAAU,CAAA,IAAA,EAAM,cAAc,YAAa,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AACtK,EAGA,WAAW,QAAqC,EAAA;AAC/C,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,SAAU,CAAA,IAAA;AAAA;AACtD,EAGA,aAAa,EAA6C,EAAA;AACzD,IAAO,OAAA,KAAA,CAAM,qBAAkC,EAAE,CAAA;AAAA;AAClD,EAEA,sBAAsB,GAA8B,EAAA;AACnD,IAAO,OAAA,KAAA,CAAM,qBAAmC,CAAA,GAAG,GAAG,CAAA;AAAA;AACvD,EAGA,IAAqB,GAAA;AACpB,IAAA,OAAO,SAAU,CAAA,IAAA;AAAA;AAGnB;AAGA,MAAM,QAAA,GAAW,IAAI,SAAU,EAAA;AAC/B,IAAO,kBAAQ,GAAA","file":"line_items.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 { LineItemOption } from './line_item_options'\nimport type { ReturnLineItem } from './return_line_items'\nimport type { StockReservation } from './stock_reservations'\nimport type { StockLineItem } from './stock_line_items'\nimport type { StockTransfer } from './stock_transfers'\nimport type { Notification } from './notifications'\nimport type { Event } from './events'\nimport type { Tag, TagType } from './tags'\nimport type { Sku, SkuType } from './skus'\nimport type { Bundle, BundleType } from './bundles'\nimport type { GiftCard, GiftCardType } from './gift_cards'\nimport type { Shipment, ShipmentType } from './shipments'\nimport type { PaymentMethod, PaymentMethodType } from './payment_methods'\nimport type { Adjustment, AdjustmentType } from './adjustments'\nimport type { DiscountEngineItem, DiscountEngineItemType } from './discount_engine_items'\nimport type { PercentageDiscountPromotion, PercentageDiscountPromotionType } from './percentage_discount_promotions'\nimport type { FreeShippingPromotion, FreeShippingPromotionType } from './free_shipping_promotions'\nimport type { BuyXPayYPromotion, BuyXPayYPromotionType } from './buy_x_pay_y_promotions'\nimport type { FreeGiftPromotion, FreeGiftPromotionType } from './free_gift_promotions'\nimport type { FixedPricePromotion, FixedPricePromotionType } from './fixed_price_promotions'\nimport type { ExternalPromotion, ExternalPromotionType } from './external_promotions'\nimport type { FixedAmountPromotion, FixedAmountPromotionType } from './fixed_amount_promotions'\nimport type { FlexPromotion, FlexPromotionType } from './flex_promotions'\n\n\ntype LineItemType = 'line_items'\ntype LineItemRel = ResourceRel & { type: LineItemType }\ntype OrderRel = ResourceRel & { type: OrderType }\ntype SkuRel = ResourceRel & { type: SkuType }\ntype BundleRel = ResourceRel & { type: BundleType }\ntype GiftCardRel = ResourceRel & { type: GiftCardType }\ntype ShipmentRel = ResourceRel & { type: ShipmentType }\ntype PaymentMethodRel = ResourceRel & { type: PaymentMethodType }\ntype AdjustmentRel = ResourceRel & { type: AdjustmentType }\ntype DiscountEngineItemRel = ResourceRel & { type: DiscountEngineItemType }\ntype PercentageDiscountPromotionRel = ResourceRel & { type: PercentageDiscountPromotionType }\ntype FreeShippingPromotionRel = ResourceRel & { type: FreeShippingPromotionType }\ntype BuyXPayYPromotionRel = ResourceRel & { type: BuyXPayYPromotionType }\ntype FreeGiftPromotionRel = ResourceRel & { type: FreeGiftPromotionType }\ntype FixedPricePromotionRel = ResourceRel & { type: FixedPricePromotionType }\ntype ExternalPromotionRel = ResourceRel & { type: ExternalPromotionType }\ntype FixedAmountPromotionRel = ResourceRel & { type: FixedAmountPromotionType }\ntype FlexPromotionRel = ResourceRel & { type: FlexPromotionType }\ntype TagRel = ResourceRel & { type: TagType }\n\n\nexport type LineItemSort = Pick<LineItem, 'id' | 'currency_code' | 'unit_amount_cents' | 'compare_at_amount_cents' | 'options_amount_cents' | 'discount_cents' | 'total_amount_cents' | 'tax_amount_cents' | 'name' | 'item_type' | 'circuit_state' | 'circuit_failure_count'> & ResourceSort\n// export type LineItemFilter = Pick<LineItem, 'id' | 'sku_code' | 'quantity' | 'currency_code' | 'unit_amount_cents' | 'compare_at_amount_cents' | 'options_amount_cents' | 'discount_cents' | 'total_amount_cents' | 'tax_amount_cents' | 'name' | 'image_url' | 'item_type' | 'circuit_state' | 'circuit_failure_count'> & ResourceFilter\n\n\ninterface LineItem extends Resource {\n\t\n\treadonly type: LineItemType\n\n\t/** \n\t * The code of the associated SKU.\n\t * @example ```\"TSHIRTMM000000FFFFFFXLXX\"```\n\t */\n\tsku_code?: string | null\n\t/** \n\t * The code of the associated bundle.\n\t * @example ```\"BUNDLEMM000000FFFFFFXLXX\"```\n\t */\n\tbundle_code?: string | null\n\t/** \n\t * The line item quantity.\n\t * @example ```4```\n\t */\n\tquantity: number\n\t/** \n\t * When creating or updating a new line item, set this attribute to '1' if you want to inject the unit_amount_cents price from an external source. Any successive price computation will be done externally, until the attribute is reset to '0'.\n\t * @example ```true```\n\t */\n\t_external_price?: boolean | null\n\t/** \n\t * The international 3-letter currency code as defined by the ISO 4217 standard, automatically inherited from the order's market.\n\t * @example ```\"EUR\"```\n\t */\n\tcurrency_code?: string | null\n\t/** \n\t * The unit amount of the line item, in cents. Can be specified only via an integration application, or when the item is missing, otherwise is automatically computed by using one of the available methods. Cannot be passed by sales channels.\n\t * @example ```10000```\n\t */\n\tunit_amount_cents?: number | null\n\t/** \n\t * The unit amount of the line item, float. This can be useful to track the purchase on thrid party systems, e.g Google Analyitcs Enhanced Ecommerce.\n\t * @example ```100```\n\t */\n\tunit_amount_float?: number | null\n\t/** \n\t * The unit amount of the line item, formatted. This can be useful to display the amount with currency in you views.\n\t * @example ```\"€100,00\"```\n\t */\n\tformatted_unit_amount?: string | null\n\t/** \n\t * The compared price amount, in cents. Useful to display a percentage discount.\n\t * @example ```13000```\n\t */\n\tcompare_at_amount_cents?: number | null\n\t/** \n\t * The compared price amount, float.\n\t * @example ```130```\n\t */\n\tcompare_at_amount_float?: number | null\n\t/** \n\t * The compared price amount, formatted.\n\t * @example ```\"€130,00\"```\n\t */\n\tformatted_compare_at_amount?: string | null\n\t/** \n\t * The options amount of the line item, in cents. Cannot be passed by sales channels.\n\t * @example ```1000```\n\t */\n\toptions_amount_cents?: number | null\n\t/** \n\t * The options amount of the line item, float.\n\t * @example ```10```\n\t */\n\toptions_amount_float?: number | null\n\t/** \n\t * The options amount of the line item, formatted.\n\t * @example ```\"€10,00\"```\n\t */\n\tformatted_options_amount?: string | null\n\t/** \n\t * The discount applied to the line item, in cents. When you apply a discount to an order, this is automatically calculated basing on the line item total_amount_cents value.\n\t * @example ```-1000```\n\t */\n\tdiscount_cents?: number | null\n\t/** \n\t * The discount applied to the line item, float. When you apply a discount to an order, this is automatically calculated basing on the line item total_amount_cents value.\n\t * @example ```10```\n\t */\n\tdiscount_float?: number | null\n\t/** \n\t * The discount applied to the line item, fromatted. When you apply a discount to an order, this is automatically calculated basing on the line item total_amount_cents value.\n\t * @example ```\"€10,00\"```\n\t */\n\tformatted_discount?: string | null\n\t/** \n\t * Calculated as unit amount x quantity + options amount, in cents.\n\t * @example ```18800```\n\t */\n\ttotal_amount_cents?: number | null\n\t/** \n\t * Calculated as unit amount x quantity + options amount, float. This can be useful to track the purchase on thrid party systems, e.g Google Analyitcs Enhanced Ecommerce.\n\t * @example ```188```\n\t */\n\ttotal_amount_float: number\n\t/** \n\t * Calculated as unit amount x quantity + options amount, formatted. This can be useful to display the amount with currency in you views.\n\t * @example ```\"€188,00\"```\n\t */\n\tformatted_total_amount?: string | null\n\t/** \n\t * The collected tax amount, otherwise calculated as total amount cents - discount cent * tax rate, in cents.\n\t * @example ```1880```\n\t */\n\ttax_amount_cents?: number | null\n\t/** \n\t * The collected tax amount, otherwise calculated as total amount cents - discount cent * tax rate, float.\n\t * @example ```18.8```\n\t */\n\ttax_amount_float: number\n\t/** \n\t * The collected tax amount, otherwise calculated as total amount cents - discount cent * tax rate, formatted.\n\t * @example ```\"€18,80\"```\n\t */\n\tformatted_tax_amount?: string | null\n\t/** \n\t * The name of the line item. When blank, it gets populated with the name of the associated item (if present).\n\t * @example ```\"Men's Black T-shirt with White Logo (XL)\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The image_url of the line item. When blank, it gets populated with the image_url of the associated item (if present, SKU only).\n\t * @example ```\"https://img.yourdomain.com/skus/xYZkjABcde.png\"```\n\t */\n\timage_url?: string | null\n\t/** \n\t * The discount breakdown for this line item (if calculated).\n\t * @example ```{\"41\":{\"name\":\"10% ALL\",\"cents\":-900,\"weight\":0.416,\"coupon_code\":\"XXXXXXXX\"}}```\n\t */\n\tdiscount_breakdown?: Record<string, any> | null\n\t/** \n\t * The tax rate for this line item (if calculated).\n\t * @example ```0.22```\n\t */\n\ttax_rate?: number | null\n\t/** \n\t * The tax breakdown for this line item (if calculated).\n\t * @example ```{\"id\":\"1234\",\"city_amount\":\"0.0\",\"state_amount\":6.6,\"city_tax_rate\":0,\"county_amount\":2.78,\"taxable_amount\":139,\"county_tax_rate\":0.02,\"tax_collectable\":10.08,\"special_tax_rate\":0.005,\"combined_tax_rate\":0.0725,\"city_taxable_amount\":0,\"state_sales_tax_rate\":0.0475,\"state_taxable_amount\":139,\"county_taxable_amount\":139,\"special_district_amount\":0.7,\"special_district_taxable_amount\":139}```\n\t */\n\ttax_breakdown?: Record<string, any> | null\n\t/** \n\t * The type of the associated item. One of 'skus', 'bundles', 'gift_cards', 'shipments', 'payment_methods', 'adjustments', 'discount_engine_items', 'percentage_discount_promotions', 'free_shipping_promotions', 'buy_x_pay_y_promotions', 'free_gift_promotions', 'fixed_price_promotions', 'external_promotions', 'fixed_amount_promotions', or 'flex_promotions'.\n\t * @example ```\"skus\"```\n\t */\n\titem_type?: 'skus' | 'bundles' | 'gift_cards' | 'shipments' | 'payment_methods' | 'adjustments' | 'discount_engine_items' | 'percentage_discount_promotions' | 'free_shipping_promotions' | 'buy_x_pay_y_promotions' | 'free_gift_promotions' | 'fixed_price_promotions' | 'external_promotions' | 'fixed_amount_promotions' | 'flex_promotions' | null\n\t/** \n\t * The frequency which generates a subscription. Must be supported by existing associated subscription_model.\n\t * @example ```\"monthly\"```\n\t */\n\tfrequency?: string | null\n\t/** \n\t * The coupon code, if any, used to trigger this promotion line item. null for other line item types or if the promotion line item wasn't triggered by a coupon.\n\t * @example ```\"SUMMERDISCOUNT\"```\n\t */\n\tcoupon_code?: string | null\n\t/** \n\t * The circuit breaker state, by default it is 'closed'. It can become 'open' once the number of consecutive failures overlaps the specified threshold, in such case no further calls to the failing callback are made.\n\t * @example ```\"closed\"```\n\t */\n\tcircuit_state?: string | null\n\t/** \n\t * The number of consecutive failures recorded by the circuit breaker associated to this resource, will be reset on first successful call to callback.\n\t * @example ```5```\n\t */\n\tcircuit_failure_count?: number | null\n\n\torder?: Order | null\n\titem?: Sku | Bundle | GiftCard | Shipment | PaymentMethod | Adjustment | DiscountEngineItem | PercentageDiscountPromotion | FreeShippingPromotion | BuyXPayYPromotion | FreeGiftPromotion | FixedPricePromotion | ExternalPromotion | FixedAmountPromotion | FlexPromotion | null\n\tsku?: Sku | null\n\tbundle?: Bundle | null\n\tadjustment?: Adjustment | null\n\tgift_card?: GiftCard | null\n\tshipment?: Shipment | null\n\tpayment_method?: PaymentMethod | null\n\tline_item_options?: LineItemOption[] | null\n\treturn_line_items?: ReturnLineItem[] | null\n\tstock_reservations?: StockReservation[] | null\n\tstock_line_items?: StockLineItem[] | null\n\tstock_transfers?: StockTransfer[] | null\n\tnotifications?: Notification[] | null\n\tevents?: Event[] | null\n\ttags?: Tag[] | null\n\n}\n\n\ninterface LineItemCreate extends ResourceCreate {\n\t\n\t/** \n\t * The code of the associated SKU.\n\t * @example ```\"TSHIRTMM000000FFFFFFXLXX\"```\n\t */\n\tsku_code?: string | null\n\t/** \n\t * The code of the associated bundle.\n\t * @example ```\"BUNDLEMM000000FFFFFFXLXX\"```\n\t */\n\tbundle_code?: string | null\n\t/** \n\t * The line item quantity.\n\t * @example ```4```\n\t */\n\tquantity: number\n\t/** \n\t * When creating or updating a new line item, set this attribute to '1' if you want to inject the unit_amount_cents price from an external source. Any successive price computation will be done externally, until the attribute is reset to '0'.\n\t * @example ```true```\n\t */\n\t_external_price?: boolean | null\n\t/** \n\t * When creating a new line item, set this attribute to '1' if you want to update the line item quantity (if present) instead of creating a new line item for the same SKU.\n\t * @example ```true```\n\t */\n\t_update_quantity?: boolean | null\n\t/** \n\t * Send this attribute if you want to reserve the stock for the line item's SKUs quantity. Stock reservations expiration depends on the inventory model's cutoff. When used on update the existing active stock reservations are renewed. Cannot be passed by sales channels.\n\t * @example ```true```\n\t */\n\t_reserve_stock?: boolean | null\n\t/** \n\t * The unit amount of the line item, in cents. Can be specified only via an integration application, or when the item is missing, otherwise is automatically computed by using one of the available methods. Cannot be passed by sales channels.\n\t * @example ```10000```\n\t */\n\tunit_amount_cents?: number | null\n\t/** \n\t * The compared price amount, in cents. Useful to display a percentage discount.\n\t * @example ```13000```\n\t */\n\tcompare_at_amount_cents?: number | null\n\t/** \n\t * The name of the line item. When blank, it gets populated with the name of the associated item (if present).\n\t * @example ```\"Men's Black T-shirt with White Logo (XL)\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The image_url of the line item. When blank, it gets populated with the image_url of the associated item (if present, SKU only).\n\t * @example ```\"https://img.yourdomain.com/skus/xYZkjABcde.png\"```\n\t */\n\timage_url?: string | null\n\t/** \n\t * The type of the associated item. One of 'skus', 'bundles', 'gift_cards', 'shipments', 'payment_methods', 'adjustments', 'discount_engine_items', 'percentage_discount_promotions', 'free_shipping_promotions', 'buy_x_pay_y_promotions', 'free_gift_promotions', 'fixed_price_promotions', 'external_promotions', 'fixed_amount_promotions', or 'flex_promotions'.\n\t * @example ```\"skus\"```\n\t */\n\titem_type?: 'skus' | 'bundles' | 'gift_cards' | 'shipments' | 'payment_methods' | 'adjustments' | 'discount_engine_items' | 'percentage_discount_promotions' | 'free_shipping_promotions' | 'buy_x_pay_y_promotions' | 'free_gift_promotions' | 'fixed_price_promotions' | 'external_promotions' | 'fixed_amount_promotions' | 'flex_promotions' | null\n\t/** \n\t * The frequency which generates a subscription. Must be supported by existing associated subscription_model.\n\t * @example ```\"monthly\"```\n\t */\n\tfrequency?: string | null\n\n\torder: OrderRel\n\titem?: SkuRel | BundleRel | GiftCardRel | ShipmentRel | PaymentMethodRel | AdjustmentRel | DiscountEngineItemRel | PercentageDiscountPromotionRel | FreeShippingPromotionRel | BuyXPayYPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel | FixedAmountPromotionRel | FlexPromotionRel | null\n\ttags?: TagRel[] | null\n\n}\n\n\ninterface LineItemUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The code of the associated SKU.\n\t * @example ```\"TSHIRTMM000000FFFFFFXLXX\"```\n\t */\n\tsku_code?: string | null\n\t/** \n\t * The code of the associated bundle.\n\t * @example ```\"BUNDLEMM000000FFFFFFXLXX\"```\n\t */\n\tbundle_code?: string | null\n\t/** \n\t * The line item quantity.\n\t * @example ```4```\n\t */\n\tquantity?: number | null\n\t/** \n\t * When creating or updating a new line item, set this attribute to '1' if you want to inject the unit_amount_cents price from an external source. Any successive price computation will be done externally, until the attribute is reset to '0'.\n\t * @example ```true```\n\t */\n\t_external_price?: boolean | null\n\t/** \n\t * Send this attribute if you want to reserve the stock for the line item's SKUs quantity. Stock reservations expiration depends on the inventory model's cutoff. When used on update the existing active stock reservations are renewed. Cannot be passed by sales channels.\n\t * @example ```true```\n\t */\n\t_reserve_stock?: boolean | null\n\t/** \n\t * The unit amount of the line item, in cents. Can be specified only via an integration application, or when the item is missing, otherwise is automatically computed by using one of the available methods. Cannot be passed by sales channels.\n\t * @example ```10000```\n\t */\n\tunit_amount_cents?: number | null\n\t/** \n\t * The compared price amount, in cents. Useful to display a percentage discount.\n\t * @example ```13000```\n\t */\n\tcompare_at_amount_cents?: number | null\n\t/** \n\t * The options amount of the line item, in cents. Cannot be passed by sales channels.\n\t * @example ```1000```\n\t */\n\toptions_amount_cents?: number | null\n\t/** \n\t * The name of the line item. When blank, it gets populated with the name of the associated item (if present).\n\t * @example ```\"Men's Black T-shirt with White Logo (XL)\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The image_url of the line item. When blank, it gets populated with the image_url of the associated item (if present, SKU only).\n\t * @example ```\"https://img.yourdomain.com/skus/xYZkjABcde.png\"```\n\t */\n\timage_url?: string | null\n\t/** \n\t * The frequency which generates a subscription. Must be supported by existing associated subscription_model.\n\t * @example ```\"monthly\"```\n\t */\n\tfrequency?: string | null\n\t/** \n\t * Send this attribute if you want to reset the circuit breaker associated to this resource to 'closed' state and zero failures count. Cannot be passed by sales channels.\n\t * @example ```true```\n\t */\n\t_reset_circuit?: boolean | null\n\t/** \n\t * Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_add_tags?: string | null\n\t/** \n\t * Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_remove_tags?: string | null\n\n\ttags?: TagRel[] | null\n\n}\n\n\nclass LineItems extends ApiResource<LineItem> {\n\n\tstatic readonly TYPE: LineItemType = 'line_items' as const\n\n\tasync create(resource: LineItemCreate, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\treturn this.resources.create<LineItemCreate, LineItem>({ ...resource, type: LineItems.TYPE }, params, options)\n\t}\n\n\tasync update(resource: LineItemUpdate, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\treturn this.resources.update<LineItemUpdate, LineItem>({ ...resource, type: LineItems.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: LineItems.TYPE } : id, options)\n\t}\n\n\tasync order(lineItemId: string | LineItem, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _lineItemId = (lineItemId as LineItem).id || lineItemId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `line_items/${_lineItemId}/order`, params, options) as unknown as Order\n\t}\n\n\tasync line_item_options(lineItemId: string | LineItem, params?: QueryParamsList<LineItemOption>, options?: ResourcesConfig): Promise<ListResponse<LineItemOption>> {\n\t\tconst _lineItemId = (lineItemId as LineItem).id || lineItemId as string\n\t\treturn this.resources.fetch<LineItemOption>({ type: 'line_item_options' }, `line_items/${_lineItemId}/line_item_options`, params, options) as unknown as ListResponse<LineItemOption>\n\t}\n\n\tasync return_line_items(lineItemId: string | LineItem, params?: QueryParamsList<ReturnLineItem>, options?: ResourcesConfig): Promise<ListResponse<ReturnLineItem>> {\n\t\tconst _lineItemId = (lineItemId as LineItem).id || lineItemId as string\n\t\treturn this.resources.fetch<ReturnLineItem>({ type: 'return_line_items' }, `line_items/${_lineItemId}/return_line_items`, params, options) as unknown as ListResponse<ReturnLineItem>\n\t}\n\n\tasync stock_reservations(lineItemId: string | LineItem, params?: QueryParamsList<StockReservation>, options?: ResourcesConfig): Promise<ListResponse<StockReservation>> {\n\t\tconst _lineItemId = (lineItemId as LineItem).id || lineItemId as string\n\t\treturn this.resources.fetch<StockReservation>({ type: 'stock_reservations' }, `line_items/${_lineItemId}/stock_reservations`, params, options) as unknown as ListResponse<StockReservation>\n\t}\n\n\tasync stock_line_items(lineItemId: string | LineItem, params?: QueryParamsList<StockLineItem>, options?: ResourcesConfig): Promise<ListResponse<StockLineItem>> {\n\t\tconst _lineItemId = (lineItemId as LineItem).id || lineItemId as string\n\t\treturn this.resources.fetch<StockLineItem>({ type: 'stock_line_items' }, `line_items/${_lineItemId}/stock_line_items`, params, options) as unknown as ListResponse<StockLineItem>\n\t}\n\n\tasync stock_transfers(lineItemId: string | LineItem, params?: QueryParamsList<StockTransfer>, options?: ResourcesConfig): Promise<ListResponse<StockTransfer>> {\n\t\tconst _lineItemId = (lineItemId as LineItem).id || lineItemId as string\n\t\treturn this.resources.fetch<StockTransfer>({ type: 'stock_transfers' }, `line_items/${_lineItemId}/stock_transfers`, params, options) as unknown as ListResponse<StockTransfer>\n\t}\n\n\tasync notifications(lineItemId: string | LineItem, params?: QueryParamsList<Notification>, options?: ResourcesConfig): Promise<ListResponse<Notification>> {\n\t\tconst _lineItemId = (lineItemId as LineItem).id || lineItemId as string\n\t\treturn this.resources.fetch<Notification>({ type: 'notifications' }, `line_items/${_lineItemId}/notifications`, params, options) as unknown as ListResponse<Notification>\n\t}\n\n\tasync events(lineItemId: string | LineItem, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _lineItemId = (lineItemId as LineItem).id || lineItemId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `line_items/${_lineItemId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync tags(lineItemId: string | LineItem, params?: QueryParamsList<Tag>, options?: ResourcesConfig): Promise<ListResponse<Tag>> {\n\t\tconst _lineItemId = (lineItemId as LineItem).id || lineItemId as string\n\t\treturn this.resources.fetch<Tag>({ type: 'tags' }, `line_items/${_lineItemId}/tags`, params, options) as unknown as ListResponse<Tag>\n\t}\n\n\tasync _external_price(id: string | LineItem, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\treturn this.resources.update<LineItemUpdate, LineItem>({ id: (typeof id === 'string')? id: id.id, type: LineItems.TYPE, _external_price: true }, params, options)\n\t}\n\n\tasync _reserve_stock(id: string | LineItem, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\treturn this.resources.update<LineItemUpdate, LineItem>({ id: (typeof id === 'string')? id: id.id, type: LineItems.TYPE, _reserve_stock: true }, params, options)\n\t}\n\n\tasync _reset_circuit(id: string | LineItem, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\treturn this.resources.update<LineItemUpdate, LineItem>({ id: (typeof id === 'string')? id: id.id, type: LineItems.TYPE, _reset_circuit: true }, params, options)\n\t}\n\n\tasync _add_tags(id: string | LineItem, triggerValue: string, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\treturn this.resources.update<LineItemUpdate, LineItem>({ id: (typeof id === 'string')? id: id.id, type: LineItems.TYPE, _add_tags: triggerValue }, params, options)\n\t}\n\n\tasync _remove_tags(id: string | LineItem, triggerValue: string, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\treturn this.resources.update<LineItemUpdate, LineItem>({ id: (typeof id === 'string')? id: id.id, type: LineItems.TYPE, _remove_tags: triggerValue }, params, options)\n\t}\n\n\n\tisLineItem(resource: any): resource is LineItem {\n\t\treturn resource.type && (resource.type === LineItems.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): LineItemRel {\n\t\treturn super.relationshipOneToOne<LineItemRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): LineItemRel[] {\n\t\treturn super.relationshipOneToMany<LineItemRel>(...ids)\n\t}\n\n\n\ttype(): LineItemType {\n\t\treturn LineItems.TYPE\n\t}\n\n}\n\n\nconst instance = new LineItems()\nexport default instance\n\nexport type { LineItems, LineItem, LineItemCreate, LineItemUpdate, LineItemType }\n"]}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export {
|
1
|
+
export { hh as LineItem, hi as LineItemCreate, hk as LineItemSort, mv as LineItemType, hj as LineItemUpdate, bA as LineItems, bz 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 { hh as LineItem, hi as LineItemCreate, hk as LineItemSort, mv as LineItemType, hj as LineItemUpdate, bA as LineItems, bz 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/line_items.ts"],"names":[],"mappings":";;AAuYA,MAAM,kBAAkB,WAAsB,CAAA;AAAA,EAE7C,OAAgB,IAAqB,GAAA,YAAA;AAAA,EAErC,MAAM,MAAA,CAAO,QAA0B,EAAA,MAAA,EAAwC,OAA8C,EAAA;AAC5H,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAAiC,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,SAAU,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC9G,EAEA,MAAM,MAAA,CAAO,QAA0B,EAAA,MAAA,EAAwC,OAA8C,EAAA;AAC5H,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAAiC,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,SAAU,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC9G,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,SAAA,CAAU,IAAK,EAAA,GAAI,IAAI,OAAO,CAAA;AAAA;AACjG,EAEA,MAAM,KAAA,CAAM,UAA+B,EAAA,MAAA,EAAqC,OAA2C,EAAA;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CAAA,IAAA,EAAM,WAAW,YAAa,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AACnK,EAEA,MAAM,YAAA,CAAa,EAAuB,EAAA,YAAA,EAAsB,QAAwC,OAA8C,EAAA;AACrJ,IAAA,OAAO,KAAK,SAAU,CAAA,MAAA,CAAiC,EAAE,EAAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,SAAU,CAAA,IAAA,EAAM,cAAc,YAAa,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AACtK,EAGA,WAAW,QAAqC,EAAA;AAC/C,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,SAAU,CAAA,IAAA;AAAA;AACtD,EAGA,aAAa,EAA6C,EAAA;AACzD,IAAO,OAAA,KAAA,CAAM,qBAAkC,EAAE,CAAA;AAAA;AAClD,EAEA,sBAAsB,GAA8B,EAAA;AACnD,IAAO,OAAA,KAAA,CAAM,qBAAmC,CAAA,GAAG,GAAG,CAAA;AAAA;AACvD,EAGA,IAAqB,GAAA;AACpB,IAAA,OAAO,SAAU,CAAA,IAAA;AAAA;AAGnB;AAGA,MAAM,QAAA,GAAW,IAAI,SAAU,EAAA;AAC/B,IAAO,kBAAQ,GAAA","file":"line_items.js","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Order, OrderType } from './orders'\nimport type { LineItemOption } from './line_item_options'\nimport type { ReturnLineItem } from './return_line_items'\nimport type { StockReservation } from './stock_reservations'\nimport type { StockLineItem } from './stock_line_items'\nimport type { StockTransfer } from './stock_transfers'\nimport type { Notification } from './notifications'\nimport type { Event } from './events'\nimport type { Tag, TagType } from './tags'\nimport type { Sku, SkuType } from './skus'\nimport type { Bundle, BundleType } from './bundles'\nimport type { GiftCard, GiftCardType } from './gift_cards'\nimport type { Shipment, ShipmentType } from './shipments'\nimport type { PaymentMethod, PaymentMethodType } from './payment_methods'\nimport type { Adjustment, AdjustmentType } from './adjustments'\nimport type { DiscountEngineItem, DiscountEngineItemType } from './discount_engine_items'\nimport type { PercentageDiscountPromotion, PercentageDiscountPromotionType } from './percentage_discount_promotions'\nimport type { FreeShippingPromotion, FreeShippingPromotionType } from './free_shipping_promotions'\nimport type { BuyXPayYPromotion, BuyXPayYPromotionType } from './buy_x_pay_y_promotions'\nimport type { FreeGiftPromotion, FreeGiftPromotionType } from './free_gift_promotions'\nimport type { FixedPricePromotion, FixedPricePromotionType } from './fixed_price_promotions'\nimport type { ExternalPromotion, ExternalPromotionType } from './external_promotions'\nimport type { FixedAmountPromotion, FixedAmountPromotionType } from './fixed_amount_promotions'\nimport type { FlexPromotion, FlexPromotionType } from './flex_promotions'\n\n\ntype LineItemType = 'line_items'\ntype LineItemRel = ResourceRel & { type: LineItemType }\ntype OrderRel = ResourceRel & { type: OrderType }\ntype SkuRel = ResourceRel & { type: SkuType }\ntype BundleRel = ResourceRel & { type: BundleType }\ntype GiftCardRel = ResourceRel & { type: GiftCardType }\ntype ShipmentRel = ResourceRel & { type: ShipmentType }\ntype PaymentMethodRel = ResourceRel & { type: PaymentMethodType }\ntype AdjustmentRel = ResourceRel & { type: AdjustmentType }\ntype DiscountEngineItemRel = ResourceRel & { type: DiscountEngineItemType }\ntype PercentageDiscountPromotionRel = ResourceRel & { type: PercentageDiscountPromotionType }\ntype FreeShippingPromotionRel = ResourceRel & { type: FreeShippingPromotionType }\ntype BuyXPayYPromotionRel = ResourceRel & { type: BuyXPayYPromotionType }\ntype FreeGiftPromotionRel = ResourceRel & { type: FreeGiftPromotionType }\ntype FixedPricePromotionRel = ResourceRel & { type: FixedPricePromotionType }\ntype ExternalPromotionRel = ResourceRel & { type: ExternalPromotionType }\ntype FixedAmountPromotionRel = ResourceRel & { type: FixedAmountPromotionType }\ntype FlexPromotionRel = ResourceRel & { type: FlexPromotionType }\ntype TagRel = ResourceRel & { type: TagType }\n\n\nexport type LineItemSort = Pick<LineItem, 'id' | 'currency_code' | 'unit_amount_cents' | 'compare_at_amount_cents' | 'options_amount_cents' | 'discount_cents' | 'total_amount_cents' | 'tax_amount_cents' | 'name' | 'item_type' | 'circuit_state' | 'circuit_failure_count'> & ResourceSort\n// export type LineItemFilter = Pick<LineItem, 'id' | 'sku_code' | 'quantity' | 'currency_code' | 'unit_amount_cents' | 'compare_at_amount_cents' | 'options_amount_cents' | 'discount_cents' | 'total_amount_cents' | 'tax_amount_cents' | 'name' | 'image_url' | 'item_type' | 'circuit_state' | 'circuit_failure_count'> & ResourceFilter\n\n\ninterface LineItem extends Resource {\n\t\n\treadonly type: LineItemType\n\n\t/** \n\t * The code of the associated SKU.\n\t * @example ```\"TSHIRTMM000000FFFFFFXLXX\"```\n\t */\n\tsku_code?: string | null\n\t/** \n\t * The code of the associated bundle.\n\t * @example ```\"BUNDLEMM000000FFFFFFXLXX\"```\n\t */\n\tbundle_code?: string | null\n\t/** \n\t * The line item quantity.\n\t * @example ```4```\n\t */\n\tquantity: number\n\t/** \n\t * When creating or updating a new line item, set this attribute to '1' if you want to inject the unit_amount_cents price from an external source. Any successive price computation will be done externally, until the attribute is reset to '0'.\n\t * @example ```true```\n\t */\n\t_external_price?: boolean | null\n\t/** \n\t * The international 3-letter currency code as defined by the ISO 4217 standard, automatically inherited from the order's market.\n\t * @example ```\"EUR\"```\n\t */\n\tcurrency_code?: string | null\n\t/** \n\t * The unit amount of the line item, in cents. Can be specified only via an integration application, or when the item is missing, otherwise is automatically computed by using one of the available methods. Cannot be passed by sales channels.\n\t * @example ```10000```\n\t */\n\tunit_amount_cents?: number | null\n\t/** \n\t * The unit amount of the line item, float. This can be useful to track the purchase on thrid party systems, e.g Google Analyitcs Enhanced Ecommerce.\n\t * @example ```100```\n\t */\n\tunit_amount_float?: number | null\n\t/** \n\t * The unit amount of the line item, formatted. This can be useful to display the amount with currency in you views.\n\t * @example ```\"€100,00\"```\n\t */\n\tformatted_unit_amount?: string | null\n\t/** \n\t * The compared price amount, in cents. Useful to display a percentage discount.\n\t * @example ```13000```\n\t */\n\tcompare_at_amount_cents?: number | null\n\t/** \n\t * The compared price amount, float.\n\t * @example ```130```\n\t */\n\tcompare_at_amount_float?: number | null\n\t/** \n\t * The compared price amount, formatted.\n\t * @example ```\"€130,00\"```\n\t */\n\tformatted_compare_at_amount?: string | null\n\t/** \n\t * The options amount of the line item, in cents. Cannot be passed by sales channels.\n\t * @example ```1000```\n\t */\n\toptions_amount_cents?: number | null\n\t/** \n\t * The options amount of the line item, float.\n\t * @example ```10```\n\t */\n\toptions_amount_float?: number | null\n\t/** \n\t * The options amount of the line item, formatted.\n\t * @example ```\"€10,00\"```\n\t */\n\tformatted_options_amount?: string | null\n\t/** \n\t * The discount applied to the line item, in cents. When you apply a discount to an order, this is automatically calculated basing on the line item total_amount_cents value.\n\t * @example ```-1000```\n\t */\n\tdiscount_cents?: number | null\n\t/** \n\t * The discount applied to the line item, float. When you apply a discount to an order, this is automatically calculated basing on the line item total_amount_cents value.\n\t * @example ```10```\n\t */\n\tdiscount_float?: number | null\n\t/** \n\t * The discount applied to the line item, fromatted. When you apply a discount to an order, this is automatically calculated basing on the line item total_amount_cents value.\n\t * @example ```\"€10,00\"```\n\t */\n\tformatted_discount?: string | null\n\t/** \n\t * Calculated as unit amount x quantity + options amount, in cents.\n\t * @example ```18800```\n\t */\n\ttotal_amount_cents?: number | null\n\t/** \n\t * Calculated as unit amount x quantity + options amount, float. This can be useful to track the purchase on thrid party systems, e.g Google Analyitcs Enhanced Ecommerce.\n\t * @example ```188```\n\t */\n\ttotal_amount_float: number\n\t/** \n\t * Calculated as unit amount x quantity + options amount, formatted. This can be useful to display the amount with currency in you views.\n\t * @example ```\"€188,00\"```\n\t */\n\tformatted_total_amount?: string | null\n\t/** \n\t * The collected tax amount, otherwise calculated as total amount cents - discount cent * tax rate, in cents.\n\t * @example ```1880```\n\t */\n\ttax_amount_cents?: number | null\n\t/** \n\t * The collected tax amount, otherwise calculated as total amount cents - discount cent * tax rate, float.\n\t * @example ```18.8```\n\t */\n\ttax_amount_float: number\n\t/** \n\t * The collected tax amount, otherwise calculated as total amount cents - discount cent * tax rate, formatted.\n\t * @example ```\"€18,80\"```\n\t */\n\tformatted_tax_amount?: string | null\n\t/** \n\t * The name of the line item. When blank, it gets populated with the name of the associated item (if present).\n\t * @example ```\"Men's Black T-shirt with White Logo (XL)\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The image_url of the line item. When blank, it gets populated with the image_url of the associated item (if present, SKU only).\n\t * @example ```\"https://img.yourdomain.com/skus/xYZkjABcde.png\"```\n\t */\n\timage_url?: string | null\n\t/** \n\t * The discount breakdown for this line item (if calculated).\n\t * @example ```{\"41\":{\"name\":\"10% ALL\",\"cents\":-900,\"weight\":0.416,\"coupon_code\":\"XXXXXXXX\"}}```\n\t */\n\tdiscount_breakdown?: Record<string, any> | null\n\t/** \n\t * The tax rate for this line item (if calculated).\n\t * @example ```0.22```\n\t */\n\ttax_rate?: number | null\n\t/** \n\t * The tax breakdown for this line item (if calculated).\n\t * @example ```{\"id\":\"1234\",\"city_amount\":\"0.0\",\"state_amount\":6.6,\"city_tax_rate\":0,\"county_amount\":2.78,\"taxable_amount\":139,\"county_tax_rate\":0.02,\"tax_collectable\":10.08,\"special_tax_rate\":0.005,\"combined_tax_rate\":0.0725,\"city_taxable_amount\":0,\"state_sales_tax_rate\":0.0475,\"state_taxable_amount\":139,\"county_taxable_amount\":139,\"special_district_amount\":0.7,\"special_district_taxable_amount\":139}```\n\t */\n\ttax_breakdown?: Record<string, any> | null\n\t/** \n\t * The type of the associated item. One of 'skus', 'bundles', 'gift_cards', 'shipments', 'payment_methods', 'adjustments', 'discount_engine_items', 'percentage_discount_promotions', 'free_shipping_promotions', 'buy_x_pay_y_promotions', 'free_gift_promotions', 'fixed_price_promotions', 'external_promotions', 'fixed_amount_promotions', or 'flex_promotions'.\n\t * @example ```\"skus\"```\n\t */\n\titem_type?: 'skus' | 'bundles' | 'gift_cards' | 'shipments' | 'payment_methods' | 'adjustments' | 'discount_engine_items' | 'percentage_discount_promotions' | 'free_shipping_promotions' | 'buy_x_pay_y_promotions' | 'free_gift_promotions' | 'fixed_price_promotions' | 'external_promotions' | 'fixed_amount_promotions' | 'flex_promotions' | null\n\t/** \n\t * The frequency which generates a subscription. Must be supported by existing associated subscription_model.\n\t * @example ```\"monthly\"```\n\t */\n\tfrequency?: string | null\n\t/** \n\t * The coupon code, if any, used to trigger this promotion line item. null for other line item types or if the promotion line item wasn't triggered by a coupon.\n\t * @example ```\"SUMMERDISCOUNT\"```\n\t */\n\tcoupon_code?: string | null\n\t/** \n\t * The circuit breaker state, by default it is 'closed'. It can become 'open' once the number of consecutive failures overlaps the specified threshold, in such case no further calls to the failing callback are made.\n\t * @example ```\"closed\"```\n\t */\n\tcircuit_state?: string | null\n\t/** \n\t * The number of consecutive failures recorded by the circuit breaker associated to this resource, will be reset on first successful call to callback.\n\t * @example ```5```\n\t */\n\tcircuit_failure_count?: number | null\n\n\torder?: Order | null\n\titem?: Sku | Bundle | GiftCard | Shipment | PaymentMethod | Adjustment | DiscountEngineItem | PercentageDiscountPromotion | FreeShippingPromotion | BuyXPayYPromotion | FreeGiftPromotion | FixedPricePromotion | ExternalPromotion | FixedAmountPromotion | FlexPromotion | null\n\tsku?: Sku | null\n\tbundle?: Bundle | null\n\tadjustment?: Adjustment | null\n\tgift_card?: GiftCard | null\n\tshipment?: Shipment | null\n\tpayment_method?: PaymentMethod | null\n\tline_item_options?: LineItemOption[] | null\n\treturn_line_items?: ReturnLineItem[] | null\n\tstock_reservations?: StockReservation[] | null\n\tstock_line_items?: StockLineItem[] | null\n\tstock_transfers?: StockTransfer[] | null\n\tnotifications?: Notification[] | null\n\tevents?: Event[] | null\n\ttags?: Tag[] | null\n\n}\n\n\ninterface LineItemCreate extends ResourceCreate {\n\t\n\t/** \n\t * The code of the associated SKU.\n\t * @example ```\"TSHIRTMM000000FFFFFFXLXX\"```\n\t */\n\tsku_code?: string | null\n\t/** \n\t * The code of the associated bundle.\n\t * @example ```\"BUNDLEMM000000FFFFFFXLXX\"```\n\t */\n\tbundle_code?: string | null\n\t/** \n\t * The line item quantity.\n\t * @example ```4```\n\t */\n\tquantity: number\n\t/** \n\t * When creating or updating a new line item, set this attribute to '1' if you want to inject the unit_amount_cents price from an external source. Any successive price computation will be done externally, until the attribute is reset to '0'.\n\t * @example ```true```\n\t */\n\t_external_price?: boolean | null\n\t/** \n\t * When creating a new line item, set this attribute to '1' if you want to update the line item quantity (if present) instead of creating a new line item for the same SKU.\n\t * @example ```true```\n\t */\n\t_update_quantity?: boolean | null\n\t/** \n\t * Send this attribute if you want to reserve the stock for the line item's SKUs quantity. Stock reservations expiration depends on the inventory model's cutoff. When used on update the existing active stock reservations are renewed. Cannot be passed by sales channels.\n\t * @example ```true```\n\t */\n\t_reserve_stock?: boolean | null\n\t/** \n\t * The unit amount of the line item, in cents. Can be specified only via an integration application, or when the item is missing, otherwise is automatically computed by using one of the available methods. Cannot be passed by sales channels.\n\t * @example ```10000```\n\t */\n\tunit_amount_cents?: number | null\n\t/** \n\t * The compared price amount, in cents. Useful to display a percentage discount.\n\t * @example ```13000```\n\t */\n\tcompare_at_amount_cents?: number | null\n\t/** \n\t * The name of the line item. When blank, it gets populated with the name of the associated item (if present).\n\t * @example ```\"Men's Black T-shirt with White Logo (XL)\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The image_url of the line item. When blank, it gets populated with the image_url of the associated item (if present, SKU only).\n\t * @example ```\"https://img.yourdomain.com/skus/xYZkjABcde.png\"```\n\t */\n\timage_url?: string | null\n\t/** \n\t * The type of the associated item. One of 'skus', 'bundles', 'gift_cards', 'shipments', 'payment_methods', 'adjustments', 'discount_engine_items', 'percentage_discount_promotions', 'free_shipping_promotions', 'buy_x_pay_y_promotions', 'free_gift_promotions', 'fixed_price_promotions', 'external_promotions', 'fixed_amount_promotions', or 'flex_promotions'.\n\t * @example ```\"skus\"```\n\t */\n\titem_type?: 'skus' | 'bundles' | 'gift_cards' | 'shipments' | 'payment_methods' | 'adjustments' | 'discount_engine_items' | 'percentage_discount_promotions' | 'free_shipping_promotions' | 'buy_x_pay_y_promotions' | 'free_gift_promotions' | 'fixed_price_promotions' | 'external_promotions' | 'fixed_amount_promotions' | 'flex_promotions' | null\n\t/** \n\t * The frequency which generates a subscription. Must be supported by existing associated subscription_model.\n\t * @example ```\"monthly\"```\n\t */\n\tfrequency?: string | null\n\n\torder: OrderRel\n\titem?: SkuRel | BundleRel | GiftCardRel | ShipmentRel | PaymentMethodRel | AdjustmentRel | DiscountEngineItemRel | PercentageDiscountPromotionRel | FreeShippingPromotionRel | BuyXPayYPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel | FixedAmountPromotionRel | FlexPromotionRel | null\n\ttags?: TagRel[] | null\n\n}\n\n\ninterface LineItemUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The code of the associated SKU.\n\t * @example ```\"TSHIRTMM000000FFFFFFXLXX\"```\n\t */\n\tsku_code?: string | null\n\t/** \n\t * The code of the associated bundle.\n\t * @example ```\"BUNDLEMM000000FFFFFFXLXX\"```\n\t */\n\tbundle_code?: string | null\n\t/** \n\t * The line item quantity.\n\t * @example ```4```\n\t */\n\tquantity?: number | null\n\t/** \n\t * When creating or updating a new line item, set this attribute to '1' if you want to inject the unit_amount_cents price from an external source. Any successive price computation will be done externally, until the attribute is reset to '0'.\n\t * @example ```true```\n\t */\n\t_external_price?: boolean | null\n\t/** \n\t * Send this attribute if you want to reserve the stock for the line item's SKUs quantity. Stock reservations expiration depends on the inventory model's cutoff. When used on update the existing active stock reservations are renewed. Cannot be passed by sales channels.\n\t * @example ```true```\n\t */\n\t_reserve_stock?: boolean | null\n\t/** \n\t * The unit amount of the line item, in cents. Can be specified only via an integration application, or when the item is missing, otherwise is automatically computed by using one of the available methods. Cannot be passed by sales channels.\n\t * @example ```10000```\n\t */\n\tunit_amount_cents?: number | null\n\t/** \n\t * The compared price amount, in cents. Useful to display a percentage discount.\n\t * @example ```13000```\n\t */\n\tcompare_at_amount_cents?: number | null\n\t/** \n\t * The options amount of the line item, in cents. Cannot be passed by sales channels.\n\t * @example ```1000```\n\t */\n\toptions_amount_cents?: number | null\n\t/** \n\t * The name of the line item. When blank, it gets populated with the name of the associated item (if present).\n\t * @example ```\"Men's Black T-shirt with White Logo (XL)\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The image_url of the line item. When blank, it gets populated with the image_url of the associated item (if present, SKU only).\n\t * @example ```\"https://img.yourdomain.com/skus/xYZkjABcde.png\"```\n\t */\n\timage_url?: string | null\n\t/** \n\t * The frequency which generates a subscription. Must be supported by existing associated subscription_model.\n\t * @example ```\"monthly\"```\n\t */\n\tfrequency?: string | null\n\t/** \n\t * Send this attribute if you want to reset the circuit breaker associated to this resource to 'closed' state and zero failures count. Cannot be passed by sales channels.\n\t * @example ```true```\n\t */\n\t_reset_circuit?: boolean | null\n\t/** \n\t * Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_add_tags?: string | null\n\t/** \n\t * Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_remove_tags?: string | null\n\n\ttags?: TagRel[] | null\n\n}\n\n\nclass LineItems extends ApiResource<LineItem> {\n\n\tstatic readonly TYPE: LineItemType = 'line_items' as const\n\n\tasync create(resource: LineItemCreate, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\treturn this.resources.create<LineItemCreate, LineItem>({ ...resource, type: LineItems.TYPE }, params, options)\n\t}\n\n\tasync update(resource: LineItemUpdate, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\treturn this.resources.update<LineItemUpdate, LineItem>({ ...resource, type: LineItems.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: LineItems.TYPE } : id, options)\n\t}\n\n\tasync order(lineItemId: string | LineItem, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _lineItemId = (lineItemId as LineItem).id || lineItemId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `line_items/${_lineItemId}/order`, params, options) as unknown as Order\n\t}\n\n\tasync line_item_options(lineItemId: string | LineItem, params?: QueryParamsList<LineItemOption>, options?: ResourcesConfig): Promise<ListResponse<LineItemOption>> {\n\t\tconst _lineItemId = (lineItemId as LineItem).id || lineItemId as string\n\t\treturn this.resources.fetch<LineItemOption>({ type: 'line_item_options' }, `line_items/${_lineItemId}/line_item_options`, params, options) as unknown as ListResponse<LineItemOption>\n\t}\n\n\tasync return_line_items(lineItemId: string | LineItem, params?: QueryParamsList<ReturnLineItem>, options?: ResourcesConfig): Promise<ListResponse<ReturnLineItem>> {\n\t\tconst _lineItemId = (lineItemId as LineItem).id || lineItemId as string\n\t\treturn this.resources.fetch<ReturnLineItem>({ type: 'return_line_items' }, `line_items/${_lineItemId}/return_line_items`, params, options) as unknown as ListResponse<ReturnLineItem>\n\t}\n\n\tasync stock_reservations(lineItemId: string | LineItem, params?: QueryParamsList<StockReservation>, options?: ResourcesConfig): Promise<ListResponse<StockReservation>> {\n\t\tconst _lineItemId = (lineItemId as LineItem).id || lineItemId as string\n\t\treturn this.resources.fetch<StockReservation>({ type: 'stock_reservations' }, `line_items/${_lineItemId}/stock_reservations`, params, options) as unknown as ListResponse<StockReservation>\n\t}\n\n\tasync stock_line_items(lineItemId: string | LineItem, params?: QueryParamsList<StockLineItem>, options?: ResourcesConfig): Promise<ListResponse<StockLineItem>> {\n\t\tconst _lineItemId = (lineItemId as LineItem).id || lineItemId as string\n\t\treturn this.resources.fetch<StockLineItem>({ type: 'stock_line_items' }, `line_items/${_lineItemId}/stock_line_items`, params, options) as unknown as ListResponse<StockLineItem>\n\t}\n\n\tasync stock_transfers(lineItemId: string | LineItem, params?: QueryParamsList<StockTransfer>, options?: ResourcesConfig): Promise<ListResponse<StockTransfer>> {\n\t\tconst _lineItemId = (lineItemId as LineItem).id || lineItemId as string\n\t\treturn this.resources.fetch<StockTransfer>({ type: 'stock_transfers' }, `line_items/${_lineItemId}/stock_transfers`, params, options) as unknown as ListResponse<StockTransfer>\n\t}\n\n\tasync notifications(lineItemId: string | LineItem, params?: QueryParamsList<Notification>, options?: ResourcesConfig): Promise<ListResponse<Notification>> {\n\t\tconst _lineItemId = (lineItemId as LineItem).id || lineItemId as string\n\t\treturn this.resources.fetch<Notification>({ type: 'notifications' }, `line_items/${_lineItemId}/notifications`, params, options) as unknown as ListResponse<Notification>\n\t}\n\n\tasync events(lineItemId: string | LineItem, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _lineItemId = (lineItemId as LineItem).id || lineItemId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `line_items/${_lineItemId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync tags(lineItemId: string | LineItem, params?: QueryParamsList<Tag>, options?: ResourcesConfig): Promise<ListResponse<Tag>> {\n\t\tconst _lineItemId = (lineItemId as LineItem).id || lineItemId as string\n\t\treturn this.resources.fetch<Tag>({ type: 'tags' }, `line_items/${_lineItemId}/tags`, params, options) as unknown as ListResponse<Tag>\n\t}\n\n\tasync _external_price(id: string | LineItem, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\treturn this.resources.update<LineItemUpdate, LineItem>({ id: (typeof id === 'string')? id: id.id, type: LineItems.TYPE, _external_price: true }, params, options)\n\t}\n\n\tasync _reserve_stock(id: string | LineItem, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\treturn this.resources.update<LineItemUpdate, LineItem>({ id: (typeof id === 'string')? id: id.id, type: LineItems.TYPE, _reserve_stock: true }, params, options)\n\t}\n\n\tasync _reset_circuit(id: string | LineItem, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\treturn this.resources.update<LineItemUpdate, LineItem>({ id: (typeof id === 'string')? id: id.id, type: LineItems.TYPE, _reset_circuit: true }, params, options)\n\t}\n\n\tasync _add_tags(id: string | LineItem, triggerValue: string, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\treturn this.resources.update<LineItemUpdate, LineItem>({ id: (typeof id === 'string')? id: id.id, type: LineItems.TYPE, _add_tags: triggerValue }, params, options)\n\t}\n\n\tasync _remove_tags(id: string | LineItem, triggerValue: string, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\treturn this.resources.update<LineItemUpdate, LineItem>({ id: (typeof id === 'string')? id: id.id, type: LineItems.TYPE, _remove_tags: triggerValue }, params, options)\n\t}\n\n\n\tisLineItem(resource: any): resource is LineItem {\n\t\treturn resource.type && (resource.type === LineItems.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): LineItemRel {\n\t\treturn super.relationshipOneToOne<LineItemRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): LineItemRel[] {\n\t\treturn super.relationshipOneToMany<LineItemRel>(...ids)\n\t}\n\n\n\ttype(): LineItemType {\n\t\treturn LineItems.TYPE\n\t}\n\n}\n\n\nconst instance = new LineItems()\nexport default instance\n\nexport type { LineItem, LineItemCreate, LineItemUpdate, LineItemType }\n"]}
|
1
|
+
{"version":3,"sources":["../../src/resources/line_items.ts"],"names":[],"mappings":";;AAuYA,MAAM,kBAAkB,WAAsB,CAAA;AAAA,EAE7C,OAAgB,IAAqB,GAAA,YAAA;AAAA,EAErC,MAAM,MAAA,CAAO,QAA0B,EAAA,MAAA,EAAwC,OAA8C,EAAA;AAC5H,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MA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ACnD,IAAO,OAAA,KAAA,CAAM,qBAAmC,CAAA,GAAG,GAAG,CAAA;AAAA;AACvD,EAGA,IAAqB,GAAA;AACpB,IAAA,OAAO,SAAU,CAAA,IAAA;AAAA;AAGnB;AAGA,MAAM,QAAA,GAAW,IAAI,SAAU,EAAA;AAC/B,IAAO,kBAAQ,GAAA","file":"line_items.js","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Order, OrderType } from './orders'\nimport type { LineItemOption } from './line_item_options'\nimport type { ReturnLineItem } from './return_line_items'\nimport type { StockReservation } from './stock_reservations'\nimport type { StockLineItem } from './stock_line_items'\nimport type { StockTransfer } from './stock_transfers'\nimport type { Notification } from './notifications'\nimport type { Event } from './events'\nimport type { Tag, TagType } from './tags'\nimport type { Sku, SkuType } from './skus'\nimport type { Bundle, BundleType } from './bundles'\nimport type { GiftCard, GiftCardType } from './gift_cards'\nimport type { Shipment, ShipmentType } from './shipments'\nimport type { PaymentMethod, PaymentMethodType } from './payment_methods'\nimport type { Adjustment, AdjustmentType } from './adjustments'\nimport type { DiscountEngineItem, DiscountEngineItemType } from './discount_engine_items'\nimport type { PercentageDiscountPromotion, PercentageDiscountPromotionType } from './percentage_discount_promotions'\nimport type { FreeShippingPromotion, FreeShippingPromotionType } from './free_shipping_promotions'\nimport type { BuyXPayYPromotion, BuyXPayYPromotionType } from './buy_x_pay_y_promotions'\nimport type { FreeGiftPromotion, FreeGiftPromotionType } from './free_gift_promotions'\nimport type { FixedPricePromotion, FixedPricePromotionType } from './fixed_price_promotions'\nimport type { ExternalPromotion, ExternalPromotionType } from './external_promotions'\nimport type { FixedAmountPromotion, FixedAmountPromotionType } from './fixed_amount_promotions'\nimport type { FlexPromotion, FlexPromotionType } from './flex_promotions'\n\n\ntype LineItemType = 'line_items'\ntype LineItemRel = ResourceRel & { type: LineItemType }\ntype OrderRel = ResourceRel & { type: OrderType }\ntype SkuRel = ResourceRel & { type: SkuType }\ntype BundleRel = ResourceRel & { type: BundleType }\ntype GiftCardRel = ResourceRel & { type: GiftCardType }\ntype ShipmentRel = ResourceRel & { type: ShipmentType }\ntype PaymentMethodRel = ResourceRel & { type: PaymentMethodType }\ntype AdjustmentRel = ResourceRel & { type: AdjustmentType }\ntype DiscountEngineItemRel = ResourceRel & { type: DiscountEngineItemType }\ntype PercentageDiscountPromotionRel = ResourceRel & { type: PercentageDiscountPromotionType }\ntype FreeShippingPromotionRel = ResourceRel & { type: FreeShippingPromotionType }\ntype BuyXPayYPromotionRel = ResourceRel & { type: BuyXPayYPromotionType }\ntype FreeGiftPromotionRel = ResourceRel & { type: FreeGiftPromotionType }\ntype FixedPricePromotionRel = ResourceRel & { type: FixedPricePromotionType }\ntype ExternalPromotionRel = ResourceRel & { type: ExternalPromotionType }\ntype FixedAmountPromotionRel = ResourceRel & { type: FixedAmountPromotionType }\ntype FlexPromotionRel = ResourceRel & { type: FlexPromotionType }\ntype TagRel = ResourceRel & { type: TagType }\n\n\nexport type LineItemSort = Pick<LineItem, 'id' | 'currency_code' | 'unit_amount_cents' | 'compare_at_amount_cents' | 'options_amount_cents' | 'discount_cents' | 'total_amount_cents' | 'tax_amount_cents' | 'name' | 'item_type' | 'circuit_state' | 'circuit_failure_count'> & ResourceSort\n// export type LineItemFilter = Pick<LineItem, 'id' | 'sku_code' | 'quantity' | 'currency_code' | 'unit_amount_cents' | 'compare_at_amount_cents' | 'options_amount_cents' | 'discount_cents' | 'total_amount_cents' | 'tax_amount_cents' | 'name' | 'image_url' | 'item_type' | 'circuit_state' | 'circuit_failure_count'> & ResourceFilter\n\n\ninterface LineItem extends Resource {\n\t\n\treadonly type: LineItemType\n\n\t/** \n\t * The code of the associated SKU.\n\t * @example ```\"TSHIRTMM000000FFFFFFXLXX\"```\n\t */\n\tsku_code?: string | null\n\t/** \n\t * The code of the associated bundle.\n\t * @example ```\"BUNDLEMM000000FFFFFFXLXX\"```\n\t */\n\tbundle_code?: string | null\n\t/** \n\t * The line item quantity.\n\t * @example ```4```\n\t */\n\tquantity: number\n\t/** \n\t * When creating or updating a new line item, set this attribute to '1' if you want to inject the unit_amount_cents price from an external source. Any successive price computation will be done externally, until the attribute is reset to '0'.\n\t * @example ```true```\n\t */\n\t_external_price?: boolean | null\n\t/** \n\t * The international 3-letter currency code as defined by the ISO 4217 standard, automatically inherited from the order's market.\n\t * @example ```\"EUR\"```\n\t */\n\tcurrency_code?: string | null\n\t/** \n\t * The unit amount of the line item, in cents. Can be specified only via an integration application, or when the item is missing, otherwise is automatically computed by using one of the available methods. Cannot be passed by sales channels.\n\t * @example ```10000```\n\t */\n\tunit_amount_cents?: number | null\n\t/** \n\t * The unit amount of the line item, float. This can be useful to track the purchase on thrid party systems, e.g Google Analyitcs Enhanced Ecommerce.\n\t * @example ```100```\n\t */\n\tunit_amount_float?: number | null\n\t/** \n\t * The unit amount of the line item, formatted. This can be useful to display the amount with currency in you views.\n\t * @example ```\"€100,00\"```\n\t */\n\tformatted_unit_amount?: string | null\n\t/** \n\t * The compared price amount, in cents. Useful to display a percentage discount.\n\t * @example ```13000```\n\t */\n\tcompare_at_amount_cents?: number | null\n\t/** \n\t * The compared price amount, float.\n\t * @example ```130```\n\t */\n\tcompare_at_amount_float?: number | null\n\t/** \n\t * The compared price amount, formatted.\n\t * @example ```\"€130,00\"```\n\t */\n\tformatted_compare_at_amount?: string | null\n\t/** \n\t * The options amount of the line item, in cents. Cannot be passed by sales channels.\n\t * @example ```1000```\n\t */\n\toptions_amount_cents?: number | null\n\t/** \n\t * The options amount of the line item, float.\n\t * @example ```10```\n\t */\n\toptions_amount_float?: number | null\n\t/** \n\t * The options amount of the line item, formatted.\n\t * @example ```\"€10,00\"```\n\t */\n\tformatted_options_amount?: string | null\n\t/** \n\t * The discount applied to the line item, in cents. When you apply a discount to an order, this is automatically calculated basing on the line item total_amount_cents value.\n\t * @example ```-1000```\n\t */\n\tdiscount_cents?: number | null\n\t/** \n\t * The discount applied to the line item, float. When you apply a discount to an order, this is automatically calculated basing on the line item total_amount_cents value.\n\t * @example ```10```\n\t */\n\tdiscount_float?: number | null\n\t/** \n\t * The discount applied to the line item, fromatted. When you apply a discount to an order, this is automatically calculated basing on the line item total_amount_cents value.\n\t * @example ```\"€10,00\"```\n\t */\n\tformatted_discount?: string | null\n\t/** \n\t * Calculated as unit amount x quantity + options amount, in cents.\n\t * @example ```18800```\n\t */\n\ttotal_amount_cents?: number | null\n\t/** \n\t * Calculated as unit amount x quantity + options amount, float. This can be useful to track the purchase on thrid party systems, e.g Google Analyitcs Enhanced Ecommerce.\n\t * @example ```188```\n\t */\n\ttotal_amount_float: number\n\t/** \n\t * Calculated as unit amount x quantity + options amount, formatted. This can be useful to display the amount with currency in you views.\n\t * @example ```\"€188,00\"```\n\t */\n\tformatted_total_amount?: string | null\n\t/** \n\t * The collected tax amount, otherwise calculated as total amount cents - discount cent * tax rate, in cents.\n\t * @example ```1880```\n\t */\n\ttax_amount_cents?: number | null\n\t/** \n\t * The collected tax amount, otherwise calculated as total amount cents - discount cent * tax rate, float.\n\t * @example ```18.8```\n\t */\n\ttax_amount_float: number\n\t/** \n\t * The collected tax amount, otherwise calculated as total amount cents - discount cent * tax rate, formatted.\n\t * @example ```\"€18,80\"```\n\t */\n\tformatted_tax_amount?: string | null\n\t/** \n\t * The name of the line item. When blank, it gets populated with the name of the associated item (if present).\n\t * @example ```\"Men's Black T-shirt with White Logo (XL)\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The image_url of the line item. When blank, it gets populated with the image_url of the associated item (if present, SKU only).\n\t * @example ```\"https://img.yourdomain.com/skus/xYZkjABcde.png\"```\n\t */\n\timage_url?: string | null\n\t/** \n\t * The discount breakdown for this line item (if calculated).\n\t * @example ```{\"41\":{\"name\":\"10% ALL\",\"cents\":-900,\"weight\":0.416,\"coupon_code\":\"XXXXXXXX\"}}```\n\t */\n\tdiscount_breakdown?: Record<string, any> | null\n\t/** \n\t * The tax rate for this line item (if calculated).\n\t * @example ```0.22```\n\t */\n\ttax_rate?: number | null\n\t/** \n\t * The tax breakdown for this line item (if calculated).\n\t * @example ```{\"id\":\"1234\",\"city_amount\":\"0.0\",\"state_amount\":6.6,\"city_tax_rate\":0,\"county_amount\":2.78,\"taxable_amount\":139,\"county_tax_rate\":0.02,\"tax_collectable\":10.08,\"special_tax_rate\":0.005,\"combined_tax_rate\":0.0725,\"city_taxable_amount\":0,\"state_sales_tax_rate\":0.0475,\"state_taxable_amount\":139,\"county_taxable_amount\":139,\"special_district_amount\":0.7,\"special_district_taxable_amount\":139}```\n\t */\n\ttax_breakdown?: Record<string, any> | null\n\t/** \n\t * The type of the associated item. One of 'skus', 'bundles', 'gift_cards', 'shipments', 'payment_methods', 'adjustments', 'discount_engine_items', 'percentage_discount_promotions', 'free_shipping_promotions', 'buy_x_pay_y_promotions', 'free_gift_promotions', 'fixed_price_promotions', 'external_promotions', 'fixed_amount_promotions', or 'flex_promotions'.\n\t * @example ```\"skus\"```\n\t */\n\titem_type?: 'skus' | 'bundles' | 'gift_cards' | 'shipments' | 'payment_methods' | 'adjustments' | 'discount_engine_items' | 'percentage_discount_promotions' | 'free_shipping_promotions' | 'buy_x_pay_y_promotions' | 'free_gift_promotions' | 'fixed_price_promotions' | 'external_promotions' | 'fixed_amount_promotions' | 'flex_promotions' | null\n\t/** \n\t * The frequency which generates a subscription. Must be supported by existing associated subscription_model.\n\t * @example ```\"monthly\"```\n\t */\n\tfrequency?: string | null\n\t/** \n\t * The coupon code, if any, used to trigger this promotion line item. null for other line item types or if the promotion line item wasn't triggered by a coupon.\n\t * @example ```\"SUMMERDISCOUNT\"```\n\t */\n\tcoupon_code?: string | null\n\t/** \n\t * The circuit breaker state, by default it is 'closed'. It can become 'open' once the number of consecutive failures overlaps the specified threshold, in such case no further calls to the failing callback are made.\n\t * @example ```\"closed\"```\n\t */\n\tcircuit_state?: string | null\n\t/** \n\t * The number of consecutive failures recorded by the circuit breaker associated to this resource, will be reset on first successful call to callback.\n\t * @example ```5```\n\t */\n\tcircuit_failure_count?: number | null\n\n\torder?: Order | null\n\titem?: Sku | Bundle | GiftCard | Shipment | PaymentMethod | Adjustment | DiscountEngineItem | PercentageDiscountPromotion | FreeShippingPromotion | BuyXPayYPromotion | FreeGiftPromotion | FixedPricePromotion | ExternalPromotion | FixedAmountPromotion | FlexPromotion | null\n\tsku?: Sku | null\n\tbundle?: Bundle | null\n\tadjustment?: Adjustment | null\n\tgift_card?: GiftCard | null\n\tshipment?: Shipment | null\n\tpayment_method?: PaymentMethod | null\n\tline_item_options?: LineItemOption[] | null\n\treturn_line_items?: ReturnLineItem[] | null\n\tstock_reservations?: StockReservation[] | null\n\tstock_line_items?: StockLineItem[] | null\n\tstock_transfers?: StockTransfer[] | null\n\tnotifications?: Notification[] | null\n\tevents?: Event[] | null\n\ttags?: Tag[] | null\n\n}\n\n\ninterface LineItemCreate extends ResourceCreate {\n\t\n\t/** \n\t * The code of the associated SKU.\n\t * @example ```\"TSHIRTMM000000FFFFFFXLXX\"```\n\t */\n\tsku_code?: string | null\n\t/** \n\t * The code of the associated bundle.\n\t * @example ```\"BUNDLEMM000000FFFFFFXLXX\"```\n\t */\n\tbundle_code?: string | null\n\t/** \n\t * The line item quantity.\n\t * @example ```4```\n\t */\n\tquantity: number\n\t/** \n\t * When creating or updating a new line item, set this attribute to '1' if you want to inject the unit_amount_cents price from an external source. Any successive price computation will be done externally, until the attribute is reset to '0'.\n\t * @example ```true```\n\t */\n\t_external_price?: boolean | null\n\t/** \n\t * When creating a new line item, set this attribute to '1' if you want to update the line item quantity (if present) instead of creating a new line item for the same SKU.\n\t * @example ```true```\n\t */\n\t_update_quantity?: boolean | null\n\t/** \n\t * Send this attribute if you want to reserve the stock for the line item's SKUs quantity. Stock reservations expiration depends on the inventory model's cutoff. When used on update the existing active stock reservations are renewed. Cannot be passed by sales channels.\n\t * @example ```true```\n\t */\n\t_reserve_stock?: boolean | null\n\t/** \n\t * The unit amount of the line item, in cents. Can be specified only via an integration application, or when the item is missing, otherwise is automatically computed by using one of the available methods. Cannot be passed by sales channels.\n\t * @example ```10000```\n\t */\n\tunit_amount_cents?: number | null\n\t/** \n\t * The compared price amount, in cents. Useful to display a percentage discount.\n\t * @example ```13000```\n\t */\n\tcompare_at_amount_cents?: number | null\n\t/** \n\t * The name of the line item. When blank, it gets populated with the name of the associated item (if present).\n\t * @example ```\"Men's Black T-shirt with White Logo (XL)\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The image_url of the line item. When blank, it gets populated with the image_url of the associated item (if present, SKU only).\n\t * @example ```\"https://img.yourdomain.com/skus/xYZkjABcde.png\"```\n\t */\n\timage_url?: string | null\n\t/** \n\t * The type of the associated item. One of 'skus', 'bundles', 'gift_cards', 'shipments', 'payment_methods', 'adjustments', 'discount_engine_items', 'percentage_discount_promotions', 'free_shipping_promotions', 'buy_x_pay_y_promotions', 'free_gift_promotions', 'fixed_price_promotions', 'external_promotions', 'fixed_amount_promotions', or 'flex_promotions'.\n\t * @example ```\"skus\"```\n\t */\n\titem_type?: 'skus' | 'bundles' | 'gift_cards' | 'shipments' | 'payment_methods' | 'adjustments' | 'discount_engine_items' | 'percentage_discount_promotions' | 'free_shipping_promotions' | 'buy_x_pay_y_promotions' | 'free_gift_promotions' | 'fixed_price_promotions' | 'external_promotions' | 'fixed_amount_promotions' | 'flex_promotions' | null\n\t/** \n\t * The frequency which generates a subscription. Must be supported by existing associated subscription_model.\n\t * @example ```\"monthly\"```\n\t */\n\tfrequency?: string | null\n\n\torder: OrderRel\n\titem?: SkuRel | BundleRel | GiftCardRel | ShipmentRel | PaymentMethodRel | AdjustmentRel | DiscountEngineItemRel | PercentageDiscountPromotionRel | FreeShippingPromotionRel | BuyXPayYPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel | FixedAmountPromotionRel | FlexPromotionRel | null\n\ttags?: TagRel[] | null\n\n}\n\n\ninterface LineItemUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The code of the associated SKU.\n\t * @example ```\"TSHIRTMM000000FFFFFFXLXX\"```\n\t */\n\tsku_code?: string | null\n\t/** \n\t * The code of the associated bundle.\n\t * @example ```\"BUNDLEMM000000FFFFFFXLXX\"```\n\t */\n\tbundle_code?: string | null\n\t/** \n\t * The line item quantity.\n\t * @example ```4```\n\t */\n\tquantity?: number | null\n\t/** \n\t * When creating or updating a new line item, set this attribute to '1' if you want to inject the unit_amount_cents price from an external source. Any successive price computation will be done externally, until the attribute is reset to '0'.\n\t * @example ```true```\n\t */\n\t_external_price?: boolean | null\n\t/** \n\t * Send this attribute if you want to reserve the stock for the line item's SKUs quantity. Stock reservations expiration depends on the inventory model's cutoff. When used on update the existing active stock reservations are renewed. Cannot be passed by sales channels.\n\t * @example ```true```\n\t */\n\t_reserve_stock?: boolean | null\n\t/** \n\t * The unit amount of the line item, in cents. Can be specified only via an integration application, or when the item is missing, otherwise is automatically computed by using one of the available methods. Cannot be passed by sales channels.\n\t * @example ```10000```\n\t */\n\tunit_amount_cents?: number | null\n\t/** \n\t * The compared price amount, in cents. Useful to display a percentage discount.\n\t * @example ```13000```\n\t */\n\tcompare_at_amount_cents?: number | null\n\t/** \n\t * The options amount of the line item, in cents. Cannot be passed by sales channels.\n\t * @example ```1000```\n\t */\n\toptions_amount_cents?: number | null\n\t/** \n\t * The name of the line item. When blank, it gets populated with the name of the associated item (if present).\n\t * @example ```\"Men's Black T-shirt with White Logo (XL)\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The image_url of the line item. When blank, it gets populated with the image_url of the associated item (if present, SKU only).\n\t * @example ```\"https://img.yourdomain.com/skus/xYZkjABcde.png\"```\n\t */\n\timage_url?: string | null\n\t/** \n\t * The frequency which generates a subscription. Must be supported by existing associated subscription_model.\n\t * @example ```\"monthly\"```\n\t */\n\tfrequency?: string | null\n\t/** \n\t * Send this attribute if you want to reset the circuit breaker associated to this resource to 'closed' state and zero failures count. Cannot be passed by sales channels.\n\t * @example ```true```\n\t */\n\t_reset_circuit?: boolean | null\n\t/** \n\t * Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_add_tags?: string | null\n\t/** \n\t * Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_remove_tags?: string | null\n\n\ttags?: TagRel[] | null\n\n}\n\n\nclass LineItems extends ApiResource<LineItem> {\n\n\tstatic readonly TYPE: LineItemType = 'line_items' as const\n\n\tasync create(resource: LineItemCreate, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\treturn this.resources.create<LineItemCreate, LineItem>({ ...resource, type: LineItems.TYPE }, params, options)\n\t}\n\n\tasync update(resource: LineItemUpdate, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\treturn this.resources.update<LineItemUpdate, LineItem>({ ...resource, type: LineItems.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: LineItems.TYPE } : id, options)\n\t}\n\n\tasync order(lineItemId: string | LineItem, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _lineItemId = (lineItemId as LineItem).id || lineItemId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `line_items/${_lineItemId}/order`, params, options) as unknown as Order\n\t}\n\n\tasync line_item_options(lineItemId: string | LineItem, params?: QueryParamsList<LineItemOption>, options?: ResourcesConfig): Promise<ListResponse<LineItemOption>> {\n\t\tconst _lineItemId = (lineItemId as LineItem).id || lineItemId as string\n\t\treturn this.resources.fetch<LineItemOption>({ type: 'line_item_options' }, `line_items/${_lineItemId}/line_item_options`, params, options) as unknown as ListResponse<LineItemOption>\n\t}\n\n\tasync return_line_items(lineItemId: string | LineItem, params?: QueryParamsList<ReturnLineItem>, options?: ResourcesConfig): Promise<ListResponse<ReturnLineItem>> {\n\t\tconst _lineItemId = (lineItemId as LineItem).id || lineItemId as string\n\t\treturn this.resources.fetch<ReturnLineItem>({ type: 'return_line_items' }, `line_items/${_lineItemId}/return_line_items`, params, options) as unknown as ListResponse<ReturnLineItem>\n\t}\n\n\tasync stock_reservations(lineItemId: string | LineItem, params?: QueryParamsList<StockReservation>, options?: ResourcesConfig): Promise<ListResponse<StockReservation>> {\n\t\tconst _lineItemId = (lineItemId as LineItem).id || lineItemId as string\n\t\treturn this.resources.fetch<StockReservation>({ type: 'stock_reservations' }, `line_items/${_lineItemId}/stock_reservations`, params, options) as unknown as ListResponse<StockReservation>\n\t}\n\n\tasync stock_line_items(lineItemId: string | LineItem, params?: QueryParamsList<StockLineItem>, options?: ResourcesConfig): Promise<ListResponse<StockLineItem>> {\n\t\tconst _lineItemId = (lineItemId as LineItem).id || lineItemId as string\n\t\treturn this.resources.fetch<StockLineItem>({ type: 'stock_line_items' }, `line_items/${_lineItemId}/stock_line_items`, params, options) as unknown as ListResponse<StockLineItem>\n\t}\n\n\tasync stock_transfers(lineItemId: string | LineItem, params?: QueryParamsList<StockTransfer>, options?: ResourcesConfig): Promise<ListResponse<StockTransfer>> {\n\t\tconst _lineItemId = (lineItemId as LineItem).id || lineItemId as string\n\t\treturn this.resources.fetch<StockTransfer>({ type: 'stock_transfers' }, `line_items/${_lineItemId}/stock_transfers`, params, options) as unknown as ListResponse<StockTransfer>\n\t}\n\n\tasync notifications(lineItemId: string | LineItem, params?: QueryParamsList<Notification>, options?: ResourcesConfig): Promise<ListResponse<Notification>> {\n\t\tconst _lineItemId = (lineItemId as LineItem).id || lineItemId as string\n\t\treturn this.resources.fetch<Notification>({ type: 'notifications' }, `line_items/${_lineItemId}/notifications`, params, options) as unknown as ListResponse<Notification>\n\t}\n\n\tasync events(lineItemId: string | LineItem, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _lineItemId = (lineItemId as LineItem).id || lineItemId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `line_items/${_lineItemId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync tags(lineItemId: string | LineItem, params?: QueryParamsList<Tag>, options?: ResourcesConfig): Promise<ListResponse<Tag>> {\n\t\tconst _lineItemId = (lineItemId as LineItem).id || lineItemId as string\n\t\treturn this.resources.fetch<Tag>({ type: 'tags' }, `line_items/${_lineItemId}/tags`, params, options) as unknown as ListResponse<Tag>\n\t}\n\n\tasync _external_price(id: string | LineItem, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\treturn this.resources.update<LineItemUpdate, LineItem>({ id: (typeof id === 'string')? id: id.id, type: LineItems.TYPE, _external_price: true }, params, options)\n\t}\n\n\tasync _reserve_stock(id: string | LineItem, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\treturn this.resources.update<LineItemUpdate, LineItem>({ id: (typeof id === 'string')? id: id.id, type: LineItems.TYPE, _reserve_stock: true }, params, options)\n\t}\n\n\tasync _reset_circuit(id: string | LineItem, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\treturn this.resources.update<LineItemUpdate, LineItem>({ id: (typeof id === 'string')? id: id.id, type: LineItems.TYPE, _reset_circuit: true }, params, options)\n\t}\n\n\tasync _add_tags(id: string | LineItem, triggerValue: string, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\treturn this.resources.update<LineItemUpdate, LineItem>({ id: (typeof id === 'string')? id: id.id, type: LineItems.TYPE, _add_tags: triggerValue }, params, options)\n\t}\n\n\tasync _remove_tags(id: string | LineItem, triggerValue: string, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\treturn this.resources.update<LineItemUpdate, LineItem>({ id: (typeof id === 'string')? id: id.id, type: LineItems.TYPE, _remove_tags: triggerValue }, params, options)\n\t}\n\n\n\tisLineItem(resource: any): resource is LineItem {\n\t\treturn resource.type && (resource.type === LineItems.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): LineItemRel {\n\t\treturn super.relationshipOneToOne<LineItemRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): LineItemRel[] {\n\t\treturn super.relationshipOneToMany<LineItemRel>(...ids)\n\t}\n\n\n\ttype(): LineItemType {\n\t\treturn LineItems.TYPE\n\t}\n\n}\n\n\nconst instance = new LineItems()\nexport default instance\n\nexport type { LineItems, LineItem, LineItemCreate, LineItemUpdate, LineItemType }\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/resources/links.ts"],"names":["ApiResource"],"mappings":";;;;AA2MA,MAAM,cAAcA,oBAAkB,CAAA;AAAA,EAErC,OAAgB,IAAiB,GAAA,OAAA;AAAA,EAEjC,MAAM,MAAA,CAAO,QAAsB,EAAA,MAAA,EAAoC,OAA0C,EAAA;AAChH,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAAyB,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,KAAM,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAClG,EAEA,MAAM,MAAA,CAAO,QAAsB,EAAA,MAAA,EAAoC,OAA0C,EAAA;AAChH,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAAyB,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,KAAM,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAClG,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,KAAA,CAAM,IAAK,EAAA,GAAI,IAAI,OAAO,CAAA;AAAA;AAC7F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AAGf;AAGA,MAAM,QAAA,GAAW,IAAI,KAAM,EAAA;AAC3B,IAAO,aAAQ,GAAA","file":"links.cjs","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Event } from './events'\nimport type { Order, OrderType } from './orders'\nimport type { Sku, SkuType } from './skus'\nimport type { SkuList, SkuListType } from './sku_lists'\n\n\ntype LinkType = 'links'\ntype LinkRel = ResourceRel & { type: LinkType }\ntype OrderRel = ResourceRel & { type: OrderType }\ntype SkuRel = ResourceRel & { type: SkuType }\ntype SkuListRel = ResourceRel & { type: SkuListType }\n\n\nexport type LinkSort = Pick<Link, 'id' | 'name' | 'starts_at' | 'expires_at' | 'item_type' | 'disabled_at'> & ResourceSort\n// export type LinkFilter = Pick<Link, 'id' | 'name' | 'client_id' | 'scope' | 'starts_at' | 'expires_at' | 'item_type' | 'params' | 'disabled_at'> & ResourceFilter\n\n\ninterface Link extends Resource {\n\t\n\treadonly type: LinkType\n\n\t/** \n\t * The link internal name.\n\t * @example ```\"FW SALE 2023\"```\n\t */\n\tname: string\n\t/** \n\t * The link application client id, used to fetch JWT.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tclient_id: string\n\t/** \n\t * The link application scope, used to fetch JWT.\n\t * @example ```\"market:id:GhvCxsElAQ,market:id:kJhgVcxZDr\"```\n\t */\n\tscope: string\n\t/** \n\t * The activation date/time of this link.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at?: string | null\n\t/** \n\t * The expiration date/time of this link (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at?: string | null\n\t/** \n\t * Indicates if the link is active (enabled and not expired).\n\t * @example ```true```\n\t */\n\tactive?: boolean | null\n\t/** \n\t * The link status. One of 'disabled', 'expired', 'pending', or 'active'.\n\t * @example ```\"pending\"```\n\t */\n\tstatus?: 'disabled' | 'expired' | 'pending' | 'active' | null\n\t/** \n\t * The link URL second level domain.\n\t * @example ```\"commercelayer.link\"```\n\t */\n\tdomain?: string | null\n\t/** \n\t * The link URL.\n\t * @example ```\"https://commercelayer.link/ZXUtd2VzdC0xLzE5ZjBlMGVlLTg4OGMtNDQ1Yi1iYTA0LTg3MTUxY2FjZjFmYQ\"```\n\t */\n\turl?: string | null\n\t/** \n\t * The type of the associated item. One of 'orders', 'skus', or 'sku_lists'.\n\t * @example ```\"orders\"```\n\t */\n\titem_type?: 'orders' | 'skus' | 'sku_lists' | null\n\t/** \n\t * The link params to be passed in URL the query string.\n\t * @example ```{\"param1\":\"ABC\",\"param2\":\"XYZ\"}```\n\t */\n\tparams?: Record<string, any> | null\n\t/** \n\t * Time at which this resource was disabled.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tdisabled_at?: string | null\n\n\titem?: Order | Sku | SkuList | null\n\tevents?: Event[] | null\n\n}\n\n\ninterface LinkCreate extends ResourceCreate {\n\t\n\t/** \n\t * The link internal name.\n\t * @example ```\"FW SALE 2023\"```\n\t */\n\tname: string\n\t/** \n\t * The link application client id, used to fetch JWT.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tclient_id: string\n\t/** \n\t * The link application scope, used to fetch JWT.\n\t * @example ```\"market:id:GhvCxsElAQ,market:id:kJhgVcxZDr\"```\n\t */\n\tscope: string\n\t/** \n\t * The activation date/time of this link.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at?: string | null\n\t/** \n\t * The expiration date/time of this link (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at?: string | null\n\t/** \n\t * The link URL second level domain.\n\t * @example ```\"commercelayer.link\"```\n\t */\n\tdomain?: string | null\n\t/** \n\t * The type of the associated item. One of 'orders', 'skus', or 'sku_lists'.\n\t * @example ```\"orders\"```\n\t */\n\titem_type?: 'orders' | 'skus' | 'sku_lists' | null\n\t/** \n\t * The link params to be passed in URL the query string.\n\t * @example ```{\"param1\":\"ABC\",\"param2\":\"XYZ\"}```\n\t */\n\tparams?: Record<string, any> | null\n\t/** \n\t * Send this attribute if you want to mark this resource as disabled.\n\t * @example ```true```\n\t */\n\t_disable?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this resource as enabled.\n\t * @example ```true```\n\t */\n\t_enable?: boolean | null\n\n\titem: OrderRel | SkuRel | SkuListRel\n\n}\n\n\ninterface LinkUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The link internal name.\n\t * @example ```\"FW SALE 2023\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The link application client id, used to fetch JWT.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tclient_id?: string | null\n\t/** \n\t * The link application scope, used to fetch JWT.\n\t * @example ```\"market:id:GhvCxsElAQ,market:id:kJhgVcxZDr\"```\n\t */\n\tscope?: string | null\n\t/** \n\t * The activation date/time of this link.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at?: string | null\n\t/** \n\t * The expiration date/time of this link (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at?: string | null\n\t/** \n\t * The link URL second level domain.\n\t * @example ```\"commercelayer.link\"```\n\t */\n\tdomain?: string | null\n\t/** \n\t * The link params to be passed in URL the query string.\n\t * @example ```{\"param1\":\"ABC\",\"param2\":\"XYZ\"}```\n\t */\n\tparams?: Record<string, any> | null\n\t/** \n\t * Send this attribute if you want to mark this resource as disabled.\n\t * @example ```true```\n\t */\n\t_disable?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this resource as enabled.\n\t * @example ```true```\n\t */\n\t_enable?: boolean | null\n\n\titem?: OrderRel | SkuRel | SkuListRel | null\n\n}\n\n\nclass Links extends ApiResource<Link> {\n\n\tstatic readonly TYPE: LinkType = 'links' as const\n\n\tasync create(resource: LinkCreate, params?: QueryParamsRetrieve<Link>, options?: ResourcesConfig): Promise<Link> {\n\t\treturn this.resources.create<LinkCreate, Link>({ ...resource, type: Links.TYPE }, params, options)\n\t}\n\n\tasync update(resource: LinkUpdate, params?: QueryParamsRetrieve<Link>, options?: ResourcesConfig): Promise<Link> {\n\t\treturn this.resources.update<LinkUpdate, Link>({ ...resource, type: Links.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: Links.TYPE } : id, options)\n\t}\n\n\tasync events(linkId: string | Link, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _linkId = (linkId as Link).id || linkId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `links/${_linkId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync _disable(id: string | Link, params?: QueryParamsRetrieve<Link>, options?: ResourcesConfig): Promise<Link> {\n\t\treturn this.resources.update<LinkUpdate, Link>({ id: (typeof id === 'string')? id: id.id, type: Links.TYPE, _disable: true }, params, options)\n\t}\n\n\tasync _enable(id: string | Link, params?: QueryParamsRetrieve<Link>, options?: ResourcesConfig): Promise<Link> {\n\t\treturn this.resources.update<LinkUpdate, Link>({ id: (typeof id === 'string')? id: id.id, type: Links.TYPE, _enable: true }, params, options)\n\t}\n\n\n\tisLink(resource: any): resource is Link {\n\t\treturn resource.type && (resource.type === Links.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): LinkRel {\n\t\treturn super.relationshipOneToOne<LinkRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): LinkRel[] {\n\t\treturn super.relationshipOneToMany<LinkRel>(...ids)\n\t}\n\n\n\ttype(): LinkType {\n\t\treturn Links.TYPE\n\t}\n\n}\n\n\nconst instance = new Links()\nexport default instance\n\nexport type { Link, LinkCreate, LinkUpdate, LinkType }\n"]}
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AE,EAAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,KAAM,CAAA,IAAA,EAAM,UAAU,IAAK,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AAC9I,EAEA,MAAM,OAAA,CAAQ,EAAmB,EAAA,MAAA,EAAoC,OAA0C,EAAA;AAC9G,IAAA,OAAO,KAAK,SAAU,CAAA,MAAA,CAAyB,EAAE,EAAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,KAAM,CAAA,IAAA,EAAM,SAAS,IAAK,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AAC7I,EAGA,OAAO,QAAiC,EAAA;AACvC,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,KAAM,CAAA,IAAA;AAAA;AAClD,EAGA,aAAa,EAAyC,EAAA;AACrD,IAAO,OAAA,KAAA,CAAM,qBAA8B,EAAE,CAAA;AAAA;AAC9C,EAEA,sBAAsB,GAA0B,EAAA;AAC/C,IAAO,OAAA,KAAA,CAAM,qBAA+B,CAAA,GAAG,GAAG,CAAA;AAAA;AACnD,EAGA,IAAiB,GAAA;AAChB,IAAA,OAAO,KAAM,CAAA,IAAA;AAAA;AAGf;AAGA,MAAM,QAAA,GAAW,IAAI,KAAM,EAAA;AAC3B,IAAO,aAAQ,GAAA","file":"links.cjs","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Event } from './events'\nimport type { Order, OrderType } from './orders'\nimport type { Sku, SkuType } from './skus'\nimport type { SkuList, SkuListType } from './sku_lists'\n\n\ntype LinkType = 'links'\ntype LinkRel = ResourceRel & { type: LinkType }\ntype OrderRel = ResourceRel & { type: OrderType }\ntype SkuRel = ResourceRel & { type: SkuType }\ntype SkuListRel = ResourceRel & { type: SkuListType }\n\n\nexport type LinkSort = Pick<Link, 'id' | 'name' | 'starts_at' | 'expires_at' | 'item_type' | 'disabled_at'> & ResourceSort\n// export type LinkFilter = Pick<Link, 'id' | 'name' | 'client_id' | 'scope' | 'starts_at' | 'expires_at' | 'item_type' | 'params' | 'disabled_at'> & ResourceFilter\n\n\ninterface Link extends Resource {\n\t\n\treadonly type: LinkType\n\n\t/** \n\t * The link internal name.\n\t * @example ```\"FW SALE 2023\"```\n\t */\n\tname: string\n\t/** \n\t * The link application client id, used to fetch JWT.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tclient_id: string\n\t/** \n\t * The link application scope, used to fetch JWT.\n\t * @example ```\"market:id:GhvCxsElAQ,market:id:kJhgVcxZDr\"```\n\t */\n\tscope: string\n\t/** \n\t * The activation date/time of this link.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at?: string | null\n\t/** \n\t * The expiration date/time of this link (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at?: string | null\n\t/** \n\t * Indicates if the link is active (enabled and not expired).\n\t * @example ```true```\n\t */\n\tactive?: boolean | null\n\t/** \n\t * The link status. One of 'disabled', 'expired', 'pending', or 'active'.\n\t * @example ```\"pending\"```\n\t */\n\tstatus?: 'disabled' | 'expired' | 'pending' | 'active' | null\n\t/** \n\t * The link URL second level domain.\n\t * @example ```\"commercelayer.link\"```\n\t */\n\tdomain?: string | null\n\t/** \n\t * The link URL.\n\t * @example ```\"https://commercelayer.link/ZXUtd2VzdC0xLzE5ZjBlMGVlLTg4OGMtNDQ1Yi1iYTA0LTg3MTUxY2FjZjFmYQ\"```\n\t */\n\turl?: string | null\n\t/** \n\t * The type of the associated item. One of 'orders', 'skus', or 'sku_lists'.\n\t * @example ```\"orders\"```\n\t */\n\titem_type?: 'orders' | 'skus' | 'sku_lists' | null\n\t/** \n\t * The link params to be passed in URL the query string.\n\t * @example ```{\"param1\":\"ABC\",\"param2\":\"XYZ\"}```\n\t */\n\tparams?: Record<string, any> | null\n\t/** \n\t * Time at which this resource was disabled.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tdisabled_at?: string | null\n\n\titem?: Order | Sku | SkuList | null\n\tevents?: Event[] | null\n\n}\n\n\ninterface LinkCreate extends ResourceCreate {\n\t\n\t/** \n\t * The link internal name.\n\t * @example ```\"FW SALE 2023\"```\n\t */\n\tname: string\n\t/** \n\t * The link application client id, used to fetch JWT.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tclient_id: string\n\t/** \n\t * The link application scope, used to fetch JWT.\n\t * @example ```\"market:id:GhvCxsElAQ,market:id:kJhgVcxZDr\"```\n\t */\n\tscope: string\n\t/** \n\t * The activation date/time of this link.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at?: string | null\n\t/** \n\t * The expiration date/time of this link (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at?: string | null\n\t/** \n\t * The link URL second level domain.\n\t * @example ```\"commercelayer.link\"```\n\t */\n\tdomain?: string | null\n\t/** \n\t * The type of the associated item. One of 'orders', 'skus', or 'sku_lists'.\n\t * @example ```\"orders\"```\n\t */\n\titem_type?: 'orders' | 'skus' | 'sku_lists' | null\n\t/** \n\t * The link params to be passed in URL the query string.\n\t * @example ```{\"param1\":\"ABC\",\"param2\":\"XYZ\"}```\n\t */\n\tparams?: Record<string, any> | null\n\t/** \n\t * Send this attribute if you want to mark this resource as disabled.\n\t * @example ```true```\n\t */\n\t_disable?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this resource as enabled.\n\t * @example ```true```\n\t */\n\t_enable?: boolean | null\n\n\titem: OrderRel | SkuRel | SkuListRel\n\n}\n\n\ninterface LinkUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The link internal name.\n\t * @example ```\"FW SALE 2023\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The link application client id, used to fetch JWT.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tclient_id?: string | null\n\t/** \n\t * The link application scope, used to fetch JWT.\n\t * @example ```\"market:id:GhvCxsElAQ,market:id:kJhgVcxZDr\"```\n\t */\n\tscope?: string | null\n\t/** \n\t * The activation date/time of this link.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at?: string | null\n\t/** \n\t * The expiration date/time of this link (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at?: string | null\n\t/** \n\t * The link URL second level domain.\n\t * @example ```\"commercelayer.link\"```\n\t */\n\tdomain?: string | null\n\t/** \n\t * The link params to be passed in URL the query string.\n\t * @example ```{\"param1\":\"ABC\",\"param2\":\"XYZ\"}```\n\t */\n\tparams?: Record<string, any> | null\n\t/** \n\t * Send this attribute if you want to mark this resource as disabled.\n\t * @example ```true```\n\t */\n\t_disable?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this resource as enabled.\n\t * @example ```true```\n\t */\n\t_enable?: boolean | null\n\n\titem?: OrderRel | SkuRel | SkuListRel | null\n\n}\n\n\nclass Links extends ApiResource<Link> {\n\n\tstatic readonly TYPE: LinkType = 'links' as const\n\n\tasync create(resource: LinkCreate, params?: QueryParamsRetrieve<Link>, options?: ResourcesConfig): Promise<Link> {\n\t\treturn this.resources.create<LinkCreate, Link>({ ...resource, type: Links.TYPE }, params, options)\n\t}\n\n\tasync update(resource: LinkUpdate, params?: QueryParamsRetrieve<Link>, options?: ResourcesConfig): Promise<Link> {\n\t\treturn this.resources.update<LinkUpdate, Link>({ ...resource, type: Links.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: Links.TYPE } : id, options)\n\t}\n\n\tasync events(linkId: string | Link, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _linkId = (linkId as Link).id || linkId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `links/${_linkId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync _disable(id: string | Link, params?: QueryParamsRetrieve<Link>, options?: ResourcesConfig): Promise<Link> {\n\t\treturn this.resources.update<LinkUpdate, Link>({ id: (typeof id === 'string')? id: id.id, type: Links.TYPE, _disable: true }, params, options)\n\t}\n\n\tasync _enable(id: string | Link, params?: QueryParamsRetrieve<Link>, options?: ResourcesConfig): Promise<Link> {\n\t\treturn this.resources.update<LinkUpdate, Link>({ id: (typeof id === 'string')? id: id.id, type: Links.TYPE, _enable: true }, params, options)\n\t}\n\n\n\tisLink(resource: any): resource is Link {\n\t\treturn resource.type && (resource.type === Links.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): LinkRel {\n\t\treturn super.relationshipOneToOne<LinkRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): LinkRel[] {\n\t\treturn super.relationshipOneToMany<LinkRel>(...ids)\n\t}\n\n\n\ttype(): LinkType {\n\t\treturn Links.TYPE\n\t}\n\n}\n\n\nconst instance = new Links()\nexport default instance\n\nexport type { Links, Link, LinkCreate, LinkUpdate, LinkType }\n"]}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export {
|
1
|
+
export { hl as Link, hm as LinkCreate, ho as LinkSort, m9 as LinkType, hn as LinkUpdate, bC as Links, bB as default } from '../api-IwWtsAqE.cjs';
|
2
2
|
import '../client.cjs';
|
3
|
-
import '../interceptor-
|
3
|
+
import '../interceptor-k15jXzf0.cjs';
|
4
4
|
import '../types.cjs';
|