@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.mjs CHANGED
@@ -10790,17 +10790,17 @@ var AccountBillingPlanChangeType = /* @__PURE__ */ ((AccountBillingPlanChangeTyp
10790
10790
  return AccountBillingPlanChangeType2;
10791
10791
  })(AccountBillingPlanChangeType || {});
10792
10792
 
10793
- var __getOwnPropSymbols$v = Object.getOwnPropertySymbols;
10794
- var __hasOwnProp$v = Object.prototype.hasOwnProperty;
10795
- var __propIsEnum$v = Object.prototype.propertyIsEnumerable;
10796
- var __objRest$i = (source, exclude) => {
10793
+ var __getOwnPropSymbols$z = Object.getOwnPropertySymbols;
10794
+ var __hasOwnProp$z = Object.prototype.hasOwnProperty;
10795
+ var __propIsEnum$z = Object.prototype.propertyIsEnumerable;
10796
+ var __objRest$n = (source, exclude) => {
10797
10797
  var target = {};
10798
10798
  for (var prop in source)
10799
- if (__hasOwnProp$v.call(source, prop) && exclude.indexOf(prop) < 0)
10799
+ if (__hasOwnProp$z.call(source, prop) && exclude.indexOf(prop) < 0)
10800
10800
  target[prop] = source[prop];
10801
- if (source != null && __getOwnPropSymbols$v)
10802
- for (var prop of __getOwnPropSymbols$v(source)) {
10803
- if (exclude.indexOf(prop) < 0 && __propIsEnum$v.call(source, prop))
10801
+ if (source != null && __getOwnPropSymbols$z)
10802
+ for (var prop of __getOwnPropSymbols$z(source)) {
10803
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$z.call(source, prop))
10804
10804
  target[prop] = source[prop];
10805
10805
  }
10806
10806
  return target;
@@ -10814,7 +10814,7 @@ class CodedError {
10814
10814
  this.message = message;
10815
10815
  }
10816
10816
  static fromObject(_a) {
10817
- var _b = _a, { message } = _b, options = __objRest$i(_b, ["message"]);
10817
+ var _b = _a, { message } = _b, options = __objRest$n(_b, ["message"]);
10818
10818
  return new CodedError(message, options);
10819
10819
  }
10820
10820
  }
@@ -10922,17 +10922,17 @@ const types = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
10922
10922
  RateCardStatus
10923
10923
  }, Symbol.toStringTag, { value: 'Module' }));
10924
10924
 
10925
- var __getOwnPropSymbols$u = Object.getOwnPropertySymbols;
10926
- var __hasOwnProp$u = Object.prototype.hasOwnProperty;
10927
- var __propIsEnum$u = Object.prototype.propertyIsEnumerable;
10928
- var __objRest$h = (source, exclude) => {
10925
+ var __getOwnPropSymbols$y = Object.getOwnPropertySymbols;
10926
+ var __hasOwnProp$y = Object.prototype.hasOwnProperty;
10927
+ var __propIsEnum$y = Object.prototype.propertyIsEnumerable;
10928
+ var __objRest$m = (source, exclude) => {
10929
10929
  var target = {};
10930
10930
  for (var prop in source)
10931
- if (__hasOwnProp$u.call(source, prop) && exclude.indexOf(prop) < 0)
10931
+ if (__hasOwnProp$y.call(source, prop) && exclude.indexOf(prop) < 0)
10932
10932
  target[prop] = source[prop];
10933
- if (source != null && __getOwnPropSymbols$u)
10934
- for (var prop of __getOwnPropSymbols$u(source)) {
10935
- if (exclude.indexOf(prop) < 0 && __propIsEnum$u.call(source, prop))
10933
+ if (source != null && __getOwnPropSymbols$y)
10934
+ for (var prop of __getOwnPropSymbols$y(source)) {
10935
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$y.call(source, prop))
10936
10936
  target[prop] = source[prop];
10937
10937
  }
10938
10938
  return target;
@@ -10964,7 +10964,7 @@ class AccountSettingsAPI {
10964
10964
  * The `updateImage` method updates specific image data for a given image id.
10965
10965
  */
10966
10966
  this.updateImage = (_a) => {
10967
- var _b = _a, { labelImageId } = _b, data = __objRest$h(_b, ["labelImageId"]);
10967
+ var _b = _a, { labelImageId } = _b, data = __objRest$m(_b, ["labelImageId"]);
10968
10968
  return this.client.put(`/v1/account/settings/images/${labelImageId}`, data);
10969
10969
  };
10970
10970
  /**
@@ -13706,33 +13706,33 @@ const getEndUserIpAddress = () => __async$O(void 0, null, function* () {
13706
13706
  }
13707
13707
  });
13708
13708
 
13709
- var __defProp$i = Object.defineProperty;
13710
- var __defProps$d = Object.defineProperties;
13711
- var __getOwnPropDescs$d = Object.getOwnPropertyDescriptors;
13712
- var __getOwnPropSymbols$t = Object.getOwnPropertySymbols;
13713
- var __hasOwnProp$t = Object.prototype.hasOwnProperty;
13714
- var __propIsEnum$t = Object.prototype.propertyIsEnumerable;
13715
- var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13716
- var __spreadValues$i = (a, b) => {
13709
+ var __defProp$n = Object.defineProperty;
13710
+ var __defProps$i = Object.defineProperties;
13711
+ var __getOwnPropDescs$i = Object.getOwnPropertyDescriptors;
13712
+ var __getOwnPropSymbols$x = Object.getOwnPropertySymbols;
13713
+ var __hasOwnProp$x = Object.prototype.hasOwnProperty;
13714
+ var __propIsEnum$x = Object.prototype.propertyIsEnumerable;
13715
+ var __defNormalProp$n = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13716
+ var __spreadValues$n = (a, b) => {
13717
13717
  for (var prop in b || (b = {}))
13718
- if (__hasOwnProp$t.call(b, prop))
13719
- __defNormalProp$i(a, prop, b[prop]);
13720
- if (__getOwnPropSymbols$t)
13721
- for (var prop of __getOwnPropSymbols$t(b)) {
13722
- if (__propIsEnum$t.call(b, prop))
13723
- __defNormalProp$i(a, prop, b[prop]);
13718
+ if (__hasOwnProp$x.call(b, prop))
13719
+ __defNormalProp$n(a, prop, b[prop]);
13720
+ if (__getOwnPropSymbols$x)
13721
+ for (var prop of __getOwnPropSymbols$x(b)) {
13722
+ if (__propIsEnum$x.call(b, prop))
13723
+ __defNormalProp$n(a, prop, b[prop]);
13724
13724
  }
13725
13725
  return a;
13726
13726
  };
13727
- var __spreadProps$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(b));
13728
- var __objRest$g = (source, exclude) => {
13727
+ var __spreadProps$i = (a, b) => __defProps$i(a, __getOwnPropDescs$i(b));
13728
+ var __objRest$l = (source, exclude) => {
13729
13729
  var target = {};
13730
13730
  for (var prop in source)
13731
- if (__hasOwnProp$t.call(source, prop) && exclude.indexOf(prop) < 0)
13731
+ if (__hasOwnProp$x.call(source, prop) && exclude.indexOf(prop) < 0)
13732
13732
  target[prop] = source[prop];
13733
- if (source != null && __getOwnPropSymbols$t)
13734
- for (var prop of __getOwnPropSymbols$t(source)) {
13735
- if (exclude.indexOf(prop) < 0 && __propIsEnum$t.call(source, prop))
13733
+ if (source != null && __getOwnPropSymbols$x)
13734
+ for (var prop of __getOwnPropSymbols$x(source)) {
13735
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$x.call(source, prop))
13736
13736
  target[prop] = source[prop];
13737
13737
  }
13738
13738
  return target;
@@ -13763,8 +13763,10 @@ class CarriersAPI {
13763
13763
  /**
13764
13764
  * The `list` method retrieves a list of connected carriers for a given user.
13765
13765
  */
13766
- this.list = () => {
13767
- return this.client.get("/v1/carriers");
13766
+ this.list = (props) => {
13767
+ return this.client.get("/v1/carriers", {
13768
+ isSandbox: props == null ? void 0 : props.isSandbox
13769
+ });
13768
13770
  };
13769
13771
  /**
13770
13772
  * The `get` method retrieves a specific carrier by `carrierId`.
@@ -13776,11 +13778,11 @@ class CarriersAPI {
13776
13778
  * The `connect` method connects a carrier account to a user's ShipEngine account.
13777
13779
  */
13778
13780
  this.connect = (_a) => __async$N(this, null, function* () {
13779
- var _b = _a, { carrierCode } = _b, connection = __objRest$g(_b, ["carrierCode"]);
13781
+ var _b = _a, { carrierCode } = _b, connection = __objRest$l(_b, ["carrierCode"]);
13780
13782
  const endUserIpAddress = yield getEndUserIpAddress();
13781
13783
  if (!endUserIpAddress)
13782
13784
  return Promise.reject([new CodedError("Unable to get IP address")]);
13783
- return yield this.client.post(`/v1/registration/${carrierCode}`, __spreadProps$d(__spreadValues$i({}, connection), {
13785
+ return yield this.client.post(`/v1/registration/${carrierCode}`, __spreadProps$i(__spreadValues$n({}, connection), {
13784
13786
  endUserIpAddress
13785
13787
  }));
13786
13788
  });
@@ -16163,19 +16165,19 @@ class CustomPackagesAPI {
16163
16165
  }
16164
16166
  }
16165
16167
 
16166
- var __defProp$h = Object.defineProperty;
16167
- var __getOwnPropSymbols$s = Object.getOwnPropertySymbols;
16168
- var __hasOwnProp$s = Object.prototype.hasOwnProperty;
16169
- var __propIsEnum$s = Object.prototype.propertyIsEnumerable;
16170
- var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16171
- var __spreadValues$h = (a, b) => {
16168
+ var __defProp$m = Object.defineProperty;
16169
+ var __getOwnPropSymbols$w = Object.getOwnPropertySymbols;
16170
+ var __hasOwnProp$w = Object.prototype.hasOwnProperty;
16171
+ var __propIsEnum$w = Object.prototype.propertyIsEnumerable;
16172
+ var __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16173
+ var __spreadValues$m = (a, b) => {
16172
16174
  for (var prop in b || (b = {}))
16173
- if (__hasOwnProp$s.call(b, prop))
16174
- __defNormalProp$h(a, prop, b[prop]);
16175
- if (__getOwnPropSymbols$s)
16176
- for (var prop of __getOwnPropSymbols$s(b)) {
16177
- if (__propIsEnum$s.call(b, prop))
16178
- __defNormalProp$h(a, prop, b[prop]);
16175
+ if (__hasOwnProp$w.call(b, prop))
16176
+ __defNormalProp$m(a, prop, b[prop]);
16177
+ if (__getOwnPropSymbols$w)
16178
+ for (var prop of __getOwnPropSymbols$w(b)) {
16179
+ if (__propIsEnum$w.call(b, prop))
16180
+ __defNormalProp$m(a, prop, b[prop]);
16179
16181
  }
16180
16182
  return a;
16181
16183
  };
@@ -16223,7 +16225,7 @@ class FundingSourcesAPI {
16223
16225
  if (!endUserIpAddress) {
16224
16226
  return Promise.reject([new CodedError("Unable to get IP address")]);
16225
16227
  }
16226
- return yield this.client.post("/v1/funding_sources", __spreadValues$h({
16228
+ return yield this.client.post("/v1/funding_sources", __spreadValues$m({
16227
16229
  endUserIpAddress
16228
16230
  }, createFundingSource));
16229
16231
  });
@@ -16255,7 +16257,7 @@ class FundingSourcesAPI {
16255
16257
  if (!endUserIpAddress) {
16256
16258
  return Promise.reject([new CodedError("Unable to get IP address")]);
16257
16259
  }
16258
- return yield this.client.post("/v1/registration/funding_source", __spreadValues$h({
16260
+ return yield this.client.post("/v1/registration/funding_source", __spreadValues$m({
16259
16261
  endUserIpAddress
16260
16262
  }, carrier));
16261
16263
  });
@@ -16460,19 +16462,19 @@ class RateCardsAPI {
16460
16462
  }
16461
16463
  }
16462
16464
 
16463
- var __defProp$g = Object.defineProperty;
16464
- var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
16465
- var __hasOwnProp$r = Object.prototype.hasOwnProperty;
16466
- var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
16467
- var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16468
- var __spreadValues$g = (a, b) => {
16465
+ var __defProp$l = Object.defineProperty;
16466
+ var __getOwnPropSymbols$v = Object.getOwnPropertySymbols;
16467
+ var __hasOwnProp$v = Object.prototype.hasOwnProperty;
16468
+ var __propIsEnum$v = Object.prototype.propertyIsEnumerable;
16469
+ var __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16470
+ var __spreadValues$l = (a, b) => {
16469
16471
  for (var prop in b || (b = {}))
16470
- if (__hasOwnProp$r.call(b, prop))
16471
- __defNormalProp$g(a, prop, b[prop]);
16472
- if (__getOwnPropSymbols$r)
16473
- for (var prop of __getOwnPropSymbols$r(b)) {
16474
- if (__propIsEnum$r.call(b, prop))
16475
- __defNormalProp$g(a, prop, b[prop]);
16472
+ if (__hasOwnProp$v.call(b, prop))
16473
+ __defNormalProp$l(a, prop, b[prop]);
16474
+ if (__getOwnPropSymbols$v)
16475
+ for (var prop of __getOwnPropSymbols$v(b)) {
16476
+ if (__propIsEnum$v.call(b, prop))
16477
+ __defNormalProp$l(a, prop, b[prop]);
16476
16478
  }
16477
16479
  return a;
16478
16480
  };
@@ -16494,7 +16496,7 @@ class RatesAPI {
16494
16496
  * method.
16495
16497
  */
16496
16498
  this.estimate = (params) => {
16497
- return this.client.post("/v1/rates/estimate", __spreadValues$g({}, params));
16499
+ return this.client.post("/v1/rates/estimate", __spreadValues$l({}, params));
16498
16500
  };
16499
16501
  this.client = client;
16500
16502
  }
@@ -16592,19 +16594,19 @@ class SellersAPI {
16592
16594
  }
16593
16595
  }
16594
16596
 
16595
- var __defProp$f = Object.defineProperty;
16596
- var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
16597
- var __hasOwnProp$q = Object.prototype.hasOwnProperty;
16598
- var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
16599
- var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16600
- var __spreadValues$f = (a, b) => {
16597
+ var __defProp$k = Object.defineProperty;
16598
+ var __getOwnPropSymbols$u = Object.getOwnPropertySymbols;
16599
+ var __hasOwnProp$u = Object.prototype.hasOwnProperty;
16600
+ var __propIsEnum$u = Object.prototype.propertyIsEnumerable;
16601
+ var __defNormalProp$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16602
+ var __spreadValues$k = (a, b) => {
16601
16603
  for (var prop in b || (b = {}))
16602
- if (__hasOwnProp$q.call(b, prop))
16603
- __defNormalProp$f(a, prop, b[prop]);
16604
- if (__getOwnPropSymbols$q)
16605
- for (var prop of __getOwnPropSymbols$q(b)) {
16606
- if (__propIsEnum$q.call(b, prop))
16607
- __defNormalProp$f(a, prop, b[prop]);
16604
+ if (__hasOwnProp$u.call(b, prop))
16605
+ __defNormalProp$k(a, prop, b[prop]);
16606
+ if (__getOwnPropSymbols$u)
16607
+ for (var prop of __getOwnPropSymbols$u(b)) {
16608
+ if (__propIsEnum$u.call(b, prop))
16609
+ __defNormalProp$k(a, prop, b[prop]);
16608
16610
  }
16609
16611
  return a;
16610
16612
  };
@@ -16616,7 +16618,7 @@ class ServicePointsAPI {
16616
16618
  * Either an address, coordinates, or an address query
16617
16619
  */
16618
16620
  this.list = (options) => {
16619
- return this.client.post("/v1/service_points/list", __spreadValues$f({}, options));
16621
+ return this.client.post("/v1/service_points/list", __spreadValues$k({}, options));
16620
16622
  };
16621
16623
  /**
16622
16624
  * Get a specific service point by its carrier code, country code, and id
@@ -16698,42 +16700,55 @@ class ShippingRulesAPI {
16698
16700
  /**
16699
16701
  * The `list` method retrieves the list of shipping rules by seller.
16700
16702
  */
16701
- this.list = () => {
16702
- return this.client.get(`/v1/shipping_rules`);
16703
+ this.list = (props) => {
16704
+ return this.client.get(`/v1/shipping_rules`, {
16705
+ isSandbox: props == null ? void 0 : props.isSandbox
16706
+ });
16703
16707
  };
16704
16708
  /**
16705
16709
  * The `get` method retrieves a specific shipping rule by `shippingRuleId`.
16706
16710
  */
16707
- this.get = (shippingRuleId) => {
16708
- return this.client.get(`/v1/shipping_rules/${shippingRuleId}`);
16711
+ this.get = (props) => {
16712
+ return this.client.get(`/v1/shipping_rules/${props == null ? void 0 : props.shippingRuleId}`, {
16713
+ isSandbox: props == null ? void 0 : props.isSandbox
16714
+ });
16709
16715
  };
16710
16716
  /**
16711
16717
  * The `create` method creates a new shipping rule for a given user.
16712
16718
  */
16713
- this.create = (shippingRule) => {
16714
- return this.client.post("/v1/shipping_rules", shippingRule);
16719
+ this.create = (props) => {
16720
+ return this.client.post("/v1/shipping_rules", props.shippingRule, {
16721
+ isSandbox: props.isSandbox
16722
+ });
16715
16723
  };
16716
16724
  /**
16717
16725
  * The `delete` method deletes a shipping rule by `shippingRuleId`.
16718
16726
  */
16719
- this.delete = (shippingRuleId) => {
16720
- return this.client.delete(`/v1/shipping_rules/${shippingRuleId}`);
16727
+ this.delete = (props) => {
16728
+ return this.client.delete(`/v1/shipping_rules/${props.shippingRuleId}`, {
16729
+ isSandbox: props.isSandbox
16730
+ });
16721
16731
  };
16722
16732
  /**
16723
16733
  * The `edit` method edits a specific shipping rule by `shippingRuleId` with a new
16724
16734
  * `ShippingRule`.
16725
16735
  */
16726
- this.edit = (shippingRule) => {
16736
+ this.edit = (props) => {
16727
16737
  return this.client.put(
16728
- `/v1/shipping_rules/${shippingRule.shippingRuleId}`,
16729
- shippingRule
16738
+ `/v1/shipping_rules/${props.shippingRule.shippingRuleId}`,
16739
+ props.shippingRule,
16740
+ {
16741
+ isSandbox: props.isSandbox
16742
+ }
16730
16743
  );
16731
16744
  };
16732
16745
  /**
16733
16746
  * The `getConditionOptions` method retrieves the list of condition options availables for creating shipping rules.
16734
16747
  */
16735
- this.getConditionOptions = () => {
16736
- return this.client.get(`/v1/shipping_rules/rule_conditions_options`);
16748
+ this.getConditionOptions = (props) => {
16749
+ return this.client.get(`/v1/shipping_rules/rule_conditions_options`, {
16750
+ isSandbox: props == null ? void 0 : props.isSandbox
16751
+ });
16737
16752
  };
16738
16753
  this.client = client;
16739
16754
  }
@@ -16759,8 +16774,10 @@ class WarehousesAPI {
16759
16774
  * The `list` method retrieves a list of `warehouses` (Ship From Locations)
16760
16775
  * for a given user.
16761
16776
  */
16762
- this.list = () => {
16763
- return this.client.get("/v1/warehouses");
16777
+ this.list = (props) => {
16778
+ return this.client.get("/v1/warehouses", {
16779
+ isSandbox: props == null ? void 0 : props.isSandbox
16780
+ });
16764
16781
  };
16765
16782
  /**
16766
16783
  * The `create` method allows for creation of warehouses (Ship From Locations)
@@ -34049,25 +34066,25 @@ class WebhooksAPI {
34049
34066
  }
34050
34067
  }
34051
34068
 
34052
- var __defProp$e = Object.defineProperty;
34053
- var __defProps$c = Object.defineProperties;
34054
- var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
34055
- var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
34056
- var __hasOwnProp$p = Object.prototype.hasOwnProperty;
34057
- var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
34058
- var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
34059
- var __spreadValues$e = (a, b) => {
34069
+ var __defProp$j = Object.defineProperty;
34070
+ var __defProps$h = Object.defineProperties;
34071
+ var __getOwnPropDescs$h = Object.getOwnPropertyDescriptors;
34072
+ var __getOwnPropSymbols$t = Object.getOwnPropertySymbols;
34073
+ var __hasOwnProp$t = Object.prototype.hasOwnProperty;
34074
+ var __propIsEnum$t = Object.prototype.propertyIsEnumerable;
34075
+ var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
34076
+ var __spreadValues$j = (a, b) => {
34060
34077
  for (var prop in b || (b = {}))
34061
- if (__hasOwnProp$p.call(b, prop))
34062
- __defNormalProp$e(a, prop, b[prop]);
34063
- if (__getOwnPropSymbols$p)
34064
- for (var prop of __getOwnPropSymbols$p(b)) {
34065
- if (__propIsEnum$p.call(b, prop))
34066
- __defNormalProp$e(a, prop, b[prop]);
34078
+ if (__hasOwnProp$t.call(b, prop))
34079
+ __defNormalProp$j(a, prop, b[prop]);
34080
+ if (__getOwnPropSymbols$t)
34081
+ for (var prop of __getOwnPropSymbols$t(b)) {
34082
+ if (__propIsEnum$t.call(b, prop))
34083
+ __defNormalProp$j(a, prop, b[prop]);
34067
34084
  }
34068
34085
  return a;
34069
34086
  };
34070
- var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(b));
34087
+ var __spreadProps$h = (a, b) => __defProps$h(a, __getOwnPropDescs$h(b));
34071
34088
  var __async$J = (__this, __arguments, generator) => {
34072
34089
  return new Promise((resolve, reject) => {
34073
34090
  var fulfilled = (value) => {
@@ -34091,7 +34108,7 @@ var __async$J = (__this, __arguments, generator) => {
34091
34108
  const logger$1 = E({
34092
34109
  level: process.env.NODE_ENV === "production" ? "fatal" : "info",
34093
34110
  name: "shipengine-api",
34094
- serializers: __spreadProps$c(__spreadValues$e({}, k), {
34111
+ serializers: __spreadProps$h(__spreadValues$j({}, k), {
34095
34112
  req: (req) => ({
34096
34113
  headers: req.headers,
34097
34114
  method: req.method,
@@ -34112,10 +34129,10 @@ const logger$1 = E({
34112
34129
  ]
34113
34130
  });
34114
34131
  class ShipEngineAPI {
34115
- constructor(token, { baseURL, headers, getToken, onApiError }) {
34132
+ constructor(token, { baseURL, headers, getToken, getSandboxToken, onApiError }) {
34116
34133
  const client = axios.create({
34117
34134
  baseURL,
34118
- headers: __spreadProps$c(__spreadValues$e({}, headers), {
34135
+ headers: __spreadProps$h(__spreadValues$j({}, headers), {
34119
34136
  "Content-Type": "application/json"
34120
34137
  }),
34121
34138
  paramsSerializer: (params) => lib.stringify(humpsExports.decamelizeKeys(params), { arrayFormat: "brackets" }),
@@ -34149,6 +34166,21 @@ class ShipEngineAPI {
34149
34166
  ]
34150
34167
  });
34151
34168
  client.defaults.headers.common["Authorization"] = `Bearer ${token}`;
34169
+ client.interceptors.request.use(
34170
+ (config) => __async$J(this, null, function* () {
34171
+ if (config.isSandbox) {
34172
+ if (!this.sandboxToken) {
34173
+ this.sandboxToken = yield getSandboxToken == null ? void 0 : getSandboxToken();
34174
+ }
34175
+ config.headers || (config.headers = {});
34176
+ config.headers["Authorization"] = `Bearer ${this.sandboxToken}`;
34177
+ }
34178
+ return config;
34179
+ }),
34180
+ function(error) {
34181
+ return Promise.reject(error);
34182
+ }
34183
+ );
34152
34184
  client.interceptors.response.use(
34153
34185
  (res) => {
34154
34186
  var _a;
@@ -34174,9 +34206,13 @@ class ShipEngineAPI {
34174
34206
  err.message
34175
34207
  );
34176
34208
  if (isInvalidTokenError(err)) {
34177
- const token2 = yield getToken();
34209
+ const token2 = yield err.config.isSandbox ? getSandboxToken == null ? void 0 : getSandboxToken() : getToken();
34178
34210
  const config = err.config;
34179
- this.token = token2;
34211
+ if (err.config.isSandbox) {
34212
+ this.sandboxToken = token2;
34213
+ } else {
34214
+ this.token = token2;
34215
+ }
34180
34216
  if (config) {
34181
34217
  config.headers || (config.headers = {});
34182
34218
  config.headers["Authorization"] = `Bearer ${token2}`;
@@ -34387,6 +34423,7 @@ const ShipEngine = ({
34387
34423
  baseURL,
34388
34424
  children,
34389
34425
  headers,
34426
+ getSandboxToken,
34390
34427
  getToken,
34391
34428
  onApiError,
34392
34429
  defaultQueryClientOptions = {}
@@ -34401,6 +34438,7 @@ const ShipEngine = ({
34401
34438
  const token = getToken();
34402
34439
  const commonClientProps = {
34403
34440
  baseURL,
34441
+ getSandboxToken,
34404
34442
  getToken,
34405
34443
  headers: headers != null ? headers : {},
34406
34444
  onApiError
@@ -34444,25 +34482,25 @@ const delay = (ms) => new Promise((resolve) => {
34444
34482
 
34445
34483
  const onError = (_errors) => _default();
34446
34484
 
34447
- var __defProp$d = Object.defineProperty;
34448
- var __defProps$b = Object.defineProperties;
34449
- var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
34450
- var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
34451
- var __hasOwnProp$o = Object.prototype.hasOwnProperty;
34452
- var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
34453
- var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
34454
- var __spreadValues$d = (a, b) => {
34485
+ var __defProp$i = Object.defineProperty;
34486
+ var __defProps$g = Object.defineProperties;
34487
+ var __getOwnPropDescs$g = Object.getOwnPropertyDescriptors;
34488
+ var __getOwnPropSymbols$s = Object.getOwnPropertySymbols;
34489
+ var __hasOwnProp$s = Object.prototype.hasOwnProperty;
34490
+ var __propIsEnum$s = Object.prototype.propertyIsEnumerable;
34491
+ var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
34492
+ var __spreadValues$i = (a, b) => {
34455
34493
  for (var prop in b || (b = {}))
34456
- if (__hasOwnProp$o.call(b, prop))
34457
- __defNormalProp$d(a, prop, b[prop]);
34458
- if (__getOwnPropSymbols$o)
34459
- for (var prop of __getOwnPropSymbols$o(b)) {
34460
- if (__propIsEnum$o.call(b, prop))
34461
- __defNormalProp$d(a, prop, b[prop]);
34494
+ if (__hasOwnProp$s.call(b, prop))
34495
+ __defNormalProp$i(a, prop, b[prop]);
34496
+ if (__getOwnPropSymbols$s)
34497
+ for (var prop of __getOwnPropSymbols$s(b)) {
34498
+ if (__propIsEnum$s.call(b, prop))
34499
+ __defNormalProp$i(a, prop, b[prop]);
34462
34500
  }
34463
34501
  return a;
34464
34502
  };
34465
- var __spreadProps$b = (a, b) => __defProps$b(a, __getOwnPropDescs$b(b));
34503
+ var __spreadProps$g = (a, b) => __defProps$g(a, __getOwnPropDescs$g(b));
34466
34504
  const streams = [];
34467
34505
  if (process.env.NODE_ENV === "production") {
34468
34506
  streams.push({
@@ -34471,7 +34509,7 @@ if (process.env.NODE_ENV === "production") {
34471
34509
  }
34472
34510
  const logger = E({
34473
34511
  name: "shipengine",
34474
- serializers: __spreadProps$b(__spreadValues$d({}, k), {
34512
+ serializers: __spreadProps$g(__spreadValues$i({}, k), {
34475
34513
  req: (req) => ({
34476
34514
  headers: req.headers,
34477
34515
  method: req.method,
@@ -34872,27 +34910,59 @@ const useGetServicesByCarrier = (carrierId) => {
34872
34910
  });
34873
34911
  };
34874
34912
 
34875
- const useListCarriers = () => {
34913
+ var __defProp$h = Object.defineProperty;
34914
+ var __defProps$f = Object.defineProperties;
34915
+ var __getOwnPropDescs$f = Object.getOwnPropertyDescriptors;
34916
+ var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
34917
+ var __hasOwnProp$r = Object.prototype.hasOwnProperty;
34918
+ var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
34919
+ var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
34920
+ var __spreadValues$h = (a, b) => {
34921
+ for (var prop in b || (b = {}))
34922
+ if (__hasOwnProp$r.call(b, prop))
34923
+ __defNormalProp$h(a, prop, b[prop]);
34924
+ if (__getOwnPropSymbols$r)
34925
+ for (var prop of __getOwnPropSymbols$r(b)) {
34926
+ if (__propIsEnum$r.call(b, prop))
34927
+ __defNormalProp$h(a, prop, b[prop]);
34928
+ }
34929
+ return a;
34930
+ };
34931
+ var __spreadProps$f = (a, b) => __defProps$f(a, __getOwnPropDescs$f(b));
34932
+ var __objRest$k = (source, exclude) => {
34933
+ var target = {};
34934
+ for (var prop in source)
34935
+ if (__hasOwnProp$r.call(source, prop) && exclude.indexOf(prop) < 0)
34936
+ target[prop] = source[prop];
34937
+ if (source != null && __getOwnPropSymbols$r)
34938
+ for (var prop of __getOwnPropSymbols$r(source)) {
34939
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$r.call(source, prop))
34940
+ target[prop] = source[prop];
34941
+ }
34942
+ return target;
34943
+ };
34944
+ const useListCarriers = (params) => {
34876
34945
  const { client } = useShipEngine();
34877
- return useQuery({
34946
+ const _a = __spreadValues$h({}, params), { queryFnParams } = _a, rest = __objRest$k(_a, ["queryFnParams"]);
34947
+ return useQuery(__spreadProps$f(__spreadValues$h({}, rest), {
34878
34948
  onError,
34879
- queryFn: () => client.carriers.list(),
34880
- queryKey: ["useListCarriers"],
34949
+ queryFn: () => client.carriers.list(queryFnParams),
34950
+ queryKey: ["useListCarriers", queryFnParams],
34881
34951
  select: (result) => result.data.carriers
34882
- });
34952
+ }));
34883
34953
  };
34884
34954
 
34885
- var __getOwnPropSymbols$n = Object.getOwnPropertySymbols;
34886
- var __hasOwnProp$n = Object.prototype.hasOwnProperty;
34887
- var __propIsEnum$n = Object.prototype.propertyIsEnumerable;
34888
- var __objRest$f = (source, exclude) => {
34955
+ var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
34956
+ var __hasOwnProp$q = Object.prototype.hasOwnProperty;
34957
+ var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
34958
+ var __objRest$j = (source, exclude) => {
34889
34959
  var target = {};
34890
34960
  for (var prop in source)
34891
- if (__hasOwnProp$n.call(source, prop) && exclude.indexOf(prop) < 0)
34961
+ if (__hasOwnProp$q.call(source, prop) && exclude.indexOf(prop) < 0)
34892
34962
  target[prop] = source[prop];
34893
- if (source != null && __getOwnPropSymbols$n)
34894
- for (var prop of __getOwnPropSymbols$n(source)) {
34895
- if (exclude.indexOf(prop) < 0 && __propIsEnum$n.call(source, prop))
34963
+ if (source != null && __getOwnPropSymbols$q)
34964
+ for (var prop of __getOwnPropSymbols$q(source)) {
34965
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$q.call(source, prop))
34896
34966
  target[prop] = source[prop];
34897
34967
  }
34898
34968
  return target;
@@ -34922,7 +34992,7 @@ const useUpdateAutoFunding = () => {
34922
34992
  const queryClient = useQueryClient();
34923
34993
  return useMutation({
34924
34994
  mutationFn: (_a) => __async$A(void 0, null, function* () {
34925
- var _b = _a, { carrierId } = _b, options = __objRest$f(_b, ["carrierId"]);
34995
+ var _b = _a, { carrierId } = _b, options = __objRest$j(_b, ["carrierId"]);
34926
34996
  const result = yield client.carriers.updateAutoFunding(carrierId, options);
34927
34997
  return result.data;
34928
34998
  }),
@@ -34983,24 +35053,24 @@ const useDeleteCarrier = () => {
34983
35053
  });
34984
35054
  };
34985
35055
 
34986
- var __getOwnPropSymbols$m = Object.getOwnPropertySymbols;
34987
- var __hasOwnProp$m = Object.prototype.hasOwnProperty;
34988
- var __propIsEnum$m = Object.prototype.propertyIsEnumerable;
34989
- var __objRest$e = (source, exclude) => {
35056
+ var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
35057
+ var __hasOwnProp$p = Object.prototype.hasOwnProperty;
35058
+ var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
35059
+ var __objRest$i = (source, exclude) => {
34990
35060
  var target = {};
34991
35061
  for (var prop in source)
34992
- if (__hasOwnProp$m.call(source, prop) && exclude.indexOf(prop) < 0)
35062
+ if (__hasOwnProp$p.call(source, prop) && exclude.indexOf(prop) < 0)
34993
35063
  target[prop] = source[prop];
34994
- if (source != null && __getOwnPropSymbols$m)
34995
- for (var prop of __getOwnPropSymbols$m(source)) {
34996
- if (exclude.indexOf(prop) < 0 && __propIsEnum$m.call(source, prop))
35064
+ if (source != null && __getOwnPropSymbols$p)
35065
+ for (var prop of __getOwnPropSymbols$p(source)) {
35066
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$p.call(source, prop))
34997
35067
  target[prop] = source[prop];
34998
35068
  }
34999
35069
  return target;
35000
35070
  };
35001
35071
  const useGetCarrierConnectionForm = (_params) => {
35002
35072
  const { client } = useShipEngine();
35003
- const _a = _params || {}, { carrierName, enabled = true } = _a, params = __objRest$e(_a, ["carrierName", "enabled"]);
35073
+ const _a = _params || {}, { carrierName, enabled = true } = _a, params = __objRest$i(_a, ["carrierName", "enabled"]);
35004
35074
  return useQuery({
35005
35075
  enabled,
35006
35076
  onError,
@@ -35010,24 +35080,24 @@ const useGetCarrierConnectionForm = (_params) => {
35010
35080
  });
35011
35081
  };
35012
35082
 
35013
- var __getOwnPropSymbols$l = Object.getOwnPropertySymbols;
35014
- var __hasOwnProp$l = Object.prototype.hasOwnProperty;
35015
- var __propIsEnum$l = Object.prototype.propertyIsEnumerable;
35016
- var __objRest$d = (source, exclude) => {
35083
+ var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
35084
+ var __hasOwnProp$o = Object.prototype.hasOwnProperty;
35085
+ var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
35086
+ var __objRest$h = (source, exclude) => {
35017
35087
  var target = {};
35018
35088
  for (var prop in source)
35019
- if (__hasOwnProp$l.call(source, prop) && exclude.indexOf(prop) < 0)
35089
+ if (__hasOwnProp$o.call(source, prop) && exclude.indexOf(prop) < 0)
35020
35090
  target[prop] = source[prop];
35021
- if (source != null && __getOwnPropSymbols$l)
35022
- for (var prop of __getOwnPropSymbols$l(source)) {
35023
- if (exclude.indexOf(prop) < 0 && __propIsEnum$l.call(source, prop))
35091
+ if (source != null && __getOwnPropSymbols$o)
35092
+ for (var prop of __getOwnPropSymbols$o(source)) {
35093
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$o.call(source, prop))
35024
35094
  target[prop] = source[prop];
35025
35095
  }
35026
35096
  return target;
35027
35097
  };
35028
35098
  const useListCarrierConnections = (_params) => {
35029
35099
  const { client } = useShipEngine();
35030
- const _a = _params || {}, { enabled = true } = _a, params = __objRest$d(_a, ["enabled"]);
35100
+ const _a = _params || {}, { enabled = true } = _a, params = __objRest$h(_a, ["enabled"]);
35031
35101
  return useQuery({
35032
35102
  enabled,
35033
35103
  onError,
@@ -35080,33 +35150,33 @@ const useCarrierConnectionsServicesList = (carrierCode) => {
35080
35150
  });
35081
35151
  };
35082
35152
 
35083
- var __defProp$c = Object.defineProperty;
35084
- var __defProps$a = Object.defineProperties;
35085
- var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
35086
- var __getOwnPropSymbols$k = Object.getOwnPropertySymbols;
35087
- var __hasOwnProp$k = Object.prototype.hasOwnProperty;
35088
- var __propIsEnum$k = Object.prototype.propertyIsEnumerable;
35089
- var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
35090
- var __spreadValues$c = (a, b) => {
35153
+ var __defProp$g = Object.defineProperty;
35154
+ var __defProps$e = Object.defineProperties;
35155
+ var __getOwnPropDescs$e = Object.getOwnPropertyDescriptors;
35156
+ var __getOwnPropSymbols$n = Object.getOwnPropertySymbols;
35157
+ var __hasOwnProp$n = Object.prototype.hasOwnProperty;
35158
+ var __propIsEnum$n = Object.prototype.propertyIsEnumerable;
35159
+ var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
35160
+ var __spreadValues$g = (a, b) => {
35091
35161
  for (var prop in b || (b = {}))
35092
- if (__hasOwnProp$k.call(b, prop))
35093
- __defNormalProp$c(a, prop, b[prop]);
35094
- if (__getOwnPropSymbols$k)
35095
- for (var prop of __getOwnPropSymbols$k(b)) {
35096
- if (__propIsEnum$k.call(b, prop))
35097
- __defNormalProp$c(a, prop, b[prop]);
35162
+ if (__hasOwnProp$n.call(b, prop))
35163
+ __defNormalProp$g(a, prop, b[prop]);
35164
+ if (__getOwnPropSymbols$n)
35165
+ for (var prop of __getOwnPropSymbols$n(b)) {
35166
+ if (__propIsEnum$n.call(b, prop))
35167
+ __defNormalProp$g(a, prop, b[prop]);
35098
35168
  }
35099
35169
  return a;
35100
35170
  };
35101
- var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
35102
- var __objRest$c = (source, exclude) => {
35171
+ var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
35172
+ var __objRest$g = (source, exclude) => {
35103
35173
  var target = {};
35104
35174
  for (var prop in source)
35105
- if (__hasOwnProp$k.call(source, prop) && exclude.indexOf(prop) < 0)
35175
+ if (__hasOwnProp$n.call(source, prop) && exclude.indexOf(prop) < 0)
35106
35176
  target[prop] = source[prop];
35107
- if (source != null && __getOwnPropSymbols$k)
35108
- for (var prop of __getOwnPropSymbols$k(source)) {
35109
- if (exclude.indexOf(prop) < 0 && __propIsEnum$k.call(source, prop))
35177
+ if (source != null && __getOwnPropSymbols$n)
35178
+ for (var prop of __getOwnPropSymbols$n(source)) {
35179
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$n.call(source, prop))
35110
35180
  target[prop] = source[prop];
35111
35181
  }
35112
35182
  return target;
@@ -35114,12 +35184,12 @@ var __objRest$c = (source, exclude) => {
35114
35184
  const useGetConnectionsCarrierSettings = (_a) => {
35115
35185
  var _b = _a, {
35116
35186
  queryFnParams
35117
- } = _b, params = __objRest$c(_b, [
35187
+ } = _b, params = __objRest$g(_b, [
35118
35188
  "queryFnParams"
35119
35189
  ]);
35120
35190
  const { client } = useShipEngine();
35121
35191
  const { carrierName, carrierCode } = queryFnParams;
35122
- return useQuery(__spreadProps$a(__spreadValues$c({}, params), {
35192
+ return useQuery(__spreadProps$e(__spreadValues$g({}, params), {
35123
35193
  onError,
35124
35194
  queryFn: () => client.connections.getCarrierSettings(carrierName, carrierCode),
35125
35195
  queryKey: ["useGetConnectionsCarrierSettings", carrierName, carrierCode],
@@ -35127,25 +35197,25 @@ const useGetConnectionsCarrierSettings = (_a) => {
35127
35197
  }));
35128
35198
  };
35129
35199
 
35130
- var __defProp$b = Object.defineProperty;
35131
- var __defProps$9 = Object.defineProperties;
35132
- var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
35133
- var __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
35134
- var __hasOwnProp$j = Object.prototype.hasOwnProperty;
35135
- var __propIsEnum$j = Object.prototype.propertyIsEnumerable;
35136
- var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
35137
- var __spreadValues$b = (a, b) => {
35200
+ var __defProp$f = Object.defineProperty;
35201
+ var __defProps$d = Object.defineProperties;
35202
+ var __getOwnPropDescs$d = Object.getOwnPropertyDescriptors;
35203
+ var __getOwnPropSymbols$m = Object.getOwnPropertySymbols;
35204
+ var __hasOwnProp$m = Object.prototype.hasOwnProperty;
35205
+ var __propIsEnum$m = Object.prototype.propertyIsEnumerable;
35206
+ var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
35207
+ var __spreadValues$f = (a, b) => {
35138
35208
  for (var prop in b || (b = {}))
35139
- if (__hasOwnProp$j.call(b, prop))
35140
- __defNormalProp$b(a, prop, b[prop]);
35141
- if (__getOwnPropSymbols$j)
35142
- for (var prop of __getOwnPropSymbols$j(b)) {
35143
- if (__propIsEnum$j.call(b, prop))
35144
- __defNormalProp$b(a, prop, b[prop]);
35209
+ if (__hasOwnProp$m.call(b, prop))
35210
+ __defNormalProp$f(a, prop, b[prop]);
35211
+ if (__getOwnPropSymbols$m)
35212
+ for (var prop of __getOwnPropSymbols$m(b)) {
35213
+ if (__propIsEnum$m.call(b, prop))
35214
+ __defNormalProp$f(a, prop, b[prop]);
35145
35215
  }
35146
35216
  return a;
35147
35217
  };
35148
- var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
35218
+ var __spreadProps$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(b));
35149
35219
  var __async$x = (__this, __arguments, generator) => {
35150
35220
  return new Promise((resolve, reject) => {
35151
35221
  var fulfilled = (value) => {
@@ -35168,7 +35238,7 @@ var __async$x = (__this, __arguments, generator) => {
35168
35238
  };
35169
35239
  const useUpdateConnectionsCarrierSettings = (params) => {
35170
35240
  const { client } = useShipEngine();
35171
- return useMutation(__spreadProps$9(__spreadValues$b({}, params), {
35241
+ return useMutation(__spreadProps$d(__spreadValues$f({}, params), {
35172
35242
  mutationFn: (_0) => __async$x(void 0, [_0], function* ({
35173
35243
  carrierName,
35174
35244
  carrierCode,
@@ -35399,17 +35469,17 @@ const useGetInsuranceAccount = (insuranceProvider) => {
35399
35469
  });
35400
35470
  };
35401
35471
 
35402
- var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
35403
- var __hasOwnProp$i = Object.prototype.hasOwnProperty;
35404
- var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
35405
- var __objRest$b = (source, exclude) => {
35472
+ var __getOwnPropSymbols$l = Object.getOwnPropertySymbols;
35473
+ var __hasOwnProp$l = Object.prototype.hasOwnProperty;
35474
+ var __propIsEnum$l = Object.prototype.propertyIsEnumerable;
35475
+ var __objRest$f = (source, exclude) => {
35406
35476
  var target = {};
35407
35477
  for (var prop in source)
35408
- if (__hasOwnProp$i.call(source, prop) && exclude.indexOf(prop) < 0)
35478
+ if (__hasOwnProp$l.call(source, prop) && exclude.indexOf(prop) < 0)
35409
35479
  target[prop] = source[prop];
35410
- if (source != null && __getOwnPropSymbols$i)
35411
- for (var prop of __getOwnPropSymbols$i(source)) {
35412
- if (exclude.indexOf(prop) < 0 && __propIsEnum$i.call(source, prop))
35480
+ if (source != null && __getOwnPropSymbols$l)
35481
+ for (var prop of __getOwnPropSymbols$l(source)) {
35482
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$l.call(source, prop))
35413
35483
  target[prop] = source[prop];
35414
35484
  }
35415
35485
  return target;
@@ -35438,7 +35508,7 @@ const useAddInsuranceFunds = () => {
35438
35508
  const { client } = useShipEngine();
35439
35509
  return useMutation({
35440
35510
  mutationFn: (_a) => __async$s(void 0, null, function* () {
35441
- var _b = _a, { insuranceProvider } = _b, rest = __objRest$b(_b, ["insuranceProvider"]);
35511
+ var _b = _a, { insuranceProvider } = _b, rest = __objRest$f(_b, ["insuranceProvider"]);
35442
35512
  const result = yield client.insurance.addFunds(insuranceProvider, rest);
35443
35513
  return result.data;
35444
35514
  }),
@@ -35447,17 +35517,17 @@ const useAddInsuranceFunds = () => {
35447
35517
  });
35448
35518
  };
35449
35519
 
35450
- var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
35451
- var __hasOwnProp$h = Object.prototype.hasOwnProperty;
35452
- var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
35453
- var __objRest$a = (source, exclude) => {
35454
- var target = {};
35455
- for (var prop in source)
35456
- if (__hasOwnProp$h.call(source, prop) && exclude.indexOf(prop) < 0)
35520
+ var __getOwnPropSymbols$k = Object.getOwnPropertySymbols;
35521
+ var __hasOwnProp$k = Object.prototype.hasOwnProperty;
35522
+ var __propIsEnum$k = Object.prototype.propertyIsEnumerable;
35523
+ var __objRest$e = (source, exclude) => {
35524
+ var target = {};
35525
+ for (var prop in source)
35526
+ if (__hasOwnProp$k.call(source, prop) && exclude.indexOf(prop) < 0)
35457
35527
  target[prop] = source[prop];
35458
- if (source != null && __getOwnPropSymbols$h)
35459
- for (var prop of __getOwnPropSymbols$h(source)) {
35460
- if (exclude.indexOf(prop) < 0 && __propIsEnum$h.call(source, prop))
35528
+ if (source != null && __getOwnPropSymbols$k)
35529
+ for (var prop of __getOwnPropSymbols$k(source)) {
35530
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$k.call(source, prop))
35461
35531
  target[prop] = source[prop];
35462
35532
  }
35463
35533
  return target;
@@ -35486,7 +35556,7 @@ const useCreateLabel = () => {
35486
35556
  const { client } = useShipEngine();
35487
35557
  return useMutation({
35488
35558
  mutationFn: (_a) => __async$r(void 0, null, function* () {
35489
- var _b = _a, { rateId } = _b, options = __objRest$a(_b, ["rateId"]);
35559
+ var _b = _a, { rateId } = _b, options = __objRest$e(_b, ["rateId"]);
35490
35560
  const result = yield client.labels.createByRateId(rateId, options);
35491
35561
  return result.data;
35492
35562
  }),
@@ -35510,31 +35580,46 @@ const useGetLabel = (labelId) => {
35510
35580
  });
35511
35581
  };
35512
35582
 
35513
- var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
35514
- var __hasOwnProp$g = Object.prototype.hasOwnProperty;
35515
- var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
35516
- var __objRest$9 = (source, exclude) => {
35583
+ var __defProp$e = Object.defineProperty;
35584
+ var __defProps$c = Object.defineProperties;
35585
+ var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
35586
+ var __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
35587
+ var __hasOwnProp$j = Object.prototype.hasOwnProperty;
35588
+ var __propIsEnum$j = Object.prototype.propertyIsEnumerable;
35589
+ var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
35590
+ var __spreadValues$e = (a, b) => {
35591
+ for (var prop in b || (b = {}))
35592
+ if (__hasOwnProp$j.call(b, prop))
35593
+ __defNormalProp$e(a, prop, b[prop]);
35594
+ if (__getOwnPropSymbols$j)
35595
+ for (var prop of __getOwnPropSymbols$j(b)) {
35596
+ if (__propIsEnum$j.call(b, prop))
35597
+ __defNormalProp$e(a, prop, b[prop]);
35598
+ }
35599
+ return a;
35600
+ };
35601
+ var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(b));
35602
+ var __objRest$d = (source, exclude) => {
35517
35603
  var target = {};
35518
35604
  for (var prop in source)
35519
- if (__hasOwnProp$g.call(source, prop) && exclude.indexOf(prop) < 0)
35605
+ if (__hasOwnProp$j.call(source, prop) && exclude.indexOf(prop) < 0)
35520
35606
  target[prop] = source[prop];
35521
- if (source != null && __getOwnPropSymbols$g)
35522
- for (var prop of __getOwnPropSymbols$g(source)) {
35523
- if (exclude.indexOf(prop) < 0 && __propIsEnum$g.call(source, prop))
35607
+ if (source != null && __getOwnPropSymbols$j)
35608
+ for (var prop of __getOwnPropSymbols$j(source)) {
35609
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$j.call(source, prop))
35524
35610
  target[prop] = source[prop];
35525
35611
  }
35526
35612
  return target;
35527
35613
  };
35528
- const useListLabels = (_params) => {
35614
+ const useListLabels = (params) => {
35529
35615
  const { client } = useShipEngine();
35530
- const _a = _params || {}, { enabled = true } = _a, params = __objRest$9(_a, ["enabled"]);
35531
- return useQuery({
35532
- enabled,
35616
+ const _a = params, { queryFnParams } = _a, rest = __objRest$d(_a, ["queryFnParams"]);
35617
+ return useQuery(__spreadProps$c(__spreadValues$e({}, rest), {
35533
35618
  onError,
35534
- queryFn: () => client.labels.list(params),
35619
+ queryFn: () => client.labels.list(queryFnParams),
35535
35620
  queryKey: ["useListLabels", params],
35536
35621
  select: (result) => result.data
35537
- });
35622
+ }));
35538
35623
  };
35539
35624
 
35540
35625
  var __async$q = (__this, __arguments, generator) => {
@@ -35948,17 +36033,17 @@ const useListSalesOrders = (params = {}) => {
35948
36033
  });
35949
36034
  };
35950
36035
 
35951
- var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
35952
- var __hasOwnProp$f = Object.prototype.hasOwnProperty;
35953
- var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
35954
- var __objRest$8 = (source, exclude) => {
36036
+ var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
36037
+ var __hasOwnProp$i = Object.prototype.hasOwnProperty;
36038
+ var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
36039
+ var __objRest$c = (source, exclude) => {
35955
36040
  var target = {};
35956
36041
  for (var prop in source)
35957
- if (__hasOwnProp$f.call(source, prop) && exclude.indexOf(prop) < 0)
36042
+ if (__hasOwnProp$i.call(source, prop) && exclude.indexOf(prop) < 0)
35958
36043
  target[prop] = source[prop];
35959
- if (source != null && __getOwnPropSymbols$f)
35960
- for (var prop of __getOwnPropSymbols$f(source)) {
35961
- if (exclude.indexOf(prop) < 0 && __propIsEnum$f.call(source, prop))
36044
+ if (source != null && __getOwnPropSymbols$i)
36045
+ for (var prop of __getOwnPropSymbols$i(source)) {
36046
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$i.call(source, prop))
35962
36047
  target[prop] = source[prop];
35963
36048
  }
35964
36049
  return target;
@@ -35987,7 +36072,7 @@ const useNotifySalesOrderShipped = () => {
35987
36072
  const { client } = useShipEngine();
35988
36073
  return useMutation({
35989
36074
  mutationFn: (_a) => __async$g(void 0, null, function* () {
35990
- var _b = _a, { salesOrderId } = _b, tracking = __objRest$8(_b, ["salesOrderId"]);
36075
+ var _b = _a, { salesOrderId } = _b, tracking = __objRest$c(_b, ["salesOrderId"]);
35991
36076
  const result = yield client.salesOrders.notifyShipped(salesOrderId, tracking);
35992
36077
  return result.data;
35993
36078
  }),
@@ -35996,17 +36081,17 @@ const useNotifySalesOrderShipped = () => {
35996
36081
  });
35997
36082
  };
35998
36083
 
35999
- var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
36000
- var __hasOwnProp$e = Object.prototype.hasOwnProperty;
36001
- var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
36002
- var __objRest$7 = (source, exclude) => {
36084
+ var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
36085
+ var __hasOwnProp$h = Object.prototype.hasOwnProperty;
36086
+ var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
36087
+ var __objRest$b = (source, exclude) => {
36003
36088
  var target = {};
36004
36089
  for (var prop in source)
36005
- if (__hasOwnProp$e.call(source, prop) && exclude.indexOf(prop) < 0)
36090
+ if (__hasOwnProp$h.call(source, prop) && exclude.indexOf(prop) < 0)
36006
36091
  target[prop] = source[prop];
36007
- if (source != null && __getOwnPropSymbols$e)
36008
- for (var prop of __getOwnPropSymbols$e(source)) {
36009
- if (exclude.indexOf(prop) < 0 && __propIsEnum$e.call(source, prop))
36092
+ if (source != null && __getOwnPropSymbols$h)
36093
+ for (var prop of __getOwnPropSymbols$h(source)) {
36094
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$h.call(source, prop))
36010
36095
  target[prop] = source[prop];
36011
36096
  }
36012
36097
  return target;
@@ -36035,7 +36120,7 @@ const useCreateSalesOrderShipment = () => {
36035
36120
  const { client } = useShipEngine();
36036
36121
  return useMutation({
36037
36122
  mutationFn: (_a) => __async$f(void 0, null, function* () {
36038
- var _b = _a, { salesOrderId } = _b, shipment = __objRest$7(_b, ["salesOrderId"]);
36123
+ var _b = _a, { salesOrderId } = _b, shipment = __objRest$b(_b, ["salesOrderId"]);
36039
36124
  const result = yield client.salesOrderShipments.create(salesOrderId, shipment);
36040
36125
  return result.data;
36041
36126
  }),
@@ -36070,17 +36155,17 @@ const useListSalesOrderShipments = (params) => {
36070
36155
  });
36071
36156
  };
36072
36157
 
36073
- var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
36074
- var __hasOwnProp$d = Object.prototype.hasOwnProperty;
36075
- var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
36076
- var __objRest$6 = (source, exclude) => {
36158
+ var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
36159
+ var __hasOwnProp$g = Object.prototype.hasOwnProperty;
36160
+ var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
36161
+ var __objRest$a = (source, exclude) => {
36077
36162
  var target = {};
36078
36163
  for (var prop in source)
36079
- if (__hasOwnProp$d.call(source, prop) && exclude.indexOf(prop) < 0)
36164
+ if (__hasOwnProp$g.call(source, prop) && exclude.indexOf(prop) < 0)
36080
36165
  target[prop] = source[prop];
36081
- if (source != null && __getOwnPropSymbols$d)
36082
- for (var prop of __getOwnPropSymbols$d(source)) {
36083
- if (exclude.indexOf(prop) < 0 && __propIsEnum$d.call(source, prop))
36166
+ if (source != null && __getOwnPropSymbols$g)
36167
+ for (var prop of __getOwnPropSymbols$g(source)) {
36168
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$g.call(source, prop))
36084
36169
  target[prop] = source[prop];
36085
36170
  }
36086
36171
  return target;
@@ -36109,7 +36194,7 @@ const useUpdateSalesOrderShipment = () => {
36109
36194
  const { client } = useShipEngine();
36110
36195
  return useMutation({
36111
36196
  mutationFn: (_a) => __async$e(void 0, null, function* () {
36112
- var _b = _a, { shipmentId } = _b, shipment = __objRest$6(_b, ["shipmentId"]);
36197
+ var _b = _a, { shipmentId } = _b, shipment = __objRest$a(_b, ["shipmentId"]);
36113
36198
  const result = yield client.salesOrderShipments.update(shipmentId, shipment);
36114
36199
  return result.data;
36115
36200
  }),
@@ -36118,25 +36203,25 @@ const useUpdateSalesOrderShipment = () => {
36118
36203
  });
36119
36204
  };
36120
36205
 
36121
- var __defProp$a = Object.defineProperty;
36122
- var __defProps$8 = Object.defineProperties;
36123
- var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
36124
- var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
36125
- var __hasOwnProp$c = Object.prototype.hasOwnProperty;
36126
- var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
36127
- var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
36128
- var __spreadValues$a = (a, b) => {
36206
+ var __defProp$d = Object.defineProperty;
36207
+ var __defProps$b = Object.defineProperties;
36208
+ var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
36209
+ var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
36210
+ var __hasOwnProp$f = Object.prototype.hasOwnProperty;
36211
+ var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
36212
+ var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
36213
+ var __spreadValues$d = (a, b) => {
36129
36214
  for (var prop in b || (b = {}))
36130
- if (__hasOwnProp$c.call(b, prop))
36131
- __defNormalProp$a(a, prop, b[prop]);
36132
- if (__getOwnPropSymbols$c)
36133
- for (var prop of __getOwnPropSymbols$c(b)) {
36134
- if (__propIsEnum$c.call(b, prop))
36135
- __defNormalProp$a(a, prop, b[prop]);
36215
+ if (__hasOwnProp$f.call(b, prop))
36216
+ __defNormalProp$d(a, prop, b[prop]);
36217
+ if (__getOwnPropSymbols$f)
36218
+ for (var prop of __getOwnPropSymbols$f(b)) {
36219
+ if (__propIsEnum$f.call(b, prop))
36220
+ __defNormalProp$d(a, prop, b[prop]);
36136
36221
  }
36137
36222
  return a;
36138
36223
  };
36139
- var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
36224
+ var __spreadProps$b = (a, b) => __defProps$b(a, __getOwnPropDescs$b(b));
36140
36225
  var __async$d = (__this, __arguments, generator) => {
36141
36226
  return new Promise((resolve, reject) => {
36142
36227
  var fulfilled = (value) => {
@@ -36178,7 +36263,7 @@ const useCreateShipment = () => {
36178
36263
  postalCode: "",
36179
36264
  stateProvince: ""
36180
36265
  };
36181
- return (yield client.shipments.create(__spreadProps$8(__spreadValues$a({}, shipment), {
36266
+ return (yield client.shipments.create(__spreadProps$b(__spreadValues$d({}, shipment), {
36182
36267
  shipTo
36183
36268
  }))).data;
36184
36269
  }),
@@ -36203,33 +36288,33 @@ const useGetShipmentRates = (shipmentId, createdAtStart) => {
36203
36288
  });
36204
36289
  };
36205
36290
 
36206
- var __defProp$9 = Object.defineProperty;
36207
- var __defProps$7 = Object.defineProperties;
36208
- var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
36209
- var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
36210
- var __hasOwnProp$b = Object.prototype.hasOwnProperty;
36211
- var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
36212
- var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
36213
- var __spreadValues$9 = (a, b) => {
36291
+ var __defProp$c = Object.defineProperty;
36292
+ var __defProps$a = Object.defineProperties;
36293
+ var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
36294
+ var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
36295
+ var __hasOwnProp$e = Object.prototype.hasOwnProperty;
36296
+ var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
36297
+ var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
36298
+ var __spreadValues$c = (a, b) => {
36214
36299
  for (var prop in b || (b = {}))
36215
- if (__hasOwnProp$b.call(b, prop))
36216
- __defNormalProp$9(a, prop, b[prop]);
36217
- if (__getOwnPropSymbols$b)
36218
- for (var prop of __getOwnPropSymbols$b(b)) {
36219
- if (__propIsEnum$b.call(b, prop))
36220
- __defNormalProp$9(a, prop, b[prop]);
36300
+ if (__hasOwnProp$e.call(b, prop))
36301
+ __defNormalProp$c(a, prop, b[prop]);
36302
+ if (__getOwnPropSymbols$e)
36303
+ for (var prop of __getOwnPropSymbols$e(b)) {
36304
+ if (__propIsEnum$e.call(b, prop))
36305
+ __defNormalProp$c(a, prop, b[prop]);
36221
36306
  }
36222
36307
  return a;
36223
36308
  };
36224
- var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
36225
- var __objRest$5 = (source, exclude) => {
36309
+ var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
36310
+ var __objRest$9 = (source, exclude) => {
36226
36311
  var target = {};
36227
36312
  for (var prop in source)
36228
- if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
36313
+ if (__hasOwnProp$e.call(source, prop) && exclude.indexOf(prop) < 0)
36229
36314
  target[prop] = source[prop];
36230
- if (source != null && __getOwnPropSymbols$b)
36231
- for (var prop of __getOwnPropSymbols$b(source)) {
36232
- if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
36315
+ if (source != null && __getOwnPropSymbols$e)
36316
+ for (var prop of __getOwnPropSymbols$e(source)) {
36317
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$e.call(source, prop))
36233
36318
  target[prop] = source[prop];
36234
36319
  }
36235
36320
  return target;
@@ -36240,12 +36325,12 @@ const useGetShipment = (params) => {
36240
36325
  const shipmentId = typeof params === "string" ? params : (_a = params == null ? void 0 : params.queryFnParams) == null ? void 0 : _a.shipmentId;
36241
36326
  const getQueryProps = () => {
36242
36327
  if (typeof params !== "string") {
36243
- const _a2 = params, rest = __objRest$5(_a2, ["queryFnParams"]);
36328
+ const _a2 = params, rest = __objRest$9(_a2, ["queryFnParams"]);
36244
36329
  return rest;
36245
36330
  }
36246
36331
  return {};
36247
36332
  };
36248
- return useQuery(__spreadProps$7(__spreadValues$9({}, getQueryProps()), {
36333
+ return useQuery(__spreadProps$a(__spreadValues$c({}, getQueryProps()), {
36249
36334
  enabled: shipmentId !== void 0,
36250
36335
  onError,
36251
36336
  queryFn: () => {
@@ -36259,23 +36344,23 @@ const useGetShipment = (params) => {
36259
36344
  }));
36260
36345
  };
36261
36346
 
36262
- var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
36263
- var __hasOwnProp$a = Object.prototype.hasOwnProperty;
36264
- var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
36265
- var __objRest$4 = (source, exclude) => {
36347
+ var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
36348
+ var __hasOwnProp$d = Object.prototype.hasOwnProperty;
36349
+ var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
36350
+ var __objRest$8 = (source, exclude) => {
36266
36351
  var target = {};
36267
36352
  for (var prop in source)
36268
- if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
36353
+ if (__hasOwnProp$d.call(source, prop) && exclude.indexOf(prop) < 0)
36269
36354
  target[prop] = source[prop];
36270
- if (source != null && __getOwnPropSymbols$a)
36271
- for (var prop of __getOwnPropSymbols$a(source)) {
36272
- if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
36355
+ if (source != null && __getOwnPropSymbols$d)
36356
+ for (var prop of __getOwnPropSymbols$d(source)) {
36357
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$d.call(source, prop))
36273
36358
  target[prop] = source[prop];
36274
36359
  }
36275
36360
  return target;
36276
36361
  };
36277
36362
  const useListShipments = (_params) => {
36278
- const _a = _params || {}, { enabled = true } = _a, params = __objRest$4(_a, ["enabled"]);
36363
+ const _a = _params || {}, { enabled = true } = _a, params = __objRest$8(_a, ["enabled"]);
36279
36364
  const { client } = useShipEngine();
36280
36365
  return useQuery({
36281
36366
  enabled,
@@ -36286,41 +36371,41 @@ const useListShipments = (_params) => {
36286
36371
  });
36287
36372
  };
36288
36373
 
36289
- var __defProp$8 = Object.defineProperty;
36290
- var __defProps$6 = Object.defineProperties;
36291
- var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
36292
- var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
36293
- var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
36294
- var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
36295
- var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
36296
- var __spreadValues$8 = (a, b) => {
36374
+ var __defProp$b = Object.defineProperty;
36375
+ var __defProps$9 = Object.defineProperties;
36376
+ var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
36377
+ var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
36378
+ var __hasOwnProp$c = Object.prototype.hasOwnProperty;
36379
+ var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
36380
+ var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
36381
+ var __spreadValues$b = (a, b) => {
36297
36382
  for (var prop in b || (b = {}))
36298
- if (__hasOwnProp$9.call(b, prop))
36299
- __defNormalProp$8(a, prop, b[prop]);
36300
- if (__getOwnPropSymbols$9)
36301
- for (var prop of __getOwnPropSymbols$9(b)) {
36302
- if (__propIsEnum$9.call(b, prop))
36303
- __defNormalProp$8(a, prop, b[prop]);
36383
+ if (__hasOwnProp$c.call(b, prop))
36384
+ __defNormalProp$b(a, prop, b[prop]);
36385
+ if (__getOwnPropSymbols$c)
36386
+ for (var prop of __getOwnPropSymbols$c(b)) {
36387
+ if (__propIsEnum$c.call(b, prop))
36388
+ __defNormalProp$b(a, prop, b[prop]);
36304
36389
  }
36305
36390
  return a;
36306
36391
  };
36307
- var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
36308
- var __objRest$3 = (source, exclude) => {
36392
+ var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
36393
+ var __objRest$7 = (source, exclude) => {
36309
36394
  var target = {};
36310
36395
  for (var prop in source)
36311
- if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
36396
+ if (__hasOwnProp$c.call(source, prop) && exclude.indexOf(prop) < 0)
36312
36397
  target[prop] = source[prop];
36313
- if (source != null && __getOwnPropSymbols$9)
36314
- for (var prop of __getOwnPropSymbols$9(source)) {
36315
- if (exclude.indexOf(prop) < 0 && __propIsEnum$9.call(source, prop))
36398
+ if (source != null && __getOwnPropSymbols$c)
36399
+ for (var prop of __getOwnPropSymbols$c(source)) {
36400
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$c.call(source, prop))
36316
36401
  target[prop] = source[prop];
36317
36402
  }
36318
36403
  return target;
36319
36404
  };
36320
36405
  const useGetShipmentByExternalId = (params) => {
36321
36406
  const { client } = useShipEngine();
36322
- const _a = params, { queryFnParams } = _a, rest = __objRest$3(_a, ["queryFnParams"]);
36323
- return useQuery(__spreadProps$6(__spreadValues$8({}, rest), {
36407
+ const _a = params, { queryFnParams } = _a, rest = __objRest$7(_a, ["queryFnParams"]);
36408
+ return useQuery(__spreadProps$9(__spreadValues$b({}, rest), {
36324
36409
  onError,
36325
36410
  queryFn: () => client.shipments.getByExternalId(queryFnParams.externalId),
36326
36411
  queryKey: ["useGetShipmentByExternalId", queryFnParams],
@@ -36328,33 +36413,46 @@ const useGetShipmentByExternalId = (params) => {
36328
36413
  }));
36329
36414
  };
36330
36415
 
36331
- var __defProp$7 = Object.defineProperty;
36332
- var __defProps$5 = Object.defineProperties;
36333
- var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
36334
- var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
36335
- var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
36336
- var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
36337
- var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
36338
- var __spreadValues$7 = (a, b) => {
36416
+ var __defProp$a = Object.defineProperty;
36417
+ var __defProps$8 = Object.defineProperties;
36418
+ var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
36419
+ var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
36420
+ var __hasOwnProp$b = Object.prototype.hasOwnProperty;
36421
+ var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
36422
+ var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
36423
+ var __spreadValues$a = (a, b) => {
36339
36424
  for (var prop in b || (b = {}))
36340
- if (__hasOwnProp$8.call(b, prop))
36341
- __defNormalProp$7(a, prop, b[prop]);
36342
- if (__getOwnPropSymbols$8)
36343
- for (var prop of __getOwnPropSymbols$8(b)) {
36344
- if (__propIsEnum$8.call(b, prop))
36345
- __defNormalProp$7(a, prop, b[prop]);
36425
+ if (__hasOwnProp$b.call(b, prop))
36426
+ __defNormalProp$a(a, prop, b[prop]);
36427
+ if (__getOwnPropSymbols$b)
36428
+ for (var prop of __getOwnPropSymbols$b(b)) {
36429
+ if (__propIsEnum$b.call(b, prop))
36430
+ __defNormalProp$a(a, prop, b[prop]);
36346
36431
  }
36347
36432
  return a;
36348
36433
  };
36349
- var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
36434
+ var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
36435
+ var __objRest$6 = (source, exclude) => {
36436
+ var target = {};
36437
+ for (var prop in source)
36438
+ if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
36439
+ target[prop] = source[prop];
36440
+ if (source != null && __getOwnPropSymbols$b)
36441
+ for (var prop of __getOwnPropSymbols$b(source)) {
36442
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
36443
+ target[prop] = source[prop];
36444
+ }
36445
+ return target;
36446
+ };
36350
36447
  const useListShippingRules = (params) => {
36351
36448
  const { client } = useShipEngine();
36352
- return useQuery(__spreadProps$5(__spreadValues$7({}, params), {
36449
+ const _a = __spreadValues$a({}, params), { queryFnParams } = _a, rest = __objRest$6(_a, ["queryFnParams"]);
36450
+ return useQuery(__spreadProps$8(__spreadValues$a({}, rest), {
36353
36451
  onError,
36354
36452
  queryFn: () => {
36355
- return client.shippingRules.list();
36453
+ return client.shippingRules.list(queryFnParams);
36356
36454
  },
36357
- queryKey: ["useListShippingRules"],
36455
+ queryKey: ["useListShippingRules", queryFnParams],
36358
36456
  select: (result) => result.data.shippingRules
36359
36457
  }));
36360
36458
  };
@@ -36382,8 +36480,8 @@ var __async$c = (__this, __arguments, generator) => {
36382
36480
  const useCreateShippingRule = () => {
36383
36481
  const { client } = useShipEngine();
36384
36482
  return useMutation({
36385
- mutationFn: (shippingRule) => __async$c(void 0, null, function* () {
36386
- const result = yield client.shippingRules.create(shippingRule);
36483
+ mutationFn: (props) => __async$c(void 0, null, function* () {
36484
+ const result = yield client.shippingRules.create(props);
36387
36485
  return result.data;
36388
36486
  }),
36389
36487
  mutationKey: ["useCreateShippingRule"],
@@ -36414,8 +36512,8 @@ var __async$b = (__this, __arguments, generator) => {
36414
36512
  const useDeleteShippingRule = () => {
36415
36513
  const { client } = useShipEngine();
36416
36514
  return useMutation({
36417
- mutationFn: (shippingRuleId) => __async$b(void 0, null, function* () {
36418
- const result = yield client.shippingRules.delete(shippingRuleId);
36515
+ mutationFn: (props) => __async$b(void 0, null, function* () {
36516
+ const result = yield client.shippingRules.delete(props);
36419
36517
  return result.data;
36420
36518
  }),
36421
36519
  mutationKey: ["useDeleteShippingRule"],
@@ -36446,8 +36544,8 @@ var __async$a = (__this, __arguments, generator) => {
36446
36544
  const useEditShippingRule = () => {
36447
36545
  const { client } = useShipEngine();
36448
36546
  return useMutation({
36449
- mutationFn: (shippingRule) => __async$a(void 0, null, function* () {
36450
- const result = yield client.shippingRules.edit(shippingRule);
36547
+ mutationFn: (props) => __async$a(void 0, null, function* () {
36548
+ const result = yield client.shippingRules.edit(props);
36451
36549
  return result.data;
36452
36550
  }),
36453
36551
  mutationKey: ["useEditShippingRule"],
@@ -36455,29 +36553,92 @@ const useEditShippingRule = () => {
36455
36553
  });
36456
36554
  };
36457
36555
 
36458
- const useGetShippingRuleConditionsOptions = () => {
36556
+ var __defProp$9 = Object.defineProperty;
36557
+ var __defProps$7 = Object.defineProperties;
36558
+ var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
36559
+ var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
36560
+ var __hasOwnProp$a = Object.prototype.hasOwnProperty;
36561
+ var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
36562
+ var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
36563
+ var __spreadValues$9 = (a, b) => {
36564
+ for (var prop in b || (b = {}))
36565
+ if (__hasOwnProp$a.call(b, prop))
36566
+ __defNormalProp$9(a, prop, b[prop]);
36567
+ if (__getOwnPropSymbols$a)
36568
+ for (var prop of __getOwnPropSymbols$a(b)) {
36569
+ if (__propIsEnum$a.call(b, prop))
36570
+ __defNormalProp$9(a, prop, b[prop]);
36571
+ }
36572
+ return a;
36573
+ };
36574
+ var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
36575
+ var __objRest$5 = (source, exclude) => {
36576
+ var target = {};
36577
+ for (var prop in source)
36578
+ if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
36579
+ target[prop] = source[prop];
36580
+ if (source != null && __getOwnPropSymbols$a)
36581
+ for (var prop of __getOwnPropSymbols$a(source)) {
36582
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
36583
+ target[prop] = source[prop];
36584
+ }
36585
+ return target;
36586
+ };
36587
+ const useGetShippingRuleConditionsOptions = (params) => {
36459
36588
  const { client } = useShipEngine();
36460
- return useQuery({
36589
+ const _a = __spreadValues$9({}, params), { queryFnParams } = _a, rest = __objRest$5(_a, ["queryFnParams"]);
36590
+ return useQuery(__spreadProps$7(__spreadValues$9({}, rest), {
36461
36591
  onError,
36462
36592
  queryFn: () => {
36463
- return client.shippingRules.getConditionOptions();
36593
+ return client.shippingRules.getConditionOptions(queryFnParams);
36464
36594
  },
36465
- queryKey: ["useGetShippingRuleConditionsOptions"],
36595
+ queryKey: ["useGetShippingRuleConditionsOptions", queryFnParams],
36466
36596
  select: (result) => result.data
36467
- });
36597
+ }));
36468
36598
  };
36469
36599
 
36470
- const useGetShippingRuleById = (shippingRuleId) => {
36600
+ var __defProp$8 = Object.defineProperty;
36601
+ var __defProps$6 = Object.defineProperties;
36602
+ var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
36603
+ var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
36604
+ var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
36605
+ var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
36606
+ var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
36607
+ var __spreadValues$8 = (a, b) => {
36608
+ for (var prop in b || (b = {}))
36609
+ if (__hasOwnProp$9.call(b, prop))
36610
+ __defNormalProp$8(a, prop, b[prop]);
36611
+ if (__getOwnPropSymbols$9)
36612
+ for (var prop of __getOwnPropSymbols$9(b)) {
36613
+ if (__propIsEnum$9.call(b, prop))
36614
+ __defNormalProp$8(a, prop, b[prop]);
36615
+ }
36616
+ return a;
36617
+ };
36618
+ var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
36619
+ var __objRest$4 = (source, exclude) => {
36620
+ var target = {};
36621
+ for (var prop in source)
36622
+ if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
36623
+ target[prop] = source[prop];
36624
+ if (source != null && __getOwnPropSymbols$9)
36625
+ for (var prop of __getOwnPropSymbols$9(source)) {
36626
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$9.call(source, prop))
36627
+ target[prop] = source[prop];
36628
+ }
36629
+ return target;
36630
+ };
36631
+ const useGetShippingRuleById = (params) => {
36471
36632
  const { client } = useShipEngine();
36472
- return useQuery({
36473
- enabled: !!shippingRuleId,
36633
+ const _a = __spreadValues$8({}, params), { queryFnParams } = _a, rest = __objRest$4(_a, ["queryFnParams"]);
36634
+ return useQuery(__spreadProps$6(__spreadValues$8({}, rest), {
36474
36635
  onError,
36475
36636
  queryFn: () => {
36476
- return client.shippingRules.get(shippingRuleId);
36637
+ return client.shippingRules.get(queryFnParams);
36477
36638
  },
36478
- queryKey: ["useGetShippingRuleById", shippingRuleId],
36639
+ queryKey: ["useGetShippingRuleById", queryFnParams],
36479
36640
  select: (result) => result.data
36480
- });
36641
+ }));
36481
36642
  };
36482
36643
 
36483
36644
  const useGetThemeById = (themeId) => {
@@ -36559,16 +36720,46 @@ const useDeleteWarehouse = () => {
36559
36720
  });
36560
36721
  };
36561
36722
 
36562
- const useListWarehouses = (options) => {
36563
- var _a;
36723
+ var __defProp$7 = Object.defineProperty;
36724
+ var __defProps$5 = Object.defineProperties;
36725
+ var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
36726
+ var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
36727
+ var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
36728
+ var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
36729
+ var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
36730
+ var __spreadValues$7 = (a, b) => {
36731
+ for (var prop in b || (b = {}))
36732
+ if (__hasOwnProp$8.call(b, prop))
36733
+ __defNormalProp$7(a, prop, b[prop]);
36734
+ if (__getOwnPropSymbols$8)
36735
+ for (var prop of __getOwnPropSymbols$8(b)) {
36736
+ if (__propIsEnum$8.call(b, prop))
36737
+ __defNormalProp$7(a, prop, b[prop]);
36738
+ }
36739
+ return a;
36740
+ };
36741
+ var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
36742
+ var __objRest$3 = (source, exclude) => {
36743
+ var target = {};
36744
+ for (var prop in source)
36745
+ if (__hasOwnProp$8.call(source, prop) && exclude.indexOf(prop) < 0)
36746
+ target[prop] = source[prop];
36747
+ if (source != null && __getOwnPropSymbols$8)
36748
+ for (var prop of __getOwnPropSymbols$8(source)) {
36749
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$8.call(source, prop))
36750
+ target[prop] = source[prop];
36751
+ }
36752
+ return target;
36753
+ };
36754
+ const useListWarehouses = (params) => {
36564
36755
  const { client } = useShipEngine();
36565
- return useQuery({
36566
- enabled: (_a = options == null ? void 0 : options.enabled) != null ? _a : true,
36756
+ const _a = __spreadValues$7({}, params), { queryFnParams } = _a, rest = __objRest$3(_a, ["queryFnParams"]);
36757
+ return useQuery(__spreadProps$5(__spreadValues$7({}, rest), {
36567
36758
  onError,
36568
- queryFn: () => client.warehouses.list(),
36569
- queryKey: ["useListWarehouses"],
36759
+ queryFn: () => client.warehouses.list(queryFnParams),
36760
+ queryKey: ["useListWarehouses", queryFnParams],
36570
36761
  select: (result) => result.data.warehouses
36571
- });
36762
+ }));
36572
36763
  };
36573
36764
 
36574
36765
  var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
@@ -37416,6 +37607,7 @@ const AlchemyProvider = ({
37416
37607
  cdnURL = "https://cdn.packlink.com",
37417
37608
  container,
37418
37609
  children,
37610
+ getSandboxToken,
37419
37611
  getToken,
37420
37612
  locale: localeProp,
37421
37613
  onError = _default,
@@ -37450,6 +37642,7 @@ const AlchemyProvider = ({
37450
37642
  {
37451
37643
  baseURL,
37452
37644
  headers,
37645
+ getSandboxToken,
37453
37646
  getToken,
37454
37647
  onApiError,
37455
37648
  defaultQueryClientOptions,