@commercelayer/sdk 7.0.0-beta.8 → 7.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -35
- package/lib/api-DDgIE2i8.d.ts +17175 -0
- package/lib/api-DmIZO_Np.d.cts +17175 -0
- package/lib/api.cjs +796 -0
- package/lib/api.cjs.map +1 -0
- package/lib/api.d.cts +4 -0
- package/lib/api.d.ts +4 -0
- package/lib/api.js +133 -0
- package/lib/api.js.map +1 -0
- package/lib/client.cjs +160 -0
- package/lib/client.cjs.map +1 -0
- package/lib/client.d.cts +36 -0
- package/lib/client.d.ts +36 -0
- package/lib/client.js +151 -0
- package/lib/client.js.map +1 -0
- package/lib/commercelayer.cjs +114 -0
- package/lib/commercelayer.cjs.map +1 -0
- package/lib/commercelayer.d.cts +36 -0
- package/lib/commercelayer.d.ts +36 -0
- package/lib/commercelayer.js +104 -0
- package/lib/commercelayer.js.map +1 -0
- package/lib/config.cjs +23 -0
- package/lib/config.cjs.map +1 -0
- package/lib/config.d.cts +19 -0
- package/lib/config.d.ts +19 -0
- package/lib/config.js +19 -0
- package/lib/config.js.map +1 -0
- package/lib/debug.cjs +21 -0
- package/lib/debug.cjs.map +1 -0
- package/lib/debug.d.cts +4 -0
- package/lib/debug.d.ts +4 -0
- package/lib/debug.js +17 -0
- package/lib/debug.js.map +1 -0
- package/lib/enum.cjs +659 -0
- package/lib/enum.cjs.map +1 -0
- package/lib/enum.d.cts +4 -0
- package/lib/enum.d.ts +4 -0
- package/lib/enum.js +643 -0
- package/lib/enum.js.map +1 -0
- package/lib/error.cjs +101 -0
- package/lib/error.cjs.map +1 -0
- package/lib/error.d.cts +38 -0
- package/lib/error.d.ts +38 -0
- package/lib/error.js +93 -0
- package/lib/error.js.map +1 -0
- package/lib/fetch.cjs +69 -0
- package/lib/fetch.cjs.map +1 -0
- package/lib/fetch.d.cts +1 -0
- package/lib/fetch.d.ts +1 -0
- package/lib/fetch.js +62 -0
- package/lib/fetch.js.map +1 -0
- package/lib/index.cjs +34 -2
- package/lib/index.cjs.map +1 -0
- package/lib/index.d.cts +7 -17201
- package/lib/index.d.ts +7 -17201
- package/lib/index.js +5 -2
- package/lib/index.js.map +1 -0
- package/lib/interceptor-5MISI1yn.d.cts +54 -0
- package/lib/interceptor-5MISI1yn.d.ts +54 -0
- package/lib/interceptor.cjs +4 -0
- package/lib/interceptor.cjs.map +1 -0
- package/lib/interceptor.d.cts +1 -0
- package/lib/interceptor.d.ts +1 -0
- package/lib/interceptor.js +3 -0
- package/lib/interceptor.js.map +1 -0
- package/lib/jsonapi.cjs +81 -0
- package/lib/jsonapi.cjs.map +1 -0
- package/lib/jsonapi.d.cts +11 -0
- package/lib/jsonapi.d.ts +11 -0
- package/lib/jsonapi.js +73 -0
- package/lib/jsonapi.js.map +1 -0
- package/lib/model.cjs +4 -0
- package/lib/model.cjs.map +1 -0
- package/lib/model.d.cts +4 -0
- package/lib/model.d.ts +4 -0
- package/lib/model.js +3 -0
- package/lib/model.js.map +1 -0
- package/lib/query.cjs +66 -0
- package/lib/query.cjs.map +1 -0
- package/lib/query.d.cts +4 -0
- package/lib/query.d.ts +4 -0
- package/lib/query.js +58 -0
- package/lib/query.js.map +1 -0
- package/lib/resource.cjs +218 -0
- package/lib/resource.cjs.map +1 -0
- package/lib/resource.d.cts +4 -0
- package/lib/resource.d.ts +4 -0
- package/lib/resource.js +206 -0
- package/lib/resource.js.map +1 -0
- package/lib/resources/addresses.cjs +58 -0
- package/lib/resources/addresses.cjs.map +1 -0
- package/lib/resources/addresses.d.cts +4 -0
- package/lib/resources/addresses.d.ts +4 -0
- package/lib/resources/addresses.js +54 -0
- package/lib/resources/addresses.js.map +1 -0
- package/lib/resources/adjustments.cjs +40 -0
- package/lib/resources/adjustments.cjs.map +1 -0
- package/lib/resources/adjustments.d.cts +4 -0
- package/lib/resources/adjustments.d.ts +4 -0
- package/lib/resources/adjustments.js +36 -0
- package/lib/resources/adjustments.js.map +1 -0
- package/lib/resources/adyen_gateways.cjs +48 -0
- package/lib/resources/adyen_gateways.cjs.map +1 -0
- package/lib/resources/adyen_gateways.d.cts +4 -0
- package/lib/resources/adyen_gateways.d.ts +4 -0
- package/lib/resources/adyen_gateways.js +44 -0
- package/lib/resources/adyen_gateways.js.map +1 -0
- package/lib/resources/adyen_payments.cjs +54 -0
- package/lib/resources/adyen_payments.cjs.map +1 -0
- package/lib/resources/adyen_payments.d.cts +4 -0
- package/lib/resources/adyen_payments.d.ts +4 -0
- package/lib/resources/adyen_payments.js +50 -0
- package/lib/resources/adyen_payments.js.map +1 -0
- package/lib/resources/applications.cjs +30 -0
- package/lib/resources/applications.cjs.map +1 -0
- package/lib/resources/applications.d.cts +4 -0
- package/lib/resources/applications.d.ts +4 -0
- package/lib/resources/applications.js +26 -0
- package/lib/resources/applications.js.map +1 -0
- package/lib/resources/attachments.cjs +36 -0
- package/lib/resources/attachments.cjs.map +1 -0
- package/lib/resources/attachments.d.cts +4 -0
- package/lib/resources/attachments.d.ts +4 -0
- package/lib/resources/attachments.js +32 -0
- package/lib/resources/attachments.js.map +1 -0
- package/lib/resources/authorizations.cjs +69 -0
- package/lib/resources/authorizations.cjs.map +1 -0
- package/lib/resources/authorizations.d.cts +4 -0
- package/lib/resources/authorizations.d.ts +4 -0
- package/lib/resources/authorizations.js +65 -0
- package/lib/resources/authorizations.js.map +1 -0
- package/lib/resources/avalara_accounts.cjs +56 -0
- package/lib/resources/avalara_accounts.cjs.map +1 -0
- package/lib/resources/avalara_accounts.d.cts +4 -0
- package/lib/resources/avalara_accounts.d.ts +4 -0
- package/lib/resources/avalara_accounts.js +52 -0
- package/lib/resources/avalara_accounts.js.map +1 -0
- package/lib/resources/axerve_gateways.cjs +48 -0
- package/lib/resources/axerve_gateways.cjs.map +1 -0
- package/lib/resources/axerve_gateways.d.cts +4 -0
- package/lib/resources/axerve_gateways.d.ts +4 -0
- package/lib/resources/axerve_gateways.js +44 -0
- package/lib/resources/axerve_gateways.js.map +1 -0
- package/lib/resources/axerve_payments.cjs +51 -0
- package/lib/resources/axerve_payments.cjs.map +1 -0
- package/lib/resources/axerve_payments.d.cts +4 -0
- package/lib/resources/axerve_payments.d.ts +4 -0
- package/lib/resources/axerve_payments.js +47 -0
- package/lib/resources/axerve_payments.js.map +1 -0
- package/lib/resources/bing_geocoders.cjs +48 -0
- package/lib/resources/bing_geocoders.cjs.map +1 -0
- package/lib/resources/bing_geocoders.d.cts +4 -0
- package/lib/resources/bing_geocoders.d.ts +4 -0
- package/lib/resources/bing_geocoders.js +44 -0
- package/lib/resources/bing_geocoders.js.map +1 -0
- package/lib/resources/braintree_gateways.cjs +48 -0
- package/lib/resources/braintree_gateways.cjs.map +1 -0
- package/lib/resources/braintree_gateways.d.cts +4 -0
- package/lib/resources/braintree_gateways.d.ts +4 -0
- package/lib/resources/braintree_gateways.js +44 -0
- package/lib/resources/braintree_gateways.js.map +1 -0
- package/lib/resources/braintree_payments.cjs +48 -0
- package/lib/resources/braintree_payments.cjs.map +1 -0
- package/lib/resources/braintree_payments.d.cts +4 -0
- package/lib/resources/braintree_payments.d.ts +4 -0
- package/lib/resources/braintree_payments.js +44 -0
- package/lib/resources/braintree_payments.js.map +1 -0
- package/lib/resources/bundles.cjs +76 -0
- package/lib/resources/bundles.cjs.map +1 -0
- package/lib/resources/bundles.d.cts +4 -0
- package/lib/resources/bundles.d.ts +4 -0
- package/lib/resources/bundles.js +72 -0
- package/lib/resources/bundles.js.map +1 -0
- package/lib/resources/buy_x_pay_y_promotions.cjs +96 -0
- package/lib/resources/buy_x_pay_y_promotions.cjs.map +1 -0
- package/lib/resources/buy_x_pay_y_promotions.d.cts +4 -0
- package/lib/resources/buy_x_pay_y_promotions.d.ts +4 -0
- package/lib/resources/buy_x_pay_y_promotions.js +92 -0
- package/lib/resources/buy_x_pay_y_promotions.js.map +1 -0
- package/lib/resources/captures.cjs +70 -0
- package/lib/resources/captures.cjs.map +1 -0
- package/lib/resources/captures.d.cts +4 -0
- package/lib/resources/captures.d.ts +4 -0
- package/lib/resources/captures.js +66 -0
- package/lib/resources/captures.js.map +1 -0
- package/lib/resources/carrier_accounts.cjs +48 -0
- package/lib/resources/carrier_accounts.cjs.map +1 -0
- package/lib/resources/carrier_accounts.d.cts +4 -0
- package/lib/resources/carrier_accounts.d.ts +4 -0
- package/lib/resources/carrier_accounts.js +44 -0
- package/lib/resources/carrier_accounts.js.map +1 -0
- package/lib/resources/checkout_com_gateways.cjs +48 -0
- package/lib/resources/checkout_com_gateways.cjs.map +1 -0
- package/lib/resources/checkout_com_gateways.d.cts +4 -0
- package/lib/resources/checkout_com_gateways.d.ts +4 -0
- package/lib/resources/checkout_com_gateways.js +44 -0
- package/lib/resources/checkout_com_gateways.js.map +1 -0
- package/lib/resources/checkout_com_payments.cjs +54 -0
- package/lib/resources/checkout_com_payments.cjs.map +1 -0
- package/lib/resources/checkout_com_payments.d.cts +4 -0
- package/lib/resources/checkout_com_payments.d.ts +4 -0
- package/lib/resources/checkout_com_payments.js +50 -0
- package/lib/resources/checkout_com_payments.js.map +1 -0
- package/lib/resources/cleanups.cjs +47 -0
- package/lib/resources/cleanups.cjs.map +1 -0
- package/lib/resources/cleanups.d.cts +4 -0
- package/lib/resources/cleanups.d.ts +4 -0
- package/lib/resources/cleanups.js +43 -0
- package/lib/resources/cleanups.js.map +1 -0
- package/lib/resources/coupon_codes_promotion_rules.cjs +44 -0
- package/lib/resources/coupon_codes_promotion_rules.cjs.map +1 -0
- package/lib/resources/coupon_codes_promotion_rules.d.cts +4 -0
- package/lib/resources/coupon_codes_promotion_rules.d.ts +4 -0
- package/lib/resources/coupon_codes_promotion_rules.js +40 -0
- package/lib/resources/coupon_codes_promotion_rules.js.map +1 -0
- package/lib/resources/coupon_recipients.cjs +48 -0
- package/lib/resources/coupon_recipients.cjs.map +1 -0
- package/lib/resources/coupon_recipients.d.cts +4 -0
- package/lib/resources/coupon_recipients.d.ts +4 -0
- package/lib/resources/coupon_recipients.js +44 -0
- package/lib/resources/coupon_recipients.js.map +1 -0
- package/lib/resources/coupons.cjs +62 -0
- package/lib/resources/coupons.cjs.map +1 -0
- package/lib/resources/coupons.d.cts +4 -0
- package/lib/resources/coupons.d.ts +4 -0
- package/lib/resources/coupons.js +58 -0
- package/lib/resources/coupons.js.map +1 -0
- package/lib/resources/custom_promotion_rules.cjs +40 -0
- package/lib/resources/custom_promotion_rules.cjs.map +1 -0
- package/lib/resources/custom_promotion_rules.d.cts +4 -0
- package/lib/resources/custom_promotion_rules.d.ts +4 -0
- package/lib/resources/custom_promotion_rules.js +36 -0
- package/lib/resources/custom_promotion_rules.js.map +1 -0
- package/lib/resources/customer_addresses.cjs +52 -0
- package/lib/resources/customer_addresses.cjs.map +1 -0
- package/lib/resources/customer_addresses.d.cts +4 -0
- package/lib/resources/customer_addresses.d.ts +4 -0
- package/lib/resources/customer_addresses.js +48 -0
- package/lib/resources/customer_addresses.js.map +1 -0
- package/lib/resources/customer_groups.cjs +52 -0
- package/lib/resources/customer_groups.cjs.map +1 -0
- package/lib/resources/customer_groups.d.cts +4 -0
- package/lib/resources/customer_groups.d.ts +4 -0
- package/lib/resources/customer_groups.js +48 -0
- package/lib/resources/customer_groups.js.map +1 -0
- package/lib/resources/customer_password_resets.cjs +47 -0
- package/lib/resources/customer_password_resets.cjs.map +1 -0
- package/lib/resources/customer_password_resets.d.cts +4 -0
- package/lib/resources/customer_password_resets.d.ts +4 -0
- package/lib/resources/customer_password_resets.js +43 -0
- package/lib/resources/customer_password_resets.js.map +1 -0
- package/lib/resources/customer_payment_sources.cjs +48 -0
- package/lib/resources/customer_payment_sources.cjs.map +1 -0
- package/lib/resources/customer_payment_sources.d.cts +4 -0
- package/lib/resources/customer_payment_sources.d.ts +4 -0
- package/lib/resources/customer_payment_sources.js +44 -0
- package/lib/resources/customer_payment_sources.js.map +1 -0
- package/lib/resources/customer_subscriptions.cjs +48 -0
- package/lib/resources/customer_subscriptions.cjs.map +1 -0
- package/lib/resources/customer_subscriptions.d.cts +4 -0
- package/lib/resources/customer_subscriptions.d.ts +4 -0
- package/lib/resources/customer_subscriptions.js +44 -0
- package/lib/resources/customer_subscriptions.js.map +1 -0
- package/lib/resources/customers.cjs +86 -0
- package/lib/resources/customers.cjs.map +1 -0
- package/lib/resources/customers.d.cts +4 -0
- package/lib/resources/customers.d.ts +4 -0
- package/lib/resources/customers.js +82 -0
- package/lib/resources/customers.js.map +1 -0
- package/lib/resources/delivery_lead_times.cjs +52 -0
- package/lib/resources/delivery_lead_times.cjs.map +1 -0
- package/lib/resources/delivery_lead_times.d.cts +4 -0
- package/lib/resources/delivery_lead_times.d.ts +4 -0
- package/lib/resources/delivery_lead_times.js +48 -0
- package/lib/resources/delivery_lead_times.js.map +1 -0
- package/lib/resources/discount_engine_items.cjs +35 -0
- package/lib/resources/discount_engine_items.cjs.map +1 -0
- package/lib/resources/discount_engine_items.d.cts +4 -0
- package/lib/resources/discount_engine_items.d.ts +4 -0
- package/lib/resources/discount_engine_items.js +31 -0
- package/lib/resources/discount_engine_items.js.map +1 -0
- package/lib/resources/discount_engines.cjs +43 -0
- package/lib/resources/discount_engines.cjs.map +1 -0
- package/lib/resources/discount_engines.d.cts +4 -0
- package/lib/resources/discount_engines.d.ts +4 -0
- package/lib/resources/discount_engines.js +39 -0
- package/lib/resources/discount_engines.js.map +1 -0
- package/lib/resources/easypost_pickups.cjs +51 -0
- package/lib/resources/easypost_pickups.cjs.map +1 -0
- package/lib/resources/easypost_pickups.d.cts +4 -0
- package/lib/resources/easypost_pickups.d.ts +4 -0
- package/lib/resources/easypost_pickups.js +47 -0
- package/lib/resources/easypost_pickups.js.map +1 -0
- package/lib/resources/event_callbacks.cjs +31 -0
- package/lib/resources/event_callbacks.cjs.map +1 -0
- package/lib/resources/event_callbacks.d.cts +4 -0
- package/lib/resources/event_callbacks.d.ts +4 -0
- package/lib/resources/event_callbacks.js +27 -0
- package/lib/resources/event_callbacks.js.map +1 -0
- package/lib/resources/events.cjs +41 -0
- package/lib/resources/events.cjs.map +1 -0
- package/lib/resources/events.d.cts +4 -0
- package/lib/resources/events.d.ts +4 -0
- package/lib/resources/events.js +37 -0
- package/lib/resources/events.js.map +1 -0
- package/lib/resources/exports.cjs +47 -0
- package/lib/resources/exports.cjs.map +1 -0
- package/lib/resources/exports.d.cts +4 -0
- package/lib/resources/exports.d.ts +4 -0
- package/lib/resources/exports.js +43 -0
- package/lib/resources/exports.js.map +1 -0
- package/lib/resources/external_gateways.cjs +51 -0
- package/lib/resources/external_gateways.cjs.map +1 -0
- package/lib/resources/external_gateways.d.cts +4 -0
- package/lib/resources/external_gateways.d.ts +4 -0
- package/lib/resources/external_gateways.js +47 -0
- package/lib/resources/external_gateways.js.map +1 -0
- package/lib/resources/external_payments.cjs +52 -0
- package/lib/resources/external_payments.cjs.map +1 -0
- package/lib/resources/external_payments.d.cts +4 -0
- package/lib/resources/external_payments.d.ts +4 -0
- package/lib/resources/external_payments.js +48 -0
- package/lib/resources/external_payments.js.map +1 -0
- package/lib/resources/external_promotions.cjs +99 -0
- package/lib/resources/external_promotions.cjs.map +1 -0
- package/lib/resources/external_promotions.d.cts +4 -0
- package/lib/resources/external_promotions.d.ts +4 -0
- package/lib/resources/external_promotions.js +95 -0
- package/lib/resources/external_promotions.js.map +1 -0
- package/lib/resources/external_tax_calculators.cjs +55 -0
- package/lib/resources/external_tax_calculators.cjs.map +1 -0
- package/lib/resources/external_tax_calculators.d.cts +4 -0
- package/lib/resources/external_tax_calculators.d.ts +4 -0
- package/lib/resources/external_tax_calculators.js +51 -0
- package/lib/resources/external_tax_calculators.js.map +1 -0
- package/lib/resources/fixed_amount_promotions.cjs +96 -0
- package/lib/resources/fixed_amount_promotions.cjs.map +1 -0
- package/lib/resources/fixed_amount_promotions.d.cts +4 -0
- package/lib/resources/fixed_amount_promotions.d.ts +4 -0
- package/lib/resources/fixed_amount_promotions.js +92 -0
- package/lib/resources/fixed_amount_promotions.js.map +1 -0
- package/lib/resources/fixed_price_promotions.cjs +96 -0
- package/lib/resources/fixed_price_promotions.cjs.map +1 -0
- package/lib/resources/fixed_price_promotions.d.cts +4 -0
- package/lib/resources/fixed_price_promotions.d.ts +4 -0
- package/lib/resources/fixed_price_promotions.js +92 -0
- package/lib/resources/fixed_price_promotions.js.map +1 -0
- package/lib/resources/flex_promotions.cjs +72 -0
- package/lib/resources/flex_promotions.cjs.map +1 -0
- package/lib/resources/flex_promotions.d.cts +4 -0
- package/lib/resources/flex_promotions.d.ts +4 -0
- package/lib/resources/flex_promotions.js +68 -0
- package/lib/resources/flex_promotions.js.map +1 -0
- package/lib/resources/free_gift_promotions.cjs +96 -0
- package/lib/resources/free_gift_promotions.cjs.map +1 -0
- package/lib/resources/free_gift_promotions.d.cts +4 -0
- package/lib/resources/free_gift_promotions.d.ts +4 -0
- package/lib/resources/free_gift_promotions.js +92 -0
- package/lib/resources/free_gift_promotions.js.map +1 -0
- package/lib/resources/free_shipping_promotions.cjs +92 -0
- package/lib/resources/free_shipping_promotions.cjs.map +1 -0
- package/lib/resources/free_shipping_promotions.d.cts +4 -0
- package/lib/resources/free_shipping_promotions.d.ts +4 -0
- package/lib/resources/free_shipping_promotions.js +88 -0
- package/lib/resources/free_shipping_promotions.js.map +1 -0
- package/lib/resources/geocoders.cjs +39 -0
- package/lib/resources/geocoders.cjs.map +1 -0
- package/lib/resources/geocoders.d.cts +4 -0
- package/lib/resources/geocoders.d.ts +4 -0
- package/lib/resources/geocoders.js +35 -0
- package/lib/resources/geocoders.js.map +1 -0
- package/lib/resources/gift_card_recipients.cjs +48 -0
- package/lib/resources/gift_card_recipients.cjs.map +1 -0
- package/lib/resources/gift_card_recipients.d.cts +4 -0
- package/lib/resources/gift_card_recipients.d.ts +4 -0
- package/lib/resources/gift_card_recipients.js +44 -0
- package/lib/resources/gift_card_recipients.js.map +1 -0
- package/lib/resources/gift_cards.cjs +78 -0
- package/lib/resources/gift_cards.cjs.map +1 -0
- package/lib/resources/gift_cards.d.cts +4 -0
- package/lib/resources/gift_cards.d.ts +4 -0
- package/lib/resources/gift_cards.js +74 -0
- package/lib/resources/gift_cards.js.map +1 -0
- package/lib/resources/google_geocoders.cjs +48 -0
- package/lib/resources/google_geocoders.cjs.map +1 -0
- package/lib/resources/google_geocoders.d.cts +4 -0
- package/lib/resources/google_geocoders.d.ts +4 -0
- package/lib/resources/google_geocoders.js +44 -0
- package/lib/resources/google_geocoders.js.map +1 -0
- package/lib/resources/imports.cjs +43 -0
- package/lib/resources/imports.cjs.map +1 -0
- package/lib/resources/imports.d.cts +4 -0
- package/lib/resources/imports.d.ts +4 -0
- package/lib/resources/imports.js +39 -0
- package/lib/resources/imports.js.map +1 -0
- package/lib/resources/in_stock_subscriptions.cjs +62 -0
- package/lib/resources/in_stock_subscriptions.cjs.map +1 -0
- package/lib/resources/in_stock_subscriptions.d.cts +4 -0
- package/lib/resources/in_stock_subscriptions.d.ts +4 -0
- package/lib/resources/in_stock_subscriptions.js +58 -0
- package/lib/resources/in_stock_subscriptions.js.map +1 -0
- package/lib/resources/inventory_models.cjs +52 -0
- package/lib/resources/inventory_models.cjs.map +1 -0
- package/lib/resources/inventory_models.d.cts +4 -0
- package/lib/resources/inventory_models.d.ts +4 -0
- package/lib/resources/inventory_models.js +48 -0
- package/lib/resources/inventory_models.js.map +1 -0
- package/lib/resources/inventory_return_locations.cjs +48 -0
- package/lib/resources/inventory_return_locations.cjs.map +1 -0
- package/lib/resources/inventory_return_locations.d.cts +4 -0
- package/lib/resources/inventory_return_locations.d.ts +4 -0
- package/lib/resources/inventory_return_locations.js +44 -0
- package/lib/resources/inventory_return_locations.js.map +1 -0
- package/lib/resources/inventory_stock_locations.cjs +48 -0
- package/lib/resources/inventory_stock_locations.cjs.map +1 -0
- package/lib/resources/inventory_stock_locations.d.cts +4 -0
- package/lib/resources/inventory_stock_locations.d.ts +4 -0
- package/lib/resources/inventory_stock_locations.js +44 -0
- package/lib/resources/inventory_stock_locations.js.map +1 -0
- package/lib/resources/klarna_gateways.cjs +48 -0
- package/lib/resources/klarna_gateways.cjs.map +1 -0
- package/lib/resources/klarna_gateways.d.cts +4 -0
- package/lib/resources/klarna_gateways.d.ts +4 -0
- package/lib/resources/klarna_gateways.js +44 -0
- package/lib/resources/klarna_gateways.js.map +1 -0
- package/lib/resources/klarna_payments.cjs +51 -0
- package/lib/resources/klarna_payments.cjs.map +1 -0
- package/lib/resources/klarna_payments.d.cts +4 -0
- package/lib/resources/klarna_payments.d.ts +4 -0
- package/lib/resources/klarna_payments.js +47 -0
- package/lib/resources/klarna_payments.js.map +1 -0
- package/lib/resources/line_item_options.cjs +58 -0
- package/lib/resources/line_item_options.cjs.map +1 -0
- package/lib/resources/line_item_options.d.cts +4 -0
- package/lib/resources/line_item_options.d.ts +4 -0
- package/lib/resources/line_item_options.js +54 -0
- package/lib/resources/line_item_options.js.map +1 -0
- package/lib/resources/line_items.cjs +87 -0
- package/lib/resources/line_items.cjs.map +1 -0
- package/lib/resources/line_items.d.cts +4 -0
- package/lib/resources/line_items.d.ts +4 -0
- package/lib/resources/line_items.js +83 -0
- package/lib/resources/line_items.js.map +1 -0
- package/lib/resources/links.cjs +46 -0
- package/lib/resources/links.cjs.map +1 -0
- package/lib/resources/links.d.cts +4 -0
- package/lib/resources/links.d.ts +4 -0
- package/lib/resources/links.js +42 -0
- package/lib/resources/links.js.map +1 -0
- package/lib/resources/manual_gateways.cjs +44 -0
- package/lib/resources/manual_gateways.cjs.map +1 -0
- package/lib/resources/manual_gateways.d.cts +4 -0
- package/lib/resources/manual_gateways.d.ts +4 -0
- package/lib/resources/manual_gateways.js +40 -0
- package/lib/resources/manual_gateways.js.map +1 -0
- package/lib/resources/manual_tax_calculators.cjs +56 -0
- package/lib/resources/manual_tax_calculators.cjs.map +1 -0
- package/lib/resources/manual_tax_calculators.d.cts +4 -0
- package/lib/resources/manual_tax_calculators.d.ts +4 -0
- package/lib/resources/manual_tax_calculators.js +52 -0
- package/lib/resources/manual_tax_calculators.js.map +1 -0
- package/lib/resources/markets.cjs +98 -0
- package/lib/resources/markets.cjs.map +1 -0
- package/lib/resources/markets.d.cts +4 -0
- package/lib/resources/markets.d.ts +4 -0
- package/lib/resources/markets.js +94 -0
- package/lib/resources/markets.js.map +1 -0
- package/lib/resources/merchants.cjs +48 -0
- package/lib/resources/merchants.cjs.map +1 -0
- package/lib/resources/merchants.d.cts +4 -0
- package/lib/resources/merchants.d.ts +4 -0
- package/lib/resources/merchants.js +44 -0
- package/lib/resources/merchants.js.map +1 -0
- package/lib/resources/notifications.cjs +36 -0
- package/lib/resources/notifications.cjs.map +1 -0
- package/lib/resources/notifications.d.cts +4 -0
- package/lib/resources/notifications.d.ts +4 -0
- package/lib/resources/notifications.js +32 -0
- package/lib/resources/notifications.js.map +1 -0
- package/lib/resources/order_amount_promotion_rules.cjs +40 -0
- package/lib/resources/order_amount_promotion_rules.cjs.map +1 -0
- package/lib/resources/order_amount_promotion_rules.d.cts +4 -0
- package/lib/resources/order_amount_promotion_rules.d.ts +4 -0
- package/lib/resources/order_amount_promotion_rules.js +36 -0
- package/lib/resources/order_amount_promotion_rules.js.map +1 -0
- package/lib/resources/order_copies.cjs +52 -0
- package/lib/resources/order_copies.cjs.map +1 -0
- package/lib/resources/order_copies.d.cts +4 -0
- package/lib/resources/order_copies.d.ts +4 -0
- package/lib/resources/order_copies.js +48 -0
- package/lib/resources/order_copies.js.map +1 -0
- package/lib/resources/order_factories.cjs +39 -0
- package/lib/resources/order_factories.cjs.map +1 -0
- package/lib/resources/order_factories.d.cts +4 -0
- package/lib/resources/order_factories.d.ts +4 -0
- package/lib/resources/order_factories.js +35 -0
- package/lib/resources/order_factories.js.map +1 -0
- package/lib/resources/order_subscription_items.cjs +44 -0
- package/lib/resources/order_subscription_items.cjs.map +1 -0
- package/lib/resources/order_subscription_items.d.cts +4 -0
- package/lib/resources/order_subscription_items.d.ts +4 -0
- package/lib/resources/order_subscription_items.js +40 -0
- package/lib/resources/order_subscription_items.js.map +1 -0
- package/lib/resources/order_subscriptions.cjs +102 -0
- package/lib/resources/order_subscriptions.cjs.map +1 -0
- package/lib/resources/order_subscriptions.d.cts +4 -0
- package/lib/resources/order_subscriptions.d.ts +4 -0
- package/lib/resources/order_subscriptions.js +98 -0
- package/lib/resources/order_subscriptions.js.map +1 -0
- package/lib/resources/orders.cjs +279 -0
- package/lib/resources/orders.cjs.map +1 -0
- package/lib/resources/orders.d.cts +4 -0
- package/lib/resources/orders.d.ts +4 -0
- package/lib/resources/orders.js +275 -0
- package/lib/resources/orders.js.map +1 -0
- package/lib/resources/organizations.cjs +30 -0
- package/lib/resources/organizations.cjs.map +1 -0
- package/lib/resources/organizations.d.cts +4 -0
- package/lib/resources/organizations.d.ts +4 -0
- package/lib/resources/organizations.js +26 -0
- package/lib/resources/organizations.js.map +1 -0
- package/lib/resources/packages.cjs +52 -0
- package/lib/resources/packages.cjs.map +1 -0
- package/lib/resources/packages.d.cts +4 -0
- package/lib/resources/packages.d.ts +4 -0
- package/lib/resources/packages.js +48 -0
- package/lib/resources/packages.js.map +1 -0
- package/lib/resources/parcel_line_items.cjs +48 -0
- package/lib/resources/parcel_line_items.cjs.map +1 -0
- package/lib/resources/parcel_line_items.d.cts +4 -0
- package/lib/resources/parcel_line_items.d.ts +4 -0
- package/lib/resources/parcel_line_items.js +44 -0
- package/lib/resources/parcel_line_items.js.map +1 -0
- package/lib/resources/parcels.cjs +60 -0
- package/lib/resources/parcels.cjs.map +1 -0
- package/lib/resources/parcels.d.cts +4 -0
- package/lib/resources/parcels.d.ts +4 -0
- package/lib/resources/parcels.js +56 -0
- package/lib/resources/parcels.js.map +1 -0
- package/lib/resources/payment_gateways.cjs +35 -0
- package/lib/resources/payment_gateways.cjs.map +1 -0
- package/lib/resources/payment_gateways.d.cts +4 -0
- package/lib/resources/payment_gateways.d.ts +4 -0
- package/lib/resources/payment_gateways.js +31 -0
- package/lib/resources/payment_gateways.js.map +1 -0
- package/lib/resources/payment_methods.cjs +66 -0
- package/lib/resources/payment_methods.cjs.map +1 -0
- package/lib/resources/payment_methods.d.cts +4 -0
- package/lib/resources/payment_methods.d.ts +4 -0
- package/lib/resources/payment_methods.js +62 -0
- package/lib/resources/payment_methods.js.map +1 -0
- package/lib/resources/payment_options.cjs +44 -0
- package/lib/resources/payment_options.cjs.map +1 -0
- package/lib/resources/payment_options.d.cts +4 -0
- package/lib/resources/payment_options.d.ts +4 -0
- package/lib/resources/payment_options.js +40 -0
- package/lib/resources/payment_options.js.map +1 -0
- package/lib/resources/paypal_gateways.cjs +48 -0
- package/lib/resources/paypal_gateways.cjs.map +1 -0
- package/lib/resources/paypal_gateways.d.cts +4 -0
- package/lib/resources/paypal_gateways.d.ts +4 -0
- package/lib/resources/paypal_gateways.js +44 -0
- package/lib/resources/paypal_gateways.js.map +1 -0
- package/lib/resources/paypal_payments.cjs +48 -0
- package/lib/resources/paypal_payments.cjs.map +1 -0
- package/lib/resources/paypal_payments.d.cts +4 -0
- package/lib/resources/paypal_payments.d.ts +4 -0
- package/lib/resources/paypal_payments.js +44 -0
- package/lib/resources/paypal_payments.js.map +1 -0
- package/lib/resources/percentage_discount_promotions.cjs +96 -0
- package/lib/resources/percentage_discount_promotions.cjs.map +1 -0
- package/lib/resources/percentage_discount_promotions.d.cts +4 -0
- package/lib/resources/percentage_discount_promotions.d.ts +4 -0
- package/lib/resources/percentage_discount_promotions.js +92 -0
- package/lib/resources/percentage_discount_promotions.js.map +1 -0
- package/lib/resources/pickups.cjs +39 -0
- package/lib/resources/pickups.cjs.map +1 -0
- package/lib/resources/pickups.d.cts +4 -0
- package/lib/resources/pickups.d.ts +4 -0
- package/lib/resources/pickups.js +35 -0
- package/lib/resources/pickups.js.map +1 -0
- package/lib/resources/price_frequency_tiers.cjs +52 -0
- package/lib/resources/price_frequency_tiers.cjs.map +1 -0
- package/lib/resources/price_frequency_tiers.d.cts +4 -0
- package/lib/resources/price_frequency_tiers.d.ts +4 -0
- package/lib/resources/price_frequency_tiers.js +48 -0
- package/lib/resources/price_frequency_tiers.js.map +1 -0
- package/lib/resources/price_list_schedulers.cjs +58 -0
- package/lib/resources/price_list_schedulers.cjs.map +1 -0
- package/lib/resources/price_list_schedulers.d.cts +4 -0
- package/lib/resources/price_list_schedulers.d.ts +4 -0
- package/lib/resources/price_list_schedulers.js +54 -0
- package/lib/resources/price_list_schedulers.js.map +1 -0
- package/lib/resources/price_lists.cjs +52 -0
- package/lib/resources/price_lists.cjs.map +1 -0
- package/lib/resources/price_lists.d.cts +4 -0
- package/lib/resources/price_lists.d.ts +4 -0
- package/lib/resources/price_lists.js +48 -0
- package/lib/resources/price_lists.js.map +1 -0
- package/lib/resources/price_tiers.cjs +39 -0
- package/lib/resources/price_tiers.cjs.map +1 -0
- package/lib/resources/price_tiers.d.cts +4 -0
- package/lib/resources/price_tiers.d.ts +4 -0
- package/lib/resources/price_tiers.js +35 -0
- package/lib/resources/price_tiers.js.map +1 -0
- package/lib/resources/price_volume_tiers.cjs +52 -0
- package/lib/resources/price_volume_tiers.cjs.map +1 -0
- package/lib/resources/price_volume_tiers.d.cts +4 -0
- package/lib/resources/price_volume_tiers.d.ts +4 -0
- package/lib/resources/price_volume_tiers.js +48 -0
- package/lib/resources/price_volume_tiers.js.map +1 -0
- package/lib/resources/prices.cjs +76 -0
- package/lib/resources/prices.cjs.map +1 -0
- package/lib/resources/prices.d.cts +4 -0
- package/lib/resources/prices.d.ts +4 -0
- package/lib/resources/prices.js +72 -0
- package/lib/resources/prices.js.map +1 -0
- package/lib/resources/promotion_rules.cjs +31 -0
- package/lib/resources/promotion_rules.cjs.map +1 -0
- package/lib/resources/promotion_rules.d.cts +4 -0
- package/lib/resources/promotion_rules.d.ts +4 -0
- package/lib/resources/promotion_rules.js +27 -0
- package/lib/resources/promotion_rules.js.map +1 -0
- package/lib/resources/promotions.cjs +71 -0
- package/lib/resources/promotions.cjs.map +1 -0
- package/lib/resources/promotions.d.cts +4 -0
- package/lib/resources/promotions.d.ts +4 -0
- package/lib/resources/promotions.js +67 -0
- package/lib/resources/promotions.js.map +1 -0
- package/lib/resources/recurring_order_copies.cjs +52 -0
- package/lib/resources/recurring_order_copies.cjs.map +1 -0
- package/lib/resources/recurring_order_copies.d.cts +4 -0
- package/lib/resources/recurring_order_copies.d.ts +4 -0
- package/lib/resources/recurring_order_copies.js +48 -0
- package/lib/resources/recurring_order_copies.js.map +1 -0
- package/lib/resources/refunds.cjs +57 -0
- package/lib/resources/refunds.cjs.map +1 -0
- package/lib/resources/refunds.d.cts +4 -0
- package/lib/resources/refunds.d.ts +4 -0
- package/lib/resources/refunds.js +53 -0
- package/lib/resources/refunds.js.map +1 -0
- package/lib/resources/reserved_stocks.cjs +43 -0
- package/lib/resources/reserved_stocks.cjs.map +1 -0
- package/lib/resources/reserved_stocks.d.cts +4 -0
- package/lib/resources/reserved_stocks.d.ts +4 -0
- package/lib/resources/reserved_stocks.js +39 -0
- package/lib/resources/reserved_stocks.js.map +1 -0
- package/lib/resources/resource_errors.cjs +27 -0
- package/lib/resources/resource_errors.cjs.map +1 -0
- package/lib/resources/resource_errors.d.cts +4 -0
- package/lib/resources/resource_errors.d.ts +4 -0
- package/lib/resources/resource_errors.js +23 -0
- package/lib/resources/resource_errors.js.map +1 -0
- package/lib/resources/return_line_items.cjs +47 -0
- package/lib/resources/return_line_items.cjs.map +1 -0
- package/lib/resources/return_line_items.d.cts +4 -0
- package/lib/resources/return_line_items.d.ts +4 -0
- package/lib/resources/return_line_items.js +43 -0
- package/lib/resources/return_line_items.js.map +1 -0
- package/lib/resources/returns.cjs +127 -0
- package/lib/resources/returns.cjs.map +1 -0
- package/lib/resources/returns.d.cts +4 -0
- package/lib/resources/returns.d.ts +4 -0
- package/lib/resources/returns.js +123 -0
- package/lib/resources/returns.js.map +1 -0
- package/lib/resources/satispay_gateways.cjs +48 -0
- package/lib/resources/satispay_gateways.cjs.map +1 -0
- package/lib/resources/satispay_gateways.d.cts +4 -0
- package/lib/resources/satispay_gateways.d.ts +4 -0
- package/lib/resources/satispay_gateways.js +44 -0
- package/lib/resources/satispay_gateways.js.map +1 -0
- package/lib/resources/satispay_payments.cjs +51 -0
- package/lib/resources/satispay_payments.cjs.map +1 -0
- package/lib/resources/satispay_payments.d.cts +4 -0
- package/lib/resources/satispay_payments.d.ts +4 -0
- package/lib/resources/satispay_payments.js +47 -0
- package/lib/resources/satispay_payments.js.map +1 -0
- package/lib/resources/shipments.cjs +157 -0
- package/lib/resources/shipments.cjs.map +1 -0
- package/lib/resources/shipments.d.cts +4 -0
- package/lib/resources/shipments.d.ts +4 -0
- package/lib/resources/shipments.js +153 -0
- package/lib/resources/shipments.js.map +1 -0
- package/lib/resources/shipping_categories.cjs +48 -0
- package/lib/resources/shipping_categories.cjs.map +1 -0
- package/lib/resources/shipping_categories.d.cts +4 -0
- package/lib/resources/shipping_categories.d.ts +4 -0
- package/lib/resources/shipping_categories.js +44 -0
- package/lib/resources/shipping_categories.js.map +1 -0
- package/lib/resources/shipping_method_tiers.cjs +39 -0
- package/lib/resources/shipping_method_tiers.cjs.map +1 -0
- package/lib/resources/shipping_method_tiers.d.cts +4 -0
- package/lib/resources/shipping_method_tiers.d.ts +4 -0
- package/lib/resources/shipping_method_tiers.js +35 -0
- package/lib/resources/shipping_method_tiers.js.map +1 -0
- package/lib/resources/shipping_methods.cjs +85 -0
- package/lib/resources/shipping_methods.cjs.map +1 -0
- package/lib/resources/shipping_methods.d.cts +4 -0
- package/lib/resources/shipping_methods.d.ts +4 -0
- package/lib/resources/shipping_methods.js +81 -0
- package/lib/resources/shipping_methods.js.map +1 -0
- package/lib/resources/shipping_weight_tiers.cjs +48 -0
- package/lib/resources/shipping_weight_tiers.cjs.map +1 -0
- package/lib/resources/shipping_weight_tiers.d.cts +4 -0
- package/lib/resources/shipping_weight_tiers.d.ts +4 -0
- package/lib/resources/shipping_weight_tiers.js +44 -0
- package/lib/resources/shipping_weight_tiers.js.map +1 -0
- package/lib/resources/shipping_zones.cjs +44 -0
- package/lib/resources/shipping_zones.cjs.map +1 -0
- package/lib/resources/shipping_zones.d.cts +4 -0
- package/lib/resources/shipping_zones.d.ts +4 -0
- package/lib/resources/shipping_zones.js +40 -0
- package/lib/resources/shipping_zones.js.map +1 -0
- package/lib/resources/sku_list_items.cjs +48 -0
- package/lib/resources/sku_list_items.cjs.map +1 -0
- package/lib/resources/sku_list_items.d.cts +4 -0
- package/lib/resources/sku_list_items.d.ts +4 -0
- package/lib/resources/sku_list_items.js +44 -0
- package/lib/resources/sku_list_items.js.map +1 -0
- package/lib/resources/sku_list_promotion_rules.cjs +48 -0
- package/lib/resources/sku_list_promotion_rules.cjs.map +1 -0
- package/lib/resources/sku_list_promotion_rules.d.cts +4 -0
- package/lib/resources/sku_list_promotion_rules.d.ts +4 -0
- package/lib/resources/sku_list_promotion_rules.js +44 -0
- package/lib/resources/sku_list_promotion_rules.js.map +1 -0
- package/lib/resources/sku_lists.cjs +64 -0
- package/lib/resources/sku_lists.cjs.map +1 -0
- package/lib/resources/sku_lists.d.cts +4 -0
- package/lib/resources/sku_lists.d.ts +4 -0
- package/lib/resources/sku_lists.js +60 -0
- package/lib/resources/sku_lists.js.map +1 -0
- package/lib/resources/sku_options.cjs +62 -0
- package/lib/resources/sku_options.cjs.map +1 -0
- package/lib/resources/sku_options.d.cts +4 -0
- package/lib/resources/sku_options.d.ts +4 -0
- package/lib/resources/sku_options.js +58 -0
- package/lib/resources/sku_options.js.map +1 -0
- package/lib/resources/skus.cjs +106 -0
- package/lib/resources/skus.cjs.map +1 -0
- package/lib/resources/skus.d.cts +4 -0
- package/lib/resources/skus.d.ts +4 -0
- package/lib/resources/skus.js +102 -0
- package/lib/resources/skus.js.map +1 -0
- package/lib/resources/stock_items.cjs +63 -0
- package/lib/resources/stock_items.cjs.map +1 -0
- package/lib/resources/stock_items.d.cts +4 -0
- package/lib/resources/stock_items.d.ts +4 -0
- package/lib/resources/stock_items.js +59 -0
- package/lib/resources/stock_items.js.map +1 -0
- package/lib/resources/stock_line_items.cjs +69 -0
- package/lib/resources/stock_line_items.cjs.map +1 -0
- package/lib/resources/stock_line_items.d.cts +4 -0
- package/lib/resources/stock_line_items.d.ts +4 -0
- package/lib/resources/stock_line_items.js +65 -0
- package/lib/resources/stock_line_items.js.map +1 -0
- package/lib/resources/stock_locations.cjs +68 -0
- package/lib/resources/stock_locations.cjs.map +1 -0
- package/lib/resources/stock_locations.d.cts +4 -0
- package/lib/resources/stock_locations.d.ts +4 -0
- package/lib/resources/stock_locations.js +64 -0
- package/lib/resources/stock_locations.js.map +1 -0
- package/lib/resources/stock_reservations.cjs +67 -0
- package/lib/resources/stock_reservations.cjs.map +1 -0
- package/lib/resources/stock_reservations.d.cts +4 -0
- package/lib/resources/stock_reservations.d.ts +4 -0
- package/lib/resources/stock_reservations.js +63 -0
- package/lib/resources/stock_reservations.js.map +1 -0
- package/lib/resources/stock_transfers.cjs +90 -0
- package/lib/resources/stock_transfers.cjs.map +1 -0
- package/lib/resources/stock_transfers.d.cts +4 -0
- package/lib/resources/stock_transfers.d.ts +4 -0
- package/lib/resources/stock_transfers.js +86 -0
- package/lib/resources/stock_transfers.js.map +1 -0
- package/lib/resources/stores.cjs +64 -0
- package/lib/resources/stores.cjs.map +1 -0
- package/lib/resources/stores.d.cts +4 -0
- package/lib/resources/stores.d.ts +4 -0
- package/lib/resources/stores.js +60 -0
- package/lib/resources/stores.js.map +1 -0
- package/lib/resources/stripe_gateways.cjs +48 -0
- package/lib/resources/stripe_gateways.cjs.map +1 -0
- package/lib/resources/stripe_gateways.d.cts +4 -0
- package/lib/resources/stripe_gateways.d.ts +4 -0
- package/lib/resources/stripe_gateways.js +44 -0
- package/lib/resources/stripe_gateways.js.map +1 -0
- package/lib/resources/stripe_payments.cjs +54 -0
- package/lib/resources/stripe_payments.cjs.map +1 -0
- package/lib/resources/stripe_payments.d.cts +4 -0
- package/lib/resources/stripe_payments.d.ts +4 -0
- package/lib/resources/stripe_payments.js +50 -0
- package/lib/resources/stripe_payments.js.map +1 -0
- package/lib/resources/stripe_tax_accounts.cjs +56 -0
- package/lib/resources/stripe_tax_accounts.cjs.map +1 -0
- package/lib/resources/stripe_tax_accounts.d.cts +4 -0
- package/lib/resources/stripe_tax_accounts.d.ts +4 -0
- package/lib/resources/stripe_tax_accounts.js +52 -0
- package/lib/resources/stripe_tax_accounts.js.map +1 -0
- package/lib/resources/subscription_models.cjs +48 -0
- package/lib/resources/subscription_models.cjs.map +1 -0
- package/lib/resources/subscription_models.d.cts +4 -0
- package/lib/resources/subscription_models.d.ts +4 -0
- package/lib/resources/subscription_models.js +44 -0
- package/lib/resources/subscription_models.js.map +1 -0
- package/lib/resources/tags.cjs +36 -0
- package/lib/resources/tags.cjs.map +1 -0
- package/lib/resources/tags.d.cts +4 -0
- package/lib/resources/tags.d.ts +4 -0
- package/lib/resources/tags.js +32 -0
- package/lib/resources/tags.js.map +1 -0
- package/lib/resources/talon_one_accounts.cjs +52 -0
- package/lib/resources/talon_one_accounts.cjs.map +1 -0
- package/lib/resources/talon_one_accounts.d.cts +4 -0
- package/lib/resources/talon_one_accounts.d.ts +4 -0
- package/lib/resources/talon_one_accounts.js +48 -0
- package/lib/resources/talon_one_accounts.js.map +1 -0
- package/lib/resources/tax_calculators.cjs +43 -0
- package/lib/resources/tax_calculators.cjs.map +1 -0
- package/lib/resources/tax_calculators.d.cts +4 -0
- package/lib/resources/tax_calculators.d.ts +4 -0
- package/lib/resources/tax_calculators.js +39 -0
- package/lib/resources/tax_calculators.js.map +1 -0
- package/lib/resources/tax_categories.cjs +48 -0
- package/lib/resources/tax_categories.cjs.map +1 -0
- package/lib/resources/tax_categories.d.cts +4 -0
- package/lib/resources/tax_categories.d.ts +4 -0
- package/lib/resources/tax_categories.js +44 -0
- package/lib/resources/tax_categories.js.map +1 -0
- package/lib/resources/tax_rules.cjs +44 -0
- package/lib/resources/tax_rules.cjs.map +1 -0
- package/lib/resources/tax_rules.d.cts +4 -0
- package/lib/resources/tax_rules.d.ts +4 -0
- package/lib/resources/tax_rules.js +40 -0
- package/lib/resources/tax_rules.js.map +1 -0
- package/lib/resources/taxjar_accounts.cjs +56 -0
- package/lib/resources/taxjar_accounts.cjs.map +1 -0
- package/lib/resources/taxjar_accounts.d.cts +4 -0
- package/lib/resources/taxjar_accounts.d.ts +4 -0
- package/lib/resources/taxjar_accounts.js +52 -0
- package/lib/resources/taxjar_accounts.js.map +1 -0
- package/lib/resources/transactions.cjs +43 -0
- package/lib/resources/transactions.cjs.map +1 -0
- package/lib/resources/transactions.d.cts +4 -0
- package/lib/resources/transactions.d.ts +4 -0
- package/lib/resources/transactions.js +39 -0
- package/lib/resources/transactions.js.map +1 -0
- package/lib/resources/versions.cjs +27 -0
- package/lib/resources/versions.cjs.map +1 -0
- package/lib/resources/versions.d.cts +4 -0
- package/lib/resources/versions.d.ts +4 -0
- package/lib/resources/versions.js +23 -0
- package/lib/resources/versions.js.map +1 -0
- package/lib/resources/vertex_accounts.cjs +55 -0
- package/lib/resources/vertex_accounts.cjs.map +1 -0
- package/lib/resources/vertex_accounts.d.cts +4 -0
- package/lib/resources/vertex_accounts.d.ts +4 -0
- package/lib/resources/vertex_accounts.js +51 -0
- package/lib/resources/vertex_accounts.js.map +1 -0
- package/lib/resources/voids.cjs +53 -0
- package/lib/resources/voids.cjs.map +1 -0
- package/lib/resources/voids.d.cts +4 -0
- package/lib/resources/voids.d.ts +4 -0
- package/lib/resources/voids.js +49 -0
- package/lib/resources/voids.js.map +1 -0
- package/lib/resources/webhooks.cjs +53 -0
- package/lib/resources/webhooks.cjs.map +1 -0
- package/lib/resources/webhooks.d.cts +4 -0
- package/lib/resources/webhooks.d.ts +4 -0
- package/lib/resources/webhooks.js +49 -0
- package/lib/resources/webhooks.js.map +1 -0
- package/lib/resources/wire_transfers.cjs +44 -0
- package/lib/resources/wire_transfers.cjs.map +1 -0
- package/lib/resources/wire_transfers.d.cts +4 -0
- package/lib/resources/wire_transfers.d.ts +4 -0
- package/lib/resources/wire_transfers.js +40 -0
- package/lib/resources/wire_transfers.js.map +1 -0
- package/lib/static.cjs +49 -0
- package/lib/static.cjs.map +1 -0
- package/lib/static.d.cts +22 -0
- package/lib/static.d.ts +22 -0
- package/lib/static.js +47 -0
- package/lib/static.js.map +1 -0
- package/lib/types.cjs +4 -0
- package/lib/types.cjs.map +1 -0
- package/lib/types.d.cts +7 -0
- package/lib/types.d.ts +7 -0
- package/lib/types.js +3 -0
- package/lib/types.js.map +1 -0
- package/lib/util.cjs +39 -0
- package/lib/util.cjs.map +1 -0
- package/lib/util.d.cts +13 -0
- package/lib/util.d.ts +13 -0
- package/lib/util.js +34 -0
- package/lib/util.js.map +1 -0
- package/package.json +8 -10
@@ -0,0 +1,52 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var resource = require('../resource');
|
4
|
+
|
5
|
+
class Packages extends resource.ApiResource {
|
6
|
+
static TYPE = "packages";
|
7
|
+
async create(resource, params, options) {
|
8
|
+
return this.resources.create({ ...resource, type: Packages.TYPE }, params, options);
|
9
|
+
}
|
10
|
+
async update(resource, params, options) {
|
11
|
+
return this.resources.update({ ...resource, type: Packages.TYPE }, params, options);
|
12
|
+
}
|
13
|
+
async delete(id, options) {
|
14
|
+
await this.resources.delete(typeof id === "string" ? { id, type: Packages.TYPE } : id, options);
|
15
|
+
}
|
16
|
+
async stock_location(packageId, params, options) {
|
17
|
+
const _packageId = packageId.id || packageId;
|
18
|
+
return this.resources.fetch({ type: "stock_locations" }, `packages/${_packageId}/stock_location`, params, options);
|
19
|
+
}
|
20
|
+
async parcels(packageId, params, options) {
|
21
|
+
const _packageId = packageId.id || packageId;
|
22
|
+
return this.resources.fetch({ type: "parcels" }, `packages/${_packageId}/parcels`, params, options);
|
23
|
+
}
|
24
|
+
async attachments(packageId, params, options) {
|
25
|
+
const _packageId = packageId.id || packageId;
|
26
|
+
return this.resources.fetch({ type: "attachments" }, `packages/${_packageId}/attachments`, params, options);
|
27
|
+
}
|
28
|
+
async versions(packageId, params, options) {
|
29
|
+
const _packageId = packageId.id || packageId;
|
30
|
+
return this.resources.fetch({ type: "versions" }, `packages/${_packageId}/versions`, params, options);
|
31
|
+
}
|
32
|
+
isPackage(resource) {
|
33
|
+
return resource.type && resource.type === Packages.TYPE;
|
34
|
+
}
|
35
|
+
relationship(id) {
|
36
|
+
return super.relationshipOneToOne(id);
|
37
|
+
}
|
38
|
+
relationshipToMany(...ids) {
|
39
|
+
return super.relationshipOneToMany(...ids);
|
40
|
+
}
|
41
|
+
type() {
|
42
|
+
return Packages.TYPE;
|
43
|
+
}
|
44
|
+
}
|
45
|
+
const instance = new Packages();
|
46
|
+
var packages_default = instance;
|
47
|
+
|
48
|
+
module.exports = packages_default;
|
49
|
+
//# sourceMappingURL=packages.cjs.map
|
50
|
+
|
51
|
+
module.exports = exports.default;
|
52
|
+
//# sourceMappingURL=packages.cjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../src/resources/packages.ts"],"names":["ApiResource"],"mappings":";;;;AA0IA,MAAM,iBAAiBA,oBAAqB,CAAA;AAAA,EAE3C,OAAgB,IAAoB,GAAA,UAAA;AAAA,EAEpC,MAAM,MAAA,CAAO,QAAyB,EAAA,MAAA,EAAuC,OAA6C,EAAA;AACzH,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA+B,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,QAAS,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC3G,EAEA,MAAM,MAAA,CAAO,QAAyB,EAAA,MAAA,EAAuC,OAA6C,EAAA;AACzH,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA+B,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,QAAS,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC3G,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,EAA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AO,CAAA;AAAA;AAC9G,EAGA,UAAU,QAAoC,EAAA;AAC7C,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,QAAS,CAAA,IAAA;AAAA;AACrD,EAGA,aAAa,EAA4C,EAAA;AACxD,IAAO,OAAA,KAAA,CAAM,qBAAiC,EAAE,CAAA;AAAA;AACjD,EAEA,sBAAsB,GAA6B,EAAA;AAClD,IAAO,OAAA,KAAA,CAAM,qBAAkC,CAAA,GAAG,GAAG,CAAA;AAAA;AACtD,EAGA,IAAoB,GAAA;AACnB,IAAA,OAAO,QAAS,CAAA,IAAA;AAAA;AAGlB;AAGA,MAAM,QAAA,GAAW,IAAI,QAAS,EAAA;AAC9B,IAAO,gBAAQ,GAAA","file":"packages.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 { StockLocation, StockLocationType } from './stock_locations'\nimport type { Parcel } from './parcels'\nimport type { Attachment } from './attachments'\nimport type { Version } from './versions'\n\n\ntype PackageType = 'packages'\ntype PackageRel = ResourceRel & { type: PackageType }\ntype StockLocationRel = ResourceRel & { type: StockLocationType }\n\n\nexport type PackageSort = Pick<Package, 'id' | 'name' | 'code' | 'length' | 'width' | 'height' | 'unit_of_length'> & ResourceSort\n// export type PackageFilter = Pick<Package, 'id' | 'name' | 'code' | 'length' | 'width' | 'height' | 'unit_of_length'> & ResourceFilter\n\n\ninterface Package extends Resource {\n\t\n\treadonly type: PackageType\n\n\t/** \n\t * Unique name for the package.\n\t * @example ```\"Large (60x40x30)\"```\n\t */\n\tname: string\n\t/** \n\t * The package identifying code.\n\t * @example ```\"YYYY 2000\"```\n\t */\n\tcode?: string | null\n\t/** \n\t * The package length, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```40```\n\t */\n\tlength: number\n\t/** \n\t * The package width, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```40```\n\t */\n\twidth: number\n\t/** \n\t * The package height, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```25```\n\t */\n\theight: number\n\t/** \n\t * The unit of length. Can be one of 'cm', or 'in'.\n\t * @example ```\"gr\"```\n\t */\n\tunit_of_length: string\n\n\tstock_location?: StockLocation | null\n\tparcels?: Parcel[] | null\n\tattachments?: Attachment[] | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface PackageCreate extends ResourceCreate {\n\t\n\t/** \n\t * Unique name for the package.\n\t * @example ```\"Large (60x40x30)\"```\n\t */\n\tname: string\n\t/** \n\t * The package identifying code.\n\t * @example ```\"YYYY 2000\"```\n\t */\n\tcode?: string | null\n\t/** \n\t * The package length, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```40```\n\t */\n\tlength: number\n\t/** \n\t * The package width, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```40```\n\t */\n\twidth: number\n\t/** \n\t * The package height, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```25```\n\t */\n\theight: number\n\t/** \n\t * The unit of length. Can be one of 'cm', or 'in'.\n\t * @example ```\"gr\"```\n\t */\n\tunit_of_length: string\n\n\tstock_location: StockLocationRel\n\n}\n\n\ninterface PackageUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * Unique name for the package.\n\t * @example ```\"Large (60x40x30)\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The package identifying code.\n\t * @example ```\"YYYY 2000\"```\n\t */\n\tcode?: string | null\n\t/** \n\t * The package length, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```40```\n\t */\n\tlength?: number | null\n\t/** \n\t * The package width, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```40```\n\t */\n\twidth?: number | null\n\t/** \n\t * The package height, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```25```\n\t */\n\theight?: number | null\n\t/** \n\t * The unit of length. Can be one of 'cm', or 'in'.\n\t * @example ```\"gr\"```\n\t */\n\tunit_of_length?: string | null\n\n\tstock_location?: StockLocationRel | null\n\n}\n\n\nclass Packages extends ApiResource<Package> {\n\n\tstatic readonly TYPE: PackageType = 'packages' as const\n\n\tasync create(resource: PackageCreate, params?: QueryParamsRetrieve<Package>, options?: ResourcesConfig): Promise<Package> {\n\t\treturn this.resources.create<PackageCreate, Package>({ ...resource, type: Packages.TYPE }, params, options)\n\t}\n\n\tasync update(resource: PackageUpdate, params?: QueryParamsRetrieve<Package>, options?: ResourcesConfig): Promise<Package> {\n\t\treturn this.resources.update<PackageUpdate, Package>({ ...resource, type: Packages.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: Packages.TYPE } : id, options)\n\t}\n\n\tasync stock_location(packageId: string | Package, params?: QueryParamsRetrieve<StockLocation>, options?: ResourcesConfig): Promise<StockLocation> {\n\t\tconst _packageId = (packageId as Package).id || packageId as string\n\t\treturn this.resources.fetch<StockLocation>({ type: 'stock_locations' }, `packages/${_packageId}/stock_location`, params, options) as unknown as StockLocation\n\t}\n\n\tasync parcels(packageId: string | Package, params?: QueryParamsList<Parcel>, options?: ResourcesConfig): Promise<ListResponse<Parcel>> {\n\t\tconst _packageId = (packageId as Package).id || packageId as string\n\t\treturn this.resources.fetch<Parcel>({ type: 'parcels' }, `packages/${_packageId}/parcels`, params, options) as unknown as ListResponse<Parcel>\n\t}\n\n\tasync attachments(packageId: string | Package, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _packageId = (packageId as Package).id || packageId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `packages/${_packageId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync versions(packageId: string | Package, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _packageId = (packageId as Package).id || packageId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `packages/${_packageId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\n\tisPackage(resource: any): resource is Package {\n\t\treturn resource.type && (resource.type === Packages.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): PackageRel {\n\t\treturn super.relationshipOneToOne<PackageRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): PackageRel[] {\n\t\treturn super.relationshipOneToMany<PackageRel>(...ids)\n\t}\n\n\n\ttype(): PackageType {\n\t\treturn Packages.TYPE\n\t}\n\n}\n\n\nconst instance = new Packages()\nexport default instance\n\nexport type { Package, PackageCreate, PackageUpdate, PackageType }\n"]}
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
|
3
|
+
class Packages extends ApiResource {
|
4
|
+
static TYPE = "packages";
|
5
|
+
async create(resource, params, options) {
|
6
|
+
return this.resources.create({ ...resource, type: Packages.TYPE }, params, options);
|
7
|
+
}
|
8
|
+
async update(resource, params, options) {
|
9
|
+
return this.resources.update({ ...resource, type: Packages.TYPE }, params, options);
|
10
|
+
}
|
11
|
+
async delete(id, options) {
|
12
|
+
await this.resources.delete(typeof id === "string" ? { id, type: Packages.TYPE } : id, options);
|
13
|
+
}
|
14
|
+
async stock_location(packageId, params, options) {
|
15
|
+
const _packageId = packageId.id || packageId;
|
16
|
+
return this.resources.fetch({ type: "stock_locations" }, `packages/${_packageId}/stock_location`, params, options);
|
17
|
+
}
|
18
|
+
async parcels(packageId, params, options) {
|
19
|
+
const _packageId = packageId.id || packageId;
|
20
|
+
return this.resources.fetch({ type: "parcels" }, `packages/${_packageId}/parcels`, params, options);
|
21
|
+
}
|
22
|
+
async attachments(packageId, params, options) {
|
23
|
+
const _packageId = packageId.id || packageId;
|
24
|
+
return this.resources.fetch({ type: "attachments" }, `packages/${_packageId}/attachments`, params, options);
|
25
|
+
}
|
26
|
+
async versions(packageId, params, options) {
|
27
|
+
const _packageId = packageId.id || packageId;
|
28
|
+
return this.resources.fetch({ type: "versions" }, `packages/${_packageId}/versions`, params, options);
|
29
|
+
}
|
30
|
+
isPackage(resource) {
|
31
|
+
return resource.type && resource.type === Packages.TYPE;
|
32
|
+
}
|
33
|
+
relationship(id) {
|
34
|
+
return super.relationshipOneToOne(id);
|
35
|
+
}
|
36
|
+
relationshipToMany(...ids) {
|
37
|
+
return super.relationshipOneToMany(...ids);
|
38
|
+
}
|
39
|
+
type() {
|
40
|
+
return Packages.TYPE;
|
41
|
+
}
|
42
|
+
}
|
43
|
+
const instance = new Packages();
|
44
|
+
var packages_default = instance;
|
45
|
+
|
46
|
+
export { packages_default as default };
|
47
|
+
//# sourceMappingURL=packages.js.map
|
48
|
+
//# sourceMappingURL=packages.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../src/resources/packages.ts"],"names":[],"mappings":";;AA0IA,MAAM,iBAAiB,WAAqB,CAAA;AAAA,EAE3C,OAAgB,IAAoB,GAAA,UAAA;AAAA,EAEpC,MAAM,MAAA,CAAO,QAAyB,EAAA,MAAA,EAAuC,OAA6C,EAAA;AACzH,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA+B,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,QAAS,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC3G,EAEA,MAAM,MAAA,CAAO,QAAyB,EAAA,MAAA,EAAuC,OAA6C,EAAA;AACzH,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA+B,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,QAAS,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC3G,EAEA,MAAM,MAAO,CAAA,EAAA,EAAyB,OAA0C,EAAA;AAC/E,IAAA,MAAM,IAAK,CAAA,SAAA,CAAU,MAAQ,CAAA,OAAO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,EAAA,UAAU,CAAa,SAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC9G,EAGA,UAAU,QAAoC,EAAA;AAC7C,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,QAAS,CAAA,IAAA;AAAA;AACrD,EAGA,aAAa,EAA4C,EAAA;AACxD,IAAO,OAAA,KAAA,CAAM,qBAAiC,EAAE,CAAA;AAAA;AACjD,EAEA,sBAAsB,GAA6B,EAAA;AAClD,IAAO,OAAA,KAAA,CAAM,qBAAkC,CAAA,GAAG,GAAG,CAAA;AAAA;AACtD,EAGA,IAAoB,GAAA;AACnB,IAAA,OAAO,QAAS,CAAA,IAAA;AAAA;AAGlB;AAGA,MAAM,QAAA,GAAW,IAAI,QAAS,EAAA;AAC9B,IAAO,gBAAQ,GAAA","file":"packages.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 { StockLocation, StockLocationType } from './stock_locations'\nimport type { Parcel } from './parcels'\nimport type { Attachment } from './attachments'\nimport type { Version } from './versions'\n\n\ntype PackageType = 'packages'\ntype PackageRel = ResourceRel & { type: PackageType }\ntype StockLocationRel = ResourceRel & { type: StockLocationType }\n\n\nexport type PackageSort = Pick<Package, 'id' | 'name' | 'code' | 'length' | 'width' | 'height' | 'unit_of_length'> & ResourceSort\n// export type PackageFilter = Pick<Package, 'id' | 'name' | 'code' | 'length' | 'width' | 'height' | 'unit_of_length'> & ResourceFilter\n\n\ninterface Package extends Resource {\n\t\n\treadonly type: PackageType\n\n\t/** \n\t * Unique name for the package.\n\t * @example ```\"Large (60x40x30)\"```\n\t */\n\tname: string\n\t/** \n\t * The package identifying code.\n\t * @example ```\"YYYY 2000\"```\n\t */\n\tcode?: string | null\n\t/** \n\t * The package length, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```40```\n\t */\n\tlength: number\n\t/** \n\t * The package width, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```40```\n\t */\n\twidth: number\n\t/** \n\t * The package height, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```25```\n\t */\n\theight: number\n\t/** \n\t * The unit of length. Can be one of 'cm', or 'in'.\n\t * @example ```\"gr\"```\n\t */\n\tunit_of_length: string\n\n\tstock_location?: StockLocation | null\n\tparcels?: Parcel[] | null\n\tattachments?: Attachment[] | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface PackageCreate extends ResourceCreate {\n\t\n\t/** \n\t * Unique name for the package.\n\t * @example ```\"Large (60x40x30)\"```\n\t */\n\tname: string\n\t/** \n\t * The package identifying code.\n\t * @example ```\"YYYY 2000\"```\n\t */\n\tcode?: string | null\n\t/** \n\t * The package length, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```40```\n\t */\n\tlength: number\n\t/** \n\t * The package width, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```40```\n\t */\n\twidth: number\n\t/** \n\t * The package height, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```25```\n\t */\n\theight: number\n\t/** \n\t * The unit of length. Can be one of 'cm', or 'in'.\n\t * @example ```\"gr\"```\n\t */\n\tunit_of_length: string\n\n\tstock_location: StockLocationRel\n\n}\n\n\ninterface PackageUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * Unique name for the package.\n\t * @example ```\"Large (60x40x30)\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The package identifying code.\n\t * @example ```\"YYYY 2000\"```\n\t */\n\tcode?: string | null\n\t/** \n\t * The package length, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```40```\n\t */\n\tlength?: number | null\n\t/** \n\t * The package width, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```40```\n\t */\n\twidth?: number | null\n\t/** \n\t * The package height, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```25```\n\t */\n\theight?: number | null\n\t/** \n\t * The unit of length. Can be one of 'cm', or 'in'.\n\t * @example ```\"gr\"```\n\t */\n\tunit_of_length?: string | null\n\n\tstock_location?: StockLocationRel | null\n\n}\n\n\nclass Packages extends ApiResource<Package> {\n\n\tstatic readonly TYPE: PackageType = 'packages' as const\n\n\tasync create(resource: PackageCreate, params?: QueryParamsRetrieve<Package>, options?: ResourcesConfig): Promise<Package> {\n\t\treturn this.resources.create<PackageCreate, Package>({ ...resource, type: Packages.TYPE }, params, options)\n\t}\n\n\tasync update(resource: PackageUpdate, params?: QueryParamsRetrieve<Package>, options?: ResourcesConfig): Promise<Package> {\n\t\treturn this.resources.update<PackageUpdate, Package>({ ...resource, type: Packages.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: Packages.TYPE } : id, options)\n\t}\n\n\tasync stock_location(packageId: string | Package, params?: QueryParamsRetrieve<StockLocation>, options?: ResourcesConfig): Promise<StockLocation> {\n\t\tconst _packageId = (packageId as Package).id || packageId as string\n\t\treturn this.resources.fetch<StockLocation>({ type: 'stock_locations' }, `packages/${_packageId}/stock_location`, params, options) as unknown as StockLocation\n\t}\n\n\tasync parcels(packageId: string | Package, params?: QueryParamsList<Parcel>, options?: ResourcesConfig): Promise<ListResponse<Parcel>> {\n\t\tconst _packageId = (packageId as Package).id || packageId as string\n\t\treturn this.resources.fetch<Parcel>({ type: 'parcels' }, `packages/${_packageId}/parcels`, params, options) as unknown as ListResponse<Parcel>\n\t}\n\n\tasync attachments(packageId: string | Package, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _packageId = (packageId as Package).id || packageId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `packages/${_packageId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync versions(packageId: string | Package, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _packageId = (packageId as Package).id || packageId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `packages/${_packageId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\n\tisPackage(resource: any): resource is Package {\n\t\treturn resource.type && (resource.type === Packages.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): PackageRel {\n\t\treturn super.relationshipOneToOne<PackageRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): PackageRel[] {\n\t\treturn super.relationshipOneToMany<PackageRel>(...ids)\n\t}\n\n\n\ttype(): PackageType {\n\t\treturn Packages.TYPE\n\t}\n\n}\n\n\nconst instance = new Packages()\nexport default instance\n\nexport type { Package, PackageCreate, PackageUpdate, PackageType }\n"]}
|
@@ -0,0 +1,48 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var resource = require('../resource');
|
4
|
+
|
5
|
+
class ParcelLineItems extends resource.ApiResource {
|
6
|
+
static TYPE = "parcel_line_items";
|
7
|
+
async create(resource, params, options) {
|
8
|
+
return this.resources.create({ ...resource, type: ParcelLineItems.TYPE }, params, options);
|
9
|
+
}
|
10
|
+
async update(resource, params, options) {
|
11
|
+
return this.resources.update({ ...resource, type: ParcelLineItems.TYPE }, params, options);
|
12
|
+
}
|
13
|
+
async delete(id, options) {
|
14
|
+
await this.resources.delete(typeof id === "string" ? { id, type: ParcelLineItems.TYPE } : id, options);
|
15
|
+
}
|
16
|
+
async parcel(parcelLineItemId, params, options) {
|
17
|
+
const _parcelLineItemId = parcelLineItemId.id || parcelLineItemId;
|
18
|
+
return this.resources.fetch({ type: "parcels" }, `parcel_line_items/${_parcelLineItemId}/parcel`, params, options);
|
19
|
+
}
|
20
|
+
async stock_line_item(parcelLineItemId, params, options) {
|
21
|
+
const _parcelLineItemId = parcelLineItemId.id || parcelLineItemId;
|
22
|
+
return this.resources.fetch({ type: "stock_line_items" }, `parcel_line_items/${_parcelLineItemId}/stock_line_item`, params, options);
|
23
|
+
}
|
24
|
+
async versions(parcelLineItemId, params, options) {
|
25
|
+
const _parcelLineItemId = parcelLineItemId.id || parcelLineItemId;
|
26
|
+
return this.resources.fetch({ type: "versions" }, `parcel_line_items/${_parcelLineItemId}/versions`, params, options);
|
27
|
+
}
|
28
|
+
isParcelLineItem(resource) {
|
29
|
+
return resource.type && resource.type === ParcelLineItems.TYPE;
|
30
|
+
}
|
31
|
+
relationship(id) {
|
32
|
+
return super.relationshipOneToOne(id);
|
33
|
+
}
|
34
|
+
relationshipToMany(...ids) {
|
35
|
+
return super.relationshipOneToMany(...ids);
|
36
|
+
}
|
37
|
+
type() {
|
38
|
+
return ParcelLineItems.TYPE;
|
39
|
+
}
|
40
|
+
}
|
41
|
+
const instance = new ParcelLineItems();
|
42
|
+
var parcel_line_items_default = instance;
|
43
|
+
|
44
|
+
module.exports = parcel_line_items_default;
|
45
|
+
//# sourceMappingURL=parcel_line_items.cjs.map
|
46
|
+
|
47
|
+
module.exports = exports.default;
|
48
|
+
//# sourceMappingURL=parcel_line_items.cjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../src/resources/parcel_line_items.ts"],"names":["ApiResource"],"mappings":";;;;AAyEA,MAAM,wBAAwBA,oBAA4B,CAAA;AAAA,EAEzD,OAAgB,IAA2B,GAAA,mBAAA;AAAA,EAE3C,MAAM,MAAA,CAAO,QAAgC,EAAA,MAAA,EAA8C,OAAoD,EAAA;AAC9I,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA6C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,eAAgB,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAChI,EAEA,MAAM,MAAA,CAAO,QAAgC,EAAA,MAAA,EAA8C,OAAoD,EAAA;AAC9I,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA6C,EAAE,GAAG,QAAU,E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AAA;AAC9H,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":"parcel_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 { Parcel, ParcelType } from './parcels'\nimport type { StockLineItem, StockLineItemType } from './stock_line_items'\nimport type { Version } from './versions'\n\n\ntype ParcelLineItemType = 'parcel_line_items'\ntype ParcelLineItemRel = ResourceRel & { type: ParcelLineItemType }\ntype ParcelRel = ResourceRel & { type: ParcelType }\ntype StockLineItemRel = ResourceRel & { type: StockLineItemType }\n\n\nexport type ParcelLineItemSort = Pick<ParcelLineItem, 'id' | 'quantity'> & ResourceSort\n// export type ParcelLineItemFilter = Pick<ParcelLineItem, 'id' | 'quantity'> & ResourceFilter\n\n\ninterface ParcelLineItem extends Resource {\n\t\n\treadonly type: ParcelLineItemType\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 parcel line item quantity.\n\t * @example ```4```\n\t */\n\tquantity: number\n\t/** \n\t * The internal name of the associated line item.\n\t * @example ```\"Men's Black T-shirt with White Logo (XL)\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The image_url of the associated line item.\n\t * @example ```\"https://img.yourdomain.com/skus/xYZkjABcde.png\"```\n\t */\n\timage_url?: string | null\n\n\tparcel?: Parcel | null\n\tstock_line_item?: StockLineItem | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface ParcelLineItemCreate extends ResourceCreate {\n\t\n\t/** \n\t * The parcel line item quantity.\n\t * @example ```4```\n\t */\n\tquantity: number\n\n\tparcel: ParcelRel\n\tstock_line_item: StockLineItemRel\n\n}\n\n\ntype ParcelLineItemUpdate = ResourceUpdate\n\n\nclass ParcelLineItems extends ApiResource<ParcelLineItem> {\n\n\tstatic readonly TYPE: ParcelLineItemType = 'parcel_line_items' as const\n\n\tasync create(resource: ParcelLineItemCreate, params?: QueryParamsRetrieve<ParcelLineItem>, options?: ResourcesConfig): Promise<ParcelLineItem> {\n\t\treturn this.resources.create<ParcelLineItemCreate, ParcelLineItem>({ ...resource, type: ParcelLineItems.TYPE }, params, options)\n\t}\n\n\tasync update(resource: ParcelLineItemUpdate, params?: QueryParamsRetrieve<ParcelLineItem>, options?: ResourcesConfig): Promise<ParcelLineItem> {\n\t\treturn this.resources.update<ParcelLineItemUpdate, ParcelLineItem>({ ...resource, type: ParcelLineItems.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: ParcelLineItems.TYPE } : id, options)\n\t}\n\n\tasync parcel(parcelLineItemId: string | ParcelLineItem, params?: QueryParamsRetrieve<Parcel>, options?: ResourcesConfig): Promise<Parcel> {\n\t\tconst _parcelLineItemId = (parcelLineItemId as ParcelLineItem).id || parcelLineItemId as string\n\t\treturn this.resources.fetch<Parcel>({ type: 'parcels' }, `parcel_line_items/${_parcelLineItemId}/parcel`, params, options) as unknown as Parcel\n\t}\n\n\tasync stock_line_item(parcelLineItemId: string | ParcelLineItem, params?: QueryParamsRetrieve<StockLineItem>, options?: ResourcesConfig): Promise<StockLineItem> {\n\t\tconst _parcelLineItemId = (parcelLineItemId as ParcelLineItem).id || parcelLineItemId as string\n\t\treturn this.resources.fetch<StockLineItem>({ type: 'stock_line_items' }, `parcel_line_items/${_parcelLineItemId}/stock_line_item`, params, options) as unknown as StockLineItem\n\t}\n\n\tasync versions(parcelLineItemId: string | ParcelLineItem, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _parcelLineItemId = (parcelLineItemId as ParcelLineItem).id || parcelLineItemId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `parcel_line_items/${_parcelLineItemId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\n\tisParcelLineItem(resource: any): resource is ParcelLineItem {\n\t\treturn resource.type && (resource.type === ParcelLineItems.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): ParcelLineItemRel {\n\t\treturn super.relationshipOneToOne<ParcelLineItemRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): ParcelLineItemRel[] {\n\t\treturn super.relationshipOneToMany<ParcelLineItemRel>(...ids)\n\t}\n\n\n\ttype(): ParcelLineItemType {\n\t\treturn ParcelLineItems.TYPE\n\t}\n\n}\n\n\nconst instance = new ParcelLineItems()\nexport default instance\n\nexport type { ParcelLineItem, ParcelLineItemCreate, ParcelLineItemUpdate, ParcelLineItemType }\n"]}
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
|
3
|
+
class ParcelLineItems extends ApiResource {
|
4
|
+
static TYPE = "parcel_line_items";
|
5
|
+
async create(resource, params, options) {
|
6
|
+
return this.resources.create({ ...resource, type: ParcelLineItems.TYPE }, params, options);
|
7
|
+
}
|
8
|
+
async update(resource, params, options) {
|
9
|
+
return this.resources.update({ ...resource, type: ParcelLineItems.TYPE }, params, options);
|
10
|
+
}
|
11
|
+
async delete(id, options) {
|
12
|
+
await this.resources.delete(typeof id === "string" ? { id, type: ParcelLineItems.TYPE } : id, options);
|
13
|
+
}
|
14
|
+
async parcel(parcelLineItemId, params, options) {
|
15
|
+
const _parcelLineItemId = parcelLineItemId.id || parcelLineItemId;
|
16
|
+
return this.resources.fetch({ type: "parcels" }, `parcel_line_items/${_parcelLineItemId}/parcel`, params, options);
|
17
|
+
}
|
18
|
+
async stock_line_item(parcelLineItemId, params, options) {
|
19
|
+
const _parcelLineItemId = parcelLineItemId.id || parcelLineItemId;
|
20
|
+
return this.resources.fetch({ type: "stock_line_items" }, `parcel_line_items/${_parcelLineItemId}/stock_line_item`, params, options);
|
21
|
+
}
|
22
|
+
async versions(parcelLineItemId, params, options) {
|
23
|
+
const _parcelLineItemId = parcelLineItemId.id || parcelLineItemId;
|
24
|
+
return this.resources.fetch({ type: "versions" }, `parcel_line_items/${_parcelLineItemId}/versions`, params, options);
|
25
|
+
}
|
26
|
+
isParcelLineItem(resource) {
|
27
|
+
return resource.type && resource.type === ParcelLineItems.TYPE;
|
28
|
+
}
|
29
|
+
relationship(id) {
|
30
|
+
return super.relationshipOneToOne(id);
|
31
|
+
}
|
32
|
+
relationshipToMany(...ids) {
|
33
|
+
return super.relationshipOneToMany(...ids);
|
34
|
+
}
|
35
|
+
type() {
|
36
|
+
return ParcelLineItems.TYPE;
|
37
|
+
}
|
38
|
+
}
|
39
|
+
const instance = new ParcelLineItems();
|
40
|
+
var parcel_line_items_default = instance;
|
41
|
+
|
42
|
+
export { parcel_line_items_default as default };
|
43
|
+
//# sourceMappingURL=parcel_line_items.js.map
|
44
|
+
//# sourceMappingURL=parcel_line_items.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../src/resources/parcel_line_items.ts"],"names":[],"mappings":";;AAyEA,MAAM,wBAAwB,WAA4B,CAAA;AAAA,EAEzD,OAAg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EAAG,CAAqB,kBAAA,EAAA,iBAAiB,CAAoB,gBAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACnJ,EAEA,MAAM,QAAA,CAAS,gBAA2C,EAAA,MAAA,EAAmC,OAA2D,EAAA;AACvJ,IAAM,MAAA,iBAAA,GAAqB,iBAAoC,EAAM,IAAA,gBAAA;AACrE,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAe,EAAE,IAAA,EAAM,UAAW,EAAA,EAAG,CAAqB,kBAAA,EAAA,iBAAiB,CAAa,SAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC9H,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":"parcel_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 { Parcel, ParcelType } from './parcels'\nimport type { StockLineItem, StockLineItemType } from './stock_line_items'\nimport type { Version } from './versions'\n\n\ntype ParcelLineItemType = 'parcel_line_items'\ntype ParcelLineItemRel = ResourceRel & { type: ParcelLineItemType }\ntype ParcelRel = ResourceRel & { type: ParcelType }\ntype StockLineItemRel = ResourceRel & { type: StockLineItemType }\n\n\nexport type ParcelLineItemSort = Pick<ParcelLineItem, 'id' | 'quantity'> & ResourceSort\n// export type ParcelLineItemFilter = Pick<ParcelLineItem, 'id' | 'quantity'> & ResourceFilter\n\n\ninterface ParcelLineItem extends Resource {\n\t\n\treadonly type: ParcelLineItemType\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 parcel line item quantity.\n\t * @example ```4```\n\t */\n\tquantity: number\n\t/** \n\t * The internal name of the associated line item.\n\t * @example ```\"Men's Black T-shirt with White Logo (XL)\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The image_url of the associated line item.\n\t * @example ```\"https://img.yourdomain.com/skus/xYZkjABcde.png\"```\n\t */\n\timage_url?: string | null\n\n\tparcel?: Parcel | null\n\tstock_line_item?: StockLineItem | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface ParcelLineItemCreate extends ResourceCreate {\n\t\n\t/** \n\t * The parcel line item quantity.\n\t * @example ```4```\n\t */\n\tquantity: number\n\n\tparcel: ParcelRel\n\tstock_line_item: StockLineItemRel\n\n}\n\n\ntype ParcelLineItemUpdate = ResourceUpdate\n\n\nclass ParcelLineItems extends ApiResource<ParcelLineItem> {\n\n\tstatic readonly TYPE: ParcelLineItemType = 'parcel_line_items' as const\n\n\tasync create(resource: ParcelLineItemCreate, params?: QueryParamsRetrieve<ParcelLineItem>, options?: ResourcesConfig): Promise<ParcelLineItem> {\n\t\treturn this.resources.create<ParcelLineItemCreate, ParcelLineItem>({ ...resource, type: ParcelLineItems.TYPE }, params, options)\n\t}\n\n\tasync update(resource: ParcelLineItemUpdate, params?: QueryParamsRetrieve<ParcelLineItem>, options?: ResourcesConfig): Promise<ParcelLineItem> {\n\t\treturn this.resources.update<ParcelLineItemUpdate, ParcelLineItem>({ ...resource, type: ParcelLineItems.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: ParcelLineItems.TYPE } : id, options)\n\t}\n\n\tasync parcel(parcelLineItemId: string | ParcelLineItem, params?: QueryParamsRetrieve<Parcel>, options?: ResourcesConfig): Promise<Parcel> {\n\t\tconst _parcelLineItemId = (parcelLineItemId as ParcelLineItem).id || parcelLineItemId as string\n\t\treturn this.resources.fetch<Parcel>({ type: 'parcels' }, `parcel_line_items/${_parcelLineItemId}/parcel`, params, options) as unknown as Parcel\n\t}\n\n\tasync stock_line_item(parcelLineItemId: string | ParcelLineItem, params?: QueryParamsRetrieve<StockLineItem>, options?: ResourcesConfig): Promise<StockLineItem> {\n\t\tconst _parcelLineItemId = (parcelLineItemId as ParcelLineItem).id || parcelLineItemId as string\n\t\treturn this.resources.fetch<StockLineItem>({ type: 'stock_line_items' }, `parcel_line_items/${_parcelLineItemId}/stock_line_item`, params, options) as unknown as StockLineItem\n\t}\n\n\tasync versions(parcelLineItemId: string | ParcelLineItem, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _parcelLineItemId = (parcelLineItemId as ParcelLineItem).id || parcelLineItemId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `parcel_line_items/${_parcelLineItemId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\n\tisParcelLineItem(resource: any): resource is ParcelLineItem {\n\t\treturn resource.type && (resource.type === ParcelLineItems.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): ParcelLineItemRel {\n\t\treturn super.relationshipOneToOne<ParcelLineItemRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): ParcelLineItemRel[] {\n\t\treturn super.relationshipOneToMany<ParcelLineItemRel>(...ids)\n\t}\n\n\n\ttype(): ParcelLineItemType {\n\t\treturn ParcelLineItems.TYPE\n\t}\n\n}\n\n\nconst instance = new ParcelLineItems()\nexport default instance\n\nexport type { ParcelLineItem, ParcelLineItemCreate, ParcelLineItemUpdate, ParcelLineItemType }\n"]}
|
@@ -0,0 +1,60 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var resource = require('../resource');
|
4
|
+
|
5
|
+
class Parcels extends resource.ApiResource {
|
6
|
+
static TYPE = "parcels";
|
7
|
+
async create(resource, params, options) {
|
8
|
+
return this.resources.create({ ...resource, type: Parcels.TYPE }, params, options);
|
9
|
+
}
|
10
|
+
async update(resource, params, options) {
|
11
|
+
return this.resources.update({ ...resource, type: Parcels.TYPE }, params, options);
|
12
|
+
}
|
13
|
+
async delete(id, options) {
|
14
|
+
await this.resources.delete(typeof id === "string" ? { id, type: Parcels.TYPE } : id, options);
|
15
|
+
}
|
16
|
+
async shipment(parcelId, params, options) {
|
17
|
+
const _parcelId = parcelId.id || parcelId;
|
18
|
+
return this.resources.fetch({ type: "shipments" }, `parcels/${_parcelId}/shipment`, params, options);
|
19
|
+
}
|
20
|
+
async package(parcelId, params, options) {
|
21
|
+
const _parcelId = parcelId.id || parcelId;
|
22
|
+
return this.resources.fetch({ type: "packages" }, `parcels/${_parcelId}/package`, params, options);
|
23
|
+
}
|
24
|
+
async parcel_line_items(parcelId, params, options) {
|
25
|
+
const _parcelId = parcelId.id || parcelId;
|
26
|
+
return this.resources.fetch({ type: "parcel_line_items" }, `parcels/${_parcelId}/parcel_line_items`, params, options);
|
27
|
+
}
|
28
|
+
async attachments(parcelId, params, options) {
|
29
|
+
const _parcelId = parcelId.id || parcelId;
|
30
|
+
return this.resources.fetch({ type: "attachments" }, `parcels/${_parcelId}/attachments`, params, options);
|
31
|
+
}
|
32
|
+
async events(parcelId, params, options) {
|
33
|
+
const _parcelId = parcelId.id || parcelId;
|
34
|
+
return this.resources.fetch({ type: "events" }, `parcels/${_parcelId}/events`, params, options);
|
35
|
+
}
|
36
|
+
async versions(parcelId, params, options) {
|
37
|
+
const _parcelId = parcelId.id || parcelId;
|
38
|
+
return this.resources.fetch({ type: "versions" }, `parcels/${_parcelId}/versions`, params, options);
|
39
|
+
}
|
40
|
+
isParcel(resource) {
|
41
|
+
return resource.type && resource.type === Parcels.TYPE;
|
42
|
+
}
|
43
|
+
relationship(id) {
|
44
|
+
return super.relationshipOneToOne(id);
|
45
|
+
}
|
46
|
+
relationshipToMany(...ids) {
|
47
|
+
return super.relationshipOneToMany(...ids);
|
48
|
+
}
|
49
|
+
type() {
|
50
|
+
return Parcels.TYPE;
|
51
|
+
}
|
52
|
+
}
|
53
|
+
const instance = new Parcels();
|
54
|
+
var parcels_default = instance;
|
55
|
+
|
56
|
+
module.exports = parcels_default;
|
57
|
+
//# sourceMappingURL=parcels.cjs.map
|
58
|
+
|
59
|
+
module.exports = exports.default;
|
60
|
+
//# sourceMappingURL=parcels.cjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../src/resources/parcels.ts"],"names":["ApiResource"],"mappings":";;;;AAwZA,MAAM,gBAAgBA,oBAAoB,CAAA;AAAA,EAEzC,OAAgB,IAAmB,GAAA,SAAA;AAAA,EAEnC,MAAM,MAAA,CAAO,QAAwB,EAAA,MAAA,EAAsC,OAA4C,EAAA;AACtH,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA6B,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,OAAQ,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACxG,EAEA,MAAM,MAAA,CAAO,QAAwB,EAAA,MAAA,EAAsC,OAA4C,EAAA;AACtH,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA6B,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,OAAQ,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACxG,EAEA,MAAM,MAAO,CAAA,EAAA,EAAyB,OA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import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Shipment, ShipmentType } from './shipments'\nimport type { Package, PackageType } from './packages'\nimport type { ParcelLineItem } from './parcel_line_items'\nimport type { Attachment } from './attachments'\nimport type { Event } from './events'\nimport type { Version } from './versions'\n\n\ntype ParcelType = 'parcels'\ntype ParcelRel = ResourceRel & { type: ParcelType }\ntype ShipmentRel = ResourceRel & { type: ShipmentType }\ntype PackageRel = ResourceRel & { type: PackageType }\n\n\nexport type ParcelSort = Pick<Parcel, 'id' | 'weight' | 'tracking_status' | 'tracking_status_updated_at' | 'carrier_weight_oz'> & ResourceSort\n// export type ParcelFilter = Pick<Parcel, 'id' | 'weight' | 'contents_explanation' | 'shipping_label_url' | 'shipping_label_file_type' | 'shipping_label_size' | 'shipping_label_resolution' | 'tracking_number' | 'tracking_status' | 'tracking_status_detail' | 'tracking_status_updated_at' | 'carrier_weight_oz' | 'incoterm' | 'delivery_confirmation'> & ResourceFilter\n\n\ninterface Parcel extends Resource {\n\t\n\treadonly type: ParcelType\n\n\t/** \n\t * Unique identifier for the parcel.\n\t * @example ```\"#1234/S/001/P/001\"```\n\t */\n\tnumber?: string | null\n\t/** \n\t * The parcel weight, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```1000```\n\t */\n\tweight: number\n\t/** \n\t * The unit of weight. One of 'gr', 'oz', or 'lb'.\n\t * @example ```\"gr\"```\n\t */\n\tunit_of_weight: 'gr' | 'oz' | 'lb'\n\t/** \n\t * When shipping outside the US, you need to provide either an Exemption and Exclusion Legend (EEL) code or a Proof of Filing Citation (PFC). Which you need is based on the value of the goods being shipped. Value can be one of \"EEL\" o \"PFC\".\n\t * @example ```\"EEL\"```\n\t */\n\teel_pfc?: string | null\n\t/** \n\t * The type of item you are sending.\n\t * @example ```\"merchandise\"```\n\t */\n\tcontents_type?: string | null\n\t/** \n\t * If you specify 'other' in the 'contents_type' attribute, you must supply a brief description in this attribute.\n\t */\n\tcontents_explanation?: string | null\n\t/** \n\t * Indicates if the provided information is accurate.\n\t */\n\tcustoms_certify?: boolean | null\n\t/** \n\t * This is the name of the person who is certifying that the information provided on the customs form is accurate. Use a name of the person in your organization who is responsible for this.\n\t * @example ```\"John Doe\"```\n\t */\n\tcustoms_signer?: string | null\n\t/** \n\t * In case the shipment cannot be delivered, this option tells the carrier what you want to happen to the parcel. You can pass either 'return', or 'abandon'. The value defaults to 'return'. If you pass 'abandon', you will not receive the parcel back if it cannot be delivered.\n\t * @example ```\"return\"```\n\t */\n\tnon_delivery_option?: string | null\n\t/** \n\t * Describes if your parcel requires any special treatment or quarantine when entering the country. Can be one of 'none', 'other', 'quarantine', or 'sanitary_phytosanitary_inspection'.\n\t * @example ```\"none\"```\n\t */\n\trestriction_type?: string | null\n\t/** \n\t * If you specify 'other' in the restriction type, you must supply a brief description of what is required.\n\t */\n\trestriction_comments?: string | null\n\t/** \n\t * Indicates if the parcel requires customs info to get the shipping rates.\n\t */\n\tcustoms_info_required?: boolean | null\n\t/** \n\t * The shipping label url, ready to be downloaded and printed.\n\t * @example ```\"https://bucket.s3-us-west-2.amazonaws.com/files/postage_label/20180101/123.pdf\"```\n\t */\n\tshipping_label_url?: string | null\n\t/** \n\t * The shipping label file type. One of 'application/pdf', 'application/zpl', 'application/epl2', or 'image/png'.\n\t * @example ```\"application/pdf\"```\n\t */\n\tshipping_label_file_type?: string | null\n\t/** \n\t * The shipping label size.\n\t * @example ```\"4x7\"```\n\t */\n\tshipping_label_size?: string | null\n\t/** \n\t * The shipping label resolution.\n\t * @example ```\"200\"```\n\t */\n\tshipping_label_resolution?: string | null\n\t/** \n\t * The tracking number associated to this parcel.\n\t * @example ```\"1Z4V2A000000000000\"```\n\t */\n\ttracking_number?: string | null\n\t/** \n\t * The tracking status for this parcel, automatically updated in real time by the shipping carrier.\n\t * @example ```\"delivered\"```\n\t */\n\ttracking_status?: string | null\n\t/** \n\t * Additional information about the tracking status, automatically updated in real time by the shipping carrier.\n\t * @example ```\"arrived_at_destination\"```\n\t */\n\ttracking_status_detail?: string | null\n\t/** \n\t * Time at which the parcel's tracking status was last updated.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\ttracking_status_updated_at?: string | null\n\t/** \n\t * The parcel's full tracking history, automatically updated in real time by the shipping carrier.\n\t * @example ```[{\"object\":\"TrackingDetail\",\"message\":\"Pre-Shipment information received\",\"status\":\"pre_transit\",\"datetime\":\"2018-02-27T16:02:17Z\",\"source\":\"DHLExpress\",\"tracking_location\":{\"object\":\"TrackingLocation\"}}]```\n\t */\n\ttracking_details?: Array<Record<string, any>> | null\n\t/** \n\t * The weight of the parcel as measured by the carrier in ounces (if available).\n\t * @example ```\"42.32\"```\n\t */\n\tcarrier_weight_oz?: string | null\n\t/** \n\t * The name of the person who signed for the parcel (if available).\n\t * @example ```\"John Smith\"```\n\t */\n\tsigned_by?: string | null\n\t/** \n\t * The type of Incoterm (if available).\n\t * @example ```\"EXW\"```\n\t */\n\tincoterm?: string | null\n\t/** \n\t * The type of delivery confirmation option upon delivery.\n\t * @example ```\"SIGNATURE\"```\n\t */\n\tdelivery_confirmation?: string | null\n\n\tshipment?: Shipment | null\n\tpackage?: Package | null\n\tparcel_line_items?: ParcelLineItem[] | null\n\tattachments?: Attachment[] | null\n\tevents?: Event[] | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface ParcelCreate extends ResourceCreate {\n\t\n\t/** \n\t * The parcel weight, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```1000```\n\t */\n\tweight: number\n\t/** \n\t * The unit of weight. One of 'gr', 'oz', or 'lb'.\n\t * @example ```\"gr\"```\n\t */\n\tunit_of_weight: 'gr' | 'oz' | 'lb'\n\t/** \n\t * When shipping outside the US, you need to provide either an Exemption and Exclusion Legend (EEL) code or a Proof of Filing Citation (PFC). Which you need is based on the value of the goods being shipped. Value can be one of \"EEL\" o \"PFC\".\n\t * @example ```\"EEL\"```\n\t */\n\teel_pfc?: string | null\n\t/** \n\t * The type of item you are sending.\n\t * @example ```\"merchandise\"```\n\t */\n\tcontents_type?: string | null\n\t/** \n\t * If you specify 'other' in the 'contents_type' attribute, you must supply a brief description in this attribute.\n\t */\n\tcontents_explanation?: string | null\n\t/** \n\t * Indicates if the provided information is accurate.\n\t */\n\tcustoms_certify?: boolean | null\n\t/** \n\t * This is the name of the person who is certifying that the information provided on the customs form is accurate. Use a name of the person in your organization who is responsible for this.\n\t * @example ```\"John Doe\"```\n\t */\n\tcustoms_signer?: string | null\n\t/** \n\t * In case the shipment cannot be delivered, this option tells the carrier what you want to happen to the parcel. You can pass either 'return', or 'abandon'. The value defaults to 'return'. If you pass 'abandon', you will not receive the parcel back if it cannot be delivered.\n\t * @example ```\"return\"```\n\t */\n\tnon_delivery_option?: string | null\n\t/** \n\t * Describes if your parcel requires any special treatment or quarantine when entering the country. Can be one of 'none', 'other', 'quarantine', or 'sanitary_phytosanitary_inspection'.\n\t * @example ```\"none\"```\n\t */\n\trestriction_type?: string | null\n\t/** \n\t * If you specify 'other' in the restriction type, you must supply a brief description of what is required.\n\t */\n\trestriction_comments?: string | null\n\t/** \n\t * Indicates if the parcel requires customs info to get the shipping rates.\n\t */\n\tcustoms_info_required?: boolean | null\n\t/** \n\t * The shipping label url, ready to be downloaded and printed.\n\t * @example ```\"https://bucket.s3-us-west-2.amazonaws.com/files/postage_label/20180101/123.pdf\"```\n\t */\n\tshipping_label_url?: string | null\n\t/** \n\t * The shipping label file type. One of 'application/pdf', 'application/zpl', 'application/epl2', or 'image/png'.\n\t * @example ```\"application/pdf\"```\n\t */\n\tshipping_label_file_type?: string | null\n\t/** \n\t * The shipping label size.\n\t * @example ```\"4x7\"```\n\t */\n\tshipping_label_size?: string | null\n\t/** \n\t * The shipping label resolution.\n\t * @example ```\"200\"```\n\t */\n\tshipping_label_resolution?: string | null\n\t/** \n\t * The tracking number associated to this parcel.\n\t * @example ```\"1Z4V2A000000000000\"```\n\t */\n\ttracking_number?: string | null\n\t/** \n\t * The tracking status for this parcel, automatically updated in real time by the shipping carrier.\n\t * @example ```\"delivered\"```\n\t */\n\ttracking_status?: string | null\n\t/** \n\t * Additional information about the tracking status, automatically updated in real time by the shipping carrier.\n\t * @example ```\"arrived_at_destination\"```\n\t */\n\ttracking_status_detail?: string | null\n\t/** \n\t * Time at which the parcel's tracking status was last updated.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\ttracking_status_updated_at?: string | null\n\t/** \n\t * The parcel's full tracking history, automatically updated in real time by the shipping carrier.\n\t * @example ```[{\"object\":\"TrackingDetail\",\"message\":\"Pre-Shipment information received\",\"status\":\"pre_transit\",\"datetime\":\"2018-02-27T16:02:17Z\",\"source\":\"DHLExpress\",\"tracking_location\":{\"object\":\"TrackingLocation\"}}]```\n\t */\n\ttracking_details?: Array<Record<string, any>> | null\n\t/** \n\t * The weight of the parcel as measured by the carrier in ounces (if available).\n\t * @example ```\"42.32\"```\n\t */\n\tcarrier_weight_oz?: string | null\n\t/** \n\t * The name of the person who signed for the parcel (if available).\n\t * @example ```\"John Smith\"```\n\t */\n\tsigned_by?: string | null\n\t/** \n\t * The type of Incoterm (if available).\n\t * @example ```\"EXW\"```\n\t */\n\tincoterm?: string | null\n\t/** \n\t * The type of delivery confirmation option upon delivery.\n\t * @example ```\"SIGNATURE\"```\n\t */\n\tdelivery_confirmation?: string | null\n\n\tshipment: ShipmentRel\n\tpackage: PackageRel\n\n}\n\n\ninterface ParcelUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The parcel weight, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```1000```\n\t */\n\tweight?: number | null\n\t/** \n\t * The unit of weight. One of 'gr', 'oz', or 'lb'.\n\t * @example ```\"gr\"```\n\t */\n\tunit_of_weight?: 'gr' | 'oz' | 'lb' | null\n\t/** \n\t * When shipping outside the US, you need to provide either an Exemption and Exclusion Legend (EEL) code or a Proof of Filing Citation (PFC). Which you need is based on the value of the goods being shipped. Value can be one of \"EEL\" o \"PFC\".\n\t * @example ```\"EEL\"```\n\t */\n\teel_pfc?: string | null\n\t/** \n\t * The type of item you are sending.\n\t * @example ```\"merchandise\"```\n\t */\n\tcontents_type?: string | null\n\t/** \n\t * If you specify 'other' in the 'contents_type' attribute, you must supply a brief description in this attribute.\n\t */\n\tcontents_explanation?: string | null\n\t/** \n\t * Indicates if the provided information is accurate.\n\t */\n\tcustoms_certify?: boolean | null\n\t/** \n\t * This is the name of the person who is certifying that the information provided on the customs form is accurate. Use a name of the person in your organization who is responsible for this.\n\t * @example ```\"John Doe\"```\n\t */\n\tcustoms_signer?: string | null\n\t/** \n\t * In case the shipment cannot be delivered, this option tells the carrier what you want to happen to the parcel. You can pass either 'return', or 'abandon'. The value defaults to 'return'. If you pass 'abandon', you will not receive the parcel back if it cannot be delivered.\n\t * @example ```\"return\"```\n\t */\n\tnon_delivery_option?: string | null\n\t/** \n\t * Describes if your parcel requires any special treatment or quarantine when entering the country. Can be one of 'none', 'other', 'quarantine', or 'sanitary_phytosanitary_inspection'.\n\t * @example ```\"none\"```\n\t */\n\trestriction_type?: string | null\n\t/** \n\t * If you specify 'other' in the restriction type, you must supply a brief description of what is required.\n\t */\n\trestriction_comments?: string | null\n\t/** \n\t * Indicates if the parcel requires customs info to get the shipping rates.\n\t */\n\tcustoms_info_required?: boolean | null\n\t/** \n\t * The shipping label url, ready to be downloaded and printed.\n\t * @example ```\"https://bucket.s3-us-west-2.amazonaws.com/files/postage_label/20180101/123.pdf\"```\n\t */\n\tshipping_label_url?: string | null\n\t/** \n\t * The shipping label file type. One of 'application/pdf', 'application/zpl', 'application/epl2', or 'image/png'.\n\t * @example ```\"application/pdf\"```\n\t */\n\tshipping_label_file_type?: string | null\n\t/** \n\t * The shipping label size.\n\t * @example ```\"4x7\"```\n\t */\n\tshipping_label_size?: string | null\n\t/** \n\t * The shipping label resolution.\n\t * @example ```\"200\"```\n\t */\n\tshipping_label_resolution?: string | null\n\t/** \n\t * The tracking number associated to this parcel.\n\t * @example ```\"1Z4V2A000000000000\"```\n\t */\n\ttracking_number?: string | null\n\t/** \n\t * The tracking status for this parcel, automatically updated in real time by the shipping carrier.\n\t * @example ```\"delivered\"```\n\t */\n\ttracking_status?: string | null\n\t/** \n\t * Additional information about the tracking status, automatically updated in real time by the shipping carrier.\n\t * @example ```\"arrived_at_destination\"```\n\t */\n\ttracking_status_detail?: string | null\n\t/** \n\t * Time at which the parcel's tracking status was last updated.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\ttracking_status_updated_at?: string | null\n\t/** \n\t * The parcel's full tracking history, automatically updated in real time by the shipping carrier.\n\t * @example ```[{\"object\":\"TrackingDetail\",\"message\":\"Pre-Shipment information received\",\"status\":\"pre_transit\",\"datetime\":\"2018-02-27T16:02:17Z\",\"source\":\"DHLExpress\",\"tracking_location\":{\"object\":\"TrackingLocation\"}}]```\n\t */\n\ttracking_details?: Array<Record<string, any>> | null\n\t/** \n\t * The weight of the parcel as measured by the carrier in ounces (if available).\n\t * @example ```\"42.32\"```\n\t */\n\tcarrier_weight_oz?: string | null\n\t/** \n\t * The name of the person who signed for the parcel (if available).\n\t * @example ```\"John Smith\"```\n\t */\n\tsigned_by?: string | null\n\t/** \n\t * The type of Incoterm (if available).\n\t * @example ```\"EXW\"```\n\t */\n\tincoterm?: string | null\n\t/** \n\t * The type of delivery confirmation option upon delivery.\n\t * @example ```\"SIGNATURE\"```\n\t */\n\tdelivery_confirmation?: string | null\n\n\tshipment?: ShipmentRel | null\n\tpackage?: PackageRel | null\n\n}\n\n\nclass Parcels extends ApiResource<Parcel> {\n\n\tstatic readonly TYPE: ParcelType = 'parcels' as const\n\n\tasync create(resource: ParcelCreate, params?: QueryParamsRetrieve<Parcel>, options?: ResourcesConfig): Promise<Parcel> {\n\t\treturn this.resources.create<ParcelCreate, Parcel>({ ...resource, type: Parcels.TYPE }, params, options)\n\t}\n\n\tasync update(resource: ParcelUpdate, params?: QueryParamsRetrieve<Parcel>, options?: ResourcesConfig): Promise<Parcel> {\n\t\treturn this.resources.update<ParcelUpdate, Parcel>({ ...resource, type: Parcels.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: Parcels.TYPE } : id, options)\n\t}\n\n\tasync shipment(parcelId: string | Parcel, params?: QueryParamsRetrieve<Shipment>, options?: ResourcesConfig): Promise<Shipment> {\n\t\tconst _parcelId = (parcelId as Parcel).id || parcelId as string\n\t\treturn this.resources.fetch<Shipment>({ type: 'shipments' }, `parcels/${_parcelId}/shipment`, params, options) as unknown as Shipment\n\t}\n\n\tasync package(parcelId: string | Parcel, params?: QueryParamsRetrieve<Package>, options?: ResourcesConfig): Promise<Package> {\n\t\tconst _parcelId = (parcelId as Parcel).id || parcelId as string\n\t\treturn this.resources.fetch<Package>({ type: 'packages' }, `parcels/${_parcelId}/package`, params, options) as unknown as Package\n\t}\n\n\tasync parcel_line_items(parcelId: string | Parcel, params?: QueryParamsList<ParcelLineItem>, options?: ResourcesConfig): Promise<ListResponse<ParcelLineItem>> {\n\t\tconst _parcelId = (parcelId as Parcel).id || parcelId as string\n\t\treturn this.resources.fetch<ParcelLineItem>({ type: 'parcel_line_items' }, `parcels/${_parcelId}/parcel_line_items`, params, options) as unknown as ListResponse<ParcelLineItem>\n\t}\n\n\tasync attachments(parcelId: string | Parcel, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _parcelId = (parcelId as Parcel).id || parcelId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `parcels/${_parcelId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync events(parcelId: string | Parcel, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _parcelId = (parcelId as Parcel).id || parcelId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `parcels/${_parcelId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync versions(parcelId: string | Parcel, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _parcelId = (parcelId as Parcel).id || parcelId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `parcels/${_parcelId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\n\tisParcel(resource: any): resource is Parcel {\n\t\treturn resource.type && (resource.type === Parcels.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): ParcelRel {\n\t\treturn super.relationshipOneToOne<ParcelRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): ParcelRel[] {\n\t\treturn super.relationshipOneToMany<ParcelRel>(...ids)\n\t}\n\n\n\ttype(): ParcelType {\n\t\treturn Parcels.TYPE\n\t}\n\n}\n\n\nconst instance = new Parcels()\nexport default instance\n\nexport type { Parcel, ParcelCreate, ParcelUpdate, ParcelType }\n"]}
|
@@ -0,0 +1,56 @@
|
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
|
3
|
+
class Parcels extends ApiResource {
|
4
|
+
static TYPE = "parcels";
|
5
|
+
async create(resource, params, options) {
|
6
|
+
return this.resources.create({ ...resource, type: Parcels.TYPE }, params, options);
|
7
|
+
}
|
8
|
+
async update(resource, params, options) {
|
9
|
+
return this.resources.update({ ...resource, type: Parcels.TYPE }, params, options);
|
10
|
+
}
|
11
|
+
async delete(id, options) {
|
12
|
+
await this.resources.delete(typeof id === "string" ? { id, type: Parcels.TYPE } : id, options);
|
13
|
+
}
|
14
|
+
async shipment(parcelId, params, options) {
|
15
|
+
const _parcelId = parcelId.id || parcelId;
|
16
|
+
return this.resources.fetch({ type: "shipments" }, `parcels/${_parcelId}/shipment`, params, options);
|
17
|
+
}
|
18
|
+
async package(parcelId, params, options) {
|
19
|
+
const _parcelId = parcelId.id || parcelId;
|
20
|
+
return this.resources.fetch({ type: "packages" }, `parcels/${_parcelId}/package`, params, options);
|
21
|
+
}
|
22
|
+
async parcel_line_items(parcelId, params, options) {
|
23
|
+
const _parcelId = parcelId.id || parcelId;
|
24
|
+
return this.resources.fetch({ type: "parcel_line_items" }, `parcels/${_parcelId}/parcel_line_items`, params, options);
|
25
|
+
}
|
26
|
+
async attachments(parcelId, params, options) {
|
27
|
+
const _parcelId = parcelId.id || parcelId;
|
28
|
+
return this.resources.fetch({ type: "attachments" }, `parcels/${_parcelId}/attachments`, params, options);
|
29
|
+
}
|
30
|
+
async events(parcelId, params, options) {
|
31
|
+
const _parcelId = parcelId.id || parcelId;
|
32
|
+
return this.resources.fetch({ type: "events" }, `parcels/${_parcelId}/events`, params, options);
|
33
|
+
}
|
34
|
+
async versions(parcelId, params, options) {
|
35
|
+
const _parcelId = parcelId.id || parcelId;
|
36
|
+
return this.resources.fetch({ type: "versions" }, `parcels/${_parcelId}/versions`, params, options);
|
37
|
+
}
|
38
|
+
isParcel(resource) {
|
39
|
+
return resource.type && resource.type === Parcels.TYPE;
|
40
|
+
}
|
41
|
+
relationship(id) {
|
42
|
+
return super.relationshipOneToOne(id);
|
43
|
+
}
|
44
|
+
relationshipToMany(...ids) {
|
45
|
+
return super.relationshipOneToMany(...ids);
|
46
|
+
}
|
47
|
+
type() {
|
48
|
+
return Parcels.TYPE;
|
49
|
+
}
|
50
|
+
}
|
51
|
+
const instance = new Parcels();
|
52
|
+
var parcels_default = instance;
|
53
|
+
|
54
|
+
export { parcels_default as default };
|
55
|
+
//# sourceMappingURL=parcels.js.map
|
56
|
+
//# sourceMappingURL=parcels.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../src/resources/parcels.ts"],"names":[],"mappings":";;AAwZA,MAAM,gBAAgB,WAAoB,CAAA;AAAA,EAEzC,OAAgB,IAAmB,GAAA,SAAA;AAAA,EAEnC,MAAM,MAAA,CAAO,QAAwB,EAAA,MAAA,E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,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,OAAQ,CAAA,IAAA;AAAA;AACpD,EAGA,aAAa,EAA2C,EAAA;AACvD,IAAO,OAAA,KAAA,CAAM,qBAAgC,EAAE,CAAA;AAAA;AAChD,EAEA,sBAAsB,GAA4B,EAAA;AACjD,IAAO,OAAA,KAAA,CAAM,qBAAiC,CAAA,GAAG,GAAG,CAAA;AAAA;AACrD,EAGA,IAAmB,GAAA;AAClB,IAAA,OAAO,OAAQ,CAAA,IAAA;AAAA;AAGjB;AAGA,MAAM,QAAA,GAAW,IAAI,OAAQ,EAAA;AAC7B,IAAO,eAAQ,GAAA","file":"parcels.js","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Shipment, ShipmentType } from './shipments'\nimport type { Package, PackageType } from './packages'\nimport type { ParcelLineItem } from './parcel_line_items'\nimport type { Attachment } from './attachments'\nimport type { Event } from './events'\nimport type { Version } from './versions'\n\n\ntype ParcelType = 'parcels'\ntype ParcelRel = ResourceRel & { type: ParcelType }\ntype ShipmentRel = ResourceRel & { type: ShipmentType }\ntype PackageRel = ResourceRel & { type: PackageType }\n\n\nexport type ParcelSort = Pick<Parcel, 'id' | 'weight' | 'tracking_status' | 'tracking_status_updated_at' | 'carrier_weight_oz'> & ResourceSort\n// export type ParcelFilter = Pick<Parcel, 'id' | 'weight' | 'contents_explanation' | 'shipping_label_url' | 'shipping_label_file_type' | 'shipping_label_size' | 'shipping_label_resolution' | 'tracking_number' | 'tracking_status' | 'tracking_status_detail' | 'tracking_status_updated_at' | 'carrier_weight_oz' | 'incoterm' | 'delivery_confirmation'> & ResourceFilter\n\n\ninterface Parcel extends Resource {\n\t\n\treadonly type: ParcelType\n\n\t/** \n\t * Unique identifier for the parcel.\n\t * @example ```\"#1234/S/001/P/001\"```\n\t */\n\tnumber?: string | null\n\t/** \n\t * The parcel weight, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```1000```\n\t */\n\tweight: number\n\t/** \n\t * The unit of weight. One of 'gr', 'oz', or 'lb'.\n\t * @example ```\"gr\"```\n\t */\n\tunit_of_weight: 'gr' | 'oz' | 'lb'\n\t/** \n\t * When shipping outside the US, you need to provide either an Exemption and Exclusion Legend (EEL) code or a Proof of Filing Citation (PFC). Which you need is based on the value of the goods being shipped. Value can be one of \"EEL\" o \"PFC\".\n\t * @example ```\"EEL\"```\n\t */\n\teel_pfc?: string | null\n\t/** \n\t * The type of item you are sending.\n\t * @example ```\"merchandise\"```\n\t */\n\tcontents_type?: string | null\n\t/** \n\t * If you specify 'other' in the 'contents_type' attribute, you must supply a brief description in this attribute.\n\t */\n\tcontents_explanation?: string | null\n\t/** \n\t * Indicates if the provided information is accurate.\n\t */\n\tcustoms_certify?: boolean | null\n\t/** \n\t * This is the name of the person who is certifying that the information provided on the customs form is accurate. Use a name of the person in your organization who is responsible for this.\n\t * @example ```\"John Doe\"```\n\t */\n\tcustoms_signer?: string | null\n\t/** \n\t * In case the shipment cannot be delivered, this option tells the carrier what you want to happen to the parcel. You can pass either 'return', or 'abandon'. The value defaults to 'return'. If you pass 'abandon', you will not receive the parcel back if it cannot be delivered.\n\t * @example ```\"return\"```\n\t */\n\tnon_delivery_option?: string | null\n\t/** \n\t * Describes if your parcel requires any special treatment or quarantine when entering the country. Can be one of 'none', 'other', 'quarantine', or 'sanitary_phytosanitary_inspection'.\n\t * @example ```\"none\"```\n\t */\n\trestriction_type?: string | null\n\t/** \n\t * If you specify 'other' in the restriction type, you must supply a brief description of what is required.\n\t */\n\trestriction_comments?: string | null\n\t/** \n\t * Indicates if the parcel requires customs info to get the shipping rates.\n\t */\n\tcustoms_info_required?: boolean | null\n\t/** \n\t * The shipping label url, ready to be downloaded and printed.\n\t * @example ```\"https://bucket.s3-us-west-2.amazonaws.com/files/postage_label/20180101/123.pdf\"```\n\t */\n\tshipping_label_url?: string | null\n\t/** \n\t * The shipping label file type. One of 'application/pdf', 'application/zpl', 'application/epl2', or 'image/png'.\n\t * @example ```\"application/pdf\"```\n\t */\n\tshipping_label_file_type?: string | null\n\t/** \n\t * The shipping label size.\n\t * @example ```\"4x7\"```\n\t */\n\tshipping_label_size?: string | null\n\t/** \n\t * The shipping label resolution.\n\t * @example ```\"200\"```\n\t */\n\tshipping_label_resolution?: string | null\n\t/** \n\t * The tracking number associated to this parcel.\n\t * @example ```\"1Z4V2A000000000000\"```\n\t */\n\ttracking_number?: string | null\n\t/** \n\t * The tracking status for this parcel, automatically updated in real time by the shipping carrier.\n\t * @example ```\"delivered\"```\n\t */\n\ttracking_status?: string | null\n\t/** \n\t * Additional information about the tracking status, automatically updated in real time by the shipping carrier.\n\t * @example ```\"arrived_at_destination\"```\n\t */\n\ttracking_status_detail?: string | null\n\t/** \n\t * Time at which the parcel's tracking status was last updated.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\ttracking_status_updated_at?: string | null\n\t/** \n\t * The parcel's full tracking history, automatically updated in real time by the shipping carrier.\n\t * @example ```[{\"object\":\"TrackingDetail\",\"message\":\"Pre-Shipment information received\",\"status\":\"pre_transit\",\"datetime\":\"2018-02-27T16:02:17Z\",\"source\":\"DHLExpress\",\"tracking_location\":{\"object\":\"TrackingLocation\"}}]```\n\t */\n\ttracking_details?: Array<Record<string, any>> | null\n\t/** \n\t * The weight of the parcel as measured by the carrier in ounces (if available).\n\t * @example ```\"42.32\"```\n\t */\n\tcarrier_weight_oz?: string | null\n\t/** \n\t * The name of the person who signed for the parcel (if available).\n\t * @example ```\"John Smith\"```\n\t */\n\tsigned_by?: string | null\n\t/** \n\t * The type of Incoterm (if available).\n\t * @example ```\"EXW\"```\n\t */\n\tincoterm?: string | null\n\t/** \n\t * The type of delivery confirmation option upon delivery.\n\t * @example ```\"SIGNATURE\"```\n\t */\n\tdelivery_confirmation?: string | null\n\n\tshipment?: Shipment | null\n\tpackage?: Package | null\n\tparcel_line_items?: ParcelLineItem[] | null\n\tattachments?: Attachment[] | null\n\tevents?: Event[] | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface ParcelCreate extends ResourceCreate {\n\t\n\t/** \n\t * The parcel weight, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```1000```\n\t */\n\tweight: number\n\t/** \n\t * The unit of weight. One of 'gr', 'oz', or 'lb'.\n\t * @example ```\"gr\"```\n\t */\n\tunit_of_weight: 'gr' | 'oz' | 'lb'\n\t/** \n\t * When shipping outside the US, you need to provide either an Exemption and Exclusion Legend (EEL) code or a Proof of Filing Citation (PFC). Which you need is based on the value of the goods being shipped. Value can be one of \"EEL\" o \"PFC\".\n\t * @example ```\"EEL\"```\n\t */\n\teel_pfc?: string | null\n\t/** \n\t * The type of item you are sending.\n\t * @example ```\"merchandise\"```\n\t */\n\tcontents_type?: string | null\n\t/** \n\t * If you specify 'other' in the 'contents_type' attribute, you must supply a brief description in this attribute.\n\t */\n\tcontents_explanation?: string | null\n\t/** \n\t * Indicates if the provided information is accurate.\n\t */\n\tcustoms_certify?: boolean | null\n\t/** \n\t * This is the name of the person who is certifying that the information provided on the customs form is accurate. Use a name of the person in your organization who is responsible for this.\n\t * @example ```\"John Doe\"```\n\t */\n\tcustoms_signer?: string | null\n\t/** \n\t * In case the shipment cannot be delivered, this option tells the carrier what you want to happen to the parcel. You can pass either 'return', or 'abandon'. The value defaults to 'return'. If you pass 'abandon', you will not receive the parcel back if it cannot be delivered.\n\t * @example ```\"return\"```\n\t */\n\tnon_delivery_option?: string | null\n\t/** \n\t * Describes if your parcel requires any special treatment or quarantine when entering the country. Can be one of 'none', 'other', 'quarantine', or 'sanitary_phytosanitary_inspection'.\n\t * @example ```\"none\"```\n\t */\n\trestriction_type?: string | null\n\t/** \n\t * If you specify 'other' in the restriction type, you must supply a brief description of what is required.\n\t */\n\trestriction_comments?: string | null\n\t/** \n\t * Indicates if the parcel requires customs info to get the shipping rates.\n\t */\n\tcustoms_info_required?: boolean | null\n\t/** \n\t * The shipping label url, ready to be downloaded and printed.\n\t * @example ```\"https://bucket.s3-us-west-2.amazonaws.com/files/postage_label/20180101/123.pdf\"```\n\t */\n\tshipping_label_url?: string | null\n\t/** \n\t * The shipping label file type. One of 'application/pdf', 'application/zpl', 'application/epl2', or 'image/png'.\n\t * @example ```\"application/pdf\"```\n\t */\n\tshipping_label_file_type?: string | null\n\t/** \n\t * The shipping label size.\n\t * @example ```\"4x7\"```\n\t */\n\tshipping_label_size?: string | null\n\t/** \n\t * The shipping label resolution.\n\t * @example ```\"200\"```\n\t */\n\tshipping_label_resolution?: string | null\n\t/** \n\t * The tracking number associated to this parcel.\n\t * @example ```\"1Z4V2A000000000000\"```\n\t */\n\ttracking_number?: string | null\n\t/** \n\t * The tracking status for this parcel, automatically updated in real time by the shipping carrier.\n\t * @example ```\"delivered\"```\n\t */\n\ttracking_status?: string | null\n\t/** \n\t * Additional information about the tracking status, automatically updated in real time by the shipping carrier.\n\t * @example ```\"arrived_at_destination\"```\n\t */\n\ttracking_status_detail?: string | null\n\t/** \n\t * Time at which the parcel's tracking status was last updated.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\ttracking_status_updated_at?: string | null\n\t/** \n\t * The parcel's full tracking history, automatically updated in real time by the shipping carrier.\n\t * @example ```[{\"object\":\"TrackingDetail\",\"message\":\"Pre-Shipment information received\",\"status\":\"pre_transit\",\"datetime\":\"2018-02-27T16:02:17Z\",\"source\":\"DHLExpress\",\"tracking_location\":{\"object\":\"TrackingLocation\"}}]```\n\t */\n\ttracking_details?: Array<Record<string, any>> | null\n\t/** \n\t * The weight of the parcel as measured by the carrier in ounces (if available).\n\t * @example ```\"42.32\"```\n\t */\n\tcarrier_weight_oz?: string | null\n\t/** \n\t * The name of the person who signed for the parcel (if available).\n\t * @example ```\"John Smith\"```\n\t */\n\tsigned_by?: string | null\n\t/** \n\t * The type of Incoterm (if available).\n\t * @example ```\"EXW\"```\n\t */\n\tincoterm?: string | null\n\t/** \n\t * The type of delivery confirmation option upon delivery.\n\t * @example ```\"SIGNATURE\"```\n\t */\n\tdelivery_confirmation?: string | null\n\n\tshipment: ShipmentRel\n\tpackage: PackageRel\n\n}\n\n\ninterface ParcelUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The parcel weight, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```1000```\n\t */\n\tweight?: number | null\n\t/** \n\t * The unit of weight. One of 'gr', 'oz', or 'lb'.\n\t * @example ```\"gr\"```\n\t */\n\tunit_of_weight?: 'gr' | 'oz' | 'lb' | null\n\t/** \n\t * When shipping outside the US, you need to provide either an Exemption and Exclusion Legend (EEL) code or a Proof of Filing Citation (PFC). Which you need is based on the value of the goods being shipped. Value can be one of \"EEL\" o \"PFC\".\n\t * @example ```\"EEL\"```\n\t */\n\teel_pfc?: string | null\n\t/** \n\t * The type of item you are sending.\n\t * @example ```\"merchandise\"```\n\t */\n\tcontents_type?: string | null\n\t/** \n\t * If you specify 'other' in the 'contents_type' attribute, you must supply a brief description in this attribute.\n\t */\n\tcontents_explanation?: string | null\n\t/** \n\t * Indicates if the provided information is accurate.\n\t */\n\tcustoms_certify?: boolean | null\n\t/** \n\t * This is the name of the person who is certifying that the information provided on the customs form is accurate. Use a name of the person in your organization who is responsible for this.\n\t * @example ```\"John Doe\"```\n\t */\n\tcustoms_signer?: string | null\n\t/** \n\t * In case the shipment cannot be delivered, this option tells the carrier what you want to happen to the parcel. You can pass either 'return', or 'abandon'. The value defaults to 'return'. If you pass 'abandon', you will not receive the parcel back if it cannot be delivered.\n\t * @example ```\"return\"```\n\t */\n\tnon_delivery_option?: string | null\n\t/** \n\t * Describes if your parcel requires any special treatment or quarantine when entering the country. Can be one of 'none', 'other', 'quarantine', or 'sanitary_phytosanitary_inspection'.\n\t * @example ```\"none\"```\n\t */\n\trestriction_type?: string | null\n\t/** \n\t * If you specify 'other' in the restriction type, you must supply a brief description of what is required.\n\t */\n\trestriction_comments?: string | null\n\t/** \n\t * Indicates if the parcel requires customs info to get the shipping rates.\n\t */\n\tcustoms_info_required?: boolean | null\n\t/** \n\t * The shipping label url, ready to be downloaded and printed.\n\t * @example ```\"https://bucket.s3-us-west-2.amazonaws.com/files/postage_label/20180101/123.pdf\"```\n\t */\n\tshipping_label_url?: string | null\n\t/** \n\t * The shipping label file type. One of 'application/pdf', 'application/zpl', 'application/epl2', or 'image/png'.\n\t * @example ```\"application/pdf\"```\n\t */\n\tshipping_label_file_type?: string | null\n\t/** \n\t * The shipping label size.\n\t * @example ```\"4x7\"```\n\t */\n\tshipping_label_size?: string | null\n\t/** \n\t * The shipping label resolution.\n\t * @example ```\"200\"```\n\t */\n\tshipping_label_resolution?: string | null\n\t/** \n\t * The tracking number associated to this parcel.\n\t * @example ```\"1Z4V2A000000000000\"```\n\t */\n\ttracking_number?: string | null\n\t/** \n\t * The tracking status for this parcel, automatically updated in real time by the shipping carrier.\n\t * @example ```\"delivered\"```\n\t */\n\ttracking_status?: string | null\n\t/** \n\t * Additional information about the tracking status, automatically updated in real time by the shipping carrier.\n\t * @example ```\"arrived_at_destination\"```\n\t */\n\ttracking_status_detail?: string | null\n\t/** \n\t * Time at which the parcel's tracking status was last updated.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\ttracking_status_updated_at?: string | null\n\t/** \n\t * The parcel's full tracking history, automatically updated in real time by the shipping carrier.\n\t * @example ```[{\"object\":\"TrackingDetail\",\"message\":\"Pre-Shipment information received\",\"status\":\"pre_transit\",\"datetime\":\"2018-02-27T16:02:17Z\",\"source\":\"DHLExpress\",\"tracking_location\":{\"object\":\"TrackingLocation\"}}]```\n\t */\n\ttracking_details?: Array<Record<string, any>> | null\n\t/** \n\t * The weight of the parcel as measured by the carrier in ounces (if available).\n\t * @example ```\"42.32\"```\n\t */\n\tcarrier_weight_oz?: string | null\n\t/** \n\t * The name of the person who signed for the parcel (if available).\n\t * @example ```\"John Smith\"```\n\t */\n\tsigned_by?: string | null\n\t/** \n\t * The type of Incoterm (if available).\n\t * @example ```\"EXW\"```\n\t */\n\tincoterm?: string | null\n\t/** \n\t * The type of delivery confirmation option upon delivery.\n\t * @example ```\"SIGNATURE\"```\n\t */\n\tdelivery_confirmation?: string | null\n\n\tshipment?: ShipmentRel | null\n\tpackage?: PackageRel | null\n\n}\n\n\nclass Parcels extends ApiResource<Parcel> {\n\n\tstatic readonly TYPE: ParcelType = 'parcels' as const\n\n\tasync create(resource: ParcelCreate, params?: QueryParamsRetrieve<Parcel>, options?: ResourcesConfig): Promise<Parcel> {\n\t\treturn this.resources.create<ParcelCreate, Parcel>({ ...resource, type: Parcels.TYPE }, params, options)\n\t}\n\n\tasync update(resource: ParcelUpdate, params?: QueryParamsRetrieve<Parcel>, options?: ResourcesConfig): Promise<Parcel> {\n\t\treturn this.resources.update<ParcelUpdate, Parcel>({ ...resource, type: Parcels.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: Parcels.TYPE } : id, options)\n\t}\n\n\tasync shipment(parcelId: string | Parcel, params?: QueryParamsRetrieve<Shipment>, options?: ResourcesConfig): Promise<Shipment> {\n\t\tconst _parcelId = (parcelId as Parcel).id || parcelId as string\n\t\treturn this.resources.fetch<Shipment>({ type: 'shipments' }, `parcels/${_parcelId}/shipment`, params, options) as unknown as Shipment\n\t}\n\n\tasync package(parcelId: string | Parcel, params?: QueryParamsRetrieve<Package>, options?: ResourcesConfig): Promise<Package> {\n\t\tconst _parcelId = (parcelId as Parcel).id || parcelId as string\n\t\treturn this.resources.fetch<Package>({ type: 'packages' }, `parcels/${_parcelId}/package`, params, options) as unknown as Package\n\t}\n\n\tasync parcel_line_items(parcelId: string | Parcel, params?: QueryParamsList<ParcelLineItem>, options?: ResourcesConfig): Promise<ListResponse<ParcelLineItem>> {\n\t\tconst _parcelId = (parcelId as Parcel).id || parcelId as string\n\t\treturn this.resources.fetch<ParcelLineItem>({ type: 'parcel_line_items' }, `parcels/${_parcelId}/parcel_line_items`, params, options) as unknown as ListResponse<ParcelLineItem>\n\t}\n\n\tasync attachments(parcelId: string | Parcel, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _parcelId = (parcelId as Parcel).id || parcelId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `parcels/${_parcelId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync events(parcelId: string | Parcel, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _parcelId = (parcelId as Parcel).id || parcelId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `parcels/${_parcelId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync versions(parcelId: string | Parcel, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _parcelId = (parcelId as Parcel).id || parcelId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `parcels/${_parcelId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\n\tisParcel(resource: any): resource is Parcel {\n\t\treturn resource.type && (resource.type === Parcels.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): ParcelRel {\n\t\treturn super.relationshipOneToOne<ParcelRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): ParcelRel[] {\n\t\treturn super.relationshipOneToMany<ParcelRel>(...ids)\n\t}\n\n\n\ttype(): ParcelType {\n\t\treturn Parcels.TYPE\n\t}\n\n}\n\n\nconst instance = new Parcels()\nexport default instance\n\nexport type { Parcel, ParcelCreate, ParcelUpdate, ParcelType }\n"]}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var resource = require('../resource');
|
4
|
+
|
5
|
+
class PaymentGateways extends resource.ApiResource {
|
6
|
+
static TYPE = "payment_gateways";
|
7
|
+
async payment_methods(paymentGatewayId, params, options) {
|
8
|
+
const _paymentGatewayId = paymentGatewayId.id || paymentGatewayId;
|
9
|
+
return this.resources.fetch({ type: "payment_methods" }, `payment_gateways/${_paymentGatewayId}/payment_methods`, params, options);
|
10
|
+
}
|
11
|
+
async versions(paymentGatewayId, params, options) {
|
12
|
+
const _paymentGatewayId = paymentGatewayId.id || paymentGatewayId;
|
13
|
+
return this.resources.fetch({ type: "versions" }, `payment_gateways/${_paymentGatewayId}/versions`, params, options);
|
14
|
+
}
|
15
|
+
isPaymentGateway(resource) {
|
16
|
+
return resource.type && resource.type === PaymentGateways.TYPE;
|
17
|
+
}
|
18
|
+
relationship(id) {
|
19
|
+
return super.relationshipOneToOne(id);
|
20
|
+
}
|
21
|
+
relationshipToMany(...ids) {
|
22
|
+
return super.relationshipOneToMany(...ids);
|
23
|
+
}
|
24
|
+
type() {
|
25
|
+
return PaymentGateways.TYPE;
|
26
|
+
}
|
27
|
+
}
|
28
|
+
const instance = new PaymentGateways();
|
29
|
+
var payment_gateways_default = instance;
|
30
|
+
|
31
|
+
module.exports = payment_gateways_default;
|
32
|
+
//# sourceMappingURL=payment_gateways.cjs.map
|
33
|
+
|
34
|
+
module.exports = exports.default;
|
35
|
+
//# sourceMappingURL=payment_gateways.cjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../src/resources/payment_gateways.ts"],"names":["ApiResource"],"mappings":";;;;AAgCA,MAAM,wBAAwBA,oBAA4B,CAAA;AAAA,EAEzD,OAAgB,IAA2B,GAAA,kBAAA;AAAA,EAE3C,MAAM,eAAA,CAAgB,gBAA2C,EAAA,MAAA,EAAyC,OAAiE,EAAA;AAC1K,IAAM,MAAA,iBAAA,GAAqB,iBAAoC,EAAM,IAAA,gBAAA;AACrE,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAqB,EAAE,IAAA,EAAM,iBAAkB,EAAA,EAAG,CAAoB,iBAAA,EAAA,iBAAiB,CAAoB,gBAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACjJ,EAEA,MAAM,QAAA,CAAS,gBAA2C,EAAA,MAAA,EAAmC,OAA2D,EAAA;AACvJ,IAAM,MAAA,iBAAA,GAAqB,iBAAoC,EAAM,IAAA,gBAAA;AACrE,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAe,EAAE,IAAA,EAAM,UAAW,EAAA,EAAG,CAAoB,iBAAA,EAAA,iBAAiB,CAAa,SAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC7H,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,wBAAQ,GAAA","file":"payment_gateways.cjs","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsList } from '../query'\n\nimport type { PaymentMethod } from './payment_methods'\nimport type { Version } from './versions'\n\n\ntype PaymentGatewayType = 'payment_gateways'\ntype PaymentGatewayRel = ResourceRel & { type: PaymentGatewayType }\n\n\nexport type PaymentGatewaySort = Pick<PaymentGateway, 'id' | 'name'> & ResourceSort\n// export type PaymentGatewayFilter = Pick<PaymentGateway, 'id' | 'name'> & ResourceFilter\n\n\ninterface PaymentGateway extends Resource {\n\t\n\treadonly type: PaymentGatewayType\n\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname: string\n\n\tpayment_methods?: PaymentMethod[] | null\n\tversions?: Version[] | null\n\n}\n\n\nclass PaymentGateways extends ApiResource<PaymentGateway> {\n\n\tstatic readonly TYPE: PaymentGatewayType = 'payment_gateways' as const\n\n\tasync payment_methods(paymentGatewayId: string | PaymentGateway, params?: QueryParamsList<PaymentMethod>, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>> {\n\t\tconst _paymentGatewayId = (paymentGatewayId as PaymentGateway).id || paymentGatewayId as string\n\t\treturn this.resources.fetch<PaymentMethod>({ type: 'payment_methods' }, `payment_gateways/${_paymentGatewayId}/payment_methods`, params, options) as unknown as ListResponse<PaymentMethod>\n\t}\n\n\tasync versions(paymentGatewayId: string | PaymentGateway, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _paymentGatewayId = (paymentGatewayId as PaymentGateway).id || paymentGatewayId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `payment_gateways/${_paymentGatewayId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\n\tisPaymentGateway(resource: any): resource is PaymentGateway {\n\t\treturn resource.type && (resource.type === PaymentGateways.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): PaymentGatewayRel {\n\t\treturn super.relationshipOneToOne<PaymentGatewayRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): PaymentGatewayRel[] {\n\t\treturn super.relationshipOneToMany<PaymentGatewayRel>(...ids)\n\t}\n\n\n\ttype(): PaymentGatewayType {\n\t\treturn PaymentGateways.TYPE\n\t}\n\n}\n\n\nconst instance = new PaymentGateways()\nexport default instance\n\nexport type { PaymentGateway, PaymentGatewayType }\n"]}
|