@shipengine/alchemy 5.4.13 → 5.4.15

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 +190 -115
  2. package/index.mjs +190 -116
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -10812,17 +10812,17 @@ var AccountBillingPlanChangeType = /* @__PURE__ */ ((AccountBillingPlanChangeTyp
10812
10812
  return AccountBillingPlanChangeType2;
10813
10813
  })(AccountBillingPlanChangeType || {});
10814
10814
 
10815
- var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
10816
- var __hasOwnProp$q = Object.prototype.hasOwnProperty;
10817
- var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
10815
+ var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
10816
+ var __hasOwnProp$r = Object.prototype.hasOwnProperty;
10817
+ var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
10818
10818
  var __objRest$f = (source, exclude) => {
10819
10819
  var target = {};
10820
10820
  for (var prop in source)
10821
- if (__hasOwnProp$q.call(source, prop) && exclude.indexOf(prop) < 0)
10821
+ if (__hasOwnProp$r.call(source, prop) && exclude.indexOf(prop) < 0)
10822
10822
  target[prop] = source[prop];
10823
- if (source != null && __getOwnPropSymbols$q)
10824
- for (var prop of __getOwnPropSymbols$q(source)) {
10825
- if (exclude.indexOf(prop) < 0 && __propIsEnum$q.call(source, prop))
10823
+ if (source != null && __getOwnPropSymbols$r)
10824
+ for (var prop of __getOwnPropSymbols$r(source)) {
10825
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$r.call(source, prop))
10826
10826
  target[prop] = source[prop];
10827
10827
  }
10828
10828
  return target;
@@ -10944,17 +10944,17 @@ const types = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
10944
10944
  RateCardStatus
10945
10945
  }, Symbol.toStringTag, { value: 'Module' }));
10946
10946
 
10947
- var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
10948
- var __hasOwnProp$p = Object.prototype.hasOwnProperty;
10949
- var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
10947
+ var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
10948
+ var __hasOwnProp$q = Object.prototype.hasOwnProperty;
10949
+ var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
10950
10950
  var __objRest$e = (source, exclude) => {
10951
10951
  var target = {};
10952
10952
  for (var prop in source)
10953
- if (__hasOwnProp$p.call(source, prop) && exclude.indexOf(prop) < 0)
10953
+ if (__hasOwnProp$q.call(source, prop) && exclude.indexOf(prop) < 0)
10954
10954
  target[prop] = source[prop];
10955
- if (source != null && __getOwnPropSymbols$p)
10956
- for (var prop of __getOwnPropSymbols$p(source)) {
10957
- if (exclude.indexOf(prop) < 0 && __propIsEnum$p.call(source, prop))
10955
+ if (source != null && __getOwnPropSymbols$q)
10956
+ for (var prop of __getOwnPropSymbols$q(source)) {
10957
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$q.call(source, prop))
10958
10958
  target[prop] = source[prop];
10959
10959
  }
10960
10960
  return target;
@@ -13696,7 +13696,7 @@ var ipaddr = {
13696
13696
  }).call(commonjsGlobal);
13697
13697
  } (ipaddr));
13698
13698
 
13699
- var __async$M = (__this, __arguments, generator) => {
13699
+ var __async$N = (__this, __arguments, generator) => {
13700
13700
  return new Promise((resolve, reject) => {
13701
13701
  var fulfilled = (value) => {
13702
13702
  try {
@@ -13716,7 +13716,7 @@ var __async$M = (__this, __arguments, generator) => {
13716
13716
  step((generator = generator.apply(__this, __arguments)).next());
13717
13717
  });
13718
13718
  };
13719
- const getEndUserIpAddress = () => __async$M(void 0, null, function* () {
13719
+ const getEndUserIpAddress = () => __async$N(void 0, null, function* () {
13720
13720
  try {
13721
13721
  const response = yield axios.get("https://api.ipify.org/?format=json");
13722
13722
  if (response.data.ip && ipaddrExports.isValid(response.data.ip)) {
@@ -13728,21 +13728,21 @@ const getEndUserIpAddress = () => __async$M(void 0, null, function* () {
13728
13728
  }
13729
13729
  });
13730
13730
 
13731
- var __defProp$d = Object.defineProperty;
13731
+ var __defProp$e = Object.defineProperty;
13732
13732
  var __defProps$9 = Object.defineProperties;
13733
13733
  var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
13734
- var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
13735
- var __hasOwnProp$o = Object.prototype.hasOwnProperty;
13736
- var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
13737
- var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13738
- var __spreadValues$d = (a, b) => {
13734
+ var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
13735
+ var __hasOwnProp$p = Object.prototype.hasOwnProperty;
13736
+ var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
13737
+ var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13738
+ var __spreadValues$e = (a, b) => {
13739
13739
  for (var prop in b || (b = {}))
13740
- if (__hasOwnProp$o.call(b, prop))
13741
- __defNormalProp$d(a, prop, b[prop]);
13742
- if (__getOwnPropSymbols$o)
13743
- for (var prop of __getOwnPropSymbols$o(b)) {
13744
- if (__propIsEnum$o.call(b, prop))
13745
- __defNormalProp$d(a, prop, b[prop]);
13740
+ if (__hasOwnProp$p.call(b, prop))
13741
+ __defNormalProp$e(a, prop, b[prop]);
13742
+ if (__getOwnPropSymbols$p)
13743
+ for (var prop of __getOwnPropSymbols$p(b)) {
13744
+ if (__propIsEnum$p.call(b, prop))
13745
+ __defNormalProp$e(a, prop, b[prop]);
13746
13746
  }
13747
13747
  return a;
13748
13748
  };
@@ -13750,16 +13750,16 @@ var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
13750
13750
  var __objRest$d = (source, exclude) => {
13751
13751
  var target = {};
13752
13752
  for (var prop in source)
13753
- if (__hasOwnProp$o.call(source, prop) && exclude.indexOf(prop) < 0)
13753
+ if (__hasOwnProp$p.call(source, prop) && exclude.indexOf(prop) < 0)
13754
13754
  target[prop] = source[prop];
13755
- if (source != null && __getOwnPropSymbols$o)
13756
- for (var prop of __getOwnPropSymbols$o(source)) {
13757
- if (exclude.indexOf(prop) < 0 && __propIsEnum$o.call(source, prop))
13755
+ if (source != null && __getOwnPropSymbols$p)
13756
+ for (var prop of __getOwnPropSymbols$p(source)) {
13757
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$p.call(source, prop))
13758
13758
  target[prop] = source[prop];
13759
13759
  }
13760
13760
  return target;
13761
13761
  };
13762
- var __async$L = (__this, __arguments, generator) => {
13762
+ var __async$M = (__this, __arguments, generator) => {
13763
13763
  return new Promise((resolve, reject) => {
13764
13764
  var fulfilled = (value) => {
13765
13765
  try {
@@ -13797,12 +13797,12 @@ class CarriersAPI {
13797
13797
  /**
13798
13798
  * The `connect` method connects a carrier account to a user's ShipEngine account.
13799
13799
  */
13800
- this.connect = (_a) => __async$L(this, null, function* () {
13800
+ this.connect = (_a) => __async$M(this, null, function* () {
13801
13801
  var _b = _a, { carrierCode } = _b, connection = __objRest$d(_b, ["carrierCode"]);
13802
13802
  const endUserIpAddress = yield getEndUserIpAddress();
13803
13803
  if (!endUserIpAddress)
13804
13804
  return Promise.reject([new CodedError("Unable to get IP address")]);
13805
- return yield this.client.post(`/v1/registration/${carrierCode}`, __spreadProps$9(__spreadValues$d({}, connection), {
13805
+ return yield this.client.post(`/v1/registration/${carrierCode}`, __spreadProps$9(__spreadValues$e({}, connection), {
13806
13806
  endUserIpAddress
13807
13807
  }));
13808
13808
  });
@@ -13888,7 +13888,7 @@ class CarriersAPI {
13888
13888
  }
13889
13889
  }
13890
13890
 
13891
- var __async$K = (__this, __arguments, generator) => {
13891
+ var __async$L = (__this, __arguments, generator) => {
13892
13892
  return new Promise((resolve, reject) => {
13893
13893
  var fulfilled = (value) => {
13894
13894
  try {
@@ -13930,7 +13930,7 @@ class ConnectionsAPI {
13930
13930
  /**
13931
13931
  * The `connectCarrier` method connects a carrier to account.
13932
13932
  */
13933
- this.connectCarrier = (carrierName, formData) => __async$K(this, null, function* () {
13933
+ this.connectCarrier = (carrierName, formData) => __async$L(this, null, function* () {
13934
13934
  return yield this.client.post(
13935
13935
  `/v1/connections/carriers/${carrierName}`,
13936
13936
  formData,
@@ -13953,6 +13953,25 @@ class ConnectionsAPI {
13953
13953
  `/v1/connections/carriers/${carrierCode}/services`
13954
13954
  );
13955
13955
  };
13956
+ /**
13957
+ * The `getCarrierSettings` method retrieves the settings for a given carrier,
13958
+ * identified by the `carrierName` and `carrierCode`.
13959
+ */
13960
+ this.getCarrierSettings = (carrierName, carrierCode) => {
13961
+ return this.client.get(
13962
+ `/v1/connections/carriers/${carrierName}/${carrierCode}/settings`
13963
+ );
13964
+ };
13965
+ /**
13966
+ * The `updateCarrierSettings` method updates the settings for a given carrier,
13967
+ * identified by the `carrierName` and `carrierCode`.
13968
+ */
13969
+ this.updateCarrierSettings = (carrierName, carrierCode, formData) => {
13970
+ return this.client.put(
13971
+ `/v1/connections/carriers/${carrierName}/${carrierCode}/settings`,
13972
+ formData
13973
+ );
13974
+ };
13956
13975
  this.client = client;
13957
13976
  }
13958
13977
  }
@@ -16166,23 +16185,23 @@ class CustomPackagesAPI {
16166
16185
  }
16167
16186
  }
16168
16187
 
16169
- var __defProp$c = Object.defineProperty;
16170
- var __getOwnPropSymbols$n = Object.getOwnPropertySymbols;
16171
- var __hasOwnProp$n = Object.prototype.hasOwnProperty;
16172
- var __propIsEnum$n = Object.prototype.propertyIsEnumerable;
16173
- var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16174
- var __spreadValues$c = (a, b) => {
16188
+ var __defProp$d = Object.defineProperty;
16189
+ var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
16190
+ var __hasOwnProp$o = Object.prototype.hasOwnProperty;
16191
+ var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
16192
+ var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16193
+ var __spreadValues$d = (a, b) => {
16175
16194
  for (var prop in b || (b = {}))
16176
- if (__hasOwnProp$n.call(b, prop))
16177
- __defNormalProp$c(a, prop, b[prop]);
16178
- if (__getOwnPropSymbols$n)
16179
- for (var prop of __getOwnPropSymbols$n(b)) {
16180
- if (__propIsEnum$n.call(b, prop))
16181
- __defNormalProp$c(a, prop, b[prop]);
16195
+ if (__hasOwnProp$o.call(b, prop))
16196
+ __defNormalProp$d(a, prop, b[prop]);
16197
+ if (__getOwnPropSymbols$o)
16198
+ for (var prop of __getOwnPropSymbols$o(b)) {
16199
+ if (__propIsEnum$o.call(b, prop))
16200
+ __defNormalProp$d(a, prop, b[prop]);
16182
16201
  }
16183
16202
  return a;
16184
16203
  };
16185
- var __async$J = (__this, __arguments, generator) => {
16204
+ var __async$K = (__this, __arguments, generator) => {
16186
16205
  return new Promise((resolve, reject) => {
16187
16206
  var fulfilled = (value) => {
16188
16207
  try {
@@ -16221,12 +16240,12 @@ class FundingSourcesAPI {
16221
16240
  * The `create` method creates a new funding source for a given user. This requires
16222
16241
  * payment information to be collected from the user.
16223
16242
  */
16224
- this.create = (createFundingSource) => __async$J(this, null, function* () {
16243
+ this.create = (createFundingSource) => __async$K(this, null, function* () {
16225
16244
  const endUserIpAddress = yield getEndUserIpAddress();
16226
16245
  if (!endUserIpAddress) {
16227
16246
  return Promise.reject([new CodedError("Unable to get IP address")]);
16228
16247
  }
16229
- return yield this.client.post("/v1/funding_sources", __spreadValues$c({
16248
+ return yield this.client.post("/v1/funding_sources", __spreadValues$d({
16230
16249
  endUserIpAddress
16231
16250
  }, createFundingSource));
16232
16251
  });
@@ -16235,7 +16254,7 @@ class FundingSourcesAPI {
16235
16254
  * user to update the billing address or payment information associated with the
16236
16255
  * funding source.
16237
16256
  */
16238
- this.update = (billingInfo, creditCardInfo, fundingSourceId) => __async$J(this, null, function* () {
16257
+ this.update = (billingInfo, creditCardInfo, fundingSourceId) => __async$K(this, null, function* () {
16239
16258
  const endUserIpAddress = yield getEndUserIpAddress();
16240
16259
  if (!endUserIpAddress) {
16241
16260
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -16253,19 +16272,19 @@ class FundingSourcesAPI {
16253
16272
  * The `registerCarrier` method registers a carrier account and associates
16254
16273
  * it with a given funding source.
16255
16274
  */
16256
- this.registerCarrier = (carrier) => __async$J(this, null, function* () {
16275
+ this.registerCarrier = (carrier) => __async$K(this, null, function* () {
16257
16276
  const endUserIpAddress = yield getEndUserIpAddress();
16258
16277
  if (!endUserIpAddress) {
16259
16278
  return Promise.reject([new CodedError("Unable to get IP address")]);
16260
16279
  }
16261
- return yield this.client.post("/v1/registration/funding_source", __spreadValues$c({
16280
+ return yield this.client.post("/v1/registration/funding_source", __spreadValues$d({
16262
16281
  endUserIpAddress
16263
16282
  }, carrier));
16264
16283
  });
16265
16284
  /**
16266
16285
  * The `addFunds` method allows you to add funds to a funding source.
16267
16286
  */
16268
- this.addFunds = (amount, fundingSourceId) => __async$J(this, null, function* () {
16287
+ this.addFunds = (amount, fundingSourceId) => __async$K(this, null, function* () {
16269
16288
  return yield this.client.put(
16270
16289
  `/v1/funding_sources/${fundingSourceId}/add_funds`,
16271
16290
  amount
@@ -16275,7 +16294,7 @@ class FundingSourcesAPI {
16275
16294
  * The `metadata` method returns seller-specific requirements for creating funding sources
16276
16295
  * and attaching carriers
16277
16296
  */
16278
- this.metadata = () => __async$J(this, null, function* () {
16297
+ this.metadata = () => __async$K(this, null, function* () {
16279
16298
  return yield this.client.get("/v1/funding_sources/metadata");
16280
16299
  });
16281
16300
  /**
@@ -16463,6 +16482,22 @@ class RateCardsAPI {
16463
16482
  }
16464
16483
  }
16465
16484
 
16485
+ var __defProp$c = Object.defineProperty;
16486
+ var __getOwnPropSymbols$n = Object.getOwnPropertySymbols;
16487
+ var __hasOwnProp$n = Object.prototype.hasOwnProperty;
16488
+ var __propIsEnum$n = Object.prototype.propertyIsEnumerable;
16489
+ var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16490
+ var __spreadValues$c = (a, b) => {
16491
+ for (var prop in b || (b = {}))
16492
+ if (__hasOwnProp$n.call(b, prop))
16493
+ __defNormalProp$c(a, prop, b[prop]);
16494
+ if (__getOwnPropSymbols$n)
16495
+ for (var prop of __getOwnPropSymbols$n(b)) {
16496
+ if (__propIsEnum$n.call(b, prop))
16497
+ __defNormalProp$c(a, prop, b[prop]);
16498
+ }
16499
+ return a;
16500
+ };
16466
16501
  class RatesAPI {
16467
16502
  constructor(client) {
16468
16503
  this.client = client;
@@ -16476,6 +16511,13 @@ class RatesAPI {
16476
16511
  shipmentId
16477
16512
  });
16478
16513
  };
16514
+ /**
16515
+ * The `estimate` endpoint allows us to obtain estimated rates based on the payload that is attached to the POST
16516
+ * method.
16517
+ */
16518
+ this.estimate = (params) => {
16519
+ return this.client.post("/v1/rates/estimate", __spreadValues$c({}, params));
16520
+ };
16479
16521
  this.client = client;
16480
16522
  }
16481
16523
  }
@@ -16614,7 +16656,7 @@ class ServicePointsAPI {
16614
16656
  }
16615
16657
  }
16616
16658
 
16617
- var __async$I = (__this, __arguments, generator) => {
16659
+ var __async$J = (__this, __arguments, generator) => {
16618
16660
  return new Promise((resolve, reject) => {
16619
16661
  var fulfilled = (value) => {
16620
16662
  try {
@@ -16657,7 +16699,7 @@ class ShipmentsAPI {
16657
16699
  * The `create` method allows for creating shipments based on a list of shipment
16658
16700
  * items passed into this method.
16659
16701
  */
16660
- this.create = (...shipments) => __async$I(this, null, function* () {
16702
+ this.create = (...shipments) => __async$J(this, null, function* () {
16661
16703
  return this.client.post("/v1/shipments", {
16662
16704
  shipments
16663
16705
  });
@@ -34042,7 +34084,7 @@ var __spreadValues$a = (a, b) => {
34042
34084
  return a;
34043
34085
  };
34044
34086
  var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
34045
- var __async$H = (__this, __arguments, generator) => {
34087
+ var __async$I = (__this, __arguments, generator) => {
34046
34088
  return new Promise((resolve, reject) => {
34047
34089
  var fulfilled = (value) => {
34048
34090
  try {
@@ -34136,7 +34178,7 @@ class ShipEngineAPI {
34136
34178
  );
34137
34179
  return res;
34138
34180
  },
34139
- (err) => __async$H(this, null, function* () {
34181
+ (err) => __async$I(this, null, function* () {
34140
34182
  var _a, _b, _c, _d, _e;
34141
34183
  logger$1.error(
34142
34184
  { err, req: err.config, res: err.response },
@@ -34470,7 +34512,7 @@ const retryUntil = (callbackFn, retries = 10, timeoutBetweenAttempts = 1e3) => P
34470
34512
  throw error;
34471
34513
  });
34472
34514
 
34473
- var __async$G = (__this, __arguments, generator) => {
34515
+ var __async$H = (__this, __arguments, generator) => {
34474
34516
  return new Promise((resolve, reject) => {
34475
34517
  var fulfilled = (value) => {
34476
34518
  try {
@@ -34493,7 +34535,7 @@ var __async$G = (__this, __arguments, generator) => {
34493
34535
  const useCreateAccountImage = () => {
34494
34536
  const { client } = useShipEngine();
34495
34537
  return reactQuery.useMutation({
34496
- mutationFn: (data) => __async$G(void 0, null, function* () {
34538
+ mutationFn: (data) => __async$H(void 0, null, function* () {
34497
34539
  const result = yield client.accountSettings.createImage(data);
34498
34540
  return result.data;
34499
34541
  }),
@@ -34502,7 +34544,7 @@ const useCreateAccountImage = () => {
34502
34544
  });
34503
34545
  };
34504
34546
 
34505
- var __async$F = (__this, __arguments, generator) => {
34547
+ var __async$G = (__this, __arguments, generator) => {
34506
34548
  return new Promise((resolve, reject) => {
34507
34549
  var fulfilled = (value) => {
34508
34550
  try {
@@ -34525,7 +34567,7 @@ var __async$F = (__this, __arguments, generator) => {
34525
34567
  const useDeleteAccountImage = () => {
34526
34568
  const { client } = useShipEngine();
34527
34569
  return reactQuery.useMutation({
34528
- mutationFn: (labelImageId) => __async$F(void 0, null, function* () {
34570
+ mutationFn: (labelImageId) => __async$G(void 0, null, function* () {
34529
34571
  const result = yield client.accountSettings.deleteImage(labelImageId);
34530
34572
  return result.data;
34531
34573
  }),
@@ -34554,7 +34596,7 @@ const useGetAccountSettings = () => {
34554
34596
  });
34555
34597
  };
34556
34598
 
34557
- var __async$E = (__this, __arguments, generator) => {
34599
+ var __async$F = (__this, __arguments, generator) => {
34558
34600
  return new Promise((resolve, reject) => {
34559
34601
  var fulfilled = (value) => {
34560
34602
  try {
@@ -34577,7 +34619,7 @@ var __async$E = (__this, __arguments, generator) => {
34577
34619
  const useUpdateAccountImage = () => {
34578
34620
  const { client } = useShipEngine();
34579
34621
  return reactQuery.useMutation({
34580
- mutationFn: (data) => __async$E(void 0, null, function* () {
34622
+ mutationFn: (data) => __async$F(void 0, null, function* () {
34581
34623
  const result = yield client.accountSettings.updateImage(data);
34582
34624
  return result.data;
34583
34625
  }),
@@ -34586,7 +34628,7 @@ const useUpdateAccountImage = () => {
34586
34628
  });
34587
34629
  };
34588
34630
 
34589
- var __async$D = (__this, __arguments, generator) => {
34631
+ var __async$E = (__this, __arguments, generator) => {
34590
34632
  return new Promise((resolve, reject) => {
34591
34633
  var fulfilled = (value) => {
34592
34634
  try {
@@ -34609,7 +34651,7 @@ var __async$D = (__this, __arguments, generator) => {
34609
34651
  const useUpdateAccountSettings = () => {
34610
34652
  const { client } = useShipEngine();
34611
34653
  return reactQuery.useMutation({
34612
- mutationFn: (settings) => __async$D(void 0, null, function* () {
34654
+ mutationFn: (settings) => __async$E(void 0, null, function* () {
34613
34655
  const result = yield client.accountSettings.update(settings);
34614
34656
  return result.data;
34615
34657
  }),
@@ -34618,7 +34660,7 @@ const useUpdateAccountSettings = () => {
34618
34660
  });
34619
34661
  };
34620
34662
 
34621
- var __async$C = (__this, __arguments, generator) => {
34663
+ var __async$D = (__this, __arguments, generator) => {
34622
34664
  return new Promise((resolve, reject) => {
34623
34665
  var fulfilled = (value) => {
34624
34666
  try {
@@ -34641,7 +34683,7 @@ var __async$C = (__this, __arguments, generator) => {
34641
34683
  const useParseAddress = () => {
34642
34684
  const { client } = useShipEngine();
34643
34685
  return reactQuery.useMutation({
34644
- mutationFn: (_0) => __async$C(void 0, [_0], function* ({ address, text }) {
34686
+ mutationFn: (_0) => __async$D(void 0, [_0], function* ({ address, text }) {
34645
34687
  const result = yield client.addresses.parse(text, address);
34646
34688
  return result.data;
34647
34689
  }),
@@ -34650,7 +34692,7 @@ const useParseAddress = () => {
34650
34692
  });
34651
34693
  };
34652
34694
 
34653
- var __async$B = (__this, __arguments, generator) => {
34695
+ var __async$C = (__this, __arguments, generator) => {
34654
34696
  return new Promise((resolve, reject) => {
34655
34697
  var fulfilled = (value) => {
34656
34698
  try {
@@ -34673,7 +34715,7 @@ var __async$B = (__this, __arguments, generator) => {
34673
34715
  const useValidateAddresses = () => {
34674
34716
  const { client } = useShipEngine();
34675
34717
  return reactQuery.useMutation({
34676
- mutationFn: (addresses) => __async$B(void 0, null, function* () {
34718
+ mutationFn: (addresses) => __async$C(void 0, null, function* () {
34677
34719
  const result = yield client.addresses.validate(addresses);
34678
34720
  return result.data;
34679
34721
  }),
@@ -34682,7 +34724,7 @@ const useValidateAddresses = () => {
34682
34724
  });
34683
34725
  };
34684
34726
 
34685
- var __async$A = (__this, __arguments, generator) => {
34727
+ var __async$B = (__this, __arguments, generator) => {
34686
34728
  return new Promise((resolve, reject) => {
34687
34729
  var fulfilled = (value) => {
34688
34730
  try {
@@ -34705,7 +34747,7 @@ var __async$A = (__this, __arguments, generator) => {
34705
34747
  const useAddFunds = () => {
34706
34748
  const { client } = useShipEngine();
34707
34749
  return reactQuery.useMutation({
34708
- mutationFn: (_0) => __async$A(void 0, [_0], function* ({ carrierId, funds }) {
34750
+ mutationFn: (_0) => __async$B(void 0, [_0], function* ({ carrierId, funds }) {
34709
34751
  const result = yield client.carriers.addFunds(carrierId, funds);
34710
34752
  return result.data;
34711
34753
  }),
@@ -34714,7 +34756,7 @@ const useAddFunds = () => {
34714
34756
  });
34715
34757
  };
34716
34758
 
34717
- var __async$z = (__this, __arguments, generator) => {
34759
+ var __async$A = (__this, __arguments, generator) => {
34718
34760
  return new Promise((resolve, reject) => {
34719
34761
  var fulfilled = (value) => {
34720
34762
  try {
@@ -34737,7 +34779,7 @@ var __async$z = (__this, __arguments, generator) => {
34737
34779
  const useConnectCarrier = () => {
34738
34780
  const { client } = useShipEngine();
34739
34781
  return reactQuery.useMutation({
34740
- mutationFn: (params) => __async$z(void 0, null, function* () {
34782
+ mutationFn: (params) => __async$A(void 0, null, function* () {
34741
34783
  const result = yield client.carriers.connect(params);
34742
34784
  return result.data;
34743
34785
  }),
@@ -34871,7 +34913,7 @@ var __objRest$c = (source, exclude) => {
34871
34913
  }
34872
34914
  return target;
34873
34915
  };
34874
- var __async$y = (__this, __arguments, generator) => {
34916
+ var __async$z = (__this, __arguments, generator) => {
34875
34917
  return new Promise((resolve, reject) => {
34876
34918
  var fulfilled = (value) => {
34877
34919
  try {
@@ -34895,7 +34937,7 @@ const useUpdateAutoFunding = () => {
34895
34937
  const { client } = useShipEngine();
34896
34938
  const queryClient = reactQuery.useQueryClient();
34897
34939
  return reactQuery.useMutation({
34898
- mutationFn: (_a) => __async$y(void 0, null, function* () {
34940
+ mutationFn: (_a) => __async$z(void 0, null, function* () {
34899
34941
  var _b = _a, { carrierId } = _b, options = __objRest$c(_b, ["carrierId"]);
34900
34942
  const result = yield client.carriers.updateAutoFunding(carrierId, options);
34901
34943
  return result.data;
@@ -34925,7 +34967,7 @@ const useGetZonesByCarrier = (carrierId) => {
34925
34967
  });
34926
34968
  };
34927
34969
 
34928
- var __async$x = (__this, __arguments, generator) => {
34970
+ var __async$y = (__this, __arguments, generator) => {
34929
34971
  return new Promise((resolve, reject) => {
34930
34972
  var fulfilled = (value) => {
34931
34973
  try {
@@ -34948,7 +34990,7 @@ var __async$x = (__this, __arguments, generator) => {
34948
34990
  const useDeleteCarrier = () => {
34949
34991
  const { client } = useShipEngine();
34950
34992
  return reactQuery.useMutation({
34951
- mutationFn: (carrierId) => __async$x(void 0, null, function* () {
34993
+ mutationFn: (carrierId) => __async$y(void 0, null, function* () {
34952
34994
  const result = yield client.carriers.delete(carrierId);
34953
34995
  return result.data;
34954
34996
  }),
@@ -35011,7 +35053,7 @@ const useListCarrierConnections = (_params) => {
35011
35053
  });
35012
35054
  };
35013
35055
 
35014
- var __async$w = (__this, __arguments, generator) => {
35056
+ var __async$x = (__this, __arguments, generator) => {
35015
35057
  return new Promise((resolve, reject) => {
35016
35058
  var fulfilled = (value) => {
35017
35059
  try {
@@ -35034,7 +35076,7 @@ var __async$w = (__this, __arguments, generator) => {
35034
35076
  const useConnectCarrierAccount = () => {
35035
35077
  const { client } = useShipEngine();
35036
35078
  return reactQuery.useMutation({
35037
- mutationFn: (_0) => __async$w(void 0, [_0], function* ({ carrierName, formData }) {
35079
+ mutationFn: (_0) => __async$x(void 0, [_0], function* ({ carrierName, formData }) {
35038
35080
  const result = yield client.connections.connectCarrier(carrierName, formData);
35039
35081
  return result.data;
35040
35082
  }),
@@ -35064,7 +35106,7 @@ const useListCustomPackageTypes = () => {
35064
35106
  });
35065
35107
  };
35066
35108
 
35067
- var __async$v = (__this, __arguments, generator) => {
35109
+ var __async$w = (__this, __arguments, generator) => {
35068
35110
  return new Promise((resolve, reject) => {
35069
35111
  var fulfilled = (value) => {
35070
35112
  try {
@@ -35087,7 +35129,7 @@ var __async$v = (__this, __arguments, generator) => {
35087
35129
  const useCreateFundingSource = () => {
35088
35130
  const { client } = useShipEngine();
35089
35131
  return reactQuery.useMutation({
35090
- mutationFn: (fundingSource) => __async$v(void 0, null, function* () {
35132
+ mutationFn: (fundingSource) => __async$w(void 0, null, function* () {
35091
35133
  const result = yield client.fundingSources.create(fundingSource);
35092
35134
  return result.data;
35093
35135
  }),
@@ -35096,7 +35138,7 @@ const useCreateFundingSource = () => {
35096
35138
  });
35097
35139
  };
35098
35140
 
35099
- var __async$u = (__this, __arguments, generator) => {
35141
+ var __async$v = (__this, __arguments, generator) => {
35100
35142
  return new Promise((resolve, reject) => {
35101
35143
  var fulfilled = (value) => {
35102
35144
  try {
@@ -35119,7 +35161,7 @@ var __async$u = (__this, __arguments, generator) => {
35119
35161
  const useFundingSourcesAddFunds = () => {
35120
35162
  const { client } = useShipEngine();
35121
35163
  return reactQuery.useMutation({
35122
- mutationFn: (_0) => __async$u(void 0, [_0], function* ({ funds, fundingSourceId }) {
35164
+ mutationFn: (_0) => __async$v(void 0, [_0], function* ({ funds, fundingSourceId }) {
35123
35165
  const result = yield client.fundingSources.addFunds(funds, fundingSourceId);
35124
35166
  return result.data;
35125
35167
  }),
@@ -35148,7 +35190,7 @@ const useListFundingSources = () => {
35148
35190
  });
35149
35191
  };
35150
35192
 
35151
- var __async$t = (__this, __arguments, generator) => {
35193
+ var __async$u = (__this, __arguments, generator) => {
35152
35194
  return new Promise((resolve, reject) => {
35153
35195
  var fulfilled = (value) => {
35154
35196
  try {
@@ -35171,7 +35213,7 @@ var __async$t = (__this, __arguments, generator) => {
35171
35213
  const useRegisterCarrier = () => {
35172
35214
  const { client } = useShipEngine();
35173
35215
  return reactQuery.useMutation({
35174
- mutationFn: (carrier) => __async$t(void 0, null, function* () {
35216
+ mutationFn: (carrier) => __async$u(void 0, null, function* () {
35175
35217
  const result = yield client.fundingSources.registerCarrier(carrier);
35176
35218
  return result.data;
35177
35219
  }),
@@ -35180,7 +35222,7 @@ const useRegisterCarrier = () => {
35180
35222
  });
35181
35223
  };
35182
35224
 
35183
- var __async$s = (__this, __arguments, generator) => {
35225
+ var __async$t = (__this, __arguments, generator) => {
35184
35226
  return new Promise((resolve, reject) => {
35185
35227
  var fulfilled = (value) => {
35186
35228
  try {
@@ -35203,7 +35245,7 @@ var __async$s = (__this, __arguments, generator) => {
35203
35245
  const useUpdateFundingSource = () => {
35204
35246
  const { client } = useShipEngine();
35205
35247
  return reactQuery.useMutation({
35206
- mutationFn: (_0) => __async$s(void 0, [_0], function* ({
35248
+ mutationFn: (_0) => __async$t(void 0, [_0], function* ({
35207
35249
  billingInfo,
35208
35250
  creditCardInfo,
35209
35251
  fundingSourceId
@@ -35282,7 +35324,7 @@ var __objRest$9 = (source, exclude) => {
35282
35324
  }
35283
35325
  return target;
35284
35326
  };
35285
- var __async$r = (__this, __arguments, generator) => {
35327
+ var __async$s = (__this, __arguments, generator) => {
35286
35328
  return new Promise((resolve, reject) => {
35287
35329
  var fulfilled = (value) => {
35288
35330
  try {
@@ -35305,7 +35347,7 @@ var __async$r = (__this, __arguments, generator) => {
35305
35347
  const useAddInsuranceFunds = () => {
35306
35348
  const { client } = useShipEngine();
35307
35349
  return reactQuery.useMutation({
35308
- mutationFn: (_a) => __async$r(void 0, null, function* () {
35350
+ mutationFn: (_a) => __async$s(void 0, null, function* () {
35309
35351
  var _b = _a, { insuranceProvider } = _b, rest = __objRest$9(_b, ["insuranceProvider"]);
35310
35352
  const result = yield client.insurance.addFunds(insuranceProvider, rest);
35311
35353
  return result.data;
@@ -35330,7 +35372,7 @@ var __objRest$8 = (source, exclude) => {
35330
35372
  }
35331
35373
  return target;
35332
35374
  };
35333
- var __async$q = (__this, __arguments, generator) => {
35375
+ var __async$r = (__this, __arguments, generator) => {
35334
35376
  return new Promise((resolve, reject) => {
35335
35377
  var fulfilled = (value) => {
35336
35378
  try {
@@ -35353,7 +35395,7 @@ var __async$q = (__this, __arguments, generator) => {
35353
35395
  const useCreateLabel = () => {
35354
35396
  const { client } = useShipEngine();
35355
35397
  return reactQuery.useMutation({
35356
- mutationFn: (_a) => __async$q(void 0, null, function* () {
35398
+ mutationFn: (_a) => __async$r(void 0, null, function* () {
35357
35399
  var _b = _a, { rateId } = _b, options = __objRest$8(_b, ["rateId"]);
35358
35400
  const result = yield client.labels.createByRateId(rateId, options);
35359
35401
  return result.data;
@@ -35405,7 +35447,7 @@ const useListLabels = (_params) => {
35405
35447
  });
35406
35448
  };
35407
35449
 
35408
- var __async$p = (__this, __arguments, generator) => {
35450
+ var __async$q = (__this, __arguments, generator) => {
35409
35451
  return new Promise((resolve, reject) => {
35410
35452
  var fulfilled = (value) => {
35411
35453
  try {
@@ -35428,7 +35470,7 @@ var __async$p = (__this, __arguments, generator) => {
35428
35470
  const useVoidLabel = () => {
35429
35471
  const { client } = useShipEngine();
35430
35472
  return reactQuery.useMutation({
35431
- mutationFn: (labelId) => __async$p(void 0, null, function* () {
35473
+ mutationFn: (labelId) => __async$q(void 0, null, function* () {
35432
35474
  const result = yield client.labels.void(labelId);
35433
35475
  return result.data;
35434
35476
  }),
@@ -35447,7 +35489,7 @@ const useListOrderSources = () => {
35447
35489
  });
35448
35490
  };
35449
35491
 
35450
- var __async$o = (__this, __arguments, generator) => {
35492
+ var __async$p = (__this, __arguments, generator) => {
35451
35493
  return new Promise((resolve, reject) => {
35452
35494
  var fulfilled = (value) => {
35453
35495
  try {
@@ -35470,7 +35512,7 @@ var __async$o = (__this, __arguments, generator) => {
35470
35512
  const useRefreshOrderSourceAsync = () => {
35471
35513
  const { client } = useShipEngine();
35472
35514
  return reactQuery.useMutation({
35473
- mutationFn: (orderSourceId) => __async$o(void 0, null, function* () {
35515
+ mutationFn: (orderSourceId) => __async$p(void 0, null, function* () {
35474
35516
  const result = yield client.orderSources.refresh(orderSourceId);
35475
35517
  return result.data;
35476
35518
  }),
@@ -35481,9 +35523,9 @@ const useRefreshOrderSource = () => {
35481
35523
  const { client } = useShipEngine();
35482
35524
  const { mutateAsync: refreshOrderSourceAsync } = useRefreshOrderSourceAsync();
35483
35525
  return reactQuery.useMutation({
35484
- mutationFn: (orderSourceId) => __async$o(void 0, null, function* () {
35526
+ mutationFn: (orderSourceId) => __async$p(void 0, null, function* () {
35485
35527
  yield refreshOrderSourceAsync(orderSourceId);
35486
- const waitResult = yield retryUntil(() => __async$o(void 0, null, function* () {
35528
+ const waitResult = yield retryUntil(() => __async$p(void 0, null, function* () {
35487
35529
  const { data: checkResult } = yield client.orderSources.get(orderSourceId);
35488
35530
  if (["preparing_update", "updating"].includes(checkResult.refreshInfo.status)) {
35489
35531
  throw new CodedError("Order source is still refreshing");
@@ -35497,7 +35539,7 @@ const useRefreshOrderSource = () => {
35497
35539
  });
35498
35540
  };
35499
35541
 
35500
- var __async$n = (__this, __arguments, generator) => {
35542
+ var __async$o = (__this, __arguments, generator) => {
35501
35543
  return new Promise((resolve, reject) => {
35502
35544
  var fulfilled = (value) => {
35503
35545
  try {
@@ -35520,7 +35562,7 @@ var __async$n = (__this, __arguments, generator) => {
35520
35562
  const useDeactivateOrderSource = () => {
35521
35563
  const { client } = useShipEngine();
35522
35564
  return reactQuery.useMutation({
35523
- mutationFn: (orderSourceId) => __async$n(void 0, null, function* () {
35565
+ mutationFn: (orderSourceId) => __async$o(void 0, null, function* () {
35524
35566
  const result = yield client.orderSources.deactivate(orderSourceId);
35525
35567
  return result.data;
35526
35568
  }),
@@ -35529,7 +35571,7 @@ const useDeactivateOrderSource = () => {
35529
35571
  });
35530
35572
  };
35531
35573
 
35532
- var __async$m = (__this, __arguments, generator) => {
35574
+ var __async$n = (__this, __arguments, generator) => {
35533
35575
  return new Promise((resolve, reject) => {
35534
35576
  var fulfilled = (value) => {
35535
35577
  try {
@@ -35552,7 +35594,7 @@ var __async$m = (__this, __arguments, generator) => {
35552
35594
  const useCreateRateCard = () => {
35553
35595
  const { client } = useShipEngine();
35554
35596
  return reactQuery.useMutation({
35555
- mutationFn: (rateCard) => __async$m(void 0, null, function* () {
35597
+ mutationFn: (rateCard) => __async$n(void 0, null, function* () {
35556
35598
  const result = yield client.rateCards.create(rateCard);
35557
35599
  return result.data;
35558
35600
  }),
@@ -35599,7 +35641,7 @@ const useListRateCards = (carrierIds) => {
35599
35641
  });
35600
35642
  };
35601
35643
 
35602
- var __async$l = (__this, __arguments, generator) => {
35644
+ var __async$m = (__this, __arguments, generator) => {
35603
35645
  return new Promise((resolve, reject) => {
35604
35646
  var fulfilled = (value) => {
35605
35647
  try {
@@ -35622,7 +35664,7 @@ var __async$l = (__this, __arguments, generator) => {
35622
35664
  const usePublishRateCard = () => {
35623
35665
  const { client } = useShipEngine();
35624
35666
  return reactQuery.useMutation({
35625
- mutationFn: (rateCardId) => __async$l(void 0, null, function* () {
35667
+ mutationFn: (rateCardId) => __async$m(void 0, null, function* () {
35626
35668
  return yield client.rateCards.publish(rateCardId);
35627
35669
  }),
35628
35670
  mutationKey: ["usePublishRateCard"],
@@ -35630,7 +35672,7 @@ const usePublishRateCard = () => {
35630
35672
  });
35631
35673
  };
35632
35674
 
35633
- var __async$k = (__this, __arguments, generator) => {
35675
+ var __async$l = (__this, __arguments, generator) => {
35634
35676
  return new Promise((resolve, reject) => {
35635
35677
  var fulfilled = (value) => {
35636
35678
  try {
@@ -35653,7 +35695,7 @@ var __async$k = (__this, __arguments, generator) => {
35653
35695
  const useUpdateRateCard = () => {
35654
35696
  const { client } = useShipEngine();
35655
35697
  return reactQuery.useMutation({
35656
- mutationFn: (rateCard) => __async$k(void 0, null, function* () {
35698
+ mutationFn: (rateCard) => __async$l(void 0, null, function* () {
35657
35699
  const result = yield client.rateCards.update(rateCard);
35658
35700
  return result.data;
35659
35701
  }),
@@ -35662,7 +35704,7 @@ const useUpdateRateCard = () => {
35662
35704
  });
35663
35705
  };
35664
35706
 
35665
- var __async$j = (__this, __arguments, generator) => {
35707
+ var __async$k = (__this, __arguments, generator) => {
35666
35708
  return new Promise((resolve, reject) => {
35667
35709
  var fulfilled = (value) => {
35668
35710
  try {
@@ -35685,7 +35727,7 @@ var __async$j = (__this, __arguments, generator) => {
35685
35727
  const useUploadRateCard = () => {
35686
35728
  const { client } = useShipEngine();
35687
35729
  return reactQuery.useMutation({
35688
- mutationFn: (_0) => __async$j(void 0, [_0], function* ({ rateCardId, file }) {
35730
+ mutationFn: (_0) => __async$k(void 0, [_0], function* ({ rateCardId, file }) {
35689
35731
  const result = yield client.rateCards.upload(rateCardId, file);
35690
35732
  return result.data;
35691
35733
  }),
@@ -35694,7 +35736,7 @@ const useUploadRateCard = () => {
35694
35736
  });
35695
35737
  };
35696
35738
 
35697
- var __async$i = (__this, __arguments, generator) => {
35739
+ var __async$j = (__this, __arguments, generator) => {
35698
35740
  return new Promise((resolve, reject) => {
35699
35741
  var fulfilled = (value) => {
35700
35742
  try {
@@ -35717,7 +35759,7 @@ var __async$i = (__this, __arguments, generator) => {
35717
35759
  const useDeleteRateCard = () => {
35718
35760
  const { client } = useShipEngine();
35719
35761
  return reactQuery.useMutation({
35720
- mutationFn: (rateCardId) => __async$i(void 0, null, function* () {
35762
+ mutationFn: (rateCardId) => __async$j(void 0, null, function* () {
35721
35763
  const result = yield client.rateCards.delete(rateCardId);
35722
35764
  return result.data;
35723
35765
  }),
@@ -35726,7 +35768,7 @@ const useDeleteRateCard = () => {
35726
35768
  });
35727
35769
  };
35728
35770
 
35729
- var __async$h = (__this, __arguments, generator) => {
35771
+ var __async$i = (__this, __arguments, generator) => {
35730
35772
  return new Promise((resolve, reject) => {
35731
35773
  var fulfilled = (value) => {
35732
35774
  try {
@@ -35749,7 +35791,7 @@ var __async$h = (__this, __arguments, generator) => {
35749
35791
  const useCalculateRates = () => {
35750
35792
  const { client } = useShipEngine();
35751
35793
  return reactQuery.useMutation({
35752
- mutationFn: (_0) => __async$h(void 0, [_0], function* ({ rateOptions, shipmentId }) {
35794
+ mutationFn: (_0) => __async$i(void 0, [_0], function* ({ rateOptions, shipmentId }) {
35753
35795
  const result = yield client.rates.calculateByShipmentId(shipmentId, rateOptions);
35754
35796
  return result.data;
35755
35797
  }),
@@ -35758,6 +35800,38 @@ const useCalculateRates = () => {
35758
35800
  });
35759
35801
  };
35760
35802
 
35803
+ var __async$h = (__this, __arguments, generator) => {
35804
+ return new Promise((resolve, reject) => {
35805
+ var fulfilled = (value) => {
35806
+ try {
35807
+ step(generator.next(value));
35808
+ } catch (e) {
35809
+ reject(e);
35810
+ }
35811
+ };
35812
+ var rejected = (value) => {
35813
+ try {
35814
+ step(generator.throw(value));
35815
+ } catch (e) {
35816
+ reject(e);
35817
+ }
35818
+ };
35819
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
35820
+ step((generator = generator.apply(__this, __arguments)).next());
35821
+ });
35822
+ };
35823
+ const useRatesEstimate = () => {
35824
+ const { client } = useShipEngine();
35825
+ return reactQuery.useMutation({
35826
+ mutationFn: (_0) => __async$h(void 0, [_0], function* ({ rateParams }) {
35827
+ const result = yield client.rates.estimate(rateParams);
35828
+ return result.data;
35829
+ }),
35830
+ mutationKey: ["useRatesEstimate"],
35831
+ onError
35832
+ });
35833
+ };
35834
+
35761
35835
  const useGetSalesOrder = (salesOrderId) => {
35762
35836
  const { client } = useShipEngine();
35763
35837
  return reactQuery.useQuery({
@@ -38010,6 +38084,7 @@ exports.useLoadIcons = useLoadIcons;
38010
38084
  exports.useNotifySalesOrderShipped = useNotifySalesOrderShipped;
38011
38085
  exports.useParseAddress = useParseAddress;
38012
38086
  exports.usePublishRateCard = usePublishRateCard;
38087
+ exports.useRatesEstimate = useRatesEstimate;
38013
38088
  exports.useRefreshOrderSource = useRefreshOrderSource;
38014
38089
  exports.useRefreshOrderSourceAsync = useRefreshOrderSourceAsync;
38015
38090
  exports.useRegisterCarrier = useRegisterCarrier;