@shipengine/alchemy 6.0.21 → 6.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +553 -421
- package/index.mjs +546 -422
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -10812,17 +10812,17 @@ var AccountBillingPlanChangeType = /* @__PURE__ */ ((AccountBillingPlanChangeTyp
|
|
|
10812
10812
|
return AccountBillingPlanChangeType2;
|
|
10813
10813
|
})(AccountBillingPlanChangeType || {});
|
|
10814
10814
|
|
|
10815
|
-
var __getOwnPropSymbols$
|
|
10816
|
-
var __hasOwnProp$
|
|
10817
|
-
var __propIsEnum$
|
|
10815
|
+
var __getOwnPropSymbols$H = Object.getOwnPropertySymbols;
|
|
10816
|
+
var __hasOwnProp$H = Object.prototype.hasOwnProperty;
|
|
10817
|
+
var __propIsEnum$H = Object.prototype.propertyIsEnumerable;
|
|
10818
10818
|
var __objRest$p = (source, exclude) => {
|
|
10819
10819
|
var target = {};
|
|
10820
10820
|
for (var prop in source)
|
|
10821
|
-
if (__hasOwnProp$
|
|
10821
|
+
if (__hasOwnProp$H.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
10822
10822
|
target[prop] = source[prop];
|
|
10823
|
-
if (source != null && __getOwnPropSymbols$
|
|
10824
|
-
for (var prop of __getOwnPropSymbols$
|
|
10825
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
10823
|
+
if (source != null && __getOwnPropSymbols$H)
|
|
10824
|
+
for (var prop of __getOwnPropSymbols$H(source)) {
|
|
10825
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$H.call(source, prop))
|
|
10826
10826
|
target[prop] = source[prop];
|
|
10827
10827
|
}
|
|
10828
10828
|
return target;
|
|
@@ -10955,17 +10955,17 @@ const types = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
|
10955
10955
|
RateCardStatus
|
|
10956
10956
|
}, Symbol.toStringTag, { value: 'Module' }));
|
|
10957
10957
|
|
|
10958
|
-
var __getOwnPropSymbols$
|
|
10959
|
-
var __hasOwnProp$
|
|
10960
|
-
var __propIsEnum$
|
|
10958
|
+
var __getOwnPropSymbols$G = Object.getOwnPropertySymbols;
|
|
10959
|
+
var __hasOwnProp$G = Object.prototype.hasOwnProperty;
|
|
10960
|
+
var __propIsEnum$G = Object.prototype.propertyIsEnumerable;
|
|
10961
10961
|
var __objRest$o = (source, exclude) => {
|
|
10962
10962
|
var target = {};
|
|
10963
10963
|
for (var prop in source)
|
|
10964
|
-
if (__hasOwnProp$
|
|
10964
|
+
if (__hasOwnProp$G.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
10965
10965
|
target[prop] = source[prop];
|
|
10966
|
-
if (source != null && __getOwnPropSymbols$
|
|
10967
|
-
for (var prop of __getOwnPropSymbols$
|
|
10968
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
10966
|
+
if (source != null && __getOwnPropSymbols$G)
|
|
10967
|
+
for (var prop of __getOwnPropSymbols$G(source)) {
|
|
10968
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$G.call(source, prop))
|
|
10969
10969
|
target[prop] = source[prop];
|
|
10970
10970
|
}
|
|
10971
10971
|
return target;
|
|
@@ -13707,7 +13707,7 @@ var ipaddr = {
|
|
|
13707
13707
|
}).call(commonjsGlobal);
|
|
13708
13708
|
} (ipaddr));
|
|
13709
13709
|
|
|
13710
|
-
var __async$
|
|
13710
|
+
var __async$X = (__this, __arguments, generator) => {
|
|
13711
13711
|
return new Promise((resolve, reject) => {
|
|
13712
13712
|
var fulfilled = (value) => {
|
|
13713
13713
|
try {
|
|
@@ -13727,7 +13727,7 @@ var __async$U = (__this, __arguments, generator) => {
|
|
|
13727
13727
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
13728
13728
|
});
|
|
13729
13729
|
};
|
|
13730
|
-
const getEndUserIpAddress = () => __async$
|
|
13730
|
+
const getEndUserIpAddress = () => __async$X(void 0, null, function* () {
|
|
13731
13731
|
try {
|
|
13732
13732
|
const response = yield axios.get("https://api.ipify.org/?format=json");
|
|
13733
13733
|
if (response.data.ip && ipaddrExports.isValid(response.data.ip)) {
|
|
@@ -13739,38 +13739,69 @@ const getEndUserIpAddress = () => __async$U(void 0, null, function* () {
|
|
|
13739
13739
|
}
|
|
13740
13740
|
});
|
|
13741
13741
|
|
|
13742
|
-
|
|
13743
|
-
|
|
13744
|
-
|
|
13745
|
-
|
|
13746
|
-
|
|
13747
|
-
|
|
13748
|
-
|
|
13749
|
-
|
|
13742
|
+
const camelizeKeys = (obj) => {
|
|
13743
|
+
if (Array.isArray(obj)) {
|
|
13744
|
+
return obj.map(camelizeKeys);
|
|
13745
|
+
} else if (obj !== null && typeof obj === "object") {
|
|
13746
|
+
const newObj = {};
|
|
13747
|
+
for (const key in obj) {
|
|
13748
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
13749
|
+
const newKey = key.replace(/_([a-z])/g, (match, letter) => letter.toUpperCase());
|
|
13750
|
+
newObj[newKey] = camelizeKeys(obj[key]);
|
|
13751
|
+
}
|
|
13752
|
+
}
|
|
13753
|
+
return newObj;
|
|
13754
|
+
}
|
|
13755
|
+
return obj;
|
|
13756
|
+
};
|
|
13757
|
+
const decamelizeKeys = (obj, separator = "_") => {
|
|
13758
|
+
if (Array.isArray(obj)) {
|
|
13759
|
+
return obj.map((item) => decamelizeKeys(item, separator));
|
|
13760
|
+
} else if (obj !== null && typeof obj === "object") {
|
|
13761
|
+
const newObj = {};
|
|
13762
|
+
for (const key in obj) {
|
|
13763
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
13764
|
+
const newKey = key.replace(/([A-Z])/g, (match) => separator + match.toLowerCase());
|
|
13765
|
+
newObj[newKey] = decamelizeKeys(obj[key], separator);
|
|
13766
|
+
}
|
|
13767
|
+
}
|
|
13768
|
+
return newObj;
|
|
13769
|
+
}
|
|
13770
|
+
return obj;
|
|
13771
|
+
};
|
|
13772
|
+
|
|
13773
|
+
var __defProp$u = Object.defineProperty;
|
|
13774
|
+
var __defProps$o = Object.defineProperties;
|
|
13775
|
+
var __getOwnPropDescs$o = Object.getOwnPropertyDescriptors;
|
|
13776
|
+
var __getOwnPropSymbols$F = Object.getOwnPropertySymbols;
|
|
13777
|
+
var __hasOwnProp$F = Object.prototype.hasOwnProperty;
|
|
13778
|
+
var __propIsEnum$F = Object.prototype.propertyIsEnumerable;
|
|
13779
|
+
var __defNormalProp$u = (obj, key, value) => key in obj ? __defProp$u(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13780
|
+
var __spreadValues$u = (a, b) => {
|
|
13750
13781
|
for (var prop in b || (b = {}))
|
|
13751
|
-
if (__hasOwnProp$
|
|
13752
|
-
__defNormalProp$
|
|
13753
|
-
if (__getOwnPropSymbols$
|
|
13754
|
-
for (var prop of __getOwnPropSymbols$
|
|
13755
|
-
if (__propIsEnum$
|
|
13756
|
-
__defNormalProp$
|
|
13782
|
+
if (__hasOwnProp$F.call(b, prop))
|
|
13783
|
+
__defNormalProp$u(a, prop, b[prop]);
|
|
13784
|
+
if (__getOwnPropSymbols$F)
|
|
13785
|
+
for (var prop of __getOwnPropSymbols$F(b)) {
|
|
13786
|
+
if (__propIsEnum$F.call(b, prop))
|
|
13787
|
+
__defNormalProp$u(a, prop, b[prop]);
|
|
13757
13788
|
}
|
|
13758
13789
|
return a;
|
|
13759
13790
|
};
|
|
13760
|
-
var __spreadProps$
|
|
13791
|
+
var __spreadProps$o = (a, b) => __defProps$o(a, __getOwnPropDescs$o(b));
|
|
13761
13792
|
var __objRest$n = (source, exclude) => {
|
|
13762
13793
|
var target = {};
|
|
13763
13794
|
for (var prop in source)
|
|
13764
|
-
if (__hasOwnProp$
|
|
13795
|
+
if (__hasOwnProp$F.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
13765
13796
|
target[prop] = source[prop];
|
|
13766
|
-
if (source != null && __getOwnPropSymbols$
|
|
13767
|
-
for (var prop of __getOwnPropSymbols$
|
|
13768
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
13797
|
+
if (source != null && __getOwnPropSymbols$F)
|
|
13798
|
+
for (var prop of __getOwnPropSymbols$F(source)) {
|
|
13799
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$F.call(source, prop))
|
|
13769
13800
|
target[prop] = source[prop];
|
|
13770
13801
|
}
|
|
13771
13802
|
return target;
|
|
13772
13803
|
};
|
|
13773
|
-
var __async$
|
|
13804
|
+
var __async$W = (__this, __arguments, generator) => {
|
|
13774
13805
|
return new Promise((resolve, reject) => {
|
|
13775
13806
|
var fulfilled = (value) => {
|
|
13776
13807
|
try {
|
|
@@ -13810,12 +13841,12 @@ class CarriersAPI {
|
|
|
13810
13841
|
/**
|
|
13811
13842
|
* The `connect` method connects a carrier account to a user's ShipEngine account.
|
|
13812
13843
|
*/
|
|
13813
|
-
this.connect = (_a) => __async$
|
|
13844
|
+
this.connect = (_a) => __async$W(this, null, function* () {
|
|
13814
13845
|
var _b = _a, { carrierCode } = _b, connection = __objRest$n(_b, ["carrierCode"]);
|
|
13815
13846
|
const endUserIpAddress = yield getEndUserIpAddress();
|
|
13816
13847
|
if (!endUserIpAddress)
|
|
13817
13848
|
return Promise.reject([new CodedError("Unable to get IP address")]);
|
|
13818
|
-
return yield this.client.post(`/v1/registration/${carrierCode}`, __spreadProps$
|
|
13849
|
+
return yield this.client.post(`/v1/registration/${carrierCode}`, __spreadProps$o(__spreadValues$u({}, connection), {
|
|
13819
13850
|
endUserIpAddress
|
|
13820
13851
|
}));
|
|
13821
13852
|
});
|
|
@@ -13901,7 +13932,7 @@ class CarriersAPI {
|
|
|
13901
13932
|
}
|
|
13902
13933
|
}
|
|
13903
13934
|
|
|
13904
|
-
var __async$
|
|
13935
|
+
var __async$V = (__this, __arguments, generator) => {
|
|
13905
13936
|
return new Promise((resolve, reject) => {
|
|
13906
13937
|
var fulfilled = (value) => {
|
|
13907
13938
|
try {
|
|
@@ -13943,7 +13974,7 @@ class ConnectionsAPI {
|
|
|
13943
13974
|
/**
|
|
13944
13975
|
* The `connectCarrier` method connects a carrier to account.
|
|
13945
13976
|
*/
|
|
13946
|
-
this.connectCarrier = (carrierName, formData) => __async$
|
|
13977
|
+
this.connectCarrier = (carrierName, formData) => __async$V(this, null, function* () {
|
|
13947
13978
|
return yield this.client.post(
|
|
13948
13979
|
`/v1/connections/carriers/${carrierName}`,
|
|
13949
13980
|
formData,
|
|
@@ -13991,144 +14022,6 @@ class ConnectionsAPI {
|
|
|
13991
14022
|
|
|
13992
14023
|
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}();
|
|
13993
14024
|
|
|
13994
|
-
var humpsExports = {};
|
|
13995
|
-
var humps = {
|
|
13996
|
-
get exports(){ return humpsExports; },
|
|
13997
|
-
set exports(v){ humpsExports = v; },
|
|
13998
|
-
};
|
|
13999
|
-
|
|
14000
|
-
(function (module) {
|
|
14001
|
-
(function(global) {
|
|
14002
|
-
|
|
14003
|
-
var _processKeys = function(convert, obj, options) {
|
|
14004
|
-
if(!_isObject(obj) || _isDate(obj) || _isRegExp(obj) || _isBoolean(obj) || _isFunction(obj)) {
|
|
14005
|
-
return obj;
|
|
14006
|
-
}
|
|
14007
|
-
|
|
14008
|
-
var output,
|
|
14009
|
-
i = 0,
|
|
14010
|
-
l = 0;
|
|
14011
|
-
|
|
14012
|
-
if(_isArray(obj)) {
|
|
14013
|
-
output = [];
|
|
14014
|
-
for(l=obj.length; i<l; i++) {
|
|
14015
|
-
output.push(_processKeys(convert, obj[i], options));
|
|
14016
|
-
}
|
|
14017
|
-
}
|
|
14018
|
-
else {
|
|
14019
|
-
output = {};
|
|
14020
|
-
for(var key in obj) {
|
|
14021
|
-
if(Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
14022
|
-
output[convert(key, options)] = _processKeys(convert, obj[key], options);
|
|
14023
|
-
}
|
|
14024
|
-
}
|
|
14025
|
-
}
|
|
14026
|
-
return output;
|
|
14027
|
-
};
|
|
14028
|
-
|
|
14029
|
-
// String conversion methods
|
|
14030
|
-
|
|
14031
|
-
var separateWords = function(string, options) {
|
|
14032
|
-
options = options || {};
|
|
14033
|
-
var separator = options.separator || '_';
|
|
14034
|
-
var split = options.split || /(?=[A-Z])/;
|
|
14035
|
-
|
|
14036
|
-
return string.split(split).join(separator);
|
|
14037
|
-
};
|
|
14038
|
-
|
|
14039
|
-
var camelize = function(string) {
|
|
14040
|
-
if (_isNumerical(string)) {
|
|
14041
|
-
return string;
|
|
14042
|
-
}
|
|
14043
|
-
string = string.replace(/[\-_\s]+(.)?/g, function(match, chr) {
|
|
14044
|
-
return chr ? chr.toUpperCase() : '';
|
|
14045
|
-
});
|
|
14046
|
-
// Ensure 1st char is always lowercase
|
|
14047
|
-
return string.substr(0, 1).toLowerCase() + string.substr(1);
|
|
14048
|
-
};
|
|
14049
|
-
|
|
14050
|
-
var pascalize = function(string) {
|
|
14051
|
-
var camelized = camelize(string);
|
|
14052
|
-
// Ensure 1st char is always uppercase
|
|
14053
|
-
return camelized.substr(0, 1).toUpperCase() + camelized.substr(1);
|
|
14054
|
-
};
|
|
14055
|
-
|
|
14056
|
-
var decamelize = function(string, options) {
|
|
14057
|
-
return separateWords(string, options).toLowerCase();
|
|
14058
|
-
};
|
|
14059
|
-
|
|
14060
|
-
// Utilities
|
|
14061
|
-
// Taken from Underscore.js
|
|
14062
|
-
|
|
14063
|
-
var toString = Object.prototype.toString;
|
|
14064
|
-
|
|
14065
|
-
var _isFunction = function(obj) {
|
|
14066
|
-
return typeof(obj) === 'function';
|
|
14067
|
-
};
|
|
14068
|
-
var _isObject = function(obj) {
|
|
14069
|
-
return obj === Object(obj);
|
|
14070
|
-
};
|
|
14071
|
-
var _isArray = function(obj) {
|
|
14072
|
-
return toString.call(obj) == '[object Array]';
|
|
14073
|
-
};
|
|
14074
|
-
var _isDate = function(obj) {
|
|
14075
|
-
return toString.call(obj) == '[object Date]';
|
|
14076
|
-
};
|
|
14077
|
-
var _isRegExp = function(obj) {
|
|
14078
|
-
return toString.call(obj) == '[object RegExp]';
|
|
14079
|
-
};
|
|
14080
|
-
var _isBoolean = function(obj) {
|
|
14081
|
-
return toString.call(obj) == '[object Boolean]';
|
|
14082
|
-
};
|
|
14083
|
-
|
|
14084
|
-
// Performant way to determine if obj coerces to a number
|
|
14085
|
-
var _isNumerical = function(obj) {
|
|
14086
|
-
obj = obj - 0;
|
|
14087
|
-
return obj === obj;
|
|
14088
|
-
};
|
|
14089
|
-
|
|
14090
|
-
// Sets up function which handles processing keys
|
|
14091
|
-
// allowing the convert function to be modified by a callback
|
|
14092
|
-
var _processor = function(convert, options) {
|
|
14093
|
-
var callback = options && 'process' in options ? options.process : options;
|
|
14094
|
-
|
|
14095
|
-
if(typeof(callback) !== 'function') {
|
|
14096
|
-
return convert;
|
|
14097
|
-
}
|
|
14098
|
-
|
|
14099
|
-
return function(string, options) {
|
|
14100
|
-
return callback(string, convert, options);
|
|
14101
|
-
}
|
|
14102
|
-
};
|
|
14103
|
-
|
|
14104
|
-
var humps = {
|
|
14105
|
-
camelize: camelize,
|
|
14106
|
-
decamelize: decamelize,
|
|
14107
|
-
pascalize: pascalize,
|
|
14108
|
-
depascalize: decamelize,
|
|
14109
|
-
camelizeKeys: function(object, options) {
|
|
14110
|
-
return _processKeys(_processor(camelize, options), object);
|
|
14111
|
-
},
|
|
14112
|
-
decamelizeKeys: function(object, options) {
|
|
14113
|
-
return _processKeys(_processor(decamelize, options), object, options);
|
|
14114
|
-
},
|
|
14115
|
-
pascalizeKeys: function(object, options) {
|
|
14116
|
-
return _processKeys(_processor(pascalize, options), object);
|
|
14117
|
-
},
|
|
14118
|
-
depascalizeKeys: function () {
|
|
14119
|
-
return this.decamelizeKeys.apply(this, arguments);
|
|
14120
|
-
}
|
|
14121
|
-
};
|
|
14122
|
-
|
|
14123
|
-
if (module.exports) {
|
|
14124
|
-
module.exports = humps;
|
|
14125
|
-
} else {
|
|
14126
|
-
global.humps = humps;
|
|
14127
|
-
}
|
|
14128
|
-
|
|
14129
|
-
})(commonjsGlobal);
|
|
14130
|
-
} (humps));
|
|
14131
|
-
|
|
14132
14025
|
class InvalidTokenError extends Error {
|
|
14133
14026
|
}
|
|
14134
14027
|
InvalidTokenError.prototype.name = "InvalidTokenError";
|
|
@@ -16256,23 +16149,23 @@ class CustomPackagesAPI {
|
|
|
16256
16149
|
}
|
|
16257
16150
|
}
|
|
16258
16151
|
|
|
16259
|
-
var __defProp$
|
|
16260
|
-
var __getOwnPropSymbols$
|
|
16261
|
-
var __hasOwnProp$
|
|
16262
|
-
var __propIsEnum$
|
|
16263
|
-
var __defNormalProp$
|
|
16264
|
-
var __spreadValues$
|
|
16152
|
+
var __defProp$t = Object.defineProperty;
|
|
16153
|
+
var __getOwnPropSymbols$E = Object.getOwnPropertySymbols;
|
|
16154
|
+
var __hasOwnProp$E = Object.prototype.hasOwnProperty;
|
|
16155
|
+
var __propIsEnum$E = Object.prototype.propertyIsEnumerable;
|
|
16156
|
+
var __defNormalProp$t = (obj, key, value) => key in obj ? __defProp$t(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
16157
|
+
var __spreadValues$t = (a, b) => {
|
|
16265
16158
|
for (var prop in b || (b = {}))
|
|
16266
|
-
if (__hasOwnProp$
|
|
16267
|
-
__defNormalProp$
|
|
16268
|
-
if (__getOwnPropSymbols$
|
|
16269
|
-
for (var prop of __getOwnPropSymbols$
|
|
16270
|
-
if (__propIsEnum$
|
|
16271
|
-
__defNormalProp$
|
|
16159
|
+
if (__hasOwnProp$E.call(b, prop))
|
|
16160
|
+
__defNormalProp$t(a, prop, b[prop]);
|
|
16161
|
+
if (__getOwnPropSymbols$E)
|
|
16162
|
+
for (var prop of __getOwnPropSymbols$E(b)) {
|
|
16163
|
+
if (__propIsEnum$E.call(b, prop))
|
|
16164
|
+
__defNormalProp$t(a, prop, b[prop]);
|
|
16272
16165
|
}
|
|
16273
16166
|
return a;
|
|
16274
16167
|
};
|
|
16275
|
-
var __async$
|
|
16168
|
+
var __async$U = (__this, __arguments, generator) => {
|
|
16276
16169
|
return new Promise((resolve, reject) => {
|
|
16277
16170
|
var fulfilled = (value) => {
|
|
16278
16171
|
try {
|
|
@@ -16311,12 +16204,12 @@ class FundingSourcesAPI {
|
|
|
16311
16204
|
* The `create` method creates a new funding source for a given user. This requires
|
|
16312
16205
|
* payment information to be collected from the user.
|
|
16313
16206
|
*/
|
|
16314
|
-
this.create = (createFundingSource) => __async$
|
|
16207
|
+
this.create = (createFundingSource) => __async$U(this, null, function* () {
|
|
16315
16208
|
const endUserIpAddress = yield getEndUserIpAddress();
|
|
16316
16209
|
if (!endUserIpAddress) {
|
|
16317
16210
|
return Promise.reject([new CodedError("Unable to get IP address")]);
|
|
16318
16211
|
}
|
|
16319
|
-
return yield this.client.post("/v1/funding_sources", __spreadValues$
|
|
16212
|
+
return yield this.client.post("/v1/funding_sources", __spreadValues$t({
|
|
16320
16213
|
endUserIpAddress
|
|
16321
16214
|
}, createFundingSource));
|
|
16322
16215
|
});
|
|
@@ -16325,7 +16218,7 @@ class FundingSourcesAPI {
|
|
|
16325
16218
|
* user to update the billing address or payment information associated with the
|
|
16326
16219
|
* funding source.
|
|
16327
16220
|
*/
|
|
16328
|
-
this.update = (billingInfo, creditCardInfo, fundingSourceId) => __async$
|
|
16221
|
+
this.update = (billingInfo, creditCardInfo, fundingSourceId) => __async$U(this, null, function* () {
|
|
16329
16222
|
const endUserIpAddress = yield getEndUserIpAddress();
|
|
16330
16223
|
if (!endUserIpAddress) {
|
|
16331
16224
|
return Promise.reject([new CodedError("Unable to get IP address")]);
|
|
@@ -16343,19 +16236,19 @@ class FundingSourcesAPI {
|
|
|
16343
16236
|
* The `registerCarrier` method registers a carrier account and associates
|
|
16344
16237
|
* it with a given funding source.
|
|
16345
16238
|
*/
|
|
16346
|
-
this.registerCarrier = (carrier) => __async$
|
|
16239
|
+
this.registerCarrier = (carrier) => __async$U(this, null, function* () {
|
|
16347
16240
|
const endUserIpAddress = yield getEndUserIpAddress();
|
|
16348
16241
|
if (!endUserIpAddress) {
|
|
16349
16242
|
return Promise.reject([new CodedError("Unable to get IP address")]);
|
|
16350
16243
|
}
|
|
16351
|
-
return yield this.client.post("/v1/registration/funding_source", __spreadValues$
|
|
16244
|
+
return yield this.client.post("/v1/registration/funding_source", __spreadValues$t({
|
|
16352
16245
|
endUserIpAddress
|
|
16353
16246
|
}, carrier));
|
|
16354
16247
|
});
|
|
16355
16248
|
/**
|
|
16356
16249
|
* The `addFunds` method allows you to add funds to a funding source.
|
|
16357
16250
|
*/
|
|
16358
|
-
this.addFunds = (amount, fundingSourceId) => __async$
|
|
16251
|
+
this.addFunds = (amount, fundingSourceId) => __async$U(this, null, function* () {
|
|
16359
16252
|
return yield this.client.put(
|
|
16360
16253
|
`/v1/funding_sources/${fundingSourceId}/add_funds`,
|
|
16361
16254
|
amount
|
|
@@ -16365,7 +16258,7 @@ class FundingSourcesAPI {
|
|
|
16365
16258
|
* The `metadata` method returns seller-specific requirements for creating funding sources
|
|
16366
16259
|
* and attaching carriers
|
|
16367
16260
|
*/
|
|
16368
|
-
this.metadata = () => __async$
|
|
16261
|
+
this.metadata = () => __async$U(this, null, function* () {
|
|
16369
16262
|
return yield this.client.get("/v1/funding_sources/metadata");
|
|
16370
16263
|
});
|
|
16371
16264
|
/**
|
|
@@ -16417,6 +16310,55 @@ class InsuranceAPI {
|
|
|
16417
16310
|
}
|
|
16418
16311
|
}
|
|
16419
16312
|
|
|
16313
|
+
var __async$T = (__this, __arguments, generator) => {
|
|
16314
|
+
return new Promise((resolve, reject) => {
|
|
16315
|
+
var fulfilled = (value) => {
|
|
16316
|
+
try {
|
|
16317
|
+
step(generator.next(value));
|
|
16318
|
+
} catch (e) {
|
|
16319
|
+
reject(e);
|
|
16320
|
+
}
|
|
16321
|
+
};
|
|
16322
|
+
var rejected = (value) => {
|
|
16323
|
+
try {
|
|
16324
|
+
step(generator.throw(value));
|
|
16325
|
+
} catch (e) {
|
|
16326
|
+
reject(e);
|
|
16327
|
+
}
|
|
16328
|
+
};
|
|
16329
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
16330
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
16331
|
+
});
|
|
16332
|
+
};
|
|
16333
|
+
class InvoiceAddressAPI {
|
|
16334
|
+
constructor(client) {
|
|
16335
|
+
this.client = client;
|
|
16336
|
+
/**
|
|
16337
|
+
* The `get` method retrieves the invoice address for a given user.
|
|
16338
|
+
*/
|
|
16339
|
+
this.get = () => {
|
|
16340
|
+
return this.client.get("/v1/invoice_address");
|
|
16341
|
+
};
|
|
16342
|
+
/**
|
|
16343
|
+
* The `create` method creates a new invoice address for a given user.
|
|
16344
|
+
*/
|
|
16345
|
+
this.create = (invoiceAddress) => __async$T(this, null, function* () {
|
|
16346
|
+
return yield this.client.post("/v1/invoice_address", {
|
|
16347
|
+
invoiceAddress
|
|
16348
|
+
});
|
|
16349
|
+
});
|
|
16350
|
+
/**
|
|
16351
|
+
* The `update` method updates a invoice address for a given user.
|
|
16352
|
+
*/
|
|
16353
|
+
this.update = (invoiceAddress) => __async$T(this, null, function* () {
|
|
16354
|
+
return yield this.client.put("/v1/invoice_address", {
|
|
16355
|
+
invoiceAddress
|
|
16356
|
+
});
|
|
16357
|
+
});
|
|
16358
|
+
this.client = client;
|
|
16359
|
+
}
|
|
16360
|
+
}
|
|
16361
|
+
|
|
16420
16362
|
class LabelsAPI {
|
|
16421
16363
|
constructor(client) {
|
|
16422
16364
|
this.client = client;
|
|
@@ -16452,17 +16394,17 @@ class LabelsAPI {
|
|
|
16452
16394
|
}
|
|
16453
16395
|
}
|
|
16454
16396
|
|
|
16455
|
-
var __getOwnPropSymbols$
|
|
16456
|
-
var __hasOwnProp$
|
|
16457
|
-
var __propIsEnum$
|
|
16397
|
+
var __getOwnPropSymbols$D = Object.getOwnPropertySymbols;
|
|
16398
|
+
var __hasOwnProp$D = Object.prototype.hasOwnProperty;
|
|
16399
|
+
var __propIsEnum$D = Object.prototype.propertyIsEnumerable;
|
|
16458
16400
|
var __objRest$m = (source, exclude) => {
|
|
16459
16401
|
var target = {};
|
|
16460
16402
|
for (var prop in source)
|
|
16461
|
-
if (__hasOwnProp$
|
|
16403
|
+
if (__hasOwnProp$D.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
16462
16404
|
target[prop] = source[prop];
|
|
16463
|
-
if (source != null && __getOwnPropSymbols$
|
|
16464
|
-
for (var prop of __getOwnPropSymbols$
|
|
16465
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
16405
|
+
if (source != null && __getOwnPropSymbols$D)
|
|
16406
|
+
for (var prop of __getOwnPropSymbols$D(source)) {
|
|
16407
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$D.call(source, prop))
|
|
16466
16408
|
target[prop] = source[prop];
|
|
16467
16409
|
}
|
|
16468
16410
|
return target;
|
|
@@ -16583,19 +16525,19 @@ class RateCardsAPI {
|
|
|
16583
16525
|
}
|
|
16584
16526
|
}
|
|
16585
16527
|
|
|
16586
|
-
var __defProp$
|
|
16587
|
-
var __getOwnPropSymbols$
|
|
16588
|
-
var __hasOwnProp$
|
|
16589
|
-
var __propIsEnum$
|
|
16590
|
-
var __defNormalProp$
|
|
16591
|
-
var __spreadValues$
|
|
16528
|
+
var __defProp$s = Object.defineProperty;
|
|
16529
|
+
var __getOwnPropSymbols$C = Object.getOwnPropertySymbols;
|
|
16530
|
+
var __hasOwnProp$C = Object.prototype.hasOwnProperty;
|
|
16531
|
+
var __propIsEnum$C = Object.prototype.propertyIsEnumerable;
|
|
16532
|
+
var __defNormalProp$s = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
16533
|
+
var __spreadValues$s = (a, b) => {
|
|
16592
16534
|
for (var prop in b || (b = {}))
|
|
16593
|
-
if (__hasOwnProp$
|
|
16594
|
-
__defNormalProp$
|
|
16595
|
-
if (__getOwnPropSymbols$
|
|
16596
|
-
for (var prop of __getOwnPropSymbols$
|
|
16597
|
-
if (__propIsEnum$
|
|
16598
|
-
__defNormalProp$
|
|
16535
|
+
if (__hasOwnProp$C.call(b, prop))
|
|
16536
|
+
__defNormalProp$s(a, prop, b[prop]);
|
|
16537
|
+
if (__getOwnPropSymbols$C)
|
|
16538
|
+
for (var prop of __getOwnPropSymbols$C(b)) {
|
|
16539
|
+
if (__propIsEnum$C.call(b, prop))
|
|
16540
|
+
__defNormalProp$s(a, prop, b[prop]);
|
|
16599
16541
|
}
|
|
16600
16542
|
return a;
|
|
16601
16543
|
};
|
|
@@ -16617,7 +16559,7 @@ class RatesAPI {
|
|
|
16617
16559
|
* method.
|
|
16618
16560
|
*/
|
|
16619
16561
|
this.estimate = (params) => {
|
|
16620
|
-
return this.client.post("/v1/rates/estimate", __spreadValues$
|
|
16562
|
+
return this.client.post("/v1/rates/estimate", __spreadValues$s({}, params));
|
|
16621
16563
|
};
|
|
16622
16564
|
this.client = client;
|
|
16623
16565
|
}
|
|
@@ -16629,10 +16571,14 @@ class SalesOrderShipmentsAPI {
|
|
|
16629
16571
|
/**
|
|
16630
16572
|
* The `list` method retrieves a list of sales order shipments for a given user.
|
|
16631
16573
|
*/
|
|
16632
|
-
this.list = (body
|
|
16633
|
-
return this.client.post("/v-beta/shipments/list", body
|
|
16634
|
-
|
|
16635
|
-
|
|
16574
|
+
this.list = (body) => {
|
|
16575
|
+
return this.client.post("/v-beta/shipments/list", body);
|
|
16576
|
+
};
|
|
16577
|
+
/**
|
|
16578
|
+
* The `listShipmentsByExternalOrderId` method retrieves a list of shipments associated to a sales order that matches `externalOrderId`
|
|
16579
|
+
*/
|
|
16580
|
+
this.listShipmentsByExternalOrderId = (externalOrderId) => {
|
|
16581
|
+
return this.client.get(`/v-beta/shipments/external_order_id/${externalOrderId}`);
|
|
16636
16582
|
};
|
|
16637
16583
|
/**
|
|
16638
16584
|
* The `get` method retrieves a specific sales order shipment by `shipmentId`.
|
|
@@ -16674,6 +16620,13 @@ class SalesOrdersAPI {
|
|
|
16674
16620
|
this.get = (salesOrderId) => {
|
|
16675
16621
|
return this.client.get(`/v-beta/sales_orders/${salesOrderId}`);
|
|
16676
16622
|
};
|
|
16623
|
+
/**
|
|
16624
|
+
* The `getByExternalId` method retrieves a specific sales order by its `externalOrderId`.
|
|
16625
|
+
* @param externalOrderId Id that matches that of the desired sales order.
|
|
16626
|
+
*/
|
|
16627
|
+
this.getByExternalId = (externalOrderId) => {
|
|
16628
|
+
return this.client.get(`/v-beta/sales_orders/external_order_id/${externalOrderId}`);
|
|
16629
|
+
};
|
|
16677
16630
|
/**
|
|
16678
16631
|
* The `notifyShipped` method notifies order source that the order has been
|
|
16679
16632
|
* shipped. Typically, the order source will then notify the user based on
|
|
@@ -16686,7 +16639,7 @@ class SalesOrdersAPI {
|
|
|
16686
16639
|
}
|
|
16687
16640
|
}
|
|
16688
16641
|
|
|
16689
|
-
var __async$
|
|
16642
|
+
var __async$S = (__this, __arguments, generator) => {
|
|
16690
16643
|
return new Promise((resolve, reject) => {
|
|
16691
16644
|
var fulfilled = (value) => {
|
|
16692
16645
|
try {
|
|
@@ -16744,7 +16697,7 @@ class SellersAPI {
|
|
|
16744
16697
|
/**
|
|
16745
16698
|
* Deletes an API Key
|
|
16746
16699
|
*/
|
|
16747
|
-
this.deleteSellerApiKey = (_0) => __async$
|
|
16700
|
+
this.deleteSellerApiKey = (_0) => __async$S(this, [_0], function* ({
|
|
16748
16701
|
encryptedApiKey,
|
|
16749
16702
|
sellerId,
|
|
16750
16703
|
isSandbox
|
|
@@ -16790,19 +16743,19 @@ class SellersAPI {
|
|
|
16790
16743
|
}
|
|
16791
16744
|
}
|
|
16792
16745
|
|
|
16793
|
-
var __defProp$
|
|
16794
|
-
var __getOwnPropSymbols$
|
|
16795
|
-
var __hasOwnProp$
|
|
16796
|
-
var __propIsEnum$
|
|
16797
|
-
var __defNormalProp$
|
|
16798
|
-
var __spreadValues$
|
|
16746
|
+
var __defProp$r = Object.defineProperty;
|
|
16747
|
+
var __getOwnPropSymbols$B = Object.getOwnPropertySymbols;
|
|
16748
|
+
var __hasOwnProp$B = Object.prototype.hasOwnProperty;
|
|
16749
|
+
var __propIsEnum$B = Object.prototype.propertyIsEnumerable;
|
|
16750
|
+
var __defNormalProp$r = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
16751
|
+
var __spreadValues$r = (a, b) => {
|
|
16799
16752
|
for (var prop in b || (b = {}))
|
|
16800
|
-
if (__hasOwnProp$
|
|
16801
|
-
__defNormalProp$
|
|
16802
|
-
if (__getOwnPropSymbols$
|
|
16803
|
-
for (var prop of __getOwnPropSymbols$
|
|
16804
|
-
if (__propIsEnum$
|
|
16805
|
-
__defNormalProp$
|
|
16753
|
+
if (__hasOwnProp$B.call(b, prop))
|
|
16754
|
+
__defNormalProp$r(a, prop, b[prop]);
|
|
16755
|
+
if (__getOwnPropSymbols$B)
|
|
16756
|
+
for (var prop of __getOwnPropSymbols$B(b)) {
|
|
16757
|
+
if (__propIsEnum$B.call(b, prop))
|
|
16758
|
+
__defNormalProp$r(a, prop, b[prop]);
|
|
16806
16759
|
}
|
|
16807
16760
|
return a;
|
|
16808
16761
|
};
|
|
@@ -16814,7 +16767,7 @@ class ServicePointsAPI {
|
|
|
16814
16767
|
* Either an address, coordinates, or an address query
|
|
16815
16768
|
*/
|
|
16816
16769
|
this.list = (options) => {
|
|
16817
|
-
return this.client.post("/v1/service_points/list", __spreadValues$
|
|
16770
|
+
return this.client.post("/v1/service_points/list", __spreadValues$r({}, options));
|
|
16818
16771
|
};
|
|
16819
16772
|
/**
|
|
16820
16773
|
* Get a specific service point by its carrier code, country code, and id
|
|
@@ -16832,7 +16785,7 @@ class ServicePointsAPI {
|
|
|
16832
16785
|
}
|
|
16833
16786
|
}
|
|
16834
16787
|
|
|
16835
|
-
var __async$
|
|
16788
|
+
var __async$R = (__this, __arguments, generator) => {
|
|
16836
16789
|
return new Promise((resolve, reject) => {
|
|
16837
16790
|
var fulfilled = (value) => {
|
|
16838
16791
|
try {
|
|
@@ -16881,7 +16834,7 @@ class ShipmentsAPI {
|
|
|
16881
16834
|
* The `create` method allows for creating shipments based on a list of shipment
|
|
16882
16835
|
* items passed into this method.
|
|
16883
16836
|
*/
|
|
16884
|
-
this.create = (...shipments) => __async$
|
|
16837
|
+
this.create = (...shipments) => __async$R(this, null, function* () {
|
|
16885
16838
|
return this.client.post("/v1/shipments", {
|
|
16886
16839
|
shipments
|
|
16887
16840
|
});
|
|
@@ -34273,26 +34226,26 @@ class WebhooksAPI {
|
|
|
34273
34226
|
}
|
|
34274
34227
|
}
|
|
34275
34228
|
|
|
34276
|
-
var __defProp$
|
|
34277
|
-
var __defProps$
|
|
34278
|
-
var __getOwnPropDescs$
|
|
34279
|
-
var __getOwnPropSymbols$
|
|
34280
|
-
var __hasOwnProp$
|
|
34281
|
-
var __propIsEnum$
|
|
34282
|
-
var __defNormalProp$
|
|
34283
|
-
var __spreadValues$
|
|
34229
|
+
var __defProp$q = Object.defineProperty;
|
|
34230
|
+
var __defProps$n = Object.defineProperties;
|
|
34231
|
+
var __getOwnPropDescs$n = Object.getOwnPropertyDescriptors;
|
|
34232
|
+
var __getOwnPropSymbols$A = Object.getOwnPropertySymbols;
|
|
34233
|
+
var __hasOwnProp$A = Object.prototype.hasOwnProperty;
|
|
34234
|
+
var __propIsEnum$A = Object.prototype.propertyIsEnumerable;
|
|
34235
|
+
var __defNormalProp$q = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
34236
|
+
var __spreadValues$q = (a, b) => {
|
|
34284
34237
|
for (var prop in b || (b = {}))
|
|
34285
|
-
if (__hasOwnProp$
|
|
34286
|
-
__defNormalProp$
|
|
34287
|
-
if (__getOwnPropSymbols$
|
|
34288
|
-
for (var prop of __getOwnPropSymbols$
|
|
34289
|
-
if (__propIsEnum$
|
|
34290
|
-
__defNormalProp$
|
|
34238
|
+
if (__hasOwnProp$A.call(b, prop))
|
|
34239
|
+
__defNormalProp$q(a, prop, b[prop]);
|
|
34240
|
+
if (__getOwnPropSymbols$A)
|
|
34241
|
+
for (var prop of __getOwnPropSymbols$A(b)) {
|
|
34242
|
+
if (__propIsEnum$A.call(b, prop))
|
|
34243
|
+
__defNormalProp$q(a, prop, b[prop]);
|
|
34291
34244
|
}
|
|
34292
34245
|
return a;
|
|
34293
34246
|
};
|
|
34294
|
-
var __spreadProps$
|
|
34295
|
-
var __async$
|
|
34247
|
+
var __spreadProps$n = (a, b) => __defProps$n(a, __getOwnPropDescs$n(b));
|
|
34248
|
+
var __async$Q = (__this, __arguments, generator) => {
|
|
34296
34249
|
return new Promise((resolve, reject) => {
|
|
34297
34250
|
var fulfilled = (value) => {
|
|
34298
34251
|
try {
|
|
@@ -34315,7 +34268,7 @@ var __async$O = (__this, __arguments, generator) => {
|
|
|
34315
34268
|
const logger$1 = E({
|
|
34316
34269
|
level: process.env.NODE_ENV === "production" ? "fatal" : "info",
|
|
34317
34270
|
name: "shipengine-api",
|
|
34318
|
-
serializers: __spreadProps$
|
|
34271
|
+
serializers: __spreadProps$n(__spreadValues$q({}, k), {
|
|
34319
34272
|
req: (req) => ({
|
|
34320
34273
|
headers: req.headers,
|
|
34321
34274
|
method: req.method,
|
|
@@ -34340,14 +34293,14 @@ class ShipEngineAPI {
|
|
|
34340
34293
|
this.getSandboxToken = getSandboxToken;
|
|
34341
34294
|
const client = axios.create({
|
|
34342
34295
|
baseURL,
|
|
34343
|
-
headers: __spreadProps$
|
|
34296
|
+
headers: __spreadProps$n(__spreadValues$q({}, headers), {
|
|
34344
34297
|
"Content-Type": "application/json"
|
|
34345
34298
|
}),
|
|
34346
|
-
paramsSerializer: (params) => lib.stringify(
|
|
34299
|
+
paramsSerializer: (params) => lib.stringify(decamelizeKeys(params), { arrayFormat: "brackets" }),
|
|
34347
34300
|
transformRequest: [
|
|
34348
34301
|
(data) => {
|
|
34349
34302
|
if (data && !(data instanceof FormData))
|
|
34350
|
-
return
|
|
34303
|
+
return decamelizeKeys(data);
|
|
34351
34304
|
else
|
|
34352
34305
|
return data;
|
|
34353
34306
|
},
|
|
@@ -34367,7 +34320,7 @@ class ShipEngineAPI {
|
|
|
34367
34320
|
},
|
|
34368
34321
|
(data) => {
|
|
34369
34322
|
if (data && !(data instanceof Blob))
|
|
34370
|
-
return
|
|
34323
|
+
return camelizeKeys(data);
|
|
34371
34324
|
else
|
|
34372
34325
|
return data;
|
|
34373
34326
|
}
|
|
@@ -34375,7 +34328,7 @@ class ShipEngineAPI {
|
|
|
34375
34328
|
});
|
|
34376
34329
|
client.defaults.headers.common["Authorization"] = `Bearer ${token}`;
|
|
34377
34330
|
client.interceptors.request.use(
|
|
34378
|
-
(config) => __async$
|
|
34331
|
+
(config) => __async$Q(this, null, function* () {
|
|
34379
34332
|
if (config.isSandbox) {
|
|
34380
34333
|
if (!this.sandboxToken) {
|
|
34381
34334
|
this.sandboxToken = yield getSandboxToken == null ? void 0 : getSandboxToken();
|
|
@@ -34402,7 +34355,7 @@ class ShipEngineAPI {
|
|
|
34402
34355
|
);
|
|
34403
34356
|
return res;
|
|
34404
34357
|
},
|
|
34405
|
-
(err) => __async$
|
|
34358
|
+
(err) => __async$Q(this, null, function* () {
|
|
34406
34359
|
var _a, _b, _c, _d, _e;
|
|
34407
34360
|
logger$1.error(
|
|
34408
34361
|
{ err, req: err.config, res: err.response },
|
|
@@ -34449,7 +34402,7 @@ class ShipEngineAPI {
|
|
|
34449
34402
|
* that token (also known as Seller ID)
|
|
34450
34403
|
*/
|
|
34451
34404
|
getTenant(isSandbox) {
|
|
34452
|
-
return __async$
|
|
34405
|
+
return __async$Q(this, null, function* () {
|
|
34453
34406
|
var _a;
|
|
34454
34407
|
if (!isSandbox) {
|
|
34455
34408
|
return this.getTenantFromToken(this.token);
|
|
@@ -34540,6 +34493,15 @@ class ShipEngineAPI {
|
|
|
34540
34493
|
get insurance() {
|
|
34541
34494
|
return new InsuranceAPI(this.client);
|
|
34542
34495
|
}
|
|
34496
|
+
/**
|
|
34497
|
+
* The `invoiceAddress` method provides access to the Invoice Address endpoints
|
|
34498
|
+
* in ShipEngine API.
|
|
34499
|
+
*
|
|
34500
|
+
* @see {@link InvoiceAddress | The Invoice Address API module}
|
|
34501
|
+
*/
|
|
34502
|
+
get invoiceAddress() {
|
|
34503
|
+
return new InvoiceAddressAPI(this.client);
|
|
34504
|
+
}
|
|
34543
34505
|
/**
|
|
34544
34506
|
* The `labels` method provides access to the Label endpoints in ShipEngine API.
|
|
34545
34507
|
* e.g. Create Label, Get Label, Void Label, etc.
|
|
@@ -34719,25 +34681,25 @@ const delay = (ms) => new Promise((resolve) => {
|
|
|
34719
34681
|
|
|
34720
34682
|
const onError = (_errors) => _default();
|
|
34721
34683
|
|
|
34722
|
-
var __defProp$
|
|
34723
|
-
var __defProps$
|
|
34724
|
-
var __getOwnPropDescs$
|
|
34725
|
-
var __getOwnPropSymbols$
|
|
34726
|
-
var __hasOwnProp$
|
|
34727
|
-
var __propIsEnum$
|
|
34728
|
-
var __defNormalProp$
|
|
34729
|
-
var __spreadValues$
|
|
34684
|
+
var __defProp$p = Object.defineProperty;
|
|
34685
|
+
var __defProps$m = Object.defineProperties;
|
|
34686
|
+
var __getOwnPropDescs$m = Object.getOwnPropertyDescriptors;
|
|
34687
|
+
var __getOwnPropSymbols$z = Object.getOwnPropertySymbols;
|
|
34688
|
+
var __hasOwnProp$z = Object.prototype.hasOwnProperty;
|
|
34689
|
+
var __propIsEnum$z = Object.prototype.propertyIsEnumerable;
|
|
34690
|
+
var __defNormalProp$p = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
34691
|
+
var __spreadValues$p = (a, b) => {
|
|
34730
34692
|
for (var prop in b || (b = {}))
|
|
34731
|
-
if (__hasOwnProp$
|
|
34732
|
-
__defNormalProp$
|
|
34733
|
-
if (__getOwnPropSymbols$
|
|
34734
|
-
for (var prop of __getOwnPropSymbols$
|
|
34735
|
-
if (__propIsEnum$
|
|
34736
|
-
__defNormalProp$
|
|
34693
|
+
if (__hasOwnProp$z.call(b, prop))
|
|
34694
|
+
__defNormalProp$p(a, prop, b[prop]);
|
|
34695
|
+
if (__getOwnPropSymbols$z)
|
|
34696
|
+
for (var prop of __getOwnPropSymbols$z(b)) {
|
|
34697
|
+
if (__propIsEnum$z.call(b, prop))
|
|
34698
|
+
__defNormalProp$p(a, prop, b[prop]);
|
|
34737
34699
|
}
|
|
34738
34700
|
return a;
|
|
34739
34701
|
};
|
|
34740
|
-
var __spreadProps$
|
|
34702
|
+
var __spreadProps$m = (a, b) => __defProps$m(a, __getOwnPropDescs$m(b));
|
|
34741
34703
|
const streams = [];
|
|
34742
34704
|
if (process.env.NODE_ENV === "production") {
|
|
34743
34705
|
streams.push({
|
|
@@ -34746,7 +34708,7 @@ if (process.env.NODE_ENV === "production") {
|
|
|
34746
34708
|
}
|
|
34747
34709
|
const logger = E({
|
|
34748
34710
|
name: "shipengine",
|
|
34749
|
-
serializers: __spreadProps$
|
|
34711
|
+
serializers: __spreadProps$m(__spreadValues$p({}, k), {
|
|
34750
34712
|
req: (req) => ({
|
|
34751
34713
|
headers: req.headers,
|
|
34752
34714
|
method: req.method,
|
|
@@ -34771,7 +34733,7 @@ const retryUntil = (callbackFn, retries = 10, timeoutBetweenAttempts = 1e3) => P
|
|
|
34771
34733
|
throw error;
|
|
34772
34734
|
});
|
|
34773
34735
|
|
|
34774
|
-
var __async$
|
|
34736
|
+
var __async$P = (__this, __arguments, generator) => {
|
|
34775
34737
|
return new Promise((resolve, reject) => {
|
|
34776
34738
|
var fulfilled = (value) => {
|
|
34777
34739
|
try {
|
|
@@ -34794,7 +34756,7 @@ var __async$N = (__this, __arguments, generator) => {
|
|
|
34794
34756
|
const useCreateAccountImage = () => {
|
|
34795
34757
|
const { client } = useShipEngine();
|
|
34796
34758
|
return reactQuery.useMutation({
|
|
34797
|
-
mutationFn: (data) => __async$
|
|
34759
|
+
mutationFn: (data) => __async$P(void 0, null, function* () {
|
|
34798
34760
|
const result = yield client.accountSettings.createImage(data);
|
|
34799
34761
|
return result.data;
|
|
34800
34762
|
}),
|
|
@@ -34803,7 +34765,7 @@ const useCreateAccountImage = () => {
|
|
|
34803
34765
|
});
|
|
34804
34766
|
};
|
|
34805
34767
|
|
|
34806
|
-
var __async$
|
|
34768
|
+
var __async$O = (__this, __arguments, generator) => {
|
|
34807
34769
|
return new Promise((resolve, reject) => {
|
|
34808
34770
|
var fulfilled = (value) => {
|
|
34809
34771
|
try {
|
|
@@ -34826,7 +34788,7 @@ var __async$M = (__this, __arguments, generator) => {
|
|
|
34826
34788
|
const useDeleteAccountImage = () => {
|
|
34827
34789
|
const { client } = useShipEngine();
|
|
34828
34790
|
return reactQuery.useMutation({
|
|
34829
|
-
mutationFn: (labelImageId) => __async$
|
|
34791
|
+
mutationFn: (labelImageId) => __async$O(void 0, null, function* () {
|
|
34830
34792
|
const result = yield client.accountSettings.deleteImage(labelImageId);
|
|
34831
34793
|
return result.data;
|
|
34832
34794
|
}),
|
|
@@ -34855,7 +34817,7 @@ const useGetAccountSettings = () => {
|
|
|
34855
34817
|
});
|
|
34856
34818
|
};
|
|
34857
34819
|
|
|
34858
|
-
var __async$
|
|
34820
|
+
var __async$N = (__this, __arguments, generator) => {
|
|
34859
34821
|
return new Promise((resolve, reject) => {
|
|
34860
34822
|
var fulfilled = (value) => {
|
|
34861
34823
|
try {
|
|
@@ -34878,7 +34840,7 @@ var __async$L = (__this, __arguments, generator) => {
|
|
|
34878
34840
|
const useUpdateAccountImage = () => {
|
|
34879
34841
|
const { client } = useShipEngine();
|
|
34880
34842
|
return reactQuery.useMutation({
|
|
34881
|
-
mutationFn: (data) => __async$
|
|
34843
|
+
mutationFn: (data) => __async$N(void 0, null, function* () {
|
|
34882
34844
|
const result = yield client.accountSettings.updateImage(data);
|
|
34883
34845
|
return result.data;
|
|
34884
34846
|
}),
|
|
@@ -34887,7 +34849,7 @@ const useUpdateAccountImage = () => {
|
|
|
34887
34849
|
});
|
|
34888
34850
|
};
|
|
34889
34851
|
|
|
34890
|
-
var __async$
|
|
34852
|
+
var __async$M = (__this, __arguments, generator) => {
|
|
34891
34853
|
return new Promise((resolve, reject) => {
|
|
34892
34854
|
var fulfilled = (value) => {
|
|
34893
34855
|
try {
|
|
@@ -34910,7 +34872,7 @@ var __async$K = (__this, __arguments, generator) => {
|
|
|
34910
34872
|
const useUpdateAccountSettings = () => {
|
|
34911
34873
|
const { client } = useShipEngine();
|
|
34912
34874
|
return reactQuery.useMutation({
|
|
34913
|
-
mutationFn: (settings) => __async$
|
|
34875
|
+
mutationFn: (settings) => __async$M(void 0, null, function* () {
|
|
34914
34876
|
const result = yield client.accountSettings.update(settings);
|
|
34915
34877
|
return result.data;
|
|
34916
34878
|
}),
|
|
@@ -34919,7 +34881,7 @@ const useUpdateAccountSettings = () => {
|
|
|
34919
34881
|
});
|
|
34920
34882
|
};
|
|
34921
34883
|
|
|
34922
|
-
var __async$
|
|
34884
|
+
var __async$L = (__this, __arguments, generator) => {
|
|
34923
34885
|
return new Promise((resolve, reject) => {
|
|
34924
34886
|
var fulfilled = (value) => {
|
|
34925
34887
|
try {
|
|
@@ -34942,7 +34904,7 @@ var __async$J = (__this, __arguments, generator) => {
|
|
|
34942
34904
|
const useParseAddress = () => {
|
|
34943
34905
|
const { client } = useShipEngine();
|
|
34944
34906
|
return reactQuery.useMutation({
|
|
34945
|
-
mutationFn: (_0) => __async$
|
|
34907
|
+
mutationFn: (_0) => __async$L(void 0, [_0], function* ({ address, text }) {
|
|
34946
34908
|
const result = yield client.addresses.parse(text, address);
|
|
34947
34909
|
return result.data;
|
|
34948
34910
|
}),
|
|
@@ -34951,7 +34913,7 @@ const useParseAddress = () => {
|
|
|
34951
34913
|
});
|
|
34952
34914
|
};
|
|
34953
34915
|
|
|
34954
|
-
var __async$
|
|
34916
|
+
var __async$K = (__this, __arguments, generator) => {
|
|
34955
34917
|
return new Promise((resolve, reject) => {
|
|
34956
34918
|
var fulfilled = (value) => {
|
|
34957
34919
|
try {
|
|
@@ -34974,7 +34936,7 @@ var __async$I = (__this, __arguments, generator) => {
|
|
|
34974
34936
|
const useValidateAddresses = () => {
|
|
34975
34937
|
const { client } = useShipEngine();
|
|
34976
34938
|
return reactQuery.useMutation({
|
|
34977
|
-
mutationFn: (addresses) => __async$
|
|
34939
|
+
mutationFn: (addresses) => __async$K(void 0, null, function* () {
|
|
34978
34940
|
const result = yield client.addresses.validate(addresses);
|
|
34979
34941
|
return result.data;
|
|
34980
34942
|
}),
|
|
@@ -34983,7 +34945,7 @@ const useValidateAddresses = () => {
|
|
|
34983
34945
|
});
|
|
34984
34946
|
};
|
|
34985
34947
|
|
|
34986
|
-
var __async$
|
|
34948
|
+
var __async$J = (__this, __arguments, generator) => {
|
|
34987
34949
|
return new Promise((resolve, reject) => {
|
|
34988
34950
|
var fulfilled = (value) => {
|
|
34989
34951
|
try {
|
|
@@ -35006,7 +34968,7 @@ var __async$H = (__this, __arguments, generator) => {
|
|
|
35006
34968
|
const useAddFunds = () => {
|
|
35007
34969
|
const { client } = useShipEngine();
|
|
35008
34970
|
return reactQuery.useMutation({
|
|
35009
|
-
mutationFn: (_0) => __async$
|
|
34971
|
+
mutationFn: (_0) => __async$J(void 0, [_0], function* ({ carrierId, funds }) {
|
|
35010
34972
|
const result = yield client.carriers.addFunds(carrierId, funds);
|
|
35011
34973
|
return result.data;
|
|
35012
34974
|
}),
|
|
@@ -35015,7 +34977,7 @@ const useAddFunds = () => {
|
|
|
35015
34977
|
});
|
|
35016
34978
|
};
|
|
35017
34979
|
|
|
35018
|
-
var __async$
|
|
34980
|
+
var __async$I = (__this, __arguments, generator) => {
|
|
35019
34981
|
return new Promise((resolve, reject) => {
|
|
35020
34982
|
var fulfilled = (value) => {
|
|
35021
34983
|
try {
|
|
@@ -35038,7 +35000,7 @@ var __async$G = (__this, __arguments, generator) => {
|
|
|
35038
35000
|
const useConnectCarrier = () => {
|
|
35039
35001
|
const { client } = useShipEngine();
|
|
35040
35002
|
return reactQuery.useMutation({
|
|
35041
|
-
mutationFn: (params) => __async$
|
|
35003
|
+
mutationFn: (params) => __async$I(void 0, null, function* () {
|
|
35042
35004
|
const result = yield client.carriers.connect(params);
|
|
35043
35005
|
return result.data;
|
|
35044
35006
|
}),
|
|
@@ -35147,41 +35109,41 @@ const useGetServicesByCarrier = (carrierId) => {
|
|
|
35147
35109
|
});
|
|
35148
35110
|
};
|
|
35149
35111
|
|
|
35150
|
-
var __defProp$
|
|
35151
|
-
var __defProps$
|
|
35152
|
-
var __getOwnPropDescs$
|
|
35153
|
-
var __getOwnPropSymbols$
|
|
35154
|
-
var __hasOwnProp$
|
|
35155
|
-
var __propIsEnum$
|
|
35156
|
-
var __defNormalProp$
|
|
35157
|
-
var __spreadValues$
|
|
35112
|
+
var __defProp$o = Object.defineProperty;
|
|
35113
|
+
var __defProps$l = Object.defineProperties;
|
|
35114
|
+
var __getOwnPropDescs$l = Object.getOwnPropertyDescriptors;
|
|
35115
|
+
var __getOwnPropSymbols$y = Object.getOwnPropertySymbols;
|
|
35116
|
+
var __hasOwnProp$y = Object.prototype.hasOwnProperty;
|
|
35117
|
+
var __propIsEnum$y = Object.prototype.propertyIsEnumerable;
|
|
35118
|
+
var __defNormalProp$o = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
35119
|
+
var __spreadValues$o = (a, b) => {
|
|
35158
35120
|
for (var prop in b || (b = {}))
|
|
35159
|
-
if (__hasOwnProp$
|
|
35160
|
-
__defNormalProp$
|
|
35161
|
-
if (__getOwnPropSymbols$
|
|
35162
|
-
for (var prop of __getOwnPropSymbols$
|
|
35163
|
-
if (__propIsEnum$
|
|
35164
|
-
__defNormalProp$
|
|
35121
|
+
if (__hasOwnProp$y.call(b, prop))
|
|
35122
|
+
__defNormalProp$o(a, prop, b[prop]);
|
|
35123
|
+
if (__getOwnPropSymbols$y)
|
|
35124
|
+
for (var prop of __getOwnPropSymbols$y(b)) {
|
|
35125
|
+
if (__propIsEnum$y.call(b, prop))
|
|
35126
|
+
__defNormalProp$o(a, prop, b[prop]);
|
|
35165
35127
|
}
|
|
35166
35128
|
return a;
|
|
35167
35129
|
};
|
|
35168
|
-
var __spreadProps$
|
|
35130
|
+
var __spreadProps$l = (a, b) => __defProps$l(a, __getOwnPropDescs$l(b));
|
|
35169
35131
|
var __objRest$l = (source, exclude) => {
|
|
35170
35132
|
var target = {};
|
|
35171
35133
|
for (var prop in source)
|
|
35172
|
-
if (__hasOwnProp$
|
|
35134
|
+
if (__hasOwnProp$y.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
35173
35135
|
target[prop] = source[prop];
|
|
35174
|
-
if (source != null && __getOwnPropSymbols$
|
|
35175
|
-
for (var prop of __getOwnPropSymbols$
|
|
35176
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
35136
|
+
if (source != null && __getOwnPropSymbols$y)
|
|
35137
|
+
for (var prop of __getOwnPropSymbols$y(source)) {
|
|
35138
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$y.call(source, prop))
|
|
35177
35139
|
target[prop] = source[prop];
|
|
35178
35140
|
}
|
|
35179
35141
|
return target;
|
|
35180
35142
|
};
|
|
35181
35143
|
const useListCarriers = (params) => {
|
|
35182
35144
|
const { client } = useShipEngine();
|
|
35183
|
-
const _a = __spreadValues$
|
|
35184
|
-
return reactQuery.useQuery(__spreadProps$
|
|
35145
|
+
const _a = __spreadValues$o({}, params), { queryFnParams } = _a, rest = __objRest$l(_a, ["queryFnParams"]);
|
|
35146
|
+
return reactQuery.useQuery(__spreadProps$l(__spreadValues$o({}, rest), {
|
|
35185
35147
|
onError,
|
|
35186
35148
|
queryFn: () => client.carriers.list(queryFnParams),
|
|
35187
35149
|
queryKey: ["useListCarriers", queryFnParams],
|
|
@@ -35189,22 +35151,22 @@ const useListCarriers = (params) => {
|
|
|
35189
35151
|
}));
|
|
35190
35152
|
};
|
|
35191
35153
|
|
|
35192
|
-
var __getOwnPropSymbols$
|
|
35193
|
-
var __hasOwnProp$
|
|
35194
|
-
var __propIsEnum$
|
|
35154
|
+
var __getOwnPropSymbols$x = Object.getOwnPropertySymbols;
|
|
35155
|
+
var __hasOwnProp$x = Object.prototype.hasOwnProperty;
|
|
35156
|
+
var __propIsEnum$x = Object.prototype.propertyIsEnumerable;
|
|
35195
35157
|
var __objRest$k = (source, exclude) => {
|
|
35196
35158
|
var target = {};
|
|
35197
35159
|
for (var prop in source)
|
|
35198
|
-
if (__hasOwnProp$
|
|
35160
|
+
if (__hasOwnProp$x.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
35199
35161
|
target[prop] = source[prop];
|
|
35200
|
-
if (source != null && __getOwnPropSymbols$
|
|
35201
|
-
for (var prop of __getOwnPropSymbols$
|
|
35202
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
35162
|
+
if (source != null && __getOwnPropSymbols$x)
|
|
35163
|
+
for (var prop of __getOwnPropSymbols$x(source)) {
|
|
35164
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$x.call(source, prop))
|
|
35203
35165
|
target[prop] = source[prop];
|
|
35204
35166
|
}
|
|
35205
35167
|
return target;
|
|
35206
35168
|
};
|
|
35207
|
-
var __async$
|
|
35169
|
+
var __async$H = (__this, __arguments, generator) => {
|
|
35208
35170
|
return new Promise((resolve, reject) => {
|
|
35209
35171
|
var fulfilled = (value) => {
|
|
35210
35172
|
try {
|
|
@@ -35228,7 +35190,7 @@ const useUpdateAutoFunding = () => {
|
|
|
35228
35190
|
const { client } = useShipEngine();
|
|
35229
35191
|
const queryClient = reactQuery.useQueryClient();
|
|
35230
35192
|
return reactQuery.useMutation({
|
|
35231
|
-
mutationFn: (_a) => __async$
|
|
35193
|
+
mutationFn: (_a) => __async$H(void 0, null, function* () {
|
|
35232
35194
|
var _b = _a, { carrierId } = _b, options = __objRest$k(_b, ["carrierId"]);
|
|
35233
35195
|
const result = yield client.carriers.updateAutoFunding(carrierId, options);
|
|
35234
35196
|
return result.data;
|
|
@@ -35258,7 +35220,7 @@ const useGetZonesByCarrier = (carrierId) => {
|
|
|
35258
35220
|
});
|
|
35259
35221
|
};
|
|
35260
35222
|
|
|
35261
|
-
var __async$
|
|
35223
|
+
var __async$G = (__this, __arguments, generator) => {
|
|
35262
35224
|
return new Promise((resolve, reject) => {
|
|
35263
35225
|
var fulfilled = (value) => {
|
|
35264
35226
|
try {
|
|
@@ -35281,7 +35243,7 @@ var __async$E = (__this, __arguments, generator) => {
|
|
|
35281
35243
|
const useDeleteCarrier = () => {
|
|
35282
35244
|
const { client } = useShipEngine();
|
|
35283
35245
|
return reactQuery.useMutation({
|
|
35284
|
-
mutationFn: (carrierId) => __async$
|
|
35246
|
+
mutationFn: (carrierId) => __async$G(void 0, null, function* () {
|
|
35285
35247
|
const result = yield client.carriers.delete(carrierId);
|
|
35286
35248
|
return result.data;
|
|
35287
35249
|
}),
|
|
@@ -35290,17 +35252,17 @@ const useDeleteCarrier = () => {
|
|
|
35290
35252
|
});
|
|
35291
35253
|
};
|
|
35292
35254
|
|
|
35293
|
-
var __getOwnPropSymbols$
|
|
35294
|
-
var __hasOwnProp$
|
|
35295
|
-
var __propIsEnum$
|
|
35255
|
+
var __getOwnPropSymbols$w = Object.getOwnPropertySymbols;
|
|
35256
|
+
var __hasOwnProp$w = Object.prototype.hasOwnProperty;
|
|
35257
|
+
var __propIsEnum$w = Object.prototype.propertyIsEnumerable;
|
|
35296
35258
|
var __objRest$j = (source, exclude) => {
|
|
35297
35259
|
var target = {};
|
|
35298
35260
|
for (var prop in source)
|
|
35299
|
-
if (__hasOwnProp$
|
|
35261
|
+
if (__hasOwnProp$w.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
35300
35262
|
target[prop] = source[prop];
|
|
35301
|
-
if (source != null && __getOwnPropSymbols$
|
|
35302
|
-
for (var prop of __getOwnPropSymbols$
|
|
35303
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
35263
|
+
if (source != null && __getOwnPropSymbols$w)
|
|
35264
|
+
for (var prop of __getOwnPropSymbols$w(source)) {
|
|
35265
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$w.call(source, prop))
|
|
35304
35266
|
target[prop] = source[prop];
|
|
35305
35267
|
}
|
|
35306
35268
|
return target;
|
|
@@ -35317,17 +35279,17 @@ const useGetCarrierConnectionForm = (_params) => {
|
|
|
35317
35279
|
});
|
|
35318
35280
|
};
|
|
35319
35281
|
|
|
35320
|
-
var __getOwnPropSymbols$
|
|
35321
|
-
var __hasOwnProp$
|
|
35322
|
-
var __propIsEnum$
|
|
35282
|
+
var __getOwnPropSymbols$v = Object.getOwnPropertySymbols;
|
|
35283
|
+
var __hasOwnProp$v = Object.prototype.hasOwnProperty;
|
|
35284
|
+
var __propIsEnum$v = Object.prototype.propertyIsEnumerable;
|
|
35323
35285
|
var __objRest$i = (source, exclude) => {
|
|
35324
35286
|
var target = {};
|
|
35325
35287
|
for (var prop in source)
|
|
35326
|
-
if (__hasOwnProp$
|
|
35288
|
+
if (__hasOwnProp$v.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
35327
35289
|
target[prop] = source[prop];
|
|
35328
|
-
if (source != null && __getOwnPropSymbols$
|
|
35329
|
-
for (var prop of __getOwnPropSymbols$
|
|
35330
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
35290
|
+
if (source != null && __getOwnPropSymbols$v)
|
|
35291
|
+
for (var prop of __getOwnPropSymbols$v(source)) {
|
|
35292
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$v.call(source, prop))
|
|
35331
35293
|
target[prop] = source[prop];
|
|
35332
35294
|
}
|
|
35333
35295
|
return target;
|
|
@@ -35344,7 +35306,7 @@ const useListCarrierConnections = (_params) => {
|
|
|
35344
35306
|
});
|
|
35345
35307
|
};
|
|
35346
35308
|
|
|
35347
|
-
var __async$
|
|
35309
|
+
var __async$F = (__this, __arguments, generator) => {
|
|
35348
35310
|
return new Promise((resolve, reject) => {
|
|
35349
35311
|
var fulfilled = (value) => {
|
|
35350
35312
|
try {
|
|
@@ -35367,7 +35329,7 @@ var __async$D = (__this, __arguments, generator) => {
|
|
|
35367
35329
|
const useConnectCarrierAccount = () => {
|
|
35368
35330
|
const { client } = useShipEngine();
|
|
35369
35331
|
return reactQuery.useMutation({
|
|
35370
|
-
mutationFn: (_0) => __async$
|
|
35332
|
+
mutationFn: (_0) => __async$F(void 0, [_0], function* ({ carrierName, formData }) {
|
|
35371
35333
|
const result = yield client.connections.connectCarrier(carrierName, formData);
|
|
35372
35334
|
return result.data;
|
|
35373
35335
|
}),
|
|
@@ -35387,33 +35349,33 @@ const useCarrierConnectionsServicesList = (carrierCode) => {
|
|
|
35387
35349
|
});
|
|
35388
35350
|
};
|
|
35389
35351
|
|
|
35390
|
-
var __defProp$
|
|
35391
|
-
var __defProps$
|
|
35392
|
-
var __getOwnPropDescs$
|
|
35393
|
-
var __getOwnPropSymbols$
|
|
35394
|
-
var __hasOwnProp$
|
|
35395
|
-
var __propIsEnum$
|
|
35396
|
-
var __defNormalProp$
|
|
35397
|
-
var __spreadValues$
|
|
35352
|
+
var __defProp$n = Object.defineProperty;
|
|
35353
|
+
var __defProps$k = Object.defineProperties;
|
|
35354
|
+
var __getOwnPropDescs$k = Object.getOwnPropertyDescriptors;
|
|
35355
|
+
var __getOwnPropSymbols$u = Object.getOwnPropertySymbols;
|
|
35356
|
+
var __hasOwnProp$u = Object.prototype.hasOwnProperty;
|
|
35357
|
+
var __propIsEnum$u = Object.prototype.propertyIsEnumerable;
|
|
35358
|
+
var __defNormalProp$n = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
35359
|
+
var __spreadValues$n = (a, b) => {
|
|
35398
35360
|
for (var prop in b || (b = {}))
|
|
35399
|
-
if (__hasOwnProp$
|
|
35400
|
-
__defNormalProp$
|
|
35401
|
-
if (__getOwnPropSymbols$
|
|
35402
|
-
for (var prop of __getOwnPropSymbols$
|
|
35403
|
-
if (__propIsEnum$
|
|
35404
|
-
__defNormalProp$
|
|
35361
|
+
if (__hasOwnProp$u.call(b, prop))
|
|
35362
|
+
__defNormalProp$n(a, prop, b[prop]);
|
|
35363
|
+
if (__getOwnPropSymbols$u)
|
|
35364
|
+
for (var prop of __getOwnPropSymbols$u(b)) {
|
|
35365
|
+
if (__propIsEnum$u.call(b, prop))
|
|
35366
|
+
__defNormalProp$n(a, prop, b[prop]);
|
|
35405
35367
|
}
|
|
35406
35368
|
return a;
|
|
35407
35369
|
};
|
|
35408
|
-
var __spreadProps$
|
|
35370
|
+
var __spreadProps$k = (a, b) => __defProps$k(a, __getOwnPropDescs$k(b));
|
|
35409
35371
|
var __objRest$h = (source, exclude) => {
|
|
35410
35372
|
var target = {};
|
|
35411
35373
|
for (var prop in source)
|
|
35412
|
-
if (__hasOwnProp$
|
|
35374
|
+
if (__hasOwnProp$u.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
35413
35375
|
target[prop] = source[prop];
|
|
35414
|
-
if (source != null && __getOwnPropSymbols$
|
|
35415
|
-
for (var prop of __getOwnPropSymbols$
|
|
35416
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
35376
|
+
if (source != null && __getOwnPropSymbols$u)
|
|
35377
|
+
for (var prop of __getOwnPropSymbols$u(source)) {
|
|
35378
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$u.call(source, prop))
|
|
35417
35379
|
target[prop] = source[prop];
|
|
35418
35380
|
}
|
|
35419
35381
|
return target;
|
|
@@ -35426,7 +35388,7 @@ const useGetConnectionsCarrierSettings = (_a) => {
|
|
|
35426
35388
|
]);
|
|
35427
35389
|
const { client } = useShipEngine();
|
|
35428
35390
|
const { carrierName, carrierId } = queryFnParams;
|
|
35429
|
-
return reactQuery.useQuery(__spreadProps$
|
|
35391
|
+
return reactQuery.useQuery(__spreadProps$k(__spreadValues$n({}, params), {
|
|
35430
35392
|
onError,
|
|
35431
35393
|
queryFn: () => client.connections.getCarrierSettings(carrierName, carrierId),
|
|
35432
35394
|
queryKey: ["useGetConnectionsCarrierSettings", carrierName, carrierId],
|
|
@@ -35434,26 +35396,26 @@ const useGetConnectionsCarrierSettings = (_a) => {
|
|
|
35434
35396
|
}));
|
|
35435
35397
|
};
|
|
35436
35398
|
|
|
35437
|
-
var __defProp$
|
|
35438
|
-
var __defProps$
|
|
35439
|
-
var __getOwnPropDescs$
|
|
35440
|
-
var __getOwnPropSymbols$
|
|
35441
|
-
var __hasOwnProp$
|
|
35442
|
-
var __propIsEnum$
|
|
35443
|
-
var __defNormalProp$
|
|
35444
|
-
var __spreadValues$
|
|
35399
|
+
var __defProp$m = Object.defineProperty;
|
|
35400
|
+
var __defProps$j = Object.defineProperties;
|
|
35401
|
+
var __getOwnPropDescs$j = Object.getOwnPropertyDescriptors;
|
|
35402
|
+
var __getOwnPropSymbols$t = Object.getOwnPropertySymbols;
|
|
35403
|
+
var __hasOwnProp$t = Object.prototype.hasOwnProperty;
|
|
35404
|
+
var __propIsEnum$t = Object.prototype.propertyIsEnumerable;
|
|
35405
|
+
var __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
35406
|
+
var __spreadValues$m = (a, b) => {
|
|
35445
35407
|
for (var prop in b || (b = {}))
|
|
35446
|
-
if (__hasOwnProp$
|
|
35447
|
-
__defNormalProp$
|
|
35448
|
-
if (__getOwnPropSymbols$
|
|
35449
|
-
for (var prop of __getOwnPropSymbols$
|
|
35450
|
-
if (__propIsEnum$
|
|
35451
|
-
__defNormalProp$
|
|
35408
|
+
if (__hasOwnProp$t.call(b, prop))
|
|
35409
|
+
__defNormalProp$m(a, prop, b[prop]);
|
|
35410
|
+
if (__getOwnPropSymbols$t)
|
|
35411
|
+
for (var prop of __getOwnPropSymbols$t(b)) {
|
|
35412
|
+
if (__propIsEnum$t.call(b, prop))
|
|
35413
|
+
__defNormalProp$m(a, prop, b[prop]);
|
|
35452
35414
|
}
|
|
35453
35415
|
return a;
|
|
35454
35416
|
};
|
|
35455
|
-
var __spreadProps$
|
|
35456
|
-
var __async$
|
|
35417
|
+
var __spreadProps$j = (a, b) => __defProps$j(a, __getOwnPropDescs$j(b));
|
|
35418
|
+
var __async$E = (__this, __arguments, generator) => {
|
|
35457
35419
|
return new Promise((resolve, reject) => {
|
|
35458
35420
|
var fulfilled = (value) => {
|
|
35459
35421
|
try {
|
|
@@ -35475,8 +35437,8 @@ var __async$C = (__this, __arguments, generator) => {
|
|
|
35475
35437
|
};
|
|
35476
35438
|
const useUpdateConnectionsCarrierSettings = (params) => {
|
|
35477
35439
|
const { client } = useShipEngine();
|
|
35478
|
-
return reactQuery.useMutation(__spreadProps$
|
|
35479
|
-
mutationFn: (_0) => __async$
|
|
35440
|
+
return reactQuery.useMutation(__spreadProps$j(__spreadValues$m({}, params), {
|
|
35441
|
+
mutationFn: (_0) => __async$E(void 0, [_0], function* ({
|
|
35480
35442
|
carrierName,
|
|
35481
35443
|
carrierId,
|
|
35482
35444
|
formData
|
|
@@ -35503,7 +35465,7 @@ const useListCustomPackageTypes = () => {
|
|
|
35503
35465
|
});
|
|
35504
35466
|
};
|
|
35505
35467
|
|
|
35506
|
-
var __async$
|
|
35468
|
+
var __async$D = (__this, __arguments, generator) => {
|
|
35507
35469
|
return new Promise((resolve, reject) => {
|
|
35508
35470
|
var fulfilled = (value) => {
|
|
35509
35471
|
try {
|
|
@@ -35526,7 +35488,7 @@ var __async$B = (__this, __arguments, generator) => {
|
|
|
35526
35488
|
const useCreateFundingSource = () => {
|
|
35527
35489
|
const { client } = useShipEngine();
|
|
35528
35490
|
return reactQuery.useMutation({
|
|
35529
|
-
mutationFn: (fundingSource) => __async$
|
|
35491
|
+
mutationFn: (fundingSource) => __async$D(void 0, null, function* () {
|
|
35530
35492
|
const result = yield client.fundingSources.create(fundingSource);
|
|
35531
35493
|
return result.data;
|
|
35532
35494
|
}),
|
|
@@ -35535,7 +35497,7 @@ const useCreateFundingSource = () => {
|
|
|
35535
35497
|
});
|
|
35536
35498
|
};
|
|
35537
35499
|
|
|
35538
|
-
var __async$
|
|
35500
|
+
var __async$C = (__this, __arguments, generator) => {
|
|
35539
35501
|
return new Promise((resolve, reject) => {
|
|
35540
35502
|
var fulfilled = (value) => {
|
|
35541
35503
|
try {
|
|
@@ -35558,7 +35520,7 @@ var __async$A = (__this, __arguments, generator) => {
|
|
|
35558
35520
|
const useFundingSourcesAddFunds = () => {
|
|
35559
35521
|
const { client } = useShipEngine();
|
|
35560
35522
|
return reactQuery.useMutation({
|
|
35561
|
-
mutationFn: (_0) => __async$
|
|
35523
|
+
mutationFn: (_0) => __async$C(void 0, [_0], function* ({ funds, fundingSourceId }) {
|
|
35562
35524
|
const result = yield client.fundingSources.addFunds(funds, fundingSourceId);
|
|
35563
35525
|
return result.data;
|
|
35564
35526
|
}),
|
|
@@ -35587,7 +35549,7 @@ const useListFundingSources = () => {
|
|
|
35587
35549
|
});
|
|
35588
35550
|
};
|
|
35589
35551
|
|
|
35590
|
-
var __async$
|
|
35552
|
+
var __async$B = (__this, __arguments, generator) => {
|
|
35591
35553
|
return new Promise((resolve, reject) => {
|
|
35592
35554
|
var fulfilled = (value) => {
|
|
35593
35555
|
try {
|
|
@@ -35610,7 +35572,7 @@ var __async$z = (__this, __arguments, generator) => {
|
|
|
35610
35572
|
const useRegisterCarrier = () => {
|
|
35611
35573
|
const { client } = useShipEngine();
|
|
35612
35574
|
return reactQuery.useMutation({
|
|
35613
|
-
mutationFn: (carrier) => __async$
|
|
35575
|
+
mutationFn: (carrier) => __async$B(void 0, null, function* () {
|
|
35614
35576
|
const result = yield client.fundingSources.registerCarrier(carrier);
|
|
35615
35577
|
return result.data;
|
|
35616
35578
|
}),
|
|
@@ -35619,7 +35581,7 @@ const useRegisterCarrier = () => {
|
|
|
35619
35581
|
});
|
|
35620
35582
|
};
|
|
35621
35583
|
|
|
35622
|
-
var __async$
|
|
35584
|
+
var __async$A = (__this, __arguments, generator) => {
|
|
35623
35585
|
return new Promise((resolve, reject) => {
|
|
35624
35586
|
var fulfilled = (value) => {
|
|
35625
35587
|
try {
|
|
@@ -35642,7 +35604,7 @@ var __async$y = (__this, __arguments, generator) => {
|
|
|
35642
35604
|
const useUpdateFundingSource = () => {
|
|
35643
35605
|
const { client } = useShipEngine();
|
|
35644
35606
|
return reactQuery.useMutation({
|
|
35645
|
-
mutationFn: (_0) => __async$
|
|
35607
|
+
mutationFn: (_0) => __async$A(void 0, [_0], function* ({
|
|
35646
35608
|
billingInfo,
|
|
35647
35609
|
creditCardInfo,
|
|
35648
35610
|
fundingSourceId
|
|
@@ -35681,29 +35643,29 @@ const useGetFundingSourceTransactions = (fundingSourceId, params) => {
|
|
|
35681
35643
|
});
|
|
35682
35644
|
};
|
|
35683
35645
|
|
|
35684
|
-
var __defProp$
|
|
35685
|
-
var __defProps$
|
|
35686
|
-
var __getOwnPropDescs$
|
|
35687
|
-
var __getOwnPropSymbols$
|
|
35688
|
-
var __hasOwnProp$
|
|
35689
|
-
var __propIsEnum$
|
|
35690
|
-
var __defNormalProp$
|
|
35691
|
-
var __spreadValues$
|
|
35646
|
+
var __defProp$l = Object.defineProperty;
|
|
35647
|
+
var __defProps$i = Object.defineProperties;
|
|
35648
|
+
var __getOwnPropDescs$i = Object.getOwnPropertyDescriptors;
|
|
35649
|
+
var __getOwnPropSymbols$s = Object.getOwnPropertySymbols;
|
|
35650
|
+
var __hasOwnProp$s = Object.prototype.hasOwnProperty;
|
|
35651
|
+
var __propIsEnum$s = Object.prototype.propertyIsEnumerable;
|
|
35652
|
+
var __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
35653
|
+
var __spreadValues$l = (a, b) => {
|
|
35692
35654
|
for (var prop in b || (b = {}))
|
|
35693
|
-
if (__hasOwnProp$
|
|
35694
|
-
__defNormalProp$
|
|
35695
|
-
if (__getOwnPropSymbols$
|
|
35696
|
-
for (var prop of __getOwnPropSymbols$
|
|
35697
|
-
if (__propIsEnum$
|
|
35698
|
-
__defNormalProp$
|
|
35655
|
+
if (__hasOwnProp$s.call(b, prop))
|
|
35656
|
+
__defNormalProp$l(a, prop, b[prop]);
|
|
35657
|
+
if (__getOwnPropSymbols$s)
|
|
35658
|
+
for (var prop of __getOwnPropSymbols$s(b)) {
|
|
35659
|
+
if (__propIsEnum$s.call(b, prop))
|
|
35660
|
+
__defNormalProp$l(a, prop, b[prop]);
|
|
35699
35661
|
}
|
|
35700
35662
|
return a;
|
|
35701
35663
|
};
|
|
35702
|
-
var __spreadProps$
|
|
35664
|
+
var __spreadProps$i = (a, b) => __defProps$i(a, __getOwnPropDescs$i(b));
|
|
35703
35665
|
const useGetInsuranceFundingSourceAcceptedTerms = (params) => {
|
|
35704
35666
|
const { client } = useShipEngine();
|
|
35705
|
-
const queryParams = __spreadValues$
|
|
35706
|
-
return reactQuery.useQuery(__spreadProps$
|
|
35667
|
+
const queryParams = __spreadValues$l({}, params);
|
|
35668
|
+
return reactQuery.useQuery(__spreadProps$i(__spreadValues$l({}, queryParams), {
|
|
35707
35669
|
onError,
|
|
35708
35670
|
queryFn: () => client.fundingSources.insuranceAcceptedTerms(),
|
|
35709
35671
|
queryKey: ["useGetInsuranceFundingSourceAcceptedTerms"],
|
|
@@ -35726,22 +35688,22 @@ const useGetInsuranceAccount = (insuranceProvider) => {
|
|
|
35726
35688
|
});
|
|
35727
35689
|
};
|
|
35728
35690
|
|
|
35729
|
-
var __getOwnPropSymbols$
|
|
35730
|
-
var __hasOwnProp$
|
|
35731
|
-
var __propIsEnum$
|
|
35691
|
+
var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
|
|
35692
|
+
var __hasOwnProp$r = Object.prototype.hasOwnProperty;
|
|
35693
|
+
var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
|
|
35732
35694
|
var __objRest$g = (source, exclude) => {
|
|
35733
35695
|
var target = {};
|
|
35734
35696
|
for (var prop in source)
|
|
35735
|
-
if (__hasOwnProp$
|
|
35697
|
+
if (__hasOwnProp$r.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
35736
35698
|
target[prop] = source[prop];
|
|
35737
|
-
if (source != null && __getOwnPropSymbols$
|
|
35738
|
-
for (var prop of __getOwnPropSymbols$
|
|
35739
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
35699
|
+
if (source != null && __getOwnPropSymbols$r)
|
|
35700
|
+
for (var prop of __getOwnPropSymbols$r(source)) {
|
|
35701
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$r.call(source, prop))
|
|
35740
35702
|
target[prop] = source[prop];
|
|
35741
35703
|
}
|
|
35742
35704
|
return target;
|
|
35743
35705
|
};
|
|
35744
|
-
var __async$
|
|
35706
|
+
var __async$z = (__this, __arguments, generator) => {
|
|
35745
35707
|
return new Promise((resolve, reject) => {
|
|
35746
35708
|
var fulfilled = (value) => {
|
|
35747
35709
|
try {
|
|
@@ -35764,7 +35726,7 @@ var __async$x = (__this, __arguments, generator) => {
|
|
|
35764
35726
|
const useAddInsuranceFunds = () => {
|
|
35765
35727
|
const { client } = useShipEngine();
|
|
35766
35728
|
return reactQuery.useMutation({
|
|
35767
|
-
mutationFn: (_a) => __async$
|
|
35729
|
+
mutationFn: (_a) => __async$z(void 0, null, function* () {
|
|
35768
35730
|
var _b = _a, { insuranceProvider } = _b, rest = __objRest$g(_b, ["insuranceProvider"]);
|
|
35769
35731
|
const result = yield client.insurance.addFunds(insuranceProvider, rest);
|
|
35770
35732
|
return result.data;
|
|
@@ -35774,6 +35736,137 @@ const useAddInsuranceFunds = () => {
|
|
|
35774
35736
|
});
|
|
35775
35737
|
};
|
|
35776
35738
|
|
|
35739
|
+
var __defProp$k = Object.defineProperty;
|
|
35740
|
+
var __defProps$h = Object.defineProperties;
|
|
35741
|
+
var __getOwnPropDescs$h = Object.getOwnPropertyDescriptors;
|
|
35742
|
+
var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
|
|
35743
|
+
var __hasOwnProp$q = Object.prototype.hasOwnProperty;
|
|
35744
|
+
var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
|
|
35745
|
+
var __defNormalProp$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
35746
|
+
var __spreadValues$k = (a, b) => {
|
|
35747
|
+
for (var prop in b || (b = {}))
|
|
35748
|
+
if (__hasOwnProp$q.call(b, prop))
|
|
35749
|
+
__defNormalProp$k(a, prop, b[prop]);
|
|
35750
|
+
if (__getOwnPropSymbols$q)
|
|
35751
|
+
for (var prop of __getOwnPropSymbols$q(b)) {
|
|
35752
|
+
if (__propIsEnum$q.call(b, prop))
|
|
35753
|
+
__defNormalProp$k(a, prop, b[prop]);
|
|
35754
|
+
}
|
|
35755
|
+
return a;
|
|
35756
|
+
};
|
|
35757
|
+
var __spreadProps$h = (a, b) => __defProps$h(a, __getOwnPropDescs$h(b));
|
|
35758
|
+
var __async$y = (__this, __arguments, generator) => {
|
|
35759
|
+
return new Promise((resolve, reject) => {
|
|
35760
|
+
var fulfilled = (value) => {
|
|
35761
|
+
try {
|
|
35762
|
+
step(generator.next(value));
|
|
35763
|
+
} catch (e) {
|
|
35764
|
+
reject(e);
|
|
35765
|
+
}
|
|
35766
|
+
};
|
|
35767
|
+
var rejected = (value) => {
|
|
35768
|
+
try {
|
|
35769
|
+
step(generator.throw(value));
|
|
35770
|
+
} catch (e) {
|
|
35771
|
+
reject(e);
|
|
35772
|
+
}
|
|
35773
|
+
};
|
|
35774
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
35775
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
35776
|
+
});
|
|
35777
|
+
};
|
|
35778
|
+
const useCreateInvoiceAddress = (params) => {
|
|
35779
|
+
const { client } = useShipEngine();
|
|
35780
|
+
return reactQuery.useMutation(__spreadProps$h(__spreadValues$k({}, params), {
|
|
35781
|
+
mutationFn: (invoiceAddress) => __async$y(void 0, null, function* () {
|
|
35782
|
+
const result = yield client.invoiceAddress.create(invoiceAddress);
|
|
35783
|
+
return result.data.invoiceAddress;
|
|
35784
|
+
}),
|
|
35785
|
+
mutationKey: ["useCreateInvoiceAddress"],
|
|
35786
|
+
onError
|
|
35787
|
+
}));
|
|
35788
|
+
};
|
|
35789
|
+
|
|
35790
|
+
var __defProp$j = Object.defineProperty;
|
|
35791
|
+
var __defProps$g = Object.defineProperties;
|
|
35792
|
+
var __getOwnPropDescs$g = Object.getOwnPropertyDescriptors;
|
|
35793
|
+
var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
|
|
35794
|
+
var __hasOwnProp$p = Object.prototype.hasOwnProperty;
|
|
35795
|
+
var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
|
|
35796
|
+
var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
35797
|
+
var __spreadValues$j = (a, b) => {
|
|
35798
|
+
for (var prop in b || (b = {}))
|
|
35799
|
+
if (__hasOwnProp$p.call(b, prop))
|
|
35800
|
+
__defNormalProp$j(a, prop, b[prop]);
|
|
35801
|
+
if (__getOwnPropSymbols$p)
|
|
35802
|
+
for (var prop of __getOwnPropSymbols$p(b)) {
|
|
35803
|
+
if (__propIsEnum$p.call(b, prop))
|
|
35804
|
+
__defNormalProp$j(a, prop, b[prop]);
|
|
35805
|
+
}
|
|
35806
|
+
return a;
|
|
35807
|
+
};
|
|
35808
|
+
var __spreadProps$g = (a, b) => __defProps$g(a, __getOwnPropDescs$g(b));
|
|
35809
|
+
var __async$x = (__this, __arguments, generator) => {
|
|
35810
|
+
return new Promise((resolve, reject) => {
|
|
35811
|
+
var fulfilled = (value) => {
|
|
35812
|
+
try {
|
|
35813
|
+
step(generator.next(value));
|
|
35814
|
+
} catch (e) {
|
|
35815
|
+
reject(e);
|
|
35816
|
+
}
|
|
35817
|
+
};
|
|
35818
|
+
var rejected = (value) => {
|
|
35819
|
+
try {
|
|
35820
|
+
step(generator.throw(value));
|
|
35821
|
+
} catch (e) {
|
|
35822
|
+
reject(e);
|
|
35823
|
+
}
|
|
35824
|
+
};
|
|
35825
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
35826
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
35827
|
+
});
|
|
35828
|
+
};
|
|
35829
|
+
const useUpdateInvoiceAddress = (params) => {
|
|
35830
|
+
const { client } = useShipEngine();
|
|
35831
|
+
return reactQuery.useMutation(__spreadProps$g(__spreadValues$j({}, params), {
|
|
35832
|
+
mutationFn: (invoiceAddress) => __async$x(void 0, null, function* () {
|
|
35833
|
+
const result = yield client.invoiceAddress.update(invoiceAddress);
|
|
35834
|
+
return result.data.invoiceAddress;
|
|
35835
|
+
}),
|
|
35836
|
+
mutationKey: ["useUpdateInvoiceAddress"],
|
|
35837
|
+
onError
|
|
35838
|
+
}));
|
|
35839
|
+
};
|
|
35840
|
+
|
|
35841
|
+
var __defProp$i = Object.defineProperty;
|
|
35842
|
+
var __defProps$f = Object.defineProperties;
|
|
35843
|
+
var __getOwnPropDescs$f = Object.getOwnPropertyDescriptors;
|
|
35844
|
+
var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
|
|
35845
|
+
var __hasOwnProp$o = Object.prototype.hasOwnProperty;
|
|
35846
|
+
var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
|
|
35847
|
+
var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
35848
|
+
var __spreadValues$i = (a, b) => {
|
|
35849
|
+
for (var prop in b || (b = {}))
|
|
35850
|
+
if (__hasOwnProp$o.call(b, prop))
|
|
35851
|
+
__defNormalProp$i(a, prop, b[prop]);
|
|
35852
|
+
if (__getOwnPropSymbols$o)
|
|
35853
|
+
for (var prop of __getOwnPropSymbols$o(b)) {
|
|
35854
|
+
if (__propIsEnum$o.call(b, prop))
|
|
35855
|
+
__defNormalProp$i(a, prop, b[prop]);
|
|
35856
|
+
}
|
|
35857
|
+
return a;
|
|
35858
|
+
};
|
|
35859
|
+
var __spreadProps$f = (a, b) => __defProps$f(a, __getOwnPropDescs$f(b));
|
|
35860
|
+
const useGetInvoiceAddress = (params) => {
|
|
35861
|
+
const { client } = useShipEngine();
|
|
35862
|
+
return reactQuery.useQuery(__spreadProps$f(__spreadValues$i({}, params), {
|
|
35863
|
+
onError,
|
|
35864
|
+
queryFn: () => client.invoiceAddress.get(),
|
|
35865
|
+
queryKey: ["useGetInvoiceAddress"],
|
|
35866
|
+
select: (result) => result.data.invoiceAddress
|
|
35867
|
+
}));
|
|
35868
|
+
};
|
|
35869
|
+
|
|
35777
35870
|
var __getOwnPropSymbols$n = Object.getOwnPropertySymbols;
|
|
35778
35871
|
var __hasOwnProp$n = Object.prototype.hasOwnProperty;
|
|
35779
35872
|
var __propIsEnum$n = Object.prototype.propertyIsEnumerable;
|
|
@@ -36325,10 +36418,12 @@ const useRatesEstimate = () => {
|
|
|
36325
36418
|
});
|
|
36326
36419
|
};
|
|
36327
36420
|
|
|
36328
|
-
const useGetSalesOrder = (salesOrderId) => {
|
|
36421
|
+
const useGetSalesOrder = (salesOrderId, config) => {
|
|
36422
|
+
var _a;
|
|
36329
36423
|
const { client } = useShipEngine();
|
|
36424
|
+
const enabled = (_a = config == null ? void 0 : config.enabled) != null ? _a : true;
|
|
36330
36425
|
return reactQuery.useQuery({
|
|
36331
|
-
enabled: salesOrderId !== void 0,
|
|
36426
|
+
enabled: salesOrderId !== void 0 && enabled,
|
|
36332
36427
|
onError,
|
|
36333
36428
|
queryFn: () => {
|
|
36334
36429
|
if (salesOrderId)
|
|
@@ -36340,6 +36435,23 @@ const useGetSalesOrder = (salesOrderId) => {
|
|
|
36340
36435
|
});
|
|
36341
36436
|
};
|
|
36342
36437
|
|
|
36438
|
+
const useGetSalesOrderByExternalOrderId = (externalOrderId, config) => {
|
|
36439
|
+
var _a;
|
|
36440
|
+
const { client } = useShipEngine();
|
|
36441
|
+
const enabled = (_a = config == null ? void 0 : config.enabled) != null ? _a : true;
|
|
36442
|
+
return reactQuery.useQuery({
|
|
36443
|
+
enabled: externalOrderId !== void 0 && enabled,
|
|
36444
|
+
onError,
|
|
36445
|
+
queryFn: () => {
|
|
36446
|
+
if (externalOrderId)
|
|
36447
|
+
return client.salesOrders.getByExternalId(externalOrderId);
|
|
36448
|
+
return Promise.reject(new Error("externalOrderId is required"));
|
|
36449
|
+
},
|
|
36450
|
+
queryKey: ["useGetSalesOrderByExternalOrderId", externalOrderId],
|
|
36451
|
+
select: (result) => result.data
|
|
36452
|
+
});
|
|
36453
|
+
};
|
|
36454
|
+
|
|
36343
36455
|
const useListSalesOrders = (params = {}) => {
|
|
36344
36456
|
const { client } = useShipEngine();
|
|
36345
36457
|
return reactQuery.useQuery({
|
|
@@ -36462,13 +36574,14 @@ const useGetSalesOrderShipment = (shipmentId) => {
|
|
|
36462
36574
|
});
|
|
36463
36575
|
};
|
|
36464
36576
|
|
|
36465
|
-
const useListSalesOrderShipments = (
|
|
36577
|
+
const useListSalesOrderShipments = (body) => {
|
|
36466
36578
|
const { client } = useShipEngine();
|
|
36579
|
+
const { shipmentIds, salesOrderIds, externalOrderIds } = body;
|
|
36467
36580
|
return reactQuery.useQuery({
|
|
36468
|
-
enabled:
|
|
36581
|
+
enabled: !!((shipmentIds == null ? void 0 : shipmentIds.length) || (salesOrderIds == null ? void 0 : salesOrderIds.length) || (externalOrderIds == null ? void 0 : externalOrderIds.length)),
|
|
36469
36582
|
onError,
|
|
36470
|
-
queryFn: () => client.salesOrderShipments.list(
|
|
36471
|
-
queryKey: ["useListSalesOrderShipments",
|
|
36583
|
+
queryFn: () => client.salesOrderShipments.list(body),
|
|
36584
|
+
queryKey: ["useListSalesOrderShipments", body],
|
|
36472
36585
|
select: (result) => result.data.shipments
|
|
36473
36586
|
});
|
|
36474
36587
|
};
|
|
@@ -36521,6 +36634,17 @@ const useUpdateSalesOrderShipment = () => {
|
|
|
36521
36634
|
});
|
|
36522
36635
|
};
|
|
36523
36636
|
|
|
36637
|
+
const useListSalesOrderShipmentsByExternalOrderId = (externalOrderId) => {
|
|
36638
|
+
const { client } = useShipEngine();
|
|
36639
|
+
return reactQuery.useQuery({
|
|
36640
|
+
enabled: externalOrderId !== null && externalOrderId.length > 0,
|
|
36641
|
+
onError,
|
|
36642
|
+
queryFn: () => client.salesOrderShipments.listShipmentsByExternalOrderId(externalOrderId),
|
|
36643
|
+
queryKey: ["useListSalesOrderShipments", externalOrderId],
|
|
36644
|
+
select: (result) => result.data.shipments
|
|
36645
|
+
});
|
|
36646
|
+
};
|
|
36647
|
+
|
|
36524
36648
|
var __defProp$f = Object.defineProperty;
|
|
36525
36649
|
var __defProps$c = Object.defineProperties;
|
|
36526
36650
|
var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
|
|
@@ -38857,6 +38981,7 @@ exports.ErrorBoundary = ErrorBoundary;
|
|
|
38857
38981
|
exports.FundingSourcesAPI = FundingSourcesAPI;
|
|
38858
38982
|
exports.InsuranceAPI = InsuranceAPI;
|
|
38859
38983
|
exports.InsuranceProviderType = InsuranceProviderType;
|
|
38984
|
+
exports.InvoiceAddressAPI = InvoiceAddressAPI;
|
|
38860
38985
|
exports.LabelsAPI = LabelsAPI;
|
|
38861
38986
|
exports.MetadataCapability = MetadataCapability;
|
|
38862
38987
|
exports.MetadataRequirement = MetadataRequirement;
|
|
@@ -38880,6 +39005,8 @@ exports.ThemesAPI = ThemesAPI;
|
|
|
38880
39005
|
exports.WarehousesAPI = WarehousesAPI;
|
|
38881
39006
|
exports.WebhooksAPI = WebhooksAPI;
|
|
38882
39007
|
exports.alchemy = alchemy;
|
|
39008
|
+
exports.camelizeKeys = camelizeKeys;
|
|
39009
|
+
exports.decamelizeKeys = decamelizeKeys;
|
|
38883
39010
|
exports.default = alchemy;
|
|
38884
39011
|
exports.delay = delay;
|
|
38885
39012
|
exports.getEmotionCache = getEmotionCache;
|
|
@@ -38903,6 +39030,7 @@ exports.useConnectCarrier = useConnectCarrier;
|
|
|
38903
39030
|
exports.useConnectCarrierAccount = useConnectCarrierAccount;
|
|
38904
39031
|
exports.useCreateAccountImage = useCreateAccountImage;
|
|
38905
39032
|
exports.useCreateFundingSource = useCreateFundingSource;
|
|
39033
|
+
exports.useCreateInvoiceAddress = useCreateInvoiceAddress;
|
|
38906
39034
|
exports.useCreateLabel = useCreateLabel;
|
|
38907
39035
|
exports.useCreateRateCard = useCreateRateCard;
|
|
38908
39036
|
exports.useCreateSalesOrderShipment = useCreateSalesOrderShipment;
|
|
@@ -38938,10 +39066,12 @@ exports.useGetFundingSourceTransactions = useGetFundingSourceTransactions;
|
|
|
38938
39066
|
exports.useGetHereToken = useGetHereToken;
|
|
38939
39067
|
exports.useGetInsuranceAccount = useGetInsuranceAccount;
|
|
38940
39068
|
exports.useGetInsuranceFundingSourceAcceptedTerms = useGetInsuranceFundingSourceAcceptedTerms;
|
|
39069
|
+
exports.useGetInvoiceAddress = useGetInvoiceAddress;
|
|
38941
39070
|
exports.useGetLabel = useGetLabel;
|
|
38942
39071
|
exports.useGetPackageRatingGroupByCarrier = useGetPackageRatingGroupByCarrier;
|
|
38943
39072
|
exports.useGetRateCardById = useGetRateCardById;
|
|
38944
39073
|
exports.useGetSalesOrder = useGetSalesOrder;
|
|
39074
|
+
exports.useGetSalesOrderByExternalOrderId = useGetSalesOrderByExternalOrderId;
|
|
38945
39075
|
exports.useGetSalesOrderShipment = useGetSalesOrderShipment;
|
|
38946
39076
|
exports.useGetServicePoint = useGetServicePoint;
|
|
38947
39077
|
exports.useGetServicesByCarrier = useGetServicesByCarrier;
|
|
@@ -38962,6 +39092,7 @@ exports.useListOrderSources = useListOrderSources;
|
|
|
38962
39092
|
exports.useListOrderSourcesConnections = useListOrderSourcesConnections;
|
|
38963
39093
|
exports.useListRateCards = useListRateCards;
|
|
38964
39094
|
exports.useListSalesOrderShipments = useListSalesOrderShipments;
|
|
39095
|
+
exports.useListSalesOrderShipmentsByExternalOrderId = useListSalesOrderShipmentsByExternalOrderId;
|
|
38965
39096
|
exports.useListSalesOrders = useListSalesOrders;
|
|
38966
39097
|
exports.useListSandboxSellerIds = useListSandboxSellerIds;
|
|
38967
39098
|
exports.useListSellerApiKeys = useListSellerApiKeys;
|
|
@@ -38985,6 +39116,7 @@ exports.useUpdateAccountSettings = useUpdateAccountSettings;
|
|
|
38985
39116
|
exports.useUpdateAutoFunding = useUpdateAutoFunding;
|
|
38986
39117
|
exports.useUpdateConnectionsCarrierSettings = useUpdateConnectionsCarrierSettings;
|
|
38987
39118
|
exports.useUpdateFundingSource = useUpdateFundingSource;
|
|
39119
|
+
exports.useUpdateInvoiceAddress = useUpdateInvoiceAddress;
|
|
38988
39120
|
exports.useUpdateOrderSource = useUpdateOrderSource;
|
|
38989
39121
|
exports.useUpdateRateCard = useUpdateRateCard;
|
|
38990
39122
|
exports.useUpdateSalesOrderShipment = useUpdateSalesOrderShipment;
|