@shipengine/alchemy 5.4.26 → 6.0.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.
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$m = Object.defineProperty;
13732
+ var __defProps$h = Object.defineProperties;
13733
+ var __getOwnPropDescs$h = 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$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13738
+ var __spreadValues$m = (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$m(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$m(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$h = (a, b) => __defProps$h(a, __getOwnPropDescs$h(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$h(__spreadValues$m({}, 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$l = 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$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16195
+ var __spreadValues$l = (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$l(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$l(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$l({
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$l({
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$k = 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$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16492
+ var __spreadValues$k = (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$k(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$k(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$k({}, 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$j = 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$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16624
+ var __spreadValues$j = (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$j(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$j(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$j({}, 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$i = Object.defineProperty;
34092
+ var __defProps$g = Object.defineProperties;
34093
+ var __getOwnPropDescs$g = 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$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
34098
+ var __spreadValues$i = (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$i(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$i(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$g = (a, b) => __defProps$g(a, __getOwnPropDescs$g(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$g(__spreadValues$i({}, 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$g(__spreadValues$i({}, 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$h = Object.defineProperty;
34508
+ var __defProps$f = Object.defineProperties;
34509
+ var __getOwnPropDescs$f = 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$h = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
34514
+ var __spreadValues$h = (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$h(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$h(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$f = (a, b) => __defProps$f(a, __getOwnPropDescs$f(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$f(__spreadValues$h({}, 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$g = Object.defineProperty;
34936
+ var __defProps$e = Object.defineProperties;
34937
+ var __getOwnPropDescs$e = 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$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
34942
+ var __spreadValues$g = (a, b) => {
34943
+ for (var prop in b || (b = {}))
34944
+ if (__hasOwnProp$r.call(b, prop))
34945
+ __defNormalProp$g(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$g(a, prop, b[prop]);
34950
+ }
34951
+ return a;
34952
+ };
34953
+ var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(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$g({}, params), { queryFnParams } = _a, rest = __objRest$k(_a, ["queryFnParams"]);
34969
+ return reactQuery.useQuery(__spreadProps$e(__spreadValues$g({}, 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$f = Object.defineProperty;
35176
+ var __defProps$d = Object.defineProperties;
35177
+ var __getOwnPropDescs$d = 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$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
35182
+ var __spreadValues$f = (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$f(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$f(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$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(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$d(__spreadValues$f({}, 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$e = Object.defineProperty;
35223
+ var __defProps$c = Object.defineProperties;
35224
+ var __getOwnPropDescs$c = 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$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
35229
+ var __spreadValues$e = (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$e(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$e(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$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(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$c(__spreadValues$e({}, 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) => {
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) => {
35476
35546
  var target = {};
35477
35547
  for (var prop in source)
35478
- if (__hasOwnProp$h.call(source, prop) && exclude.indexOf(prop) < 0)
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,24 +35602,24 @@ 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 __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
35606
+ var __hasOwnProp$j = Object.prototype.hasOwnProperty;
35607
+ var __propIsEnum$j = Object.prototype.propertyIsEnumerable;
35608
+ var __objRest$d = (source, exclude) => {
35539
35609
  var target = {};
35540
35610
  for (var prop in source)
35541
- if (__hasOwnProp$g.call(source, prop) && exclude.indexOf(prop) < 0)
35611
+ if (__hasOwnProp$j.call(source, prop) && exclude.indexOf(prop) < 0)
35542
35612
  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))
35613
+ if (source != null && __getOwnPropSymbols$j)
35614
+ for (var prop of __getOwnPropSymbols$j(source)) {
35615
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$j.call(source, prop))
35546
35616
  target[prop] = source[prop];
35547
35617
  }
35548
35618
  return target;
35549
35619
  };
35550
35620
  const useListLabels = (_params) => {
35551
35621
  const { client } = useShipEngine();
35552
- const _a = _params || {}, { enabled = true } = _a, params = __objRest$9(_a, ["enabled"]);
35622
+ const _a = _params || {}, { enabled = true } = _a, params = __objRest$d(_a, ["enabled"]);
35553
35623
  return reactQuery.useQuery({
35554
35624
  enabled,
35555
35625
  onError,
@@ -35970,17 +36040,17 @@ const useListSalesOrders = (params = {}) => {
35970
36040
  });
35971
36041
  };
35972
36042
 
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) => {
36043
+ var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
36044
+ var __hasOwnProp$i = Object.prototype.hasOwnProperty;
36045
+ var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
36046
+ var __objRest$c = (source, exclude) => {
35977
36047
  var target = {};
35978
36048
  for (var prop in source)
35979
- if (__hasOwnProp$f.call(source, prop) && exclude.indexOf(prop) < 0)
36049
+ if (__hasOwnProp$i.call(source, prop) && exclude.indexOf(prop) < 0)
35980
36050
  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))
36051
+ if (source != null && __getOwnPropSymbols$i)
36052
+ for (var prop of __getOwnPropSymbols$i(source)) {
36053
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$i.call(source, prop))
35984
36054
  target[prop] = source[prop];
35985
36055
  }
35986
36056
  return target;
@@ -36009,7 +36079,7 @@ const useNotifySalesOrderShipped = () => {
36009
36079
  const { client } = useShipEngine();
36010
36080
  return reactQuery.useMutation({
36011
36081
  mutationFn: (_a) => __async$g(void 0, null, function* () {
36012
- var _b = _a, { salesOrderId } = _b, tracking = __objRest$8(_b, ["salesOrderId"]);
36082
+ var _b = _a, { salesOrderId } = _b, tracking = __objRest$c(_b, ["salesOrderId"]);
36013
36083
  const result = yield client.salesOrders.notifyShipped(salesOrderId, tracking);
36014
36084
  return result.data;
36015
36085
  }),
@@ -36018,17 +36088,17 @@ const useNotifySalesOrderShipped = () => {
36018
36088
  });
36019
36089
  };
36020
36090
 
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) => {
36091
+ var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
36092
+ var __hasOwnProp$h = Object.prototype.hasOwnProperty;
36093
+ var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
36094
+ var __objRest$b = (source, exclude) => {
36025
36095
  var target = {};
36026
36096
  for (var prop in source)
36027
- if (__hasOwnProp$e.call(source, prop) && exclude.indexOf(prop) < 0)
36097
+ if (__hasOwnProp$h.call(source, prop) && exclude.indexOf(prop) < 0)
36028
36098
  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))
36099
+ if (source != null && __getOwnPropSymbols$h)
36100
+ for (var prop of __getOwnPropSymbols$h(source)) {
36101
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$h.call(source, prop))
36032
36102
  target[prop] = source[prop];
36033
36103
  }
36034
36104
  return target;
@@ -36057,7 +36127,7 @@ const useCreateSalesOrderShipment = () => {
36057
36127
  const { client } = useShipEngine();
36058
36128
  return reactQuery.useMutation({
36059
36129
  mutationFn: (_a) => __async$f(void 0, null, function* () {
36060
- var _b = _a, { salesOrderId } = _b, shipment = __objRest$7(_b, ["salesOrderId"]);
36130
+ var _b = _a, { salesOrderId } = _b, shipment = __objRest$b(_b, ["salesOrderId"]);
36061
36131
  const result = yield client.salesOrderShipments.create(salesOrderId, shipment);
36062
36132
  return result.data;
36063
36133
  }),
@@ -36092,17 +36162,17 @@ const useListSalesOrderShipments = (params) => {
36092
36162
  });
36093
36163
  };
36094
36164
 
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) => {
36165
+ var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
36166
+ var __hasOwnProp$g = Object.prototype.hasOwnProperty;
36167
+ var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
36168
+ var __objRest$a = (source, exclude) => {
36099
36169
  var target = {};
36100
36170
  for (var prop in source)
36101
- if (__hasOwnProp$d.call(source, prop) && exclude.indexOf(prop) < 0)
36171
+ if (__hasOwnProp$g.call(source, prop) && exclude.indexOf(prop) < 0)
36102
36172
  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))
36173
+ if (source != null && __getOwnPropSymbols$g)
36174
+ for (var prop of __getOwnPropSymbols$g(source)) {
36175
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$g.call(source, prop))
36106
36176
  target[prop] = source[prop];
36107
36177
  }
36108
36178
  return target;
@@ -36131,7 +36201,7 @@ const useUpdateSalesOrderShipment = () => {
36131
36201
  const { client } = useShipEngine();
36132
36202
  return reactQuery.useMutation({
36133
36203
  mutationFn: (_a) => __async$e(void 0, null, function* () {
36134
- var _b = _a, { shipmentId } = _b, shipment = __objRest$6(_b, ["shipmentId"]);
36204
+ var _b = _a, { shipmentId } = _b, shipment = __objRest$a(_b, ["shipmentId"]);
36135
36205
  const result = yield client.salesOrderShipments.update(shipmentId, shipment);
36136
36206
  return result.data;
36137
36207
  }),
@@ -36140,25 +36210,25 @@ const useUpdateSalesOrderShipment = () => {
36140
36210
  });
36141
36211
  };
36142
36212
 
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) => {
36213
+ var __defProp$d = Object.defineProperty;
36214
+ var __defProps$b = Object.defineProperties;
36215
+ var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
36216
+ var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
36217
+ var __hasOwnProp$f = Object.prototype.hasOwnProperty;
36218
+ var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
36219
+ var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
36220
+ var __spreadValues$d = (a, b) => {
36151
36221
  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]);
36222
+ if (__hasOwnProp$f.call(b, prop))
36223
+ __defNormalProp$d(a, prop, b[prop]);
36224
+ if (__getOwnPropSymbols$f)
36225
+ for (var prop of __getOwnPropSymbols$f(b)) {
36226
+ if (__propIsEnum$f.call(b, prop))
36227
+ __defNormalProp$d(a, prop, b[prop]);
36158
36228
  }
36159
36229
  return a;
36160
36230
  };
36161
- var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
36231
+ var __spreadProps$b = (a, b) => __defProps$b(a, __getOwnPropDescs$b(b));
36162
36232
  var __async$d = (__this, __arguments, generator) => {
36163
36233
  return new Promise((resolve, reject) => {
36164
36234
  var fulfilled = (value) => {
@@ -36200,7 +36270,7 @@ const useCreateShipment = () => {
36200
36270
  postalCode: "",
36201
36271
  stateProvince: ""
36202
36272
  };
36203
- return (yield client.shipments.create(__spreadProps$8(__spreadValues$a({}, shipment), {
36273
+ return (yield client.shipments.create(__spreadProps$b(__spreadValues$d({}, shipment), {
36204
36274
  shipTo
36205
36275
  }))).data;
36206
36276
  }),
@@ -36225,33 +36295,33 @@ const useGetShipmentRates = (shipmentId, createdAtStart) => {
36225
36295
  });
36226
36296
  };
36227
36297
 
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) => {
36298
+ var __defProp$c = Object.defineProperty;
36299
+ var __defProps$a = Object.defineProperties;
36300
+ var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
36301
+ var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
36302
+ var __hasOwnProp$e = Object.prototype.hasOwnProperty;
36303
+ var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
36304
+ var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
36305
+ var __spreadValues$c = (a, b) => {
36236
36306
  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]);
36307
+ if (__hasOwnProp$e.call(b, prop))
36308
+ __defNormalProp$c(a, prop, b[prop]);
36309
+ if (__getOwnPropSymbols$e)
36310
+ for (var prop of __getOwnPropSymbols$e(b)) {
36311
+ if (__propIsEnum$e.call(b, prop))
36312
+ __defNormalProp$c(a, prop, b[prop]);
36243
36313
  }
36244
36314
  return a;
36245
36315
  };
36246
- var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
36247
- var __objRest$5 = (source, exclude) => {
36316
+ var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
36317
+ var __objRest$9 = (source, exclude) => {
36248
36318
  var target = {};
36249
36319
  for (var prop in source)
36250
- if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
36320
+ if (__hasOwnProp$e.call(source, prop) && exclude.indexOf(prop) < 0)
36251
36321
  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))
36322
+ if (source != null && __getOwnPropSymbols$e)
36323
+ for (var prop of __getOwnPropSymbols$e(source)) {
36324
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$e.call(source, prop))
36255
36325
  target[prop] = source[prop];
36256
36326
  }
36257
36327
  return target;
@@ -36262,12 +36332,12 @@ const useGetShipment = (params) => {
36262
36332
  const shipmentId = typeof params === "string" ? params : (_a = params == null ? void 0 : params.queryFnParams) == null ? void 0 : _a.shipmentId;
36263
36333
  const getQueryProps = () => {
36264
36334
  if (typeof params !== "string") {
36265
- const _a2 = params, rest = __objRest$5(_a2, ["queryFnParams"]);
36335
+ const _a2 = params, rest = __objRest$9(_a2, ["queryFnParams"]);
36266
36336
  return rest;
36267
36337
  }
36268
36338
  return {};
36269
36339
  };
36270
- return reactQuery.useQuery(__spreadProps$7(__spreadValues$9({}, getQueryProps()), {
36340
+ return reactQuery.useQuery(__spreadProps$a(__spreadValues$c({}, getQueryProps()), {
36271
36341
  enabled: shipmentId !== void 0,
36272
36342
  onError,
36273
36343
  queryFn: () => {
@@ -36281,23 +36351,23 @@ const useGetShipment = (params) => {
36281
36351
  }));
36282
36352
  };
36283
36353
 
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) => {
36354
+ var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
36355
+ var __hasOwnProp$d = Object.prototype.hasOwnProperty;
36356
+ var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
36357
+ var __objRest$8 = (source, exclude) => {
36288
36358
  var target = {};
36289
36359
  for (var prop in source)
36290
- if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
36360
+ if (__hasOwnProp$d.call(source, prop) && exclude.indexOf(prop) < 0)
36291
36361
  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))
36362
+ if (source != null && __getOwnPropSymbols$d)
36363
+ for (var prop of __getOwnPropSymbols$d(source)) {
36364
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$d.call(source, prop))
36295
36365
  target[prop] = source[prop];
36296
36366
  }
36297
36367
  return target;
36298
36368
  };
36299
36369
  const useListShipments = (_params) => {
36300
- const _a = _params || {}, { enabled = true } = _a, params = __objRest$4(_a, ["enabled"]);
36370
+ const _a = _params || {}, { enabled = true } = _a, params = __objRest$8(_a, ["enabled"]);
36301
36371
  const { client } = useShipEngine();
36302
36372
  return reactQuery.useQuery({
36303
36373
  enabled,
@@ -36308,41 +36378,41 @@ const useListShipments = (_params) => {
36308
36378
  });
36309
36379
  };
36310
36380
 
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) => {
36381
+ var __defProp$b = Object.defineProperty;
36382
+ var __defProps$9 = Object.defineProperties;
36383
+ var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
36384
+ var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
36385
+ var __hasOwnProp$c = Object.prototype.hasOwnProperty;
36386
+ var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
36387
+ var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
36388
+ var __spreadValues$b = (a, b) => {
36319
36389
  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]);
36390
+ if (__hasOwnProp$c.call(b, prop))
36391
+ __defNormalProp$b(a, prop, b[prop]);
36392
+ if (__getOwnPropSymbols$c)
36393
+ for (var prop of __getOwnPropSymbols$c(b)) {
36394
+ if (__propIsEnum$c.call(b, prop))
36395
+ __defNormalProp$b(a, prop, b[prop]);
36326
36396
  }
36327
36397
  return a;
36328
36398
  };
36329
- var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
36330
- var __objRest$3 = (source, exclude) => {
36399
+ var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
36400
+ var __objRest$7 = (source, exclude) => {
36331
36401
  var target = {};
36332
36402
  for (var prop in source)
36333
- if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
36403
+ if (__hasOwnProp$c.call(source, prop) && exclude.indexOf(prop) < 0)
36334
36404
  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))
36405
+ if (source != null && __getOwnPropSymbols$c)
36406
+ for (var prop of __getOwnPropSymbols$c(source)) {
36407
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$c.call(source, prop))
36338
36408
  target[prop] = source[prop];
36339
36409
  }
36340
36410
  return target;
36341
36411
  };
36342
36412
  const useGetShipmentByExternalId = (params) => {
36343
36413
  const { client } = useShipEngine();
36344
- const _a = params, { queryFnParams } = _a, rest = __objRest$3(_a, ["queryFnParams"]);
36345
- return reactQuery.useQuery(__spreadProps$6(__spreadValues$8({}, rest), {
36414
+ const _a = params, { queryFnParams } = _a, rest = __objRest$7(_a, ["queryFnParams"]);
36415
+ return reactQuery.useQuery(__spreadProps$9(__spreadValues$b({}, rest), {
36346
36416
  onError,
36347
36417
  queryFn: () => client.shipments.getByExternalId(queryFnParams.externalId),
36348
36418
  queryKey: ["useGetShipmentByExternalId", queryFnParams],
@@ -36350,33 +36420,46 @@ const useGetShipmentByExternalId = (params) => {
36350
36420
  }));
36351
36421
  };
36352
36422
 
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) => {
36423
+ var __defProp$a = Object.defineProperty;
36424
+ var __defProps$8 = Object.defineProperties;
36425
+ var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
36426
+ var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
36427
+ var __hasOwnProp$b = Object.prototype.hasOwnProperty;
36428
+ var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
36429
+ var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
36430
+ var __spreadValues$a = (a, b) => {
36361
36431
  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]);
36432
+ if (__hasOwnProp$b.call(b, prop))
36433
+ __defNormalProp$a(a, prop, b[prop]);
36434
+ if (__getOwnPropSymbols$b)
36435
+ for (var prop of __getOwnPropSymbols$b(b)) {
36436
+ if (__propIsEnum$b.call(b, prop))
36437
+ __defNormalProp$a(a, prop, b[prop]);
36368
36438
  }
36369
36439
  return a;
36370
36440
  };
36371
- var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
36441
+ var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
36442
+ var __objRest$6 = (source, exclude) => {
36443
+ var target = {};
36444
+ for (var prop in source)
36445
+ if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
36446
+ target[prop] = source[prop];
36447
+ if (source != null && __getOwnPropSymbols$b)
36448
+ for (var prop of __getOwnPropSymbols$b(source)) {
36449
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
36450
+ target[prop] = source[prop];
36451
+ }
36452
+ return target;
36453
+ };
36372
36454
  const useListShippingRules = (params) => {
36373
36455
  const { client } = useShipEngine();
36374
- return reactQuery.useQuery(__spreadProps$5(__spreadValues$7({}, params), {
36456
+ const _a = __spreadValues$a({}, params), { queryFnParams } = _a, rest = __objRest$6(_a, ["queryFnParams"]);
36457
+ return reactQuery.useQuery(__spreadProps$8(__spreadValues$a({}, rest), {
36375
36458
  onError,
36376
36459
  queryFn: () => {
36377
- return client.shippingRules.list();
36460
+ return client.shippingRules.list(queryFnParams);
36378
36461
  },
36379
- queryKey: ["useListShippingRules"],
36462
+ queryKey: ["useListShippingRules", queryFnParams],
36380
36463
  select: (result) => result.data.shippingRules
36381
36464
  }));
36382
36465
  };
@@ -36404,8 +36487,8 @@ var __async$c = (__this, __arguments, generator) => {
36404
36487
  const useCreateShippingRule = () => {
36405
36488
  const { client } = useShipEngine();
36406
36489
  return reactQuery.useMutation({
36407
- mutationFn: (shippingRule) => __async$c(void 0, null, function* () {
36408
- const result = yield client.shippingRules.create(shippingRule);
36490
+ mutationFn: (props) => __async$c(void 0, null, function* () {
36491
+ const result = yield client.shippingRules.create(props);
36409
36492
  return result.data;
36410
36493
  }),
36411
36494
  mutationKey: ["useCreateShippingRule"],
@@ -36436,8 +36519,8 @@ var __async$b = (__this, __arguments, generator) => {
36436
36519
  const useDeleteShippingRule = () => {
36437
36520
  const { client } = useShipEngine();
36438
36521
  return reactQuery.useMutation({
36439
- mutationFn: (shippingRuleId) => __async$b(void 0, null, function* () {
36440
- const result = yield client.shippingRules.delete(shippingRuleId);
36522
+ mutationFn: (props) => __async$b(void 0, null, function* () {
36523
+ const result = yield client.shippingRules.delete(props);
36441
36524
  return result.data;
36442
36525
  }),
36443
36526
  mutationKey: ["useDeleteShippingRule"],
@@ -36468,8 +36551,8 @@ var __async$a = (__this, __arguments, generator) => {
36468
36551
  const useEditShippingRule = () => {
36469
36552
  const { client } = useShipEngine();
36470
36553
  return reactQuery.useMutation({
36471
- mutationFn: (shippingRule) => __async$a(void 0, null, function* () {
36472
- const result = yield client.shippingRules.edit(shippingRule);
36554
+ mutationFn: (props) => __async$a(void 0, null, function* () {
36555
+ const result = yield client.shippingRules.edit(props);
36473
36556
  return result.data;
36474
36557
  }),
36475
36558
  mutationKey: ["useEditShippingRule"],
@@ -36477,29 +36560,92 @@ const useEditShippingRule = () => {
36477
36560
  });
36478
36561
  };
36479
36562
 
36480
- const useGetShippingRuleConditionsOptions = () => {
36563
+ var __defProp$9 = Object.defineProperty;
36564
+ var __defProps$7 = Object.defineProperties;
36565
+ var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
36566
+ var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
36567
+ var __hasOwnProp$a = Object.prototype.hasOwnProperty;
36568
+ var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
36569
+ var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
36570
+ var __spreadValues$9 = (a, b) => {
36571
+ for (var prop in b || (b = {}))
36572
+ if (__hasOwnProp$a.call(b, prop))
36573
+ __defNormalProp$9(a, prop, b[prop]);
36574
+ if (__getOwnPropSymbols$a)
36575
+ for (var prop of __getOwnPropSymbols$a(b)) {
36576
+ if (__propIsEnum$a.call(b, prop))
36577
+ __defNormalProp$9(a, prop, b[prop]);
36578
+ }
36579
+ return a;
36580
+ };
36581
+ var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
36582
+ var __objRest$5 = (source, exclude) => {
36583
+ var target = {};
36584
+ for (var prop in source)
36585
+ if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
36586
+ target[prop] = source[prop];
36587
+ if (source != null && __getOwnPropSymbols$a)
36588
+ for (var prop of __getOwnPropSymbols$a(source)) {
36589
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
36590
+ target[prop] = source[prop];
36591
+ }
36592
+ return target;
36593
+ };
36594
+ const useGetShippingRuleConditionsOptions = (params) => {
36481
36595
  const { client } = useShipEngine();
36482
- return reactQuery.useQuery({
36596
+ const _a = __spreadValues$9({}, params), { queryFnParams } = _a, rest = __objRest$5(_a, ["queryFnParams"]);
36597
+ return reactQuery.useQuery(__spreadProps$7(__spreadValues$9({}, rest), {
36483
36598
  onError,
36484
36599
  queryFn: () => {
36485
- return client.shippingRules.getConditionOptions();
36600
+ return client.shippingRules.getConditionOptions(queryFnParams);
36486
36601
  },
36487
- queryKey: ["useGetShippingRuleConditionsOptions"],
36602
+ queryKey: ["useGetShippingRuleConditionsOptions", queryFnParams],
36488
36603
  select: (result) => result.data
36489
- });
36604
+ }));
36490
36605
  };
36491
36606
 
36492
- const useGetShippingRuleById = (shippingRuleId) => {
36607
+ var __defProp$8 = Object.defineProperty;
36608
+ var __defProps$6 = Object.defineProperties;
36609
+ var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
36610
+ var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
36611
+ var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
36612
+ var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
36613
+ var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
36614
+ var __spreadValues$8 = (a, b) => {
36615
+ for (var prop in b || (b = {}))
36616
+ if (__hasOwnProp$9.call(b, prop))
36617
+ __defNormalProp$8(a, prop, b[prop]);
36618
+ if (__getOwnPropSymbols$9)
36619
+ for (var prop of __getOwnPropSymbols$9(b)) {
36620
+ if (__propIsEnum$9.call(b, prop))
36621
+ __defNormalProp$8(a, prop, b[prop]);
36622
+ }
36623
+ return a;
36624
+ };
36625
+ var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
36626
+ var __objRest$4 = (source, exclude) => {
36627
+ var target = {};
36628
+ for (var prop in source)
36629
+ if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
36630
+ target[prop] = source[prop];
36631
+ if (source != null && __getOwnPropSymbols$9)
36632
+ for (var prop of __getOwnPropSymbols$9(source)) {
36633
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$9.call(source, prop))
36634
+ target[prop] = source[prop];
36635
+ }
36636
+ return target;
36637
+ };
36638
+ const useGetShippingRuleById = (params) => {
36493
36639
  const { client } = useShipEngine();
36494
- return reactQuery.useQuery({
36495
- enabled: !!shippingRuleId,
36640
+ const _a = __spreadValues$8({}, params), { queryFnParams } = _a, rest = __objRest$4(_a, ["queryFnParams"]);
36641
+ return reactQuery.useQuery(__spreadProps$6(__spreadValues$8({}, rest), {
36496
36642
  onError,
36497
36643
  queryFn: () => {
36498
- return client.shippingRules.get(shippingRuleId);
36644
+ return client.shippingRules.get(queryFnParams);
36499
36645
  },
36500
- queryKey: ["useGetShippingRuleById", shippingRuleId],
36646
+ queryKey: ["useGetShippingRuleById", queryFnParams],
36501
36647
  select: (result) => result.data
36502
- });
36648
+ }));
36503
36649
  };
36504
36650
 
36505
36651
  const useGetThemeById = (themeId) => {
@@ -36581,16 +36727,46 @@ const useDeleteWarehouse = () => {
36581
36727
  });
36582
36728
  };
36583
36729
 
36584
- const useListWarehouses = (options) => {
36585
- var _a;
36730
+ var __defProp$7 = Object.defineProperty;
36731
+ var __defProps$5 = Object.defineProperties;
36732
+ var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
36733
+ var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
36734
+ var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
36735
+ var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
36736
+ var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
36737
+ var __spreadValues$7 = (a, b) => {
36738
+ for (var prop in b || (b = {}))
36739
+ if (__hasOwnProp$8.call(b, prop))
36740
+ __defNormalProp$7(a, prop, b[prop]);
36741
+ if (__getOwnPropSymbols$8)
36742
+ for (var prop of __getOwnPropSymbols$8(b)) {
36743
+ if (__propIsEnum$8.call(b, prop))
36744
+ __defNormalProp$7(a, prop, b[prop]);
36745
+ }
36746
+ return a;
36747
+ };
36748
+ var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
36749
+ var __objRest$3 = (source, exclude) => {
36750
+ var target = {};
36751
+ for (var prop in source)
36752
+ if (__hasOwnProp$8.call(source, prop) && exclude.indexOf(prop) < 0)
36753
+ target[prop] = source[prop];
36754
+ if (source != null && __getOwnPropSymbols$8)
36755
+ for (var prop of __getOwnPropSymbols$8(source)) {
36756
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$8.call(source, prop))
36757
+ target[prop] = source[prop];
36758
+ }
36759
+ return target;
36760
+ };
36761
+ const useListWarehouses = (params) => {
36586
36762
  const { client } = useShipEngine();
36587
- return reactQuery.useQuery({
36588
- enabled: (_a = options == null ? void 0 : options.enabled) != null ? _a : true,
36763
+ const _a = __spreadValues$7({}, params), { queryFnParams } = _a, rest = __objRest$3(_a, ["queryFnParams"]);
36764
+ return reactQuery.useQuery(__spreadProps$5(__spreadValues$7({}, rest), {
36589
36765
  onError,
36590
- queryFn: () => client.warehouses.list(),
36591
- queryKey: ["useListWarehouses"],
36766
+ queryFn: () => client.warehouses.list(queryFnParams),
36767
+ queryKey: ["useListWarehouses", queryFnParams],
36592
36768
  select: (result) => result.data.warehouses
36593
- });
36769
+ }));
36594
36770
  };
36595
36771
 
36596
36772
  var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
@@ -37438,6 +37614,7 @@ const AlchemyProvider = ({
37438
37614
  cdnURL = "https://cdn.packlink.com",
37439
37615
  container,
37440
37616
  children,
37617
+ getSandboxToken,
37441
37618
  getToken,
37442
37619
  locale: localeProp,
37443
37620
  onError = _default,
@@ -37472,6 +37649,7 @@ const AlchemyProvider = ({
37472
37649
  {
37473
37650
  baseURL,
37474
37651
  headers,
37652
+ getSandboxToken,
37475
37653
  getToken,
37476
37654
  onApiError,
37477
37655
  defaultQueryClientOptions,