@commercelayer/sdk 4.48.0 → 4.49.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 -126
- package/lib/cjs/api.js +1 -394
- package/lib/cjs/client.d.ts +1 -31
- package/lib/cjs/client.js +1 -123
- package/lib/cjs/commercelayer.d.ts +1 -152
- package/lib/cjs/commercelayer.js +1 -243
- package/lib/cjs/common.d.ts +1 -4
- package/lib/cjs/common.js +1 -14
- package/lib/cjs/config.d.ts +1 -11
- package/lib/cjs/config.js +1 -13
- package/lib/cjs/debug.d.ts +1 -3
- package/lib/cjs/debug.js +1 -42
- package/lib/cjs/error.d.ts +1 -28
- package/lib/cjs/error.js +1 -43
- package/lib/cjs/index.d.ts +1 -7
- package/lib/cjs/index.js +1 -29
- package/lib/cjs/interceptor.d.ts +1 -21
- package/lib/cjs/interceptor.js +1 -2
- package/lib/cjs/jsonapi.d.ts +1 -5
- package/lib/cjs/jsonapi.js +1 -82
- package/lib/cjs/model.d.ts +1 -124
- package/lib/cjs/model.js +1 -3
- package/lib/cjs/query.d.ts +1 -23
- package/lib/cjs/query.js +1 -51
- package/lib/cjs/resource.d.ts +1 -75
- package/lib/cjs/resource.js +1 -145
- package/lib/cjs/resources/addresses.d.ts +1 -102
- package/lib/cjs/resources/addresses.js +1 -49
- package/lib/cjs/resources/adjustments.d.ts +1 -41
- package/lib/cjs/resources/adjustments.js +1 -37
- package/lib/cjs/resources/adyen_gateways.d.ts +1 -59
- package/lib/cjs/resources/adyen_gateways.js +1 -45
- package/lib/cjs/resources/adyen_payments.d.ts +1 -49
- package/lib/cjs/resources/adyen_payments.js +1 -45
- package/lib/cjs/resources/application.d.ts +1 -21
- package/lib/cjs/resources/application.js +1 -21
- package/lib/cjs/resources/attachments.d.ts +1 -156
- package/lib/cjs/resources/attachments.js +1 -33
- package/lib/cjs/resources/authorizations.d.ts +1 -66
- package/lib/cjs/resources/authorizations.js +1 -51
- package/lib/cjs/resources/avalara_accounts.d.ts +1 -58
- package/lib/cjs/resources/avalara_accounts.js +1 -49
- package/lib/cjs/resources/axerve_gateways.d.ts +1 -47
- package/lib/cjs/resources/axerve_gateways.js +1 -45
- package/lib/cjs/resources/axerve_payments.d.ts +1 -52
- package/lib/cjs/resources/axerve_payments.js +1 -45
- package/lib/cjs/resources/billing_info_validation_rules.d.ts +1 -38
- package/lib/cjs/resources/billing_info_validation_rules.js +1 -45
- package/lib/cjs/resources/bing_geocoders.d.ts +1 -35
- package/lib/cjs/resources/bing_geocoders.js +1 -41
- package/lib/cjs/resources/braintree_gateways.d.ts +1 -59
- package/lib/cjs/resources/braintree_gateways.js +1 -45
- package/lib/cjs/resources/braintree_payments.d.ts +1 -51
- package/lib/cjs/resources/braintree_payments.js +1 -45
- package/lib/cjs/resources/bundles.d.ts +1 -90
- package/lib/cjs/resources/bundles.js +1 -61
- package/lib/cjs/resources/buy_x_pay_y_promotions.d.ts +1 -134
- package/lib/cjs/resources/buy_x_pay_y_promotions.js +1 -81
- package/lib/cjs/resources/captures.d.ts +1 -57
- package/lib/cjs/resources/captures.js +1 -51
- package/lib/cjs/resources/carrier_accounts.d.ts +1 -29
- package/lib/cjs/resources/carrier_accounts.js +1 -36
- package/lib/cjs/resources/checkout_com_gateways.d.ts +1 -48
- package/lib/cjs/resources/checkout_com_gateways.js +1 -45
- package/lib/cjs/resources/checkout_com_payments.d.ts +1 -62
- package/lib/cjs/resources/checkout_com_payments.js +1 -45
- package/lib/cjs/resources/cleanups.d.ts +1 -39
- package/lib/cjs/resources/cleanups.js +1 -38
- package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +1 -66
- package/lib/cjs/resources/coupon_codes_promotion_rules.js +1 -41
- package/lib/cjs/resources/coupon_recipients.d.ts +1 -47
- package/lib/cjs/resources/coupon_recipients.js +1 -45
- package/lib/cjs/resources/coupons.d.ts +1 -70
- package/lib/cjs/resources/coupons.js +1 -53
- package/lib/cjs/resources/custom_promotion_rules.d.ts +1 -61
- package/lib/cjs/resources/custom_promotion_rules.js +1 -37
- package/lib/cjs/resources/customer_addresses.d.ts +1 -49
- package/lib/cjs/resources/customer_addresses.js +1 -49
- package/lib/cjs/resources/customer_groups.d.ts +1 -39
- package/lib/cjs/resources/customer_groups.js +1 -49
- package/lib/cjs/resources/customer_password_resets.d.ts +1 -36
- package/lib/cjs/resources/customer_password_resets.js +1 -41
- package/lib/cjs/resources/customer_payment_sources.d.ts +1 -85
- package/lib/cjs/resources/customer_payment_sources.js +1 -45
- package/lib/cjs/resources/customer_subscriptions.d.ts +1 -34
- package/lib/cjs/resources/customer_subscriptions.js +1 -45
- package/lib/cjs/resources/customers.d.ts +1 -75
- package/lib/cjs/resources/customers.js +1 -77
- package/lib/cjs/resources/delivery_lead_times.d.ts +1 -54
- package/lib/cjs/resources/delivery_lead_times.js +1 -49
- package/lib/cjs/resources/event_callbacks.d.ts +1 -24
- package/lib/cjs/resources/event_callbacks.js +1 -28
- package/lib/cjs/resources/events.d.ts +1 -24
- package/lib/cjs/resources/events.js +1 -32
- package/lib/cjs/resources/exports.d.ts +1 -40
- package/lib/cjs/resources/exports.js +1 -34
- package/lib/cjs/resources/external_gateways.d.ts +1 -55
- package/lib/cjs/resources/external_gateways.js +1 -45
- package/lib/cjs/resources/external_payments.d.ts +1 -47
- package/lib/cjs/resources/external_payments.js +1 -49
- package/lib/cjs/resources/external_promotions.d.ts +1 -132
- package/lib/cjs/resources/external_promotions.js +1 -81
- package/lib/cjs/resources/external_tax_calculators.d.ts +1 -43
- package/lib/cjs/resources/external_tax_calculators.js +1 -45
- package/lib/cjs/resources/fixed_amount_promotions.d.ts +1 -130
- package/lib/cjs/resources/fixed_amount_promotions.js +1 -81
- package/lib/cjs/resources/fixed_price_promotions.d.ts +1 -130
- package/lib/cjs/resources/fixed_price_promotions.js +1 -81
- package/lib/cjs/resources/free_gift_promotions.d.ts +1 -128
- package/lib/cjs/resources/free_gift_promotions.js +1 -81
- package/lib/cjs/resources/free_shipping_promotions.d.ts +1 -122
- package/lib/cjs/resources/free_shipping_promotions.js +1 -77
- package/lib/cjs/resources/geocoders.d.ts +1 -24
- package/lib/cjs/resources/geocoders.js +1 -32
- package/lib/cjs/resources/gift_card_recipients.d.ts +1 -47
- package/lib/cjs/resources/gift_card_recipients.js +1 -45
- package/lib/cjs/resources/gift_cards.d.ts +1 -99
- package/lib/cjs/resources/gift_cards.js +1 -57
- package/lib/cjs/resources/google_geocoders.d.ts +1 -35
- package/lib/cjs/resources/google_geocoders.js +1 -41
- package/lib/cjs/resources/imports.d.ts +1 -43
- package/lib/cjs/resources/imports.js +1 -34
- package/lib/cjs/resources/in_stock_subscriptions.d.ts +1 -65
- package/lib/cjs/resources/in_stock_subscriptions.js +1 -53
- package/lib/cjs/resources/inventory_models.d.ts +1 -54
- package/lib/cjs/resources/inventory_models.js +1 -49
- package/lib/cjs/resources/inventory_return_locations.d.ts +1 -46
- package/lib/cjs/resources/inventory_return_locations.js +1 -45
- package/lib/cjs/resources/inventory_stock_locations.d.ts +1 -49
- package/lib/cjs/resources/inventory_stock_locations.js +1 -45
- package/lib/cjs/resources/klarna_gateways.d.ts +1 -47
- package/lib/cjs/resources/klarna_gateways.js +1 -45
- package/lib/cjs/resources/klarna_payments.d.ts +1 -46
- package/lib/cjs/resources/klarna_payments.js +1 -45
- package/lib/cjs/resources/line_item_options.d.ts +1 -68
- package/lib/cjs/resources/line_item_options.js +1 -49
- package/lib/cjs/resources/line_items.d.ts +1 -166
- package/lib/cjs/resources/line_items.js +1 -65
- package/lib/cjs/resources/manual_gateways.d.ts +1 -33
- package/lib/cjs/resources/manual_gateways.js +1 -41
- package/lib/cjs/resources/manual_tax_calculators.d.ts +1 -44
- package/lib/cjs/resources/manual_tax_calculators.js +1 -49
- package/lib/cjs/resources/markets.d.ts +1 -104
- package/lib/cjs/resources/markets.js +1 -65
- package/lib/cjs/resources/merchants.d.ts +1 -41
- package/lib/cjs/resources/merchants.js +1 -45
- package/lib/cjs/resources/order_amount_promotion_rules.d.ts +1 -66
- package/lib/cjs/resources/order_amount_promotion_rules.js +1 -37
- package/lib/cjs/resources/order_copies.d.ts +1 -50
- package/lib/cjs/resources/order_copies.js +1 -49
- package/lib/cjs/resources/order_factories.d.ts +1 -33
- package/lib/cjs/resources/order_factories.js +1 -36
- package/lib/cjs/resources/order_subscription_items.d.ts +1 -71
- package/lib/cjs/resources/order_subscription_items.js +1 -41
- package/lib/cjs/resources/order_subscriptions.d.ts +1 -94
- package/lib/cjs/resources/order_subscriptions.js +1 -77
- package/lib/cjs/resources/order_validation_rules.d.ts +1 -26
- package/lib/cjs/resources/order_validation_rules.js +1 -36
- package/lib/cjs/resources/orders.d.ts +1 -359
- package/lib/cjs/resources/orders.js +1 -157
- package/lib/cjs/resources/organization.d.ts +1 -33
- package/lib/cjs/resources/organization.js +1 -21
- package/lib/cjs/resources/packages.d.ts +1 -59
- package/lib/cjs/resources/packages.js +1 -49
- package/lib/cjs/resources/parcel_line_items.d.ts +1 -46
- package/lib/cjs/resources/parcel_line_items.js +1 -45
- package/lib/cjs/resources/parcels.d.ts +1 -125
- package/lib/cjs/resources/parcels.js +1 -57
- package/lib/cjs/resources/payment_gateways.d.ts +1 -24
- package/lib/cjs/resources/payment_gateways.js +1 -32
- package/lib/cjs/resources/payment_methods.d.ts +1 -80
- package/lib/cjs/resources/payment_methods.js +1 -49
- package/lib/cjs/resources/payment_options.d.ts +1 -43
- package/lib/cjs/resources/payment_options.js +1 -41
- package/lib/cjs/resources/paypal_gateways.d.ts +1 -40
- package/lib/cjs/resources/paypal_gateways.js +1 -45
- package/lib/cjs/resources/paypal_payments.d.ts +1 -52
- package/lib/cjs/resources/paypal_payments.js +1 -45
- package/lib/cjs/resources/percentage_discount_promotions.d.ts +1 -128
- package/lib/cjs/resources/percentage_discount_promotions.js +1 -81
- package/lib/cjs/resources/price_frequency_tiers.d.ts +1 -52
- package/lib/cjs/resources/price_frequency_tiers.js +1 -49
- package/lib/cjs/resources/price_lists.d.ts +1 -45
- package/lib/cjs/resources/price_lists.js +1 -45
- package/lib/cjs/resources/price_tiers.d.ts +1 -31
- package/lib/cjs/resources/price_tiers.js +1 -36
- package/lib/cjs/resources/price_volume_tiers.d.ts +1 -52
- package/lib/cjs/resources/price_volume_tiers.js +1 -49
- package/lib/cjs/resources/prices.d.ts +1 -83
- package/lib/cjs/resources/prices.js +1 -73
- package/lib/cjs/resources/promotion_rules.d.ts +1 -28
- package/lib/cjs/resources/promotion_rules.js +1 -28
- package/lib/cjs/resources/promotions.d.ts +1 -62
- package/lib/cjs/resources/promotions.js +1 -68
- package/lib/cjs/resources/recurring_order_copies.d.ts +1 -52
- package/lib/cjs/resources/recurring_order_copies.js +1 -49
- package/lib/cjs/resources/refunds.d.ts +1 -43
- package/lib/cjs/resources/refunds.js +1 -44
- package/lib/cjs/resources/reserved_stocks.d.ts +1 -27
- package/lib/cjs/resources/reserved_stocks.js +1 -36
- package/lib/cjs/resources/resource_errors.d.ts +1 -22
- package/lib/cjs/resources/resource_errors.js +1 -24
- package/lib/cjs/resources/return_line_items.d.ts +1 -50
- package/lib/cjs/resources/return_line_items.js +1 -41
- package/lib/cjs/resources/returns.d.ts +1 -86
- package/lib/cjs/resources/returns.js +1 -73
- package/lib/cjs/resources/satispay_gateways.d.ts +1 -45
- package/lib/cjs/resources/satispay_gateways.js +1 -45
- package/lib/cjs/resources/satispay_payments.d.ts +1 -48
- package/lib/cjs/resources/satispay_payments.js +1 -45
- package/lib/cjs/resources/shipments.d.ts +1 -139
- package/lib/cjs/resources/shipments.js +1 -105
- package/lib/cjs/resources/shipping_categories.d.ts +1 -39
- package/lib/cjs/resources/shipping_categories.js +1 -45
- package/lib/cjs/resources/shipping_method_tiers.d.ts +1 -31
- package/lib/cjs/resources/shipping_method_tiers.js +1 -36
- package/lib/cjs/resources/shipping_methods.d.ts +1 -121
- package/lib/cjs/resources/shipping_methods.js +1 -69
- package/lib/cjs/resources/shipping_weight_tiers.d.ts +1 -49
- package/lib/cjs/resources/shipping_weight_tiers.js +1 -45
- package/lib/cjs/resources/shipping_zones.d.ts +1 -51
- package/lib/cjs/resources/shipping_zones.js +1 -41
- package/lib/cjs/resources/sku_list_items.d.ts +1 -50
- package/lib/cjs/resources/sku_list_items.js +1 -45
- package/lib/cjs/resources/sku_list_promotion_rules.d.ts +1 -75
- package/lib/cjs/resources/sku_list_promotion_rules.js +1 -45
- package/lib/cjs/resources/sku_lists.d.ts +1 -63
- package/lib/cjs/resources/sku_lists.js +1 -57
- package/lib/cjs/resources/sku_options.d.ts +1 -70
- package/lib/cjs/resources/sku_options.js +1 -53
- package/lib/cjs/resources/skus.d.ts +1 -95
- package/lib/cjs/resources/skus.js +1 -73
- package/lib/cjs/resources/stock_items.d.ts +1 -59
- package/lib/cjs/resources/stock_items.js +1 -57
- package/lib/cjs/resources/stock_line_items.d.ts +1 -69
- package/lib/cjs/resources/stock_line_items.js +1 -53
- package/lib/cjs/resources/stock_locations.d.ts +1 -63
- package/lib/cjs/resources/stock_locations.js +1 -61
- package/lib/cjs/resources/stock_reservations.d.ts +1 -49
- package/lib/cjs/resources/stock_reservations.js +1 -53
- package/lib/cjs/resources/stock_transfers.d.ts +1 -79
- package/lib/cjs/resources/stock_transfers.js +1 -61
- package/lib/cjs/resources/stripe_gateways.d.ts +1 -44
- package/lib/cjs/resources/stripe_gateways.js +1 -45
- package/lib/cjs/resources/stripe_payments.d.ts +1 -56
- package/lib/cjs/resources/stripe_payments.js +1 -45
- package/lib/cjs/resources/subscription_models.d.ts +1 -48
- package/lib/cjs/resources/subscription_models.js +1 -45
- package/lib/cjs/resources/tags.d.ts +1 -27
- package/lib/cjs/resources/tags.js +1 -33
- package/lib/cjs/resources/tax_calculators.d.ts +1 -27
- package/lib/cjs/resources/tax_calculators.js +1 -36
- package/lib/cjs/resources/tax_categories.d.ts +1 -62
- package/lib/cjs/resources/tax_categories.js +1 -45
- package/lib/cjs/resources/tax_rules.d.ts +1 -72
- package/lib/cjs/resources/tax_rules.js +1 -41
- package/lib/cjs/resources/taxjar_accounts.d.ts +1 -46
- package/lib/cjs/resources/taxjar_accounts.js +1 -49
- package/lib/cjs/resources/transactions.d.ts +1 -40
- package/lib/cjs/resources/transactions.js +1 -40
- package/lib/cjs/resources/versions.d.ts +1 -22
- package/lib/cjs/resources/versions.js +1 -24
- package/lib/cjs/resources/voids.d.ts +1 -43
- package/lib/cjs/resources/voids.js +1 -44
- package/lib/cjs/resources/webhooks.d.ts +1 -51
- package/lib/cjs/resources/webhooks.js +1 -41
- package/lib/cjs/resources/wire_transfers.d.ts +1 -36
- package/lib/cjs/resources/wire_transfers.js +1 -41
- package/lib/cjs/static.d.ts +1 -9
- package/lib/cjs/static.js +1 -45
- package/lib/cjs/util.d.ts +1 -6
- package/lib/cjs/util.js +1 -15
- package/lib/esm/api.d.ts +1 -126
- package/lib/esm/api.js +1 -265
- package/lib/esm/client.d.ts +1 -31
- package/lib/esm/client.js +1 -118
- package/lib/esm/commercelayer.d.ts +1 -152
- package/lib/esm/commercelayer.js +1 -214
- package/lib/esm/common.d.ts +1 -4
- package/lib/esm/common.js +1 -10
- package/lib/esm/config.d.ts +1 -11
- package/lib/esm/config.js +1 -11
- package/lib/esm/debug.d.ts +1 -3
- package/lib/esm/debug.js +1 -40
- package/lib/esm/error.d.ts +1 -28
- package/lib/esm/error.js +1 -38
- package/lib/esm/index.d.ts +1 -7
- package/lib/esm/index.js +1 -6
- package/lib/esm/interceptor.d.ts +1 -21
- package/lib/esm/interceptor.js +1 -1
- package/lib/esm/jsonapi.d.ts +1 -5
- package/lib/esm/jsonapi.js +1 -75
- package/lib/esm/model.d.ts +1 -124
- package/lib/esm/model.js +1 -2
- package/lib/esm/query.d.ts +1 -23
- package/lib/esm/query.js +1 -45
- package/lib/esm/resource.d.ts +1 -75
- package/lib/esm/resource.js +1 -139
- package/lib/esm/resources/addresses.d.ts +1 -102
- package/lib/esm/resources/addresses.js +1 -47
- package/lib/esm/resources/adjustments.d.ts +1 -41
- package/lib/esm/resources/adjustments.js +1 -35
- package/lib/esm/resources/adyen_gateways.d.ts +1 -59
- package/lib/esm/resources/adyen_gateways.js +1 -43
- package/lib/esm/resources/adyen_payments.d.ts +1 -49
- package/lib/esm/resources/adyen_payments.js +1 -43
- package/lib/esm/resources/application.d.ts +1 -21
- package/lib/esm/resources/application.js +1 -19
- package/lib/esm/resources/attachments.d.ts +1 -156
- package/lib/esm/resources/attachments.js +1 -31
- package/lib/esm/resources/authorizations.d.ts +1 -66
- package/lib/esm/resources/authorizations.js +1 -49
- package/lib/esm/resources/avalara_accounts.d.ts +1 -58
- package/lib/esm/resources/avalara_accounts.js +1 -47
- package/lib/esm/resources/axerve_gateways.d.ts +1 -47
- package/lib/esm/resources/axerve_gateways.js +1 -43
- package/lib/esm/resources/axerve_payments.d.ts +1 -52
- package/lib/esm/resources/axerve_payments.js +1 -43
- package/lib/esm/resources/billing_info_validation_rules.d.ts +1 -38
- package/lib/esm/resources/billing_info_validation_rules.js +1 -43
- package/lib/esm/resources/bing_geocoders.d.ts +1 -35
- package/lib/esm/resources/bing_geocoders.js +1 -39
- package/lib/esm/resources/braintree_gateways.d.ts +1 -59
- package/lib/esm/resources/braintree_gateways.js +1 -43
- package/lib/esm/resources/braintree_payments.d.ts +1 -51
- package/lib/esm/resources/braintree_payments.js +1 -43
- package/lib/esm/resources/bundles.d.ts +1 -90
- package/lib/esm/resources/bundles.js +1 -59
- package/lib/esm/resources/buy_x_pay_y_promotions.d.ts +1 -134
- package/lib/esm/resources/buy_x_pay_y_promotions.js +1 -79
- package/lib/esm/resources/captures.d.ts +1 -57
- package/lib/esm/resources/captures.js +1 -49
- package/lib/esm/resources/carrier_accounts.d.ts +1 -29
- package/lib/esm/resources/carrier_accounts.js +1 -34
- package/lib/esm/resources/checkout_com_gateways.d.ts +1 -48
- package/lib/esm/resources/checkout_com_gateways.js +1 -43
- package/lib/esm/resources/checkout_com_payments.d.ts +1 -62
- package/lib/esm/resources/checkout_com_payments.js +1 -43
- package/lib/esm/resources/cleanups.d.ts +1 -39
- package/lib/esm/resources/cleanups.js +1 -36
- package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +1 -66
- package/lib/esm/resources/coupon_codes_promotion_rules.js +1 -39
- package/lib/esm/resources/coupon_recipients.d.ts +1 -47
- package/lib/esm/resources/coupon_recipients.js +1 -43
- package/lib/esm/resources/coupons.d.ts +1 -70
- package/lib/esm/resources/coupons.js +1 -51
- package/lib/esm/resources/custom_promotion_rules.d.ts +1 -61
- package/lib/esm/resources/custom_promotion_rules.js +1 -35
- package/lib/esm/resources/customer_addresses.d.ts +1 -49
- package/lib/esm/resources/customer_addresses.js +1 -47
- package/lib/esm/resources/customer_groups.d.ts +1 -39
- package/lib/esm/resources/customer_groups.js +1 -47
- package/lib/esm/resources/customer_password_resets.d.ts +1 -36
- package/lib/esm/resources/customer_password_resets.js +1 -39
- package/lib/esm/resources/customer_payment_sources.d.ts +1 -85
- package/lib/esm/resources/customer_payment_sources.js +1 -43
- package/lib/esm/resources/customer_subscriptions.d.ts +1 -34
- package/lib/esm/resources/customer_subscriptions.js +1 -43
- package/lib/esm/resources/customers.d.ts +1 -75
- package/lib/esm/resources/customers.js +1 -75
- package/lib/esm/resources/delivery_lead_times.d.ts +1 -54
- package/lib/esm/resources/delivery_lead_times.js +1 -47
- package/lib/esm/resources/event_callbacks.d.ts +1 -24
- package/lib/esm/resources/event_callbacks.js +1 -26
- package/lib/esm/resources/events.d.ts +1 -24
- package/lib/esm/resources/events.js +1 -30
- package/lib/esm/resources/exports.d.ts +1 -40
- package/lib/esm/resources/exports.js +1 -32
- package/lib/esm/resources/external_gateways.d.ts +1 -55
- package/lib/esm/resources/external_gateways.js +1 -43
- package/lib/esm/resources/external_payments.d.ts +1 -47
- package/lib/esm/resources/external_payments.js +1 -47
- package/lib/esm/resources/external_promotions.d.ts +1 -132
- package/lib/esm/resources/external_promotions.js +1 -79
- package/lib/esm/resources/external_tax_calculators.d.ts +1 -43
- package/lib/esm/resources/external_tax_calculators.js +1 -43
- package/lib/esm/resources/fixed_amount_promotions.d.ts +1 -130
- package/lib/esm/resources/fixed_amount_promotions.js +1 -79
- package/lib/esm/resources/fixed_price_promotions.d.ts +1 -130
- package/lib/esm/resources/fixed_price_promotions.js +1 -79
- package/lib/esm/resources/free_gift_promotions.d.ts +1 -128
- package/lib/esm/resources/free_gift_promotions.js +1 -79
- package/lib/esm/resources/free_shipping_promotions.d.ts +1 -122
- package/lib/esm/resources/free_shipping_promotions.js +1 -75
- package/lib/esm/resources/geocoders.d.ts +1 -24
- package/lib/esm/resources/geocoders.js +1 -30
- package/lib/esm/resources/gift_card_recipients.d.ts +1 -47
- package/lib/esm/resources/gift_card_recipients.js +1 -43
- package/lib/esm/resources/gift_cards.d.ts +1 -99
- package/lib/esm/resources/gift_cards.js +1 -55
- package/lib/esm/resources/google_geocoders.d.ts +1 -35
- package/lib/esm/resources/google_geocoders.js +1 -39
- package/lib/esm/resources/imports.d.ts +1 -43
- package/lib/esm/resources/imports.js +1 -32
- package/lib/esm/resources/in_stock_subscriptions.d.ts +1 -65
- package/lib/esm/resources/in_stock_subscriptions.js +1 -51
- package/lib/esm/resources/inventory_models.d.ts +1 -54
- package/lib/esm/resources/inventory_models.js +1 -47
- package/lib/esm/resources/inventory_return_locations.d.ts +1 -46
- package/lib/esm/resources/inventory_return_locations.js +1 -43
- package/lib/esm/resources/inventory_stock_locations.d.ts +1 -49
- package/lib/esm/resources/inventory_stock_locations.js +1 -43
- package/lib/esm/resources/klarna_gateways.d.ts +1 -47
- package/lib/esm/resources/klarna_gateways.js +1 -43
- package/lib/esm/resources/klarna_payments.d.ts +1 -46
- package/lib/esm/resources/klarna_payments.js +1 -43
- package/lib/esm/resources/line_item_options.d.ts +1 -68
- package/lib/esm/resources/line_item_options.js +1 -47
- package/lib/esm/resources/line_items.d.ts +1 -166
- package/lib/esm/resources/line_items.js +1 -63
- package/lib/esm/resources/manual_gateways.d.ts +1 -33
- package/lib/esm/resources/manual_gateways.js +1 -39
- package/lib/esm/resources/manual_tax_calculators.d.ts +1 -44
- package/lib/esm/resources/manual_tax_calculators.js +1 -47
- package/lib/esm/resources/markets.d.ts +1 -104
- package/lib/esm/resources/markets.js +1 -63
- package/lib/esm/resources/merchants.d.ts +1 -41
- package/lib/esm/resources/merchants.js +1 -43
- package/lib/esm/resources/order_amount_promotion_rules.d.ts +1 -66
- package/lib/esm/resources/order_amount_promotion_rules.js +1 -35
- package/lib/esm/resources/order_copies.d.ts +1 -50
- package/lib/esm/resources/order_copies.js +1 -47
- package/lib/esm/resources/order_factories.d.ts +1 -33
- package/lib/esm/resources/order_factories.js +1 -34
- package/lib/esm/resources/order_subscription_items.d.ts +1 -71
- package/lib/esm/resources/order_subscription_items.js +1 -39
- package/lib/esm/resources/order_subscriptions.d.ts +1 -94
- package/lib/esm/resources/order_subscriptions.js +1 -75
- package/lib/esm/resources/order_validation_rules.d.ts +1 -26
- package/lib/esm/resources/order_validation_rules.js +1 -34
- package/lib/esm/resources/orders.d.ts +1 -359
- package/lib/esm/resources/orders.js +1 -155
- package/lib/esm/resources/organization.d.ts +1 -33
- package/lib/esm/resources/organization.js +1 -19
- package/lib/esm/resources/packages.d.ts +1 -59
- package/lib/esm/resources/packages.js +1 -47
- package/lib/esm/resources/parcel_line_items.d.ts +1 -46
- package/lib/esm/resources/parcel_line_items.js +1 -43
- package/lib/esm/resources/parcels.d.ts +1 -125
- package/lib/esm/resources/parcels.js +1 -55
- package/lib/esm/resources/payment_gateways.d.ts +1 -24
- package/lib/esm/resources/payment_gateways.js +1 -30
- package/lib/esm/resources/payment_methods.d.ts +1 -80
- package/lib/esm/resources/payment_methods.js +1 -47
- package/lib/esm/resources/payment_options.d.ts +1 -43
- package/lib/esm/resources/payment_options.js +1 -39
- package/lib/esm/resources/paypal_gateways.d.ts +1 -40
- package/lib/esm/resources/paypal_gateways.js +1 -43
- package/lib/esm/resources/paypal_payments.d.ts +1 -52
- package/lib/esm/resources/paypal_payments.js +1 -43
- package/lib/esm/resources/percentage_discount_promotions.d.ts +1 -128
- package/lib/esm/resources/percentage_discount_promotions.js +1 -79
- package/lib/esm/resources/price_frequency_tiers.d.ts +1 -52
- package/lib/esm/resources/price_frequency_tiers.js +1 -47
- package/lib/esm/resources/price_lists.d.ts +1 -45
- package/lib/esm/resources/price_lists.js +1 -43
- package/lib/esm/resources/price_tiers.d.ts +1 -31
- package/lib/esm/resources/price_tiers.js +1 -34
- package/lib/esm/resources/price_volume_tiers.d.ts +1 -52
- package/lib/esm/resources/price_volume_tiers.js +1 -47
- package/lib/esm/resources/prices.d.ts +1 -83
- package/lib/esm/resources/prices.js +1 -71
- package/lib/esm/resources/promotion_rules.d.ts +1 -28
- package/lib/esm/resources/promotion_rules.js +1 -26
- package/lib/esm/resources/promotions.d.ts +1 -62
- package/lib/esm/resources/promotions.js +1 -66
- package/lib/esm/resources/recurring_order_copies.d.ts +1 -52
- package/lib/esm/resources/recurring_order_copies.js +1 -47
- package/lib/esm/resources/refunds.d.ts +1 -43
- package/lib/esm/resources/refunds.js +1 -42
- package/lib/esm/resources/reserved_stocks.d.ts +1 -27
- package/lib/esm/resources/reserved_stocks.js +1 -34
- package/lib/esm/resources/resource_errors.d.ts +1 -22
- package/lib/esm/resources/resource_errors.js +1 -22
- package/lib/esm/resources/return_line_items.d.ts +1 -50
- package/lib/esm/resources/return_line_items.js +1 -39
- package/lib/esm/resources/returns.d.ts +1 -86
- package/lib/esm/resources/returns.js +1 -71
- package/lib/esm/resources/satispay_gateways.d.ts +1 -45
- package/lib/esm/resources/satispay_gateways.js +1 -43
- package/lib/esm/resources/satispay_payments.d.ts +1 -48
- package/lib/esm/resources/satispay_payments.js +1 -43
- package/lib/esm/resources/shipments.d.ts +1 -139
- package/lib/esm/resources/shipments.js +1 -103
- package/lib/esm/resources/shipping_categories.d.ts +1 -39
- package/lib/esm/resources/shipping_categories.js +1 -43
- package/lib/esm/resources/shipping_method_tiers.d.ts +1 -31
- package/lib/esm/resources/shipping_method_tiers.js +1 -34
- package/lib/esm/resources/shipping_methods.d.ts +1 -121
- package/lib/esm/resources/shipping_methods.js +1 -67
- package/lib/esm/resources/shipping_weight_tiers.d.ts +1 -49
- package/lib/esm/resources/shipping_weight_tiers.js +1 -43
- package/lib/esm/resources/shipping_zones.d.ts +1 -51
- package/lib/esm/resources/shipping_zones.js +1 -39
- package/lib/esm/resources/sku_list_items.d.ts +1 -50
- package/lib/esm/resources/sku_list_items.js +1 -43
- package/lib/esm/resources/sku_list_promotion_rules.d.ts +1 -75
- package/lib/esm/resources/sku_list_promotion_rules.js +1 -43
- package/lib/esm/resources/sku_lists.d.ts +1 -63
- package/lib/esm/resources/sku_lists.js +1 -55
- package/lib/esm/resources/sku_options.d.ts +1 -70
- package/lib/esm/resources/sku_options.js +1 -51
- package/lib/esm/resources/skus.d.ts +1 -95
- package/lib/esm/resources/skus.js +1 -71
- package/lib/esm/resources/stock_items.d.ts +1 -59
- package/lib/esm/resources/stock_items.js +1 -55
- package/lib/esm/resources/stock_line_items.d.ts +1 -69
- package/lib/esm/resources/stock_line_items.js +1 -51
- package/lib/esm/resources/stock_locations.d.ts +1 -63
- package/lib/esm/resources/stock_locations.js +1 -59
- package/lib/esm/resources/stock_reservations.d.ts +1 -49
- package/lib/esm/resources/stock_reservations.js +1 -51
- package/lib/esm/resources/stock_transfers.d.ts +1 -79
- package/lib/esm/resources/stock_transfers.js +1 -59
- package/lib/esm/resources/stripe_gateways.d.ts +1 -44
- package/lib/esm/resources/stripe_gateways.js +1 -43
- package/lib/esm/resources/stripe_payments.d.ts +1 -56
- package/lib/esm/resources/stripe_payments.js +1 -43
- package/lib/esm/resources/subscription_models.d.ts +1 -48
- package/lib/esm/resources/subscription_models.js +1 -43
- package/lib/esm/resources/tags.d.ts +1 -27
- package/lib/esm/resources/tags.js +1 -31
- package/lib/esm/resources/tax_calculators.d.ts +1 -27
- package/lib/esm/resources/tax_calculators.js +1 -34
- package/lib/esm/resources/tax_categories.d.ts +1 -62
- package/lib/esm/resources/tax_categories.js +1 -43
- package/lib/esm/resources/tax_rules.d.ts +1 -72
- package/lib/esm/resources/tax_rules.js +1 -39
- package/lib/esm/resources/taxjar_accounts.d.ts +1 -46
- package/lib/esm/resources/taxjar_accounts.js +1 -47
- package/lib/esm/resources/transactions.d.ts +1 -40
- package/lib/esm/resources/transactions.js +1 -38
- package/lib/esm/resources/versions.d.ts +1 -22
- package/lib/esm/resources/versions.js +1 -22
- package/lib/esm/resources/voids.d.ts +1 -43
- package/lib/esm/resources/voids.js +1 -42
- package/lib/esm/resources/webhooks.d.ts +1 -51
- package/lib/esm/resources/webhooks.js +1 -39
- package/lib/esm/resources/wire_transfers.d.ts +1 -36
- package/lib/esm/resources/wire_transfers.js +1 -39
- package/lib/esm/static.d.ts +1 -9
- package/lib/esm/static.js +1 -19
- package/lib/esm/util.d.ts +1 -6
- package/lib/esm/util.js +1 -11
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
@@ -1,66 +1 @@
|
|
1
|
-
import
|
2
|
-
class Promotions extends ApiResource {
|
3
|
-
// static readonly PATH = 'promotions'
|
4
|
-
async list(params, options) {
|
5
|
-
return this.resources.list({ type: Promotions.TYPE }, params, options);
|
6
|
-
}
|
7
|
-
async retrieve(id, params, options) {
|
8
|
-
return this.resources.retrieve({ type: Promotions.TYPE, id }, params, options);
|
9
|
-
}
|
10
|
-
async market(promotionId, params, options) {
|
11
|
-
const _promotionId = promotionId.id || promotionId;
|
12
|
-
return this.resources.fetch({ type: 'markets' }, `promotions/${_promotionId}/market`, params, options);
|
13
|
-
}
|
14
|
-
async order_amount_promotion_rule(promotionId, params, options) {
|
15
|
-
const _promotionId = promotionId.id || promotionId;
|
16
|
-
return this.resources.fetch({ type: 'order_amount_promotion_rules' }, `promotions/${_promotionId}/order_amount_promotion_rule`, params, options);
|
17
|
-
}
|
18
|
-
async sku_list_promotion_rule(promotionId, params, options) {
|
19
|
-
const _promotionId = promotionId.id || promotionId;
|
20
|
-
return this.resources.fetch({ type: 'sku_list_promotion_rules' }, `promotions/${_promotionId}/sku_list_promotion_rule`, params, options);
|
21
|
-
}
|
22
|
-
async coupon_codes_promotion_rule(promotionId, params, options) {
|
23
|
-
const _promotionId = promotionId.id || promotionId;
|
24
|
-
return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `promotions/${_promotionId}/coupon_codes_promotion_rule`, params, options);
|
25
|
-
}
|
26
|
-
async custom_promotion_rule(promotionId, params, options) {
|
27
|
-
const _promotionId = promotionId.id || promotionId;
|
28
|
-
return this.resources.fetch({ type: 'custom_promotion_rules' }, `promotions/${_promotionId}/custom_promotion_rule`, params, options);
|
29
|
-
}
|
30
|
-
async sku_list(promotionId, params, options) {
|
31
|
-
const _promotionId = promotionId.id || promotionId;
|
32
|
-
return this.resources.fetch({ type: 'sku_lists' }, `promotions/${_promotionId}/sku_list`, params, options);
|
33
|
-
}
|
34
|
-
async coupons(promotionId, params, options) {
|
35
|
-
const _promotionId = promotionId.id || promotionId;
|
36
|
-
return this.resources.fetch({ type: 'coupons' }, `promotions/${_promotionId}/coupons`, params, options);
|
37
|
-
}
|
38
|
-
async attachments(promotionId, params, options) {
|
39
|
-
const _promotionId = promotionId.id || promotionId;
|
40
|
-
return this.resources.fetch({ type: 'attachments' }, `promotions/${_promotionId}/attachments`, params, options);
|
41
|
-
}
|
42
|
-
async events(promotionId, params, options) {
|
43
|
-
const _promotionId = promotionId.id || promotionId;
|
44
|
-
return this.resources.fetch({ type: 'events' }, `promotions/${_promotionId}/events`, params, options);
|
45
|
-
}
|
46
|
-
async tags(promotionId, params, options) {
|
47
|
-
const _promotionId = promotionId.id || promotionId;
|
48
|
-
return this.resources.fetch({ type: 'tags' }, `promotions/${_promotionId}/tags`, params, options);
|
49
|
-
}
|
50
|
-
async versions(promotionId, params, options) {
|
51
|
-
const _promotionId = promotionId.id || promotionId;
|
52
|
-
return this.resources.fetch({ type: 'versions' }, `promotions/${_promotionId}/versions`, params, options);
|
53
|
-
}
|
54
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
55
|
-
isPromotion(resource) {
|
56
|
-
return resource.type && (resource.type === Promotions.TYPE);
|
57
|
-
}
|
58
|
-
relationship(id) {
|
59
|
-
return ((id === null) || (typeof id === 'string')) ? { id, type: Promotions.TYPE } : { id: id.id, type: Promotions.TYPE };
|
60
|
-
}
|
61
|
-
type() {
|
62
|
-
return Promotions.TYPE;
|
63
|
-
}
|
64
|
-
}
|
65
|
-
Promotions.TYPE = 'promotions';
|
66
|
-
export default Promotions;
|
1
|
+
import{ApiResource as n}from"../resource";class r extends n{async list(t,s){return this.resources.list({type:r.TYPE},t,s)}async retrieve(t,s,e){return this.resources.retrieve({type:r.TYPE,id:t},s,e)}async market(t,s,e){const o=t.id||t;return this.resources.fetch({type:"markets"},`promotions/${o}/market`,s,e)}async order_amount_promotion_rule(t,s,e){const o=t.id||t;return this.resources.fetch({type:"order_amount_promotion_rules"},`promotions/${o}/order_amount_promotion_rule`,s,e)}async sku_list_promotion_rule(t,s,e){const o=t.id||t;return this.resources.fetch({type:"sku_list_promotion_rules"},`promotions/${o}/sku_list_promotion_rule`,s,e)}async coupon_codes_promotion_rule(t,s,e){const o=t.id||t;return this.resources.fetch({type:"coupon_codes_promotion_rules"},`promotions/${o}/coupon_codes_promotion_rule`,s,e)}async custom_promotion_rule(t,s,e){const o=t.id||t;return this.resources.fetch({type:"custom_promotion_rules"},`promotions/${o}/custom_promotion_rule`,s,e)}async sku_list(t,s,e){const o=t.id||t;return this.resources.fetch({type:"sku_lists"},`promotions/${o}/sku_list`,s,e)}async coupons(t,s,e){const o=t.id||t;return this.resources.fetch({type:"coupons"},`promotions/${o}/coupons`,s,e)}async attachments(t,s,e){const o=t.id||t;return this.resources.fetch({type:"attachments"},`promotions/${o}/attachments`,s,e)}async events(t,s,e){const o=t.id||t;return this.resources.fetch({type:"events"},`promotions/${o}/events`,s,e)}async tags(t,s,e){const o=t.id||t;return this.resources.fetch({type:"tags"},`promotions/${o}/tags`,s,e)}async versions(t,s,e){const o=t.id||t;return this.resources.fetch({type:"versions"},`promotions/${o}/versions`,s,e)}isPromotion(t){return t.type&&t.type===r.TYPE}relationship(t){return t===null||typeof t=="string"?{id:t,type:r.TYPE}:{id:t.id,type:r.TYPE}}type(){return r.TYPE}}r.TYPE="promotions";export default r;
|
@@ -1,52 +1 @@
|
|
1
|
-
import
|
2
|
-
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import type { Order } from './orders';
|
4
|
-
import type { Event } from './events';
|
5
|
-
import type { OrderSubscription } from './order_subscriptions';
|
6
|
-
type RecurringOrderCopyRel = ResourceRel & {
|
7
|
-
type: typeof RecurringOrderCopies.TYPE;
|
8
|
-
};
|
9
|
-
type OrderRel = ResourceRel & {
|
10
|
-
type: 'orders';
|
11
|
-
};
|
12
|
-
type OrderSubscriptionRel = ResourceRel & {
|
13
|
-
type: 'order_subscriptions';
|
14
|
-
};
|
15
|
-
interface RecurringOrderCopy extends Resource {
|
16
|
-
status?: string;
|
17
|
-
started_at?: string;
|
18
|
-
completed_at?: string;
|
19
|
-
failed_at?: string;
|
20
|
-
errors_log?: object;
|
21
|
-
errors_count?: number;
|
22
|
-
place_target_order?: boolean;
|
23
|
-
reuse_wallet?: boolean;
|
24
|
-
source_order?: Order;
|
25
|
-
target_order?: Order;
|
26
|
-
events?: Event[];
|
27
|
-
order_subscription?: OrderSubscription;
|
28
|
-
}
|
29
|
-
interface RecurringOrderCopyCreate extends ResourceCreate {
|
30
|
-
place_target_order?: boolean;
|
31
|
-
reuse_wallet?: boolean;
|
32
|
-
source_order: OrderRel;
|
33
|
-
order_subscription: OrderSubscriptionRel;
|
34
|
-
}
|
35
|
-
type RecurringOrderCopyUpdate = ResourceUpdate;
|
36
|
-
declare class RecurringOrderCopies extends ApiResource {
|
37
|
-
static readonly TYPE: 'recurring_order_copies';
|
38
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<RecurringOrderCopy>>;
|
39
|
-
create(resource: RecurringOrderCopyCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<RecurringOrderCopy>;
|
40
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<RecurringOrderCopy>;
|
41
|
-
update(resource: RecurringOrderCopyUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<RecurringOrderCopy>;
|
42
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
43
|
-
source_order(recurringOrderCopyId: string | RecurringOrderCopy, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
44
|
-
target_order(recurringOrderCopyId: string | RecurringOrderCopy, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
45
|
-
events(recurringOrderCopyId: string | RecurringOrderCopy, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
46
|
-
order_subscription(recurringOrderCopyId: string | RecurringOrderCopy, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderSubscription>;
|
47
|
-
isRecurringOrderCopy(resource: any): resource is RecurringOrderCopy;
|
48
|
-
relationship(id: string | ResourceId | null): RecurringOrderCopyRel;
|
49
|
-
type(): string;
|
50
|
-
}
|
51
|
-
export default RecurringOrderCopies;
|
52
|
-
export { RecurringOrderCopy, RecurringOrderCopyCreate, RecurringOrderCopyUpdate };
|
1
|
+
import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Order}from'./orders';import type{Event}from'./events';import type{OrderSubscription}from'./order_subscriptions';type RecurringOrderCopyRel=ResourceRel&{type:typeof RecurringOrderCopies.TYPE;};type OrderRel=ResourceRel&{type:'orders';};type OrderSubscriptionRel=ResourceRel&{type:'order_subscriptions';};interface RecurringOrderCopy extends Resource{status?:string;started_at?:string;completed_at?:string;failed_at?:string;errors_log?:object;errors_count?:number;place_target_order?:boolean;reuse_wallet?:boolean;source_order?:Order;target_order?:Order;events?:Event[];order_subscription?:OrderSubscription;}interface RecurringOrderCopyCreate extends ResourceCreate{place_target_order?:boolean;reuse_wallet?:boolean;source_order:OrderRel;order_subscription:OrderSubscriptionRel;}type RecurringOrderCopyUpdate=ResourceUpdate;declare class RecurringOrderCopies extends ApiResource{static readonly TYPE:'recurring_order_copies';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<RecurringOrderCopy>>;create(resource:RecurringOrderCopyCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<RecurringOrderCopy>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<RecurringOrderCopy>;update(resource:RecurringOrderCopyUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<RecurringOrderCopy>;delete(id:string,options?:ResourcesConfig):Promise<void>;source_order(recurringOrderCopyId:string|RecurringOrderCopy,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Order>;target_order(recurringOrderCopyId:string|RecurringOrderCopy,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Order>;events(recurringOrderCopyId:string|RecurringOrderCopy,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Event>>;order_subscription(recurringOrderCopyId:string|RecurringOrderCopy,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<OrderSubscription>;isRecurringOrderCopy(resource:any):resource is RecurringOrderCopy;relationship(id:string|ResourceId|null):RecurringOrderCopyRel;type():string;}export default RecurringOrderCopies;export{RecurringOrderCopy,RecurringOrderCopyCreate,RecurringOrderCopyUpdate};
|
@@ -1,47 +1 @@
|
|
1
|
-
import
|
2
|
-
class RecurringOrderCopies extends ApiResource {
|
3
|
-
// static readonly PATH = 'recurring_order_copies'
|
4
|
-
async list(params, options) {
|
5
|
-
return this.resources.list({ type: RecurringOrderCopies.TYPE }, params, options);
|
6
|
-
}
|
7
|
-
async create(resource, params, options) {
|
8
|
-
return this.resources.create(Object.assign(Object.assign({}, resource), { type: RecurringOrderCopies.TYPE }), params, options);
|
9
|
-
}
|
10
|
-
async retrieve(id, params, options) {
|
11
|
-
return this.resources.retrieve({ type: RecurringOrderCopies.TYPE, id }, params, options);
|
12
|
-
}
|
13
|
-
async update(resource, params, options) {
|
14
|
-
return this.resources.update(Object.assign(Object.assign({}, resource), { type: RecurringOrderCopies.TYPE }), params, options);
|
15
|
-
}
|
16
|
-
async delete(id, options) {
|
17
|
-
await this.resources.delete({ type: RecurringOrderCopies.TYPE, id }, options);
|
18
|
-
}
|
19
|
-
async source_order(recurringOrderCopyId, params, options) {
|
20
|
-
const _recurringOrderCopyId = recurringOrderCopyId.id || recurringOrderCopyId;
|
21
|
-
return this.resources.fetch({ type: 'orders' }, `recurring_order_copies/${_recurringOrderCopyId}/source_order`, params, options);
|
22
|
-
}
|
23
|
-
async target_order(recurringOrderCopyId, params, options) {
|
24
|
-
const _recurringOrderCopyId = recurringOrderCopyId.id || recurringOrderCopyId;
|
25
|
-
return this.resources.fetch({ type: 'orders' }, `recurring_order_copies/${_recurringOrderCopyId}/target_order`, params, options);
|
26
|
-
}
|
27
|
-
async events(recurringOrderCopyId, params, options) {
|
28
|
-
const _recurringOrderCopyId = recurringOrderCopyId.id || recurringOrderCopyId;
|
29
|
-
return this.resources.fetch({ type: 'events' }, `recurring_order_copies/${_recurringOrderCopyId}/events`, params, options);
|
30
|
-
}
|
31
|
-
async order_subscription(recurringOrderCopyId, params, options) {
|
32
|
-
const _recurringOrderCopyId = recurringOrderCopyId.id || recurringOrderCopyId;
|
33
|
-
return this.resources.fetch({ type: 'order_subscriptions' }, `recurring_order_copies/${_recurringOrderCopyId}/order_subscription`, params, options);
|
34
|
-
}
|
35
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
36
|
-
isRecurringOrderCopy(resource) {
|
37
|
-
return resource.type && (resource.type === RecurringOrderCopies.TYPE);
|
38
|
-
}
|
39
|
-
relationship(id) {
|
40
|
-
return ((id === null) || (typeof id === 'string')) ? { id, type: RecurringOrderCopies.TYPE } : { id: id.id, type: RecurringOrderCopies.TYPE };
|
41
|
-
}
|
42
|
-
type() {
|
43
|
-
return RecurringOrderCopies.TYPE;
|
44
|
-
}
|
45
|
-
}
|
46
|
-
RecurringOrderCopies.TYPE = 'recurring_order_copies';
|
47
|
-
export default RecurringOrderCopies;
|
1
|
+
import{ApiResource as n}from"../resource";class s extends n{async list(e,t){return this.resources.list({type:s.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:s.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:s.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:s.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:s.TYPE,id:e},t)}async source_order(e,t,r){const c=e.id||e;return this.resources.fetch({type:"orders"},`recurring_order_copies/${c}/source_order`,t,r)}async target_order(e,t,r){const c=e.id||e;return this.resources.fetch({type:"orders"},`recurring_order_copies/${c}/target_order`,t,r)}async events(e,t,r){const c=e.id||e;return this.resources.fetch({type:"events"},`recurring_order_copies/${c}/events`,t,r)}async order_subscription(e,t,r){const c=e.id||e;return this.resources.fetch({type:"order_subscriptions"},`recurring_order_copies/${c}/order_subscription`,t,r)}isRecurringOrderCopy(e){return e.type&&e.type===s.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:s.TYPE}:{id:e.id,type:s.TYPE}}type(){return s.TYPE}}s.TYPE="recurring_order_copies";export default s;
|
@@ -1,43 +1 @@
|
|
1
|
-
import
|
2
|
-
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import type { Order } from './orders';
|
4
|
-
import type { Attachment } from './attachments';
|
5
|
-
import type { Event } from './events';
|
6
|
-
import type { Version } from './versions';
|
7
|
-
import type { Capture } from './captures';
|
8
|
-
type RefundRel = ResourceRel & {
|
9
|
-
type: typeof Refunds.TYPE;
|
10
|
-
};
|
11
|
-
interface Refund extends Resource {
|
12
|
-
number?: string;
|
13
|
-
currency_code?: string;
|
14
|
-
amount_cents?: number;
|
15
|
-
amount_float?: number;
|
16
|
-
formatted_amount?: string;
|
17
|
-
succeeded?: boolean;
|
18
|
-
message?: string;
|
19
|
-
error_code?: string;
|
20
|
-
error_detail?: string;
|
21
|
-
token?: string;
|
22
|
-
gateway_transaction_id?: string;
|
23
|
-
order?: Order;
|
24
|
-
attachments?: Attachment[];
|
25
|
-
events?: Event[];
|
26
|
-
versions?: Version[];
|
27
|
-
reference_capture?: Capture;
|
28
|
-
}
|
29
|
-
declare class Refunds extends ApiResource {
|
30
|
-
static readonly TYPE: 'refunds';
|
31
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Refund>>;
|
32
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Refund>;
|
33
|
-
order(refundId: string | Refund, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
34
|
-
attachments(refundId: string | Refund, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
35
|
-
events(refundId: string | Refund, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
36
|
-
versions(refundId: string | Refund, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
37
|
-
reference_capture(refundId: string | Refund, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Capture>;
|
38
|
-
isRefund(resource: any): resource is Refund;
|
39
|
-
relationship(id: string | ResourceId | null): RefundRel;
|
40
|
-
type(): string;
|
41
|
-
}
|
42
|
-
export default Refunds;
|
43
|
-
export { Refund };
|
1
|
+
import{ApiResource,Resource,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Order}from'./orders';import type{Attachment}from'./attachments';import type{Event}from'./events';import type{Version}from'./versions';import type{Capture}from'./captures';type RefundRel=ResourceRel&{type:typeof Refunds.TYPE;};interface Refund extends Resource{number?:string;currency_code?:string;amount_cents?:number;amount_float?:number;formatted_amount?:string;succeeded?:boolean;message?:string;error_code?:string;error_detail?:string;token?:string;gateway_transaction_id?:string;order?:Order;attachments?:Attachment[];events?:Event[];versions?:Version[];reference_capture?:Capture;}declare class Refunds extends ApiResource{static readonly TYPE:'refunds';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Refund>>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Refund>;order(refundId:string|Refund,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Order>;attachments(refundId:string|Refund,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;events(refundId:string|Refund,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Event>>;versions(refundId:string|Refund,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Version>>;reference_capture(refundId:string|Refund,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Capture>;isRefund(resource:any):resource is Refund;relationship(id:string|ResourceId|null):RefundRel;type():string;}export default Refunds;export{Refund};
|
@@ -1,42 +1 @@
|
|
1
|
-
import
|
2
|
-
class Refunds extends ApiResource {
|
3
|
-
// static readonly PATH = 'refunds'
|
4
|
-
async list(params, options) {
|
5
|
-
return this.resources.list({ type: Refunds.TYPE }, params, options);
|
6
|
-
}
|
7
|
-
async retrieve(id, params, options) {
|
8
|
-
return this.resources.retrieve({ type: Refunds.TYPE, id }, params, options);
|
9
|
-
}
|
10
|
-
async order(refundId, params, options) {
|
11
|
-
const _refundId = refundId.id || refundId;
|
12
|
-
return this.resources.fetch({ type: 'orders' }, `refunds/${_refundId}/order`, params, options);
|
13
|
-
}
|
14
|
-
async attachments(refundId, params, options) {
|
15
|
-
const _refundId = refundId.id || refundId;
|
16
|
-
return this.resources.fetch({ type: 'attachments' }, `refunds/${_refundId}/attachments`, params, options);
|
17
|
-
}
|
18
|
-
async events(refundId, params, options) {
|
19
|
-
const _refundId = refundId.id || refundId;
|
20
|
-
return this.resources.fetch({ type: 'events' }, `refunds/${_refundId}/events`, params, options);
|
21
|
-
}
|
22
|
-
async versions(refundId, params, options) {
|
23
|
-
const _refundId = refundId.id || refundId;
|
24
|
-
return this.resources.fetch({ type: 'versions' }, `refunds/${_refundId}/versions`, params, options);
|
25
|
-
}
|
26
|
-
async reference_capture(refundId, params, options) {
|
27
|
-
const _refundId = refundId.id || refundId;
|
28
|
-
return this.resources.fetch({ type: 'captures' }, `refunds/${_refundId}/reference_capture`, params, options);
|
29
|
-
}
|
30
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
31
|
-
isRefund(resource) {
|
32
|
-
return resource.type && (resource.type === Refunds.TYPE);
|
33
|
-
}
|
34
|
-
relationship(id) {
|
35
|
-
return ((id === null) || (typeof id === 'string')) ? { id, type: Refunds.TYPE } : { id: id.id, type: Refunds.TYPE };
|
36
|
-
}
|
37
|
-
type() {
|
38
|
-
return Refunds.TYPE;
|
39
|
-
}
|
40
|
-
}
|
41
|
-
Refunds.TYPE = 'refunds';
|
42
|
-
export default Refunds;
|
1
|
+
import{ApiResource as c}from"../resource";class n extends c{async list(e,t){return this.resources.list({type:n.TYPE},e,t)}async retrieve(e,t,r){return this.resources.retrieve({type:n.TYPE,id:e},t,r)}async order(e,t,r){const s=e.id||e;return this.resources.fetch({type:"orders"},`refunds/${s}/order`,t,r)}async attachments(e,t,r){const s=e.id||e;return this.resources.fetch({type:"attachments"},`refunds/${s}/attachments`,t,r)}async events(e,t,r){const s=e.id||e;return this.resources.fetch({type:"events"},`refunds/${s}/events`,t,r)}async versions(e,t,r){const s=e.id||e;return this.resources.fetch({type:"versions"},`refunds/${s}/versions`,t,r)}async reference_capture(e,t,r){const s=e.id||e;return this.resources.fetch({type:"captures"},`refunds/${s}/reference_capture`,t,r)}isRefund(e){return e.type&&e.type===n.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:n.TYPE}:{id:e.id,type:n.TYPE}}type(){return n.TYPE}}n.TYPE="refunds";export default n;
|
@@ -1,27 +1 @@
|
|
1
|
-
import
|
2
|
-
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import type { StockItem } from './stock_items';
|
4
|
-
import type { Sku } from './skus';
|
5
|
-
import type { StockReservation } from './stock_reservations';
|
6
|
-
type ReservedStockRel = ResourceRel & {
|
7
|
-
type: typeof ReservedStocks.TYPE;
|
8
|
-
};
|
9
|
-
interface ReservedStock extends Resource {
|
10
|
-
quantity?: number;
|
11
|
-
stock_item?: StockItem;
|
12
|
-
sku?: Sku;
|
13
|
-
stock_reservations?: StockReservation[];
|
14
|
-
}
|
15
|
-
declare class ReservedStocks extends ApiResource {
|
16
|
-
static readonly TYPE: 'reserved_stocks';
|
17
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ReservedStock>>;
|
18
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ReservedStock>;
|
19
|
-
stock_item(reservedStockId: string | ReservedStock, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockItem>;
|
20
|
-
sku(reservedStockId: string | ReservedStock, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
|
21
|
-
stock_reservations(reservedStockId: string | ReservedStock, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockReservation>>;
|
22
|
-
isReservedStock(resource: any): resource is ReservedStock;
|
23
|
-
relationship(id: string | ResourceId | null): ReservedStockRel;
|
24
|
-
type(): string;
|
25
|
-
}
|
26
|
-
export default ReservedStocks;
|
27
|
-
export { ReservedStock };
|
1
|
+
import{ApiResource,Resource,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{StockItem}from'./stock_items';import type{Sku}from'./skus';import type{StockReservation}from'./stock_reservations';type ReservedStockRel=ResourceRel&{type:typeof ReservedStocks.TYPE;};interface ReservedStock extends Resource{quantity?:number;stock_item?:StockItem;sku?:Sku;stock_reservations?:StockReservation[];}declare class ReservedStocks extends ApiResource{static readonly TYPE:'reserved_stocks';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<ReservedStock>>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ReservedStock>;stock_item(reservedStockId:string|ReservedStock,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockItem>;sku(reservedStockId:string|ReservedStock,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Sku>;stock_reservations(reservedStockId:string|ReservedStock,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<StockReservation>>;isReservedStock(resource:any):resource is ReservedStock;relationship(id:string|ResourceId|null):ReservedStockRel;type():string;}export default ReservedStocks;export{ReservedStock};
|
@@ -1,34 +1 @@
|
|
1
|
-
import
|
2
|
-
class ReservedStocks extends ApiResource {
|
3
|
-
// static readonly PATH = 'reserved_stocks'
|
4
|
-
async list(params, options) {
|
5
|
-
return this.resources.list({ type: ReservedStocks.TYPE }, params, options);
|
6
|
-
}
|
7
|
-
async retrieve(id, params, options) {
|
8
|
-
return this.resources.retrieve({ type: ReservedStocks.TYPE, id }, params, options);
|
9
|
-
}
|
10
|
-
async stock_item(reservedStockId, params, options) {
|
11
|
-
const _reservedStockId = reservedStockId.id || reservedStockId;
|
12
|
-
return this.resources.fetch({ type: 'stock_items' }, `reserved_stocks/${_reservedStockId}/stock_item`, params, options);
|
13
|
-
}
|
14
|
-
async sku(reservedStockId, params, options) {
|
15
|
-
const _reservedStockId = reservedStockId.id || reservedStockId;
|
16
|
-
return this.resources.fetch({ type: 'skus' }, `reserved_stocks/${_reservedStockId}/sku`, params, options);
|
17
|
-
}
|
18
|
-
async stock_reservations(reservedStockId, params, options) {
|
19
|
-
const _reservedStockId = reservedStockId.id || reservedStockId;
|
20
|
-
return this.resources.fetch({ type: 'stock_reservations' }, `reserved_stocks/${_reservedStockId}/stock_reservations`, params, options);
|
21
|
-
}
|
22
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
23
|
-
isReservedStock(resource) {
|
24
|
-
return resource.type && (resource.type === ReservedStocks.TYPE);
|
25
|
-
}
|
26
|
-
relationship(id) {
|
27
|
-
return ((id === null) || (typeof id === 'string')) ? { id, type: ReservedStocks.TYPE } : { id: id.id, type: ReservedStocks.TYPE };
|
28
|
-
}
|
29
|
-
type() {
|
30
|
-
return ReservedStocks.TYPE;
|
31
|
-
}
|
32
|
-
}
|
33
|
-
ReservedStocks.TYPE = 'reserved_stocks';
|
34
|
-
export default ReservedStocks;
|
1
|
+
import{ApiResource as i}from"../resource";class s extends i{async list(e,t){return this.resources.list({type:s.TYPE},e,t)}async retrieve(e,t,r){return this.resources.retrieve({type:s.TYPE,id:e},t,r)}async stock_item(e,t,r){const c=e.id||e;return this.resources.fetch({type:"stock_items"},`reserved_stocks/${c}/stock_item`,t,r)}async sku(e,t,r){const c=e.id||e;return this.resources.fetch({type:"skus"},`reserved_stocks/${c}/sku`,t,r)}async stock_reservations(e,t,r){const c=e.id||e;return this.resources.fetch({type:"stock_reservations"},`reserved_stocks/${c}/stock_reservations`,t,r)}isReservedStock(e){return e.type&&e.type===s.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:s.TYPE}:{id:e.id,type:s.TYPE}}type(){return s.TYPE}}s.TYPE="reserved_stocks";export default s;
|
@@ -1,22 +1 @@
|
|
1
|
-
import
|
2
|
-
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import type { Order } from './orders';
|
4
|
-
type ResourceErrorRel = ResourceRel & {
|
5
|
-
type: typeof ResourceErrors.TYPE;
|
6
|
-
};
|
7
|
-
interface ResourceError extends Resource {
|
8
|
-
name?: string;
|
9
|
-
code?: string;
|
10
|
-
message?: string;
|
11
|
-
resource?: Order;
|
12
|
-
}
|
13
|
-
declare class ResourceErrors extends ApiResource {
|
14
|
-
static readonly TYPE: 'resource_errors';
|
15
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ResourceError>>;
|
16
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ResourceError>;
|
17
|
-
isResourceError(resource: any): resource is ResourceError;
|
18
|
-
relationship(id: string | ResourceId | null): ResourceErrorRel;
|
19
|
-
type(): string;
|
20
|
-
}
|
21
|
-
export default ResourceErrors;
|
22
|
-
export { ResourceError };
|
1
|
+
import{ApiResource,Resource,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Order}from'./orders';type ResourceErrorRel=ResourceRel&{type:typeof ResourceErrors.TYPE;};interface ResourceError extends Resource{name?:string;code?:string;message?:string;resource?:Order;}declare class ResourceErrors extends ApiResource{static readonly TYPE:'resource_errors';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<ResourceError>>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ResourceError>;isResourceError(resource:any):resource is ResourceError;relationship(id:string|ResourceId|null):ResourceErrorRel;type():string;}export default ResourceErrors;export{ResourceError};
|
@@ -1,22 +1 @@
|
|
1
|
-
import
|
2
|
-
class ResourceErrors extends ApiResource {
|
3
|
-
// static readonly PATH = 'resource_errors'
|
4
|
-
async list(params, options) {
|
5
|
-
return this.resources.list({ type: ResourceErrors.TYPE }, params, options);
|
6
|
-
}
|
7
|
-
async retrieve(id, params, options) {
|
8
|
-
return this.resources.retrieve({ type: ResourceErrors.TYPE, id }, params, options);
|
9
|
-
}
|
10
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
11
|
-
isResourceError(resource) {
|
12
|
-
return resource.type && (resource.type === ResourceErrors.TYPE);
|
13
|
-
}
|
14
|
-
relationship(id) {
|
15
|
-
return ((id === null) || (typeof id === 'string')) ? { id, type: ResourceErrors.TYPE } : { id: id.id, type: ResourceErrors.TYPE };
|
16
|
-
}
|
17
|
-
type() {
|
18
|
-
return ResourceErrors.TYPE;
|
19
|
-
}
|
20
|
-
}
|
21
|
-
ResourceErrors.TYPE = 'resource_errors';
|
22
|
-
export default ResourceErrors;
|
1
|
+
import{ApiResource as n}from"../resource";class e extends n{async list(t,p){return this.resources.list({type:e.TYPE},t,p)}async retrieve(t,p,i){return this.resources.retrieve({type:e.TYPE,id:t},p,i)}isResourceError(t){return t.type&&t.type===e.TYPE}relationship(t){return t===null||typeof t=="string"?{id:t,type:e.TYPE}:{id:t.id,type:e.TYPE}}type(){return e.TYPE}}e.TYPE="resource_errors";export default e;
|
@@ -1,50 +1 @@
|
|
1
|
-
import
|
2
|
-
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import type { Return } from './returns';
|
4
|
-
import type { LineItem } from './line_items';
|
5
|
-
type ReturnLineItemRel = ResourceRel & {
|
6
|
-
type: typeof ReturnLineItems.TYPE;
|
7
|
-
};
|
8
|
-
type ReturnRel = ResourceRel & {
|
9
|
-
type: 'returns';
|
10
|
-
};
|
11
|
-
type LineItemRel = ResourceRel & {
|
12
|
-
type: 'line_items';
|
13
|
-
};
|
14
|
-
interface ReturnLineItem extends Resource {
|
15
|
-
sku_code?: string;
|
16
|
-
bundle_code?: string;
|
17
|
-
quantity?: number;
|
18
|
-
name?: string;
|
19
|
-
image_url?: string;
|
20
|
-
return_reason?: object;
|
21
|
-
restocked_at?: string;
|
22
|
-
return?: Return;
|
23
|
-
line_item?: LineItem;
|
24
|
-
}
|
25
|
-
interface ReturnLineItemCreate extends ResourceCreate {
|
26
|
-
quantity: number;
|
27
|
-
return_reason?: object;
|
28
|
-
return: ReturnRel;
|
29
|
-
line_item: LineItemRel;
|
30
|
-
}
|
31
|
-
interface ReturnLineItemUpdate extends ResourceUpdate {
|
32
|
-
quantity?: number;
|
33
|
-
_restock?: boolean;
|
34
|
-
return_reason?: object;
|
35
|
-
}
|
36
|
-
declare class ReturnLineItems extends ApiResource {
|
37
|
-
static readonly TYPE: 'return_line_items';
|
38
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ReturnLineItem>>;
|
39
|
-
create(resource: ReturnLineItemCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ReturnLineItem>;
|
40
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ReturnLineItem>;
|
41
|
-
update(resource: ReturnLineItemUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ReturnLineItem>;
|
42
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
43
|
-
return(returnLineItemId: string | ReturnLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Return>;
|
44
|
-
line_item(returnLineItemId: string | ReturnLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
|
45
|
-
isReturnLineItem(resource: any): resource is ReturnLineItem;
|
46
|
-
relationship(id: string | ResourceId | null): ReturnLineItemRel;
|
47
|
-
type(): string;
|
48
|
-
}
|
49
|
-
export default ReturnLineItems;
|
50
|
-
export { ReturnLineItem, ReturnLineItemCreate, ReturnLineItemUpdate };
|
1
|
+
import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Return}from'./returns';import type{LineItem}from'./line_items';type ReturnLineItemRel=ResourceRel&{type:typeof ReturnLineItems.TYPE;};type ReturnRel=ResourceRel&{type:'returns';};type LineItemRel=ResourceRel&{type:'line_items';};interface ReturnLineItem extends Resource{sku_code?:string;bundle_code?:string;quantity?:number;name?:string;image_url?:string;return_reason?:object;restocked_at?:string;return?:Return;line_item?:LineItem;}interface ReturnLineItemCreate extends ResourceCreate{quantity:number;return_reason?:object;return:ReturnRel;line_item:LineItemRel;}interface ReturnLineItemUpdate extends ResourceUpdate{quantity?:number;_restock?:boolean;return_reason?:object;}declare class ReturnLineItems extends ApiResource{static readonly TYPE:'return_line_items';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<ReturnLineItem>>;create(resource:ReturnLineItemCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ReturnLineItem>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ReturnLineItem>;update(resource:ReturnLineItemUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ReturnLineItem>;delete(id:string,options?:ResourcesConfig):Promise<void>;return(returnLineItemId:string|ReturnLineItem,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Return>;line_item(returnLineItemId:string|ReturnLineItem,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<LineItem>;isReturnLineItem(resource:any):resource is ReturnLineItem;relationship(id:string|ResourceId|null):ReturnLineItemRel;type():string;}export default ReturnLineItems;export{ReturnLineItem,ReturnLineItemCreate,ReturnLineItemUpdate};
|
@@ -1,39 +1 @@
|
|
1
|
-
import
|
2
|
-
class ReturnLineItems extends ApiResource {
|
3
|
-
// static readonly PATH = 'return_line_items'
|
4
|
-
async list(params, options) {
|
5
|
-
return this.resources.list({ type: ReturnLineItems.TYPE }, params, options);
|
6
|
-
}
|
7
|
-
async create(resource, params, options) {
|
8
|
-
return this.resources.create(Object.assign(Object.assign({}, resource), { type: ReturnLineItems.TYPE }), params, options);
|
9
|
-
}
|
10
|
-
async retrieve(id, params, options) {
|
11
|
-
return this.resources.retrieve({ type: ReturnLineItems.TYPE, id }, params, options);
|
12
|
-
}
|
13
|
-
async update(resource, params, options) {
|
14
|
-
return this.resources.update(Object.assign(Object.assign({}, resource), { type: ReturnLineItems.TYPE }), params, options);
|
15
|
-
}
|
16
|
-
async delete(id, options) {
|
17
|
-
await this.resources.delete({ type: ReturnLineItems.TYPE, id }, options);
|
18
|
-
}
|
19
|
-
async return(returnLineItemId, params, options) {
|
20
|
-
const _returnLineItemId = returnLineItemId.id || returnLineItemId;
|
21
|
-
return this.resources.fetch({ type: 'returns' }, `return_line_items/${_returnLineItemId}/return`, params, options);
|
22
|
-
}
|
23
|
-
async line_item(returnLineItemId, params, options) {
|
24
|
-
const _returnLineItemId = returnLineItemId.id || returnLineItemId;
|
25
|
-
return this.resources.fetch({ type: 'line_items' }, `return_line_items/${_returnLineItemId}/line_item`, params, options);
|
26
|
-
}
|
27
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
28
|
-
isReturnLineItem(resource) {
|
29
|
-
return resource.type && (resource.type === ReturnLineItems.TYPE);
|
30
|
-
}
|
31
|
-
relationship(id) {
|
32
|
-
return ((id === null) || (typeof id === 'string')) ? { id, type: ReturnLineItems.TYPE } : { id: id.id, type: ReturnLineItems.TYPE };
|
33
|
-
}
|
34
|
-
type() {
|
35
|
-
return ReturnLineItems.TYPE;
|
36
|
-
}
|
37
|
-
}
|
38
|
-
ReturnLineItems.TYPE = 'return_line_items';
|
39
|
-
export default ReturnLineItems;
|
1
|
+
import{ApiResource as c}from"../resource";class r extends c{async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,s){return this.resources.create(Object.assign(Object.assign({},e),{type:r.TYPE}),t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:r.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update(Object.assign(Object.assign({},e),{type:r.TYPE}),t,s)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}async return(e,t,s){const i=e.id||e;return this.resources.fetch({type:"returns"},`return_line_items/${i}/return`,t,s)}async line_item(e,t,s){const i=e.id||e;return this.resources.fetch({type:"line_items"},`return_line_items/${i}/line_item`,t,s)}isReturnLineItem(e){return e.type&&e.type===r.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:r.TYPE}:{id:e.id,type:r.TYPE}}type(){return r.TYPE}}r.TYPE="return_line_items";export default r;
|
@@ -1,86 +1 @@
|
|
1
|
-
import
|
2
|
-
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import type { Order } from './orders';
|
4
|
-
import type { Customer } from './customers';
|
5
|
-
import type { StockLocation } from './stock_locations';
|
6
|
-
import type { Address } from './addresses';
|
7
|
-
import type { ReturnLineItem } from './return_line_items';
|
8
|
-
import type { Attachment } from './attachments';
|
9
|
-
import type { Event } from './events';
|
10
|
-
import type { Tag } from './tags';
|
11
|
-
import type { Version } from './versions';
|
12
|
-
type ReturnRel = ResourceRel & {
|
13
|
-
type: typeof Returns.TYPE;
|
14
|
-
};
|
15
|
-
type OrderRel = ResourceRel & {
|
16
|
-
type: 'orders';
|
17
|
-
};
|
18
|
-
type StockLocationRel = ResourceRel & {
|
19
|
-
type: 'stock_locations';
|
20
|
-
};
|
21
|
-
type TagRel = ResourceRel & {
|
22
|
-
type: 'tags';
|
23
|
-
};
|
24
|
-
interface Return extends Resource {
|
25
|
-
number?: string;
|
26
|
-
status?: string;
|
27
|
-
customer_email?: string;
|
28
|
-
skus_count?: number;
|
29
|
-
approved_at?: string;
|
30
|
-
cancelled_at?: string;
|
31
|
-
shipped_at?: string;
|
32
|
-
rejected_at?: string;
|
33
|
-
received_at?: string;
|
34
|
-
archived_at?: string;
|
35
|
-
order?: Order;
|
36
|
-
customer?: Customer;
|
37
|
-
stock_location?: StockLocation;
|
38
|
-
origin_address?: Address;
|
39
|
-
destination_address?: Address;
|
40
|
-
return_line_items?: ReturnLineItem[];
|
41
|
-
attachments?: Attachment[];
|
42
|
-
events?: Event[];
|
43
|
-
tags?: Tag[];
|
44
|
-
versions?: Version[];
|
45
|
-
}
|
46
|
-
interface ReturnCreate extends ResourceCreate {
|
47
|
-
order: OrderRel;
|
48
|
-
stock_location?: StockLocationRel;
|
49
|
-
tags?: TagRel[];
|
50
|
-
}
|
51
|
-
interface ReturnUpdate extends ResourceUpdate {
|
52
|
-
_request?: boolean;
|
53
|
-
_approve?: boolean;
|
54
|
-
_cancel?: boolean;
|
55
|
-
_ship?: boolean;
|
56
|
-
_reject?: boolean;
|
57
|
-
_receive?: boolean;
|
58
|
-
_restock?: boolean;
|
59
|
-
_archive?: boolean;
|
60
|
-
_unarchive?: boolean;
|
61
|
-
stock_location?: StockLocationRel;
|
62
|
-
tags?: TagRel[];
|
63
|
-
}
|
64
|
-
declare class Returns extends ApiResource {
|
65
|
-
static readonly TYPE: 'returns';
|
66
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Return>>;
|
67
|
-
create(resource: ReturnCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Return>;
|
68
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Return>;
|
69
|
-
update(resource: ReturnUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Return>;
|
70
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
71
|
-
order(returnId: string | Return, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
72
|
-
customer(returnId: string | Return, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Customer>;
|
73
|
-
stock_location(returnId: string | Return, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
|
74
|
-
origin_address(returnId: string | Return, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Address>;
|
75
|
-
destination_address(returnId: string | Return, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Address>;
|
76
|
-
return_line_items(returnId: string | Return, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ReturnLineItem>>;
|
77
|
-
attachments(returnId: string | Return, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
78
|
-
events(returnId: string | Return, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
79
|
-
tags(returnId: string | Return, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
80
|
-
versions(returnId: string | Return, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
81
|
-
isReturn(resource: any): resource is Return;
|
82
|
-
relationship(id: string | ResourceId | null): ReturnRel;
|
83
|
-
type(): string;
|
84
|
-
}
|
85
|
-
export default Returns;
|
86
|
-
export { Return, ReturnCreate, ReturnUpdate };
|
1
|
+
import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Order}from'./orders';import type{Customer}from'./customers';import type{StockLocation}from'./stock_locations';import type{Address}from'./addresses';import type{ReturnLineItem}from'./return_line_items';import type{Attachment}from'./attachments';import type{Event}from'./events';import type{Tag}from'./tags';import type{Version}from'./versions';type ReturnRel=ResourceRel&{type:typeof Returns.TYPE;};type OrderRel=ResourceRel&{type:'orders';};type StockLocationRel=ResourceRel&{type:'stock_locations';};type TagRel=ResourceRel&{type:'tags';};interface Return extends Resource{number?:string;status?:string;customer_email?:string;skus_count?:number;approved_at?:string;cancelled_at?:string;shipped_at?:string;rejected_at?:string;received_at?:string;archived_at?:string;order?:Order;customer?:Customer;stock_location?:StockLocation;origin_address?:Address;destination_address?:Address;return_line_items?:ReturnLineItem[];attachments?:Attachment[];events?:Event[];tags?:Tag[];versions?:Version[];}interface ReturnCreate extends ResourceCreate{order:OrderRel;stock_location?:StockLocationRel;tags?:TagRel[];}interface ReturnUpdate extends ResourceUpdate{_request?:boolean;_approve?:boolean;_cancel?:boolean;_ship?:boolean;_reject?:boolean;_receive?:boolean;_restock?:boolean;_archive?:boolean;_unarchive?:boolean;stock_location?:StockLocationRel;tags?:TagRel[];}declare class Returns extends ApiResource{static readonly TYPE:'returns';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Return>>;create(resource:ReturnCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Return>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Return>;update(resource:ReturnUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Return>;delete(id:string,options?:ResourcesConfig):Promise<void>;order(returnId:string|Return,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Order>;customer(returnId:string|Return,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Customer>;stock_location(returnId:string|Return,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockLocation>;origin_address(returnId:string|Return,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Address>;destination_address(returnId:string|Return,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Address>;return_line_items(returnId:string|Return,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<ReturnLineItem>>;attachments(returnId:string|Return,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;events(returnId:string|Return,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Event>>;tags(returnId:string|Return,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Tag>>;versions(returnId:string|Return,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Version>>;isReturn(resource:any):resource is Return;relationship(id:string|ResourceId|null):ReturnRel;type():string;}export default Returns;export{Return,ReturnCreate,ReturnUpdate};
|