@commercelayer/sdk 5.27.3 → 5.29.0-alfa.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/cjs/api.d.ts +3 -2
- package/lib/cjs/api.js +5 -2
- package/lib/cjs/client.js +5 -5
- package/lib/cjs/commercelayer.d.ts +3 -2
- package/lib/cjs/commercelayer.js +5 -4
- package/lib/cjs/common.js +1 -1
- package/lib/cjs/error.js +1 -2
- package/lib/cjs/model.d.ts +1 -0
- package/lib/cjs/query.d.ts +1 -1
- package/lib/cjs/query.js +1 -1
- package/lib/cjs/resource.js +22 -25
- package/lib/cjs/resources/adjustments.d.ts +3 -0
- package/lib/cjs/resources/adyen_gateways.d.ts +2 -2
- package/lib/cjs/resources/avalara_accounts.d.ts +6 -6
- package/lib/cjs/resources/buy_x_pay_y_promotions.d.ts +11 -13
- package/lib/cjs/resources/buy_x_pay_y_promotions.js +6 -2
- package/lib/cjs/resources/external_gateways.d.ts +5 -1
- package/lib/cjs/resources/external_gateways.js +3 -0
- package/lib/cjs/resources/external_promotions.d.ts +15 -13
- package/lib/cjs/resources/external_promotions.js +9 -2
- package/lib/cjs/resources/external_tax_calculators.d.ts +4 -0
- package/lib/cjs/resources/external_tax_calculators.js +3 -0
- package/lib/cjs/resources/fixed_amount_promotions.d.ts +11 -13
- package/lib/cjs/resources/fixed_amount_promotions.js +6 -2
- package/lib/cjs/resources/fixed_price_promotions.d.ts +11 -13
- package/lib/cjs/resources/fixed_price_promotions.js +6 -2
- package/lib/cjs/resources/free_gift_promotions.d.ts +11 -13
- package/lib/cjs/resources/free_gift_promotions.js +6 -2
- package/lib/cjs/resources/free_shipping_promotions.d.ts +17 -14
- package/lib/cjs/resources/free_shipping_promotions.js +6 -2
- package/lib/cjs/resources/gift_cards.d.ts +3 -0
- package/lib/cjs/resources/inventory_models.d.ts +3 -0
- package/lib/cjs/resources/line_items.d.ts +15 -4
- package/lib/cjs/resources/line_items.js +7 -0
- package/lib/cjs/resources/markets.d.ts +1 -1
- package/lib/cjs/resources/order_subscriptions.d.ts +1 -4
- package/lib/cjs/resources/orders.d.ts +16 -1
- package/lib/cjs/resources/orders.js +14 -0
- package/lib/cjs/resources/parcel_line_items.d.ts +0 -8
- package/lib/cjs/resources/payment_methods.d.ts +8 -5
- package/lib/cjs/resources/percentage_discount_promotions.d.ts +11 -13
- package/lib/cjs/resources/percentage_discount_promotions.js +6 -2
- package/lib/cjs/resources/promotions.d.ts +6 -3
- package/lib/cjs/resources/promotions.js +6 -2
- package/lib/cjs/resources/resource_errors.d.ts +22 -0
- package/lib/cjs/resources/resource_errors.js +16 -0
- package/lib/cjs/resources/shipments.d.ts +0 -4
- package/lib/cjs/resources/shipping_methods.d.ts +9 -5
- package/lib/cjs/resources/shipping_methods.js +3 -0
- package/lib/cjs/resources/stock_line_items.d.ts +6 -0
- package/lib/cjs/resources/stock_line_items.js +9 -0
- package/lib/cjs/resources/stock_reservations.d.ts +0 -1
- package/lib/cjs/resources/stock_transfers.d.ts +1 -1
- package/lib/cjs/resources/stripe_payments.d.ts +4 -1
- package/lib/cjs/resources/webhooks.d.ts +3 -3
- package/lib/cjs/resources/webhooks.js +3 -3
- package/lib/esm/api.d.ts +3 -2
- package/lib/esm/api.js +2 -0
- package/lib/esm/client.js +19 -30
- package/lib/esm/commercelayer.d.ts +3 -2
- package/lib/esm/commercelayer.js +261 -149
- package/lib/esm/common.js +1 -1
- package/lib/esm/error.js +10 -5
- package/lib/esm/model.d.ts +1 -0
- package/lib/esm/query.d.ts +1 -1
- package/lib/esm/query.js +1 -1
- package/lib/esm/resource.js +37 -50
- package/lib/esm/resources/addresses.js +1 -1
- package/lib/esm/resources/adjustments.d.ts +3 -0
- package/lib/esm/resources/adjustments.js +1 -1
- package/lib/esm/resources/adyen_gateways.d.ts +2 -2
- package/lib/esm/resources/adyen_gateways.js +1 -1
- package/lib/esm/resources/adyen_payments.js +1 -1
- package/lib/esm/resources/application.js +1 -1
- package/lib/esm/resources/attachments.js +1 -1
- package/lib/esm/resources/authorizations.js +1 -1
- package/lib/esm/resources/avalara_accounts.d.ts +6 -6
- package/lib/esm/resources/avalara_accounts.js +1 -1
- package/lib/esm/resources/axerve_gateways.js +1 -1
- package/lib/esm/resources/axerve_payments.js +1 -1
- package/lib/esm/resources/billing_info_validation_rules.js +1 -1
- package/lib/esm/resources/bing_geocoders.js +1 -1
- package/lib/esm/resources/braintree_gateways.js +1 -1
- package/lib/esm/resources/braintree_payments.js +1 -1
- package/lib/esm/resources/bundles.js +1 -1
- package/lib/esm/resources/buy_x_pay_y_promotions.d.ts +11 -13
- package/lib/esm/resources/buy_x_pay_y_promotions.js +7 -3
- package/lib/esm/resources/captures.js +1 -1
- package/lib/esm/resources/carrier_accounts.js +1 -1
- package/lib/esm/resources/checkout_com_gateways.js +1 -1
- package/lib/esm/resources/checkout_com_payments.js +1 -1
- package/lib/esm/resources/cleanups.js +1 -1
- package/lib/esm/resources/coupon_codes_promotion_rules.js +1 -1
- package/lib/esm/resources/coupon_recipients.js +1 -1
- package/lib/esm/resources/coupons.js +1 -1
- package/lib/esm/resources/custom_promotion_rules.js +1 -1
- package/lib/esm/resources/customer_addresses.js +1 -1
- package/lib/esm/resources/customer_groups.js +1 -1
- package/lib/esm/resources/customer_password_resets.js +1 -1
- package/lib/esm/resources/customer_payment_sources.js +1 -1
- package/lib/esm/resources/customer_subscriptions.js +1 -1
- package/lib/esm/resources/customers.js +1 -1
- package/lib/esm/resources/delivery_lead_times.js +1 -1
- package/lib/esm/resources/event_callbacks.js +1 -1
- package/lib/esm/resources/events.js +1 -1
- package/lib/esm/resources/exports.js +1 -1
- package/lib/esm/resources/external_gateways.d.ts +5 -1
- package/lib/esm/resources/external_gateways.js +4 -1
- package/lib/esm/resources/external_payments.js +1 -1
- package/lib/esm/resources/external_promotions.d.ts +15 -13
- package/lib/esm/resources/external_promotions.js +10 -3
- package/lib/esm/resources/external_tax_calculators.d.ts +4 -0
- package/lib/esm/resources/external_tax_calculators.js +4 -1
- package/lib/esm/resources/fixed_amount_promotions.d.ts +11 -13
- package/lib/esm/resources/fixed_amount_promotions.js +7 -3
- package/lib/esm/resources/fixed_price_promotions.d.ts +11 -13
- package/lib/esm/resources/fixed_price_promotions.js +7 -3
- package/lib/esm/resources/free_gift_promotions.d.ts +11 -13
- package/lib/esm/resources/free_gift_promotions.js +7 -3
- package/lib/esm/resources/free_shipping_promotions.d.ts +17 -14
- package/lib/esm/resources/free_shipping_promotions.js +7 -3
- package/lib/esm/resources/geocoders.js +1 -1
- package/lib/esm/resources/gift_card_recipients.js +1 -1
- package/lib/esm/resources/gift_cards.d.ts +3 -0
- package/lib/esm/resources/gift_cards.js +1 -1
- package/lib/esm/resources/google_geocoders.js +1 -1
- package/lib/esm/resources/imports.js +1 -1
- package/lib/esm/resources/in_stock_subscriptions.js +1 -1
- package/lib/esm/resources/inventory_models.d.ts +3 -0
- package/lib/esm/resources/inventory_models.js +1 -1
- package/lib/esm/resources/inventory_return_locations.js +1 -1
- package/lib/esm/resources/inventory_stock_locations.js +1 -1
- package/lib/esm/resources/klarna_gateways.js +1 -1
- package/lib/esm/resources/klarna_payments.js +1 -1
- package/lib/esm/resources/line_item_options.js +1 -1
- package/lib/esm/resources/line_items.d.ts +15 -4
- package/lib/esm/resources/line_items.js +8 -1
- package/lib/esm/resources/manual_gateways.js +1 -1
- package/lib/esm/resources/manual_tax_calculators.js +1 -1
- package/lib/esm/resources/markets.d.ts +1 -1
- package/lib/esm/resources/markets.js +1 -1
- package/lib/esm/resources/merchants.js +1 -1
- package/lib/esm/resources/order_amount_promotion_rules.js +1 -1
- package/lib/esm/resources/order_copies.js +1 -1
- package/lib/esm/resources/order_factories.js +1 -1
- package/lib/esm/resources/order_subscription_items.js +1 -1
- package/lib/esm/resources/order_subscriptions.d.ts +1 -4
- package/lib/esm/resources/order_subscriptions.js +1 -1
- package/lib/esm/resources/order_validation_rules.js +1 -1
- package/lib/esm/resources/orders.d.ts +16 -1
- package/lib/esm/resources/orders.js +15 -1
- package/lib/esm/resources/organization.js +1 -1
- package/lib/esm/resources/packages.js +1 -1
- package/lib/esm/resources/parcel_line_items.d.ts +0 -8
- package/lib/esm/resources/parcel_line_items.js +1 -1
- package/lib/esm/resources/parcels.js +1 -1
- package/lib/esm/resources/payment_gateways.js +1 -1
- package/lib/esm/resources/payment_methods.d.ts +8 -5
- package/lib/esm/resources/payment_methods.js +1 -1
- package/lib/esm/resources/payment_options.js +1 -1
- package/lib/esm/resources/paypal_gateways.js +1 -1
- package/lib/esm/resources/paypal_payments.js +1 -1
- package/lib/esm/resources/percentage_discount_promotions.d.ts +11 -13
- package/lib/esm/resources/percentage_discount_promotions.js +7 -3
- package/lib/esm/resources/price_frequency_tiers.js +1 -1
- package/lib/esm/resources/price_lists.js +1 -1
- package/lib/esm/resources/price_tiers.js +1 -1
- package/lib/esm/resources/price_volume_tiers.js +1 -1
- package/lib/esm/resources/prices.js +1 -1
- package/lib/esm/resources/promotion_rules.js +1 -1
- package/lib/esm/resources/promotions.d.ts +6 -3
- package/lib/esm/resources/promotions.js +7 -3
- package/lib/esm/resources/recurring_order_copies.js +1 -1
- package/lib/esm/resources/refunds.js +1 -1
- package/lib/esm/resources/reserved_stocks.js +1 -1
- package/lib/esm/resources/resource_errors.d.ts +22 -0
- package/lib/esm/resources/resource_errors.js +14 -0
- package/lib/esm/resources/return_line_items.js +1 -1
- package/lib/esm/resources/returns.js +1 -1
- package/lib/esm/resources/satispay_gateways.js +1 -1
- package/lib/esm/resources/satispay_payments.js +1 -1
- package/lib/esm/resources/shipments.d.ts +0 -4
- package/lib/esm/resources/shipments.js +1 -1
- package/lib/esm/resources/shipping_categories.js +1 -1
- package/lib/esm/resources/shipping_method_tiers.js +1 -1
- package/lib/esm/resources/shipping_methods.d.ts +9 -5
- package/lib/esm/resources/shipping_methods.js +4 -1
- package/lib/esm/resources/shipping_weight_tiers.js +1 -1
- package/lib/esm/resources/shipping_zones.js +1 -1
- package/lib/esm/resources/sku_list_items.js +1 -1
- package/lib/esm/resources/sku_list_promotion_rules.js +1 -1
- package/lib/esm/resources/sku_lists.js +1 -1
- package/lib/esm/resources/sku_options.js +1 -1
- package/lib/esm/resources/skus.js +1 -1
- package/lib/esm/resources/stock_items.js +1 -1
- package/lib/esm/resources/stock_line_items.d.ts +6 -0
- package/lib/esm/resources/stock_line_items.js +10 -1
- package/lib/esm/resources/stock_locations.js +1 -1
- package/lib/esm/resources/stock_reservations.d.ts +0 -1
- package/lib/esm/resources/stock_reservations.js +1 -1
- package/lib/esm/resources/stock_transfers.d.ts +1 -1
- package/lib/esm/resources/stock_transfers.js +1 -1
- package/lib/esm/resources/stripe_gateways.js +1 -1
- package/lib/esm/resources/stripe_payments.d.ts +4 -1
- package/lib/esm/resources/stripe_payments.js +1 -1
- package/lib/esm/resources/subscription_models.js +1 -1
- package/lib/esm/resources/tags.js +1 -1
- package/lib/esm/resources/tax_calculators.js +1 -1
- package/lib/esm/resources/tax_categories.js +1 -1
- package/lib/esm/resources/tax_rules.js +1 -1
- package/lib/esm/resources/taxjar_accounts.js +1 -1
- package/lib/esm/resources/transactions.js +1 -1
- package/lib/esm/resources/versions.js +1 -1
- package/lib/esm/resources/voids.js +1 -1
- package/lib/esm/resources/webhooks.d.ts +3 -3
- package/lib/esm/resources/webhooks.js +4 -4
- package/lib/esm/resources/wire_transfers.js +1 -1
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +16 -16
package/lib/cjs/api.d.ts
CHANGED
@@ -91,6 +91,7 @@ export { default as Promotions } from './resources/promotions';
|
|
91
91
|
export { default as RecurringOrderCopies } from './resources/recurring_order_copies';
|
92
92
|
export { default as Refunds } from './resources/refunds';
|
93
93
|
export { default as ReservedStocks } from './resources/reserved_stocks';
|
94
|
+
export { default as ResourceErrors } from './resources/resource_errors';
|
94
95
|
export { default as ReturnLineItems } from './resources/return_line_items';
|
95
96
|
export { default as Returns } from './resources/returns';
|
96
97
|
export { default as SatispayGateways } from './resources/satispay_gateways';
|
@@ -124,8 +125,8 @@ export { default as Versions } from './resources/versions';
|
|
124
125
|
export { default as Voids } from './resources/voids';
|
125
126
|
export { default as Webhooks } from './resources/webhooks';
|
126
127
|
export { default as WireTransfers } from './resources/wire_transfers';
|
127
|
-
export type ResourceTypeLock = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'application' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'buy_x_pay_y_promotions' | 'captures' | 'carrier_accounts' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'custom_promotion_rules' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'event_callbacks' | 'events' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'geocoders' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_factories' | 'order_subscription_items' | 'order_subscriptions' | 'order_validation_rules' | 'orders' | 'organization' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_gateways' | 'payment_methods' | 'payment_options' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_tiers' | 'price_volume_tiers' | 'prices' | 'promotion_rules' | 'promotions' | 'recurring_order_copies' | 'refunds' | 'reserved_stocks' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_method_tiers' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_line_items' | 'stock_locations' | 'stock_reservations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_calculators' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'transactions' | 'versions' | 'voids' | 'webhooks' | 'wire_transfers';
|
128
|
-
export declare const resourceList: readonly ["addresses", "adjustments", "adyen_gateways", "adyen_payments", "application", "attachments", "authorizations", "avalara_accounts", "axerve_gateways", "axerve_payments", "billing_info_validation_rules", "bing_geocoders", "braintree_gateways", "braintree_payments", "bundles", "buy_x_pay_y_promotions", "captures", "carrier_accounts", "checkout_com_gateways", "checkout_com_payments", "cleanups", "coupon_codes_promotion_rules", "coupon_recipients", "coupons", "custom_promotion_rules", "customer_addresses", "customer_groups", "customer_password_resets", "customer_payment_sources", "customer_subscriptions", "customers", "delivery_lead_times", "event_callbacks", "events", "exports", "external_gateways", "external_payments", "external_promotions", "external_tax_calculators", "fixed_amount_promotions", "fixed_price_promotions", "free_gift_promotions", "free_shipping_promotions", "geocoders", "gift_card_recipients", "gift_cards", "google_geocoders", "imports", "in_stock_subscriptions", "inventory_models", "inventory_return_locations", "inventory_stock_locations", "klarna_gateways", "klarna_payments", "line_item_options", "line_items", "manual_gateways", "manual_tax_calculators", "markets", "merchants", "order_amount_promotion_rules", "order_copies", "order_factories", "order_subscription_items", "order_subscriptions", "order_validation_rules", "orders", "organization", "packages", "parcel_line_items", "parcels", "payment_gateways", "payment_methods", "payment_options", "paypal_gateways", "paypal_payments", "percentage_discount_promotions", "price_frequency_tiers", "price_lists", "price_tiers", "price_volume_tiers", "prices", "promotion_rules", "promotions", "recurring_order_copies", "refunds", "reserved_stocks", "return_line_items", "returns", "satispay_gateways", "satispay_payments", "shipments", "shipping_categories", "shipping_method_tiers", "shipping_methods", "shipping_weight_tiers", "shipping_zones", "sku_list_items", "sku_list_promotion_rules", "sku_lists", "sku_options", "skus", "stock_items", "stock_line_items", "stock_locations", "stock_reservations", "stock_transfers", "stripe_gateways", "stripe_payments", "subscription_models", "tags", "tax_calculators", "tax_categories", "tax_rules", "taxjar_accounts", "transactions", "versions", "voids", "webhooks", "wire_transfers"];
|
128
|
+
export type ResourceTypeLock = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'application' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'buy_x_pay_y_promotions' | 'captures' | 'carrier_accounts' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'custom_promotion_rules' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'event_callbacks' | 'events' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'geocoders' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_factories' | 'order_subscription_items' | 'order_subscriptions' | 'order_validation_rules' | 'orders' | 'organization' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_gateways' | 'payment_methods' | 'payment_options' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_tiers' | 'price_volume_tiers' | 'prices' | 'promotion_rules' | 'promotions' | 'recurring_order_copies' | 'refunds' | 'reserved_stocks' | 'resource_errors' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_method_tiers' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_line_items' | 'stock_locations' | 'stock_reservations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_calculators' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'transactions' | 'versions' | 'voids' | 'webhooks' | 'wire_transfers';
|
129
|
+
export declare const resourceList: readonly ["addresses", "adjustments", "adyen_gateways", "adyen_payments", "application", "attachments", "authorizations", "avalara_accounts", "axerve_gateways", "axerve_payments", "billing_info_validation_rules", "bing_geocoders", "braintree_gateways", "braintree_payments", "bundles", "buy_x_pay_y_promotions", "captures", "carrier_accounts", "checkout_com_gateways", "checkout_com_payments", "cleanups", "coupon_codes_promotion_rules", "coupon_recipients", "coupons", "custom_promotion_rules", "customer_addresses", "customer_groups", "customer_password_resets", "customer_payment_sources", "customer_subscriptions", "customers", "delivery_lead_times", "event_callbacks", "events", "exports", "external_gateways", "external_payments", "external_promotions", "external_tax_calculators", "fixed_amount_promotions", "fixed_price_promotions", "free_gift_promotions", "free_shipping_promotions", "geocoders", "gift_card_recipients", "gift_cards", "google_geocoders", "imports", "in_stock_subscriptions", "inventory_models", "inventory_return_locations", "inventory_stock_locations", "klarna_gateways", "klarna_payments", "line_item_options", "line_items", "manual_gateways", "manual_tax_calculators", "markets", "merchants", "order_amount_promotion_rules", "order_copies", "order_factories", "order_subscription_items", "order_subscriptions", "order_validation_rules", "orders", "organization", "packages", "parcel_line_items", "parcels", "payment_gateways", "payment_methods", "payment_options", "paypal_gateways", "paypal_payments", "percentage_discount_promotions", "price_frequency_tiers", "price_lists", "price_tiers", "price_volume_tiers", "prices", "promotion_rules", "promotions", "recurring_order_copies", "refunds", "reserved_stocks", "resource_errors", "return_line_items", "returns", "satispay_gateways", "satispay_payments", "shipments", "shipping_categories", "shipping_method_tiers", "shipping_methods", "shipping_weight_tiers", "shipping_zones", "sku_list_items", "sku_list_promotion_rules", "sku_lists", "sku_options", "skus", "stock_items", "stock_line_items", "stock_locations", "stock_reservations", "stock_transfers", "stripe_gateways", "stripe_payments", "subscription_models", "tags", "tax_calculators", "tax_categories", "tax_rules", "taxjar_accounts", "transactions", "versions", "voids", "webhooks", "wire_transfers"];
|
129
130
|
export declare const singletonList: readonly ["application", "organization"];
|
130
131
|
export type RetrievableResourceType = ResourceTypeLock;
|
131
132
|
export type RetrievableResource = Resource & {
|
package/lib/cjs/api.js
CHANGED
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
6
|
exports.InventoryModels = exports.InStockSubscriptions = exports.Imports = exports.GoogleGeocoders = exports.GiftCards = exports.GiftCardRecipients = exports.Geocoders = exports.FreeShippingPromotions = exports.FreeGiftPromotions = exports.FixedPricePromotions = exports.FixedAmountPromotions = exports.ExternalTaxCalculators = exports.ExternalPromotions = exports.ExternalPayments = exports.ExternalGateways = exports.Exports = exports.Events = exports.EventCallbacks = exports.DeliveryLeadTimes = exports.Customers = exports.CustomerSubscriptions = exports.CustomerPaymentSources = exports.CustomerPasswordResets = exports.CustomerGroups = exports.CustomerAddresses = exports.CustomPromotionRules = exports.Coupons = exports.CouponRecipients = exports.CouponCodesPromotionRules = exports.Cleanups = exports.CheckoutComPayments = exports.CheckoutComGateways = exports.CarrierAccounts = exports.Captures = exports.BuyXPayYPromotions = exports.Bundles = exports.BraintreePayments = exports.BraintreeGateways = exports.BingGeocoders = exports.BillingInfoValidationRules = exports.AxervePayments = exports.AxerveGateways = exports.AvalaraAccounts = exports.Authorizations = exports.Attachments = exports.Applications = exports.AdyenPayments = exports.AdyenGateways = exports.Adjustments = exports.Addresses = void 0;
|
7
|
-
exports.
|
8
|
-
exports.singletonList = exports.resourceList = exports.WireTransfers = exports.Webhooks = exports.Voids = exports.Versions = exports.Transactions = exports.TaxjarAccounts = exports.TaxRules = exports.TaxCategories = exports.TaxCalculators = exports.Tags = exports.SubscriptionModels = exports.StripePayments = exports.StripeGateways = exports.StockTransfers = exports.StockReservations = exports.StockLocations = exports.StockLineItems = exports.StockItems = exports.Skus = exports.SkuOptions = void 0;
|
7
|
+
exports.SkuListPromotionRules = exports.SkuListItems = exports.ShippingZones = exports.ShippingWeightTiers = exports.ShippingMethods = exports.ShippingMethodTiers = exports.ShippingCategories = exports.Shipments = exports.SatispayPayments = exports.SatispayGateways = exports.Returns = exports.ReturnLineItems = exports.ResourceErrors = exports.ReservedStocks = exports.Refunds = exports.RecurringOrderCopies = exports.Promotions = exports.PromotionRules = exports.Prices = exports.PriceVolumeTiers = exports.PriceTiers = exports.PriceLists = exports.PriceFrequencyTiers = exports.PercentageDiscountPromotions = exports.PaypalPayments = exports.PaypalGateways = exports.PaymentOptions = exports.PaymentMethods = exports.PaymentGateways = exports.Parcels = exports.ParcelLineItems = exports.Packages = exports.Organizations = exports.Orders = exports.OrderValidationRules = exports.OrderSubscriptions = exports.OrderSubscriptionItems = exports.OrderFactories = exports.OrderCopies = exports.OrderAmountPromotionRules = exports.Merchants = exports.Markets = exports.ManualTaxCalculators = exports.ManualGateways = exports.LineItems = exports.LineItemOptions = exports.KlarnaPayments = exports.KlarnaGateways = exports.InventoryStockLocations = exports.InventoryReturnLocations = void 0;
|
8
|
+
exports.singletonList = exports.resourceList = exports.WireTransfers = exports.Webhooks = exports.Voids = exports.Versions = exports.Transactions = exports.TaxjarAccounts = exports.TaxRules = exports.TaxCategories = exports.TaxCalculators = exports.Tags = exports.SubscriptionModels = exports.StripePayments = exports.StripeGateways = exports.StockTransfers = exports.StockReservations = exports.StockLocations = exports.StockLineItems = exports.StockItems = exports.Skus = exports.SkuOptions = exports.SkuLists = void 0;
|
9
9
|
// ##__API_RESOURCES_START__##
|
10
10
|
// ##__API_RESOURCES_TEMPLATE:: export { default as ##__RESOURCE_CLASS__## } from './resources/##__RESOURCE_TYPE__##'
|
11
11
|
/**
|
@@ -185,6 +185,8 @@ var refunds_1 = require("./resources/refunds");
|
|
185
185
|
Object.defineProperty(exports, "Refunds", { enumerable: true, get: function () { return __importDefault(refunds_1).default; } });
|
186
186
|
var reserved_stocks_1 = require("./resources/reserved_stocks");
|
187
187
|
Object.defineProperty(exports, "ReservedStocks", { enumerable: true, get: function () { return __importDefault(reserved_stocks_1).default; } });
|
188
|
+
var resource_errors_1 = require("./resources/resource_errors");
|
189
|
+
Object.defineProperty(exports, "ResourceErrors", { enumerable: true, get: function () { return __importDefault(resource_errors_1).default; } });
|
188
190
|
var return_line_items_1 = require("./resources/return_line_items");
|
189
191
|
Object.defineProperty(exports, "ReturnLineItems", { enumerable: true, get: function () { return __importDefault(return_line_items_1).default; } });
|
190
192
|
var returns_1 = require("./resources/returns");
|
@@ -341,6 +343,7 @@ exports.resourceList = [
|
|
341
343
|
'recurring_order_copies',
|
342
344
|
'refunds',
|
343
345
|
'reserved_stocks',
|
346
|
+
'resource_errors',
|
344
347
|
'return_line_items',
|
345
348
|
'returns',
|
346
349
|
'satispay_gateways',
|
package/lib/cjs/client.js
CHANGED
@@ -120,16 +120,16 @@ class ApiClient {
|
|
120
120
|
async request(method, path, body, options) {
|
121
121
|
debug('request %s %s, %O, %O', method, path, body || {}, options || {});
|
122
122
|
// Ignored params alerts (in debug mode)
|
123
|
-
if (options
|
123
|
+
if (options?.adapter)
|
124
124
|
debug('Adapter ignored in request config');
|
125
|
-
if (options
|
125
|
+
if (options?.userAgent)
|
126
126
|
debug('User-Agent header ignored in request config');
|
127
127
|
const data = body ? { data: body } : undefined;
|
128
128
|
const url = path;
|
129
129
|
// Runtime request parameters
|
130
|
-
const baseUrl =
|
131
|
-
const accessToken =
|
132
|
-
const headers = this.customHeaders(options
|
130
|
+
const baseUrl = options?.organization ? baseURL(options.organization, options.domain) : undefined;
|
131
|
+
const accessToken = options?.accessToken || __classPrivateFieldGet(this, _ApiClient_accessToken, "f");
|
132
|
+
const headers = this.customHeaders(options?.headers);
|
133
133
|
if (accessToken)
|
134
134
|
headers.Authorization = 'Bearer ' + accessToken;
|
135
135
|
const requestParams = { method, baseURL: baseUrl, url, data, ...options, headers };
|
@@ -2,14 +2,14 @@ import * as api from './api';
|
|
2
2
|
import type { ApiError } from './error';
|
3
3
|
import type { ErrorInterceptor, InterceptorType, RawResponseReader, RequestInterceptor, ResponseInterceptor } from './interceptor';
|
4
4
|
import { type ResourcesInitConfig } from './resource';
|
5
|
-
declare const OPEN_API_SCHEMA_VERSION = "
|
5
|
+
declare const OPEN_API_SCHEMA_VERSION = "5.0.0";
|
6
6
|
export { OPEN_API_SCHEMA_VERSION };
|
7
7
|
type SdkConfig = {};
|
8
8
|
type CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig;
|
9
9
|
type CommerceLayerConfig = Partial<CommerceLayerInitConfig>;
|
10
10
|
declare class CommerceLayerClient {
|
11
11
|
#private;
|
12
|
-
readonly openApiSchemaVersion = "
|
12
|
+
readonly openApiSchemaVersion = "5.0.0";
|
13
13
|
addresses: api.Addresses;
|
14
14
|
adjustments: api.Adjustments;
|
15
15
|
adyen_gateways: api.AdyenGateways;
|
@@ -97,6 +97,7 @@ declare class CommerceLayerClient {
|
|
97
97
|
recurring_order_copies: api.RecurringOrderCopies;
|
98
98
|
refunds: api.Refunds;
|
99
99
|
reserved_stocks: api.ReservedStocks;
|
100
|
+
resource_errors: api.ResourceErrors;
|
100
101
|
return_line_items: api.ReturnLineItems;
|
101
102
|
returns: api.Returns;
|
102
103
|
satispay_gateways: api.SatispayGateways;
|
package/lib/cjs/commercelayer.js
CHANGED
@@ -45,7 +45,7 @@ const resource_1 = __importDefault(require("./resource"));
|
|
45
45
|
const debug_1 = __importDefault(require("./debug"));
|
46
46
|
const debug = (0, debug_1.default)('commercelayer');
|
47
47
|
// Autogenerated schema version number, do not remove this line
|
48
|
-
const OPEN_API_SCHEMA_VERSION = '
|
48
|
+
const OPEN_API_SCHEMA_VERSION = '5.0.0';
|
49
49
|
exports.OPEN_API_SCHEMA_VERSION = OPEN_API_SCHEMA_VERSION;
|
50
50
|
class CommerceLayerClient {
|
51
51
|
// ##__CL_RESOURCES_DEF_STOP__##
|
@@ -147,6 +147,7 @@ class CommerceLayerClient {
|
|
147
147
|
this.recurring_order_copies = new api.RecurringOrderCopies(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
148
148
|
this.refunds = new api.Refunds(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
149
149
|
this.reserved_stocks = new api.ReservedStocks(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
150
|
+
this.resource_errors = new api.ResourceErrors(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
150
151
|
this.return_line_items = new api.ReturnLineItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
151
152
|
this.returns = new api.Returns(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
152
153
|
this.satispay_gateways = new api.SatispayGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
@@ -229,8 +230,8 @@ class CommerceLayerClient {
|
|
229
230
|
headers: undefined,
|
230
231
|
};
|
231
232
|
function rawResponseInterceptor(response) {
|
232
|
-
reader.rawResponse = response
|
233
|
-
if (options
|
233
|
+
reader.rawResponse = response?.data;
|
234
|
+
if (options?.headers)
|
234
235
|
reader.headers = response.headers;
|
235
236
|
return response;
|
236
237
|
}
|
@@ -239,7 +240,7 @@ class CommerceLayerClient {
|
|
239
240
|
return reader;
|
240
241
|
}
|
241
242
|
removeRawResponseReader(reader) {
|
242
|
-
const id = (typeof reader === 'number') ? reader : reader
|
243
|
+
const id = (typeof reader === 'number') ? reader : reader?.id;
|
243
244
|
if (id && (id >= 0))
|
244
245
|
this.removeInterceptor('response', id);
|
245
246
|
}
|
package/lib/cjs/common.js
CHANGED
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isResourceType = exports.isResourceId = void 0;
|
4
4
|
const api_1 = require("./api");
|
5
5
|
const isResourceId = (resource) => {
|
6
|
-
return (
|
6
|
+
return (resource?.type && resource.id) && api_1.resourceList.includes(resource.type);
|
7
7
|
};
|
8
8
|
exports.isResourceId = isResourceId;
|
9
9
|
const isResourceType = (resource) => {
|
package/lib/cjs/error.js
CHANGED
@@ -36,8 +36,7 @@ class ApiError extends SdkError {
|
|
36
36
|
this.name = ApiError.NAME; // this.constructor.name
|
37
37
|
}
|
38
38
|
first() {
|
39
|
-
|
40
|
-
return (((_a = this.errors) === null || _a === void 0 ? void 0 : _a.length) > 0) ? this.errors[0] : undefined;
|
39
|
+
return (this.errors?.length > 0) ? this.errors[0] : undefined;
|
41
40
|
}
|
42
41
|
}
|
43
42
|
exports.ApiError = ApiError;
|
package/lib/cjs/model.d.ts
CHANGED
@@ -88,6 +88,7 @@ export type { Promotion } from './resources/promotions';
|
|
88
88
|
export type { RecurringOrderCopy, RecurringOrderCopyCreate, RecurringOrderCopyUpdate } from './resources/recurring_order_copies';
|
89
89
|
export type { Refund } from './resources/refunds';
|
90
90
|
export type { ReservedStock } from './resources/reserved_stocks';
|
91
|
+
export type { ResourceError } from './resources/resource_errors';
|
91
92
|
export type { ReturnLineItem, ReturnLineItemCreate, ReturnLineItemUpdate } from './resources/return_line_items';
|
92
93
|
export type { Return, ReturnCreate, ReturnUpdate } from './resources/returns';
|
93
94
|
export type { SatispayGateway, SatispayGatewayCreate, SatispayGatewayUpdate } from './resources/satispay_gateways';
|
package/lib/cjs/query.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { ResourceType } from "./resource";
|
2
|
-
type QueryFilter = Record<string, string | number | boolean>;
|
2
|
+
type QueryFilter = Record<string, string | number | boolean | object>;
|
3
3
|
interface QueryParamsRetrieve {
|
4
4
|
include?: string[];
|
5
5
|
fields?: string[] | Record<string, string[]>;
|
package/lib/cjs/query.js
CHANGED
@@ -42,7 +42,7 @@ const generateQueryStringParams = (params, res) => {
|
|
42
42
|
// Filters
|
43
43
|
if (params.filters) {
|
44
44
|
Object.entries(params.filters).forEach(([p, v]) => {
|
45
|
-
qp[`filter[q][${p}]`] = String(v);
|
45
|
+
qp[`filter[q][${p}]`] = (typeof v === 'object') ? JSON.stringify(v) : String(v);
|
46
46
|
});
|
47
47
|
}
|
48
48
|
}
|
package/lib/cjs/resource.js
CHANGED
@@ -65,8 +65,8 @@ class ResourceAdapter {
|
|
65
65
|
async singleton(resource, params, options) {
|
66
66
|
debug('singleton: %o, %O, %O', resource, params || {}, options || {});
|
67
67
|
const queryParams = (0, query_1.generateQueryStringParams)(params, resource);
|
68
|
-
if (options
|
69
|
-
Object.assign(queryParams, options
|
68
|
+
if (options?.params)
|
69
|
+
Object.assign(queryParams, options?.params);
|
70
70
|
const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('get', `${resource.type}`, undefined, { ...options, params: queryParams });
|
71
71
|
const r = (0, jsonapi_1.denormalize)(res);
|
72
72
|
return r;
|
@@ -74,33 +74,32 @@ class ResourceAdapter {
|
|
74
74
|
async retrieve(resource, params, options) {
|
75
75
|
debug('retrieve: %o, %O, %O', resource, params || {}, options || {});
|
76
76
|
const queryParams = (0, query_1.generateQueryStringParams)(params, resource);
|
77
|
-
if (options
|
78
|
-
Object.assign(queryParams, options
|
77
|
+
if (options?.params)
|
78
|
+
Object.assign(queryParams, options?.params);
|
79
79
|
const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('get', `${resource.type}/${resource.id}`, undefined, { ...options, params: queryParams });
|
80
80
|
const r = (0, jsonapi_1.denormalize)(res);
|
81
81
|
return r;
|
82
82
|
}
|
83
83
|
async list(resource, params, options) {
|
84
|
-
var _a, _b;
|
85
84
|
debug('list: %o, %O, %O', resource, params || {}, options || {});
|
86
85
|
const queryParams = (0, query_1.generateQueryStringParams)(params, resource);
|
87
|
-
if (options
|
88
|
-
Object.assign(queryParams, options
|
86
|
+
if (options?.params)
|
87
|
+
Object.assign(queryParams, options?.params);
|
89
88
|
const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('get', `${resource.type}`, undefined, { ...options, params: queryParams });
|
90
89
|
const r = (0, jsonapi_1.denormalize)(res);
|
91
90
|
const meta = {
|
92
|
-
pageCount: Number(
|
93
|
-
recordCount: Number(
|
94
|
-
currentPage:
|
95
|
-
recordsPerPage:
|
91
|
+
pageCount: Number(res.meta?.page_count),
|
92
|
+
recordCount: Number(res.meta?.record_count),
|
93
|
+
currentPage: params?.pageNumber || config_1.default.default.pageNumber,
|
94
|
+
recordsPerPage: params?.pageSize || config_1.default.default.pageSize
|
96
95
|
};
|
97
96
|
return new ListResponse(meta, r);
|
98
97
|
}
|
99
98
|
async create(resource, params, options) {
|
100
99
|
debug('create: %o, %O, %O', resource, params || {}, options || {});
|
101
100
|
const queryParams = (0, query_1.generateQueryStringParams)(params, resource);
|
102
|
-
if (options
|
103
|
-
Object.assign(queryParams, options
|
101
|
+
if (options?.params)
|
102
|
+
Object.assign(queryParams, options?.params);
|
104
103
|
const data = (0, jsonapi_1.normalize)(resource);
|
105
104
|
const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('post', resource.type, data, { ...options, params: queryParams });
|
106
105
|
const r = (0, jsonapi_1.denormalize)(res);
|
@@ -109,8 +108,8 @@ class ResourceAdapter {
|
|
109
108
|
async update(resource, params, options) {
|
110
109
|
debug('update: %o, %O, %O', resource, params || {}, options || {});
|
111
110
|
const queryParams = (0, query_1.generateQueryStringParams)(params, resource);
|
112
|
-
if (options
|
113
|
-
Object.assign(queryParams, options
|
111
|
+
if (options?.params)
|
112
|
+
Object.assign(queryParams, options?.params);
|
114
113
|
const data = (0, jsonapi_1.normalize)(resource);
|
115
114
|
const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('patch', `${resource.type}/${resource.id}`, data, { ...options, params: queryParams });
|
116
115
|
const r = (0, jsonapi_1.denormalize)(res);
|
@@ -121,20 +120,19 @@ class ResourceAdapter {
|
|
121
120
|
await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('delete', `${resource.type}/${resource.id}`, undefined, options);
|
122
121
|
}
|
123
122
|
async fetch(resource, path, params, options) {
|
124
|
-
var _a, _b;
|
125
123
|
debug('fetch: %o, %O, %O', path, params || {}, options || {});
|
126
124
|
const queryParams = (0, query_1.generateQueryStringParams)(params, resource);
|
127
|
-
if (options
|
128
|
-
Object.assign(queryParams, options
|
125
|
+
if (options?.params)
|
126
|
+
Object.assign(queryParams, options?.params);
|
129
127
|
const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('get', path, undefined, { ...options, params: queryParams });
|
130
128
|
const r = (0, jsonapi_1.denormalize)(res);
|
131
129
|
if (Array.isArray(r)) {
|
132
130
|
const p = params;
|
133
131
|
const meta = {
|
134
|
-
pageCount: Number(
|
135
|
-
recordCount: Number(
|
136
|
-
currentPage:
|
137
|
-
recordsPerPage:
|
132
|
+
pageCount: Number(res.meta?.page_count),
|
133
|
+
recordCount: Number(res.meta?.record_count),
|
134
|
+
currentPage: p?.pageNumber || config_1.default.default.pageNumber,
|
135
|
+
recordsPerPage: p?.pageSize || config_1.default.default.pageSize
|
138
136
|
};
|
139
137
|
return new ListResponse(meta, r);
|
140
138
|
}
|
@@ -149,11 +147,10 @@ class ApiResourceBase {
|
|
149
147
|
this.resources = adapter;
|
150
148
|
}
|
151
149
|
parse(resource) {
|
152
|
-
var _a, _b;
|
153
150
|
try {
|
154
151
|
const res = JSON.parse(resource);
|
155
|
-
if (
|
156
|
-
throw new error_1.SdkError({ message: `Invalid resource type [${
|
152
|
+
if (res.data?.type !== this.type())
|
153
|
+
throw new error_1.SdkError({ message: `Invalid resource type [${res.data?.type}]`, type: error_1.ErrorType.PARSE });
|
157
154
|
return (0, jsonapi_1.denormalize)(res);
|
158
155
|
}
|
159
156
|
catch (error) {
|
@@ -13,17 +13,20 @@ interface Adjustment extends Resource {
|
|
13
13
|
amount_cents: number;
|
14
14
|
amount_float: number;
|
15
15
|
formatted_amount: string;
|
16
|
+
distribute_discount?: boolean | null;
|
16
17
|
versions?: Version[] | null;
|
17
18
|
}
|
18
19
|
interface AdjustmentCreate extends ResourceCreate {
|
19
20
|
name: string;
|
20
21
|
currency_code: string;
|
21
22
|
amount_cents: number;
|
23
|
+
distribute_discount?: boolean | null;
|
22
24
|
}
|
23
25
|
interface AdjustmentUpdate extends ResourceUpdate {
|
24
26
|
name?: string | null;
|
25
27
|
currency_code?: string | null;
|
26
28
|
amount_cents?: number | null;
|
29
|
+
distribute_discount?: boolean | null;
|
27
30
|
}
|
28
31
|
declare class Adjustments extends ApiResource<Adjustment> {
|
29
32
|
static readonly TYPE: AdjustmentType;
|
@@ -28,7 +28,7 @@ interface AdyenGatewayCreate extends ResourceCreate {
|
|
28
28
|
api_key: string;
|
29
29
|
public_key?: string | null;
|
30
30
|
live_url_prefix: string;
|
31
|
-
api_version?:
|
31
|
+
api_version?: number | null;
|
32
32
|
async_api?: boolean | null;
|
33
33
|
webhook_endpoint_secret?: string | null;
|
34
34
|
adyen_payments?: AdyenPaymentRel[] | null;
|
@@ -39,7 +39,7 @@ interface AdyenGatewayUpdate extends ResourceUpdate {
|
|
39
39
|
api_key?: string | null;
|
40
40
|
public_key?: string | null;
|
41
41
|
live_url_prefix?: string | null;
|
42
|
-
api_version?:
|
42
|
+
api_version?: number | null;
|
43
43
|
async_api?: boolean | null;
|
44
44
|
webhook_endpoint_secret?: string | null;
|
45
45
|
adyen_payments?: AdyenPaymentRel[] | null;
|
@@ -17,8 +17,8 @@ interface AvalaraAccount extends Resource {
|
|
17
17
|
name: string;
|
18
18
|
username: string;
|
19
19
|
company_code: string;
|
20
|
-
commit_invoice?:
|
21
|
-
ddp?:
|
20
|
+
commit_invoice?: boolean | null;
|
21
|
+
ddp?: boolean | null;
|
22
22
|
markets?: Market[] | null;
|
23
23
|
attachments?: Attachment[] | null;
|
24
24
|
versions?: Version[] | null;
|
@@ -29,8 +29,8 @@ interface AvalaraAccountCreate extends ResourceCreate {
|
|
29
29
|
username: string;
|
30
30
|
password: string;
|
31
31
|
company_code: string;
|
32
|
-
commit_invoice?:
|
33
|
-
ddp?:
|
32
|
+
commit_invoice?: boolean | null;
|
33
|
+
ddp?: boolean | null;
|
34
34
|
tax_categories?: TaxCategoryRel[] | null;
|
35
35
|
}
|
36
36
|
interface AvalaraAccountUpdate extends ResourceUpdate {
|
@@ -38,8 +38,8 @@ interface AvalaraAccountUpdate extends ResourceUpdate {
|
|
38
38
|
username?: string | null;
|
39
39
|
password?: string | null;
|
40
40
|
company_code?: string | null;
|
41
|
-
commit_invoice?:
|
42
|
-
ddp?:
|
41
|
+
commit_invoice?: boolean | null;
|
42
|
+
ddp?: boolean | null;
|
43
43
|
tax_categories?: TaxCategoryRel[] | null;
|
44
44
|
}
|
45
45
|
declare class AvalaraAccounts extends ApiResource<AvalaraAccount> {
|
@@ -2,12 +2,13 @@ import { ApiResource } from '../resource';
|
|
2
2
|
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
3
3
|
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
4
4
|
import type { Market, MarketType } from './markets';
|
5
|
-
import type { PromotionRule
|
5
|
+
import type { PromotionRule } from './promotion_rules';
|
6
6
|
import type { OrderAmountPromotionRule, OrderAmountPromotionRuleType } from './order_amount_promotion_rules';
|
7
7
|
import type { SkuListPromotionRule, SkuListPromotionRuleType } from './sku_list_promotion_rules';
|
8
8
|
import type { CouponCodesPromotionRule, CouponCodesPromotionRuleType } from './coupon_codes_promotion_rules';
|
9
|
-
import type {
|
9
|
+
import type { CustomPromotionRule, CustomPromotionRuleType } from './custom_promotion_rules';
|
10
10
|
import type { SkuList, SkuListType } from './sku_lists';
|
11
|
+
import type { Coupon } from './coupons';
|
11
12
|
import type { Attachment } from './attachments';
|
12
13
|
import type { Event } from './events';
|
13
14
|
import type { Tag, TagType } from './tags';
|
@@ -20,9 +21,6 @@ type BuyXPayYPromotionRel = ResourceRel & {
|
|
20
21
|
type MarketRel = ResourceRel & {
|
21
22
|
type: MarketType;
|
22
23
|
};
|
23
|
-
type PromotionRuleRel = ResourceRel & {
|
24
|
-
type: PromotionRuleType;
|
25
|
-
};
|
26
24
|
type OrderAmountPromotionRuleRel = ResourceRel & {
|
27
25
|
type: OrderAmountPromotionRuleType;
|
28
26
|
};
|
@@ -32,8 +30,8 @@ type SkuListPromotionRuleRel = ResourceRel & {
|
|
32
30
|
type CouponCodesPromotionRuleRel = ResourceRel & {
|
33
31
|
type: CouponCodesPromotionRuleType;
|
34
32
|
};
|
35
|
-
type
|
36
|
-
type:
|
33
|
+
type CustomPromotionRuleRel = ResourceRel & {
|
34
|
+
type: CustomPromotionRuleType;
|
37
35
|
};
|
38
36
|
type SkuListRel = ResourceRel & {
|
39
37
|
type: SkuListType;
|
@@ -61,8 +59,9 @@ interface BuyXPayYPromotion extends Resource {
|
|
61
59
|
order_amount_promotion_rule?: OrderAmountPromotionRule | null;
|
62
60
|
sku_list_promotion_rule?: SkuListPromotionRule | null;
|
63
61
|
coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
|
64
|
-
|
62
|
+
custom_promotion_rule?: CustomPromotionRule | null;
|
65
63
|
sku_list?: SkuList | null;
|
64
|
+
coupons?: Coupon[] | null;
|
66
65
|
attachments?: Attachment[] | null;
|
67
66
|
events?: Event[] | null;
|
68
67
|
tags?: Tag[] | null;
|
@@ -83,11 +82,10 @@ interface BuyXPayYPromotionCreate extends ResourceCreate {
|
|
83
82
|
y: number;
|
84
83
|
cheapest_free?: boolean | null;
|
85
84
|
market?: MarketRel | null;
|
86
|
-
promotion_rules?: PromotionRuleRel[] | null;
|
87
85
|
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
88
86
|
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
89
87
|
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
90
|
-
|
88
|
+
custom_promotion_rule?: CustomPromotionRuleRel | null;
|
91
89
|
sku_list: SkuListRel;
|
92
90
|
tags?: TagRel[] | null;
|
93
91
|
}
|
@@ -105,11 +103,10 @@ interface BuyXPayYPromotionUpdate extends ResourceUpdate {
|
|
105
103
|
y?: number | null;
|
106
104
|
cheapest_free?: boolean | null;
|
107
105
|
market?: MarketRel | null;
|
108
|
-
promotion_rules?: PromotionRuleRel[] | null;
|
109
106
|
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
110
107
|
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
111
108
|
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
112
|
-
|
109
|
+
custom_promotion_rule?: CustomPromotionRuleRel | null;
|
113
110
|
sku_list?: SkuListRel | null;
|
114
111
|
tags?: TagRel[] | null;
|
115
112
|
}
|
@@ -122,8 +119,9 @@ declare class BuyXPayYPromotions extends ApiResource<BuyXPayYPromotion> {
|
|
122
119
|
order_amount_promotion_rule(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
123
120
|
sku_list_promotion_rule(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
124
121
|
coupon_codes_promotion_rule(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
125
|
-
|
122
|
+
custom_promotion_rule(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
|
126
123
|
sku_list(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
124
|
+
coupons(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
|
127
125
|
attachments(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
128
126
|
events(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
129
127
|
tags(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
@@ -27,14 +27,18 @@ class BuyXPayYPromotions extends resource_1.ApiResource {
|
|
27
27
|
const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
|
28
28
|
return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/coupon_codes_promotion_rule`, params, options);
|
29
29
|
}
|
30
|
-
async
|
30
|
+
async custom_promotion_rule(buyXPayYPromotionId, params, options) {
|
31
31
|
const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
|
32
|
-
return this.resources.fetch({ type: '
|
32
|
+
return this.resources.fetch({ type: 'custom_promotion_rules' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/custom_promotion_rule`, params, options);
|
33
33
|
}
|
34
34
|
async sku_list(buyXPayYPromotionId, params, options) {
|
35
35
|
const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
|
36
36
|
return this.resources.fetch({ type: 'sku_lists' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/sku_list`, params, options);
|
37
37
|
}
|
38
|
+
async coupons(buyXPayYPromotionId, params, options) {
|
39
|
+
const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
|
40
|
+
return this.resources.fetch({ type: 'coupons' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/coupons`, params, options);
|
41
|
+
}
|
38
42
|
async attachments(buyXPayYPromotionId, params, options) {
|
39
43
|
const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
|
40
44
|
return this.resources.fetch({ type: 'attachments' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/attachments`, params, options);
|
@@ -11,12 +11,14 @@ type ExternalGatewayRel = ResourceRel & {
|
|
11
11
|
interface ExternalGateway extends Resource {
|
12
12
|
readonly type: ExternalGatewayType;
|
13
13
|
name: string;
|
14
|
-
shared_secret: string;
|
15
14
|
authorize_url?: string | null;
|
16
15
|
capture_url?: string | null;
|
17
16
|
void_url?: string | null;
|
18
17
|
refund_url?: string | null;
|
19
18
|
token_url?: string | null;
|
19
|
+
circuit_state?: string | null;
|
20
|
+
circuit_failure_count?: number | null;
|
21
|
+
shared_secret: string;
|
20
22
|
payment_methods?: PaymentMethod[] | null;
|
21
23
|
versions?: Version[] | null;
|
22
24
|
external_payments?: ExternalPayment[] | null;
|
@@ -36,6 +38,7 @@ interface ExternalGatewayUpdate extends ResourceUpdate {
|
|
36
38
|
void_url?: string | null;
|
37
39
|
refund_url?: string | null;
|
38
40
|
token_url?: string | null;
|
41
|
+
_reset_circuit?: boolean | null;
|
39
42
|
}
|
40
43
|
declare class ExternalGateways extends ApiResource<ExternalGateway> {
|
41
44
|
static readonly TYPE: ExternalGatewayType;
|
@@ -45,6 +48,7 @@ declare class ExternalGateways extends ApiResource<ExternalGateway> {
|
|
45
48
|
payment_methods(externalGatewayId: string | ExternalGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>>;
|
46
49
|
versions(externalGatewayId: string | ExternalGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
47
50
|
external_payments(externalGatewayId: string | ExternalGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ExternalPayment>>;
|
51
|
+
_reset_circuit(id: string | ExternalGateway, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ExternalGateway>;
|
48
52
|
isExternalGateway(resource: any): resource is ExternalGateway;
|
49
53
|
relationship(id: string | ResourceId | null): ExternalGatewayRel;
|
50
54
|
type(): ExternalGatewayType;
|
@@ -23,6 +23,9 @@ class ExternalGateways extends resource_1.ApiResource {
|
|
23
23
|
const _externalGatewayId = externalGatewayId.id || externalGatewayId;
|
24
24
|
return this.resources.fetch({ type: 'external_payments' }, `external_gateways/${_externalGatewayId}/external_payments`, params, options);
|
25
25
|
}
|
26
|
+
async _reset_circuit(id, params, options) {
|
27
|
+
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: ExternalGateways.TYPE, _reset_circuit: true }, params, options);
|
28
|
+
}
|
26
29
|
isExternalGateway(resource) {
|
27
30
|
return resource.type && (resource.type === ExternalGateways.TYPE);
|
28
31
|
}
|