@shipengine/alchemy 5.0.6 → 5.0.8

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 +270 -81
  2. package/index.mjs +267 -83
  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$d = Object.getOwnPropertySymbols;
10790
- var __hasOwnProp$d = Object.prototype.hasOwnProperty;
10791
- var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
10792
- var __objRest$8 = (source, exclude) => {
10789
+ var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
10790
+ var __hasOwnProp$e = Object.prototype.hasOwnProperty;
10791
+ var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
10792
+ var __objRest$9 = (source, exclude) => {
10793
10793
  var target = {};
10794
10794
  for (var prop in source)
10795
- if (__hasOwnProp$d.call(source, prop) && exclude.indexOf(prop) < 0)
10795
+ if (__hasOwnProp$e.call(source, prop) && exclude.indexOf(prop) < 0)
10796
10796
  target[prop] = source[prop];
10797
- if (source != null && __getOwnPropSymbols$d)
10798
- for (var prop of __getOwnPropSymbols$d(source)) {
10799
- if (exclude.indexOf(prop) < 0 && __propIsEnum$d.call(source, prop))
10797
+ if (source != null && __getOwnPropSymbols$e)
10798
+ for (var prop of __getOwnPropSymbols$e(source)) {
10799
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$e.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$8(_b, ["message"]);
10813
+ var _b = _a, { message } = _b, options = __objRest$9(_b, ["message"]);
10814
10814
  return new CodedError(message, options);
10815
10815
  }
10816
10816
  }
@@ -10918,6 +10918,21 @@ const types = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
10918
10918
  RateCardStatus
10919
10919
  }, Symbol.toStringTag, { value: 'Module' }));
10920
10920
 
10921
+ var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
10922
+ var __hasOwnProp$d = Object.prototype.hasOwnProperty;
10923
+ var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
10924
+ var __objRest$8 = (source, exclude) => {
10925
+ var target = {};
10926
+ for (var prop in source)
10927
+ if (__hasOwnProp$d.call(source, prop) && exclude.indexOf(prop) < 0)
10928
+ target[prop] = source[prop];
10929
+ if (source != null && __getOwnPropSymbols$d)
10930
+ for (var prop of __getOwnPropSymbols$d(source)) {
10931
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$d.call(source, prop))
10932
+ target[prop] = source[prop];
10933
+ }
10934
+ return target;
10935
+ };
10921
10936
  class AccountSettingsAPI {
10922
10937
  constructor(client) {
10923
10938
  this.client = client;
@@ -10935,6 +10950,31 @@ class AccountSettingsAPI {
10935
10950
  this.update = (settings) => {
10936
10951
  return this.client.put("/v1/account/settings", settings);
10937
10952
  };
10953
+ /**
10954
+ * The `createImage` method creates an image that can be used in your printed labels.
10955
+ */
10956
+ this.createImage = (data) => {
10957
+ return this.client.post("/v1/account/settings/images", data);
10958
+ };
10959
+ /**
10960
+ * The `updateImage` method updates specific image data for a given image id.
10961
+ */
10962
+ this.updateImage = (_a) => {
10963
+ var _b = _a, { labelImageId } = _b, data = __objRest$8(_b, ["labelImageId"]);
10964
+ return this.client.put(`/v1/account/settings/images/${labelImageId}`, data);
10965
+ };
10966
+ /**
10967
+ * The `getImages` method retrieves a list of images for a given user.
10968
+ */
10969
+ this.getImages = () => {
10970
+ return this.client.get("/v1/account/settings/images");
10971
+ };
10972
+ /**
10973
+ * The `deleteAccountImage` method deletes an image by id.
10974
+ */
10975
+ this.deleteImage = (labelImageId) => {
10976
+ return this.client.delete(`/v1/account/settings/images/${labelImageId}`);
10977
+ };
10938
10978
  this.client = client;
10939
10979
  }
10940
10980
  }
@@ -13600,7 +13640,7 @@ var ipaddr = {
13600
13640
  }).call(commonjsGlobal);
13601
13641
  } (ipaddr));
13602
13642
 
13603
- var __async$x = (__this, __arguments, generator) => {
13643
+ var __async$B = (__this, __arguments, generator) => {
13604
13644
  return new Promise((resolve, reject) => {
13605
13645
  var fulfilled = (value) => {
13606
13646
  try {
@@ -13620,7 +13660,7 @@ var __async$x = (__this, __arguments, generator) => {
13620
13660
  step((generator = generator.apply(__this, __arguments)).next());
13621
13661
  });
13622
13662
  };
13623
- const getEndUserIpAddress = () => __async$x(void 0, null, function* () {
13663
+ const getEndUserIpAddress = () => __async$B(void 0, null, function* () {
13624
13664
  try {
13625
13665
  const response = yield axios.get("https://api.ipify.org/?format=json");
13626
13666
  if (response.data.ip && ipaddrExports.isValid(response.data.ip)) {
@@ -13663,7 +13703,7 @@ var __objRest$7 = (source, exclude) => {
13663
13703
  }
13664
13704
  return target;
13665
13705
  };
13666
- var __async$w = (__this, __arguments, generator) => {
13706
+ var __async$A = (__this, __arguments, generator) => {
13667
13707
  return new Promise((resolve, reject) => {
13668
13708
  var fulfilled = (value) => {
13669
13709
  try {
@@ -13701,7 +13741,7 @@ class CarriersAPI {
13701
13741
  /**
13702
13742
  * The `connect` method connects a carrier account to a user's ShipEngine account.
13703
13743
  */
13704
- this.connect = (_a) => __async$w(this, null, function* () {
13744
+ this.connect = (_a) => __async$A(this, null, function* () {
13705
13745
  var _b = _a, { carrierCode } = _b, connection = __objRest$7(_b, ["carrierCode"]);
13706
13746
  const endUserIpAddress = yield getEndUserIpAddress();
13707
13747
  if (!endUserIpAddress)
@@ -15984,6 +16024,12 @@ class AccountBillingPlanAPI {
15984
16024
  this.get = () => {
15985
16025
  return this.client.get("/v1/account/billing_plan");
15986
16026
  };
16027
+ /**
16028
+ * The `update` method updates the code of the account billing plan
16029
+ */
16030
+ this.update = (reqBody) => {
16031
+ return this.client.put(`/v1/account/billing_plan`, reqBody);
16032
+ };
15987
16033
  this.client = client;
15988
16034
  }
15989
16035
  }
@@ -16017,7 +16063,7 @@ var __spreadValues$5 = (a, b) => {
16017
16063
  }
16018
16064
  return a;
16019
16065
  };
16020
- var __async$v = (__this, __arguments, generator) => {
16066
+ var __async$z = (__this, __arguments, generator) => {
16021
16067
  return new Promise((resolve, reject) => {
16022
16068
  var fulfilled = (value) => {
16023
16069
  try {
@@ -16056,7 +16102,7 @@ class FundingSourcesAPI {
16056
16102
  * The `create` method creates a new funding source for a given user. This requires
16057
16103
  * payment information to be collected from the user.
16058
16104
  */
16059
- this.create = (createFundingSource) => __async$v(this, null, function* () {
16105
+ this.create = (createFundingSource) => __async$z(this, null, function* () {
16060
16106
  const endUserIpAddress = yield getEndUserIpAddress();
16061
16107
  if (!endUserIpAddress)
16062
16108
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -16069,7 +16115,7 @@ class FundingSourcesAPI {
16069
16115
  * user to update the billing address or payment information associated with the
16070
16116
  * funding source.
16071
16117
  */
16072
- this.update = (billingInfo, creditCardInfo, fundingSourceId) => __async$v(this, null, function* () {
16118
+ this.update = (billingInfo, creditCardInfo, fundingSourceId) => __async$z(this, null, function* () {
16073
16119
  const endUserIpAddress = yield getEndUserIpAddress();
16074
16120
  if (!endUserIpAddress)
16075
16121
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -16086,7 +16132,7 @@ class FundingSourcesAPI {
16086
16132
  * The `registerCarrier` method registers a carrier account and associates
16087
16133
  * it with a given funding source.
16088
16134
  */
16089
- this.registerCarrier = (carrier) => __async$v(this, null, function* () {
16135
+ this.registerCarrier = (carrier) => __async$z(this, null, function* () {
16090
16136
  const endUserIpAddress = yield getEndUserIpAddress();
16091
16137
  if (!endUserIpAddress)
16092
16138
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -16097,7 +16143,7 @@ class FundingSourcesAPI {
16097
16143
  /**
16098
16144
  * The `addFunds` method allows you to add funds to a funding source.
16099
16145
  */
16100
- this.addFunds = (amount, fundingSourceId) => __async$v(this, null, function* () {
16146
+ this.addFunds = (amount, fundingSourceId) => __async$z(this, null, function* () {
16101
16147
  return yield this.client.put(
16102
16148
  `/v1/funding_sources/${fundingSourceId}/add_funds`,
16103
16149
  amount
@@ -16107,7 +16153,7 @@ class FundingSourcesAPI {
16107
16153
  * The `metadata` method returns seller-specific requirements for creating funding sources
16108
16154
  * and attaching carriers
16109
16155
  */
16110
- this.metadata = () => __async$v(this, null, function* () {
16156
+ this.metadata = () => __async$z(this, null, function* () {
16111
16157
  return yield this.client.get("/v1/funding_sources/metadata");
16112
16158
  });
16113
16159
  /**
@@ -16350,7 +16396,7 @@ class SalesOrdersAPI {
16350
16396
  }
16351
16397
  }
16352
16398
 
16353
- var __async$u = (__this, __arguments, generator) => {
16399
+ var __async$y = (__this, __arguments, generator) => {
16354
16400
  return new Promise((resolve, reject) => {
16355
16401
  var fulfilled = (value) => {
16356
16402
  try {
@@ -16393,7 +16439,7 @@ class ShipmentsAPI {
16393
16439
  * The `create` method allows for creating shipments based on a list of shipment
16394
16440
  * items passed into this method.
16395
16441
  */
16396
- this.create = (...shipments) => __async$u(this, null, function* () {
16442
+ this.create = (...shipments) => __async$y(this, null, function* () {
16397
16443
  return this.client.post("/v1/shipments", {
16398
16444
  shipments
16399
16445
  });
@@ -16487,7 +16533,7 @@ var __spreadValues$4 = (a, b) => {
16487
16533
  return a;
16488
16534
  };
16489
16535
  var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
16490
- var __async$t = (__this, __arguments, generator) => {
16536
+ var __async$x = (__this, __arguments, generator) => {
16491
16537
  return new Promise((resolve, reject) => {
16492
16538
  var fulfilled = (value) => {
16493
16539
  try {
@@ -16581,7 +16627,7 @@ class ShipEngineAPI {
16581
16627
  );
16582
16628
  return res;
16583
16629
  },
16584
- (err) => __async$t(this, null, function* () {
16630
+ (err) => __async$x(this, null, function* () {
16585
16631
  var _a, _b, _c, _d, _e, _f, _g;
16586
16632
  logger$1.error(
16587
16633
  { err, req: err.config, res: err.response },
@@ -16876,6 +16922,80 @@ const retryUntil = (callbackFn, retries = 10, timeoutBetweenAttempts = 1e3) => P
16876
16922
  throw error;
16877
16923
  });
16878
16924
 
16925
+ var __async$w = (__this, __arguments, generator) => {
16926
+ return new Promise((resolve, reject) => {
16927
+ var fulfilled = (value) => {
16928
+ try {
16929
+ step(generator.next(value));
16930
+ } catch (e) {
16931
+ reject(e);
16932
+ }
16933
+ };
16934
+ var rejected = (value) => {
16935
+ try {
16936
+ step(generator.throw(value));
16937
+ } catch (e) {
16938
+ reject(e);
16939
+ }
16940
+ };
16941
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
16942
+ step((generator = generator.apply(__this, __arguments)).next());
16943
+ });
16944
+ };
16945
+ const useCreateAccountImage = () => {
16946
+ const { client } = useShipEngine();
16947
+ return reactQuery.useMutation({
16948
+ mutationFn: (data) => __async$w(void 0, null, function* () {
16949
+ const result = yield client.accountSettings.createImage(data);
16950
+ return result.data;
16951
+ }),
16952
+ mutationKey: ["useCreateAccountImage"],
16953
+ onError
16954
+ });
16955
+ };
16956
+
16957
+ var __async$v = (__this, __arguments, generator) => {
16958
+ return new Promise((resolve, reject) => {
16959
+ var fulfilled = (value) => {
16960
+ try {
16961
+ step(generator.next(value));
16962
+ } catch (e) {
16963
+ reject(e);
16964
+ }
16965
+ };
16966
+ var rejected = (value) => {
16967
+ try {
16968
+ step(generator.throw(value));
16969
+ } catch (e) {
16970
+ reject(e);
16971
+ }
16972
+ };
16973
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
16974
+ step((generator = generator.apply(__this, __arguments)).next());
16975
+ });
16976
+ };
16977
+ const useDeleteAccountImage = () => {
16978
+ const { client } = useShipEngine();
16979
+ return reactQuery.useMutation({
16980
+ mutationFn: (labelImageId) => __async$v(void 0, null, function* () {
16981
+ const result = yield client.accountSettings.deleteImage(labelImageId);
16982
+ return result.data;
16983
+ }),
16984
+ mutationKey: ["useDeleteAccountImage"],
16985
+ onError
16986
+ });
16987
+ };
16988
+
16989
+ const useGetAccountImages = () => {
16990
+ const { client } = useShipEngine();
16991
+ return reactQuery.useQuery({
16992
+ onError,
16993
+ queryFn: () => client.accountSettings.getImages(),
16994
+ queryKey: ["useGetAccountImages"],
16995
+ select: (result) => result.data
16996
+ });
16997
+ };
16998
+
16879
16999
  const useGetAccountSettings = () => {
16880
17000
  const { client } = useShipEngine();
16881
17001
  return reactQuery.useQuery({
@@ -16886,7 +17006,39 @@ const useGetAccountSettings = () => {
16886
17006
  });
16887
17007
  };
16888
17008
 
16889
- var __async$s = (__this, __arguments, generator) => {
17009
+ var __async$u = (__this, __arguments, generator) => {
17010
+ return new Promise((resolve, reject) => {
17011
+ var fulfilled = (value) => {
17012
+ try {
17013
+ step(generator.next(value));
17014
+ } catch (e) {
17015
+ reject(e);
17016
+ }
17017
+ };
17018
+ var rejected = (value) => {
17019
+ try {
17020
+ step(generator.throw(value));
17021
+ } catch (e) {
17022
+ reject(e);
17023
+ }
17024
+ };
17025
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
17026
+ step((generator = generator.apply(__this, __arguments)).next());
17027
+ });
17028
+ };
17029
+ const useUpdateAccountImage = () => {
17030
+ const { client } = useShipEngine();
17031
+ return reactQuery.useMutation({
17032
+ mutationFn: (data) => __async$u(void 0, null, function* () {
17033
+ const result = yield client.accountSettings.updateImage(data);
17034
+ return result.data;
17035
+ }),
17036
+ mutationKey: ["useUpdateAccountImage"],
17037
+ onError
17038
+ });
17039
+ };
17040
+
17041
+ var __async$t = (__this, __arguments, generator) => {
16890
17042
  return new Promise((resolve, reject) => {
16891
17043
  var fulfilled = (value) => {
16892
17044
  try {
@@ -16909,7 +17061,7 @@ var __async$s = (__this, __arguments, generator) => {
16909
17061
  const useUpdateAccountSettings = () => {
16910
17062
  const { client } = useShipEngine();
16911
17063
  return reactQuery.useMutation({
16912
- mutationFn: (settings) => __async$s(void 0, null, function* () {
17064
+ mutationFn: (settings) => __async$t(void 0, null, function* () {
16913
17065
  const result = yield client.accountSettings.update(settings);
16914
17066
  return result.data;
16915
17067
  }),
@@ -16918,7 +17070,7 @@ const useUpdateAccountSettings = () => {
16918
17070
  });
16919
17071
  };
16920
17072
 
16921
- var __async$r = (__this, __arguments, generator) => {
17073
+ var __async$s = (__this, __arguments, generator) => {
16922
17074
  return new Promise((resolve, reject) => {
16923
17075
  var fulfilled = (value) => {
16924
17076
  try {
@@ -16941,7 +17093,7 @@ var __async$r = (__this, __arguments, generator) => {
16941
17093
  const useParseAddress = () => {
16942
17094
  const { client } = useShipEngine();
16943
17095
  return reactQuery.useMutation({
16944
- mutationFn: (_0) => __async$r(void 0, [_0], function* ({ address, text }) {
17096
+ mutationFn: (_0) => __async$s(void 0, [_0], function* ({ address, text }) {
16945
17097
  const result = yield client.addresses.parse(text, address);
16946
17098
  return result.data;
16947
17099
  }),
@@ -16950,7 +17102,7 @@ const useParseAddress = () => {
16950
17102
  });
16951
17103
  };
16952
17104
 
16953
- var __async$q = (__this, __arguments, generator) => {
17105
+ var __async$r = (__this, __arguments, generator) => {
16954
17106
  return new Promise((resolve, reject) => {
16955
17107
  var fulfilled = (value) => {
16956
17108
  try {
@@ -16973,7 +17125,7 @@ var __async$q = (__this, __arguments, generator) => {
16973
17125
  const useValidateAddresses = () => {
16974
17126
  const { client } = useShipEngine();
16975
17127
  return reactQuery.useMutation({
16976
- mutationFn: (addresses) => __async$q(void 0, null, function* () {
17128
+ mutationFn: (addresses) => __async$r(void 0, null, function* () {
16977
17129
  const result = yield client.addresses.validate(addresses);
16978
17130
  return result.data;
16979
17131
  }),
@@ -16982,7 +17134,7 @@ const useValidateAddresses = () => {
16982
17134
  });
16983
17135
  };
16984
17136
 
16985
- var __async$p = (__this, __arguments, generator) => {
17137
+ var __async$q = (__this, __arguments, generator) => {
16986
17138
  return new Promise((resolve, reject) => {
16987
17139
  var fulfilled = (value) => {
16988
17140
  try {
@@ -17005,7 +17157,7 @@ var __async$p = (__this, __arguments, generator) => {
17005
17157
  const useAddFunds = () => {
17006
17158
  const { client } = useShipEngine();
17007
17159
  return reactQuery.useMutation({
17008
- mutationFn: (_0) => __async$p(void 0, [_0], function* ({ carrierId, funds }) {
17160
+ mutationFn: (_0) => __async$q(void 0, [_0], function* ({ carrierId, funds }) {
17009
17161
  const result = yield client.carriers.addFunds(carrierId, funds);
17010
17162
  return result.data;
17011
17163
  }),
@@ -17014,7 +17166,7 @@ const useAddFunds = () => {
17014
17166
  });
17015
17167
  };
17016
17168
 
17017
- var __async$o = (__this, __arguments, generator) => {
17169
+ var __async$p = (__this, __arguments, generator) => {
17018
17170
  return new Promise((resolve, reject) => {
17019
17171
  var fulfilled = (value) => {
17020
17172
  try {
@@ -17037,7 +17189,7 @@ var __async$o = (__this, __arguments, generator) => {
17037
17189
  const useConnectCarrier = () => {
17038
17190
  const { client } = useShipEngine();
17039
17191
  return reactQuery.useMutation({
17040
- mutationFn: (params) => __async$o(void 0, null, function* () {
17192
+ mutationFn: (params) => __async$p(void 0, null, function* () {
17041
17193
  const result = yield client.carriers.connect(params);
17042
17194
  return result.data;
17043
17195
  }),
@@ -17174,7 +17326,7 @@ const useListCarriers = () => {
17174
17326
  });
17175
17327
  };
17176
17328
 
17177
- var __async$n = (__this, __arguments, generator) => {
17329
+ var __async$o = (__this, __arguments, generator) => {
17178
17330
  return new Promise((resolve, reject) => {
17179
17331
  var fulfilled = (value) => {
17180
17332
  try {
@@ -17198,7 +17350,7 @@ const useUpdateAutoFunding = (carrierId) => {
17198
17350
  const { client } = useShipEngine();
17199
17351
  const queryClient = reactQuery.useQueryClient();
17200
17352
  return reactQuery.useMutation({
17201
- mutationFn: (options) => __async$n(void 0, null, function* () {
17353
+ mutationFn: (options) => __async$o(void 0, null, function* () {
17202
17354
  const result = yield client.carriers.updateAutoFunding(carrierId, options);
17203
17355
  return result.data;
17204
17356
  }),
@@ -17237,7 +17389,7 @@ const useListCustomPackageTypes = () => {
17237
17389
  });
17238
17390
  };
17239
17391
 
17240
- var __async$m = (__this, __arguments, generator) => {
17392
+ var __async$n = (__this, __arguments, generator) => {
17241
17393
  return new Promise((resolve, reject) => {
17242
17394
  var fulfilled = (value) => {
17243
17395
  try {
@@ -17260,7 +17412,7 @@ var __async$m = (__this, __arguments, generator) => {
17260
17412
  const useCreateFundingSource = () => {
17261
17413
  const { client } = useShipEngine();
17262
17414
  return reactQuery.useMutation({
17263
- mutationFn: (fundingSource) => __async$m(void 0, null, function* () {
17415
+ mutationFn: (fundingSource) => __async$n(void 0, null, function* () {
17264
17416
  const result = yield client.fundingSources.create(fundingSource);
17265
17417
  return result.data;
17266
17418
  }),
@@ -17269,7 +17421,7 @@ const useCreateFundingSource = () => {
17269
17421
  });
17270
17422
  };
17271
17423
 
17272
- var __async$l = (__this, __arguments, generator) => {
17424
+ var __async$m = (__this, __arguments, generator) => {
17273
17425
  return new Promise((resolve, reject) => {
17274
17426
  var fulfilled = (value) => {
17275
17427
  try {
@@ -17292,7 +17444,7 @@ var __async$l = (__this, __arguments, generator) => {
17292
17444
  const useFundingSourcesAddFunds = (fundingSourceId) => {
17293
17445
  const { client } = useShipEngine();
17294
17446
  return reactQuery.useMutation({
17295
- mutationFn: (funds) => __async$l(void 0, null, function* () {
17447
+ mutationFn: (funds) => __async$m(void 0, null, function* () {
17296
17448
  const result = yield client.fundingSources.addFunds(funds, fundingSourceId);
17297
17449
  return result.data;
17298
17450
  }),
@@ -17321,7 +17473,7 @@ const useListFundingSources = () => {
17321
17473
  });
17322
17474
  };
17323
17475
 
17324
- var __async$k = (__this, __arguments, generator) => {
17476
+ var __async$l = (__this, __arguments, generator) => {
17325
17477
  return new Promise((resolve, reject) => {
17326
17478
  var fulfilled = (value) => {
17327
17479
  try {
@@ -17344,7 +17496,7 @@ var __async$k = (__this, __arguments, generator) => {
17344
17496
  const useRegisterCarrier = () => {
17345
17497
  const { client } = useShipEngine();
17346
17498
  return reactQuery.useMutation({
17347
- mutationFn: (carrier) => __async$k(void 0, null, function* () {
17499
+ mutationFn: (carrier) => __async$l(void 0, null, function* () {
17348
17500
  const result = yield client.fundingSources.registerCarrier(carrier);
17349
17501
  return result.data;
17350
17502
  }),
@@ -17353,7 +17505,7 @@ const useRegisterCarrier = () => {
17353
17505
  });
17354
17506
  };
17355
17507
 
17356
- var __async$j = (__this, __arguments, generator) => {
17508
+ var __async$k = (__this, __arguments, generator) => {
17357
17509
  return new Promise((resolve, reject) => {
17358
17510
  var fulfilled = (value) => {
17359
17511
  try {
@@ -17376,7 +17528,7 @@ var __async$j = (__this, __arguments, generator) => {
17376
17528
  const useUpdateFundingSource = () => {
17377
17529
  const { client } = useShipEngine();
17378
17530
  return reactQuery.useMutation({
17379
- mutationFn: (_0) => __async$j(void 0, [_0], function* ({
17531
+ mutationFn: (_0) => __async$k(void 0, [_0], function* ({
17380
17532
  billingInfo,
17381
17533
  creditCardInfo,
17382
17534
  fundingSourceId
@@ -17443,7 +17595,7 @@ var __objRest$6 = (source, exclude) => {
17443
17595
  }
17444
17596
  return target;
17445
17597
  };
17446
- var __async$i = (__this, __arguments, generator) => {
17598
+ var __async$j = (__this, __arguments, generator) => {
17447
17599
  return new Promise((resolve, reject) => {
17448
17600
  var fulfilled = (value) => {
17449
17601
  try {
@@ -17466,7 +17618,7 @@ var __async$i = (__this, __arguments, generator) => {
17466
17618
  const useCreateLabel = () => {
17467
17619
  const { client } = useShipEngine();
17468
17620
  return reactQuery.useMutation({
17469
- mutationFn: (_a) => __async$i(void 0, null, function* () {
17621
+ mutationFn: (_a) => __async$j(void 0, null, function* () {
17470
17622
  var _b = _a, { rateId } = _b, options = __objRest$6(_b, ["rateId"]);
17471
17623
  const result = yield client.labels.createByRateId(rateId, options);
17472
17624
  return result.data;
@@ -17502,7 +17654,7 @@ const useListLabels = (params) => {
17502
17654
  });
17503
17655
  };
17504
17656
 
17505
- var __async$h = (__this, __arguments, generator) => {
17657
+ var __async$i = (__this, __arguments, generator) => {
17506
17658
  return new Promise((resolve, reject) => {
17507
17659
  var fulfilled = (value) => {
17508
17660
  try {
@@ -17525,7 +17677,7 @@ var __async$h = (__this, __arguments, generator) => {
17525
17677
  const useVoidLabel = () => {
17526
17678
  const { client } = useShipEngine();
17527
17679
  return reactQuery.useMutation({
17528
- mutationFn: (labelId) => __async$h(void 0, null, function* () {
17680
+ mutationFn: (labelId) => __async$i(void 0, null, function* () {
17529
17681
  const result = yield client.labels.void(labelId);
17530
17682
  return result.data;
17531
17683
  }),
@@ -17544,7 +17696,7 @@ const useListOrderSources = () => {
17544
17696
  });
17545
17697
  };
17546
17698
 
17547
- var __async$g = (__this, __arguments, generator) => {
17699
+ var __async$h = (__this, __arguments, generator) => {
17548
17700
  return new Promise((resolve, reject) => {
17549
17701
  var fulfilled = (value) => {
17550
17702
  try {
@@ -17567,7 +17719,7 @@ var __async$g = (__this, __arguments, generator) => {
17567
17719
  const useRefreshOrderSourceAsync = () => {
17568
17720
  const { client } = useShipEngine();
17569
17721
  return reactQuery.useMutation({
17570
- mutationFn: (orderSourceId) => __async$g(void 0, null, function* () {
17722
+ mutationFn: (orderSourceId) => __async$h(void 0, null, function* () {
17571
17723
  const result = yield client.orderSources.refresh(orderSourceId);
17572
17724
  return result.data;
17573
17725
  }),
@@ -17578,9 +17730,9 @@ const useRefreshOrderSource = () => {
17578
17730
  const { client } = useShipEngine();
17579
17731
  const { mutateAsync: refreshOrderSourceAsync } = useRefreshOrderSourceAsync();
17580
17732
  return reactQuery.useMutation({
17581
- mutationFn: (orderSourceId) => __async$g(void 0, null, function* () {
17733
+ mutationFn: (orderSourceId) => __async$h(void 0, null, function* () {
17582
17734
  yield refreshOrderSourceAsync(orderSourceId);
17583
- const waitResult = yield retryUntil(() => __async$g(void 0, null, function* () {
17735
+ const waitResult = yield retryUntil(() => __async$h(void 0, null, function* () {
17584
17736
  const { data: checkResult } = yield client.orderSources.get(orderSourceId);
17585
17737
  if (["preparing_update", "updating"].includes(checkResult.refreshInfo.status)) {
17586
17738
  throw new CodedError("Order source is still refreshing");
@@ -17594,7 +17746,7 @@ const useRefreshOrderSource = () => {
17594
17746
  });
17595
17747
  };
17596
17748
 
17597
- var __async$f = (__this, __arguments, generator) => {
17749
+ var __async$g = (__this, __arguments, generator) => {
17598
17750
  return new Promise((resolve, reject) => {
17599
17751
  var fulfilled = (value) => {
17600
17752
  try {
@@ -17617,7 +17769,7 @@ var __async$f = (__this, __arguments, generator) => {
17617
17769
  const useCreateRateCard = () => {
17618
17770
  const { client } = useShipEngine();
17619
17771
  return reactQuery.useMutation({
17620
- mutationFn: (rateCard) => __async$f(void 0, null, function* () {
17772
+ mutationFn: (rateCard) => __async$g(void 0, null, function* () {
17621
17773
  const result = yield client.rateCards.create(rateCard);
17622
17774
  return result.data;
17623
17775
  }),
@@ -17664,7 +17816,7 @@ const useListRateCards = (carrierIds) => {
17664
17816
  });
17665
17817
  };
17666
17818
 
17667
- var __async$e = (__this, __arguments, generator) => {
17819
+ var __async$f = (__this, __arguments, generator) => {
17668
17820
  return new Promise((resolve, reject) => {
17669
17821
  var fulfilled = (value) => {
17670
17822
  try {
@@ -17687,7 +17839,7 @@ var __async$e = (__this, __arguments, generator) => {
17687
17839
  const usePublishRateCard = () => {
17688
17840
  const { client } = useShipEngine();
17689
17841
  return reactQuery.useMutation({
17690
- mutationFn: (rateCardId) => __async$e(void 0, null, function* () {
17842
+ mutationFn: (rateCardId) => __async$f(void 0, null, function* () {
17691
17843
  return yield client.rateCards.publish(rateCardId);
17692
17844
  }),
17693
17845
  mutationKey: ["usePublishRateCard"],
@@ -17695,7 +17847,7 @@ const usePublishRateCard = () => {
17695
17847
  });
17696
17848
  };
17697
17849
 
17698
- var __async$d = (__this, __arguments, generator) => {
17850
+ var __async$e = (__this, __arguments, generator) => {
17699
17851
  return new Promise((resolve, reject) => {
17700
17852
  var fulfilled = (value) => {
17701
17853
  try {
@@ -17718,7 +17870,7 @@ var __async$d = (__this, __arguments, generator) => {
17718
17870
  const useUpdateRateCard = () => {
17719
17871
  const { client } = useShipEngine();
17720
17872
  return reactQuery.useMutation({
17721
- mutationFn: (rateCard) => __async$d(void 0, null, function* () {
17873
+ mutationFn: (rateCard) => __async$e(void 0, null, function* () {
17722
17874
  const result = yield client.rateCards.update(rateCard);
17723
17875
  return result.data;
17724
17876
  }),
@@ -17727,7 +17879,7 @@ const useUpdateRateCard = () => {
17727
17879
  });
17728
17880
  };
17729
17881
 
17730
- var __async$c = (__this, __arguments, generator) => {
17882
+ var __async$d = (__this, __arguments, generator) => {
17731
17883
  return new Promise((resolve, reject) => {
17732
17884
  var fulfilled = (value) => {
17733
17885
  try {
@@ -17750,7 +17902,7 @@ var __async$c = (__this, __arguments, generator) => {
17750
17902
  const useUploadRateCard = () => {
17751
17903
  const { client } = useShipEngine();
17752
17904
  return reactQuery.useMutation({
17753
- mutationFn: (_0) => __async$c(void 0, [_0], function* ({ rateCardId, file }) {
17905
+ mutationFn: (_0) => __async$d(void 0, [_0], function* ({ rateCardId, file }) {
17754
17906
  const result = yield client.rateCards.upload(rateCardId, file);
17755
17907
  return result.data;
17756
17908
  }),
@@ -17759,7 +17911,7 @@ const useUploadRateCard = () => {
17759
17911
  });
17760
17912
  };
17761
17913
 
17762
- var __async$b = (__this, __arguments, generator) => {
17914
+ var __async$c = (__this, __arguments, generator) => {
17763
17915
  return new Promise((resolve, reject) => {
17764
17916
  var fulfilled = (value) => {
17765
17917
  try {
@@ -17782,7 +17934,7 @@ var __async$b = (__this, __arguments, generator) => {
17782
17934
  const useDeleteRateCard = () => {
17783
17935
  const { client } = useShipEngine();
17784
17936
  return reactQuery.useMutation({
17785
- mutationFn: (rateCardId) => __async$b(void 0, null, function* () {
17937
+ mutationFn: (rateCardId) => __async$c(void 0, null, function* () {
17786
17938
  const result = yield client.rateCards.delete(rateCardId);
17787
17939
  return result.data;
17788
17940
  }),
@@ -17791,7 +17943,7 @@ const useDeleteRateCard = () => {
17791
17943
  });
17792
17944
  };
17793
17945
 
17794
- var __async$a = (__this, __arguments, generator) => {
17946
+ var __async$b = (__this, __arguments, generator) => {
17795
17947
  return new Promise((resolve, reject) => {
17796
17948
  var fulfilled = (value) => {
17797
17949
  try {
@@ -17814,7 +17966,7 @@ var __async$a = (__this, __arguments, generator) => {
17814
17966
  const useCalculateRates = () => {
17815
17967
  const { client } = useShipEngine();
17816
17968
  return reactQuery.useMutation({
17817
- mutationFn: (_0) => __async$a(void 0, [_0], function* ({ rateOptions, shipmentId }) {
17969
+ mutationFn: (_0) => __async$b(void 0, [_0], function* ({ rateOptions, shipmentId }) {
17818
17970
  const result = yield client.rates.calculateByShipmentId(shipmentId, rateOptions);
17819
17971
  return result.data;
17820
17972
  }),
@@ -17864,7 +18016,7 @@ var __objRest$5 = (source, exclude) => {
17864
18016
  }
17865
18017
  return target;
17866
18018
  };
17867
- var __async$9 = (__this, __arguments, generator) => {
18019
+ var __async$a = (__this, __arguments, generator) => {
17868
18020
  return new Promise((resolve, reject) => {
17869
18021
  var fulfilled = (value) => {
17870
18022
  try {
@@ -17887,7 +18039,7 @@ var __async$9 = (__this, __arguments, generator) => {
17887
18039
  const useNotifySalesOrderShipped = () => {
17888
18040
  const { client } = useShipEngine();
17889
18041
  return reactQuery.useMutation({
17890
- mutationFn: (_a) => __async$9(void 0, null, function* () {
18042
+ mutationFn: (_a) => __async$a(void 0, null, function* () {
17891
18043
  var _b = _a, { salesOrderId } = _b, tracking = __objRest$5(_b, ["salesOrderId"]);
17892
18044
  const result = yield client.salesOrders.notifyShipped(salesOrderId, tracking);
17893
18045
  return result.data;
@@ -17912,7 +18064,7 @@ var __objRest$4 = (source, exclude) => {
17912
18064
  }
17913
18065
  return target;
17914
18066
  };
17915
- var __async$8 = (__this, __arguments, generator) => {
18067
+ var __async$9 = (__this, __arguments, generator) => {
17916
18068
  return new Promise((resolve, reject) => {
17917
18069
  var fulfilled = (value) => {
17918
18070
  try {
@@ -17935,7 +18087,7 @@ var __async$8 = (__this, __arguments, generator) => {
17935
18087
  const useCreateSalesOrderShipment = () => {
17936
18088
  const { client } = useShipEngine();
17937
18089
  return reactQuery.useMutation({
17938
- mutationFn: (_a) => __async$8(void 0, null, function* () {
18090
+ mutationFn: (_a) => __async$9(void 0, null, function* () {
17939
18091
  var _b = _a, { salesOrderId } = _b, shipment = __objRest$4(_b, ["salesOrderId"]);
17940
18092
  const result = yield client.salesOrderShipments.create(salesOrderId, shipment);
17941
18093
  return result.data;
@@ -17986,7 +18138,7 @@ var __objRest$3 = (source, exclude) => {
17986
18138
  }
17987
18139
  return target;
17988
18140
  };
17989
- var __async$7 = (__this, __arguments, generator) => {
18141
+ var __async$8 = (__this, __arguments, generator) => {
17990
18142
  return new Promise((resolve, reject) => {
17991
18143
  var fulfilled = (value) => {
17992
18144
  try {
@@ -18009,7 +18161,7 @@ var __async$7 = (__this, __arguments, generator) => {
18009
18161
  const useUpdateSalesOrderShipment = () => {
18010
18162
  const { client } = useShipEngine();
18011
18163
  return reactQuery.useMutation({
18012
- mutationFn: (_a) => __async$7(void 0, null, function* () {
18164
+ mutationFn: (_a) => __async$8(void 0, null, function* () {
18013
18165
  var _b = _a, { shipmentId } = _b, shipment = __objRest$3(_b, ["shipmentId"]);
18014
18166
  const result = yield client.salesOrderShipments.update(shipmentId, shipment);
18015
18167
  return result.data;
@@ -18038,7 +18190,7 @@ var __spreadValues$2 = (a, b) => {
18038
18190
  return a;
18039
18191
  };
18040
18192
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
18041
- var __async$6 = (__this, __arguments, generator) => {
18193
+ var __async$7 = (__this, __arguments, generator) => {
18042
18194
  return new Promise((resolve, reject) => {
18043
18195
  var fulfilled = (value) => {
18044
18196
  try {
@@ -18061,7 +18213,7 @@ var __async$6 = (__this, __arguments, generator) => {
18061
18213
  const useCreateShipment = () => {
18062
18214
  const { client } = useShipEngine();
18063
18215
  return reactQuery.useMutation({
18064
- mutationFn: (shipment) => __async$6(void 0, null, function* () {
18216
+ mutationFn: (shipment) => __async$7(void 0, null, function* () {
18065
18217
  var _a;
18066
18218
  if (shipment.warehouseId === void 0) {
18067
18219
  throw new CodedError("errorMessages.noWarehouses", {
@@ -18159,7 +18311,7 @@ const useListShippingRules = () => {
18159
18311
  });
18160
18312
  };
18161
18313
 
18162
- var __async$5 = (__this, __arguments, generator) => {
18314
+ var __async$6 = (__this, __arguments, generator) => {
18163
18315
  return new Promise((resolve, reject) => {
18164
18316
  var fulfilled = (value) => {
18165
18317
  try {
@@ -18182,7 +18334,7 @@ var __async$5 = (__this, __arguments, generator) => {
18182
18334
  const useCreateShippingRule = () => {
18183
18335
  const { client } = useShipEngine();
18184
18336
  return reactQuery.useMutation({
18185
- mutationFn: (shippingRule) => __async$5(void 0, null, function* () {
18337
+ mutationFn: (shippingRule) => __async$6(void 0, null, function* () {
18186
18338
  const result = yield client.shippingRules.create(shippingRule);
18187
18339
  return result.data;
18188
18340
  }),
@@ -18191,7 +18343,7 @@ const useCreateShippingRule = () => {
18191
18343
  });
18192
18344
  };
18193
18345
 
18194
- var __async$4 = (__this, __arguments, generator) => {
18346
+ var __async$5 = (__this, __arguments, generator) => {
18195
18347
  return new Promise((resolve, reject) => {
18196
18348
  var fulfilled = (value) => {
18197
18349
  try {
@@ -18214,7 +18366,7 @@ var __async$4 = (__this, __arguments, generator) => {
18214
18366
  const useDeleteShippingRule = () => {
18215
18367
  const { client } = useShipEngine();
18216
18368
  return reactQuery.useMutation({
18217
- mutationFn: (shippingRuleId) => __async$4(void 0, null, function* () {
18369
+ mutationFn: (shippingRuleId) => __async$5(void 0, null, function* () {
18218
18370
  const result = yield client.shippingRules.delete(shippingRuleId);
18219
18371
  return result.data;
18220
18372
  }),
@@ -18223,7 +18375,7 @@ const useDeleteShippingRule = () => {
18223
18375
  });
18224
18376
  };
18225
18377
 
18226
- var __async$3 = (__this, __arguments, generator) => {
18378
+ var __async$4 = (__this, __arguments, generator) => {
18227
18379
  return new Promise((resolve, reject) => {
18228
18380
  var fulfilled = (value) => {
18229
18381
  try {
@@ -18246,7 +18398,7 @@ var __async$3 = (__this, __arguments, generator) => {
18246
18398
  const useCreateWarehouse = () => {
18247
18399
  const { client } = useShipEngine();
18248
18400
  return reactQuery.useMutation({
18249
- mutationFn: (data) => __async$3(void 0, null, function* () {
18401
+ mutationFn: (data) => __async$4(void 0, null, function* () {
18250
18402
  const result = yield client.warehouses.create(data);
18251
18403
  return result.data;
18252
18404
  }),
@@ -18255,7 +18407,7 @@ const useCreateWarehouse = () => {
18255
18407
  });
18256
18408
  };
18257
18409
 
18258
- var __async$2 = (__this, __arguments, generator) => {
18410
+ var __async$3 = (__this, __arguments, generator) => {
18259
18411
  return new Promise((resolve, reject) => {
18260
18412
  var fulfilled = (value) => {
18261
18413
  try {
@@ -18278,7 +18430,7 @@ var __async$2 = (__this, __arguments, generator) => {
18278
18430
  const useDeleteWarehouse = () => {
18279
18431
  const { client } = useShipEngine();
18280
18432
  return reactQuery.useMutation({
18281
- mutationFn: (_0) => __async$2(void 0, [_0], function* ({ warehouseId }) {
18433
+ mutationFn: (_0) => __async$3(void 0, [_0], function* ({ warehouseId }) {
18282
18434
  const result = yield client.warehouses.delete(warehouseId);
18283
18435
  return result.data;
18284
18436
  }),
@@ -18314,7 +18466,7 @@ var __objRest$1 = (source, exclude) => {
18314
18466
  }
18315
18467
  return target;
18316
18468
  };
18317
- var __async$1 = (__this, __arguments, generator) => {
18469
+ var __async$2 = (__this, __arguments, generator) => {
18318
18470
  return new Promise((resolve, reject) => {
18319
18471
  var fulfilled = (value) => {
18320
18472
  try {
@@ -18337,7 +18489,7 @@ var __async$1 = (__this, __arguments, generator) => {
18337
18489
  const useUpdateWarehouse = () => {
18338
18490
  const { client } = useShipEngine();
18339
18491
  return reactQuery.useMutation({
18340
- mutationFn: (_a) => __async$1(void 0, null, function* () {
18492
+ mutationFn: (_a) => __async$2(void 0, null, function* () {
18341
18493
  var _b = _a, { warehouseId } = _b, warehouse = __objRest$1(_b, ["warehouseId"]);
18342
18494
  const result = yield client.warehouses.update(warehouseId, warehouse);
18343
18495
  return result.data;
@@ -18357,6 +18509,38 @@ const useGetAccountBillingPlan = () => {
18357
18509
  });
18358
18510
  };
18359
18511
 
18512
+ var __async$1 = (__this, __arguments, generator) => {
18513
+ return new Promise((resolve, reject) => {
18514
+ var fulfilled = (value) => {
18515
+ try {
18516
+ step(generator.next(value));
18517
+ } catch (e) {
18518
+ reject(e);
18519
+ }
18520
+ };
18521
+ var rejected = (value) => {
18522
+ try {
18523
+ step(generator.throw(value));
18524
+ } catch (e) {
18525
+ reject(e);
18526
+ }
18527
+ };
18528
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
18529
+ step((generator = generator.apply(__this, __arguments)).next());
18530
+ });
18531
+ };
18532
+ const useUpdateAccountBillingPlan = () => {
18533
+ const { client } = useShipEngine();
18534
+ return reactQuery.useMutation({
18535
+ mutationFn: (code) => __async$1(void 0, null, function* () {
18536
+ const result = yield client.accountBillingPlan.update({ code });
18537
+ return result.data;
18538
+ }),
18539
+ mutationKey: ["useUpdateAccountBillingPlan"],
18540
+ onError
18541
+ });
18542
+ };
18543
+
18360
18544
  const fallbackThemeData = {
18361
18545
  borderRadius: {
18362
18546
  L: "16px",
@@ -19521,6 +19705,7 @@ exports.useAddFunds = useAddFunds;
19521
19705
  exports.useAlchemy = useAlchemy;
19522
19706
  exports.useCalculateRates = useCalculateRates;
19523
19707
  exports.useConnectCarrier = useConnectCarrier;
19708
+ exports.useCreateAccountImage = useCreateAccountImage;
19524
19709
  exports.useCreateFundingSource = useCreateFundingSource;
19525
19710
  exports.useCreateLabel = useCreateLabel;
19526
19711
  exports.useCreateRateCard = useCreateRateCard;
@@ -19528,12 +19713,14 @@ exports.useCreateSalesOrderShipment = useCreateSalesOrderShipment;
19528
19713
  exports.useCreateShipment = useCreateShipment;
19529
19714
  exports.useCreateShippingRule = useCreateShippingRule;
19530
19715
  exports.useCreateWarehouse = useCreateWarehouse;
19716
+ exports.useDeleteAccountImage = useDeleteAccountImage;
19531
19717
  exports.useDeleteRateCard = useDeleteRateCard;
19532
19718
  exports.useDeleteShippingRule = useDeleteShippingRule;
19533
19719
  exports.useDeleteWarehouse = useDeleteWarehouse;
19534
19720
  exports.useDownloadRateCard = useDownloadRateCard;
19535
19721
  exports.useFundingSourcesAddFunds = useFundingSourcesAddFunds;
19536
19722
  exports.useGetAccountBillingPlan = useGetAccountBillingPlan;
19723
+ exports.useGetAccountImages = useGetAccountImages;
19537
19724
  exports.useGetAccountSettings = useGetAccountSettings;
19538
19725
  exports.useGetAutoFundingConfiguration = useGetAutoFundingConfiguration;
19539
19726
  exports.useGetCarrierById = useGetCarrierById;
@@ -19573,6 +19760,8 @@ exports.useRefreshOrderSource = useRefreshOrderSource;
19573
19760
  exports.useRefreshOrderSourceAsync = useRefreshOrderSourceAsync;
19574
19761
  exports.useRegisterCarrier = useRegisterCarrier;
19575
19762
  exports.useShipEngine = useShipEngine;
19763
+ exports.useUpdateAccountBillingPlan = useUpdateAccountBillingPlan;
19764
+ exports.useUpdateAccountImage = useUpdateAccountImage;
19576
19765
  exports.useUpdateAccountSettings = useUpdateAccountSettings;
19577
19766
  exports.useUpdateAutoFunding = useUpdateAutoFunding;
19578
19767
  exports.useUpdateFundingSource = useUpdateFundingSource;