@shipengine/alchemy 6.0.78 → 6.0.79

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 +75 -35
  2. package/index.mjs +75 -36
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -11070,6 +11070,13 @@ class AccountFeaturesAPI {
11070
11070
  this.list = () => {
11071
11071
  return this.client.get("/v1/account/features");
11072
11072
  };
11073
+ /**
11074
+ * The `request` method allows a Seller (usually under Enterprise plan) to request
11075
+ * the activation of a Feature
11076
+ */
11077
+ this.request = (request) => {
11078
+ return this.client.post("/v1/account/features/request", request);
11079
+ };
11073
11080
  this.client = client;
11074
11081
  }
11075
11082
  }
@@ -13877,7 +13884,7 @@ var ipaddr = {
13877
13884
  }).call(commonjsGlobal);
13878
13885
  } (ipaddr));
13879
13886
 
13880
- var __async$17 = (__this, __arguments, generator) => {
13887
+ var __async$18 = (__this, __arguments, generator) => {
13881
13888
  return new Promise((resolve, reject) => {
13882
13889
  var fulfilled = (value) => {
13883
13890
  try {
@@ -13897,7 +13904,7 @@ var __async$17 = (__this, __arguments, generator) => {
13897
13904
  step((generator = generator.apply(__this, __arguments)).next());
13898
13905
  });
13899
13906
  };
13900
- const getEndUserIpAddress = () => __async$17(void 0, null, function* () {
13907
+ const getEndUserIpAddress = () => __async$18(void 0, null, function* () {
13901
13908
  try {
13902
13909
  const response = yield axios.get("https://api.ipify.org/?format=json");
13903
13910
  if (response.data.ip && ipaddrExports.isValid(response.data.ip)) {
@@ -13989,7 +13996,7 @@ var __objRest$v = (source, exclude) => {
13989
13996
  }
13990
13997
  return target;
13991
13998
  };
13992
- var __async$16 = (__this, __arguments, generator) => {
13999
+ var __async$17 = (__this, __arguments, generator) => {
13993
14000
  return new Promise((resolve, reject) => {
13994
14001
  var fulfilled = (value) => {
13995
14002
  try {
@@ -14029,7 +14036,7 @@ class CarriersAPI {
14029
14036
  /**
14030
14037
  * The `connect` method connects a carrier account to a user's ShipEngine account.
14031
14038
  */
14032
- this.connect = (_a) => __async$16(this, null, function* () {
14039
+ this.connect = (_a) => __async$17(this, null, function* () {
14033
14040
  var _b = _a, { carrierCode } = _b, connection = __objRest$v(_b, ["carrierCode"]);
14034
14041
  const endUserIpAddress = yield getEndUserIpAddress();
14035
14042
  if (!endUserIpAddress)
@@ -14133,7 +14140,7 @@ var __objRest$u = (source, exclude) => {
14133
14140
  }
14134
14141
  return target;
14135
14142
  };
14136
- var __async$15 = (__this, __arguments, generator) => {
14143
+ var __async$16 = (__this, __arguments, generator) => {
14137
14144
  return new Promise((resolve, reject) => {
14138
14145
  var fulfilled = (value) => {
14139
14146
  try {
@@ -14175,7 +14182,7 @@ class ConnectionsAPI {
14175
14182
  /**
14176
14183
  * The `connectCarrier` method connects a carrier to account.
14177
14184
  */
14178
- this.connectCarrier = (carrierName, formData) => __async$15(this, null, function* () {
14185
+ this.connectCarrier = (carrierName, formData) => __async$16(this, null, function* () {
14179
14186
  return yield this.client.post(
14180
14187
  `/v1/connections/carriers/${carrierName}`,
14181
14188
  formData,
@@ -16359,7 +16366,7 @@ var __spreadValues$Q = (a, b) => {
16359
16366
  }
16360
16367
  return a;
16361
16368
  };
16362
- var __async$14 = (__this, __arguments, generator) => {
16369
+ var __async$15 = (__this, __arguments, generator) => {
16363
16370
  return new Promise((resolve, reject) => {
16364
16371
  var fulfilled = (value) => {
16365
16372
  try {
@@ -16398,7 +16405,7 @@ class FundingSourcesAPI {
16398
16405
  * The `create` method creates a new funding source for a given user. This requires
16399
16406
  * payment information to be collected from the user.
16400
16407
  */
16401
- this.create = (createFundingSource) => __async$14(this, null, function* () {
16408
+ this.create = (createFundingSource) => __async$15(this, null, function* () {
16402
16409
  const endUserIpAddress = yield getEndUserIpAddress();
16403
16410
  if (!endUserIpAddress) {
16404
16411
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -16412,7 +16419,7 @@ class FundingSourcesAPI {
16412
16419
  * user to update the billing address or payment information associated with the
16413
16420
  * funding source.
16414
16421
  */
16415
- this.update = (billingInfo, creditCardInfo, auctanePayInfo, fundingSourceId) => __async$14(this, null, function* () {
16422
+ this.update = (billingInfo, creditCardInfo, auctanePayInfo, fundingSourceId) => __async$15(this, null, function* () {
16416
16423
  const endUserIpAddress = yield getEndUserIpAddress();
16417
16424
  if (!endUserIpAddress) {
16418
16425
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -16432,7 +16439,7 @@ class FundingSourcesAPI {
16432
16439
  * The `registerCarrier` method registers a carrier account and associates
16433
16440
  * it with a given funding source.
16434
16441
  */
16435
- this.registerCarrier = (carrier) => __async$14(this, null, function* () {
16442
+ this.registerCarrier = (carrier) => __async$15(this, null, function* () {
16436
16443
  const endUserIpAddress = yield getEndUserIpAddress();
16437
16444
  if (!endUserIpAddress) {
16438
16445
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -16444,7 +16451,7 @@ class FundingSourcesAPI {
16444
16451
  /**
16445
16452
  * The `addFunds` method allows you to add funds to a funding source.
16446
16453
  */
16447
- this.addFunds = (amount, fundingSourceId) => __async$14(this, null, function* () {
16454
+ this.addFunds = (amount, fundingSourceId) => __async$15(this, null, function* () {
16448
16455
  return yield this.client.put(
16449
16456
  `/v1/funding_sources/${fundingSourceId}/add_funds`,
16450
16457
  amount
@@ -16454,7 +16461,7 @@ class FundingSourcesAPI {
16454
16461
  * The `metadata` method returns seller-specific requirements for creating funding sources
16455
16462
  * and attaching carriers
16456
16463
  */
16457
- this.metadata = () => __async$14(this, null, function* () {
16464
+ this.metadata = () => __async$15(this, null, function* () {
16458
16465
  return yield this.client.get("/v1/funding_sources/metadata");
16459
16466
  });
16460
16467
  /**
@@ -16506,7 +16513,7 @@ class InsuranceAPI {
16506
16513
  }
16507
16514
  }
16508
16515
 
16509
- var __async$13 = (__this, __arguments, generator) => {
16516
+ var __async$14 = (__this, __arguments, generator) => {
16510
16517
  return new Promise((resolve, reject) => {
16511
16518
  var fulfilled = (value) => {
16512
16519
  try {
@@ -16538,13 +16545,13 @@ class InvoiceAddressAPI {
16538
16545
  /**
16539
16546
  * The `create` method creates a new invoice address for a given user.
16540
16547
  */
16541
- this.create = (invoiceAddress) => __async$13(this, null, function* () {
16548
+ this.create = (invoiceAddress) => __async$14(this, null, function* () {
16542
16549
  return yield this.client.post("/v1/invoice_address", invoiceAddress);
16543
16550
  });
16544
16551
  /**
16545
16552
  * The `update` method updates a invoice address for a given user.
16546
16553
  */
16547
- this.update = (invoiceAddress) => __async$13(this, null, function* () {
16554
+ this.update = (invoiceAddress) => __async$14(this, null, function* () {
16548
16555
  return yield this.client.put("/v1/invoice_address", invoiceAddress);
16549
16556
  });
16550
16557
  this.client = client;
@@ -16851,7 +16858,7 @@ class SalesOrdersAPI {
16851
16858
  }
16852
16859
  }
16853
16860
 
16854
- var __async$12 = (__this, __arguments, generator) => {
16861
+ var __async$13 = (__this, __arguments, generator) => {
16855
16862
  return new Promise((resolve, reject) => {
16856
16863
  var fulfilled = (value) => {
16857
16864
  try {
@@ -16909,7 +16916,7 @@ class SellersAPI {
16909
16916
  /**
16910
16917
  * Deletes an API Key
16911
16918
  */
16912
- this.deleteSellerApiKey = (_0) => __async$12(this, [_0], function* ({
16919
+ this.deleteSellerApiKey = (_0) => __async$13(this, [_0], function* ({
16913
16920
  encryptedApiKey,
16914
16921
  sellerId,
16915
16922
  isSandbox
@@ -16997,7 +17004,7 @@ class ServicePointsAPI {
16997
17004
  }
16998
17005
  }
16999
17006
 
17000
- var __async$11 = (__this, __arguments, generator) => {
17007
+ var __async$12 = (__this, __arguments, generator) => {
17001
17008
  return new Promise((resolve, reject) => {
17002
17009
  var fulfilled = (value) => {
17003
17010
  try {
@@ -17046,7 +17053,7 @@ class ShipmentsAPI {
17046
17053
  * The `create` method allows for creating shipments based on a list of shipment
17047
17054
  * items passed into this method.
17048
17055
  */
17049
- this.create = (...shipments) => __async$11(this, null, function* () {
17056
+ this.create = (...shipments) => __async$12(this, null, function* () {
17050
17057
  return this.client.post("/v1/shipments", {
17051
17058
  shipments
17052
17059
  });
@@ -34494,7 +34501,7 @@ var __objRest$s = (source, exclude) => {
34494
34501
  }
34495
34502
  return target;
34496
34503
  };
34497
- var __async$10 = (__this, __arguments, generator) => {
34504
+ var __async$11 = (__this, __arguments, generator) => {
34498
34505
  return new Promise((resolve, reject) => {
34499
34506
  var fulfilled = (value) => {
34500
34507
  try {
@@ -34582,7 +34589,7 @@ class ShipEngineAPI {
34582
34589
  });
34583
34590
  client.defaults.headers.common["Authorization"] = `Bearer ${token}`;
34584
34591
  client.interceptors.request.use(
34585
- (config) => __async$10(this, null, function* () {
34592
+ (config) => __async$11(this, null, function* () {
34586
34593
  if (config.isSandbox) {
34587
34594
  if (!this.sandboxToken) {
34588
34595
  this.sandboxToken = yield getSandboxToken == null ? void 0 : getSandboxToken();
@@ -34611,7 +34618,7 @@ class ShipEngineAPI {
34611
34618
  }
34612
34619
  return res;
34613
34620
  },
34614
- (err) => __async$10(this, null, function* () {
34621
+ (err) => __async$11(this, null, function* () {
34615
34622
  var _a, _b, _c, _d, _e;
34616
34623
  if (debug) {
34617
34624
  logger$1.error(
@@ -34660,7 +34667,7 @@ class ShipEngineAPI {
34660
34667
  * that token (also known as Seller ID)
34661
34668
  */
34662
34669
  getTenant(isSandbox) {
34663
- return __async$10(this, null, function* () {
34670
+ return __async$11(this, null, function* () {
34664
34671
  var _a;
34665
34672
  if (!isSandbox) {
34666
34673
  return this.getTenantFromToken(this.token);
@@ -35031,7 +35038,7 @@ const retryUntil = (callbackFn, retries = 10, timeoutBetweenAttempts = 1e3) => P
35031
35038
  throw error;
35032
35039
  });
35033
35040
 
35034
- var __async$$ = (__this, __arguments, generator) => {
35041
+ var __async$10 = (__this, __arguments, generator) => {
35035
35042
  return new Promise((resolve, reject) => {
35036
35043
  var fulfilled = (value) => {
35037
35044
  try {
@@ -35054,7 +35061,7 @@ var __async$$ = (__this, __arguments, generator) => {
35054
35061
  const useCreateAccountImage = () => {
35055
35062
  const { client } = useShipEngine();
35056
35063
  return reactQuery.useMutation({
35057
- mutationFn: (data) => __async$$(void 0, null, function* () {
35064
+ mutationFn: (data) => __async$10(void 0, null, function* () {
35058
35065
  const result = yield client.accountSettings.createImage(data);
35059
35066
  return result.data;
35060
35067
  }),
@@ -35063,7 +35070,7 @@ const useCreateAccountImage = () => {
35063
35070
  });
35064
35071
  };
35065
35072
 
35066
- var __async$_ = (__this, __arguments, generator) => {
35073
+ var __async$$ = (__this, __arguments, generator) => {
35067
35074
  return new Promise((resolve, reject) => {
35068
35075
  var fulfilled = (value) => {
35069
35076
  try {
@@ -35086,7 +35093,7 @@ var __async$_ = (__this, __arguments, generator) => {
35086
35093
  const useDeleteAccountImage = () => {
35087
35094
  const { client } = useShipEngine();
35088
35095
  return reactQuery.useMutation({
35089
- mutationFn: (labelImageId) => __async$_(void 0, null, function* () {
35096
+ mutationFn: (labelImageId) => __async$$(void 0, null, function* () {
35090
35097
  const result = yield client.accountSettings.deleteImage(labelImageId);
35091
35098
  return result.data;
35092
35099
  }),
@@ -35115,7 +35122,7 @@ const useGetAccountSettings = () => {
35115
35122
  });
35116
35123
  };
35117
35124
 
35118
- var __async$Z = (__this, __arguments, generator) => {
35125
+ var __async$_ = (__this, __arguments, generator) => {
35119
35126
  return new Promise((resolve, reject) => {
35120
35127
  var fulfilled = (value) => {
35121
35128
  try {
@@ -35138,7 +35145,7 @@ var __async$Z = (__this, __arguments, generator) => {
35138
35145
  const useUpdateAccountImage = () => {
35139
35146
  const { client } = useShipEngine();
35140
35147
  return reactQuery.useMutation({
35141
- mutationFn: (data) => __async$Z(void 0, null, function* () {
35148
+ mutationFn: (data) => __async$_(void 0, null, function* () {
35142
35149
  const result = yield client.accountSettings.updateImage(data);
35143
35150
  return result.data;
35144
35151
  }),
@@ -35147,7 +35154,7 @@ const useUpdateAccountImage = () => {
35147
35154
  });
35148
35155
  };
35149
35156
 
35150
- var __async$Y = (__this, __arguments, generator) => {
35157
+ var __async$Z = (__this, __arguments, generator) => {
35151
35158
  return new Promise((resolve, reject) => {
35152
35159
  var fulfilled = (value) => {
35153
35160
  try {
@@ -35170,7 +35177,7 @@ var __async$Y = (__this, __arguments, generator) => {
35170
35177
  const useUpdateAccountSettings = () => {
35171
35178
  const { client } = useShipEngine();
35172
35179
  return reactQuery.useMutation({
35173
- mutationFn: (settings) => __async$Y(void 0, null, function* () {
35180
+ mutationFn: (settings) => __async$Z(void 0, null, function* () {
35174
35181
  const result = yield client.accountSettings.update(settings);
35175
35182
  return result.data;
35176
35183
  }),
@@ -35227,7 +35234,7 @@ var __spreadValues$K = (a, b) => {
35227
35234
  return a;
35228
35235
  };
35229
35236
  var __spreadProps$H = (a, b) => __defProps$H(a, __getOwnPropDescs$H(b));
35230
- var __async$X = (__this, __arguments, generator) => {
35237
+ var __async$Y = (__this, __arguments, generator) => {
35231
35238
  return new Promise((resolve, reject) => {
35232
35239
  var fulfilled = (value) => {
35233
35240
  try {
@@ -35250,7 +35257,7 @@ var __async$X = (__this, __arguments, generator) => {
35250
35257
  const useEnableAccountAddon = (params) => {
35251
35258
  const { client } = useShipEngine();
35252
35259
  return reactQuery.useMutation(__spreadProps$H(__spreadValues$K({}, params), {
35253
- mutationFn: (addonType) => __async$X(void 0, null, function* () {
35260
+ mutationFn: (addonType) => __async$Y(void 0, null, function* () {
35254
35261
  const result = yield client.accountAddons.enable(addonType);
35255
35262
  return result.data;
35256
35263
  }),
@@ -35278,7 +35285,7 @@ var __spreadValues$J = (a, b) => {
35278
35285
  return a;
35279
35286
  };
35280
35287
  var __spreadProps$G = (a, b) => __defProps$G(a, __getOwnPropDescs$G(b));
35281
- var __async$W = (__this, __arguments, generator) => {
35288
+ var __async$X = (__this, __arguments, generator) => {
35282
35289
  return new Promise((resolve, reject) => {
35283
35290
  var fulfilled = (value) => {
35284
35291
  try {
@@ -35301,7 +35308,7 @@ var __async$W = (__this, __arguments, generator) => {
35301
35308
  const useDisableAccountAddon = (params) => {
35302
35309
  const { client } = useShipEngine();
35303
35310
  return reactQuery.useMutation(__spreadProps$G(__spreadValues$J({}, params), {
35304
- mutationFn: (addonType) => __async$W(void 0, null, function* () {
35311
+ mutationFn: (addonType) => __async$X(void 0, null, function* () {
35305
35312
  const result = yield client.accountAddons.disable(addonType);
35306
35313
  return result.data;
35307
35314
  }),
@@ -35339,6 +35346,38 @@ const useListAccountFeatures = (params) => {
35339
35346
  }));
35340
35347
  };
35341
35348
 
35349
+ var __async$W = (__this, __arguments, generator) => {
35350
+ return new Promise((resolve, reject) => {
35351
+ var fulfilled = (value) => {
35352
+ try {
35353
+ step(generator.next(value));
35354
+ } catch (e) {
35355
+ reject(e);
35356
+ }
35357
+ };
35358
+ var rejected = (value) => {
35359
+ try {
35360
+ step(generator.throw(value));
35361
+ } catch (e) {
35362
+ reject(e);
35363
+ }
35364
+ };
35365
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
35366
+ step((generator = generator.apply(__this, __arguments)).next());
35367
+ });
35368
+ };
35369
+ const useRequestAccountFeature = () => {
35370
+ const { client } = useShipEngine();
35371
+ return reactQuery.useMutation({
35372
+ mutationFn: (request) => __async$W(void 0, null, function* () {
35373
+ const result = yield client.accountFeatures.request(request);
35374
+ return result.data;
35375
+ }),
35376
+ mutationKey: ["useRequestAccountFeature"],
35377
+ onError
35378
+ });
35379
+ };
35380
+
35342
35381
  var __async$V = (__this, __arguments, generator) => {
35343
35382
  return new Promise((resolve, reject) => {
35344
35383
  var fulfilled = (value) => {
@@ -40440,6 +40479,7 @@ exports.useRatesEstimate = useRatesEstimate;
40440
40479
  exports.useRefreshOrderSource = useRefreshOrderSource;
40441
40480
  exports.useRefreshOrderSourceAsync = useRefreshOrderSourceAsync;
40442
40481
  exports.useRegisterCarrier = useRegisterCarrier;
40482
+ exports.useRequestAccountFeature = useRequestAccountFeature;
40443
40483
  exports.useRequestStampsAccountUrls = useRequestStampsAccountUrls;
40444
40484
  exports.useShipEngine = useShipEngine;
40445
40485
  exports.useUpdateAccountBillingPlan = useUpdateAccountBillingPlan;
package/index.mjs CHANGED
@@ -11048,6 +11048,13 @@ class AccountFeaturesAPI {
11048
11048
  this.list = () => {
11049
11049
  return this.client.get("/v1/account/features");
11050
11050
  };
11051
+ /**
11052
+ * The `request` method allows a Seller (usually under Enterprise plan) to request
11053
+ * the activation of a Feature
11054
+ */
11055
+ this.request = (request) => {
11056
+ return this.client.post("/v1/account/features/request", request);
11057
+ };
11051
11058
  this.client = client;
11052
11059
  }
11053
11060
  }
@@ -13855,7 +13862,7 @@ var ipaddr = {
13855
13862
  }).call(commonjsGlobal);
13856
13863
  } (ipaddr));
13857
13864
 
13858
- var __async$17 = (__this, __arguments, generator) => {
13865
+ var __async$18 = (__this, __arguments, generator) => {
13859
13866
  return new Promise((resolve, reject) => {
13860
13867
  var fulfilled = (value) => {
13861
13868
  try {
@@ -13875,7 +13882,7 @@ var __async$17 = (__this, __arguments, generator) => {
13875
13882
  step((generator = generator.apply(__this, __arguments)).next());
13876
13883
  });
13877
13884
  };
13878
- const getEndUserIpAddress = () => __async$17(void 0, null, function* () {
13885
+ const getEndUserIpAddress = () => __async$18(void 0, null, function* () {
13879
13886
  try {
13880
13887
  const response = yield axios.get("https://api.ipify.org/?format=json");
13881
13888
  if (response.data.ip && ipaddrExports.isValid(response.data.ip)) {
@@ -13967,7 +13974,7 @@ var __objRest$v = (source, exclude) => {
13967
13974
  }
13968
13975
  return target;
13969
13976
  };
13970
- var __async$16 = (__this, __arguments, generator) => {
13977
+ var __async$17 = (__this, __arguments, generator) => {
13971
13978
  return new Promise((resolve, reject) => {
13972
13979
  var fulfilled = (value) => {
13973
13980
  try {
@@ -14007,7 +14014,7 @@ class CarriersAPI {
14007
14014
  /**
14008
14015
  * The `connect` method connects a carrier account to a user's ShipEngine account.
14009
14016
  */
14010
- this.connect = (_a) => __async$16(this, null, function* () {
14017
+ this.connect = (_a) => __async$17(this, null, function* () {
14011
14018
  var _b = _a, { carrierCode } = _b, connection = __objRest$v(_b, ["carrierCode"]);
14012
14019
  const endUserIpAddress = yield getEndUserIpAddress();
14013
14020
  if (!endUserIpAddress)
@@ -14111,7 +14118,7 @@ var __objRest$u = (source, exclude) => {
14111
14118
  }
14112
14119
  return target;
14113
14120
  };
14114
- var __async$15 = (__this, __arguments, generator) => {
14121
+ var __async$16 = (__this, __arguments, generator) => {
14115
14122
  return new Promise((resolve, reject) => {
14116
14123
  var fulfilled = (value) => {
14117
14124
  try {
@@ -14153,7 +14160,7 @@ class ConnectionsAPI {
14153
14160
  /**
14154
14161
  * The `connectCarrier` method connects a carrier to account.
14155
14162
  */
14156
- this.connectCarrier = (carrierName, formData) => __async$15(this, null, function* () {
14163
+ this.connectCarrier = (carrierName, formData) => __async$16(this, null, function* () {
14157
14164
  return yield this.client.post(
14158
14165
  `/v1/connections/carriers/${carrierName}`,
14159
14166
  formData,
@@ -16337,7 +16344,7 @@ var __spreadValues$Q = (a, b) => {
16337
16344
  }
16338
16345
  return a;
16339
16346
  };
16340
- var __async$14 = (__this, __arguments, generator) => {
16347
+ var __async$15 = (__this, __arguments, generator) => {
16341
16348
  return new Promise((resolve, reject) => {
16342
16349
  var fulfilled = (value) => {
16343
16350
  try {
@@ -16376,7 +16383,7 @@ class FundingSourcesAPI {
16376
16383
  * The `create` method creates a new funding source for a given user. This requires
16377
16384
  * payment information to be collected from the user.
16378
16385
  */
16379
- this.create = (createFundingSource) => __async$14(this, null, function* () {
16386
+ this.create = (createFundingSource) => __async$15(this, null, function* () {
16380
16387
  const endUserIpAddress = yield getEndUserIpAddress();
16381
16388
  if (!endUserIpAddress) {
16382
16389
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -16390,7 +16397,7 @@ class FundingSourcesAPI {
16390
16397
  * user to update the billing address or payment information associated with the
16391
16398
  * funding source.
16392
16399
  */
16393
- this.update = (billingInfo, creditCardInfo, auctanePayInfo, fundingSourceId) => __async$14(this, null, function* () {
16400
+ this.update = (billingInfo, creditCardInfo, auctanePayInfo, fundingSourceId) => __async$15(this, null, function* () {
16394
16401
  const endUserIpAddress = yield getEndUserIpAddress();
16395
16402
  if (!endUserIpAddress) {
16396
16403
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -16410,7 +16417,7 @@ class FundingSourcesAPI {
16410
16417
  * The `registerCarrier` method registers a carrier account and associates
16411
16418
  * it with a given funding source.
16412
16419
  */
16413
- this.registerCarrier = (carrier) => __async$14(this, null, function* () {
16420
+ this.registerCarrier = (carrier) => __async$15(this, null, function* () {
16414
16421
  const endUserIpAddress = yield getEndUserIpAddress();
16415
16422
  if (!endUserIpAddress) {
16416
16423
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -16422,7 +16429,7 @@ class FundingSourcesAPI {
16422
16429
  /**
16423
16430
  * The `addFunds` method allows you to add funds to a funding source.
16424
16431
  */
16425
- this.addFunds = (amount, fundingSourceId) => __async$14(this, null, function* () {
16432
+ this.addFunds = (amount, fundingSourceId) => __async$15(this, null, function* () {
16426
16433
  return yield this.client.put(
16427
16434
  `/v1/funding_sources/${fundingSourceId}/add_funds`,
16428
16435
  amount
@@ -16432,7 +16439,7 @@ class FundingSourcesAPI {
16432
16439
  * The `metadata` method returns seller-specific requirements for creating funding sources
16433
16440
  * and attaching carriers
16434
16441
  */
16435
- this.metadata = () => __async$14(this, null, function* () {
16442
+ this.metadata = () => __async$15(this, null, function* () {
16436
16443
  return yield this.client.get("/v1/funding_sources/metadata");
16437
16444
  });
16438
16445
  /**
@@ -16484,7 +16491,7 @@ class InsuranceAPI {
16484
16491
  }
16485
16492
  }
16486
16493
 
16487
- var __async$13 = (__this, __arguments, generator) => {
16494
+ var __async$14 = (__this, __arguments, generator) => {
16488
16495
  return new Promise((resolve, reject) => {
16489
16496
  var fulfilled = (value) => {
16490
16497
  try {
@@ -16516,13 +16523,13 @@ class InvoiceAddressAPI {
16516
16523
  /**
16517
16524
  * The `create` method creates a new invoice address for a given user.
16518
16525
  */
16519
- this.create = (invoiceAddress) => __async$13(this, null, function* () {
16526
+ this.create = (invoiceAddress) => __async$14(this, null, function* () {
16520
16527
  return yield this.client.post("/v1/invoice_address", invoiceAddress);
16521
16528
  });
16522
16529
  /**
16523
16530
  * The `update` method updates a invoice address for a given user.
16524
16531
  */
16525
- this.update = (invoiceAddress) => __async$13(this, null, function* () {
16532
+ this.update = (invoiceAddress) => __async$14(this, null, function* () {
16526
16533
  return yield this.client.put("/v1/invoice_address", invoiceAddress);
16527
16534
  });
16528
16535
  this.client = client;
@@ -16829,7 +16836,7 @@ class SalesOrdersAPI {
16829
16836
  }
16830
16837
  }
16831
16838
 
16832
- var __async$12 = (__this, __arguments, generator) => {
16839
+ var __async$13 = (__this, __arguments, generator) => {
16833
16840
  return new Promise((resolve, reject) => {
16834
16841
  var fulfilled = (value) => {
16835
16842
  try {
@@ -16887,7 +16894,7 @@ class SellersAPI {
16887
16894
  /**
16888
16895
  * Deletes an API Key
16889
16896
  */
16890
- this.deleteSellerApiKey = (_0) => __async$12(this, [_0], function* ({
16897
+ this.deleteSellerApiKey = (_0) => __async$13(this, [_0], function* ({
16891
16898
  encryptedApiKey,
16892
16899
  sellerId,
16893
16900
  isSandbox
@@ -16975,7 +16982,7 @@ class ServicePointsAPI {
16975
16982
  }
16976
16983
  }
16977
16984
 
16978
- var __async$11 = (__this, __arguments, generator) => {
16985
+ var __async$12 = (__this, __arguments, generator) => {
16979
16986
  return new Promise((resolve, reject) => {
16980
16987
  var fulfilled = (value) => {
16981
16988
  try {
@@ -17024,7 +17031,7 @@ class ShipmentsAPI {
17024
17031
  * The `create` method allows for creating shipments based on a list of shipment
17025
17032
  * items passed into this method.
17026
17033
  */
17027
- this.create = (...shipments) => __async$11(this, null, function* () {
17034
+ this.create = (...shipments) => __async$12(this, null, function* () {
17028
17035
  return this.client.post("/v1/shipments", {
17029
17036
  shipments
17030
17037
  });
@@ -34472,7 +34479,7 @@ var __objRest$s = (source, exclude) => {
34472
34479
  }
34473
34480
  return target;
34474
34481
  };
34475
- var __async$10 = (__this, __arguments, generator) => {
34482
+ var __async$11 = (__this, __arguments, generator) => {
34476
34483
  return new Promise((resolve, reject) => {
34477
34484
  var fulfilled = (value) => {
34478
34485
  try {
@@ -34560,7 +34567,7 @@ class ShipEngineAPI {
34560
34567
  });
34561
34568
  client.defaults.headers.common["Authorization"] = `Bearer ${token}`;
34562
34569
  client.interceptors.request.use(
34563
- (config) => __async$10(this, null, function* () {
34570
+ (config) => __async$11(this, null, function* () {
34564
34571
  if (config.isSandbox) {
34565
34572
  if (!this.sandboxToken) {
34566
34573
  this.sandboxToken = yield getSandboxToken == null ? void 0 : getSandboxToken();
@@ -34589,7 +34596,7 @@ class ShipEngineAPI {
34589
34596
  }
34590
34597
  return res;
34591
34598
  },
34592
- (err) => __async$10(this, null, function* () {
34599
+ (err) => __async$11(this, null, function* () {
34593
34600
  var _a, _b, _c, _d, _e;
34594
34601
  if (debug) {
34595
34602
  logger$1.error(
@@ -34638,7 +34645,7 @@ class ShipEngineAPI {
34638
34645
  * that token (also known as Seller ID)
34639
34646
  */
34640
34647
  getTenant(isSandbox) {
34641
- return __async$10(this, null, function* () {
34648
+ return __async$11(this, null, function* () {
34642
34649
  var _a;
34643
34650
  if (!isSandbox) {
34644
34651
  return this.getTenantFromToken(this.token);
@@ -35009,7 +35016,7 @@ const retryUntil = (callbackFn, retries = 10, timeoutBetweenAttempts = 1e3) => P
35009
35016
  throw error;
35010
35017
  });
35011
35018
 
35012
- var __async$$ = (__this, __arguments, generator) => {
35019
+ var __async$10 = (__this, __arguments, generator) => {
35013
35020
  return new Promise((resolve, reject) => {
35014
35021
  var fulfilled = (value) => {
35015
35022
  try {
@@ -35032,7 +35039,7 @@ var __async$$ = (__this, __arguments, generator) => {
35032
35039
  const useCreateAccountImage = () => {
35033
35040
  const { client } = useShipEngine();
35034
35041
  return useMutation({
35035
- mutationFn: (data) => __async$$(void 0, null, function* () {
35042
+ mutationFn: (data) => __async$10(void 0, null, function* () {
35036
35043
  const result = yield client.accountSettings.createImage(data);
35037
35044
  return result.data;
35038
35045
  }),
@@ -35041,7 +35048,7 @@ const useCreateAccountImage = () => {
35041
35048
  });
35042
35049
  };
35043
35050
 
35044
- var __async$_ = (__this, __arguments, generator) => {
35051
+ var __async$$ = (__this, __arguments, generator) => {
35045
35052
  return new Promise((resolve, reject) => {
35046
35053
  var fulfilled = (value) => {
35047
35054
  try {
@@ -35064,7 +35071,7 @@ var __async$_ = (__this, __arguments, generator) => {
35064
35071
  const useDeleteAccountImage = () => {
35065
35072
  const { client } = useShipEngine();
35066
35073
  return useMutation({
35067
- mutationFn: (labelImageId) => __async$_(void 0, null, function* () {
35074
+ mutationFn: (labelImageId) => __async$$(void 0, null, function* () {
35068
35075
  const result = yield client.accountSettings.deleteImage(labelImageId);
35069
35076
  return result.data;
35070
35077
  }),
@@ -35093,7 +35100,7 @@ const useGetAccountSettings = () => {
35093
35100
  });
35094
35101
  };
35095
35102
 
35096
- var __async$Z = (__this, __arguments, generator) => {
35103
+ var __async$_ = (__this, __arguments, generator) => {
35097
35104
  return new Promise((resolve, reject) => {
35098
35105
  var fulfilled = (value) => {
35099
35106
  try {
@@ -35116,7 +35123,7 @@ var __async$Z = (__this, __arguments, generator) => {
35116
35123
  const useUpdateAccountImage = () => {
35117
35124
  const { client } = useShipEngine();
35118
35125
  return useMutation({
35119
- mutationFn: (data) => __async$Z(void 0, null, function* () {
35126
+ mutationFn: (data) => __async$_(void 0, null, function* () {
35120
35127
  const result = yield client.accountSettings.updateImage(data);
35121
35128
  return result.data;
35122
35129
  }),
@@ -35125,7 +35132,7 @@ const useUpdateAccountImage = () => {
35125
35132
  });
35126
35133
  };
35127
35134
 
35128
- var __async$Y = (__this, __arguments, generator) => {
35135
+ var __async$Z = (__this, __arguments, generator) => {
35129
35136
  return new Promise((resolve, reject) => {
35130
35137
  var fulfilled = (value) => {
35131
35138
  try {
@@ -35148,7 +35155,7 @@ var __async$Y = (__this, __arguments, generator) => {
35148
35155
  const useUpdateAccountSettings = () => {
35149
35156
  const { client } = useShipEngine();
35150
35157
  return useMutation({
35151
- mutationFn: (settings) => __async$Y(void 0, null, function* () {
35158
+ mutationFn: (settings) => __async$Z(void 0, null, function* () {
35152
35159
  const result = yield client.accountSettings.update(settings);
35153
35160
  return result.data;
35154
35161
  }),
@@ -35205,7 +35212,7 @@ var __spreadValues$K = (a, b) => {
35205
35212
  return a;
35206
35213
  };
35207
35214
  var __spreadProps$H = (a, b) => __defProps$H(a, __getOwnPropDescs$H(b));
35208
- var __async$X = (__this, __arguments, generator) => {
35215
+ var __async$Y = (__this, __arguments, generator) => {
35209
35216
  return new Promise((resolve, reject) => {
35210
35217
  var fulfilled = (value) => {
35211
35218
  try {
@@ -35228,7 +35235,7 @@ var __async$X = (__this, __arguments, generator) => {
35228
35235
  const useEnableAccountAddon = (params) => {
35229
35236
  const { client } = useShipEngine();
35230
35237
  return useMutation(__spreadProps$H(__spreadValues$K({}, params), {
35231
- mutationFn: (addonType) => __async$X(void 0, null, function* () {
35238
+ mutationFn: (addonType) => __async$Y(void 0, null, function* () {
35232
35239
  const result = yield client.accountAddons.enable(addonType);
35233
35240
  return result.data;
35234
35241
  }),
@@ -35256,7 +35263,7 @@ var __spreadValues$J = (a, b) => {
35256
35263
  return a;
35257
35264
  };
35258
35265
  var __spreadProps$G = (a, b) => __defProps$G(a, __getOwnPropDescs$G(b));
35259
- var __async$W = (__this, __arguments, generator) => {
35266
+ var __async$X = (__this, __arguments, generator) => {
35260
35267
  return new Promise((resolve, reject) => {
35261
35268
  var fulfilled = (value) => {
35262
35269
  try {
@@ -35279,7 +35286,7 @@ var __async$W = (__this, __arguments, generator) => {
35279
35286
  const useDisableAccountAddon = (params) => {
35280
35287
  const { client } = useShipEngine();
35281
35288
  return useMutation(__spreadProps$G(__spreadValues$J({}, params), {
35282
- mutationFn: (addonType) => __async$W(void 0, null, function* () {
35289
+ mutationFn: (addonType) => __async$X(void 0, null, function* () {
35283
35290
  const result = yield client.accountAddons.disable(addonType);
35284
35291
  return result.data;
35285
35292
  }),
@@ -35317,6 +35324,38 @@ const useListAccountFeatures = (params) => {
35317
35324
  }));
35318
35325
  };
35319
35326
 
35327
+ var __async$W = (__this, __arguments, generator) => {
35328
+ return new Promise((resolve, reject) => {
35329
+ var fulfilled = (value) => {
35330
+ try {
35331
+ step(generator.next(value));
35332
+ } catch (e) {
35333
+ reject(e);
35334
+ }
35335
+ };
35336
+ var rejected = (value) => {
35337
+ try {
35338
+ step(generator.throw(value));
35339
+ } catch (e) {
35340
+ reject(e);
35341
+ }
35342
+ };
35343
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
35344
+ step((generator = generator.apply(__this, __arguments)).next());
35345
+ });
35346
+ };
35347
+ const useRequestAccountFeature = () => {
35348
+ const { client } = useShipEngine();
35349
+ return useMutation({
35350
+ mutationFn: (request) => __async$W(void 0, null, function* () {
35351
+ const result = yield client.accountFeatures.request(request);
35352
+ return result.data;
35353
+ }),
35354
+ mutationKey: ["useRequestAccountFeature"],
35355
+ onError
35356
+ });
35357
+ };
35358
+
35320
35359
  var __async$V = (__this, __arguments, generator) => {
35321
35360
  return new Promise((resolve, reject) => {
35322
35361
  var fulfilled = (value) => {
@@ -40245,4 +40284,4 @@ const alchemy = {
40245
40284
  createElement
40246
40285
  };
40247
40286
 
40248
- export { AccountAddonsAPI, AccountBillingAPI, AccountBillingPlanAPI, AccountBillingPlanChangeType, AccountFeaturesAPI, AccountSettingsAPI, AddressesAPI, AlchemyContext, AlchemyProvider, AlchemyTestProvider, AuctanePayAPI, CarriersAPI, CodedError, ConfirmationType, ConnectionsAPI, CreditCardVendor, Currency, CustomPackagesAPI, CustomsContentsType, CustomsNonDeliveryType, Element, ErrorBoundary, FeatureId, FundingSourcesAPI, InsuranceAPI, InsuranceProviderType, InvoiceAddressAPI, LabelsAPI, MetadataCapability, MetadataRequirement, MetadataSatisfyingFormTypes, MovementIndicator, OrderSourcesAPI, RateCardStatus, RateCardsAPI, RatesAPI, types as SE, SalesOrderShipmentsAPI, SalesOrdersAPI, SellersAPI, ServicePointsAPI, ShipEngine, ShipEngineAPI, ShipEngineContext, ShipmentsAPI, ShippingRulesAPI, ThemesAPI, UsersApi, WarehousesAPI, WebhooksAPI, alchemy, camelizeKeys, decamelizeKeys, alchemy as default, delay, getEmotionCache, getEndUserIpAddress, isCodedError, isCodedErrors, isDataCodedErrors, isInvalidTokenError, logger, onError, parseError, retryUntil, useAddFunds, useAddInsuranceFunds, useAddSandboxCarriers, useAlchemy, useCalculateRates, useCancelShipment, useCarrierConnectionsServicesList, useConnectCarrier, useConnectCarrierAccount, useCreateAccountImage, useCreateAuctanePaySession, useCreateFundingSource, useCreateInvoiceAddress, useCreateLabel, useCreateLabelByRateId, useCreateLabelByShipmentId, useCreateRateCard, useCreateSalesOrderShipment, useCreateSandboxSeller, useCreateSellerApiKey, useCreateShipment, useCreateShippingRule, useCreateWarehouse, useCreateWebhook, useDeactivateOrderSource, useDeleteAccountImage, useDeleteCarrier, useDeletePaymentMethod, useDeleteRateCard, useDeleteSellerApiKey, useDeleteShippingRule, useDeleteWarehouse, useDeleteWebhook, useDisableAccountAddon, useDownloadRateCard, useEditShippingRule, useEnableAccountAddon, useExportLabels, useExportShipments, useFundingSourcesAddFunds, useGetAccountBilling, useGetAccountBillingPlan, useGetAccountImages, useGetAccountSettings, useGetAuctanePayConfig, useGetAutoFundingConfiguration, useGetCarrierById, useGetCarrierConnectionForm, useGetConnectionsCarrierSettings, useGetCountriesByCarrier, useGetCurrenciesByCarrier, useGetFundingSourceById, useGetFundingSourceMetadata, useGetFundingSourceTransactions, useGetHereToken, useGetInsuranceAccount, useGetInsuranceFundingSourceAcceptedTerms, useGetInvoiceAddress, useGetLabel, useGetPackageRatingGroupByCarrier, useGetPaymentAccount, useGetPaymentMethods, useGetRateCardById, useGetSalesOrder, useGetSalesOrderByExternalOrderId, useGetSalesOrderShipment, useGetServicePoint, useGetServicesByCarrier, useGetShipment, useGetShipmentByExternalId, useGetShipmentRates, useGetShippingRuleById, useGetShippingRuleConditionsOptions, useGetThemeById, useGetZonesByCarrier, useI18n, useIdentityVerification, useListAccountAddons, useListAccountFeatures, useListCarrierConnections, useListCarriers, useListCustomPackageTypes, useListFundingSources, useListLabels, useListLabelsInfinite, useListOrderSources, useListOrderSourcesConnections, useListRateCards, useListSalesOrderShipments, useListSalesOrderShipmentsByExternalOrderId, useListSalesOrders, useListSandboxSellerIds, useListSellerApiKeys, useListServicePoints, useListShipments, useListShippingRules, useListUsers, useListWarehouses, useListWebhooks, useLoadIcons, useNotifySalesOrderShipped, useParseAddress, usePreviewTransaction, usePublishRateCard, useRatesEstimate, useRefreshOrderSource, useRefreshOrderSourceAsync, useRegisterCarrier, useRequestStampsAccountUrls, useShipEngine, useUpdateAccountBillingPlan, useUpdateAccountImage, useUpdateAccountSettings, useUpdateAutoFunding, useUpdateConnectionsCarrierSettings, useUpdateFundingSource, useUpdateInvoiceAddress, useUpdateOrderSource, useUpdatePaymentMethod, useUpdateRateCard, useUpdateSalesOrderShipment, useUpdateWarehouse, useUpdateWebhook, useUploadRateCard, useUpsertAccountBilling, useValidateAddresses, useVoidLabel };
40287
+ export { AccountAddonsAPI, AccountBillingAPI, AccountBillingPlanAPI, AccountBillingPlanChangeType, AccountFeaturesAPI, AccountSettingsAPI, AddressesAPI, AlchemyContext, AlchemyProvider, AlchemyTestProvider, AuctanePayAPI, CarriersAPI, CodedError, ConfirmationType, ConnectionsAPI, CreditCardVendor, Currency, CustomPackagesAPI, CustomsContentsType, CustomsNonDeliveryType, Element, ErrorBoundary, FeatureId, FundingSourcesAPI, InsuranceAPI, InsuranceProviderType, InvoiceAddressAPI, LabelsAPI, MetadataCapability, MetadataRequirement, MetadataSatisfyingFormTypes, MovementIndicator, OrderSourcesAPI, RateCardStatus, RateCardsAPI, RatesAPI, types as SE, SalesOrderShipmentsAPI, SalesOrdersAPI, SellersAPI, ServicePointsAPI, ShipEngine, ShipEngineAPI, ShipEngineContext, ShipmentsAPI, ShippingRulesAPI, ThemesAPI, UsersApi, WarehousesAPI, WebhooksAPI, alchemy, camelizeKeys, decamelizeKeys, alchemy as default, delay, getEmotionCache, getEndUserIpAddress, isCodedError, isCodedErrors, isDataCodedErrors, isInvalidTokenError, logger, onError, parseError, retryUntil, useAddFunds, useAddInsuranceFunds, useAddSandboxCarriers, useAlchemy, useCalculateRates, useCancelShipment, useCarrierConnectionsServicesList, useConnectCarrier, useConnectCarrierAccount, useCreateAccountImage, useCreateAuctanePaySession, useCreateFundingSource, useCreateInvoiceAddress, useCreateLabel, useCreateLabelByRateId, useCreateLabelByShipmentId, useCreateRateCard, useCreateSalesOrderShipment, useCreateSandboxSeller, useCreateSellerApiKey, useCreateShipment, useCreateShippingRule, useCreateWarehouse, useCreateWebhook, useDeactivateOrderSource, useDeleteAccountImage, useDeleteCarrier, useDeletePaymentMethod, useDeleteRateCard, useDeleteSellerApiKey, useDeleteShippingRule, useDeleteWarehouse, useDeleteWebhook, useDisableAccountAddon, useDownloadRateCard, useEditShippingRule, useEnableAccountAddon, useExportLabels, useExportShipments, useFundingSourcesAddFunds, useGetAccountBilling, useGetAccountBillingPlan, useGetAccountImages, useGetAccountSettings, useGetAuctanePayConfig, useGetAutoFundingConfiguration, useGetCarrierById, useGetCarrierConnectionForm, useGetConnectionsCarrierSettings, useGetCountriesByCarrier, useGetCurrenciesByCarrier, useGetFundingSourceById, useGetFundingSourceMetadata, useGetFundingSourceTransactions, useGetHereToken, useGetInsuranceAccount, useGetInsuranceFundingSourceAcceptedTerms, useGetInvoiceAddress, useGetLabel, useGetPackageRatingGroupByCarrier, useGetPaymentAccount, useGetPaymentMethods, useGetRateCardById, useGetSalesOrder, useGetSalesOrderByExternalOrderId, useGetSalesOrderShipment, useGetServicePoint, useGetServicesByCarrier, useGetShipment, useGetShipmentByExternalId, useGetShipmentRates, useGetShippingRuleById, useGetShippingRuleConditionsOptions, useGetThemeById, useGetZonesByCarrier, useI18n, useIdentityVerification, useListAccountAddons, useListAccountFeatures, useListCarrierConnections, useListCarriers, useListCustomPackageTypes, useListFundingSources, useListLabels, useListLabelsInfinite, useListOrderSources, useListOrderSourcesConnections, useListRateCards, useListSalesOrderShipments, useListSalesOrderShipmentsByExternalOrderId, useListSalesOrders, useListSandboxSellerIds, useListSellerApiKeys, useListServicePoints, useListShipments, useListShippingRules, useListUsers, useListWarehouses, useListWebhooks, useLoadIcons, useNotifySalesOrderShipped, useParseAddress, usePreviewTransaction, usePublishRateCard, useRatesEstimate, useRefreshOrderSource, useRefreshOrderSourceAsync, useRegisterCarrier, useRequestAccountFeature, useRequestStampsAccountUrls, useShipEngine, useUpdateAccountBillingPlan, useUpdateAccountImage, useUpdateAccountSettings, useUpdateAutoFunding, useUpdateConnectionsCarrierSettings, useUpdateFundingSource, useUpdateInvoiceAddress, useUpdateOrderSource, useUpdatePaymentMethod, useUpdateRateCard, useUpdateSalesOrderShipment, useUpdateWarehouse, useUpdateWebhook, useUploadRateCard, useUpsertAccountBilling, useValidateAddresses, useVoidLabel };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/alchemy",
3
- "version": "6.0.78",
3
+ "version": "6.0.79",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {