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