@shipengine/alchemy 6.0.68 → 6.0.70

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 +245 -181
  2. package/index.mjs +245 -182
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -10822,17 +10822,17 @@ var AccountBillingPlanChangeType = /* @__PURE__ */ ((AccountBillingPlanChangeTyp
10822
10822
  return AccountBillingPlanChangeType2;
10823
10823
  })(AccountBillingPlanChangeType || {});
10824
10824
 
10825
- var __getOwnPropSymbols$$ = Object.getOwnPropertySymbols;
10826
- var __hasOwnProp$$ = Object.prototype.hasOwnProperty;
10827
- var __propIsEnum$$ = Object.prototype.propertyIsEnumerable;
10825
+ var __getOwnPropSymbols$10 = Object.getOwnPropertySymbols;
10826
+ var __hasOwnProp$10 = Object.prototype.hasOwnProperty;
10827
+ var __propIsEnum$10 = Object.prototype.propertyIsEnumerable;
10828
10828
  var __objRest$x = (source, exclude) => {
10829
10829
  var target = {};
10830
10830
  for (var prop in source)
10831
- if (__hasOwnProp$$.call(source, prop) && exclude.indexOf(prop) < 0)
10831
+ if (__hasOwnProp$10.call(source, prop) && exclude.indexOf(prop) < 0)
10832
10832
  target[prop] = source[prop];
10833
- if (source != null && __getOwnPropSymbols$$)
10834
- for (var prop of __getOwnPropSymbols$$(source)) {
10835
- if (exclude.indexOf(prop) < 0 && __propIsEnum$$.call(source, prop))
10833
+ if (source != null && __getOwnPropSymbols$10)
10834
+ for (var prop of __getOwnPropSymbols$10(source)) {
10835
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$10.call(source, prop))
10836
10836
  target[prop] = source[prop];
10837
10837
  }
10838
10838
  return target;
@@ -10967,17 +10967,17 @@ const types = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
10967
10967
  RateCardStatus
10968
10968
  }, Symbol.toStringTag, { value: 'Module' }));
10969
10969
 
10970
- var __getOwnPropSymbols$_ = Object.getOwnPropertySymbols;
10971
- var __hasOwnProp$_ = Object.prototype.hasOwnProperty;
10972
- var __propIsEnum$_ = Object.prototype.propertyIsEnumerable;
10970
+ var __getOwnPropSymbols$$ = Object.getOwnPropertySymbols;
10971
+ var __hasOwnProp$$ = Object.prototype.hasOwnProperty;
10972
+ var __propIsEnum$$ = Object.prototype.propertyIsEnumerable;
10973
10973
  var __objRest$w = (source, exclude) => {
10974
10974
  var target = {};
10975
10975
  for (var prop in source)
10976
- if (__hasOwnProp$_.call(source, prop) && exclude.indexOf(prop) < 0)
10976
+ if (__hasOwnProp$$.call(source, prop) && exclude.indexOf(prop) < 0)
10977
10977
  target[prop] = source[prop];
10978
- if (source != null && __getOwnPropSymbols$_)
10979
- for (var prop of __getOwnPropSymbols$_(source)) {
10980
- if (exclude.indexOf(prop) < 0 && __propIsEnum$_.call(source, prop))
10978
+ if (source != null && __getOwnPropSymbols$$)
10979
+ for (var prop of __getOwnPropSymbols$$(source)) {
10980
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$$.call(source, prop))
10981
10981
  target[prop] = source[prop];
10982
10982
  }
10983
10983
  return target;
@@ -11038,6 +11038,12 @@ class AccountAddonsAPI {
11038
11038
  this.list = () => {
11039
11039
  return this.client.get("/v1/account/addons");
11040
11040
  };
11041
+ /**
11042
+ * The `enable` method allows to enable an AddOn for the current user
11043
+ */
11044
+ this.enable = (addonCode) => {
11045
+ return this.client.post(`/v1/account/addons/${addonCode}/enable`);
11046
+ };
11041
11047
  this.client = client;
11042
11048
  }
11043
11049
  }
@@ -13845,7 +13851,7 @@ var ipaddr = {
13845
13851
  }).call(commonjsGlobal);
13846
13852
  } (ipaddr));
13847
13853
 
13848
- var __async$15 = (__this, __arguments, generator) => {
13854
+ var __async$16 = (__this, __arguments, generator) => {
13849
13855
  return new Promise((resolve, reject) => {
13850
13856
  var fulfilled = (value) => {
13851
13857
  try {
@@ -13865,7 +13871,7 @@ var __async$15 = (__this, __arguments, generator) => {
13865
13871
  step((generator = generator.apply(__this, __arguments)).next());
13866
13872
  });
13867
13873
  };
13868
- const getEndUserIpAddress = () => __async$15(void 0, null, function* () {
13874
+ const getEndUserIpAddress = () => __async$16(void 0, null, function* () {
13869
13875
  try {
13870
13876
  const response = yield axios.get("https://api.ipify.org/?format=json");
13871
13877
  if (response.data.ip && ipaddrExports.isValid(response.data.ip)) {
@@ -13926,38 +13932,38 @@ const decamelizeKeys = (obj, separator = "_") => {
13926
13932
  return obj;
13927
13933
  };
13928
13934
 
13929
- var __defProp$O = Object.defineProperty;
13930
- var __defProps$I = Object.defineProperties;
13931
- var __getOwnPropDescs$I = Object.getOwnPropertyDescriptors;
13932
- var __getOwnPropSymbols$Z = Object.getOwnPropertySymbols;
13933
- var __hasOwnProp$Z = Object.prototype.hasOwnProperty;
13934
- var __propIsEnum$Z = Object.prototype.propertyIsEnumerable;
13935
- var __defNormalProp$O = (obj, key, value) => key in obj ? __defProp$O(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13936
- var __spreadValues$O = (a, b) => {
13935
+ var __defProp$P = Object.defineProperty;
13936
+ var __defProps$J = Object.defineProperties;
13937
+ var __getOwnPropDescs$J = Object.getOwnPropertyDescriptors;
13938
+ var __getOwnPropSymbols$_ = Object.getOwnPropertySymbols;
13939
+ var __hasOwnProp$_ = Object.prototype.hasOwnProperty;
13940
+ var __propIsEnum$_ = Object.prototype.propertyIsEnumerable;
13941
+ var __defNormalProp$P = (obj, key, value) => key in obj ? __defProp$P(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13942
+ var __spreadValues$P = (a, b) => {
13937
13943
  for (var prop in b || (b = {}))
13938
- if (__hasOwnProp$Z.call(b, prop))
13939
- __defNormalProp$O(a, prop, b[prop]);
13940
- if (__getOwnPropSymbols$Z)
13941
- for (var prop of __getOwnPropSymbols$Z(b)) {
13942
- if (__propIsEnum$Z.call(b, prop))
13943
- __defNormalProp$O(a, prop, b[prop]);
13944
+ if (__hasOwnProp$_.call(b, prop))
13945
+ __defNormalProp$P(a, prop, b[prop]);
13946
+ if (__getOwnPropSymbols$_)
13947
+ for (var prop of __getOwnPropSymbols$_(b)) {
13948
+ if (__propIsEnum$_.call(b, prop))
13949
+ __defNormalProp$P(a, prop, b[prop]);
13944
13950
  }
13945
13951
  return a;
13946
13952
  };
13947
- var __spreadProps$I = (a, b) => __defProps$I(a, __getOwnPropDescs$I(b));
13953
+ var __spreadProps$J = (a, b) => __defProps$J(a, __getOwnPropDescs$J(b));
13948
13954
  var __objRest$v = (source, exclude) => {
13949
13955
  var target = {};
13950
13956
  for (var prop in source)
13951
- if (__hasOwnProp$Z.call(source, prop) && exclude.indexOf(prop) < 0)
13957
+ if (__hasOwnProp$_.call(source, prop) && exclude.indexOf(prop) < 0)
13952
13958
  target[prop] = source[prop];
13953
- if (source != null && __getOwnPropSymbols$Z)
13954
- for (var prop of __getOwnPropSymbols$Z(source)) {
13955
- if (exclude.indexOf(prop) < 0 && __propIsEnum$Z.call(source, prop))
13959
+ if (source != null && __getOwnPropSymbols$_)
13960
+ for (var prop of __getOwnPropSymbols$_(source)) {
13961
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$_.call(source, prop))
13956
13962
  target[prop] = source[prop];
13957
13963
  }
13958
13964
  return target;
13959
13965
  };
13960
- var __async$14 = (__this, __arguments, generator) => {
13966
+ var __async$15 = (__this, __arguments, generator) => {
13961
13967
  return new Promise((resolve, reject) => {
13962
13968
  var fulfilled = (value) => {
13963
13969
  try {
@@ -13997,12 +14003,12 @@ class CarriersAPI {
13997
14003
  /**
13998
14004
  * The `connect` method connects a carrier account to a user's ShipEngine account.
13999
14005
  */
14000
- this.connect = (_a) => __async$14(this, null, function* () {
14006
+ this.connect = (_a) => __async$15(this, null, function* () {
14001
14007
  var _b = _a, { carrierCode } = _b, connection = __objRest$v(_b, ["carrierCode"]);
14002
14008
  const endUserIpAddress = yield getEndUserIpAddress();
14003
14009
  if (!endUserIpAddress)
14004
14010
  return Promise.reject([new CodedError("Unable to get IP address")]);
14005
- return yield this.client.post(`/v1/registration/${carrierCode}`, __spreadProps$I(__spreadValues$O({}, connection), {
14011
+ return yield this.client.post(`/v1/registration/${carrierCode}`, __spreadProps$J(__spreadValues$P({}, connection), {
14006
14012
  endUserIpAddress
14007
14013
  }));
14008
14014
  });
@@ -14086,22 +14092,22 @@ class CarriersAPI {
14086
14092
  }
14087
14093
  }
14088
14094
 
14089
- var __getOwnPropSymbols$Y = Object.getOwnPropertySymbols;
14090
- var __hasOwnProp$Y = Object.prototype.hasOwnProperty;
14091
- var __propIsEnum$Y = Object.prototype.propertyIsEnumerable;
14095
+ var __getOwnPropSymbols$Z = Object.getOwnPropertySymbols;
14096
+ var __hasOwnProp$Z = Object.prototype.hasOwnProperty;
14097
+ var __propIsEnum$Z = Object.prototype.propertyIsEnumerable;
14092
14098
  var __objRest$u = (source, exclude) => {
14093
14099
  var target = {};
14094
14100
  for (var prop in source)
14095
- if (__hasOwnProp$Y.call(source, prop) && exclude.indexOf(prop) < 0)
14101
+ if (__hasOwnProp$Z.call(source, prop) && exclude.indexOf(prop) < 0)
14096
14102
  target[prop] = source[prop];
14097
- if (source != null && __getOwnPropSymbols$Y)
14098
- for (var prop of __getOwnPropSymbols$Y(source)) {
14099
- if (exclude.indexOf(prop) < 0 && __propIsEnum$Y.call(source, prop))
14103
+ if (source != null && __getOwnPropSymbols$Z)
14104
+ for (var prop of __getOwnPropSymbols$Z(source)) {
14105
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$Z.call(source, prop))
14100
14106
  target[prop] = source[prop];
14101
14107
  }
14102
14108
  return target;
14103
14109
  };
14104
- var __async$13 = (__this, __arguments, generator) => {
14110
+ var __async$14 = (__this, __arguments, generator) => {
14105
14111
  return new Promise((resolve, reject) => {
14106
14112
  var fulfilled = (value) => {
14107
14113
  try {
@@ -14143,7 +14149,7 @@ class ConnectionsAPI {
14143
14149
  /**
14144
14150
  * The `connectCarrier` method connects a carrier to account.
14145
14151
  */
14146
- this.connectCarrier = (carrierName, formData) => __async$13(this, null, function* () {
14152
+ this.connectCarrier = (carrierName, formData) => __async$14(this, null, function* () {
14147
14153
  return yield this.client.post(
14148
14154
  `/v1/connections/carriers/${carrierName}`,
14149
14155
  formData,
@@ -16311,23 +16317,23 @@ class CustomPackagesAPI {
16311
16317
  }
16312
16318
  }
16313
16319
 
16314
- var __defProp$N = Object.defineProperty;
16315
- var __getOwnPropSymbols$X = Object.getOwnPropertySymbols;
16316
- var __hasOwnProp$X = Object.prototype.hasOwnProperty;
16317
- var __propIsEnum$X = Object.prototype.propertyIsEnumerable;
16318
- var __defNormalProp$N = (obj, key, value) => key in obj ? __defProp$N(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16319
- var __spreadValues$N = (a, b) => {
16320
+ var __defProp$O = Object.defineProperty;
16321
+ var __getOwnPropSymbols$Y = Object.getOwnPropertySymbols;
16322
+ var __hasOwnProp$Y = Object.prototype.hasOwnProperty;
16323
+ var __propIsEnum$Y = Object.prototype.propertyIsEnumerable;
16324
+ var __defNormalProp$O = (obj, key, value) => key in obj ? __defProp$O(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16325
+ var __spreadValues$O = (a, b) => {
16320
16326
  for (var prop in b || (b = {}))
16321
- if (__hasOwnProp$X.call(b, prop))
16322
- __defNormalProp$N(a, prop, b[prop]);
16323
- if (__getOwnPropSymbols$X)
16324
- for (var prop of __getOwnPropSymbols$X(b)) {
16325
- if (__propIsEnum$X.call(b, prop))
16326
- __defNormalProp$N(a, prop, b[prop]);
16327
+ if (__hasOwnProp$Y.call(b, prop))
16328
+ __defNormalProp$O(a, prop, b[prop]);
16329
+ if (__getOwnPropSymbols$Y)
16330
+ for (var prop of __getOwnPropSymbols$Y(b)) {
16331
+ if (__propIsEnum$Y.call(b, prop))
16332
+ __defNormalProp$O(a, prop, b[prop]);
16327
16333
  }
16328
16334
  return a;
16329
16335
  };
16330
- var __async$12 = (__this, __arguments, generator) => {
16336
+ var __async$13 = (__this, __arguments, generator) => {
16331
16337
  return new Promise((resolve, reject) => {
16332
16338
  var fulfilled = (value) => {
16333
16339
  try {
@@ -16366,12 +16372,12 @@ class FundingSourcesAPI {
16366
16372
  * The `create` method creates a new funding source for a given user. This requires
16367
16373
  * payment information to be collected from the user.
16368
16374
  */
16369
- this.create = (createFundingSource) => __async$12(this, null, function* () {
16375
+ this.create = (createFundingSource) => __async$13(this, null, function* () {
16370
16376
  const endUserIpAddress = yield getEndUserIpAddress();
16371
16377
  if (!endUserIpAddress) {
16372
16378
  return Promise.reject([new CodedError("Unable to get IP address")]);
16373
16379
  }
16374
- return yield this.client.post("/v1/funding_sources", __spreadValues$N({
16380
+ return yield this.client.post("/v1/funding_sources", __spreadValues$O({
16375
16381
  endUserIpAddress
16376
16382
  }, createFundingSource));
16377
16383
  });
@@ -16380,7 +16386,7 @@ class FundingSourcesAPI {
16380
16386
  * user to update the billing address or payment information associated with the
16381
16387
  * funding source.
16382
16388
  */
16383
- this.update = (billingInfo, creditCardInfo, auctanePayInfo, fundingSourceId) => __async$12(this, null, function* () {
16389
+ this.update = (billingInfo, creditCardInfo, auctanePayInfo, fundingSourceId) => __async$13(this, null, function* () {
16384
16390
  const endUserIpAddress = yield getEndUserIpAddress();
16385
16391
  if (!endUserIpAddress) {
16386
16392
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -16390,7 +16396,7 @@ class FundingSourcesAPI {
16390
16396
  {
16391
16397
  billingInfo,
16392
16398
  endUserIpAddress,
16393
- paymentMethod: __spreadValues$N({
16399
+ paymentMethod: __spreadValues$O({
16394
16400
  creditCardInfo
16395
16401
  }, auctanePayInfo)
16396
16402
  }
@@ -16400,19 +16406,19 @@ class FundingSourcesAPI {
16400
16406
  * The `registerCarrier` method registers a carrier account and associates
16401
16407
  * it with a given funding source.
16402
16408
  */
16403
- this.registerCarrier = (carrier) => __async$12(this, null, function* () {
16409
+ this.registerCarrier = (carrier) => __async$13(this, null, function* () {
16404
16410
  const endUserIpAddress = yield getEndUserIpAddress();
16405
16411
  if (!endUserIpAddress) {
16406
16412
  return Promise.reject([new CodedError("Unable to get IP address")]);
16407
16413
  }
16408
- return yield this.client.post("/v1/registration/funding_source", __spreadValues$N({
16414
+ return yield this.client.post("/v1/registration/funding_source", __spreadValues$O({
16409
16415
  endUserIpAddress
16410
16416
  }, carrier));
16411
16417
  });
16412
16418
  /**
16413
16419
  * The `addFunds` method allows you to add funds to a funding source.
16414
16420
  */
16415
- this.addFunds = (amount, fundingSourceId) => __async$12(this, null, function* () {
16421
+ this.addFunds = (amount, fundingSourceId) => __async$13(this, null, function* () {
16416
16422
  return yield this.client.put(
16417
16423
  `/v1/funding_sources/${fundingSourceId}/add_funds`,
16418
16424
  amount
@@ -16422,7 +16428,7 @@ class FundingSourcesAPI {
16422
16428
  * The `metadata` method returns seller-specific requirements for creating funding sources
16423
16429
  * and attaching carriers
16424
16430
  */
16425
- this.metadata = () => __async$12(this, null, function* () {
16431
+ this.metadata = () => __async$13(this, null, function* () {
16426
16432
  return yield this.client.get("/v1/funding_sources/metadata");
16427
16433
  });
16428
16434
  /**
@@ -16474,7 +16480,7 @@ class InsuranceAPI {
16474
16480
  }
16475
16481
  }
16476
16482
 
16477
- var __async$11 = (__this, __arguments, generator) => {
16483
+ var __async$12 = (__this, __arguments, generator) => {
16478
16484
  return new Promise((resolve, reject) => {
16479
16485
  var fulfilled = (value) => {
16480
16486
  try {
@@ -16506,13 +16512,13 @@ class InvoiceAddressAPI {
16506
16512
  /**
16507
16513
  * The `create` method creates a new invoice address for a given user.
16508
16514
  */
16509
- this.create = (invoiceAddress) => __async$11(this, null, function* () {
16515
+ this.create = (invoiceAddress) => __async$12(this, null, function* () {
16510
16516
  return yield this.client.post("/v1/invoice_address", invoiceAddress);
16511
16517
  });
16512
16518
  /**
16513
16519
  * The `update` method updates a invoice address for a given user.
16514
16520
  */
16515
- this.update = (invoiceAddress) => __async$11(this, null, function* () {
16521
+ this.update = (invoiceAddress) => __async$12(this, null, function* () {
16516
16522
  return yield this.client.put("/v1/invoice_address", invoiceAddress);
16517
16523
  });
16518
16524
  this.client = client;
@@ -16574,17 +16580,17 @@ class LabelsAPI {
16574
16580
  }
16575
16581
  }
16576
16582
 
16577
- var __getOwnPropSymbols$W = Object.getOwnPropertySymbols;
16578
- var __hasOwnProp$W = Object.prototype.hasOwnProperty;
16579
- var __propIsEnum$W = Object.prototype.propertyIsEnumerable;
16583
+ var __getOwnPropSymbols$X = Object.getOwnPropertySymbols;
16584
+ var __hasOwnProp$X = Object.prototype.hasOwnProperty;
16585
+ var __propIsEnum$X = Object.prototype.propertyIsEnumerable;
16580
16586
  var __objRest$t = (source, exclude) => {
16581
16587
  var target = {};
16582
16588
  for (var prop in source)
16583
- if (__hasOwnProp$W.call(source, prop) && exclude.indexOf(prop) < 0)
16589
+ if (__hasOwnProp$X.call(source, prop) && exclude.indexOf(prop) < 0)
16584
16590
  target[prop] = source[prop];
16585
- if (source != null && __getOwnPropSymbols$W)
16586
- for (var prop of __getOwnPropSymbols$W(source)) {
16587
- if (exclude.indexOf(prop) < 0 && __propIsEnum$W.call(source, prop))
16591
+ if (source != null && __getOwnPropSymbols$X)
16592
+ for (var prop of __getOwnPropSymbols$X(source)) {
16593
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$X.call(source, prop))
16588
16594
  target[prop] = source[prop];
16589
16595
  }
16590
16596
  return target;
@@ -16705,19 +16711,19 @@ class RateCardsAPI {
16705
16711
  }
16706
16712
  }
16707
16713
 
16708
- var __defProp$M = Object.defineProperty;
16709
- var __getOwnPropSymbols$V = Object.getOwnPropertySymbols;
16710
- var __hasOwnProp$V = Object.prototype.hasOwnProperty;
16711
- var __propIsEnum$V = Object.prototype.propertyIsEnumerable;
16712
- var __defNormalProp$M = (obj, key, value) => key in obj ? __defProp$M(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16713
- var __spreadValues$M = (a, b) => {
16714
+ var __defProp$N = Object.defineProperty;
16715
+ var __getOwnPropSymbols$W = Object.getOwnPropertySymbols;
16716
+ var __hasOwnProp$W = Object.prototype.hasOwnProperty;
16717
+ var __propIsEnum$W = Object.prototype.propertyIsEnumerable;
16718
+ var __defNormalProp$N = (obj, key, value) => key in obj ? __defProp$N(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16719
+ var __spreadValues$N = (a, b) => {
16714
16720
  for (var prop in b || (b = {}))
16715
- if (__hasOwnProp$V.call(b, prop))
16716
- __defNormalProp$M(a, prop, b[prop]);
16717
- if (__getOwnPropSymbols$V)
16718
- for (var prop of __getOwnPropSymbols$V(b)) {
16719
- if (__propIsEnum$V.call(b, prop))
16720
- __defNormalProp$M(a, prop, b[prop]);
16721
+ if (__hasOwnProp$W.call(b, prop))
16722
+ __defNormalProp$N(a, prop, b[prop]);
16723
+ if (__getOwnPropSymbols$W)
16724
+ for (var prop of __getOwnPropSymbols$W(b)) {
16725
+ if (__propIsEnum$W.call(b, prop))
16726
+ __defNormalProp$N(a, prop, b[prop]);
16721
16727
  }
16722
16728
  return a;
16723
16729
  };
@@ -16739,7 +16745,7 @@ class RatesAPI {
16739
16745
  * method.
16740
16746
  */
16741
16747
  this.estimate = (params) => {
16742
- return this.client.post("/v1/rates/estimate", __spreadValues$M({}, params));
16748
+ return this.client.post("/v1/rates/estimate", __spreadValues$N({}, params));
16743
16749
  };
16744
16750
  this.client = client;
16745
16751
  }
@@ -16819,7 +16825,7 @@ class SalesOrdersAPI {
16819
16825
  }
16820
16826
  }
16821
16827
 
16822
- var __async$10 = (__this, __arguments, generator) => {
16828
+ var __async$11 = (__this, __arguments, generator) => {
16823
16829
  return new Promise((resolve, reject) => {
16824
16830
  var fulfilled = (value) => {
16825
16831
  try {
@@ -16877,7 +16883,7 @@ class SellersAPI {
16877
16883
  /**
16878
16884
  * Deletes an API Key
16879
16885
  */
16880
- this.deleteSellerApiKey = (_0) => __async$10(this, [_0], function* ({
16886
+ this.deleteSellerApiKey = (_0) => __async$11(this, [_0], function* ({
16881
16887
  encryptedApiKey,
16882
16888
  sellerId,
16883
16889
  isSandbox
@@ -16923,19 +16929,19 @@ class SellersAPI {
16923
16929
  }
16924
16930
  }
16925
16931
 
16926
- var __defProp$L = Object.defineProperty;
16927
- var __getOwnPropSymbols$U = Object.getOwnPropertySymbols;
16928
- var __hasOwnProp$U = Object.prototype.hasOwnProperty;
16929
- var __propIsEnum$U = Object.prototype.propertyIsEnumerable;
16930
- var __defNormalProp$L = (obj, key, value) => key in obj ? __defProp$L(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16931
- var __spreadValues$L = (a, b) => {
16932
+ var __defProp$M = Object.defineProperty;
16933
+ var __getOwnPropSymbols$V = Object.getOwnPropertySymbols;
16934
+ var __hasOwnProp$V = Object.prototype.hasOwnProperty;
16935
+ var __propIsEnum$V = Object.prototype.propertyIsEnumerable;
16936
+ var __defNormalProp$M = (obj, key, value) => key in obj ? __defProp$M(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16937
+ var __spreadValues$M = (a, b) => {
16932
16938
  for (var prop in b || (b = {}))
16933
- if (__hasOwnProp$U.call(b, prop))
16934
- __defNormalProp$L(a, prop, b[prop]);
16935
- if (__getOwnPropSymbols$U)
16936
- for (var prop of __getOwnPropSymbols$U(b)) {
16937
- if (__propIsEnum$U.call(b, prop))
16938
- __defNormalProp$L(a, prop, b[prop]);
16939
+ if (__hasOwnProp$V.call(b, prop))
16940
+ __defNormalProp$M(a, prop, b[prop]);
16941
+ if (__getOwnPropSymbols$V)
16942
+ for (var prop of __getOwnPropSymbols$V(b)) {
16943
+ if (__propIsEnum$V.call(b, prop))
16944
+ __defNormalProp$M(a, prop, b[prop]);
16939
16945
  }
16940
16946
  return a;
16941
16947
  };
@@ -16947,7 +16953,7 @@ class ServicePointsAPI {
16947
16953
  * Either an address, coordinates, or an address query
16948
16954
  */
16949
16955
  this.list = (options) => {
16950
- return this.client.post("/v1/service_points/list", __spreadValues$L({}, options));
16956
+ return this.client.post("/v1/service_points/list", __spreadValues$M({}, options));
16951
16957
  };
16952
16958
  /**
16953
16959
  * Get a specific service point by its carrier code, country code, and id
@@ -16965,7 +16971,7 @@ class ServicePointsAPI {
16965
16971
  }
16966
16972
  }
16967
16973
 
16968
- var __async$$ = (__this, __arguments, generator) => {
16974
+ var __async$10 = (__this, __arguments, generator) => {
16969
16975
  return new Promise((resolve, reject) => {
16970
16976
  var fulfilled = (value) => {
16971
16977
  try {
@@ -17014,7 +17020,7 @@ class ShipmentsAPI {
17014
17020
  * The `create` method allows for creating shipments based on a list of shipment
17015
17021
  * items passed into this method.
17016
17022
  */
17017
- this.create = (...shipments) => __async$$(this, null, function* () {
17023
+ this.create = (...shipments) => __async$10(this, null, function* () {
17018
17024
  return this.client.post("/v1/shipments", {
17019
17025
  shipments
17020
17026
  });
@@ -34431,38 +34437,38 @@ class WebhooksAPI {
34431
34437
  }
34432
34438
  }
34433
34439
 
34434
- var __defProp$K = Object.defineProperty;
34435
- var __defProps$H = Object.defineProperties;
34436
- var __getOwnPropDescs$H = Object.getOwnPropertyDescriptors;
34437
- var __getOwnPropSymbols$T = Object.getOwnPropertySymbols;
34438
- var __hasOwnProp$T = Object.prototype.hasOwnProperty;
34439
- var __propIsEnum$T = Object.prototype.propertyIsEnumerable;
34440
- var __defNormalProp$K = (obj, key, value) => key in obj ? __defProp$K(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
34441
- var __spreadValues$K = (a, b) => {
34440
+ var __defProp$L = Object.defineProperty;
34441
+ var __defProps$I = Object.defineProperties;
34442
+ var __getOwnPropDescs$I = Object.getOwnPropertyDescriptors;
34443
+ var __getOwnPropSymbols$U = Object.getOwnPropertySymbols;
34444
+ var __hasOwnProp$U = Object.prototype.hasOwnProperty;
34445
+ var __propIsEnum$U = Object.prototype.propertyIsEnumerable;
34446
+ var __defNormalProp$L = (obj, key, value) => key in obj ? __defProp$L(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
34447
+ var __spreadValues$L = (a, b) => {
34442
34448
  for (var prop in b || (b = {}))
34443
- if (__hasOwnProp$T.call(b, prop))
34444
- __defNormalProp$K(a, prop, b[prop]);
34445
- if (__getOwnPropSymbols$T)
34446
- for (var prop of __getOwnPropSymbols$T(b)) {
34447
- if (__propIsEnum$T.call(b, prop))
34448
- __defNormalProp$K(a, prop, b[prop]);
34449
+ if (__hasOwnProp$U.call(b, prop))
34450
+ __defNormalProp$L(a, prop, b[prop]);
34451
+ if (__getOwnPropSymbols$U)
34452
+ for (var prop of __getOwnPropSymbols$U(b)) {
34453
+ if (__propIsEnum$U.call(b, prop))
34454
+ __defNormalProp$L(a, prop, b[prop]);
34449
34455
  }
34450
34456
  return a;
34451
34457
  };
34452
- var __spreadProps$H = (a, b) => __defProps$H(a, __getOwnPropDescs$H(b));
34458
+ var __spreadProps$I = (a, b) => __defProps$I(a, __getOwnPropDescs$I(b));
34453
34459
  var __objRest$s = (source, exclude) => {
34454
34460
  var target = {};
34455
34461
  for (var prop in source)
34456
- if (__hasOwnProp$T.call(source, prop) && exclude.indexOf(prop) < 0)
34462
+ if (__hasOwnProp$U.call(source, prop) && exclude.indexOf(prop) < 0)
34457
34463
  target[prop] = source[prop];
34458
- if (source != null && __getOwnPropSymbols$T)
34459
- for (var prop of __getOwnPropSymbols$T(source)) {
34460
- if (exclude.indexOf(prop) < 0 && __propIsEnum$T.call(source, prop))
34464
+ if (source != null && __getOwnPropSymbols$U)
34465
+ for (var prop of __getOwnPropSymbols$U(source)) {
34466
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$U.call(source, prop))
34461
34467
  target[prop] = source[prop];
34462
34468
  }
34463
34469
  return target;
34464
34470
  };
34465
- var __async$_ = (__this, __arguments, generator) => {
34471
+ var __async$$ = (__this, __arguments, generator) => {
34466
34472
  return new Promise((resolve, reject) => {
34467
34473
  var fulfilled = (value) => {
34468
34474
  try {
@@ -34485,7 +34491,7 @@ var __async$_ = (__this, __arguments, generator) => {
34485
34491
  const logger$1 = E({
34486
34492
  level: process.env.NODE_ENV === "production" ? "fatal" : "info",
34487
34493
  name: "shipengine-api",
34488
- serializers: __spreadProps$H(__spreadValues$K({}, k), {
34494
+ serializers: __spreadProps$I(__spreadValues$L({}, k), {
34489
34495
  req: (req) => ({
34490
34496
  headers: req.headers,
34491
34497
  method: req.method,
@@ -34506,11 +34512,11 @@ const logger$1 = E({
34506
34512
  ]
34507
34513
  });
34508
34514
  class ShipEngineAPI {
34509
- constructor(token, { baseURL, headers, getToken, getSandboxToken, onApiError }) {
34515
+ constructor(token, { baseURL, debug = true, headers, getToken, getSandboxToken, onApiError }) {
34510
34516
  this.getSandboxToken = getSandboxToken;
34511
34517
  const client = axios.create({
34512
34518
  baseURL,
34513
- headers: __spreadProps$H(__spreadValues$K({}, headers), {
34519
+ headers: __spreadProps$I(__spreadValues$L({}, headers), {
34514
34520
  "Content-Type": "application/json"
34515
34521
  }),
34516
34522
  paramsSerializer: (params) => lib.stringify(decamelizeKeys(params), { arrayFormat: "brackets" }),
@@ -34550,7 +34556,7 @@ class ShipEngineAPI {
34550
34556
  });
34551
34557
  client.defaults.headers.common["Authorization"] = `Bearer ${token}`;
34552
34558
  client.interceptors.request.use(
34553
- (config) => __async$_(this, null, function* () {
34559
+ (config) => __async$$(this, null, function* () {
34554
34560
  if (config.isSandbox) {
34555
34561
  if (!this.sandboxToken) {
34556
34562
  this.sandboxToken = yield getSandboxToken == null ? void 0 : getSandboxToken();
@@ -34567,27 +34573,31 @@ class ShipEngineAPI {
34567
34573
  client.interceptors.response.use(
34568
34574
  (res) => {
34569
34575
  var _a;
34570
- logger$1.info(
34571
- { req: res.config, res },
34572
- "%s %s: %s %s",
34573
- (_a = res.config.method) == null ? void 0 : _a.toUpperCase(),
34574
- res.config.url,
34575
- res.status,
34576
- res.statusText
34577
- );
34576
+ if (debug) {
34577
+ logger$1.info(
34578
+ { req: res.config, res },
34579
+ "%s %s: %s %s",
34580
+ (_a = res.config.method) == null ? void 0 : _a.toUpperCase(),
34581
+ res.config.url,
34582
+ res.status,
34583
+ res.statusText
34584
+ );
34585
+ }
34578
34586
  return res;
34579
34587
  },
34580
- (err) => __async$_(this, null, function* () {
34588
+ (err) => __async$$(this, null, function* () {
34581
34589
  var _a, _b, _c, _d, _e;
34582
- logger$1.error(
34583
- { err, req: err.config, res: err.response },
34584
- "%s %s: %s %s - %s",
34585
- (_b = (_a = err.config) == null ? void 0 : _a.method) == null ? void 0 : _b.toUpperCase(),
34586
- (_c = err.config) == null ? void 0 : _c.url,
34587
- (_d = err.response) == null ? void 0 : _d.status,
34588
- (_e = err.response) == null ? void 0 : _e.statusText,
34589
- err.message
34590
- );
34590
+ if (debug) {
34591
+ logger$1.error(
34592
+ { err, req: err.config, res: err.response },
34593
+ "%s %s: %s %s - %s",
34594
+ (_b = (_a = err.config) == null ? void 0 : _a.method) == null ? void 0 : _b.toUpperCase(),
34595
+ (_c = err.config) == null ? void 0 : _c.url,
34596
+ (_d = err.response) == null ? void 0 : _d.status,
34597
+ (_e = err.response) == null ? void 0 : _e.statusText,
34598
+ err.message
34599
+ );
34600
+ }
34591
34601
  if (isInvalidTokenError(err)) {
34592
34602
  const token2 = yield err.config.isSandbox ? getSandboxToken == null ? void 0 : getSandboxToken() : getToken();
34593
34603
  const config = err.config;
@@ -34624,7 +34634,7 @@ class ShipEngineAPI {
34624
34634
  * that token (also known as Seller ID)
34625
34635
  */
34626
34636
  getTenant(isSandbox) {
34627
- return __async$_(this, null, function* () {
34637
+ return __async$$(this, null, function* () {
34628
34638
  var _a;
34629
34639
  if (!isSandbox) {
34630
34640
  return this.getTenantFromToken(this.token);
@@ -34874,6 +34884,7 @@ const ShipEngineContext = React.createContext(void 0);
34874
34884
  const ShipEngine = ({
34875
34885
  baseURL,
34876
34886
  children,
34887
+ debug,
34877
34888
  headers,
34878
34889
  getSandboxToken,
34879
34890
  getToken,
@@ -34890,6 +34901,7 @@ const ShipEngine = ({
34890
34901
  const token = getToken();
34891
34902
  const commonClientProps = {
34892
34903
  baseURL,
34904
+ debug,
34893
34905
  getSandboxToken,
34894
34906
  getToken,
34895
34907
  headers: headers != null ? headers : {},
@@ -34934,25 +34946,25 @@ const delay = (ms) => new Promise((resolve) => {
34934
34946
 
34935
34947
  const onError = (_errors) => _default();
34936
34948
 
34937
- var __defProp$J = Object.defineProperty;
34938
- var __defProps$G = Object.defineProperties;
34939
- var __getOwnPropDescs$G = Object.getOwnPropertyDescriptors;
34940
- var __getOwnPropSymbols$S = Object.getOwnPropertySymbols;
34941
- var __hasOwnProp$S = Object.prototype.hasOwnProperty;
34942
- var __propIsEnum$S = Object.prototype.propertyIsEnumerable;
34943
- var __defNormalProp$J = (obj, key, value) => key in obj ? __defProp$J(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
34944
- var __spreadValues$J = (a, b) => {
34949
+ var __defProp$K = Object.defineProperty;
34950
+ var __defProps$H = Object.defineProperties;
34951
+ var __getOwnPropDescs$H = Object.getOwnPropertyDescriptors;
34952
+ var __getOwnPropSymbols$T = Object.getOwnPropertySymbols;
34953
+ var __hasOwnProp$T = Object.prototype.hasOwnProperty;
34954
+ var __propIsEnum$T = Object.prototype.propertyIsEnumerable;
34955
+ var __defNormalProp$K = (obj, key, value) => key in obj ? __defProp$K(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
34956
+ var __spreadValues$K = (a, b) => {
34945
34957
  for (var prop in b || (b = {}))
34946
- if (__hasOwnProp$S.call(b, prop))
34947
- __defNormalProp$J(a, prop, b[prop]);
34948
- if (__getOwnPropSymbols$S)
34949
- for (var prop of __getOwnPropSymbols$S(b)) {
34950
- if (__propIsEnum$S.call(b, prop))
34951
- __defNormalProp$J(a, prop, b[prop]);
34958
+ if (__hasOwnProp$T.call(b, prop))
34959
+ __defNormalProp$K(a, prop, b[prop]);
34960
+ if (__getOwnPropSymbols$T)
34961
+ for (var prop of __getOwnPropSymbols$T(b)) {
34962
+ if (__propIsEnum$T.call(b, prop))
34963
+ __defNormalProp$K(a, prop, b[prop]);
34952
34964
  }
34953
34965
  return a;
34954
34966
  };
34955
- var __spreadProps$G = (a, b) => __defProps$G(a, __getOwnPropDescs$G(b));
34967
+ var __spreadProps$H = (a, b) => __defProps$H(a, __getOwnPropDescs$H(b));
34956
34968
  const streams = [];
34957
34969
  if (process.env.NODE_ENV === "production") {
34958
34970
  streams.push({
@@ -34961,7 +34973,7 @@ if (process.env.NODE_ENV === "production") {
34961
34973
  }
34962
34974
  const logger = E({
34963
34975
  name: "shipengine",
34964
- serializers: __spreadProps$G(__spreadValues$J({}, k), {
34976
+ serializers: __spreadProps$H(__spreadValues$K({}, k), {
34965
34977
  req: (req) => ({
34966
34978
  headers: req.headers,
34967
34979
  method: req.method,
@@ -34986,7 +34998,7 @@ const retryUntil = (callbackFn, retries = 10, timeoutBetweenAttempts = 1e3) => P
34986
34998
  throw error;
34987
34999
  });
34988
35000
 
34989
- var __async$Z = (__this, __arguments, generator) => {
35001
+ var __async$_ = (__this, __arguments, generator) => {
34990
35002
  return new Promise((resolve, reject) => {
34991
35003
  var fulfilled = (value) => {
34992
35004
  try {
@@ -35009,7 +35021,7 @@ var __async$Z = (__this, __arguments, generator) => {
35009
35021
  const useCreateAccountImage = () => {
35010
35022
  const { client } = useShipEngine();
35011
35023
  return reactQuery.useMutation({
35012
- mutationFn: (data) => __async$Z(void 0, null, function* () {
35024
+ mutationFn: (data) => __async$_(void 0, null, function* () {
35013
35025
  const result = yield client.accountSettings.createImage(data);
35014
35026
  return result.data;
35015
35027
  }),
@@ -35018,7 +35030,7 @@ const useCreateAccountImage = () => {
35018
35030
  });
35019
35031
  };
35020
35032
 
35021
- var __async$Y = (__this, __arguments, generator) => {
35033
+ var __async$Z = (__this, __arguments, generator) => {
35022
35034
  return new Promise((resolve, reject) => {
35023
35035
  var fulfilled = (value) => {
35024
35036
  try {
@@ -35041,7 +35053,7 @@ var __async$Y = (__this, __arguments, generator) => {
35041
35053
  const useDeleteAccountImage = () => {
35042
35054
  const { client } = useShipEngine();
35043
35055
  return reactQuery.useMutation({
35044
- mutationFn: (labelImageId) => __async$Y(void 0, null, function* () {
35056
+ mutationFn: (labelImageId) => __async$Z(void 0, null, function* () {
35045
35057
  const result = yield client.accountSettings.deleteImage(labelImageId);
35046
35058
  return result.data;
35047
35059
  }),
@@ -35070,7 +35082,7 @@ const useGetAccountSettings = () => {
35070
35082
  });
35071
35083
  };
35072
35084
 
35073
- var __async$X = (__this, __arguments, generator) => {
35085
+ var __async$Y = (__this, __arguments, generator) => {
35074
35086
  return new Promise((resolve, reject) => {
35075
35087
  var fulfilled = (value) => {
35076
35088
  try {
@@ -35093,7 +35105,7 @@ var __async$X = (__this, __arguments, generator) => {
35093
35105
  const useUpdateAccountImage = () => {
35094
35106
  const { client } = useShipEngine();
35095
35107
  return reactQuery.useMutation({
35096
- mutationFn: (data) => __async$X(void 0, null, function* () {
35108
+ mutationFn: (data) => __async$Y(void 0, null, function* () {
35097
35109
  const result = yield client.accountSettings.updateImage(data);
35098
35110
  return result.data;
35099
35111
  }),
@@ -35102,7 +35114,7 @@ const useUpdateAccountImage = () => {
35102
35114
  });
35103
35115
  };
35104
35116
 
35105
- var __async$W = (__this, __arguments, generator) => {
35117
+ var __async$X = (__this, __arguments, generator) => {
35106
35118
  return new Promise((resolve, reject) => {
35107
35119
  var fulfilled = (value) => {
35108
35120
  try {
@@ -35125,7 +35137,7 @@ var __async$W = (__this, __arguments, generator) => {
35125
35137
  const useUpdateAccountSettings = () => {
35126
35138
  const { client } = useShipEngine();
35127
35139
  return reactQuery.useMutation({
35128
- mutationFn: (settings) => __async$W(void 0, null, function* () {
35140
+ mutationFn: (settings) => __async$X(void 0, null, function* () {
35129
35141
  const result = yield client.accountSettings.update(settings);
35130
35142
  return result.data;
35131
35143
  }),
@@ -35134,6 +35146,35 @@ const useUpdateAccountSettings = () => {
35134
35146
  });
35135
35147
  };
35136
35148
 
35149
+ var __defProp$J = Object.defineProperty;
35150
+ var __defProps$G = Object.defineProperties;
35151
+ var __getOwnPropDescs$G = Object.getOwnPropertyDescriptors;
35152
+ var __getOwnPropSymbols$S = Object.getOwnPropertySymbols;
35153
+ var __hasOwnProp$S = Object.prototype.hasOwnProperty;
35154
+ var __propIsEnum$S = Object.prototype.propertyIsEnumerable;
35155
+ var __defNormalProp$J = (obj, key, value) => key in obj ? __defProp$J(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
35156
+ var __spreadValues$J = (a, b) => {
35157
+ for (var prop in b || (b = {}))
35158
+ if (__hasOwnProp$S.call(b, prop))
35159
+ __defNormalProp$J(a, prop, b[prop]);
35160
+ if (__getOwnPropSymbols$S)
35161
+ for (var prop of __getOwnPropSymbols$S(b)) {
35162
+ if (__propIsEnum$S.call(b, prop))
35163
+ __defNormalProp$J(a, prop, b[prop]);
35164
+ }
35165
+ return a;
35166
+ };
35167
+ var __spreadProps$G = (a, b) => __defProps$G(a, __getOwnPropDescs$G(b));
35168
+ const useListAccountAddons = (params) => {
35169
+ const { client } = useShipEngine();
35170
+ return reactQuery.useQuery(__spreadProps$G(__spreadValues$J({}, params), {
35171
+ onError,
35172
+ queryFn: () => client.accountAddons.list(),
35173
+ queryKey: ["useListAccountAddons"],
35174
+ select: (result) => result.data.addons
35175
+ }));
35176
+ };
35177
+
35137
35178
  var __defProp$I = Object.defineProperty;
35138
35179
  var __defProps$F = Object.defineProperties;
35139
35180
  var __getOwnPropDescs$F = Object.getOwnPropertyDescriptors;
@@ -35153,13 +35194,35 @@ var __spreadValues$I = (a, b) => {
35153
35194
  return a;
35154
35195
  };
35155
35196
  var __spreadProps$F = (a, b) => __defProps$F(a, __getOwnPropDescs$F(b));
35156
- const useListAccountAddons = (params) => {
35197
+ var __async$W = (__this, __arguments, generator) => {
35198
+ return new Promise((resolve, reject) => {
35199
+ var fulfilled = (value) => {
35200
+ try {
35201
+ step(generator.next(value));
35202
+ } catch (e) {
35203
+ reject(e);
35204
+ }
35205
+ };
35206
+ var rejected = (value) => {
35207
+ try {
35208
+ step(generator.throw(value));
35209
+ } catch (e) {
35210
+ reject(e);
35211
+ }
35212
+ };
35213
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
35214
+ step((generator = generator.apply(__this, __arguments)).next());
35215
+ });
35216
+ };
35217
+ const useEnableAccountAddon = (params) => {
35157
35218
  const { client } = useShipEngine();
35158
- return reactQuery.useQuery(__spreadProps$F(__spreadValues$I({}, params), {
35159
- onError,
35160
- queryFn: () => client.accountAddons.list(),
35161
- queryKey: ["useListAccountAddons"],
35162
- select: (result) => result.data.addons
35219
+ return reactQuery.useMutation(__spreadProps$F(__spreadValues$I({}, params), {
35220
+ mutationFn: (addonType) => __async$W(void 0, null, function* () {
35221
+ const result = yield client.accountAddons.enable(addonType);
35222
+ return result.data;
35223
+ }),
35224
+ mutationKey: ["useEnableAccountAddon"],
35225
+ onError
35163
35226
  }));
35164
35227
  };
35165
35228
 
@@ -40189,6 +40252,7 @@ exports.useDeleteWarehouse = useDeleteWarehouse;
40189
40252
  exports.useDeleteWebhook = useDeleteWebhook;
40190
40253
  exports.useDownloadRateCard = useDownloadRateCard;
40191
40254
  exports.useEditShippingRule = useEditShippingRule;
40255
+ exports.useEnableAccountAddon = useEnableAccountAddon;
40192
40256
  exports.useExportLabels = useExportLabels;
40193
40257
  exports.useExportShipments = useExportShipments;
40194
40258
  exports.useFundingSourcesAddFunds = useFundingSourcesAddFunds;