@commercelayer/sdk 6.0.0-alfa.8 → 6.0.0-beta.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/lib/index.d.mts +7644 -0
- package/lib/index.d.ts +7644 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -0
- package/lib/index.mjs +2 -0
- package/lib/index.mjs.map +1 -0
- package/package.json +9 -15
- package/lib/cjs/api.d.ts +0 -161
- package/lib/cjs/api.js +0 -377
- package/lib/cjs/client.d.ts +0 -31
- package/lib/cjs/client.js +0 -120
- package/lib/cjs/commercelayer.d.ts +0 -154
- package/lib/cjs/commercelayer.js +0 -365
- package/lib/cjs/common.d.ts +0 -5
- package/lib/cjs/common.js +0 -12
- package/lib/cjs/config.d.ts +0 -15
- package/lib/cjs/config.js +0 -17
- package/lib/cjs/debug.d.ts +0 -3
- package/lib/cjs/debug.js +0 -17
- package/lib/cjs/error.d.ts +0 -30
- package/lib/cjs/error.js +0 -78
- package/lib/cjs/fetch.d.ts +0 -13
- package/lib/cjs/fetch.js +0 -67
- package/lib/cjs/index.d.ts +0 -7
- package/lib/cjs/index.js +0 -11
- package/lib/cjs/interceptor.d.ts +0 -37
- package/lib/cjs/interceptor.js +0 -2
- package/lib/cjs/jsonapi.d.ts +0 -6
- package/lib/cjs/jsonapi.js +0 -92
- package/lib/cjs/model.d.ts +0 -121
- package/lib/cjs/model.js +0 -2
- package/lib/cjs/query.d.ts +0 -18
- package/lib/cjs/query.js +0 -70
- package/lib/cjs/resource.d.ts +0 -86
- package/lib/cjs/resource.js +0 -172
- package/lib/cjs/resources/addresses.d.ts +0 -104
- package/lib/cjs/resources/addresses.js +0 -44
- package/lib/cjs/resources/adjustments.d.ts +0 -43
- package/lib/cjs/resources/adjustments.js +0 -32
- package/lib/cjs/resources/adyen_gateways.d.ts +0 -61
- package/lib/cjs/resources/adyen_gateways.js +0 -40
- package/lib/cjs/resources/adyen_payments.d.ts +0 -52
- package/lib/cjs/resources/adyen_payments.js +0 -43
- package/lib/cjs/resources/application.d.ts +0 -23
- package/lib/cjs/resources/application.js +0 -19
- package/lib/cjs/resources/attachments.d.ts +0 -158
- package/lib/cjs/resources/attachments.js +0 -28
- package/lib/cjs/resources/authorizations.d.ts +0 -71
- package/lib/cjs/resources/authorizations.js +0 -55
- package/lib/cjs/resources/avalara_accounts.d.ts +0 -60
- package/lib/cjs/resources/avalara_accounts.js +0 -44
- package/lib/cjs/resources/axerve_gateways.d.ts +0 -49
- package/lib/cjs/resources/axerve_gateways.js +0 -40
- package/lib/cjs/resources/axerve_payments.d.ts +0 -58
- package/lib/cjs/resources/axerve_payments.js +0 -43
- package/lib/cjs/resources/billing_info_validation_rules.d.ts +0 -40
- package/lib/cjs/resources/billing_info_validation_rules.js +0 -40
- package/lib/cjs/resources/bing_geocoders.d.ts +0 -37
- package/lib/cjs/resources/bing_geocoders.js +0 -36
- package/lib/cjs/resources/braintree_gateways.d.ts +0 -61
- package/lib/cjs/resources/braintree_gateways.js +0 -40
- package/lib/cjs/resources/braintree_payments.d.ts +0 -53
- package/lib/cjs/resources/braintree_payments.js +0 -40
- package/lib/cjs/resources/bundles.d.ts +0 -94
- package/lib/cjs/resources/bundles.js +0 -62
- package/lib/cjs/resources/buy_x_pay_y_promotions.d.ts +0 -138
- package/lib/cjs/resources/buy_x_pay_y_promotions.js +0 -82
- package/lib/cjs/resources/captures.d.ts +0 -61
- package/lib/cjs/resources/captures.js +0 -52
- package/lib/cjs/resources/carrier_accounts.d.ts +0 -31
- package/lib/cjs/resources/carrier_accounts.js +0 -31
- package/lib/cjs/resources/checkout_com_gateways.d.ts +0 -50
- package/lib/cjs/resources/checkout_com_gateways.js +0 -40
- package/lib/cjs/resources/checkout_com_payments.d.ts +0 -66
- package/lib/cjs/resources/checkout_com_payments.js +0 -46
- package/lib/cjs/resources/cleanups.d.ts +0 -41
- package/lib/cjs/resources/cleanups.js +0 -33
- package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +0 -68
- package/lib/cjs/resources/coupon_codes_promotion_rules.js +0 -36
- package/lib/cjs/resources/coupon_recipients.d.ts +0 -49
- package/lib/cjs/resources/coupon_recipients.js +0 -40
- package/lib/cjs/resources/coupons.d.ts +0 -72
- package/lib/cjs/resources/coupons.js +0 -48
- package/lib/cjs/resources/custom_promotion_rules.d.ts +0 -63
- package/lib/cjs/resources/custom_promotion_rules.js +0 -32
- package/lib/cjs/resources/customer_addresses.d.ts +0 -51
- package/lib/cjs/resources/customer_addresses.js +0 -44
- package/lib/cjs/resources/customer_groups.d.ts +0 -41
- package/lib/cjs/resources/customer_groups.js +0 -44
- package/lib/cjs/resources/customer_password_resets.d.ts +0 -39
- package/lib/cjs/resources/customer_password_resets.js +0 -39
- package/lib/cjs/resources/customer_payment_sources.d.ts +0 -87
- package/lib/cjs/resources/customer_payment_sources.js +0 -40
- package/lib/cjs/resources/customer_subscriptions.d.ts +0 -36
- package/lib/cjs/resources/customer_subscriptions.js +0 -40
- package/lib/cjs/resources/customers.d.ts +0 -77
- package/lib/cjs/resources/customers.js +0 -72
- package/lib/cjs/resources/delivery_lead_times.d.ts +0 -56
- package/lib/cjs/resources/delivery_lead_times.js +0 -44
- package/lib/cjs/resources/event_callbacks.d.ts +0 -26
- package/lib/cjs/resources/event_callbacks.js +0 -23
- package/lib/cjs/resources/events.d.ts +0 -26
- package/lib/cjs/resources/events.js +0 -27
- package/lib/cjs/resources/exports.d.ts +0 -42
- package/lib/cjs/resources/exports.js +0 -29
- package/lib/cjs/resources/external_gateways.d.ts +0 -58
- package/lib/cjs/resources/external_gateways.js +0 -43
- package/lib/cjs/resources/external_payments.d.ts +0 -49
- package/lib/cjs/resources/external_payments.js +0 -44
- package/lib/cjs/resources/external_promotions.d.ts +0 -137
- package/lib/cjs/resources/external_promotions.js +0 -85
- package/lib/cjs/resources/external_tax_calculators.d.ts +0 -46
- package/lib/cjs/resources/external_tax_calculators.js +0 -43
- package/lib/cjs/resources/fixed_amount_promotions.d.ts +0 -134
- package/lib/cjs/resources/fixed_amount_promotions.js +0 -82
- package/lib/cjs/resources/fixed_price_promotions.d.ts +0 -134
- package/lib/cjs/resources/fixed_price_promotions.js +0 -82
- package/lib/cjs/resources/free_gift_promotions.d.ts +0 -132
- package/lib/cjs/resources/free_gift_promotions.js +0 -82
- package/lib/cjs/resources/free_shipping_promotions.d.ts +0 -126
- package/lib/cjs/resources/free_shipping_promotions.js +0 -78
- package/lib/cjs/resources/geocoders.d.ts +0 -26
- package/lib/cjs/resources/geocoders.js +0 -27
- package/lib/cjs/resources/gift_card_recipients.d.ts +0 -49
- package/lib/cjs/resources/gift_card_recipients.js +0 -40
- package/lib/cjs/resources/gift_cards.d.ts +0 -105
- package/lib/cjs/resources/gift_cards.js +0 -64
- package/lib/cjs/resources/google_geocoders.d.ts +0 -37
- package/lib/cjs/resources/google_geocoders.js +0 -36
- package/lib/cjs/resources/imports.d.ts +0 -45
- package/lib/cjs/resources/imports.js +0 -29
- package/lib/cjs/resources/in_stock_subscriptions.d.ts +0 -69
- package/lib/cjs/resources/in_stock_subscriptions.js +0 -54
- package/lib/cjs/resources/inventory_models.d.ts +0 -56
- package/lib/cjs/resources/inventory_models.js +0 -44
- package/lib/cjs/resources/inventory_return_locations.d.ts +0 -48
- package/lib/cjs/resources/inventory_return_locations.js +0 -40
- package/lib/cjs/resources/inventory_stock_locations.d.ts +0 -51
- package/lib/cjs/resources/inventory_stock_locations.js +0 -40
- package/lib/cjs/resources/klarna_gateways.d.ts +0 -49
- package/lib/cjs/resources/klarna_gateways.js +0 -40
- package/lib/cjs/resources/klarna_payments.d.ts +0 -52
- package/lib/cjs/resources/klarna_payments.js +0 -43
- package/lib/cjs/resources/line_item_options.d.ts +0 -70
- package/lib/cjs/resources/line_item_options.js +0 -44
- package/lib/cjs/resources/line_items.d.ts +0 -171
- package/lib/cjs/resources/line_items.js +0 -69
- package/lib/cjs/resources/manual_gateways.d.ts +0 -35
- package/lib/cjs/resources/manual_gateways.js +0 -36
- package/lib/cjs/resources/manual_tax_calculators.d.ts +0 -46
- package/lib/cjs/resources/manual_tax_calculators.js +0 -44
- package/lib/cjs/resources/markets.d.ts +0 -108
- package/lib/cjs/resources/markets.js +0 -66
- package/lib/cjs/resources/merchants.d.ts +0 -43
- package/lib/cjs/resources/merchants.js +0 -40
- package/lib/cjs/resources/order_amount_promotion_rules.d.ts +0 -68
- package/lib/cjs/resources/order_amount_promotion_rules.js +0 -32
- package/lib/cjs/resources/order_copies.d.ts +0 -52
- package/lib/cjs/resources/order_copies.js +0 -44
- package/lib/cjs/resources/order_factories.d.ts +0 -35
- package/lib/cjs/resources/order_factories.js +0 -31
- package/lib/cjs/resources/order_subscription_items.d.ts +0 -69
- package/lib/cjs/resources/order_subscription_items.js +0 -36
- package/lib/cjs/resources/order_subscriptions.d.ts +0 -97
- package/lib/cjs/resources/order_subscriptions.js +0 -81
- package/lib/cjs/resources/order_validation_rules.d.ts +0 -28
- package/lib/cjs/resources/order_validation_rules.js +0 -31
- package/lib/cjs/resources/orders.d.ts +0 -390
- package/lib/cjs/resources/orders.js +0 -239
- package/lib/cjs/resources/organization.d.ts +0 -35
- package/lib/cjs/resources/organization.js +0 -19
- package/lib/cjs/resources/packages.d.ts +0 -61
- package/lib/cjs/resources/packages.js +0 -44
- package/lib/cjs/resources/parcel_line_items.d.ts +0 -48
- package/lib/cjs/resources/parcel_line_items.js +0 -40
- package/lib/cjs/resources/parcels.d.ts +0 -127
- package/lib/cjs/resources/parcels.js +0 -52
- package/lib/cjs/resources/payment_gateways.d.ts +0 -26
- package/lib/cjs/resources/payment_gateways.js +0 -27
- package/lib/cjs/resources/payment_methods.d.ts +0 -84
- package/lib/cjs/resources/payment_methods.js +0 -50
- package/lib/cjs/resources/payment_options.d.ts +0 -45
- package/lib/cjs/resources/payment_options.js +0 -36
- package/lib/cjs/resources/paypal_gateways.d.ts +0 -42
- package/lib/cjs/resources/paypal_gateways.js +0 -40
- package/lib/cjs/resources/paypal_payments.d.ts +0 -57
- package/lib/cjs/resources/paypal_payments.js +0 -40
- package/lib/cjs/resources/percentage_discount_promotions.d.ts +0 -132
- package/lib/cjs/resources/percentage_discount_promotions.js +0 -82
- package/lib/cjs/resources/price_frequency_tiers.d.ts +0 -54
- package/lib/cjs/resources/price_frequency_tiers.js +0 -44
- package/lib/cjs/resources/price_lists.d.ts +0 -47
- package/lib/cjs/resources/price_lists.js +0 -40
- package/lib/cjs/resources/price_tiers.d.ts +0 -33
- package/lib/cjs/resources/price_tiers.js +0 -31
- package/lib/cjs/resources/price_volume_tiers.d.ts +0 -54
- package/lib/cjs/resources/price_volume_tiers.js +0 -44
- package/lib/cjs/resources/prices.d.ts +0 -76
- package/lib/cjs/resources/prices.js +0 -56
- package/lib/cjs/resources/promotion_rules.d.ts +0 -30
- package/lib/cjs/resources/promotion_rules.js +0 -23
- package/lib/cjs/resources/promotions.d.ts +0 -64
- package/lib/cjs/resources/promotions.js +0 -63
- package/lib/cjs/resources/recurring_order_copies.d.ts +0 -54
- package/lib/cjs/resources/recurring_order_copies.js +0 -44
- package/lib/cjs/resources/refunds.d.ts +0 -45
- package/lib/cjs/resources/refunds.js +0 -39
- package/lib/cjs/resources/reserved_stocks.d.ts +0 -29
- package/lib/cjs/resources/reserved_stocks.js +0 -31
- package/lib/cjs/resources/resource_errors.d.ts +0 -23
- package/lib/cjs/resources/resource_errors.js +0 -19
- package/lib/cjs/resources/return_line_items.d.ts +0 -53
- package/lib/cjs/resources/return_line_items.js +0 -39
- package/lib/cjs/resources/returns.d.ts +0 -97
- package/lib/cjs/resources/returns.js +0 -95
- package/lib/cjs/resources/satispay_gateways.d.ts +0 -47
- package/lib/cjs/resources/satispay_gateways.js +0 -40
- package/lib/cjs/resources/satispay_payments.d.ts +0 -54
- package/lib/cjs/resources/satispay_payments.js +0 -43
- package/lib/cjs/resources/shipments.d.ts +0 -152
- package/lib/cjs/resources/shipments.js +0 -133
- package/lib/cjs/resources/shipping_categories.d.ts +0 -41
- package/lib/cjs/resources/shipping_categories.js +0 -40
- package/lib/cjs/resources/shipping_method_tiers.d.ts +0 -33
- package/lib/cjs/resources/shipping_method_tiers.js +0 -31
- package/lib/cjs/resources/shipping_methods.d.ts +0 -126
- package/lib/cjs/resources/shipping_methods.js +0 -73
- package/lib/cjs/resources/shipping_weight_tiers.d.ts +0 -51
- package/lib/cjs/resources/shipping_weight_tiers.js +0 -40
- package/lib/cjs/resources/shipping_zones.d.ts +0 -53
- package/lib/cjs/resources/shipping_zones.js +0 -36
- package/lib/cjs/resources/sku_list_items.d.ts +0 -52
- package/lib/cjs/resources/sku_list_items.js +0 -40
- package/lib/cjs/resources/sku_list_promotion_rules.d.ts +0 -77
- package/lib/cjs/resources/sku_list_promotion_rules.js +0 -40
- package/lib/cjs/resources/sku_lists.d.ts +0 -65
- package/lib/cjs/resources/sku_lists.js +0 -52
- package/lib/cjs/resources/sku_options.d.ts +0 -72
- package/lib/cjs/resources/sku_options.js +0 -48
- package/lib/cjs/resources/skus.d.ts +0 -97
- package/lib/cjs/resources/skus.js +0 -68
- package/lib/cjs/resources/stock_items.d.ts +0 -60
- package/lib/cjs/resources/stock_items.js +0 -52
- package/lib/cjs/resources/stock_line_items.d.ts +0 -74
- package/lib/cjs/resources/stock_line_items.js +0 -57
- package/lib/cjs/resources/stock_locations.d.ts +0 -65
- package/lib/cjs/resources/stock_locations.js +0 -56
- package/lib/cjs/resources/stock_reservations.d.ts +0 -52
- package/lib/cjs/resources/stock_reservations.js +0 -51
- package/lib/cjs/resources/stock_transfers.d.ts +0 -87
- package/lib/cjs/resources/stock_transfers.js +0 -74
- package/lib/cjs/resources/stripe_gateways.d.ts +0 -46
- package/lib/cjs/resources/stripe_gateways.js +0 -40
- package/lib/cjs/resources/stripe_payments.d.ts +0 -63
- package/lib/cjs/resources/stripe_payments.js +0 -46
- package/lib/cjs/resources/subscription_models.d.ts +0 -50
- package/lib/cjs/resources/subscription_models.js +0 -40
- package/lib/cjs/resources/tags.d.ts +0 -29
- package/lib/cjs/resources/tags.js +0 -28
- package/lib/cjs/resources/tax_calculators.d.ts +0 -29
- package/lib/cjs/resources/tax_calculators.js +0 -31
- package/lib/cjs/resources/tax_categories.d.ts +0 -64
- package/lib/cjs/resources/tax_categories.js +0 -40
- package/lib/cjs/resources/tax_rules.d.ts +0 -74
- package/lib/cjs/resources/tax_rules.js +0 -36
- package/lib/cjs/resources/taxjar_accounts.d.ts +0 -48
- package/lib/cjs/resources/taxjar_accounts.js +0 -44
- package/lib/cjs/resources/transactions.d.ts +0 -42
- package/lib/cjs/resources/transactions.js +0 -35
- package/lib/cjs/resources/versions.d.ts +0 -23
- package/lib/cjs/resources/versions.js +0 -19
- package/lib/cjs/resources/voids.d.ts +0 -45
- package/lib/cjs/resources/voids.js +0 -39
- package/lib/cjs/resources/webhooks.d.ts +0 -56
- package/lib/cjs/resources/webhooks.js +0 -45
- package/lib/cjs/resources/wire_transfers.d.ts +0 -38
- package/lib/cjs/resources/wire_transfers.js +0 -36
- package/lib/cjs/static.d.ts +0 -12
- package/lib/cjs/static.js +0 -50
- package/lib/cjs/util.d.ts +0 -9
- package/lib/cjs/util.js +0 -15
- package/lib/esm/api.d.ts +0 -161
- package/lib/esm/api.js +0 -248
- package/lib/esm/client.d.ts +0 -31
- package/lib/esm/client.js +0 -102
- package/lib/esm/commercelayer.d.ts +0 -154
- package/lib/esm/commercelayer.js +0 -323
- package/lib/esm/common.d.ts +0 -5
- package/lib/esm/common.js +0 -8
- package/lib/esm/config.d.ts +0 -15
- package/lib/esm/config.js +0 -15
- package/lib/esm/debug.d.ts +0 -3
- package/lib/esm/debug.js +0 -15
- package/lib/esm/error.d.ts +0 -30
- package/lib/esm/error.js +0 -78
- package/lib/esm/fetch.d.ts +0 -13
- package/lib/esm/fetch.js +0 -46
- package/lib/esm/index.d.ts +0 -7
- package/lib/esm/index.js +0 -2
- package/lib/esm/interceptor.d.ts +0 -37
- package/lib/esm/interceptor.js +0 -1
- package/lib/esm/jsonapi.d.ts +0 -6
- package/lib/esm/jsonapi.js +0 -85
- package/lib/esm/model.d.ts +0 -121
- package/lib/esm/model.js +0 -1
- package/lib/esm/query.d.ts +0 -18
- package/lib/esm/query.js +0 -62
- package/lib/esm/resource.d.ts +0 -86
- package/lib/esm/resource.js +0 -155
- package/lib/esm/resources/addresses.d.ts +0 -104
- package/lib/esm/resources/addresses.js +0 -42
- package/lib/esm/resources/adjustments.d.ts +0 -43
- package/lib/esm/resources/adjustments.js +0 -30
- package/lib/esm/resources/adyen_gateways.d.ts +0 -61
- package/lib/esm/resources/adyen_gateways.js +0 -38
- package/lib/esm/resources/adyen_payments.d.ts +0 -52
- package/lib/esm/resources/adyen_payments.js +0 -41
- package/lib/esm/resources/application.d.ts +0 -23
- package/lib/esm/resources/application.js +0 -17
- package/lib/esm/resources/attachments.d.ts +0 -158
- package/lib/esm/resources/attachments.js +0 -26
- package/lib/esm/resources/authorizations.d.ts +0 -71
- package/lib/esm/resources/authorizations.js +0 -53
- package/lib/esm/resources/avalara_accounts.d.ts +0 -60
- package/lib/esm/resources/avalara_accounts.js +0 -42
- package/lib/esm/resources/axerve_gateways.d.ts +0 -49
- package/lib/esm/resources/axerve_gateways.js +0 -38
- package/lib/esm/resources/axerve_payments.d.ts +0 -58
- package/lib/esm/resources/axerve_payments.js +0 -41
- package/lib/esm/resources/billing_info_validation_rules.d.ts +0 -40
- package/lib/esm/resources/billing_info_validation_rules.js +0 -38
- package/lib/esm/resources/bing_geocoders.d.ts +0 -37
- package/lib/esm/resources/bing_geocoders.js +0 -34
- package/lib/esm/resources/braintree_gateways.d.ts +0 -61
- package/lib/esm/resources/braintree_gateways.js +0 -38
- package/lib/esm/resources/braintree_payments.d.ts +0 -53
- package/lib/esm/resources/braintree_payments.js +0 -38
- package/lib/esm/resources/bundles.d.ts +0 -94
- package/lib/esm/resources/bundles.js +0 -60
- package/lib/esm/resources/buy_x_pay_y_promotions.d.ts +0 -138
- package/lib/esm/resources/buy_x_pay_y_promotions.js +0 -80
- package/lib/esm/resources/captures.d.ts +0 -61
- package/lib/esm/resources/captures.js +0 -50
- package/lib/esm/resources/carrier_accounts.d.ts +0 -31
- package/lib/esm/resources/carrier_accounts.js +0 -29
- package/lib/esm/resources/checkout_com_gateways.d.ts +0 -50
- package/lib/esm/resources/checkout_com_gateways.js +0 -38
- package/lib/esm/resources/checkout_com_payments.d.ts +0 -66
- package/lib/esm/resources/checkout_com_payments.js +0 -44
- package/lib/esm/resources/cleanups.d.ts +0 -41
- package/lib/esm/resources/cleanups.js +0 -31
- package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +0 -68
- package/lib/esm/resources/coupon_codes_promotion_rules.js +0 -34
- package/lib/esm/resources/coupon_recipients.d.ts +0 -49
- package/lib/esm/resources/coupon_recipients.js +0 -38
- package/lib/esm/resources/coupons.d.ts +0 -72
- package/lib/esm/resources/coupons.js +0 -46
- package/lib/esm/resources/custom_promotion_rules.d.ts +0 -63
- package/lib/esm/resources/custom_promotion_rules.js +0 -30
- package/lib/esm/resources/customer_addresses.d.ts +0 -51
- package/lib/esm/resources/customer_addresses.js +0 -42
- package/lib/esm/resources/customer_groups.d.ts +0 -41
- package/lib/esm/resources/customer_groups.js +0 -42
- package/lib/esm/resources/customer_password_resets.d.ts +0 -39
- package/lib/esm/resources/customer_password_resets.js +0 -37
- package/lib/esm/resources/customer_payment_sources.d.ts +0 -87
- package/lib/esm/resources/customer_payment_sources.js +0 -38
- package/lib/esm/resources/customer_subscriptions.d.ts +0 -36
- package/lib/esm/resources/customer_subscriptions.js +0 -38
- package/lib/esm/resources/customers.d.ts +0 -77
- package/lib/esm/resources/customers.js +0 -70
- package/lib/esm/resources/delivery_lead_times.d.ts +0 -56
- package/lib/esm/resources/delivery_lead_times.js +0 -42
- package/lib/esm/resources/event_callbacks.d.ts +0 -26
- package/lib/esm/resources/event_callbacks.js +0 -21
- package/lib/esm/resources/events.d.ts +0 -26
- package/lib/esm/resources/events.js +0 -25
- package/lib/esm/resources/exports.d.ts +0 -42
- package/lib/esm/resources/exports.js +0 -27
- package/lib/esm/resources/external_gateways.d.ts +0 -58
- package/lib/esm/resources/external_gateways.js +0 -41
- package/lib/esm/resources/external_payments.d.ts +0 -49
- package/lib/esm/resources/external_payments.js +0 -42
- package/lib/esm/resources/external_promotions.d.ts +0 -137
- package/lib/esm/resources/external_promotions.js +0 -83
- package/lib/esm/resources/external_tax_calculators.d.ts +0 -46
- package/lib/esm/resources/external_tax_calculators.js +0 -41
- package/lib/esm/resources/fixed_amount_promotions.d.ts +0 -134
- package/lib/esm/resources/fixed_amount_promotions.js +0 -80
- package/lib/esm/resources/fixed_price_promotions.d.ts +0 -134
- package/lib/esm/resources/fixed_price_promotions.js +0 -80
- package/lib/esm/resources/free_gift_promotions.d.ts +0 -132
- package/lib/esm/resources/free_gift_promotions.js +0 -80
- package/lib/esm/resources/free_shipping_promotions.d.ts +0 -126
- package/lib/esm/resources/free_shipping_promotions.js +0 -76
- package/lib/esm/resources/geocoders.d.ts +0 -26
- package/lib/esm/resources/geocoders.js +0 -25
- package/lib/esm/resources/gift_card_recipients.d.ts +0 -49
- package/lib/esm/resources/gift_card_recipients.js +0 -38
- package/lib/esm/resources/gift_cards.d.ts +0 -105
- package/lib/esm/resources/gift_cards.js +0 -62
- package/lib/esm/resources/google_geocoders.d.ts +0 -37
- package/lib/esm/resources/google_geocoders.js +0 -34
- package/lib/esm/resources/imports.d.ts +0 -45
- package/lib/esm/resources/imports.js +0 -27
- package/lib/esm/resources/in_stock_subscriptions.d.ts +0 -69
- package/lib/esm/resources/in_stock_subscriptions.js +0 -52
- package/lib/esm/resources/inventory_models.d.ts +0 -56
- package/lib/esm/resources/inventory_models.js +0 -42
- package/lib/esm/resources/inventory_return_locations.d.ts +0 -48
- package/lib/esm/resources/inventory_return_locations.js +0 -38
- package/lib/esm/resources/inventory_stock_locations.d.ts +0 -51
- package/lib/esm/resources/inventory_stock_locations.js +0 -38
- package/lib/esm/resources/klarna_gateways.d.ts +0 -49
- package/lib/esm/resources/klarna_gateways.js +0 -38
- package/lib/esm/resources/klarna_payments.d.ts +0 -52
- package/lib/esm/resources/klarna_payments.js +0 -41
- package/lib/esm/resources/line_item_options.d.ts +0 -70
- package/lib/esm/resources/line_item_options.js +0 -42
- package/lib/esm/resources/line_items.d.ts +0 -171
- package/lib/esm/resources/line_items.js +0 -67
- package/lib/esm/resources/manual_gateways.d.ts +0 -35
- package/lib/esm/resources/manual_gateways.js +0 -34
- package/lib/esm/resources/manual_tax_calculators.d.ts +0 -46
- package/lib/esm/resources/manual_tax_calculators.js +0 -42
- package/lib/esm/resources/markets.d.ts +0 -108
- package/lib/esm/resources/markets.js +0 -64
- package/lib/esm/resources/merchants.d.ts +0 -43
- package/lib/esm/resources/merchants.js +0 -38
- package/lib/esm/resources/order_amount_promotion_rules.d.ts +0 -68
- package/lib/esm/resources/order_amount_promotion_rules.js +0 -30
- package/lib/esm/resources/order_copies.d.ts +0 -52
- package/lib/esm/resources/order_copies.js +0 -42
- package/lib/esm/resources/order_factories.d.ts +0 -35
- package/lib/esm/resources/order_factories.js +0 -29
- package/lib/esm/resources/order_subscription_items.d.ts +0 -69
- package/lib/esm/resources/order_subscription_items.js +0 -34
- package/lib/esm/resources/order_subscriptions.d.ts +0 -97
- package/lib/esm/resources/order_subscriptions.js +0 -79
- package/lib/esm/resources/order_validation_rules.d.ts +0 -28
- package/lib/esm/resources/order_validation_rules.js +0 -29
- package/lib/esm/resources/orders.d.ts +0 -390
- package/lib/esm/resources/orders.js +0 -237
- package/lib/esm/resources/organization.d.ts +0 -35
- package/lib/esm/resources/organization.js +0 -17
- package/lib/esm/resources/packages.d.ts +0 -61
- package/lib/esm/resources/packages.js +0 -42
- package/lib/esm/resources/parcel_line_items.d.ts +0 -48
- package/lib/esm/resources/parcel_line_items.js +0 -38
- package/lib/esm/resources/parcels.d.ts +0 -127
- package/lib/esm/resources/parcels.js +0 -50
- package/lib/esm/resources/payment_gateways.d.ts +0 -26
- package/lib/esm/resources/payment_gateways.js +0 -25
- package/lib/esm/resources/payment_methods.d.ts +0 -84
- package/lib/esm/resources/payment_methods.js +0 -48
- package/lib/esm/resources/payment_options.d.ts +0 -45
- package/lib/esm/resources/payment_options.js +0 -34
- package/lib/esm/resources/paypal_gateways.d.ts +0 -42
- package/lib/esm/resources/paypal_gateways.js +0 -38
- package/lib/esm/resources/paypal_payments.d.ts +0 -57
- package/lib/esm/resources/paypal_payments.js +0 -38
- package/lib/esm/resources/percentage_discount_promotions.d.ts +0 -132
- package/lib/esm/resources/percentage_discount_promotions.js +0 -80
- package/lib/esm/resources/price_frequency_tiers.d.ts +0 -54
- package/lib/esm/resources/price_frequency_tiers.js +0 -42
- package/lib/esm/resources/price_lists.d.ts +0 -47
- package/lib/esm/resources/price_lists.js +0 -38
- package/lib/esm/resources/price_tiers.d.ts +0 -33
- package/lib/esm/resources/price_tiers.js +0 -29
- package/lib/esm/resources/price_volume_tiers.d.ts +0 -54
- package/lib/esm/resources/price_volume_tiers.js +0 -42
- package/lib/esm/resources/prices.d.ts +0 -76
- package/lib/esm/resources/prices.js +0 -54
- package/lib/esm/resources/promotion_rules.d.ts +0 -30
- package/lib/esm/resources/promotion_rules.js +0 -21
- package/lib/esm/resources/promotions.d.ts +0 -64
- package/lib/esm/resources/promotions.js +0 -61
- package/lib/esm/resources/recurring_order_copies.d.ts +0 -54
- package/lib/esm/resources/recurring_order_copies.js +0 -42
- package/lib/esm/resources/refunds.d.ts +0 -45
- package/lib/esm/resources/refunds.js +0 -37
- package/lib/esm/resources/reserved_stocks.d.ts +0 -29
- package/lib/esm/resources/reserved_stocks.js +0 -29
- package/lib/esm/resources/resource_errors.d.ts +0 -23
- package/lib/esm/resources/resource_errors.js +0 -17
- package/lib/esm/resources/return_line_items.d.ts +0 -53
- package/lib/esm/resources/return_line_items.js +0 -37
- package/lib/esm/resources/returns.d.ts +0 -97
- package/lib/esm/resources/returns.js +0 -93
- package/lib/esm/resources/satispay_gateways.d.ts +0 -47
- package/lib/esm/resources/satispay_gateways.js +0 -38
- package/lib/esm/resources/satispay_payments.d.ts +0 -54
- package/lib/esm/resources/satispay_payments.js +0 -41
- package/lib/esm/resources/shipments.d.ts +0 -152
- package/lib/esm/resources/shipments.js +0 -131
- package/lib/esm/resources/shipping_categories.d.ts +0 -41
- package/lib/esm/resources/shipping_categories.js +0 -38
- package/lib/esm/resources/shipping_method_tiers.d.ts +0 -33
- package/lib/esm/resources/shipping_method_tiers.js +0 -29
- package/lib/esm/resources/shipping_methods.d.ts +0 -126
- package/lib/esm/resources/shipping_methods.js +0 -71
- package/lib/esm/resources/shipping_weight_tiers.d.ts +0 -51
- package/lib/esm/resources/shipping_weight_tiers.js +0 -38
- package/lib/esm/resources/shipping_zones.d.ts +0 -53
- package/lib/esm/resources/shipping_zones.js +0 -34
- package/lib/esm/resources/sku_list_items.d.ts +0 -52
- package/lib/esm/resources/sku_list_items.js +0 -38
- package/lib/esm/resources/sku_list_promotion_rules.d.ts +0 -77
- package/lib/esm/resources/sku_list_promotion_rules.js +0 -38
- package/lib/esm/resources/sku_lists.d.ts +0 -65
- package/lib/esm/resources/sku_lists.js +0 -50
- package/lib/esm/resources/sku_options.d.ts +0 -72
- package/lib/esm/resources/sku_options.js +0 -46
- package/lib/esm/resources/skus.d.ts +0 -97
- package/lib/esm/resources/skus.js +0 -66
- package/lib/esm/resources/stock_items.d.ts +0 -60
- package/lib/esm/resources/stock_items.js +0 -50
- package/lib/esm/resources/stock_line_items.d.ts +0 -74
- package/lib/esm/resources/stock_line_items.js +0 -55
- package/lib/esm/resources/stock_locations.d.ts +0 -65
- package/lib/esm/resources/stock_locations.js +0 -54
- package/lib/esm/resources/stock_reservations.d.ts +0 -52
- package/lib/esm/resources/stock_reservations.js +0 -49
- package/lib/esm/resources/stock_transfers.d.ts +0 -87
- package/lib/esm/resources/stock_transfers.js +0 -72
- package/lib/esm/resources/stripe_gateways.d.ts +0 -46
- package/lib/esm/resources/stripe_gateways.js +0 -38
- package/lib/esm/resources/stripe_payments.d.ts +0 -63
- package/lib/esm/resources/stripe_payments.js +0 -44
- package/lib/esm/resources/subscription_models.d.ts +0 -50
- package/lib/esm/resources/subscription_models.js +0 -38
- package/lib/esm/resources/tags.d.ts +0 -29
- package/lib/esm/resources/tags.js +0 -26
- package/lib/esm/resources/tax_calculators.d.ts +0 -29
- package/lib/esm/resources/tax_calculators.js +0 -29
- package/lib/esm/resources/tax_categories.d.ts +0 -64
- package/lib/esm/resources/tax_categories.js +0 -38
- package/lib/esm/resources/tax_rules.d.ts +0 -74
- package/lib/esm/resources/tax_rules.js +0 -34
- package/lib/esm/resources/taxjar_accounts.d.ts +0 -48
- package/lib/esm/resources/taxjar_accounts.js +0 -42
- package/lib/esm/resources/transactions.d.ts +0 -42
- package/lib/esm/resources/transactions.js +0 -33
- package/lib/esm/resources/versions.d.ts +0 -23
- package/lib/esm/resources/versions.js +0 -17
- package/lib/esm/resources/voids.d.ts +0 -45
- package/lib/esm/resources/voids.js +0 -37
- package/lib/esm/resources/webhooks.d.ts +0 -56
- package/lib/esm/resources/webhooks.js +0 -43
- package/lib/esm/resources/wire_transfers.d.ts +0 -38
- package/lib/esm/resources/wire_transfers.js +0 -34
- package/lib/esm/static.d.ts +0 -12
- package/lib/esm/static.js +0 -24
- package/lib/esm/util.d.ts +0 -9
- package/lib/esm/util.js +0 -11
- package/lib/tsconfig.esm.tsbuildinfo +0 -1
- package/lib/tsconfig.tsbuildinfo +0 -1
@@ -1,237 +0,0 @@
|
|
1
|
-
import { ApiResource } from '../resource';
|
2
|
-
class Orders extends ApiResource {
|
3
|
-
static TYPE = 'orders';
|
4
|
-
async create(resource, params, options) {
|
5
|
-
return this.resources.create({ ...resource, type: Orders.TYPE }, params, options);
|
6
|
-
}
|
7
|
-
async update(resource, params, options) {
|
8
|
-
return this.resources.update({ ...resource, type: Orders.TYPE }, params, options);
|
9
|
-
}
|
10
|
-
async delete(id, options) {
|
11
|
-
await this.resources.delete((typeof id === 'string') ? { id, type: Orders.TYPE } : id, options);
|
12
|
-
}
|
13
|
-
async market(orderId, params, options) {
|
14
|
-
const _orderId = orderId.id || orderId;
|
15
|
-
return this.resources.fetch({ type: 'markets' }, `orders/${_orderId}/market`, params, options);
|
16
|
-
}
|
17
|
-
async customer(orderId, params, options) {
|
18
|
-
const _orderId = orderId.id || orderId;
|
19
|
-
return this.resources.fetch({ type: 'customers' }, `orders/${_orderId}/customer`, params, options);
|
20
|
-
}
|
21
|
-
async shipping_address(orderId, params, options) {
|
22
|
-
const _orderId = orderId.id || orderId;
|
23
|
-
return this.resources.fetch({ type: 'addresses' }, `orders/${_orderId}/shipping_address`, params, options);
|
24
|
-
}
|
25
|
-
async billing_address(orderId, params, options) {
|
26
|
-
const _orderId = orderId.id || orderId;
|
27
|
-
return this.resources.fetch({ type: 'addresses' }, `orders/${_orderId}/billing_address`, params, options);
|
28
|
-
}
|
29
|
-
async available_payment_methods(orderId, params, options) {
|
30
|
-
const _orderId = orderId.id || orderId;
|
31
|
-
return this.resources.fetch({ type: 'payment_methods' }, `orders/${_orderId}/available_payment_methods`, params, options);
|
32
|
-
}
|
33
|
-
async available_customer_payment_sources(orderId, params, options) {
|
34
|
-
const _orderId = orderId.id || orderId;
|
35
|
-
return this.resources.fetch({ type: 'customer_payment_sources' }, `orders/${_orderId}/available_customer_payment_sources`, params, options);
|
36
|
-
}
|
37
|
-
async available_free_skus(orderId, params, options) {
|
38
|
-
const _orderId = orderId.id || orderId;
|
39
|
-
return this.resources.fetch({ type: 'skus' }, `orders/${_orderId}/available_free_skus`, params, options);
|
40
|
-
}
|
41
|
-
async available_free_bundles(orderId, params, options) {
|
42
|
-
const _orderId = orderId.id || orderId;
|
43
|
-
return this.resources.fetch({ type: 'bundles' }, `orders/${_orderId}/available_free_bundles`, params, options);
|
44
|
-
}
|
45
|
-
async payment_method(orderId, params, options) {
|
46
|
-
const _orderId = orderId.id || orderId;
|
47
|
-
return this.resources.fetch({ type: 'payment_methods' }, `orders/${_orderId}/payment_method`, params, options);
|
48
|
-
}
|
49
|
-
async line_items(orderId, params, options) {
|
50
|
-
const _orderId = orderId.id || orderId;
|
51
|
-
return this.resources.fetch({ type: 'line_items' }, `orders/${_orderId}/line_items`, params, options);
|
52
|
-
}
|
53
|
-
async line_item_options(orderId, params, options) {
|
54
|
-
const _orderId = orderId.id || orderId;
|
55
|
-
return this.resources.fetch({ type: 'line_item_options' }, `orders/${_orderId}/line_item_options`, params, options);
|
56
|
-
}
|
57
|
-
async stock_reservations(orderId, params, options) {
|
58
|
-
const _orderId = orderId.id || orderId;
|
59
|
-
return this.resources.fetch({ type: 'stock_reservations' }, `orders/${_orderId}/stock_reservations`, params, options);
|
60
|
-
}
|
61
|
-
async stock_line_items(orderId, params, options) {
|
62
|
-
const _orderId = orderId.id || orderId;
|
63
|
-
return this.resources.fetch({ type: 'stock_line_items' }, `orders/${_orderId}/stock_line_items`, params, options);
|
64
|
-
}
|
65
|
-
async stock_transfers(orderId, params, options) {
|
66
|
-
const _orderId = orderId.id || orderId;
|
67
|
-
return this.resources.fetch({ type: 'stock_transfers' }, `orders/${_orderId}/stock_transfers`, params, options);
|
68
|
-
}
|
69
|
-
async shipments(orderId, params, options) {
|
70
|
-
const _orderId = orderId.id || orderId;
|
71
|
-
return this.resources.fetch({ type: 'shipments' }, `orders/${_orderId}/shipments`, params, options);
|
72
|
-
}
|
73
|
-
async payment_options(orderId, params, options) {
|
74
|
-
const _orderId = orderId.id || orderId;
|
75
|
-
return this.resources.fetch({ type: 'payment_options' }, `orders/${_orderId}/payment_options`, params, options);
|
76
|
-
}
|
77
|
-
async authorizations(orderId, params, options) {
|
78
|
-
const _orderId = orderId.id || orderId;
|
79
|
-
return this.resources.fetch({ type: 'authorizations' }, `orders/${_orderId}/authorizations`, params, options);
|
80
|
-
}
|
81
|
-
async captures(orderId, params, options) {
|
82
|
-
const _orderId = orderId.id || orderId;
|
83
|
-
return this.resources.fetch({ type: 'captures' }, `orders/${_orderId}/captures`, params, options);
|
84
|
-
}
|
85
|
-
async voids(orderId, params, options) {
|
86
|
-
const _orderId = orderId.id || orderId;
|
87
|
-
return this.resources.fetch({ type: 'voids' }, `orders/${_orderId}/voids`, params, options);
|
88
|
-
}
|
89
|
-
async refunds(orderId, params, options) {
|
90
|
-
const _orderId = orderId.id || orderId;
|
91
|
-
return this.resources.fetch({ type: 'refunds' }, `orders/${_orderId}/refunds`, params, options);
|
92
|
-
}
|
93
|
-
async returns(orderId, params, options) {
|
94
|
-
const _orderId = orderId.id || orderId;
|
95
|
-
return this.resources.fetch({ type: 'returns' }, `orders/${_orderId}/returns`, params, options);
|
96
|
-
}
|
97
|
-
async order_subscription(orderId, params, options) {
|
98
|
-
const _orderId = orderId.id || orderId;
|
99
|
-
return this.resources.fetch({ type: 'order_subscriptions' }, `orders/${_orderId}/order_subscription`, params, options);
|
100
|
-
}
|
101
|
-
async order_subscriptions(orderId, params, options) {
|
102
|
-
const _orderId = orderId.id || orderId;
|
103
|
-
return this.resources.fetch({ type: 'order_subscriptions' }, `orders/${_orderId}/order_subscriptions`, params, options);
|
104
|
-
}
|
105
|
-
async order_factories(orderId, params, options) {
|
106
|
-
const _orderId = orderId.id || orderId;
|
107
|
-
return this.resources.fetch({ type: 'order_factories' }, `orders/${_orderId}/order_factories`, params, options);
|
108
|
-
}
|
109
|
-
async order_copies(orderId, params, options) {
|
110
|
-
const _orderId = orderId.id || orderId;
|
111
|
-
return this.resources.fetch({ type: 'order_copies' }, `orders/${_orderId}/order_copies`, params, options);
|
112
|
-
}
|
113
|
-
async recurring_order_copies(orderId, params, options) {
|
114
|
-
const _orderId = orderId.id || orderId;
|
115
|
-
return this.resources.fetch({ type: 'recurring_order_copies' }, `orders/${_orderId}/recurring_order_copies`, params, options);
|
116
|
-
}
|
117
|
-
async attachments(orderId, params, options) {
|
118
|
-
const _orderId = orderId.id || orderId;
|
119
|
-
return this.resources.fetch({ type: 'attachments' }, `orders/${_orderId}/attachments`, params, options);
|
120
|
-
}
|
121
|
-
async resource_errors(orderId, params, options) {
|
122
|
-
const _orderId = orderId.id || orderId;
|
123
|
-
return this.resources.fetch({ type: 'resource_errors' }, `orders/${_orderId}/resource_errors`, params, options);
|
124
|
-
}
|
125
|
-
async events(orderId, params, options) {
|
126
|
-
const _orderId = orderId.id || orderId;
|
127
|
-
return this.resources.fetch({ type: 'events' }, `orders/${_orderId}/events`, params, options);
|
128
|
-
}
|
129
|
-
async tags(orderId, params, options) {
|
130
|
-
const _orderId = orderId.id || orderId;
|
131
|
-
return this.resources.fetch({ type: 'tags' }, `orders/${_orderId}/tags`, params, options);
|
132
|
-
}
|
133
|
-
async versions(orderId, params, options) {
|
134
|
-
const _orderId = orderId.id || orderId;
|
135
|
-
return this.resources.fetch({ type: 'versions' }, `orders/${_orderId}/versions`, params, options);
|
136
|
-
}
|
137
|
-
async _archive(id, params, options) {
|
138
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _archive: true }, params, options);
|
139
|
-
}
|
140
|
-
async _unarchive(id, params, options) {
|
141
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _unarchive: true }, params, options);
|
142
|
-
}
|
143
|
-
async _pending(id, params, options) {
|
144
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _pending: true }, params, options);
|
145
|
-
}
|
146
|
-
async _place(id, params, options) {
|
147
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _place: true }, params, options);
|
148
|
-
}
|
149
|
-
async _cancel(id, params, options) {
|
150
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _cancel: true }, params, options);
|
151
|
-
}
|
152
|
-
async _approve(id, params, options) {
|
153
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _approve: true }, params, options);
|
154
|
-
}
|
155
|
-
async _approve_and_capture(id, params, options) {
|
156
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _approve_and_capture: true }, params, options);
|
157
|
-
}
|
158
|
-
async _authorize(id, params, options) {
|
159
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _authorize: true }, params, options);
|
160
|
-
}
|
161
|
-
async _authorization_amount_cents(id, triggerValue, params, options) {
|
162
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _authorization_amount_cents: triggerValue }, params, options);
|
163
|
-
}
|
164
|
-
async _capture(id, params, options) {
|
165
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _capture: true }, params, options);
|
166
|
-
}
|
167
|
-
async _refund(id, params, options) {
|
168
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _refund: true }, params, options);
|
169
|
-
}
|
170
|
-
async _update_taxes(id, params, options) {
|
171
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _update_taxes: true }, params, options);
|
172
|
-
}
|
173
|
-
async _nullify_payment_source(id, params, options) {
|
174
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _nullify_payment_source: true }, params, options);
|
175
|
-
}
|
176
|
-
async _billing_address_clone_id(id, triggerValue, params, options) {
|
177
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _billing_address_clone_id: triggerValue }, params, options);
|
178
|
-
}
|
179
|
-
async _shipping_address_clone_id(id, triggerValue, params, options) {
|
180
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _shipping_address_clone_id: triggerValue }, params, options);
|
181
|
-
}
|
182
|
-
async _customer_payment_source_id(id, triggerValue, params, options) {
|
183
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _customer_payment_source_id: triggerValue }, params, options);
|
184
|
-
}
|
185
|
-
async _shipping_address_same_as_billing(id, params, options) {
|
186
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _shipping_address_same_as_billing: true }, params, options);
|
187
|
-
}
|
188
|
-
async _billing_address_same_as_shipping(id, params, options) {
|
189
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _billing_address_same_as_shipping: true }, params, options);
|
190
|
-
}
|
191
|
-
async _commit_invoice(id, params, options) {
|
192
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _commit_invoice: true }, params, options);
|
193
|
-
}
|
194
|
-
async _refund_invoice(id, params, options) {
|
195
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _refund_invoice: true }, params, options);
|
196
|
-
}
|
197
|
-
async _save_payment_source_to_customer_wallet(id, params, options) {
|
198
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _save_payment_source_to_customer_wallet: true }, params, options);
|
199
|
-
}
|
200
|
-
async _save_shipping_address_to_customer_address_book(id, params, options) {
|
201
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _save_shipping_address_to_customer_address_book: true }, params, options);
|
202
|
-
}
|
203
|
-
async _save_billing_address_to_customer_address_book(id, params, options) {
|
204
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _save_billing_address_to_customer_address_book: true }, params, options);
|
205
|
-
}
|
206
|
-
async _refresh(id, params, options) {
|
207
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _refresh: true }, params, options);
|
208
|
-
}
|
209
|
-
async _validate(id, params, options) {
|
210
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _validate: true }, params, options);
|
211
|
-
}
|
212
|
-
async _create_subscriptions(id, params, options) {
|
213
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _create_subscriptions: true }, params, options);
|
214
|
-
}
|
215
|
-
async _start_editing(id, params, options) {
|
216
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _start_editing: true }, params, options);
|
217
|
-
}
|
218
|
-
async _stop_editing(id, params, options) {
|
219
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _stop_editing: true }, params, options);
|
220
|
-
}
|
221
|
-
async _reset_circuit(id, params, options) {
|
222
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _reset_circuit: true }, params, options);
|
223
|
-
}
|
224
|
-
isOrder(resource) {
|
225
|
-
return resource.type && (resource.type === Orders.TYPE);
|
226
|
-
}
|
227
|
-
relationship(id) {
|
228
|
-
return super.relationshipOneToOne(id);
|
229
|
-
}
|
230
|
-
relationshipToMany(...ids) {
|
231
|
-
return super.relationshipOneToMany(...ids);
|
232
|
-
}
|
233
|
-
type() {
|
234
|
-
return Orders.TYPE;
|
235
|
-
}
|
236
|
-
}
|
237
|
-
export default Orders;
|
@@ -1,35 +0,0 @@
|
|
1
|
-
import { ApiSingleton } from '../resource';
|
2
|
-
import type { Resource, ResourceId, ResourceRel } from '../resource';
|
3
|
-
type OrganizationType = 'organization';
|
4
|
-
type OrganizationRel = ResourceRel & {
|
5
|
-
type: OrganizationType;
|
6
|
-
};
|
7
|
-
interface Organization extends Resource {
|
8
|
-
readonly type: OrganizationType;
|
9
|
-
name?: string | null;
|
10
|
-
slug?: string | null;
|
11
|
-
domain?: string | null;
|
12
|
-
support_phone?: string | null;
|
13
|
-
support_email?: string | null;
|
14
|
-
logo_url?: string | null;
|
15
|
-
favicon_url?: string | null;
|
16
|
-
primary_color?: string | null;
|
17
|
-
gtm_id?: string | null;
|
18
|
-
gtm_id_test?: string | null;
|
19
|
-
max_concurrent_promotions?: number | null;
|
20
|
-
max_concurrent_imports?: number | null;
|
21
|
-
max_concurrent_exports?: number | null;
|
22
|
-
max_concurrent_cleanups?: number | null;
|
23
|
-
order_number_editable_test?: boolean | null;
|
24
|
-
order_number_editable_live?: boolean | null;
|
25
|
-
config?: Record<string, any> | null;
|
26
|
-
}
|
27
|
-
declare class Organizations extends ApiSingleton<Organization> {
|
28
|
-
static readonly TYPE: OrganizationType;
|
29
|
-
isOrganization(resource: any): resource is Organization;
|
30
|
-
relationship(id: string | ResourceId | null): OrganizationRel;
|
31
|
-
relationshipToMany(...ids: string[]): OrganizationRel[];
|
32
|
-
type(): OrganizationType;
|
33
|
-
}
|
34
|
-
export default Organizations;
|
35
|
-
export type { Organization, OrganizationType };
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import { ApiSingleton } from '../resource';
|
2
|
-
class Organizations extends ApiSingleton {
|
3
|
-
static TYPE = 'organization';
|
4
|
-
isOrganization(resource) {
|
5
|
-
return resource.type && (resource.type === Organizations.TYPE);
|
6
|
-
}
|
7
|
-
relationship(id) {
|
8
|
-
return super.relationshipOneToOne(id);
|
9
|
-
}
|
10
|
-
relationshipToMany(...ids) {
|
11
|
-
return super.relationshipOneToMany(...ids);
|
12
|
-
}
|
13
|
-
type() {
|
14
|
-
return Organizations.TYPE;
|
15
|
-
}
|
16
|
-
}
|
17
|
-
export default Organizations;
|
@@ -1,61 +0,0 @@
|
|
1
|
-
import { ApiResource } from '../resource';
|
2
|
-
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
3
|
-
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
4
|
-
import type { StockLocation, StockLocationType } from './stock_locations';
|
5
|
-
import type { Parcel } from './parcels';
|
6
|
-
import type { Attachment } from './attachments';
|
7
|
-
import type { Version } from './versions';
|
8
|
-
type PackageType = 'packages';
|
9
|
-
type PackageRel = ResourceRel & {
|
10
|
-
type: PackageType;
|
11
|
-
};
|
12
|
-
type StockLocationRel = ResourceRel & {
|
13
|
-
type: StockLocationType;
|
14
|
-
};
|
15
|
-
interface Package extends Resource {
|
16
|
-
readonly type: PackageType;
|
17
|
-
name: string;
|
18
|
-
code?: string | null;
|
19
|
-
length: number;
|
20
|
-
width: number;
|
21
|
-
height: number;
|
22
|
-
unit_of_length: string;
|
23
|
-
stock_location?: StockLocation | null;
|
24
|
-
parcels?: Parcel[] | null;
|
25
|
-
attachments?: Attachment[] | null;
|
26
|
-
versions?: Version[] | null;
|
27
|
-
}
|
28
|
-
interface PackageCreate extends ResourceCreate {
|
29
|
-
name: string;
|
30
|
-
code?: string | null;
|
31
|
-
length: number;
|
32
|
-
width: number;
|
33
|
-
height: number;
|
34
|
-
unit_of_length: string;
|
35
|
-
stock_location: StockLocationRel;
|
36
|
-
}
|
37
|
-
interface PackageUpdate extends ResourceUpdate {
|
38
|
-
name?: string | null;
|
39
|
-
code?: string | null;
|
40
|
-
length?: number | null;
|
41
|
-
width?: number | null;
|
42
|
-
height?: number | null;
|
43
|
-
unit_of_length?: string | null;
|
44
|
-
stock_location?: StockLocationRel | null;
|
45
|
-
}
|
46
|
-
declare class Packages extends ApiResource<Package> {
|
47
|
-
static readonly TYPE: PackageType;
|
48
|
-
create(resource: PackageCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Package>;
|
49
|
-
update(resource: PackageUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Package>;
|
50
|
-
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
51
|
-
stock_location(packageId: string | Package, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
|
52
|
-
parcels(packageId: string | Package, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Parcel>>;
|
53
|
-
attachments(packageId: string | Package, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
54
|
-
versions(packageId: string | Package, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
55
|
-
isPackage(resource: any): resource is Package;
|
56
|
-
relationship(id: string | ResourceId | null): PackageRel;
|
57
|
-
relationshipToMany(...ids: string[]): PackageRel[];
|
58
|
-
type(): PackageType;
|
59
|
-
}
|
60
|
-
export default Packages;
|
61
|
-
export type { Package, PackageCreate, PackageUpdate, PackageType };
|
@@ -1,42 +0,0 @@
|
|
1
|
-
import { ApiResource } from '../resource';
|
2
|
-
class Packages extends ApiResource {
|
3
|
-
static TYPE = 'packages';
|
4
|
-
async create(resource, params, options) {
|
5
|
-
return this.resources.create({ ...resource, type: Packages.TYPE }, params, options);
|
6
|
-
}
|
7
|
-
async update(resource, params, options) {
|
8
|
-
return this.resources.update({ ...resource, type: Packages.TYPE }, params, options);
|
9
|
-
}
|
10
|
-
async delete(id, options) {
|
11
|
-
await this.resources.delete((typeof id === 'string') ? { id, type: Packages.TYPE } : id, options);
|
12
|
-
}
|
13
|
-
async stock_location(packageId, params, options) {
|
14
|
-
const _packageId = packageId.id || packageId;
|
15
|
-
return this.resources.fetch({ type: 'stock_locations' }, `packages/${_packageId}/stock_location`, params, options);
|
16
|
-
}
|
17
|
-
async parcels(packageId, params, options) {
|
18
|
-
const _packageId = packageId.id || packageId;
|
19
|
-
return this.resources.fetch({ type: 'parcels' }, `packages/${_packageId}/parcels`, params, options);
|
20
|
-
}
|
21
|
-
async attachments(packageId, params, options) {
|
22
|
-
const _packageId = packageId.id || packageId;
|
23
|
-
return this.resources.fetch({ type: 'attachments' }, `packages/${_packageId}/attachments`, params, options);
|
24
|
-
}
|
25
|
-
async versions(packageId, params, options) {
|
26
|
-
const _packageId = packageId.id || packageId;
|
27
|
-
return this.resources.fetch({ type: 'versions' }, `packages/${_packageId}/versions`, params, options);
|
28
|
-
}
|
29
|
-
isPackage(resource) {
|
30
|
-
return resource.type && (resource.type === Packages.TYPE);
|
31
|
-
}
|
32
|
-
relationship(id) {
|
33
|
-
return super.relationshipOneToOne(id);
|
34
|
-
}
|
35
|
-
relationshipToMany(...ids) {
|
36
|
-
return super.relationshipOneToMany(...ids);
|
37
|
-
}
|
38
|
-
type() {
|
39
|
-
return Packages.TYPE;
|
40
|
-
}
|
41
|
-
}
|
42
|
-
export default Packages;
|
@@ -1,48 +0,0 @@
|
|
1
|
-
import { ApiResource } from '../resource';
|
2
|
-
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
3
|
-
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
4
|
-
import type { Parcel, ParcelType } from './parcels';
|
5
|
-
import type { StockLineItem, StockLineItemType } from './stock_line_items';
|
6
|
-
import type { Version } from './versions';
|
7
|
-
type ParcelLineItemType = 'parcel_line_items';
|
8
|
-
type ParcelLineItemRel = ResourceRel & {
|
9
|
-
type: ParcelLineItemType;
|
10
|
-
};
|
11
|
-
type ParcelRel = ResourceRel & {
|
12
|
-
type: ParcelType;
|
13
|
-
};
|
14
|
-
type StockLineItemRel = ResourceRel & {
|
15
|
-
type: StockLineItemType;
|
16
|
-
};
|
17
|
-
interface ParcelLineItem extends Resource {
|
18
|
-
readonly type: ParcelLineItemType;
|
19
|
-
sku_code?: string | null;
|
20
|
-
bundle_code?: string | null;
|
21
|
-
quantity: number;
|
22
|
-
name: string;
|
23
|
-
image_url?: string | null;
|
24
|
-
parcel?: Parcel | null;
|
25
|
-
stock_line_item?: StockLineItem | null;
|
26
|
-
versions?: Version[] | null;
|
27
|
-
}
|
28
|
-
interface ParcelLineItemCreate extends ResourceCreate {
|
29
|
-
quantity: number;
|
30
|
-
parcel: ParcelRel;
|
31
|
-
stock_line_item: StockLineItemRel;
|
32
|
-
}
|
33
|
-
type ParcelLineItemUpdate = ResourceUpdate;
|
34
|
-
declare class ParcelLineItems extends ApiResource<ParcelLineItem> {
|
35
|
-
static readonly TYPE: ParcelLineItemType;
|
36
|
-
create(resource: ParcelLineItemCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ParcelLineItem>;
|
37
|
-
update(resource: ParcelLineItemUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ParcelLineItem>;
|
38
|
-
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
39
|
-
parcel(parcelLineItemId: string | ParcelLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Parcel>;
|
40
|
-
stock_line_item(parcelLineItemId: string | ParcelLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLineItem>;
|
41
|
-
versions(parcelLineItemId: string | ParcelLineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
42
|
-
isParcelLineItem(resource: any): resource is ParcelLineItem;
|
43
|
-
relationship(id: string | ResourceId | null): ParcelLineItemRel;
|
44
|
-
relationshipToMany(...ids: string[]): ParcelLineItemRel[];
|
45
|
-
type(): ParcelLineItemType;
|
46
|
-
}
|
47
|
-
export default ParcelLineItems;
|
48
|
-
export type { ParcelLineItem, ParcelLineItemCreate, ParcelLineItemUpdate, ParcelLineItemType };
|
@@ -1,38 +0,0 @@
|
|
1
|
-
import { ApiResource } from '../resource';
|
2
|
-
class ParcelLineItems extends ApiResource {
|
3
|
-
static TYPE = 'parcel_line_items';
|
4
|
-
async create(resource, params, options) {
|
5
|
-
return this.resources.create({ ...resource, type: ParcelLineItems.TYPE }, params, options);
|
6
|
-
}
|
7
|
-
async update(resource, params, options) {
|
8
|
-
return this.resources.update({ ...resource, type: ParcelLineItems.TYPE }, params, options);
|
9
|
-
}
|
10
|
-
async delete(id, options) {
|
11
|
-
await this.resources.delete((typeof id === 'string') ? { id, type: ParcelLineItems.TYPE } : id, options);
|
12
|
-
}
|
13
|
-
async parcel(parcelLineItemId, params, options) {
|
14
|
-
const _parcelLineItemId = parcelLineItemId.id || parcelLineItemId;
|
15
|
-
return this.resources.fetch({ type: 'parcels' }, `parcel_line_items/${_parcelLineItemId}/parcel`, params, options);
|
16
|
-
}
|
17
|
-
async stock_line_item(parcelLineItemId, params, options) {
|
18
|
-
const _parcelLineItemId = parcelLineItemId.id || parcelLineItemId;
|
19
|
-
return this.resources.fetch({ type: 'stock_line_items' }, `parcel_line_items/${_parcelLineItemId}/stock_line_item`, params, options);
|
20
|
-
}
|
21
|
-
async versions(parcelLineItemId, params, options) {
|
22
|
-
const _parcelLineItemId = parcelLineItemId.id || parcelLineItemId;
|
23
|
-
return this.resources.fetch({ type: 'versions' }, `parcel_line_items/${_parcelLineItemId}/versions`, params, options);
|
24
|
-
}
|
25
|
-
isParcelLineItem(resource) {
|
26
|
-
return resource.type && (resource.type === ParcelLineItems.TYPE);
|
27
|
-
}
|
28
|
-
relationship(id) {
|
29
|
-
return super.relationshipOneToOne(id);
|
30
|
-
}
|
31
|
-
relationshipToMany(...ids) {
|
32
|
-
return super.relationshipOneToMany(...ids);
|
33
|
-
}
|
34
|
-
type() {
|
35
|
-
return ParcelLineItems.TYPE;
|
36
|
-
}
|
37
|
-
}
|
38
|
-
export default ParcelLineItems;
|
@@ -1,127 +0,0 @@
|
|
1
|
-
import { ApiResource } from '../resource';
|
2
|
-
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
3
|
-
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
4
|
-
import type { Shipment, ShipmentType } from './shipments';
|
5
|
-
import type { Package, PackageType } from './packages';
|
6
|
-
import type { ParcelLineItem } from './parcel_line_items';
|
7
|
-
import type { Attachment } from './attachments';
|
8
|
-
import type { Event } from './events';
|
9
|
-
import type { Version } from './versions';
|
10
|
-
type ParcelType = 'parcels';
|
11
|
-
type ParcelRel = ResourceRel & {
|
12
|
-
type: ParcelType;
|
13
|
-
};
|
14
|
-
type ShipmentRel = ResourceRel & {
|
15
|
-
type: ShipmentType;
|
16
|
-
};
|
17
|
-
type PackageRel = ResourceRel & {
|
18
|
-
type: PackageType;
|
19
|
-
};
|
20
|
-
interface Parcel extends Resource {
|
21
|
-
readonly type: ParcelType;
|
22
|
-
number?: string | null;
|
23
|
-
weight: number;
|
24
|
-
unit_of_weight: string;
|
25
|
-
eel_pfc?: string | null;
|
26
|
-
contents_type?: string | null;
|
27
|
-
contents_explanation?: string | null;
|
28
|
-
customs_certify?: boolean | null;
|
29
|
-
customs_signer?: string | null;
|
30
|
-
non_delivery_option?: string | null;
|
31
|
-
restriction_type?: string | null;
|
32
|
-
restriction_comments?: string | null;
|
33
|
-
customs_info_required?: boolean | null;
|
34
|
-
shipping_label_url?: string | null;
|
35
|
-
shipping_label_file_type?: string | null;
|
36
|
-
shipping_label_size?: string | null;
|
37
|
-
shipping_label_resolution?: string | null;
|
38
|
-
tracking_number?: string | null;
|
39
|
-
tracking_status?: string | null;
|
40
|
-
tracking_status_detail?: string | null;
|
41
|
-
tracking_status_updated_at?: string | null;
|
42
|
-
tracking_details?: Record<string, any> | null;
|
43
|
-
carrier_weight_oz?: string | null;
|
44
|
-
signed_by?: string | null;
|
45
|
-
incoterm?: string | null;
|
46
|
-
delivery_confirmation?: string | null;
|
47
|
-
shipment?: Shipment | null;
|
48
|
-
package?: Package | null;
|
49
|
-
parcel_line_items?: ParcelLineItem[] | null;
|
50
|
-
attachments?: Attachment[] | null;
|
51
|
-
events?: Event[] | null;
|
52
|
-
versions?: Version[] | null;
|
53
|
-
}
|
54
|
-
interface ParcelCreate extends ResourceCreate {
|
55
|
-
weight: number;
|
56
|
-
unit_of_weight: string;
|
57
|
-
eel_pfc?: string | null;
|
58
|
-
contents_type?: string | null;
|
59
|
-
contents_explanation?: string | null;
|
60
|
-
customs_certify?: boolean | null;
|
61
|
-
customs_signer?: string | null;
|
62
|
-
non_delivery_option?: string | null;
|
63
|
-
restriction_type?: string | null;
|
64
|
-
restriction_comments?: string | null;
|
65
|
-
customs_info_required?: boolean | null;
|
66
|
-
shipping_label_url?: string | null;
|
67
|
-
shipping_label_file_type?: string | null;
|
68
|
-
shipping_label_size?: string | null;
|
69
|
-
shipping_label_resolution?: string | null;
|
70
|
-
tracking_number?: string | null;
|
71
|
-
tracking_status?: string | null;
|
72
|
-
tracking_status_detail?: string | null;
|
73
|
-
tracking_status_updated_at?: string | null;
|
74
|
-
tracking_details?: Record<string, any> | null;
|
75
|
-
carrier_weight_oz?: string | null;
|
76
|
-
signed_by?: string | null;
|
77
|
-
incoterm?: string | null;
|
78
|
-
delivery_confirmation?: string | null;
|
79
|
-
shipment: ShipmentRel;
|
80
|
-
package: PackageRel;
|
81
|
-
}
|
82
|
-
interface ParcelUpdate extends ResourceUpdate {
|
83
|
-
weight?: number | null;
|
84
|
-
unit_of_weight?: string | null;
|
85
|
-
eel_pfc?: string | null;
|
86
|
-
contents_type?: string | null;
|
87
|
-
contents_explanation?: string | null;
|
88
|
-
customs_certify?: boolean | null;
|
89
|
-
customs_signer?: string | null;
|
90
|
-
non_delivery_option?: string | null;
|
91
|
-
restriction_type?: string | null;
|
92
|
-
restriction_comments?: string | null;
|
93
|
-
customs_info_required?: boolean | null;
|
94
|
-
shipping_label_url?: string | null;
|
95
|
-
shipping_label_file_type?: string | null;
|
96
|
-
shipping_label_size?: string | null;
|
97
|
-
shipping_label_resolution?: string | null;
|
98
|
-
tracking_number?: string | null;
|
99
|
-
tracking_status?: string | null;
|
100
|
-
tracking_status_detail?: string | null;
|
101
|
-
tracking_status_updated_at?: string | null;
|
102
|
-
tracking_details?: Record<string, any> | null;
|
103
|
-
carrier_weight_oz?: string | null;
|
104
|
-
signed_by?: string | null;
|
105
|
-
incoterm?: string | null;
|
106
|
-
delivery_confirmation?: string | null;
|
107
|
-
shipment?: ShipmentRel | null;
|
108
|
-
package?: PackageRel | null;
|
109
|
-
}
|
110
|
-
declare class Parcels extends ApiResource<Parcel> {
|
111
|
-
static readonly TYPE: ParcelType;
|
112
|
-
create(resource: ParcelCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Parcel>;
|
113
|
-
update(resource: ParcelUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Parcel>;
|
114
|
-
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
115
|
-
shipment(parcelId: string | Parcel, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Shipment>;
|
116
|
-
package(parcelId: string | Parcel, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Package>;
|
117
|
-
parcel_line_items(parcelId: string | Parcel, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ParcelLineItem>>;
|
118
|
-
attachments(parcelId: string | Parcel, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
119
|
-
events(parcelId: string | Parcel, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
120
|
-
versions(parcelId: string | Parcel, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
121
|
-
isParcel(resource: any): resource is Parcel;
|
122
|
-
relationship(id: string | ResourceId | null): ParcelRel;
|
123
|
-
relationshipToMany(...ids: string[]): ParcelRel[];
|
124
|
-
type(): ParcelType;
|
125
|
-
}
|
126
|
-
export default Parcels;
|
127
|
-
export type { Parcel, ParcelCreate, ParcelUpdate, ParcelType };
|
@@ -1,50 +0,0 @@
|
|
1
|
-
import { ApiResource } from '../resource';
|
2
|
-
class Parcels extends ApiResource {
|
3
|
-
static TYPE = 'parcels';
|
4
|
-
async create(resource, params, options) {
|
5
|
-
return this.resources.create({ ...resource, type: Parcels.TYPE }, params, options);
|
6
|
-
}
|
7
|
-
async update(resource, params, options) {
|
8
|
-
return this.resources.update({ ...resource, type: Parcels.TYPE }, params, options);
|
9
|
-
}
|
10
|
-
async delete(id, options) {
|
11
|
-
await this.resources.delete((typeof id === 'string') ? { id, type: Parcels.TYPE } : id, options);
|
12
|
-
}
|
13
|
-
async shipment(parcelId, params, options) {
|
14
|
-
const _parcelId = parcelId.id || parcelId;
|
15
|
-
return this.resources.fetch({ type: 'shipments' }, `parcels/${_parcelId}/shipment`, params, options);
|
16
|
-
}
|
17
|
-
async package(parcelId, params, options) {
|
18
|
-
const _parcelId = parcelId.id || parcelId;
|
19
|
-
return this.resources.fetch({ type: 'packages' }, `parcels/${_parcelId}/package`, params, options);
|
20
|
-
}
|
21
|
-
async parcel_line_items(parcelId, params, options) {
|
22
|
-
const _parcelId = parcelId.id || parcelId;
|
23
|
-
return this.resources.fetch({ type: 'parcel_line_items' }, `parcels/${_parcelId}/parcel_line_items`, params, options);
|
24
|
-
}
|
25
|
-
async attachments(parcelId, params, options) {
|
26
|
-
const _parcelId = parcelId.id || parcelId;
|
27
|
-
return this.resources.fetch({ type: 'attachments' }, `parcels/${_parcelId}/attachments`, params, options);
|
28
|
-
}
|
29
|
-
async events(parcelId, params, options) {
|
30
|
-
const _parcelId = parcelId.id || parcelId;
|
31
|
-
return this.resources.fetch({ type: 'events' }, `parcels/${_parcelId}/events`, params, options);
|
32
|
-
}
|
33
|
-
async versions(parcelId, params, options) {
|
34
|
-
const _parcelId = parcelId.id || parcelId;
|
35
|
-
return this.resources.fetch({ type: 'versions' }, `parcels/${_parcelId}/versions`, params, options);
|
36
|
-
}
|
37
|
-
isParcel(resource) {
|
38
|
-
return resource.type && (resource.type === Parcels.TYPE);
|
39
|
-
}
|
40
|
-
relationship(id) {
|
41
|
-
return super.relationshipOneToOne(id);
|
42
|
-
}
|
43
|
-
relationshipToMany(...ids) {
|
44
|
-
return super.relationshipOneToMany(...ids);
|
45
|
-
}
|
46
|
-
type() {
|
47
|
-
return Parcels.TYPE;
|
48
|
-
}
|
49
|
-
}
|
50
|
-
export default Parcels;
|