@shipengine/alchemy 5.1.7 → 5.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.js +120 -45
  2. package/index.mjs +118 -46
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -10786,17 +10786,17 @@ var AccountBillingPlanChangeType = /* @__PURE__ */ ((AccountBillingPlanChangeTyp
10786
10786
  return AccountBillingPlanChangeType2;
10787
10787
  })(AccountBillingPlanChangeType || {});
10788
10788
 
10789
- var __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
10790
- var __hasOwnProp$j = Object.prototype.hasOwnProperty;
10791
- var __propIsEnum$j = Object.prototype.propertyIsEnumerable;
10789
+ var __getOwnPropSymbols$k = Object.getOwnPropertySymbols;
10790
+ var __hasOwnProp$k = Object.prototype.hasOwnProperty;
10791
+ var __propIsEnum$k = Object.prototype.propertyIsEnumerable;
10792
10792
  var __objRest$e = (source, exclude) => {
10793
10793
  var target = {};
10794
10794
  for (var prop in source)
10795
- if (__hasOwnProp$j.call(source, prop) && exclude.indexOf(prop) < 0)
10795
+ if (__hasOwnProp$k.call(source, prop) && exclude.indexOf(prop) < 0)
10796
10796
  target[prop] = source[prop];
10797
- if (source != null && __getOwnPropSymbols$j)
10798
- for (var prop of __getOwnPropSymbols$j(source)) {
10799
- if (exclude.indexOf(prop) < 0 && __propIsEnum$j.call(source, prop))
10797
+ if (source != null && __getOwnPropSymbols$k)
10798
+ for (var prop of __getOwnPropSymbols$k(source)) {
10799
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$k.call(source, prop))
10800
10800
  target[prop] = source[prop];
10801
10801
  }
10802
10802
  return target;
@@ -10918,17 +10918,17 @@ const types = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
10918
10918
  RateCardStatus
10919
10919
  }, Symbol.toStringTag, { value: 'Module' }));
10920
10920
 
10921
- var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
10922
- var __hasOwnProp$i = Object.prototype.hasOwnProperty;
10923
- var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
10921
+ var __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
10922
+ var __hasOwnProp$j = Object.prototype.hasOwnProperty;
10923
+ var __propIsEnum$j = Object.prototype.propertyIsEnumerable;
10924
10924
  var __objRest$d = (source, exclude) => {
10925
10925
  var target = {};
10926
10926
  for (var prop in source)
10927
- if (__hasOwnProp$i.call(source, prop) && exclude.indexOf(prop) < 0)
10927
+ if (__hasOwnProp$j.call(source, prop) && exclude.indexOf(prop) < 0)
10928
10928
  target[prop] = source[prop];
10929
- if (source != null && __getOwnPropSymbols$i)
10930
- for (var prop of __getOwnPropSymbols$i(source)) {
10931
- if (exclude.indexOf(prop) < 0 && __propIsEnum$i.call(source, prop))
10929
+ if (source != null && __getOwnPropSymbols$j)
10930
+ for (var prop of __getOwnPropSymbols$j(source)) {
10931
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$j.call(source, prop))
10932
10932
  target[prop] = source[prop];
10933
10933
  }
10934
10934
  return target;
@@ -13702,21 +13702,21 @@ const getEndUserIpAddress = () => __async$E(void 0, null, function* () {
13702
13702
  }
13703
13703
  });
13704
13704
 
13705
- var __defProp$6 = Object.defineProperty;
13705
+ var __defProp$7 = Object.defineProperty;
13706
13706
  var __defProps$3 = Object.defineProperties;
13707
13707
  var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
13708
- var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
13709
- var __hasOwnProp$h = Object.prototype.hasOwnProperty;
13710
- var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
13711
- var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13712
- var __spreadValues$6 = (a, b) => {
13708
+ var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
13709
+ var __hasOwnProp$i = Object.prototype.hasOwnProperty;
13710
+ var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
13711
+ var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13712
+ var __spreadValues$7 = (a, b) => {
13713
13713
  for (var prop in b || (b = {}))
13714
- if (__hasOwnProp$h.call(b, prop))
13715
- __defNormalProp$6(a, prop, b[prop]);
13716
- if (__getOwnPropSymbols$h)
13717
- for (var prop of __getOwnPropSymbols$h(b)) {
13718
- if (__propIsEnum$h.call(b, prop))
13719
- __defNormalProp$6(a, prop, b[prop]);
13714
+ if (__hasOwnProp$i.call(b, prop))
13715
+ __defNormalProp$7(a, prop, b[prop]);
13716
+ if (__getOwnPropSymbols$i)
13717
+ for (var prop of __getOwnPropSymbols$i(b)) {
13718
+ if (__propIsEnum$i.call(b, prop))
13719
+ __defNormalProp$7(a, prop, b[prop]);
13720
13720
  }
13721
13721
  return a;
13722
13722
  };
@@ -13724,11 +13724,11 @@ var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
13724
13724
  var __objRest$c = (source, exclude) => {
13725
13725
  var target = {};
13726
13726
  for (var prop in source)
13727
- if (__hasOwnProp$h.call(source, prop) && exclude.indexOf(prop) < 0)
13727
+ if (__hasOwnProp$i.call(source, prop) && exclude.indexOf(prop) < 0)
13728
13728
  target[prop] = source[prop];
13729
- if (source != null && __getOwnPropSymbols$h)
13730
- for (var prop of __getOwnPropSymbols$h(source)) {
13731
- if (exclude.indexOf(prop) < 0 && __propIsEnum$h.call(source, prop))
13729
+ if (source != null && __getOwnPropSymbols$i)
13730
+ for (var prop of __getOwnPropSymbols$i(source)) {
13731
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$i.call(source, prop))
13732
13732
  target[prop] = source[prop];
13733
13733
  }
13734
13734
  return target;
@@ -13776,7 +13776,7 @@ class CarriersAPI {
13776
13776
  const endUserIpAddress = yield getEndUserIpAddress();
13777
13777
  if (!endUserIpAddress)
13778
13778
  return Promise.reject([new CodedError("Unable to get IP address")]);
13779
- return yield this.client.post(`/v1/registration/${carrierCode}`, __spreadProps$3(__spreadValues$6({}, connection), {
13779
+ return yield this.client.post(`/v1/registration/${carrierCode}`, __spreadProps$3(__spreadValues$7({}, connection), {
13780
13780
  endUserIpAddress
13781
13781
  }));
13782
13782
  });
@@ -16087,19 +16087,19 @@ class CustomPackagesAPI {
16087
16087
  }
16088
16088
  }
16089
16089
 
16090
- var __defProp$5 = Object.defineProperty;
16091
- var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
16092
- var __hasOwnProp$g = Object.prototype.hasOwnProperty;
16093
- var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
16094
- var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16095
- var __spreadValues$5 = (a, b) => {
16090
+ var __defProp$6 = Object.defineProperty;
16091
+ var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
16092
+ var __hasOwnProp$h = Object.prototype.hasOwnProperty;
16093
+ var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
16094
+ var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16095
+ var __spreadValues$6 = (a, b) => {
16096
16096
  for (var prop in b || (b = {}))
16097
- if (__hasOwnProp$g.call(b, prop))
16098
- __defNormalProp$5(a, prop, b[prop]);
16099
- if (__getOwnPropSymbols$g)
16100
- for (var prop of __getOwnPropSymbols$g(b)) {
16101
- if (__propIsEnum$g.call(b, prop))
16102
- __defNormalProp$5(a, prop, b[prop]);
16097
+ if (__hasOwnProp$h.call(b, prop))
16098
+ __defNormalProp$6(a, prop, b[prop]);
16099
+ if (__getOwnPropSymbols$h)
16100
+ for (var prop of __getOwnPropSymbols$h(b)) {
16101
+ if (__propIsEnum$h.call(b, prop))
16102
+ __defNormalProp$6(a, prop, b[prop]);
16103
16103
  }
16104
16104
  return a;
16105
16105
  };
@@ -16146,7 +16146,7 @@ class FundingSourcesAPI {
16146
16146
  const endUserIpAddress = yield getEndUserIpAddress();
16147
16147
  if (!endUserIpAddress)
16148
16148
  return Promise.reject([new CodedError("Unable to get IP address")]);
16149
- return yield this.client.post("/v1/funding_sources", __spreadValues$5({
16149
+ return yield this.client.post("/v1/funding_sources", __spreadValues$6({
16150
16150
  endUserIpAddress
16151
16151
  }, createFundingSource));
16152
16152
  });
@@ -16176,7 +16176,7 @@ class FundingSourcesAPI {
16176
16176
  const endUserIpAddress = yield getEndUserIpAddress();
16177
16177
  if (!endUserIpAddress)
16178
16178
  return Promise.reject([new CodedError("Unable to get IP address")]);
16179
- return yield this.client.post("/v1/registration/funding_source", __spreadValues$5({
16179
+ return yield this.client.post("/v1/registration/funding_source", __spreadValues$6({
16180
16180
  endUserIpAddress
16181
16181
  }, carrier));
16182
16182
  });
@@ -16451,6 +16451,42 @@ class SalesOrdersAPI {
16451
16451
  }
16452
16452
  }
16453
16453
 
16454
+ var __defProp$5 = Object.defineProperty;
16455
+ var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
16456
+ var __hasOwnProp$g = Object.prototype.hasOwnProperty;
16457
+ var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
16458
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16459
+ var __spreadValues$5 = (a, b) => {
16460
+ for (var prop in b || (b = {}))
16461
+ if (__hasOwnProp$g.call(b, prop))
16462
+ __defNormalProp$5(a, prop, b[prop]);
16463
+ if (__getOwnPropSymbols$g)
16464
+ for (var prop of __getOwnPropSymbols$g(b)) {
16465
+ if (__propIsEnum$g.call(b, prop))
16466
+ __defNormalProp$5(a, prop, b[prop]);
16467
+ }
16468
+ return a;
16469
+ };
16470
+ class ServicePointsAPI {
16471
+ constructor(client) {
16472
+ /**
16473
+ * The `list` method returns a list of service points based on several factors
16474
+ * A providers list that must contain at least one provider but no more than five
16475
+ * Either an address, coordinates, or an address query
16476
+ */
16477
+ this.list = (options) => {
16478
+ return this.client.post("/v1/service_points/list", __spreadValues$5({}, options));
16479
+ };
16480
+ /**
16481
+ * Get a specific service point by its carrier code, country code, and id
16482
+ */
16483
+ this.get = ({ carrierCode, countryCode, id }) => {
16484
+ return this.client.get(`/v1/service_points/${carrierCode}/${countryCode}/${id}`);
16485
+ };
16486
+ this.client = client;
16487
+ }
16488
+ }
16489
+
16454
16490
  var __async$B = (__this, __arguments, generator) => {
16455
16491
  return new Promise((resolve, reject) => {
16456
16492
  var fulfilled = (value) => {
@@ -16868,6 +16904,9 @@ class ShipEngineAPI {
16868
16904
  get salesOrders() {
16869
16905
  return new SalesOrdersAPI(this.client);
16870
16906
  }
16907
+ get servicePoints() {
16908
+ return new ServicePointsAPI(this.client);
16909
+ }
16871
16910
  /**
16872
16911
  * The `shipments` method provides access to the Shipment endpoints in ShipEngine
16873
16912
  * API. e.g. Create Shipment, Get Shipment, etc.
@@ -18855,6 +18894,39 @@ const useUpdateAccountBillingPlan = () => {
18855
18894
  });
18856
18895
  };
18857
18896
 
18897
+ const useListServicePoints = (options) => {
18898
+ const { client } = useShipEngine();
18899
+ return reactQuery.useQuery({
18900
+ onError,
18901
+ queryFn: () => client.servicePoints.list(options),
18902
+ queryKey: ["useListServicePoints"],
18903
+ select: (result) => result.data
18904
+ });
18905
+ };
18906
+
18907
+ const useGetServicePoint = ({
18908
+ carrierCode,
18909
+ countryCode,
18910
+ id
18911
+ }) => {
18912
+ const { client } = useShipEngine();
18913
+ return reactQuery.useQuery({
18914
+ enabled: !!carrierCode && !!countryCode && !!id,
18915
+ onError,
18916
+ queryFn: () => {
18917
+ if (carrierCode === void 0)
18918
+ return Promise.reject(new Error("carrierCode required"));
18919
+ if (countryCode === void 0)
18920
+ return Promise.reject(new Error("countryCode required"));
18921
+ if (id === void 0)
18922
+ return Promise.reject(new Error("id required"));
18923
+ return client.servicePoints.get({ carrierCode, countryCode, id });
18924
+ },
18925
+ queryKey: ["useGetServicePoint", carrierCode, countryCode, id],
18926
+ select: (result) => result.data
18927
+ });
18928
+ };
18929
+
18858
18930
  const fallbackThemeData = {
18859
18931
  borderRadius: {
18860
18932
  L: "16px",
@@ -20002,6 +20074,7 @@ exports.RatesAPI = RatesAPI;
20002
20074
  exports.SE = types;
20003
20075
  exports.SalesOrderShipmentsAPI = SalesOrderShipmentsAPI;
20004
20076
  exports.SalesOrdersAPI = SalesOrdersAPI;
20077
+ exports.ServicePointsAPI = ServicePointsAPI;
20005
20078
  exports.ShipEngine = ShipEngine;
20006
20079
  exports.ShipEngineAPI = ShipEngineAPI;
20007
20080
  exports.ShipEngineContext = ShipEngineContext;
@@ -20060,6 +20133,7 @@ exports.useGetPackageRatingGroupByCarrier = useGetPackageRatingGroupByCarrier;
20060
20133
  exports.useGetRateCardById = useGetRateCardById;
20061
20134
  exports.useGetSalesOrder = useGetSalesOrder;
20062
20135
  exports.useGetSalesOrderShipment = useGetSalesOrderShipment;
20136
+ exports.useGetServicePoint = useGetServicePoint;
20063
20137
  exports.useGetServicesByCarrier = useGetServicesByCarrier;
20064
20138
  exports.useGetShipment = useGetShipment;
20065
20139
  exports.useGetShipmentRates = useGetShipmentRates;
@@ -20077,6 +20151,7 @@ exports.useListOrderSources = useListOrderSources;
20077
20151
  exports.useListRateCards = useListRateCards;
20078
20152
  exports.useListSalesOrderShipments = useListSalesOrderShipments;
20079
20153
  exports.useListSalesOrders = useListSalesOrders;
20154
+ exports.useListServicePoints = useListServicePoints;
20080
20155
  exports.useListShipments = useListShipments;
20081
20156
  exports.useListShippingRules = useListShippingRules;
20082
20157
  exports.useListWarehouses = useListWarehouses;
package/index.mjs CHANGED
@@ -10764,17 +10764,17 @@ var AccountBillingPlanChangeType = /* @__PURE__ */ ((AccountBillingPlanChangeTyp
10764
10764
  return AccountBillingPlanChangeType2;
10765
10765
  })(AccountBillingPlanChangeType || {});
10766
10766
 
10767
- var __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
10768
- var __hasOwnProp$j = Object.prototype.hasOwnProperty;
10769
- var __propIsEnum$j = Object.prototype.propertyIsEnumerable;
10767
+ var __getOwnPropSymbols$k = Object.getOwnPropertySymbols;
10768
+ var __hasOwnProp$k = Object.prototype.hasOwnProperty;
10769
+ var __propIsEnum$k = Object.prototype.propertyIsEnumerable;
10770
10770
  var __objRest$e = (source, exclude) => {
10771
10771
  var target = {};
10772
10772
  for (var prop in source)
10773
- if (__hasOwnProp$j.call(source, prop) && exclude.indexOf(prop) < 0)
10773
+ if (__hasOwnProp$k.call(source, prop) && exclude.indexOf(prop) < 0)
10774
10774
  target[prop] = source[prop];
10775
- if (source != null && __getOwnPropSymbols$j)
10776
- for (var prop of __getOwnPropSymbols$j(source)) {
10777
- if (exclude.indexOf(prop) < 0 && __propIsEnum$j.call(source, prop))
10775
+ if (source != null && __getOwnPropSymbols$k)
10776
+ for (var prop of __getOwnPropSymbols$k(source)) {
10777
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$k.call(source, prop))
10778
10778
  target[prop] = source[prop];
10779
10779
  }
10780
10780
  return target;
@@ -10896,17 +10896,17 @@ const types = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
10896
10896
  RateCardStatus
10897
10897
  }, Symbol.toStringTag, { value: 'Module' }));
10898
10898
 
10899
- var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
10900
- var __hasOwnProp$i = Object.prototype.hasOwnProperty;
10901
- var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
10899
+ var __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
10900
+ var __hasOwnProp$j = Object.prototype.hasOwnProperty;
10901
+ var __propIsEnum$j = Object.prototype.propertyIsEnumerable;
10902
10902
  var __objRest$d = (source, exclude) => {
10903
10903
  var target = {};
10904
10904
  for (var prop in source)
10905
- if (__hasOwnProp$i.call(source, prop) && exclude.indexOf(prop) < 0)
10905
+ if (__hasOwnProp$j.call(source, prop) && exclude.indexOf(prop) < 0)
10906
10906
  target[prop] = source[prop];
10907
- if (source != null && __getOwnPropSymbols$i)
10908
- for (var prop of __getOwnPropSymbols$i(source)) {
10909
- if (exclude.indexOf(prop) < 0 && __propIsEnum$i.call(source, prop))
10907
+ if (source != null && __getOwnPropSymbols$j)
10908
+ for (var prop of __getOwnPropSymbols$j(source)) {
10909
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$j.call(source, prop))
10910
10910
  target[prop] = source[prop];
10911
10911
  }
10912
10912
  return target;
@@ -13680,21 +13680,21 @@ const getEndUserIpAddress = () => __async$E(void 0, null, function* () {
13680
13680
  }
13681
13681
  });
13682
13682
 
13683
- var __defProp$6 = Object.defineProperty;
13683
+ var __defProp$7 = Object.defineProperty;
13684
13684
  var __defProps$3 = Object.defineProperties;
13685
13685
  var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
13686
- var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
13687
- var __hasOwnProp$h = Object.prototype.hasOwnProperty;
13688
- var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
13689
- var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13690
- var __spreadValues$6 = (a, b) => {
13686
+ var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
13687
+ var __hasOwnProp$i = Object.prototype.hasOwnProperty;
13688
+ var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
13689
+ var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13690
+ var __spreadValues$7 = (a, b) => {
13691
13691
  for (var prop in b || (b = {}))
13692
- if (__hasOwnProp$h.call(b, prop))
13693
- __defNormalProp$6(a, prop, b[prop]);
13694
- if (__getOwnPropSymbols$h)
13695
- for (var prop of __getOwnPropSymbols$h(b)) {
13696
- if (__propIsEnum$h.call(b, prop))
13697
- __defNormalProp$6(a, prop, b[prop]);
13692
+ if (__hasOwnProp$i.call(b, prop))
13693
+ __defNormalProp$7(a, prop, b[prop]);
13694
+ if (__getOwnPropSymbols$i)
13695
+ for (var prop of __getOwnPropSymbols$i(b)) {
13696
+ if (__propIsEnum$i.call(b, prop))
13697
+ __defNormalProp$7(a, prop, b[prop]);
13698
13698
  }
13699
13699
  return a;
13700
13700
  };
@@ -13702,11 +13702,11 @@ var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
13702
13702
  var __objRest$c = (source, exclude) => {
13703
13703
  var target = {};
13704
13704
  for (var prop in source)
13705
- if (__hasOwnProp$h.call(source, prop) && exclude.indexOf(prop) < 0)
13705
+ if (__hasOwnProp$i.call(source, prop) && exclude.indexOf(prop) < 0)
13706
13706
  target[prop] = source[prop];
13707
- if (source != null && __getOwnPropSymbols$h)
13708
- for (var prop of __getOwnPropSymbols$h(source)) {
13709
- if (exclude.indexOf(prop) < 0 && __propIsEnum$h.call(source, prop))
13707
+ if (source != null && __getOwnPropSymbols$i)
13708
+ for (var prop of __getOwnPropSymbols$i(source)) {
13709
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$i.call(source, prop))
13710
13710
  target[prop] = source[prop];
13711
13711
  }
13712
13712
  return target;
@@ -13754,7 +13754,7 @@ class CarriersAPI {
13754
13754
  const endUserIpAddress = yield getEndUserIpAddress();
13755
13755
  if (!endUserIpAddress)
13756
13756
  return Promise.reject([new CodedError("Unable to get IP address")]);
13757
- return yield this.client.post(`/v1/registration/${carrierCode}`, __spreadProps$3(__spreadValues$6({}, connection), {
13757
+ return yield this.client.post(`/v1/registration/${carrierCode}`, __spreadProps$3(__spreadValues$7({}, connection), {
13758
13758
  endUserIpAddress
13759
13759
  }));
13760
13760
  });
@@ -16065,19 +16065,19 @@ class CustomPackagesAPI {
16065
16065
  }
16066
16066
  }
16067
16067
 
16068
- var __defProp$5 = Object.defineProperty;
16069
- var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
16070
- var __hasOwnProp$g = Object.prototype.hasOwnProperty;
16071
- var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
16072
- var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16073
- var __spreadValues$5 = (a, b) => {
16068
+ var __defProp$6 = Object.defineProperty;
16069
+ var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
16070
+ var __hasOwnProp$h = Object.prototype.hasOwnProperty;
16071
+ var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
16072
+ var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16073
+ var __spreadValues$6 = (a, b) => {
16074
16074
  for (var prop in b || (b = {}))
16075
- if (__hasOwnProp$g.call(b, prop))
16076
- __defNormalProp$5(a, prop, b[prop]);
16077
- if (__getOwnPropSymbols$g)
16078
- for (var prop of __getOwnPropSymbols$g(b)) {
16079
- if (__propIsEnum$g.call(b, prop))
16080
- __defNormalProp$5(a, prop, b[prop]);
16075
+ if (__hasOwnProp$h.call(b, prop))
16076
+ __defNormalProp$6(a, prop, b[prop]);
16077
+ if (__getOwnPropSymbols$h)
16078
+ for (var prop of __getOwnPropSymbols$h(b)) {
16079
+ if (__propIsEnum$h.call(b, prop))
16080
+ __defNormalProp$6(a, prop, b[prop]);
16081
16081
  }
16082
16082
  return a;
16083
16083
  };
@@ -16124,7 +16124,7 @@ class FundingSourcesAPI {
16124
16124
  const endUserIpAddress = yield getEndUserIpAddress();
16125
16125
  if (!endUserIpAddress)
16126
16126
  return Promise.reject([new CodedError("Unable to get IP address")]);
16127
- return yield this.client.post("/v1/funding_sources", __spreadValues$5({
16127
+ return yield this.client.post("/v1/funding_sources", __spreadValues$6({
16128
16128
  endUserIpAddress
16129
16129
  }, createFundingSource));
16130
16130
  });
@@ -16154,7 +16154,7 @@ class FundingSourcesAPI {
16154
16154
  const endUserIpAddress = yield getEndUserIpAddress();
16155
16155
  if (!endUserIpAddress)
16156
16156
  return Promise.reject([new CodedError("Unable to get IP address")]);
16157
- return yield this.client.post("/v1/registration/funding_source", __spreadValues$5({
16157
+ return yield this.client.post("/v1/registration/funding_source", __spreadValues$6({
16158
16158
  endUserIpAddress
16159
16159
  }, carrier));
16160
16160
  });
@@ -16429,6 +16429,42 @@ class SalesOrdersAPI {
16429
16429
  }
16430
16430
  }
16431
16431
 
16432
+ var __defProp$5 = Object.defineProperty;
16433
+ var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
16434
+ var __hasOwnProp$g = Object.prototype.hasOwnProperty;
16435
+ var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
16436
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16437
+ var __spreadValues$5 = (a, b) => {
16438
+ for (var prop in b || (b = {}))
16439
+ if (__hasOwnProp$g.call(b, prop))
16440
+ __defNormalProp$5(a, prop, b[prop]);
16441
+ if (__getOwnPropSymbols$g)
16442
+ for (var prop of __getOwnPropSymbols$g(b)) {
16443
+ if (__propIsEnum$g.call(b, prop))
16444
+ __defNormalProp$5(a, prop, b[prop]);
16445
+ }
16446
+ return a;
16447
+ };
16448
+ class ServicePointsAPI {
16449
+ constructor(client) {
16450
+ /**
16451
+ * The `list` method returns a list of service points based on several factors
16452
+ * A providers list that must contain at least one provider but no more than five
16453
+ * Either an address, coordinates, or an address query
16454
+ */
16455
+ this.list = (options) => {
16456
+ return this.client.post("/v1/service_points/list", __spreadValues$5({}, options));
16457
+ };
16458
+ /**
16459
+ * Get a specific service point by its carrier code, country code, and id
16460
+ */
16461
+ this.get = ({ carrierCode, countryCode, id }) => {
16462
+ return this.client.get(`/v1/service_points/${carrierCode}/${countryCode}/${id}`);
16463
+ };
16464
+ this.client = client;
16465
+ }
16466
+ }
16467
+
16432
16468
  var __async$B = (__this, __arguments, generator) => {
16433
16469
  return new Promise((resolve, reject) => {
16434
16470
  var fulfilled = (value) => {
@@ -16846,6 +16882,9 @@ class ShipEngineAPI {
16846
16882
  get salesOrders() {
16847
16883
  return new SalesOrdersAPI(this.client);
16848
16884
  }
16885
+ get servicePoints() {
16886
+ return new ServicePointsAPI(this.client);
16887
+ }
16849
16888
  /**
16850
16889
  * The `shipments` method provides access to the Shipment endpoints in ShipEngine
16851
16890
  * API. e.g. Create Shipment, Get Shipment, etc.
@@ -18833,6 +18872,39 @@ const useUpdateAccountBillingPlan = () => {
18833
18872
  });
18834
18873
  };
18835
18874
 
18875
+ const useListServicePoints = (options) => {
18876
+ const { client } = useShipEngine();
18877
+ return useQuery({
18878
+ onError,
18879
+ queryFn: () => client.servicePoints.list(options),
18880
+ queryKey: ["useListServicePoints"],
18881
+ select: (result) => result.data
18882
+ });
18883
+ };
18884
+
18885
+ const useGetServicePoint = ({
18886
+ carrierCode,
18887
+ countryCode,
18888
+ id
18889
+ }) => {
18890
+ const { client } = useShipEngine();
18891
+ return useQuery({
18892
+ enabled: !!carrierCode && !!countryCode && !!id,
18893
+ onError,
18894
+ queryFn: () => {
18895
+ if (carrierCode === void 0)
18896
+ return Promise.reject(new Error("carrierCode required"));
18897
+ if (countryCode === void 0)
18898
+ return Promise.reject(new Error("countryCode required"));
18899
+ if (id === void 0)
18900
+ return Promise.reject(new Error("id required"));
18901
+ return client.servicePoints.get({ carrierCode, countryCode, id });
18902
+ },
18903
+ queryKey: ["useGetServicePoint", carrierCode, countryCode, id],
18904
+ select: (result) => result.data
18905
+ });
18906
+ };
18907
+
18836
18908
  const fallbackThemeData = {
18837
18909
  borderRadius: {
18838
18910
  L: "16px",
@@ -19950,4 +20022,4 @@ const alchemy = {
19950
20022
  createElement
19951
20023
  };
19952
20024
 
19953
- export { AccountSettingsAPI, AddressesAPI, AlchemyContext, AlchemyProvider, AlchemyTestProvider, CarriersAPI, CodedError, ConfirmationType, ConnectionsAPI, CreditCardVendor, Currency, CustomPackagesAPI, CustomsContentsType, CustomsNonDeliveryType, Element, ErrorBoundary, FundingSourcesAPI, InsuranceAPI, InsuranceProviderType, LabelsAPI, MetadataCapability, MetadataRequirement, MetadataSatisfyingFormTypes, OrderSourcesAPI, RateCardStatus, RateCardsAPI, RatesAPI, types as SE, SalesOrderShipmentsAPI, SalesOrdersAPI, ShipEngine, ShipEngineAPI, ShipEngineContext, ShipmentsAPI, ShippingRulesAPI, ThemesAPI, WarehousesAPI, alchemy, alchemy as default, delay, getEmotionCache, getEndUserIpAddress, isCodedError, isCodedErrors, isDataCodedErrors, isInvalidTokenError, logger, onError, parseError, retryUntil, useAddFunds, useAddInsuranceFunds, useAlchemy, useCalculateRates, useConnectCarrier, useCreateAccountImage, useCreateFundingSource, useCreateLabel, useCreateRateCard, useCreateSalesOrderShipment, useCreateShipment, useCreateShippingRule, useCreateWarehouse, useDeactivateOrderSource, useDeleteAccountImage, useDeleteRateCard, useDeleteShippingRule, useDeleteWarehouse, useDownloadRateCard, useEditShippingRule, useFundingSourcesAddFunds, useGetAccountBillingPlan, useGetAccountImages, useGetAccountSettings, useGetAutoFundingConfiguration, useGetCarrierById, useGetCarrierConnectionForm, useGetCountriesByCarrier, useGetCurrenciesByCarrier, useGetFundingSourceById, useGetFundingSourceMetadata, useGetFundingSourceTransactions, useGetInsuranceAccount, useGetLabel, useGetPackageRatingGroupByCarrier, useGetRateCardById, useGetSalesOrder, useGetSalesOrderShipment, useGetServicesByCarrier, useGetShipment, useGetShipmentRates, useGetShippingRuleById, useGetShippingRuleConditionsOptions, useGetThemeById, useGetZonesByCarrier, useI18n, useListCarrierConnections, useListCarriers, useListCustomPackageTypes, useListFundingSources, useListLabels, useListOrderSources, useListRateCards, useListSalesOrderShipments, useListSalesOrders, useListShipments, useListShippingRules, useListWarehouses, useLoadIcons, useNotifySalesOrderShipped, useParseAddress, usePublishRateCard, useRefreshOrderSource, useRefreshOrderSourceAsync, useRegisterCarrier, useShipEngine, useUpdateAccountBillingPlan, useUpdateAccountImage, useUpdateAccountSettings, useUpdateAutoFunding, useUpdateFundingSource, useUpdateRateCard, useUpdateSalesOrderShipment, useUpdateWarehouse, useUploadRateCard, useValidateAddresses, useVoidLabel };
20025
+ export { AccountSettingsAPI, AddressesAPI, AlchemyContext, AlchemyProvider, AlchemyTestProvider, CarriersAPI, CodedError, ConfirmationType, ConnectionsAPI, CreditCardVendor, Currency, CustomPackagesAPI, CustomsContentsType, CustomsNonDeliveryType, Element, ErrorBoundary, FundingSourcesAPI, InsuranceAPI, InsuranceProviderType, LabelsAPI, MetadataCapability, MetadataRequirement, MetadataSatisfyingFormTypes, OrderSourcesAPI, RateCardStatus, RateCardsAPI, RatesAPI, types as SE, SalesOrderShipmentsAPI, SalesOrdersAPI, ServicePointsAPI, ShipEngine, ShipEngineAPI, ShipEngineContext, ShipmentsAPI, ShippingRulesAPI, ThemesAPI, WarehousesAPI, alchemy, alchemy as default, delay, getEmotionCache, getEndUserIpAddress, isCodedError, isCodedErrors, isDataCodedErrors, isInvalidTokenError, logger, onError, parseError, retryUntil, useAddFunds, useAddInsuranceFunds, useAlchemy, useCalculateRates, useConnectCarrier, useCreateAccountImage, useCreateFundingSource, useCreateLabel, useCreateRateCard, useCreateSalesOrderShipment, useCreateShipment, useCreateShippingRule, useCreateWarehouse, useDeactivateOrderSource, useDeleteAccountImage, useDeleteRateCard, useDeleteShippingRule, useDeleteWarehouse, useDownloadRateCard, useEditShippingRule, useFundingSourcesAddFunds, useGetAccountBillingPlan, useGetAccountImages, useGetAccountSettings, useGetAutoFundingConfiguration, useGetCarrierById, useGetCarrierConnectionForm, useGetCountriesByCarrier, useGetCurrenciesByCarrier, useGetFundingSourceById, useGetFundingSourceMetadata, useGetFundingSourceTransactions, useGetInsuranceAccount, useGetLabel, useGetPackageRatingGroupByCarrier, useGetRateCardById, useGetSalesOrder, useGetSalesOrderShipment, useGetServicePoint, useGetServicesByCarrier, useGetShipment, useGetShipmentRates, useGetShippingRuleById, useGetShippingRuleConditionsOptions, useGetThemeById, useGetZonesByCarrier, useI18n, useListCarrierConnections, useListCarriers, useListCustomPackageTypes, useListFundingSources, useListLabels, useListOrderSources, useListRateCards, useListSalesOrderShipments, useListSalesOrders, useListServicePoints, useListShipments, useListShippingRules, useListWarehouses, useLoadIcons, useNotifySalesOrderShipped, useParseAddress, usePublishRateCard, useRefreshOrderSource, useRefreshOrderSourceAsync, useRegisterCarrier, useShipEngine, useUpdateAccountBillingPlan, useUpdateAccountImage, useUpdateAccountSettings, useUpdateAutoFunding, useUpdateFundingSource, useUpdateRateCard, useUpdateSalesOrderShipment, useUpdateWarehouse, useUploadRateCard, useValidateAddresses, useVoidLabel };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/alchemy",
3
- "version": "5.1.7",
3
+ "version": "5.1.9",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {