@commercelayer/sdk 3.7.1 → 3.9.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.
Files changed (86) hide show
  1. package/lib/cjs/api.d.ts +8 -3
  2. package/lib/cjs/api.js +1 -1
  3. package/lib/cjs/commercelayer.d.ts +5 -0
  4. package/lib/cjs/commercelayer.js +1 -1
  5. package/lib/cjs/error.js +1 -1
  6. package/lib/cjs/interceptor.d.ts +19 -1
  7. package/lib/cjs/model.d.ts +6 -1
  8. package/lib/cjs/resource.js +1 -1
  9. package/lib/cjs/resources/application.d.ts +1 -1
  10. package/lib/cjs/resources/avalara_accounts.d.ts +3 -0
  11. package/lib/cjs/resources/bundles.d.ts +6 -0
  12. package/lib/cjs/resources/customer_addresses.d.ts +2 -0
  13. package/lib/cjs/resources/customer_password_resets.d.ts +2 -0
  14. package/lib/cjs/resources/customer_subscriptions.d.ts +2 -0
  15. package/lib/cjs/resources/customers.d.ts +2 -0
  16. package/lib/cjs/resources/events.d.ts +22 -0
  17. package/lib/cjs/resources/events.js +1 -0
  18. package/lib/cjs/resources/gift_cards.d.ts +2 -0
  19. package/lib/cjs/resources/imports.d.ts +2 -0
  20. package/lib/cjs/resources/in_stock_subscriptions.d.ts +2 -0
  21. package/lib/cjs/resources/inventory_models.d.ts +1 -1
  22. package/lib/cjs/resources/order_copies.d.ts +2 -0
  23. package/lib/cjs/resources/order_subscriptions.d.ts +2 -0
  24. package/lib/cjs/resources/orders.d.ts +8 -0
  25. package/lib/cjs/resources/parcels.d.ts +4 -2
  26. package/lib/cjs/resources/payment_methods.d.ts +2 -0
  27. package/lib/cjs/resources/price_tiers.d.ts +26 -0
  28. package/lib/cjs/resources/price_tiers.js +1 -0
  29. package/lib/cjs/resources/price_volume_tiers.d.ts +44 -0
  30. package/lib/cjs/resources/price_volume_tiers.js +1 -0
  31. package/lib/cjs/resources/prices.d.ts +9 -0
  32. package/lib/cjs/resources/refunds.d.ts +2 -0
  33. package/lib/cjs/resources/returns.d.ts +2 -0
  34. package/lib/cjs/resources/shipments.d.ts +3 -0
  35. package/lib/cjs/resources/shipping_method_tiers.d.ts +26 -0
  36. package/lib/cjs/resources/shipping_method_tiers.js +1 -0
  37. package/lib/cjs/resources/shipping_methods.d.ts +32 -2
  38. package/lib/cjs/resources/shipping_weight_tiers.d.ts +44 -0
  39. package/lib/cjs/resources/shipping_weight_tiers.js +1 -0
  40. package/lib/cjs/resources/stock_transfers.d.ts +2 -0
  41. package/lib/cjs/util.d.ts +3 -0
  42. package/lib/esm/api.d.ts +8 -3
  43. package/lib/esm/api.js +1 -1
  44. package/lib/esm/commercelayer.d.ts +5 -0
  45. package/lib/esm/commercelayer.js +1 -1
  46. package/lib/esm/debug.js +1 -1
  47. package/lib/esm/error.js +1 -1
  48. package/lib/esm/interceptor.d.ts +19 -1
  49. package/lib/esm/model.d.ts +6 -1
  50. package/lib/esm/resource.js +1 -1
  51. package/lib/esm/resources/application.d.ts +1 -1
  52. package/lib/esm/resources/avalara_accounts.d.ts +3 -0
  53. package/lib/esm/resources/bundles.d.ts +6 -0
  54. package/lib/esm/resources/customer_addresses.d.ts +2 -0
  55. package/lib/esm/resources/customer_password_resets.d.ts +2 -0
  56. package/lib/esm/resources/customer_subscriptions.d.ts +2 -0
  57. package/lib/esm/resources/customers.d.ts +2 -0
  58. package/lib/esm/resources/events.d.ts +22 -0
  59. package/lib/esm/resources/events.js +1 -0
  60. package/lib/esm/resources/gift_cards.d.ts +2 -0
  61. package/lib/esm/resources/imports.d.ts +2 -0
  62. package/lib/esm/resources/in_stock_subscriptions.d.ts +2 -0
  63. package/lib/esm/resources/inventory_models.d.ts +1 -1
  64. package/lib/esm/resources/order_copies.d.ts +2 -0
  65. package/lib/esm/resources/order_subscriptions.d.ts +2 -0
  66. package/lib/esm/resources/orders.d.ts +8 -0
  67. package/lib/esm/resources/parcels.d.ts +4 -2
  68. package/lib/esm/resources/payment_methods.d.ts +2 -0
  69. package/lib/esm/resources/price_tiers.d.ts +26 -0
  70. package/lib/esm/resources/price_tiers.js +1 -0
  71. package/lib/esm/resources/price_volume_tiers.d.ts +44 -0
  72. package/lib/esm/resources/price_volume_tiers.js +1 -0
  73. package/lib/esm/resources/prices.d.ts +9 -0
  74. package/lib/esm/resources/refunds.d.ts +2 -0
  75. package/lib/esm/resources/returns.d.ts +2 -0
  76. package/lib/esm/resources/shipments.d.ts +3 -0
  77. package/lib/esm/resources/shipping_method_tiers.d.ts +26 -0
  78. package/lib/esm/resources/shipping_method_tiers.js +1 -0
  79. package/lib/esm/resources/shipping_methods.d.ts +32 -2
  80. package/lib/esm/resources/shipping_weight_tiers.d.ts +44 -0
  81. package/lib/esm/resources/shipping_weight_tiers.js +1 -0
  82. package/lib/esm/resources/stock_transfers.d.ts +2 -0
  83. package/lib/esm/util.d.ts +3 -0
  84. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  85. package/lib/tsconfig.tsbuildinfo +1 -1
  86. package/package.json +1 -1
@@ -1 +1 @@
1
- var c=this&&this.__classPrivateFieldSet||function(o,i,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof i=="function"?o!==i||!a:!i.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(o,n):a?a.value=n:i.set(o,n),n},s=this&&this.__classPrivateFieldGet||function(o,i,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof i=="function"?o!==i||!r:!i.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(o):r?r.value:i.get(o)},t,h;import*as e from"./api";import{CommerceLayerStatic as w}from"./static";import f from"./resource";const p="2.9.2";class u{constructor(i){t.set(this,void 0),h.set(this,void 0),c(this,t,new f(i),"f"),c(this,h,i.organization,"f"),this.addresses=new e.Addresses(s(this,t,"f")),this.adjustments=new e.Adjustments(s(this,t,"f")),this.adyen_gateways=new e.AdyenGateways(s(this,t,"f")),this.adyen_payments=new e.AdyenPayments(s(this,t,"f")),this.application=new e.Applications(s(this,t,"f")),this.attachments=new e.Attachments(s(this,t,"f")),this.authorizations=new e.Authorizations(s(this,t,"f")),this.avalara_accounts=new e.AvalaraAccounts(s(this,t,"f")),this.billing_info_validation_rules=new e.BillingInfoValidationRules(s(this,t,"f")),this.bing_geocoders=new e.BingGeocoders(s(this,t,"f")),this.braintree_gateways=new e.BraintreeGateways(s(this,t,"f")),this.braintree_payments=new e.BraintreePayments(s(this,t,"f")),this.bundles=new e.Bundles(s(this,t,"f")),this.captures=new e.Captures(s(this,t,"f")),this.carrier_accounts=new e.CarrierAccounts(s(this,t,"f")),this.checkout_com_gateways=new e.CheckoutComGateways(s(this,t,"f")),this.checkout_com_payments=new e.CheckoutComPayments(s(this,t,"f")),this.coupon_codes_promotion_rules=new e.CouponCodesPromotionRules(s(this,t,"f")),this.coupon_recipients=new e.CouponRecipients(s(this,t,"f")),this.coupons=new e.Coupons(s(this,t,"f")),this.customer_addresses=new e.CustomerAddresses(s(this,t,"f")),this.customer_groups=new e.CustomerGroups(s(this,t,"f")),this.customer_password_resets=new e.CustomerPasswordResets(s(this,t,"f")),this.customer_payment_sources=new e.CustomerPaymentSources(s(this,t,"f")),this.customer_subscriptions=new e.CustomerSubscriptions(s(this,t,"f")),this.customers=new e.Customers(s(this,t,"f")),this.delivery_lead_times=new e.DeliveryLeadTimes(s(this,t,"f")),this.event_callbacks=new e.EventCallbacks(s(this,t,"f")),this.external_gateways=new e.ExternalGateways(s(this,t,"f")),this.external_payments=new e.ExternalPayments(s(this,t,"f")),this.external_promotions=new e.ExternalPromotions(s(this,t,"f")),this.external_tax_calculators=new e.ExternalTaxCalculators(s(this,t,"f")),this.fixed_amount_promotions=new e.FixedAmountPromotions(s(this,t,"f")),this.fixed_price_promotions=new e.FixedPricePromotions(s(this,t,"f")),this.free_gift_promotions=new e.FreeGiftPromotions(s(this,t,"f")),this.free_shipping_promotions=new e.FreeShippingPromotions(s(this,t,"f")),this.geocoders=new e.Geocoders(s(this,t,"f")),this.gift_card_recipients=new e.GiftCardRecipients(s(this,t,"f")),this.gift_cards=new e.GiftCards(s(this,t,"f")),this.google_geocoders=new e.GoogleGeocoders(s(this,t,"f")),this.imports=new e.Imports(s(this,t,"f")),this.in_stock_subscriptions=new e.InStockSubscriptions(s(this,t,"f")),this.inventory_models=new e.InventoryModels(s(this,t,"f")),this.inventory_return_locations=new e.InventoryReturnLocations(s(this,t,"f")),this.inventory_stock_locations=new e.InventoryStockLocations(s(this,t,"f")),this.klarna_gateways=new e.KlarnaGateways(s(this,t,"f")),this.klarna_payments=new e.KlarnaPayments(s(this,t,"f")),this.line_item_options=new e.LineItemOptions(s(this,t,"f")),this.line_items=new e.LineItems(s(this,t,"f")),this.manual_gateways=new e.ManualGateways(s(this,t,"f")),this.manual_tax_calculators=new e.ManualTaxCalculators(s(this,t,"f")),this.markets=new e.Markets(s(this,t,"f")),this.merchants=new e.Merchants(s(this,t,"f")),this.order_amount_promotion_rules=new e.OrderAmountPromotionRules(s(this,t,"f")),this.order_copies=new e.OrderCopies(s(this,t,"f")),this.order_subscriptions=new e.OrderSubscriptions(s(this,t,"f")),this.order_validation_rules=new e.OrderValidationRules(s(this,t,"f")),this.orders=new e.Orders(s(this,t,"f")),this.organization=new e.Organizations(s(this,t,"f")),this.packages=new e.Packages(s(this,t,"f")),this.parcel_line_items=new e.ParcelLineItems(s(this,t,"f")),this.parcels=new e.Parcels(s(this,t,"f")),this.payment_gateways=new e.PaymentGateways(s(this,t,"f")),this.payment_methods=new e.PaymentMethods(s(this,t,"f")),this.paypal_gateways=new e.PaypalGateways(s(this,t,"f")),this.paypal_payments=new e.PaypalPayments(s(this,t,"f")),this.percentage_discount_promotions=new e.PercentageDiscountPromotions(s(this,t,"f")),this.price_lists=new e.PriceLists(s(this,t,"f")),this.prices=new e.Prices(s(this,t,"f")),this.promotion_rules=new e.PromotionRules(s(this,t,"f")),this.promotions=new e.Promotions(s(this,t,"f")),this.refunds=new e.Refunds(s(this,t,"f")),this.return_line_items=new e.ReturnLineItems(s(this,t,"f")),this.returns=new e.Returns(s(this,t,"f")),this.shipments=new e.Shipments(s(this,t,"f")),this.shipping_categories=new e.ShippingCategories(s(this,t,"f")),this.shipping_methods=new e.ShippingMethods(s(this,t,"f")),this.shipping_zones=new e.ShippingZones(s(this,t,"f")),this.sku_list_items=new e.SkuListItems(s(this,t,"f")),this.sku_list_promotion_rules=new e.SkuListPromotionRules(s(this,t,"f")),this.sku_lists=new e.SkuLists(s(this,t,"f")),this.sku_options=new e.SkuOptions(s(this,t,"f")),this.skus=new e.Skus(s(this,t,"f")),this.stock_items=new e.StockItems(s(this,t,"f")),this.stock_line_items=new e.StockLineItems(s(this,t,"f")),this.stock_locations=new e.StockLocations(s(this,t,"f")),this.stock_transfers=new e.StockTransfers(s(this,t,"f")),this.stripe_gateways=new e.StripeGateways(s(this,t,"f")),this.stripe_payments=new e.StripePayments(s(this,t,"f")),this.tax_calculators=new e.TaxCalculators(s(this,t,"f")),this.tax_categories=new e.TaxCategories(s(this,t,"f")),this.tax_rules=new e.TaxRules(s(this,t,"f")),this.taxjar_accounts=new e.TaxjarAccounts(s(this,t,"f")),this.transactions=new e.Transactions(s(this,t,"f")),this.voids=new e.Voids(s(this,t,"f")),this.webhooks=new e.Webhooks(s(this,t,"f")),this.wire_transfers=new e.WireTransfers(s(this,t,"f"))}static get openApiSchemaVersion(){return p}get currentOrganization(){return s(this,h,"f")}config(i){i.organization&&c(this,h,i.organization,"f"),s(this,t,"f").config(i)}resources(){return w.resources()}isApiError(i){return w.isApiError(i)}addRequestInterceptor(i,n){return s(this,t,"f").interceptors.request.use(i,n)}addResponseInterceptor(i,n){return s(this,t,"f").interceptors.response.use(i,n)}removeInterceptor(i,n){return s(this,t,"f").interceptors[i].eject(n)}addRawResponseReader(){const i={id:void 0,rawResponse:void 0};function n(a){return i.rawResponse=a?.data,a}const r=this.addResponseInterceptor(n);return i.id=r,i}removeRawResponseReader(i){const n=typeof i=="number"?i:i.id;if(n)return this.removeInterceptor("response",n)}}t=new WeakMap,h=new WeakMap;const m=o=>new u(o);export default m;
1
+ var c=this&&this.__classPrivateFieldSet||function(r,i,n,o,a){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof i=="function"?r!==i||!a:!i.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?a.call(r,n):a?a.value=n:i.set(r,n),n},s=this&&this.__classPrivateFieldGet||function(r,i,n,o){if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof i=="function"?r!==i||!o:!i.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?o:n==="a"?o.call(r):o?o.value:i.get(r)},t,h;import*as e from"./api";import{CommerceLayerStatic as w}from"./static";import f from"./resource";const p="2.9.6";class u{constructor(i){t.set(this,void 0),h.set(this,void 0),c(this,t,new f(i),"f"),c(this,h,i.organization,"f"),this.addresses=new e.Addresses(s(this,t,"f")),this.adjustments=new e.Adjustments(s(this,t,"f")),this.adyen_gateways=new e.AdyenGateways(s(this,t,"f")),this.adyen_payments=new e.AdyenPayments(s(this,t,"f")),this.application=new e.Applications(s(this,t,"f")),this.attachments=new e.Attachments(s(this,t,"f")),this.authorizations=new e.Authorizations(s(this,t,"f")),this.avalara_accounts=new e.AvalaraAccounts(s(this,t,"f")),this.billing_info_validation_rules=new e.BillingInfoValidationRules(s(this,t,"f")),this.bing_geocoders=new e.BingGeocoders(s(this,t,"f")),this.braintree_gateways=new e.BraintreeGateways(s(this,t,"f")),this.braintree_payments=new e.BraintreePayments(s(this,t,"f")),this.bundles=new e.Bundles(s(this,t,"f")),this.captures=new e.Captures(s(this,t,"f")),this.carrier_accounts=new e.CarrierAccounts(s(this,t,"f")),this.checkout_com_gateways=new e.CheckoutComGateways(s(this,t,"f")),this.checkout_com_payments=new e.CheckoutComPayments(s(this,t,"f")),this.coupon_codes_promotion_rules=new e.CouponCodesPromotionRules(s(this,t,"f")),this.coupon_recipients=new e.CouponRecipients(s(this,t,"f")),this.coupons=new e.Coupons(s(this,t,"f")),this.customer_addresses=new e.CustomerAddresses(s(this,t,"f")),this.customer_groups=new e.CustomerGroups(s(this,t,"f")),this.customer_password_resets=new e.CustomerPasswordResets(s(this,t,"f")),this.customer_payment_sources=new e.CustomerPaymentSources(s(this,t,"f")),this.customer_subscriptions=new e.CustomerSubscriptions(s(this,t,"f")),this.customers=new e.Customers(s(this,t,"f")),this.delivery_lead_times=new e.DeliveryLeadTimes(s(this,t,"f")),this.event_callbacks=new e.EventCallbacks(s(this,t,"f")),this.events=new e.Events(s(this,t,"f")),this.external_gateways=new e.ExternalGateways(s(this,t,"f")),this.external_payments=new e.ExternalPayments(s(this,t,"f")),this.external_promotions=new e.ExternalPromotions(s(this,t,"f")),this.external_tax_calculators=new e.ExternalTaxCalculators(s(this,t,"f")),this.fixed_amount_promotions=new e.FixedAmountPromotions(s(this,t,"f")),this.fixed_price_promotions=new e.FixedPricePromotions(s(this,t,"f")),this.free_gift_promotions=new e.FreeGiftPromotions(s(this,t,"f")),this.free_shipping_promotions=new e.FreeShippingPromotions(s(this,t,"f")),this.geocoders=new e.Geocoders(s(this,t,"f")),this.gift_card_recipients=new e.GiftCardRecipients(s(this,t,"f")),this.gift_cards=new e.GiftCards(s(this,t,"f")),this.google_geocoders=new e.GoogleGeocoders(s(this,t,"f")),this.imports=new e.Imports(s(this,t,"f")),this.in_stock_subscriptions=new e.InStockSubscriptions(s(this,t,"f")),this.inventory_models=new e.InventoryModels(s(this,t,"f")),this.inventory_return_locations=new e.InventoryReturnLocations(s(this,t,"f")),this.inventory_stock_locations=new e.InventoryStockLocations(s(this,t,"f")),this.klarna_gateways=new e.KlarnaGateways(s(this,t,"f")),this.klarna_payments=new e.KlarnaPayments(s(this,t,"f")),this.line_item_options=new e.LineItemOptions(s(this,t,"f")),this.line_items=new e.LineItems(s(this,t,"f")),this.manual_gateways=new e.ManualGateways(s(this,t,"f")),this.manual_tax_calculators=new e.ManualTaxCalculators(s(this,t,"f")),this.markets=new e.Markets(s(this,t,"f")),this.merchants=new e.Merchants(s(this,t,"f")),this.order_amount_promotion_rules=new e.OrderAmountPromotionRules(s(this,t,"f")),this.order_copies=new e.OrderCopies(s(this,t,"f")),this.order_subscriptions=new e.OrderSubscriptions(s(this,t,"f")),this.order_validation_rules=new e.OrderValidationRules(s(this,t,"f")),this.orders=new e.Orders(s(this,t,"f")),this.organization=new e.Organizations(s(this,t,"f")),this.packages=new e.Packages(s(this,t,"f")),this.parcel_line_items=new e.ParcelLineItems(s(this,t,"f")),this.parcels=new e.Parcels(s(this,t,"f")),this.payment_gateways=new e.PaymentGateways(s(this,t,"f")),this.payment_methods=new e.PaymentMethods(s(this,t,"f")),this.paypal_gateways=new e.PaypalGateways(s(this,t,"f")),this.paypal_payments=new e.PaypalPayments(s(this,t,"f")),this.percentage_discount_promotions=new e.PercentageDiscountPromotions(s(this,t,"f")),this.price_lists=new e.PriceLists(s(this,t,"f")),this.price_tiers=new e.PriceTiers(s(this,t,"f")),this.price_volume_tiers=new e.PriceVolumeTiers(s(this,t,"f")),this.prices=new e.Prices(s(this,t,"f")),this.promotion_rules=new e.PromotionRules(s(this,t,"f")),this.promotions=new e.Promotions(s(this,t,"f")),this.refunds=new e.Refunds(s(this,t,"f")),this.return_line_items=new e.ReturnLineItems(s(this,t,"f")),this.returns=new e.Returns(s(this,t,"f")),this.shipments=new e.Shipments(s(this,t,"f")),this.shipping_categories=new e.ShippingCategories(s(this,t,"f")),this.shipping_method_tiers=new e.ShippingMethodTiers(s(this,t,"f")),this.shipping_methods=new e.ShippingMethods(s(this,t,"f")),this.shipping_weight_tiers=new e.ShippingWeightTiers(s(this,t,"f")),this.shipping_zones=new e.ShippingZones(s(this,t,"f")),this.sku_list_items=new e.SkuListItems(s(this,t,"f")),this.sku_list_promotion_rules=new e.SkuListPromotionRules(s(this,t,"f")),this.sku_lists=new e.SkuLists(s(this,t,"f")),this.sku_options=new e.SkuOptions(s(this,t,"f")),this.skus=new e.Skus(s(this,t,"f")),this.stock_items=new e.StockItems(s(this,t,"f")),this.stock_line_items=new e.StockLineItems(s(this,t,"f")),this.stock_locations=new e.StockLocations(s(this,t,"f")),this.stock_transfers=new e.StockTransfers(s(this,t,"f")),this.stripe_gateways=new e.StripeGateways(s(this,t,"f")),this.stripe_payments=new e.StripePayments(s(this,t,"f")),this.tax_calculators=new e.TaxCalculators(s(this,t,"f")),this.tax_categories=new e.TaxCategories(s(this,t,"f")),this.tax_rules=new e.TaxRules(s(this,t,"f")),this.taxjar_accounts=new e.TaxjarAccounts(s(this,t,"f")),this.transactions=new e.Transactions(s(this,t,"f")),this.voids=new e.Voids(s(this,t,"f")),this.webhooks=new e.Webhooks(s(this,t,"f")),this.wire_transfers=new e.WireTransfers(s(this,t,"f"))}static get openApiSchemaVersion(){return p}get currentOrganization(){return s(this,h,"f")}config(i){i.organization&&c(this,h,i.organization,"f"),s(this,t,"f").config(i)}resources(){return w.resources()}isApiError(i){return w.isApiError(i)}addRequestInterceptor(i,n){return s(this,t,"f").interceptors.request.use(i,n)}addResponseInterceptor(i,n){return s(this,t,"f").interceptors.response.use(i,n)}removeInterceptor(i,n){return s(this,t,"f").interceptors[i].eject(n)}addRawResponseReader(){const i={id:void 0,rawResponse:void 0};function n(a){return i.rawResponse=a?.data,a}const o=this.addResponseInterceptor(n);return i.id=o,i}removeRawResponseReader(i){const n=typeof i=="number"?i:i.id;if(n)return this.removeInterceptor("response",n)}}t=new WeakMap,h=new WeakMap;const m=r=>new u(r);export default m;
package/lib/esm/debug.js CHANGED
@@ -1 +1 @@
1
- const e=(t,...r)=>{};let c=t=>e;try{const t=require("debug");t&&typeof t=="function"&&(c=t)}catch{}const o="clsdk",n=t=>c(`${o}:${t}`);export default n;
1
+ const c=(t,...r)=>{};let e=t=>c;try{const t=require("debug");t&&typeof t=="function"&&(e=t)}catch{}const n="clsdk",o=t=>e(`${n}:${t}`);export default o;
package/lib/esm/error.js CHANGED
@@ -1 +1 @@
1
- var s;(function(e){e.CLIENT="client",e.REQUEST="request",e.RESPONSE="response",e.GENERIC="generic",e.CANCEL="cancel"})(s||(s={}));class t extends Error{constructor(r){super(r.message);this.name=this.constructor.name,this.type=r.type||s.GENERIC}static isSdkError(r){return r&&["SdkError","ApiError"].includes(r.name)&&Object.values(s).includes(r.type)}}class i extends t{constructor(r){super(Object.assign(Object.assign({},r),{type:s.RESPONSE}));this.errors=[],this.name=this.constructor.name}static isApiError(r){return t.isSdkError(r)&&r.name==="ApiError"&&r.type===s.RESPONSE}first(){var r;return((r=this.errors)===null||r===void 0?void 0:r.length)>0?this.errors[0]:void 0}}export{t as SdkError,i as ApiError,s as ErrorType};
1
+ var s;(function(e){e.CLIENT="client",e.REQUEST="request",e.RESPONSE="response",e.GENERIC="generic",e.CANCEL="cancel"})(s||(s={}));class t extends Error{constructor(r){super(r.message),this.name=this.constructor.name,this.type=r.type||s.GENERIC}static isSdkError(r){return r&&["SdkError","ApiError"].includes(r.name)&&Object.values(s).includes(r.type)}}class i extends t{constructor(r){super(Object.assign(Object.assign({},r),{type:s.RESPONSE})),this.errors=[],this.name=this.constructor.name}static isApiError(r){return t.isSdkError(r)&&r.name==="ApiError"&&r.type===s.RESPONSE}first(){var r;return((r=this.errors)===null||r===void 0?void 0:r.length)>0?this.errors[0]:void 0}}export{t as SdkError,i as ApiError,s as ErrorType};
@@ -1 +1,19 @@
1
- import{AxiosError,AxiosInterceptorManager,AxiosRequestConfig,AxiosResponse}from"axios";declare type InterceptorManager={request:AxiosInterceptorManager<AxiosRequestConfig>;response:AxiosInterceptorManager<any>;};declare type RequestObj=AxiosRequestConfig;declare type RequestInterceptor=(request:RequestObj)=>RequestObj|Promise<RequestObj>;declare type ResponseObj=AxiosResponse;declare type ResponseInterceptor=(response:ResponseObj)=>ResponseObj;declare type ErrorObj=AxiosError;declare type ErrorInterceptor=(error:ErrorObj)=>ErrorObj;declare type InterceptorType='request'|'response';export type{InterceptorManager,RequestInterceptor,ResponseInterceptor,ErrorInterceptor,InterceptorType};export type{RequestObj,ResponseObj,ErrorObj};declare type RawResponseReader={id:number|undefined;rawResponse:ResponseObj|undefined;};export type{RawResponseReader};
1
+ import { AxiosError, AxiosInterceptorManager, AxiosRequestConfig, AxiosResponse } from "axios";
2
+ declare type InterceptorManager = {
3
+ request: AxiosInterceptorManager<AxiosRequestConfig>;
4
+ response: AxiosInterceptorManager<any>;
5
+ };
6
+ declare type RequestObj = AxiosRequestConfig;
7
+ declare type RequestInterceptor = (request: RequestObj) => RequestObj | Promise<RequestObj>;
8
+ declare type ResponseObj = AxiosResponse;
9
+ declare type ResponseInterceptor = (response: ResponseObj) => ResponseObj;
10
+ declare type ErrorObj = AxiosError;
11
+ declare type ErrorInterceptor = (error: ErrorObj) => ErrorObj;
12
+ declare type InterceptorType = 'request' | 'response';
13
+ export type { InterceptorManager, RequestInterceptor, ResponseInterceptor, ErrorInterceptor, InterceptorType };
14
+ export type { RequestObj, ResponseObj, ErrorObj };
15
+ declare type RawResponseReader = {
16
+ id: number | undefined;
17
+ rawResponse: ResponseObj | undefined;
18
+ };
19
+ export type { RawResponseReader };
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * ©2022 Commerce Layer Inc.
3
- * OpenAPI schema, version 2.9.2
3
+ * OpenAPI schema, version 2.9.6
4
4
  **/
5
5
  export type { Address, AddressCreate, AddressUpdate } from './resources/addresses';
6
6
  export type { Adjustment, AdjustmentCreate, AdjustmentUpdate } from './resources/adjustments';
@@ -30,6 +30,7 @@ export type { CustomerSubscription, CustomerSubscriptionCreate, CustomerSubscrip
30
30
  export type { Customer, CustomerCreate, CustomerUpdate } from './resources/customers';
31
31
  export type { DeliveryLeadTime, DeliveryLeadTimeCreate, DeliveryLeadTimeUpdate } from './resources/delivery_lead_times';
32
32
  export type { EventCallback } from './resources/event_callbacks';
33
+ export type { Event } from './resources/events';
33
34
  export type { ExternalGateway, ExternalGatewayCreate, ExternalGatewayUpdate } from './resources/external_gateways';
34
35
  export type { ExternalPayment, ExternalPaymentCreate, ExternalPaymentUpdate } from './resources/external_payments';
35
36
  export type { ExternalPromotion, ExternalPromotionCreate, ExternalPromotionUpdate } from './resources/external_promotions';
@@ -70,6 +71,8 @@ export type { PaypalGateway, PaypalGatewayCreate, PaypalGatewayUpdate } from './
70
71
  export type { PaypalPayment, PaypalPaymentCreate, PaypalPaymentUpdate } from './resources/paypal_payments';
71
72
  export type { PercentageDiscountPromotion, PercentageDiscountPromotionCreate, PercentageDiscountPromotionUpdate } from './resources/percentage_discount_promotions';
72
73
  export type { PriceList, PriceListCreate, PriceListUpdate } from './resources/price_lists';
74
+ export type { PriceTier } from './resources/price_tiers';
75
+ export type { PriceVolumeTier, PriceVolumeTierCreate, PriceVolumeTierUpdate } from './resources/price_volume_tiers';
73
76
  export type { Price, PriceCreate, PriceUpdate } from './resources/prices';
74
77
  export type { PromotionRule } from './resources/promotion_rules';
75
78
  export type { Promotion } from './resources/promotions';
@@ -78,7 +81,9 @@ export type { ReturnLineItem, ReturnLineItemCreate, ReturnLineItemUpdate } from
78
81
  export type { Return, ReturnCreate, ReturnUpdate } from './resources/returns';
79
82
  export type { Shipment, ShipmentUpdate } from './resources/shipments';
80
83
  export type { ShippingCategory, ShippingCategoryCreate, ShippingCategoryUpdate } from './resources/shipping_categories';
84
+ export type { ShippingMethodTier } from './resources/shipping_method_tiers';
81
85
  export type { ShippingMethod, ShippingMethodCreate, ShippingMethodUpdate } from './resources/shipping_methods';
86
+ export type { ShippingWeightTier, ShippingWeightTierCreate, ShippingWeightTierUpdate } from './resources/shipping_weight_tiers';
82
87
  export type { ShippingZone, ShippingZoneCreate, ShippingZoneUpdate } from './resources/shipping_zones';
83
88
  export type { SkuListItem, SkuListItemCreate, SkuListItemUpdate } from './resources/sku_list_items';
84
89
  export type { SkuListPromotionRule, SkuListPromotionRuleCreate, SkuListPromotionRuleUpdate } from './resources/sku_list_promotion_rules';
@@ -1 +1 @@
1
- var w=this&&this.__classPrivateFieldSet||function(s,t,a,e,r){if(e==="m")throw new TypeError("Private method is not writable");if(e==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?s!==t||!r:!t.has(s))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e==="a"?r.call(s,a):r?r.value=a:t.set(s,a),a},d=this&&this.__classPrivateFieldGet||function(s,t,a,e){if(a==="a"&&!e)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?s!==t||!e:!t.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return a==="m"?e:a==="a"?e.call(s):e?e.value:t.get(s)},n,h;import y from"./client";import{denormalize as u,normalize as g}from"./jsonapi";import{generateQueryStringParams as o}from"./query";import m from"./config";class b extends Array{constructor(t,a){super(...a||[]);this.meta=t}first(){return this.length?this[0]:void 0}last(){return this.length?this[this.length-1]:void 0}get(t){return this.length&&t>=0?this[t]:void 0}}class p{constructor(t){n.set(this,void 0),h.set(this,{}),w(this,n,y.create(t),"f"),this.config(t)}get interceptors(){return d(this,n,"f").interceptors}config(t){d(this,n,"f").config(t)}async singleton(t,a,e){const r=o(a,t);e?.params&&Object.assign(r,e?.params);const i=await d(this,n,"f").request("get",`${t.type}`,void 0,Object.assign(Object.assign({},e),{params:r}));return u(i)}async retrieve(t,a,e){const r=o(a,t);e?.params&&Object.assign(r,e?.params);const i=await d(this,n,"f").request("get",`${t.type}/${t.id}`,void 0,Object.assign(Object.assign({},e),{params:r}));return u(i)}async list(t,a,e){var r,i;const c=o(a,t);e?.params&&Object.assign(c,e?.params);const l=await d(this,n,"f").request("get",`${t.type}`,void 0,Object.assign(Object.assign({},e),{params:c})),f=u(l),v={pageCount:Number((r=l.meta)===null||r===void 0?void 0:r.page_count),recordCount:Number((i=l.meta)===null||i===void 0?void 0:i.record_count),currentPage:a?.pageNumber||m.default.pageNumber,recordsPerPage:a?.pageSize||m.default.pageSize};return new b(v,f)}async create(t,a,e){const r=o(a,t);e?.params&&Object.assign(r,e?.params);const i=g(t),c=await d(this,n,"f").request("post",t.type,i,Object.assign(Object.assign({},e),{params:r}));return u(c)}async update(t,a,e){const r=o(a,t);e?.params&&Object.assign(r,e?.params);const i=g(t),c=await d(this,n,"f").request("patch",`${t.type}/${t.id}`,i,Object.assign(Object.assign({},e),{params:r}));return u(c)}async delete(t,a){await d(this,n,"f").request("delete",`${t.type}/${t.id}`,void 0,a)}}n=new WeakMap,h=new WeakMap;class j{constructor(t){this.resources=t}}export default p;export{j as ApiResource};
1
+ var w=this&&this.__classPrivateFieldSet||function(s,t,a,e,r){if(e==="m")throw new TypeError("Private method is not writable");if(e==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?s!==t||!r:!t.has(s))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e==="a"?r.call(s,a):r?r.value=a:t.set(s,a),a},d=this&&this.__classPrivateFieldGet||function(s,t,a,e){if(a==="a"&&!e)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?s!==t||!e:!t.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return a==="m"?e:a==="a"?e.call(s):e?e.value:t.get(s)},n,h;import y from"./client";import{denormalize as u,normalize as g}from"./jsonapi";import{generateQueryStringParams as o}from"./query";import m from"./config";class b extends Array{constructor(t,a){super(...a||[]),this.meta=t}first(){return this.length?this[0]:void 0}last(){return this.length?this[this.length-1]:void 0}get(t){return this.length&&t>=0?this[t]:void 0}}class p{constructor(t){n.set(this,void 0),h.set(this,{}),w(this,n,y.create(t),"f"),this.config(t)}get interceptors(){return d(this,n,"f").interceptors}config(t){d(this,n,"f").config(t)}async singleton(t,a,e){const r=o(a,t);e?.params&&Object.assign(r,e?.params);const i=await d(this,n,"f").request("get",`${t.type}`,void 0,Object.assign(Object.assign({},e),{params:r}));return u(i)}async retrieve(t,a,e){const r=o(a,t);e?.params&&Object.assign(r,e?.params);const i=await d(this,n,"f").request("get",`${t.type}/${t.id}`,void 0,Object.assign(Object.assign({},e),{params:r}));return u(i)}async list(t,a,e){var r,i;const c=o(a,t);e?.params&&Object.assign(c,e?.params);const l=await d(this,n,"f").request("get",`${t.type}`,void 0,Object.assign(Object.assign({},e),{params:c})),f=u(l),v={pageCount:Number((r=l.meta)===null||r===void 0?void 0:r.page_count),recordCount:Number((i=l.meta)===null||i===void 0?void 0:i.record_count),currentPage:a?.pageNumber||m.default.pageNumber,recordsPerPage:a?.pageSize||m.default.pageSize};return new b(v,f)}async create(t,a,e){const r=o(a,t);e?.params&&Object.assign(r,e?.params);const i=g(t),c=await d(this,n,"f").request("post",t.type,i,Object.assign(Object.assign({},e),{params:r}));return u(c)}async update(t,a,e){const r=o(a,t);e?.params&&Object.assign(r,e?.params);const i=g(t),c=await d(this,n,"f").request("patch",`${t.type}/${t.id}`,i,Object.assign(Object.assign({},e),{params:r}));return u(c)}async delete(t,a){await d(this,n,"f").request("delete",`${t.type}/${t.id}`,void 0,a)}}n=new WeakMap,h=new WeakMap;class j{constructor(t){this.resources=t}}export default p;export{j as ApiResource};
@@ -6,7 +6,7 @@ declare type ApplicationRel = ResourceRel & {
6
6
  interface Application extends Resource {
7
7
  name?: string;
8
8
  kind?: string;
9
- public_access?: string;
9
+ public_access?: boolean;
10
10
  redirect_uri?: string;
11
11
  scopes?: string;
12
12
  }
@@ -13,6 +13,7 @@ interface AvalaraAccount extends Resource {
13
13
  name?: string;
14
14
  username?: string;
15
15
  company_code?: string;
16
+ commit_invoice?: string;
16
17
  ddp?: string;
17
18
  tax_categories?: TaxCategory[];
18
19
  markets?: Market[];
@@ -23,6 +24,7 @@ interface AvalaraAccountCreate extends ResourceCreate {
23
24
  username: string;
24
25
  password: string;
25
26
  company_code: string;
27
+ commit_invoice?: string;
26
28
  ddp?: string;
27
29
  tax_categories?: TaxCategoryRel[];
28
30
  }
@@ -31,6 +33,7 @@ interface AvalaraAccountUpdate extends ResourceUpdate {
31
33
  username?: string;
32
34
  password?: string;
33
35
  company_code?: string;
36
+ commit_invoice?: string;
34
37
  ddp?: string;
35
38
  tax_categories?: TaxCategoryRel[];
36
39
  }
@@ -19,6 +19,8 @@ interface Bundle extends Resource {
19
19
  currency_code?: string;
20
20
  description?: string;
21
21
  image_url?: string;
22
+ do_not_ship?: boolean;
23
+ do_not_track?: boolean;
22
24
  price_amount_cents?: number;
23
25
  price_amount_float?: number;
24
26
  formatted_price_amount?: string;
@@ -37,6 +39,8 @@ interface BundleCreate extends ResourceCreate {
37
39
  currency_code?: string;
38
40
  description?: string;
39
41
  image_url?: string;
42
+ do_not_ship?: boolean;
43
+ do_not_track?: boolean;
40
44
  price_amount_cents: number;
41
45
  compare_at_amount_cents: number;
42
46
  _compute_price_amount?: boolean;
@@ -50,6 +54,8 @@ interface BundleUpdate extends ResourceUpdate {
50
54
  currency_code?: string;
51
55
  description?: string;
52
56
  image_url?: string;
57
+ do_not_ship?: boolean;
58
+ do_not_track?: boolean;
53
59
  price_amount_cents?: number;
54
60
  compare_at_amount_cents?: number;
55
61
  _compute_price_amount?: boolean;
@@ -2,6 +2,7 @@ import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig,
2
2
  import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
3
  import { Customer } from './customers';
4
4
  import { Address } from './addresses';
5
+ import { Event } from './events';
5
6
  declare type CustomerAddressRel = ResourceRel & {
6
7
  type: typeof CustomerAddresses.TYPE;
7
8
  };
@@ -15,6 +16,7 @@ interface CustomerAddress extends Resource {
15
16
  name?: string;
16
17
  customer?: Customer;
17
18
  address?: Address;
19
+ events?: Event[];
18
20
  }
19
21
  interface CustomerAddressCreate extends ResourceCreate {
20
22
  customer: CustomerRel;
@@ -1,6 +1,7 @@
1
1
  import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
2
  import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
3
  import { Customer } from './customers';
4
+ import { Event } from './events';
4
5
  declare type CustomerPasswordResetRel = ResourceRel & {
5
6
  type: typeof CustomerPasswordResets.TYPE;
6
7
  };
@@ -9,6 +10,7 @@ interface CustomerPasswordReset extends Resource {
9
10
  reset_password_token?: string;
10
11
  reset_password_at?: string;
11
12
  customer?: Customer;
13
+ events?: Event[];
12
14
  }
13
15
  interface CustomerPasswordResetCreate extends ResourceCreate {
14
16
  customer_email: string;
@@ -1,12 +1,14 @@
1
1
  import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
2
  import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
3
  import { Customer } from './customers';
4
+ import { Event } from './events';
4
5
  declare type CustomerSubscriptionRel = ResourceRel & {
5
6
  type: typeof CustomerSubscriptions.TYPE;
6
7
  };
7
8
  interface CustomerSubscription extends Resource {
8
9
  customer_email?: string;
9
10
  customer?: Customer;
11
+ events?: Event[];
10
12
  }
11
13
  interface CustomerSubscriptionCreate extends ResourceCreate {
12
14
  customer_email: string;
@@ -8,6 +8,7 @@ import { Order } from './orders';
8
8
  import { OrderSubscription } from './order_subscriptions';
9
9
  import { Return } from './returns';
10
10
  import { Attachment } from './attachments';
11
+ import { Event } from './events';
11
12
  declare type CustomerRel = ResourceRel & {
12
13
  type: typeof Customers.TYPE;
13
14
  };
@@ -26,6 +27,7 @@ interface Customer extends Resource {
26
27
  order_subscriptions?: OrderSubscription[];
27
28
  returns?: Return[];
28
29
  attachments?: Attachment[];
30
+ events?: Event[];
29
31
  }
30
32
  interface CustomerCreate extends ResourceCreate {
31
33
  email: string;
@@ -0,0 +1,22 @@
1
+ import { ApiResource, Resource, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
+ import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
+ import { EventCallback } from './event_callbacks';
4
+ import { Webhook } from './webhooks';
5
+ declare type EventRel = ResourceRel & {
6
+ type: typeof Events.TYPE;
7
+ };
8
+ interface Event extends Resource {
9
+ name?: string;
10
+ last_event_callbacks?: EventCallback[];
11
+ webhooks?: Webhook[];
12
+ }
13
+ declare class Events extends ApiResource {
14
+ static readonly TYPE: 'events';
15
+ list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
16
+ retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Event>;
17
+ isEvent(resource: any): resource is Event;
18
+ relationship(id: string | ResourceId | null): EventRel;
19
+ type(): string;
20
+ }
21
+ export default Events;
22
+ export { Event };
@@ -0,0 +1 @@
1
+ import{ApiResource as s}from"../resource";class r extends s{async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async retrieve(e,t,p){return this.resources.retrieve({type:r.TYPE,id:e},t,p)}isEvent(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="events";export default r;
@@ -3,6 +3,7 @@ import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
3
  import { Market } from './markets';
4
4
  import { GiftCardRecipient } from './gift_card_recipients';
5
5
  import { Attachment } from './attachments';
6
+ import { Event } from './events';
6
7
  declare type GiftCardRel = ResourceRel & {
7
8
  type: typeof GiftCards.TYPE;
8
9
  };
@@ -34,6 +35,7 @@ interface GiftCard extends Resource {
34
35
  market?: Market;
35
36
  gift_card_recipient?: GiftCardRecipient;
36
37
  attachments?: Attachment[];
38
+ events?: Event[];
37
39
  }
38
40
  interface GiftCardCreate extends ResourceCreate {
39
41
  code?: string;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource, Resource, ResourceCreate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
2
  import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
+ import { Event } from './events';
3
4
  declare type ImportRel = ResourceRel & {
4
5
  type: typeof Imports.TYPE;
5
6
  };
@@ -19,6 +20,7 @@ interface Import extends Resource {
19
20
  errors_log?: object;
20
21
  warnings_log?: object;
21
22
  cleanup_records?: boolean;
23
+ events?: Event[];
22
24
  }
23
25
  interface ImportCreate extends ResourceCreate {
24
26
  resource_type: string;
@@ -3,6 +3,7 @@ import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
3
  import { Market } from './markets';
4
4
  import { Customer } from './customers';
5
5
  import { Sku } from './skus';
6
+ import { Event } from './events';
6
7
  declare type InStockSubscriptionRel = ResourceRel & {
7
8
  type: typeof InStockSubscriptions.TYPE;
8
9
  };
@@ -23,6 +24,7 @@ interface InStockSubscription extends Resource {
23
24
  market?: Market;
24
25
  customer?: Customer;
25
26
  sku?: Sku;
27
+ events?: Event[];
26
28
  }
27
29
  interface InStockSubscriptionCreate extends ResourceCreate {
28
30
  customer_email?: string;
@@ -16,7 +16,7 @@ interface InventoryModel extends Resource {
16
16
  }
17
17
  interface InventoryModelCreate extends ResourceCreate {
18
18
  name: string;
19
- strategy: string;
19
+ strategy?: string;
20
20
  stock_locations_cutoff?: number;
21
21
  }
22
22
  interface InventoryModelUpdate extends ResourceUpdate {
@@ -2,6 +2,7 @@ import { ApiResource, Resource, ResourceCreate, ResourcesConfig, ResourceId, Res
2
2
  import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
3
  import { Order } from './orders';
4
4
  import { OrderSubscription } from './order_subscriptions';
5
+ import { Event } from './events';
5
6
  declare type OrderCopyRel = ResourceRel & {
6
7
  type: typeof OrderCopies.TYPE;
7
8
  };
@@ -21,6 +22,7 @@ interface OrderCopy extends Resource {
21
22
  source_order?: Order;
22
23
  target_order?: Order;
23
24
  order_subscription?: OrderSubscription;
25
+ events?: Event[];
24
26
  }
25
27
  interface OrderCopyCreate extends ResourceCreate {
26
28
  place_target_order?: boolean;
@@ -4,6 +4,7 @@ import { Market } from './markets';
4
4
  import { Order } from './orders';
5
5
  import { Customer } from './customers';
6
6
  import { OrderCopy } from './order_copies';
7
+ import { Event } from './events';
7
8
  declare type OrderSubscriptionRel = ResourceRel & {
8
9
  type: typeof OrderSubscriptions.TYPE;
9
10
  };
@@ -31,6 +32,7 @@ interface OrderSubscription extends Resource {
31
32
  customer?: Customer;
32
33
  order_copies?: OrderCopy[];
33
34
  orders?: Order[];
35
+ events?: Event[];
34
36
  }
35
37
  interface OrderSubscriptionCreate extends ResourceCreate {
36
38
  frequency: string;
@@ -5,6 +5,8 @@ import { Customer } from './customers';
5
5
  import { Address } from './addresses';
6
6
  import { PaymentMethod } from './payment_methods';
7
7
  import { CustomerPaymentSource } from './customer_payment_sources';
8
+ import { Sku } from './skus';
9
+ import { Bundle } from './bundles';
8
10
  import { AdyenPayment } from './adyen_payments';
9
11
  import { BraintreePayment } from './braintree_payments';
10
12
  import { CheckoutComPayment } from './checkout_com_payments';
@@ -22,6 +24,7 @@ import { Refund } from './refunds';
22
24
  import { OrderSubscription } from './order_subscriptions';
23
25
  import { OrderCopy } from './order_copies';
24
26
  import { Attachment } from './attachments';
27
+ import { Event } from './events';
25
28
  declare type OrderRel = ResourceRel & {
26
29
  type: typeof Orders.TYPE;
27
30
  };
@@ -165,6 +168,8 @@ interface Order extends Resource {
165
168
  billing_address?: Address;
166
169
  available_payment_methods?: PaymentMethod[];
167
170
  available_customer_payment_sources?: CustomerPaymentSource[];
171
+ available_free_skus?: Sku[];
172
+ available_free_bundles?: Bundle[];
168
173
  payment_method?: PaymentMethod;
169
174
  payment_source?: AdyenPayment | BraintreePayment | CheckoutComPayment | ExternalPayment | KlarnaPayment | PaypalPayment | StripePayment | WireTransfer;
170
175
  line_items?: LineItem[];
@@ -177,6 +182,7 @@ interface Order extends Resource {
177
182
  order_subscriptions?: OrderSubscription[];
178
183
  order_copies?: OrderCopy[];
179
184
  attachments?: Attachment[];
185
+ events?: Event[];
180
186
  }
181
187
  interface OrderCreate extends ResourceCreate {
182
188
  autorefresh?: boolean;
@@ -230,6 +236,8 @@ interface OrderUpdate extends ResourceUpdate {
230
236
  _customer_payment_source_id?: string;
231
237
  _shipping_address_same_as_billing?: boolean;
232
238
  _billing_address_same_as_shipping?: boolean;
239
+ _commit_invoice?: boolean;
240
+ _refund_invoice?: boolean;
233
241
  _save_payment_source_to_customer_wallet?: boolean;
234
242
  _save_shipping_address_to_customer_address_book?: boolean;
235
243
  _save_billing_address_to_customer_address_book?: boolean;
@@ -4,6 +4,7 @@ import { Shipment } from './shipments';
4
4
  import { Package } from './packages';
5
5
  import { ParcelLineItem } from './parcel_line_items';
6
6
  import { Attachment } from './attachments';
7
+ import { Event } from './events';
7
8
  declare type ParcelRel = ResourceRel & {
8
9
  type: typeof Parcels.TYPE;
9
10
  };
@@ -42,10 +43,11 @@ interface Parcel extends Resource {
42
43
  package?: Package;
43
44
  parcel_line_items?: ParcelLineItem[];
44
45
  attachments?: Attachment[];
46
+ events?: Event[];
45
47
  }
46
48
  interface ParcelCreate extends ResourceCreate {
47
- weight?: number;
48
- unit_of_weight?: string;
49
+ weight: number;
50
+ unit_of_weight: string;
49
51
  eel_pfc?: string;
50
52
  contents_type?: string;
51
53
  contents_explanation?: string;
@@ -37,6 +37,8 @@ interface PaymentMethodUpdate extends ResourceUpdate {
37
37
  payment_source_type?: string;
38
38
  currency_code?: string;
39
39
  moto?: boolean;
40
+ _disable?: boolean;
41
+ _enable?: boolean;
40
42
  price_amount_cents?: number;
41
43
  market?: MarketRel;
42
44
  payment_gateway?: PaymentGatewayRel;
@@ -0,0 +1,26 @@
1
+ import { ApiResource, Resource, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
+ import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
+ import { Price } from './prices';
4
+ import { Attachment } from './attachments';
5
+ declare type PriceTierRel = ResourceRel & {
6
+ type: typeof PriceTiers.TYPE;
7
+ };
8
+ interface PriceTier extends Resource {
9
+ name?: string;
10
+ up_to?: number;
11
+ price_amount_cents?: number;
12
+ price_amount_float?: number;
13
+ formatted_price_amount?: string;
14
+ price?: Price;
15
+ attachments?: Attachment[];
16
+ }
17
+ declare class PriceTiers extends ApiResource {
18
+ static readonly TYPE: 'price_tiers';
19
+ list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PriceTier>>;
20
+ retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PriceTier>;
21
+ isPriceTier(resource: any): resource is PriceTier;
22
+ relationship(id: string | ResourceId | null): PriceTierRel;
23
+ type(): string;
24
+ }
25
+ export default PriceTiers;
26
+ export { PriceTier };
@@ -0,0 +1 @@
1
+ import{ApiResource as s}from"../resource";class e extends s{async list(t,r){return this.resources.list({type:e.TYPE},t,r)}async retrieve(t,r,p){return this.resources.retrieve({type:e.TYPE,id:t},r,p)}isPriceTier(t){return t.type&&t.type===e.TYPE}relationship(t){return t===null||typeof t=="string"?{id:t,type:e.TYPE}:{id:t.id,type:e.TYPE}}type(){return e.TYPE}}e.TYPE="price_tiers";export default e;
@@ -0,0 +1,44 @@
1
+ import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
+ import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
+ import { Price } from './prices';
4
+ import { Attachment } from './attachments';
5
+ declare type PriceVolumeTierRel = ResourceRel & {
6
+ type: typeof PriceVolumeTiers.TYPE;
7
+ };
8
+ declare type PriceRel = ResourceRel & {
9
+ type: 'prices';
10
+ };
11
+ interface PriceVolumeTier extends Resource {
12
+ name?: string;
13
+ up_to?: number;
14
+ price_amount_cents?: number;
15
+ price_amount_float?: number;
16
+ formatted_price_amount?: string;
17
+ price?: Price;
18
+ attachments?: Attachment[];
19
+ }
20
+ interface PriceVolumeTierCreate extends ResourceCreate {
21
+ name: string;
22
+ up_to?: number;
23
+ price_amount_cents: number;
24
+ price: PriceRel;
25
+ }
26
+ interface PriceVolumeTierUpdate extends ResourceUpdate {
27
+ name?: string;
28
+ up_to?: number;
29
+ price_amount_cents?: number;
30
+ price?: PriceRel;
31
+ }
32
+ declare class PriceVolumeTiers extends ApiResource {
33
+ static readonly TYPE: 'price_volume_tiers';
34
+ list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PriceVolumeTier>>;
35
+ create(resource: PriceVolumeTierCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PriceVolumeTier>;
36
+ retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PriceVolumeTier>;
37
+ update(resource: PriceVolumeTierUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PriceVolumeTier>;
38
+ delete(id: string, options?: ResourcesConfig): Promise<void>;
39
+ isPriceVolumeTier(resource: any): resource is PriceVolumeTier;
40
+ relationship(id: string | ResourceId | null): PriceVolumeTierRel;
41
+ type(): string;
42
+ }
43
+ export default PriceVolumeTiers;
44
+ export { PriceVolumeTier, PriceVolumeTierCreate, PriceVolumeTierUpdate };
@@ -0,0 +1 @@
1
+ import{ApiResource as n}from"../resource";class e extends n{async list(t,s){return this.resources.list({type:e.TYPE},t,s)}async create(t,s,r){return this.resources.create(Object.assign(Object.assign({},t),{type:e.TYPE}),s,r)}async retrieve(t,s,r){return this.resources.retrieve({type:e.TYPE,id:t},s,r)}async update(t,s,r){return this.resources.update(Object.assign(Object.assign({},t),{type:e.TYPE}),s,r)}async delete(t,s){await this.resources.delete({type:e.TYPE,id:t},s)}isPriceVolumeTier(t){return t.type&&t.type===e.TYPE}relationship(t){return t===null||typeof t=="string"?{id:t,type:e.TYPE}:{id:t.id,type:e.TYPE}}type(){return e.TYPE}}e.TYPE="price_volume_tiers";export default e;
@@ -2,6 +2,8 @@ import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig,
2
2
  import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
3
  import { PriceList } from './price_lists';
4
4
  import { Sku } from './skus';
5
+ import { PriceTier } from './price_tiers';
6
+ import { PriceVolumeTier } from './price_volume_tiers';
5
7
  import { Attachment } from './attachments';
6
8
  declare type PriceRel = ResourceRel & {
7
9
  type: typeof Prices.TYPE;
@@ -12,6 +14,9 @@ declare type PriceListRel = ResourceRel & {
12
14
  declare type SkuRel = ResourceRel & {
13
15
  type: 'skus';
14
16
  };
17
+ declare type PriceTierRel = ResourceRel & {
18
+ type: 'price_tiers';
19
+ };
15
20
  interface Price extends Resource {
16
21
  currency_code?: string;
17
22
  sku_code?: string;
@@ -23,6 +28,8 @@ interface Price extends Resource {
23
28
  formatted_compare_at_amount?: string;
24
29
  price_list?: PriceList;
25
30
  sku?: Sku;
31
+ price_tiers?: PriceTier[];
32
+ price_volume_tiers?: PriceVolumeTier[];
26
33
  attachments?: Attachment[];
27
34
  }
28
35
  interface PriceCreate extends ResourceCreate {
@@ -31,6 +38,7 @@ interface PriceCreate extends ResourceCreate {
31
38
  compare_at_amount_cents: number;
32
39
  price_list: PriceListRel;
33
40
  sku?: SkuRel;
41
+ price_tiers?: PriceTierRel[];
34
42
  }
35
43
  interface PriceUpdate extends ResourceUpdate {
36
44
  sku_code?: string;
@@ -38,6 +46,7 @@ interface PriceUpdate extends ResourceUpdate {
38
46
  compare_at_amount_cents?: number;
39
47
  price_list?: PriceListRel;
40
48
  sku?: SkuRel;
49
+ price_tiers?: PriceTierRel[];
41
50
  }
42
51
  declare class Prices extends ApiResource {
43
52
  static readonly TYPE: 'prices';
@@ -2,6 +2,7 @@ import { ApiResource, Resource, ResourcesConfig, ResourceId, ResourceRel, ListRe
2
2
  import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
3
  import { Order } from './orders';
4
4
  import { Capture } from './captures';
5
+ import { Event } from './events';
5
6
  declare type RefundRel = ResourceRel & {
6
7
  type: typeof Refunds.TYPE;
7
8
  };
@@ -19,6 +20,7 @@ interface Refund extends Resource {
19
20
  gateway_transaction_id?: string;
20
21
  order?: Order;
21
22
  reference_capture?: Capture;
23
+ events?: Event[];
22
24
  }
23
25
  declare class Refunds extends ApiResource {
24
26
  static readonly TYPE: 'refunds';
@@ -6,6 +6,7 @@ import { StockLocation } from './stock_locations';
6
6
  import { Address } from './addresses';
7
7
  import { ReturnLineItem } from './return_line_items';
8
8
  import { Attachment } from './attachments';
9
+ import { Event } from './events';
9
10
  declare type ReturnRel = ResourceRel & {
10
11
  type: typeof Returns.TYPE;
11
12
  };
@@ -33,6 +34,7 @@ interface Return extends Resource {
33
34
  destination_address?: Address;
34
35
  return_line_items?: ReturnLineItem[];
35
36
  attachments?: Attachment[];
37
+ events?: Event[];
36
38
  }
37
39
  interface ReturnCreate extends ResourceCreate {
38
40
  order: OrderRel;
@@ -11,6 +11,7 @@ import { StockTransfer } from './stock_transfers';
11
11
  import { CarrierAccount } from './carrier_accounts';
12
12
  import { Parcel } from './parcels';
13
13
  import { Attachment } from './attachments';
14
+ import { Event } from './events';
14
15
  declare type ShipmentRel = ResourceRel & {
15
16
  type: typeof Shipments.TYPE;
16
17
  };
@@ -29,6 +30,7 @@ interface Shipment extends Resource {
29
30
  rates?: object[];
30
31
  purchase_error_code?: string;
31
32
  purchase_error_message?: string;
33
+ get_rates_errors?: object[];
32
34
  get_rates_started_at?: string;
33
35
  get_rates_completed_at?: string;
34
36
  purchase_started_at?: string;
@@ -51,6 +53,7 @@ interface Shipment extends Resource {
51
53
  carrier_accounts?: CarrierAccount[];
52
54
  parcels?: Parcel[];
53
55
  attachments?: Attachment[];
56
+ events?: Event[];
54
57
  }
55
58
  interface ShipmentUpdate extends ResourceUpdate {
56
59
  _on_hold?: boolean;