@shipengine/alchemy 5.0.7 → 5.0.9

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 +117 -78
  2. package/index.mjs +117 -79
  3. package/package.json +1 -1
package/index.mjs CHANGED
@@ -13618,7 +13618,7 @@ var ipaddr = {
13618
13618
  }).call(commonjsGlobal);
13619
13619
  } (ipaddr));
13620
13620
 
13621
- var __async$A = (__this, __arguments, generator) => {
13621
+ var __async$B = (__this, __arguments, generator) => {
13622
13622
  return new Promise((resolve, reject) => {
13623
13623
  var fulfilled = (value) => {
13624
13624
  try {
@@ -13638,7 +13638,7 @@ var __async$A = (__this, __arguments, generator) => {
13638
13638
  step((generator = generator.apply(__this, __arguments)).next());
13639
13639
  });
13640
13640
  };
13641
- const getEndUserIpAddress = () => __async$A(void 0, null, function* () {
13641
+ const getEndUserIpAddress = () => __async$B(void 0, null, function* () {
13642
13642
  try {
13643
13643
  const response = yield axios.get("https://api.ipify.org/?format=json");
13644
13644
  if (response.data.ip && ipaddrExports.isValid(response.data.ip)) {
@@ -13681,7 +13681,7 @@ var __objRest$7 = (source, exclude) => {
13681
13681
  }
13682
13682
  return target;
13683
13683
  };
13684
- var __async$z = (__this, __arguments, generator) => {
13684
+ var __async$A = (__this, __arguments, generator) => {
13685
13685
  return new Promise((resolve, reject) => {
13686
13686
  var fulfilled = (value) => {
13687
13687
  try {
@@ -13719,7 +13719,7 @@ class CarriersAPI {
13719
13719
  /**
13720
13720
  * The `connect` method connects a carrier account to a user's ShipEngine account.
13721
13721
  */
13722
- this.connect = (_a) => __async$z(this, null, function* () {
13722
+ this.connect = (_a) => __async$A(this, null, function* () {
13723
13723
  var _b = _a, { carrierCode } = _b, connection = __objRest$7(_b, ["carrierCode"]);
13724
13724
  const endUserIpAddress = yield getEndUserIpAddress();
13725
13725
  if (!endUserIpAddress)
@@ -16002,6 +16002,12 @@ class AccountBillingPlanAPI {
16002
16002
  this.get = () => {
16003
16003
  return this.client.get("/v1/account/billing_plan");
16004
16004
  };
16005
+ /**
16006
+ * The `update` method updates the code of the account billing plan
16007
+ */
16008
+ this.update = (reqBody) => {
16009
+ return this.client.put(`/v1/account/billing_plan`, reqBody);
16010
+ };
16005
16011
  this.client = client;
16006
16012
  }
16007
16013
  }
@@ -16035,7 +16041,7 @@ var __spreadValues$5 = (a, b) => {
16035
16041
  }
16036
16042
  return a;
16037
16043
  };
16038
- var __async$y = (__this, __arguments, generator) => {
16044
+ var __async$z = (__this, __arguments, generator) => {
16039
16045
  return new Promise((resolve, reject) => {
16040
16046
  var fulfilled = (value) => {
16041
16047
  try {
@@ -16074,7 +16080,7 @@ class FundingSourcesAPI {
16074
16080
  * The `create` method creates a new funding source for a given user. This requires
16075
16081
  * payment information to be collected from the user.
16076
16082
  */
16077
- this.create = (createFundingSource) => __async$y(this, null, function* () {
16083
+ this.create = (createFundingSource) => __async$z(this, null, function* () {
16078
16084
  const endUserIpAddress = yield getEndUserIpAddress();
16079
16085
  if (!endUserIpAddress)
16080
16086
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -16087,7 +16093,7 @@ class FundingSourcesAPI {
16087
16093
  * user to update the billing address or payment information associated with the
16088
16094
  * funding source.
16089
16095
  */
16090
- this.update = (billingInfo, creditCardInfo, fundingSourceId) => __async$y(this, null, function* () {
16096
+ this.update = (billingInfo, creditCardInfo, fundingSourceId) => __async$z(this, null, function* () {
16091
16097
  const endUserIpAddress = yield getEndUserIpAddress();
16092
16098
  if (!endUserIpAddress)
16093
16099
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -16104,7 +16110,7 @@ class FundingSourcesAPI {
16104
16110
  * The `registerCarrier` method registers a carrier account and associates
16105
16111
  * it with a given funding source.
16106
16112
  */
16107
- this.registerCarrier = (carrier) => __async$y(this, null, function* () {
16113
+ this.registerCarrier = (carrier) => __async$z(this, null, function* () {
16108
16114
  const endUserIpAddress = yield getEndUserIpAddress();
16109
16115
  if (!endUserIpAddress)
16110
16116
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -16115,7 +16121,7 @@ class FundingSourcesAPI {
16115
16121
  /**
16116
16122
  * The `addFunds` method allows you to add funds to a funding source.
16117
16123
  */
16118
- this.addFunds = (amount, fundingSourceId) => __async$y(this, null, function* () {
16124
+ this.addFunds = (amount, fundingSourceId) => __async$z(this, null, function* () {
16119
16125
  return yield this.client.put(
16120
16126
  `/v1/funding_sources/${fundingSourceId}/add_funds`,
16121
16127
  amount
@@ -16125,7 +16131,7 @@ class FundingSourcesAPI {
16125
16131
  * The `metadata` method returns seller-specific requirements for creating funding sources
16126
16132
  * and attaching carriers
16127
16133
  */
16128
- this.metadata = () => __async$y(this, null, function* () {
16134
+ this.metadata = () => __async$z(this, null, function* () {
16129
16135
  return yield this.client.get("/v1/funding_sources/metadata");
16130
16136
  });
16131
16137
  /**
@@ -16368,7 +16374,7 @@ class SalesOrdersAPI {
16368
16374
  }
16369
16375
  }
16370
16376
 
16371
- var __async$x = (__this, __arguments, generator) => {
16377
+ var __async$y = (__this, __arguments, generator) => {
16372
16378
  return new Promise((resolve, reject) => {
16373
16379
  var fulfilled = (value) => {
16374
16380
  try {
@@ -16411,7 +16417,7 @@ class ShipmentsAPI {
16411
16417
  * The `create` method allows for creating shipments based on a list of shipment
16412
16418
  * items passed into this method.
16413
16419
  */
16414
- this.create = (...shipments) => __async$x(this, null, function* () {
16420
+ this.create = (...shipments) => __async$y(this, null, function* () {
16415
16421
  return this.client.post("/v1/shipments", {
16416
16422
  shipments
16417
16423
  });
@@ -16505,7 +16511,7 @@ var __spreadValues$4 = (a, b) => {
16505
16511
  return a;
16506
16512
  };
16507
16513
  var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
16508
- var __async$w = (__this, __arguments, generator) => {
16514
+ var __async$x = (__this, __arguments, generator) => {
16509
16515
  return new Promise((resolve, reject) => {
16510
16516
  var fulfilled = (value) => {
16511
16517
  try {
@@ -16599,7 +16605,7 @@ class ShipEngineAPI {
16599
16605
  );
16600
16606
  return res;
16601
16607
  },
16602
- (err) => __async$w(this, null, function* () {
16608
+ (err) => __async$x(this, null, function* () {
16603
16609
  var _a, _b, _c, _d, _e, _f, _g;
16604
16610
  logger$1.error(
16605
16611
  { err, req: err.config, res: err.response },
@@ -16894,7 +16900,7 @@ const retryUntil = (callbackFn, retries = 10, timeoutBetweenAttempts = 1e3) => P
16894
16900
  throw error;
16895
16901
  });
16896
16902
 
16897
- var __async$v = (__this, __arguments, generator) => {
16903
+ var __async$w = (__this, __arguments, generator) => {
16898
16904
  return new Promise((resolve, reject) => {
16899
16905
  var fulfilled = (value) => {
16900
16906
  try {
@@ -16917,7 +16923,7 @@ var __async$v = (__this, __arguments, generator) => {
16917
16923
  const useCreateAccountImage = () => {
16918
16924
  const { client } = useShipEngine();
16919
16925
  return useMutation({
16920
- mutationFn: (data) => __async$v(void 0, null, function* () {
16926
+ mutationFn: (data) => __async$w(void 0, null, function* () {
16921
16927
  const result = yield client.accountSettings.createImage(data);
16922
16928
  return result.data;
16923
16929
  }),
@@ -16926,7 +16932,7 @@ const useCreateAccountImage = () => {
16926
16932
  });
16927
16933
  };
16928
16934
 
16929
- var __async$u = (__this, __arguments, generator) => {
16935
+ var __async$v = (__this, __arguments, generator) => {
16930
16936
  return new Promise((resolve, reject) => {
16931
16937
  var fulfilled = (value) => {
16932
16938
  try {
@@ -16949,7 +16955,7 @@ var __async$u = (__this, __arguments, generator) => {
16949
16955
  const useDeleteAccountImage = () => {
16950
16956
  const { client } = useShipEngine();
16951
16957
  return useMutation({
16952
- mutationFn: (labelImageId) => __async$u(void 0, null, function* () {
16958
+ mutationFn: (labelImageId) => __async$v(void 0, null, function* () {
16953
16959
  const result = yield client.accountSettings.deleteImage(labelImageId);
16954
16960
  return result.data;
16955
16961
  }),
@@ -16978,7 +16984,7 @@ const useGetAccountSettings = () => {
16978
16984
  });
16979
16985
  };
16980
16986
 
16981
- var __async$t = (__this, __arguments, generator) => {
16987
+ var __async$u = (__this, __arguments, generator) => {
16982
16988
  return new Promise((resolve, reject) => {
16983
16989
  var fulfilled = (value) => {
16984
16990
  try {
@@ -17001,7 +17007,7 @@ var __async$t = (__this, __arguments, generator) => {
17001
17007
  const useUpdateAccountImage = () => {
17002
17008
  const { client } = useShipEngine();
17003
17009
  return useMutation({
17004
- mutationFn: (data) => __async$t(void 0, null, function* () {
17010
+ mutationFn: (data) => __async$u(void 0, null, function* () {
17005
17011
  const result = yield client.accountSettings.updateImage(data);
17006
17012
  return result.data;
17007
17013
  }),
@@ -17010,7 +17016,7 @@ const useUpdateAccountImage = () => {
17010
17016
  });
17011
17017
  };
17012
17018
 
17013
- var __async$s = (__this, __arguments, generator) => {
17019
+ var __async$t = (__this, __arguments, generator) => {
17014
17020
  return new Promise((resolve, reject) => {
17015
17021
  var fulfilled = (value) => {
17016
17022
  try {
@@ -17033,7 +17039,7 @@ var __async$s = (__this, __arguments, generator) => {
17033
17039
  const useUpdateAccountSettings = () => {
17034
17040
  const { client } = useShipEngine();
17035
17041
  return useMutation({
17036
- mutationFn: (settings) => __async$s(void 0, null, function* () {
17042
+ mutationFn: (settings) => __async$t(void 0, null, function* () {
17037
17043
  const result = yield client.accountSettings.update(settings);
17038
17044
  return result.data;
17039
17045
  }),
@@ -17042,7 +17048,7 @@ const useUpdateAccountSettings = () => {
17042
17048
  });
17043
17049
  };
17044
17050
 
17045
- var __async$r = (__this, __arguments, generator) => {
17051
+ var __async$s = (__this, __arguments, generator) => {
17046
17052
  return new Promise((resolve, reject) => {
17047
17053
  var fulfilled = (value) => {
17048
17054
  try {
@@ -17065,7 +17071,7 @@ var __async$r = (__this, __arguments, generator) => {
17065
17071
  const useParseAddress = () => {
17066
17072
  const { client } = useShipEngine();
17067
17073
  return useMutation({
17068
- mutationFn: (_0) => __async$r(void 0, [_0], function* ({ address, text }) {
17074
+ mutationFn: (_0) => __async$s(void 0, [_0], function* ({ address, text }) {
17069
17075
  const result = yield client.addresses.parse(text, address);
17070
17076
  return result.data;
17071
17077
  }),
@@ -17074,7 +17080,7 @@ const useParseAddress = () => {
17074
17080
  });
17075
17081
  };
17076
17082
 
17077
- var __async$q = (__this, __arguments, generator) => {
17083
+ var __async$r = (__this, __arguments, generator) => {
17078
17084
  return new Promise((resolve, reject) => {
17079
17085
  var fulfilled = (value) => {
17080
17086
  try {
@@ -17097,7 +17103,7 @@ var __async$q = (__this, __arguments, generator) => {
17097
17103
  const useValidateAddresses = () => {
17098
17104
  const { client } = useShipEngine();
17099
17105
  return useMutation({
17100
- mutationFn: (addresses) => __async$q(void 0, null, function* () {
17106
+ mutationFn: (addresses) => __async$r(void 0, null, function* () {
17101
17107
  const result = yield client.addresses.validate(addresses);
17102
17108
  return result.data;
17103
17109
  }),
@@ -17106,7 +17112,7 @@ const useValidateAddresses = () => {
17106
17112
  });
17107
17113
  };
17108
17114
 
17109
- var __async$p = (__this, __arguments, generator) => {
17115
+ var __async$q = (__this, __arguments, generator) => {
17110
17116
  return new Promise((resolve, reject) => {
17111
17117
  var fulfilled = (value) => {
17112
17118
  try {
@@ -17129,7 +17135,7 @@ var __async$p = (__this, __arguments, generator) => {
17129
17135
  const useAddFunds = () => {
17130
17136
  const { client } = useShipEngine();
17131
17137
  return useMutation({
17132
- mutationFn: (_0) => __async$p(void 0, [_0], function* ({ carrierId, funds }) {
17138
+ mutationFn: (_0) => __async$q(void 0, [_0], function* ({ carrierId, funds }) {
17133
17139
  const result = yield client.carriers.addFunds(carrierId, funds);
17134
17140
  return result.data;
17135
17141
  }),
@@ -17138,7 +17144,7 @@ const useAddFunds = () => {
17138
17144
  });
17139
17145
  };
17140
17146
 
17141
- var __async$o = (__this, __arguments, generator) => {
17147
+ var __async$p = (__this, __arguments, generator) => {
17142
17148
  return new Promise((resolve, reject) => {
17143
17149
  var fulfilled = (value) => {
17144
17150
  try {
@@ -17161,7 +17167,7 @@ var __async$o = (__this, __arguments, generator) => {
17161
17167
  const useConnectCarrier = () => {
17162
17168
  const { client } = useShipEngine();
17163
17169
  return useMutation({
17164
- mutationFn: (params) => __async$o(void 0, null, function* () {
17170
+ mutationFn: (params) => __async$p(void 0, null, function* () {
17165
17171
  const result = yield client.carriers.connect(params);
17166
17172
  return result.data;
17167
17173
  }),
@@ -17298,7 +17304,7 @@ const useListCarriers = () => {
17298
17304
  });
17299
17305
  };
17300
17306
 
17301
- var __async$n = (__this, __arguments, generator) => {
17307
+ var __async$o = (__this, __arguments, generator) => {
17302
17308
  return new Promise((resolve, reject) => {
17303
17309
  var fulfilled = (value) => {
17304
17310
  try {
@@ -17322,7 +17328,7 @@ const useUpdateAutoFunding = (carrierId) => {
17322
17328
  const { client } = useShipEngine();
17323
17329
  const queryClient = useQueryClient();
17324
17330
  return useMutation({
17325
- mutationFn: (options) => __async$n(void 0, null, function* () {
17331
+ mutationFn: (options) => __async$o(void 0, null, function* () {
17326
17332
  const result = yield client.carriers.updateAutoFunding(carrierId, options);
17327
17333
  return result.data;
17328
17334
  }),
@@ -17361,7 +17367,7 @@ const useListCustomPackageTypes = () => {
17361
17367
  });
17362
17368
  };
17363
17369
 
17364
- var __async$m = (__this, __arguments, generator) => {
17370
+ var __async$n = (__this, __arguments, generator) => {
17365
17371
  return new Promise((resolve, reject) => {
17366
17372
  var fulfilled = (value) => {
17367
17373
  try {
@@ -17384,7 +17390,7 @@ var __async$m = (__this, __arguments, generator) => {
17384
17390
  const useCreateFundingSource = () => {
17385
17391
  const { client } = useShipEngine();
17386
17392
  return useMutation({
17387
- mutationFn: (fundingSource) => __async$m(void 0, null, function* () {
17393
+ mutationFn: (fundingSource) => __async$n(void 0, null, function* () {
17388
17394
  const result = yield client.fundingSources.create(fundingSource);
17389
17395
  return result.data;
17390
17396
  }),
@@ -17393,7 +17399,7 @@ const useCreateFundingSource = () => {
17393
17399
  });
17394
17400
  };
17395
17401
 
17396
- var __async$l = (__this, __arguments, generator) => {
17402
+ var __async$m = (__this, __arguments, generator) => {
17397
17403
  return new Promise((resolve, reject) => {
17398
17404
  var fulfilled = (value) => {
17399
17405
  try {
@@ -17416,7 +17422,7 @@ var __async$l = (__this, __arguments, generator) => {
17416
17422
  const useFundingSourcesAddFunds = (fundingSourceId) => {
17417
17423
  const { client } = useShipEngine();
17418
17424
  return useMutation({
17419
- mutationFn: (funds) => __async$l(void 0, null, function* () {
17425
+ mutationFn: (funds) => __async$m(void 0, null, function* () {
17420
17426
  const result = yield client.fundingSources.addFunds(funds, fundingSourceId);
17421
17427
  return result.data;
17422
17428
  }),
@@ -17445,7 +17451,7 @@ const useListFundingSources = () => {
17445
17451
  });
17446
17452
  };
17447
17453
 
17448
- var __async$k = (__this, __arguments, generator) => {
17454
+ var __async$l = (__this, __arguments, generator) => {
17449
17455
  return new Promise((resolve, reject) => {
17450
17456
  var fulfilled = (value) => {
17451
17457
  try {
@@ -17468,7 +17474,7 @@ var __async$k = (__this, __arguments, generator) => {
17468
17474
  const useRegisterCarrier = () => {
17469
17475
  const { client } = useShipEngine();
17470
17476
  return useMutation({
17471
- mutationFn: (carrier) => __async$k(void 0, null, function* () {
17477
+ mutationFn: (carrier) => __async$l(void 0, null, function* () {
17472
17478
  const result = yield client.fundingSources.registerCarrier(carrier);
17473
17479
  return result.data;
17474
17480
  }),
@@ -17477,7 +17483,7 @@ const useRegisterCarrier = () => {
17477
17483
  });
17478
17484
  };
17479
17485
 
17480
- var __async$j = (__this, __arguments, generator) => {
17486
+ var __async$k = (__this, __arguments, generator) => {
17481
17487
  return new Promise((resolve, reject) => {
17482
17488
  var fulfilled = (value) => {
17483
17489
  try {
@@ -17500,7 +17506,7 @@ var __async$j = (__this, __arguments, generator) => {
17500
17506
  const useUpdateFundingSource = () => {
17501
17507
  const { client } = useShipEngine();
17502
17508
  return useMutation({
17503
- mutationFn: (_0) => __async$j(void 0, [_0], function* ({
17509
+ mutationFn: (_0) => __async$k(void 0, [_0], function* ({
17504
17510
  billingInfo,
17505
17511
  creditCardInfo,
17506
17512
  fundingSourceId
@@ -17567,7 +17573,7 @@ var __objRest$6 = (source, exclude) => {
17567
17573
  }
17568
17574
  return target;
17569
17575
  };
17570
- var __async$i = (__this, __arguments, generator) => {
17576
+ var __async$j = (__this, __arguments, generator) => {
17571
17577
  return new Promise((resolve, reject) => {
17572
17578
  var fulfilled = (value) => {
17573
17579
  try {
@@ -17590,7 +17596,7 @@ var __async$i = (__this, __arguments, generator) => {
17590
17596
  const useCreateLabel = () => {
17591
17597
  const { client } = useShipEngine();
17592
17598
  return useMutation({
17593
- mutationFn: (_a) => __async$i(void 0, null, function* () {
17599
+ mutationFn: (_a) => __async$j(void 0, null, function* () {
17594
17600
  var _b = _a, { rateId } = _b, options = __objRest$6(_b, ["rateId"]);
17595
17601
  const result = yield client.labels.createByRateId(rateId, options);
17596
17602
  return result.data;
@@ -17626,7 +17632,7 @@ const useListLabels = (params) => {
17626
17632
  });
17627
17633
  };
17628
17634
 
17629
- var __async$h = (__this, __arguments, generator) => {
17635
+ var __async$i = (__this, __arguments, generator) => {
17630
17636
  return new Promise((resolve, reject) => {
17631
17637
  var fulfilled = (value) => {
17632
17638
  try {
@@ -17649,7 +17655,7 @@ var __async$h = (__this, __arguments, generator) => {
17649
17655
  const useVoidLabel = () => {
17650
17656
  const { client } = useShipEngine();
17651
17657
  return useMutation({
17652
- mutationFn: (labelId) => __async$h(void 0, null, function* () {
17658
+ mutationFn: (labelId) => __async$i(void 0, null, function* () {
17653
17659
  const result = yield client.labels.void(labelId);
17654
17660
  return result.data;
17655
17661
  }),
@@ -17668,7 +17674,7 @@ const useListOrderSources = () => {
17668
17674
  });
17669
17675
  };
17670
17676
 
17671
- var __async$g = (__this, __arguments, generator) => {
17677
+ var __async$h = (__this, __arguments, generator) => {
17672
17678
  return new Promise((resolve, reject) => {
17673
17679
  var fulfilled = (value) => {
17674
17680
  try {
@@ -17691,7 +17697,7 @@ var __async$g = (__this, __arguments, generator) => {
17691
17697
  const useRefreshOrderSourceAsync = () => {
17692
17698
  const { client } = useShipEngine();
17693
17699
  return useMutation({
17694
- mutationFn: (orderSourceId) => __async$g(void 0, null, function* () {
17700
+ mutationFn: (orderSourceId) => __async$h(void 0, null, function* () {
17695
17701
  const result = yield client.orderSources.refresh(orderSourceId);
17696
17702
  return result.data;
17697
17703
  }),
@@ -17702,9 +17708,9 @@ const useRefreshOrderSource = () => {
17702
17708
  const { client } = useShipEngine();
17703
17709
  const { mutateAsync: refreshOrderSourceAsync } = useRefreshOrderSourceAsync();
17704
17710
  return useMutation({
17705
- mutationFn: (orderSourceId) => __async$g(void 0, null, function* () {
17711
+ mutationFn: (orderSourceId) => __async$h(void 0, null, function* () {
17706
17712
  yield refreshOrderSourceAsync(orderSourceId);
17707
- const waitResult = yield retryUntil(() => __async$g(void 0, null, function* () {
17713
+ const waitResult = yield retryUntil(() => __async$h(void 0, null, function* () {
17708
17714
  const { data: checkResult } = yield client.orderSources.get(orderSourceId);
17709
17715
  if (["preparing_update", "updating"].includes(checkResult.refreshInfo.status)) {
17710
17716
  throw new CodedError("Order source is still refreshing");
@@ -17718,7 +17724,7 @@ const useRefreshOrderSource = () => {
17718
17724
  });
17719
17725
  };
17720
17726
 
17721
- var __async$f = (__this, __arguments, generator) => {
17727
+ var __async$g = (__this, __arguments, generator) => {
17722
17728
  return new Promise((resolve, reject) => {
17723
17729
  var fulfilled = (value) => {
17724
17730
  try {
@@ -17741,7 +17747,7 @@ var __async$f = (__this, __arguments, generator) => {
17741
17747
  const useCreateRateCard = () => {
17742
17748
  const { client } = useShipEngine();
17743
17749
  return useMutation({
17744
- mutationFn: (rateCard) => __async$f(void 0, null, function* () {
17750
+ mutationFn: (rateCard) => __async$g(void 0, null, function* () {
17745
17751
  const result = yield client.rateCards.create(rateCard);
17746
17752
  return result.data;
17747
17753
  }),
@@ -17788,7 +17794,7 @@ const useListRateCards = (carrierIds) => {
17788
17794
  });
17789
17795
  };
17790
17796
 
17791
- var __async$e = (__this, __arguments, generator) => {
17797
+ var __async$f = (__this, __arguments, generator) => {
17792
17798
  return new Promise((resolve, reject) => {
17793
17799
  var fulfilled = (value) => {
17794
17800
  try {
@@ -17811,7 +17817,7 @@ var __async$e = (__this, __arguments, generator) => {
17811
17817
  const usePublishRateCard = () => {
17812
17818
  const { client } = useShipEngine();
17813
17819
  return useMutation({
17814
- mutationFn: (rateCardId) => __async$e(void 0, null, function* () {
17820
+ mutationFn: (rateCardId) => __async$f(void 0, null, function* () {
17815
17821
  return yield client.rateCards.publish(rateCardId);
17816
17822
  }),
17817
17823
  mutationKey: ["usePublishRateCard"],
@@ -17819,7 +17825,7 @@ const usePublishRateCard = () => {
17819
17825
  });
17820
17826
  };
17821
17827
 
17822
- var __async$d = (__this, __arguments, generator) => {
17828
+ var __async$e = (__this, __arguments, generator) => {
17823
17829
  return new Promise((resolve, reject) => {
17824
17830
  var fulfilled = (value) => {
17825
17831
  try {
@@ -17842,7 +17848,7 @@ var __async$d = (__this, __arguments, generator) => {
17842
17848
  const useUpdateRateCard = () => {
17843
17849
  const { client } = useShipEngine();
17844
17850
  return useMutation({
17845
- mutationFn: (rateCard) => __async$d(void 0, null, function* () {
17851
+ mutationFn: (rateCard) => __async$e(void 0, null, function* () {
17846
17852
  const result = yield client.rateCards.update(rateCard);
17847
17853
  return result.data;
17848
17854
  }),
@@ -17851,7 +17857,7 @@ const useUpdateRateCard = () => {
17851
17857
  });
17852
17858
  };
17853
17859
 
17854
- var __async$c = (__this, __arguments, generator) => {
17860
+ var __async$d = (__this, __arguments, generator) => {
17855
17861
  return new Promise((resolve, reject) => {
17856
17862
  var fulfilled = (value) => {
17857
17863
  try {
@@ -17874,7 +17880,7 @@ var __async$c = (__this, __arguments, generator) => {
17874
17880
  const useUploadRateCard = () => {
17875
17881
  const { client } = useShipEngine();
17876
17882
  return useMutation({
17877
- mutationFn: (_0) => __async$c(void 0, [_0], function* ({ rateCardId, file }) {
17883
+ mutationFn: (_0) => __async$d(void 0, [_0], function* ({ rateCardId, file }) {
17878
17884
  const result = yield client.rateCards.upload(rateCardId, file);
17879
17885
  return result.data;
17880
17886
  }),
@@ -17883,7 +17889,7 @@ const useUploadRateCard = () => {
17883
17889
  });
17884
17890
  };
17885
17891
 
17886
- var __async$b = (__this, __arguments, generator) => {
17892
+ var __async$c = (__this, __arguments, generator) => {
17887
17893
  return new Promise((resolve, reject) => {
17888
17894
  var fulfilled = (value) => {
17889
17895
  try {
@@ -17906,7 +17912,7 @@ var __async$b = (__this, __arguments, generator) => {
17906
17912
  const useDeleteRateCard = () => {
17907
17913
  const { client } = useShipEngine();
17908
17914
  return useMutation({
17909
- mutationFn: (rateCardId) => __async$b(void 0, null, function* () {
17915
+ mutationFn: (rateCardId) => __async$c(void 0, null, function* () {
17910
17916
  const result = yield client.rateCards.delete(rateCardId);
17911
17917
  return result.data;
17912
17918
  }),
@@ -17915,7 +17921,7 @@ const useDeleteRateCard = () => {
17915
17921
  });
17916
17922
  };
17917
17923
 
17918
- var __async$a = (__this, __arguments, generator) => {
17924
+ var __async$b = (__this, __arguments, generator) => {
17919
17925
  return new Promise((resolve, reject) => {
17920
17926
  var fulfilled = (value) => {
17921
17927
  try {
@@ -17938,7 +17944,7 @@ var __async$a = (__this, __arguments, generator) => {
17938
17944
  const useCalculateRates = () => {
17939
17945
  const { client } = useShipEngine();
17940
17946
  return useMutation({
17941
- mutationFn: (_0) => __async$a(void 0, [_0], function* ({ rateOptions, shipmentId }) {
17947
+ mutationFn: (_0) => __async$b(void 0, [_0], function* ({ rateOptions, shipmentId }) {
17942
17948
  const result = yield client.rates.calculateByShipmentId(shipmentId, rateOptions);
17943
17949
  return result.data;
17944
17950
  }),
@@ -17988,7 +17994,7 @@ var __objRest$5 = (source, exclude) => {
17988
17994
  }
17989
17995
  return target;
17990
17996
  };
17991
- var __async$9 = (__this, __arguments, generator) => {
17997
+ var __async$a = (__this, __arguments, generator) => {
17992
17998
  return new Promise((resolve, reject) => {
17993
17999
  var fulfilled = (value) => {
17994
18000
  try {
@@ -18011,7 +18017,7 @@ var __async$9 = (__this, __arguments, generator) => {
18011
18017
  const useNotifySalesOrderShipped = () => {
18012
18018
  const { client } = useShipEngine();
18013
18019
  return useMutation({
18014
- mutationFn: (_a) => __async$9(void 0, null, function* () {
18020
+ mutationFn: (_a) => __async$a(void 0, null, function* () {
18015
18021
  var _b = _a, { salesOrderId } = _b, tracking = __objRest$5(_b, ["salesOrderId"]);
18016
18022
  const result = yield client.salesOrders.notifyShipped(salesOrderId, tracking);
18017
18023
  return result.data;
@@ -18036,7 +18042,7 @@ var __objRest$4 = (source, exclude) => {
18036
18042
  }
18037
18043
  return target;
18038
18044
  };
18039
- var __async$8 = (__this, __arguments, generator) => {
18045
+ var __async$9 = (__this, __arguments, generator) => {
18040
18046
  return new Promise((resolve, reject) => {
18041
18047
  var fulfilled = (value) => {
18042
18048
  try {
@@ -18059,7 +18065,7 @@ var __async$8 = (__this, __arguments, generator) => {
18059
18065
  const useCreateSalesOrderShipment = () => {
18060
18066
  const { client } = useShipEngine();
18061
18067
  return useMutation({
18062
- mutationFn: (_a) => __async$8(void 0, null, function* () {
18068
+ mutationFn: (_a) => __async$9(void 0, null, function* () {
18063
18069
  var _b = _a, { salesOrderId } = _b, shipment = __objRest$4(_b, ["salesOrderId"]);
18064
18070
  const result = yield client.salesOrderShipments.create(salesOrderId, shipment);
18065
18071
  return result.data;
@@ -18110,7 +18116,7 @@ var __objRest$3 = (source, exclude) => {
18110
18116
  }
18111
18117
  return target;
18112
18118
  };
18113
- var __async$7 = (__this, __arguments, generator) => {
18119
+ var __async$8 = (__this, __arguments, generator) => {
18114
18120
  return new Promise((resolve, reject) => {
18115
18121
  var fulfilled = (value) => {
18116
18122
  try {
@@ -18133,7 +18139,7 @@ var __async$7 = (__this, __arguments, generator) => {
18133
18139
  const useUpdateSalesOrderShipment = () => {
18134
18140
  const { client } = useShipEngine();
18135
18141
  return useMutation({
18136
- mutationFn: (_a) => __async$7(void 0, null, function* () {
18142
+ mutationFn: (_a) => __async$8(void 0, null, function* () {
18137
18143
  var _b = _a, { shipmentId } = _b, shipment = __objRest$3(_b, ["shipmentId"]);
18138
18144
  const result = yield client.salesOrderShipments.update(shipmentId, shipment);
18139
18145
  return result.data;
@@ -18162,7 +18168,7 @@ var __spreadValues$2 = (a, b) => {
18162
18168
  return a;
18163
18169
  };
18164
18170
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
18165
- var __async$6 = (__this, __arguments, generator) => {
18171
+ var __async$7 = (__this, __arguments, generator) => {
18166
18172
  return new Promise((resolve, reject) => {
18167
18173
  var fulfilled = (value) => {
18168
18174
  try {
@@ -18185,7 +18191,7 @@ var __async$6 = (__this, __arguments, generator) => {
18185
18191
  const useCreateShipment = () => {
18186
18192
  const { client } = useShipEngine();
18187
18193
  return useMutation({
18188
- mutationFn: (shipment) => __async$6(void 0, null, function* () {
18194
+ mutationFn: (shipment) => __async$7(void 0, null, function* () {
18189
18195
  var _a;
18190
18196
  if (shipment.warehouseId === void 0) {
18191
18197
  throw new CodedError("errorMessages.noWarehouses", {
@@ -18283,7 +18289,7 @@ const useListShippingRules = () => {
18283
18289
  });
18284
18290
  };
18285
18291
 
18286
- var __async$5 = (__this, __arguments, generator) => {
18292
+ var __async$6 = (__this, __arguments, generator) => {
18287
18293
  return new Promise((resolve, reject) => {
18288
18294
  var fulfilled = (value) => {
18289
18295
  try {
@@ -18306,7 +18312,7 @@ var __async$5 = (__this, __arguments, generator) => {
18306
18312
  const useCreateShippingRule = () => {
18307
18313
  const { client } = useShipEngine();
18308
18314
  return useMutation({
18309
- mutationFn: (shippingRule) => __async$5(void 0, null, function* () {
18315
+ mutationFn: (shippingRule) => __async$6(void 0, null, function* () {
18310
18316
  const result = yield client.shippingRules.create(shippingRule);
18311
18317
  return result.data;
18312
18318
  }),
@@ -18315,7 +18321,7 @@ const useCreateShippingRule = () => {
18315
18321
  });
18316
18322
  };
18317
18323
 
18318
- var __async$4 = (__this, __arguments, generator) => {
18324
+ var __async$5 = (__this, __arguments, generator) => {
18319
18325
  return new Promise((resolve, reject) => {
18320
18326
  var fulfilled = (value) => {
18321
18327
  try {
@@ -18338,7 +18344,7 @@ var __async$4 = (__this, __arguments, generator) => {
18338
18344
  const useDeleteShippingRule = () => {
18339
18345
  const { client } = useShipEngine();
18340
18346
  return useMutation({
18341
- mutationFn: (shippingRuleId) => __async$4(void 0, null, function* () {
18347
+ mutationFn: (shippingRuleId) => __async$5(void 0, null, function* () {
18342
18348
  const result = yield client.shippingRules.delete(shippingRuleId);
18343
18349
  return result.data;
18344
18350
  }),
@@ -18347,7 +18353,7 @@ const useDeleteShippingRule = () => {
18347
18353
  });
18348
18354
  };
18349
18355
 
18350
- var __async$3 = (__this, __arguments, generator) => {
18356
+ var __async$4 = (__this, __arguments, generator) => {
18351
18357
  return new Promise((resolve, reject) => {
18352
18358
  var fulfilled = (value) => {
18353
18359
  try {
@@ -18370,7 +18376,7 @@ var __async$3 = (__this, __arguments, generator) => {
18370
18376
  const useCreateWarehouse = () => {
18371
18377
  const { client } = useShipEngine();
18372
18378
  return useMutation({
18373
- mutationFn: (data) => __async$3(void 0, null, function* () {
18379
+ mutationFn: (data) => __async$4(void 0, null, function* () {
18374
18380
  const result = yield client.warehouses.create(data);
18375
18381
  return result.data;
18376
18382
  }),
@@ -18379,7 +18385,7 @@ const useCreateWarehouse = () => {
18379
18385
  });
18380
18386
  };
18381
18387
 
18382
- var __async$2 = (__this, __arguments, generator) => {
18388
+ var __async$3 = (__this, __arguments, generator) => {
18383
18389
  return new Promise((resolve, reject) => {
18384
18390
  var fulfilled = (value) => {
18385
18391
  try {
@@ -18402,7 +18408,7 @@ var __async$2 = (__this, __arguments, generator) => {
18402
18408
  const useDeleteWarehouse = () => {
18403
18409
  const { client } = useShipEngine();
18404
18410
  return useMutation({
18405
- mutationFn: (_0) => __async$2(void 0, [_0], function* ({ warehouseId }) {
18411
+ mutationFn: (_0) => __async$3(void 0, [_0], function* ({ warehouseId }) {
18406
18412
  const result = yield client.warehouses.delete(warehouseId);
18407
18413
  return result.data;
18408
18414
  }),
@@ -18438,7 +18444,7 @@ var __objRest$1 = (source, exclude) => {
18438
18444
  }
18439
18445
  return target;
18440
18446
  };
18441
- var __async$1 = (__this, __arguments, generator) => {
18447
+ var __async$2 = (__this, __arguments, generator) => {
18442
18448
  return new Promise((resolve, reject) => {
18443
18449
  var fulfilled = (value) => {
18444
18450
  try {
@@ -18461,7 +18467,7 @@ var __async$1 = (__this, __arguments, generator) => {
18461
18467
  const useUpdateWarehouse = () => {
18462
18468
  const { client } = useShipEngine();
18463
18469
  return useMutation({
18464
- mutationFn: (_a) => __async$1(void 0, null, function* () {
18470
+ mutationFn: (_a) => __async$2(void 0, null, function* () {
18465
18471
  var _b = _a, { warehouseId } = _b, warehouse = __objRest$1(_b, ["warehouseId"]);
18466
18472
  const result = yield client.warehouses.update(warehouseId, warehouse);
18467
18473
  return result.data;
@@ -18481,6 +18487,38 @@ const useGetAccountBillingPlan = () => {
18481
18487
  });
18482
18488
  };
18483
18489
 
18490
+ var __async$1 = (__this, __arguments, generator) => {
18491
+ return new Promise((resolve, reject) => {
18492
+ var fulfilled = (value) => {
18493
+ try {
18494
+ step(generator.next(value));
18495
+ } catch (e) {
18496
+ reject(e);
18497
+ }
18498
+ };
18499
+ var rejected = (value) => {
18500
+ try {
18501
+ step(generator.throw(value));
18502
+ } catch (e) {
18503
+ reject(e);
18504
+ }
18505
+ };
18506
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
18507
+ step((generator = generator.apply(__this, __arguments)).next());
18508
+ });
18509
+ };
18510
+ const useUpdateAccountBillingPlan = () => {
18511
+ const { client } = useShipEngine();
18512
+ return useMutation({
18513
+ mutationFn: (code) => __async$1(void 0, null, function* () {
18514
+ const result = yield client.accountBillingPlan.update({ code });
18515
+ return result.data;
18516
+ }),
18517
+ mutationKey: ["useUpdateAccountBillingPlan"],
18518
+ onError
18519
+ });
18520
+ };
18521
+
18484
18522
  const fallbackThemeData = {
18485
18523
  borderRadius: {
18486
18524
  L: "16px",
@@ -19596,4 +19634,4 @@ const alchemy = {
19596
19634
  createElement
19597
19635
  };
19598
19636
 
19599
- export { AccountSettingsAPI, AddressesAPI, AlchemyContext, AlchemyProvider, AlchemyTestProvider, CarriersAPI, CodedError, ConfirmationType, CreditCardVendor, Currency, CustomPackagesAPI, CustomsContentsType, CustomsNonDeliveryType, Element, ErrorBoundary, FundingSourcesAPI, InsuranceAPI, InsuranceProviderType, LabelsAPI, MetadataCapability, MetadataRequirement, MetadataSatisfyingFormTypes, OrderSourcesAPI, RateCardStatus, RateCardsAPI, RatesAPI, types as SE, SalesOrderShipmentsAPI, SalesOrdersAPI, ShipEngine, ShipEngineAPI, ShipEngineContext, ShipmentsAPI, ShippingRulesAPI, WarehousesAPI, alchemy, alchemy as default, delay, getEmotionCache, getEndUserIpAddress, isCodedError, isCodedErrors, logger, onError, retryUntil, useAddFunds, useAlchemy, useCalculateRates, useConnectCarrier, useCreateAccountImage, useCreateFundingSource, useCreateLabel, useCreateRateCard, useCreateSalesOrderShipment, useCreateShipment, useCreateShippingRule, useCreateWarehouse, useDeleteAccountImage, useDeleteRateCard, useDeleteShippingRule, useDeleteWarehouse, useDownloadRateCard, useFundingSourcesAddFunds, useGetAccountBillingPlan, useGetAccountImages, useGetAccountSettings, useGetAutoFundingConfiguration, useGetCarrierById, useGetCountriesByCarrier, useGetCurrenciesByCarrier, useGetFundingSourceById, useGetFundingSourceMetadata, useGetFundingSourceTransactions, useGetInsuranceAccount, useGetLabel, useGetPackageRatingGroupByCarrier, useGetRateCardById, useGetSalesOrder, useGetSalesOrderShipment, useGetServicesByCarrier, useGetShipment, useGetShipmentRates, useGetWalletHistory, useGetZonesByCarrier, useI18n, useListCarriers, useListCustomPackageTypes, useListFundingSources, useListLabels, useListOrderSources, useListRateCards, useListSalesOrderShipments, useListSalesOrders, useListShipments, useListShippingRules, useListWarehouses, useLoadIcons, useNotifySalesOrderShipped, useParseAddress, usePublishRateCard, useRefreshOrderSource, useRefreshOrderSourceAsync, useRegisterCarrier, useShipEngine, useUpdateAccountImage, useUpdateAccountSettings, useUpdateAutoFunding, useUpdateFundingSource, useUpdateRateCard, useUpdateSalesOrderShipment, useUpdateWarehouse, useUploadRateCard, useValidateAddresses, useVoidLabel };
19637
+ export { AccountSettingsAPI, AddressesAPI, AlchemyContext, AlchemyProvider, AlchemyTestProvider, CarriersAPI, CodedError, ConfirmationType, CreditCardVendor, Currency, CustomPackagesAPI, CustomsContentsType, CustomsNonDeliveryType, Element, ErrorBoundary, FundingSourcesAPI, InsuranceAPI, InsuranceProviderType, LabelsAPI, MetadataCapability, MetadataRequirement, MetadataSatisfyingFormTypes, OrderSourcesAPI, RateCardStatus, RateCardsAPI, RatesAPI, types as SE, SalesOrderShipmentsAPI, SalesOrdersAPI, ShipEngine, ShipEngineAPI, ShipEngineContext, ShipmentsAPI, ShippingRulesAPI, WarehousesAPI, alchemy, alchemy as default, delay, getEmotionCache, getEndUserIpAddress, isCodedError, isCodedErrors, logger, onError, retryUntil, useAddFunds, useAlchemy, useCalculateRates, useConnectCarrier, useCreateAccountImage, useCreateFundingSource, useCreateLabel, useCreateRateCard, useCreateSalesOrderShipment, useCreateShipment, useCreateShippingRule, useCreateWarehouse, useDeleteAccountImage, useDeleteRateCard, useDeleteShippingRule, useDeleteWarehouse, useDownloadRateCard, useFundingSourcesAddFunds, useGetAccountBillingPlan, useGetAccountImages, useGetAccountSettings, useGetAutoFundingConfiguration, useGetCarrierById, useGetCountriesByCarrier, useGetCurrenciesByCarrier, useGetFundingSourceById, useGetFundingSourceMetadata, useGetFundingSourceTransactions, useGetInsuranceAccount, useGetLabel, useGetPackageRatingGroupByCarrier, useGetRateCardById, useGetSalesOrder, useGetSalesOrderShipment, useGetServicesByCarrier, useGetShipment, useGetShipmentRates, useGetWalletHistory, useGetZonesByCarrier, useI18n, useListCarriers, useListCustomPackageTypes, useListFundingSources, useListLabels, useListOrderSources, useListRateCards, useListSalesOrderShipments, useListSalesOrders, useListShipments, useListShippingRules, useListWarehouses, useLoadIcons, useNotifySalesOrderShipped, useParseAddress, usePublishRateCard, useRefreshOrderSource, useRefreshOrderSourceAsync, useRegisterCarrier, useShipEngine, useUpdateAccountBillingPlan, useUpdateAccountImage, useUpdateAccountSettings, useUpdateAutoFunding, useUpdateFundingSource, useUpdateRateCard, useUpdateSalesOrderShipment, useUpdateWarehouse, useUploadRateCard, useValidateAddresses, useVoidLabel };