@commercelayer/sdk 5.37.0 → 5.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/api.d.ts +1 -164
- package/lib/cjs/api.js +1 -387
- package/lib/cjs/client.d.ts +1 -39
- package/lib/cjs/client.js +1 -154
- package/lib/cjs/commercelayer.d.ts +1 -153
- package/lib/cjs/commercelayer.js +1 -253
- package/lib/cjs/common.d.ts +1 -5
- package/lib/cjs/common.js +1 -23
- package/lib/cjs/config.d.ts +1 -15
- package/lib/cjs/config.js +1 -19
- package/lib/cjs/debug.d.ts +1 -3
- package/lib/cjs/debug.js +1 -38
- package/lib/cjs/error.d.ts +1 -31
- package/lib/cjs/error.js +1 -77
- package/lib/cjs/index.d.ts +1 -7
- package/lib/cjs/index.js +1 -13
- package/lib/cjs/interceptor.d.ts +1 -25
- package/lib/cjs/interceptor.js +1 -2
- package/lib/cjs/jsonapi.d.ts +1 -6
- package/lib/cjs/jsonapi.js +1 -94
- package/lib/cjs/model.d.ts +1 -124
- package/lib/cjs/model.js +1 -3
- package/lib/cjs/query.d.ts +1 -17
- package/lib/cjs/query.js +1 -69
- package/lib/cjs/resource.d.ts +1 -89
- package/lib/cjs/resource.js +1 -198
- package/lib/cjs/resources/addresses.d.ts +1 -103
- package/lib/cjs/resources/addresses.js +1 -41
- package/lib/cjs/resources/adjustments.d.ts +1 -42
- package/lib/cjs/resources/adjustments.js +1 -29
- package/lib/cjs/resources/adyen_gateways.d.ts +1 -60
- package/lib/cjs/resources/adyen_gateways.js +1 -37
- package/lib/cjs/resources/adyen_payments.d.ts +1 -51
- package/lib/cjs/resources/adyen_payments.js +1 -40
- package/lib/cjs/resources/application.d.ts +1 -22
- package/lib/cjs/resources/application.js +1 -16
- package/lib/cjs/resources/attachments.d.ts +1 -157
- package/lib/cjs/resources/attachments.js +1 -25
- package/lib/cjs/resources/authorizations.d.ts +1 -70
- package/lib/cjs/resources/authorizations.js +1 -52
- package/lib/cjs/resources/avalara_accounts.d.ts +1 -59
- package/lib/cjs/resources/avalara_accounts.js +1 -41
- package/lib/cjs/resources/axerve_gateways.d.ts +1 -48
- package/lib/cjs/resources/axerve_gateways.js +1 -37
- package/lib/cjs/resources/axerve_payments.d.ts +1 -54
- package/lib/cjs/resources/axerve_payments.js +1 -40
- package/lib/cjs/resources/billing_info_validation_rules.d.ts +1 -39
- package/lib/cjs/resources/billing_info_validation_rules.js +1 -37
- package/lib/cjs/resources/bing_geocoders.d.ts +1 -36
- package/lib/cjs/resources/bing_geocoders.js +1 -33
- package/lib/cjs/resources/braintree_gateways.d.ts +1 -60
- package/lib/cjs/resources/braintree_gateways.js +1 -37
- package/lib/cjs/resources/braintree_payments.d.ts +1 -52
- package/lib/cjs/resources/braintree_payments.js +1 -37
- package/lib/cjs/resources/bundles.d.ts +1 -93
- package/lib/cjs/resources/bundles.js +1 -59
- package/lib/cjs/resources/buy_x_pay_y_promotions.d.ts +1 -137
- package/lib/cjs/resources/buy_x_pay_y_promotions.js +1 -79
- package/lib/cjs/resources/captures.d.ts +1 -60
- package/lib/cjs/resources/captures.js +1 -49
- package/lib/cjs/resources/carrier_accounts.d.ts +1 -30
- package/lib/cjs/resources/carrier_accounts.js +1 -28
- package/lib/cjs/resources/checkout_com_gateways.d.ts +1 -49
- package/lib/cjs/resources/checkout_com_gateways.js +1 -37
- package/lib/cjs/resources/checkout_com_payments.d.ts +1 -65
- package/lib/cjs/resources/checkout_com_payments.js +1 -43
- package/lib/cjs/resources/cleanups.d.ts +1 -40
- package/lib/cjs/resources/cleanups.js +1 -30
- package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +1 -67
- package/lib/cjs/resources/coupon_codes_promotion_rules.js +1 -33
- package/lib/cjs/resources/coupon_recipients.d.ts +1 -48
- package/lib/cjs/resources/coupon_recipients.js +1 -37
- package/lib/cjs/resources/coupons.d.ts +1 -71
- package/lib/cjs/resources/coupons.js +1 -45
- package/lib/cjs/resources/custom_promotion_rules.d.ts +1 -62
- package/lib/cjs/resources/custom_promotion_rules.js +1 -29
- package/lib/cjs/resources/customer_addresses.d.ts +1 -50
- package/lib/cjs/resources/customer_addresses.js +1 -41
- package/lib/cjs/resources/customer_groups.d.ts +1 -40
- package/lib/cjs/resources/customer_groups.js +1 -41
- package/lib/cjs/resources/customer_password_resets.d.ts +1 -38
- package/lib/cjs/resources/customer_password_resets.js +1 -36
- package/lib/cjs/resources/customer_payment_sources.d.ts +1 -86
- package/lib/cjs/resources/customer_payment_sources.js +1 -37
- package/lib/cjs/resources/customer_subscriptions.d.ts +1 -35
- package/lib/cjs/resources/customer_subscriptions.js +1 -37
- package/lib/cjs/resources/customers.d.ts +1 -76
- package/lib/cjs/resources/customers.js +1 -69
- package/lib/cjs/resources/delivery_lead_times.d.ts +1 -55
- package/lib/cjs/resources/delivery_lead_times.js +1 -41
- package/lib/cjs/resources/event_callbacks.d.ts +1 -25
- package/lib/cjs/resources/event_callbacks.js +1 -20
- package/lib/cjs/resources/events.d.ts +1 -25
- package/lib/cjs/resources/events.js +1 -24
- package/lib/cjs/resources/exports.d.ts +1 -41
- package/lib/cjs/resources/exports.js +1 -26
- package/lib/cjs/resources/external_gateways.d.ts +1 -57
- package/lib/cjs/resources/external_gateways.js +1 -40
- package/lib/cjs/resources/external_payments.d.ts +1 -48
- package/lib/cjs/resources/external_payments.js +1 -41
- package/lib/cjs/resources/external_promotions.d.ts +1 -136
- package/lib/cjs/resources/external_promotions.js +1 -82
- package/lib/cjs/resources/external_tax_calculators.d.ts +1 -45
- package/lib/cjs/resources/external_tax_calculators.js +1 -40
- package/lib/cjs/resources/fixed_amount_promotions.d.ts +1 -133
- package/lib/cjs/resources/fixed_amount_promotions.js +1 -79
- package/lib/cjs/resources/fixed_price_promotions.d.ts +1 -133
- package/lib/cjs/resources/fixed_price_promotions.js +1 -79
- package/lib/cjs/resources/free_gift_promotions.d.ts +1 -131
- package/lib/cjs/resources/free_gift_promotions.js +1 -79
- package/lib/cjs/resources/free_shipping_promotions.d.ts +1 -125
- package/lib/cjs/resources/free_shipping_promotions.js +1 -75
- package/lib/cjs/resources/geocoders.d.ts +1 -25
- package/lib/cjs/resources/geocoders.js +1 -24
- package/lib/cjs/resources/gift_card_recipients.d.ts +1 -48
- package/lib/cjs/resources/gift_card_recipients.js +1 -37
- package/lib/cjs/resources/gift_cards.d.ts +1 -104
- package/lib/cjs/resources/gift_cards.js +1 -61
- package/lib/cjs/resources/google_geocoders.d.ts +1 -36
- package/lib/cjs/resources/google_geocoders.js +1 -33
- package/lib/cjs/resources/imports.d.ts +1 -44
- package/lib/cjs/resources/imports.js +1 -26
- package/lib/cjs/resources/in_stock_subscriptions.d.ts +1 -68
- package/lib/cjs/resources/in_stock_subscriptions.js +1 -51
- package/lib/cjs/resources/inventory_models.d.ts +1 -55
- package/lib/cjs/resources/inventory_models.js +1 -41
- package/lib/cjs/resources/inventory_return_locations.d.ts +1 -47
- package/lib/cjs/resources/inventory_return_locations.js +1 -37
- package/lib/cjs/resources/inventory_stock_locations.d.ts +1 -50
- package/lib/cjs/resources/inventory_stock_locations.js +1 -37
- package/lib/cjs/resources/klarna_gateways.d.ts +1 -48
- package/lib/cjs/resources/klarna_gateways.js +1 -37
- package/lib/cjs/resources/klarna_payments.d.ts +1 -48
- package/lib/cjs/resources/klarna_payments.js +1 -40
- package/lib/cjs/resources/line_item_options.d.ts +1 -69
- package/lib/cjs/resources/line_item_options.js +1 -41
- package/lib/cjs/resources/line_items.d.ts +1 -170
- package/lib/cjs/resources/line_items.js +1 -66
- package/lib/cjs/resources/manual_gateways.d.ts +1 -34
- package/lib/cjs/resources/manual_gateways.js +1 -33
- package/lib/cjs/resources/manual_tax_calculators.d.ts +1 -45
- package/lib/cjs/resources/manual_tax_calculators.js +1 -41
- package/lib/cjs/resources/markets.d.ts +1 -107
- package/lib/cjs/resources/markets.js +1 -63
- package/lib/cjs/resources/merchants.d.ts +1 -42
- package/lib/cjs/resources/merchants.js +1 -37
- package/lib/cjs/resources/order_amount_promotion_rules.d.ts +1 -67
- package/lib/cjs/resources/order_amount_promotion_rules.js +1 -29
- package/lib/cjs/resources/order_copies.d.ts +1 -51
- package/lib/cjs/resources/order_copies.js +1 -41
- package/lib/cjs/resources/order_factories.d.ts +1 -34
- package/lib/cjs/resources/order_factories.js +1 -28
- package/lib/cjs/resources/order_subscription_items.d.ts +1 -72
- package/lib/cjs/resources/order_subscription_items.js +1 -33
- package/lib/cjs/resources/order_subscriptions.d.ts +1 -98
- package/lib/cjs/resources/order_subscriptions.js +1 -78
- package/lib/cjs/resources/order_validation_rules.d.ts +1 -27
- package/lib/cjs/resources/order_validation_rules.js +1 -28
- package/lib/cjs/resources/orders.d.ts +1 -389
- package/lib/cjs/resources/orders.js +1 -236
- package/lib/cjs/resources/organization.d.ts +1 -34
- package/lib/cjs/resources/organization.js +1 -16
- package/lib/cjs/resources/packages.d.ts +1 -60
- package/lib/cjs/resources/packages.js +1 -41
- package/lib/cjs/resources/parcel_line_items.d.ts +1 -47
- package/lib/cjs/resources/parcel_line_items.js +1 -37
- package/lib/cjs/resources/parcels.d.ts +1 -126
- package/lib/cjs/resources/parcels.js +1 -49
- package/lib/cjs/resources/payment_gateways.d.ts +1 -25
- package/lib/cjs/resources/payment_gateways.js +1 -24
- package/lib/cjs/resources/payment_methods.d.ts +1 -83
- package/lib/cjs/resources/payment_methods.js +1 -47
- package/lib/cjs/resources/payment_options.d.ts +1 -44
- package/lib/cjs/resources/payment_options.js +1 -33
- package/lib/cjs/resources/paypal_gateways.d.ts +1 -41
- package/lib/cjs/resources/paypal_gateways.js +1 -37
- package/lib/cjs/resources/paypal_payments.d.ts +1 -53
- package/lib/cjs/resources/paypal_payments.js +1 -37
- package/lib/cjs/resources/percentage_discount_promotions.d.ts +1 -131
- package/lib/cjs/resources/percentage_discount_promotions.js +1 -79
- package/lib/cjs/resources/price_frequency_tiers.d.ts +1 -53
- package/lib/cjs/resources/price_frequency_tiers.js +1 -41
- package/lib/cjs/resources/price_lists.d.ts +1 -46
- package/lib/cjs/resources/price_lists.js +1 -37
- package/lib/cjs/resources/price_tiers.d.ts +1 -32
- package/lib/cjs/resources/price_tiers.js +1 -28
- package/lib/cjs/resources/price_volume_tiers.d.ts +1 -53
- package/lib/cjs/resources/price_volume_tiers.js +1 -41
- package/lib/cjs/resources/prices.d.ts +1 -84
- package/lib/cjs/resources/prices.js +1 -65
- package/lib/cjs/resources/promotion_rules.d.ts +1 -29
- package/lib/cjs/resources/promotion_rules.js +1 -20
- package/lib/cjs/resources/promotions.d.ts +1 -63
- package/lib/cjs/resources/promotions.js +1 -60
- package/lib/cjs/resources/recurring_order_copies.d.ts +1 -53
- package/lib/cjs/resources/recurring_order_copies.js +1 -41
- package/lib/cjs/resources/refunds.d.ts +1 -44
- package/lib/cjs/resources/refunds.js +1 -36
- package/lib/cjs/resources/reserved_stocks.d.ts +1 -28
- package/lib/cjs/resources/reserved_stocks.js +1 -28
- package/lib/cjs/resources/resource_errors.d.ts +1 -22
- package/lib/cjs/resources/resource_errors.js +1 -16
- package/lib/cjs/resources/return_line_items.d.ts +1 -52
- package/lib/cjs/resources/return_line_items.js +1 -36
- package/lib/cjs/resources/returns.d.ts +1 -96
- package/lib/cjs/resources/returns.js +1 -92
- package/lib/cjs/resources/satispay_gateways.d.ts +1 -46
- package/lib/cjs/resources/satispay_gateways.js +1 -37
- package/lib/cjs/resources/satispay_payments.d.ts +1 -50
- package/lib/cjs/resources/satispay_payments.js +1 -40
- package/lib/cjs/resources/shipments.d.ts +1 -151
- package/lib/cjs/resources/shipments.js +1 -130
- package/lib/cjs/resources/shipping_categories.d.ts +1 -40
- package/lib/cjs/resources/shipping_categories.js +1 -37
- package/lib/cjs/resources/shipping_method_tiers.d.ts +1 -32
- package/lib/cjs/resources/shipping_method_tiers.js +1 -28
- package/lib/cjs/resources/shipping_methods.d.ts +1 -125
- package/lib/cjs/resources/shipping_methods.js +1 -70
- package/lib/cjs/resources/shipping_weight_tiers.d.ts +1 -50
- package/lib/cjs/resources/shipping_weight_tiers.js +1 -37
- package/lib/cjs/resources/shipping_zones.d.ts +1 -52
- package/lib/cjs/resources/shipping_zones.js +1 -33
- package/lib/cjs/resources/sku_list_items.d.ts +1 -51
- package/lib/cjs/resources/sku_list_items.js +1 -37
- package/lib/cjs/resources/sku_list_promotion_rules.d.ts +1 -76
- package/lib/cjs/resources/sku_list_promotion_rules.js +1 -37
- package/lib/cjs/resources/sku_lists.d.ts +1 -64
- package/lib/cjs/resources/sku_lists.js +1 -49
- package/lib/cjs/resources/sku_options.d.ts +1 -71
- package/lib/cjs/resources/sku_options.js +1 -45
- package/lib/cjs/resources/skus.d.ts +1 -96
- package/lib/cjs/resources/skus.js +1 -65
- package/lib/cjs/resources/stock_items.d.ts +1 -61
- package/lib/cjs/resources/stock_items.js +1 -52
- package/lib/cjs/resources/stock_line_items.d.ts +1 -73
- package/lib/cjs/resources/stock_line_items.js +1 -54
- package/lib/cjs/resources/stock_locations.d.ts +1 -64
- package/lib/cjs/resources/stock_locations.js +1 -53
- package/lib/cjs/resources/stock_reservations.d.ts +1 -51
- package/lib/cjs/resources/stock_reservations.js +1 -48
- package/lib/cjs/resources/stock_transfers.d.ts +1 -86
- package/lib/cjs/resources/stock_transfers.js +1 -71
- package/lib/cjs/resources/stripe_gateways.d.ts +1 -45
- package/lib/cjs/resources/stripe_gateways.js +1 -37
- package/lib/cjs/resources/stripe_payments.d.ts +1 -59
- package/lib/cjs/resources/stripe_payments.js +1 -43
- package/lib/cjs/resources/subscription_models.d.ts +1 -49
- package/lib/cjs/resources/subscription_models.js +1 -37
- package/lib/cjs/resources/tags.d.ts +1 -28
- package/lib/cjs/resources/tags.js +1 -25
- package/lib/cjs/resources/tax_calculators.d.ts +1 -28
- package/lib/cjs/resources/tax_calculators.js +1 -28
- package/lib/cjs/resources/tax_categories.d.ts +1 -63
- package/lib/cjs/resources/tax_categories.js +1 -37
- package/lib/cjs/resources/tax_rules.d.ts +1 -73
- package/lib/cjs/resources/tax_rules.js +1 -33
- package/lib/cjs/resources/taxjar_accounts.d.ts +1 -47
- package/lib/cjs/resources/taxjar_accounts.js +1 -41
- package/lib/cjs/resources/transactions.d.ts +1 -41
- package/lib/cjs/resources/transactions.js +1 -32
- package/lib/cjs/resources/versions.d.ts +1 -22
- package/lib/cjs/resources/versions.js +1 -16
- package/lib/cjs/resources/voids.d.ts +1 -44
- package/lib/cjs/resources/voids.js +1 -36
- package/lib/cjs/resources/webhooks.d.ts +1 -55
- package/lib/cjs/resources/webhooks.js +1 -42
- package/lib/cjs/resources/wire_transfers.d.ts +1 -37
- package/lib/cjs/resources/wire_transfers.js +1 -33
- package/lib/cjs/static.d.ts +1 -12
- package/lib/cjs/static.js +1 -51
- package/lib/cjs/util.d.ts +1 -4
- package/lib/cjs/util.js +1 -16
- package/lib/esm/api.d.ts +1 -164
- package/lib/esm/api.js +1 -258
- package/lib/esm/client.d.ts +1 -39
- package/lib/esm/client.js +1 -149
- package/lib/esm/commercelayer.d.ts +1 -153
- package/lib/esm/commercelayer.js +1 -224
- package/lib/esm/common.d.ts +1 -5
- package/lib/esm/common.js +1 -19
- package/lib/esm/config.d.ts +1 -15
- package/lib/esm/config.js +1 -17
- package/lib/esm/debug.d.ts +1 -3
- package/lib/esm/debug.js +1 -36
- package/lib/esm/error.d.ts +1 -31
- package/lib/esm/error.js +1 -69
- package/lib/esm/index.d.ts +1 -7
- package/lib/esm/index.js +1 -4
- package/lib/esm/interceptor.d.ts +1 -25
- package/lib/esm/interceptor.js +1 -1
- package/lib/esm/jsonapi.d.ts +1 -6
- package/lib/esm/jsonapi.js +1 -87
- package/lib/esm/model.d.ts +1 -124
- package/lib/esm/model.js +1 -2
- package/lib/esm/query.d.ts +1 -17
- package/lib/esm/query.js +1 -62
- package/lib/esm/resource.d.ts +1 -89
- package/lib/esm/resource.js +1 -191
- package/lib/esm/resources/addresses.d.ts +1 -103
- package/lib/esm/resources/addresses.js +1 -39
- package/lib/esm/resources/adjustments.d.ts +1 -42
- package/lib/esm/resources/adjustments.js +1 -27
- package/lib/esm/resources/adyen_gateways.d.ts +1 -60
- package/lib/esm/resources/adyen_gateways.js +1 -35
- package/lib/esm/resources/adyen_payments.d.ts +1 -51
- package/lib/esm/resources/adyen_payments.js +1 -38
- package/lib/esm/resources/application.d.ts +1 -22
- package/lib/esm/resources/application.js +1 -14
- package/lib/esm/resources/attachments.d.ts +1 -157
- package/lib/esm/resources/attachments.js +1 -23
- package/lib/esm/resources/authorizations.d.ts +1 -70
- package/lib/esm/resources/authorizations.js +1 -50
- package/lib/esm/resources/avalara_accounts.d.ts +1 -59
- package/lib/esm/resources/avalara_accounts.js +1 -39
- package/lib/esm/resources/axerve_gateways.d.ts +1 -48
- package/lib/esm/resources/axerve_gateways.js +1 -35
- package/lib/esm/resources/axerve_payments.d.ts +1 -54
- package/lib/esm/resources/axerve_payments.js +1 -38
- package/lib/esm/resources/billing_info_validation_rules.d.ts +1 -39
- package/lib/esm/resources/billing_info_validation_rules.js +1 -35
- package/lib/esm/resources/bing_geocoders.d.ts +1 -36
- package/lib/esm/resources/bing_geocoders.js +1 -31
- package/lib/esm/resources/braintree_gateways.d.ts +1 -60
- package/lib/esm/resources/braintree_gateways.js +1 -35
- package/lib/esm/resources/braintree_payments.d.ts +1 -52
- package/lib/esm/resources/braintree_payments.js +1 -35
- package/lib/esm/resources/bundles.d.ts +1 -93
- package/lib/esm/resources/bundles.js +1 -57
- package/lib/esm/resources/buy_x_pay_y_promotions.d.ts +1 -137
- package/lib/esm/resources/buy_x_pay_y_promotions.js +1 -77
- package/lib/esm/resources/captures.d.ts +1 -60
- package/lib/esm/resources/captures.js +1 -47
- package/lib/esm/resources/carrier_accounts.d.ts +1 -30
- package/lib/esm/resources/carrier_accounts.js +1 -26
- package/lib/esm/resources/checkout_com_gateways.d.ts +1 -49
- package/lib/esm/resources/checkout_com_gateways.js +1 -35
- package/lib/esm/resources/checkout_com_payments.d.ts +1 -65
- package/lib/esm/resources/checkout_com_payments.js +1 -41
- package/lib/esm/resources/cleanups.d.ts +1 -40
- package/lib/esm/resources/cleanups.js +1 -28
- package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +1 -67
- package/lib/esm/resources/coupon_codes_promotion_rules.js +1 -31
- package/lib/esm/resources/coupon_recipients.d.ts +1 -48
- package/lib/esm/resources/coupon_recipients.js +1 -35
- package/lib/esm/resources/coupons.d.ts +1 -71
- package/lib/esm/resources/coupons.js +1 -43
- package/lib/esm/resources/custom_promotion_rules.d.ts +1 -62
- package/lib/esm/resources/custom_promotion_rules.js +1 -27
- package/lib/esm/resources/customer_addresses.d.ts +1 -50
- package/lib/esm/resources/customer_addresses.js +1 -39
- package/lib/esm/resources/customer_groups.d.ts +1 -40
- package/lib/esm/resources/customer_groups.js +1 -39
- package/lib/esm/resources/customer_password_resets.d.ts +1 -38
- package/lib/esm/resources/customer_password_resets.js +1 -34
- package/lib/esm/resources/customer_payment_sources.d.ts +1 -86
- package/lib/esm/resources/customer_payment_sources.js +1 -35
- package/lib/esm/resources/customer_subscriptions.d.ts +1 -35
- package/lib/esm/resources/customer_subscriptions.js +1 -35
- package/lib/esm/resources/customers.d.ts +1 -76
- package/lib/esm/resources/customers.js +1 -67
- package/lib/esm/resources/delivery_lead_times.d.ts +1 -55
- package/lib/esm/resources/delivery_lead_times.js +1 -39
- package/lib/esm/resources/event_callbacks.d.ts +1 -25
- package/lib/esm/resources/event_callbacks.js +1 -18
- package/lib/esm/resources/events.d.ts +1 -25
- package/lib/esm/resources/events.js +1 -22
- package/lib/esm/resources/exports.d.ts +1 -41
- package/lib/esm/resources/exports.js +1 -24
- package/lib/esm/resources/external_gateways.d.ts +1 -57
- package/lib/esm/resources/external_gateways.js +1 -38
- package/lib/esm/resources/external_payments.d.ts +1 -48
- package/lib/esm/resources/external_payments.js +1 -39
- package/lib/esm/resources/external_promotions.d.ts +1 -136
- package/lib/esm/resources/external_promotions.js +1 -80
- package/lib/esm/resources/external_tax_calculators.d.ts +1 -45
- package/lib/esm/resources/external_tax_calculators.js +1 -38
- package/lib/esm/resources/fixed_amount_promotions.d.ts +1 -133
- package/lib/esm/resources/fixed_amount_promotions.js +1 -77
- package/lib/esm/resources/fixed_price_promotions.d.ts +1 -133
- package/lib/esm/resources/fixed_price_promotions.js +1 -77
- package/lib/esm/resources/free_gift_promotions.d.ts +1 -131
- package/lib/esm/resources/free_gift_promotions.js +1 -77
- package/lib/esm/resources/free_shipping_promotions.d.ts +1 -125
- package/lib/esm/resources/free_shipping_promotions.js +1 -73
- package/lib/esm/resources/geocoders.d.ts +1 -25
- package/lib/esm/resources/geocoders.js +1 -22
- package/lib/esm/resources/gift_card_recipients.d.ts +1 -48
- package/lib/esm/resources/gift_card_recipients.js +1 -35
- package/lib/esm/resources/gift_cards.d.ts +1 -104
- package/lib/esm/resources/gift_cards.js +1 -59
- package/lib/esm/resources/google_geocoders.d.ts +1 -36
- package/lib/esm/resources/google_geocoders.js +1 -31
- package/lib/esm/resources/imports.d.ts +1 -44
- package/lib/esm/resources/imports.js +1 -24
- package/lib/esm/resources/in_stock_subscriptions.d.ts +1 -68
- package/lib/esm/resources/in_stock_subscriptions.js +1 -49
- package/lib/esm/resources/inventory_models.d.ts +1 -55
- package/lib/esm/resources/inventory_models.js +1 -39
- package/lib/esm/resources/inventory_return_locations.d.ts +1 -47
- package/lib/esm/resources/inventory_return_locations.js +1 -35
- package/lib/esm/resources/inventory_stock_locations.d.ts +1 -50
- package/lib/esm/resources/inventory_stock_locations.js +1 -35
- package/lib/esm/resources/klarna_gateways.d.ts +1 -48
- package/lib/esm/resources/klarna_gateways.js +1 -35
- package/lib/esm/resources/klarna_payments.d.ts +1 -48
- package/lib/esm/resources/klarna_payments.js +1 -38
- package/lib/esm/resources/line_item_options.d.ts +1 -69
- package/lib/esm/resources/line_item_options.js +1 -39
- package/lib/esm/resources/line_items.d.ts +1 -170
- package/lib/esm/resources/line_items.js +1 -64
- package/lib/esm/resources/manual_gateways.d.ts +1 -34
- package/lib/esm/resources/manual_gateways.js +1 -31
- package/lib/esm/resources/manual_tax_calculators.d.ts +1 -45
- package/lib/esm/resources/manual_tax_calculators.js +1 -39
- package/lib/esm/resources/markets.d.ts +1 -107
- package/lib/esm/resources/markets.js +1 -61
- package/lib/esm/resources/merchants.d.ts +1 -42
- package/lib/esm/resources/merchants.js +1 -35
- package/lib/esm/resources/order_amount_promotion_rules.d.ts +1 -67
- package/lib/esm/resources/order_amount_promotion_rules.js +1 -27
- package/lib/esm/resources/order_copies.d.ts +1 -51
- package/lib/esm/resources/order_copies.js +1 -39
- package/lib/esm/resources/order_factories.d.ts +1 -34
- package/lib/esm/resources/order_factories.js +1 -26
- package/lib/esm/resources/order_subscription_items.d.ts +1 -72
- package/lib/esm/resources/order_subscription_items.js +1 -31
- package/lib/esm/resources/order_subscriptions.d.ts +1 -98
- package/lib/esm/resources/order_subscriptions.js +1 -76
- package/lib/esm/resources/order_validation_rules.d.ts +1 -27
- package/lib/esm/resources/order_validation_rules.js +1 -26
- package/lib/esm/resources/orders.d.ts +1 -389
- package/lib/esm/resources/orders.js +1 -234
- package/lib/esm/resources/organization.d.ts +1 -34
- package/lib/esm/resources/organization.js +1 -14
- package/lib/esm/resources/packages.d.ts +1 -60
- package/lib/esm/resources/packages.js +1 -39
- package/lib/esm/resources/parcel_line_items.d.ts +1 -47
- package/lib/esm/resources/parcel_line_items.js +1 -35
- package/lib/esm/resources/parcels.d.ts +1 -126
- package/lib/esm/resources/parcels.js +1 -47
- package/lib/esm/resources/payment_gateways.d.ts +1 -25
- package/lib/esm/resources/payment_gateways.js +1 -22
- package/lib/esm/resources/payment_methods.d.ts +1 -83
- package/lib/esm/resources/payment_methods.js +1 -45
- package/lib/esm/resources/payment_options.d.ts +1 -44
- package/lib/esm/resources/payment_options.js +1 -31
- package/lib/esm/resources/paypal_gateways.d.ts +1 -41
- package/lib/esm/resources/paypal_gateways.js +1 -35
- package/lib/esm/resources/paypal_payments.d.ts +1 -53
- package/lib/esm/resources/paypal_payments.js +1 -35
- package/lib/esm/resources/percentage_discount_promotions.d.ts +1 -131
- package/lib/esm/resources/percentage_discount_promotions.js +1 -77
- package/lib/esm/resources/price_frequency_tiers.d.ts +1 -53
- package/lib/esm/resources/price_frequency_tiers.js +1 -39
- package/lib/esm/resources/price_lists.d.ts +1 -46
- package/lib/esm/resources/price_lists.js +1 -35
- package/lib/esm/resources/price_tiers.d.ts +1 -32
- package/lib/esm/resources/price_tiers.js +1 -26
- package/lib/esm/resources/price_volume_tiers.d.ts +1 -53
- package/lib/esm/resources/price_volume_tiers.js +1 -39
- package/lib/esm/resources/prices.d.ts +1 -84
- package/lib/esm/resources/prices.js +1 -63
- package/lib/esm/resources/promotion_rules.d.ts +1 -29
- package/lib/esm/resources/promotion_rules.js +1 -18
- package/lib/esm/resources/promotions.d.ts +1 -63
- package/lib/esm/resources/promotions.js +1 -58
- package/lib/esm/resources/recurring_order_copies.d.ts +1 -53
- package/lib/esm/resources/recurring_order_copies.js +1 -39
- package/lib/esm/resources/refunds.d.ts +1 -44
- package/lib/esm/resources/refunds.js +1 -34
- package/lib/esm/resources/reserved_stocks.d.ts +1 -28
- package/lib/esm/resources/reserved_stocks.js +1 -26
- package/lib/esm/resources/resource_errors.d.ts +1 -22
- package/lib/esm/resources/resource_errors.js +1 -14
- package/lib/esm/resources/return_line_items.d.ts +1 -52
- package/lib/esm/resources/return_line_items.js +1 -34
- package/lib/esm/resources/returns.d.ts +1 -96
- package/lib/esm/resources/returns.js +1 -90
- package/lib/esm/resources/satispay_gateways.d.ts +1 -46
- package/lib/esm/resources/satispay_gateways.js +1 -35
- package/lib/esm/resources/satispay_payments.d.ts +1 -50
- package/lib/esm/resources/satispay_payments.js +1 -38
- package/lib/esm/resources/shipments.d.ts +1 -151
- package/lib/esm/resources/shipments.js +1 -128
- package/lib/esm/resources/shipping_categories.d.ts +1 -40
- package/lib/esm/resources/shipping_categories.js +1 -35
- package/lib/esm/resources/shipping_method_tiers.d.ts +1 -32
- package/lib/esm/resources/shipping_method_tiers.js +1 -26
- package/lib/esm/resources/shipping_methods.d.ts +1 -125
- package/lib/esm/resources/shipping_methods.js +1 -68
- package/lib/esm/resources/shipping_weight_tiers.d.ts +1 -50
- package/lib/esm/resources/shipping_weight_tiers.js +1 -35
- package/lib/esm/resources/shipping_zones.d.ts +1 -52
- package/lib/esm/resources/shipping_zones.js +1 -31
- package/lib/esm/resources/sku_list_items.d.ts +1 -51
- package/lib/esm/resources/sku_list_items.js +1 -35
- package/lib/esm/resources/sku_list_promotion_rules.d.ts +1 -76
- package/lib/esm/resources/sku_list_promotion_rules.js +1 -35
- package/lib/esm/resources/sku_lists.d.ts +1 -64
- package/lib/esm/resources/sku_lists.js +1 -47
- package/lib/esm/resources/sku_options.d.ts +1 -71
- package/lib/esm/resources/sku_options.js +1 -43
- package/lib/esm/resources/skus.d.ts +1 -96
- package/lib/esm/resources/skus.js +1 -63
- package/lib/esm/resources/stock_items.d.ts +1 -61
- package/lib/esm/resources/stock_items.js +1 -50
- package/lib/esm/resources/stock_line_items.d.ts +1 -73
- package/lib/esm/resources/stock_line_items.js +1 -52
- package/lib/esm/resources/stock_locations.d.ts +1 -64
- package/lib/esm/resources/stock_locations.js +1 -51
- package/lib/esm/resources/stock_reservations.d.ts +1 -51
- package/lib/esm/resources/stock_reservations.js +1 -46
- package/lib/esm/resources/stock_transfers.d.ts +1 -86
- package/lib/esm/resources/stock_transfers.js +1 -69
- package/lib/esm/resources/stripe_gateways.d.ts +1 -45
- package/lib/esm/resources/stripe_gateways.js +1 -35
- package/lib/esm/resources/stripe_payments.d.ts +1 -59
- package/lib/esm/resources/stripe_payments.js +1 -41
- package/lib/esm/resources/subscription_models.d.ts +1 -49
- package/lib/esm/resources/subscription_models.js +1 -35
- package/lib/esm/resources/tags.d.ts +1 -28
- package/lib/esm/resources/tags.js +1 -23
- package/lib/esm/resources/tax_calculators.d.ts +1 -28
- package/lib/esm/resources/tax_calculators.js +1 -26
- package/lib/esm/resources/tax_categories.d.ts +1 -63
- package/lib/esm/resources/tax_categories.js +1 -35
- package/lib/esm/resources/tax_rules.d.ts +1 -73
- package/lib/esm/resources/tax_rules.js +1 -31
- package/lib/esm/resources/taxjar_accounts.d.ts +1 -47
- package/lib/esm/resources/taxjar_accounts.js +1 -39
- package/lib/esm/resources/transactions.d.ts +1 -41
- package/lib/esm/resources/transactions.js +1 -30
- package/lib/esm/resources/versions.d.ts +1 -22
- package/lib/esm/resources/versions.js +1 -14
- package/lib/esm/resources/voids.d.ts +1 -44
- package/lib/esm/resources/voids.js +1 -34
- package/lib/esm/resources/webhooks.d.ts +1 -55
- package/lib/esm/resources/webhooks.js +1 -40
- package/lib/esm/resources/wire_transfers.d.ts +1 -37
- package/lib/esm/resources/wire_transfers.js +1 -31
- package/lib/esm/static.d.ts +1 -12
- package/lib/esm/static.js +1 -25
- package/lib/esm/util.d.ts +1 -4
- package/lib/esm/util.js +1 -37
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
@@ -1,73 +1 @@
|
|
1
|
-
import
|
2
|
-
class FreeShippingPromotions extends ApiResource {
|
3
|
-
async create(resource, params, options) {
|
4
|
-
return this.resources.create({ ...resource, type: FreeShippingPromotions.TYPE }, params, options);
|
5
|
-
}
|
6
|
-
async update(resource, params, options) {
|
7
|
-
return this.resources.update({ ...resource, type: FreeShippingPromotions.TYPE }, params, options);
|
8
|
-
}
|
9
|
-
async delete(id, options) {
|
10
|
-
await this.resources.delete((typeof id === 'string') ? { id, type: FreeShippingPromotions.TYPE } : id, options);
|
11
|
-
}
|
12
|
-
async market(freeShippingPromotionId, params, options) {
|
13
|
-
const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
|
14
|
-
return this.resources.fetch({ type: 'markets' }, `free_shipping_promotions/${_freeShippingPromotionId}/market`, params, options);
|
15
|
-
}
|
16
|
-
async order_amount_promotion_rule(freeShippingPromotionId, params, options) {
|
17
|
-
const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
|
18
|
-
return this.resources.fetch({ type: 'order_amount_promotion_rules' }, `free_shipping_promotions/${_freeShippingPromotionId}/order_amount_promotion_rule`, params, options);
|
19
|
-
}
|
20
|
-
async sku_list_promotion_rule(freeShippingPromotionId, params, options) {
|
21
|
-
const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
|
22
|
-
return this.resources.fetch({ type: 'sku_list_promotion_rules' }, `free_shipping_promotions/${_freeShippingPromotionId}/sku_list_promotion_rule`, params, options);
|
23
|
-
}
|
24
|
-
async coupon_codes_promotion_rule(freeShippingPromotionId, params, options) {
|
25
|
-
const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
|
26
|
-
return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `free_shipping_promotions/${_freeShippingPromotionId}/coupon_codes_promotion_rule`, params, options);
|
27
|
-
}
|
28
|
-
async custom_promotion_rule(freeShippingPromotionId, params, options) {
|
29
|
-
const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
|
30
|
-
return this.resources.fetch({ type: 'custom_promotion_rules' }, `free_shipping_promotions/${_freeShippingPromotionId}/custom_promotion_rule`, params, options);
|
31
|
-
}
|
32
|
-
async sku_list(freeShippingPromotionId, params, options) {
|
33
|
-
const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
|
34
|
-
return this.resources.fetch({ type: 'sku_lists' }, `free_shipping_promotions/${_freeShippingPromotionId}/sku_list`, params, options);
|
35
|
-
}
|
36
|
-
async coupons(freeShippingPromotionId, params, options) {
|
37
|
-
const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
|
38
|
-
return this.resources.fetch({ type: 'coupons' }, `free_shipping_promotions/${_freeShippingPromotionId}/coupons`, params, options);
|
39
|
-
}
|
40
|
-
async attachments(freeShippingPromotionId, params, options) {
|
41
|
-
const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
|
42
|
-
return this.resources.fetch({ type: 'attachments' }, `free_shipping_promotions/${_freeShippingPromotionId}/attachments`, params, options);
|
43
|
-
}
|
44
|
-
async events(freeShippingPromotionId, params, options) {
|
45
|
-
const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
|
46
|
-
return this.resources.fetch({ type: 'events' }, `free_shipping_promotions/${_freeShippingPromotionId}/events`, params, options);
|
47
|
-
}
|
48
|
-
async tags(freeShippingPromotionId, params, options) {
|
49
|
-
const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
|
50
|
-
return this.resources.fetch({ type: 'tags' }, `free_shipping_promotions/${_freeShippingPromotionId}/tags`, params, options);
|
51
|
-
}
|
52
|
-
async versions(freeShippingPromotionId, params, options) {
|
53
|
-
const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
|
54
|
-
return this.resources.fetch({ type: 'versions' }, `free_shipping_promotions/${_freeShippingPromotionId}/versions`, params, options);
|
55
|
-
}
|
56
|
-
async _disable(id, params, options) {
|
57
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: FreeShippingPromotions.TYPE, _disable: true }, params, options);
|
58
|
-
}
|
59
|
-
async _enable(id, params, options) {
|
60
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: FreeShippingPromotions.TYPE, _enable: true }, params, options);
|
61
|
-
}
|
62
|
-
isFreeShippingPromotion(resource) {
|
63
|
-
return resource.type && (resource.type === FreeShippingPromotions.TYPE);
|
64
|
-
}
|
65
|
-
relationship(id) {
|
66
|
-
return ((id === null) || (typeof id === 'string')) ? { id, type: FreeShippingPromotions.TYPE } : { id: id.id, type: FreeShippingPromotions.TYPE };
|
67
|
-
}
|
68
|
-
type() {
|
69
|
-
return FreeShippingPromotions.TYPE;
|
70
|
-
}
|
71
|
-
}
|
72
|
-
FreeShippingPromotions.TYPE = 'free_shipping_promotions';
|
73
|
-
export default FreeShippingPromotions;
|
1
|
+
import{ApiResource as n}from"../resource";class o extends n{async create(e,t,s){return this.resources.create({...e,type:o.TYPE},t,s)}async update(e,t,s){return this.resources.update({...e,type:o.TYPE},t,s)}async delete(e,t){await this.resources.delete(typeof e=="string"?{id:e,type:o.TYPE}:e,t)}async market(e,t,s){const r=e.id||e;return this.resources.fetch({type:"markets"},`free_shipping_promotions/${r}/market`,t,s)}async order_amount_promotion_rule(e,t,s){const r=e.id||e;return this.resources.fetch({type:"order_amount_promotion_rules"},`free_shipping_promotions/${r}/order_amount_promotion_rule`,t,s)}async sku_list_promotion_rule(e,t,s){const r=e.id||e;return this.resources.fetch({type:"sku_list_promotion_rules"},`free_shipping_promotions/${r}/sku_list_promotion_rule`,t,s)}async coupon_codes_promotion_rule(e,t,s){const r=e.id||e;return this.resources.fetch({type:"coupon_codes_promotion_rules"},`free_shipping_promotions/${r}/coupon_codes_promotion_rule`,t,s)}async custom_promotion_rule(e,t,s){const r=e.id||e;return this.resources.fetch({type:"custom_promotion_rules"},`free_shipping_promotions/${r}/custom_promotion_rule`,t,s)}async sku_list(e,t,s){const r=e.id||e;return this.resources.fetch({type:"sku_lists"},`free_shipping_promotions/${r}/sku_list`,t,s)}async coupons(e,t,s){const r=e.id||e;return this.resources.fetch({type:"coupons"},`free_shipping_promotions/${r}/coupons`,t,s)}async attachments(e,t,s){const r=e.id||e;return this.resources.fetch({type:"attachments"},`free_shipping_promotions/${r}/attachments`,t,s)}async events(e,t,s){const r=e.id||e;return this.resources.fetch({type:"events"},`free_shipping_promotions/${r}/events`,t,s)}async tags(e,t,s){const r=e.id||e;return this.resources.fetch({type:"tags"},`free_shipping_promotions/${r}/tags`,t,s)}async versions(e,t,s){const r=e.id||e;return this.resources.fetch({type:"versions"},`free_shipping_promotions/${r}/versions`,t,s)}async _disable(e,t,s){return this.resources.update({id:typeof e=="string"?e:e.id,type:o.TYPE,_disable:!0},t,s)}async _enable(e,t,s){return this.resources.update({id:typeof e=="string"?e:e.id,type:o.TYPE,_enable:!0},t,s)}isFreeShippingPromotion(e){return e.type&&e.type===o.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:o.TYPE}:{id:e.id,type:o.TYPE}}type(){return o.TYPE}}o.TYPE="free_shipping_promotions";export default o;
|
@@ -1,25 +1 @@
|
|
1
|
-
import {
|
2
|
-
import type { Resource, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
3
|
-
import type { QueryParamsList } from '../query';
|
4
|
-
import type { Address } from './addresses';
|
5
|
-
import type { Attachment } from './attachments';
|
6
|
-
type GeocoderType = 'geocoders';
|
7
|
-
type GeocoderRel = ResourceRel & {
|
8
|
-
type: GeocoderType;
|
9
|
-
};
|
10
|
-
interface Geocoder extends Resource {
|
11
|
-
readonly type: GeocoderType;
|
12
|
-
name: string;
|
13
|
-
addresses?: Address[] | null;
|
14
|
-
attachments?: Attachment[] | null;
|
15
|
-
}
|
16
|
-
declare class Geocoders extends ApiResource<Geocoder> {
|
17
|
-
static readonly TYPE: GeocoderType;
|
18
|
-
addresses(geocoderId: string | Geocoder, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Address>>;
|
19
|
-
attachments(geocoderId: string | Geocoder, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
20
|
-
isGeocoder(resource: any): resource is Geocoder;
|
21
|
-
relationship(id: string | ResourceId | null): GeocoderRel;
|
22
|
-
type(): GeocoderType;
|
23
|
-
}
|
24
|
-
export default Geocoders;
|
25
|
-
export type { Geocoder, GeocoderType };
|
1
|
+
import{ApiResource}from'../resource';import type{Resource,ResourceId,ResourcesConfig,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList}from'../query';import type{Address}from'./addresses';import type{Attachment}from'./attachments';type GeocoderType='geocoders';type GeocoderRel=ResourceRel&{type:GeocoderType;};interface Geocoder extends Resource{readonly type:GeocoderType;name:string;addresses?:Address[]|null;attachments?:Attachment[]|null;}declare class Geocoders extends ApiResource<Geocoder>{static readonly TYPE:GeocoderType;addresses(geocoderId:string|Geocoder,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Address>>;attachments(geocoderId:string|Geocoder,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;isGeocoder(resource:any):resource is Geocoder;relationship(id:string|ResourceId|null):GeocoderRel;type():GeocoderType;}export default Geocoders;export type{Geocoder,GeocoderType};
|
@@ -1,22 +1 @@
|
|
1
|
-
import
|
2
|
-
class Geocoders extends ApiResource {
|
3
|
-
async addresses(geocoderId, params, options) {
|
4
|
-
const _geocoderId = geocoderId.id || geocoderId;
|
5
|
-
return this.resources.fetch({ type: 'addresses' }, `geocoders/${_geocoderId}/addresses`, params, options);
|
6
|
-
}
|
7
|
-
async attachments(geocoderId, params, options) {
|
8
|
-
const _geocoderId = geocoderId.id || geocoderId;
|
9
|
-
return this.resources.fetch({ type: 'attachments' }, `geocoders/${_geocoderId}/attachments`, params, options);
|
10
|
-
}
|
11
|
-
isGeocoder(resource) {
|
12
|
-
return resource.type && (resource.type === Geocoders.TYPE);
|
13
|
-
}
|
14
|
-
relationship(id) {
|
15
|
-
return ((id === null) || (typeof id === 'string')) ? { id, type: Geocoders.TYPE } : { id: id.id, type: Geocoders.TYPE };
|
16
|
-
}
|
17
|
-
type() {
|
18
|
-
return Geocoders.TYPE;
|
19
|
-
}
|
20
|
-
}
|
21
|
-
Geocoders.TYPE = 'geocoders';
|
22
|
-
export default Geocoders;
|
1
|
+
import{ApiResource as a}from"../resource";class t extends a{async addresses(e,s,r){const n=e.id||e;return this.resources.fetch({type:"addresses"},`geocoders/${n}/addresses`,s,r)}async attachments(e,s,r){const n=e.id||e;return this.resources.fetch({type:"attachments"},`geocoders/${n}/attachments`,s,r)}isGeocoder(e){return e.type&&e.type===t.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="geocoders";export default t;
|
@@ -1,48 +1 @@
|
|
1
|
-
import {
|
2
|
-
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
3
|
-
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
4
|
-
import type { Customer, CustomerType } from './customers';
|
5
|
-
import type { Attachment } from './attachments';
|
6
|
-
import type { Version } from './versions';
|
7
|
-
type GiftCardRecipientType = 'gift_card_recipients';
|
8
|
-
type GiftCardRecipientRel = ResourceRel & {
|
9
|
-
type: GiftCardRecipientType;
|
10
|
-
};
|
11
|
-
type CustomerRel = ResourceRel & {
|
12
|
-
type: CustomerType;
|
13
|
-
};
|
14
|
-
interface GiftCardRecipient extends Resource {
|
15
|
-
readonly type: GiftCardRecipientType;
|
16
|
-
email: string;
|
17
|
-
first_name?: string | null;
|
18
|
-
last_name?: string | null;
|
19
|
-
customer?: Customer | null;
|
20
|
-
attachments?: Attachment[] | null;
|
21
|
-
versions?: Version[] | null;
|
22
|
-
}
|
23
|
-
interface GiftCardRecipientCreate extends ResourceCreate {
|
24
|
-
email: string;
|
25
|
-
first_name?: string | null;
|
26
|
-
last_name?: string | null;
|
27
|
-
customer?: CustomerRel | null;
|
28
|
-
}
|
29
|
-
interface GiftCardRecipientUpdate extends ResourceUpdate {
|
30
|
-
email?: string | null;
|
31
|
-
first_name?: string | null;
|
32
|
-
last_name?: string | null;
|
33
|
-
customer?: CustomerRel | null;
|
34
|
-
}
|
35
|
-
declare class GiftCardRecipients extends ApiResource<GiftCardRecipient> {
|
36
|
-
static readonly TYPE: GiftCardRecipientType;
|
37
|
-
create(resource: GiftCardRecipientCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<GiftCardRecipient>;
|
38
|
-
update(resource: GiftCardRecipientUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<GiftCardRecipient>;
|
39
|
-
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
40
|
-
customer(giftCardRecipientId: string | GiftCardRecipient, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Customer>;
|
41
|
-
attachments(giftCardRecipientId: string | GiftCardRecipient, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
42
|
-
versions(giftCardRecipientId: string | GiftCardRecipient, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
43
|
-
isGiftCardRecipient(resource: any): resource is GiftCardRecipient;
|
44
|
-
relationship(id: string | ResourceId | null): GiftCardRecipientRel;
|
45
|
-
type(): GiftCardRecipientType;
|
46
|
-
}
|
47
|
-
export default GiftCardRecipients;
|
48
|
-
export type { GiftCardRecipient, GiftCardRecipientCreate, GiftCardRecipientUpdate, GiftCardRecipientType };
|
1
|
+
import{ApiResource}from'../resource';import type{Resource,ResourceCreate,ResourceUpdate,ResourceId,ResourcesConfig,ResourceRel,ListResponse}from'../resource';import type{QueryParamsRetrieve,QueryParamsList}from'../query';import type{Customer,CustomerType}from'./customers';import type{Attachment}from'./attachments';import type{Version}from'./versions';type GiftCardRecipientType='gift_card_recipients';type GiftCardRecipientRel=ResourceRel&{type:GiftCardRecipientType;};type CustomerRel=ResourceRel&{type:CustomerType;};interface GiftCardRecipient extends Resource{readonly type:GiftCardRecipientType;email:string;first_name?:string|null;last_name?:string|null;customer?:Customer|null;attachments?:Attachment[]|null;versions?:Version[]|null;}interface GiftCardRecipientCreate extends ResourceCreate{email:string;first_name?:string|null;last_name?:string|null;customer?:CustomerRel|null;}interface GiftCardRecipientUpdate extends ResourceUpdate{email?:string|null;first_name?:string|null;last_name?:string|null;customer?:CustomerRel|null;}declare class GiftCardRecipients extends ApiResource<GiftCardRecipient>{static readonly TYPE:GiftCardRecipientType;create(resource:GiftCardRecipientCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<GiftCardRecipient>;update(resource:GiftCardRecipientUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<GiftCardRecipient>;delete(id:string|ResourceId,options?:ResourcesConfig):Promise<void>;customer(giftCardRecipientId:string|GiftCardRecipient,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Customer>;attachments(giftCardRecipientId:string|GiftCardRecipient,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;versions(giftCardRecipientId:string|GiftCardRecipient,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Version>>;isGiftCardRecipient(resource:any):resource is GiftCardRecipient;relationship(id:string|ResourceId|null):GiftCardRecipientRel;type():GiftCardRecipientType;}export default GiftCardRecipients;export type{GiftCardRecipient,GiftCardRecipientCreate,GiftCardRecipientUpdate,GiftCardRecipientType};
|
@@ -1,35 +1 @@
|
|
1
|
-
import
|
2
|
-
class GiftCardRecipients extends ApiResource {
|
3
|
-
async create(resource, params, options) {
|
4
|
-
return this.resources.create({ ...resource, type: GiftCardRecipients.TYPE }, params, options);
|
5
|
-
}
|
6
|
-
async update(resource, params, options) {
|
7
|
-
return this.resources.update({ ...resource, type: GiftCardRecipients.TYPE }, params, options);
|
8
|
-
}
|
9
|
-
async delete(id, options) {
|
10
|
-
await this.resources.delete((typeof id === 'string') ? { id, type: GiftCardRecipients.TYPE } : id, options);
|
11
|
-
}
|
12
|
-
async customer(giftCardRecipientId, params, options) {
|
13
|
-
const _giftCardRecipientId = giftCardRecipientId.id || giftCardRecipientId;
|
14
|
-
return this.resources.fetch({ type: 'customers' }, `gift_card_recipients/${_giftCardRecipientId}/customer`, params, options);
|
15
|
-
}
|
16
|
-
async attachments(giftCardRecipientId, params, options) {
|
17
|
-
const _giftCardRecipientId = giftCardRecipientId.id || giftCardRecipientId;
|
18
|
-
return this.resources.fetch({ type: 'attachments' }, `gift_card_recipients/${_giftCardRecipientId}/attachments`, params, options);
|
19
|
-
}
|
20
|
-
async versions(giftCardRecipientId, params, options) {
|
21
|
-
const _giftCardRecipientId = giftCardRecipientId.id || giftCardRecipientId;
|
22
|
-
return this.resources.fetch({ type: 'versions' }, `gift_card_recipients/${_giftCardRecipientId}/versions`, params, options);
|
23
|
-
}
|
24
|
-
isGiftCardRecipient(resource) {
|
25
|
-
return resource.type && (resource.type === GiftCardRecipients.TYPE);
|
26
|
-
}
|
27
|
-
relationship(id) {
|
28
|
-
return ((id === null) || (typeof id === 'string')) ? { id, type: GiftCardRecipients.TYPE } : { id: id.id, type: GiftCardRecipients.TYPE };
|
29
|
-
}
|
30
|
-
type() {
|
31
|
-
return GiftCardRecipients.TYPE;
|
32
|
-
}
|
33
|
-
}
|
34
|
-
GiftCardRecipients.TYPE = 'gift_card_recipients';
|
35
|
-
export default GiftCardRecipients;
|
1
|
+
import{ApiResource as n}from"../resource";class s extends n{async create(e,t,r){return this.resources.create({...e,type:s.TYPE},t,r)}async update(e,t,r){return this.resources.update({...e,type:s.TYPE},t,r)}async delete(e,t){await this.resources.delete(typeof e=="string"?{id:e,type:s.TYPE}:e,t)}async customer(e,t,r){const c=e.id||e;return this.resources.fetch({type:"customers"},`gift_card_recipients/${c}/customer`,t,r)}async attachments(e,t,r){const c=e.id||e;return this.resources.fetch({type:"attachments"},`gift_card_recipients/${c}/attachments`,t,r)}async versions(e,t,r){const c=e.id||e;return this.resources.fetch({type:"versions"},`gift_card_recipients/${c}/versions`,t,r)}isGiftCardRecipient(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="gift_card_recipients";export default s;
|
@@ -1,104 +1 @@
|
|
1
|
-
import {
|
2
|
-
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
3
|
-
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
4
|
-
import type { Market, MarketType } from './markets';
|
5
|
-
import type { GiftCardRecipient, GiftCardRecipientType } from './gift_card_recipients';
|
6
|
-
import type { Attachment } from './attachments';
|
7
|
-
import type { Event } from './events';
|
8
|
-
import type { Tag, TagType } from './tags';
|
9
|
-
import type { Version } from './versions';
|
10
|
-
type GiftCardType = 'gift_cards';
|
11
|
-
type GiftCardRel = ResourceRel & {
|
12
|
-
type: GiftCardType;
|
13
|
-
};
|
14
|
-
type MarketRel = ResourceRel & {
|
15
|
-
type: MarketType;
|
16
|
-
};
|
17
|
-
type GiftCardRecipientRel = ResourceRel & {
|
18
|
-
type: GiftCardRecipientType;
|
19
|
-
};
|
20
|
-
type TagRel = ResourceRel & {
|
21
|
-
type: TagType;
|
22
|
-
};
|
23
|
-
interface GiftCard extends Resource {
|
24
|
-
readonly type: GiftCardType;
|
25
|
-
status: 'draft' | 'inactive' | 'active' | 'redeemed';
|
26
|
-
code?: string | null;
|
27
|
-
currency_code?: string | null;
|
28
|
-
initial_balance_cents: number;
|
29
|
-
initial_balance_float: number;
|
30
|
-
formatted_initial_balance: string;
|
31
|
-
balance_cents: number;
|
32
|
-
balance_float: number;
|
33
|
-
formatted_balance: string;
|
34
|
-
balance_max_cents?: string | null;
|
35
|
-
balance_max_float?: number | null;
|
36
|
-
formatted_balance_max?: string | null;
|
37
|
-
balance_log: Array<Record<string, any>>;
|
38
|
-
single_use?: boolean | null;
|
39
|
-
rechargeable?: boolean | null;
|
40
|
-
distribute_discount?: boolean | null;
|
41
|
-
image_url?: string | null;
|
42
|
-
expires_at?: string | null;
|
43
|
-
recipient_email?: string | null;
|
44
|
-
market?: Market | null;
|
45
|
-
gift_card_recipient?: GiftCardRecipient | null;
|
46
|
-
attachments?: Attachment[] | null;
|
47
|
-
events?: Event[] | null;
|
48
|
-
tags?: Tag[] | null;
|
49
|
-
versions?: Version[] | null;
|
50
|
-
}
|
51
|
-
interface GiftCardCreate extends ResourceCreate {
|
52
|
-
code?: string | null;
|
53
|
-
currency_code?: string | null;
|
54
|
-
balance_cents: number;
|
55
|
-
balance_max_cents?: string | null;
|
56
|
-
single_use?: boolean | null;
|
57
|
-
rechargeable?: boolean | null;
|
58
|
-
distribute_discount?: boolean | null;
|
59
|
-
image_url?: string | null;
|
60
|
-
expires_at?: string | null;
|
61
|
-
recipient_email?: string | null;
|
62
|
-
market?: MarketRel | null;
|
63
|
-
gift_card_recipient?: GiftCardRecipientRel | null;
|
64
|
-
tags?: TagRel[] | null;
|
65
|
-
}
|
66
|
-
interface GiftCardUpdate extends ResourceUpdate {
|
67
|
-
currency_code?: string | null;
|
68
|
-
balance_cents?: number | null;
|
69
|
-
balance_max_cents?: string | null;
|
70
|
-
single_use?: boolean | null;
|
71
|
-
rechargeable?: boolean | null;
|
72
|
-
distribute_discount?: boolean | null;
|
73
|
-
image_url?: string | null;
|
74
|
-
expires_at?: string | null;
|
75
|
-
recipient_email?: string | null;
|
76
|
-
_purchase?: boolean | null;
|
77
|
-
_activate?: boolean | null;
|
78
|
-
_deactivate?: boolean | null;
|
79
|
-
_balance_change_cents?: number | null;
|
80
|
-
market?: MarketRel | null;
|
81
|
-
gift_card_recipient?: GiftCardRecipientRel | null;
|
82
|
-
tags?: TagRel[] | null;
|
83
|
-
}
|
84
|
-
declare class GiftCards extends ApiResource<GiftCard> {
|
85
|
-
static readonly TYPE: GiftCardType;
|
86
|
-
create(resource: GiftCardCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<GiftCard>;
|
87
|
-
update(resource: GiftCardUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<GiftCard>;
|
88
|
-
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
89
|
-
market(giftCardId: string | GiftCard, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
|
90
|
-
gift_card_recipient(giftCardId: string | GiftCard, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<GiftCardRecipient>;
|
91
|
-
attachments(giftCardId: string | GiftCard, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
92
|
-
events(giftCardId: string | GiftCard, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
93
|
-
tags(giftCardId: string | GiftCard, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
94
|
-
versions(giftCardId: string | GiftCard, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
95
|
-
_purchase(id: string | GiftCard, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<GiftCard>;
|
96
|
-
_activate(id: string | GiftCard, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<GiftCard>;
|
97
|
-
_deactivate(id: string | GiftCard, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<GiftCard>;
|
98
|
-
_balance_change_cents(id: string | GiftCard, triggerValue: number, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<GiftCard>;
|
99
|
-
isGiftCard(resource: any): resource is GiftCard;
|
100
|
-
relationship(id: string | ResourceId | null): GiftCardRel;
|
101
|
-
type(): GiftCardType;
|
102
|
-
}
|
103
|
-
export default GiftCards;
|
104
|
-
export type { GiftCard, GiftCardCreate, GiftCardUpdate, GiftCardType };
|
1
|
+
import{ApiResource}from'../resource';import type{Resource,ResourceCreate,ResourceUpdate,ResourceId,ResourcesConfig,ResourceRel,ListResponse}from'../resource';import type{QueryParamsRetrieve,QueryParamsList}from'../query';import type{Market,MarketType}from'./markets';import type{GiftCardRecipient,GiftCardRecipientType}from'./gift_card_recipients';import type{Attachment}from'./attachments';import type{Event}from'./events';import type{Tag,TagType}from'./tags';import type{Version}from'./versions';type GiftCardType='gift_cards';type GiftCardRel=ResourceRel&{type:GiftCardType;};type MarketRel=ResourceRel&{type:MarketType;};type GiftCardRecipientRel=ResourceRel&{type:GiftCardRecipientType;};type TagRel=ResourceRel&{type:TagType;};interface GiftCard extends Resource{readonly type:GiftCardType;status:'draft'|'inactive'|'active'|'redeemed';code?:string|null;currency_code?:string|null;initial_balance_cents:number;initial_balance_float:number;formatted_initial_balance:string;balance_cents:number;balance_float:number;formatted_balance:string;balance_max_cents?:string|null;balance_max_float?:number|null;formatted_balance_max?:string|null;balance_log:Array<Record<string,any>>;single_use?:boolean|null;rechargeable?:boolean|null;distribute_discount?:boolean|null;image_url?:string|null;expires_at?:string|null;recipient_email?:string|null;market?:Market|null;gift_card_recipient?:GiftCardRecipient|null;attachments?:Attachment[]|null;events?:Event[]|null;tags?:Tag[]|null;versions?:Version[]|null;}interface GiftCardCreate extends ResourceCreate{code?:string|null;currency_code?:string|null;balance_cents:number;balance_max_cents?:string|null;single_use?:boolean|null;rechargeable?:boolean|null;distribute_discount?:boolean|null;image_url?:string|null;expires_at?:string|null;recipient_email?:string|null;market?:MarketRel|null;gift_card_recipient?:GiftCardRecipientRel|null;tags?:TagRel[]|null;}interface GiftCardUpdate extends ResourceUpdate{currency_code?:string|null;balance_cents?:number|null;balance_max_cents?:string|null;single_use?:boolean|null;rechargeable?:boolean|null;distribute_discount?:boolean|null;image_url?:string|null;expires_at?:string|null;recipient_email?:string|null;_purchase?:boolean|null;_activate?:boolean|null;_deactivate?:boolean|null;_balance_change_cents?:number|null;market?:MarketRel|null;gift_card_recipient?:GiftCardRecipientRel|null;tags?:TagRel[]|null;}declare class GiftCards extends ApiResource<GiftCard>{static readonly TYPE:GiftCardType;create(resource:GiftCardCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<GiftCard>;update(resource:GiftCardUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<GiftCard>;delete(id:string|ResourceId,options?:ResourcesConfig):Promise<void>;market(giftCardId:string|GiftCard,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Market>;gift_card_recipient(giftCardId:string|GiftCard,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<GiftCardRecipient>;attachments(giftCardId:string|GiftCard,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;events(giftCardId:string|GiftCard,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Event>>;tags(giftCardId:string|GiftCard,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Tag>>;versions(giftCardId:string|GiftCard,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Version>>;_purchase(id:string|GiftCard,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<GiftCard>;_activate(id:string|GiftCard,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<GiftCard>;_deactivate(id:string|GiftCard,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<GiftCard>;_balance_change_cents(id:string|GiftCard,triggerValue:number,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<GiftCard>;isGiftCard(resource:any):resource is GiftCard;relationship(id:string|ResourceId|null):GiftCardRel;type():GiftCardType;}export default GiftCards;export type{GiftCard,GiftCardCreate,GiftCardUpdate,GiftCardType};
|
@@ -1,59 +1 @@
|
|
1
|
-
import
|
2
|
-
class GiftCards extends ApiResource {
|
3
|
-
async create(resource, params, options) {
|
4
|
-
return this.resources.create({ ...resource, type: GiftCards.TYPE }, params, options);
|
5
|
-
}
|
6
|
-
async update(resource, params, options) {
|
7
|
-
return this.resources.update({ ...resource, type: GiftCards.TYPE }, params, options);
|
8
|
-
}
|
9
|
-
async delete(id, options) {
|
10
|
-
await this.resources.delete((typeof id === 'string') ? { id, type: GiftCards.TYPE } : id, options);
|
11
|
-
}
|
12
|
-
async market(giftCardId, params, options) {
|
13
|
-
const _giftCardId = giftCardId.id || giftCardId;
|
14
|
-
return this.resources.fetch({ type: 'markets' }, `gift_cards/${_giftCardId}/market`, params, options);
|
15
|
-
}
|
16
|
-
async gift_card_recipient(giftCardId, params, options) {
|
17
|
-
const _giftCardId = giftCardId.id || giftCardId;
|
18
|
-
return this.resources.fetch({ type: 'gift_card_recipients' }, `gift_cards/${_giftCardId}/gift_card_recipient`, params, options);
|
19
|
-
}
|
20
|
-
async attachments(giftCardId, params, options) {
|
21
|
-
const _giftCardId = giftCardId.id || giftCardId;
|
22
|
-
return this.resources.fetch({ type: 'attachments' }, `gift_cards/${_giftCardId}/attachments`, params, options);
|
23
|
-
}
|
24
|
-
async events(giftCardId, params, options) {
|
25
|
-
const _giftCardId = giftCardId.id || giftCardId;
|
26
|
-
return this.resources.fetch({ type: 'events' }, `gift_cards/${_giftCardId}/events`, params, options);
|
27
|
-
}
|
28
|
-
async tags(giftCardId, params, options) {
|
29
|
-
const _giftCardId = giftCardId.id || giftCardId;
|
30
|
-
return this.resources.fetch({ type: 'tags' }, `gift_cards/${_giftCardId}/tags`, params, options);
|
31
|
-
}
|
32
|
-
async versions(giftCardId, params, options) {
|
33
|
-
const _giftCardId = giftCardId.id || giftCardId;
|
34
|
-
return this.resources.fetch({ type: 'versions' }, `gift_cards/${_giftCardId}/versions`, params, options);
|
35
|
-
}
|
36
|
-
async _purchase(id, params, options) {
|
37
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: GiftCards.TYPE, _purchase: true }, params, options);
|
38
|
-
}
|
39
|
-
async _activate(id, params, options) {
|
40
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: GiftCards.TYPE, _activate: true }, params, options);
|
41
|
-
}
|
42
|
-
async _deactivate(id, params, options) {
|
43
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: GiftCards.TYPE, _deactivate: true }, params, options);
|
44
|
-
}
|
45
|
-
async _balance_change_cents(id, triggerValue, params, options) {
|
46
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: GiftCards.TYPE, _balance_change_cents: triggerValue }, params, options);
|
47
|
-
}
|
48
|
-
isGiftCard(resource) {
|
49
|
-
return resource.type && (resource.type === GiftCards.TYPE);
|
50
|
-
}
|
51
|
-
relationship(id) {
|
52
|
-
return ((id === null) || (typeof id === 'string')) ? { id, type: GiftCards.TYPE } : { id: id.id, type: GiftCards.TYPE };
|
53
|
-
}
|
54
|
-
type() {
|
55
|
-
return GiftCards.TYPE;
|
56
|
-
}
|
57
|
-
}
|
58
|
-
GiftCards.TYPE = 'gift_cards';
|
59
|
-
export default GiftCards;
|
1
|
+
import{ApiResource as n}from"../resource";class r extends n{async create(e,t,s){return this.resources.create({...e,type:r.TYPE},t,s)}async update(e,t,s){return this.resources.update({...e,type:r.TYPE},t,s)}async delete(e,t){await this.resources.delete(typeof e=="string"?{id:e,type:r.TYPE}:e,t)}async market(e,t,s){const c=e.id||e;return this.resources.fetch({type:"markets"},`gift_cards/${c}/market`,t,s)}async gift_card_recipient(e,t,s){const c=e.id||e;return this.resources.fetch({type:"gift_card_recipients"},`gift_cards/${c}/gift_card_recipient`,t,s)}async attachments(e,t,s){const c=e.id||e;return this.resources.fetch({type:"attachments"},`gift_cards/${c}/attachments`,t,s)}async events(e,t,s){const c=e.id||e;return this.resources.fetch({type:"events"},`gift_cards/${c}/events`,t,s)}async tags(e,t,s){const c=e.id||e;return this.resources.fetch({type:"tags"},`gift_cards/${c}/tags`,t,s)}async versions(e,t,s){const c=e.id||e;return this.resources.fetch({type:"versions"},`gift_cards/${c}/versions`,t,s)}async _purchase(e,t,s){return this.resources.update({id:typeof e=="string"?e:e.id,type:r.TYPE,_purchase:!0},t,s)}async _activate(e,t,s){return this.resources.update({id:typeof e=="string"?e:e.id,type:r.TYPE,_activate:!0},t,s)}async _deactivate(e,t,s){return this.resources.update({id:typeof e=="string"?e:e.id,type:r.TYPE,_deactivate:!0},t,s)}async _balance_change_cents(e,t,s,c){return this.resources.update({id:typeof e=="string"?e:e.id,type:r.TYPE,_balance_change_cents:t},s,c)}isGiftCard(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="gift_cards";export default r;
|
@@ -1,36 +1 @@
|
|
1
|
-
import {
|
2
|
-
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
3
|
-
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
4
|
-
import type { Address } from './addresses';
|
5
|
-
import type { Attachment } from './attachments';
|
6
|
-
type GoogleGeocoderType = 'google_geocoders';
|
7
|
-
type GoogleGeocoderRel = ResourceRel & {
|
8
|
-
type: GoogleGeocoderType;
|
9
|
-
};
|
10
|
-
interface GoogleGeocoder extends Resource {
|
11
|
-
readonly type: GoogleGeocoderType;
|
12
|
-
name: string;
|
13
|
-
addresses?: Address[] | null;
|
14
|
-
attachments?: Attachment[] | null;
|
15
|
-
}
|
16
|
-
interface GoogleGeocoderCreate extends ResourceCreate {
|
17
|
-
name: string;
|
18
|
-
api_key: string;
|
19
|
-
}
|
20
|
-
interface GoogleGeocoderUpdate extends ResourceUpdate {
|
21
|
-
name?: string | null;
|
22
|
-
api_key?: string | null;
|
23
|
-
}
|
24
|
-
declare class GoogleGeocoders extends ApiResource<GoogleGeocoder> {
|
25
|
-
static readonly TYPE: GoogleGeocoderType;
|
26
|
-
create(resource: GoogleGeocoderCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<GoogleGeocoder>;
|
27
|
-
update(resource: GoogleGeocoderUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<GoogleGeocoder>;
|
28
|
-
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
29
|
-
addresses(googleGeocoderId: string | GoogleGeocoder, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Address>>;
|
30
|
-
attachments(googleGeocoderId: string | GoogleGeocoder, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
31
|
-
isGoogleGeocoder(resource: any): resource is GoogleGeocoder;
|
32
|
-
relationship(id: string | ResourceId | null): GoogleGeocoderRel;
|
33
|
-
type(): GoogleGeocoderType;
|
34
|
-
}
|
35
|
-
export default GoogleGeocoders;
|
36
|
-
export type { GoogleGeocoder, GoogleGeocoderCreate, GoogleGeocoderUpdate, GoogleGeocoderType };
|
1
|
+
import{ApiResource}from'../resource';import type{Resource,ResourceCreate,ResourceUpdate,ResourceId,ResourcesConfig,ResourceRel,ListResponse}from'../resource';import type{QueryParamsRetrieve,QueryParamsList}from'../query';import type{Address}from'./addresses';import type{Attachment}from'./attachments';type GoogleGeocoderType='google_geocoders';type GoogleGeocoderRel=ResourceRel&{type:GoogleGeocoderType;};interface GoogleGeocoder extends Resource{readonly type:GoogleGeocoderType;name:string;addresses?:Address[]|null;attachments?:Attachment[]|null;}interface GoogleGeocoderCreate extends ResourceCreate{name:string;api_key:string;}interface GoogleGeocoderUpdate extends ResourceUpdate{name?:string|null;api_key?:string|null;}declare class GoogleGeocoders extends ApiResource<GoogleGeocoder>{static readonly TYPE:GoogleGeocoderType;create(resource:GoogleGeocoderCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<GoogleGeocoder>;update(resource:GoogleGeocoderUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<GoogleGeocoder>;delete(id:string|ResourceId,options?:ResourcesConfig):Promise<void>;addresses(googleGeocoderId:string|GoogleGeocoder,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Address>>;attachments(googleGeocoderId:string|GoogleGeocoder,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;isGoogleGeocoder(resource:any):resource is GoogleGeocoder;relationship(id:string|ResourceId|null):GoogleGeocoderRel;type():GoogleGeocoderType;}export default GoogleGeocoders;export type{GoogleGeocoder,GoogleGeocoderCreate,GoogleGeocoderUpdate,GoogleGeocoderType};
|
@@ -1,31 +1 @@
|
|
1
|
-
import
|
2
|
-
class GoogleGeocoders extends ApiResource {
|
3
|
-
async create(resource, params, options) {
|
4
|
-
return this.resources.create({ ...resource, type: GoogleGeocoders.TYPE }, params, options);
|
5
|
-
}
|
6
|
-
async update(resource, params, options) {
|
7
|
-
return this.resources.update({ ...resource, type: GoogleGeocoders.TYPE }, params, options);
|
8
|
-
}
|
9
|
-
async delete(id, options) {
|
10
|
-
await this.resources.delete((typeof id === 'string') ? { id, type: GoogleGeocoders.TYPE } : id, options);
|
11
|
-
}
|
12
|
-
async addresses(googleGeocoderId, params, options) {
|
13
|
-
const _googleGeocoderId = googleGeocoderId.id || googleGeocoderId;
|
14
|
-
return this.resources.fetch({ type: 'addresses' }, `google_geocoders/${_googleGeocoderId}/addresses`, params, options);
|
15
|
-
}
|
16
|
-
async attachments(googleGeocoderId, params, options) {
|
17
|
-
const _googleGeocoderId = googleGeocoderId.id || googleGeocoderId;
|
18
|
-
return this.resources.fetch({ type: 'attachments' }, `google_geocoders/${_googleGeocoderId}/attachments`, params, options);
|
19
|
-
}
|
20
|
-
isGoogleGeocoder(resource) {
|
21
|
-
return resource.type && (resource.type === GoogleGeocoders.TYPE);
|
22
|
-
}
|
23
|
-
relationship(id) {
|
24
|
-
return ((id === null) || (typeof id === 'string')) ? { id, type: GoogleGeocoders.TYPE } : { id: id.id, type: GoogleGeocoders.TYPE };
|
25
|
-
}
|
26
|
-
type() {
|
27
|
-
return GoogleGeocoders.TYPE;
|
28
|
-
}
|
29
|
-
}
|
30
|
-
GoogleGeocoders.TYPE = 'google_geocoders';
|
31
|
-
export default GoogleGeocoders;
|
1
|
+
import{ApiResource as n}from"../resource";class t extends n{async create(e,s,r){return this.resources.create({...e,type:t.TYPE},s,r)}async update(e,s,r){return this.resources.update({...e,type:t.TYPE},s,r)}async delete(e,s){await this.resources.delete(typeof e=="string"?{id:e,type:t.TYPE}:e,s)}async addresses(e,s,r){const a=e.id||e;return this.resources.fetch({type:"addresses"},`google_geocoders/${a}/addresses`,s,r)}async attachments(e,s,r){const a=e.id||e;return this.resources.fetch({type:"attachments"},`google_geocoders/${a}/attachments`,s,r)}isGoogleGeocoder(e){return e.type&&e.type===t.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="google_geocoders";export default t;
|
@@ -1,44 +1 @@
|
|
1
|
-
import
|
2
|
-
import type { Resource, ResourceCreate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
3
|
-
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
4
|
-
import type { Event } from './events';
|
5
|
-
type ImportType = 'imports';
|
6
|
-
type ImportRel = ResourceRel & {
|
7
|
-
type: ImportType;
|
8
|
-
};
|
9
|
-
interface Import extends Resource {
|
10
|
-
readonly type: ImportType;
|
11
|
-
resource_type: string;
|
12
|
-
format?: string | null;
|
13
|
-
parent_resource_id?: string | null;
|
14
|
-
status: 'pending' | 'in_progress' | 'interrupted' | 'completed';
|
15
|
-
started_at?: string | null;
|
16
|
-
completed_at?: string | null;
|
17
|
-
interrupted_at?: string | null;
|
18
|
-
inputs: Array<Record<string, any>>;
|
19
|
-
inputs_size?: number | null;
|
20
|
-
errors_count?: number | null;
|
21
|
-
warnings_count?: number | null;
|
22
|
-
processed_count?: number | null;
|
23
|
-
errors_log?: Record<string, any> | null;
|
24
|
-
warnings_log?: Record<string, any> | null;
|
25
|
-
attachment_url?: string | null;
|
26
|
-
events?: Event[] | null;
|
27
|
-
}
|
28
|
-
interface ImportCreate extends ResourceCreate {
|
29
|
-
resource_type: string;
|
30
|
-
format?: string | null;
|
31
|
-
parent_resource_id?: string | null;
|
32
|
-
inputs: Array<Record<string, any>>;
|
33
|
-
}
|
34
|
-
declare class Imports extends ApiResource<Import> {
|
35
|
-
static readonly TYPE: ImportType;
|
36
|
-
create(resource: ImportCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Import>;
|
37
|
-
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
38
|
-
events(importId: string | Import, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
39
|
-
isImport(resource: any): resource is Import;
|
40
|
-
relationship(id: string | ResourceId | null): ImportRel;
|
41
|
-
type(): ImportType;
|
42
|
-
}
|
43
|
-
export default Imports;
|
44
|
-
export type { Import, ImportCreate, ImportType };
|
1
|
+
import{ApiResource}from'../resource';import type{Resource,ResourceCreate,ResourceId,ResourcesConfig,ResourceRel,ListResponse}from'../resource';import type{QueryParamsRetrieve,QueryParamsList}from'../query';import type{Event}from'./events';type ImportType='imports';type ImportRel=ResourceRel&{type:ImportType;};interface Import extends Resource{readonly type:ImportType;resource_type:string;format?:string|null;parent_resource_id?:string|null;status:'pending'|'in_progress'|'interrupted'|'completed';started_at?:string|null;completed_at?:string|null;interrupted_at?:string|null;inputs:Array<Record<string,any>>;inputs_size?:number|null;errors_count?:number|null;warnings_count?:number|null;processed_count?:number|null;errors_log?:Record<string,any>|null;warnings_log?:Record<string,any>|null;attachment_url?:string|null;events?:Event[]|null;}interface ImportCreate extends ResourceCreate{resource_type:string;format?:string|null;parent_resource_id?:string|null;inputs:Array<Record<string,any>>;}declare class Imports extends ApiResource<Import>{static readonly TYPE:ImportType;create(resource:ImportCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Import>;delete(id:string|ResourceId,options?:ResourcesConfig):Promise<void>;events(importId:string|Import,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Event>>;isImport(resource:any):resource is Import;relationship(id:string|ResourceId|null):ImportRel;type():ImportType;}export default Imports;export type{Import,ImportCreate,ImportType};
|
@@ -1,24 +1 @@
|
|
1
|
-
import
|
2
|
-
class Imports extends ApiResource {
|
3
|
-
async create(resource, params, options) {
|
4
|
-
return this.resources.create({ ...resource, type: Imports.TYPE }, params, options);
|
5
|
-
}
|
6
|
-
async delete(id, options) {
|
7
|
-
await this.resources.delete((typeof id === 'string') ? { id, type: Imports.TYPE } : id, options);
|
8
|
-
}
|
9
|
-
async events(importId, params, options) {
|
10
|
-
const _importId = importId.id || importId;
|
11
|
-
return this.resources.fetch({ type: 'events' }, `imports/${_importId}/events`, params, options);
|
12
|
-
}
|
13
|
-
isImport(resource) {
|
14
|
-
return resource.type && (resource.type === Imports.TYPE);
|
15
|
-
}
|
16
|
-
relationship(id) {
|
17
|
-
return ((id === null) || (typeof id === 'string')) ? { id, type: Imports.TYPE } : { id: id.id, type: Imports.TYPE };
|
18
|
-
}
|
19
|
-
type() {
|
20
|
-
return Imports.TYPE;
|
21
|
-
}
|
22
|
-
}
|
23
|
-
Imports.TYPE = 'imports';
|
24
|
-
export default Imports;
|
1
|
+
import{ApiResource as y}from"../resource";class t extends y{async create(e,r,s){return this.resources.create({...e,type:t.TYPE},r,s)}async delete(e,r){await this.resources.delete(typeof e=="string"?{id:e,type:t.TYPE}:e,r)}async events(e,r,s){const n=e.id||e;return this.resources.fetch({type:"events"},`imports/${n}/events`,r,s)}isImport(e){return e.type&&e.type===t.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="imports";export default t;
|
@@ -1,68 +1 @@
|
|
1
|
-
import {
|
2
|
-
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
3
|
-
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
4
|
-
import type { Market, MarketType } from './markets';
|
5
|
-
import type { Customer, CustomerType } from './customers';
|
6
|
-
import type { Sku, SkuType } from './skus';
|
7
|
-
import type { Event } from './events';
|
8
|
-
import type { Version } from './versions';
|
9
|
-
type InStockSubscriptionType = 'in_stock_subscriptions';
|
10
|
-
type InStockSubscriptionRel = ResourceRel & {
|
11
|
-
type: InStockSubscriptionType;
|
12
|
-
};
|
13
|
-
type MarketRel = ResourceRel & {
|
14
|
-
type: MarketType;
|
15
|
-
};
|
16
|
-
type CustomerRel = ResourceRel & {
|
17
|
-
type: CustomerType;
|
18
|
-
};
|
19
|
-
type SkuRel = ResourceRel & {
|
20
|
-
type: SkuType;
|
21
|
-
};
|
22
|
-
interface InStockSubscription extends Resource {
|
23
|
-
readonly type: InStockSubscriptionType;
|
24
|
-
status: 'active' | 'inactive' | 'notified';
|
25
|
-
customer_email?: string | null;
|
26
|
-
sku_code?: string | null;
|
27
|
-
stock_threshold?: number | null;
|
28
|
-
market?: Market | null;
|
29
|
-
customer?: Customer | null;
|
30
|
-
sku?: Sku | null;
|
31
|
-
events?: Event[] | null;
|
32
|
-
versions?: Version[] | null;
|
33
|
-
}
|
34
|
-
interface InStockSubscriptionCreate extends ResourceCreate {
|
35
|
-
customer_email?: string | null;
|
36
|
-
sku_code?: string | null;
|
37
|
-
stock_threshold?: number | null;
|
38
|
-
market: MarketRel;
|
39
|
-
customer: CustomerRel;
|
40
|
-
sku: SkuRel;
|
41
|
-
}
|
42
|
-
interface InStockSubscriptionUpdate extends ResourceUpdate {
|
43
|
-
sku_code?: string | null;
|
44
|
-
stock_threshold?: number | null;
|
45
|
-
_activate?: boolean | null;
|
46
|
-
_deactivate?: boolean | null;
|
47
|
-
market?: MarketRel | null;
|
48
|
-
customer?: CustomerRel | null;
|
49
|
-
sku?: SkuRel | null;
|
50
|
-
}
|
51
|
-
declare class InStockSubscriptions extends ApiResource<InStockSubscription> {
|
52
|
-
static readonly TYPE: InStockSubscriptionType;
|
53
|
-
create(resource: InStockSubscriptionCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<InStockSubscription>;
|
54
|
-
update(resource: InStockSubscriptionUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<InStockSubscription>;
|
55
|
-
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
56
|
-
market(inStockSubscriptionId: string | InStockSubscription, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
|
57
|
-
customer(inStockSubscriptionId: string | InStockSubscription, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Customer>;
|
58
|
-
sku(inStockSubscriptionId: string | InStockSubscription, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
|
59
|
-
events(inStockSubscriptionId: string | InStockSubscription, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
60
|
-
versions(inStockSubscriptionId: string | InStockSubscription, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
61
|
-
_activate(id: string | InStockSubscription, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<InStockSubscription>;
|
62
|
-
_deactivate(id: string | InStockSubscription, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<InStockSubscription>;
|
63
|
-
isInStockSubscription(resource: any): resource is InStockSubscription;
|
64
|
-
relationship(id: string | ResourceId | null): InStockSubscriptionRel;
|
65
|
-
type(): InStockSubscriptionType;
|
66
|
-
}
|
67
|
-
export default InStockSubscriptions;
|
68
|
-
export type { InStockSubscription, InStockSubscriptionCreate, InStockSubscriptionUpdate, InStockSubscriptionType };
|
1
|
+
import{ApiResource}from'../resource';import type{Resource,ResourceCreate,ResourceUpdate,ResourceId,ResourcesConfig,ResourceRel,ListResponse}from'../resource';import type{QueryParamsRetrieve,QueryParamsList}from'../query';import type{Market,MarketType}from'./markets';import type{Customer,CustomerType}from'./customers';import type{Sku,SkuType}from'./skus';import type{Event}from'./events';import type{Version}from'./versions';type InStockSubscriptionType='in_stock_subscriptions';type InStockSubscriptionRel=ResourceRel&{type:InStockSubscriptionType;};type MarketRel=ResourceRel&{type:MarketType;};type CustomerRel=ResourceRel&{type:CustomerType;};type SkuRel=ResourceRel&{type:SkuType;};interface InStockSubscription extends Resource{readonly type:InStockSubscriptionType;status:'active'|'inactive'|'notified';customer_email?:string|null;sku_code?:string|null;stock_threshold?:number|null;market?:Market|null;customer?:Customer|null;sku?:Sku|null;events?:Event[]|null;versions?:Version[]|null;}interface InStockSubscriptionCreate extends ResourceCreate{customer_email?:string|null;sku_code?:string|null;stock_threshold?:number|null;market:MarketRel;customer:CustomerRel;sku:SkuRel;}interface InStockSubscriptionUpdate extends ResourceUpdate{sku_code?:string|null;stock_threshold?:number|null;_activate?:boolean|null;_deactivate?:boolean|null;market?:MarketRel|null;customer?:CustomerRel|null;sku?:SkuRel|null;}declare class InStockSubscriptions extends ApiResource<InStockSubscription>{static readonly TYPE:InStockSubscriptionType;create(resource:InStockSubscriptionCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<InStockSubscription>;update(resource:InStockSubscriptionUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<InStockSubscription>;delete(id:string|ResourceId,options?:ResourcesConfig):Promise<void>;market(inStockSubscriptionId:string|InStockSubscription,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Market>;customer(inStockSubscriptionId:string|InStockSubscription,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Customer>;sku(inStockSubscriptionId:string|InStockSubscription,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Sku>;events(inStockSubscriptionId:string|InStockSubscription,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Event>>;versions(inStockSubscriptionId:string|InStockSubscription,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Version>>;_activate(id:string|InStockSubscription,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<InStockSubscription>;_deactivate(id:string|InStockSubscription,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<InStockSubscription>;isInStockSubscription(resource:any):resource is InStockSubscription;relationship(id:string|ResourceId|null):InStockSubscriptionRel;type():InStockSubscriptionType;}export default InStockSubscriptions;export type{InStockSubscription,InStockSubscriptionCreate,InStockSubscriptionUpdate,InStockSubscriptionType};
|