@shipengine/alchemy 5.4.26 → 6.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -10812,17 +10812,17 @@ var AccountBillingPlanChangeType = /* @__PURE__ */ ((AccountBillingPlanChangeTyp
10812
10812
  return AccountBillingPlanChangeType2;
10813
10813
  })(AccountBillingPlanChangeType || {});
10814
10814
 
10815
- var __getOwnPropSymbols$v = Object.getOwnPropertySymbols;
10816
- var __hasOwnProp$v = Object.prototype.hasOwnProperty;
10817
- var __propIsEnum$v = Object.prototype.propertyIsEnumerable;
10818
- var __objRest$i = (source, exclude) => {
10815
+ var __getOwnPropSymbols$z = Object.getOwnPropertySymbols;
10816
+ var __hasOwnProp$z = Object.prototype.hasOwnProperty;
10817
+ var __propIsEnum$z = Object.prototype.propertyIsEnumerable;
10818
+ var __objRest$n = (source, exclude) => {
10819
10819
  var target = {};
10820
10820
  for (var prop in source)
10821
- if (__hasOwnProp$v.call(source, prop) && exclude.indexOf(prop) < 0)
10821
+ if (__hasOwnProp$z.call(source, prop) && exclude.indexOf(prop) < 0)
10822
10822
  target[prop] = source[prop];
10823
- if (source != null && __getOwnPropSymbols$v)
10824
- for (var prop of __getOwnPropSymbols$v(source)) {
10825
- if (exclude.indexOf(prop) < 0 && __propIsEnum$v.call(source, prop))
10823
+ if (source != null && __getOwnPropSymbols$z)
10824
+ for (var prop of __getOwnPropSymbols$z(source)) {
10825
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$z.call(source, prop))
10826
10826
  target[prop] = source[prop];
10827
10827
  }
10828
10828
  return target;
@@ -10836,7 +10836,7 @@ class CodedError {
10836
10836
  this.message = message;
10837
10837
  }
10838
10838
  static fromObject(_a) {
10839
- var _b = _a, { message } = _b, options = __objRest$i(_b, ["message"]);
10839
+ var _b = _a, { message } = _b, options = __objRest$n(_b, ["message"]);
10840
10840
  return new CodedError(message, options);
10841
10841
  }
10842
10842
  }
@@ -10944,17 +10944,17 @@ const types = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
10944
10944
  RateCardStatus
10945
10945
  }, Symbol.toStringTag, { value: 'Module' }));
10946
10946
 
10947
- var __getOwnPropSymbols$u = Object.getOwnPropertySymbols;
10948
- var __hasOwnProp$u = Object.prototype.hasOwnProperty;
10949
- var __propIsEnum$u = Object.prototype.propertyIsEnumerable;
10950
- var __objRest$h = (source, exclude) => {
10947
+ var __getOwnPropSymbols$y = Object.getOwnPropertySymbols;
10948
+ var __hasOwnProp$y = Object.prototype.hasOwnProperty;
10949
+ var __propIsEnum$y = Object.prototype.propertyIsEnumerable;
10950
+ var __objRest$m = (source, exclude) => {
10951
10951
  var target = {};
10952
10952
  for (var prop in source)
10953
- if (__hasOwnProp$u.call(source, prop) && exclude.indexOf(prop) < 0)
10953
+ if (__hasOwnProp$y.call(source, prop) && exclude.indexOf(prop) < 0)
10954
10954
  target[prop] = source[prop];
10955
- if (source != null && __getOwnPropSymbols$u)
10956
- for (var prop of __getOwnPropSymbols$u(source)) {
10957
- if (exclude.indexOf(prop) < 0 && __propIsEnum$u.call(source, prop))
10955
+ if (source != null && __getOwnPropSymbols$y)
10956
+ for (var prop of __getOwnPropSymbols$y(source)) {
10957
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$y.call(source, prop))
10958
10958
  target[prop] = source[prop];
10959
10959
  }
10960
10960
  return target;
@@ -10986,7 +10986,7 @@ class AccountSettingsAPI {
10986
10986
  * The `updateImage` method updates specific image data for a given image id.
10987
10987
  */
10988
10988
  this.updateImage = (_a) => {
10989
- var _b = _a, { labelImageId } = _b, data = __objRest$h(_b, ["labelImageId"]);
10989
+ var _b = _a, { labelImageId } = _b, data = __objRest$m(_b, ["labelImageId"]);
10990
10990
  return this.client.put(`/v1/account/settings/images/${labelImageId}`, data);
10991
10991
  };
10992
10992
  /**
@@ -13728,33 +13728,33 @@ const getEndUserIpAddress = () => __async$O(void 0, null, function* () {
13728
13728
  }
13729
13729
  });
13730
13730
 
13731
- var __defProp$i = Object.defineProperty;
13732
- var __defProps$d = Object.defineProperties;
13733
- var __getOwnPropDescs$d = Object.getOwnPropertyDescriptors;
13734
- var __getOwnPropSymbols$t = Object.getOwnPropertySymbols;
13735
- var __hasOwnProp$t = Object.prototype.hasOwnProperty;
13736
- var __propIsEnum$t = Object.prototype.propertyIsEnumerable;
13737
- var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13738
- var __spreadValues$i = (a, b) => {
13731
+ var __defProp$n = Object.defineProperty;
13732
+ var __defProps$i = Object.defineProperties;
13733
+ var __getOwnPropDescs$i = Object.getOwnPropertyDescriptors;
13734
+ var __getOwnPropSymbols$x = Object.getOwnPropertySymbols;
13735
+ var __hasOwnProp$x = Object.prototype.hasOwnProperty;
13736
+ var __propIsEnum$x = Object.prototype.propertyIsEnumerable;
13737
+ var __defNormalProp$n = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13738
+ var __spreadValues$n = (a, b) => {
13739
13739
  for (var prop in b || (b = {}))
13740
- if (__hasOwnProp$t.call(b, prop))
13741
- __defNormalProp$i(a, prop, b[prop]);
13742
- if (__getOwnPropSymbols$t)
13743
- for (var prop of __getOwnPropSymbols$t(b)) {
13744
- if (__propIsEnum$t.call(b, prop))
13745
- __defNormalProp$i(a, prop, b[prop]);
13740
+ if (__hasOwnProp$x.call(b, prop))
13741
+ __defNormalProp$n(a, prop, b[prop]);
13742
+ if (__getOwnPropSymbols$x)
13743
+ for (var prop of __getOwnPropSymbols$x(b)) {
13744
+ if (__propIsEnum$x.call(b, prop))
13745
+ __defNormalProp$n(a, prop, b[prop]);
13746
13746
  }
13747
13747
  return a;
13748
13748
  };
13749
- var __spreadProps$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(b));
13750
- var __objRest$g = (source, exclude) => {
13749
+ var __spreadProps$i = (a, b) => __defProps$i(a, __getOwnPropDescs$i(b));
13750
+ var __objRest$l = (source, exclude) => {
13751
13751
  var target = {};
13752
13752
  for (var prop in source)
13753
- if (__hasOwnProp$t.call(source, prop) && exclude.indexOf(prop) < 0)
13753
+ if (__hasOwnProp$x.call(source, prop) && exclude.indexOf(prop) < 0)
13754
13754
  target[prop] = source[prop];
13755
- if (source != null && __getOwnPropSymbols$t)
13756
- for (var prop of __getOwnPropSymbols$t(source)) {
13757
- if (exclude.indexOf(prop) < 0 && __propIsEnum$t.call(source, prop))
13755
+ if (source != null && __getOwnPropSymbols$x)
13756
+ for (var prop of __getOwnPropSymbols$x(source)) {
13757
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$x.call(source, prop))
13758
13758
  target[prop] = source[prop];
13759
13759
  }
13760
13760
  return target;
@@ -13785,8 +13785,10 @@ class CarriersAPI {
13785
13785
  /**
13786
13786
  * The `list` method retrieves a list of connected carriers for a given user.
13787
13787
  */
13788
- this.list = () => {
13789
- return this.client.get("/v1/carriers");
13788
+ this.list = (props) => {
13789
+ return this.client.get("/v1/carriers", {
13790
+ isSandbox: props == null ? void 0 : props.isSandbox
13791
+ });
13790
13792
  };
13791
13793
  /**
13792
13794
  * The `get` method retrieves a specific carrier by `carrierId`.
@@ -13798,11 +13800,11 @@ class CarriersAPI {
13798
13800
  * The `connect` method connects a carrier account to a user's ShipEngine account.
13799
13801
  */
13800
13802
  this.connect = (_a) => __async$N(this, null, function* () {
13801
- var _b = _a, { carrierCode } = _b, connection = __objRest$g(_b, ["carrierCode"]);
13803
+ var _b = _a, { carrierCode } = _b, connection = __objRest$l(_b, ["carrierCode"]);
13802
13804
  const endUserIpAddress = yield getEndUserIpAddress();
13803
13805
  if (!endUserIpAddress)
13804
13806
  return Promise.reject([new CodedError("Unable to get IP address")]);
13805
- return yield this.client.post(`/v1/registration/${carrierCode}`, __spreadProps$d(__spreadValues$i({}, connection), {
13807
+ return yield this.client.post(`/v1/registration/${carrierCode}`, __spreadProps$i(__spreadValues$n({}, connection), {
13806
13808
  endUserIpAddress
13807
13809
  }));
13808
13810
  });
@@ -16185,19 +16187,19 @@ class CustomPackagesAPI {
16185
16187
  }
16186
16188
  }
16187
16189
 
16188
- var __defProp$h = Object.defineProperty;
16189
- var __getOwnPropSymbols$s = Object.getOwnPropertySymbols;
16190
- var __hasOwnProp$s = Object.prototype.hasOwnProperty;
16191
- var __propIsEnum$s = Object.prototype.propertyIsEnumerable;
16192
- var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16193
- var __spreadValues$h = (a, b) => {
16190
+ var __defProp$m = Object.defineProperty;
16191
+ var __getOwnPropSymbols$w = Object.getOwnPropertySymbols;
16192
+ var __hasOwnProp$w = Object.prototype.hasOwnProperty;
16193
+ var __propIsEnum$w = Object.prototype.propertyIsEnumerable;
16194
+ var __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16195
+ var __spreadValues$m = (a, b) => {
16194
16196
  for (var prop in b || (b = {}))
16195
- if (__hasOwnProp$s.call(b, prop))
16196
- __defNormalProp$h(a, prop, b[prop]);
16197
- if (__getOwnPropSymbols$s)
16198
- for (var prop of __getOwnPropSymbols$s(b)) {
16199
- if (__propIsEnum$s.call(b, prop))
16200
- __defNormalProp$h(a, prop, b[prop]);
16197
+ if (__hasOwnProp$w.call(b, prop))
16198
+ __defNormalProp$m(a, prop, b[prop]);
16199
+ if (__getOwnPropSymbols$w)
16200
+ for (var prop of __getOwnPropSymbols$w(b)) {
16201
+ if (__propIsEnum$w.call(b, prop))
16202
+ __defNormalProp$m(a, prop, b[prop]);
16201
16203
  }
16202
16204
  return a;
16203
16205
  };
@@ -16245,7 +16247,7 @@ class FundingSourcesAPI {
16245
16247
  if (!endUserIpAddress) {
16246
16248
  return Promise.reject([new CodedError("Unable to get IP address")]);
16247
16249
  }
16248
- return yield this.client.post("/v1/funding_sources", __spreadValues$h({
16250
+ return yield this.client.post("/v1/funding_sources", __spreadValues$m({
16249
16251
  endUserIpAddress
16250
16252
  }, createFundingSource));
16251
16253
  });
@@ -16277,7 +16279,7 @@ class FundingSourcesAPI {
16277
16279
  if (!endUserIpAddress) {
16278
16280
  return Promise.reject([new CodedError("Unable to get IP address")]);
16279
16281
  }
16280
- return yield this.client.post("/v1/registration/funding_source", __spreadValues$h({
16282
+ return yield this.client.post("/v1/registration/funding_source", __spreadValues$m({
16281
16283
  endUserIpAddress
16282
16284
  }, carrier));
16283
16285
  });
@@ -16482,19 +16484,19 @@ class RateCardsAPI {
16482
16484
  }
16483
16485
  }
16484
16486
 
16485
- var __defProp$g = Object.defineProperty;
16486
- var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
16487
- var __hasOwnProp$r = Object.prototype.hasOwnProperty;
16488
- var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
16489
- var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16490
- var __spreadValues$g = (a, b) => {
16487
+ var __defProp$l = Object.defineProperty;
16488
+ var __getOwnPropSymbols$v = Object.getOwnPropertySymbols;
16489
+ var __hasOwnProp$v = Object.prototype.hasOwnProperty;
16490
+ var __propIsEnum$v = Object.prototype.propertyIsEnumerable;
16491
+ var __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16492
+ var __spreadValues$l = (a, b) => {
16491
16493
  for (var prop in b || (b = {}))
16492
- if (__hasOwnProp$r.call(b, prop))
16493
- __defNormalProp$g(a, prop, b[prop]);
16494
- if (__getOwnPropSymbols$r)
16495
- for (var prop of __getOwnPropSymbols$r(b)) {
16496
- if (__propIsEnum$r.call(b, prop))
16497
- __defNormalProp$g(a, prop, b[prop]);
16494
+ if (__hasOwnProp$v.call(b, prop))
16495
+ __defNormalProp$l(a, prop, b[prop]);
16496
+ if (__getOwnPropSymbols$v)
16497
+ for (var prop of __getOwnPropSymbols$v(b)) {
16498
+ if (__propIsEnum$v.call(b, prop))
16499
+ __defNormalProp$l(a, prop, b[prop]);
16498
16500
  }
16499
16501
  return a;
16500
16502
  };
@@ -16516,7 +16518,7 @@ class RatesAPI {
16516
16518
  * method.
16517
16519
  */
16518
16520
  this.estimate = (params) => {
16519
- return this.client.post("/v1/rates/estimate", __spreadValues$g({}, params));
16521
+ return this.client.post("/v1/rates/estimate", __spreadValues$l({}, params));
16520
16522
  };
16521
16523
  this.client = client;
16522
16524
  }
@@ -16614,19 +16616,19 @@ class SellersAPI {
16614
16616
  }
16615
16617
  }
16616
16618
 
16617
- var __defProp$f = Object.defineProperty;
16618
- var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
16619
- var __hasOwnProp$q = Object.prototype.hasOwnProperty;
16620
- var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
16621
- var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16622
- var __spreadValues$f = (a, b) => {
16619
+ var __defProp$k = Object.defineProperty;
16620
+ var __getOwnPropSymbols$u = Object.getOwnPropertySymbols;
16621
+ var __hasOwnProp$u = Object.prototype.hasOwnProperty;
16622
+ var __propIsEnum$u = Object.prototype.propertyIsEnumerable;
16623
+ var __defNormalProp$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16624
+ var __spreadValues$k = (a, b) => {
16623
16625
  for (var prop in b || (b = {}))
16624
- if (__hasOwnProp$q.call(b, prop))
16625
- __defNormalProp$f(a, prop, b[prop]);
16626
- if (__getOwnPropSymbols$q)
16627
- for (var prop of __getOwnPropSymbols$q(b)) {
16628
- if (__propIsEnum$q.call(b, prop))
16629
- __defNormalProp$f(a, prop, b[prop]);
16626
+ if (__hasOwnProp$u.call(b, prop))
16627
+ __defNormalProp$k(a, prop, b[prop]);
16628
+ if (__getOwnPropSymbols$u)
16629
+ for (var prop of __getOwnPropSymbols$u(b)) {
16630
+ if (__propIsEnum$u.call(b, prop))
16631
+ __defNormalProp$k(a, prop, b[prop]);
16630
16632
  }
16631
16633
  return a;
16632
16634
  };
@@ -16638,7 +16640,7 @@ class ServicePointsAPI {
16638
16640
  * Either an address, coordinates, or an address query
16639
16641
  */
16640
16642
  this.list = (options) => {
16641
- return this.client.post("/v1/service_points/list", __spreadValues$f({}, options));
16643
+ return this.client.post("/v1/service_points/list", __spreadValues$k({}, options));
16642
16644
  };
16643
16645
  /**
16644
16646
  * Get a specific service point by its carrier code, country code, and id
@@ -16720,42 +16722,55 @@ class ShippingRulesAPI {
16720
16722
  /**
16721
16723
  * The `list` method retrieves the list of shipping rules by seller.
16722
16724
  */
16723
- this.list = () => {
16724
- return this.client.get(`/v1/shipping_rules`);
16725
+ this.list = (props) => {
16726
+ return this.client.get(`/v1/shipping_rules`, {
16727
+ isSandbox: props == null ? void 0 : props.isSandbox
16728
+ });
16725
16729
  };
16726
16730
  /**
16727
16731
  * The `get` method retrieves a specific shipping rule by `shippingRuleId`.
16728
16732
  */
16729
- this.get = (shippingRuleId) => {
16730
- return this.client.get(`/v1/shipping_rules/${shippingRuleId}`);
16733
+ this.get = (props) => {
16734
+ return this.client.get(`/v1/shipping_rules/${props == null ? void 0 : props.shippingRuleId}`, {
16735
+ isSandbox: props == null ? void 0 : props.isSandbox
16736
+ });
16731
16737
  };
16732
16738
  /**
16733
16739
  * The `create` method creates a new shipping rule for a given user.
16734
16740
  */
16735
- this.create = (shippingRule) => {
16736
- return this.client.post("/v1/shipping_rules", shippingRule);
16741
+ this.create = (props) => {
16742
+ return this.client.post("/v1/shipping_rules", props.shippingRule, {
16743
+ isSandbox: props.isSandbox
16744
+ });
16737
16745
  };
16738
16746
  /**
16739
16747
  * The `delete` method deletes a shipping rule by `shippingRuleId`.
16740
16748
  */
16741
- this.delete = (shippingRuleId) => {
16742
- return this.client.delete(`/v1/shipping_rules/${shippingRuleId}`);
16749
+ this.delete = (props) => {
16750
+ return this.client.delete(`/v1/shipping_rules/${props.shippingRuleId}`, {
16751
+ isSandbox: props.isSandbox
16752
+ });
16743
16753
  };
16744
16754
  /**
16745
16755
  * The `edit` method edits a specific shipping rule by `shippingRuleId` with a new
16746
16756
  * `ShippingRule`.
16747
16757
  */
16748
- this.edit = (shippingRule) => {
16758
+ this.edit = (props) => {
16749
16759
  return this.client.put(
16750
- `/v1/shipping_rules/${shippingRule.shippingRuleId}`,
16751
- shippingRule
16760
+ `/v1/shipping_rules/${props.shippingRule.shippingRuleId}`,
16761
+ props.shippingRule,
16762
+ {
16763
+ isSandbox: props.isSandbox
16764
+ }
16752
16765
  );
16753
16766
  };
16754
16767
  /**
16755
16768
  * The `getConditionOptions` method retrieves the list of condition options availables for creating shipping rules.
16756
16769
  */
16757
- this.getConditionOptions = () => {
16758
- return this.client.get(`/v1/shipping_rules/rule_conditions_options`);
16770
+ this.getConditionOptions = (props) => {
16771
+ return this.client.get(`/v1/shipping_rules/rule_conditions_options`, {
16772
+ isSandbox: props == null ? void 0 : props.isSandbox
16773
+ });
16759
16774
  };
16760
16775
  this.client = client;
16761
16776
  }
@@ -16781,8 +16796,10 @@ class WarehousesAPI {
16781
16796
  * The `list` method retrieves a list of `warehouses` (Ship From Locations)
16782
16797
  * for a given user.
16783
16798
  */
16784
- this.list = () => {
16785
- return this.client.get("/v1/warehouses");
16799
+ this.list = (props) => {
16800
+ return this.client.get("/v1/warehouses", {
16801
+ isSandbox: props == null ? void 0 : props.isSandbox
16802
+ });
16786
16803
  };
16787
16804
  /**
16788
16805
  * The `create` method allows for creation of warehouses (Ship From Locations)
@@ -34071,25 +34088,25 @@ class WebhooksAPI {
34071
34088
  }
34072
34089
  }
34073
34090
 
34074
- var __defProp$e = Object.defineProperty;
34075
- var __defProps$c = Object.defineProperties;
34076
- var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
34077
- var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
34078
- var __hasOwnProp$p = Object.prototype.hasOwnProperty;
34079
- var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
34080
- var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
34081
- var __spreadValues$e = (a, b) => {
34091
+ var __defProp$j = Object.defineProperty;
34092
+ var __defProps$h = Object.defineProperties;
34093
+ var __getOwnPropDescs$h = Object.getOwnPropertyDescriptors;
34094
+ var __getOwnPropSymbols$t = Object.getOwnPropertySymbols;
34095
+ var __hasOwnProp$t = Object.prototype.hasOwnProperty;
34096
+ var __propIsEnum$t = Object.prototype.propertyIsEnumerable;
34097
+ var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
34098
+ var __spreadValues$j = (a, b) => {
34082
34099
  for (var prop in b || (b = {}))
34083
- if (__hasOwnProp$p.call(b, prop))
34084
- __defNormalProp$e(a, prop, b[prop]);
34085
- if (__getOwnPropSymbols$p)
34086
- for (var prop of __getOwnPropSymbols$p(b)) {
34087
- if (__propIsEnum$p.call(b, prop))
34088
- __defNormalProp$e(a, prop, b[prop]);
34100
+ if (__hasOwnProp$t.call(b, prop))
34101
+ __defNormalProp$j(a, prop, b[prop]);
34102
+ if (__getOwnPropSymbols$t)
34103
+ for (var prop of __getOwnPropSymbols$t(b)) {
34104
+ if (__propIsEnum$t.call(b, prop))
34105
+ __defNormalProp$j(a, prop, b[prop]);
34089
34106
  }
34090
34107
  return a;
34091
34108
  };
34092
- var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(b));
34109
+ var __spreadProps$h = (a, b) => __defProps$h(a, __getOwnPropDescs$h(b));
34093
34110
  var __async$J = (__this, __arguments, generator) => {
34094
34111
  return new Promise((resolve, reject) => {
34095
34112
  var fulfilled = (value) => {
@@ -34113,7 +34130,7 @@ var __async$J = (__this, __arguments, generator) => {
34113
34130
  const logger$1 = E({
34114
34131
  level: process.env.NODE_ENV === "production" ? "fatal" : "info",
34115
34132
  name: "shipengine-api",
34116
- serializers: __spreadProps$c(__spreadValues$e({}, k), {
34133
+ serializers: __spreadProps$h(__spreadValues$j({}, k), {
34117
34134
  req: (req) => ({
34118
34135
  headers: req.headers,
34119
34136
  method: req.method,
@@ -34134,10 +34151,10 @@ const logger$1 = E({
34134
34151
  ]
34135
34152
  });
34136
34153
  class ShipEngineAPI {
34137
- constructor(token, { baseURL, headers, getToken, onApiError }) {
34154
+ constructor(token, { baseURL, headers, getToken, getSandboxToken, onApiError }) {
34138
34155
  const client = axios.create({
34139
34156
  baseURL,
34140
- headers: __spreadProps$c(__spreadValues$e({}, headers), {
34157
+ headers: __spreadProps$h(__spreadValues$j({}, headers), {
34141
34158
  "Content-Type": "application/json"
34142
34159
  }),
34143
34160
  paramsSerializer: (params) => lib.stringify(humpsExports.decamelizeKeys(params), { arrayFormat: "brackets" }),
@@ -34171,6 +34188,21 @@ class ShipEngineAPI {
34171
34188
  ]
34172
34189
  });
34173
34190
  client.defaults.headers.common["Authorization"] = `Bearer ${token}`;
34191
+ client.interceptors.request.use(
34192
+ (config) => __async$J(this, null, function* () {
34193
+ if (config.isSandbox) {
34194
+ if (!this.sandboxToken) {
34195
+ this.sandboxToken = yield getSandboxToken == null ? void 0 : getSandboxToken();
34196
+ }
34197
+ config.headers || (config.headers = {});
34198
+ config.headers["Authorization"] = `Bearer ${this.sandboxToken}`;
34199
+ }
34200
+ return config;
34201
+ }),
34202
+ function(error) {
34203
+ return Promise.reject(error);
34204
+ }
34205
+ );
34174
34206
  client.interceptors.response.use(
34175
34207
  (res) => {
34176
34208
  var _a;
@@ -34196,9 +34228,13 @@ class ShipEngineAPI {
34196
34228
  err.message
34197
34229
  );
34198
34230
  if (isInvalidTokenError(err)) {
34199
- const token2 = yield getToken();
34231
+ const token2 = yield err.config.isSandbox ? getSandboxToken == null ? void 0 : getSandboxToken() : getToken();
34200
34232
  const config = err.config;
34201
- this.token = token2;
34233
+ if (err.config.isSandbox) {
34234
+ this.sandboxToken = token2;
34235
+ } else {
34236
+ this.token = token2;
34237
+ }
34202
34238
  if (config) {
34203
34239
  config.headers || (config.headers = {});
34204
34240
  config.headers["Authorization"] = `Bearer ${token2}`;
@@ -34409,6 +34445,7 @@ const ShipEngine = ({
34409
34445
  baseURL,
34410
34446
  children,
34411
34447
  headers,
34448
+ getSandboxToken,
34412
34449
  getToken,
34413
34450
  onApiError,
34414
34451
  defaultQueryClientOptions = {}
@@ -34423,6 +34460,7 @@ const ShipEngine = ({
34423
34460
  const token = getToken();
34424
34461
  const commonClientProps = {
34425
34462
  baseURL,
34463
+ getSandboxToken,
34426
34464
  getToken,
34427
34465
  headers: headers != null ? headers : {},
34428
34466
  onApiError
@@ -34466,25 +34504,25 @@ const delay = (ms) => new Promise((resolve) => {
34466
34504
 
34467
34505
  const onError = (_errors) => _default();
34468
34506
 
34469
- var __defProp$d = Object.defineProperty;
34470
- var __defProps$b = Object.defineProperties;
34471
- var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
34472
- var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
34473
- var __hasOwnProp$o = Object.prototype.hasOwnProperty;
34474
- var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
34475
- var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
34476
- var __spreadValues$d = (a, b) => {
34507
+ var __defProp$i = Object.defineProperty;
34508
+ var __defProps$g = Object.defineProperties;
34509
+ var __getOwnPropDescs$g = Object.getOwnPropertyDescriptors;
34510
+ var __getOwnPropSymbols$s = Object.getOwnPropertySymbols;
34511
+ var __hasOwnProp$s = Object.prototype.hasOwnProperty;
34512
+ var __propIsEnum$s = Object.prototype.propertyIsEnumerable;
34513
+ var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
34514
+ var __spreadValues$i = (a, b) => {
34477
34515
  for (var prop in b || (b = {}))
34478
- if (__hasOwnProp$o.call(b, prop))
34479
- __defNormalProp$d(a, prop, b[prop]);
34480
- if (__getOwnPropSymbols$o)
34481
- for (var prop of __getOwnPropSymbols$o(b)) {
34482
- if (__propIsEnum$o.call(b, prop))
34483
- __defNormalProp$d(a, prop, b[prop]);
34516
+ if (__hasOwnProp$s.call(b, prop))
34517
+ __defNormalProp$i(a, prop, b[prop]);
34518
+ if (__getOwnPropSymbols$s)
34519
+ for (var prop of __getOwnPropSymbols$s(b)) {
34520
+ if (__propIsEnum$s.call(b, prop))
34521
+ __defNormalProp$i(a, prop, b[prop]);
34484
34522
  }
34485
34523
  return a;
34486
34524
  };
34487
- var __spreadProps$b = (a, b) => __defProps$b(a, __getOwnPropDescs$b(b));
34525
+ var __spreadProps$g = (a, b) => __defProps$g(a, __getOwnPropDescs$g(b));
34488
34526
  const streams = [];
34489
34527
  if (process.env.NODE_ENV === "production") {
34490
34528
  streams.push({
@@ -34493,7 +34531,7 @@ if (process.env.NODE_ENV === "production") {
34493
34531
  }
34494
34532
  const logger = E({
34495
34533
  name: "shipengine",
34496
- serializers: __spreadProps$b(__spreadValues$d({}, k), {
34534
+ serializers: __spreadProps$g(__spreadValues$i({}, k), {
34497
34535
  req: (req) => ({
34498
34536
  headers: req.headers,
34499
34537
  method: req.method,
@@ -34894,27 +34932,59 @@ const useGetServicesByCarrier = (carrierId) => {
34894
34932
  });
34895
34933
  };
34896
34934
 
34897
- const useListCarriers = () => {
34935
+ var __defProp$h = Object.defineProperty;
34936
+ var __defProps$f = Object.defineProperties;
34937
+ var __getOwnPropDescs$f = Object.getOwnPropertyDescriptors;
34938
+ var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
34939
+ var __hasOwnProp$r = Object.prototype.hasOwnProperty;
34940
+ var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
34941
+ var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
34942
+ var __spreadValues$h = (a, b) => {
34943
+ for (var prop in b || (b = {}))
34944
+ if (__hasOwnProp$r.call(b, prop))
34945
+ __defNormalProp$h(a, prop, b[prop]);
34946
+ if (__getOwnPropSymbols$r)
34947
+ for (var prop of __getOwnPropSymbols$r(b)) {
34948
+ if (__propIsEnum$r.call(b, prop))
34949
+ __defNormalProp$h(a, prop, b[prop]);
34950
+ }
34951
+ return a;
34952
+ };
34953
+ var __spreadProps$f = (a, b) => __defProps$f(a, __getOwnPropDescs$f(b));
34954
+ var __objRest$k = (source, exclude) => {
34955
+ var target = {};
34956
+ for (var prop in source)
34957
+ if (__hasOwnProp$r.call(source, prop) && exclude.indexOf(prop) < 0)
34958
+ target[prop] = source[prop];
34959
+ if (source != null && __getOwnPropSymbols$r)
34960
+ for (var prop of __getOwnPropSymbols$r(source)) {
34961
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$r.call(source, prop))
34962
+ target[prop] = source[prop];
34963
+ }
34964
+ return target;
34965
+ };
34966
+ const useListCarriers = (params) => {
34898
34967
  const { client } = useShipEngine();
34899
- return reactQuery.useQuery({
34968
+ const _a = __spreadValues$h({}, params), { queryFnParams } = _a, rest = __objRest$k(_a, ["queryFnParams"]);
34969
+ return reactQuery.useQuery(__spreadProps$f(__spreadValues$h({}, rest), {
34900
34970
  onError,
34901
- queryFn: () => client.carriers.list(),
34902
- queryKey: ["useListCarriers"],
34971
+ queryFn: () => client.carriers.list(queryFnParams),
34972
+ queryKey: ["useListCarriers", queryFnParams],
34903
34973
  select: (result) => result.data.carriers
34904
- });
34974
+ }));
34905
34975
  };
34906
34976
 
34907
- var __getOwnPropSymbols$n = Object.getOwnPropertySymbols;
34908
- var __hasOwnProp$n = Object.prototype.hasOwnProperty;
34909
- var __propIsEnum$n = Object.prototype.propertyIsEnumerable;
34910
- var __objRest$f = (source, exclude) => {
34977
+ var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
34978
+ var __hasOwnProp$q = Object.prototype.hasOwnProperty;
34979
+ var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
34980
+ var __objRest$j = (source, exclude) => {
34911
34981
  var target = {};
34912
34982
  for (var prop in source)
34913
- if (__hasOwnProp$n.call(source, prop) && exclude.indexOf(prop) < 0)
34983
+ if (__hasOwnProp$q.call(source, prop) && exclude.indexOf(prop) < 0)
34914
34984
  target[prop] = source[prop];
34915
- if (source != null && __getOwnPropSymbols$n)
34916
- for (var prop of __getOwnPropSymbols$n(source)) {
34917
- if (exclude.indexOf(prop) < 0 && __propIsEnum$n.call(source, prop))
34985
+ if (source != null && __getOwnPropSymbols$q)
34986
+ for (var prop of __getOwnPropSymbols$q(source)) {
34987
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$q.call(source, prop))
34918
34988
  target[prop] = source[prop];
34919
34989
  }
34920
34990
  return target;
@@ -34944,7 +35014,7 @@ const useUpdateAutoFunding = () => {
34944
35014
  const queryClient = reactQuery.useQueryClient();
34945
35015
  return reactQuery.useMutation({
34946
35016
  mutationFn: (_a) => __async$A(void 0, null, function* () {
34947
- var _b = _a, { carrierId } = _b, options = __objRest$f(_b, ["carrierId"]);
35017
+ var _b = _a, { carrierId } = _b, options = __objRest$j(_b, ["carrierId"]);
34948
35018
  const result = yield client.carriers.updateAutoFunding(carrierId, options);
34949
35019
  return result.data;
34950
35020
  }),
@@ -35005,24 +35075,24 @@ const useDeleteCarrier = () => {
35005
35075
  });
35006
35076
  };
35007
35077
 
35008
- var __getOwnPropSymbols$m = Object.getOwnPropertySymbols;
35009
- var __hasOwnProp$m = Object.prototype.hasOwnProperty;
35010
- var __propIsEnum$m = Object.prototype.propertyIsEnumerable;
35011
- var __objRest$e = (source, exclude) => {
35078
+ var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
35079
+ var __hasOwnProp$p = Object.prototype.hasOwnProperty;
35080
+ var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
35081
+ var __objRest$i = (source, exclude) => {
35012
35082
  var target = {};
35013
35083
  for (var prop in source)
35014
- if (__hasOwnProp$m.call(source, prop) && exclude.indexOf(prop) < 0)
35084
+ if (__hasOwnProp$p.call(source, prop) && exclude.indexOf(prop) < 0)
35015
35085
  target[prop] = source[prop];
35016
- if (source != null && __getOwnPropSymbols$m)
35017
- for (var prop of __getOwnPropSymbols$m(source)) {
35018
- if (exclude.indexOf(prop) < 0 && __propIsEnum$m.call(source, prop))
35086
+ if (source != null && __getOwnPropSymbols$p)
35087
+ for (var prop of __getOwnPropSymbols$p(source)) {
35088
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$p.call(source, prop))
35019
35089
  target[prop] = source[prop];
35020
35090
  }
35021
35091
  return target;
35022
35092
  };
35023
35093
  const useGetCarrierConnectionForm = (_params) => {
35024
35094
  const { client } = useShipEngine();
35025
- const _a = _params || {}, { carrierName, enabled = true } = _a, params = __objRest$e(_a, ["carrierName", "enabled"]);
35095
+ const _a = _params || {}, { carrierName, enabled = true } = _a, params = __objRest$i(_a, ["carrierName", "enabled"]);
35026
35096
  return reactQuery.useQuery({
35027
35097
  enabled,
35028
35098
  onError,
@@ -35032,24 +35102,24 @@ const useGetCarrierConnectionForm = (_params) => {
35032
35102
  });
35033
35103
  };
35034
35104
 
35035
- var __getOwnPropSymbols$l = Object.getOwnPropertySymbols;
35036
- var __hasOwnProp$l = Object.prototype.hasOwnProperty;
35037
- var __propIsEnum$l = Object.prototype.propertyIsEnumerable;
35038
- var __objRest$d = (source, exclude) => {
35105
+ var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
35106
+ var __hasOwnProp$o = Object.prototype.hasOwnProperty;
35107
+ var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
35108
+ var __objRest$h = (source, exclude) => {
35039
35109
  var target = {};
35040
35110
  for (var prop in source)
35041
- if (__hasOwnProp$l.call(source, prop) && exclude.indexOf(prop) < 0)
35111
+ if (__hasOwnProp$o.call(source, prop) && exclude.indexOf(prop) < 0)
35042
35112
  target[prop] = source[prop];
35043
- if (source != null && __getOwnPropSymbols$l)
35044
- for (var prop of __getOwnPropSymbols$l(source)) {
35045
- if (exclude.indexOf(prop) < 0 && __propIsEnum$l.call(source, prop))
35113
+ if (source != null && __getOwnPropSymbols$o)
35114
+ for (var prop of __getOwnPropSymbols$o(source)) {
35115
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$o.call(source, prop))
35046
35116
  target[prop] = source[prop];
35047
35117
  }
35048
35118
  return target;
35049
35119
  };
35050
35120
  const useListCarrierConnections = (_params) => {
35051
35121
  const { client } = useShipEngine();
35052
- const _a = _params || {}, { enabled = true } = _a, params = __objRest$d(_a, ["enabled"]);
35122
+ const _a = _params || {}, { enabled = true } = _a, params = __objRest$h(_a, ["enabled"]);
35053
35123
  return reactQuery.useQuery({
35054
35124
  enabled,
35055
35125
  onError,
@@ -35102,33 +35172,33 @@ const useCarrierConnectionsServicesList = (carrierCode) => {
35102
35172
  });
35103
35173
  };
35104
35174
 
35105
- var __defProp$c = Object.defineProperty;
35106
- var __defProps$a = Object.defineProperties;
35107
- var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
35108
- var __getOwnPropSymbols$k = Object.getOwnPropertySymbols;
35109
- var __hasOwnProp$k = Object.prototype.hasOwnProperty;
35110
- var __propIsEnum$k = Object.prototype.propertyIsEnumerable;
35111
- var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
35112
- var __spreadValues$c = (a, b) => {
35175
+ var __defProp$g = Object.defineProperty;
35176
+ var __defProps$e = Object.defineProperties;
35177
+ var __getOwnPropDescs$e = Object.getOwnPropertyDescriptors;
35178
+ var __getOwnPropSymbols$n = Object.getOwnPropertySymbols;
35179
+ var __hasOwnProp$n = Object.prototype.hasOwnProperty;
35180
+ var __propIsEnum$n = Object.prototype.propertyIsEnumerable;
35181
+ var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
35182
+ var __spreadValues$g = (a, b) => {
35113
35183
  for (var prop in b || (b = {}))
35114
- if (__hasOwnProp$k.call(b, prop))
35115
- __defNormalProp$c(a, prop, b[prop]);
35116
- if (__getOwnPropSymbols$k)
35117
- for (var prop of __getOwnPropSymbols$k(b)) {
35118
- if (__propIsEnum$k.call(b, prop))
35119
- __defNormalProp$c(a, prop, b[prop]);
35184
+ if (__hasOwnProp$n.call(b, prop))
35185
+ __defNormalProp$g(a, prop, b[prop]);
35186
+ if (__getOwnPropSymbols$n)
35187
+ for (var prop of __getOwnPropSymbols$n(b)) {
35188
+ if (__propIsEnum$n.call(b, prop))
35189
+ __defNormalProp$g(a, prop, b[prop]);
35120
35190
  }
35121
35191
  return a;
35122
35192
  };
35123
- var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
35124
- var __objRest$c = (source, exclude) => {
35193
+ var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
35194
+ var __objRest$g = (source, exclude) => {
35125
35195
  var target = {};
35126
35196
  for (var prop in source)
35127
- if (__hasOwnProp$k.call(source, prop) && exclude.indexOf(prop) < 0)
35197
+ if (__hasOwnProp$n.call(source, prop) && exclude.indexOf(prop) < 0)
35128
35198
  target[prop] = source[prop];
35129
- if (source != null && __getOwnPropSymbols$k)
35130
- for (var prop of __getOwnPropSymbols$k(source)) {
35131
- if (exclude.indexOf(prop) < 0 && __propIsEnum$k.call(source, prop))
35199
+ if (source != null && __getOwnPropSymbols$n)
35200
+ for (var prop of __getOwnPropSymbols$n(source)) {
35201
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$n.call(source, prop))
35132
35202
  target[prop] = source[prop];
35133
35203
  }
35134
35204
  return target;
@@ -35136,12 +35206,12 @@ var __objRest$c = (source, exclude) => {
35136
35206
  const useGetConnectionsCarrierSettings = (_a) => {
35137
35207
  var _b = _a, {
35138
35208
  queryFnParams
35139
- } = _b, params = __objRest$c(_b, [
35209
+ } = _b, params = __objRest$g(_b, [
35140
35210
  "queryFnParams"
35141
35211
  ]);
35142
35212
  const { client } = useShipEngine();
35143
35213
  const { carrierName, carrierCode } = queryFnParams;
35144
- return reactQuery.useQuery(__spreadProps$a(__spreadValues$c({}, params), {
35214
+ return reactQuery.useQuery(__spreadProps$e(__spreadValues$g({}, params), {
35145
35215
  onError,
35146
35216
  queryFn: () => client.connections.getCarrierSettings(carrierName, carrierCode),
35147
35217
  queryKey: ["useGetConnectionsCarrierSettings", carrierName, carrierCode],
@@ -35149,25 +35219,25 @@ const useGetConnectionsCarrierSettings = (_a) => {
35149
35219
  }));
35150
35220
  };
35151
35221
 
35152
- var __defProp$b = Object.defineProperty;
35153
- var __defProps$9 = Object.defineProperties;
35154
- var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
35155
- var __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
35156
- var __hasOwnProp$j = Object.prototype.hasOwnProperty;
35157
- var __propIsEnum$j = Object.prototype.propertyIsEnumerable;
35158
- var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
35159
- var __spreadValues$b = (a, b) => {
35222
+ var __defProp$f = Object.defineProperty;
35223
+ var __defProps$d = Object.defineProperties;
35224
+ var __getOwnPropDescs$d = Object.getOwnPropertyDescriptors;
35225
+ var __getOwnPropSymbols$m = Object.getOwnPropertySymbols;
35226
+ var __hasOwnProp$m = Object.prototype.hasOwnProperty;
35227
+ var __propIsEnum$m = Object.prototype.propertyIsEnumerable;
35228
+ var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
35229
+ var __spreadValues$f = (a, b) => {
35160
35230
  for (var prop in b || (b = {}))
35161
- if (__hasOwnProp$j.call(b, prop))
35162
- __defNormalProp$b(a, prop, b[prop]);
35163
- if (__getOwnPropSymbols$j)
35164
- for (var prop of __getOwnPropSymbols$j(b)) {
35165
- if (__propIsEnum$j.call(b, prop))
35166
- __defNormalProp$b(a, prop, b[prop]);
35231
+ if (__hasOwnProp$m.call(b, prop))
35232
+ __defNormalProp$f(a, prop, b[prop]);
35233
+ if (__getOwnPropSymbols$m)
35234
+ for (var prop of __getOwnPropSymbols$m(b)) {
35235
+ if (__propIsEnum$m.call(b, prop))
35236
+ __defNormalProp$f(a, prop, b[prop]);
35167
35237
  }
35168
35238
  return a;
35169
35239
  };
35170
- var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
35240
+ var __spreadProps$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(b));
35171
35241
  var __async$x = (__this, __arguments, generator) => {
35172
35242
  return new Promise((resolve, reject) => {
35173
35243
  var fulfilled = (value) => {
@@ -35190,7 +35260,7 @@ var __async$x = (__this, __arguments, generator) => {
35190
35260
  };
35191
35261
  const useUpdateConnectionsCarrierSettings = (params) => {
35192
35262
  const { client } = useShipEngine();
35193
- return reactQuery.useMutation(__spreadProps$9(__spreadValues$b({}, params), {
35263
+ return reactQuery.useMutation(__spreadProps$d(__spreadValues$f({}, params), {
35194
35264
  mutationFn: (_0) => __async$x(void 0, [_0], function* ({
35195
35265
  carrierName,
35196
35266
  carrierCode,
@@ -35421,17 +35491,17 @@ const useGetInsuranceAccount = (insuranceProvider) => {
35421
35491
  });
35422
35492
  };
35423
35493
 
35424
- var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
35425
- var __hasOwnProp$i = Object.prototype.hasOwnProperty;
35426
- var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
35427
- var __objRest$b = (source, exclude) => {
35494
+ var __getOwnPropSymbols$l = Object.getOwnPropertySymbols;
35495
+ var __hasOwnProp$l = Object.prototype.hasOwnProperty;
35496
+ var __propIsEnum$l = Object.prototype.propertyIsEnumerable;
35497
+ var __objRest$f = (source, exclude) => {
35428
35498
  var target = {};
35429
35499
  for (var prop in source)
35430
- if (__hasOwnProp$i.call(source, prop) && exclude.indexOf(prop) < 0)
35500
+ if (__hasOwnProp$l.call(source, prop) && exclude.indexOf(prop) < 0)
35431
35501
  target[prop] = source[prop];
35432
- if (source != null && __getOwnPropSymbols$i)
35433
- for (var prop of __getOwnPropSymbols$i(source)) {
35434
- if (exclude.indexOf(prop) < 0 && __propIsEnum$i.call(source, prop))
35502
+ if (source != null && __getOwnPropSymbols$l)
35503
+ for (var prop of __getOwnPropSymbols$l(source)) {
35504
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$l.call(source, prop))
35435
35505
  target[prop] = source[prop];
35436
35506
  }
35437
35507
  return target;
@@ -35460,7 +35530,7 @@ const useAddInsuranceFunds = () => {
35460
35530
  const { client } = useShipEngine();
35461
35531
  return reactQuery.useMutation({
35462
35532
  mutationFn: (_a) => __async$s(void 0, null, function* () {
35463
- var _b = _a, { insuranceProvider } = _b, rest = __objRest$b(_b, ["insuranceProvider"]);
35533
+ var _b = _a, { insuranceProvider } = _b, rest = __objRest$f(_b, ["insuranceProvider"]);
35464
35534
  const result = yield client.insurance.addFunds(insuranceProvider, rest);
35465
35535
  return result.data;
35466
35536
  }),
@@ -35469,17 +35539,17 @@ const useAddInsuranceFunds = () => {
35469
35539
  });
35470
35540
  };
35471
35541
 
35472
- var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
35473
- var __hasOwnProp$h = Object.prototype.hasOwnProperty;
35474
- var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
35475
- var __objRest$a = (source, exclude) => {
35476
- var target = {};
35477
- for (var prop in source)
35478
- if (__hasOwnProp$h.call(source, prop) && exclude.indexOf(prop) < 0)
35542
+ var __getOwnPropSymbols$k = Object.getOwnPropertySymbols;
35543
+ var __hasOwnProp$k = Object.prototype.hasOwnProperty;
35544
+ var __propIsEnum$k = Object.prototype.propertyIsEnumerable;
35545
+ var __objRest$e = (source, exclude) => {
35546
+ var target = {};
35547
+ for (var prop in source)
35548
+ if (__hasOwnProp$k.call(source, prop) && exclude.indexOf(prop) < 0)
35479
35549
  target[prop] = source[prop];
35480
- if (source != null && __getOwnPropSymbols$h)
35481
- for (var prop of __getOwnPropSymbols$h(source)) {
35482
- if (exclude.indexOf(prop) < 0 && __propIsEnum$h.call(source, prop))
35550
+ if (source != null && __getOwnPropSymbols$k)
35551
+ for (var prop of __getOwnPropSymbols$k(source)) {
35552
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$k.call(source, prop))
35483
35553
  target[prop] = source[prop];
35484
35554
  }
35485
35555
  return target;
@@ -35508,7 +35578,7 @@ const useCreateLabel = () => {
35508
35578
  const { client } = useShipEngine();
35509
35579
  return reactQuery.useMutation({
35510
35580
  mutationFn: (_a) => __async$r(void 0, null, function* () {
35511
- var _b = _a, { rateId } = _b, options = __objRest$a(_b, ["rateId"]);
35581
+ var _b = _a, { rateId } = _b, options = __objRest$e(_b, ["rateId"]);
35512
35582
  const result = yield client.labels.createByRateId(rateId, options);
35513
35583
  return result.data;
35514
35584
  }),
@@ -35532,31 +35602,46 @@ const useGetLabel = (labelId) => {
35532
35602
  });
35533
35603
  };
35534
35604
 
35535
- var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
35536
- var __hasOwnProp$g = Object.prototype.hasOwnProperty;
35537
- var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
35538
- var __objRest$9 = (source, exclude) => {
35605
+ var __defProp$e = Object.defineProperty;
35606
+ var __defProps$c = Object.defineProperties;
35607
+ var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
35608
+ var __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
35609
+ var __hasOwnProp$j = Object.prototype.hasOwnProperty;
35610
+ var __propIsEnum$j = Object.prototype.propertyIsEnumerable;
35611
+ var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
35612
+ var __spreadValues$e = (a, b) => {
35613
+ for (var prop in b || (b = {}))
35614
+ if (__hasOwnProp$j.call(b, prop))
35615
+ __defNormalProp$e(a, prop, b[prop]);
35616
+ if (__getOwnPropSymbols$j)
35617
+ for (var prop of __getOwnPropSymbols$j(b)) {
35618
+ if (__propIsEnum$j.call(b, prop))
35619
+ __defNormalProp$e(a, prop, b[prop]);
35620
+ }
35621
+ return a;
35622
+ };
35623
+ var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(b));
35624
+ var __objRest$d = (source, exclude) => {
35539
35625
  var target = {};
35540
35626
  for (var prop in source)
35541
- if (__hasOwnProp$g.call(source, prop) && exclude.indexOf(prop) < 0)
35627
+ if (__hasOwnProp$j.call(source, prop) && exclude.indexOf(prop) < 0)
35542
35628
  target[prop] = source[prop];
35543
- if (source != null && __getOwnPropSymbols$g)
35544
- for (var prop of __getOwnPropSymbols$g(source)) {
35545
- if (exclude.indexOf(prop) < 0 && __propIsEnum$g.call(source, prop))
35629
+ if (source != null && __getOwnPropSymbols$j)
35630
+ for (var prop of __getOwnPropSymbols$j(source)) {
35631
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$j.call(source, prop))
35546
35632
  target[prop] = source[prop];
35547
35633
  }
35548
35634
  return target;
35549
35635
  };
35550
- const useListLabels = (_params) => {
35636
+ const useListLabels = (params) => {
35551
35637
  const { client } = useShipEngine();
35552
- const _a = _params || {}, { enabled = true } = _a, params = __objRest$9(_a, ["enabled"]);
35553
- return reactQuery.useQuery({
35554
- enabled,
35638
+ const _a = params, { queryFnParams } = _a, rest = __objRest$d(_a, ["queryFnParams"]);
35639
+ return reactQuery.useQuery(__spreadProps$c(__spreadValues$e({}, rest), {
35555
35640
  onError,
35556
- queryFn: () => client.labels.list(params),
35641
+ queryFn: () => client.labels.list(queryFnParams),
35557
35642
  queryKey: ["useListLabels", params],
35558
35643
  select: (result) => result.data
35559
- });
35644
+ }));
35560
35645
  };
35561
35646
 
35562
35647
  var __async$q = (__this, __arguments, generator) => {
@@ -35970,17 +36055,17 @@ const useListSalesOrders = (params = {}) => {
35970
36055
  });
35971
36056
  };
35972
36057
 
35973
- var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
35974
- var __hasOwnProp$f = Object.prototype.hasOwnProperty;
35975
- var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
35976
- var __objRest$8 = (source, exclude) => {
36058
+ var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
36059
+ var __hasOwnProp$i = Object.prototype.hasOwnProperty;
36060
+ var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
36061
+ var __objRest$c = (source, exclude) => {
35977
36062
  var target = {};
35978
36063
  for (var prop in source)
35979
- if (__hasOwnProp$f.call(source, prop) && exclude.indexOf(prop) < 0)
36064
+ if (__hasOwnProp$i.call(source, prop) && exclude.indexOf(prop) < 0)
35980
36065
  target[prop] = source[prop];
35981
- if (source != null && __getOwnPropSymbols$f)
35982
- for (var prop of __getOwnPropSymbols$f(source)) {
35983
- if (exclude.indexOf(prop) < 0 && __propIsEnum$f.call(source, prop))
36066
+ if (source != null && __getOwnPropSymbols$i)
36067
+ for (var prop of __getOwnPropSymbols$i(source)) {
36068
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$i.call(source, prop))
35984
36069
  target[prop] = source[prop];
35985
36070
  }
35986
36071
  return target;
@@ -36009,7 +36094,7 @@ const useNotifySalesOrderShipped = () => {
36009
36094
  const { client } = useShipEngine();
36010
36095
  return reactQuery.useMutation({
36011
36096
  mutationFn: (_a) => __async$g(void 0, null, function* () {
36012
- var _b = _a, { salesOrderId } = _b, tracking = __objRest$8(_b, ["salesOrderId"]);
36097
+ var _b = _a, { salesOrderId } = _b, tracking = __objRest$c(_b, ["salesOrderId"]);
36013
36098
  const result = yield client.salesOrders.notifyShipped(salesOrderId, tracking);
36014
36099
  return result.data;
36015
36100
  }),
@@ -36018,17 +36103,17 @@ const useNotifySalesOrderShipped = () => {
36018
36103
  });
36019
36104
  };
36020
36105
 
36021
- var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
36022
- var __hasOwnProp$e = Object.prototype.hasOwnProperty;
36023
- var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
36024
- var __objRest$7 = (source, exclude) => {
36106
+ var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
36107
+ var __hasOwnProp$h = Object.prototype.hasOwnProperty;
36108
+ var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
36109
+ var __objRest$b = (source, exclude) => {
36025
36110
  var target = {};
36026
36111
  for (var prop in source)
36027
- if (__hasOwnProp$e.call(source, prop) && exclude.indexOf(prop) < 0)
36112
+ if (__hasOwnProp$h.call(source, prop) && exclude.indexOf(prop) < 0)
36028
36113
  target[prop] = source[prop];
36029
- if (source != null && __getOwnPropSymbols$e)
36030
- for (var prop of __getOwnPropSymbols$e(source)) {
36031
- if (exclude.indexOf(prop) < 0 && __propIsEnum$e.call(source, prop))
36114
+ if (source != null && __getOwnPropSymbols$h)
36115
+ for (var prop of __getOwnPropSymbols$h(source)) {
36116
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$h.call(source, prop))
36032
36117
  target[prop] = source[prop];
36033
36118
  }
36034
36119
  return target;
@@ -36057,7 +36142,7 @@ const useCreateSalesOrderShipment = () => {
36057
36142
  const { client } = useShipEngine();
36058
36143
  return reactQuery.useMutation({
36059
36144
  mutationFn: (_a) => __async$f(void 0, null, function* () {
36060
- var _b = _a, { salesOrderId } = _b, shipment = __objRest$7(_b, ["salesOrderId"]);
36145
+ var _b = _a, { salesOrderId } = _b, shipment = __objRest$b(_b, ["salesOrderId"]);
36061
36146
  const result = yield client.salesOrderShipments.create(salesOrderId, shipment);
36062
36147
  return result.data;
36063
36148
  }),
@@ -36092,17 +36177,17 @@ const useListSalesOrderShipments = (params) => {
36092
36177
  });
36093
36178
  };
36094
36179
 
36095
- var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
36096
- var __hasOwnProp$d = Object.prototype.hasOwnProperty;
36097
- var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
36098
- var __objRest$6 = (source, exclude) => {
36180
+ var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
36181
+ var __hasOwnProp$g = Object.prototype.hasOwnProperty;
36182
+ var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
36183
+ var __objRest$a = (source, exclude) => {
36099
36184
  var target = {};
36100
36185
  for (var prop in source)
36101
- if (__hasOwnProp$d.call(source, prop) && exclude.indexOf(prop) < 0)
36186
+ if (__hasOwnProp$g.call(source, prop) && exclude.indexOf(prop) < 0)
36102
36187
  target[prop] = source[prop];
36103
- if (source != null && __getOwnPropSymbols$d)
36104
- for (var prop of __getOwnPropSymbols$d(source)) {
36105
- if (exclude.indexOf(prop) < 0 && __propIsEnum$d.call(source, prop))
36188
+ if (source != null && __getOwnPropSymbols$g)
36189
+ for (var prop of __getOwnPropSymbols$g(source)) {
36190
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$g.call(source, prop))
36106
36191
  target[prop] = source[prop];
36107
36192
  }
36108
36193
  return target;
@@ -36131,7 +36216,7 @@ const useUpdateSalesOrderShipment = () => {
36131
36216
  const { client } = useShipEngine();
36132
36217
  return reactQuery.useMutation({
36133
36218
  mutationFn: (_a) => __async$e(void 0, null, function* () {
36134
- var _b = _a, { shipmentId } = _b, shipment = __objRest$6(_b, ["shipmentId"]);
36219
+ var _b = _a, { shipmentId } = _b, shipment = __objRest$a(_b, ["shipmentId"]);
36135
36220
  const result = yield client.salesOrderShipments.update(shipmentId, shipment);
36136
36221
  return result.data;
36137
36222
  }),
@@ -36140,25 +36225,25 @@ const useUpdateSalesOrderShipment = () => {
36140
36225
  });
36141
36226
  };
36142
36227
 
36143
- var __defProp$a = Object.defineProperty;
36144
- var __defProps$8 = Object.defineProperties;
36145
- var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
36146
- var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
36147
- var __hasOwnProp$c = Object.prototype.hasOwnProperty;
36148
- var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
36149
- var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
36150
- var __spreadValues$a = (a, b) => {
36228
+ var __defProp$d = Object.defineProperty;
36229
+ var __defProps$b = Object.defineProperties;
36230
+ var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
36231
+ var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
36232
+ var __hasOwnProp$f = Object.prototype.hasOwnProperty;
36233
+ var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
36234
+ var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
36235
+ var __spreadValues$d = (a, b) => {
36151
36236
  for (var prop in b || (b = {}))
36152
- if (__hasOwnProp$c.call(b, prop))
36153
- __defNormalProp$a(a, prop, b[prop]);
36154
- if (__getOwnPropSymbols$c)
36155
- for (var prop of __getOwnPropSymbols$c(b)) {
36156
- if (__propIsEnum$c.call(b, prop))
36157
- __defNormalProp$a(a, prop, b[prop]);
36237
+ if (__hasOwnProp$f.call(b, prop))
36238
+ __defNormalProp$d(a, prop, b[prop]);
36239
+ if (__getOwnPropSymbols$f)
36240
+ for (var prop of __getOwnPropSymbols$f(b)) {
36241
+ if (__propIsEnum$f.call(b, prop))
36242
+ __defNormalProp$d(a, prop, b[prop]);
36158
36243
  }
36159
36244
  return a;
36160
36245
  };
36161
- var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
36246
+ var __spreadProps$b = (a, b) => __defProps$b(a, __getOwnPropDescs$b(b));
36162
36247
  var __async$d = (__this, __arguments, generator) => {
36163
36248
  return new Promise((resolve, reject) => {
36164
36249
  var fulfilled = (value) => {
@@ -36200,7 +36285,7 @@ const useCreateShipment = () => {
36200
36285
  postalCode: "",
36201
36286
  stateProvince: ""
36202
36287
  };
36203
- return (yield client.shipments.create(__spreadProps$8(__spreadValues$a({}, shipment), {
36288
+ return (yield client.shipments.create(__spreadProps$b(__spreadValues$d({}, shipment), {
36204
36289
  shipTo
36205
36290
  }))).data;
36206
36291
  }),
@@ -36225,33 +36310,33 @@ const useGetShipmentRates = (shipmentId, createdAtStart) => {
36225
36310
  });
36226
36311
  };
36227
36312
 
36228
- var __defProp$9 = Object.defineProperty;
36229
- var __defProps$7 = Object.defineProperties;
36230
- var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
36231
- var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
36232
- var __hasOwnProp$b = Object.prototype.hasOwnProperty;
36233
- var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
36234
- var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
36235
- var __spreadValues$9 = (a, b) => {
36313
+ var __defProp$c = Object.defineProperty;
36314
+ var __defProps$a = Object.defineProperties;
36315
+ var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
36316
+ var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
36317
+ var __hasOwnProp$e = Object.prototype.hasOwnProperty;
36318
+ var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
36319
+ var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
36320
+ var __spreadValues$c = (a, b) => {
36236
36321
  for (var prop in b || (b = {}))
36237
- if (__hasOwnProp$b.call(b, prop))
36238
- __defNormalProp$9(a, prop, b[prop]);
36239
- if (__getOwnPropSymbols$b)
36240
- for (var prop of __getOwnPropSymbols$b(b)) {
36241
- if (__propIsEnum$b.call(b, prop))
36242
- __defNormalProp$9(a, prop, b[prop]);
36322
+ if (__hasOwnProp$e.call(b, prop))
36323
+ __defNormalProp$c(a, prop, b[prop]);
36324
+ if (__getOwnPropSymbols$e)
36325
+ for (var prop of __getOwnPropSymbols$e(b)) {
36326
+ if (__propIsEnum$e.call(b, prop))
36327
+ __defNormalProp$c(a, prop, b[prop]);
36243
36328
  }
36244
36329
  return a;
36245
36330
  };
36246
- var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
36247
- var __objRest$5 = (source, exclude) => {
36331
+ var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
36332
+ var __objRest$9 = (source, exclude) => {
36248
36333
  var target = {};
36249
36334
  for (var prop in source)
36250
- if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
36335
+ if (__hasOwnProp$e.call(source, prop) && exclude.indexOf(prop) < 0)
36251
36336
  target[prop] = source[prop];
36252
- if (source != null && __getOwnPropSymbols$b)
36253
- for (var prop of __getOwnPropSymbols$b(source)) {
36254
- if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
36337
+ if (source != null && __getOwnPropSymbols$e)
36338
+ for (var prop of __getOwnPropSymbols$e(source)) {
36339
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$e.call(source, prop))
36255
36340
  target[prop] = source[prop];
36256
36341
  }
36257
36342
  return target;
@@ -36262,12 +36347,12 @@ const useGetShipment = (params) => {
36262
36347
  const shipmentId = typeof params === "string" ? params : (_a = params == null ? void 0 : params.queryFnParams) == null ? void 0 : _a.shipmentId;
36263
36348
  const getQueryProps = () => {
36264
36349
  if (typeof params !== "string") {
36265
- const _a2 = params, rest = __objRest$5(_a2, ["queryFnParams"]);
36350
+ const _a2 = params, rest = __objRest$9(_a2, ["queryFnParams"]);
36266
36351
  return rest;
36267
36352
  }
36268
36353
  return {};
36269
36354
  };
36270
- return reactQuery.useQuery(__spreadProps$7(__spreadValues$9({}, getQueryProps()), {
36355
+ return reactQuery.useQuery(__spreadProps$a(__spreadValues$c({}, getQueryProps()), {
36271
36356
  enabled: shipmentId !== void 0,
36272
36357
  onError,
36273
36358
  queryFn: () => {
@@ -36281,23 +36366,23 @@ const useGetShipment = (params) => {
36281
36366
  }));
36282
36367
  };
36283
36368
 
36284
- var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
36285
- var __hasOwnProp$a = Object.prototype.hasOwnProperty;
36286
- var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
36287
- var __objRest$4 = (source, exclude) => {
36369
+ var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
36370
+ var __hasOwnProp$d = Object.prototype.hasOwnProperty;
36371
+ var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
36372
+ var __objRest$8 = (source, exclude) => {
36288
36373
  var target = {};
36289
36374
  for (var prop in source)
36290
- if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
36375
+ if (__hasOwnProp$d.call(source, prop) && exclude.indexOf(prop) < 0)
36291
36376
  target[prop] = source[prop];
36292
- if (source != null && __getOwnPropSymbols$a)
36293
- for (var prop of __getOwnPropSymbols$a(source)) {
36294
- if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
36377
+ if (source != null && __getOwnPropSymbols$d)
36378
+ for (var prop of __getOwnPropSymbols$d(source)) {
36379
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$d.call(source, prop))
36295
36380
  target[prop] = source[prop];
36296
36381
  }
36297
36382
  return target;
36298
36383
  };
36299
36384
  const useListShipments = (_params) => {
36300
- const _a = _params || {}, { enabled = true } = _a, params = __objRest$4(_a, ["enabled"]);
36385
+ const _a = _params || {}, { enabled = true } = _a, params = __objRest$8(_a, ["enabled"]);
36301
36386
  const { client } = useShipEngine();
36302
36387
  return reactQuery.useQuery({
36303
36388
  enabled,
@@ -36308,41 +36393,41 @@ const useListShipments = (_params) => {
36308
36393
  });
36309
36394
  };
36310
36395
 
36311
- var __defProp$8 = Object.defineProperty;
36312
- var __defProps$6 = Object.defineProperties;
36313
- var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
36314
- var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
36315
- var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
36316
- var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
36317
- var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
36318
- var __spreadValues$8 = (a, b) => {
36396
+ var __defProp$b = Object.defineProperty;
36397
+ var __defProps$9 = Object.defineProperties;
36398
+ var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
36399
+ var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
36400
+ var __hasOwnProp$c = Object.prototype.hasOwnProperty;
36401
+ var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
36402
+ var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
36403
+ var __spreadValues$b = (a, b) => {
36319
36404
  for (var prop in b || (b = {}))
36320
- if (__hasOwnProp$9.call(b, prop))
36321
- __defNormalProp$8(a, prop, b[prop]);
36322
- if (__getOwnPropSymbols$9)
36323
- for (var prop of __getOwnPropSymbols$9(b)) {
36324
- if (__propIsEnum$9.call(b, prop))
36325
- __defNormalProp$8(a, prop, b[prop]);
36405
+ if (__hasOwnProp$c.call(b, prop))
36406
+ __defNormalProp$b(a, prop, b[prop]);
36407
+ if (__getOwnPropSymbols$c)
36408
+ for (var prop of __getOwnPropSymbols$c(b)) {
36409
+ if (__propIsEnum$c.call(b, prop))
36410
+ __defNormalProp$b(a, prop, b[prop]);
36326
36411
  }
36327
36412
  return a;
36328
36413
  };
36329
- var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
36330
- var __objRest$3 = (source, exclude) => {
36414
+ var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
36415
+ var __objRest$7 = (source, exclude) => {
36331
36416
  var target = {};
36332
36417
  for (var prop in source)
36333
- if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
36418
+ if (__hasOwnProp$c.call(source, prop) && exclude.indexOf(prop) < 0)
36334
36419
  target[prop] = source[prop];
36335
- if (source != null && __getOwnPropSymbols$9)
36336
- for (var prop of __getOwnPropSymbols$9(source)) {
36337
- if (exclude.indexOf(prop) < 0 && __propIsEnum$9.call(source, prop))
36420
+ if (source != null && __getOwnPropSymbols$c)
36421
+ for (var prop of __getOwnPropSymbols$c(source)) {
36422
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$c.call(source, prop))
36338
36423
  target[prop] = source[prop];
36339
36424
  }
36340
36425
  return target;
36341
36426
  };
36342
36427
  const useGetShipmentByExternalId = (params) => {
36343
36428
  const { client } = useShipEngine();
36344
- const _a = params, { queryFnParams } = _a, rest = __objRest$3(_a, ["queryFnParams"]);
36345
- return reactQuery.useQuery(__spreadProps$6(__spreadValues$8({}, rest), {
36429
+ const _a = params, { queryFnParams } = _a, rest = __objRest$7(_a, ["queryFnParams"]);
36430
+ return reactQuery.useQuery(__spreadProps$9(__spreadValues$b({}, rest), {
36346
36431
  onError,
36347
36432
  queryFn: () => client.shipments.getByExternalId(queryFnParams.externalId),
36348
36433
  queryKey: ["useGetShipmentByExternalId", queryFnParams],
@@ -36350,33 +36435,46 @@ const useGetShipmentByExternalId = (params) => {
36350
36435
  }));
36351
36436
  };
36352
36437
 
36353
- var __defProp$7 = Object.defineProperty;
36354
- var __defProps$5 = Object.defineProperties;
36355
- var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
36356
- var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
36357
- var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
36358
- var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
36359
- var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
36360
- var __spreadValues$7 = (a, b) => {
36438
+ var __defProp$a = Object.defineProperty;
36439
+ var __defProps$8 = Object.defineProperties;
36440
+ var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
36441
+ var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
36442
+ var __hasOwnProp$b = Object.prototype.hasOwnProperty;
36443
+ var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
36444
+ var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
36445
+ var __spreadValues$a = (a, b) => {
36361
36446
  for (var prop in b || (b = {}))
36362
- if (__hasOwnProp$8.call(b, prop))
36363
- __defNormalProp$7(a, prop, b[prop]);
36364
- if (__getOwnPropSymbols$8)
36365
- for (var prop of __getOwnPropSymbols$8(b)) {
36366
- if (__propIsEnum$8.call(b, prop))
36367
- __defNormalProp$7(a, prop, b[prop]);
36447
+ if (__hasOwnProp$b.call(b, prop))
36448
+ __defNormalProp$a(a, prop, b[prop]);
36449
+ if (__getOwnPropSymbols$b)
36450
+ for (var prop of __getOwnPropSymbols$b(b)) {
36451
+ if (__propIsEnum$b.call(b, prop))
36452
+ __defNormalProp$a(a, prop, b[prop]);
36368
36453
  }
36369
36454
  return a;
36370
36455
  };
36371
- var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
36456
+ var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
36457
+ var __objRest$6 = (source, exclude) => {
36458
+ var target = {};
36459
+ for (var prop in source)
36460
+ if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
36461
+ target[prop] = source[prop];
36462
+ if (source != null && __getOwnPropSymbols$b)
36463
+ for (var prop of __getOwnPropSymbols$b(source)) {
36464
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
36465
+ target[prop] = source[prop];
36466
+ }
36467
+ return target;
36468
+ };
36372
36469
  const useListShippingRules = (params) => {
36373
36470
  const { client } = useShipEngine();
36374
- return reactQuery.useQuery(__spreadProps$5(__spreadValues$7({}, params), {
36471
+ const _a = __spreadValues$a({}, params), { queryFnParams } = _a, rest = __objRest$6(_a, ["queryFnParams"]);
36472
+ return reactQuery.useQuery(__spreadProps$8(__spreadValues$a({}, rest), {
36375
36473
  onError,
36376
36474
  queryFn: () => {
36377
- return client.shippingRules.list();
36475
+ return client.shippingRules.list(queryFnParams);
36378
36476
  },
36379
- queryKey: ["useListShippingRules"],
36477
+ queryKey: ["useListShippingRules", queryFnParams],
36380
36478
  select: (result) => result.data.shippingRules
36381
36479
  }));
36382
36480
  };
@@ -36404,8 +36502,8 @@ var __async$c = (__this, __arguments, generator) => {
36404
36502
  const useCreateShippingRule = () => {
36405
36503
  const { client } = useShipEngine();
36406
36504
  return reactQuery.useMutation({
36407
- mutationFn: (shippingRule) => __async$c(void 0, null, function* () {
36408
- const result = yield client.shippingRules.create(shippingRule);
36505
+ mutationFn: (props) => __async$c(void 0, null, function* () {
36506
+ const result = yield client.shippingRules.create(props);
36409
36507
  return result.data;
36410
36508
  }),
36411
36509
  mutationKey: ["useCreateShippingRule"],
@@ -36436,8 +36534,8 @@ var __async$b = (__this, __arguments, generator) => {
36436
36534
  const useDeleteShippingRule = () => {
36437
36535
  const { client } = useShipEngine();
36438
36536
  return reactQuery.useMutation({
36439
- mutationFn: (shippingRuleId) => __async$b(void 0, null, function* () {
36440
- const result = yield client.shippingRules.delete(shippingRuleId);
36537
+ mutationFn: (props) => __async$b(void 0, null, function* () {
36538
+ const result = yield client.shippingRules.delete(props);
36441
36539
  return result.data;
36442
36540
  }),
36443
36541
  mutationKey: ["useDeleteShippingRule"],
@@ -36468,8 +36566,8 @@ var __async$a = (__this, __arguments, generator) => {
36468
36566
  const useEditShippingRule = () => {
36469
36567
  const { client } = useShipEngine();
36470
36568
  return reactQuery.useMutation({
36471
- mutationFn: (shippingRule) => __async$a(void 0, null, function* () {
36472
- const result = yield client.shippingRules.edit(shippingRule);
36569
+ mutationFn: (props) => __async$a(void 0, null, function* () {
36570
+ const result = yield client.shippingRules.edit(props);
36473
36571
  return result.data;
36474
36572
  }),
36475
36573
  mutationKey: ["useEditShippingRule"],
@@ -36477,29 +36575,92 @@ const useEditShippingRule = () => {
36477
36575
  });
36478
36576
  };
36479
36577
 
36480
- const useGetShippingRuleConditionsOptions = () => {
36578
+ var __defProp$9 = Object.defineProperty;
36579
+ var __defProps$7 = Object.defineProperties;
36580
+ var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
36581
+ var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
36582
+ var __hasOwnProp$a = Object.prototype.hasOwnProperty;
36583
+ var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
36584
+ var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
36585
+ var __spreadValues$9 = (a, b) => {
36586
+ for (var prop in b || (b = {}))
36587
+ if (__hasOwnProp$a.call(b, prop))
36588
+ __defNormalProp$9(a, prop, b[prop]);
36589
+ if (__getOwnPropSymbols$a)
36590
+ for (var prop of __getOwnPropSymbols$a(b)) {
36591
+ if (__propIsEnum$a.call(b, prop))
36592
+ __defNormalProp$9(a, prop, b[prop]);
36593
+ }
36594
+ return a;
36595
+ };
36596
+ var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
36597
+ var __objRest$5 = (source, exclude) => {
36598
+ var target = {};
36599
+ for (var prop in source)
36600
+ if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
36601
+ target[prop] = source[prop];
36602
+ if (source != null && __getOwnPropSymbols$a)
36603
+ for (var prop of __getOwnPropSymbols$a(source)) {
36604
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
36605
+ target[prop] = source[prop];
36606
+ }
36607
+ return target;
36608
+ };
36609
+ const useGetShippingRuleConditionsOptions = (params) => {
36481
36610
  const { client } = useShipEngine();
36482
- return reactQuery.useQuery({
36611
+ const _a = __spreadValues$9({}, params), { queryFnParams } = _a, rest = __objRest$5(_a, ["queryFnParams"]);
36612
+ return reactQuery.useQuery(__spreadProps$7(__spreadValues$9({}, rest), {
36483
36613
  onError,
36484
36614
  queryFn: () => {
36485
- return client.shippingRules.getConditionOptions();
36615
+ return client.shippingRules.getConditionOptions(queryFnParams);
36486
36616
  },
36487
- queryKey: ["useGetShippingRuleConditionsOptions"],
36617
+ queryKey: ["useGetShippingRuleConditionsOptions", queryFnParams],
36488
36618
  select: (result) => result.data
36489
- });
36619
+ }));
36490
36620
  };
36491
36621
 
36492
- const useGetShippingRuleById = (shippingRuleId) => {
36622
+ var __defProp$8 = Object.defineProperty;
36623
+ var __defProps$6 = Object.defineProperties;
36624
+ var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
36625
+ var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
36626
+ var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
36627
+ var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
36628
+ var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
36629
+ var __spreadValues$8 = (a, b) => {
36630
+ for (var prop in b || (b = {}))
36631
+ if (__hasOwnProp$9.call(b, prop))
36632
+ __defNormalProp$8(a, prop, b[prop]);
36633
+ if (__getOwnPropSymbols$9)
36634
+ for (var prop of __getOwnPropSymbols$9(b)) {
36635
+ if (__propIsEnum$9.call(b, prop))
36636
+ __defNormalProp$8(a, prop, b[prop]);
36637
+ }
36638
+ return a;
36639
+ };
36640
+ var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
36641
+ var __objRest$4 = (source, exclude) => {
36642
+ var target = {};
36643
+ for (var prop in source)
36644
+ if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
36645
+ target[prop] = source[prop];
36646
+ if (source != null && __getOwnPropSymbols$9)
36647
+ for (var prop of __getOwnPropSymbols$9(source)) {
36648
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$9.call(source, prop))
36649
+ target[prop] = source[prop];
36650
+ }
36651
+ return target;
36652
+ };
36653
+ const useGetShippingRuleById = (params) => {
36493
36654
  const { client } = useShipEngine();
36494
- return reactQuery.useQuery({
36495
- enabled: !!shippingRuleId,
36655
+ const _a = __spreadValues$8({}, params), { queryFnParams } = _a, rest = __objRest$4(_a, ["queryFnParams"]);
36656
+ return reactQuery.useQuery(__spreadProps$6(__spreadValues$8({}, rest), {
36496
36657
  onError,
36497
36658
  queryFn: () => {
36498
- return client.shippingRules.get(shippingRuleId);
36659
+ return client.shippingRules.get(queryFnParams);
36499
36660
  },
36500
- queryKey: ["useGetShippingRuleById", shippingRuleId],
36661
+ queryKey: ["useGetShippingRuleById", queryFnParams],
36501
36662
  select: (result) => result.data
36502
- });
36663
+ }));
36503
36664
  };
36504
36665
 
36505
36666
  const useGetThemeById = (themeId) => {
@@ -36581,16 +36742,46 @@ const useDeleteWarehouse = () => {
36581
36742
  });
36582
36743
  };
36583
36744
 
36584
- const useListWarehouses = (options) => {
36585
- var _a;
36745
+ var __defProp$7 = Object.defineProperty;
36746
+ var __defProps$5 = Object.defineProperties;
36747
+ var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
36748
+ var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
36749
+ var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
36750
+ var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
36751
+ var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
36752
+ var __spreadValues$7 = (a, b) => {
36753
+ for (var prop in b || (b = {}))
36754
+ if (__hasOwnProp$8.call(b, prop))
36755
+ __defNormalProp$7(a, prop, b[prop]);
36756
+ if (__getOwnPropSymbols$8)
36757
+ for (var prop of __getOwnPropSymbols$8(b)) {
36758
+ if (__propIsEnum$8.call(b, prop))
36759
+ __defNormalProp$7(a, prop, b[prop]);
36760
+ }
36761
+ return a;
36762
+ };
36763
+ var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
36764
+ var __objRest$3 = (source, exclude) => {
36765
+ var target = {};
36766
+ for (var prop in source)
36767
+ if (__hasOwnProp$8.call(source, prop) && exclude.indexOf(prop) < 0)
36768
+ target[prop] = source[prop];
36769
+ if (source != null && __getOwnPropSymbols$8)
36770
+ for (var prop of __getOwnPropSymbols$8(source)) {
36771
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$8.call(source, prop))
36772
+ target[prop] = source[prop];
36773
+ }
36774
+ return target;
36775
+ };
36776
+ const useListWarehouses = (params) => {
36586
36777
  const { client } = useShipEngine();
36587
- return reactQuery.useQuery({
36588
- enabled: (_a = options == null ? void 0 : options.enabled) != null ? _a : true,
36778
+ const _a = __spreadValues$7({}, params), { queryFnParams } = _a, rest = __objRest$3(_a, ["queryFnParams"]);
36779
+ return reactQuery.useQuery(__spreadProps$5(__spreadValues$7({}, rest), {
36589
36780
  onError,
36590
- queryFn: () => client.warehouses.list(),
36591
- queryKey: ["useListWarehouses"],
36781
+ queryFn: () => client.warehouses.list(queryFnParams),
36782
+ queryKey: ["useListWarehouses", queryFnParams],
36592
36783
  select: (result) => result.data.warehouses
36593
- });
36784
+ }));
36594
36785
  };
36595
36786
 
36596
36787
  var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
@@ -37438,6 +37629,7 @@ const AlchemyProvider = ({
37438
37629
  cdnURL = "https://cdn.packlink.com",
37439
37630
  container,
37440
37631
  children,
37632
+ getSandboxToken,
37441
37633
  getToken,
37442
37634
  locale: localeProp,
37443
37635
  onError = _default,
@@ -37472,6 +37664,7 @@ const AlchemyProvider = ({
37472
37664
  {
37473
37665
  baseURL,
37474
37666
  headers,
37667
+ getSandboxToken,
37475
37668
  getToken,
37476
37669
  onApiError,
37477
37670
  defaultQueryClientOptions,