@shipengine/react-api 2.6.0 → 2.7.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.
@@ -1,5 +1,7 @@
1
+ import { ShippingRule } from "@shipengine/js-api";
2
+ import { QueryProps } from "../../utilities";
1
3
  /**
2
4
  * @category ShipEngine API Hooks
3
5
  *
4
6
  */
5
- export declare const useListShippingRules: () => import("@tanstack/react-query").UseQueryResult<import("@shipengine/js-api").ShippingRule[], import("@shipengine/js-api").CodedError[]>;
7
+ export declare const useListShippingRules: (params?: QueryProps<ShippingRule[]>) => import("@tanstack/react-query").UseQueryResult<ShippingRule[], import("@shipengine/js-api").CodedError[]>;
package/index.js CHANGED
@@ -72,25 +72,25 @@ const onError = (_errors) => _default();
72
72
 
73
73
  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}();
74
74
 
75
- var __defProp$1 = Object.defineProperty;
76
- var __defProps$1 = Object.defineProperties;
77
- var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
78
- var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
79
- var __hasOwnProp$c = Object.prototype.hasOwnProperty;
80
- var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
81
- var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
82
- var __spreadValues$1 = (a, b) => {
75
+ var __defProp$2 = Object.defineProperty;
76
+ var __defProps$2 = Object.defineProperties;
77
+ var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
78
+ var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
79
+ var __hasOwnProp$d = Object.prototype.hasOwnProperty;
80
+ var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
81
+ var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
82
+ var __spreadValues$2 = (a, b) => {
83
83
  for (var prop in b || (b = {}))
84
- if (__hasOwnProp$c.call(b, prop))
85
- __defNormalProp$1(a, prop, b[prop]);
86
- if (__getOwnPropSymbols$c)
87
- for (var prop of __getOwnPropSymbols$c(b)) {
88
- if (__propIsEnum$c.call(b, prop))
89
- __defNormalProp$1(a, prop, b[prop]);
84
+ if (__hasOwnProp$d.call(b, prop))
85
+ __defNormalProp$2(a, prop, b[prop]);
86
+ if (__getOwnPropSymbols$d)
87
+ for (var prop of __getOwnPropSymbols$d(b)) {
88
+ if (__propIsEnum$d.call(b, prop))
89
+ __defNormalProp$2(a, prop, b[prop]);
90
90
  }
91
91
  return a;
92
92
  };
93
- var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
93
+ var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
94
94
  const streams = [];
95
95
  if (process.env.NODE_ENV === "production") {
96
96
  streams.push({
@@ -99,7 +99,7 @@ if (process.env.NODE_ENV === "production") {
99
99
  }
100
100
  const logger = E({
101
101
  name: "shipengine",
102
- serializers: __spreadProps$1(__spreadValues$1({}, k), {
102
+ serializers: __spreadProps$2(__spreadValues$2({}, k), {
103
103
  req: (req) => ({
104
104
  headers: req.headers,
105
105
  method: req.method,
@@ -510,17 +510,17 @@ const useListCarriers = () => {
510
510
  });
511
511
  };
512
512
 
513
- var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
514
- var __hasOwnProp$b = Object.prototype.hasOwnProperty;
515
- var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
513
+ var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
514
+ var __hasOwnProp$c = Object.prototype.hasOwnProperty;
515
+ var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
516
516
  var __objRest$a = (source, exclude) => {
517
517
  var target = {};
518
518
  for (var prop in source)
519
- if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
519
+ if (__hasOwnProp$c.call(source, prop) && exclude.indexOf(prop) < 0)
520
520
  target[prop] = source[prop];
521
- if (source != null && __getOwnPropSymbols$b)
522
- for (var prop of __getOwnPropSymbols$b(source)) {
523
- if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
521
+ if (source != null && __getOwnPropSymbols$c)
522
+ for (var prop of __getOwnPropSymbols$c(source)) {
523
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$c.call(source, prop))
524
524
  target[prop] = source[prop];
525
525
  }
526
526
  return target;
@@ -611,17 +611,17 @@ const useDeleteCarrier = () => {
611
611
  });
612
612
  };
613
613
 
614
- var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
615
- var __hasOwnProp$a = Object.prototype.hasOwnProperty;
616
- var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
614
+ var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
615
+ var __hasOwnProp$b = Object.prototype.hasOwnProperty;
616
+ var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
617
617
  var __objRest$9 = (source, exclude) => {
618
618
  var target = {};
619
619
  for (var prop in source)
620
- if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
620
+ if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
621
621
  target[prop] = source[prop];
622
- if (source != null && __getOwnPropSymbols$a)
623
- for (var prop of __getOwnPropSymbols$a(source)) {
624
- if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
622
+ if (source != null && __getOwnPropSymbols$b)
623
+ for (var prop of __getOwnPropSymbols$b(source)) {
624
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
625
625
  target[prop] = source[prop];
626
626
  }
627
627
  return target;
@@ -638,17 +638,17 @@ const useGetCarrierConnectionForm = (_params) => {
638
638
  });
639
639
  };
640
640
 
641
- var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
642
- var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
643
- var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
641
+ var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
642
+ var __hasOwnProp$a = Object.prototype.hasOwnProperty;
643
+ var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
644
644
  var __objRest$8 = (source, exclude) => {
645
645
  var target = {};
646
646
  for (var prop in source)
647
- if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
647
+ if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
648
648
  target[prop] = source[prop];
649
- if (source != null && __getOwnPropSymbols$9)
650
- for (var prop of __getOwnPropSymbols$9(source)) {
651
- if (exclude.indexOf(prop) < 0 && __propIsEnum$9.call(source, prop))
649
+ if (source != null && __getOwnPropSymbols$a)
650
+ for (var prop of __getOwnPropSymbols$a(source)) {
651
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
652
652
  target[prop] = source[prop];
653
653
  }
654
654
  return target;
@@ -903,17 +903,17 @@ const useGetInsuranceAccount = (insuranceProvider) => {
903
903
  });
904
904
  };
905
905
 
906
- var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
907
- var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
908
- var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
906
+ var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
907
+ var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
908
+ var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
909
909
  var __objRest$7 = (source, exclude) => {
910
910
  var target = {};
911
911
  for (var prop in source)
912
- if (__hasOwnProp$8.call(source, prop) && exclude.indexOf(prop) < 0)
912
+ if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
913
913
  target[prop] = source[prop];
914
- if (source != null && __getOwnPropSymbols$8)
915
- for (var prop of __getOwnPropSymbols$8(source)) {
916
- if (exclude.indexOf(prop) < 0 && __propIsEnum$8.call(source, prop))
914
+ if (source != null && __getOwnPropSymbols$9)
915
+ for (var prop of __getOwnPropSymbols$9(source)) {
916
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$9.call(source, prop))
917
917
  target[prop] = source[prop];
918
918
  }
919
919
  return target;
@@ -951,17 +951,17 @@ const useAddInsuranceFunds = () => {
951
951
  });
952
952
  };
953
953
 
954
- var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
955
- var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
956
- var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
954
+ var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
955
+ var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
956
+ var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
957
957
  var __objRest$6 = (source, exclude) => {
958
958
  var target = {};
959
959
  for (var prop in source)
960
- if (__hasOwnProp$7.call(source, prop) && exclude.indexOf(prop) < 0)
960
+ if (__hasOwnProp$8.call(source, prop) && exclude.indexOf(prop) < 0)
961
961
  target[prop] = source[prop];
962
- if (source != null && __getOwnPropSymbols$7)
963
- for (var prop of __getOwnPropSymbols$7(source)) {
964
- if (exclude.indexOf(prop) < 0 && __propIsEnum$7.call(source, prop))
962
+ if (source != null && __getOwnPropSymbols$8)
963
+ for (var prop of __getOwnPropSymbols$8(source)) {
964
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$8.call(source, prop))
965
965
  target[prop] = source[prop];
966
966
  }
967
967
  return target;
@@ -1014,17 +1014,17 @@ const useGetLabel = (labelId) => {
1014
1014
  });
1015
1015
  };
1016
1016
 
1017
- var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
1018
- var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
1019
- var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
1017
+ var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
1018
+ var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
1019
+ var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
1020
1020
  var __objRest$5 = (source, exclude) => {
1021
1021
  var target = {};
1022
1022
  for (var prop in source)
1023
- if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
1023
+ if (__hasOwnProp$7.call(source, prop) && exclude.indexOf(prop) < 0)
1024
1024
  target[prop] = source[prop];
1025
- if (source != null && __getOwnPropSymbols$6)
1026
- for (var prop of __getOwnPropSymbols$6(source)) {
1027
- if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
1025
+ if (source != null && __getOwnPropSymbols$7)
1026
+ for (var prop of __getOwnPropSymbols$7(source)) {
1027
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$7.call(source, prop))
1028
1028
  target[prop] = source[prop];
1029
1029
  }
1030
1030
  return target;
@@ -1420,17 +1420,17 @@ const useListSalesOrders = (params = {}) => {
1420
1420
  });
1421
1421
  };
1422
1422
 
1423
- var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
1424
- var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
1425
- var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
1423
+ var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
1424
+ var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
1425
+ var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
1426
1426
  var __objRest$4 = (source, exclude) => {
1427
1427
  var target = {};
1428
1428
  for (var prop in source)
1429
- if (__hasOwnProp$5.call(source, prop) && exclude.indexOf(prop) < 0)
1429
+ if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
1430
1430
  target[prop] = source[prop];
1431
- if (source != null && __getOwnPropSymbols$5)
1432
- for (var prop of __getOwnPropSymbols$5(source)) {
1433
- if (exclude.indexOf(prop) < 0 && __propIsEnum$5.call(source, prop))
1431
+ if (source != null && __getOwnPropSymbols$6)
1432
+ for (var prop of __getOwnPropSymbols$6(source)) {
1433
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
1434
1434
  target[prop] = source[prop];
1435
1435
  }
1436
1436
  return target;
@@ -1468,17 +1468,17 @@ const useNotifySalesOrderShipped = () => {
1468
1468
  });
1469
1469
  };
1470
1470
 
1471
- var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
1472
- var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
1473
- var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
1471
+ var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
1472
+ var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
1473
+ var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
1474
1474
  var __objRest$3 = (source, exclude) => {
1475
1475
  var target = {};
1476
1476
  for (var prop in source)
1477
- if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
1477
+ if (__hasOwnProp$5.call(source, prop) && exclude.indexOf(prop) < 0)
1478
1478
  target[prop] = source[prop];
1479
- if (source != null && __getOwnPropSymbols$4)
1480
- for (var prop of __getOwnPropSymbols$4(source)) {
1481
- if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
1479
+ if (source != null && __getOwnPropSymbols$5)
1480
+ for (var prop of __getOwnPropSymbols$5(source)) {
1481
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$5.call(source, prop))
1482
1482
  target[prop] = source[prop];
1483
1483
  }
1484
1484
  return target;
@@ -1542,17 +1542,17 @@ const useListSalesOrderShipments = (params) => {
1542
1542
  });
1543
1543
  };
1544
1544
 
1545
- var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
1546
- var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
1547
- var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
1545
+ var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
1546
+ var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
1547
+ var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
1548
1548
  var __objRest$2 = (source, exclude) => {
1549
1549
  var target = {};
1550
1550
  for (var prop in source)
1551
- if (__hasOwnProp$3.call(source, prop) && exclude.indexOf(prop) < 0)
1551
+ if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
1552
1552
  target[prop] = source[prop];
1553
- if (source != null && __getOwnPropSymbols$3)
1554
- for (var prop of __getOwnPropSymbols$3(source)) {
1555
- if (exclude.indexOf(prop) < 0 && __propIsEnum$3.call(source, prop))
1553
+ if (source != null && __getOwnPropSymbols$4)
1554
+ for (var prop of __getOwnPropSymbols$4(source)) {
1555
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
1556
1556
  target[prop] = source[prop];
1557
1557
  }
1558
1558
  return target;
@@ -1590,25 +1590,25 @@ const useUpdateSalesOrderShipment = () => {
1590
1590
  });
1591
1591
  };
1592
1592
 
1593
- var __defProp = Object.defineProperty;
1594
- var __defProps = Object.defineProperties;
1595
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
1596
- var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
1597
- var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
1598
- var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
1599
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1600
- var __spreadValues = (a, b) => {
1593
+ var __defProp$1 = Object.defineProperty;
1594
+ var __defProps$1 = Object.defineProperties;
1595
+ var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
1596
+ var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
1597
+ var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
1598
+ var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
1599
+ var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1600
+ var __spreadValues$1 = (a, b) => {
1601
1601
  for (var prop in b || (b = {}))
1602
- if (__hasOwnProp$2.call(b, prop))
1603
- __defNormalProp(a, prop, b[prop]);
1604
- if (__getOwnPropSymbols$2)
1605
- for (var prop of __getOwnPropSymbols$2(b)) {
1606
- if (__propIsEnum$2.call(b, prop))
1607
- __defNormalProp(a, prop, b[prop]);
1602
+ if (__hasOwnProp$3.call(b, prop))
1603
+ __defNormalProp$1(a, prop, b[prop]);
1604
+ if (__getOwnPropSymbols$3)
1605
+ for (var prop of __getOwnPropSymbols$3(b)) {
1606
+ if (__propIsEnum$3.call(b, prop))
1607
+ __defNormalProp$1(a, prop, b[prop]);
1608
1608
  }
1609
1609
  return a;
1610
1610
  };
1611
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
1611
+ var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
1612
1612
  var __async$9 = (__this, __arguments, generator) => {
1613
1613
  return new Promise((resolve, reject) => {
1614
1614
  var fulfilled = (value) => {
@@ -1650,7 +1650,7 @@ const useCreateShipment = () => {
1650
1650
  postalCode: "",
1651
1651
  stateProvince: ""
1652
1652
  };
1653
- return (yield client.shipments.create(__spreadProps(__spreadValues({}, shipment), {
1653
+ return (yield client.shipments.create(__spreadProps$1(__spreadValues$1({}, shipment), {
1654
1654
  shipTo
1655
1655
  }))).data;
1656
1656
  }),
@@ -1691,17 +1691,17 @@ const useGetShipment = (shipmentId) => {
1691
1691
  });
1692
1692
  };
1693
1693
 
1694
- var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
1695
- var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
1696
- var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
1694
+ var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
1695
+ var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
1696
+ var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
1697
1697
  var __objRest$1 = (source, exclude) => {
1698
1698
  var target = {};
1699
1699
  for (var prop in source)
1700
- if (__hasOwnProp$1.call(source, prop) && exclude.indexOf(prop) < 0)
1700
+ if (__hasOwnProp$2.call(source, prop) && exclude.indexOf(prop) < 0)
1701
1701
  target[prop] = source[prop];
1702
- if (source != null && __getOwnPropSymbols$1)
1703
- for (var prop of __getOwnPropSymbols$1(source)) {
1704
- if (exclude.indexOf(prop) < 0 && __propIsEnum$1.call(source, prop))
1702
+ if (source != null && __getOwnPropSymbols$2)
1703
+ for (var prop of __getOwnPropSymbols$2(source)) {
1704
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$2.call(source, prop))
1705
1705
  target[prop] = source[prop];
1706
1706
  }
1707
1707
  return target;
@@ -1718,16 +1718,35 @@ const useListShipments = (_params) => {
1718
1718
  });
1719
1719
  };
1720
1720
 
1721
- const useListShippingRules = () => {
1721
+ var __defProp = Object.defineProperty;
1722
+ var __defProps = Object.defineProperties;
1723
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
1724
+ var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
1725
+ var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
1726
+ var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
1727
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1728
+ var __spreadValues = (a, b) => {
1729
+ for (var prop in b || (b = {}))
1730
+ if (__hasOwnProp$1.call(b, prop))
1731
+ __defNormalProp(a, prop, b[prop]);
1732
+ if (__getOwnPropSymbols$1)
1733
+ for (var prop of __getOwnPropSymbols$1(b)) {
1734
+ if (__propIsEnum$1.call(b, prop))
1735
+ __defNormalProp(a, prop, b[prop]);
1736
+ }
1737
+ return a;
1738
+ };
1739
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
1740
+ const useListShippingRules = (params) => {
1722
1741
  const { client } = useShipEngine();
1723
- return reactQuery.useQuery({
1742
+ return reactQuery.useQuery(__spreadProps(__spreadValues({}, params), {
1724
1743
  onError,
1725
1744
  queryFn: () => {
1726
1745
  return client.shippingRules.list();
1727
1746
  },
1728
1747
  queryKey: ["useListShippingRules"],
1729
1748
  select: (result) => result.data.shippingRules
1730
- });
1749
+ }));
1731
1750
  };
1732
1751
 
1733
1752
  var __async$8 = (__this, __arguments, generator) => {
package/index.mjs CHANGED
@@ -69,25 +69,25 @@ const onError = (_errors) => _default();
69
69
 
70
70
  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}();
71
71
 
72
- var __defProp$1 = Object.defineProperty;
73
- var __defProps$1 = Object.defineProperties;
74
- var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
75
- var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
76
- var __hasOwnProp$c = Object.prototype.hasOwnProperty;
77
- var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
78
- var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
79
- var __spreadValues$1 = (a, b) => {
72
+ var __defProp$2 = Object.defineProperty;
73
+ var __defProps$2 = Object.defineProperties;
74
+ var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
75
+ var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
76
+ var __hasOwnProp$d = Object.prototype.hasOwnProperty;
77
+ var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
78
+ var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
79
+ var __spreadValues$2 = (a, b) => {
80
80
  for (var prop in b || (b = {}))
81
- if (__hasOwnProp$c.call(b, prop))
82
- __defNormalProp$1(a, prop, b[prop]);
83
- if (__getOwnPropSymbols$c)
84
- for (var prop of __getOwnPropSymbols$c(b)) {
85
- if (__propIsEnum$c.call(b, prop))
86
- __defNormalProp$1(a, prop, b[prop]);
81
+ if (__hasOwnProp$d.call(b, prop))
82
+ __defNormalProp$2(a, prop, b[prop]);
83
+ if (__getOwnPropSymbols$d)
84
+ for (var prop of __getOwnPropSymbols$d(b)) {
85
+ if (__propIsEnum$d.call(b, prop))
86
+ __defNormalProp$2(a, prop, b[prop]);
87
87
  }
88
88
  return a;
89
89
  };
90
- var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
90
+ var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
91
91
  const streams = [];
92
92
  if (process.env.NODE_ENV === "production") {
93
93
  streams.push({
@@ -96,7 +96,7 @@ if (process.env.NODE_ENV === "production") {
96
96
  }
97
97
  const logger = E({
98
98
  name: "shipengine",
99
- serializers: __spreadProps$1(__spreadValues$1({}, k), {
99
+ serializers: __spreadProps$2(__spreadValues$2({}, k), {
100
100
  req: (req) => ({
101
101
  headers: req.headers,
102
102
  method: req.method,
@@ -507,17 +507,17 @@ const useListCarriers = () => {
507
507
  });
508
508
  };
509
509
 
510
- var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
511
- var __hasOwnProp$b = Object.prototype.hasOwnProperty;
512
- var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
510
+ var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
511
+ var __hasOwnProp$c = Object.prototype.hasOwnProperty;
512
+ var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
513
513
  var __objRest$a = (source, exclude) => {
514
514
  var target = {};
515
515
  for (var prop in source)
516
- if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
516
+ if (__hasOwnProp$c.call(source, prop) && exclude.indexOf(prop) < 0)
517
517
  target[prop] = source[prop];
518
- if (source != null && __getOwnPropSymbols$b)
519
- for (var prop of __getOwnPropSymbols$b(source)) {
520
- if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
518
+ if (source != null && __getOwnPropSymbols$c)
519
+ for (var prop of __getOwnPropSymbols$c(source)) {
520
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$c.call(source, prop))
521
521
  target[prop] = source[prop];
522
522
  }
523
523
  return target;
@@ -608,17 +608,17 @@ const useDeleteCarrier = () => {
608
608
  });
609
609
  };
610
610
 
611
- var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
612
- var __hasOwnProp$a = Object.prototype.hasOwnProperty;
613
- var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
611
+ var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
612
+ var __hasOwnProp$b = Object.prototype.hasOwnProperty;
613
+ var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
614
614
  var __objRest$9 = (source, exclude) => {
615
615
  var target = {};
616
616
  for (var prop in source)
617
- if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
617
+ if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
618
618
  target[prop] = source[prop];
619
- if (source != null && __getOwnPropSymbols$a)
620
- for (var prop of __getOwnPropSymbols$a(source)) {
621
- if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
619
+ if (source != null && __getOwnPropSymbols$b)
620
+ for (var prop of __getOwnPropSymbols$b(source)) {
621
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
622
622
  target[prop] = source[prop];
623
623
  }
624
624
  return target;
@@ -635,17 +635,17 @@ const useGetCarrierConnectionForm = (_params) => {
635
635
  });
636
636
  };
637
637
 
638
- var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
639
- var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
640
- var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
638
+ var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
639
+ var __hasOwnProp$a = Object.prototype.hasOwnProperty;
640
+ var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
641
641
  var __objRest$8 = (source, exclude) => {
642
642
  var target = {};
643
643
  for (var prop in source)
644
- if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
644
+ if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
645
645
  target[prop] = source[prop];
646
- if (source != null && __getOwnPropSymbols$9)
647
- for (var prop of __getOwnPropSymbols$9(source)) {
648
- if (exclude.indexOf(prop) < 0 && __propIsEnum$9.call(source, prop))
646
+ if (source != null && __getOwnPropSymbols$a)
647
+ for (var prop of __getOwnPropSymbols$a(source)) {
648
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
649
649
  target[prop] = source[prop];
650
650
  }
651
651
  return target;
@@ -900,17 +900,17 @@ const useGetInsuranceAccount = (insuranceProvider) => {
900
900
  });
901
901
  };
902
902
 
903
- var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
904
- var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
905
- var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
903
+ var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
904
+ var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
905
+ var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
906
906
  var __objRest$7 = (source, exclude) => {
907
907
  var target = {};
908
908
  for (var prop in source)
909
- if (__hasOwnProp$8.call(source, prop) && exclude.indexOf(prop) < 0)
909
+ if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
910
910
  target[prop] = source[prop];
911
- if (source != null && __getOwnPropSymbols$8)
912
- for (var prop of __getOwnPropSymbols$8(source)) {
913
- if (exclude.indexOf(prop) < 0 && __propIsEnum$8.call(source, prop))
911
+ if (source != null && __getOwnPropSymbols$9)
912
+ for (var prop of __getOwnPropSymbols$9(source)) {
913
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$9.call(source, prop))
914
914
  target[prop] = source[prop];
915
915
  }
916
916
  return target;
@@ -948,17 +948,17 @@ const useAddInsuranceFunds = () => {
948
948
  });
949
949
  };
950
950
 
951
- var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
952
- var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
953
- var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
951
+ var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
952
+ var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
953
+ var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
954
954
  var __objRest$6 = (source, exclude) => {
955
955
  var target = {};
956
956
  for (var prop in source)
957
- if (__hasOwnProp$7.call(source, prop) && exclude.indexOf(prop) < 0)
957
+ if (__hasOwnProp$8.call(source, prop) && exclude.indexOf(prop) < 0)
958
958
  target[prop] = source[prop];
959
- if (source != null && __getOwnPropSymbols$7)
960
- for (var prop of __getOwnPropSymbols$7(source)) {
961
- if (exclude.indexOf(prop) < 0 && __propIsEnum$7.call(source, prop))
959
+ if (source != null && __getOwnPropSymbols$8)
960
+ for (var prop of __getOwnPropSymbols$8(source)) {
961
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$8.call(source, prop))
962
962
  target[prop] = source[prop];
963
963
  }
964
964
  return target;
@@ -1011,17 +1011,17 @@ const useGetLabel = (labelId) => {
1011
1011
  });
1012
1012
  };
1013
1013
 
1014
- var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
1015
- var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
1016
- var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
1014
+ var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
1015
+ var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
1016
+ var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
1017
1017
  var __objRest$5 = (source, exclude) => {
1018
1018
  var target = {};
1019
1019
  for (var prop in source)
1020
- if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
1020
+ if (__hasOwnProp$7.call(source, prop) && exclude.indexOf(prop) < 0)
1021
1021
  target[prop] = source[prop];
1022
- if (source != null && __getOwnPropSymbols$6)
1023
- for (var prop of __getOwnPropSymbols$6(source)) {
1024
- if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
1022
+ if (source != null && __getOwnPropSymbols$7)
1023
+ for (var prop of __getOwnPropSymbols$7(source)) {
1024
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$7.call(source, prop))
1025
1025
  target[prop] = source[prop];
1026
1026
  }
1027
1027
  return target;
@@ -1417,17 +1417,17 @@ const useListSalesOrders = (params = {}) => {
1417
1417
  });
1418
1418
  };
1419
1419
 
1420
- var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
1421
- var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
1422
- var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
1420
+ var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
1421
+ var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
1422
+ var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
1423
1423
  var __objRest$4 = (source, exclude) => {
1424
1424
  var target = {};
1425
1425
  for (var prop in source)
1426
- if (__hasOwnProp$5.call(source, prop) && exclude.indexOf(prop) < 0)
1426
+ if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
1427
1427
  target[prop] = source[prop];
1428
- if (source != null && __getOwnPropSymbols$5)
1429
- for (var prop of __getOwnPropSymbols$5(source)) {
1430
- if (exclude.indexOf(prop) < 0 && __propIsEnum$5.call(source, prop))
1428
+ if (source != null && __getOwnPropSymbols$6)
1429
+ for (var prop of __getOwnPropSymbols$6(source)) {
1430
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
1431
1431
  target[prop] = source[prop];
1432
1432
  }
1433
1433
  return target;
@@ -1465,17 +1465,17 @@ const useNotifySalesOrderShipped = () => {
1465
1465
  });
1466
1466
  };
1467
1467
 
1468
- var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
1469
- var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
1470
- var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
1468
+ var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
1469
+ var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
1470
+ var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
1471
1471
  var __objRest$3 = (source, exclude) => {
1472
1472
  var target = {};
1473
1473
  for (var prop in source)
1474
- if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
1474
+ if (__hasOwnProp$5.call(source, prop) && exclude.indexOf(prop) < 0)
1475
1475
  target[prop] = source[prop];
1476
- if (source != null && __getOwnPropSymbols$4)
1477
- for (var prop of __getOwnPropSymbols$4(source)) {
1478
- if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
1476
+ if (source != null && __getOwnPropSymbols$5)
1477
+ for (var prop of __getOwnPropSymbols$5(source)) {
1478
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$5.call(source, prop))
1479
1479
  target[prop] = source[prop];
1480
1480
  }
1481
1481
  return target;
@@ -1539,17 +1539,17 @@ const useListSalesOrderShipments = (params) => {
1539
1539
  });
1540
1540
  };
1541
1541
 
1542
- var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
1543
- var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
1544
- var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
1542
+ var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
1543
+ var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
1544
+ var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
1545
1545
  var __objRest$2 = (source, exclude) => {
1546
1546
  var target = {};
1547
1547
  for (var prop in source)
1548
- if (__hasOwnProp$3.call(source, prop) && exclude.indexOf(prop) < 0)
1548
+ if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
1549
1549
  target[prop] = source[prop];
1550
- if (source != null && __getOwnPropSymbols$3)
1551
- for (var prop of __getOwnPropSymbols$3(source)) {
1552
- if (exclude.indexOf(prop) < 0 && __propIsEnum$3.call(source, prop))
1550
+ if (source != null && __getOwnPropSymbols$4)
1551
+ for (var prop of __getOwnPropSymbols$4(source)) {
1552
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
1553
1553
  target[prop] = source[prop];
1554
1554
  }
1555
1555
  return target;
@@ -1587,25 +1587,25 @@ const useUpdateSalesOrderShipment = () => {
1587
1587
  });
1588
1588
  };
1589
1589
 
1590
- var __defProp = Object.defineProperty;
1591
- var __defProps = Object.defineProperties;
1592
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
1593
- var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
1594
- var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
1595
- var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
1596
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1597
- var __spreadValues = (a, b) => {
1590
+ var __defProp$1 = Object.defineProperty;
1591
+ var __defProps$1 = Object.defineProperties;
1592
+ var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
1593
+ var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
1594
+ var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
1595
+ var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
1596
+ var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1597
+ var __spreadValues$1 = (a, b) => {
1598
1598
  for (var prop in b || (b = {}))
1599
- if (__hasOwnProp$2.call(b, prop))
1600
- __defNormalProp(a, prop, b[prop]);
1601
- if (__getOwnPropSymbols$2)
1602
- for (var prop of __getOwnPropSymbols$2(b)) {
1603
- if (__propIsEnum$2.call(b, prop))
1604
- __defNormalProp(a, prop, b[prop]);
1599
+ if (__hasOwnProp$3.call(b, prop))
1600
+ __defNormalProp$1(a, prop, b[prop]);
1601
+ if (__getOwnPropSymbols$3)
1602
+ for (var prop of __getOwnPropSymbols$3(b)) {
1603
+ if (__propIsEnum$3.call(b, prop))
1604
+ __defNormalProp$1(a, prop, b[prop]);
1605
1605
  }
1606
1606
  return a;
1607
1607
  };
1608
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
1608
+ var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
1609
1609
  var __async$9 = (__this, __arguments, generator) => {
1610
1610
  return new Promise((resolve, reject) => {
1611
1611
  var fulfilled = (value) => {
@@ -1647,7 +1647,7 @@ const useCreateShipment = () => {
1647
1647
  postalCode: "",
1648
1648
  stateProvince: ""
1649
1649
  };
1650
- return (yield client.shipments.create(__spreadProps(__spreadValues({}, shipment), {
1650
+ return (yield client.shipments.create(__spreadProps$1(__spreadValues$1({}, shipment), {
1651
1651
  shipTo
1652
1652
  }))).data;
1653
1653
  }),
@@ -1688,17 +1688,17 @@ const useGetShipment = (shipmentId) => {
1688
1688
  });
1689
1689
  };
1690
1690
 
1691
- var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
1692
- var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
1693
- var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
1691
+ var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
1692
+ var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
1693
+ var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
1694
1694
  var __objRest$1 = (source, exclude) => {
1695
1695
  var target = {};
1696
1696
  for (var prop in source)
1697
- if (__hasOwnProp$1.call(source, prop) && exclude.indexOf(prop) < 0)
1697
+ if (__hasOwnProp$2.call(source, prop) && exclude.indexOf(prop) < 0)
1698
1698
  target[prop] = source[prop];
1699
- if (source != null && __getOwnPropSymbols$1)
1700
- for (var prop of __getOwnPropSymbols$1(source)) {
1701
- if (exclude.indexOf(prop) < 0 && __propIsEnum$1.call(source, prop))
1699
+ if (source != null && __getOwnPropSymbols$2)
1700
+ for (var prop of __getOwnPropSymbols$2(source)) {
1701
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$2.call(source, prop))
1702
1702
  target[prop] = source[prop];
1703
1703
  }
1704
1704
  return target;
@@ -1715,16 +1715,35 @@ const useListShipments = (_params) => {
1715
1715
  });
1716
1716
  };
1717
1717
 
1718
- const useListShippingRules = () => {
1718
+ var __defProp = Object.defineProperty;
1719
+ var __defProps = Object.defineProperties;
1720
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
1721
+ var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
1722
+ var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
1723
+ var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
1724
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1725
+ var __spreadValues = (a, b) => {
1726
+ for (var prop in b || (b = {}))
1727
+ if (__hasOwnProp$1.call(b, prop))
1728
+ __defNormalProp(a, prop, b[prop]);
1729
+ if (__getOwnPropSymbols$1)
1730
+ for (var prop of __getOwnPropSymbols$1(b)) {
1731
+ if (__propIsEnum$1.call(b, prop))
1732
+ __defNormalProp(a, prop, b[prop]);
1733
+ }
1734
+ return a;
1735
+ };
1736
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
1737
+ const useListShippingRules = (params) => {
1719
1738
  const { client } = useShipEngine();
1720
- return useQuery({
1739
+ return useQuery(__spreadProps(__spreadValues({}, params), {
1721
1740
  onError,
1722
1741
  queryFn: () => {
1723
1742
  return client.shippingRules.list();
1724
1743
  },
1725
1744
  queryKey: ["useListShippingRules"],
1726
1745
  select: (result) => result.data.shippingRules
1727
- });
1746
+ }));
1728
1747
  };
1729
1748
 
1730
1749
  var __async$8 = (__this, __arguments, generator) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/react-api",
3
- "version": "2.6.0",
3
+ "version": "2.7.0",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {
@@ -2,3 +2,4 @@ export * from "./delay";
2
2
  export * from "./error";
3
3
  export * from "./logger";
4
4
  export * from "./retry";
5
+ export * from "./types";
@@ -0,0 +1,19 @@
1
+ import { UseMutationOptions, UseQueryOptions } from "@tanstack/react-query";
2
+ import { AxiosResponse } from "axios";
3
+ import { CodedError } from "@shipengine/js-api";
4
+ /**
5
+ * @category Entities
6
+ * Generic object type to be used in any useQuery hook
7
+ * @param TResponseData - The response data type from the query
8
+ * @param TQueryFnParams - The data type for the queryFnParams
9
+ */
10
+ export type QueryProps<TResponseData, TQueryFnParams = unknown> = {
11
+ queryFnParams?: TQueryFnParams;
12
+ } & Pick<UseQueryOptions<AxiosResponse<TResponseData, any>, CodedError[], TResponseData>, "enabled">;
13
+ /**
14
+ * @category Entities
15
+ * Generic object type to be used in any useMutation hook
16
+ * @param TMutationInput - The input data type for the mutation
17
+ * @param TResponseData - The response data type from the mutation
18
+ */
19
+ export type MutationProps<TMutationInput, TResponseData, TError = CodedError[], TContext = unknown> = Pick<UseMutationOptions<TResponseData, TError, TMutationInput, TContext>, "retry">;