@shipengine/alchemy 2.2.3 → 2.3.0

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.
package/index.js CHANGED
@@ -2477,17 +2477,17 @@ Object.defineProperty(dist, "__esModule", { value: true });
2477
2477
  var _default = dist.default = (function () {
2478
2478
  });
2479
2479
 
2480
- var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
2481
- var __hasOwnProp$e = Object.prototype.hasOwnProperty;
2482
- var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
2480
+ var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
2481
+ var __hasOwnProp$c = Object.prototype.hasOwnProperty;
2482
+ var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
2483
2483
  var __objRest$8 = (source, exclude) => {
2484
2484
  var target = {};
2485
2485
  for (var prop in source)
2486
- if (__hasOwnProp$e.call(source, prop) && exclude.indexOf(prop) < 0)
2486
+ if (__hasOwnProp$c.call(source, prop) && exclude.indexOf(prop) < 0)
2487
2487
  target[prop] = source[prop];
2488
- if (source != null && __getOwnPropSymbols$e)
2489
- for (var prop of __getOwnPropSymbols$e(source)) {
2490
- if (exclude.indexOf(prop) < 0 && __propIsEnum$e.call(source, prop))
2488
+ if (source != null && __getOwnPropSymbols$c)
2489
+ for (var prop of __getOwnPropSymbols$c(source)) {
2490
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$c.call(source, prop))
2491
2491
  target[prop] = source[prop];
2492
2492
  }
2493
2493
  return target;
@@ -2575,9 +2575,17 @@ const types = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
2575
2575
  class AccountSettingsAPI {
2576
2576
  constructor(client) {
2577
2577
  this.client = client;
2578
+ /**
2579
+ * The `get` method retrieves the account settings for a given user.
2580
+ */
2578
2581
  this.get = () => {
2579
2582
  return this.client.get("/v1/account/settings");
2580
2583
  };
2584
+ /**
2585
+ * The `update` method updates specific account settings for a given user.
2586
+ *
2587
+ * @params Partial<AccountSettings> The account settings to update.
2588
+ */
2581
2589
  this.update = (settings) => {
2582
2590
  return this.client.put("/v1/account/settings", settings);
2583
2591
  };
@@ -2588,9 +2596,17 @@ class AccountSettingsAPI {
2588
2596
  class AddressesAPI {
2589
2597
  constructor(client) {
2590
2598
  this.client = client;
2599
+ /**
2600
+ * The `validate` method validates a list of addresses.
2601
+ *
2602
+ * @params Address[] The addresses to be validated.
2603
+ */
2591
2604
  this.validate = (addresses) => {
2592
2605
  return this.client.post("/v1/addresses/validate", addresses);
2593
2606
  };
2607
+ /**
2608
+ * The `parse` method parses a string of text to extract addresses.
2609
+ */
2594
2610
  this.parse = (text, address) => {
2595
2611
  return this.client.put("/v1/addresses/recognize", {
2596
2612
  address,
@@ -5238,7 +5254,7 @@ var ipaddr = {
5238
5254
  }).call(commonjsGlobal);
5239
5255
  } (ipaddr));
5240
5256
 
5241
- var __async$x = (__this, __arguments, generator) => {
5257
+ var __async$w = (__this, __arguments, generator) => {
5242
5258
  return new Promise((resolve, reject) => {
5243
5259
  var fulfilled = (value) => {
5244
5260
  try {
@@ -5258,7 +5274,7 @@ var __async$x = (__this, __arguments, generator) => {
5258
5274
  step((generator = generator.apply(__this, __arguments)).next());
5259
5275
  });
5260
5276
  };
5261
- const getEndUserIpAddress = () => __async$x(void 0, null, function* () {
5277
+ const getEndUserIpAddress = () => __async$w(void 0, null, function* () {
5262
5278
  try {
5263
5279
  const response = yield axios.get("https://api.ipify.org/?format=json");
5264
5280
  if (response.data.ip && ipaddrExports.isValid(response.data.ip)) {
@@ -5270,38 +5286,38 @@ const getEndUserIpAddress = () => __async$x(void 0, null, function* () {
5270
5286
  }
5271
5287
  });
5272
5288
 
5273
- var __defProp$7 = Object.defineProperty;
5274
- var __defProps$5 = Object.defineProperties;
5275
- var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
5276
- var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
5277
- var __hasOwnProp$d = Object.prototype.hasOwnProperty;
5278
- var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
5279
- var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5280
- var __spreadValues$7 = (a, b) => {
5289
+ var __defProp$5 = Object.defineProperty;
5290
+ var __defProps$3 = Object.defineProperties;
5291
+ var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
5292
+ var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
5293
+ var __hasOwnProp$b = Object.prototype.hasOwnProperty;
5294
+ var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
5295
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5296
+ var __spreadValues$5 = (a, b) => {
5281
5297
  for (var prop in b || (b = {}))
5282
- if (__hasOwnProp$d.call(b, prop))
5283
- __defNormalProp$7(a, prop, b[prop]);
5284
- if (__getOwnPropSymbols$d)
5285
- for (var prop of __getOwnPropSymbols$d(b)) {
5286
- if (__propIsEnum$d.call(b, prop))
5287
- __defNormalProp$7(a, prop, b[prop]);
5298
+ if (__hasOwnProp$b.call(b, prop))
5299
+ __defNormalProp$5(a, prop, b[prop]);
5300
+ if (__getOwnPropSymbols$b)
5301
+ for (var prop of __getOwnPropSymbols$b(b)) {
5302
+ if (__propIsEnum$b.call(b, prop))
5303
+ __defNormalProp$5(a, prop, b[prop]);
5288
5304
  }
5289
5305
  return a;
5290
5306
  };
5291
- var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
5307
+ var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
5292
5308
  var __objRest$7 = (source, exclude) => {
5293
5309
  var target = {};
5294
5310
  for (var prop in source)
5295
- if (__hasOwnProp$d.call(source, prop) && exclude.indexOf(prop) < 0)
5311
+ if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
5296
5312
  target[prop] = source[prop];
5297
- if (source != null && __getOwnPropSymbols$d)
5298
- for (var prop of __getOwnPropSymbols$d(source)) {
5299
- if (exclude.indexOf(prop) < 0 && __propIsEnum$d.call(source, prop))
5313
+ if (source != null && __getOwnPropSymbols$b)
5314
+ for (var prop of __getOwnPropSymbols$b(source)) {
5315
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
5300
5316
  target[prop] = source[prop];
5301
5317
  }
5302
5318
  return target;
5303
5319
  };
5304
- var __async$w = (__this, __arguments, generator) => {
5320
+ var __async$v = (__this, __arguments, generator) => {
5305
5321
  return new Promise((resolve, reject) => {
5306
5322
  var fulfilled = (value) => {
5307
5323
  try {
@@ -5324,35 +5340,68 @@ var __async$w = (__this, __arguments, generator) => {
5324
5340
  class CarriersAPI {
5325
5341
  constructor(client) {
5326
5342
  this.client = client;
5343
+ /**
5344
+ * The `list` method retrieves a list of connected carriers for a given user.
5345
+ */
5327
5346
  this.list = () => {
5328
5347
  return this.client.get("/v1/carriers");
5329
5348
  };
5349
+ /**
5350
+ * The `get` method retrieves a specific carrier by `carrierId`.
5351
+ */
5330
5352
  this.get = (carrierId) => {
5331
5353
  return this.client.get(`/v1/carriers/${carrierId}`);
5332
5354
  };
5333
- this.connect = (_a) => __async$w(this, null, function* () {
5355
+ /**
5356
+ * The `connect` method connects a carrier account to a user's ShipEngine account.
5357
+ */
5358
+ this.connect = (_a) => __async$v(this, null, function* () {
5334
5359
  var _b = _a, { carrierCode } = _b, connection = __objRest$7(_b, ["carrierCode"]);
5335
5360
  const endUserIpAddress = yield getEndUserIpAddress();
5336
5361
  if (!endUserIpAddress)
5337
5362
  return Promise.reject([new CodedError("Unable to get IP address")]);
5338
- return yield this.client.post(`/v1/registration/${carrierCode}`, __spreadProps$5(__spreadValues$7({}, connection), {
5363
+ return yield this.client.post(`/v1/registration/${carrierCode}`, __spreadProps$3(__spreadValues$5({}, connection), {
5339
5364
  endUserIpAddress
5340
5365
  }));
5341
5366
  });
5367
+ /**
5368
+ * The `addFunds` method allows a user to add funds to their carrier account balance.
5369
+ * Not all carrier providers allow you to maintain a balance.
5370
+ *
5371
+ * - For example, FedEx does
5372
+ * not require you to maintain a balance that will be used when purchasing labels.
5373
+ */
5342
5374
  this.addFunds = (carrierId, funds) => {
5343
5375
  return this.client.put(`/v1/carriers/${carrierId}/add_funds`, funds);
5344
5376
  };
5377
+ /**
5378
+ * The `updateAutoFunding` method allows a user to update the auto-funding settings
5379
+ * on their ShipEngine account.
5380
+ *
5381
+ * e.g. Enable auto-funding, set a balance threshold, and a maximum number of time
5382
+ * per day you wish to auto-fund your account.
5383
+ */
5345
5384
  this.updateAutoFunding = (carrierId, options) => {
5346
5385
  return this.client.post(
5347
5386
  `/v1/carriers/${carrierId}/auto_funding`,
5348
5387
  options
5349
5388
  );
5350
5389
  };
5390
+ /**
5391
+ * The `getAutoFunding` method retrieves the current auto-funding settings.
5392
+ *
5393
+ * If no auto-funding rules have been set, the response will contain the default
5394
+ * values for auto-funding. Auto-funding is disabled by default.
5395
+ */
5351
5396
  this.getAutoFunding = (carrierId) => {
5352
5397
  return this.client.get(
5353
5398
  `/v1/carriers/${carrierId}/auto_funding`
5354
5399
  );
5355
5400
  };
5401
+ /**
5402
+ * The `getWalletHistory` method retrieves the wallet transaction history for
5403
+ * a ShipEngine wallet account.
5404
+ */
5356
5405
  this.getWalletHistory = (startDate, endDate, page) => {
5357
5406
  return this.client.get(`/v1/carriers/wallet_history`, {
5358
5407
  params: {
@@ -5362,17 +5411,33 @@ class CarriersAPI {
5362
5411
  }
5363
5412
  });
5364
5413
  };
5414
+ /**
5415
+ * The `getServices` method retrieves a list of shipping services that a given carrier offers.
5416
+ */
5365
5417
  this.getServices = (carrierId) => {
5366
5418
  return this.client.get(`/v1/carriers/${carrierId}/services`);
5367
5419
  };
5420
+ /**
5421
+ * The `getPackageRatingGroup` method retrieves a list of package rating groups.
5422
+ * This is primarily used for carriers that support negotiated rates, and a user
5423
+ * has a rate card with multiple package rating groups.
5424
+ */
5368
5425
  this.getPackageRatingGroup = (carrierId) => {
5369
5426
  return this.client.get(
5370
5427
  `/v1/carriers/${carrierId}/package_rating_group`
5371
5428
  );
5372
5429
  };
5430
+ /**
5431
+ * The `getCountries` method retrieves a list of countries that a given carrier
5432
+ * supports shipping to.
5433
+ */
5373
5434
  this.getCountries = (carrierId) => {
5374
5435
  return this.client.get(`/v1/carriers/${carrierId}/countries`);
5375
5436
  };
5437
+ /**
5438
+ * The `getCurrencies` method retrieves a list of currencies that a given carrier
5439
+ * supports the usage of.
5440
+ */
5376
5441
  this.getCurrencies = (carrierId) => {
5377
5442
  return this.client.get(`/v1/carriers/${carrierId}/currencies`);
5378
5443
  };
@@ -7560,6 +7625,9 @@ var lib = {
7560
7625
  class CustomPackagesAPI {
7561
7626
  constructor(client) {
7562
7627
  this.client = client;
7628
+ /**
7629
+ * The `list` method retrieves a list of custom packages a given user has created.
7630
+ */
7563
7631
  this.list = () => {
7564
7632
  return this.client.get("/v1/packages");
7565
7633
  };
@@ -7567,23 +7635,23 @@ class CustomPackagesAPI {
7567
7635
  }
7568
7636
  }
7569
7637
 
7570
- var __defProp$6 = Object.defineProperty;
7571
- var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
7572
- var __hasOwnProp$c = Object.prototype.hasOwnProperty;
7573
- var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
7574
- var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7575
- var __spreadValues$6 = (a, b) => {
7638
+ var __defProp$4 = Object.defineProperty;
7639
+ var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
7640
+ var __hasOwnProp$a = Object.prototype.hasOwnProperty;
7641
+ var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
7642
+ var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7643
+ var __spreadValues$4 = (a, b) => {
7576
7644
  for (var prop in b || (b = {}))
7577
- if (__hasOwnProp$c.call(b, prop))
7578
- __defNormalProp$6(a, prop, b[prop]);
7579
- if (__getOwnPropSymbols$c)
7580
- for (var prop of __getOwnPropSymbols$c(b)) {
7581
- if (__propIsEnum$c.call(b, prop))
7582
- __defNormalProp$6(a, prop, b[prop]);
7645
+ if (__hasOwnProp$a.call(b, prop))
7646
+ __defNormalProp$4(a, prop, b[prop]);
7647
+ if (__getOwnPropSymbols$a)
7648
+ for (var prop of __getOwnPropSymbols$a(b)) {
7649
+ if (__propIsEnum$a.call(b, prop))
7650
+ __defNormalProp$4(a, prop, b[prop]);
7583
7651
  }
7584
7652
  return a;
7585
7653
  };
7586
- var __async$v = (__this, __arguments, generator) => {
7654
+ var __async$u = (__this, __arguments, generator) => {
7587
7655
  return new Promise((resolve, reject) => {
7588
7656
  var fulfilled = (value) => {
7589
7657
  try {
@@ -7606,21 +7674,36 @@ var __async$v = (__this, __arguments, generator) => {
7606
7674
  class FundingSourcesAPI {
7607
7675
  constructor(client) {
7608
7676
  this.client = client;
7677
+ /**
7678
+ * The `list` method retrieves a list of funding sources for a given user.
7679
+ */
7609
7680
  this.list = () => {
7610
7681
  return this.client.get("/v1/funding_sources");
7611
7682
  };
7683
+ /**
7684
+ * The `get` method retrieves a specific funding source by `fundingSourceId`.
7685
+ */
7612
7686
  this.get = (fundingSourceId) => {
7613
7687
  return this.client.get(`/v1/funding_sources/${fundingSourceId}`);
7614
7688
  };
7615
- this.create = (createFundingSource) => __async$v(this, null, function* () {
7689
+ /**
7690
+ * The `create` method creates a new funding source for a given user. This requires
7691
+ * payment information to be collected from the user.
7692
+ */
7693
+ this.create = (createFundingSource) => __async$u(this, null, function* () {
7616
7694
  const endUserIpAddress = yield getEndUserIpAddress();
7617
7695
  if (!endUserIpAddress)
7618
7696
  return Promise.reject([new CodedError("Unable to get IP address")]);
7619
- return yield this.client.post("/v1/funding_sources", __spreadValues$6({
7697
+ return yield this.client.post("/v1/funding_sources", __spreadValues$4({
7620
7698
  endUserIpAddress
7621
7699
  }, createFundingSource));
7622
7700
  });
7623
- this.update = (billingInfo, creditCardInfo, fundingSourceId) => __async$v(this, null, function* () {
7701
+ /**
7702
+ * The `update` method updates a funding source for a given user. This allows the
7703
+ * user to update the billing address or payment information associated with the
7704
+ * funding source.
7705
+ */
7706
+ this.update = (billingInfo, creditCardInfo, fundingSourceId) => __async$u(this, null, function* () {
7624
7707
  const endUserIpAddress = yield getEndUserIpAddress();
7625
7708
  if (!endUserIpAddress)
7626
7709
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -7633,15 +7716,22 @@ class FundingSourcesAPI {
7633
7716
  }
7634
7717
  );
7635
7718
  });
7636
- this.registerCarrier = (carrier) => __async$v(this, null, function* () {
7719
+ /**
7720
+ * The `registerCarrier` method registers a carrier account and associates
7721
+ * it with a given funding source.
7722
+ */
7723
+ this.registerCarrier = (carrier) => __async$u(this, null, function* () {
7637
7724
  const endUserIpAddress = yield getEndUserIpAddress();
7638
7725
  if (!endUserIpAddress)
7639
7726
  return Promise.reject([new CodedError("Unable to get IP address")]);
7640
- return yield this.client.post("/v1/registration/funding_source", __spreadValues$6({
7727
+ return yield this.client.post("/v1/registration/funding_source", __spreadValues$4({
7641
7728
  endUserIpAddress
7642
7729
  }, carrier));
7643
7730
  });
7644
- this.addFunds = (amount, fundingSourceId) => __async$v(this, null, function* () {
7731
+ /**
7732
+ * The `addFunds` method allows you to add funds to a funding source.
7733
+ */
7734
+ this.addFunds = (amount, fundingSourceId) => __async$u(this, null, function* () {
7645
7735
  return yield this.client.put(
7646
7736
  `/v1/funding_sources/${fundingSourceId}/add_funds`,
7647
7737
  amount
@@ -7654,6 +7744,10 @@ class FundingSourcesAPI {
7654
7744
  class InsuranceAPI {
7655
7745
  constructor(client) {
7656
7746
  this.client = client;
7747
+ /**
7748
+ * The `get` method retrieves the insurance balance for a given `insuranceProvider`
7749
+ * by ID.
7750
+ */
7657
7751
  this.get = (insuranceProvider) => {
7658
7752
  return this.client.get(`/v1/insurance/${insuranceProvider}/balance`);
7659
7753
  };
@@ -7664,15 +7758,31 @@ class InsuranceAPI {
7664
7758
  class LabelsAPI {
7665
7759
  constructor(client) {
7666
7760
  this.client = client;
7761
+ /**
7762
+ * The `get` method retrieves a specific label by `labelId`.
7763
+ */
7667
7764
  this.get = (labelId) => {
7668
7765
  return this.client.get(`/v1/labels/${labelId}`);
7669
7766
  };
7767
+ /**
7768
+ * The `list` method retrieves a list of labels created by a given user.
7769
+ */
7670
7770
  this.list = (params = {}) => {
7671
7771
  return this.client.get("/v1/labels", { params });
7672
7772
  };
7773
+ /**
7774
+ * The `createByRateId` allows you to create a shipping label by using a `rateId`
7775
+ * which is a unique identifier tied to a specific rate.
7776
+ *
7777
+ * This helps ensure that when a user is rate shopping, they can purchase a
7778
+ * label for the price they were initially rated.
7779
+ */
7673
7780
  this.createByRateId = (rateId, options) => {
7674
7781
  return this.client.post(`/v1/labels/rates/${rateId}`, options);
7675
7782
  };
7783
+ /**
7784
+ * The `void` method allows a user to void a label by `labelId`.
7785
+ */
7676
7786
  this.void = (labelId) => {
7677
7787
  return this.client.put(`/v1/labels/${labelId}/void`);
7678
7788
  };
@@ -7683,12 +7793,22 @@ class LabelsAPI {
7683
7793
  class OrderSourcesAPI {
7684
7794
  constructor(client) {
7685
7795
  this.client = client;
7796
+ /**
7797
+ * The `list` method retrieves a list of connected order sources for a given user.
7798
+ */
7686
7799
  this.list = () => {
7687
7800
  return this.client.get("/v-beta/order_sources");
7688
7801
  };
7802
+ /**
7803
+ * The `get` method retrieves a specific order source by `orderSourceId`.
7804
+ */
7689
7805
  this.get = (orderSourceId) => {
7690
7806
  return this.client.get(`/v-beta/order_sources/${orderSourceId}`);
7691
7807
  };
7808
+ /**
7809
+ * The `refresh` method refreshes a specific order source by `orderSourceId`.
7810
+ * This will pull in any `new orders` since the last order import.
7811
+ */
7692
7812
  this.refresh = (orderSourceId) => {
7693
7813
  return this.client.put(`/v-beta/order_sources/${orderSourceId}/refresh`);
7694
7814
  };
@@ -7699,20 +7819,36 @@ class OrderSourcesAPI {
7699
7819
  class RateCardsAPI {
7700
7820
  constructor(client) {
7701
7821
  this.client = client;
7822
+ /**
7823
+ * The `list` method retrieves a list of rate cards for a given list of carrier ID's.
7824
+ */
7702
7825
  this.list = (carrierIds) => {
7703
7826
  return this.client.get(
7704
7827
  `/v1/rate_cards?carrier_ids=${carrierIds.toString()}`
7705
7828
  );
7706
7829
  };
7830
+ /**
7831
+ * The `get` method retrieves a specific rate card by `rateCardId`.
7832
+ */
7707
7833
  this.get = (rateCardId) => {
7708
7834
  return this.client.get(`/v1/rate_cards/${rateCardId}`);
7709
7835
  };
7836
+ /**
7837
+ * The `create` method creates a new rate card for a given user.
7838
+ */
7710
7839
  this.create = (rateCardInput) => {
7711
7840
  return this.client.post("/v1/rate_cards", rateCardInput);
7712
7841
  };
7842
+ /**
7843
+ * The `update` method updates a specific rate card by `rateCardId` with a new
7844
+ * `RateCard`.
7845
+ */
7713
7846
  this.update = (rateCard) => {
7714
7847
  return this.client.put(`/v1/rate_cards/${rateCard.id}`, rateCard);
7715
7848
  };
7849
+ /**
7850
+ * The `download` method allows for downloading a given rate card by `rateCardId`.
7851
+ */
7716
7852
  this.download = (rateCardId) => {
7717
7853
  return this.client.get(`/v1/rate_cards/${rateCardId}/rates/download`, {
7718
7854
  headers: {
@@ -7721,6 +7857,9 @@ class RateCardsAPI {
7721
7857
  responseType: "blob"
7722
7858
  });
7723
7859
  };
7860
+ /**
7861
+ * The `upload` method allows for uploading a given rate card as a spreadsheet file.
7862
+ */
7724
7863
  this.upload = (rateCardId, file) => {
7725
7864
  const formData = new FormData();
7726
7865
  formData.append("file", file);
@@ -7730,6 +7869,9 @@ class RateCardsAPI {
7730
7869
  }
7731
7870
  });
7732
7871
  };
7872
+ /**
7873
+ * The `publish` method allows for publishing a given rate card by `rateCardId`.
7874
+ */
7733
7875
  this.publish = (rateCardId) => {
7734
7876
  return this.client.post(`/v1/rate_cards/${rateCardId}/publish`);
7735
7877
  };
@@ -7746,6 +7888,10 @@ class RateCardsAPI {
7746
7888
  class RatesAPI {
7747
7889
  constructor(client) {
7748
7890
  this.client = client;
7891
+ /**
7892
+ * The `calculate` method calculates rates for a shipment by shipment ID based
7893
+ * on the shipment's options.
7894
+ */
7749
7895
  this.calculateByShipmentId = (shipmentId, options) => {
7750
7896
  return this.client.post("/v1/rates", {
7751
7897
  rateOptions: options,
@@ -7759,20 +7905,32 @@ class RatesAPI {
7759
7905
  class SalesOrderShipmentsAPI {
7760
7906
  constructor(client) {
7761
7907
  this.client = client;
7908
+ /**
7909
+ * The `list` method retrieves a list of sales order shipments for a given user.
7910
+ */
7762
7911
  this.list = (body = {}, params) => {
7763
7912
  return this.client.post("/v-beta/shipments/list", body, {
7764
7913
  params
7765
7914
  });
7766
7915
  };
7916
+ /**
7917
+ * The `get` method retrieves a specific sales order shipment by `shipmentId`.
7918
+ */
7767
7919
  this.get = (shipmentId) => {
7768
7920
  return this.client.get(`/v-beta/shipments/${shipmentId}`);
7769
7921
  };
7922
+ /**
7923
+ * The `create` method creates a new shipment for a sales order.
7924
+ */
7770
7925
  this.create = (salesOrderId, shipment) => {
7771
7926
  return this.client.post(
7772
7927
  `/v-beta/shipments/sales_order/${salesOrderId}`,
7773
7928
  shipment
7774
7929
  );
7775
7930
  };
7931
+ /**
7932
+ * The `update` method updates a specific sales order shipment by `shipmentId`.
7933
+ */
7776
7934
  this.update = (shipmentId, shipment) => {
7777
7935
  return this.client.put(`/v-beta/shipments/${shipmentId}`, shipment);
7778
7936
  };
@@ -7783,12 +7941,23 @@ class SalesOrderShipmentsAPI {
7783
7941
  class SalesOrdersAPI {
7784
7942
  constructor(client) {
7785
7943
  this.client = client;
7944
+ /**
7945
+ * The `list` method retrieves a list of sales orders.
7946
+ */
7786
7947
  this.list = (params = {}) => {
7787
7948
  return this.client.get("/v-beta/sales_orders", { params });
7788
7949
  };
7950
+ /**
7951
+ * The `get` method retrieves a specific sales order by `salesOrderId`.
7952
+ */
7789
7953
  this.get = (salesOrderId) => {
7790
7954
  return this.client.get(`/v-beta/sales_orders/${salesOrderId}`);
7791
7955
  };
7956
+ /**
7957
+ * The `notifyShipped` method notifies order source that the order has been
7958
+ * shipped. Typically, the order source will then notify the user based on
7959
+ * this update from ShipEngine API.
7960
+ */
7792
7961
  this.notifyShipped = (salesOrderId, tracking) => {
7793
7962
  return this.client.post(`/v-beta/sales_orders/${salesOrderId}/notify`, tracking);
7794
7963
  };
@@ -7796,7 +7965,7 @@ class SalesOrdersAPI {
7796
7965
  }
7797
7966
  }
7798
7967
 
7799
- var __async$u = (__this, __arguments, generator) => {
7968
+ var __async$t = (__this, __arguments, generator) => {
7800
7969
  return new Promise((resolve, reject) => {
7801
7970
  var fulfilled = (value) => {
7802
7971
  try {
@@ -7819,16 +7988,27 @@ var __async$u = (__this, __arguments, generator) => {
7819
7988
  class ShipmentsAPI {
7820
7989
  constructor(client) {
7821
7990
  this.client = client;
7991
+ /**
7992
+ * The `getShipmentRates` method retrieves rates for a given shipment by
7993
+ * shipment ID.
7994
+ */
7822
7995
  this.getShipmentRates = ({ shipmentId, createdAtStart }) => {
7823
7996
  return this.client.get(
7824
7997
  `/v1/shipments/${shipmentId}/rates`,
7825
7998
  createdAtStart !== void 0 ? { params: { createdAtStart } } : void 0
7826
7999
  );
7827
8000
  };
8001
+ /**
8002
+ * The `list` method retrieves a list of shipments for a given user.
8003
+ */
7828
8004
  this.list = (options) => {
7829
8005
  return this.client.get("/v1/shipments", { params: options });
7830
8006
  };
7831
- this.create = (...shipments) => __async$u(this, null, function* () {
8007
+ /**
8008
+ * The `create` method allows for creating shipments based on a list of shipment
8009
+ * items passed into this method.
8010
+ */
8011
+ this.create = (...shipments) => __async$t(this, null, function* () {
7832
8012
  return this.client.post("/v1/shipments", {
7833
8013
  shipments
7834
8014
  });
@@ -7840,15 +8020,31 @@ class ShipmentsAPI {
7840
8020
  class WarehousesAPI {
7841
8021
  constructor(client) {
7842
8022
  this.client = client;
8023
+ /**
8024
+ * The `list` method retrieves a list of `warehouses` (Ship From Locations)
8025
+ * for a given user.
8026
+ */
7843
8027
  this.list = () => {
7844
8028
  return this.client.get("/v1/warehouses");
7845
8029
  };
8030
+ /**
8031
+ * The `create` method allows for creation of warehouses (Ship From Locations)
8032
+ * on a users ShipEngine account.
8033
+ */
7846
8034
  this.create = (warehouse) => {
7847
8035
  return this.client.post("/v1/warehouses", warehouse);
7848
8036
  };
8037
+ /**
8038
+ * The `update` method updates a specific warehouse (Ship From Location) for a
8039
+ * given user by `warehouseId`.
8040
+ */
7849
8041
  this.update = (warehouseId, warehouse) => {
7850
8042
  return this.client.put(`/v1/warehouses/${warehouseId}`, warehouse);
7851
8043
  };
8044
+ /**
8045
+ * The `delete` method deletes a specific warehouse (Ship From Location) by
8046
+ * `warehouseId` from a users ShipEngine account.
8047
+ */
7852
8048
  this.delete = (warehouseId) => {
7853
8049
  return this.client.delete(`/v1/warehouses/${warehouseId}`);
7854
8050
  };
@@ -7856,26 +8052,26 @@ class WarehousesAPI {
7856
8052
  }
7857
8053
  }
7858
8054
 
7859
- var __defProp$5 = Object.defineProperty;
7860
- var __defProps$4 = Object.defineProperties;
7861
- var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
7862
- var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
7863
- var __hasOwnProp$b = Object.prototype.hasOwnProperty;
7864
- var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
7865
- var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7866
- var __spreadValues$5 = (a, b) => {
8055
+ var __defProp$3 = Object.defineProperty;
8056
+ var __defProps$2 = Object.defineProperties;
8057
+ var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
8058
+ var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
8059
+ var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
8060
+ var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
8061
+ var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8062
+ var __spreadValues$3 = (a, b) => {
7867
8063
  for (var prop in b || (b = {}))
7868
- if (__hasOwnProp$b.call(b, prop))
7869
- __defNormalProp$5(a, prop, b[prop]);
7870
- if (__getOwnPropSymbols$b)
7871
- for (var prop of __getOwnPropSymbols$b(b)) {
7872
- if (__propIsEnum$b.call(b, prop))
7873
- __defNormalProp$5(a, prop, b[prop]);
8064
+ if (__hasOwnProp$9.call(b, prop))
8065
+ __defNormalProp$3(a, prop, b[prop]);
8066
+ if (__getOwnPropSymbols$9)
8067
+ for (var prop of __getOwnPropSymbols$9(b)) {
8068
+ if (__propIsEnum$9.call(b, prop))
8069
+ __defNormalProp$3(a, prop, b[prop]);
7874
8070
  }
7875
8071
  return a;
7876
8072
  };
7877
- var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
7878
- var __async$t = (__this, __arguments, generator) => {
8073
+ var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
8074
+ var __async$s = (__this, __arguments, generator) => {
7879
8075
  return new Promise((resolve, reject) => {
7880
8076
  var fulfilled = (value) => {
7881
8077
  try {
@@ -7897,7 +8093,7 @@ var __async$t = (__this, __arguments, generator) => {
7897
8093
  };
7898
8094
  const logger$1 = E({
7899
8095
  name: "shipengine-api",
7900
- serializers: __spreadProps$4(__spreadValues$5({}, k), {
8096
+ serializers: __spreadProps$2(__spreadValues$3({}, k), {
7901
8097
  req: (req) => ({
7902
8098
  headers: req.headers,
7903
8099
  method: req.method,
@@ -7922,7 +8118,7 @@ class ShipEngineAPI {
7922
8118
  constructor(token, { baseURL, headers, getToken }) {
7923
8119
  const client = axios.create({
7924
8120
  baseURL,
7925
- headers: __spreadProps$4(__spreadValues$5({}, headers), {
8121
+ headers: __spreadProps$2(__spreadValues$3({}, headers), {
7926
8122
  Authorization: `Bearer ${token}`,
7927
8123
  "Content-Type": "application/json"
7928
8124
  }),
@@ -7969,7 +8165,7 @@ class ShipEngineAPI {
7969
8165
  );
7970
8166
  return res;
7971
8167
  },
7972
- (err) => __async$t(this, null, function* () {
8168
+ (err) => __async$s(this, null, function* () {
7973
8169
  var _a, _b, _c, _d, _e, _f, _g;
7974
8170
  logger$1.error(
7975
8171
  { err, req: err.config, res: err.response },
@@ -8009,48 +8205,135 @@ class ShipEngineAPI {
8009
8205
  );
8010
8206
  this.client = client;
8011
8207
  }
8208
+ /**
8209
+ * The `token` method takes in a string and sets it as the Authorization header for all requests.
8210
+ */
8012
8211
  set token(token) {
8013
8212
  this.client.defaults.headers.common["Authorization"] = `Bearer ${token}`;
8014
8213
  }
8214
+ /**
8215
+ * The `accountSettings` method provides access to the Account Settings endpoints
8216
+ * in ShipEngine API.
8217
+ *
8218
+ * @see {@link AccountSettingsAPI | The Account Settings API module}
8219
+ */
8015
8220
  get accountSettings() {
8016
8221
  return new AccountSettingsAPI(this.client);
8017
8222
  }
8223
+ /**
8224
+ * The `addresses` method provides access to the Address Validation endpoints
8225
+ * in ShipEngine API. e.g. Validate Addresses, Parse Addresses, etc.
8226
+ *
8227
+ * @see {@link AddressesAPI | The Addresses API module}
8228
+ */
8018
8229
  get addresses() {
8019
8230
  return new AddressesAPI(this.client);
8020
8231
  }
8232
+ /**
8233
+ * The `carriers` method provides access to the Carrier endpoints in ShipEngine
8234
+ * API. e.g. List Carriers, Get Carrier, Connect Carrier, etc.
8235
+ *
8236
+ * @see {@link CarriersAPI | The Carriers API module}
8237
+ */
8021
8238
  get carriers() {
8022
8239
  return new CarriersAPI(this.client);
8023
8240
  }
8241
+ /**
8242
+ * The `customPackages` method provides access to the Packages endpoint in ShipEngine
8243
+ * API. e.g. List Packages
8244
+ *
8245
+ * @see {@link CustomPackagesAPI | The Custom Packages API module}
8246
+ */
8024
8247
  get customPackages() {
8025
8248
  return new CustomPackagesAPI(this.client);
8026
8249
  }
8250
+ /**
8251
+ * The `fundingSources` method provides access to the Funding Sources endpoints
8252
+ * in ShipEngine API.
8253
+ *
8254
+ * @see {@link FundingSourcesAPI | The Funding Sources API module}
8255
+ */
8027
8256
  get fundingSources() {
8028
8257
  return new FundingSourcesAPI(this.client);
8029
8258
  }
8259
+ /**
8260
+ * The `insurance` method provides access to the Insurance endpoint in ShipEngine
8261
+ * API. e.g. Get Insurance Balance
8262
+ *
8263
+ * @see {@link InsuranceAPI | The Insurance API module}
8264
+ */
8030
8265
  get insurance() {
8031
8266
  return new InsuranceAPI(this.client);
8032
8267
  }
8268
+ /**
8269
+ * The `labels` method provides access to the Label endpoints in ShipEngine API.
8270
+ * e.g. Create Label, Get Label, Void Label, etc.
8271
+ *
8272
+ * @see {@link LabelsAPI | The Labels API module}
8273
+ */
8033
8274
  get labels() {
8034
8275
  return new LabelsAPI(this.client);
8035
8276
  }
8277
+ /**
8278
+ * The `orderSources` method provides access to the Order Sources endpoints in
8279
+ * ShipEngine API. e.g. List Order Sources, Get Order Source, Refresh Order Source, etc.
8280
+ *
8281
+ * @see {@link OrderSourcesAPI | The Order Sources API module}
8282
+ */
8036
8283
  get orderSources() {
8037
8284
  return new OrderSourcesAPI(this.client);
8038
8285
  }
8286
+ /**
8287
+ * The `rateCards` method provides access to the Rate Cards endpoints in ShipEngine
8288
+ * API.
8289
+ *
8290
+ * @see {@link RateCardsAPI | The Rate Cards API module}
8291
+ */
8039
8292
  get rateCards() {
8040
8293
  return new RateCardsAPI(this.client);
8041
8294
  }
8295
+ /**
8296
+ * The `rates` method provides access to the Rate endpoints in ShipEngine API.
8297
+ * e.g. Get Rates
8298
+ *
8299
+ * @see {@link RatesAPI | The Rates API module}
8300
+ */
8042
8301
  get rates() {
8043
8302
  return new RatesAPI(this.client);
8044
8303
  }
8304
+ /**
8305
+ * The `salesOrderShipments` method provides access to the `v-beta` Sales
8306
+ * Order Shipments endpoints in ShipEngine API.
8307
+ *
8308
+ * @see {@link SalesOrderShipmentsAPI | The Sales Order Shipments API module}
8309
+ */
8045
8310
  get salesOrderShipments() {
8046
8311
  return new SalesOrderShipmentsAPI(this.client);
8047
8312
  }
8313
+ /**
8314
+ * The `salesOrders` method provides access to the `v-beta` Sales Order endpoints
8315
+ * in ShipEngine API.
8316
+ *
8317
+ * @see {@link SalesOrdersAPI | The Sales Orders API module}
8318
+ */
8048
8319
  get salesOrders() {
8049
8320
  return new SalesOrdersAPI(this.client);
8050
8321
  }
8322
+ /**
8323
+ * The `shipments` method provides access to the Shipment endpoints in ShipEngine
8324
+ * API. e.g. Create Shipment, Get Shipment, etc.
8325
+ *
8326
+ * @see {@link ShipmentsAPI | The Shipments API module}
8327
+ */
8051
8328
  get shipments() {
8052
8329
  return new ShipmentsAPI(this.client);
8053
8330
  }
8331
+ /**
8332
+ * The `warehouses` method provides access to the Warehouses endpoints in ShipEngine
8333
+ * API. e.g. List Warehouses, Get Warehouse, etc.
8334
+ *
8335
+ * @see {@link WarehousesAPI | The Warehouses API module}
8336
+ */
8054
8337
  get warehouses() {
8055
8338
  return new WarehousesAPI(this.client);
8056
8339
  }
@@ -8109,25 +8392,25 @@ const delay = (ms) => new Promise((resolve) => {
8109
8392
 
8110
8393
  const onError = (errors) => errors.forEach(console.log);
8111
8394
 
8112
- var __defProp$4 = Object.defineProperty;
8113
- var __defProps$3 = Object.defineProperties;
8114
- var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
8115
- var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
8116
- var __hasOwnProp$a = Object.prototype.hasOwnProperty;
8117
- var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
8118
- var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8119
- var __spreadValues$4 = (a, b) => {
8395
+ var __defProp$2 = Object.defineProperty;
8396
+ var __defProps$1 = Object.defineProperties;
8397
+ var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
8398
+ var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
8399
+ var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
8400
+ var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
8401
+ var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8402
+ var __spreadValues$2 = (a, b) => {
8120
8403
  for (var prop in b || (b = {}))
8121
- if (__hasOwnProp$a.call(b, prop))
8122
- __defNormalProp$4(a, prop, b[prop]);
8123
- if (__getOwnPropSymbols$a)
8124
- for (var prop of __getOwnPropSymbols$a(b)) {
8125
- if (__propIsEnum$a.call(b, prop))
8126
- __defNormalProp$4(a, prop, b[prop]);
8404
+ if (__hasOwnProp$8.call(b, prop))
8405
+ __defNormalProp$2(a, prop, b[prop]);
8406
+ if (__getOwnPropSymbols$8)
8407
+ for (var prop of __getOwnPropSymbols$8(b)) {
8408
+ if (__propIsEnum$8.call(b, prop))
8409
+ __defNormalProp$2(a, prop, b[prop]);
8127
8410
  }
8128
8411
  return a;
8129
8412
  };
8130
- var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
8413
+ var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
8131
8414
  const streams = [];
8132
8415
  if (process.env.NODE_ENV === "production") {
8133
8416
  streams.push({
@@ -8136,7 +8419,7 @@ if (process.env.NODE_ENV === "production") {
8136
8419
  }
8137
8420
  const logger = E({
8138
8421
  name: "shipengine",
8139
- serializers: __spreadProps$3(__spreadValues$4({}, k), {
8422
+ serializers: __spreadProps$1(__spreadValues$2({}, k), {
8140
8423
  req: (req) => ({
8141
8424
  headers: req.headers,
8142
8425
  method: req.method,
@@ -8171,7 +8454,7 @@ const useGetAccountSettings = () => {
8171
8454
  });
8172
8455
  };
8173
8456
 
8174
- var __async$s = (__this, __arguments, generator) => {
8457
+ var __async$r = (__this, __arguments, generator) => {
8175
8458
  return new Promise((resolve, reject) => {
8176
8459
  var fulfilled = (value) => {
8177
8460
  try {
@@ -8194,7 +8477,7 @@ var __async$s = (__this, __arguments, generator) => {
8194
8477
  const useUpdateAccountSettings = () => {
8195
8478
  const { client } = useShipEngine();
8196
8479
  return reactQuery.useMutation({
8197
- mutationFn: (settings) => __async$s(void 0, null, function* () {
8480
+ mutationFn: (settings) => __async$r(void 0, null, function* () {
8198
8481
  const result = yield client.accountSettings.update(settings);
8199
8482
  return result.data;
8200
8483
  }),
@@ -8203,7 +8486,7 @@ const useUpdateAccountSettings = () => {
8203
8486
  });
8204
8487
  };
8205
8488
 
8206
- var __async$r = (__this, __arguments, generator) => {
8489
+ var __async$q = (__this, __arguments, generator) => {
8207
8490
  return new Promise((resolve, reject) => {
8208
8491
  var fulfilled = (value) => {
8209
8492
  try {
@@ -8226,7 +8509,7 @@ var __async$r = (__this, __arguments, generator) => {
8226
8509
  const useParseAddress = () => {
8227
8510
  const { client } = useShipEngine();
8228
8511
  return reactQuery.useMutation({
8229
- mutationFn: (_0) => __async$r(void 0, [_0], function* ({ address, text }) {
8512
+ mutationFn: (_0) => __async$q(void 0, [_0], function* ({ address, text }) {
8230
8513
  const result = yield client.addresses.parse(text, address);
8231
8514
  return result.data;
8232
8515
  }),
@@ -8235,7 +8518,7 @@ const useParseAddress = () => {
8235
8518
  });
8236
8519
  };
8237
8520
 
8238
- var __async$q = (__this, __arguments, generator) => {
8521
+ var __async$p = (__this, __arguments, generator) => {
8239
8522
  return new Promise((resolve, reject) => {
8240
8523
  var fulfilled = (value) => {
8241
8524
  try {
@@ -8258,7 +8541,7 @@ var __async$q = (__this, __arguments, generator) => {
8258
8541
  const useValidateAddresses = () => {
8259
8542
  const { client } = useShipEngine();
8260
8543
  return reactQuery.useMutation({
8261
- mutationFn: (addresses) => __async$q(void 0, null, function* () {
8544
+ mutationFn: (addresses) => __async$p(void 0, null, function* () {
8262
8545
  const result = yield client.addresses.validate(addresses);
8263
8546
  return result.data;
8264
8547
  }),
@@ -8267,7 +8550,7 @@ const useValidateAddresses = () => {
8267
8550
  });
8268
8551
  };
8269
8552
 
8270
- var __async$p = (__this, __arguments, generator) => {
8553
+ var __async$o = (__this, __arguments, generator) => {
8271
8554
  return new Promise((resolve, reject) => {
8272
8555
  var fulfilled = (value) => {
8273
8556
  try {
@@ -8290,7 +8573,7 @@ var __async$p = (__this, __arguments, generator) => {
8290
8573
  const useAddFunds = (carrierId) => {
8291
8574
  const { client } = useShipEngine();
8292
8575
  return reactQuery.useMutation({
8293
- mutationFn: (funds) => __async$p(void 0, null, function* () {
8576
+ mutationFn: (funds) => __async$o(void 0, null, function* () {
8294
8577
  const result = yield client.carriers.addFunds(carrierId, funds);
8295
8578
  return result.data;
8296
8579
  }),
@@ -8299,7 +8582,7 @@ const useAddFunds = (carrierId) => {
8299
8582
  });
8300
8583
  };
8301
8584
 
8302
- var __async$o = (__this, __arguments, generator) => {
8585
+ var __async$n = (__this, __arguments, generator) => {
8303
8586
  return new Promise((resolve, reject) => {
8304
8587
  var fulfilled = (value) => {
8305
8588
  try {
@@ -8322,7 +8605,7 @@ var __async$o = (__this, __arguments, generator) => {
8322
8605
  const useConnectCarrier = () => {
8323
8606
  const { client } = useShipEngine();
8324
8607
  return reactQuery.useMutation({
8325
- mutationFn: (params) => __async$o(void 0, null, function* () {
8608
+ mutationFn: (params) => __async$n(void 0, null, function* () {
8326
8609
  const result = yield client.carriers.connect(params);
8327
8610
  return result.data;
8328
8611
  }),
@@ -8459,7 +8742,7 @@ const useListCarriers = () => {
8459
8742
  });
8460
8743
  };
8461
8744
 
8462
- var __async$n = (__this, __arguments, generator) => {
8745
+ var __async$m = (__this, __arguments, generator) => {
8463
8746
  return new Promise((resolve, reject) => {
8464
8747
  var fulfilled = (value) => {
8465
8748
  try {
@@ -8483,7 +8766,7 @@ const useUpdateAutoFunding = (carrierId) => {
8483
8766
  const { client } = useShipEngine();
8484
8767
  const queryClient = reactQuery.useQueryClient();
8485
8768
  return reactQuery.useMutation({
8486
- mutationFn: (options) => __async$n(void 0, null, function* () {
8769
+ mutationFn: (options) => __async$m(void 0, null, function* () {
8487
8770
  const result = yield client.carriers.updateAutoFunding(carrierId, options);
8488
8771
  return result.data;
8489
8772
  }),
@@ -8505,7 +8788,7 @@ const useListCustomPackageTypes = () => {
8505
8788
  });
8506
8789
  };
8507
8790
 
8508
- var __async$m = (__this, __arguments, generator) => {
8791
+ var __async$l = (__this, __arguments, generator) => {
8509
8792
  return new Promise((resolve, reject) => {
8510
8793
  var fulfilled = (value) => {
8511
8794
  try {
@@ -8528,7 +8811,7 @@ var __async$m = (__this, __arguments, generator) => {
8528
8811
  const useCreateFundingSource = () => {
8529
8812
  const { client } = useShipEngine();
8530
8813
  return reactQuery.useMutation({
8531
- mutationFn: (fundingSource) => __async$m(void 0, null, function* () {
8814
+ mutationFn: (fundingSource) => __async$l(void 0, null, function* () {
8532
8815
  const result = yield client.fundingSources.create(fundingSource);
8533
8816
  return result.data;
8534
8817
  }),
@@ -8537,7 +8820,7 @@ const useCreateFundingSource = () => {
8537
8820
  });
8538
8821
  };
8539
8822
 
8540
- var __async$l = (__this, __arguments, generator) => {
8823
+ var __async$k = (__this, __arguments, generator) => {
8541
8824
  return new Promise((resolve, reject) => {
8542
8825
  var fulfilled = (value) => {
8543
8826
  try {
@@ -8560,7 +8843,7 @@ var __async$l = (__this, __arguments, generator) => {
8560
8843
  const useFundingSourcesAddFunds = (fundingSourceId) => {
8561
8844
  const { client } = useShipEngine();
8562
8845
  return reactQuery.useMutation({
8563
- mutationFn: (funds) => __async$l(void 0, null, function* () {
8846
+ mutationFn: (funds) => __async$k(void 0, null, function* () {
8564
8847
  const result = yield client.fundingSources.addFunds(funds, fundingSourceId);
8565
8848
  return result.data;
8566
8849
  }),
@@ -8589,7 +8872,7 @@ const useListFundingSources = () => {
8589
8872
  });
8590
8873
  };
8591
8874
 
8592
- var __async$k = (__this, __arguments, generator) => {
8875
+ var __async$j = (__this, __arguments, generator) => {
8593
8876
  return new Promise((resolve, reject) => {
8594
8877
  var fulfilled = (value) => {
8595
8878
  try {
@@ -8612,7 +8895,7 @@ var __async$k = (__this, __arguments, generator) => {
8612
8895
  const useRegisterCarrier = () => {
8613
8896
  const { client } = useShipEngine();
8614
8897
  return reactQuery.useMutation({
8615
- mutationFn: (carrier) => __async$k(void 0, null, function* () {
8898
+ mutationFn: (carrier) => __async$j(void 0, null, function* () {
8616
8899
  const result = yield client.fundingSources.registerCarrier(carrier);
8617
8900
  return result.data;
8618
8901
  }),
@@ -8621,7 +8904,7 @@ const useRegisterCarrier = () => {
8621
8904
  });
8622
8905
  };
8623
8906
 
8624
- var __async$j = (__this, __arguments, generator) => {
8907
+ var __async$i = (__this, __arguments, generator) => {
8625
8908
  return new Promise((resolve, reject) => {
8626
8909
  var fulfilled = (value) => {
8627
8910
  try {
@@ -8644,7 +8927,7 @@ var __async$j = (__this, __arguments, generator) => {
8644
8927
  const useUpdateFundingSource = () => {
8645
8928
  const { client } = useShipEngine();
8646
8929
  return reactQuery.useMutation({
8647
- mutationFn: (_0) => __async$j(void 0, [_0], function* ({
8930
+ mutationFn: (_0) => __async$i(void 0, [_0], function* ({
8648
8931
  billingInfo,
8649
8932
  creditCardInfo,
8650
8933
  fundingSourceId
@@ -8676,22 +8959,22 @@ const useGetInsuranceAccount = (insuranceProvider) => {
8676
8959
  });
8677
8960
  };
8678
8961
 
8679
- var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
8680
- var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
8681
- var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
8962
+ var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
8963
+ var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
8964
+ var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
8682
8965
  var __objRest$6 = (source, exclude) => {
8683
8966
  var target = {};
8684
8967
  for (var prop in source)
8685
- if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
8968
+ if (__hasOwnProp$7.call(source, prop) && exclude.indexOf(prop) < 0)
8686
8969
  target[prop] = source[prop];
8687
- if (source != null && __getOwnPropSymbols$9)
8688
- for (var prop of __getOwnPropSymbols$9(source)) {
8689
- if (exclude.indexOf(prop) < 0 && __propIsEnum$9.call(source, prop))
8970
+ if (source != null && __getOwnPropSymbols$7)
8971
+ for (var prop of __getOwnPropSymbols$7(source)) {
8972
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$7.call(source, prop))
8690
8973
  target[prop] = source[prop];
8691
8974
  }
8692
8975
  return target;
8693
8976
  };
8694
- var __async$i = (__this, __arguments, generator) => {
8977
+ var __async$h = (__this, __arguments, generator) => {
8695
8978
  return new Promise((resolve, reject) => {
8696
8979
  var fulfilled = (value) => {
8697
8980
  try {
@@ -8714,7 +8997,7 @@ var __async$i = (__this, __arguments, generator) => {
8714
8997
  const useCreateLabel = () => {
8715
8998
  const { client } = useShipEngine();
8716
8999
  return reactQuery.useMutation({
8717
- mutationFn: (_a) => __async$i(void 0, null, function* () {
9000
+ mutationFn: (_a) => __async$h(void 0, null, function* () {
8718
9001
  var _b = _a, { rateId } = _b, options = __objRest$6(_b, ["rateId"]);
8719
9002
  const result = yield client.labels.createByRateId(rateId, options);
8720
9003
  return result.data;
@@ -8750,7 +9033,7 @@ const useListLabels = (params) => {
8750
9033
  });
8751
9034
  };
8752
9035
 
8753
- var __async$h = (__this, __arguments, generator) => {
9036
+ var __async$g = (__this, __arguments, generator) => {
8754
9037
  return new Promise((resolve, reject) => {
8755
9038
  var fulfilled = (value) => {
8756
9039
  try {
@@ -8773,7 +9056,7 @@ var __async$h = (__this, __arguments, generator) => {
8773
9056
  const useVoidLabel = () => {
8774
9057
  const { client } = useShipEngine();
8775
9058
  return reactQuery.useMutation({
8776
- mutationFn: (labelId) => __async$h(void 0, null, function* () {
9059
+ mutationFn: (labelId) => __async$g(void 0, null, function* () {
8777
9060
  const result = yield client.labels.void(labelId);
8778
9061
  return result.data;
8779
9062
  }),
@@ -8792,7 +9075,7 @@ const useListOrderSources = () => {
8792
9075
  });
8793
9076
  };
8794
9077
 
8795
- var __async$g = (__this, __arguments, generator) => {
9078
+ var __async$f = (__this, __arguments, generator) => {
8796
9079
  return new Promise((resolve, reject) => {
8797
9080
  var fulfilled = (value) => {
8798
9081
  try {
@@ -8815,7 +9098,7 @@ var __async$g = (__this, __arguments, generator) => {
8815
9098
  const useRefreshOrderSourceAsync = () => {
8816
9099
  const { client } = useShipEngine();
8817
9100
  return reactQuery.useMutation({
8818
- mutationFn: (orderSourceId) => __async$g(void 0, null, function* () {
9101
+ mutationFn: (orderSourceId) => __async$f(void 0, null, function* () {
8819
9102
  const result = yield client.orderSources.refresh(orderSourceId);
8820
9103
  return result.data;
8821
9104
  }),
@@ -8826,9 +9109,9 @@ const useRefreshOrderSource = () => {
8826
9109
  const { client } = useShipEngine();
8827
9110
  const { mutateAsync: refreshOrderSourceAsync } = useRefreshOrderSourceAsync();
8828
9111
  return reactQuery.useMutation({
8829
- mutationFn: (orderSourceId) => __async$g(void 0, null, function* () {
9112
+ mutationFn: (orderSourceId) => __async$f(void 0, null, function* () {
8830
9113
  yield refreshOrderSourceAsync(orderSourceId);
8831
- const waitResult = yield retryUntil(() => __async$g(void 0, null, function* () {
9114
+ const waitResult = yield retryUntil(() => __async$f(void 0, null, function* () {
8832
9115
  const { data: checkResult } = yield client.orderSources.get(orderSourceId);
8833
9116
  if (["preparing_update", "updating"].includes(checkResult.refreshInfo.status)) {
8834
9117
  throw new CodedError("Order source is still refreshing");
@@ -8842,7 +9125,7 @@ const useRefreshOrderSource = () => {
8842
9125
  });
8843
9126
  };
8844
9127
 
8845
- var __async$f = (__this, __arguments, generator) => {
9128
+ var __async$e = (__this, __arguments, generator) => {
8846
9129
  return new Promise((resolve, reject) => {
8847
9130
  var fulfilled = (value) => {
8848
9131
  try {
@@ -8865,7 +9148,7 @@ var __async$f = (__this, __arguments, generator) => {
8865
9148
  const useCreateRateCard = () => {
8866
9149
  const { client } = useShipEngine();
8867
9150
  return reactQuery.useMutation({
8868
- mutationFn: (rateCard) => __async$f(void 0, null, function* () {
9151
+ mutationFn: (rateCard) => __async$e(void 0, null, function* () {
8869
9152
  const result = yield client.rateCards.create(rateCard);
8870
9153
  return result.data;
8871
9154
  }),
@@ -8912,7 +9195,7 @@ const useListRateCards = (carrierIds) => {
8912
9195
  });
8913
9196
  };
8914
9197
 
8915
- var __async$e = (__this, __arguments, generator) => {
9198
+ var __async$d = (__this, __arguments, generator) => {
8916
9199
  return new Promise((resolve, reject) => {
8917
9200
  var fulfilled = (value) => {
8918
9201
  try {
@@ -8935,7 +9218,7 @@ var __async$e = (__this, __arguments, generator) => {
8935
9218
  const usePublishRateCard = () => {
8936
9219
  const { client } = useShipEngine();
8937
9220
  return reactQuery.useMutation({
8938
- mutationFn: (rateCardId) => __async$e(void 0, null, function* () {
9221
+ mutationFn: (rateCardId) => __async$d(void 0, null, function* () {
8939
9222
  return yield client.rateCards.publish(rateCardId);
8940
9223
  }),
8941
9224
  mutationKey: ["usePublishRateCard"],
@@ -8943,7 +9226,7 @@ const usePublishRateCard = () => {
8943
9226
  });
8944
9227
  };
8945
9228
 
8946
- var __async$d = (__this, __arguments, generator) => {
9229
+ var __async$c = (__this, __arguments, generator) => {
8947
9230
  return new Promise((resolve, reject) => {
8948
9231
  var fulfilled = (value) => {
8949
9232
  try {
@@ -8966,7 +9249,7 @@ var __async$d = (__this, __arguments, generator) => {
8966
9249
  const useUpdateRateCard = () => {
8967
9250
  const { client } = useShipEngine();
8968
9251
  return reactQuery.useMutation({
8969
- mutationFn: (rateCard) => __async$d(void 0, null, function* () {
9252
+ mutationFn: (rateCard) => __async$c(void 0, null, function* () {
8970
9253
  const result = yield client.rateCards.update(rateCard);
8971
9254
  return result.data;
8972
9255
  }),
@@ -8975,7 +9258,7 @@ const useUpdateRateCard = () => {
8975
9258
  });
8976
9259
  };
8977
9260
 
8978
- var __async$c = (__this, __arguments, generator) => {
9261
+ var __async$b = (__this, __arguments, generator) => {
8979
9262
  return new Promise((resolve, reject) => {
8980
9263
  var fulfilled = (value) => {
8981
9264
  try {
@@ -8998,7 +9281,7 @@ var __async$c = (__this, __arguments, generator) => {
8998
9281
  const useUploadRateCard = () => {
8999
9282
  const { client } = useShipEngine();
9000
9283
  return reactQuery.useMutation({
9001
- mutationFn: (_0) => __async$c(void 0, [_0], function* ({ rateCardId, file }) {
9284
+ mutationFn: (_0) => __async$b(void 0, [_0], function* ({ rateCardId, file }) {
9002
9285
  const result = yield client.rateCards.upload(rateCardId, file);
9003
9286
  return result.data;
9004
9287
  }),
@@ -9007,7 +9290,7 @@ const useUploadRateCard = () => {
9007
9290
  });
9008
9291
  };
9009
9292
 
9010
- var __async$b = (__this, __arguments, generator) => {
9293
+ var __async$a = (__this, __arguments, generator) => {
9011
9294
  return new Promise((resolve, reject) => {
9012
9295
  var fulfilled = (value) => {
9013
9296
  try {
@@ -9030,7 +9313,7 @@ var __async$b = (__this, __arguments, generator) => {
9030
9313
  const useDeleteRateCard = () => {
9031
9314
  const { client } = useShipEngine();
9032
9315
  return reactQuery.useMutation({
9033
- mutationFn: (rateCardId) => __async$b(void 0, null, function* () {
9316
+ mutationFn: (rateCardId) => __async$a(void 0, null, function* () {
9034
9317
  const result = yield client.rateCards.delete(rateCardId);
9035
9318
  return result.data;
9036
9319
  }),
@@ -9039,7 +9322,7 @@ const useDeleteRateCard = () => {
9039
9322
  });
9040
9323
  };
9041
9324
 
9042
- var __async$a = (__this, __arguments, generator) => {
9325
+ var __async$9 = (__this, __arguments, generator) => {
9043
9326
  return new Promise((resolve, reject) => {
9044
9327
  var fulfilled = (value) => {
9045
9328
  try {
@@ -9062,7 +9345,7 @@ var __async$a = (__this, __arguments, generator) => {
9062
9345
  const useCalculateRates = () => {
9063
9346
  const { client } = useShipEngine();
9064
9347
  return reactQuery.useMutation({
9065
- mutationFn: (_0) => __async$a(void 0, [_0], function* ({ rateOptions, shipmentId }) {
9348
+ mutationFn: (_0) => __async$9(void 0, [_0], function* ({ rateOptions, shipmentId }) {
9066
9349
  const result = yield client.rates.calculateByShipmentId(shipmentId, rateOptions);
9067
9350
  return result.data;
9068
9351
  }),
@@ -9097,22 +9380,22 @@ const useListSalesOrders = (params = {}) => {
9097
9380
  });
9098
9381
  };
9099
9382
 
9100
- var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
9101
- var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
9102
- var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
9383
+ var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
9384
+ var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
9385
+ var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
9103
9386
  var __objRest$5 = (source, exclude) => {
9104
9387
  var target = {};
9105
9388
  for (var prop in source)
9106
- if (__hasOwnProp$8.call(source, prop) && exclude.indexOf(prop) < 0)
9389
+ if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
9107
9390
  target[prop] = source[prop];
9108
- if (source != null && __getOwnPropSymbols$8)
9109
- for (var prop of __getOwnPropSymbols$8(source)) {
9110
- if (exclude.indexOf(prop) < 0 && __propIsEnum$8.call(source, prop))
9391
+ if (source != null && __getOwnPropSymbols$6)
9392
+ for (var prop of __getOwnPropSymbols$6(source)) {
9393
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
9111
9394
  target[prop] = source[prop];
9112
9395
  }
9113
9396
  return target;
9114
9397
  };
9115
- var __async$9 = (__this, __arguments, generator) => {
9398
+ var __async$8 = (__this, __arguments, generator) => {
9116
9399
  return new Promise((resolve, reject) => {
9117
9400
  var fulfilled = (value) => {
9118
9401
  try {
@@ -9135,7 +9418,7 @@ var __async$9 = (__this, __arguments, generator) => {
9135
9418
  const useNotifySalesOrderShipped = () => {
9136
9419
  const { client } = useShipEngine();
9137
9420
  return reactQuery.useMutation({
9138
- mutationFn: (_a) => __async$9(void 0, null, function* () {
9421
+ mutationFn: (_a) => __async$8(void 0, null, function* () {
9139
9422
  var _b = _a, { salesOrderId } = _b, tracking = __objRest$5(_b, ["salesOrderId"]);
9140
9423
  const result = yield client.salesOrders.notifyShipped(salesOrderId, tracking);
9141
9424
  return result.data;
@@ -9145,22 +9428,22 @@ const useNotifySalesOrderShipped = () => {
9145
9428
  });
9146
9429
  };
9147
9430
 
9148
- var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
9149
- var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
9150
- var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
9431
+ var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
9432
+ var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
9433
+ var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
9151
9434
  var __objRest$4 = (source, exclude) => {
9152
9435
  var target = {};
9153
9436
  for (var prop in source)
9154
- if (__hasOwnProp$7.call(source, prop) && exclude.indexOf(prop) < 0)
9437
+ if (__hasOwnProp$5.call(source, prop) && exclude.indexOf(prop) < 0)
9155
9438
  target[prop] = source[prop];
9156
- if (source != null && __getOwnPropSymbols$7)
9157
- for (var prop of __getOwnPropSymbols$7(source)) {
9158
- if (exclude.indexOf(prop) < 0 && __propIsEnum$7.call(source, prop))
9439
+ if (source != null && __getOwnPropSymbols$5)
9440
+ for (var prop of __getOwnPropSymbols$5(source)) {
9441
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$5.call(source, prop))
9159
9442
  target[prop] = source[prop];
9160
9443
  }
9161
9444
  return target;
9162
9445
  };
9163
- var __async$8 = (__this, __arguments, generator) => {
9446
+ var __async$7 = (__this, __arguments, generator) => {
9164
9447
  return new Promise((resolve, reject) => {
9165
9448
  var fulfilled = (value) => {
9166
9449
  try {
@@ -9183,7 +9466,7 @@ var __async$8 = (__this, __arguments, generator) => {
9183
9466
  const useCreateSalesOrderShipment = () => {
9184
9467
  const { client } = useShipEngine();
9185
9468
  return reactQuery.useMutation({
9186
- mutationFn: (_a) => __async$8(void 0, null, function* () {
9469
+ mutationFn: (_a) => __async$7(void 0, null, function* () {
9187
9470
  var _b = _a, { salesOrderId } = _b, shipment = __objRest$4(_b, ["salesOrderId"]);
9188
9471
  const result = yield client.salesOrderShipments.create(salesOrderId, shipment);
9189
9472
  return result.data;
@@ -9219,22 +9502,22 @@ const useListSalesOrderShipments = (params) => {
9219
9502
  });
9220
9503
  };
9221
9504
 
9222
- var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
9223
- var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
9224
- var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
9505
+ var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
9506
+ var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
9507
+ var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
9225
9508
  var __objRest$3 = (source, exclude) => {
9226
9509
  var target = {};
9227
9510
  for (var prop in source)
9228
- if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
9511
+ if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
9229
9512
  target[prop] = source[prop];
9230
- if (source != null && __getOwnPropSymbols$6)
9231
- for (var prop of __getOwnPropSymbols$6(source)) {
9232
- if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
9513
+ if (source != null && __getOwnPropSymbols$4)
9514
+ for (var prop of __getOwnPropSymbols$4(source)) {
9515
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
9233
9516
  target[prop] = source[prop];
9234
9517
  }
9235
9518
  return target;
9236
9519
  };
9237
- var __async$7 = (__this, __arguments, generator) => {
9520
+ var __async$6 = (__this, __arguments, generator) => {
9238
9521
  return new Promise((resolve, reject) => {
9239
9522
  var fulfilled = (value) => {
9240
9523
  try {
@@ -9257,7 +9540,7 @@ var __async$7 = (__this, __arguments, generator) => {
9257
9540
  const useUpdateSalesOrderShipment = () => {
9258
9541
  const { client } = useShipEngine();
9259
9542
  return reactQuery.useMutation({
9260
- mutationFn: (_a) => __async$7(void 0, null, function* () {
9543
+ mutationFn: (_a) => __async$6(void 0, null, function* () {
9261
9544
  var _b = _a, { shipmentId } = _b, shipment = __objRest$3(_b, ["shipmentId"]);
9262
9545
  const result = yield client.salesOrderShipments.update(shipmentId, shipment);
9263
9546
  return result.data;
@@ -9267,26 +9550,26 @@ const useUpdateSalesOrderShipment = () => {
9267
9550
  });
9268
9551
  };
9269
9552
 
9270
- var __defProp$3 = Object.defineProperty;
9271
- var __defProps$2 = Object.defineProperties;
9272
- var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
9273
- var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
9274
- var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
9275
- var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
9276
- var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9277
- var __spreadValues$3 = (a, b) => {
9553
+ var __defProp$1 = Object.defineProperty;
9554
+ var __defProps = Object.defineProperties;
9555
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
9556
+ var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
9557
+ var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
9558
+ var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
9559
+ var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9560
+ var __spreadValues$1 = (a, b) => {
9278
9561
  for (var prop in b || (b = {}))
9279
- if (__hasOwnProp$5.call(b, prop))
9280
- __defNormalProp$3(a, prop, b[prop]);
9281
- if (__getOwnPropSymbols$5)
9282
- for (var prop of __getOwnPropSymbols$5(b)) {
9283
- if (__propIsEnum$5.call(b, prop))
9284
- __defNormalProp$3(a, prop, b[prop]);
9562
+ if (__hasOwnProp$3.call(b, prop))
9563
+ __defNormalProp$1(a, prop, b[prop]);
9564
+ if (__getOwnPropSymbols$3)
9565
+ for (var prop of __getOwnPropSymbols$3(b)) {
9566
+ if (__propIsEnum$3.call(b, prop))
9567
+ __defNormalProp$1(a, prop, b[prop]);
9285
9568
  }
9286
9569
  return a;
9287
9570
  };
9288
- var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
9289
- var __async$6 = (__this, __arguments, generator) => {
9571
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9572
+ var __async$5 = (__this, __arguments, generator) => {
9290
9573
  return new Promise((resolve, reject) => {
9291
9574
  var fulfilled = (value) => {
9292
9575
  try {
@@ -9309,7 +9592,7 @@ var __async$6 = (__this, __arguments, generator) => {
9309
9592
  const useCreateShipment = () => {
9310
9593
  const { client } = useShipEngine();
9311
9594
  return reactQuery.useMutation({
9312
- mutationFn: (shipment) => __async$6(void 0, null, function* () {
9595
+ mutationFn: (shipment) => __async$5(void 0, null, function* () {
9313
9596
  var _a;
9314
9597
  if (shipment.warehouseId === void 0) {
9315
9598
  throw new CodedError("errorMessages.noWarehouses", {
@@ -9327,7 +9610,7 @@ const useCreateShipment = () => {
9327
9610
  postalCode: "",
9328
9611
  stateProvince: ""
9329
9612
  };
9330
- return (yield client.shipments.create(__spreadProps$2(__spreadValues$3({}, shipment), {
9613
+ return (yield client.shipments.create(__spreadProps(__spreadValues$1({}, shipment), {
9331
9614
  shipTo
9332
9615
  }))).data;
9333
9616
  }),
@@ -9368,17 +9651,17 @@ const useGetShipment = (shipmentId) => {
9368
9651
  });
9369
9652
  };
9370
9653
 
9371
- var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
9372
- var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
9373
- var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
9654
+ var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
9655
+ var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
9656
+ var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
9374
9657
  var __objRest$2 = (source, exclude) => {
9375
9658
  var target = {};
9376
9659
  for (var prop in source)
9377
- if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
9660
+ if (__hasOwnProp$2.call(source, prop) && exclude.indexOf(prop) < 0)
9378
9661
  target[prop] = source[prop];
9379
- if (source != null && __getOwnPropSymbols$4)
9380
- for (var prop of __getOwnPropSymbols$4(source)) {
9381
- if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
9662
+ if (source != null && __getOwnPropSymbols$2)
9663
+ for (var prop of __getOwnPropSymbols$2(source)) {
9664
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$2.call(source, prop))
9382
9665
  target[prop] = source[prop];
9383
9666
  }
9384
9667
  return target;
@@ -9395,7 +9678,7 @@ const useListShipments = (_params) => {
9395
9678
  });
9396
9679
  };
9397
9680
 
9398
- var __async$5 = (__this, __arguments, generator) => {
9681
+ var __async$4 = (__this, __arguments, generator) => {
9399
9682
  return new Promise((resolve, reject) => {
9400
9683
  var fulfilled = (value) => {
9401
9684
  try {
@@ -9418,7 +9701,7 @@ var __async$5 = (__this, __arguments, generator) => {
9418
9701
  const useCreateWarehouse = () => {
9419
9702
  const { client } = useShipEngine();
9420
9703
  return reactQuery.useMutation({
9421
- mutationFn: (data) => __async$5(void 0, null, function* () {
9704
+ mutationFn: (data) => __async$4(void 0, null, function* () {
9422
9705
  const result = yield client.warehouses.create(data);
9423
9706
  return result.data;
9424
9707
  }),
@@ -9427,7 +9710,7 @@ const useCreateWarehouse = () => {
9427
9710
  });
9428
9711
  };
9429
9712
 
9430
- var __async$4 = (__this, __arguments, generator) => {
9713
+ var __async$3 = (__this, __arguments, generator) => {
9431
9714
  return new Promise((resolve, reject) => {
9432
9715
  var fulfilled = (value) => {
9433
9716
  try {
@@ -9450,7 +9733,7 @@ var __async$4 = (__this, __arguments, generator) => {
9450
9733
  const useDeleteWarehouse = () => {
9451
9734
  const { client } = useShipEngine();
9452
9735
  return reactQuery.useMutation({
9453
- mutationFn: (_0) => __async$4(void 0, [_0], function* ({ warehouseId }) {
9736
+ mutationFn: (_0) => __async$3(void 0, [_0], function* ({ warehouseId }) {
9454
9737
  const result = yield client.warehouses.delete(warehouseId);
9455
9738
  return result.data;
9456
9739
  }),
@@ -9471,22 +9754,22 @@ const useListWarehouses = (options) => {
9471
9754
  });
9472
9755
  };
9473
9756
 
9474
- var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
9475
- var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
9476
- var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
9757
+ var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
9758
+ var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
9759
+ var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
9477
9760
  var __objRest$1 = (source, exclude) => {
9478
9761
  var target = {};
9479
9762
  for (var prop in source)
9480
- if (__hasOwnProp$3.call(source, prop) && exclude.indexOf(prop) < 0)
9763
+ if (__hasOwnProp$1.call(source, prop) && exclude.indexOf(prop) < 0)
9481
9764
  target[prop] = source[prop];
9482
- if (source != null && __getOwnPropSymbols$3)
9483
- for (var prop of __getOwnPropSymbols$3(source)) {
9484
- if (exclude.indexOf(prop) < 0 && __propIsEnum$3.call(source, prop))
9765
+ if (source != null && __getOwnPropSymbols$1)
9766
+ for (var prop of __getOwnPropSymbols$1(source)) {
9767
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$1.call(source, prop))
9485
9768
  target[prop] = source[prop];
9486
9769
  }
9487
9770
  return target;
9488
9771
  };
9489
- var __async$3 = (__this, __arguments, generator) => {
9772
+ var __async$2 = (__this, __arguments, generator) => {
9490
9773
  return new Promise((resolve, reject) => {
9491
9774
  var fulfilled = (value) => {
9492
9775
  try {
@@ -9509,7 +9792,7 @@ var __async$3 = (__this, __arguments, generator) => {
9509
9792
  const useUpdateWarehouse = () => {
9510
9793
  const { client } = useShipEngine();
9511
9794
  return reactQuery.useMutation({
9512
- mutationFn: (_a) => __async$3(void 0, null, function* () {
9795
+ mutationFn: (_a) => __async$2(void 0, null, function* () {
9513
9796
  var _b = _a, { warehouseId } = _b, warehouse = __objRest$1(_b, ["warehouseId"]);
9514
9797
  const result = yield client.warehouses.update(warehouseId, warehouse);
9515
9798
  return result.data;
@@ -9519,7 +9802,7 @@ const useUpdateWarehouse = () => {
9519
9802
  });
9520
9803
  };
9521
9804
 
9522
- var __async$2 = (__this, __arguments, generator) => {
9805
+ var __async$1 = (__this, __arguments, generator) => {
9523
9806
  return new Promise((resolve, reject) => {
9524
9807
  var fulfilled = (value) => {
9525
9808
  try {
@@ -9542,12 +9825,12 @@ var __async$2 = (__this, __arguments, generator) => {
9542
9825
  const useLoadFonts = ({ cdnURL = "/", scope, theme }) => {
9543
9826
  const [fontFamily, setFontFamily] = React.useState();
9544
9827
  React.useEffect(() => {
9545
- (() => __async$2(void 0, null, function* () {
9828
+ (() => __async$1(void 0, null, function* () {
9546
9829
  var _a;
9547
9830
  try {
9548
9831
  const fontFaces = (_a = theme == null ? void 0 : theme.fontFaces) != null ? _a : [];
9549
9832
  yield Promise.all(
9550
- fontFaces.map((_0) => __async$2(void 0, [_0], function* ({ family, source, descriptors }) {
9833
+ fontFaces.map((_0) => __async$1(void 0, [_0], function* ({ family, source, descriptors }) {
9551
9834
  const fontSources = source.map((url) => `url(${url.replace("$cdnUrl", cdnURL)})`).join(", ");
9552
9835
  try {
9553
9836
  const font = new FontFace(family, fontSources, descriptors);
@@ -9569,7 +9852,7 @@ const useLoadFonts = ({ cdnURL = "/", scope, theme }) => {
9569
9852
  });
9570
9853
  };
9571
9854
 
9572
- var __async$1 = (__this, __arguments, generator) => {
9855
+ var __async = (__this, __arguments, generator) => {
9573
9856
  return new Promise((resolve, reject) => {
9574
9857
  var fulfilled = (value) => {
9575
9858
  try {
@@ -9592,7 +9875,7 @@ var __async$1 = (__this, __arguments, generator) => {
9592
9875
  const useLoadIcons = ({ brandName, cdnURL = "/" }) => {
9593
9876
  const [iconIndex, setIconIndex] = React.useState();
9594
9877
  React.useEffect(() => {
9595
- (() => __async$1(void 0, null, function* () {
9878
+ (() => __async(void 0, null, function* () {
9596
9879
  try {
9597
9880
  const result = yield axios.get("/brand/iconIndex.json", { baseURL: cdnURL });
9598
9881
  setIconIndex(result.data);
@@ -9602,7 +9885,7 @@ const useLoadIcons = ({ brandName, cdnURL = "/" }) => {
9602
9885
  }))();
9603
9886
  }, [brandName, cdnURL]);
9604
9887
  return React.useCallback(
9605
- (iconName) => __async$1(void 0, null, function* () {
9888
+ (iconName) => __async(void 0, null, function* () {
9606
9889
  if (iconIndex) {
9607
9890
  const iconBrand = (iconIndex[iconName.toLowerCase()] || []).includes(brandName) ? brandName : brands.BrandName.FALLBACK;
9608
9891
  const result = yield axios.get(
@@ -9628,39 +9911,7 @@ const useLoadTheme = ({ cdnURL = "/", brandName }) => {
9628
9911
  return theme;
9629
9912
  };
9630
9913
 
9631
- var __defProp$2 = Object.defineProperty;
9632
- var __defProps$1 = Object.defineProperties;
9633
- var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
9634
- var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
9635
- var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
9636
- var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
9637
- var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9638
- var __spreadValues$2 = (a, b) => {
9639
- for (var prop in b || (b = {}))
9640
- if (__hasOwnProp$2.call(b, prop))
9641
- __defNormalProp$2(a, prop, b[prop]);
9642
- if (__getOwnPropSymbols$2)
9643
- for (var prop of __getOwnPropSymbols$2(b)) {
9644
- if (__propIsEnum$2.call(b, prop))
9645
- __defNormalProp$2(a, prop, b[prop]);
9646
- }
9647
- return a;
9648
- };
9649
- var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
9650
9914
  const AlchemyContext = React.createContext(void 0);
9651
- const renderAlchemyProviders = ({
9652
- baseURL,
9653
- children,
9654
- getToken,
9655
- theme,
9656
- scope,
9657
- fontStyles,
9658
- iconCache,
9659
- resolveIcon
9660
- }) => /* @__PURE__ */ jsxs(react.ThemeProvider, { theme, children: [
9661
- /* @__PURE__ */ jsx(react.Global, { styles: [giger.getEmotionResetStyles(scope), fontStyles] }),
9662
- /* @__PURE__ */ jsx(giger.GigerConfigProvider, { iconCache, resolveIcon, children: /* @__PURE__ */ jsx(ShipEngine, { baseURL, getToken, children }) })
9663
- ] });
9664
9915
  const AlchemyProvider = ({
9665
9916
  baseURL = "https://api.shipengine.com",
9666
9917
  brandName = brands.BrandName.FALLBACK,
@@ -9678,7 +9929,10 @@ const AlchemyProvider = ({
9678
9929
  if (!theme)
9679
9930
  return null;
9680
9931
  const contextValue = { baseURL, brandName, cdnURL, getToken, locale, onError, scope, theme };
9681
- return /* @__PURE__ */ jsx(AlchemyContext.Provider, { value: contextValue, children: renderAlchemyProviders(__spreadProps$1(__spreadValues$2({}, contextValue), { children, fontStyles, iconCache, resolveIcon })) });
9932
+ return /* @__PURE__ */ jsx(AlchemyContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs(react.ThemeProvider, { theme, children: [
9933
+ /* @__PURE__ */ jsx(react.Global, { styles: [giger.getEmotionResetStyles(scope), fontStyles] }),
9934
+ /* @__PURE__ */ jsx(giger.GigerConfigProvider, { iconCache, resolveIcon, children: /* @__PURE__ */ jsx(ShipEngine, { baseURL, getToken, children }) })
9935
+ ] }) });
9682
9936
  };
9683
9937
  const useAlchemy = () => {
9684
9938
  const context = React.useContext(AlchemyContext);
@@ -9688,57 +9942,10 @@ const useAlchemy = () => {
9688
9942
  return context;
9689
9943
  };
9690
9944
 
9691
- var __defProp$1 = Object.defineProperty;
9692
- var __defProps = Object.defineProperties;
9693
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
9694
- var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
9695
- var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
9696
- var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
9697
- var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9698
- var __spreadValues$1 = (a, b) => {
9699
- for (var prop in b || (b = {}))
9700
- if (__hasOwnProp$1.call(b, prop))
9701
- __defNormalProp$1(a, prop, b[prop]);
9702
- if (__getOwnPropSymbols$1)
9703
- for (var prop of __getOwnPropSymbols$1(b)) {
9704
- if (__propIsEnum$1.call(b, prop))
9705
- __defNormalProp$1(a, prop, b[prop]);
9706
- }
9707
- return a;
9708
- };
9709
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9710
- var __async = (__this, __arguments, generator) => {
9711
- return new Promise((resolve, reject) => {
9712
- var fulfilled = (value) => {
9713
- try {
9714
- step(generator.next(value));
9715
- } catch (e) {
9716
- reject(e);
9717
- }
9718
- };
9719
- var rejected = (value) => {
9720
- try {
9721
- step(generator.throw(value));
9722
- } catch (e) {
9723
- reject(e);
9724
- }
9725
- };
9726
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
9727
- step((generator = generator.apply(__this, __arguments)).next());
9728
- });
9729
- };
9730
9945
  const AlchemyTestProvider = ({ baseURL, children }) => {
9731
9946
  const scope = "lmnt";
9732
9947
  const theme = React.useMemo(() => new gigerTheme.Theme(), []);
9733
- const fontStyles = react.css({ [`.${scope}`]: { fontFamily: theme.defaultFontFamily } });
9734
9948
  const getToken = React.useCallback(() => "none", []);
9735
- const iconCache = React.useMemo(giger.createIconCache, []);
9736
- const resolveIcon = React.useCallback(
9737
- (iconName) => __async(void 0, null, function* () {
9738
- return `<svg data-svg-id="${iconName}">mock icon-${iconName}</svg>`;
9739
- }),
9740
- []
9741
- );
9742
9949
  const contextValue = {
9743
9950
  baseURL,
9744
9951
  brandName: brands.BrandName.FALLBACK,
@@ -9748,7 +9955,7 @@ const AlchemyTestProvider = ({ baseURL, children }) => {
9748
9955
  scope,
9749
9956
  theme
9750
9957
  };
9751
- return /* @__PURE__ */ jsx(AlchemyContext.Provider, { value: contextValue, children: renderAlchemyProviders(__spreadProps(__spreadValues$1({}, contextValue), { children, fontStyles, iconCache, resolveIcon })) });
9958
+ return /* @__PURE__ */ jsx(AlchemyContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(giger.GigerTestProvider, { theme, children: /* @__PURE__ */ jsx(ShipEngine, { baseURL, getToken, children }) }) });
9752
9959
  };
9753
9960
 
9754
9961
  var classnamesExports = {};
@@ -10410,7 +10617,6 @@ exports.isCodedErrors = isCodedErrors;
10410
10617
  exports.logger = logger;
10411
10618
  exports.memoizedCreateCache = memoizedCreateCache;
10412
10619
  exports.onError = onError;
10413
- exports.renderAlchemyProviders = renderAlchemyProviders;
10414
10620
  exports.retryUntil = retryUntil;
10415
10621
  exports.useAddFunds = useAddFunds;
10416
10622
  exports.useAlchemy = useAlchemy;