@shipengine/alchemy 5.1.0 → 5.1.2

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 (3) hide show
  1. package/index.js +247 -103
  2. package/index.mjs +244 -104
  3. package/package.json +1 -1
package/index.mjs CHANGED
@@ -10764,17 +10764,17 @@ var AccountBillingPlanChangeType = /* @__PURE__ */ ((AccountBillingPlanChangeTyp
10764
10764
  return AccountBillingPlanChangeType2;
10765
10765
  })(AccountBillingPlanChangeType || {});
10766
10766
 
10767
- var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
10768
- var __hasOwnProp$f = Object.prototype.hasOwnProperty;
10769
- var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
10770
- var __objRest$a = (source, exclude) => {
10767
+ var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
10768
+ var __hasOwnProp$i = Object.prototype.hasOwnProperty;
10769
+ var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
10770
+ var __objRest$d = (source, exclude) => {
10771
10771
  var target = {};
10772
10772
  for (var prop in source)
10773
- if (__hasOwnProp$f.call(source, prop) && exclude.indexOf(prop) < 0)
10773
+ if (__hasOwnProp$i.call(source, prop) && exclude.indexOf(prop) < 0)
10774
10774
  target[prop] = source[prop];
10775
- if (source != null && __getOwnPropSymbols$f)
10776
- for (var prop of __getOwnPropSymbols$f(source)) {
10777
- if (exclude.indexOf(prop) < 0 && __propIsEnum$f.call(source, prop))
10775
+ if (source != null && __getOwnPropSymbols$i)
10776
+ for (var prop of __getOwnPropSymbols$i(source)) {
10777
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$i.call(source, prop))
10778
10778
  target[prop] = source[prop];
10779
10779
  }
10780
10780
  return target;
@@ -10788,7 +10788,7 @@ class CodedError {
10788
10788
  this.message = message;
10789
10789
  }
10790
10790
  static fromObject(_a) {
10791
- var _b = _a, { message } = _b, options = __objRest$a(_b, ["message"]);
10791
+ var _b = _a, { message } = _b, options = __objRest$d(_b, ["message"]);
10792
10792
  return new CodedError(message, options);
10793
10793
  }
10794
10794
  }
@@ -10896,17 +10896,17 @@ const types = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
10896
10896
  RateCardStatus
10897
10897
  }, Symbol.toStringTag, { value: 'Module' }));
10898
10898
 
10899
- var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
10900
- var __hasOwnProp$e = Object.prototype.hasOwnProperty;
10901
- var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
10902
- var __objRest$9 = (source, exclude) => {
10899
+ var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
10900
+ var __hasOwnProp$h = Object.prototype.hasOwnProperty;
10901
+ var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
10902
+ var __objRest$c = (source, exclude) => {
10903
10903
  var target = {};
10904
10904
  for (var prop in source)
10905
- if (__hasOwnProp$e.call(source, prop) && exclude.indexOf(prop) < 0)
10905
+ if (__hasOwnProp$h.call(source, prop) && exclude.indexOf(prop) < 0)
10906
10906
  target[prop] = source[prop];
10907
- if (source != null && __getOwnPropSymbols$e)
10908
- for (var prop of __getOwnPropSymbols$e(source)) {
10909
- if (exclude.indexOf(prop) < 0 && __propIsEnum$e.call(source, prop))
10907
+ if (source != null && __getOwnPropSymbols$h)
10908
+ for (var prop of __getOwnPropSymbols$h(source)) {
10909
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$h.call(source, prop))
10910
10910
  target[prop] = source[prop];
10911
10911
  }
10912
10912
  return target;
@@ -10938,7 +10938,7 @@ class AccountSettingsAPI {
10938
10938
  * The `updateImage` method updates specific image data for a given image id.
10939
10939
  */
10940
10940
  this.updateImage = (_a) => {
10941
- var _b = _a, { labelImageId } = _b, data = __objRest$9(_b, ["labelImageId"]);
10941
+ var _b = _a, { labelImageId } = _b, data = __objRest$c(_b, ["labelImageId"]);
10942
10942
  return this.client.put(`/v1/account/settings/images/${labelImageId}`, data);
10943
10943
  };
10944
10944
  /**
@@ -13633,7 +13633,7 @@ var ipaddr = {
13633
13633
  }).call(commonjsGlobal);
13634
13634
  } (ipaddr));
13635
13635
 
13636
- var __async$C = (__this, __arguments, generator) => {
13636
+ var __async$D = (__this, __arguments, generator) => {
13637
13637
  return new Promise((resolve, reject) => {
13638
13638
  var fulfilled = (value) => {
13639
13639
  try {
@@ -13653,7 +13653,7 @@ var __async$C = (__this, __arguments, generator) => {
13653
13653
  step((generator = generator.apply(__this, __arguments)).next());
13654
13654
  });
13655
13655
  };
13656
- const getEndUserIpAddress = () => __async$C(void 0, null, function* () {
13656
+ const getEndUserIpAddress = () => __async$D(void 0, null, function* () {
13657
13657
  try {
13658
13658
  const response = yield axios.get("https://api.ipify.org/?format=json");
13659
13659
  if (response.data.ip && ipaddrExports.isValid(response.data.ip)) {
@@ -13668,35 +13668,35 @@ const getEndUserIpAddress = () => __async$C(void 0, null, function* () {
13668
13668
  var __defProp$6 = Object.defineProperty;
13669
13669
  var __defProps$3 = Object.defineProperties;
13670
13670
  var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
13671
- var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
13672
- var __hasOwnProp$d = Object.prototype.hasOwnProperty;
13673
- var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
13671
+ var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
13672
+ var __hasOwnProp$g = Object.prototype.hasOwnProperty;
13673
+ var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
13674
13674
  var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13675
13675
  var __spreadValues$6 = (a, b) => {
13676
13676
  for (var prop in b || (b = {}))
13677
- if (__hasOwnProp$d.call(b, prop))
13677
+ if (__hasOwnProp$g.call(b, prop))
13678
13678
  __defNormalProp$6(a, prop, b[prop]);
13679
- if (__getOwnPropSymbols$d)
13680
- for (var prop of __getOwnPropSymbols$d(b)) {
13681
- if (__propIsEnum$d.call(b, prop))
13679
+ if (__getOwnPropSymbols$g)
13680
+ for (var prop of __getOwnPropSymbols$g(b)) {
13681
+ if (__propIsEnum$g.call(b, prop))
13682
13682
  __defNormalProp$6(a, prop, b[prop]);
13683
13683
  }
13684
13684
  return a;
13685
13685
  };
13686
13686
  var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
13687
- var __objRest$8 = (source, exclude) => {
13687
+ var __objRest$b = (source, exclude) => {
13688
13688
  var target = {};
13689
13689
  for (var prop in source)
13690
- if (__hasOwnProp$d.call(source, prop) && exclude.indexOf(prop) < 0)
13690
+ if (__hasOwnProp$g.call(source, prop) && exclude.indexOf(prop) < 0)
13691
13691
  target[prop] = source[prop];
13692
- if (source != null && __getOwnPropSymbols$d)
13693
- for (var prop of __getOwnPropSymbols$d(source)) {
13694
- if (exclude.indexOf(prop) < 0 && __propIsEnum$d.call(source, prop))
13692
+ if (source != null && __getOwnPropSymbols$g)
13693
+ for (var prop of __getOwnPropSymbols$g(source)) {
13694
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$g.call(source, prop))
13695
13695
  target[prop] = source[prop];
13696
13696
  }
13697
13697
  return target;
13698
13698
  };
13699
- var __async$B = (__this, __arguments, generator) => {
13699
+ var __async$C = (__this, __arguments, generator) => {
13700
13700
  return new Promise((resolve, reject) => {
13701
13701
  var fulfilled = (value) => {
13702
13702
  try {
@@ -13734,8 +13734,8 @@ class CarriersAPI {
13734
13734
  /**
13735
13735
  * The `connect` method connects a carrier account to a user's ShipEngine account.
13736
13736
  */
13737
- this.connect = (_a) => __async$B(this, null, function* () {
13738
- var _b = _a, { carrierCode } = _b, connection = __objRest$8(_b, ["carrierCode"]);
13737
+ this.connect = (_a) => __async$C(this, null, function* () {
13738
+ var _b = _a, { carrierCode } = _b, connection = __objRest$b(_b, ["carrierCode"]);
13739
13739
  const endUserIpAddress = yield getEndUserIpAddress();
13740
13740
  if (!endUserIpAddress)
13741
13741
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -13818,6 +13818,29 @@ class CarriersAPI {
13818
13818
  }
13819
13819
  }
13820
13820
 
13821
+ class ConnectionsAPI {
13822
+ constructor(client) {
13823
+ this.client = client;
13824
+ /**
13825
+ * The `listCarriers` method retrieves a list of carriers available to be connected.
13826
+ */
13827
+ this.listCarriers = (params) => {
13828
+ return this.client.get("/v1/connections/carriers", { params });
13829
+ };
13830
+ /**
13831
+ * The `getCarrierConnectionForm` method retrieves a JSON Form Schema for collecting
13832
+ * information required to connect to the carrier.
13833
+ */
13834
+ this.getCarrierConnectionForm = (carrierName, params) => {
13835
+ return this.client.get(
13836
+ `/v1/connections/carriers/${carrierName}/form`,
13837
+ { params }
13838
+ );
13839
+ };
13840
+ this.client = client;
13841
+ }
13842
+ }
13843
+
13821
13844
  var o={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},l={};function a(e){return "string"==typeof e?o[e.toLowerCase()]:e}function c(e,r){return c=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e},c(e,r)}function u(){if("undefined"==typeof Reflect||!Reflect.construct)return !1;if(Reflect.construct.sham)return !1;if("function"==typeof Proxy)return !0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return !1}}function f(e,r,t){return f=u()?Reflect.construct:function(e,r,t){var s=[null];s.push.apply(s,r);var i=new(Function.bind.apply(e,s));return t&&c(i,t.prototype),i},f.apply(null,arguments)}function h(e){if(null==e)return e;if(Array.isArray(e))return e.slice();if("object"==typeof e){var r={};return Object.keys(e).forEach(function(t){r[t]=e[t];}),r}return e}function v(e){return void 0===e?"undefined":null===e?"null":Array.isArray(e)?"[ "+e.map(function(e){return v(e)}).join(", ")+" ]":"object"==typeof e?JSON.stringify(e):"function"==typeof e?"[Function: "+e.name+"]":"boolean"==typeof e||"number"==typeof e?e:"'"+e.toString()+"'"}function p(e){if("string"!=typeof e){for(var r=new Array(arguments.length),t=0;t<arguments.length;t++)r[t]=v(arguments[t]);return r.join(" ")}for(var s=/%[sdj%]/g,i=1,n=arguments,o=n.length,l=String(e).replace(s,function(e){if("%%"===e)return "%";if(i>=o)return e;switch(e){case"%s":return String(n[i++]);case"%d":return Number(n[i++]);case"%j":try{return JSON.stringify(n[i++])}catch(e){return "[Circular]"}default:return e}}),a=n[i];i<o;a=n[++i])l+=null===a||"object"!=typeof a?" "+a:" "+v(a);return l}function m(e,r){var t=e.split("\n");t[0]&&t[0].indexOf("call-stack-error")>=0&&t.shift();var s=t[r],i=null;if(s){var n=/^\s*(at|.*@)\s*(.+)?$/.exec(s);i=Array.isArray(n)&&n[2]?n[2]:s;}return i}Object.keys(o).forEach(function(e){l[o[e]]=e;});var y={};function d(e,r){if(r){if(y[r])return;y[r]=!0;}console.error(e+"\n");}function g(e){return y[e]}function w(){var e=[];return function(r,t){return t&&"object"==typeof t?-1!==e.indexOf(t)?"[Circular]":(e.push(t),t):t}}var b=/*#__PURE__*/function(){function e(){}return e.prototype.write=function(e){e.level<30?console.log(e):e.level<40?console.info(e):e.level<50?console.warn(e):console.error(e),e.err&&e.err.stack&&console.error(e.err.stack),e.obj&&console.log(e.obj);},e}(),j=/*#__PURE__*/function(){function e(r,t,s){var i,n,o,l,a=this;if(!(this instanceof e))return new e(r,t);if(void 0!==t&&(i=r,r=t,!(i instanceof e)))throw new TypeError("invalid Logger creation: do not pass a second arg");if(!r)throw new TypeError("options (object) is required");if(i){if(r.name)throw new TypeError("invalid options.name: child cannot set logger name")}else if(!r.name)throw new TypeError("options.name (string) is required");if(r.stream&&r.streams)throw new TypeError('cannot mix "streams" and "stream" options');if(r.streams&&!Array.isArray(r.streams))throw new TypeError("invalid options.streams: must be an array");if(r.serializers&&("object"!=typeof r.serializers||Array.isArray(r.serializers)))throw new TypeError("invalid options.serializers: must be an object");if(i&&s){this._level=i._level,this.streams=i.streams,this.serializers=i.serializers,this.src=i.src,n=this.fields={};var c=Object.keys(i.fields);for(l=0;l<c.length;l++)n[o=c[l]]=i.fields[o];var u=Object.keys(r);for(l=0;l<u.length;l++)n[o=u[l]]=r[o];}else {if(i){for(this._level=i._level,this.streams=[],l=0;l<i.streams.length;l++){var f=h(i.streams[l]);this.streams.push(f);}this.serializers=h(i.serializers),this.src=i.src,this.fields=h(i.fields),r.level&&this.level(r.level);}else this._level=Number.POSITIVE_INFINITY,this.streams=[],this.serializers=null,this.src=!1,this.fields={};r.stream?this.addStream({type:"stream",stream:r.stream,level:r.level}):r.streams?r.streams.forEach(function(e){a.addStream(e,r.level);}):i&&r.level?this.level(r.level):i||this.addStream({type:"raw",stream:new b,level:r.level}),r.serializers&&this.addSerializers(r.serializers),r.src&&(this.src=!0),delete(n=h(r)).stream,delete n.level,delete n.streams,delete n.serializers,delete n.src,this.serializers&&this._applySerializers(n),Object.keys(n).forEach(function(e){a.fields[e]=n[e];});}}var r=e.prototype;return r.addStream=function(e,r){void 0===r&&(r=30),(e=h(e)).type="raw",e.level=a(e.level||r),e.level<this._level&&(this._level=e.level),this.streams.push(e),delete this.haveNonRawStreams;},r.addSerializers=function(e){var r=this;this.serializers||(this.serializers={}),Object.keys(e).forEach(function(t){var s=e[t];if("function"!=typeof s)throw new TypeError(p('invalid serializer for "%s" field: must be a function',t));r.serializers[t]=s;});},r.child=function(e,r){return new this.constructor(this,e||{},r)},r.level=function(e){if(void 0===e)return this._level;for(var r=a(e),t=this.streams.length,s=0;s<t;s++)this.streams[s].level=r;this._level=r;},r.levels=function(e,r){if(void 0===e)return this.streams.map(function(e){return e.level});var t;if("number"==typeof e){if(void 0===(t=this.streams[e]))throw new Error("invalid stream index: "+e)}else {for(var s=this.streams.length,i=0;i<s;i++){var n=this.streams[i];if(n.name===e){t=n;break}}if(!t)throw new Error(p('no stream with name "%s"',e))}if(void 0===r)return t.level;var o=a(r);t.level=o,o<this._level&&(this._level=o);},r._applySerializers=function(e,r){var t=this;Object.keys(this.serializers).forEach(function(s){if(!(void 0===e[s]||r&&r[s]))try{e[s]=t.serializers[s](e[s]);}catch(r){d(p('bunyan: ERROR: Exception thrown from the "%s" Bunyan serializer. This should never happen. This is a bugin that serializer function.\n%s',s,r.stack||r)),e[s]=p('(Error in Bunyan log "%s" serializer broke field. See stderr for details.)',s);}});},r._emit=function(e,r){var t,s;if(void 0===this.haveNonRawStreams)for(this.haveNonRawStreams=!1,t=0;t<this.streams.length;t++)if(!this.streams[t].raw){this.haveNonRawStreams=!0;break}if(r||this.haveNonRawStreams)try{s=JSON.stringify(e,w())+"\n";}catch(r){var i=r.stack.split(/\n/g,2).join("\n");d('bunyan: ERROR: Exception in `JSON.stringify(rec)`. You can install the "safe-json-stringify" module to have Bunyan fallback to safer stringification. Record:\n'+function(e,r){return r||(r=" "),r+e.split(/\r?\n/g).join("\n"+r)}(p("%s\n%s",e,r.stack)),i),s=p("(Exception in JSON.stringify(rec): %j. See stderr for details.)\n",r.message);}if(r)return s;var n=e.level;for(t=0;t<this.streams.length;t++){var o=this.streams[t];o.level<=n&&o.stream.write(e);}return s},e}();function z(e){return function(){var r=this;function t(t){var n;t[0]instanceof Error?(s={err:r.serializers&&r.serializers.err?r.serializers.err(t[0]):k.err(t[0])},n={err:!0},i=1===t.length?[s.err.message]:Array.prototype.slice.call(t,1)):"object"!=typeof t[0]&&null!==t[0]||Array.isArray(t[0])?(s=null,i=Array.prototype.slice.call(t)):(s=t[0],i=1===t.length&&s.err&&s.err instanceof Error?[s.err.message]:Array.prototype.slice.call(t,1));var o=h(r.fields);o.level=e;var a=s?h(s):null;if(a&&(r.serializers&&r._applySerializers(a,n),Object.keys(a).forEach(function(e){o[e]=a[e];})),o.levelName=l[e],o.msg=i.length?p.apply(r,i):"",o.time||(o.time=new Date),r.src&&!o.src)try{throw new Error("call-stack-error")}catch(e){var c=e.stack?m(e.stack,2):"";c||g("src")||d("Unable to determine src line info","src"),o.src=c||"";}return o.v=1,o}var s=null,i=arguments,n=null;if(0===arguments.length)return this._level<=e;this._level>e||(n=t(i),this._emit(n));}}function S(e){var r=e.stack||e.toString();if(e.cause&&"function"==typeof e.cause){var t=e.cause();t&&(r+="\nCaused by: "+S(t));}return r}j.prototype.trace=z(10),j.prototype.debug=z(20),j.prototype.info=z(30),j.prototype.warn=z(40),j.prototype.error=z(50),j.prototype.fatal=z(60);var k={err:function(e){return e&&e.stack?{message:e.message,name:e.name,stack:S(e),code:e.code,signal:e.signal}:e}};function E(){return f(j,[].slice.call(arguments))}var A={levels:{trace:"color: DeepPink",debug:"color: GoldenRod",info:"color: DarkTurquoise",warn:"color: Purple",error:"color: Crimson",fatal:"color: Black"},def:"color: DimGray",msg:"color: SteelBlue",src:"color: DimGray; font-style: italic; font-size: 0.9em"},R=/*#__PURE__*/function(){function e(e){var r=void 0===e?{}:e,t=r.logByLevel,s=r.css,i=void 0===s?A:s;this.logByLevel=void 0!==t&&t,this.css=i;}return e.prototype.write=function(e){var r,t,s=this.css.def,i=this.css.msg,n=this.css.src,o=e.childName?e.name+"/"+e.childName:e.name,a=l[e.level],c=(Array(6-a.length).join(" ")+a).toUpperCase();this.logByLevel?(10===e.level?a="debug":60===e.level&&(a="error"),t="function"==typeof console[a]?console[a]:console.log):t=console.log,r=e.level<20?this.css.levels.trace:e.level<30?this.css.levels.debug:e.level<40?this.css.levels.info:e.level<50?this.css.levels.warn:e.level<60?this.css.levels.error:this.css.levels.fatal;var u=function(e,r){return Array(r+1-(e+"").length).join("0")+e},f=[];f.push("[%s:%s:%s:%s] %c%s%c: %s: %c%s "+(e.src?"%c%s":"")),f.push(u(e.time.getHours(),2)),f.push(u(e.time.getMinutes(),2)),f.push(u(e.time.getSeconds(),2)),f.push(u(e.time.getMilliseconds(),4)),f.push(r),f.push(c),f.push(s),f.push(o),f.push(i),f.push(e.msg),e.src&&(f.push(n),f.push(e.src)),e.obj&&(f.push("\n"),f.push(e.obj)),e.err&&e.err.stack&&(f.push("\n"),f.push(e.err.stack)),t.apply(console,f);},e.getDefaultCss=function(){return A},e}();
13822
13845
 
13823
13846
  var humpsExports = {};
@@ -16028,22 +16051,22 @@ class CustomPackagesAPI {
16028
16051
  }
16029
16052
 
16030
16053
  var __defProp$5 = Object.defineProperty;
16031
- var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
16032
- var __hasOwnProp$c = Object.prototype.hasOwnProperty;
16033
- var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
16054
+ var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
16055
+ var __hasOwnProp$f = Object.prototype.hasOwnProperty;
16056
+ var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
16034
16057
  var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16035
16058
  var __spreadValues$5 = (a, b) => {
16036
16059
  for (var prop in b || (b = {}))
16037
- if (__hasOwnProp$c.call(b, prop))
16060
+ if (__hasOwnProp$f.call(b, prop))
16038
16061
  __defNormalProp$5(a, prop, b[prop]);
16039
- if (__getOwnPropSymbols$c)
16040
- for (var prop of __getOwnPropSymbols$c(b)) {
16041
- if (__propIsEnum$c.call(b, prop))
16062
+ if (__getOwnPropSymbols$f)
16063
+ for (var prop of __getOwnPropSymbols$f(b)) {
16064
+ if (__propIsEnum$f.call(b, prop))
16042
16065
  __defNormalProp$5(a, prop, b[prop]);
16043
16066
  }
16044
16067
  return a;
16045
16068
  };
16046
- var __async$A = (__this, __arguments, generator) => {
16069
+ var __async$B = (__this, __arguments, generator) => {
16047
16070
  return new Promise((resolve, reject) => {
16048
16071
  var fulfilled = (value) => {
16049
16072
  try {
@@ -16082,7 +16105,7 @@ class FundingSourcesAPI {
16082
16105
  * The `create` method creates a new funding source for a given user. This requires
16083
16106
  * payment information to be collected from the user.
16084
16107
  */
16085
- this.create = (createFundingSource) => __async$A(this, null, function* () {
16108
+ this.create = (createFundingSource) => __async$B(this, null, function* () {
16086
16109
  const endUserIpAddress = yield getEndUserIpAddress();
16087
16110
  if (!endUserIpAddress)
16088
16111
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -16095,7 +16118,7 @@ class FundingSourcesAPI {
16095
16118
  * user to update the billing address or payment information associated with the
16096
16119
  * funding source.
16097
16120
  */
16098
- this.update = (billingInfo, creditCardInfo, fundingSourceId) => __async$A(this, null, function* () {
16121
+ this.update = (billingInfo, creditCardInfo, fundingSourceId) => __async$B(this, null, function* () {
16099
16122
  const endUserIpAddress = yield getEndUserIpAddress();
16100
16123
  if (!endUserIpAddress)
16101
16124
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -16112,7 +16135,7 @@ class FundingSourcesAPI {
16112
16135
  * The `registerCarrier` method registers a carrier account and associates
16113
16136
  * it with a given funding source.
16114
16137
  */
16115
- this.registerCarrier = (carrier) => __async$A(this, null, function* () {
16138
+ this.registerCarrier = (carrier) => __async$B(this, null, function* () {
16116
16139
  const endUserIpAddress = yield getEndUserIpAddress();
16117
16140
  if (!endUserIpAddress)
16118
16141
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -16123,7 +16146,7 @@ class FundingSourcesAPI {
16123
16146
  /**
16124
16147
  * The `addFunds` method allows you to add funds to a funding source.
16125
16148
  */
16126
- this.addFunds = (amount, fundingSourceId) => __async$A(this, null, function* () {
16149
+ this.addFunds = (amount, fundingSourceId) => __async$B(this, null, function* () {
16127
16150
  return yield this.client.put(
16128
16151
  `/v1/funding_sources/${fundingSourceId}/add_funds`,
16129
16152
  amount
@@ -16133,7 +16156,7 @@ class FundingSourcesAPI {
16133
16156
  * The `metadata` method returns seller-specific requirements for creating funding sources
16134
16157
  * and attaching carriers
16135
16158
  */
16136
- this.metadata = () => __async$A(this, null, function* () {
16159
+ this.metadata = () => __async$B(this, null, function* () {
16137
16160
  return yield this.client.get("/v1/funding_sources/metadata");
16138
16161
  });
16139
16162
  /**
@@ -16223,6 +16246,12 @@ class OrderSourcesAPI {
16223
16246
  this.refresh = (orderSourceId) => {
16224
16247
  return this.client.put(`/v-beta/order_sources/${orderSourceId}/refresh`);
16225
16248
  };
16249
+ /**
16250
+ * The `deactivate` method remove a specific connected order source by `orderSourceId`.
16251
+ */
16252
+ this.deactivate = (orderSourceId) => {
16253
+ return this.client.put(`/v-beta/order_sources/${orderSourceId}/deactivate`);
16254
+ };
16226
16255
  this.client = client;
16227
16256
  }
16228
16257
  }
@@ -16376,7 +16405,7 @@ class SalesOrdersAPI {
16376
16405
  }
16377
16406
  }
16378
16407
 
16379
- var __async$z = (__this, __arguments, generator) => {
16408
+ var __async$A = (__this, __arguments, generator) => {
16380
16409
  return new Promise((resolve, reject) => {
16381
16410
  var fulfilled = (value) => {
16382
16411
  try {
@@ -16419,7 +16448,7 @@ class ShipmentsAPI {
16419
16448
  * The `create` method allows for creating shipments based on a list of shipment
16420
16449
  * items passed into this method.
16421
16450
  */
16422
- this.create = (...shipments) => __async$z(this, null, function* () {
16451
+ this.create = (...shipments) => __async$A(this, null, function* () {
16423
16452
  return this.client.post("/v1/shipments", {
16424
16453
  shipments
16425
16454
  });
@@ -16526,23 +16555,23 @@ class WarehousesAPI {
16526
16555
  var __defProp$4 = Object.defineProperty;
16527
16556
  var __defProps$2 = Object.defineProperties;
16528
16557
  var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
16529
- var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
16530
- var __hasOwnProp$b = Object.prototype.hasOwnProperty;
16531
- var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
16558
+ var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
16559
+ var __hasOwnProp$e = Object.prototype.hasOwnProperty;
16560
+ var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
16532
16561
  var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16533
16562
  var __spreadValues$4 = (a, b) => {
16534
16563
  for (var prop in b || (b = {}))
16535
- if (__hasOwnProp$b.call(b, prop))
16564
+ if (__hasOwnProp$e.call(b, prop))
16536
16565
  __defNormalProp$4(a, prop, b[prop]);
16537
- if (__getOwnPropSymbols$b)
16538
- for (var prop of __getOwnPropSymbols$b(b)) {
16539
- if (__propIsEnum$b.call(b, prop))
16566
+ if (__getOwnPropSymbols$e)
16567
+ for (var prop of __getOwnPropSymbols$e(b)) {
16568
+ if (__propIsEnum$e.call(b, prop))
16540
16569
  __defNormalProp$4(a, prop, b[prop]);
16541
16570
  }
16542
16571
  return a;
16543
16572
  };
16544
16573
  var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
16545
- var __async$y = (__this, __arguments, generator) => {
16574
+ var __async$z = (__this, __arguments, generator) => {
16546
16575
  return new Promise((resolve, reject) => {
16547
16576
  var fulfilled = (value) => {
16548
16577
  try {
@@ -16636,7 +16665,7 @@ class ShipEngineAPI {
16636
16665
  );
16637
16666
  return res;
16638
16667
  },
16639
- (err) => __async$y(this, null, function* () {
16668
+ (err) => __async$z(this, null, function* () {
16640
16669
  var _a, _b, _c, _d, _e, _f;
16641
16670
  logger$1.error(
16642
16671
  { err, req: err.config, res: err.response },
@@ -16703,6 +16732,15 @@ class ShipEngineAPI {
16703
16732
  get carriers() {
16704
16733
  return new CarriersAPI(this.client);
16705
16734
  }
16735
+ /**
16736
+ * The `connections` method provides access to the Connections endpoints in ShipEngine
16737
+ * API. e.g. List Carrier Connections, Get Carrier Connection Form
16738
+ *
16739
+ * @see {@link ConnectionsAPI | The Connections API module}
16740
+ */
16741
+ get connections() {
16742
+ return new ConnectionsAPI(this.client);
16743
+ }
16706
16744
  /**
16707
16745
  * The `customPackages` method provides access to the Packages endpoint in ShipEngine
16708
16746
  * API. e.g. List Packages
@@ -16885,17 +16923,17 @@ const onError = (_errors) => _default();
16885
16923
  var __defProp$3 = Object.defineProperty;
16886
16924
  var __defProps$1 = Object.defineProperties;
16887
16925
  var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
16888
- var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
16889
- var __hasOwnProp$a = Object.prototype.hasOwnProperty;
16890
- var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
16926
+ var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
16927
+ var __hasOwnProp$d = Object.prototype.hasOwnProperty;
16928
+ var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
16891
16929
  var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16892
16930
  var __spreadValues$3 = (a, b) => {
16893
16931
  for (var prop in b || (b = {}))
16894
- if (__hasOwnProp$a.call(b, prop))
16932
+ if (__hasOwnProp$d.call(b, prop))
16895
16933
  __defNormalProp$3(a, prop, b[prop]);
16896
- if (__getOwnPropSymbols$a)
16897
- for (var prop of __getOwnPropSymbols$a(b)) {
16898
- if (__propIsEnum$a.call(b, prop))
16934
+ if (__getOwnPropSymbols$d)
16935
+ for (var prop of __getOwnPropSymbols$d(b)) {
16936
+ if (__propIsEnum$d.call(b, prop))
16899
16937
  __defNormalProp$3(a, prop, b[prop]);
16900
16938
  }
16901
16939
  return a;
@@ -16934,7 +16972,7 @@ const retryUntil = (callbackFn, retries = 10, timeoutBetweenAttempts = 1e3) => P
16934
16972
  throw error;
16935
16973
  });
16936
16974
 
16937
- var __async$x = (__this, __arguments, generator) => {
16975
+ var __async$y = (__this, __arguments, generator) => {
16938
16976
  return new Promise((resolve, reject) => {
16939
16977
  var fulfilled = (value) => {
16940
16978
  try {
@@ -16957,7 +16995,7 @@ var __async$x = (__this, __arguments, generator) => {
16957
16995
  const useCreateAccountImage = () => {
16958
16996
  const { client } = useShipEngine();
16959
16997
  return useMutation({
16960
- mutationFn: (data) => __async$x(void 0, null, function* () {
16998
+ mutationFn: (data) => __async$y(void 0, null, function* () {
16961
16999
  const result = yield client.accountSettings.createImage(data);
16962
17000
  return result.data;
16963
17001
  }),
@@ -16966,7 +17004,7 @@ const useCreateAccountImage = () => {
16966
17004
  });
16967
17005
  };
16968
17006
 
16969
- var __async$w = (__this, __arguments, generator) => {
17007
+ var __async$x = (__this, __arguments, generator) => {
16970
17008
  return new Promise((resolve, reject) => {
16971
17009
  var fulfilled = (value) => {
16972
17010
  try {
@@ -16989,7 +17027,7 @@ var __async$w = (__this, __arguments, generator) => {
16989
17027
  const useDeleteAccountImage = () => {
16990
17028
  const { client } = useShipEngine();
16991
17029
  return useMutation({
16992
- mutationFn: (labelImageId) => __async$w(void 0, null, function* () {
17030
+ mutationFn: (labelImageId) => __async$x(void 0, null, function* () {
16993
17031
  const result = yield client.accountSettings.deleteImage(labelImageId);
16994
17032
  return result.data;
16995
17033
  }),
@@ -17018,7 +17056,7 @@ const useGetAccountSettings = () => {
17018
17056
  });
17019
17057
  };
17020
17058
 
17021
- var __async$v = (__this, __arguments, generator) => {
17059
+ var __async$w = (__this, __arguments, generator) => {
17022
17060
  return new Promise((resolve, reject) => {
17023
17061
  var fulfilled = (value) => {
17024
17062
  try {
@@ -17041,7 +17079,7 @@ var __async$v = (__this, __arguments, generator) => {
17041
17079
  const useUpdateAccountImage = () => {
17042
17080
  const { client } = useShipEngine();
17043
17081
  return useMutation({
17044
- mutationFn: (data) => __async$v(void 0, null, function* () {
17082
+ mutationFn: (data) => __async$w(void 0, null, function* () {
17045
17083
  const result = yield client.accountSettings.updateImage(data);
17046
17084
  return result.data;
17047
17085
  }),
@@ -17050,7 +17088,7 @@ const useUpdateAccountImage = () => {
17050
17088
  });
17051
17089
  };
17052
17090
 
17053
- var __async$u = (__this, __arguments, generator) => {
17091
+ var __async$v = (__this, __arguments, generator) => {
17054
17092
  return new Promise((resolve, reject) => {
17055
17093
  var fulfilled = (value) => {
17056
17094
  try {
@@ -17073,7 +17111,7 @@ var __async$u = (__this, __arguments, generator) => {
17073
17111
  const useUpdateAccountSettings = () => {
17074
17112
  const { client } = useShipEngine();
17075
17113
  return useMutation({
17076
- mutationFn: (settings) => __async$u(void 0, null, function* () {
17114
+ mutationFn: (settings) => __async$v(void 0, null, function* () {
17077
17115
  const result = yield client.accountSettings.update(settings);
17078
17116
  return result.data;
17079
17117
  }),
@@ -17082,7 +17120,7 @@ const useUpdateAccountSettings = () => {
17082
17120
  });
17083
17121
  };
17084
17122
 
17085
- var __async$t = (__this, __arguments, generator) => {
17123
+ var __async$u = (__this, __arguments, generator) => {
17086
17124
  return new Promise((resolve, reject) => {
17087
17125
  var fulfilled = (value) => {
17088
17126
  try {
@@ -17105,7 +17143,7 @@ var __async$t = (__this, __arguments, generator) => {
17105
17143
  const useParseAddress = () => {
17106
17144
  const { client } = useShipEngine();
17107
17145
  return useMutation({
17108
- mutationFn: (_0) => __async$t(void 0, [_0], function* ({ address, text }) {
17146
+ mutationFn: (_0) => __async$u(void 0, [_0], function* ({ address, text }) {
17109
17147
  const result = yield client.addresses.parse(text, address);
17110
17148
  return result.data;
17111
17149
  }),
@@ -17114,7 +17152,7 @@ const useParseAddress = () => {
17114
17152
  });
17115
17153
  };
17116
17154
 
17117
- var __async$s = (__this, __arguments, generator) => {
17155
+ var __async$t = (__this, __arguments, generator) => {
17118
17156
  return new Promise((resolve, reject) => {
17119
17157
  var fulfilled = (value) => {
17120
17158
  try {
@@ -17137,7 +17175,7 @@ var __async$s = (__this, __arguments, generator) => {
17137
17175
  const useValidateAddresses = () => {
17138
17176
  const { client } = useShipEngine();
17139
17177
  return useMutation({
17140
- mutationFn: (addresses) => __async$s(void 0, null, function* () {
17178
+ mutationFn: (addresses) => __async$t(void 0, null, function* () {
17141
17179
  const result = yield client.addresses.validate(addresses);
17142
17180
  return result.data;
17143
17181
  }),
@@ -17146,7 +17184,7 @@ const useValidateAddresses = () => {
17146
17184
  });
17147
17185
  };
17148
17186
 
17149
- var __async$r = (__this, __arguments, generator) => {
17187
+ var __async$s = (__this, __arguments, generator) => {
17150
17188
  return new Promise((resolve, reject) => {
17151
17189
  var fulfilled = (value) => {
17152
17190
  try {
@@ -17169,7 +17207,7 @@ var __async$r = (__this, __arguments, generator) => {
17169
17207
  const useAddFunds = () => {
17170
17208
  const { client } = useShipEngine();
17171
17209
  return useMutation({
17172
- mutationFn: (_0) => __async$r(void 0, [_0], function* ({ carrierId, funds }) {
17210
+ mutationFn: (_0) => __async$s(void 0, [_0], function* ({ carrierId, funds }) {
17173
17211
  const result = yield client.carriers.addFunds(carrierId, funds);
17174
17212
  return result.data;
17175
17213
  }),
@@ -17178,7 +17216,7 @@ const useAddFunds = () => {
17178
17216
  });
17179
17217
  };
17180
17218
 
17181
- var __async$q = (__this, __arguments, generator) => {
17219
+ var __async$r = (__this, __arguments, generator) => {
17182
17220
  return new Promise((resolve, reject) => {
17183
17221
  var fulfilled = (value) => {
17184
17222
  try {
@@ -17201,7 +17239,7 @@ var __async$q = (__this, __arguments, generator) => {
17201
17239
  const useConnectCarrier = () => {
17202
17240
  const { client } = useShipEngine();
17203
17241
  return useMutation({
17204
- mutationFn: (params) => __async$q(void 0, null, function* () {
17242
+ mutationFn: (params) => __async$r(void 0, null, function* () {
17205
17243
  const result = yield client.carriers.connect(params);
17206
17244
  return result.data;
17207
17245
  }),
@@ -17320,7 +17358,22 @@ const useListCarriers = () => {
17320
17358
  });
17321
17359
  };
17322
17360
 
17323
- var __async$p = (__this, __arguments, generator) => {
17361
+ var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
17362
+ var __hasOwnProp$c = Object.prototype.hasOwnProperty;
17363
+ var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
17364
+ var __objRest$a = (source, exclude) => {
17365
+ var target = {};
17366
+ for (var prop in source)
17367
+ if (__hasOwnProp$c.call(source, prop) && exclude.indexOf(prop) < 0)
17368
+ target[prop] = source[prop];
17369
+ if (source != null && __getOwnPropSymbols$c)
17370
+ for (var prop of __getOwnPropSymbols$c(source)) {
17371
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$c.call(source, prop))
17372
+ target[prop] = source[prop];
17373
+ }
17374
+ return target;
17375
+ };
17376
+ var __async$q = (__this, __arguments, generator) => {
17324
17377
  return new Promise((resolve, reject) => {
17325
17378
  var fulfilled = (value) => {
17326
17379
  try {
@@ -17340,18 +17393,19 @@ var __async$p = (__this, __arguments, generator) => {
17340
17393
  step((generator = generator.apply(__this, __arguments)).next());
17341
17394
  });
17342
17395
  };
17343
- const useUpdateAutoFunding = (carrierId) => {
17396
+ const useUpdateAutoFunding = () => {
17344
17397
  const { client } = useShipEngine();
17345
17398
  const queryClient = useQueryClient();
17346
17399
  return useMutation({
17347
- mutationFn: (options) => __async$p(void 0, null, function* () {
17400
+ mutationFn: (_a) => __async$q(void 0, null, function* () {
17401
+ var _b = _a, { carrierId } = _b, options = __objRest$a(_b, ["carrierId"]);
17348
17402
  const result = yield client.carriers.updateAutoFunding(carrierId, options);
17349
17403
  return result.data;
17350
17404
  }),
17351
17405
  mutationKey: ["useUpdateAutoFunding"],
17352
17406
  onError,
17353
- onSuccess: (_) => {
17354
- queryClient.invalidateQueries(["useGetAutoFunding", carrierId], { exact: true });
17407
+ onSuccess: () => {
17408
+ queryClient.invalidateQueries(["useGetAutoFunding"]);
17355
17409
  }
17356
17410
  });
17357
17411
  };
@@ -17373,6 +17427,60 @@ const useGetZonesByCarrier = (carrierId) => {
17373
17427
  });
17374
17428
  };
17375
17429
 
17430
+ var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
17431
+ var __hasOwnProp$b = Object.prototype.hasOwnProperty;
17432
+ var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
17433
+ var __objRest$9 = (source, exclude) => {
17434
+ var target = {};
17435
+ for (var prop in source)
17436
+ if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
17437
+ target[prop] = source[prop];
17438
+ if (source != null && __getOwnPropSymbols$b)
17439
+ for (var prop of __getOwnPropSymbols$b(source)) {
17440
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
17441
+ target[prop] = source[prop];
17442
+ }
17443
+ return target;
17444
+ };
17445
+ const useGetCarrierConnectionForm = (_params) => {
17446
+ const { client } = useShipEngine();
17447
+ const _a = _params || {}, { carrierName, enabled = true } = _a, params = __objRest$9(_a, ["carrierName", "enabled"]);
17448
+ return useQuery({
17449
+ enabled,
17450
+ onError,
17451
+ queryFn: () => client.connections.getCarrierConnectionForm(carrierName, params),
17452
+ queryKey: ["useGetCarrierConnectionForm", params],
17453
+ select: (result) => result.data
17454
+ });
17455
+ };
17456
+
17457
+ var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
17458
+ var __hasOwnProp$a = Object.prototype.hasOwnProperty;
17459
+ var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
17460
+ var __objRest$8 = (source, exclude) => {
17461
+ var target = {};
17462
+ for (var prop in source)
17463
+ if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
17464
+ target[prop] = source[prop];
17465
+ if (source != null && __getOwnPropSymbols$a)
17466
+ for (var prop of __getOwnPropSymbols$a(source)) {
17467
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
17468
+ target[prop] = source[prop];
17469
+ }
17470
+ return target;
17471
+ };
17472
+ const useListCarrierConnections = (_params) => {
17473
+ const { client } = useShipEngine();
17474
+ const _a = _params || {}, { enabled = true } = _a, params = __objRest$8(_a, ["enabled"]);
17475
+ return useQuery({
17476
+ enabled,
17477
+ onError,
17478
+ queryFn: () => client.connections.listCarriers(params),
17479
+ queryKey: ["useListCarrierConnections", params],
17480
+ select: (result) => result.data
17481
+ });
17482
+ };
17483
+
17376
17484
  const useListCustomPackageTypes = () => {
17377
17485
  const { client } = useShipEngine();
17378
17486
  return useQuery({
@@ -17383,7 +17491,7 @@ const useListCustomPackageTypes = () => {
17383
17491
  });
17384
17492
  };
17385
17493
 
17386
- var __async$o = (__this, __arguments, generator) => {
17494
+ var __async$p = (__this, __arguments, generator) => {
17387
17495
  return new Promise((resolve, reject) => {
17388
17496
  var fulfilled = (value) => {
17389
17497
  try {
@@ -17406,7 +17514,7 @@ var __async$o = (__this, __arguments, generator) => {
17406
17514
  const useCreateFundingSource = () => {
17407
17515
  const { client } = useShipEngine();
17408
17516
  return useMutation({
17409
- mutationFn: (fundingSource) => __async$o(void 0, null, function* () {
17517
+ mutationFn: (fundingSource) => __async$p(void 0, null, function* () {
17410
17518
  const result = yield client.fundingSources.create(fundingSource);
17411
17519
  return result.data;
17412
17520
  }),
@@ -17415,7 +17523,7 @@ const useCreateFundingSource = () => {
17415
17523
  });
17416
17524
  };
17417
17525
 
17418
- var __async$n = (__this, __arguments, generator) => {
17526
+ var __async$o = (__this, __arguments, generator) => {
17419
17527
  return new Promise((resolve, reject) => {
17420
17528
  var fulfilled = (value) => {
17421
17529
  try {
@@ -17438,7 +17546,7 @@ var __async$n = (__this, __arguments, generator) => {
17438
17546
  const useFundingSourcesAddFunds = () => {
17439
17547
  const { client } = useShipEngine();
17440
17548
  return useMutation({
17441
- mutationFn: (_0) => __async$n(void 0, [_0], function* ({ funds, fundingSourceId }) {
17549
+ mutationFn: (_0) => __async$o(void 0, [_0], function* ({ funds, fundingSourceId }) {
17442
17550
  const result = yield client.fundingSources.addFunds(funds, fundingSourceId);
17443
17551
  return result.data;
17444
17552
  }),
@@ -17467,7 +17575,7 @@ const useListFundingSources = () => {
17467
17575
  });
17468
17576
  };
17469
17577
 
17470
- var __async$m = (__this, __arguments, generator) => {
17578
+ var __async$n = (__this, __arguments, generator) => {
17471
17579
  return new Promise((resolve, reject) => {
17472
17580
  var fulfilled = (value) => {
17473
17581
  try {
@@ -17490,7 +17598,7 @@ var __async$m = (__this, __arguments, generator) => {
17490
17598
  const useRegisterCarrier = () => {
17491
17599
  const { client } = useShipEngine();
17492
17600
  return useMutation({
17493
- mutationFn: (carrier) => __async$m(void 0, null, function* () {
17601
+ mutationFn: (carrier) => __async$n(void 0, null, function* () {
17494
17602
  const result = yield client.fundingSources.registerCarrier(carrier);
17495
17603
  return result.data;
17496
17604
  }),
@@ -17499,7 +17607,7 @@ const useRegisterCarrier = () => {
17499
17607
  });
17500
17608
  };
17501
17609
 
17502
- var __async$l = (__this, __arguments, generator) => {
17610
+ var __async$m = (__this, __arguments, generator) => {
17503
17611
  return new Promise((resolve, reject) => {
17504
17612
  var fulfilled = (value) => {
17505
17613
  try {
@@ -17522,7 +17630,7 @@ var __async$l = (__this, __arguments, generator) => {
17522
17630
  const useUpdateFundingSource = () => {
17523
17631
  const { client } = useShipEngine();
17524
17632
  return useMutation({
17525
- mutationFn: (_0) => __async$l(void 0, [_0], function* ({
17633
+ mutationFn: (_0) => __async$m(void 0, [_0], function* ({
17526
17634
  billingInfo,
17527
17635
  creditCardInfo,
17528
17636
  fundingSourceId
@@ -17590,7 +17698,7 @@ var __objRest$7 = (source, exclude) => {
17590
17698
  }
17591
17699
  return target;
17592
17700
  };
17593
- var __async$k = (__this, __arguments, generator) => {
17701
+ var __async$l = (__this, __arguments, generator) => {
17594
17702
  return new Promise((resolve, reject) => {
17595
17703
  var fulfilled = (value) => {
17596
17704
  try {
@@ -17613,7 +17721,7 @@ var __async$k = (__this, __arguments, generator) => {
17613
17721
  const useCreateLabel = () => {
17614
17722
  const { client } = useShipEngine();
17615
17723
  return useMutation({
17616
- mutationFn: (_a) => __async$k(void 0, null, function* () {
17724
+ mutationFn: (_a) => __async$l(void 0, null, function* () {
17617
17725
  var _b = _a, { rateId } = _b, options = __objRest$7(_b, ["rateId"]);
17618
17726
  const result = yield client.labels.createByRateId(rateId, options);
17619
17727
  return result.data;
@@ -17665,7 +17773,7 @@ const useListLabels = (_params) => {
17665
17773
  });
17666
17774
  };
17667
17775
 
17668
- var __async$j = (__this, __arguments, generator) => {
17776
+ var __async$k = (__this, __arguments, generator) => {
17669
17777
  return new Promise((resolve, reject) => {
17670
17778
  var fulfilled = (value) => {
17671
17779
  try {
@@ -17688,7 +17796,7 @@ var __async$j = (__this, __arguments, generator) => {
17688
17796
  const useVoidLabel = () => {
17689
17797
  const { client } = useShipEngine();
17690
17798
  return useMutation({
17691
- mutationFn: (labelId) => __async$j(void 0, null, function* () {
17799
+ mutationFn: (labelId) => __async$k(void 0, null, function* () {
17692
17800
  const result = yield client.labels.void(labelId);
17693
17801
  return result.data;
17694
17802
  }),
@@ -17707,7 +17815,7 @@ const useListOrderSources = () => {
17707
17815
  });
17708
17816
  };
17709
17817
 
17710
- var __async$i = (__this, __arguments, generator) => {
17818
+ var __async$j = (__this, __arguments, generator) => {
17711
17819
  return new Promise((resolve, reject) => {
17712
17820
  var fulfilled = (value) => {
17713
17821
  try {
@@ -17730,7 +17838,7 @@ var __async$i = (__this, __arguments, generator) => {
17730
17838
  const useRefreshOrderSourceAsync = () => {
17731
17839
  const { client } = useShipEngine();
17732
17840
  return useMutation({
17733
- mutationFn: (orderSourceId) => __async$i(void 0, null, function* () {
17841
+ mutationFn: (orderSourceId) => __async$j(void 0, null, function* () {
17734
17842
  const result = yield client.orderSources.refresh(orderSourceId);
17735
17843
  return result.data;
17736
17844
  }),
@@ -17741,9 +17849,9 @@ const useRefreshOrderSource = () => {
17741
17849
  const { client } = useShipEngine();
17742
17850
  const { mutateAsync: refreshOrderSourceAsync } = useRefreshOrderSourceAsync();
17743
17851
  return useMutation({
17744
- mutationFn: (orderSourceId) => __async$i(void 0, null, function* () {
17852
+ mutationFn: (orderSourceId) => __async$j(void 0, null, function* () {
17745
17853
  yield refreshOrderSourceAsync(orderSourceId);
17746
- const waitResult = yield retryUntil(() => __async$i(void 0, null, function* () {
17854
+ const waitResult = yield retryUntil(() => __async$j(void 0, null, function* () {
17747
17855
  const { data: checkResult } = yield client.orderSources.get(orderSourceId);
17748
17856
  if (["preparing_update", "updating"].includes(checkResult.refreshInfo.status)) {
17749
17857
  throw new CodedError("Order source is still refreshing");
@@ -17757,6 +17865,38 @@ const useRefreshOrderSource = () => {
17757
17865
  });
17758
17866
  };
17759
17867
 
17868
+ var __async$i = (__this, __arguments, generator) => {
17869
+ return new Promise((resolve, reject) => {
17870
+ var fulfilled = (value) => {
17871
+ try {
17872
+ step(generator.next(value));
17873
+ } catch (e) {
17874
+ reject(e);
17875
+ }
17876
+ };
17877
+ var rejected = (value) => {
17878
+ try {
17879
+ step(generator.throw(value));
17880
+ } catch (e) {
17881
+ reject(e);
17882
+ }
17883
+ };
17884
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
17885
+ step((generator = generator.apply(__this, __arguments)).next());
17886
+ });
17887
+ };
17888
+ const useDeactivateOrderSource = () => {
17889
+ const { client } = useShipEngine();
17890
+ return useMutation({
17891
+ mutationFn: (orderSourceId) => __async$i(void 0, null, function* () {
17892
+ const result = yield client.orderSources.deactivate(orderSourceId);
17893
+ return result.data;
17894
+ }),
17895
+ mutationKey: ["useDeactivateOrderSource"],
17896
+ onError
17897
+ });
17898
+ };
17899
+
17760
17900
  var __async$h = (__this, __arguments, generator) => {
17761
17901
  return new Promise((resolve, reject) => {
17762
17902
  var fulfilled = (value) => {
@@ -19741,4 +19881,4 @@ const alchemy = {
19741
19881
  createElement
19742
19882
  };
19743
19883
 
19744
- export { AccountSettingsAPI, AddressesAPI, AlchemyContext, AlchemyProvider, AlchemyTestProvider, CarriersAPI, CodedError, ConfirmationType, CreditCardVendor, Currency, CustomPackagesAPI, CustomsContentsType, CustomsNonDeliveryType, Element, ErrorBoundary, FundingSourcesAPI, InsuranceAPI, InsuranceProviderType, LabelsAPI, MetadataCapability, MetadataRequirement, MetadataSatisfyingFormTypes, OrderSourcesAPI, RateCardStatus, RateCardsAPI, RatesAPI, types as SE, SalesOrderShipmentsAPI, SalesOrdersAPI, ShipEngine, ShipEngineAPI, ShipEngineContext, ShipmentsAPI, ShippingRulesAPI, ThemesAPI, WarehousesAPI, alchemy, alchemy as default, delay, getEmotionCache, getEndUserIpAddress, isCodedError, isCodedErrors, isDataCodedErrors, logger, onError, parseError, retryUntil, useAddFunds, useAlchemy, useCalculateRates, useConnectCarrier, useCreateAccountImage, useCreateFundingSource, useCreateLabel, useCreateRateCard, useCreateSalesOrderShipment, useCreateShipment, useCreateShippingRule, useCreateWarehouse, useDeleteAccountImage, useDeleteRateCard, useDeleteShippingRule, useDeleteWarehouse, useDownloadRateCard, useEditShippingRule, useFundingSourcesAddFunds, useGetAccountBillingPlan, useGetAccountImages, useGetAccountSettings, useGetAutoFundingConfiguration, useGetCarrierById, useGetCountriesByCarrier, useGetCurrenciesByCarrier, useGetFundingSourceById, useGetFundingSourceMetadata, useGetFundingSourceTransactions, useGetInsuranceAccount, useGetLabel, useGetPackageRatingGroupByCarrier, useGetRateCardById, useGetSalesOrder, useGetSalesOrderShipment, useGetServicesByCarrier, useGetShipment, useGetShipmentRates, useGetShippingRuleById, useGetShippingRuleConditionsOptions, useGetThemeById, useGetZonesByCarrier, useI18n, useListCarriers, useListCustomPackageTypes, useListFundingSources, useListLabels, useListOrderSources, useListRateCards, useListSalesOrderShipments, useListSalesOrders, useListShipments, useListShippingRules, useListWarehouses, useLoadIcons, useNotifySalesOrderShipped, useParseAddress, usePublishRateCard, useRefreshOrderSource, useRefreshOrderSourceAsync, useRegisterCarrier, useShipEngine, useUpdateAccountBillingPlan, useUpdateAccountImage, useUpdateAccountSettings, useUpdateAutoFunding, useUpdateFundingSource, useUpdateRateCard, useUpdateSalesOrderShipment, useUpdateWarehouse, useUploadRateCard, useValidateAddresses, useVoidLabel };
19884
+ export { AccountSettingsAPI, AddressesAPI, AlchemyContext, AlchemyProvider, AlchemyTestProvider, CarriersAPI, CodedError, ConfirmationType, ConnectionsAPI, CreditCardVendor, Currency, CustomPackagesAPI, CustomsContentsType, CustomsNonDeliveryType, Element, ErrorBoundary, FundingSourcesAPI, InsuranceAPI, InsuranceProviderType, LabelsAPI, MetadataCapability, MetadataRequirement, MetadataSatisfyingFormTypes, OrderSourcesAPI, RateCardStatus, RateCardsAPI, RatesAPI, types as SE, SalesOrderShipmentsAPI, SalesOrdersAPI, ShipEngine, ShipEngineAPI, ShipEngineContext, ShipmentsAPI, ShippingRulesAPI, ThemesAPI, WarehousesAPI, alchemy, alchemy as default, delay, getEmotionCache, getEndUserIpAddress, isCodedError, isCodedErrors, isDataCodedErrors, logger, onError, parseError, retryUntil, useAddFunds, useAlchemy, useCalculateRates, useConnectCarrier, useCreateAccountImage, useCreateFundingSource, useCreateLabel, useCreateRateCard, useCreateSalesOrderShipment, useCreateShipment, useCreateShippingRule, useCreateWarehouse, useDeactivateOrderSource, useDeleteAccountImage, useDeleteRateCard, useDeleteShippingRule, useDeleteWarehouse, useDownloadRateCard, useEditShippingRule, useFundingSourcesAddFunds, useGetAccountBillingPlan, useGetAccountImages, useGetAccountSettings, useGetAutoFundingConfiguration, useGetCarrierById, useGetCarrierConnectionForm, useGetCountriesByCarrier, useGetCurrenciesByCarrier, useGetFundingSourceById, useGetFundingSourceMetadata, useGetFundingSourceTransactions, useGetInsuranceAccount, useGetLabel, useGetPackageRatingGroupByCarrier, useGetRateCardById, useGetSalesOrder, useGetSalesOrderShipment, useGetServicesByCarrier, useGetShipment, useGetShipmentRates, useGetShippingRuleById, useGetShippingRuleConditionsOptions, useGetThemeById, useGetZonesByCarrier, useI18n, useListCarrierConnections, useListCarriers, useListCustomPackageTypes, useListFundingSources, useListLabels, useListOrderSources, useListRateCards, useListSalesOrderShipments, useListSalesOrders, useListShipments, useListShippingRules, useListWarehouses, useLoadIcons, useNotifySalesOrderShipped, useParseAddress, usePublishRateCard, useRefreshOrderSource, useRefreshOrderSourceAsync, useRegisterCarrier, useShipEngine, useUpdateAccountBillingPlan, useUpdateAccountImage, useUpdateAccountSettings, useUpdateAutoFunding, useUpdateFundingSource, useUpdateRateCard, useUpdateSalesOrderShipment, useUpdateWarehouse, useUploadRateCard, useValidateAddresses, useVoidLabel };