@shipengine/alchemy 5.1.4 → 5.1.6

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.
Files changed (3) hide show
  1. package/index.js +177 -119
  2. package/index.mjs +177 -120
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -10786,17 +10786,17 @@ var AccountBillingPlanChangeType = /* @__PURE__ */ ((AccountBillingPlanChangeTyp
10786
10786
  return AccountBillingPlanChangeType2;
10787
10787
  })(AccountBillingPlanChangeType || {});
10788
10788
 
10789
- var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
10790
- var __hasOwnProp$i = Object.prototype.hasOwnProperty;
10791
- var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
10792
- var __objRest$d = (source, exclude) => {
10789
+ var __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
10790
+ var __hasOwnProp$j = Object.prototype.hasOwnProperty;
10791
+ var __propIsEnum$j = Object.prototype.propertyIsEnumerable;
10792
+ var __objRest$e = (source, exclude) => {
10793
10793
  var target = {};
10794
10794
  for (var prop in source)
10795
- if (__hasOwnProp$i.call(source, prop) && exclude.indexOf(prop) < 0)
10795
+ if (__hasOwnProp$j.call(source, prop) && exclude.indexOf(prop) < 0)
10796
10796
  target[prop] = source[prop];
10797
- if (source != null && __getOwnPropSymbols$i)
10798
- for (var prop of __getOwnPropSymbols$i(source)) {
10799
- if (exclude.indexOf(prop) < 0 && __propIsEnum$i.call(source, prop))
10797
+ if (source != null && __getOwnPropSymbols$j)
10798
+ for (var prop of __getOwnPropSymbols$j(source)) {
10799
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$j.call(source, prop))
10800
10800
  target[prop] = source[prop];
10801
10801
  }
10802
10802
  return target;
@@ -10810,7 +10810,7 @@ class CodedError {
10810
10810
  this.message = message;
10811
10811
  }
10812
10812
  static fromObject(_a) {
10813
- var _b = _a, { message } = _b, options = __objRest$d(_b, ["message"]);
10813
+ var _b = _a, { message } = _b, options = __objRest$e(_b, ["message"]);
10814
10814
  return new CodedError(message, options);
10815
10815
  }
10816
10816
  }
@@ -10918,17 +10918,17 @@ const types = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
10918
10918
  RateCardStatus
10919
10919
  }, Symbol.toStringTag, { value: 'Module' }));
10920
10920
 
10921
- var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
10922
- var __hasOwnProp$h = Object.prototype.hasOwnProperty;
10923
- var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
10924
- var __objRest$c = (source, exclude) => {
10921
+ var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
10922
+ var __hasOwnProp$i = Object.prototype.hasOwnProperty;
10923
+ var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
10924
+ var __objRest$d = (source, exclude) => {
10925
10925
  var target = {};
10926
10926
  for (var prop in source)
10927
- if (__hasOwnProp$h.call(source, prop) && exclude.indexOf(prop) < 0)
10927
+ if (__hasOwnProp$i.call(source, prop) && exclude.indexOf(prop) < 0)
10928
10928
  target[prop] = source[prop];
10929
- if (source != null && __getOwnPropSymbols$h)
10930
- for (var prop of __getOwnPropSymbols$h(source)) {
10931
- if (exclude.indexOf(prop) < 0 && __propIsEnum$h.call(source, prop))
10929
+ if (source != null && __getOwnPropSymbols$i)
10930
+ for (var prop of __getOwnPropSymbols$i(source)) {
10931
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$i.call(source, prop))
10932
10932
  target[prop] = source[prop];
10933
10933
  }
10934
10934
  return target;
@@ -10960,7 +10960,7 @@ class AccountSettingsAPI {
10960
10960
  * The `updateImage` method updates specific image data for a given image id.
10961
10961
  */
10962
10962
  this.updateImage = (_a) => {
10963
- var _b = _a, { labelImageId } = _b, data = __objRest$c(_b, ["labelImageId"]);
10963
+ var _b = _a, { labelImageId } = _b, data = __objRest$d(_b, ["labelImageId"]);
10964
10964
  return this.client.put(`/v1/account/settings/images/${labelImageId}`, data);
10965
10965
  };
10966
10966
  /**
@@ -13655,7 +13655,7 @@ var ipaddr = {
13655
13655
  }).call(commonjsGlobal);
13656
13656
  } (ipaddr));
13657
13657
 
13658
- var __async$D = (__this, __arguments, generator) => {
13658
+ var __async$E = (__this, __arguments, generator) => {
13659
13659
  return new Promise((resolve, reject) => {
13660
13660
  var fulfilled = (value) => {
13661
13661
  try {
@@ -13675,7 +13675,7 @@ var __async$D = (__this, __arguments, generator) => {
13675
13675
  step((generator = generator.apply(__this, __arguments)).next());
13676
13676
  });
13677
13677
  };
13678
- const getEndUserIpAddress = () => __async$D(void 0, null, function* () {
13678
+ const getEndUserIpAddress = () => __async$E(void 0, null, function* () {
13679
13679
  try {
13680
13680
  const response = yield axios.get("https://api.ipify.org/?format=json");
13681
13681
  if (response.data.ip && ipaddrExports.isValid(response.data.ip)) {
@@ -13690,35 +13690,35 @@ const getEndUserIpAddress = () => __async$D(void 0, null, function* () {
13690
13690
  var __defProp$6 = Object.defineProperty;
13691
13691
  var __defProps$3 = Object.defineProperties;
13692
13692
  var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
13693
- var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
13694
- var __hasOwnProp$g = Object.prototype.hasOwnProperty;
13695
- var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
13693
+ var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
13694
+ var __hasOwnProp$h = Object.prototype.hasOwnProperty;
13695
+ var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
13696
13696
  var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13697
13697
  var __spreadValues$6 = (a, b) => {
13698
13698
  for (var prop in b || (b = {}))
13699
- if (__hasOwnProp$g.call(b, prop))
13699
+ if (__hasOwnProp$h.call(b, prop))
13700
13700
  __defNormalProp$6(a, prop, b[prop]);
13701
- if (__getOwnPropSymbols$g)
13702
- for (var prop of __getOwnPropSymbols$g(b)) {
13703
- if (__propIsEnum$g.call(b, prop))
13701
+ if (__getOwnPropSymbols$h)
13702
+ for (var prop of __getOwnPropSymbols$h(b)) {
13703
+ if (__propIsEnum$h.call(b, prop))
13704
13704
  __defNormalProp$6(a, prop, b[prop]);
13705
13705
  }
13706
13706
  return a;
13707
13707
  };
13708
13708
  var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
13709
- var __objRest$b = (source, exclude) => {
13709
+ var __objRest$c = (source, exclude) => {
13710
13710
  var target = {};
13711
13711
  for (var prop in source)
13712
- if (__hasOwnProp$g.call(source, prop) && exclude.indexOf(prop) < 0)
13712
+ if (__hasOwnProp$h.call(source, prop) && exclude.indexOf(prop) < 0)
13713
13713
  target[prop] = source[prop];
13714
- if (source != null && __getOwnPropSymbols$g)
13715
- for (var prop of __getOwnPropSymbols$g(source)) {
13716
- if (exclude.indexOf(prop) < 0 && __propIsEnum$g.call(source, prop))
13714
+ if (source != null && __getOwnPropSymbols$h)
13715
+ for (var prop of __getOwnPropSymbols$h(source)) {
13716
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$h.call(source, prop))
13717
13717
  target[prop] = source[prop];
13718
13718
  }
13719
13719
  return target;
13720
13720
  };
13721
- var __async$C = (__this, __arguments, generator) => {
13721
+ var __async$D = (__this, __arguments, generator) => {
13722
13722
  return new Promise((resolve, reject) => {
13723
13723
  var fulfilled = (value) => {
13724
13724
  try {
@@ -13756,8 +13756,8 @@ class CarriersAPI {
13756
13756
  /**
13757
13757
  * The `connect` method connects a carrier account to a user's ShipEngine account.
13758
13758
  */
13759
- this.connect = (_a) => __async$C(this, null, function* () {
13760
- var _b = _a, { carrierCode } = _b, connection = __objRest$b(_b, ["carrierCode"]);
13759
+ this.connect = (_a) => __async$D(this, null, function* () {
13760
+ var _b = _a, { carrierCode } = _b, connection = __objRest$c(_b, ["carrierCode"]);
13761
13761
  const endUserIpAddress = yield getEndUserIpAddress();
13762
13762
  if (!endUserIpAddress)
13763
13763
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -16073,22 +16073,22 @@ class CustomPackagesAPI {
16073
16073
  }
16074
16074
 
16075
16075
  var __defProp$5 = Object.defineProperty;
16076
- var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
16077
- var __hasOwnProp$f = Object.prototype.hasOwnProperty;
16078
- var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
16076
+ var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
16077
+ var __hasOwnProp$g = Object.prototype.hasOwnProperty;
16078
+ var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
16079
16079
  var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16080
16080
  var __spreadValues$5 = (a, b) => {
16081
16081
  for (var prop in b || (b = {}))
16082
- if (__hasOwnProp$f.call(b, prop))
16082
+ if (__hasOwnProp$g.call(b, prop))
16083
16083
  __defNormalProp$5(a, prop, b[prop]);
16084
- if (__getOwnPropSymbols$f)
16085
- for (var prop of __getOwnPropSymbols$f(b)) {
16086
- if (__propIsEnum$f.call(b, prop))
16084
+ if (__getOwnPropSymbols$g)
16085
+ for (var prop of __getOwnPropSymbols$g(b)) {
16086
+ if (__propIsEnum$g.call(b, prop))
16087
16087
  __defNormalProp$5(a, prop, b[prop]);
16088
16088
  }
16089
16089
  return a;
16090
16090
  };
16091
- var __async$B = (__this, __arguments, generator) => {
16091
+ var __async$C = (__this, __arguments, generator) => {
16092
16092
  return new Promise((resolve, reject) => {
16093
16093
  var fulfilled = (value) => {
16094
16094
  try {
@@ -16127,7 +16127,7 @@ class FundingSourcesAPI {
16127
16127
  * The `create` method creates a new funding source for a given user. This requires
16128
16128
  * payment information to be collected from the user.
16129
16129
  */
16130
- this.create = (createFundingSource) => __async$B(this, null, function* () {
16130
+ this.create = (createFundingSource) => __async$C(this, null, function* () {
16131
16131
  const endUserIpAddress = yield getEndUserIpAddress();
16132
16132
  if (!endUserIpAddress)
16133
16133
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -16140,7 +16140,7 @@ class FundingSourcesAPI {
16140
16140
  * user to update the billing address or payment information associated with the
16141
16141
  * funding source.
16142
16142
  */
16143
- this.update = (billingInfo, creditCardInfo, fundingSourceId) => __async$B(this, null, function* () {
16143
+ this.update = (billingInfo, creditCardInfo, fundingSourceId) => __async$C(this, null, function* () {
16144
16144
  const endUserIpAddress = yield getEndUserIpAddress();
16145
16145
  if (!endUserIpAddress)
16146
16146
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -16157,7 +16157,7 @@ class FundingSourcesAPI {
16157
16157
  * The `registerCarrier` method registers a carrier account and associates
16158
16158
  * it with a given funding source.
16159
16159
  */
16160
- this.registerCarrier = (carrier) => __async$B(this, null, function* () {
16160
+ this.registerCarrier = (carrier) => __async$C(this, null, function* () {
16161
16161
  const endUserIpAddress = yield getEndUserIpAddress();
16162
16162
  if (!endUserIpAddress)
16163
16163
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -16168,7 +16168,7 @@ class FundingSourcesAPI {
16168
16168
  /**
16169
16169
  * The `addFunds` method allows you to add funds to a funding source.
16170
16170
  */
16171
- this.addFunds = (amount, fundingSourceId) => __async$B(this, null, function* () {
16171
+ this.addFunds = (amount, fundingSourceId) => __async$C(this, null, function* () {
16172
16172
  return yield this.client.put(
16173
16173
  `/v1/funding_sources/${fundingSourceId}/add_funds`,
16174
16174
  amount
@@ -16178,7 +16178,7 @@ class FundingSourcesAPI {
16178
16178
  * The `metadata` method returns seller-specific requirements for creating funding sources
16179
16179
  * and attaching carriers
16180
16180
  */
16181
- this.metadata = () => __async$B(this, null, function* () {
16181
+ this.metadata = () => __async$C(this, null, function* () {
16182
16182
  return yield this.client.get("/v1/funding_sources/metadata");
16183
16183
  });
16184
16184
  /**
@@ -16207,6 +16207,15 @@ class InsuranceAPI {
16207
16207
  this.get = (insuranceProvider) => {
16208
16208
  return this.client.get(`/v1/insurance/${insuranceProvider}/balance`);
16209
16209
  };
16210
+ /**
16211
+ * The `addFunds` method add funds to the account balance of the given `insuranceProvider`.
16212
+ */
16213
+ this.addFunds = (insuranceProvider, params) => {
16214
+ return this.client.patch(
16215
+ `/v1/insurance/${insuranceProvider}/add_funds`,
16216
+ params
16217
+ );
16218
+ };
16210
16219
  this.client = client;
16211
16220
  }
16212
16221
  }
@@ -16427,7 +16436,7 @@ class SalesOrdersAPI {
16427
16436
  }
16428
16437
  }
16429
16438
 
16430
- var __async$A = (__this, __arguments, generator) => {
16439
+ var __async$B = (__this, __arguments, generator) => {
16431
16440
  return new Promise((resolve, reject) => {
16432
16441
  var fulfilled = (value) => {
16433
16442
  try {
@@ -16470,7 +16479,7 @@ class ShipmentsAPI {
16470
16479
  * The `create` method allows for creating shipments based on a list of shipment
16471
16480
  * items passed into this method.
16472
16481
  */
16473
- this.create = (...shipments) => __async$A(this, null, function* () {
16482
+ this.create = (...shipments) => __async$B(this, null, function* () {
16474
16483
  return this.client.post("/v1/shipments", {
16475
16484
  shipments
16476
16485
  });
@@ -16577,23 +16586,23 @@ class WarehousesAPI {
16577
16586
  var __defProp$4 = Object.defineProperty;
16578
16587
  var __defProps$2 = Object.defineProperties;
16579
16588
  var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
16580
- var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
16581
- var __hasOwnProp$e = Object.prototype.hasOwnProperty;
16582
- var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
16589
+ var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
16590
+ var __hasOwnProp$f = Object.prototype.hasOwnProperty;
16591
+ var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
16583
16592
  var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16584
16593
  var __spreadValues$4 = (a, b) => {
16585
16594
  for (var prop in b || (b = {}))
16586
- if (__hasOwnProp$e.call(b, prop))
16595
+ if (__hasOwnProp$f.call(b, prop))
16587
16596
  __defNormalProp$4(a, prop, b[prop]);
16588
- if (__getOwnPropSymbols$e)
16589
- for (var prop of __getOwnPropSymbols$e(b)) {
16590
- if (__propIsEnum$e.call(b, prop))
16597
+ if (__getOwnPropSymbols$f)
16598
+ for (var prop of __getOwnPropSymbols$f(b)) {
16599
+ if (__propIsEnum$f.call(b, prop))
16591
16600
  __defNormalProp$4(a, prop, b[prop]);
16592
16601
  }
16593
16602
  return a;
16594
16603
  };
16595
16604
  var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
16596
- var __async$z = (__this, __arguments, generator) => {
16605
+ var __async$A = (__this, __arguments, generator) => {
16597
16606
  return new Promise((resolve, reject) => {
16598
16607
  var fulfilled = (value) => {
16599
16608
  try {
@@ -16687,7 +16696,7 @@ class ShipEngineAPI {
16687
16696
  );
16688
16697
  return res;
16689
16698
  },
16690
- (err) => __async$z(this, null, function* () {
16699
+ (err) => __async$A(this, null, function* () {
16691
16700
  var _a, _b, _c, _d, _e, _f;
16692
16701
  logger$1.error(
16693
16702
  { err, req: err.config, res: err.response },
@@ -16945,17 +16954,17 @@ const onError = (_errors) => _default();
16945
16954
  var __defProp$3 = Object.defineProperty;
16946
16955
  var __defProps$1 = Object.defineProperties;
16947
16956
  var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
16948
- var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
16949
- var __hasOwnProp$d = Object.prototype.hasOwnProperty;
16950
- var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
16957
+ var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
16958
+ var __hasOwnProp$e = Object.prototype.hasOwnProperty;
16959
+ var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
16951
16960
  var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16952
16961
  var __spreadValues$3 = (a, b) => {
16953
16962
  for (var prop in b || (b = {}))
16954
- if (__hasOwnProp$d.call(b, prop))
16963
+ if (__hasOwnProp$e.call(b, prop))
16955
16964
  __defNormalProp$3(a, prop, b[prop]);
16956
- if (__getOwnPropSymbols$d)
16957
- for (var prop of __getOwnPropSymbols$d(b)) {
16958
- if (__propIsEnum$d.call(b, prop))
16965
+ if (__getOwnPropSymbols$e)
16966
+ for (var prop of __getOwnPropSymbols$e(b)) {
16967
+ if (__propIsEnum$e.call(b, prop))
16959
16968
  __defNormalProp$3(a, prop, b[prop]);
16960
16969
  }
16961
16970
  return a;
@@ -16994,7 +17003,7 @@ const retryUntil = (callbackFn, retries = 10, timeoutBetweenAttempts = 1e3) => P
16994
17003
  throw error;
16995
17004
  });
16996
17005
 
16997
- var __async$y = (__this, __arguments, generator) => {
17006
+ var __async$z = (__this, __arguments, generator) => {
16998
17007
  return new Promise((resolve, reject) => {
16999
17008
  var fulfilled = (value) => {
17000
17009
  try {
@@ -17017,7 +17026,7 @@ var __async$y = (__this, __arguments, generator) => {
17017
17026
  const useCreateAccountImage = () => {
17018
17027
  const { client } = useShipEngine();
17019
17028
  return reactQuery.useMutation({
17020
- mutationFn: (data) => __async$y(void 0, null, function* () {
17029
+ mutationFn: (data) => __async$z(void 0, null, function* () {
17021
17030
  const result = yield client.accountSettings.createImage(data);
17022
17031
  return result.data;
17023
17032
  }),
@@ -17026,7 +17035,7 @@ const useCreateAccountImage = () => {
17026
17035
  });
17027
17036
  };
17028
17037
 
17029
- var __async$x = (__this, __arguments, generator) => {
17038
+ var __async$y = (__this, __arguments, generator) => {
17030
17039
  return new Promise((resolve, reject) => {
17031
17040
  var fulfilled = (value) => {
17032
17041
  try {
@@ -17049,7 +17058,7 @@ var __async$x = (__this, __arguments, generator) => {
17049
17058
  const useDeleteAccountImage = () => {
17050
17059
  const { client } = useShipEngine();
17051
17060
  return reactQuery.useMutation({
17052
- mutationFn: (labelImageId) => __async$x(void 0, null, function* () {
17061
+ mutationFn: (labelImageId) => __async$y(void 0, null, function* () {
17053
17062
  const result = yield client.accountSettings.deleteImage(labelImageId);
17054
17063
  return result.data;
17055
17064
  }),
@@ -17078,7 +17087,7 @@ const useGetAccountSettings = () => {
17078
17087
  });
17079
17088
  };
17080
17089
 
17081
- var __async$w = (__this, __arguments, generator) => {
17090
+ var __async$x = (__this, __arguments, generator) => {
17082
17091
  return new Promise((resolve, reject) => {
17083
17092
  var fulfilled = (value) => {
17084
17093
  try {
@@ -17101,7 +17110,7 @@ var __async$w = (__this, __arguments, generator) => {
17101
17110
  const useUpdateAccountImage = () => {
17102
17111
  const { client } = useShipEngine();
17103
17112
  return reactQuery.useMutation({
17104
- mutationFn: (data) => __async$w(void 0, null, function* () {
17113
+ mutationFn: (data) => __async$x(void 0, null, function* () {
17105
17114
  const result = yield client.accountSettings.updateImage(data);
17106
17115
  return result.data;
17107
17116
  }),
@@ -17110,7 +17119,7 @@ const useUpdateAccountImage = () => {
17110
17119
  });
17111
17120
  };
17112
17121
 
17113
- var __async$v = (__this, __arguments, generator) => {
17122
+ var __async$w = (__this, __arguments, generator) => {
17114
17123
  return new Promise((resolve, reject) => {
17115
17124
  var fulfilled = (value) => {
17116
17125
  try {
@@ -17133,7 +17142,7 @@ var __async$v = (__this, __arguments, generator) => {
17133
17142
  const useUpdateAccountSettings = () => {
17134
17143
  const { client } = useShipEngine();
17135
17144
  return reactQuery.useMutation({
17136
- mutationFn: (settings) => __async$v(void 0, null, function* () {
17145
+ mutationFn: (settings) => __async$w(void 0, null, function* () {
17137
17146
  const result = yield client.accountSettings.update(settings);
17138
17147
  return result.data;
17139
17148
  }),
@@ -17142,7 +17151,7 @@ const useUpdateAccountSettings = () => {
17142
17151
  });
17143
17152
  };
17144
17153
 
17145
- var __async$u = (__this, __arguments, generator) => {
17154
+ var __async$v = (__this, __arguments, generator) => {
17146
17155
  return new Promise((resolve, reject) => {
17147
17156
  var fulfilled = (value) => {
17148
17157
  try {
@@ -17165,7 +17174,7 @@ var __async$u = (__this, __arguments, generator) => {
17165
17174
  const useParseAddress = () => {
17166
17175
  const { client } = useShipEngine();
17167
17176
  return reactQuery.useMutation({
17168
- mutationFn: (_0) => __async$u(void 0, [_0], function* ({ address, text }) {
17177
+ mutationFn: (_0) => __async$v(void 0, [_0], function* ({ address, text }) {
17169
17178
  const result = yield client.addresses.parse(text, address);
17170
17179
  return result.data;
17171
17180
  }),
@@ -17174,7 +17183,7 @@ const useParseAddress = () => {
17174
17183
  });
17175
17184
  };
17176
17185
 
17177
- var __async$t = (__this, __arguments, generator) => {
17186
+ var __async$u = (__this, __arguments, generator) => {
17178
17187
  return new Promise((resolve, reject) => {
17179
17188
  var fulfilled = (value) => {
17180
17189
  try {
@@ -17197,7 +17206,7 @@ var __async$t = (__this, __arguments, generator) => {
17197
17206
  const useValidateAddresses = () => {
17198
17207
  const { client } = useShipEngine();
17199
17208
  return reactQuery.useMutation({
17200
- mutationFn: (addresses) => __async$t(void 0, null, function* () {
17209
+ mutationFn: (addresses) => __async$u(void 0, null, function* () {
17201
17210
  const result = yield client.addresses.validate(addresses);
17202
17211
  return result.data;
17203
17212
  }),
@@ -17206,7 +17215,7 @@ const useValidateAddresses = () => {
17206
17215
  });
17207
17216
  };
17208
17217
 
17209
- var __async$s = (__this, __arguments, generator) => {
17218
+ var __async$t = (__this, __arguments, generator) => {
17210
17219
  return new Promise((resolve, reject) => {
17211
17220
  var fulfilled = (value) => {
17212
17221
  try {
@@ -17229,7 +17238,7 @@ var __async$s = (__this, __arguments, generator) => {
17229
17238
  const useAddFunds = () => {
17230
17239
  const { client } = useShipEngine();
17231
17240
  return reactQuery.useMutation({
17232
- mutationFn: (_0) => __async$s(void 0, [_0], function* ({ carrierId, funds }) {
17241
+ mutationFn: (_0) => __async$t(void 0, [_0], function* ({ carrierId, funds }) {
17233
17242
  const result = yield client.carriers.addFunds(carrierId, funds);
17234
17243
  return result.data;
17235
17244
  }),
@@ -17238,7 +17247,7 @@ const useAddFunds = () => {
17238
17247
  });
17239
17248
  };
17240
17249
 
17241
- var __async$r = (__this, __arguments, generator) => {
17250
+ var __async$s = (__this, __arguments, generator) => {
17242
17251
  return new Promise((resolve, reject) => {
17243
17252
  var fulfilled = (value) => {
17244
17253
  try {
@@ -17261,7 +17270,7 @@ var __async$r = (__this, __arguments, generator) => {
17261
17270
  const useConnectCarrier = () => {
17262
17271
  const { client } = useShipEngine();
17263
17272
  return reactQuery.useMutation({
17264
- mutationFn: (params) => __async$r(void 0, null, function* () {
17273
+ mutationFn: (params) => __async$s(void 0, null, function* () {
17265
17274
  const result = yield client.carriers.connect(params);
17266
17275
  return result.data;
17267
17276
  }),
@@ -17380,22 +17389,22 @@ const useListCarriers = () => {
17380
17389
  });
17381
17390
  };
17382
17391
 
17383
- var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
17384
- var __hasOwnProp$c = Object.prototype.hasOwnProperty;
17385
- var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
17386
- var __objRest$a = (source, exclude) => {
17392
+ var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
17393
+ var __hasOwnProp$d = Object.prototype.hasOwnProperty;
17394
+ var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
17395
+ var __objRest$b = (source, exclude) => {
17387
17396
  var target = {};
17388
17397
  for (var prop in source)
17389
- if (__hasOwnProp$c.call(source, prop) && exclude.indexOf(prop) < 0)
17398
+ if (__hasOwnProp$d.call(source, prop) && exclude.indexOf(prop) < 0)
17390
17399
  target[prop] = source[prop];
17391
- if (source != null && __getOwnPropSymbols$c)
17392
- for (var prop of __getOwnPropSymbols$c(source)) {
17393
- if (exclude.indexOf(prop) < 0 && __propIsEnum$c.call(source, prop))
17400
+ if (source != null && __getOwnPropSymbols$d)
17401
+ for (var prop of __getOwnPropSymbols$d(source)) {
17402
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$d.call(source, prop))
17394
17403
  target[prop] = source[prop];
17395
17404
  }
17396
17405
  return target;
17397
17406
  };
17398
- var __async$q = (__this, __arguments, generator) => {
17407
+ var __async$r = (__this, __arguments, generator) => {
17399
17408
  return new Promise((resolve, reject) => {
17400
17409
  var fulfilled = (value) => {
17401
17410
  try {
@@ -17419,8 +17428,8 @@ const useUpdateAutoFunding = () => {
17419
17428
  const { client } = useShipEngine();
17420
17429
  const queryClient = reactQuery.useQueryClient();
17421
17430
  return reactQuery.useMutation({
17422
- mutationFn: (_a) => __async$q(void 0, null, function* () {
17423
- var _b = _a, { carrierId } = _b, options = __objRest$a(_b, ["carrierId"]);
17431
+ mutationFn: (_a) => __async$r(void 0, null, function* () {
17432
+ var _b = _a, { carrierId } = _b, options = __objRest$b(_b, ["carrierId"]);
17424
17433
  const result = yield client.carriers.updateAutoFunding(carrierId, options);
17425
17434
  return result.data;
17426
17435
  }),
@@ -17449,24 +17458,24 @@ const useGetZonesByCarrier = (carrierId) => {
17449
17458
  });
17450
17459
  };
17451
17460
 
17452
- var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
17453
- var __hasOwnProp$b = Object.prototype.hasOwnProperty;
17454
- var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
17455
- var __objRest$9 = (source, exclude) => {
17461
+ var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
17462
+ var __hasOwnProp$c = Object.prototype.hasOwnProperty;
17463
+ var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
17464
+ var __objRest$a = (source, exclude) => {
17456
17465
  var target = {};
17457
17466
  for (var prop in source)
17458
- if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
17467
+ if (__hasOwnProp$c.call(source, prop) && exclude.indexOf(prop) < 0)
17459
17468
  target[prop] = source[prop];
17460
- if (source != null && __getOwnPropSymbols$b)
17461
- for (var prop of __getOwnPropSymbols$b(source)) {
17462
- if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
17469
+ if (source != null && __getOwnPropSymbols$c)
17470
+ for (var prop of __getOwnPropSymbols$c(source)) {
17471
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$c.call(source, prop))
17463
17472
  target[prop] = source[prop];
17464
17473
  }
17465
17474
  return target;
17466
17475
  };
17467
17476
  const useGetCarrierConnectionForm = (_params) => {
17468
17477
  const { client } = useShipEngine();
17469
- const _a = _params || {}, { carrierName, enabled = true } = _a, params = __objRest$9(_a, ["carrierName", "enabled"]);
17478
+ const _a = _params || {}, { carrierName, enabled = true } = _a, params = __objRest$a(_a, ["carrierName", "enabled"]);
17470
17479
  return reactQuery.useQuery({
17471
17480
  enabled,
17472
17481
  onError,
@@ -17476,24 +17485,24 @@ const useGetCarrierConnectionForm = (_params) => {
17476
17485
  });
17477
17486
  };
17478
17487
 
17479
- var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
17480
- var __hasOwnProp$a = Object.prototype.hasOwnProperty;
17481
- var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
17482
- var __objRest$8 = (source, exclude) => {
17488
+ var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
17489
+ var __hasOwnProp$b = Object.prototype.hasOwnProperty;
17490
+ var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
17491
+ var __objRest$9 = (source, exclude) => {
17483
17492
  var target = {};
17484
17493
  for (var prop in source)
17485
- if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
17494
+ if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
17486
17495
  target[prop] = source[prop];
17487
- if (source != null && __getOwnPropSymbols$a)
17488
- for (var prop of __getOwnPropSymbols$a(source)) {
17489
- if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
17496
+ if (source != null && __getOwnPropSymbols$b)
17497
+ for (var prop of __getOwnPropSymbols$b(source)) {
17498
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
17490
17499
  target[prop] = source[prop];
17491
17500
  }
17492
17501
  return target;
17493
17502
  };
17494
17503
  const useListCarrierConnections = (_params) => {
17495
17504
  const { client } = useShipEngine();
17496
- const _a = _params || {}, { enabled = true } = _a, params = __objRest$8(_a, ["enabled"]);
17505
+ const _a = _params || {}, { enabled = true } = _a, params = __objRest$9(_a, ["enabled"]);
17497
17506
  return reactQuery.useQuery({
17498
17507
  enabled,
17499
17508
  onError,
@@ -17513,7 +17522,7 @@ const useListCustomPackageTypes = () => {
17513
17522
  });
17514
17523
  };
17515
17524
 
17516
- var __async$p = (__this, __arguments, generator) => {
17525
+ var __async$q = (__this, __arguments, generator) => {
17517
17526
  return new Promise((resolve, reject) => {
17518
17527
  var fulfilled = (value) => {
17519
17528
  try {
@@ -17536,7 +17545,7 @@ var __async$p = (__this, __arguments, generator) => {
17536
17545
  const useCreateFundingSource = () => {
17537
17546
  const { client } = useShipEngine();
17538
17547
  return reactQuery.useMutation({
17539
- mutationFn: (fundingSource) => __async$p(void 0, null, function* () {
17548
+ mutationFn: (fundingSource) => __async$q(void 0, null, function* () {
17540
17549
  const result = yield client.fundingSources.create(fundingSource);
17541
17550
  return result.data;
17542
17551
  }),
@@ -17545,7 +17554,7 @@ const useCreateFundingSource = () => {
17545
17554
  });
17546
17555
  };
17547
17556
 
17548
- var __async$o = (__this, __arguments, generator) => {
17557
+ var __async$p = (__this, __arguments, generator) => {
17549
17558
  return new Promise((resolve, reject) => {
17550
17559
  var fulfilled = (value) => {
17551
17560
  try {
@@ -17568,7 +17577,7 @@ var __async$o = (__this, __arguments, generator) => {
17568
17577
  const useFundingSourcesAddFunds = () => {
17569
17578
  const { client } = useShipEngine();
17570
17579
  return reactQuery.useMutation({
17571
- mutationFn: (_0) => __async$o(void 0, [_0], function* ({ funds, fundingSourceId }) {
17580
+ mutationFn: (_0) => __async$p(void 0, [_0], function* ({ funds, fundingSourceId }) {
17572
17581
  const result = yield client.fundingSources.addFunds(funds, fundingSourceId);
17573
17582
  return result.data;
17574
17583
  }),
@@ -17597,7 +17606,7 @@ const useListFundingSources = () => {
17597
17606
  });
17598
17607
  };
17599
17608
 
17600
- var __async$n = (__this, __arguments, generator) => {
17609
+ var __async$o = (__this, __arguments, generator) => {
17601
17610
  return new Promise((resolve, reject) => {
17602
17611
  var fulfilled = (value) => {
17603
17612
  try {
@@ -17620,7 +17629,7 @@ var __async$n = (__this, __arguments, generator) => {
17620
17629
  const useRegisterCarrier = () => {
17621
17630
  const { client } = useShipEngine();
17622
17631
  return reactQuery.useMutation({
17623
- mutationFn: (carrier) => __async$n(void 0, null, function* () {
17632
+ mutationFn: (carrier) => __async$o(void 0, null, function* () {
17624
17633
  const result = yield client.fundingSources.registerCarrier(carrier);
17625
17634
  return result.data;
17626
17635
  }),
@@ -17629,7 +17638,7 @@ const useRegisterCarrier = () => {
17629
17638
  });
17630
17639
  };
17631
17640
 
17632
- var __async$m = (__this, __arguments, generator) => {
17641
+ var __async$n = (__this, __arguments, generator) => {
17633
17642
  return new Promise((resolve, reject) => {
17634
17643
  var fulfilled = (value) => {
17635
17644
  try {
@@ -17652,7 +17661,7 @@ var __async$m = (__this, __arguments, generator) => {
17652
17661
  const useUpdateFundingSource = () => {
17653
17662
  const { client } = useShipEngine();
17654
17663
  return reactQuery.useMutation({
17655
- mutationFn: (_0) => __async$m(void 0, [_0], function* ({
17664
+ mutationFn: (_0) => __async$n(void 0, [_0], function* ({
17656
17665
  billingInfo,
17657
17666
  creditCardInfo,
17658
17667
  fundingSourceId
@@ -17706,6 +17715,54 @@ const useGetInsuranceAccount = (insuranceProvider) => {
17706
17715
  });
17707
17716
  };
17708
17717
 
17718
+ var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
17719
+ var __hasOwnProp$a = Object.prototype.hasOwnProperty;
17720
+ var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
17721
+ var __objRest$8 = (source, exclude) => {
17722
+ var target = {};
17723
+ for (var prop in source)
17724
+ if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
17725
+ target[prop] = source[prop];
17726
+ if (source != null && __getOwnPropSymbols$a)
17727
+ for (var prop of __getOwnPropSymbols$a(source)) {
17728
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
17729
+ target[prop] = source[prop];
17730
+ }
17731
+ return target;
17732
+ };
17733
+ var __async$m = (__this, __arguments, generator) => {
17734
+ return new Promise((resolve, reject) => {
17735
+ var fulfilled = (value) => {
17736
+ try {
17737
+ step(generator.next(value));
17738
+ } catch (e) {
17739
+ reject(e);
17740
+ }
17741
+ };
17742
+ var rejected = (value) => {
17743
+ try {
17744
+ step(generator.throw(value));
17745
+ } catch (e) {
17746
+ reject(e);
17747
+ }
17748
+ };
17749
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
17750
+ step((generator = generator.apply(__this, __arguments)).next());
17751
+ });
17752
+ };
17753
+ const useAddInsuranceFunds = () => {
17754
+ const { client } = useShipEngine();
17755
+ return reactQuery.useMutation({
17756
+ mutationFn: (_a) => __async$m(void 0, null, function* () {
17757
+ var _b = _a, { insuranceProvider } = _b, rest = __objRest$8(_b, ["insuranceProvider"]);
17758
+ const result = yield client.insurance.addFunds(insuranceProvider, rest);
17759
+ return result.data;
17760
+ }),
17761
+ mutationKey: ["useAddInsuranceFunds"],
17762
+ onError
17763
+ });
17764
+ };
17765
+
17709
17766
  var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
17710
17767
  var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
17711
17768
  var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
@@ -19954,6 +20011,7 @@ exports.onError = onError;
19954
20011
  exports.parseError = parseError;
19955
20012
  exports.retryUntil = retryUntil;
19956
20013
  exports.useAddFunds = useAddFunds;
20014
+ exports.useAddInsuranceFunds = useAddInsuranceFunds;
19957
20015
  exports.useAlchemy = useAlchemy;
19958
20016
  exports.useCalculateRates = useCalculateRates;
19959
20017
  exports.useConnectCarrier = useConnectCarrier;