@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.js CHANGED
@@ -10786,17 +10786,17 @@ var AccountBillingPlanChangeType = /* @__PURE__ */ ((AccountBillingPlanChangeTyp
10786
10786
  return AccountBillingPlanChangeType2;
10787
10787
  })(AccountBillingPlanChangeType || {});
10788
10788
 
10789
- var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
10790
- var __hasOwnProp$f = Object.prototype.hasOwnProperty;
10791
- var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
10792
- var __objRest$a = (source, exclude) => {
10789
+ var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
10790
+ var __hasOwnProp$i = Object.prototype.hasOwnProperty;
10791
+ var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
10792
+ var __objRest$d = (source, exclude) => {
10793
10793
  var target = {};
10794
10794
  for (var prop in source)
10795
- if (__hasOwnProp$f.call(source, prop) && exclude.indexOf(prop) < 0)
10795
+ if (__hasOwnProp$i.call(source, prop) && exclude.indexOf(prop) < 0)
10796
10796
  target[prop] = source[prop];
10797
- if (source != null && __getOwnPropSymbols$f)
10798
- for (var prop of __getOwnPropSymbols$f(source)) {
10799
- if (exclude.indexOf(prop) < 0 && __propIsEnum$f.call(source, prop))
10797
+ if (source != null && __getOwnPropSymbols$i)
10798
+ for (var prop of __getOwnPropSymbols$i(source)) {
10799
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$i.call(source, prop))
10800
10800
  target[prop] = source[prop];
10801
10801
  }
10802
10802
  return target;
@@ -10810,7 +10810,7 @@ class CodedError {
10810
10810
  this.message = message;
10811
10811
  }
10812
10812
  static fromObject(_a) {
10813
- var _b = _a, { message } = _b, options = __objRest$a(_b, ["message"]);
10813
+ var _b = _a, { message } = _b, options = __objRest$d(_b, ["message"]);
10814
10814
  return new CodedError(message, options);
10815
10815
  }
10816
10816
  }
@@ -10918,17 +10918,17 @@ const types = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
10918
10918
  RateCardStatus
10919
10919
  }, Symbol.toStringTag, { value: 'Module' }));
10920
10920
 
10921
- var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
10922
- var __hasOwnProp$e = Object.prototype.hasOwnProperty;
10923
- var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
10924
- var __objRest$9 = (source, exclude) => {
10921
+ var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
10922
+ var __hasOwnProp$h = Object.prototype.hasOwnProperty;
10923
+ var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
10924
+ var __objRest$c = (source, exclude) => {
10925
10925
  var target = {};
10926
10926
  for (var prop in source)
10927
- if (__hasOwnProp$e.call(source, prop) && exclude.indexOf(prop) < 0)
10927
+ if (__hasOwnProp$h.call(source, prop) && exclude.indexOf(prop) < 0)
10928
10928
  target[prop] = source[prop];
10929
- if (source != null && __getOwnPropSymbols$e)
10930
- for (var prop of __getOwnPropSymbols$e(source)) {
10931
- if (exclude.indexOf(prop) < 0 && __propIsEnum$e.call(source, prop))
10929
+ if (source != null && __getOwnPropSymbols$h)
10930
+ for (var prop of __getOwnPropSymbols$h(source)) {
10931
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$h.call(source, prop))
10932
10932
  target[prop] = source[prop];
10933
10933
  }
10934
10934
  return target;
@@ -10960,7 +10960,7 @@ class AccountSettingsAPI {
10960
10960
  * The `updateImage` method updates specific image data for a given image id.
10961
10961
  */
10962
10962
  this.updateImage = (_a) => {
10963
- var _b = _a, { labelImageId } = _b, data = __objRest$9(_b, ["labelImageId"]);
10963
+ var _b = _a, { labelImageId } = _b, data = __objRest$c(_b, ["labelImageId"]);
10964
10964
  return this.client.put(`/v1/account/settings/images/${labelImageId}`, data);
10965
10965
  };
10966
10966
  /**
@@ -13655,7 +13655,7 @@ var ipaddr = {
13655
13655
  }).call(commonjsGlobal);
13656
13656
  } (ipaddr));
13657
13657
 
13658
- var __async$C = (__this, __arguments, generator) => {
13658
+ var __async$D = (__this, __arguments, generator) => {
13659
13659
  return new Promise((resolve, reject) => {
13660
13660
  var fulfilled = (value) => {
13661
13661
  try {
@@ -13675,7 +13675,7 @@ var __async$C = (__this, __arguments, generator) => {
13675
13675
  step((generator = generator.apply(__this, __arguments)).next());
13676
13676
  });
13677
13677
  };
13678
- const getEndUserIpAddress = () => __async$C(void 0, null, function* () {
13678
+ const getEndUserIpAddress = () => __async$D(void 0, null, function* () {
13679
13679
  try {
13680
13680
  const response = yield axios.get("https://api.ipify.org/?format=json");
13681
13681
  if (response.data.ip && ipaddrExports.isValid(response.data.ip)) {
@@ -13690,35 +13690,35 @@ const getEndUserIpAddress = () => __async$C(void 0, null, function* () {
13690
13690
  var __defProp$6 = Object.defineProperty;
13691
13691
  var __defProps$3 = Object.defineProperties;
13692
13692
  var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
13693
- var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
13694
- var __hasOwnProp$d = Object.prototype.hasOwnProperty;
13695
- var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
13693
+ var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
13694
+ var __hasOwnProp$g = Object.prototype.hasOwnProperty;
13695
+ var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
13696
13696
  var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13697
13697
  var __spreadValues$6 = (a, b) => {
13698
13698
  for (var prop in b || (b = {}))
13699
- if (__hasOwnProp$d.call(b, prop))
13699
+ if (__hasOwnProp$g.call(b, prop))
13700
13700
  __defNormalProp$6(a, prop, b[prop]);
13701
- if (__getOwnPropSymbols$d)
13702
- for (var prop of __getOwnPropSymbols$d(b)) {
13703
- if (__propIsEnum$d.call(b, prop))
13701
+ if (__getOwnPropSymbols$g)
13702
+ for (var prop of __getOwnPropSymbols$g(b)) {
13703
+ if (__propIsEnum$g.call(b, prop))
13704
13704
  __defNormalProp$6(a, prop, b[prop]);
13705
13705
  }
13706
13706
  return a;
13707
13707
  };
13708
13708
  var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
13709
- var __objRest$8 = (source, exclude) => {
13709
+ var __objRest$b = (source, exclude) => {
13710
13710
  var target = {};
13711
13711
  for (var prop in source)
13712
- if (__hasOwnProp$d.call(source, prop) && exclude.indexOf(prop) < 0)
13712
+ if (__hasOwnProp$g.call(source, prop) && exclude.indexOf(prop) < 0)
13713
13713
  target[prop] = source[prop];
13714
- if (source != null && __getOwnPropSymbols$d)
13715
- for (var prop of __getOwnPropSymbols$d(source)) {
13716
- if (exclude.indexOf(prop) < 0 && __propIsEnum$d.call(source, prop))
13714
+ if (source != null && __getOwnPropSymbols$g)
13715
+ for (var prop of __getOwnPropSymbols$g(source)) {
13716
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$g.call(source, prop))
13717
13717
  target[prop] = source[prop];
13718
13718
  }
13719
13719
  return target;
13720
13720
  };
13721
- var __async$B = (__this, __arguments, generator) => {
13721
+ var __async$C = (__this, __arguments, generator) => {
13722
13722
  return new Promise((resolve, reject) => {
13723
13723
  var fulfilled = (value) => {
13724
13724
  try {
@@ -13756,8 +13756,8 @@ class CarriersAPI {
13756
13756
  /**
13757
13757
  * The `connect` method connects a carrier account to a user's ShipEngine account.
13758
13758
  */
13759
- this.connect = (_a) => __async$B(this, null, function* () {
13760
- var _b = _a, { carrierCode } = _b, connection = __objRest$8(_b, ["carrierCode"]);
13759
+ this.connect = (_a) => __async$C(this, null, function* () {
13760
+ var _b = _a, { carrierCode } = _b, connection = __objRest$b(_b, ["carrierCode"]);
13761
13761
  const endUserIpAddress = yield getEndUserIpAddress();
13762
13762
  if (!endUserIpAddress)
13763
13763
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -13840,6 +13840,29 @@ class CarriersAPI {
13840
13840
  }
13841
13841
  }
13842
13842
 
13843
+ class ConnectionsAPI {
13844
+ constructor(client) {
13845
+ this.client = client;
13846
+ /**
13847
+ * The `listCarriers` method retrieves a list of carriers available to be connected.
13848
+ */
13849
+ this.listCarriers = (params) => {
13850
+ return this.client.get("/v1/connections/carriers", { params });
13851
+ };
13852
+ /**
13853
+ * The `getCarrierConnectionForm` method retrieves a JSON Form Schema for collecting
13854
+ * information required to connect to the carrier.
13855
+ */
13856
+ this.getCarrierConnectionForm = (carrierName, params) => {
13857
+ return this.client.get(
13858
+ `/v1/connections/carriers/${carrierName}/form`,
13859
+ { params }
13860
+ );
13861
+ };
13862
+ this.client = client;
13863
+ }
13864
+ }
13865
+
13843
13866
  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}();
13844
13867
 
13845
13868
  var humpsExports = {};
@@ -16050,22 +16073,22 @@ class CustomPackagesAPI {
16050
16073
  }
16051
16074
 
16052
16075
  var __defProp$5 = Object.defineProperty;
16053
- var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
16054
- var __hasOwnProp$c = Object.prototype.hasOwnProperty;
16055
- var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
16076
+ var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
16077
+ var __hasOwnProp$f = Object.prototype.hasOwnProperty;
16078
+ var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
16056
16079
  var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16057
16080
  var __spreadValues$5 = (a, b) => {
16058
16081
  for (var prop in b || (b = {}))
16059
- if (__hasOwnProp$c.call(b, prop))
16082
+ if (__hasOwnProp$f.call(b, prop))
16060
16083
  __defNormalProp$5(a, prop, b[prop]);
16061
- if (__getOwnPropSymbols$c)
16062
- for (var prop of __getOwnPropSymbols$c(b)) {
16063
- if (__propIsEnum$c.call(b, prop))
16084
+ if (__getOwnPropSymbols$f)
16085
+ for (var prop of __getOwnPropSymbols$f(b)) {
16086
+ if (__propIsEnum$f.call(b, prop))
16064
16087
  __defNormalProp$5(a, prop, b[prop]);
16065
16088
  }
16066
16089
  return a;
16067
16090
  };
16068
- var __async$A = (__this, __arguments, generator) => {
16091
+ var __async$B = (__this, __arguments, generator) => {
16069
16092
  return new Promise((resolve, reject) => {
16070
16093
  var fulfilled = (value) => {
16071
16094
  try {
@@ -16104,7 +16127,7 @@ class FundingSourcesAPI {
16104
16127
  * The `create` method creates a new funding source for a given user. This requires
16105
16128
  * payment information to be collected from the user.
16106
16129
  */
16107
- this.create = (createFundingSource) => __async$A(this, null, function* () {
16130
+ this.create = (createFundingSource) => __async$B(this, null, function* () {
16108
16131
  const endUserIpAddress = yield getEndUserIpAddress();
16109
16132
  if (!endUserIpAddress)
16110
16133
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -16117,7 +16140,7 @@ class FundingSourcesAPI {
16117
16140
  * user to update the billing address or payment information associated with the
16118
16141
  * funding source.
16119
16142
  */
16120
- this.update = (billingInfo, creditCardInfo, fundingSourceId) => __async$A(this, null, function* () {
16143
+ this.update = (billingInfo, creditCardInfo, fundingSourceId) => __async$B(this, null, function* () {
16121
16144
  const endUserIpAddress = yield getEndUserIpAddress();
16122
16145
  if (!endUserIpAddress)
16123
16146
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -16134,7 +16157,7 @@ class FundingSourcesAPI {
16134
16157
  * The `registerCarrier` method registers a carrier account and associates
16135
16158
  * it with a given funding source.
16136
16159
  */
16137
- this.registerCarrier = (carrier) => __async$A(this, null, function* () {
16160
+ this.registerCarrier = (carrier) => __async$B(this, null, function* () {
16138
16161
  const endUserIpAddress = yield getEndUserIpAddress();
16139
16162
  if (!endUserIpAddress)
16140
16163
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -16145,7 +16168,7 @@ class FundingSourcesAPI {
16145
16168
  /**
16146
16169
  * The `addFunds` method allows you to add funds to a funding source.
16147
16170
  */
16148
- this.addFunds = (amount, fundingSourceId) => __async$A(this, null, function* () {
16171
+ this.addFunds = (amount, fundingSourceId) => __async$B(this, null, function* () {
16149
16172
  return yield this.client.put(
16150
16173
  `/v1/funding_sources/${fundingSourceId}/add_funds`,
16151
16174
  amount
@@ -16155,7 +16178,7 @@ class FundingSourcesAPI {
16155
16178
  * The `metadata` method returns seller-specific requirements for creating funding sources
16156
16179
  * and attaching carriers
16157
16180
  */
16158
- this.metadata = () => __async$A(this, null, function* () {
16181
+ this.metadata = () => __async$B(this, null, function* () {
16159
16182
  return yield this.client.get("/v1/funding_sources/metadata");
16160
16183
  });
16161
16184
  /**
@@ -16245,6 +16268,12 @@ class OrderSourcesAPI {
16245
16268
  this.refresh = (orderSourceId) => {
16246
16269
  return this.client.put(`/v-beta/order_sources/${orderSourceId}/refresh`);
16247
16270
  };
16271
+ /**
16272
+ * The `deactivate` method remove a specific connected order source by `orderSourceId`.
16273
+ */
16274
+ this.deactivate = (orderSourceId) => {
16275
+ return this.client.put(`/v-beta/order_sources/${orderSourceId}/deactivate`);
16276
+ };
16248
16277
  this.client = client;
16249
16278
  }
16250
16279
  }
@@ -16398,7 +16427,7 @@ class SalesOrdersAPI {
16398
16427
  }
16399
16428
  }
16400
16429
 
16401
- var __async$z = (__this, __arguments, generator) => {
16430
+ var __async$A = (__this, __arguments, generator) => {
16402
16431
  return new Promise((resolve, reject) => {
16403
16432
  var fulfilled = (value) => {
16404
16433
  try {
@@ -16441,7 +16470,7 @@ class ShipmentsAPI {
16441
16470
  * The `create` method allows for creating shipments based on a list of shipment
16442
16471
  * items passed into this method.
16443
16472
  */
16444
- this.create = (...shipments) => __async$z(this, null, function* () {
16473
+ this.create = (...shipments) => __async$A(this, null, function* () {
16445
16474
  return this.client.post("/v1/shipments", {
16446
16475
  shipments
16447
16476
  });
@@ -16548,23 +16577,23 @@ class WarehousesAPI {
16548
16577
  var __defProp$4 = Object.defineProperty;
16549
16578
  var __defProps$2 = Object.defineProperties;
16550
16579
  var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
16551
- var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
16552
- var __hasOwnProp$b = Object.prototype.hasOwnProperty;
16553
- var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
16580
+ var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
16581
+ var __hasOwnProp$e = Object.prototype.hasOwnProperty;
16582
+ var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
16554
16583
  var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16555
16584
  var __spreadValues$4 = (a, b) => {
16556
16585
  for (var prop in b || (b = {}))
16557
- if (__hasOwnProp$b.call(b, prop))
16586
+ if (__hasOwnProp$e.call(b, prop))
16558
16587
  __defNormalProp$4(a, prop, b[prop]);
16559
- if (__getOwnPropSymbols$b)
16560
- for (var prop of __getOwnPropSymbols$b(b)) {
16561
- if (__propIsEnum$b.call(b, prop))
16588
+ if (__getOwnPropSymbols$e)
16589
+ for (var prop of __getOwnPropSymbols$e(b)) {
16590
+ if (__propIsEnum$e.call(b, prop))
16562
16591
  __defNormalProp$4(a, prop, b[prop]);
16563
16592
  }
16564
16593
  return a;
16565
16594
  };
16566
16595
  var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
16567
- var __async$y = (__this, __arguments, generator) => {
16596
+ var __async$z = (__this, __arguments, generator) => {
16568
16597
  return new Promise((resolve, reject) => {
16569
16598
  var fulfilled = (value) => {
16570
16599
  try {
@@ -16658,7 +16687,7 @@ class ShipEngineAPI {
16658
16687
  );
16659
16688
  return res;
16660
16689
  },
16661
- (err) => __async$y(this, null, function* () {
16690
+ (err) => __async$z(this, null, function* () {
16662
16691
  var _a, _b, _c, _d, _e, _f;
16663
16692
  logger$1.error(
16664
16693
  { err, req: err.config, res: err.response },
@@ -16725,6 +16754,15 @@ class ShipEngineAPI {
16725
16754
  get carriers() {
16726
16755
  return new CarriersAPI(this.client);
16727
16756
  }
16757
+ /**
16758
+ * The `connections` method provides access to the Connections endpoints in ShipEngine
16759
+ * API. e.g. List Carrier Connections, Get Carrier Connection Form
16760
+ *
16761
+ * @see {@link ConnectionsAPI | The Connections API module}
16762
+ */
16763
+ get connections() {
16764
+ return new ConnectionsAPI(this.client);
16765
+ }
16728
16766
  /**
16729
16767
  * The `customPackages` method provides access to the Packages endpoint in ShipEngine
16730
16768
  * API. e.g. List Packages
@@ -16907,17 +16945,17 @@ const onError = (_errors) => _default();
16907
16945
  var __defProp$3 = Object.defineProperty;
16908
16946
  var __defProps$1 = Object.defineProperties;
16909
16947
  var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
16910
- var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
16911
- var __hasOwnProp$a = Object.prototype.hasOwnProperty;
16912
- var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
16948
+ var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
16949
+ var __hasOwnProp$d = Object.prototype.hasOwnProperty;
16950
+ var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
16913
16951
  var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16914
16952
  var __spreadValues$3 = (a, b) => {
16915
16953
  for (var prop in b || (b = {}))
16916
- if (__hasOwnProp$a.call(b, prop))
16954
+ if (__hasOwnProp$d.call(b, prop))
16917
16955
  __defNormalProp$3(a, prop, b[prop]);
16918
- if (__getOwnPropSymbols$a)
16919
- for (var prop of __getOwnPropSymbols$a(b)) {
16920
- if (__propIsEnum$a.call(b, prop))
16956
+ if (__getOwnPropSymbols$d)
16957
+ for (var prop of __getOwnPropSymbols$d(b)) {
16958
+ if (__propIsEnum$d.call(b, prop))
16921
16959
  __defNormalProp$3(a, prop, b[prop]);
16922
16960
  }
16923
16961
  return a;
@@ -16956,7 +16994,7 @@ const retryUntil = (callbackFn, retries = 10, timeoutBetweenAttempts = 1e3) => P
16956
16994
  throw error;
16957
16995
  });
16958
16996
 
16959
- var __async$x = (__this, __arguments, generator) => {
16997
+ var __async$y = (__this, __arguments, generator) => {
16960
16998
  return new Promise((resolve, reject) => {
16961
16999
  var fulfilled = (value) => {
16962
17000
  try {
@@ -16979,7 +17017,7 @@ var __async$x = (__this, __arguments, generator) => {
16979
17017
  const useCreateAccountImage = () => {
16980
17018
  const { client } = useShipEngine();
16981
17019
  return reactQuery.useMutation({
16982
- mutationFn: (data) => __async$x(void 0, null, function* () {
17020
+ mutationFn: (data) => __async$y(void 0, null, function* () {
16983
17021
  const result = yield client.accountSettings.createImage(data);
16984
17022
  return result.data;
16985
17023
  }),
@@ -16988,7 +17026,7 @@ const useCreateAccountImage = () => {
16988
17026
  });
16989
17027
  };
16990
17028
 
16991
- var __async$w = (__this, __arguments, generator) => {
17029
+ var __async$x = (__this, __arguments, generator) => {
16992
17030
  return new Promise((resolve, reject) => {
16993
17031
  var fulfilled = (value) => {
16994
17032
  try {
@@ -17011,7 +17049,7 @@ var __async$w = (__this, __arguments, generator) => {
17011
17049
  const useDeleteAccountImage = () => {
17012
17050
  const { client } = useShipEngine();
17013
17051
  return reactQuery.useMutation({
17014
- mutationFn: (labelImageId) => __async$w(void 0, null, function* () {
17052
+ mutationFn: (labelImageId) => __async$x(void 0, null, function* () {
17015
17053
  const result = yield client.accountSettings.deleteImage(labelImageId);
17016
17054
  return result.data;
17017
17055
  }),
@@ -17040,7 +17078,7 @@ const useGetAccountSettings = () => {
17040
17078
  });
17041
17079
  };
17042
17080
 
17043
- var __async$v = (__this, __arguments, generator) => {
17081
+ var __async$w = (__this, __arguments, generator) => {
17044
17082
  return new Promise((resolve, reject) => {
17045
17083
  var fulfilled = (value) => {
17046
17084
  try {
@@ -17063,7 +17101,7 @@ var __async$v = (__this, __arguments, generator) => {
17063
17101
  const useUpdateAccountImage = () => {
17064
17102
  const { client } = useShipEngine();
17065
17103
  return reactQuery.useMutation({
17066
- mutationFn: (data) => __async$v(void 0, null, function* () {
17104
+ mutationFn: (data) => __async$w(void 0, null, function* () {
17067
17105
  const result = yield client.accountSettings.updateImage(data);
17068
17106
  return result.data;
17069
17107
  }),
@@ -17072,7 +17110,7 @@ const useUpdateAccountImage = () => {
17072
17110
  });
17073
17111
  };
17074
17112
 
17075
- var __async$u = (__this, __arguments, generator) => {
17113
+ var __async$v = (__this, __arguments, generator) => {
17076
17114
  return new Promise((resolve, reject) => {
17077
17115
  var fulfilled = (value) => {
17078
17116
  try {
@@ -17095,7 +17133,7 @@ var __async$u = (__this, __arguments, generator) => {
17095
17133
  const useUpdateAccountSettings = () => {
17096
17134
  const { client } = useShipEngine();
17097
17135
  return reactQuery.useMutation({
17098
- mutationFn: (settings) => __async$u(void 0, null, function* () {
17136
+ mutationFn: (settings) => __async$v(void 0, null, function* () {
17099
17137
  const result = yield client.accountSettings.update(settings);
17100
17138
  return result.data;
17101
17139
  }),
@@ -17104,7 +17142,7 @@ const useUpdateAccountSettings = () => {
17104
17142
  });
17105
17143
  };
17106
17144
 
17107
- var __async$t = (__this, __arguments, generator) => {
17145
+ var __async$u = (__this, __arguments, generator) => {
17108
17146
  return new Promise((resolve, reject) => {
17109
17147
  var fulfilled = (value) => {
17110
17148
  try {
@@ -17127,7 +17165,7 @@ var __async$t = (__this, __arguments, generator) => {
17127
17165
  const useParseAddress = () => {
17128
17166
  const { client } = useShipEngine();
17129
17167
  return reactQuery.useMutation({
17130
- mutationFn: (_0) => __async$t(void 0, [_0], function* ({ address, text }) {
17168
+ mutationFn: (_0) => __async$u(void 0, [_0], function* ({ address, text }) {
17131
17169
  const result = yield client.addresses.parse(text, address);
17132
17170
  return result.data;
17133
17171
  }),
@@ -17136,7 +17174,7 @@ const useParseAddress = () => {
17136
17174
  });
17137
17175
  };
17138
17176
 
17139
- var __async$s = (__this, __arguments, generator) => {
17177
+ var __async$t = (__this, __arguments, generator) => {
17140
17178
  return new Promise((resolve, reject) => {
17141
17179
  var fulfilled = (value) => {
17142
17180
  try {
@@ -17159,7 +17197,7 @@ var __async$s = (__this, __arguments, generator) => {
17159
17197
  const useValidateAddresses = () => {
17160
17198
  const { client } = useShipEngine();
17161
17199
  return reactQuery.useMutation({
17162
- mutationFn: (addresses) => __async$s(void 0, null, function* () {
17200
+ mutationFn: (addresses) => __async$t(void 0, null, function* () {
17163
17201
  const result = yield client.addresses.validate(addresses);
17164
17202
  return result.data;
17165
17203
  }),
@@ -17168,7 +17206,7 @@ const useValidateAddresses = () => {
17168
17206
  });
17169
17207
  };
17170
17208
 
17171
- var __async$r = (__this, __arguments, generator) => {
17209
+ var __async$s = (__this, __arguments, generator) => {
17172
17210
  return new Promise((resolve, reject) => {
17173
17211
  var fulfilled = (value) => {
17174
17212
  try {
@@ -17191,7 +17229,7 @@ var __async$r = (__this, __arguments, generator) => {
17191
17229
  const useAddFunds = () => {
17192
17230
  const { client } = useShipEngine();
17193
17231
  return reactQuery.useMutation({
17194
- mutationFn: (_0) => __async$r(void 0, [_0], function* ({ carrierId, funds }) {
17232
+ mutationFn: (_0) => __async$s(void 0, [_0], function* ({ carrierId, funds }) {
17195
17233
  const result = yield client.carriers.addFunds(carrierId, funds);
17196
17234
  return result.data;
17197
17235
  }),
@@ -17200,7 +17238,7 @@ const useAddFunds = () => {
17200
17238
  });
17201
17239
  };
17202
17240
 
17203
- var __async$q = (__this, __arguments, generator) => {
17241
+ var __async$r = (__this, __arguments, generator) => {
17204
17242
  return new Promise((resolve, reject) => {
17205
17243
  var fulfilled = (value) => {
17206
17244
  try {
@@ -17223,7 +17261,7 @@ var __async$q = (__this, __arguments, generator) => {
17223
17261
  const useConnectCarrier = () => {
17224
17262
  const { client } = useShipEngine();
17225
17263
  return reactQuery.useMutation({
17226
- mutationFn: (params) => __async$q(void 0, null, function* () {
17264
+ mutationFn: (params) => __async$r(void 0, null, function* () {
17227
17265
  const result = yield client.carriers.connect(params);
17228
17266
  return result.data;
17229
17267
  }),
@@ -17342,7 +17380,22 @@ const useListCarriers = () => {
17342
17380
  });
17343
17381
  };
17344
17382
 
17345
- var __async$p = (__this, __arguments, generator) => {
17383
+ var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
17384
+ var __hasOwnProp$c = Object.prototype.hasOwnProperty;
17385
+ var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
17386
+ var __objRest$a = (source, exclude) => {
17387
+ var target = {};
17388
+ for (var prop in source)
17389
+ if (__hasOwnProp$c.call(source, prop) && exclude.indexOf(prop) < 0)
17390
+ target[prop] = source[prop];
17391
+ if (source != null && __getOwnPropSymbols$c)
17392
+ for (var prop of __getOwnPropSymbols$c(source)) {
17393
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$c.call(source, prop))
17394
+ target[prop] = source[prop];
17395
+ }
17396
+ return target;
17397
+ };
17398
+ var __async$q = (__this, __arguments, generator) => {
17346
17399
  return new Promise((resolve, reject) => {
17347
17400
  var fulfilled = (value) => {
17348
17401
  try {
@@ -17362,18 +17415,19 @@ var __async$p = (__this, __arguments, generator) => {
17362
17415
  step((generator = generator.apply(__this, __arguments)).next());
17363
17416
  });
17364
17417
  };
17365
- const useUpdateAutoFunding = (carrierId) => {
17418
+ const useUpdateAutoFunding = () => {
17366
17419
  const { client } = useShipEngine();
17367
17420
  const queryClient = reactQuery.useQueryClient();
17368
17421
  return reactQuery.useMutation({
17369
- mutationFn: (options) => __async$p(void 0, null, function* () {
17422
+ mutationFn: (_a) => __async$q(void 0, null, function* () {
17423
+ var _b = _a, { carrierId } = _b, options = __objRest$a(_b, ["carrierId"]);
17370
17424
  const result = yield client.carriers.updateAutoFunding(carrierId, options);
17371
17425
  return result.data;
17372
17426
  }),
17373
17427
  mutationKey: ["useUpdateAutoFunding"],
17374
17428
  onError,
17375
- onSuccess: (_) => {
17376
- queryClient.invalidateQueries(["useGetAutoFunding", carrierId], { exact: true });
17429
+ onSuccess: () => {
17430
+ queryClient.invalidateQueries(["useGetAutoFunding"]);
17377
17431
  }
17378
17432
  });
17379
17433
  };
@@ -17395,6 +17449,60 @@ const useGetZonesByCarrier = (carrierId) => {
17395
17449
  });
17396
17450
  };
17397
17451
 
17452
+ var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
17453
+ var __hasOwnProp$b = Object.prototype.hasOwnProperty;
17454
+ var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
17455
+ var __objRest$9 = (source, exclude) => {
17456
+ var target = {};
17457
+ for (var prop in source)
17458
+ if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
17459
+ target[prop] = source[prop];
17460
+ if (source != null && __getOwnPropSymbols$b)
17461
+ for (var prop of __getOwnPropSymbols$b(source)) {
17462
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
17463
+ target[prop] = source[prop];
17464
+ }
17465
+ return target;
17466
+ };
17467
+ const useGetCarrierConnectionForm = (_params) => {
17468
+ const { client } = useShipEngine();
17469
+ const _a = _params || {}, { carrierName, enabled = true } = _a, params = __objRest$9(_a, ["carrierName", "enabled"]);
17470
+ return reactQuery.useQuery({
17471
+ enabled,
17472
+ onError,
17473
+ queryFn: () => client.connections.getCarrierConnectionForm(carrierName, params),
17474
+ queryKey: ["useGetCarrierConnectionForm", params],
17475
+ select: (result) => result.data
17476
+ });
17477
+ };
17478
+
17479
+ var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
17480
+ var __hasOwnProp$a = Object.prototype.hasOwnProperty;
17481
+ var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
17482
+ var __objRest$8 = (source, exclude) => {
17483
+ var target = {};
17484
+ for (var prop in source)
17485
+ if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
17486
+ target[prop] = source[prop];
17487
+ if (source != null && __getOwnPropSymbols$a)
17488
+ for (var prop of __getOwnPropSymbols$a(source)) {
17489
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
17490
+ target[prop] = source[prop];
17491
+ }
17492
+ return target;
17493
+ };
17494
+ const useListCarrierConnections = (_params) => {
17495
+ const { client } = useShipEngine();
17496
+ const _a = _params || {}, { enabled = true } = _a, params = __objRest$8(_a, ["enabled"]);
17497
+ return reactQuery.useQuery({
17498
+ enabled,
17499
+ onError,
17500
+ queryFn: () => client.connections.listCarriers(params),
17501
+ queryKey: ["useListCarrierConnections", params],
17502
+ select: (result) => result.data
17503
+ });
17504
+ };
17505
+
17398
17506
  const useListCustomPackageTypes = () => {
17399
17507
  const { client } = useShipEngine();
17400
17508
  return reactQuery.useQuery({
@@ -17405,7 +17513,7 @@ const useListCustomPackageTypes = () => {
17405
17513
  });
17406
17514
  };
17407
17515
 
17408
- var __async$o = (__this, __arguments, generator) => {
17516
+ var __async$p = (__this, __arguments, generator) => {
17409
17517
  return new Promise((resolve, reject) => {
17410
17518
  var fulfilled = (value) => {
17411
17519
  try {
@@ -17428,7 +17536,7 @@ var __async$o = (__this, __arguments, generator) => {
17428
17536
  const useCreateFundingSource = () => {
17429
17537
  const { client } = useShipEngine();
17430
17538
  return reactQuery.useMutation({
17431
- mutationFn: (fundingSource) => __async$o(void 0, null, function* () {
17539
+ mutationFn: (fundingSource) => __async$p(void 0, null, function* () {
17432
17540
  const result = yield client.fundingSources.create(fundingSource);
17433
17541
  return result.data;
17434
17542
  }),
@@ -17437,7 +17545,7 @@ const useCreateFundingSource = () => {
17437
17545
  });
17438
17546
  };
17439
17547
 
17440
- var __async$n = (__this, __arguments, generator) => {
17548
+ var __async$o = (__this, __arguments, generator) => {
17441
17549
  return new Promise((resolve, reject) => {
17442
17550
  var fulfilled = (value) => {
17443
17551
  try {
@@ -17460,7 +17568,7 @@ var __async$n = (__this, __arguments, generator) => {
17460
17568
  const useFundingSourcesAddFunds = () => {
17461
17569
  const { client } = useShipEngine();
17462
17570
  return reactQuery.useMutation({
17463
- mutationFn: (_0) => __async$n(void 0, [_0], function* ({ funds, fundingSourceId }) {
17571
+ mutationFn: (_0) => __async$o(void 0, [_0], function* ({ funds, fundingSourceId }) {
17464
17572
  const result = yield client.fundingSources.addFunds(funds, fundingSourceId);
17465
17573
  return result.data;
17466
17574
  }),
@@ -17489,7 +17597,7 @@ const useListFundingSources = () => {
17489
17597
  });
17490
17598
  };
17491
17599
 
17492
- var __async$m = (__this, __arguments, generator) => {
17600
+ var __async$n = (__this, __arguments, generator) => {
17493
17601
  return new Promise((resolve, reject) => {
17494
17602
  var fulfilled = (value) => {
17495
17603
  try {
@@ -17512,7 +17620,7 @@ var __async$m = (__this, __arguments, generator) => {
17512
17620
  const useRegisterCarrier = () => {
17513
17621
  const { client } = useShipEngine();
17514
17622
  return reactQuery.useMutation({
17515
- mutationFn: (carrier) => __async$m(void 0, null, function* () {
17623
+ mutationFn: (carrier) => __async$n(void 0, null, function* () {
17516
17624
  const result = yield client.fundingSources.registerCarrier(carrier);
17517
17625
  return result.data;
17518
17626
  }),
@@ -17521,7 +17629,7 @@ const useRegisterCarrier = () => {
17521
17629
  });
17522
17630
  };
17523
17631
 
17524
- var __async$l = (__this, __arguments, generator) => {
17632
+ var __async$m = (__this, __arguments, generator) => {
17525
17633
  return new Promise((resolve, reject) => {
17526
17634
  var fulfilled = (value) => {
17527
17635
  try {
@@ -17544,7 +17652,7 @@ var __async$l = (__this, __arguments, generator) => {
17544
17652
  const useUpdateFundingSource = () => {
17545
17653
  const { client } = useShipEngine();
17546
17654
  return reactQuery.useMutation({
17547
- mutationFn: (_0) => __async$l(void 0, [_0], function* ({
17655
+ mutationFn: (_0) => __async$m(void 0, [_0], function* ({
17548
17656
  billingInfo,
17549
17657
  creditCardInfo,
17550
17658
  fundingSourceId
@@ -17612,7 +17720,7 @@ var __objRest$7 = (source, exclude) => {
17612
17720
  }
17613
17721
  return target;
17614
17722
  };
17615
- var __async$k = (__this, __arguments, generator) => {
17723
+ var __async$l = (__this, __arguments, generator) => {
17616
17724
  return new Promise((resolve, reject) => {
17617
17725
  var fulfilled = (value) => {
17618
17726
  try {
@@ -17635,7 +17743,7 @@ var __async$k = (__this, __arguments, generator) => {
17635
17743
  const useCreateLabel = () => {
17636
17744
  const { client } = useShipEngine();
17637
17745
  return reactQuery.useMutation({
17638
- mutationFn: (_a) => __async$k(void 0, null, function* () {
17746
+ mutationFn: (_a) => __async$l(void 0, null, function* () {
17639
17747
  var _b = _a, { rateId } = _b, options = __objRest$7(_b, ["rateId"]);
17640
17748
  const result = yield client.labels.createByRateId(rateId, options);
17641
17749
  return result.data;
@@ -17687,7 +17795,7 @@ const useListLabels = (_params) => {
17687
17795
  });
17688
17796
  };
17689
17797
 
17690
- var __async$j = (__this, __arguments, generator) => {
17798
+ var __async$k = (__this, __arguments, generator) => {
17691
17799
  return new Promise((resolve, reject) => {
17692
17800
  var fulfilled = (value) => {
17693
17801
  try {
@@ -17710,7 +17818,7 @@ var __async$j = (__this, __arguments, generator) => {
17710
17818
  const useVoidLabel = () => {
17711
17819
  const { client } = useShipEngine();
17712
17820
  return reactQuery.useMutation({
17713
- mutationFn: (labelId) => __async$j(void 0, null, function* () {
17821
+ mutationFn: (labelId) => __async$k(void 0, null, function* () {
17714
17822
  const result = yield client.labels.void(labelId);
17715
17823
  return result.data;
17716
17824
  }),
@@ -17729,7 +17837,7 @@ const useListOrderSources = () => {
17729
17837
  });
17730
17838
  };
17731
17839
 
17732
- var __async$i = (__this, __arguments, generator) => {
17840
+ var __async$j = (__this, __arguments, generator) => {
17733
17841
  return new Promise((resolve, reject) => {
17734
17842
  var fulfilled = (value) => {
17735
17843
  try {
@@ -17752,7 +17860,7 @@ var __async$i = (__this, __arguments, generator) => {
17752
17860
  const useRefreshOrderSourceAsync = () => {
17753
17861
  const { client } = useShipEngine();
17754
17862
  return reactQuery.useMutation({
17755
- mutationFn: (orderSourceId) => __async$i(void 0, null, function* () {
17863
+ mutationFn: (orderSourceId) => __async$j(void 0, null, function* () {
17756
17864
  const result = yield client.orderSources.refresh(orderSourceId);
17757
17865
  return result.data;
17758
17866
  }),
@@ -17763,9 +17871,9 @@ const useRefreshOrderSource = () => {
17763
17871
  const { client } = useShipEngine();
17764
17872
  const { mutateAsync: refreshOrderSourceAsync } = useRefreshOrderSourceAsync();
17765
17873
  return reactQuery.useMutation({
17766
- mutationFn: (orderSourceId) => __async$i(void 0, null, function* () {
17874
+ mutationFn: (orderSourceId) => __async$j(void 0, null, function* () {
17767
17875
  yield refreshOrderSourceAsync(orderSourceId);
17768
- const waitResult = yield retryUntil(() => __async$i(void 0, null, function* () {
17876
+ const waitResult = yield retryUntil(() => __async$j(void 0, null, function* () {
17769
17877
  const { data: checkResult } = yield client.orderSources.get(orderSourceId);
17770
17878
  if (["preparing_update", "updating"].includes(checkResult.refreshInfo.status)) {
17771
17879
  throw new CodedError("Order source is still refreshing");
@@ -17779,6 +17887,38 @@ const useRefreshOrderSource = () => {
17779
17887
  });
17780
17888
  };
17781
17889
 
17890
+ var __async$i = (__this, __arguments, generator) => {
17891
+ return new Promise((resolve, reject) => {
17892
+ var fulfilled = (value) => {
17893
+ try {
17894
+ step(generator.next(value));
17895
+ } catch (e) {
17896
+ reject(e);
17897
+ }
17898
+ };
17899
+ var rejected = (value) => {
17900
+ try {
17901
+ step(generator.throw(value));
17902
+ } catch (e) {
17903
+ reject(e);
17904
+ }
17905
+ };
17906
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
17907
+ step((generator = generator.apply(__this, __arguments)).next());
17908
+ });
17909
+ };
17910
+ const useDeactivateOrderSource = () => {
17911
+ const { client } = useShipEngine();
17912
+ return reactQuery.useMutation({
17913
+ mutationFn: (orderSourceId) => __async$i(void 0, null, function* () {
17914
+ const result = yield client.orderSources.deactivate(orderSourceId);
17915
+ return result.data;
17916
+ }),
17917
+ mutationKey: ["useDeactivateOrderSource"],
17918
+ onError
17919
+ });
17920
+ };
17921
+
17782
17922
  var __async$h = (__this, __arguments, generator) => {
17783
17923
  return new Promise((resolve, reject) => {
17784
17924
  var fulfilled = (value) => {
@@ -19771,6 +19911,7 @@ exports.AlchemyTestProvider = AlchemyTestProvider;
19771
19911
  exports.CarriersAPI = CarriersAPI;
19772
19912
  exports.CodedError = CodedError;
19773
19913
  exports.ConfirmationType = ConfirmationType;
19914
+ exports.ConnectionsAPI = ConnectionsAPI;
19774
19915
  exports.CreditCardVendor = CreditCardVendor;
19775
19916
  exports.Currency = Currency;
19776
19917
  exports.CustomPackagesAPI = CustomPackagesAPI;
@@ -19823,6 +19964,7 @@ exports.useCreateSalesOrderShipment = useCreateSalesOrderShipment;
19823
19964
  exports.useCreateShipment = useCreateShipment;
19824
19965
  exports.useCreateShippingRule = useCreateShippingRule;
19825
19966
  exports.useCreateWarehouse = useCreateWarehouse;
19967
+ exports.useDeactivateOrderSource = useDeactivateOrderSource;
19826
19968
  exports.useDeleteAccountImage = useDeleteAccountImage;
19827
19969
  exports.useDeleteRateCard = useDeleteRateCard;
19828
19970
  exports.useDeleteShippingRule = useDeleteShippingRule;
@@ -19835,6 +19977,7 @@ exports.useGetAccountImages = useGetAccountImages;
19835
19977
  exports.useGetAccountSettings = useGetAccountSettings;
19836
19978
  exports.useGetAutoFundingConfiguration = useGetAutoFundingConfiguration;
19837
19979
  exports.useGetCarrierById = useGetCarrierById;
19980
+ exports.useGetCarrierConnectionForm = useGetCarrierConnectionForm;
19838
19981
  exports.useGetCountriesByCarrier = useGetCountriesByCarrier;
19839
19982
  exports.useGetCurrenciesByCarrier = useGetCurrenciesByCarrier;
19840
19983
  exports.useGetFundingSourceById = useGetFundingSourceById;
@@ -19854,6 +19997,7 @@ exports.useGetShippingRuleConditionsOptions = useGetShippingRuleConditionsOption
19854
19997
  exports.useGetThemeById = useGetThemeById;
19855
19998
  exports.useGetZonesByCarrier = useGetZonesByCarrier;
19856
19999
  exports.useI18n = useI18n;
20000
+ exports.useListCarrierConnections = useListCarrierConnections;
19857
20001
  exports.useListCarriers = useListCarriers;
19858
20002
  exports.useListCustomPackageTypes = useListCustomPackageTypes;
19859
20003
  exports.useListFundingSources = useListFundingSources;