@commercelayer/sdk 6.0.0-alfa.8 → 6.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.mts +7644 -0
- package/lib/index.d.ts +7644 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -0
- package/lib/index.mjs +2 -0
- package/lib/index.mjs.map +1 -0
- package/package.json +9 -15
- package/lib/cjs/api.d.ts +0 -161
- package/lib/cjs/api.js +0 -377
- package/lib/cjs/client.d.ts +0 -31
- package/lib/cjs/client.js +0 -120
- package/lib/cjs/commercelayer.d.ts +0 -154
- package/lib/cjs/commercelayer.js +0 -365
- package/lib/cjs/common.d.ts +0 -5
- package/lib/cjs/common.js +0 -12
- package/lib/cjs/config.d.ts +0 -15
- package/lib/cjs/config.js +0 -17
- package/lib/cjs/debug.d.ts +0 -3
- package/lib/cjs/debug.js +0 -17
- package/lib/cjs/error.d.ts +0 -30
- package/lib/cjs/error.js +0 -78
- package/lib/cjs/fetch.d.ts +0 -13
- package/lib/cjs/fetch.js +0 -67
- package/lib/cjs/index.d.ts +0 -7
- package/lib/cjs/index.js +0 -11
- package/lib/cjs/interceptor.d.ts +0 -37
- package/lib/cjs/interceptor.js +0 -2
- package/lib/cjs/jsonapi.d.ts +0 -6
- package/lib/cjs/jsonapi.js +0 -92
- package/lib/cjs/model.d.ts +0 -121
- package/lib/cjs/model.js +0 -2
- package/lib/cjs/query.d.ts +0 -18
- package/lib/cjs/query.js +0 -70
- package/lib/cjs/resource.d.ts +0 -86
- package/lib/cjs/resource.js +0 -172
- package/lib/cjs/resources/addresses.d.ts +0 -104
- package/lib/cjs/resources/addresses.js +0 -44
- package/lib/cjs/resources/adjustments.d.ts +0 -43
- package/lib/cjs/resources/adjustments.js +0 -32
- package/lib/cjs/resources/adyen_gateways.d.ts +0 -61
- package/lib/cjs/resources/adyen_gateways.js +0 -40
- package/lib/cjs/resources/adyen_payments.d.ts +0 -52
- package/lib/cjs/resources/adyen_payments.js +0 -43
- package/lib/cjs/resources/application.d.ts +0 -23
- package/lib/cjs/resources/application.js +0 -19
- package/lib/cjs/resources/attachments.d.ts +0 -158
- package/lib/cjs/resources/attachments.js +0 -28
- package/lib/cjs/resources/authorizations.d.ts +0 -71
- package/lib/cjs/resources/authorizations.js +0 -55
- package/lib/cjs/resources/avalara_accounts.d.ts +0 -60
- package/lib/cjs/resources/avalara_accounts.js +0 -44
- package/lib/cjs/resources/axerve_gateways.d.ts +0 -49
- package/lib/cjs/resources/axerve_gateways.js +0 -40
- package/lib/cjs/resources/axerve_payments.d.ts +0 -58
- package/lib/cjs/resources/axerve_payments.js +0 -43
- package/lib/cjs/resources/billing_info_validation_rules.d.ts +0 -40
- package/lib/cjs/resources/billing_info_validation_rules.js +0 -40
- package/lib/cjs/resources/bing_geocoders.d.ts +0 -37
- package/lib/cjs/resources/bing_geocoders.js +0 -36
- package/lib/cjs/resources/braintree_gateways.d.ts +0 -61
- package/lib/cjs/resources/braintree_gateways.js +0 -40
- package/lib/cjs/resources/braintree_payments.d.ts +0 -53
- package/lib/cjs/resources/braintree_payments.js +0 -40
- package/lib/cjs/resources/bundles.d.ts +0 -94
- package/lib/cjs/resources/bundles.js +0 -62
- package/lib/cjs/resources/buy_x_pay_y_promotions.d.ts +0 -138
- package/lib/cjs/resources/buy_x_pay_y_promotions.js +0 -82
- package/lib/cjs/resources/captures.d.ts +0 -61
- package/lib/cjs/resources/captures.js +0 -52
- package/lib/cjs/resources/carrier_accounts.d.ts +0 -31
- package/lib/cjs/resources/carrier_accounts.js +0 -31
- package/lib/cjs/resources/checkout_com_gateways.d.ts +0 -50
- package/lib/cjs/resources/checkout_com_gateways.js +0 -40
- package/lib/cjs/resources/checkout_com_payments.d.ts +0 -66
- package/lib/cjs/resources/checkout_com_payments.js +0 -46
- package/lib/cjs/resources/cleanups.d.ts +0 -41
- package/lib/cjs/resources/cleanups.js +0 -33
- package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +0 -68
- package/lib/cjs/resources/coupon_codes_promotion_rules.js +0 -36
- package/lib/cjs/resources/coupon_recipients.d.ts +0 -49
- package/lib/cjs/resources/coupon_recipients.js +0 -40
- package/lib/cjs/resources/coupons.d.ts +0 -72
- package/lib/cjs/resources/coupons.js +0 -48
- package/lib/cjs/resources/custom_promotion_rules.d.ts +0 -63
- package/lib/cjs/resources/custom_promotion_rules.js +0 -32
- package/lib/cjs/resources/customer_addresses.d.ts +0 -51
- package/lib/cjs/resources/customer_addresses.js +0 -44
- package/lib/cjs/resources/customer_groups.d.ts +0 -41
- package/lib/cjs/resources/customer_groups.js +0 -44
- package/lib/cjs/resources/customer_password_resets.d.ts +0 -39
- package/lib/cjs/resources/customer_password_resets.js +0 -39
- package/lib/cjs/resources/customer_payment_sources.d.ts +0 -87
- package/lib/cjs/resources/customer_payment_sources.js +0 -40
- package/lib/cjs/resources/customer_subscriptions.d.ts +0 -36
- package/lib/cjs/resources/customer_subscriptions.js +0 -40
- package/lib/cjs/resources/customers.d.ts +0 -77
- package/lib/cjs/resources/customers.js +0 -72
- package/lib/cjs/resources/delivery_lead_times.d.ts +0 -56
- package/lib/cjs/resources/delivery_lead_times.js +0 -44
- package/lib/cjs/resources/event_callbacks.d.ts +0 -26
- package/lib/cjs/resources/event_callbacks.js +0 -23
- package/lib/cjs/resources/events.d.ts +0 -26
- package/lib/cjs/resources/events.js +0 -27
- package/lib/cjs/resources/exports.d.ts +0 -42
- package/lib/cjs/resources/exports.js +0 -29
- package/lib/cjs/resources/external_gateways.d.ts +0 -58
- package/lib/cjs/resources/external_gateways.js +0 -43
- package/lib/cjs/resources/external_payments.d.ts +0 -49
- package/lib/cjs/resources/external_payments.js +0 -44
- package/lib/cjs/resources/external_promotions.d.ts +0 -137
- package/lib/cjs/resources/external_promotions.js +0 -85
- package/lib/cjs/resources/external_tax_calculators.d.ts +0 -46
- package/lib/cjs/resources/external_tax_calculators.js +0 -43
- package/lib/cjs/resources/fixed_amount_promotions.d.ts +0 -134
- package/lib/cjs/resources/fixed_amount_promotions.js +0 -82
- package/lib/cjs/resources/fixed_price_promotions.d.ts +0 -134
- package/lib/cjs/resources/fixed_price_promotions.js +0 -82
- package/lib/cjs/resources/free_gift_promotions.d.ts +0 -132
- package/lib/cjs/resources/free_gift_promotions.js +0 -82
- package/lib/cjs/resources/free_shipping_promotions.d.ts +0 -126
- package/lib/cjs/resources/free_shipping_promotions.js +0 -78
- package/lib/cjs/resources/geocoders.d.ts +0 -26
- package/lib/cjs/resources/geocoders.js +0 -27
- package/lib/cjs/resources/gift_card_recipients.d.ts +0 -49
- package/lib/cjs/resources/gift_card_recipients.js +0 -40
- package/lib/cjs/resources/gift_cards.d.ts +0 -105
- package/lib/cjs/resources/gift_cards.js +0 -64
- package/lib/cjs/resources/google_geocoders.d.ts +0 -37
- package/lib/cjs/resources/google_geocoders.js +0 -36
- package/lib/cjs/resources/imports.d.ts +0 -45
- package/lib/cjs/resources/imports.js +0 -29
- package/lib/cjs/resources/in_stock_subscriptions.d.ts +0 -69
- package/lib/cjs/resources/in_stock_subscriptions.js +0 -54
- package/lib/cjs/resources/inventory_models.d.ts +0 -56
- package/lib/cjs/resources/inventory_models.js +0 -44
- package/lib/cjs/resources/inventory_return_locations.d.ts +0 -48
- package/lib/cjs/resources/inventory_return_locations.js +0 -40
- package/lib/cjs/resources/inventory_stock_locations.d.ts +0 -51
- package/lib/cjs/resources/inventory_stock_locations.js +0 -40
- package/lib/cjs/resources/klarna_gateways.d.ts +0 -49
- package/lib/cjs/resources/klarna_gateways.js +0 -40
- package/lib/cjs/resources/klarna_payments.d.ts +0 -52
- package/lib/cjs/resources/klarna_payments.js +0 -43
- package/lib/cjs/resources/line_item_options.d.ts +0 -70
- package/lib/cjs/resources/line_item_options.js +0 -44
- package/lib/cjs/resources/line_items.d.ts +0 -171
- package/lib/cjs/resources/line_items.js +0 -69
- package/lib/cjs/resources/manual_gateways.d.ts +0 -35
- package/lib/cjs/resources/manual_gateways.js +0 -36
- package/lib/cjs/resources/manual_tax_calculators.d.ts +0 -46
- package/lib/cjs/resources/manual_tax_calculators.js +0 -44
- package/lib/cjs/resources/markets.d.ts +0 -108
- package/lib/cjs/resources/markets.js +0 -66
- package/lib/cjs/resources/merchants.d.ts +0 -43
- package/lib/cjs/resources/merchants.js +0 -40
- package/lib/cjs/resources/order_amount_promotion_rules.d.ts +0 -68
- package/lib/cjs/resources/order_amount_promotion_rules.js +0 -32
- package/lib/cjs/resources/order_copies.d.ts +0 -52
- package/lib/cjs/resources/order_copies.js +0 -44
- package/lib/cjs/resources/order_factories.d.ts +0 -35
- package/lib/cjs/resources/order_factories.js +0 -31
- package/lib/cjs/resources/order_subscription_items.d.ts +0 -69
- package/lib/cjs/resources/order_subscription_items.js +0 -36
- package/lib/cjs/resources/order_subscriptions.d.ts +0 -97
- package/lib/cjs/resources/order_subscriptions.js +0 -81
- package/lib/cjs/resources/order_validation_rules.d.ts +0 -28
- package/lib/cjs/resources/order_validation_rules.js +0 -31
- package/lib/cjs/resources/orders.d.ts +0 -390
- package/lib/cjs/resources/orders.js +0 -239
- package/lib/cjs/resources/organization.d.ts +0 -35
- package/lib/cjs/resources/organization.js +0 -19
- package/lib/cjs/resources/packages.d.ts +0 -61
- package/lib/cjs/resources/packages.js +0 -44
- package/lib/cjs/resources/parcel_line_items.d.ts +0 -48
- package/lib/cjs/resources/parcel_line_items.js +0 -40
- package/lib/cjs/resources/parcels.d.ts +0 -127
- package/lib/cjs/resources/parcels.js +0 -52
- package/lib/cjs/resources/payment_gateways.d.ts +0 -26
- package/lib/cjs/resources/payment_gateways.js +0 -27
- package/lib/cjs/resources/payment_methods.d.ts +0 -84
- package/lib/cjs/resources/payment_methods.js +0 -50
- package/lib/cjs/resources/payment_options.d.ts +0 -45
- package/lib/cjs/resources/payment_options.js +0 -36
- package/lib/cjs/resources/paypal_gateways.d.ts +0 -42
- package/lib/cjs/resources/paypal_gateways.js +0 -40
- package/lib/cjs/resources/paypal_payments.d.ts +0 -57
- package/lib/cjs/resources/paypal_payments.js +0 -40
- package/lib/cjs/resources/percentage_discount_promotions.d.ts +0 -132
- package/lib/cjs/resources/percentage_discount_promotions.js +0 -82
- package/lib/cjs/resources/price_frequency_tiers.d.ts +0 -54
- package/lib/cjs/resources/price_frequency_tiers.js +0 -44
- package/lib/cjs/resources/price_lists.d.ts +0 -47
- package/lib/cjs/resources/price_lists.js +0 -40
- package/lib/cjs/resources/price_tiers.d.ts +0 -33
- package/lib/cjs/resources/price_tiers.js +0 -31
- package/lib/cjs/resources/price_volume_tiers.d.ts +0 -54
- package/lib/cjs/resources/price_volume_tiers.js +0 -44
- package/lib/cjs/resources/prices.d.ts +0 -76
- package/lib/cjs/resources/prices.js +0 -56
- package/lib/cjs/resources/promotion_rules.d.ts +0 -30
- package/lib/cjs/resources/promotion_rules.js +0 -23
- package/lib/cjs/resources/promotions.d.ts +0 -64
- package/lib/cjs/resources/promotions.js +0 -63
- package/lib/cjs/resources/recurring_order_copies.d.ts +0 -54
- package/lib/cjs/resources/recurring_order_copies.js +0 -44
- package/lib/cjs/resources/refunds.d.ts +0 -45
- package/lib/cjs/resources/refunds.js +0 -39
- package/lib/cjs/resources/reserved_stocks.d.ts +0 -29
- package/lib/cjs/resources/reserved_stocks.js +0 -31
- package/lib/cjs/resources/resource_errors.d.ts +0 -23
- package/lib/cjs/resources/resource_errors.js +0 -19
- package/lib/cjs/resources/return_line_items.d.ts +0 -53
- package/lib/cjs/resources/return_line_items.js +0 -39
- package/lib/cjs/resources/returns.d.ts +0 -97
- package/lib/cjs/resources/returns.js +0 -95
- package/lib/cjs/resources/satispay_gateways.d.ts +0 -47
- package/lib/cjs/resources/satispay_gateways.js +0 -40
- package/lib/cjs/resources/satispay_payments.d.ts +0 -54
- package/lib/cjs/resources/satispay_payments.js +0 -43
- package/lib/cjs/resources/shipments.d.ts +0 -152
- package/lib/cjs/resources/shipments.js +0 -133
- package/lib/cjs/resources/shipping_categories.d.ts +0 -41
- package/lib/cjs/resources/shipping_categories.js +0 -40
- package/lib/cjs/resources/shipping_method_tiers.d.ts +0 -33
- package/lib/cjs/resources/shipping_method_tiers.js +0 -31
- package/lib/cjs/resources/shipping_methods.d.ts +0 -126
- package/lib/cjs/resources/shipping_methods.js +0 -73
- package/lib/cjs/resources/shipping_weight_tiers.d.ts +0 -51
- package/lib/cjs/resources/shipping_weight_tiers.js +0 -40
- package/lib/cjs/resources/shipping_zones.d.ts +0 -53
- package/lib/cjs/resources/shipping_zones.js +0 -36
- package/lib/cjs/resources/sku_list_items.d.ts +0 -52
- package/lib/cjs/resources/sku_list_items.js +0 -40
- package/lib/cjs/resources/sku_list_promotion_rules.d.ts +0 -77
- package/lib/cjs/resources/sku_list_promotion_rules.js +0 -40
- package/lib/cjs/resources/sku_lists.d.ts +0 -65
- package/lib/cjs/resources/sku_lists.js +0 -52
- package/lib/cjs/resources/sku_options.d.ts +0 -72
- package/lib/cjs/resources/sku_options.js +0 -48
- package/lib/cjs/resources/skus.d.ts +0 -97
- package/lib/cjs/resources/skus.js +0 -68
- package/lib/cjs/resources/stock_items.d.ts +0 -60
- package/lib/cjs/resources/stock_items.js +0 -52
- package/lib/cjs/resources/stock_line_items.d.ts +0 -74
- package/lib/cjs/resources/stock_line_items.js +0 -57
- package/lib/cjs/resources/stock_locations.d.ts +0 -65
- package/lib/cjs/resources/stock_locations.js +0 -56
- package/lib/cjs/resources/stock_reservations.d.ts +0 -52
- package/lib/cjs/resources/stock_reservations.js +0 -51
- package/lib/cjs/resources/stock_transfers.d.ts +0 -87
- package/lib/cjs/resources/stock_transfers.js +0 -74
- package/lib/cjs/resources/stripe_gateways.d.ts +0 -46
- package/lib/cjs/resources/stripe_gateways.js +0 -40
- package/lib/cjs/resources/stripe_payments.d.ts +0 -63
- package/lib/cjs/resources/stripe_payments.js +0 -46
- package/lib/cjs/resources/subscription_models.d.ts +0 -50
- package/lib/cjs/resources/subscription_models.js +0 -40
- package/lib/cjs/resources/tags.d.ts +0 -29
- package/lib/cjs/resources/tags.js +0 -28
- package/lib/cjs/resources/tax_calculators.d.ts +0 -29
- package/lib/cjs/resources/tax_calculators.js +0 -31
- package/lib/cjs/resources/tax_categories.d.ts +0 -64
- package/lib/cjs/resources/tax_categories.js +0 -40
- package/lib/cjs/resources/tax_rules.d.ts +0 -74
- package/lib/cjs/resources/tax_rules.js +0 -36
- package/lib/cjs/resources/taxjar_accounts.d.ts +0 -48
- package/lib/cjs/resources/taxjar_accounts.js +0 -44
- package/lib/cjs/resources/transactions.d.ts +0 -42
- package/lib/cjs/resources/transactions.js +0 -35
- package/lib/cjs/resources/versions.d.ts +0 -23
- package/lib/cjs/resources/versions.js +0 -19
- package/lib/cjs/resources/voids.d.ts +0 -45
- package/lib/cjs/resources/voids.js +0 -39
- package/lib/cjs/resources/webhooks.d.ts +0 -56
- package/lib/cjs/resources/webhooks.js +0 -45
- package/lib/cjs/resources/wire_transfers.d.ts +0 -38
- package/lib/cjs/resources/wire_transfers.js +0 -36
- package/lib/cjs/static.d.ts +0 -12
- package/lib/cjs/static.js +0 -50
- package/lib/cjs/util.d.ts +0 -9
- package/lib/cjs/util.js +0 -15
- package/lib/esm/api.d.ts +0 -161
- package/lib/esm/api.js +0 -248
- package/lib/esm/client.d.ts +0 -31
- package/lib/esm/client.js +0 -102
- package/lib/esm/commercelayer.d.ts +0 -154
- package/lib/esm/commercelayer.js +0 -323
- package/lib/esm/common.d.ts +0 -5
- package/lib/esm/common.js +0 -8
- package/lib/esm/config.d.ts +0 -15
- package/lib/esm/config.js +0 -15
- package/lib/esm/debug.d.ts +0 -3
- package/lib/esm/debug.js +0 -15
- package/lib/esm/error.d.ts +0 -30
- package/lib/esm/error.js +0 -78
- package/lib/esm/fetch.d.ts +0 -13
- package/lib/esm/fetch.js +0 -46
- package/lib/esm/index.d.ts +0 -7
- package/lib/esm/index.js +0 -2
- package/lib/esm/interceptor.d.ts +0 -37
- package/lib/esm/interceptor.js +0 -1
- package/lib/esm/jsonapi.d.ts +0 -6
- package/lib/esm/jsonapi.js +0 -85
- package/lib/esm/model.d.ts +0 -121
- package/lib/esm/model.js +0 -1
- package/lib/esm/query.d.ts +0 -18
- package/lib/esm/query.js +0 -62
- package/lib/esm/resource.d.ts +0 -86
- package/lib/esm/resource.js +0 -155
- package/lib/esm/resources/addresses.d.ts +0 -104
- package/lib/esm/resources/addresses.js +0 -42
- package/lib/esm/resources/adjustments.d.ts +0 -43
- package/lib/esm/resources/adjustments.js +0 -30
- package/lib/esm/resources/adyen_gateways.d.ts +0 -61
- package/lib/esm/resources/adyen_gateways.js +0 -38
- package/lib/esm/resources/adyen_payments.d.ts +0 -52
- package/lib/esm/resources/adyen_payments.js +0 -41
- package/lib/esm/resources/application.d.ts +0 -23
- package/lib/esm/resources/application.js +0 -17
- package/lib/esm/resources/attachments.d.ts +0 -158
- package/lib/esm/resources/attachments.js +0 -26
- package/lib/esm/resources/authorizations.d.ts +0 -71
- package/lib/esm/resources/authorizations.js +0 -53
- package/lib/esm/resources/avalara_accounts.d.ts +0 -60
- package/lib/esm/resources/avalara_accounts.js +0 -42
- package/lib/esm/resources/axerve_gateways.d.ts +0 -49
- package/lib/esm/resources/axerve_gateways.js +0 -38
- package/lib/esm/resources/axerve_payments.d.ts +0 -58
- package/lib/esm/resources/axerve_payments.js +0 -41
- package/lib/esm/resources/billing_info_validation_rules.d.ts +0 -40
- package/lib/esm/resources/billing_info_validation_rules.js +0 -38
- package/lib/esm/resources/bing_geocoders.d.ts +0 -37
- package/lib/esm/resources/bing_geocoders.js +0 -34
- package/lib/esm/resources/braintree_gateways.d.ts +0 -61
- package/lib/esm/resources/braintree_gateways.js +0 -38
- package/lib/esm/resources/braintree_payments.d.ts +0 -53
- package/lib/esm/resources/braintree_payments.js +0 -38
- package/lib/esm/resources/bundles.d.ts +0 -94
- package/lib/esm/resources/bundles.js +0 -60
- package/lib/esm/resources/buy_x_pay_y_promotions.d.ts +0 -138
- package/lib/esm/resources/buy_x_pay_y_promotions.js +0 -80
- package/lib/esm/resources/captures.d.ts +0 -61
- package/lib/esm/resources/captures.js +0 -50
- package/lib/esm/resources/carrier_accounts.d.ts +0 -31
- package/lib/esm/resources/carrier_accounts.js +0 -29
- package/lib/esm/resources/checkout_com_gateways.d.ts +0 -50
- package/lib/esm/resources/checkout_com_gateways.js +0 -38
- package/lib/esm/resources/checkout_com_payments.d.ts +0 -66
- package/lib/esm/resources/checkout_com_payments.js +0 -44
- package/lib/esm/resources/cleanups.d.ts +0 -41
- package/lib/esm/resources/cleanups.js +0 -31
- package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +0 -68
- package/lib/esm/resources/coupon_codes_promotion_rules.js +0 -34
- package/lib/esm/resources/coupon_recipients.d.ts +0 -49
- package/lib/esm/resources/coupon_recipients.js +0 -38
- package/lib/esm/resources/coupons.d.ts +0 -72
- package/lib/esm/resources/coupons.js +0 -46
- package/lib/esm/resources/custom_promotion_rules.d.ts +0 -63
- package/lib/esm/resources/custom_promotion_rules.js +0 -30
- package/lib/esm/resources/customer_addresses.d.ts +0 -51
- package/lib/esm/resources/customer_addresses.js +0 -42
- package/lib/esm/resources/customer_groups.d.ts +0 -41
- package/lib/esm/resources/customer_groups.js +0 -42
- package/lib/esm/resources/customer_password_resets.d.ts +0 -39
- package/lib/esm/resources/customer_password_resets.js +0 -37
- package/lib/esm/resources/customer_payment_sources.d.ts +0 -87
- package/lib/esm/resources/customer_payment_sources.js +0 -38
- package/lib/esm/resources/customer_subscriptions.d.ts +0 -36
- package/lib/esm/resources/customer_subscriptions.js +0 -38
- package/lib/esm/resources/customers.d.ts +0 -77
- package/lib/esm/resources/customers.js +0 -70
- package/lib/esm/resources/delivery_lead_times.d.ts +0 -56
- package/lib/esm/resources/delivery_lead_times.js +0 -42
- package/lib/esm/resources/event_callbacks.d.ts +0 -26
- package/lib/esm/resources/event_callbacks.js +0 -21
- package/lib/esm/resources/events.d.ts +0 -26
- package/lib/esm/resources/events.js +0 -25
- package/lib/esm/resources/exports.d.ts +0 -42
- package/lib/esm/resources/exports.js +0 -27
- package/lib/esm/resources/external_gateways.d.ts +0 -58
- package/lib/esm/resources/external_gateways.js +0 -41
- package/lib/esm/resources/external_payments.d.ts +0 -49
- package/lib/esm/resources/external_payments.js +0 -42
- package/lib/esm/resources/external_promotions.d.ts +0 -137
- package/lib/esm/resources/external_promotions.js +0 -83
- package/lib/esm/resources/external_tax_calculators.d.ts +0 -46
- package/lib/esm/resources/external_tax_calculators.js +0 -41
- package/lib/esm/resources/fixed_amount_promotions.d.ts +0 -134
- package/lib/esm/resources/fixed_amount_promotions.js +0 -80
- package/lib/esm/resources/fixed_price_promotions.d.ts +0 -134
- package/lib/esm/resources/fixed_price_promotions.js +0 -80
- package/lib/esm/resources/free_gift_promotions.d.ts +0 -132
- package/lib/esm/resources/free_gift_promotions.js +0 -80
- package/lib/esm/resources/free_shipping_promotions.d.ts +0 -126
- package/lib/esm/resources/free_shipping_promotions.js +0 -76
- package/lib/esm/resources/geocoders.d.ts +0 -26
- package/lib/esm/resources/geocoders.js +0 -25
- package/lib/esm/resources/gift_card_recipients.d.ts +0 -49
- package/lib/esm/resources/gift_card_recipients.js +0 -38
- package/lib/esm/resources/gift_cards.d.ts +0 -105
- package/lib/esm/resources/gift_cards.js +0 -62
- package/lib/esm/resources/google_geocoders.d.ts +0 -37
- package/lib/esm/resources/google_geocoders.js +0 -34
- package/lib/esm/resources/imports.d.ts +0 -45
- package/lib/esm/resources/imports.js +0 -27
- package/lib/esm/resources/in_stock_subscriptions.d.ts +0 -69
- package/lib/esm/resources/in_stock_subscriptions.js +0 -52
- package/lib/esm/resources/inventory_models.d.ts +0 -56
- package/lib/esm/resources/inventory_models.js +0 -42
- package/lib/esm/resources/inventory_return_locations.d.ts +0 -48
- package/lib/esm/resources/inventory_return_locations.js +0 -38
- package/lib/esm/resources/inventory_stock_locations.d.ts +0 -51
- package/lib/esm/resources/inventory_stock_locations.js +0 -38
- package/lib/esm/resources/klarna_gateways.d.ts +0 -49
- package/lib/esm/resources/klarna_gateways.js +0 -38
- package/lib/esm/resources/klarna_payments.d.ts +0 -52
- package/lib/esm/resources/klarna_payments.js +0 -41
- package/lib/esm/resources/line_item_options.d.ts +0 -70
- package/lib/esm/resources/line_item_options.js +0 -42
- package/lib/esm/resources/line_items.d.ts +0 -171
- package/lib/esm/resources/line_items.js +0 -67
- package/lib/esm/resources/manual_gateways.d.ts +0 -35
- package/lib/esm/resources/manual_gateways.js +0 -34
- package/lib/esm/resources/manual_tax_calculators.d.ts +0 -46
- package/lib/esm/resources/manual_tax_calculators.js +0 -42
- package/lib/esm/resources/markets.d.ts +0 -108
- package/lib/esm/resources/markets.js +0 -64
- package/lib/esm/resources/merchants.d.ts +0 -43
- package/lib/esm/resources/merchants.js +0 -38
- package/lib/esm/resources/order_amount_promotion_rules.d.ts +0 -68
- package/lib/esm/resources/order_amount_promotion_rules.js +0 -30
- package/lib/esm/resources/order_copies.d.ts +0 -52
- package/lib/esm/resources/order_copies.js +0 -42
- package/lib/esm/resources/order_factories.d.ts +0 -35
- package/lib/esm/resources/order_factories.js +0 -29
- package/lib/esm/resources/order_subscription_items.d.ts +0 -69
- package/lib/esm/resources/order_subscription_items.js +0 -34
- package/lib/esm/resources/order_subscriptions.d.ts +0 -97
- package/lib/esm/resources/order_subscriptions.js +0 -79
- package/lib/esm/resources/order_validation_rules.d.ts +0 -28
- package/lib/esm/resources/order_validation_rules.js +0 -29
- package/lib/esm/resources/orders.d.ts +0 -390
- package/lib/esm/resources/orders.js +0 -237
- package/lib/esm/resources/organization.d.ts +0 -35
- package/lib/esm/resources/organization.js +0 -17
- package/lib/esm/resources/packages.d.ts +0 -61
- package/lib/esm/resources/packages.js +0 -42
- package/lib/esm/resources/parcel_line_items.d.ts +0 -48
- package/lib/esm/resources/parcel_line_items.js +0 -38
- package/lib/esm/resources/parcels.d.ts +0 -127
- package/lib/esm/resources/parcels.js +0 -50
- package/lib/esm/resources/payment_gateways.d.ts +0 -26
- package/lib/esm/resources/payment_gateways.js +0 -25
- package/lib/esm/resources/payment_methods.d.ts +0 -84
- package/lib/esm/resources/payment_methods.js +0 -48
- package/lib/esm/resources/payment_options.d.ts +0 -45
- package/lib/esm/resources/payment_options.js +0 -34
- package/lib/esm/resources/paypal_gateways.d.ts +0 -42
- package/lib/esm/resources/paypal_gateways.js +0 -38
- package/lib/esm/resources/paypal_payments.d.ts +0 -57
- package/lib/esm/resources/paypal_payments.js +0 -38
- package/lib/esm/resources/percentage_discount_promotions.d.ts +0 -132
- package/lib/esm/resources/percentage_discount_promotions.js +0 -80
- package/lib/esm/resources/price_frequency_tiers.d.ts +0 -54
- package/lib/esm/resources/price_frequency_tiers.js +0 -42
- package/lib/esm/resources/price_lists.d.ts +0 -47
- package/lib/esm/resources/price_lists.js +0 -38
- package/lib/esm/resources/price_tiers.d.ts +0 -33
- package/lib/esm/resources/price_tiers.js +0 -29
- package/lib/esm/resources/price_volume_tiers.d.ts +0 -54
- package/lib/esm/resources/price_volume_tiers.js +0 -42
- package/lib/esm/resources/prices.d.ts +0 -76
- package/lib/esm/resources/prices.js +0 -54
- package/lib/esm/resources/promotion_rules.d.ts +0 -30
- package/lib/esm/resources/promotion_rules.js +0 -21
- package/lib/esm/resources/promotions.d.ts +0 -64
- package/lib/esm/resources/promotions.js +0 -61
- package/lib/esm/resources/recurring_order_copies.d.ts +0 -54
- package/lib/esm/resources/recurring_order_copies.js +0 -42
- package/lib/esm/resources/refunds.d.ts +0 -45
- package/lib/esm/resources/refunds.js +0 -37
- package/lib/esm/resources/reserved_stocks.d.ts +0 -29
- package/lib/esm/resources/reserved_stocks.js +0 -29
- package/lib/esm/resources/resource_errors.d.ts +0 -23
- package/lib/esm/resources/resource_errors.js +0 -17
- package/lib/esm/resources/return_line_items.d.ts +0 -53
- package/lib/esm/resources/return_line_items.js +0 -37
- package/lib/esm/resources/returns.d.ts +0 -97
- package/lib/esm/resources/returns.js +0 -93
- package/lib/esm/resources/satispay_gateways.d.ts +0 -47
- package/lib/esm/resources/satispay_gateways.js +0 -38
- package/lib/esm/resources/satispay_payments.d.ts +0 -54
- package/lib/esm/resources/satispay_payments.js +0 -41
- package/lib/esm/resources/shipments.d.ts +0 -152
- package/lib/esm/resources/shipments.js +0 -131
- package/lib/esm/resources/shipping_categories.d.ts +0 -41
- package/lib/esm/resources/shipping_categories.js +0 -38
- package/lib/esm/resources/shipping_method_tiers.d.ts +0 -33
- package/lib/esm/resources/shipping_method_tiers.js +0 -29
- package/lib/esm/resources/shipping_methods.d.ts +0 -126
- package/lib/esm/resources/shipping_methods.js +0 -71
- package/lib/esm/resources/shipping_weight_tiers.d.ts +0 -51
- package/lib/esm/resources/shipping_weight_tiers.js +0 -38
- package/lib/esm/resources/shipping_zones.d.ts +0 -53
- package/lib/esm/resources/shipping_zones.js +0 -34
- package/lib/esm/resources/sku_list_items.d.ts +0 -52
- package/lib/esm/resources/sku_list_items.js +0 -38
- package/lib/esm/resources/sku_list_promotion_rules.d.ts +0 -77
- package/lib/esm/resources/sku_list_promotion_rules.js +0 -38
- package/lib/esm/resources/sku_lists.d.ts +0 -65
- package/lib/esm/resources/sku_lists.js +0 -50
- package/lib/esm/resources/sku_options.d.ts +0 -72
- package/lib/esm/resources/sku_options.js +0 -46
- package/lib/esm/resources/skus.d.ts +0 -97
- package/lib/esm/resources/skus.js +0 -66
- package/lib/esm/resources/stock_items.d.ts +0 -60
- package/lib/esm/resources/stock_items.js +0 -50
- package/lib/esm/resources/stock_line_items.d.ts +0 -74
- package/lib/esm/resources/stock_line_items.js +0 -55
- package/lib/esm/resources/stock_locations.d.ts +0 -65
- package/lib/esm/resources/stock_locations.js +0 -54
- package/lib/esm/resources/stock_reservations.d.ts +0 -52
- package/lib/esm/resources/stock_reservations.js +0 -49
- package/lib/esm/resources/stock_transfers.d.ts +0 -87
- package/lib/esm/resources/stock_transfers.js +0 -72
- package/lib/esm/resources/stripe_gateways.d.ts +0 -46
- package/lib/esm/resources/stripe_gateways.js +0 -38
- package/lib/esm/resources/stripe_payments.d.ts +0 -63
- package/lib/esm/resources/stripe_payments.js +0 -44
- package/lib/esm/resources/subscription_models.d.ts +0 -50
- package/lib/esm/resources/subscription_models.js +0 -38
- package/lib/esm/resources/tags.d.ts +0 -29
- package/lib/esm/resources/tags.js +0 -26
- package/lib/esm/resources/tax_calculators.d.ts +0 -29
- package/lib/esm/resources/tax_calculators.js +0 -29
- package/lib/esm/resources/tax_categories.d.ts +0 -64
- package/lib/esm/resources/tax_categories.js +0 -38
- package/lib/esm/resources/tax_rules.d.ts +0 -74
- package/lib/esm/resources/tax_rules.js +0 -34
- package/lib/esm/resources/taxjar_accounts.d.ts +0 -48
- package/lib/esm/resources/taxjar_accounts.js +0 -42
- package/lib/esm/resources/transactions.d.ts +0 -42
- package/lib/esm/resources/transactions.js +0 -33
- package/lib/esm/resources/versions.d.ts +0 -23
- package/lib/esm/resources/versions.js +0 -17
- package/lib/esm/resources/voids.d.ts +0 -45
- package/lib/esm/resources/voids.js +0 -37
- package/lib/esm/resources/webhooks.d.ts +0 -56
- package/lib/esm/resources/webhooks.js +0 -43
- package/lib/esm/resources/wire_transfers.d.ts +0 -38
- package/lib/esm/resources/wire_transfers.js +0 -34
- package/lib/esm/static.d.ts +0 -12
- package/lib/esm/static.js +0 -24
- package/lib/esm/util.d.ts +0 -9
- package/lib/esm/util.js +0 -11
- package/lib/tsconfig.esm.tsbuildinfo +0 -1
- package/lib/tsconfig.tsbuildinfo +0 -1
@@ -1,65 +0,0 @@
|
|
1
|
-
import { ApiResource } from '../resource';
|
2
|
-
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
3
|
-
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
4
|
-
import type { Address, AddressType } from './addresses';
|
5
|
-
import type { InventoryStockLocation } from './inventory_stock_locations';
|
6
|
-
import type { InventoryReturnLocation } from './inventory_return_locations';
|
7
|
-
import type { StockItem } from './stock_items';
|
8
|
-
import type { StockTransfer } from './stock_transfers';
|
9
|
-
import type { Attachment } from './attachments';
|
10
|
-
import type { Version } from './versions';
|
11
|
-
type StockLocationType = 'stock_locations';
|
12
|
-
type StockLocationRel = ResourceRel & {
|
13
|
-
type: StockLocationType;
|
14
|
-
};
|
15
|
-
type AddressRel = ResourceRel & {
|
16
|
-
type: AddressType;
|
17
|
-
};
|
18
|
-
interface StockLocation extends Resource {
|
19
|
-
readonly type: StockLocationType;
|
20
|
-
number?: number | null;
|
21
|
-
name: string;
|
22
|
-
code?: string | null;
|
23
|
-
label_format?: string | null;
|
24
|
-
suppress_etd?: boolean | null;
|
25
|
-
address?: Address | null;
|
26
|
-
inventory_stock_locations?: InventoryStockLocation[] | null;
|
27
|
-
inventory_return_locations?: InventoryReturnLocation[] | null;
|
28
|
-
stock_items?: StockItem[] | null;
|
29
|
-
stock_transfers?: StockTransfer[] | null;
|
30
|
-
attachments?: Attachment[] | null;
|
31
|
-
versions?: Version[] | null;
|
32
|
-
}
|
33
|
-
interface StockLocationCreate extends ResourceCreate {
|
34
|
-
name: string;
|
35
|
-
code?: string | null;
|
36
|
-
label_format?: string | null;
|
37
|
-
suppress_etd?: boolean | null;
|
38
|
-
address: AddressRel;
|
39
|
-
}
|
40
|
-
interface StockLocationUpdate extends ResourceUpdate {
|
41
|
-
name?: string | null;
|
42
|
-
code?: string | null;
|
43
|
-
label_format?: string | null;
|
44
|
-
suppress_etd?: boolean | null;
|
45
|
-
address?: AddressRel | null;
|
46
|
-
}
|
47
|
-
declare class StockLocations extends ApiResource<StockLocation> {
|
48
|
-
static readonly TYPE: StockLocationType;
|
49
|
-
create(resource: StockLocationCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
|
50
|
-
update(resource: StockLocationUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
|
51
|
-
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
52
|
-
address(stockLocationId: string | StockLocation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Address>;
|
53
|
-
inventory_stock_locations(stockLocationId: string | StockLocation, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<InventoryStockLocation>>;
|
54
|
-
inventory_return_locations(stockLocationId: string | StockLocation, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<InventoryReturnLocation>>;
|
55
|
-
stock_items(stockLocationId: string | StockLocation, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockItem>>;
|
56
|
-
stock_transfers(stockLocationId: string | StockLocation, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockTransfer>>;
|
57
|
-
attachments(stockLocationId: string | StockLocation, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
58
|
-
versions(stockLocationId: string | StockLocation, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
59
|
-
isStockLocation(resource: any): resource is StockLocation;
|
60
|
-
relationship(id: string | ResourceId | null): StockLocationRel;
|
61
|
-
relationshipToMany(...ids: string[]): StockLocationRel[];
|
62
|
-
type(): StockLocationType;
|
63
|
-
}
|
64
|
-
export default StockLocations;
|
65
|
-
export type { StockLocation, StockLocationCreate, StockLocationUpdate, StockLocationType };
|
@@ -1,56 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
const resource_1 = require("../resource");
|
4
|
-
class StockLocations extends resource_1.ApiResource {
|
5
|
-
async create(resource, params, options) {
|
6
|
-
return this.resources.create({ ...resource, type: StockLocations.TYPE }, params, options);
|
7
|
-
}
|
8
|
-
async update(resource, params, options) {
|
9
|
-
return this.resources.update({ ...resource, type: StockLocations.TYPE }, params, options);
|
10
|
-
}
|
11
|
-
async delete(id, options) {
|
12
|
-
await this.resources.delete((typeof id === 'string') ? { id, type: StockLocations.TYPE } : id, options);
|
13
|
-
}
|
14
|
-
async address(stockLocationId, params, options) {
|
15
|
-
const _stockLocationId = stockLocationId.id || stockLocationId;
|
16
|
-
return this.resources.fetch({ type: 'addresses' }, `stock_locations/${_stockLocationId}/address`, params, options);
|
17
|
-
}
|
18
|
-
async inventory_stock_locations(stockLocationId, params, options) {
|
19
|
-
const _stockLocationId = stockLocationId.id || stockLocationId;
|
20
|
-
return this.resources.fetch({ type: 'inventory_stock_locations' }, `stock_locations/${_stockLocationId}/inventory_stock_locations`, params, options);
|
21
|
-
}
|
22
|
-
async inventory_return_locations(stockLocationId, params, options) {
|
23
|
-
const _stockLocationId = stockLocationId.id || stockLocationId;
|
24
|
-
return this.resources.fetch({ type: 'inventory_return_locations' }, `stock_locations/${_stockLocationId}/inventory_return_locations`, params, options);
|
25
|
-
}
|
26
|
-
async stock_items(stockLocationId, params, options) {
|
27
|
-
const _stockLocationId = stockLocationId.id || stockLocationId;
|
28
|
-
return this.resources.fetch({ type: 'stock_items' }, `stock_locations/${_stockLocationId}/stock_items`, params, options);
|
29
|
-
}
|
30
|
-
async stock_transfers(stockLocationId, params, options) {
|
31
|
-
const _stockLocationId = stockLocationId.id || stockLocationId;
|
32
|
-
return this.resources.fetch({ type: 'stock_transfers' }, `stock_locations/${_stockLocationId}/stock_transfers`, params, options);
|
33
|
-
}
|
34
|
-
async attachments(stockLocationId, params, options) {
|
35
|
-
const _stockLocationId = stockLocationId.id || stockLocationId;
|
36
|
-
return this.resources.fetch({ type: 'attachments' }, `stock_locations/${_stockLocationId}/attachments`, params, options);
|
37
|
-
}
|
38
|
-
async versions(stockLocationId, params, options) {
|
39
|
-
const _stockLocationId = stockLocationId.id || stockLocationId;
|
40
|
-
return this.resources.fetch({ type: 'versions' }, `stock_locations/${_stockLocationId}/versions`, params, options);
|
41
|
-
}
|
42
|
-
isStockLocation(resource) {
|
43
|
-
return resource.type && (resource.type === StockLocations.TYPE);
|
44
|
-
}
|
45
|
-
relationship(id) {
|
46
|
-
return super.relationshipOneToOne(id);
|
47
|
-
}
|
48
|
-
relationshipToMany(...ids) {
|
49
|
-
return super.relationshipOneToMany(...ids);
|
50
|
-
}
|
51
|
-
type() {
|
52
|
-
return StockLocations.TYPE;
|
53
|
-
}
|
54
|
-
}
|
55
|
-
StockLocations.TYPE = 'stock_locations';
|
56
|
-
exports.default = StockLocations;
|
@@ -1,52 +0,0 @@
|
|
1
|
-
import { ApiResource } from '../resource';
|
2
|
-
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel } from '../resource';
|
3
|
-
import type { QueryParamsRetrieve } from '../query';
|
4
|
-
import type { LineItem } from './line_items';
|
5
|
-
import type { Order } from './orders';
|
6
|
-
import type { StockItem, StockItemType } from './stock_items';
|
7
|
-
import type { ReservedStock } from './reserved_stocks';
|
8
|
-
import type { Sku } from './skus';
|
9
|
-
type StockReservationType = 'stock_reservations';
|
10
|
-
type StockReservationRel = ResourceRel & {
|
11
|
-
type: StockReservationType;
|
12
|
-
};
|
13
|
-
type StockItemRel = ResourceRel & {
|
14
|
-
type: StockItemType;
|
15
|
-
};
|
16
|
-
interface StockReservation extends Resource {
|
17
|
-
readonly type: StockReservationType;
|
18
|
-
status: 'draft' | 'pending';
|
19
|
-
quantity: number;
|
20
|
-
expires_at: string;
|
21
|
-
line_item?: LineItem | null;
|
22
|
-
order?: Order | null;
|
23
|
-
stock_item?: StockItem | null;
|
24
|
-
reserved_stock?: ReservedStock | null;
|
25
|
-
sku?: Sku | null;
|
26
|
-
}
|
27
|
-
interface StockReservationCreate extends ResourceCreate {
|
28
|
-
quantity: number;
|
29
|
-
stock_item: StockItemRel;
|
30
|
-
}
|
31
|
-
interface StockReservationUpdate extends ResourceUpdate {
|
32
|
-
quantity?: number | null;
|
33
|
-
_pending?: boolean | null;
|
34
|
-
}
|
35
|
-
declare class StockReservations extends ApiResource<StockReservation> {
|
36
|
-
static readonly TYPE: StockReservationType;
|
37
|
-
create(resource: StockReservationCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockReservation>;
|
38
|
-
update(resource: StockReservationUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockReservation>;
|
39
|
-
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
40
|
-
line_item(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
|
41
|
-
order(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
42
|
-
stock_item(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockItem>;
|
43
|
-
reserved_stock(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ReservedStock>;
|
44
|
-
sku(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
|
45
|
-
_pending(id: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockReservation>;
|
46
|
-
isStockReservation(resource: any): resource is StockReservation;
|
47
|
-
relationship(id: string | ResourceId | null): StockReservationRel;
|
48
|
-
relationshipToMany(...ids: string[]): StockReservationRel[];
|
49
|
-
type(): StockReservationType;
|
50
|
-
}
|
51
|
-
export default StockReservations;
|
52
|
-
export type { StockReservation, StockReservationCreate, StockReservationUpdate, StockReservationType };
|
@@ -1,51 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
const resource_1 = require("../resource");
|
4
|
-
class StockReservations extends resource_1.ApiResource {
|
5
|
-
async create(resource, params, options) {
|
6
|
-
return this.resources.create({ ...resource, type: StockReservations.TYPE }, params, options);
|
7
|
-
}
|
8
|
-
async update(resource, params, options) {
|
9
|
-
return this.resources.update({ ...resource, type: StockReservations.TYPE }, params, options);
|
10
|
-
}
|
11
|
-
async delete(id, options) {
|
12
|
-
await this.resources.delete((typeof id === 'string') ? { id, type: StockReservations.TYPE } : id, options);
|
13
|
-
}
|
14
|
-
async line_item(stockReservationId, params, options) {
|
15
|
-
const _stockReservationId = stockReservationId.id || stockReservationId;
|
16
|
-
return this.resources.fetch({ type: 'line_items' }, `stock_reservations/${_stockReservationId}/line_item`, params, options);
|
17
|
-
}
|
18
|
-
async order(stockReservationId, params, options) {
|
19
|
-
const _stockReservationId = stockReservationId.id || stockReservationId;
|
20
|
-
return this.resources.fetch({ type: 'orders' }, `stock_reservations/${_stockReservationId}/order`, params, options);
|
21
|
-
}
|
22
|
-
async stock_item(stockReservationId, params, options) {
|
23
|
-
const _stockReservationId = stockReservationId.id || stockReservationId;
|
24
|
-
return this.resources.fetch({ type: 'stock_items' }, `stock_reservations/${_stockReservationId}/stock_item`, params, options);
|
25
|
-
}
|
26
|
-
async reserved_stock(stockReservationId, params, options) {
|
27
|
-
const _stockReservationId = stockReservationId.id || stockReservationId;
|
28
|
-
return this.resources.fetch({ type: 'reserved_stocks' }, `stock_reservations/${_stockReservationId}/reserved_stock`, params, options);
|
29
|
-
}
|
30
|
-
async sku(stockReservationId, params, options) {
|
31
|
-
const _stockReservationId = stockReservationId.id || stockReservationId;
|
32
|
-
return this.resources.fetch({ type: 'skus' }, `stock_reservations/${_stockReservationId}/sku`, params, options);
|
33
|
-
}
|
34
|
-
async _pending(id, params, options) {
|
35
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: StockReservations.TYPE, _pending: true }, params, options);
|
36
|
-
}
|
37
|
-
isStockReservation(resource) {
|
38
|
-
return resource.type && (resource.type === StockReservations.TYPE);
|
39
|
-
}
|
40
|
-
relationship(id) {
|
41
|
-
return super.relationshipOneToOne(id);
|
42
|
-
}
|
43
|
-
relationshipToMany(...ids) {
|
44
|
-
return super.relationshipOneToMany(...ids);
|
45
|
-
}
|
46
|
-
type() {
|
47
|
-
return StockReservations.TYPE;
|
48
|
-
}
|
49
|
-
}
|
50
|
-
StockReservations.TYPE = 'stock_reservations';
|
51
|
-
exports.default = StockReservations;
|
@@ -1,87 +0,0 @@
|
|
1
|
-
import { ApiResource } from '../resource';
|
2
|
-
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
3
|
-
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
4
|
-
import type { Sku, SkuType } from './skus';
|
5
|
-
import type { StockLocation, StockLocationType } from './stock_locations';
|
6
|
-
import type { Shipment, ShipmentType } from './shipments';
|
7
|
-
import type { LineItem, LineItemType } from './line_items';
|
8
|
-
import type { Event } from './events';
|
9
|
-
import type { Version } from './versions';
|
10
|
-
type StockTransferType = 'stock_transfers';
|
11
|
-
type StockTransferRel = ResourceRel & {
|
12
|
-
type: StockTransferType;
|
13
|
-
};
|
14
|
-
type SkuRel = ResourceRel & {
|
15
|
-
type: SkuType;
|
16
|
-
};
|
17
|
-
type StockLocationRel = ResourceRel & {
|
18
|
-
type: StockLocationType;
|
19
|
-
};
|
20
|
-
type ShipmentRel = ResourceRel & {
|
21
|
-
type: ShipmentType;
|
22
|
-
};
|
23
|
-
type LineItemRel = ResourceRel & {
|
24
|
-
type: LineItemType;
|
25
|
-
};
|
26
|
-
interface StockTransfer extends Resource {
|
27
|
-
readonly type: StockTransferType;
|
28
|
-
number?: string | null;
|
29
|
-
sku_code?: string | null;
|
30
|
-
status: 'draft' | 'upcoming' | 'on_hold' | 'picking' | 'in_transit' | 'completed' | 'cancelled';
|
31
|
-
quantity: number;
|
32
|
-
completed_at?: string | null;
|
33
|
-
cancelled_at?: string | null;
|
34
|
-
sku?: Sku | null;
|
35
|
-
origin_stock_location?: StockLocation | null;
|
36
|
-
destination_stock_location?: StockLocation | null;
|
37
|
-
shipment?: Shipment | null;
|
38
|
-
line_item?: LineItem | null;
|
39
|
-
events?: Event[] | null;
|
40
|
-
versions?: Version[] | null;
|
41
|
-
}
|
42
|
-
interface StockTransferCreate extends ResourceCreate {
|
43
|
-
sku_code?: string | null;
|
44
|
-
quantity: number;
|
45
|
-
sku: SkuRel;
|
46
|
-
origin_stock_location: StockLocationRel;
|
47
|
-
destination_stock_location: StockLocationRel;
|
48
|
-
shipment?: ShipmentRel | null;
|
49
|
-
line_item?: LineItemRel | null;
|
50
|
-
}
|
51
|
-
interface StockTransferUpdate extends ResourceUpdate {
|
52
|
-
sku_code?: string | null;
|
53
|
-
_upcoming?: boolean | null;
|
54
|
-
_on_hold?: boolean | null;
|
55
|
-
_picking?: boolean | null;
|
56
|
-
_in_transit?: boolean | null;
|
57
|
-
_complete?: boolean | null;
|
58
|
-
_cancel?: boolean | null;
|
59
|
-
sku?: SkuRel | null;
|
60
|
-
origin_stock_location?: StockLocationRel | null;
|
61
|
-
destination_stock_location?: StockLocationRel | null;
|
62
|
-
}
|
63
|
-
declare class StockTransfers extends ApiResource<StockTransfer> {
|
64
|
-
static readonly TYPE: StockTransferType;
|
65
|
-
create(resource: StockTransferCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
|
66
|
-
update(resource: StockTransferUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
|
67
|
-
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
68
|
-
sku(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
|
69
|
-
origin_stock_location(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
|
70
|
-
destination_stock_location(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
|
71
|
-
shipment(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Shipment>;
|
72
|
-
line_item(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
|
73
|
-
events(stockTransferId: string | StockTransfer, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
74
|
-
versions(stockTransferId: string | StockTransfer, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
75
|
-
_upcoming(id: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
|
76
|
-
_on_hold(id: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
|
77
|
-
_picking(id: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
|
78
|
-
_in_transit(id: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
|
79
|
-
_complete(id: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
|
80
|
-
_cancel(id: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
|
81
|
-
isStockTransfer(resource: any): resource is StockTransfer;
|
82
|
-
relationship(id: string | ResourceId | null): StockTransferRel;
|
83
|
-
relationshipToMany(...ids: string[]): StockTransferRel[];
|
84
|
-
type(): StockTransferType;
|
85
|
-
}
|
86
|
-
export default StockTransfers;
|
87
|
-
export type { StockTransfer, StockTransferCreate, StockTransferUpdate, StockTransferType };
|
@@ -1,74 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
const resource_1 = require("../resource");
|
4
|
-
class StockTransfers extends resource_1.ApiResource {
|
5
|
-
async create(resource, params, options) {
|
6
|
-
return this.resources.create({ ...resource, type: StockTransfers.TYPE }, params, options);
|
7
|
-
}
|
8
|
-
async update(resource, params, options) {
|
9
|
-
return this.resources.update({ ...resource, type: StockTransfers.TYPE }, params, options);
|
10
|
-
}
|
11
|
-
async delete(id, options) {
|
12
|
-
await this.resources.delete((typeof id === 'string') ? { id, type: StockTransfers.TYPE } : id, options);
|
13
|
-
}
|
14
|
-
async sku(stockTransferId, params, options) {
|
15
|
-
const _stockTransferId = stockTransferId.id || stockTransferId;
|
16
|
-
return this.resources.fetch({ type: 'skus' }, `stock_transfers/${_stockTransferId}/sku`, params, options);
|
17
|
-
}
|
18
|
-
async origin_stock_location(stockTransferId, params, options) {
|
19
|
-
const _stockTransferId = stockTransferId.id || stockTransferId;
|
20
|
-
return this.resources.fetch({ type: 'stock_locations' }, `stock_transfers/${_stockTransferId}/origin_stock_location`, params, options);
|
21
|
-
}
|
22
|
-
async destination_stock_location(stockTransferId, params, options) {
|
23
|
-
const _stockTransferId = stockTransferId.id || stockTransferId;
|
24
|
-
return this.resources.fetch({ type: 'stock_locations' }, `stock_transfers/${_stockTransferId}/destination_stock_location`, params, options);
|
25
|
-
}
|
26
|
-
async shipment(stockTransferId, params, options) {
|
27
|
-
const _stockTransferId = stockTransferId.id || stockTransferId;
|
28
|
-
return this.resources.fetch({ type: 'shipments' }, `stock_transfers/${_stockTransferId}/shipment`, params, options);
|
29
|
-
}
|
30
|
-
async line_item(stockTransferId, params, options) {
|
31
|
-
const _stockTransferId = stockTransferId.id || stockTransferId;
|
32
|
-
return this.resources.fetch({ type: 'line_items' }, `stock_transfers/${_stockTransferId}/line_item`, params, options);
|
33
|
-
}
|
34
|
-
async events(stockTransferId, params, options) {
|
35
|
-
const _stockTransferId = stockTransferId.id || stockTransferId;
|
36
|
-
return this.resources.fetch({ type: 'events' }, `stock_transfers/${_stockTransferId}/events`, params, options);
|
37
|
-
}
|
38
|
-
async versions(stockTransferId, params, options) {
|
39
|
-
const _stockTransferId = stockTransferId.id || stockTransferId;
|
40
|
-
return this.resources.fetch({ type: 'versions' }, `stock_transfers/${_stockTransferId}/versions`, params, options);
|
41
|
-
}
|
42
|
-
async _upcoming(id, params, options) {
|
43
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: StockTransfers.TYPE, _upcoming: true }, params, options);
|
44
|
-
}
|
45
|
-
async _on_hold(id, params, options) {
|
46
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: StockTransfers.TYPE, _on_hold: true }, params, options);
|
47
|
-
}
|
48
|
-
async _picking(id, params, options) {
|
49
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: StockTransfers.TYPE, _picking: true }, params, options);
|
50
|
-
}
|
51
|
-
async _in_transit(id, params, options) {
|
52
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: StockTransfers.TYPE, _in_transit: true }, params, options);
|
53
|
-
}
|
54
|
-
async _complete(id, params, options) {
|
55
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: StockTransfers.TYPE, _complete: true }, params, options);
|
56
|
-
}
|
57
|
-
async _cancel(id, params, options) {
|
58
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: StockTransfers.TYPE, _cancel: true }, params, options);
|
59
|
-
}
|
60
|
-
isStockTransfer(resource) {
|
61
|
-
return resource.type && (resource.type === StockTransfers.TYPE);
|
62
|
-
}
|
63
|
-
relationship(id) {
|
64
|
-
return super.relationshipOneToOne(id);
|
65
|
-
}
|
66
|
-
relationshipToMany(...ids) {
|
67
|
-
return super.relationshipOneToMany(...ids);
|
68
|
-
}
|
69
|
-
type() {
|
70
|
-
return StockTransfers.TYPE;
|
71
|
-
}
|
72
|
-
}
|
73
|
-
StockTransfers.TYPE = 'stock_transfers';
|
74
|
-
exports.default = StockTransfers;
|
@@ -1,46 +0,0 @@
|
|
1
|
-
import { ApiResource } from '../resource';
|
2
|
-
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
3
|
-
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
4
|
-
import type { PaymentMethod } from './payment_methods';
|
5
|
-
import type { Version } from './versions';
|
6
|
-
import type { StripePayment } from './stripe_payments';
|
7
|
-
type StripeGatewayType = 'stripe_gateways';
|
8
|
-
type StripeGatewayRel = ResourceRel & {
|
9
|
-
type: StripeGatewayType;
|
10
|
-
};
|
11
|
-
interface StripeGateway extends Resource {
|
12
|
-
readonly type: StripeGatewayType;
|
13
|
-
name: string;
|
14
|
-
auto_payments?: boolean | null;
|
15
|
-
webhook_endpoint_id?: string | null;
|
16
|
-
webhook_endpoint_secret?: string | null;
|
17
|
-
webhook_endpoint_url?: string | null;
|
18
|
-
payment_methods?: PaymentMethod[] | null;
|
19
|
-
versions?: Version[] | null;
|
20
|
-
stripe_payments?: StripePayment[] | null;
|
21
|
-
}
|
22
|
-
interface StripeGatewayCreate extends ResourceCreate {
|
23
|
-
name: string;
|
24
|
-
login: string;
|
25
|
-
publishable_key?: string | null;
|
26
|
-
auto_payments?: boolean | null;
|
27
|
-
}
|
28
|
-
interface StripeGatewayUpdate extends ResourceUpdate {
|
29
|
-
name?: string | null;
|
30
|
-
auto_payments?: boolean | null;
|
31
|
-
}
|
32
|
-
declare class StripeGateways extends ApiResource<StripeGateway> {
|
33
|
-
static readonly TYPE: StripeGatewayType;
|
34
|
-
create(resource: StripeGatewayCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StripeGateway>;
|
35
|
-
update(resource: StripeGatewayUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StripeGateway>;
|
36
|
-
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
37
|
-
payment_methods(stripeGatewayId: string | StripeGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>>;
|
38
|
-
versions(stripeGatewayId: string | StripeGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
39
|
-
stripe_payments(stripeGatewayId: string | StripeGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StripePayment>>;
|
40
|
-
isStripeGateway(resource: any): resource is StripeGateway;
|
41
|
-
relationship(id: string | ResourceId | null): StripeGatewayRel;
|
42
|
-
relationshipToMany(...ids: string[]): StripeGatewayRel[];
|
43
|
-
type(): StripeGatewayType;
|
44
|
-
}
|
45
|
-
export default StripeGateways;
|
46
|
-
export type { StripeGateway, StripeGatewayCreate, StripeGatewayUpdate, StripeGatewayType };
|
@@ -1,40 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
const resource_1 = require("../resource");
|
4
|
-
class StripeGateways extends resource_1.ApiResource {
|
5
|
-
async create(resource, params, options) {
|
6
|
-
return this.resources.create({ ...resource, type: StripeGateways.TYPE }, params, options);
|
7
|
-
}
|
8
|
-
async update(resource, params, options) {
|
9
|
-
return this.resources.update({ ...resource, type: StripeGateways.TYPE }, params, options);
|
10
|
-
}
|
11
|
-
async delete(id, options) {
|
12
|
-
await this.resources.delete((typeof id === 'string') ? { id, type: StripeGateways.TYPE } : id, options);
|
13
|
-
}
|
14
|
-
async payment_methods(stripeGatewayId, params, options) {
|
15
|
-
const _stripeGatewayId = stripeGatewayId.id || stripeGatewayId;
|
16
|
-
return this.resources.fetch({ type: 'payment_methods' }, `stripe_gateways/${_stripeGatewayId}/payment_methods`, params, options);
|
17
|
-
}
|
18
|
-
async versions(stripeGatewayId, params, options) {
|
19
|
-
const _stripeGatewayId = stripeGatewayId.id || stripeGatewayId;
|
20
|
-
return this.resources.fetch({ type: 'versions' }, `stripe_gateways/${_stripeGatewayId}/versions`, params, options);
|
21
|
-
}
|
22
|
-
async stripe_payments(stripeGatewayId, params, options) {
|
23
|
-
const _stripeGatewayId = stripeGatewayId.id || stripeGatewayId;
|
24
|
-
return this.resources.fetch({ type: 'stripe_payments' }, `stripe_gateways/${_stripeGatewayId}/stripe_payments`, params, options);
|
25
|
-
}
|
26
|
-
isStripeGateway(resource) {
|
27
|
-
return resource.type && (resource.type === StripeGateways.TYPE);
|
28
|
-
}
|
29
|
-
relationship(id) {
|
30
|
-
return super.relationshipOneToOne(id);
|
31
|
-
}
|
32
|
-
relationshipToMany(...ids) {
|
33
|
-
return super.relationshipOneToMany(...ids);
|
34
|
-
}
|
35
|
-
type() {
|
36
|
-
return StripeGateways.TYPE;
|
37
|
-
}
|
38
|
-
}
|
39
|
-
StripeGateways.TYPE = 'stripe_gateways';
|
40
|
-
exports.default = StripeGateways;
|
@@ -1,63 +0,0 @@
|
|
1
|
-
import { ApiResource } from '../resource';
|
2
|
-
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
3
|
-
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
4
|
-
import type { Order, OrderType } from './orders';
|
5
|
-
import type { PaymentGateway } from './payment_gateways';
|
6
|
-
import type { Version } from './versions';
|
7
|
-
type StripePaymentType = 'stripe_payments';
|
8
|
-
type StripePaymentRel = ResourceRel & {
|
9
|
-
type: StripePaymentType;
|
10
|
-
};
|
11
|
-
type OrderRel = ResourceRel & {
|
12
|
-
type: OrderType;
|
13
|
-
};
|
14
|
-
interface StripePayment extends Resource {
|
15
|
-
readonly type: StripePaymentType;
|
16
|
-
stripe_id?: string | null;
|
17
|
-
client_secret?: string | null;
|
18
|
-
publishable_key?: string | null;
|
19
|
-
options?: Record<string, any> | null;
|
20
|
-
payment_method?: Record<string, any> | null;
|
21
|
-
mismatched_amounts?: boolean | null;
|
22
|
-
intent_amount_cents: number;
|
23
|
-
intent_amount_float?: number | null;
|
24
|
-
formatted_intent_amount?: string | null;
|
25
|
-
return_url?: string | null;
|
26
|
-
receipt_email?: string | null;
|
27
|
-
payment_instrument?: Record<string, any> | null;
|
28
|
-
order?: Order | null;
|
29
|
-
payment_gateway?: PaymentGateway | null;
|
30
|
-
versions?: Version[] | null;
|
31
|
-
}
|
32
|
-
interface StripePaymentCreate extends ResourceCreate {
|
33
|
-
stripe_id?: string | null;
|
34
|
-
client_secret?: string | null;
|
35
|
-
options?: Record<string, any> | null;
|
36
|
-
return_url?: string | null;
|
37
|
-
receipt_email?: string | null;
|
38
|
-
order: OrderRel;
|
39
|
-
}
|
40
|
-
interface StripePaymentUpdate extends ResourceUpdate {
|
41
|
-
options?: Record<string, any> | null;
|
42
|
-
return_url?: string | null;
|
43
|
-
_update?: boolean | null;
|
44
|
-
_refresh?: boolean | null;
|
45
|
-
order?: OrderRel | null;
|
46
|
-
}
|
47
|
-
declare class StripePayments extends ApiResource<StripePayment> {
|
48
|
-
static readonly TYPE: StripePaymentType;
|
49
|
-
create(resource: StripePaymentCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StripePayment>;
|
50
|
-
update(resource: StripePaymentUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StripePayment>;
|
51
|
-
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
52
|
-
order(stripePaymentId: string | StripePayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
53
|
-
payment_gateway(stripePaymentId: string | StripePayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentGateway>;
|
54
|
-
versions(stripePaymentId: string | StripePayment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
55
|
-
_update(id: string | StripePayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StripePayment>;
|
56
|
-
_refresh(id: string | StripePayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StripePayment>;
|
57
|
-
isStripePayment(resource: any): resource is StripePayment;
|
58
|
-
relationship(id: string | ResourceId | null): StripePaymentRel;
|
59
|
-
relationshipToMany(...ids: string[]): StripePaymentRel[];
|
60
|
-
type(): StripePaymentType;
|
61
|
-
}
|
62
|
-
export default StripePayments;
|
63
|
-
export type { StripePayment, StripePaymentCreate, StripePaymentUpdate, StripePaymentType };
|
@@ -1,46 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
const resource_1 = require("../resource");
|
4
|
-
class StripePayments extends resource_1.ApiResource {
|
5
|
-
async create(resource, params, options) {
|
6
|
-
return this.resources.create({ ...resource, type: StripePayments.TYPE }, params, options);
|
7
|
-
}
|
8
|
-
async update(resource, params, options) {
|
9
|
-
return this.resources.update({ ...resource, type: StripePayments.TYPE }, params, options);
|
10
|
-
}
|
11
|
-
async delete(id, options) {
|
12
|
-
await this.resources.delete((typeof id === 'string') ? { id, type: StripePayments.TYPE } : id, options);
|
13
|
-
}
|
14
|
-
async order(stripePaymentId, params, options) {
|
15
|
-
const _stripePaymentId = stripePaymentId.id || stripePaymentId;
|
16
|
-
return this.resources.fetch({ type: 'orders' }, `stripe_payments/${_stripePaymentId}/order`, params, options);
|
17
|
-
}
|
18
|
-
async payment_gateway(stripePaymentId, params, options) {
|
19
|
-
const _stripePaymentId = stripePaymentId.id || stripePaymentId;
|
20
|
-
return this.resources.fetch({ type: 'payment_gateways' }, `stripe_payments/${_stripePaymentId}/payment_gateway`, params, options);
|
21
|
-
}
|
22
|
-
async versions(stripePaymentId, params, options) {
|
23
|
-
const _stripePaymentId = stripePaymentId.id || stripePaymentId;
|
24
|
-
return this.resources.fetch({ type: 'versions' }, `stripe_payments/${_stripePaymentId}/versions`, params, options);
|
25
|
-
}
|
26
|
-
async _update(id, params, options) {
|
27
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: StripePayments.TYPE, _update: true }, params, options);
|
28
|
-
}
|
29
|
-
async _refresh(id, params, options) {
|
30
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: StripePayments.TYPE, _refresh: true }, params, options);
|
31
|
-
}
|
32
|
-
isStripePayment(resource) {
|
33
|
-
return resource.type && (resource.type === StripePayments.TYPE);
|
34
|
-
}
|
35
|
-
relationship(id) {
|
36
|
-
return super.relationshipOneToOne(id);
|
37
|
-
}
|
38
|
-
relationshipToMany(...ids) {
|
39
|
-
return super.relationshipOneToMany(...ids);
|
40
|
-
}
|
41
|
-
type() {
|
42
|
-
return StripePayments.TYPE;
|
43
|
-
}
|
44
|
-
}
|
45
|
-
StripePayments.TYPE = 'stripe_payments';
|
46
|
-
exports.default = StripePayments;
|
@@ -1,50 +0,0 @@
|
|
1
|
-
import { ApiResource } from '../resource';
|
2
|
-
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
3
|
-
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
4
|
-
import type { Market } from './markets';
|
5
|
-
import type { OrderSubscription } from './order_subscriptions';
|
6
|
-
import type { Attachment } from './attachments';
|
7
|
-
type SubscriptionModelType = 'subscription_models';
|
8
|
-
type SubscriptionModelRel = ResourceRel & {
|
9
|
-
type: SubscriptionModelType;
|
10
|
-
};
|
11
|
-
interface SubscriptionModel extends Resource {
|
12
|
-
readonly type: SubscriptionModelType;
|
13
|
-
name: string;
|
14
|
-
strategy?: string | null;
|
15
|
-
frequencies: string[];
|
16
|
-
auto_activate?: boolean | null;
|
17
|
-
auto_cancel?: boolean | null;
|
18
|
-
markets?: Market[] | null;
|
19
|
-
order_subscriptions?: OrderSubscription[] | null;
|
20
|
-
attachments?: Attachment[] | null;
|
21
|
-
}
|
22
|
-
interface SubscriptionModelCreate extends ResourceCreate {
|
23
|
-
name: string;
|
24
|
-
strategy?: string | null;
|
25
|
-
frequencies: string[];
|
26
|
-
auto_activate?: boolean | null;
|
27
|
-
auto_cancel?: boolean | null;
|
28
|
-
}
|
29
|
-
interface SubscriptionModelUpdate extends ResourceUpdate {
|
30
|
-
name?: string | null;
|
31
|
-
strategy?: string | null;
|
32
|
-
frequencies?: string[] | null;
|
33
|
-
auto_activate?: boolean | null;
|
34
|
-
auto_cancel?: boolean | null;
|
35
|
-
}
|
36
|
-
declare class SubscriptionModels extends ApiResource<SubscriptionModel> {
|
37
|
-
static readonly TYPE: SubscriptionModelType;
|
38
|
-
create(resource: SubscriptionModelCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SubscriptionModel>;
|
39
|
-
update(resource: SubscriptionModelUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SubscriptionModel>;
|
40
|
-
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
41
|
-
markets(subscriptionModelId: string | SubscriptionModel, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Market>>;
|
42
|
-
order_subscriptions(subscriptionModelId: string | SubscriptionModel, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<OrderSubscription>>;
|
43
|
-
attachments(subscriptionModelId: string | SubscriptionModel, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
44
|
-
isSubscriptionModel(resource: any): resource is SubscriptionModel;
|
45
|
-
relationship(id: string | ResourceId | null): SubscriptionModelRel;
|
46
|
-
relationshipToMany(...ids: string[]): SubscriptionModelRel[];
|
47
|
-
type(): SubscriptionModelType;
|
48
|
-
}
|
49
|
-
export default SubscriptionModels;
|
50
|
-
export type { SubscriptionModel, SubscriptionModelCreate, SubscriptionModelUpdate, SubscriptionModelType };
|