@shipengine/react-api 2.10.0 → 2.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/hooks/service-points/index.d.ts +2 -1
- package/hooks/service-points/use-get-here-token.d.ts +8 -0
- package/index.js +162 -135
- package/index.mjs +162 -136
- package/package.json +1 -1
- package/utilities/types.d.ts +1 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HereTokenResponse } from "@shipengine/js-api";
|
|
2
|
+
import { QueryProps } from "../../utilities";
|
|
3
|
+
/**
|
|
4
|
+
* @category ShipEngine API Hooks
|
|
5
|
+
*
|
|
6
|
+
* Returns an OAuth access token that can be used to authenticate with the HERE Maps API
|
|
7
|
+
*/
|
|
8
|
+
export declare const useGetHereToken: (params?: QueryProps<HereTokenResponse>) => import("@tanstack/react-query").UseQueryResult<HereTokenResponse, import("@shipengine/js-api").CodedError[]>;
|
package/index.js
CHANGED
|
@@ -77,25 +77,25 @@ const onError = (_errors) => _default();
|
|
|
77
77
|
|
|
78
78
|
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}();
|
|
79
79
|
|
|
80
|
-
var __defProp$
|
|
81
|
-
var __defProps$
|
|
82
|
-
var __getOwnPropDescs$
|
|
83
|
-
var __getOwnPropSymbols$
|
|
84
|
-
var __hasOwnProp$
|
|
85
|
-
var __propIsEnum$
|
|
86
|
-
var __defNormalProp$
|
|
87
|
-
var __spreadValues$
|
|
80
|
+
var __defProp$7 = Object.defineProperty;
|
|
81
|
+
var __defProps$7 = Object.defineProperties;
|
|
82
|
+
var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
|
|
83
|
+
var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
|
|
84
|
+
var __hasOwnProp$i = Object.prototype.hasOwnProperty;
|
|
85
|
+
var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
|
|
86
|
+
var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
87
|
+
var __spreadValues$7 = (a, b) => {
|
|
88
88
|
for (var prop in b || (b = {}))
|
|
89
|
-
if (__hasOwnProp$
|
|
90
|
-
__defNormalProp$
|
|
91
|
-
if (__getOwnPropSymbols$
|
|
92
|
-
for (var prop of __getOwnPropSymbols$
|
|
93
|
-
if (__propIsEnum$
|
|
94
|
-
__defNormalProp$
|
|
89
|
+
if (__hasOwnProp$i.call(b, prop))
|
|
90
|
+
__defNormalProp$7(a, prop, b[prop]);
|
|
91
|
+
if (__getOwnPropSymbols$i)
|
|
92
|
+
for (var prop of __getOwnPropSymbols$i(b)) {
|
|
93
|
+
if (__propIsEnum$i.call(b, prop))
|
|
94
|
+
__defNormalProp$7(a, prop, b[prop]);
|
|
95
95
|
}
|
|
96
96
|
return a;
|
|
97
97
|
};
|
|
98
|
-
var __spreadProps$
|
|
98
|
+
var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
|
|
99
99
|
const streams = [];
|
|
100
100
|
if (process.env.NODE_ENV === "production") {
|
|
101
101
|
streams.push({
|
|
@@ -104,7 +104,7 @@ if (process.env.NODE_ENV === "production") {
|
|
|
104
104
|
}
|
|
105
105
|
const logger = E({
|
|
106
106
|
name: "shipengine",
|
|
107
|
-
serializers: __spreadProps$
|
|
107
|
+
serializers: __spreadProps$7(__spreadValues$7({}, k), {
|
|
108
108
|
req: (req) => ({
|
|
109
109
|
headers: req.headers,
|
|
110
110
|
method: req.method,
|
|
@@ -515,17 +515,17 @@ const useListCarriers = () => {
|
|
|
515
515
|
});
|
|
516
516
|
};
|
|
517
517
|
|
|
518
|
-
var __getOwnPropSymbols$
|
|
519
|
-
var __hasOwnProp$
|
|
520
|
-
var __propIsEnum$
|
|
518
|
+
var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
|
|
519
|
+
var __hasOwnProp$h = Object.prototype.hasOwnProperty;
|
|
520
|
+
var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
|
|
521
521
|
var __objRest$b = (source, exclude) => {
|
|
522
522
|
var target = {};
|
|
523
523
|
for (var prop in source)
|
|
524
|
-
if (__hasOwnProp$
|
|
524
|
+
if (__hasOwnProp$h.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
525
525
|
target[prop] = source[prop];
|
|
526
|
-
if (source != null && __getOwnPropSymbols$
|
|
527
|
-
for (var prop of __getOwnPropSymbols$
|
|
528
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
526
|
+
if (source != null && __getOwnPropSymbols$h)
|
|
527
|
+
for (var prop of __getOwnPropSymbols$h(source)) {
|
|
528
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$h.call(source, prop))
|
|
529
529
|
target[prop] = source[prop];
|
|
530
530
|
}
|
|
531
531
|
return target;
|
|
@@ -616,17 +616,17 @@ const useDeleteCarrier = () => {
|
|
|
616
616
|
});
|
|
617
617
|
};
|
|
618
618
|
|
|
619
|
-
var __getOwnPropSymbols$
|
|
620
|
-
var __hasOwnProp$
|
|
621
|
-
var __propIsEnum$
|
|
619
|
+
var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
|
|
620
|
+
var __hasOwnProp$g = Object.prototype.hasOwnProperty;
|
|
621
|
+
var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
|
|
622
622
|
var __objRest$a = (source, exclude) => {
|
|
623
623
|
var target = {};
|
|
624
624
|
for (var prop in source)
|
|
625
|
-
if (__hasOwnProp$
|
|
625
|
+
if (__hasOwnProp$g.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
626
626
|
target[prop] = source[prop];
|
|
627
|
-
if (source != null && __getOwnPropSymbols$
|
|
628
|
-
for (var prop of __getOwnPropSymbols$
|
|
629
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
627
|
+
if (source != null && __getOwnPropSymbols$g)
|
|
628
|
+
for (var prop of __getOwnPropSymbols$g(source)) {
|
|
629
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$g.call(source, prop))
|
|
630
630
|
target[prop] = source[prop];
|
|
631
631
|
}
|
|
632
632
|
return target;
|
|
@@ -643,17 +643,17 @@ const useGetCarrierConnectionForm = (_params) => {
|
|
|
643
643
|
});
|
|
644
644
|
};
|
|
645
645
|
|
|
646
|
-
var __getOwnPropSymbols$
|
|
647
|
-
var __hasOwnProp$
|
|
648
|
-
var __propIsEnum$
|
|
646
|
+
var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
|
|
647
|
+
var __hasOwnProp$f = Object.prototype.hasOwnProperty;
|
|
648
|
+
var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
|
|
649
649
|
var __objRest$9 = (source, exclude) => {
|
|
650
650
|
var target = {};
|
|
651
651
|
for (var prop in source)
|
|
652
|
-
if (__hasOwnProp$
|
|
652
|
+
if (__hasOwnProp$f.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
653
653
|
target[prop] = source[prop];
|
|
654
|
-
if (source != null && __getOwnPropSymbols$
|
|
655
|
-
for (var prop of __getOwnPropSymbols$
|
|
656
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
654
|
+
if (source != null && __getOwnPropSymbols$f)
|
|
655
|
+
for (var prop of __getOwnPropSymbols$f(source)) {
|
|
656
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$f.call(source, prop))
|
|
657
657
|
target[prop] = source[prop];
|
|
658
658
|
}
|
|
659
659
|
return target;
|
|
@@ -695,9 +695,6 @@ const useConnectCarrierAccount = () => {
|
|
|
695
695
|
return reactQuery.useMutation({
|
|
696
696
|
mutationFn: (_0) => __async$v(void 0, [_0], function* ({ carrierName, formData }) {
|
|
697
697
|
const result = yield client.connections.connectCarrier(carrierName, formData);
|
|
698
|
-
if (result.status > 300 && result.status < 309) {
|
|
699
|
-
result.data.redirectUrl = result.request.res.responseUrl;
|
|
700
|
-
}
|
|
701
698
|
return result.data;
|
|
702
699
|
}),
|
|
703
700
|
mutationKey: ["useConnectCarrierAccount"],
|
|
@@ -929,17 +926,17 @@ const useGetInsuranceAccount = (insuranceProvider) => {
|
|
|
929
926
|
});
|
|
930
927
|
};
|
|
931
928
|
|
|
932
|
-
var __getOwnPropSymbols$
|
|
933
|
-
var __hasOwnProp$
|
|
934
|
-
var __propIsEnum$
|
|
929
|
+
var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
|
|
930
|
+
var __hasOwnProp$e = Object.prototype.hasOwnProperty;
|
|
931
|
+
var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
|
|
935
932
|
var __objRest$8 = (source, exclude) => {
|
|
936
933
|
var target = {};
|
|
937
934
|
for (var prop in source)
|
|
938
|
-
if (__hasOwnProp$
|
|
935
|
+
if (__hasOwnProp$e.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
939
936
|
target[prop] = source[prop];
|
|
940
|
-
if (source != null && __getOwnPropSymbols$
|
|
941
|
-
for (var prop of __getOwnPropSymbols$
|
|
942
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
937
|
+
if (source != null && __getOwnPropSymbols$e)
|
|
938
|
+
for (var prop of __getOwnPropSymbols$e(source)) {
|
|
939
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$e.call(source, prop))
|
|
943
940
|
target[prop] = source[prop];
|
|
944
941
|
}
|
|
945
942
|
return target;
|
|
@@ -977,17 +974,17 @@ const useAddInsuranceFunds = () => {
|
|
|
977
974
|
});
|
|
978
975
|
};
|
|
979
976
|
|
|
980
|
-
var __getOwnPropSymbols$
|
|
981
|
-
var __hasOwnProp$
|
|
982
|
-
var __propIsEnum$
|
|
977
|
+
var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
|
|
978
|
+
var __hasOwnProp$d = Object.prototype.hasOwnProperty;
|
|
979
|
+
var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
|
|
983
980
|
var __objRest$7 = (source, exclude) => {
|
|
984
981
|
var target = {};
|
|
985
982
|
for (var prop in source)
|
|
986
|
-
if (__hasOwnProp$
|
|
983
|
+
if (__hasOwnProp$d.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
987
984
|
target[prop] = source[prop];
|
|
988
|
-
if (source != null && __getOwnPropSymbols$
|
|
989
|
-
for (var prop of __getOwnPropSymbols$
|
|
990
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
985
|
+
if (source != null && __getOwnPropSymbols$d)
|
|
986
|
+
for (var prop of __getOwnPropSymbols$d(source)) {
|
|
987
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$d.call(source, prop))
|
|
991
988
|
target[prop] = source[prop];
|
|
992
989
|
}
|
|
993
990
|
return target;
|
|
@@ -1040,17 +1037,17 @@ const useGetLabel = (labelId) => {
|
|
|
1040
1037
|
});
|
|
1041
1038
|
};
|
|
1042
1039
|
|
|
1043
|
-
var __getOwnPropSymbols$
|
|
1044
|
-
var __hasOwnProp$
|
|
1045
|
-
var __propIsEnum$
|
|
1040
|
+
var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
|
|
1041
|
+
var __hasOwnProp$c = Object.prototype.hasOwnProperty;
|
|
1042
|
+
var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
|
|
1046
1043
|
var __objRest$6 = (source, exclude) => {
|
|
1047
1044
|
var target = {};
|
|
1048
1045
|
for (var prop in source)
|
|
1049
|
-
if (__hasOwnProp$
|
|
1046
|
+
if (__hasOwnProp$c.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1050
1047
|
target[prop] = source[prop];
|
|
1051
|
-
if (source != null && __getOwnPropSymbols$
|
|
1052
|
-
for (var prop of __getOwnPropSymbols$
|
|
1053
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
1048
|
+
if (source != null && __getOwnPropSymbols$c)
|
|
1049
|
+
for (var prop of __getOwnPropSymbols$c(source)) {
|
|
1050
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$c.call(source, prop))
|
|
1054
1051
|
target[prop] = source[prop];
|
|
1055
1052
|
}
|
|
1056
1053
|
return target;
|
|
@@ -1446,17 +1443,17 @@ const useListSalesOrders = (params = {}) => {
|
|
|
1446
1443
|
});
|
|
1447
1444
|
};
|
|
1448
1445
|
|
|
1449
|
-
var __getOwnPropSymbols$
|
|
1450
|
-
var __hasOwnProp$
|
|
1451
|
-
var __propIsEnum$
|
|
1446
|
+
var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
|
|
1447
|
+
var __hasOwnProp$b = Object.prototype.hasOwnProperty;
|
|
1448
|
+
var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
|
|
1452
1449
|
var __objRest$5 = (source, exclude) => {
|
|
1453
1450
|
var target = {};
|
|
1454
1451
|
for (var prop in source)
|
|
1455
|
-
if (__hasOwnProp$
|
|
1452
|
+
if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1456
1453
|
target[prop] = source[prop];
|
|
1457
|
-
if (source != null && __getOwnPropSymbols$
|
|
1458
|
-
for (var prop of __getOwnPropSymbols$
|
|
1459
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
1454
|
+
if (source != null && __getOwnPropSymbols$b)
|
|
1455
|
+
for (var prop of __getOwnPropSymbols$b(source)) {
|
|
1456
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
|
|
1460
1457
|
target[prop] = source[prop];
|
|
1461
1458
|
}
|
|
1462
1459
|
return target;
|
|
@@ -1494,17 +1491,17 @@ const useNotifySalesOrderShipped = () => {
|
|
|
1494
1491
|
});
|
|
1495
1492
|
};
|
|
1496
1493
|
|
|
1497
|
-
var __getOwnPropSymbols$
|
|
1498
|
-
var __hasOwnProp$
|
|
1499
|
-
var __propIsEnum$
|
|
1494
|
+
var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
|
|
1495
|
+
var __hasOwnProp$a = Object.prototype.hasOwnProperty;
|
|
1496
|
+
var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
|
|
1500
1497
|
var __objRest$4 = (source, exclude) => {
|
|
1501
1498
|
var target = {};
|
|
1502
1499
|
for (var prop in source)
|
|
1503
|
-
if (__hasOwnProp$
|
|
1500
|
+
if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1504
1501
|
target[prop] = source[prop];
|
|
1505
|
-
if (source != null && __getOwnPropSymbols$
|
|
1506
|
-
for (var prop of __getOwnPropSymbols$
|
|
1507
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
1502
|
+
if (source != null && __getOwnPropSymbols$a)
|
|
1503
|
+
for (var prop of __getOwnPropSymbols$a(source)) {
|
|
1504
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
|
|
1508
1505
|
target[prop] = source[prop];
|
|
1509
1506
|
}
|
|
1510
1507
|
return target;
|
|
@@ -1568,17 +1565,17 @@ const useListSalesOrderShipments = (params) => {
|
|
|
1568
1565
|
});
|
|
1569
1566
|
};
|
|
1570
1567
|
|
|
1571
|
-
var __getOwnPropSymbols$
|
|
1572
|
-
var __hasOwnProp$
|
|
1573
|
-
var __propIsEnum$
|
|
1568
|
+
var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
|
|
1569
|
+
var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
|
|
1570
|
+
var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
|
|
1574
1571
|
var __objRest$3 = (source, exclude) => {
|
|
1575
1572
|
var target = {};
|
|
1576
1573
|
for (var prop in source)
|
|
1577
|
-
if (__hasOwnProp$
|
|
1574
|
+
if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1578
1575
|
target[prop] = source[prop];
|
|
1579
|
-
if (source != null && __getOwnPropSymbols$
|
|
1580
|
-
for (var prop of __getOwnPropSymbols$
|
|
1581
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
1576
|
+
if (source != null && __getOwnPropSymbols$9)
|
|
1577
|
+
for (var prop of __getOwnPropSymbols$9(source)) {
|
|
1578
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$9.call(source, prop))
|
|
1582
1579
|
target[prop] = source[prop];
|
|
1583
1580
|
}
|
|
1584
1581
|
return target;
|
|
@@ -1616,25 +1613,25 @@ const useUpdateSalesOrderShipment = () => {
|
|
|
1616
1613
|
});
|
|
1617
1614
|
};
|
|
1618
1615
|
|
|
1619
|
-
var __defProp$
|
|
1620
|
-
var __defProps$
|
|
1621
|
-
var __getOwnPropDescs$
|
|
1622
|
-
var __getOwnPropSymbols$
|
|
1623
|
-
var __hasOwnProp$
|
|
1624
|
-
var __propIsEnum$
|
|
1625
|
-
var __defNormalProp$
|
|
1626
|
-
var __spreadValues$
|
|
1616
|
+
var __defProp$6 = Object.defineProperty;
|
|
1617
|
+
var __defProps$6 = Object.defineProperties;
|
|
1618
|
+
var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
|
|
1619
|
+
var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
|
|
1620
|
+
var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
|
|
1621
|
+
var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
|
|
1622
|
+
var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1623
|
+
var __spreadValues$6 = (a, b) => {
|
|
1627
1624
|
for (var prop in b || (b = {}))
|
|
1628
|
-
if (__hasOwnProp$
|
|
1629
|
-
__defNormalProp$
|
|
1630
|
-
if (__getOwnPropSymbols$
|
|
1631
|
-
for (var prop of __getOwnPropSymbols$
|
|
1632
|
-
if (__propIsEnum$
|
|
1633
|
-
__defNormalProp$
|
|
1625
|
+
if (__hasOwnProp$8.call(b, prop))
|
|
1626
|
+
__defNormalProp$6(a, prop, b[prop]);
|
|
1627
|
+
if (__getOwnPropSymbols$8)
|
|
1628
|
+
for (var prop of __getOwnPropSymbols$8(b)) {
|
|
1629
|
+
if (__propIsEnum$8.call(b, prop))
|
|
1630
|
+
__defNormalProp$6(a, prop, b[prop]);
|
|
1634
1631
|
}
|
|
1635
1632
|
return a;
|
|
1636
1633
|
};
|
|
1637
|
-
var __spreadProps$
|
|
1634
|
+
var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
|
|
1638
1635
|
var __async$c = (__this, __arguments, generator) => {
|
|
1639
1636
|
return new Promise((resolve, reject) => {
|
|
1640
1637
|
var fulfilled = (value) => {
|
|
@@ -1676,7 +1673,7 @@ const useCreateShipment = () => {
|
|
|
1676
1673
|
postalCode: "",
|
|
1677
1674
|
stateProvince: ""
|
|
1678
1675
|
};
|
|
1679
|
-
return (yield client.shipments.create(__spreadProps$
|
|
1676
|
+
return (yield client.shipments.create(__spreadProps$6(__spreadValues$6({}, shipment), {
|
|
1680
1677
|
shipTo
|
|
1681
1678
|
}))).data;
|
|
1682
1679
|
}),
|
|
@@ -1717,17 +1714,17 @@ const useGetShipment = (shipmentId) => {
|
|
|
1717
1714
|
});
|
|
1718
1715
|
};
|
|
1719
1716
|
|
|
1720
|
-
var __getOwnPropSymbols$
|
|
1721
|
-
var __hasOwnProp$
|
|
1722
|
-
var __propIsEnum$
|
|
1717
|
+
var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
|
|
1718
|
+
var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
|
|
1719
|
+
var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
|
|
1723
1720
|
var __objRest$2 = (source, exclude) => {
|
|
1724
1721
|
var target = {};
|
|
1725
1722
|
for (var prop in source)
|
|
1726
|
-
if (__hasOwnProp$
|
|
1723
|
+
if (__hasOwnProp$7.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1727
1724
|
target[prop] = source[prop];
|
|
1728
|
-
if (source != null && __getOwnPropSymbols$
|
|
1729
|
-
for (var prop of __getOwnPropSymbols$
|
|
1730
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
1725
|
+
if (source != null && __getOwnPropSymbols$7)
|
|
1726
|
+
for (var prop of __getOwnPropSymbols$7(source)) {
|
|
1727
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$7.call(source, prop))
|
|
1731
1728
|
target[prop] = source[prop];
|
|
1732
1729
|
}
|
|
1733
1730
|
return target;
|
|
@@ -1744,28 +1741,28 @@ const useListShipments = (_params) => {
|
|
|
1744
1741
|
});
|
|
1745
1742
|
};
|
|
1746
1743
|
|
|
1747
|
-
var __defProp$
|
|
1748
|
-
var __defProps$
|
|
1749
|
-
var __getOwnPropDescs$
|
|
1750
|
-
var __getOwnPropSymbols$
|
|
1751
|
-
var __hasOwnProp$
|
|
1752
|
-
var __propIsEnum$
|
|
1753
|
-
var __defNormalProp$
|
|
1754
|
-
var __spreadValues$
|
|
1744
|
+
var __defProp$5 = Object.defineProperty;
|
|
1745
|
+
var __defProps$5 = Object.defineProperties;
|
|
1746
|
+
var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
|
|
1747
|
+
var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
|
|
1748
|
+
var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
|
|
1749
|
+
var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
|
|
1750
|
+
var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1751
|
+
var __spreadValues$5 = (a, b) => {
|
|
1755
1752
|
for (var prop in b || (b = {}))
|
|
1756
|
-
if (__hasOwnProp$
|
|
1757
|
-
__defNormalProp$
|
|
1758
|
-
if (__getOwnPropSymbols$
|
|
1759
|
-
for (var prop of __getOwnPropSymbols$
|
|
1760
|
-
if (__propIsEnum$
|
|
1761
|
-
__defNormalProp$
|
|
1753
|
+
if (__hasOwnProp$6.call(b, prop))
|
|
1754
|
+
__defNormalProp$5(a, prop, b[prop]);
|
|
1755
|
+
if (__getOwnPropSymbols$6)
|
|
1756
|
+
for (var prop of __getOwnPropSymbols$6(b)) {
|
|
1757
|
+
if (__propIsEnum$6.call(b, prop))
|
|
1758
|
+
__defNormalProp$5(a, prop, b[prop]);
|
|
1762
1759
|
}
|
|
1763
1760
|
return a;
|
|
1764
1761
|
};
|
|
1765
|
-
var __spreadProps$
|
|
1762
|
+
var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
|
|
1766
1763
|
const useListShippingRules = (params) => {
|
|
1767
1764
|
const { client } = useShipEngine();
|
|
1768
|
-
return reactQuery.useQuery(__spreadProps$
|
|
1765
|
+
return reactQuery.useQuery(__spreadProps$5(__spreadValues$5({}, params), {
|
|
1769
1766
|
onError,
|
|
1770
1767
|
queryFn: () => {
|
|
1771
1768
|
return client.shippingRules.list();
|
|
@@ -1987,17 +1984,17 @@ const useListWarehouses = (options) => {
|
|
|
1987
1984
|
});
|
|
1988
1985
|
};
|
|
1989
1986
|
|
|
1990
|
-
var __getOwnPropSymbols$
|
|
1991
|
-
var __hasOwnProp$
|
|
1992
|
-
var __propIsEnum$
|
|
1987
|
+
var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
|
|
1988
|
+
var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
|
|
1989
|
+
var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
|
|
1993
1990
|
var __objRest$1 = (source, exclude) => {
|
|
1994
1991
|
var target = {};
|
|
1995
1992
|
for (var prop in source)
|
|
1996
|
-
if (__hasOwnProp$
|
|
1993
|
+
if (__hasOwnProp$5.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1997
1994
|
target[prop] = source[prop];
|
|
1998
|
-
if (source != null && __getOwnPropSymbols$
|
|
1999
|
-
for (var prop of __getOwnPropSymbols$
|
|
2000
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
1995
|
+
if (source != null && __getOwnPropSymbols$5)
|
|
1996
|
+
for (var prop of __getOwnPropSymbols$5(source)) {
|
|
1997
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$5.call(source, prop))
|
|
2001
1998
|
target[prop] = source[prop];
|
|
2002
1999
|
}
|
|
2003
2000
|
return target;
|
|
@@ -2077,16 +2074,33 @@ const useUpdateAccountBillingPlan = () => {
|
|
|
2077
2074
|
});
|
|
2078
2075
|
};
|
|
2079
2076
|
|
|
2080
|
-
|
|
2077
|
+
var __defProp$4 = Object.defineProperty;
|
|
2078
|
+
var __defProps$4 = Object.defineProperties;
|
|
2079
|
+
var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
|
|
2080
|
+
var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
|
|
2081
|
+
var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
|
|
2082
|
+
var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
|
|
2083
|
+
var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2084
|
+
var __spreadValues$4 = (a, b) => {
|
|
2085
|
+
for (var prop in b || (b = {}))
|
|
2086
|
+
if (__hasOwnProp$4.call(b, prop))
|
|
2087
|
+
__defNormalProp$4(a, prop, b[prop]);
|
|
2088
|
+
if (__getOwnPropSymbols$4)
|
|
2089
|
+
for (var prop of __getOwnPropSymbols$4(b)) {
|
|
2090
|
+
if (__propIsEnum$4.call(b, prop))
|
|
2091
|
+
__defNormalProp$4(a, prop, b[prop]);
|
|
2092
|
+
}
|
|
2093
|
+
return a;
|
|
2094
|
+
};
|
|
2095
|
+
var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
|
|
2096
|
+
const useGetHereToken = (params) => {
|
|
2081
2097
|
const { client } = useShipEngine();
|
|
2082
|
-
return reactQuery.useQuery({
|
|
2083
|
-
enabled: options.providers.length > 0,
|
|
2098
|
+
return reactQuery.useQuery(__spreadProps$4(__spreadValues$4({}, params), {
|
|
2084
2099
|
onError,
|
|
2085
|
-
queryFn: () => client.servicePoints.
|
|
2086
|
-
queryKey: ["
|
|
2087
|
-
retry: false,
|
|
2100
|
+
queryFn: () => client.servicePoints.getHereToken(),
|
|
2101
|
+
queryKey: ["useGetHereToken"],
|
|
2088
2102
|
select: (result) => result.data
|
|
2089
|
-
});
|
|
2103
|
+
}));
|
|
2090
2104
|
};
|
|
2091
2105
|
|
|
2092
2106
|
const useGetServicePoint = ({
|
|
@@ -2112,6 +2126,18 @@ const useGetServicePoint = ({
|
|
|
2112
2126
|
});
|
|
2113
2127
|
};
|
|
2114
2128
|
|
|
2129
|
+
const useListServicePoints = (options) => {
|
|
2130
|
+
const { client } = useShipEngine();
|
|
2131
|
+
return reactQuery.useQuery({
|
|
2132
|
+
enabled: options.providers.length > 0,
|
|
2133
|
+
onError,
|
|
2134
|
+
queryFn: () => client.servicePoints.list(options),
|
|
2135
|
+
queryKey: ["useListServicePoints", options],
|
|
2136
|
+
retry: false,
|
|
2137
|
+
select: (result) => result.data
|
|
2138
|
+
});
|
|
2139
|
+
};
|
|
2140
|
+
|
|
2115
2141
|
var __async$4 = (__this, __arguments, generator) => {
|
|
2116
2142
|
return new Promise((resolve, reject) => {
|
|
2117
2143
|
var fulfilled = (value) => {
|
|
@@ -2431,6 +2457,7 @@ exports.useGetCurrenciesByCarrier = useGetCurrenciesByCarrier;
|
|
|
2431
2457
|
exports.useGetFundingSourceById = useGetFundingSourceById;
|
|
2432
2458
|
exports.useGetFundingSourceMetadata = useGetFundingSourceMetadata;
|
|
2433
2459
|
exports.useGetFundingSourceTransactions = useGetFundingSourceTransactions;
|
|
2460
|
+
exports.useGetHereToken = useGetHereToken;
|
|
2434
2461
|
exports.useGetInsuranceAccount = useGetInsuranceAccount;
|
|
2435
2462
|
exports.useGetInsuranceFundingSourceAcceptedTerms = useGetInsuranceFundingSourceAcceptedTerms;
|
|
2436
2463
|
exports.useGetLabel = useGetLabel;
|
package/index.mjs
CHANGED
|
@@ -74,25 +74,25 @@ const onError = (_errors) => _default();
|
|
|
74
74
|
|
|
75
75
|
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}();
|
|
76
76
|
|
|
77
|
-
var __defProp$
|
|
78
|
-
var __defProps$
|
|
79
|
-
var __getOwnPropDescs$
|
|
80
|
-
var __getOwnPropSymbols$
|
|
81
|
-
var __hasOwnProp$
|
|
82
|
-
var __propIsEnum$
|
|
83
|
-
var __defNormalProp$
|
|
84
|
-
var __spreadValues$
|
|
77
|
+
var __defProp$7 = Object.defineProperty;
|
|
78
|
+
var __defProps$7 = Object.defineProperties;
|
|
79
|
+
var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
|
|
80
|
+
var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
|
|
81
|
+
var __hasOwnProp$i = Object.prototype.hasOwnProperty;
|
|
82
|
+
var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
|
|
83
|
+
var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
84
|
+
var __spreadValues$7 = (a, b) => {
|
|
85
85
|
for (var prop in b || (b = {}))
|
|
86
|
-
if (__hasOwnProp$
|
|
87
|
-
__defNormalProp$
|
|
88
|
-
if (__getOwnPropSymbols$
|
|
89
|
-
for (var prop of __getOwnPropSymbols$
|
|
90
|
-
if (__propIsEnum$
|
|
91
|
-
__defNormalProp$
|
|
86
|
+
if (__hasOwnProp$i.call(b, prop))
|
|
87
|
+
__defNormalProp$7(a, prop, b[prop]);
|
|
88
|
+
if (__getOwnPropSymbols$i)
|
|
89
|
+
for (var prop of __getOwnPropSymbols$i(b)) {
|
|
90
|
+
if (__propIsEnum$i.call(b, prop))
|
|
91
|
+
__defNormalProp$7(a, prop, b[prop]);
|
|
92
92
|
}
|
|
93
93
|
return a;
|
|
94
94
|
};
|
|
95
|
-
var __spreadProps$
|
|
95
|
+
var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
|
|
96
96
|
const streams = [];
|
|
97
97
|
if (process.env.NODE_ENV === "production") {
|
|
98
98
|
streams.push({
|
|
@@ -101,7 +101,7 @@ if (process.env.NODE_ENV === "production") {
|
|
|
101
101
|
}
|
|
102
102
|
const logger = E({
|
|
103
103
|
name: "shipengine",
|
|
104
|
-
serializers: __spreadProps$
|
|
104
|
+
serializers: __spreadProps$7(__spreadValues$7({}, k), {
|
|
105
105
|
req: (req) => ({
|
|
106
106
|
headers: req.headers,
|
|
107
107
|
method: req.method,
|
|
@@ -512,17 +512,17 @@ const useListCarriers = () => {
|
|
|
512
512
|
});
|
|
513
513
|
};
|
|
514
514
|
|
|
515
|
-
var __getOwnPropSymbols$
|
|
516
|
-
var __hasOwnProp$
|
|
517
|
-
var __propIsEnum$
|
|
515
|
+
var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
|
|
516
|
+
var __hasOwnProp$h = Object.prototype.hasOwnProperty;
|
|
517
|
+
var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
|
|
518
518
|
var __objRest$b = (source, exclude) => {
|
|
519
519
|
var target = {};
|
|
520
520
|
for (var prop in source)
|
|
521
|
-
if (__hasOwnProp$
|
|
521
|
+
if (__hasOwnProp$h.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
522
522
|
target[prop] = source[prop];
|
|
523
|
-
if (source != null && __getOwnPropSymbols$
|
|
524
|
-
for (var prop of __getOwnPropSymbols$
|
|
525
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
523
|
+
if (source != null && __getOwnPropSymbols$h)
|
|
524
|
+
for (var prop of __getOwnPropSymbols$h(source)) {
|
|
525
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$h.call(source, prop))
|
|
526
526
|
target[prop] = source[prop];
|
|
527
527
|
}
|
|
528
528
|
return target;
|
|
@@ -613,17 +613,17 @@ const useDeleteCarrier = () => {
|
|
|
613
613
|
});
|
|
614
614
|
};
|
|
615
615
|
|
|
616
|
-
var __getOwnPropSymbols$
|
|
617
|
-
var __hasOwnProp$
|
|
618
|
-
var __propIsEnum$
|
|
616
|
+
var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
|
|
617
|
+
var __hasOwnProp$g = Object.prototype.hasOwnProperty;
|
|
618
|
+
var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
|
|
619
619
|
var __objRest$a = (source, exclude) => {
|
|
620
620
|
var target = {};
|
|
621
621
|
for (var prop in source)
|
|
622
|
-
if (__hasOwnProp$
|
|
622
|
+
if (__hasOwnProp$g.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
623
623
|
target[prop] = source[prop];
|
|
624
|
-
if (source != null && __getOwnPropSymbols$
|
|
625
|
-
for (var prop of __getOwnPropSymbols$
|
|
626
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
624
|
+
if (source != null && __getOwnPropSymbols$g)
|
|
625
|
+
for (var prop of __getOwnPropSymbols$g(source)) {
|
|
626
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$g.call(source, prop))
|
|
627
627
|
target[prop] = source[prop];
|
|
628
628
|
}
|
|
629
629
|
return target;
|
|
@@ -640,17 +640,17 @@ const useGetCarrierConnectionForm = (_params) => {
|
|
|
640
640
|
});
|
|
641
641
|
};
|
|
642
642
|
|
|
643
|
-
var __getOwnPropSymbols$
|
|
644
|
-
var __hasOwnProp$
|
|
645
|
-
var __propIsEnum$
|
|
643
|
+
var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
|
|
644
|
+
var __hasOwnProp$f = Object.prototype.hasOwnProperty;
|
|
645
|
+
var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
|
|
646
646
|
var __objRest$9 = (source, exclude) => {
|
|
647
647
|
var target = {};
|
|
648
648
|
for (var prop in source)
|
|
649
|
-
if (__hasOwnProp$
|
|
649
|
+
if (__hasOwnProp$f.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
650
650
|
target[prop] = source[prop];
|
|
651
|
-
if (source != null && __getOwnPropSymbols$
|
|
652
|
-
for (var prop of __getOwnPropSymbols$
|
|
653
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
651
|
+
if (source != null && __getOwnPropSymbols$f)
|
|
652
|
+
for (var prop of __getOwnPropSymbols$f(source)) {
|
|
653
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$f.call(source, prop))
|
|
654
654
|
target[prop] = source[prop];
|
|
655
655
|
}
|
|
656
656
|
return target;
|
|
@@ -692,9 +692,6 @@ const useConnectCarrierAccount = () => {
|
|
|
692
692
|
return useMutation({
|
|
693
693
|
mutationFn: (_0) => __async$v(void 0, [_0], function* ({ carrierName, formData }) {
|
|
694
694
|
const result = yield client.connections.connectCarrier(carrierName, formData);
|
|
695
|
-
if (result.status > 300 && result.status < 309) {
|
|
696
|
-
result.data.redirectUrl = result.request.res.responseUrl;
|
|
697
|
-
}
|
|
698
695
|
return result.data;
|
|
699
696
|
}),
|
|
700
697
|
mutationKey: ["useConnectCarrierAccount"],
|
|
@@ -926,17 +923,17 @@ const useGetInsuranceAccount = (insuranceProvider) => {
|
|
|
926
923
|
});
|
|
927
924
|
};
|
|
928
925
|
|
|
929
|
-
var __getOwnPropSymbols$
|
|
930
|
-
var __hasOwnProp$
|
|
931
|
-
var __propIsEnum$
|
|
926
|
+
var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
|
|
927
|
+
var __hasOwnProp$e = Object.prototype.hasOwnProperty;
|
|
928
|
+
var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
|
|
932
929
|
var __objRest$8 = (source, exclude) => {
|
|
933
930
|
var target = {};
|
|
934
931
|
for (var prop in source)
|
|
935
|
-
if (__hasOwnProp$
|
|
932
|
+
if (__hasOwnProp$e.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
936
933
|
target[prop] = source[prop];
|
|
937
|
-
if (source != null && __getOwnPropSymbols$
|
|
938
|
-
for (var prop of __getOwnPropSymbols$
|
|
939
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
934
|
+
if (source != null && __getOwnPropSymbols$e)
|
|
935
|
+
for (var prop of __getOwnPropSymbols$e(source)) {
|
|
936
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$e.call(source, prop))
|
|
940
937
|
target[prop] = source[prop];
|
|
941
938
|
}
|
|
942
939
|
return target;
|
|
@@ -974,17 +971,17 @@ const useAddInsuranceFunds = () => {
|
|
|
974
971
|
});
|
|
975
972
|
};
|
|
976
973
|
|
|
977
|
-
var __getOwnPropSymbols$
|
|
978
|
-
var __hasOwnProp$
|
|
979
|
-
var __propIsEnum$
|
|
974
|
+
var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
|
|
975
|
+
var __hasOwnProp$d = Object.prototype.hasOwnProperty;
|
|
976
|
+
var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
|
|
980
977
|
var __objRest$7 = (source, exclude) => {
|
|
981
978
|
var target = {};
|
|
982
979
|
for (var prop in source)
|
|
983
|
-
if (__hasOwnProp$
|
|
980
|
+
if (__hasOwnProp$d.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
984
981
|
target[prop] = source[prop];
|
|
985
|
-
if (source != null && __getOwnPropSymbols$
|
|
986
|
-
for (var prop of __getOwnPropSymbols$
|
|
987
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
982
|
+
if (source != null && __getOwnPropSymbols$d)
|
|
983
|
+
for (var prop of __getOwnPropSymbols$d(source)) {
|
|
984
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$d.call(source, prop))
|
|
988
985
|
target[prop] = source[prop];
|
|
989
986
|
}
|
|
990
987
|
return target;
|
|
@@ -1037,17 +1034,17 @@ const useGetLabel = (labelId) => {
|
|
|
1037
1034
|
});
|
|
1038
1035
|
};
|
|
1039
1036
|
|
|
1040
|
-
var __getOwnPropSymbols$
|
|
1041
|
-
var __hasOwnProp$
|
|
1042
|
-
var __propIsEnum$
|
|
1037
|
+
var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
|
|
1038
|
+
var __hasOwnProp$c = Object.prototype.hasOwnProperty;
|
|
1039
|
+
var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
|
|
1043
1040
|
var __objRest$6 = (source, exclude) => {
|
|
1044
1041
|
var target = {};
|
|
1045
1042
|
for (var prop in source)
|
|
1046
|
-
if (__hasOwnProp$
|
|
1043
|
+
if (__hasOwnProp$c.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1047
1044
|
target[prop] = source[prop];
|
|
1048
|
-
if (source != null && __getOwnPropSymbols$
|
|
1049
|
-
for (var prop of __getOwnPropSymbols$
|
|
1050
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
1045
|
+
if (source != null && __getOwnPropSymbols$c)
|
|
1046
|
+
for (var prop of __getOwnPropSymbols$c(source)) {
|
|
1047
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$c.call(source, prop))
|
|
1051
1048
|
target[prop] = source[prop];
|
|
1052
1049
|
}
|
|
1053
1050
|
return target;
|
|
@@ -1443,17 +1440,17 @@ const useListSalesOrders = (params = {}) => {
|
|
|
1443
1440
|
});
|
|
1444
1441
|
};
|
|
1445
1442
|
|
|
1446
|
-
var __getOwnPropSymbols$
|
|
1447
|
-
var __hasOwnProp$
|
|
1448
|
-
var __propIsEnum$
|
|
1443
|
+
var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
|
|
1444
|
+
var __hasOwnProp$b = Object.prototype.hasOwnProperty;
|
|
1445
|
+
var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
|
|
1449
1446
|
var __objRest$5 = (source, exclude) => {
|
|
1450
1447
|
var target = {};
|
|
1451
1448
|
for (var prop in source)
|
|
1452
|
-
if (__hasOwnProp$
|
|
1449
|
+
if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1453
1450
|
target[prop] = source[prop];
|
|
1454
|
-
if (source != null && __getOwnPropSymbols$
|
|
1455
|
-
for (var prop of __getOwnPropSymbols$
|
|
1456
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
1451
|
+
if (source != null && __getOwnPropSymbols$b)
|
|
1452
|
+
for (var prop of __getOwnPropSymbols$b(source)) {
|
|
1453
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
|
|
1457
1454
|
target[prop] = source[prop];
|
|
1458
1455
|
}
|
|
1459
1456
|
return target;
|
|
@@ -1491,17 +1488,17 @@ const useNotifySalesOrderShipped = () => {
|
|
|
1491
1488
|
});
|
|
1492
1489
|
};
|
|
1493
1490
|
|
|
1494
|
-
var __getOwnPropSymbols$
|
|
1495
|
-
var __hasOwnProp$
|
|
1496
|
-
var __propIsEnum$
|
|
1491
|
+
var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
|
|
1492
|
+
var __hasOwnProp$a = Object.prototype.hasOwnProperty;
|
|
1493
|
+
var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
|
|
1497
1494
|
var __objRest$4 = (source, exclude) => {
|
|
1498
1495
|
var target = {};
|
|
1499
1496
|
for (var prop in source)
|
|
1500
|
-
if (__hasOwnProp$
|
|
1497
|
+
if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1501
1498
|
target[prop] = source[prop];
|
|
1502
|
-
if (source != null && __getOwnPropSymbols$
|
|
1503
|
-
for (var prop of __getOwnPropSymbols$
|
|
1504
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
1499
|
+
if (source != null && __getOwnPropSymbols$a)
|
|
1500
|
+
for (var prop of __getOwnPropSymbols$a(source)) {
|
|
1501
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
|
|
1505
1502
|
target[prop] = source[prop];
|
|
1506
1503
|
}
|
|
1507
1504
|
return target;
|
|
@@ -1565,17 +1562,17 @@ const useListSalesOrderShipments = (params) => {
|
|
|
1565
1562
|
});
|
|
1566
1563
|
};
|
|
1567
1564
|
|
|
1568
|
-
var __getOwnPropSymbols$
|
|
1569
|
-
var __hasOwnProp$
|
|
1570
|
-
var __propIsEnum$
|
|
1565
|
+
var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
|
|
1566
|
+
var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
|
|
1567
|
+
var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
|
|
1571
1568
|
var __objRest$3 = (source, exclude) => {
|
|
1572
1569
|
var target = {};
|
|
1573
1570
|
for (var prop in source)
|
|
1574
|
-
if (__hasOwnProp$
|
|
1571
|
+
if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1575
1572
|
target[prop] = source[prop];
|
|
1576
|
-
if (source != null && __getOwnPropSymbols$
|
|
1577
|
-
for (var prop of __getOwnPropSymbols$
|
|
1578
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
1573
|
+
if (source != null && __getOwnPropSymbols$9)
|
|
1574
|
+
for (var prop of __getOwnPropSymbols$9(source)) {
|
|
1575
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$9.call(source, prop))
|
|
1579
1576
|
target[prop] = source[prop];
|
|
1580
1577
|
}
|
|
1581
1578
|
return target;
|
|
@@ -1613,25 +1610,25 @@ const useUpdateSalesOrderShipment = () => {
|
|
|
1613
1610
|
});
|
|
1614
1611
|
};
|
|
1615
1612
|
|
|
1616
|
-
var __defProp$
|
|
1617
|
-
var __defProps$
|
|
1618
|
-
var __getOwnPropDescs$
|
|
1619
|
-
var __getOwnPropSymbols$
|
|
1620
|
-
var __hasOwnProp$
|
|
1621
|
-
var __propIsEnum$
|
|
1622
|
-
var __defNormalProp$
|
|
1623
|
-
var __spreadValues$
|
|
1613
|
+
var __defProp$6 = Object.defineProperty;
|
|
1614
|
+
var __defProps$6 = Object.defineProperties;
|
|
1615
|
+
var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
|
|
1616
|
+
var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
|
|
1617
|
+
var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
|
|
1618
|
+
var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
|
|
1619
|
+
var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1620
|
+
var __spreadValues$6 = (a, b) => {
|
|
1624
1621
|
for (var prop in b || (b = {}))
|
|
1625
|
-
if (__hasOwnProp$
|
|
1626
|
-
__defNormalProp$
|
|
1627
|
-
if (__getOwnPropSymbols$
|
|
1628
|
-
for (var prop of __getOwnPropSymbols$
|
|
1629
|
-
if (__propIsEnum$
|
|
1630
|
-
__defNormalProp$
|
|
1622
|
+
if (__hasOwnProp$8.call(b, prop))
|
|
1623
|
+
__defNormalProp$6(a, prop, b[prop]);
|
|
1624
|
+
if (__getOwnPropSymbols$8)
|
|
1625
|
+
for (var prop of __getOwnPropSymbols$8(b)) {
|
|
1626
|
+
if (__propIsEnum$8.call(b, prop))
|
|
1627
|
+
__defNormalProp$6(a, prop, b[prop]);
|
|
1631
1628
|
}
|
|
1632
1629
|
return a;
|
|
1633
1630
|
};
|
|
1634
|
-
var __spreadProps$
|
|
1631
|
+
var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
|
|
1635
1632
|
var __async$c = (__this, __arguments, generator) => {
|
|
1636
1633
|
return new Promise((resolve, reject) => {
|
|
1637
1634
|
var fulfilled = (value) => {
|
|
@@ -1673,7 +1670,7 @@ const useCreateShipment = () => {
|
|
|
1673
1670
|
postalCode: "",
|
|
1674
1671
|
stateProvince: ""
|
|
1675
1672
|
};
|
|
1676
|
-
return (yield client.shipments.create(__spreadProps$
|
|
1673
|
+
return (yield client.shipments.create(__spreadProps$6(__spreadValues$6({}, shipment), {
|
|
1677
1674
|
shipTo
|
|
1678
1675
|
}))).data;
|
|
1679
1676
|
}),
|
|
@@ -1714,17 +1711,17 @@ const useGetShipment = (shipmentId) => {
|
|
|
1714
1711
|
});
|
|
1715
1712
|
};
|
|
1716
1713
|
|
|
1717
|
-
var __getOwnPropSymbols$
|
|
1718
|
-
var __hasOwnProp$
|
|
1719
|
-
var __propIsEnum$
|
|
1714
|
+
var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
|
|
1715
|
+
var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
|
|
1716
|
+
var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
|
|
1720
1717
|
var __objRest$2 = (source, exclude) => {
|
|
1721
1718
|
var target = {};
|
|
1722
1719
|
for (var prop in source)
|
|
1723
|
-
if (__hasOwnProp$
|
|
1720
|
+
if (__hasOwnProp$7.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1724
1721
|
target[prop] = source[prop];
|
|
1725
|
-
if (source != null && __getOwnPropSymbols$
|
|
1726
|
-
for (var prop of __getOwnPropSymbols$
|
|
1727
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
1722
|
+
if (source != null && __getOwnPropSymbols$7)
|
|
1723
|
+
for (var prop of __getOwnPropSymbols$7(source)) {
|
|
1724
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$7.call(source, prop))
|
|
1728
1725
|
target[prop] = source[prop];
|
|
1729
1726
|
}
|
|
1730
1727
|
return target;
|
|
@@ -1741,28 +1738,28 @@ const useListShipments = (_params) => {
|
|
|
1741
1738
|
});
|
|
1742
1739
|
};
|
|
1743
1740
|
|
|
1744
|
-
var __defProp$
|
|
1745
|
-
var __defProps$
|
|
1746
|
-
var __getOwnPropDescs$
|
|
1747
|
-
var __getOwnPropSymbols$
|
|
1748
|
-
var __hasOwnProp$
|
|
1749
|
-
var __propIsEnum$
|
|
1750
|
-
var __defNormalProp$
|
|
1751
|
-
var __spreadValues$
|
|
1741
|
+
var __defProp$5 = Object.defineProperty;
|
|
1742
|
+
var __defProps$5 = Object.defineProperties;
|
|
1743
|
+
var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
|
|
1744
|
+
var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
|
|
1745
|
+
var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
|
|
1746
|
+
var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
|
|
1747
|
+
var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1748
|
+
var __spreadValues$5 = (a, b) => {
|
|
1752
1749
|
for (var prop in b || (b = {}))
|
|
1753
|
-
if (__hasOwnProp$
|
|
1754
|
-
__defNormalProp$
|
|
1755
|
-
if (__getOwnPropSymbols$
|
|
1756
|
-
for (var prop of __getOwnPropSymbols$
|
|
1757
|
-
if (__propIsEnum$
|
|
1758
|
-
__defNormalProp$
|
|
1750
|
+
if (__hasOwnProp$6.call(b, prop))
|
|
1751
|
+
__defNormalProp$5(a, prop, b[prop]);
|
|
1752
|
+
if (__getOwnPropSymbols$6)
|
|
1753
|
+
for (var prop of __getOwnPropSymbols$6(b)) {
|
|
1754
|
+
if (__propIsEnum$6.call(b, prop))
|
|
1755
|
+
__defNormalProp$5(a, prop, b[prop]);
|
|
1759
1756
|
}
|
|
1760
1757
|
return a;
|
|
1761
1758
|
};
|
|
1762
|
-
var __spreadProps$
|
|
1759
|
+
var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
|
|
1763
1760
|
const useListShippingRules = (params) => {
|
|
1764
1761
|
const { client } = useShipEngine();
|
|
1765
|
-
return useQuery(__spreadProps$
|
|
1762
|
+
return useQuery(__spreadProps$5(__spreadValues$5({}, params), {
|
|
1766
1763
|
onError,
|
|
1767
1764
|
queryFn: () => {
|
|
1768
1765
|
return client.shippingRules.list();
|
|
@@ -1984,17 +1981,17 @@ const useListWarehouses = (options) => {
|
|
|
1984
1981
|
});
|
|
1985
1982
|
};
|
|
1986
1983
|
|
|
1987
|
-
var __getOwnPropSymbols$
|
|
1988
|
-
var __hasOwnProp$
|
|
1989
|
-
var __propIsEnum$
|
|
1984
|
+
var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
|
|
1985
|
+
var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
|
|
1986
|
+
var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
|
|
1990
1987
|
var __objRest$1 = (source, exclude) => {
|
|
1991
1988
|
var target = {};
|
|
1992
1989
|
for (var prop in source)
|
|
1993
|
-
if (__hasOwnProp$
|
|
1990
|
+
if (__hasOwnProp$5.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1994
1991
|
target[prop] = source[prop];
|
|
1995
|
-
if (source != null && __getOwnPropSymbols$
|
|
1996
|
-
for (var prop of __getOwnPropSymbols$
|
|
1997
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
1992
|
+
if (source != null && __getOwnPropSymbols$5)
|
|
1993
|
+
for (var prop of __getOwnPropSymbols$5(source)) {
|
|
1994
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$5.call(source, prop))
|
|
1998
1995
|
target[prop] = source[prop];
|
|
1999
1996
|
}
|
|
2000
1997
|
return target;
|
|
@@ -2074,16 +2071,33 @@ const useUpdateAccountBillingPlan = () => {
|
|
|
2074
2071
|
});
|
|
2075
2072
|
};
|
|
2076
2073
|
|
|
2077
|
-
|
|
2074
|
+
var __defProp$4 = Object.defineProperty;
|
|
2075
|
+
var __defProps$4 = Object.defineProperties;
|
|
2076
|
+
var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
|
|
2077
|
+
var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
|
|
2078
|
+
var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
|
|
2079
|
+
var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
|
|
2080
|
+
var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2081
|
+
var __spreadValues$4 = (a, b) => {
|
|
2082
|
+
for (var prop in b || (b = {}))
|
|
2083
|
+
if (__hasOwnProp$4.call(b, prop))
|
|
2084
|
+
__defNormalProp$4(a, prop, b[prop]);
|
|
2085
|
+
if (__getOwnPropSymbols$4)
|
|
2086
|
+
for (var prop of __getOwnPropSymbols$4(b)) {
|
|
2087
|
+
if (__propIsEnum$4.call(b, prop))
|
|
2088
|
+
__defNormalProp$4(a, prop, b[prop]);
|
|
2089
|
+
}
|
|
2090
|
+
return a;
|
|
2091
|
+
};
|
|
2092
|
+
var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
|
|
2093
|
+
const useGetHereToken = (params) => {
|
|
2078
2094
|
const { client } = useShipEngine();
|
|
2079
|
-
return useQuery({
|
|
2080
|
-
enabled: options.providers.length > 0,
|
|
2095
|
+
return useQuery(__spreadProps$4(__spreadValues$4({}, params), {
|
|
2081
2096
|
onError,
|
|
2082
|
-
queryFn: () => client.servicePoints.
|
|
2083
|
-
queryKey: ["
|
|
2084
|
-
retry: false,
|
|
2097
|
+
queryFn: () => client.servicePoints.getHereToken(),
|
|
2098
|
+
queryKey: ["useGetHereToken"],
|
|
2085
2099
|
select: (result) => result.data
|
|
2086
|
-
});
|
|
2100
|
+
}));
|
|
2087
2101
|
};
|
|
2088
2102
|
|
|
2089
2103
|
const useGetServicePoint = ({
|
|
@@ -2109,6 +2123,18 @@ const useGetServicePoint = ({
|
|
|
2109
2123
|
});
|
|
2110
2124
|
};
|
|
2111
2125
|
|
|
2126
|
+
const useListServicePoints = (options) => {
|
|
2127
|
+
const { client } = useShipEngine();
|
|
2128
|
+
return useQuery({
|
|
2129
|
+
enabled: options.providers.length > 0,
|
|
2130
|
+
onError,
|
|
2131
|
+
queryFn: () => client.servicePoints.list(options),
|
|
2132
|
+
queryKey: ["useListServicePoints", options],
|
|
2133
|
+
retry: false,
|
|
2134
|
+
select: (result) => result.data
|
|
2135
|
+
});
|
|
2136
|
+
};
|
|
2137
|
+
|
|
2112
2138
|
var __async$4 = (__this, __arguments, generator) => {
|
|
2113
2139
|
return new Promise((resolve, reject) => {
|
|
2114
2140
|
var fulfilled = (value) => {
|
|
@@ -2384,4 +2410,4 @@ const useUpdateWebhook = (params) => {
|
|
|
2384
2410
|
}));
|
|
2385
2411
|
};
|
|
2386
2412
|
|
|
2387
|
-
export { ShipEngine, ShipEngineContext, delay, logger, onError, retryUntil, useAddFunds, useAddInsuranceFunds, useAddSandboxCarriers, useCalculateRates, useCarrierConnectionsServicesList, useConnectCarrier, useConnectCarrierAccount, useCreateAccountImage, useCreateFundingSource, useCreateLabel, useCreateRateCard, useCreateSalesOrderShipment, useCreateSandboxSeller, useCreateShipment, useCreateShippingRule, useCreateWarehouse, useCreateWebhook, useDeactivateOrderSource, useDeleteAccountImage, useDeleteCarrier, useDeleteRateCard, useDeleteShippingRule, useDeleteWarehouse, useDeleteWebhook, useDownloadRateCard, useEditShippingRule, useFundingSourcesAddFunds, useGetAccountBillingPlan, useGetAccountImages, useGetAccountSettings, useGetAutoFundingConfiguration, useGetCarrierById, useGetCarrierConnectionForm, useGetCountriesByCarrier, useGetCurrenciesByCarrier, useGetFundingSourceById, useGetFundingSourceMetadata, useGetFundingSourceTransactions, useGetInsuranceAccount, useGetInsuranceFundingSourceAcceptedTerms, useGetLabel, useGetPackageRatingGroupByCarrier, useGetRateCardById, useGetSalesOrder, useGetSalesOrderShipment, useGetServicePoint, useGetServicesByCarrier, useGetShipment, useGetShipmentRates, useGetShippingRuleById, useGetShippingRuleConditionsOptions, useGetThemeById, useGetZonesByCarrier, useListCarrierConnections, useListCarriers, useListCustomPackageTypes, useListFundingSources, useListLabels, useListOrderSources, useListRateCards, useListSalesOrderShipments, useListSalesOrders, useListSandboxSellerIds, useListServicePoints, useListShipments, useListShippingRules, useListWarehouses, useListWebhooks, useNotifySalesOrderShipped, useParseAddress, usePublishRateCard, useRefreshOrderSource, useRefreshOrderSourceAsync, useRegisterCarrier, useShipEngine, useUpdateAccountBillingPlan, useUpdateAccountImage, useUpdateAccountSettings, useUpdateAutoFunding, useUpdateFundingSource, useUpdateRateCard, useUpdateSalesOrderShipment, useUpdateWarehouse, useUpdateWebhook, useUploadRateCard, useValidateAddresses, useVoidLabel };
|
|
2413
|
+
export { ShipEngine, ShipEngineContext, delay, logger, onError, retryUntil, useAddFunds, useAddInsuranceFunds, useAddSandboxCarriers, useCalculateRates, useCarrierConnectionsServicesList, useConnectCarrier, useConnectCarrierAccount, useCreateAccountImage, useCreateFundingSource, useCreateLabel, useCreateRateCard, useCreateSalesOrderShipment, useCreateSandboxSeller, useCreateShipment, useCreateShippingRule, useCreateWarehouse, useCreateWebhook, useDeactivateOrderSource, useDeleteAccountImage, useDeleteCarrier, useDeleteRateCard, useDeleteShippingRule, useDeleteWarehouse, useDeleteWebhook, useDownloadRateCard, useEditShippingRule, useFundingSourcesAddFunds, useGetAccountBillingPlan, useGetAccountImages, useGetAccountSettings, useGetAutoFundingConfiguration, useGetCarrierById, useGetCarrierConnectionForm, useGetCountriesByCarrier, useGetCurrenciesByCarrier, useGetFundingSourceById, useGetFundingSourceMetadata, useGetFundingSourceTransactions, useGetHereToken, useGetInsuranceAccount, useGetInsuranceFundingSourceAcceptedTerms, useGetLabel, useGetPackageRatingGroupByCarrier, useGetRateCardById, useGetSalesOrder, useGetSalesOrderShipment, useGetServicePoint, useGetServicesByCarrier, useGetShipment, useGetShipmentRates, useGetShippingRuleById, useGetShippingRuleConditionsOptions, useGetThemeById, useGetZonesByCarrier, useListCarrierConnections, useListCarriers, useListCustomPackageTypes, useListFundingSources, useListLabels, useListOrderSources, useListRateCards, useListSalesOrderShipments, useListSalesOrders, useListSandboxSellerIds, useListServicePoints, useListShipments, useListShippingRules, useListWarehouses, useListWebhooks, useNotifySalesOrderShipped, useParseAddress, usePublishRateCard, useRefreshOrderSource, useRefreshOrderSourceAsync, useRegisterCarrier, useShipEngine, useUpdateAccountBillingPlan, useUpdateAccountImage, useUpdateAccountSettings, useUpdateAutoFunding, useUpdateFundingSource, useUpdateRateCard, useUpdateSalesOrderShipment, useUpdateWarehouse, useUpdateWebhook, useUploadRateCard, useValidateAddresses, useVoidLabel };
|
package/package.json
CHANGED
package/utilities/types.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { CodedError } from "@shipengine/js-api";
|
|
|
9
9
|
*/
|
|
10
10
|
export type QueryProps<TResponseData, TQueryFnParams = unknown> = {
|
|
11
11
|
queryFnParams?: TQueryFnParams;
|
|
12
|
-
} & Pick<UseQueryOptions<AxiosResponse<TResponseData, any>, CodedError[], TResponseData>, "enabled">;
|
|
12
|
+
} & Pick<UseQueryOptions<AxiosResponse<TResponseData, any>, CodedError[], TResponseData>, "cacheTime" | "enabled" | "staleTime">;
|
|
13
13
|
/**
|
|
14
14
|
* @category Entities
|
|
15
15
|
* Generic object type to be used in any useMutation hook
|