@shipengine/react-api 2.9.1 → 2.11.0

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.
@@ -6,3 +6,4 @@ export * from "./use-register-carrier";
6
6
  export * from "./use-update-funding-source";
7
7
  export * from "./use-get-funding-source-metadata";
8
8
  export * from "./use-get-funding-source-transactions";
9
+ export * from "./use-get-insurance-funding-source-accepted-terms";
@@ -2,6 +2,4 @@ import { SE } from "@shipengine/js-api";
2
2
  /**
3
3
  * @category ShipEngine API Hooks
4
4
  * */
5
- export declare const useCreateFundingSource: () => import("@tanstack/react-query").UseMutationResult<{
6
- fundingSource: SE.FundingSource;
7
- }, SE.CodedError[], SE.CreateFundingSource, unknown>;
5
+ export declare const useCreateFundingSource: () => import("@tanstack/react-query").UseMutationResult<SE.FundingSourceCreateResponse, SE.CodedError[], SE.CreateFundingSource, unknown>;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @category ShipEngine API Hooks
3
+ */
4
+ export declare const useGetInsuranceFundingSourceAcceptedTerms: () => import("@tanstack/react-query").UseQueryResult<import("@shipengine/js-api").InsuranceFundingSourceAcceptedTermsResponse, import("@shipengine/js-api").CodedError[]>;
@@ -1,2 +1,3 @@
1
- export * from "./use-list-service-points";
1
+ export * from "./use-get-here-token";
2
2
  export * from "./use-get-service-point";
3
+ export * from "./use-list-service-points";
@@ -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$6 = Object.defineProperty;
81
- var __defProps$6 = Object.defineProperties;
82
- var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
83
- var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
84
- var __hasOwnProp$h = Object.prototype.hasOwnProperty;
85
- var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
86
- var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
87
- var __spreadValues$6 = (a, b) => {
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$h.call(b, prop))
90
- __defNormalProp$6(a, prop, b[prop]);
91
- if (__getOwnPropSymbols$h)
92
- for (var prop of __getOwnPropSymbols$h(b)) {
93
- if (__propIsEnum$h.call(b, prop))
94
- __defNormalProp$6(a, prop, b[prop]);
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$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
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$6(__spreadValues$6({}, k), {
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$g = Object.getOwnPropertySymbols;
519
- var __hasOwnProp$g = Object.prototype.hasOwnProperty;
520
- var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
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$g.call(source, prop) && exclude.indexOf(prop) < 0)
524
+ if (__hasOwnProp$h.call(source, prop) && exclude.indexOf(prop) < 0)
525
525
  target[prop] = source[prop];
526
- if (source != null && __getOwnPropSymbols$g)
527
- for (var prop of __getOwnPropSymbols$g(source)) {
528
- if (exclude.indexOf(prop) < 0 && __propIsEnum$g.call(source, prop))
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$f = Object.getOwnPropertySymbols;
620
- var __hasOwnProp$f = Object.prototype.hasOwnProperty;
621
- var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
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$f.call(source, prop) && exclude.indexOf(prop) < 0)
625
+ if (__hasOwnProp$g.call(source, prop) && exclude.indexOf(prop) < 0)
626
626
  target[prop] = source[prop];
627
- if (source != null && __getOwnPropSymbols$f)
628
- for (var prop of __getOwnPropSymbols$f(source)) {
629
- if (exclude.indexOf(prop) < 0 && __propIsEnum$f.call(source, prop))
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$e = Object.getOwnPropertySymbols;
647
- var __hasOwnProp$e = Object.prototype.hasOwnProperty;
648
- var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
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$e.call(source, prop) && exclude.indexOf(prop) < 0)
652
+ if (__hasOwnProp$f.call(source, prop) && exclude.indexOf(prop) < 0)
653
653
  target[prop] = source[prop];
654
- if (source != null && __getOwnPropSymbols$e)
655
- for (var prop of __getOwnPropSymbols$e(source)) {
656
- if (exclude.indexOf(prop) < 0 && __propIsEnum$e.call(source, prop))
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"],
@@ -904,6 +901,16 @@ const useGetFundingSourceTransactions = (fundingSourceId, params) => {
904
901
  });
905
902
  };
906
903
 
904
+ const useGetInsuranceFundingSourceAcceptedTerms = () => {
905
+ const { client } = useShipEngine();
906
+ return reactQuery.useQuery({
907
+ onError,
908
+ queryFn: () => client.fundingSources.insuranceAcceptedTerms(),
909
+ queryKey: ["useGetInsuranceFundingSourceAcceptedTerms"],
910
+ select: (result) => result.data
911
+ });
912
+ };
913
+
907
914
  const useGetInsuranceAccount = (insuranceProvider) => {
908
915
  const { client } = useShipEngine();
909
916
  return reactQuery.useQuery({
@@ -919,17 +926,17 @@ const useGetInsuranceAccount = (insuranceProvider) => {
919
926
  });
920
927
  };
921
928
 
922
- var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
923
- var __hasOwnProp$d = Object.prototype.hasOwnProperty;
924
- var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
929
+ var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
930
+ var __hasOwnProp$e = Object.prototype.hasOwnProperty;
931
+ var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
925
932
  var __objRest$8 = (source, exclude) => {
926
933
  var target = {};
927
934
  for (var prop in source)
928
- if (__hasOwnProp$d.call(source, prop) && exclude.indexOf(prop) < 0)
935
+ if (__hasOwnProp$e.call(source, prop) && exclude.indexOf(prop) < 0)
929
936
  target[prop] = source[prop];
930
- if (source != null && __getOwnPropSymbols$d)
931
- for (var prop of __getOwnPropSymbols$d(source)) {
932
- if (exclude.indexOf(prop) < 0 && __propIsEnum$d.call(source, prop))
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))
933
940
  target[prop] = source[prop];
934
941
  }
935
942
  return target;
@@ -967,17 +974,17 @@ const useAddInsuranceFunds = () => {
967
974
  });
968
975
  };
969
976
 
970
- var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
971
- var __hasOwnProp$c = Object.prototype.hasOwnProperty;
972
- var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
977
+ var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
978
+ var __hasOwnProp$d = Object.prototype.hasOwnProperty;
979
+ var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
973
980
  var __objRest$7 = (source, exclude) => {
974
981
  var target = {};
975
982
  for (var prop in source)
976
- if (__hasOwnProp$c.call(source, prop) && exclude.indexOf(prop) < 0)
983
+ if (__hasOwnProp$d.call(source, prop) && exclude.indexOf(prop) < 0)
977
984
  target[prop] = source[prop];
978
- if (source != null && __getOwnPropSymbols$c)
979
- for (var prop of __getOwnPropSymbols$c(source)) {
980
- if (exclude.indexOf(prop) < 0 && __propIsEnum$c.call(source, prop))
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))
981
988
  target[prop] = source[prop];
982
989
  }
983
990
  return target;
@@ -1030,17 +1037,17 @@ const useGetLabel = (labelId) => {
1030
1037
  });
1031
1038
  };
1032
1039
 
1033
- var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
1034
- var __hasOwnProp$b = Object.prototype.hasOwnProperty;
1035
- var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
1040
+ var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
1041
+ var __hasOwnProp$c = Object.prototype.hasOwnProperty;
1042
+ var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
1036
1043
  var __objRest$6 = (source, exclude) => {
1037
1044
  var target = {};
1038
1045
  for (var prop in source)
1039
- if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
1046
+ if (__hasOwnProp$c.call(source, prop) && exclude.indexOf(prop) < 0)
1040
1047
  target[prop] = source[prop];
1041
- if (source != null && __getOwnPropSymbols$b)
1042
- for (var prop of __getOwnPropSymbols$b(source)) {
1043
- if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
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))
1044
1051
  target[prop] = source[prop];
1045
1052
  }
1046
1053
  return target;
@@ -1436,17 +1443,17 @@ const useListSalesOrders = (params = {}) => {
1436
1443
  });
1437
1444
  };
1438
1445
 
1439
- var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
1440
- var __hasOwnProp$a = Object.prototype.hasOwnProperty;
1441
- var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
1446
+ var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
1447
+ var __hasOwnProp$b = Object.prototype.hasOwnProperty;
1448
+ var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
1442
1449
  var __objRest$5 = (source, exclude) => {
1443
1450
  var target = {};
1444
1451
  for (var prop in source)
1445
- if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
1452
+ if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
1446
1453
  target[prop] = source[prop];
1447
- if (source != null && __getOwnPropSymbols$a)
1448
- for (var prop of __getOwnPropSymbols$a(source)) {
1449
- if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
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))
1450
1457
  target[prop] = source[prop];
1451
1458
  }
1452
1459
  return target;
@@ -1484,17 +1491,17 @@ const useNotifySalesOrderShipped = () => {
1484
1491
  });
1485
1492
  };
1486
1493
 
1487
- var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
1488
- var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
1489
- var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
1494
+ var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
1495
+ var __hasOwnProp$a = Object.prototype.hasOwnProperty;
1496
+ var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
1490
1497
  var __objRest$4 = (source, exclude) => {
1491
1498
  var target = {};
1492
1499
  for (var prop in source)
1493
- if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
1500
+ if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
1494
1501
  target[prop] = source[prop];
1495
- if (source != null && __getOwnPropSymbols$9)
1496
- for (var prop of __getOwnPropSymbols$9(source)) {
1497
- if (exclude.indexOf(prop) < 0 && __propIsEnum$9.call(source, prop))
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))
1498
1505
  target[prop] = source[prop];
1499
1506
  }
1500
1507
  return target;
@@ -1558,17 +1565,17 @@ const useListSalesOrderShipments = (params) => {
1558
1565
  });
1559
1566
  };
1560
1567
 
1561
- var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
1562
- var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
1563
- var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
1568
+ var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
1569
+ var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
1570
+ var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
1564
1571
  var __objRest$3 = (source, exclude) => {
1565
1572
  var target = {};
1566
1573
  for (var prop in source)
1567
- if (__hasOwnProp$8.call(source, prop) && exclude.indexOf(prop) < 0)
1574
+ if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
1568
1575
  target[prop] = source[prop];
1569
- if (source != null && __getOwnPropSymbols$8)
1570
- for (var prop of __getOwnPropSymbols$8(source)) {
1571
- if (exclude.indexOf(prop) < 0 && __propIsEnum$8.call(source, prop))
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))
1572
1579
  target[prop] = source[prop];
1573
1580
  }
1574
1581
  return target;
@@ -1606,25 +1613,25 @@ const useUpdateSalesOrderShipment = () => {
1606
1613
  });
1607
1614
  };
1608
1615
 
1609
- var __defProp$5 = Object.defineProperty;
1610
- var __defProps$5 = Object.defineProperties;
1611
- var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
1612
- var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
1613
- var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
1614
- var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
1615
- var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1616
- var __spreadValues$5 = (a, b) => {
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) => {
1617
1624
  for (var prop in b || (b = {}))
1618
- if (__hasOwnProp$7.call(b, prop))
1619
- __defNormalProp$5(a, prop, b[prop]);
1620
- if (__getOwnPropSymbols$7)
1621
- for (var prop of __getOwnPropSymbols$7(b)) {
1622
- if (__propIsEnum$7.call(b, prop))
1623
- __defNormalProp$5(a, prop, b[prop]);
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]);
1624
1631
  }
1625
1632
  return a;
1626
1633
  };
1627
- var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
1634
+ var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
1628
1635
  var __async$c = (__this, __arguments, generator) => {
1629
1636
  return new Promise((resolve, reject) => {
1630
1637
  var fulfilled = (value) => {
@@ -1666,7 +1673,7 @@ const useCreateShipment = () => {
1666
1673
  postalCode: "",
1667
1674
  stateProvince: ""
1668
1675
  };
1669
- return (yield client.shipments.create(__spreadProps$5(__spreadValues$5({}, shipment), {
1676
+ return (yield client.shipments.create(__spreadProps$6(__spreadValues$6({}, shipment), {
1670
1677
  shipTo
1671
1678
  }))).data;
1672
1679
  }),
@@ -1707,17 +1714,17 @@ const useGetShipment = (shipmentId) => {
1707
1714
  });
1708
1715
  };
1709
1716
 
1710
- var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
1711
- var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
1712
- var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
1717
+ var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
1718
+ var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
1719
+ var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
1713
1720
  var __objRest$2 = (source, exclude) => {
1714
1721
  var target = {};
1715
1722
  for (var prop in source)
1716
- if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
1723
+ if (__hasOwnProp$7.call(source, prop) && exclude.indexOf(prop) < 0)
1717
1724
  target[prop] = source[prop];
1718
- if (source != null && __getOwnPropSymbols$6)
1719
- for (var prop of __getOwnPropSymbols$6(source)) {
1720
- if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
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))
1721
1728
  target[prop] = source[prop];
1722
1729
  }
1723
1730
  return target;
@@ -1734,28 +1741,28 @@ const useListShipments = (_params) => {
1734
1741
  });
1735
1742
  };
1736
1743
 
1737
- var __defProp$4 = Object.defineProperty;
1738
- var __defProps$4 = Object.defineProperties;
1739
- var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
1740
- var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
1741
- var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
1742
- var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
1743
- var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1744
- var __spreadValues$4 = (a, b) => {
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) => {
1745
1752
  for (var prop in b || (b = {}))
1746
- if (__hasOwnProp$5.call(b, prop))
1747
- __defNormalProp$4(a, prop, b[prop]);
1748
- if (__getOwnPropSymbols$5)
1749
- for (var prop of __getOwnPropSymbols$5(b)) {
1750
- if (__propIsEnum$5.call(b, prop))
1751
- __defNormalProp$4(a, prop, b[prop]);
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]);
1752
1759
  }
1753
1760
  return a;
1754
1761
  };
1755
- var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
1762
+ var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
1756
1763
  const useListShippingRules = (params) => {
1757
1764
  const { client } = useShipEngine();
1758
- return reactQuery.useQuery(__spreadProps$4(__spreadValues$4({}, params), {
1765
+ return reactQuery.useQuery(__spreadProps$5(__spreadValues$5({}, params), {
1759
1766
  onError,
1760
1767
  queryFn: () => {
1761
1768
  return client.shippingRules.list();
@@ -1977,17 +1984,17 @@ const useListWarehouses = (options) => {
1977
1984
  });
1978
1985
  };
1979
1986
 
1980
- var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
1981
- var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
1982
- var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
1987
+ var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
1988
+ var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
1989
+ var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
1983
1990
  var __objRest$1 = (source, exclude) => {
1984
1991
  var target = {};
1985
1992
  for (var prop in source)
1986
- if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
1993
+ if (__hasOwnProp$5.call(source, prop) && exclude.indexOf(prop) < 0)
1987
1994
  target[prop] = source[prop];
1988
- if (source != null && __getOwnPropSymbols$4)
1989
- for (var prop of __getOwnPropSymbols$4(source)) {
1990
- if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
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))
1991
1998
  target[prop] = source[prop];
1992
1999
  }
1993
2000
  return target;
@@ -2067,16 +2074,33 @@ const useUpdateAccountBillingPlan = () => {
2067
2074
  });
2068
2075
  };
2069
2076
 
2070
- const useListServicePoints = (options) => {
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) => {
2071
2097
  const { client } = useShipEngine();
2072
- return reactQuery.useQuery({
2073
- enabled: options.providers.length > 0,
2098
+ return reactQuery.useQuery(__spreadProps$4(__spreadValues$4({}, params), {
2074
2099
  onError,
2075
- queryFn: () => client.servicePoints.list(options),
2076
- queryKey: ["useListServicePoints", options],
2077
- retry: false,
2100
+ queryFn: () => client.servicePoints.getHereToken(),
2101
+ queryKey: ["useGetHereToken"],
2078
2102
  select: (result) => result.data
2079
- });
2103
+ }));
2080
2104
  };
2081
2105
 
2082
2106
  const useGetServicePoint = ({
@@ -2102,6 +2126,18 @@ const useGetServicePoint = ({
2102
2126
  });
2103
2127
  };
2104
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
+
2105
2141
  var __async$4 = (__this, __arguments, generator) => {
2106
2142
  return new Promise((resolve, reject) => {
2107
2143
  var fulfilled = (value) => {
@@ -2421,7 +2457,9 @@ exports.useGetCurrenciesByCarrier = useGetCurrenciesByCarrier;
2421
2457
  exports.useGetFundingSourceById = useGetFundingSourceById;
2422
2458
  exports.useGetFundingSourceMetadata = useGetFundingSourceMetadata;
2423
2459
  exports.useGetFundingSourceTransactions = useGetFundingSourceTransactions;
2460
+ exports.useGetHereToken = useGetHereToken;
2424
2461
  exports.useGetInsuranceAccount = useGetInsuranceAccount;
2462
+ exports.useGetInsuranceFundingSourceAcceptedTerms = useGetInsuranceFundingSourceAcceptedTerms;
2425
2463
  exports.useGetLabel = useGetLabel;
2426
2464
  exports.useGetPackageRatingGroupByCarrier = useGetPackageRatingGroupByCarrier;
2427
2465
  exports.useGetRateCardById = useGetRateCardById;
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$6 = Object.defineProperty;
78
- var __defProps$6 = Object.defineProperties;
79
- var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
80
- var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
81
- var __hasOwnProp$h = Object.prototype.hasOwnProperty;
82
- var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
83
- var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
84
- var __spreadValues$6 = (a, b) => {
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$h.call(b, prop))
87
- __defNormalProp$6(a, prop, b[prop]);
88
- if (__getOwnPropSymbols$h)
89
- for (var prop of __getOwnPropSymbols$h(b)) {
90
- if (__propIsEnum$h.call(b, prop))
91
- __defNormalProp$6(a, prop, b[prop]);
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$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
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$6(__spreadValues$6({}, k), {
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$g = Object.getOwnPropertySymbols;
516
- var __hasOwnProp$g = Object.prototype.hasOwnProperty;
517
- var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
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$g.call(source, prop) && exclude.indexOf(prop) < 0)
521
+ if (__hasOwnProp$h.call(source, prop) && exclude.indexOf(prop) < 0)
522
522
  target[prop] = source[prop];
523
- if (source != null && __getOwnPropSymbols$g)
524
- for (var prop of __getOwnPropSymbols$g(source)) {
525
- if (exclude.indexOf(prop) < 0 && __propIsEnum$g.call(source, prop))
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$f = Object.getOwnPropertySymbols;
617
- var __hasOwnProp$f = Object.prototype.hasOwnProperty;
618
- var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
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$f.call(source, prop) && exclude.indexOf(prop) < 0)
622
+ if (__hasOwnProp$g.call(source, prop) && exclude.indexOf(prop) < 0)
623
623
  target[prop] = source[prop];
624
- if (source != null && __getOwnPropSymbols$f)
625
- for (var prop of __getOwnPropSymbols$f(source)) {
626
- if (exclude.indexOf(prop) < 0 && __propIsEnum$f.call(source, prop))
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$e = Object.getOwnPropertySymbols;
644
- var __hasOwnProp$e = Object.prototype.hasOwnProperty;
645
- var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
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$e.call(source, prop) && exclude.indexOf(prop) < 0)
649
+ if (__hasOwnProp$f.call(source, prop) && exclude.indexOf(prop) < 0)
650
650
  target[prop] = source[prop];
651
- if (source != null && __getOwnPropSymbols$e)
652
- for (var prop of __getOwnPropSymbols$e(source)) {
653
- if (exclude.indexOf(prop) < 0 && __propIsEnum$e.call(source, prop))
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"],
@@ -901,6 +898,16 @@ const useGetFundingSourceTransactions = (fundingSourceId, params) => {
901
898
  });
902
899
  };
903
900
 
901
+ const useGetInsuranceFundingSourceAcceptedTerms = () => {
902
+ const { client } = useShipEngine();
903
+ return useQuery({
904
+ onError,
905
+ queryFn: () => client.fundingSources.insuranceAcceptedTerms(),
906
+ queryKey: ["useGetInsuranceFundingSourceAcceptedTerms"],
907
+ select: (result) => result.data
908
+ });
909
+ };
910
+
904
911
  const useGetInsuranceAccount = (insuranceProvider) => {
905
912
  const { client } = useShipEngine();
906
913
  return useQuery({
@@ -916,17 +923,17 @@ const useGetInsuranceAccount = (insuranceProvider) => {
916
923
  });
917
924
  };
918
925
 
919
- var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
920
- var __hasOwnProp$d = Object.prototype.hasOwnProperty;
921
- var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
926
+ var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
927
+ var __hasOwnProp$e = Object.prototype.hasOwnProperty;
928
+ var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
922
929
  var __objRest$8 = (source, exclude) => {
923
930
  var target = {};
924
931
  for (var prop in source)
925
- if (__hasOwnProp$d.call(source, prop) && exclude.indexOf(prop) < 0)
932
+ if (__hasOwnProp$e.call(source, prop) && exclude.indexOf(prop) < 0)
926
933
  target[prop] = source[prop];
927
- if (source != null && __getOwnPropSymbols$d)
928
- for (var prop of __getOwnPropSymbols$d(source)) {
929
- if (exclude.indexOf(prop) < 0 && __propIsEnum$d.call(source, prop))
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))
930
937
  target[prop] = source[prop];
931
938
  }
932
939
  return target;
@@ -964,17 +971,17 @@ const useAddInsuranceFunds = () => {
964
971
  });
965
972
  };
966
973
 
967
- var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
968
- var __hasOwnProp$c = Object.prototype.hasOwnProperty;
969
- var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
974
+ var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
975
+ var __hasOwnProp$d = Object.prototype.hasOwnProperty;
976
+ var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
970
977
  var __objRest$7 = (source, exclude) => {
971
978
  var target = {};
972
979
  for (var prop in source)
973
- if (__hasOwnProp$c.call(source, prop) && exclude.indexOf(prop) < 0)
980
+ if (__hasOwnProp$d.call(source, prop) && exclude.indexOf(prop) < 0)
974
981
  target[prop] = source[prop];
975
- if (source != null && __getOwnPropSymbols$c)
976
- for (var prop of __getOwnPropSymbols$c(source)) {
977
- if (exclude.indexOf(prop) < 0 && __propIsEnum$c.call(source, prop))
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))
978
985
  target[prop] = source[prop];
979
986
  }
980
987
  return target;
@@ -1027,17 +1034,17 @@ const useGetLabel = (labelId) => {
1027
1034
  });
1028
1035
  };
1029
1036
 
1030
- var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
1031
- var __hasOwnProp$b = Object.prototype.hasOwnProperty;
1032
- var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
1037
+ var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
1038
+ var __hasOwnProp$c = Object.prototype.hasOwnProperty;
1039
+ var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
1033
1040
  var __objRest$6 = (source, exclude) => {
1034
1041
  var target = {};
1035
1042
  for (var prop in source)
1036
- if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
1043
+ if (__hasOwnProp$c.call(source, prop) && exclude.indexOf(prop) < 0)
1037
1044
  target[prop] = source[prop];
1038
- if (source != null && __getOwnPropSymbols$b)
1039
- for (var prop of __getOwnPropSymbols$b(source)) {
1040
- if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
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))
1041
1048
  target[prop] = source[prop];
1042
1049
  }
1043
1050
  return target;
@@ -1433,17 +1440,17 @@ const useListSalesOrders = (params = {}) => {
1433
1440
  });
1434
1441
  };
1435
1442
 
1436
- var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
1437
- var __hasOwnProp$a = Object.prototype.hasOwnProperty;
1438
- var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
1443
+ var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
1444
+ var __hasOwnProp$b = Object.prototype.hasOwnProperty;
1445
+ var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
1439
1446
  var __objRest$5 = (source, exclude) => {
1440
1447
  var target = {};
1441
1448
  for (var prop in source)
1442
- if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
1449
+ if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
1443
1450
  target[prop] = source[prop];
1444
- if (source != null && __getOwnPropSymbols$a)
1445
- for (var prop of __getOwnPropSymbols$a(source)) {
1446
- if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
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))
1447
1454
  target[prop] = source[prop];
1448
1455
  }
1449
1456
  return target;
@@ -1481,17 +1488,17 @@ const useNotifySalesOrderShipped = () => {
1481
1488
  });
1482
1489
  };
1483
1490
 
1484
- var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
1485
- var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
1486
- var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
1491
+ var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
1492
+ var __hasOwnProp$a = Object.prototype.hasOwnProperty;
1493
+ var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
1487
1494
  var __objRest$4 = (source, exclude) => {
1488
1495
  var target = {};
1489
1496
  for (var prop in source)
1490
- if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
1497
+ if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
1491
1498
  target[prop] = source[prop];
1492
- if (source != null && __getOwnPropSymbols$9)
1493
- for (var prop of __getOwnPropSymbols$9(source)) {
1494
- if (exclude.indexOf(prop) < 0 && __propIsEnum$9.call(source, prop))
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))
1495
1502
  target[prop] = source[prop];
1496
1503
  }
1497
1504
  return target;
@@ -1555,17 +1562,17 @@ const useListSalesOrderShipments = (params) => {
1555
1562
  });
1556
1563
  };
1557
1564
 
1558
- var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
1559
- var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
1560
- var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
1565
+ var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
1566
+ var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
1567
+ var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
1561
1568
  var __objRest$3 = (source, exclude) => {
1562
1569
  var target = {};
1563
1570
  for (var prop in source)
1564
- if (__hasOwnProp$8.call(source, prop) && exclude.indexOf(prop) < 0)
1571
+ if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
1565
1572
  target[prop] = source[prop];
1566
- if (source != null && __getOwnPropSymbols$8)
1567
- for (var prop of __getOwnPropSymbols$8(source)) {
1568
- if (exclude.indexOf(prop) < 0 && __propIsEnum$8.call(source, prop))
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))
1569
1576
  target[prop] = source[prop];
1570
1577
  }
1571
1578
  return target;
@@ -1603,25 +1610,25 @@ const useUpdateSalesOrderShipment = () => {
1603
1610
  });
1604
1611
  };
1605
1612
 
1606
- var __defProp$5 = Object.defineProperty;
1607
- var __defProps$5 = Object.defineProperties;
1608
- var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
1609
- var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
1610
- var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
1611
- var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
1612
- var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1613
- var __spreadValues$5 = (a, b) => {
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) => {
1614
1621
  for (var prop in b || (b = {}))
1615
- if (__hasOwnProp$7.call(b, prop))
1616
- __defNormalProp$5(a, prop, b[prop]);
1617
- if (__getOwnPropSymbols$7)
1618
- for (var prop of __getOwnPropSymbols$7(b)) {
1619
- if (__propIsEnum$7.call(b, prop))
1620
- __defNormalProp$5(a, prop, b[prop]);
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]);
1621
1628
  }
1622
1629
  return a;
1623
1630
  };
1624
- var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
1631
+ var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
1625
1632
  var __async$c = (__this, __arguments, generator) => {
1626
1633
  return new Promise((resolve, reject) => {
1627
1634
  var fulfilled = (value) => {
@@ -1663,7 +1670,7 @@ const useCreateShipment = () => {
1663
1670
  postalCode: "",
1664
1671
  stateProvince: ""
1665
1672
  };
1666
- return (yield client.shipments.create(__spreadProps$5(__spreadValues$5({}, shipment), {
1673
+ return (yield client.shipments.create(__spreadProps$6(__spreadValues$6({}, shipment), {
1667
1674
  shipTo
1668
1675
  }))).data;
1669
1676
  }),
@@ -1704,17 +1711,17 @@ const useGetShipment = (shipmentId) => {
1704
1711
  });
1705
1712
  };
1706
1713
 
1707
- var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
1708
- var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
1709
- var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
1714
+ var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
1715
+ var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
1716
+ var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
1710
1717
  var __objRest$2 = (source, exclude) => {
1711
1718
  var target = {};
1712
1719
  for (var prop in source)
1713
- if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
1720
+ if (__hasOwnProp$7.call(source, prop) && exclude.indexOf(prop) < 0)
1714
1721
  target[prop] = source[prop];
1715
- if (source != null && __getOwnPropSymbols$6)
1716
- for (var prop of __getOwnPropSymbols$6(source)) {
1717
- if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
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))
1718
1725
  target[prop] = source[prop];
1719
1726
  }
1720
1727
  return target;
@@ -1731,28 +1738,28 @@ const useListShipments = (_params) => {
1731
1738
  });
1732
1739
  };
1733
1740
 
1734
- var __defProp$4 = Object.defineProperty;
1735
- var __defProps$4 = Object.defineProperties;
1736
- var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
1737
- var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
1738
- var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
1739
- var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
1740
- var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1741
- var __spreadValues$4 = (a, b) => {
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) => {
1742
1749
  for (var prop in b || (b = {}))
1743
- if (__hasOwnProp$5.call(b, prop))
1744
- __defNormalProp$4(a, prop, b[prop]);
1745
- if (__getOwnPropSymbols$5)
1746
- for (var prop of __getOwnPropSymbols$5(b)) {
1747
- if (__propIsEnum$5.call(b, prop))
1748
- __defNormalProp$4(a, prop, b[prop]);
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]);
1749
1756
  }
1750
1757
  return a;
1751
1758
  };
1752
- var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
1759
+ var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
1753
1760
  const useListShippingRules = (params) => {
1754
1761
  const { client } = useShipEngine();
1755
- return useQuery(__spreadProps$4(__spreadValues$4({}, params), {
1762
+ return useQuery(__spreadProps$5(__spreadValues$5({}, params), {
1756
1763
  onError,
1757
1764
  queryFn: () => {
1758
1765
  return client.shippingRules.list();
@@ -1974,17 +1981,17 @@ const useListWarehouses = (options) => {
1974
1981
  });
1975
1982
  };
1976
1983
 
1977
- var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
1978
- var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
1979
- var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
1984
+ var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
1985
+ var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
1986
+ var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
1980
1987
  var __objRest$1 = (source, exclude) => {
1981
1988
  var target = {};
1982
1989
  for (var prop in source)
1983
- if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
1990
+ if (__hasOwnProp$5.call(source, prop) && exclude.indexOf(prop) < 0)
1984
1991
  target[prop] = source[prop];
1985
- if (source != null && __getOwnPropSymbols$4)
1986
- for (var prop of __getOwnPropSymbols$4(source)) {
1987
- if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
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))
1988
1995
  target[prop] = source[prop];
1989
1996
  }
1990
1997
  return target;
@@ -2064,16 +2071,33 @@ const useUpdateAccountBillingPlan = () => {
2064
2071
  });
2065
2072
  };
2066
2073
 
2067
- const useListServicePoints = (options) => {
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) => {
2068
2094
  const { client } = useShipEngine();
2069
- return useQuery({
2070
- enabled: options.providers.length > 0,
2095
+ return useQuery(__spreadProps$4(__spreadValues$4({}, params), {
2071
2096
  onError,
2072
- queryFn: () => client.servicePoints.list(options),
2073
- queryKey: ["useListServicePoints", options],
2074
- retry: false,
2097
+ queryFn: () => client.servicePoints.getHereToken(),
2098
+ queryKey: ["useGetHereToken"],
2075
2099
  select: (result) => result.data
2076
- });
2100
+ }));
2077
2101
  };
2078
2102
 
2079
2103
  const useGetServicePoint = ({
@@ -2099,6 +2123,18 @@ const useGetServicePoint = ({
2099
2123
  });
2100
2124
  };
2101
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
+
2102
2138
  var __async$4 = (__this, __arguments, generator) => {
2103
2139
  return new Promise((resolve, reject) => {
2104
2140
  var fulfilled = (value) => {
@@ -2374,4 +2410,4 @@ const useUpdateWebhook = (params) => {
2374
2410
  }));
2375
2411
  };
2376
2412
 
2377
- 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, 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/react-api",
3
- "version": "2.9.1",
3
+ "version": "2.11.0",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {
@@ -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