@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.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$m = Object.defineProperty;
13710
+ var __defProps$h = Object.defineProperties;
13711
+ var __getOwnPropDescs$h = 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$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13716
+ var __spreadValues$m = (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$m(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$m(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$h = (a, b) => __defProps$h(a, __getOwnPropDescs$h(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$h(__spreadValues$m({}, 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$l = 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$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16173
+ var __spreadValues$l = (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$l(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$l(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$l({
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$l({
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$k = 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$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16470
+ var __spreadValues$k = (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$k(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$k(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$k({}, 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$j = 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$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16602
+ var __spreadValues$j = (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$j(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$j(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$j({}, 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$i = Object.defineProperty;
34070
+ var __defProps$g = Object.defineProperties;
34071
+ var __getOwnPropDescs$g = 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$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
34076
+ var __spreadValues$i = (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$i(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$i(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$g = (a, b) => __defProps$g(a, __getOwnPropDescs$g(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$g(__spreadValues$i({}, 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$g(__spreadValues$i({}, 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$h = Object.defineProperty;
34486
+ var __defProps$f = Object.defineProperties;
34487
+ var __getOwnPropDescs$f = 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$h = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
34492
+ var __spreadValues$h = (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$h(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$h(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$f = (a, b) => __defProps$f(a, __getOwnPropDescs$f(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$f(__spreadValues$h({}, 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$g = Object.defineProperty;
34914
+ var __defProps$e = Object.defineProperties;
34915
+ var __getOwnPropDescs$e = 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$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
34920
+ var __spreadValues$g = (a, b) => {
34921
+ for (var prop in b || (b = {}))
34922
+ if (__hasOwnProp$r.call(b, prop))
34923
+ __defNormalProp$g(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$g(a, prop, b[prop]);
34928
+ }
34929
+ return a;
34930
+ };
34931
+ var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(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$g({}, params), { queryFnParams } = _a, rest = __objRest$k(_a, ["queryFnParams"]);
34947
+ return useQuery(__spreadProps$e(__spreadValues$g({}, 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$f = Object.defineProperty;
35154
+ var __defProps$d = Object.defineProperties;
35155
+ var __getOwnPropDescs$d = 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$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
35160
+ var __spreadValues$f = (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$f(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$f(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$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(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$d(__spreadValues$f({}, 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$e = Object.defineProperty;
35201
+ var __defProps$c = Object.defineProperties;
35202
+ var __getOwnPropDescs$c = 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$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
35207
+ var __spreadValues$e = (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$e(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$e(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$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(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$c(__spreadValues$e({}, 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) => {
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) => {
35454
35524
  var target = {};
35455
35525
  for (var prop in source)
35456
- if (__hasOwnProp$h.call(source, prop) && exclude.indexOf(prop) < 0)
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,24 +35580,24 @@ 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 __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
35584
+ var __hasOwnProp$j = Object.prototype.hasOwnProperty;
35585
+ var __propIsEnum$j = Object.prototype.propertyIsEnumerable;
35586
+ var __objRest$d = (source, exclude) => {
35517
35587
  var target = {};
35518
35588
  for (var prop in source)
35519
- if (__hasOwnProp$g.call(source, prop) && exclude.indexOf(prop) < 0)
35589
+ if (__hasOwnProp$j.call(source, prop) && exclude.indexOf(prop) < 0)
35520
35590
  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))
35591
+ if (source != null && __getOwnPropSymbols$j)
35592
+ for (var prop of __getOwnPropSymbols$j(source)) {
35593
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$j.call(source, prop))
35524
35594
  target[prop] = source[prop];
35525
35595
  }
35526
35596
  return target;
35527
35597
  };
35528
35598
  const useListLabels = (_params) => {
35529
35599
  const { client } = useShipEngine();
35530
- const _a = _params || {}, { enabled = true } = _a, params = __objRest$9(_a, ["enabled"]);
35600
+ const _a = _params || {}, { enabled = true } = _a, params = __objRest$d(_a, ["enabled"]);
35531
35601
  return useQuery({
35532
35602
  enabled,
35533
35603
  onError,
@@ -35948,17 +36018,17 @@ const useListSalesOrders = (params = {}) => {
35948
36018
  });
35949
36019
  };
35950
36020
 
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) => {
36021
+ var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
36022
+ var __hasOwnProp$i = Object.prototype.hasOwnProperty;
36023
+ var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
36024
+ var __objRest$c = (source, exclude) => {
35955
36025
  var target = {};
35956
36026
  for (var prop in source)
35957
- if (__hasOwnProp$f.call(source, prop) && exclude.indexOf(prop) < 0)
36027
+ if (__hasOwnProp$i.call(source, prop) && exclude.indexOf(prop) < 0)
35958
36028
  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))
36029
+ if (source != null && __getOwnPropSymbols$i)
36030
+ for (var prop of __getOwnPropSymbols$i(source)) {
36031
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$i.call(source, prop))
35962
36032
  target[prop] = source[prop];
35963
36033
  }
35964
36034
  return target;
@@ -35987,7 +36057,7 @@ const useNotifySalesOrderShipped = () => {
35987
36057
  const { client } = useShipEngine();
35988
36058
  return useMutation({
35989
36059
  mutationFn: (_a) => __async$g(void 0, null, function* () {
35990
- var _b = _a, { salesOrderId } = _b, tracking = __objRest$8(_b, ["salesOrderId"]);
36060
+ var _b = _a, { salesOrderId } = _b, tracking = __objRest$c(_b, ["salesOrderId"]);
35991
36061
  const result = yield client.salesOrders.notifyShipped(salesOrderId, tracking);
35992
36062
  return result.data;
35993
36063
  }),
@@ -35996,17 +36066,17 @@ const useNotifySalesOrderShipped = () => {
35996
36066
  });
35997
36067
  };
35998
36068
 
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) => {
36069
+ var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
36070
+ var __hasOwnProp$h = Object.prototype.hasOwnProperty;
36071
+ var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
36072
+ var __objRest$b = (source, exclude) => {
36003
36073
  var target = {};
36004
36074
  for (var prop in source)
36005
- if (__hasOwnProp$e.call(source, prop) && exclude.indexOf(prop) < 0)
36075
+ if (__hasOwnProp$h.call(source, prop) && exclude.indexOf(prop) < 0)
36006
36076
  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))
36077
+ if (source != null && __getOwnPropSymbols$h)
36078
+ for (var prop of __getOwnPropSymbols$h(source)) {
36079
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$h.call(source, prop))
36010
36080
  target[prop] = source[prop];
36011
36081
  }
36012
36082
  return target;
@@ -36035,7 +36105,7 @@ const useCreateSalesOrderShipment = () => {
36035
36105
  const { client } = useShipEngine();
36036
36106
  return useMutation({
36037
36107
  mutationFn: (_a) => __async$f(void 0, null, function* () {
36038
- var _b = _a, { salesOrderId } = _b, shipment = __objRest$7(_b, ["salesOrderId"]);
36108
+ var _b = _a, { salesOrderId } = _b, shipment = __objRest$b(_b, ["salesOrderId"]);
36039
36109
  const result = yield client.salesOrderShipments.create(salesOrderId, shipment);
36040
36110
  return result.data;
36041
36111
  }),
@@ -36070,17 +36140,17 @@ const useListSalesOrderShipments = (params) => {
36070
36140
  });
36071
36141
  };
36072
36142
 
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) => {
36143
+ var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
36144
+ var __hasOwnProp$g = Object.prototype.hasOwnProperty;
36145
+ var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
36146
+ var __objRest$a = (source, exclude) => {
36077
36147
  var target = {};
36078
36148
  for (var prop in source)
36079
- if (__hasOwnProp$d.call(source, prop) && exclude.indexOf(prop) < 0)
36149
+ if (__hasOwnProp$g.call(source, prop) && exclude.indexOf(prop) < 0)
36080
36150
  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))
36151
+ if (source != null && __getOwnPropSymbols$g)
36152
+ for (var prop of __getOwnPropSymbols$g(source)) {
36153
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$g.call(source, prop))
36084
36154
  target[prop] = source[prop];
36085
36155
  }
36086
36156
  return target;
@@ -36109,7 +36179,7 @@ const useUpdateSalesOrderShipment = () => {
36109
36179
  const { client } = useShipEngine();
36110
36180
  return useMutation({
36111
36181
  mutationFn: (_a) => __async$e(void 0, null, function* () {
36112
- var _b = _a, { shipmentId } = _b, shipment = __objRest$6(_b, ["shipmentId"]);
36182
+ var _b = _a, { shipmentId } = _b, shipment = __objRest$a(_b, ["shipmentId"]);
36113
36183
  const result = yield client.salesOrderShipments.update(shipmentId, shipment);
36114
36184
  return result.data;
36115
36185
  }),
@@ -36118,25 +36188,25 @@ const useUpdateSalesOrderShipment = () => {
36118
36188
  });
36119
36189
  };
36120
36190
 
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) => {
36191
+ var __defProp$d = Object.defineProperty;
36192
+ var __defProps$b = Object.defineProperties;
36193
+ var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
36194
+ var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
36195
+ var __hasOwnProp$f = Object.prototype.hasOwnProperty;
36196
+ var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
36197
+ var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
36198
+ var __spreadValues$d = (a, b) => {
36129
36199
  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]);
36200
+ if (__hasOwnProp$f.call(b, prop))
36201
+ __defNormalProp$d(a, prop, b[prop]);
36202
+ if (__getOwnPropSymbols$f)
36203
+ for (var prop of __getOwnPropSymbols$f(b)) {
36204
+ if (__propIsEnum$f.call(b, prop))
36205
+ __defNormalProp$d(a, prop, b[prop]);
36136
36206
  }
36137
36207
  return a;
36138
36208
  };
36139
- var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
36209
+ var __spreadProps$b = (a, b) => __defProps$b(a, __getOwnPropDescs$b(b));
36140
36210
  var __async$d = (__this, __arguments, generator) => {
36141
36211
  return new Promise((resolve, reject) => {
36142
36212
  var fulfilled = (value) => {
@@ -36178,7 +36248,7 @@ const useCreateShipment = () => {
36178
36248
  postalCode: "",
36179
36249
  stateProvince: ""
36180
36250
  };
36181
- return (yield client.shipments.create(__spreadProps$8(__spreadValues$a({}, shipment), {
36251
+ return (yield client.shipments.create(__spreadProps$b(__spreadValues$d({}, shipment), {
36182
36252
  shipTo
36183
36253
  }))).data;
36184
36254
  }),
@@ -36203,33 +36273,33 @@ const useGetShipmentRates = (shipmentId, createdAtStart) => {
36203
36273
  });
36204
36274
  };
36205
36275
 
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) => {
36276
+ var __defProp$c = Object.defineProperty;
36277
+ var __defProps$a = Object.defineProperties;
36278
+ var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
36279
+ var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
36280
+ var __hasOwnProp$e = Object.prototype.hasOwnProperty;
36281
+ var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
36282
+ var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
36283
+ var __spreadValues$c = (a, b) => {
36214
36284
  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]);
36285
+ if (__hasOwnProp$e.call(b, prop))
36286
+ __defNormalProp$c(a, prop, b[prop]);
36287
+ if (__getOwnPropSymbols$e)
36288
+ for (var prop of __getOwnPropSymbols$e(b)) {
36289
+ if (__propIsEnum$e.call(b, prop))
36290
+ __defNormalProp$c(a, prop, b[prop]);
36221
36291
  }
36222
36292
  return a;
36223
36293
  };
36224
- var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
36225
- var __objRest$5 = (source, exclude) => {
36294
+ var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
36295
+ var __objRest$9 = (source, exclude) => {
36226
36296
  var target = {};
36227
36297
  for (var prop in source)
36228
- if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
36298
+ if (__hasOwnProp$e.call(source, prop) && exclude.indexOf(prop) < 0)
36229
36299
  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))
36300
+ if (source != null && __getOwnPropSymbols$e)
36301
+ for (var prop of __getOwnPropSymbols$e(source)) {
36302
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$e.call(source, prop))
36233
36303
  target[prop] = source[prop];
36234
36304
  }
36235
36305
  return target;
@@ -36240,12 +36310,12 @@ const useGetShipment = (params) => {
36240
36310
  const shipmentId = typeof params === "string" ? params : (_a = params == null ? void 0 : params.queryFnParams) == null ? void 0 : _a.shipmentId;
36241
36311
  const getQueryProps = () => {
36242
36312
  if (typeof params !== "string") {
36243
- const _a2 = params, rest = __objRest$5(_a2, ["queryFnParams"]);
36313
+ const _a2 = params, rest = __objRest$9(_a2, ["queryFnParams"]);
36244
36314
  return rest;
36245
36315
  }
36246
36316
  return {};
36247
36317
  };
36248
- return useQuery(__spreadProps$7(__spreadValues$9({}, getQueryProps()), {
36318
+ return useQuery(__spreadProps$a(__spreadValues$c({}, getQueryProps()), {
36249
36319
  enabled: shipmentId !== void 0,
36250
36320
  onError,
36251
36321
  queryFn: () => {
@@ -36259,23 +36329,23 @@ const useGetShipment = (params) => {
36259
36329
  }));
36260
36330
  };
36261
36331
 
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) => {
36332
+ var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
36333
+ var __hasOwnProp$d = Object.prototype.hasOwnProperty;
36334
+ var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
36335
+ var __objRest$8 = (source, exclude) => {
36266
36336
  var target = {};
36267
36337
  for (var prop in source)
36268
- if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
36338
+ if (__hasOwnProp$d.call(source, prop) && exclude.indexOf(prop) < 0)
36269
36339
  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))
36340
+ if (source != null && __getOwnPropSymbols$d)
36341
+ for (var prop of __getOwnPropSymbols$d(source)) {
36342
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$d.call(source, prop))
36273
36343
  target[prop] = source[prop];
36274
36344
  }
36275
36345
  return target;
36276
36346
  };
36277
36347
  const useListShipments = (_params) => {
36278
- const _a = _params || {}, { enabled = true } = _a, params = __objRest$4(_a, ["enabled"]);
36348
+ const _a = _params || {}, { enabled = true } = _a, params = __objRest$8(_a, ["enabled"]);
36279
36349
  const { client } = useShipEngine();
36280
36350
  return useQuery({
36281
36351
  enabled,
@@ -36286,41 +36356,41 @@ const useListShipments = (_params) => {
36286
36356
  });
36287
36357
  };
36288
36358
 
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) => {
36359
+ var __defProp$b = Object.defineProperty;
36360
+ var __defProps$9 = Object.defineProperties;
36361
+ var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
36362
+ var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
36363
+ var __hasOwnProp$c = Object.prototype.hasOwnProperty;
36364
+ var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
36365
+ var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
36366
+ var __spreadValues$b = (a, b) => {
36297
36367
  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]);
36368
+ if (__hasOwnProp$c.call(b, prop))
36369
+ __defNormalProp$b(a, prop, b[prop]);
36370
+ if (__getOwnPropSymbols$c)
36371
+ for (var prop of __getOwnPropSymbols$c(b)) {
36372
+ if (__propIsEnum$c.call(b, prop))
36373
+ __defNormalProp$b(a, prop, b[prop]);
36304
36374
  }
36305
36375
  return a;
36306
36376
  };
36307
- var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
36308
- var __objRest$3 = (source, exclude) => {
36377
+ var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
36378
+ var __objRest$7 = (source, exclude) => {
36309
36379
  var target = {};
36310
36380
  for (var prop in source)
36311
- if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
36381
+ if (__hasOwnProp$c.call(source, prop) && exclude.indexOf(prop) < 0)
36312
36382
  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))
36383
+ if (source != null && __getOwnPropSymbols$c)
36384
+ for (var prop of __getOwnPropSymbols$c(source)) {
36385
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$c.call(source, prop))
36316
36386
  target[prop] = source[prop];
36317
36387
  }
36318
36388
  return target;
36319
36389
  };
36320
36390
  const useGetShipmentByExternalId = (params) => {
36321
36391
  const { client } = useShipEngine();
36322
- const _a = params, { queryFnParams } = _a, rest = __objRest$3(_a, ["queryFnParams"]);
36323
- return useQuery(__spreadProps$6(__spreadValues$8({}, rest), {
36392
+ const _a = params, { queryFnParams } = _a, rest = __objRest$7(_a, ["queryFnParams"]);
36393
+ return useQuery(__spreadProps$9(__spreadValues$b({}, rest), {
36324
36394
  onError,
36325
36395
  queryFn: () => client.shipments.getByExternalId(queryFnParams.externalId),
36326
36396
  queryKey: ["useGetShipmentByExternalId", queryFnParams],
@@ -36328,33 +36398,46 @@ const useGetShipmentByExternalId = (params) => {
36328
36398
  }));
36329
36399
  };
36330
36400
 
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) => {
36401
+ var __defProp$a = Object.defineProperty;
36402
+ var __defProps$8 = Object.defineProperties;
36403
+ var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
36404
+ var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
36405
+ var __hasOwnProp$b = Object.prototype.hasOwnProperty;
36406
+ var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
36407
+ var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
36408
+ var __spreadValues$a = (a, b) => {
36339
36409
  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]);
36410
+ if (__hasOwnProp$b.call(b, prop))
36411
+ __defNormalProp$a(a, prop, b[prop]);
36412
+ if (__getOwnPropSymbols$b)
36413
+ for (var prop of __getOwnPropSymbols$b(b)) {
36414
+ if (__propIsEnum$b.call(b, prop))
36415
+ __defNormalProp$a(a, prop, b[prop]);
36346
36416
  }
36347
36417
  return a;
36348
36418
  };
36349
- var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
36419
+ var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
36420
+ var __objRest$6 = (source, exclude) => {
36421
+ var target = {};
36422
+ for (var prop in source)
36423
+ if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
36424
+ target[prop] = source[prop];
36425
+ if (source != null && __getOwnPropSymbols$b)
36426
+ for (var prop of __getOwnPropSymbols$b(source)) {
36427
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
36428
+ target[prop] = source[prop];
36429
+ }
36430
+ return target;
36431
+ };
36350
36432
  const useListShippingRules = (params) => {
36351
36433
  const { client } = useShipEngine();
36352
- return useQuery(__spreadProps$5(__spreadValues$7({}, params), {
36434
+ const _a = __spreadValues$a({}, params), { queryFnParams } = _a, rest = __objRest$6(_a, ["queryFnParams"]);
36435
+ return useQuery(__spreadProps$8(__spreadValues$a({}, rest), {
36353
36436
  onError,
36354
36437
  queryFn: () => {
36355
- return client.shippingRules.list();
36438
+ return client.shippingRules.list(queryFnParams);
36356
36439
  },
36357
- queryKey: ["useListShippingRules"],
36440
+ queryKey: ["useListShippingRules", queryFnParams],
36358
36441
  select: (result) => result.data.shippingRules
36359
36442
  }));
36360
36443
  };
@@ -36382,8 +36465,8 @@ var __async$c = (__this, __arguments, generator) => {
36382
36465
  const useCreateShippingRule = () => {
36383
36466
  const { client } = useShipEngine();
36384
36467
  return useMutation({
36385
- mutationFn: (shippingRule) => __async$c(void 0, null, function* () {
36386
- const result = yield client.shippingRules.create(shippingRule);
36468
+ mutationFn: (props) => __async$c(void 0, null, function* () {
36469
+ const result = yield client.shippingRules.create(props);
36387
36470
  return result.data;
36388
36471
  }),
36389
36472
  mutationKey: ["useCreateShippingRule"],
@@ -36414,8 +36497,8 @@ var __async$b = (__this, __arguments, generator) => {
36414
36497
  const useDeleteShippingRule = () => {
36415
36498
  const { client } = useShipEngine();
36416
36499
  return useMutation({
36417
- mutationFn: (shippingRuleId) => __async$b(void 0, null, function* () {
36418
- const result = yield client.shippingRules.delete(shippingRuleId);
36500
+ mutationFn: (props) => __async$b(void 0, null, function* () {
36501
+ const result = yield client.shippingRules.delete(props);
36419
36502
  return result.data;
36420
36503
  }),
36421
36504
  mutationKey: ["useDeleteShippingRule"],
@@ -36446,8 +36529,8 @@ var __async$a = (__this, __arguments, generator) => {
36446
36529
  const useEditShippingRule = () => {
36447
36530
  const { client } = useShipEngine();
36448
36531
  return useMutation({
36449
- mutationFn: (shippingRule) => __async$a(void 0, null, function* () {
36450
- const result = yield client.shippingRules.edit(shippingRule);
36532
+ mutationFn: (props) => __async$a(void 0, null, function* () {
36533
+ const result = yield client.shippingRules.edit(props);
36451
36534
  return result.data;
36452
36535
  }),
36453
36536
  mutationKey: ["useEditShippingRule"],
@@ -36455,29 +36538,92 @@ const useEditShippingRule = () => {
36455
36538
  });
36456
36539
  };
36457
36540
 
36458
- const useGetShippingRuleConditionsOptions = () => {
36541
+ var __defProp$9 = Object.defineProperty;
36542
+ var __defProps$7 = Object.defineProperties;
36543
+ var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
36544
+ var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
36545
+ var __hasOwnProp$a = Object.prototype.hasOwnProperty;
36546
+ var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
36547
+ var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
36548
+ var __spreadValues$9 = (a, b) => {
36549
+ for (var prop in b || (b = {}))
36550
+ if (__hasOwnProp$a.call(b, prop))
36551
+ __defNormalProp$9(a, prop, b[prop]);
36552
+ if (__getOwnPropSymbols$a)
36553
+ for (var prop of __getOwnPropSymbols$a(b)) {
36554
+ if (__propIsEnum$a.call(b, prop))
36555
+ __defNormalProp$9(a, prop, b[prop]);
36556
+ }
36557
+ return a;
36558
+ };
36559
+ var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
36560
+ var __objRest$5 = (source, exclude) => {
36561
+ var target = {};
36562
+ for (var prop in source)
36563
+ if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
36564
+ target[prop] = source[prop];
36565
+ if (source != null && __getOwnPropSymbols$a)
36566
+ for (var prop of __getOwnPropSymbols$a(source)) {
36567
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
36568
+ target[prop] = source[prop];
36569
+ }
36570
+ return target;
36571
+ };
36572
+ const useGetShippingRuleConditionsOptions = (params) => {
36459
36573
  const { client } = useShipEngine();
36460
- return useQuery({
36574
+ const _a = __spreadValues$9({}, params), { queryFnParams } = _a, rest = __objRest$5(_a, ["queryFnParams"]);
36575
+ return useQuery(__spreadProps$7(__spreadValues$9({}, rest), {
36461
36576
  onError,
36462
36577
  queryFn: () => {
36463
- return client.shippingRules.getConditionOptions();
36578
+ return client.shippingRules.getConditionOptions(queryFnParams);
36464
36579
  },
36465
- queryKey: ["useGetShippingRuleConditionsOptions"],
36580
+ queryKey: ["useGetShippingRuleConditionsOptions", queryFnParams],
36466
36581
  select: (result) => result.data
36467
- });
36582
+ }));
36468
36583
  };
36469
36584
 
36470
- const useGetShippingRuleById = (shippingRuleId) => {
36585
+ var __defProp$8 = Object.defineProperty;
36586
+ var __defProps$6 = Object.defineProperties;
36587
+ var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
36588
+ var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
36589
+ var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
36590
+ var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
36591
+ var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
36592
+ var __spreadValues$8 = (a, b) => {
36593
+ for (var prop in b || (b = {}))
36594
+ if (__hasOwnProp$9.call(b, prop))
36595
+ __defNormalProp$8(a, prop, b[prop]);
36596
+ if (__getOwnPropSymbols$9)
36597
+ for (var prop of __getOwnPropSymbols$9(b)) {
36598
+ if (__propIsEnum$9.call(b, prop))
36599
+ __defNormalProp$8(a, prop, b[prop]);
36600
+ }
36601
+ return a;
36602
+ };
36603
+ var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
36604
+ var __objRest$4 = (source, exclude) => {
36605
+ var target = {};
36606
+ for (var prop in source)
36607
+ if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
36608
+ target[prop] = source[prop];
36609
+ if (source != null && __getOwnPropSymbols$9)
36610
+ for (var prop of __getOwnPropSymbols$9(source)) {
36611
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$9.call(source, prop))
36612
+ target[prop] = source[prop];
36613
+ }
36614
+ return target;
36615
+ };
36616
+ const useGetShippingRuleById = (params) => {
36471
36617
  const { client } = useShipEngine();
36472
- return useQuery({
36473
- enabled: !!shippingRuleId,
36618
+ const _a = __spreadValues$8({}, params), { queryFnParams } = _a, rest = __objRest$4(_a, ["queryFnParams"]);
36619
+ return useQuery(__spreadProps$6(__spreadValues$8({}, rest), {
36474
36620
  onError,
36475
36621
  queryFn: () => {
36476
- return client.shippingRules.get(shippingRuleId);
36622
+ return client.shippingRules.get(queryFnParams);
36477
36623
  },
36478
- queryKey: ["useGetShippingRuleById", shippingRuleId],
36624
+ queryKey: ["useGetShippingRuleById", queryFnParams],
36479
36625
  select: (result) => result.data
36480
- });
36626
+ }));
36481
36627
  };
36482
36628
 
36483
36629
  const useGetThemeById = (themeId) => {
@@ -36559,16 +36705,46 @@ const useDeleteWarehouse = () => {
36559
36705
  });
36560
36706
  };
36561
36707
 
36562
- const useListWarehouses = (options) => {
36563
- var _a;
36708
+ var __defProp$7 = Object.defineProperty;
36709
+ var __defProps$5 = Object.defineProperties;
36710
+ var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
36711
+ var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
36712
+ var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
36713
+ var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
36714
+ var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
36715
+ var __spreadValues$7 = (a, b) => {
36716
+ for (var prop in b || (b = {}))
36717
+ if (__hasOwnProp$8.call(b, prop))
36718
+ __defNormalProp$7(a, prop, b[prop]);
36719
+ if (__getOwnPropSymbols$8)
36720
+ for (var prop of __getOwnPropSymbols$8(b)) {
36721
+ if (__propIsEnum$8.call(b, prop))
36722
+ __defNormalProp$7(a, prop, b[prop]);
36723
+ }
36724
+ return a;
36725
+ };
36726
+ var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
36727
+ var __objRest$3 = (source, exclude) => {
36728
+ var target = {};
36729
+ for (var prop in source)
36730
+ if (__hasOwnProp$8.call(source, prop) && exclude.indexOf(prop) < 0)
36731
+ target[prop] = source[prop];
36732
+ if (source != null && __getOwnPropSymbols$8)
36733
+ for (var prop of __getOwnPropSymbols$8(source)) {
36734
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$8.call(source, prop))
36735
+ target[prop] = source[prop];
36736
+ }
36737
+ return target;
36738
+ };
36739
+ const useListWarehouses = (params) => {
36564
36740
  const { client } = useShipEngine();
36565
- return useQuery({
36566
- enabled: (_a = options == null ? void 0 : options.enabled) != null ? _a : true,
36741
+ const _a = __spreadValues$7({}, params), { queryFnParams } = _a, rest = __objRest$3(_a, ["queryFnParams"]);
36742
+ return useQuery(__spreadProps$5(__spreadValues$7({}, rest), {
36567
36743
  onError,
36568
- queryFn: () => client.warehouses.list(),
36569
- queryKey: ["useListWarehouses"],
36744
+ queryFn: () => client.warehouses.list(queryFnParams),
36745
+ queryKey: ["useListWarehouses", queryFnParams],
36570
36746
  select: (result) => result.data.warehouses
36571
- });
36747
+ }));
36572
36748
  };
36573
36749
 
36574
36750
  var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
@@ -37416,6 +37592,7 @@ const AlchemyProvider = ({
37416
37592
  cdnURL = "https://cdn.packlink.com",
37417
37593
  container,
37418
37594
  children,
37595
+ getSandboxToken,
37419
37596
  getToken,
37420
37597
  locale: localeProp,
37421
37598
  onError = _default,
@@ -37450,6 +37627,7 @@ const AlchemyProvider = ({
37450
37627
  {
37451
37628
  baseURL,
37452
37629
  headers,
37630
+ getSandboxToken,
37453
37631
  getToken,
37454
37632
  onApiError,
37455
37633
  defaultQueryClientOptions,