@shipengine/alchemy 6.0.97 → 6.0.98-next.1

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 +112 -84
  2. package/index.mjs +114 -86
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -10827,17 +10827,17 @@ var FeatureId = /* @__PURE__ */ ((FeatureId2) => {
10827
10827
  return FeatureId2;
10828
10828
  })(FeatureId || {});
10829
10829
 
10830
- var __getOwnPropSymbols$18 = Object.getOwnPropertySymbols;
10831
- var __hasOwnProp$18 = Object.prototype.hasOwnProperty;
10832
- var __propIsEnum$18 = Object.prototype.propertyIsEnumerable;
10833
- var __objRest$y = (source, exclude) => {
10830
+ var __getOwnPropSymbols$19 = Object.getOwnPropertySymbols;
10831
+ var __hasOwnProp$19 = Object.prototype.hasOwnProperty;
10832
+ var __propIsEnum$19 = Object.prototype.propertyIsEnumerable;
10833
+ var __objRest$z = (source, exclude) => {
10834
10834
  var target = {};
10835
10835
  for (var prop in source)
10836
- if (__hasOwnProp$18.call(source, prop) && exclude.indexOf(prop) < 0)
10836
+ if (__hasOwnProp$19.call(source, prop) && exclude.indexOf(prop) < 0)
10837
10837
  target[prop] = source[prop];
10838
- if (source != null && __getOwnPropSymbols$18)
10839
- for (var prop of __getOwnPropSymbols$18(source)) {
10840
- if (exclude.indexOf(prop) < 0 && __propIsEnum$18.call(source, prop))
10838
+ if (source != null && __getOwnPropSymbols$19)
10839
+ for (var prop of __getOwnPropSymbols$19(source)) {
10840
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$19.call(source, prop))
10841
10841
  target[prop] = source[prop];
10842
10842
  }
10843
10843
  return target;
@@ -10851,7 +10851,7 @@ class CodedError {
10851
10851
  this.message = message;
10852
10852
  }
10853
10853
  static fromObject(_a) {
10854
- var _b = _a, { message } = _b, options = __objRest$y(_b, ["message"]);
10854
+ var _b = _a, { message } = _b, options = __objRest$z(_b, ["message"]);
10855
10855
  return new CodedError(message, options);
10856
10856
  }
10857
10857
  }
@@ -10973,17 +10973,17 @@ const types = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
10973
10973
  RateCardStatus
10974
10974
  }, Symbol.toStringTag, { value: 'Module' }));
10975
10975
 
10976
- var __getOwnPropSymbols$17 = Object.getOwnPropertySymbols;
10977
- var __hasOwnProp$17 = Object.prototype.hasOwnProperty;
10978
- var __propIsEnum$17 = Object.prototype.propertyIsEnumerable;
10979
- var __objRest$x = (source, exclude) => {
10976
+ var __getOwnPropSymbols$18 = Object.getOwnPropertySymbols;
10977
+ var __hasOwnProp$18 = Object.prototype.hasOwnProperty;
10978
+ var __propIsEnum$18 = Object.prototype.propertyIsEnumerable;
10979
+ var __objRest$y = (source, exclude) => {
10980
10980
  var target = {};
10981
10981
  for (var prop in source)
10982
- if (__hasOwnProp$17.call(source, prop) && exclude.indexOf(prop) < 0)
10982
+ if (__hasOwnProp$18.call(source, prop) && exclude.indexOf(prop) < 0)
10983
10983
  target[prop] = source[prop];
10984
- if (source != null && __getOwnPropSymbols$17)
10985
- for (var prop of __getOwnPropSymbols$17(source)) {
10986
- if (exclude.indexOf(prop) < 0 && __propIsEnum$17.call(source, prop))
10984
+ if (source != null && __getOwnPropSymbols$18)
10985
+ for (var prop of __getOwnPropSymbols$18(source)) {
10986
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$18.call(source, prop))
10987
10987
  target[prop] = source[prop];
10988
10988
  }
10989
10989
  return target;
@@ -11015,7 +11015,7 @@ class AccountSettingsAPI {
11015
11015
  * The `updateImage` method updates specific image data for a given image id.
11016
11016
  */
11017
11017
  this.updateImage = (_a) => {
11018
- var _b = _a, { labelImageId } = _b, data = __objRest$x(_b, ["labelImageId"]);
11018
+ var _b = _a, { labelImageId } = _b, data = __objRest$y(_b, ["labelImageId"]);
11019
11019
  return this.client.put(`/v1/account/settings/images/${labelImageId}`, data);
11020
11020
  };
11021
11021
  /**
@@ -14010,30 +14010,30 @@ const decamelizeKeys = (obj, separator = "_") => {
14010
14010
  var __defProp$X = Object.defineProperty;
14011
14011
  var __defProps$R = Object.defineProperties;
14012
14012
  var __getOwnPropDescs$R = Object.getOwnPropertyDescriptors;
14013
- var __getOwnPropSymbols$16 = Object.getOwnPropertySymbols;
14014
- var __hasOwnProp$16 = Object.prototype.hasOwnProperty;
14015
- var __propIsEnum$16 = Object.prototype.propertyIsEnumerable;
14013
+ var __getOwnPropSymbols$17 = Object.getOwnPropertySymbols;
14014
+ var __hasOwnProp$17 = Object.prototype.hasOwnProperty;
14015
+ var __propIsEnum$17 = Object.prototype.propertyIsEnumerable;
14016
14016
  var __defNormalProp$X = (obj, key, value) => key in obj ? __defProp$X(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
14017
14017
  var __spreadValues$X = (a, b) => {
14018
14018
  for (var prop in b || (b = {}))
14019
- if (__hasOwnProp$16.call(b, prop))
14019
+ if (__hasOwnProp$17.call(b, prop))
14020
14020
  __defNormalProp$X(a, prop, b[prop]);
14021
- if (__getOwnPropSymbols$16)
14022
- for (var prop of __getOwnPropSymbols$16(b)) {
14023
- if (__propIsEnum$16.call(b, prop))
14021
+ if (__getOwnPropSymbols$17)
14022
+ for (var prop of __getOwnPropSymbols$17(b)) {
14023
+ if (__propIsEnum$17.call(b, prop))
14024
14024
  __defNormalProp$X(a, prop, b[prop]);
14025
14025
  }
14026
14026
  return a;
14027
14027
  };
14028
14028
  var __spreadProps$R = (a, b) => __defProps$R(a, __getOwnPropDescs$R(b));
14029
- var __objRest$w = (source, exclude) => {
14029
+ var __objRest$x = (source, exclude) => {
14030
14030
  var target = {};
14031
14031
  for (var prop in source)
14032
- if (__hasOwnProp$16.call(source, prop) && exclude.indexOf(prop) < 0)
14032
+ if (__hasOwnProp$17.call(source, prop) && exclude.indexOf(prop) < 0)
14033
14033
  target[prop] = source[prop];
14034
- if (source != null && __getOwnPropSymbols$16)
14035
- for (var prop of __getOwnPropSymbols$16(source)) {
14036
- if (exclude.indexOf(prop) < 0 && __propIsEnum$16.call(source, prop))
14034
+ if (source != null && __getOwnPropSymbols$17)
14035
+ for (var prop of __getOwnPropSymbols$17(source)) {
14036
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$17.call(source, prop))
14037
14037
  target[prop] = source[prop];
14038
14038
  }
14039
14039
  return target;
@@ -14079,7 +14079,7 @@ class CarriersAPI {
14079
14079
  * The `connect` method connects a carrier account to a user's ShipEngine account.
14080
14080
  */
14081
14081
  this.connect = (_a) => __async$1f(this, null, function* () {
14082
- var _b = _a, { carrierCode } = _b, connection = __objRest$w(_b, ["carrierCode"]);
14082
+ var _b = _a, { carrierCode } = _b, connection = __objRest$x(_b, ["carrierCode"]);
14083
14083
  const endUserIpAddress = yield getEndUserIpAddress();
14084
14084
  if (!endUserIpAddress)
14085
14085
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -14177,17 +14177,17 @@ class CarriersAPI {
14177
14177
  }
14178
14178
  }
14179
14179
 
14180
- var __getOwnPropSymbols$15 = Object.getOwnPropertySymbols;
14181
- var __hasOwnProp$15 = Object.prototype.hasOwnProperty;
14182
- var __propIsEnum$15 = Object.prototype.propertyIsEnumerable;
14183
- var __objRest$v = (source, exclude) => {
14180
+ var __getOwnPropSymbols$16 = Object.getOwnPropertySymbols;
14181
+ var __hasOwnProp$16 = Object.prototype.hasOwnProperty;
14182
+ var __propIsEnum$16 = Object.prototype.propertyIsEnumerable;
14183
+ var __objRest$w = (source, exclude) => {
14184
14184
  var target = {};
14185
14185
  for (var prop in source)
14186
- if (__hasOwnProp$15.call(source, prop) && exclude.indexOf(prop) < 0)
14186
+ if (__hasOwnProp$16.call(source, prop) && exclude.indexOf(prop) < 0)
14187
14187
  target[prop] = source[prop];
14188
- if (source != null && __getOwnPropSymbols$15)
14189
- for (var prop of __getOwnPropSymbols$15(source)) {
14190
- if (exclude.indexOf(prop) < 0 && __propIsEnum$15.call(source, prop))
14188
+ if (source != null && __getOwnPropSymbols$16)
14189
+ for (var prop of __getOwnPropSymbols$16(source)) {
14190
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$16.call(source, prop))
14191
14191
  target[prop] = source[prop];
14192
14192
  }
14193
14193
  return target;
@@ -14282,7 +14282,7 @@ class ConnectionsAPI {
14282
14282
  * @docs https://auctane.atlassian.net/wiki/spaces/SEEU/pages/6228738069/ENGINE-9471+Endicia+web+client+communication
14283
14283
  */
14284
14284
  this.requestStampsAccountUrls = (_a) => {
14285
- var _b = _a, { carrierId } = _b, rest = __objRest$v(_b, ["carrierId"]);
14285
+ var _b = _a, { carrierId } = _b, rest = __objRest$w(_b, ["carrierId"]);
14286
14286
  return this.client.put(
14287
14287
  `v1/connections/carriers/stamps_com/${carrierId}/request_account_url`,
14288
14288
  rest
@@ -16403,17 +16403,17 @@ class CustomPackagesAPI {
16403
16403
  }
16404
16404
 
16405
16405
  var __defProp$W = Object.defineProperty;
16406
- var __getOwnPropSymbols$14 = Object.getOwnPropertySymbols;
16407
- var __hasOwnProp$14 = Object.prototype.hasOwnProperty;
16408
- var __propIsEnum$14 = Object.prototype.propertyIsEnumerable;
16406
+ var __getOwnPropSymbols$15 = Object.getOwnPropertySymbols;
16407
+ var __hasOwnProp$15 = Object.prototype.hasOwnProperty;
16408
+ var __propIsEnum$15 = Object.prototype.propertyIsEnumerable;
16409
16409
  var __defNormalProp$W = (obj, key, value) => key in obj ? __defProp$W(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16410
16410
  var __spreadValues$W = (a, b) => {
16411
16411
  for (var prop in b || (b = {}))
16412
- if (__hasOwnProp$14.call(b, prop))
16412
+ if (__hasOwnProp$15.call(b, prop))
16413
16413
  __defNormalProp$W(a, prop, b[prop]);
16414
- if (__getOwnPropSymbols$14)
16415
- for (var prop of __getOwnPropSymbols$14(b)) {
16416
- if (__propIsEnum$14.call(b, prop))
16414
+ if (__getOwnPropSymbols$15)
16415
+ for (var prop of __getOwnPropSymbols$15(b)) {
16416
+ if (__propIsEnum$15.call(b, prop))
16417
16417
  __defNormalProp$W(a, prop, b[prop]);
16418
16418
  }
16419
16419
  return a;
@@ -16688,17 +16688,17 @@ class LabelsAPI {
16688
16688
  }
16689
16689
  }
16690
16690
 
16691
- var __getOwnPropSymbols$13 = Object.getOwnPropertySymbols;
16692
- var __hasOwnProp$13 = Object.prototype.hasOwnProperty;
16693
- var __propIsEnum$13 = Object.prototype.propertyIsEnumerable;
16694
- var __objRest$u = (source, exclude) => {
16691
+ var __getOwnPropSymbols$14 = Object.getOwnPropertySymbols;
16692
+ var __hasOwnProp$14 = Object.prototype.hasOwnProperty;
16693
+ var __propIsEnum$14 = Object.prototype.propertyIsEnumerable;
16694
+ var __objRest$v = (source, exclude) => {
16695
16695
  var target = {};
16696
16696
  for (var prop in source)
16697
- if (__hasOwnProp$13.call(source, prop) && exclude.indexOf(prop) < 0)
16697
+ if (__hasOwnProp$14.call(source, prop) && exclude.indexOf(prop) < 0)
16698
16698
  target[prop] = source[prop];
16699
- if (source != null && __getOwnPropSymbols$13)
16700
- for (var prop of __getOwnPropSymbols$13(source)) {
16701
- if (exclude.indexOf(prop) < 0 && __propIsEnum$13.call(source, prop))
16699
+ if (source != null && __getOwnPropSymbols$14)
16700
+ for (var prop of __getOwnPropSymbols$14(source)) {
16701
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$14.call(source, prop))
16702
16702
  target[prop] = source[prop];
16703
16703
  }
16704
16704
  return target;
@@ -16730,7 +16730,7 @@ class OrderSourcesAPI {
16730
16730
  * The `update` method will allow the user to update a connected Order Source
16731
16731
  */
16732
16732
  this.update = (_a) => {
16733
- var _b = _a, { orderSourceId } = _b, rest = __objRest$u(_b, ["orderSourceId"]);
16733
+ var _b = _a, { orderSourceId } = _b, rest = __objRest$v(_b, ["orderSourceId"]);
16734
16734
  return this.client.put(`/v-beta/order_sources/${orderSourceId}`, rest);
16735
16735
  };
16736
16736
  /**
@@ -16859,17 +16859,17 @@ class RateShoppersAPI {
16859
16859
  }
16860
16860
 
16861
16861
  var __defProp$V = Object.defineProperty;
16862
- var __getOwnPropSymbols$12 = Object.getOwnPropertySymbols;
16863
- var __hasOwnProp$12 = Object.prototype.hasOwnProperty;
16864
- var __propIsEnum$12 = Object.prototype.propertyIsEnumerable;
16862
+ var __getOwnPropSymbols$13 = Object.getOwnPropertySymbols;
16863
+ var __hasOwnProp$13 = Object.prototype.hasOwnProperty;
16864
+ var __propIsEnum$13 = Object.prototype.propertyIsEnumerable;
16865
16865
  var __defNormalProp$V = (obj, key, value) => key in obj ? __defProp$V(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16866
16866
  var __spreadValues$V = (a, b) => {
16867
16867
  for (var prop in b || (b = {}))
16868
- if (__hasOwnProp$12.call(b, prop))
16868
+ if (__hasOwnProp$13.call(b, prop))
16869
16869
  __defNormalProp$V(a, prop, b[prop]);
16870
- if (__getOwnPropSymbols$12)
16871
- for (var prop of __getOwnPropSymbols$12(b)) {
16872
- if (__propIsEnum$12.call(b, prop))
16870
+ if (__getOwnPropSymbols$13)
16871
+ for (var prop of __getOwnPropSymbols$13(b)) {
16872
+ if (__propIsEnum$13.call(b, prop))
16873
16873
  __defNormalProp$V(a, prop, b[prop]);
16874
16874
  }
16875
16875
  return a;
@@ -17077,17 +17077,17 @@ class SellersAPI {
17077
17077
  }
17078
17078
 
17079
17079
  var __defProp$U = Object.defineProperty;
17080
- var __getOwnPropSymbols$11 = Object.getOwnPropertySymbols;
17081
- var __hasOwnProp$11 = Object.prototype.hasOwnProperty;
17082
- var __propIsEnum$11 = Object.prototype.propertyIsEnumerable;
17080
+ var __getOwnPropSymbols$12 = Object.getOwnPropertySymbols;
17081
+ var __hasOwnProp$12 = Object.prototype.hasOwnProperty;
17082
+ var __propIsEnum$12 = Object.prototype.propertyIsEnumerable;
17083
17083
  var __defNormalProp$U = (obj, key, value) => key in obj ? __defProp$U(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17084
17084
  var __spreadValues$U = (a, b) => {
17085
17085
  for (var prop in b || (b = {}))
17086
- if (__hasOwnProp$11.call(b, prop))
17086
+ if (__hasOwnProp$12.call(b, prop))
17087
17087
  __defNormalProp$U(a, prop, b[prop]);
17088
- if (__getOwnPropSymbols$11)
17089
- for (var prop of __getOwnPropSymbols$11(b)) {
17090
- if (__propIsEnum$11.call(b, prop))
17088
+ if (__getOwnPropSymbols$12)
17089
+ for (var prop of __getOwnPropSymbols$12(b)) {
17090
+ if (__propIsEnum$12.call(b, prop))
17091
17091
  __defNormalProp$U(a, prop, b[prop]);
17092
17092
  }
17093
17093
  return a;
@@ -34587,30 +34587,30 @@ class WebhooksAPI {
34587
34587
  var __defProp$T = Object.defineProperty;
34588
34588
  var __defProps$Q = Object.defineProperties;
34589
34589
  var __getOwnPropDescs$Q = Object.getOwnPropertyDescriptors;
34590
- var __getOwnPropSymbols$10 = Object.getOwnPropertySymbols;
34591
- var __hasOwnProp$10 = Object.prototype.hasOwnProperty;
34592
- var __propIsEnum$10 = Object.prototype.propertyIsEnumerable;
34590
+ var __getOwnPropSymbols$11 = Object.getOwnPropertySymbols;
34591
+ var __hasOwnProp$11 = Object.prototype.hasOwnProperty;
34592
+ var __propIsEnum$11 = Object.prototype.propertyIsEnumerable;
34593
34593
  var __defNormalProp$T = (obj, key, value) => key in obj ? __defProp$T(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
34594
34594
  var __spreadValues$T = (a, b) => {
34595
34595
  for (var prop in b || (b = {}))
34596
- if (__hasOwnProp$10.call(b, prop))
34596
+ if (__hasOwnProp$11.call(b, prop))
34597
34597
  __defNormalProp$T(a, prop, b[prop]);
34598
- if (__getOwnPropSymbols$10)
34599
- for (var prop of __getOwnPropSymbols$10(b)) {
34600
- if (__propIsEnum$10.call(b, prop))
34598
+ if (__getOwnPropSymbols$11)
34599
+ for (var prop of __getOwnPropSymbols$11(b)) {
34600
+ if (__propIsEnum$11.call(b, prop))
34601
34601
  __defNormalProp$T(a, prop, b[prop]);
34602
34602
  }
34603
34603
  return a;
34604
34604
  };
34605
34605
  var __spreadProps$Q = (a, b) => __defProps$Q(a, __getOwnPropDescs$Q(b));
34606
- var __objRest$t = (source, exclude) => {
34606
+ var __objRest$u = (source, exclude) => {
34607
34607
  var target = {};
34608
34608
  for (var prop in source)
34609
- if (__hasOwnProp$10.call(source, prop) && exclude.indexOf(prop) < 0)
34609
+ if (__hasOwnProp$11.call(source, prop) && exclude.indexOf(prop) < 0)
34610
34610
  target[prop] = source[prop];
34611
- if (source != null && __getOwnPropSymbols$10)
34612
- for (var prop of __getOwnPropSymbols$10(source)) {
34613
- if (exclude.indexOf(prop) < 0 && __propIsEnum$10.call(source, prop))
34611
+ if (source != null && __getOwnPropSymbols$11)
34612
+ for (var prop of __getOwnPropSymbols$11(source)) {
34613
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$11.call(source, prop))
34614
34614
  target[prop] = source[prop];
34615
34615
  }
34616
34616
  return target;
@@ -34673,7 +34673,7 @@ class ShipEngineAPI {
34673
34673
  return decamelizeKeys(data);
34674
34674
  else {
34675
34675
  if (data && data.__skipDecamelize) {
34676
- const _a = data, cleanData = __objRest$t(_a, ["__skipDecamelize"]);
34676
+ const _a = data, cleanData = __objRest$u(_a, ["__skipDecamelize"]);
34677
34677
  return cleanData;
34678
34678
  }
34679
34679
  return data;
@@ -35050,6 +35050,21 @@ class ShipEngineAPI {
35050
35050
  }
35051
35051
  }
35052
35052
 
35053
+ var __getOwnPropSymbols$10 = Object.getOwnPropertySymbols;
35054
+ var __hasOwnProp$10 = Object.prototype.hasOwnProperty;
35055
+ var __propIsEnum$10 = Object.prototype.propertyIsEnumerable;
35056
+ var __objRest$t = (source, exclude) => {
35057
+ var target = {};
35058
+ for (var prop in source)
35059
+ if (__hasOwnProp$10.call(source, prop) && exclude.indexOf(prop) < 0)
35060
+ target[prop] = source[prop];
35061
+ if (source != null && __getOwnPropSymbols$10)
35062
+ for (var prop of __getOwnPropSymbols$10(source)) {
35063
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$10.call(source, prop))
35064
+ target[prop] = source[prop];
35065
+ }
35066
+ return target;
35067
+ };
35053
35068
  const ShipEngineContext = React.createContext(void 0);
35054
35069
  const ShipEngine = ({
35055
35070
  baseURL,
@@ -35062,9 +35077,22 @@ const ShipEngine = ({
35062
35077
  defaultQueryClientOptions = {}
35063
35078
  }) => {
35064
35079
  const [client, setClient] = React.useState();
35080
+ const _a = defaultQueryClientOptions, { onError, onSuccess } = _a, restQueryClientOptions = __objRest$t(_a, ["onError", "onSuccess"]);
35081
+ const callbacksRef = React.useRef({ onError, onSuccess });
35082
+ callbacksRef.current = { onError, onSuccess };
35065
35083
  const [queryClient] = React.useState(
35066
35084
  () => new reactQuery.QueryClient({
35067
- defaultOptions: defaultQueryClientOptions
35085
+ defaultOptions: restQueryClientOptions,
35086
+ queryCache: new reactQuery.QueryCache({
35087
+ onError: (...args) => {
35088
+ var _a2, _b;
35089
+ return (_b = (_a2 = callbacksRef.current).onError) == null ? void 0 : _b.call(_a2, ...args);
35090
+ },
35091
+ onSuccess: (...args) => {
35092
+ var _a2, _b;
35093
+ return (_b = (_a2 = callbacksRef.current).onSuccess) == null ? void 0 : _b.call(_a2, ...args);
35094
+ }
35095
+ })
35068
35096
  })
35069
35097
  );
35070
35098
  React.useEffect(() => {
package/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import * as React from 'react';
2
- import { createContext, forwardRef, useContext, createElement as createElement$1, Fragment, useState, useEffect, useCallback, useMemo, useRef } from 'react';
2
+ import { createContext, forwardRef, useContext, createElement as createElement$1, Fragment, useState, useRef, useEffect, useCallback, useMemo } from 'react';
3
3
  import { jsx as jsx$1 } from 'react/jsx-runtime';
4
4
  import { GigerProvider, GigerTestProvider, DefaultPortalRefProvider } from '@shipengine/giger';
5
- import { QueryClient, QueryClientProvider, useMutation, useQuery, useQueryClient, useInfiniteQuery } from '@tanstack/react-query';
5
+ import { QueryClient, QueryCache, QueryClientProvider, useMutation, useQuery, useQueryClient, useInfiniteQuery } from '@tanstack/react-query';
6
6
  import { CacheProvider } from '@emotion/react';
7
7
  import { I18nextProvider } from 'react-i18next';
8
8
  import i18n from 'i18next';
@@ -10805,17 +10805,17 @@ var FeatureId = /* @__PURE__ */ ((FeatureId2) => {
10805
10805
  return FeatureId2;
10806
10806
  })(FeatureId || {});
10807
10807
 
10808
- var __getOwnPropSymbols$18 = Object.getOwnPropertySymbols;
10809
- var __hasOwnProp$18 = Object.prototype.hasOwnProperty;
10810
- var __propIsEnum$18 = Object.prototype.propertyIsEnumerable;
10811
- var __objRest$y = (source, exclude) => {
10808
+ var __getOwnPropSymbols$19 = Object.getOwnPropertySymbols;
10809
+ var __hasOwnProp$19 = Object.prototype.hasOwnProperty;
10810
+ var __propIsEnum$19 = Object.prototype.propertyIsEnumerable;
10811
+ var __objRest$z = (source, exclude) => {
10812
10812
  var target = {};
10813
10813
  for (var prop in source)
10814
- if (__hasOwnProp$18.call(source, prop) && exclude.indexOf(prop) < 0)
10814
+ if (__hasOwnProp$19.call(source, prop) && exclude.indexOf(prop) < 0)
10815
10815
  target[prop] = source[prop];
10816
- if (source != null && __getOwnPropSymbols$18)
10817
- for (var prop of __getOwnPropSymbols$18(source)) {
10818
- if (exclude.indexOf(prop) < 0 && __propIsEnum$18.call(source, prop))
10816
+ if (source != null && __getOwnPropSymbols$19)
10817
+ for (var prop of __getOwnPropSymbols$19(source)) {
10818
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$19.call(source, prop))
10819
10819
  target[prop] = source[prop];
10820
10820
  }
10821
10821
  return target;
@@ -10829,7 +10829,7 @@ class CodedError {
10829
10829
  this.message = message;
10830
10830
  }
10831
10831
  static fromObject(_a) {
10832
- var _b = _a, { message } = _b, options = __objRest$y(_b, ["message"]);
10832
+ var _b = _a, { message } = _b, options = __objRest$z(_b, ["message"]);
10833
10833
  return new CodedError(message, options);
10834
10834
  }
10835
10835
  }
@@ -10951,17 +10951,17 @@ const types = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
10951
10951
  RateCardStatus
10952
10952
  }, Symbol.toStringTag, { value: 'Module' }));
10953
10953
 
10954
- var __getOwnPropSymbols$17 = Object.getOwnPropertySymbols;
10955
- var __hasOwnProp$17 = Object.prototype.hasOwnProperty;
10956
- var __propIsEnum$17 = Object.prototype.propertyIsEnumerable;
10957
- var __objRest$x = (source, exclude) => {
10954
+ var __getOwnPropSymbols$18 = Object.getOwnPropertySymbols;
10955
+ var __hasOwnProp$18 = Object.prototype.hasOwnProperty;
10956
+ var __propIsEnum$18 = Object.prototype.propertyIsEnumerable;
10957
+ var __objRest$y = (source, exclude) => {
10958
10958
  var target = {};
10959
10959
  for (var prop in source)
10960
- if (__hasOwnProp$17.call(source, prop) && exclude.indexOf(prop) < 0)
10960
+ if (__hasOwnProp$18.call(source, prop) && exclude.indexOf(prop) < 0)
10961
10961
  target[prop] = source[prop];
10962
- if (source != null && __getOwnPropSymbols$17)
10963
- for (var prop of __getOwnPropSymbols$17(source)) {
10964
- if (exclude.indexOf(prop) < 0 && __propIsEnum$17.call(source, prop))
10962
+ if (source != null && __getOwnPropSymbols$18)
10963
+ for (var prop of __getOwnPropSymbols$18(source)) {
10964
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$18.call(source, prop))
10965
10965
  target[prop] = source[prop];
10966
10966
  }
10967
10967
  return target;
@@ -10993,7 +10993,7 @@ class AccountSettingsAPI {
10993
10993
  * The `updateImage` method updates specific image data for a given image id.
10994
10994
  */
10995
10995
  this.updateImage = (_a) => {
10996
- var _b = _a, { labelImageId } = _b, data = __objRest$x(_b, ["labelImageId"]);
10996
+ var _b = _a, { labelImageId } = _b, data = __objRest$y(_b, ["labelImageId"]);
10997
10997
  return this.client.put(`/v1/account/settings/images/${labelImageId}`, data);
10998
10998
  };
10999
10999
  /**
@@ -13988,30 +13988,30 @@ const decamelizeKeys = (obj, separator = "_") => {
13988
13988
  var __defProp$X = Object.defineProperty;
13989
13989
  var __defProps$R = Object.defineProperties;
13990
13990
  var __getOwnPropDescs$R = Object.getOwnPropertyDescriptors;
13991
- var __getOwnPropSymbols$16 = Object.getOwnPropertySymbols;
13992
- var __hasOwnProp$16 = Object.prototype.hasOwnProperty;
13993
- var __propIsEnum$16 = Object.prototype.propertyIsEnumerable;
13991
+ var __getOwnPropSymbols$17 = Object.getOwnPropertySymbols;
13992
+ var __hasOwnProp$17 = Object.prototype.hasOwnProperty;
13993
+ var __propIsEnum$17 = Object.prototype.propertyIsEnumerable;
13994
13994
  var __defNormalProp$X = (obj, key, value) => key in obj ? __defProp$X(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13995
13995
  var __spreadValues$X = (a, b) => {
13996
13996
  for (var prop in b || (b = {}))
13997
- if (__hasOwnProp$16.call(b, prop))
13997
+ if (__hasOwnProp$17.call(b, prop))
13998
13998
  __defNormalProp$X(a, prop, b[prop]);
13999
- if (__getOwnPropSymbols$16)
14000
- for (var prop of __getOwnPropSymbols$16(b)) {
14001
- if (__propIsEnum$16.call(b, prop))
13999
+ if (__getOwnPropSymbols$17)
14000
+ for (var prop of __getOwnPropSymbols$17(b)) {
14001
+ if (__propIsEnum$17.call(b, prop))
14002
14002
  __defNormalProp$X(a, prop, b[prop]);
14003
14003
  }
14004
14004
  return a;
14005
14005
  };
14006
14006
  var __spreadProps$R = (a, b) => __defProps$R(a, __getOwnPropDescs$R(b));
14007
- var __objRest$w = (source, exclude) => {
14007
+ var __objRest$x = (source, exclude) => {
14008
14008
  var target = {};
14009
14009
  for (var prop in source)
14010
- if (__hasOwnProp$16.call(source, prop) && exclude.indexOf(prop) < 0)
14010
+ if (__hasOwnProp$17.call(source, prop) && exclude.indexOf(prop) < 0)
14011
14011
  target[prop] = source[prop];
14012
- if (source != null && __getOwnPropSymbols$16)
14013
- for (var prop of __getOwnPropSymbols$16(source)) {
14014
- if (exclude.indexOf(prop) < 0 && __propIsEnum$16.call(source, prop))
14012
+ if (source != null && __getOwnPropSymbols$17)
14013
+ for (var prop of __getOwnPropSymbols$17(source)) {
14014
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$17.call(source, prop))
14015
14015
  target[prop] = source[prop];
14016
14016
  }
14017
14017
  return target;
@@ -14057,7 +14057,7 @@ class CarriersAPI {
14057
14057
  * The `connect` method connects a carrier account to a user's ShipEngine account.
14058
14058
  */
14059
14059
  this.connect = (_a) => __async$1f(this, null, function* () {
14060
- var _b = _a, { carrierCode } = _b, connection = __objRest$w(_b, ["carrierCode"]);
14060
+ var _b = _a, { carrierCode } = _b, connection = __objRest$x(_b, ["carrierCode"]);
14061
14061
  const endUserIpAddress = yield getEndUserIpAddress();
14062
14062
  if (!endUserIpAddress)
14063
14063
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -14155,17 +14155,17 @@ class CarriersAPI {
14155
14155
  }
14156
14156
  }
14157
14157
 
14158
- var __getOwnPropSymbols$15 = Object.getOwnPropertySymbols;
14159
- var __hasOwnProp$15 = Object.prototype.hasOwnProperty;
14160
- var __propIsEnum$15 = Object.prototype.propertyIsEnumerable;
14161
- var __objRest$v = (source, exclude) => {
14158
+ var __getOwnPropSymbols$16 = Object.getOwnPropertySymbols;
14159
+ var __hasOwnProp$16 = Object.prototype.hasOwnProperty;
14160
+ var __propIsEnum$16 = Object.prototype.propertyIsEnumerable;
14161
+ var __objRest$w = (source, exclude) => {
14162
14162
  var target = {};
14163
14163
  for (var prop in source)
14164
- if (__hasOwnProp$15.call(source, prop) && exclude.indexOf(prop) < 0)
14164
+ if (__hasOwnProp$16.call(source, prop) && exclude.indexOf(prop) < 0)
14165
14165
  target[prop] = source[prop];
14166
- if (source != null && __getOwnPropSymbols$15)
14167
- for (var prop of __getOwnPropSymbols$15(source)) {
14168
- if (exclude.indexOf(prop) < 0 && __propIsEnum$15.call(source, prop))
14166
+ if (source != null && __getOwnPropSymbols$16)
14167
+ for (var prop of __getOwnPropSymbols$16(source)) {
14168
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$16.call(source, prop))
14169
14169
  target[prop] = source[prop];
14170
14170
  }
14171
14171
  return target;
@@ -14260,7 +14260,7 @@ class ConnectionsAPI {
14260
14260
  * @docs https://auctane.atlassian.net/wiki/spaces/SEEU/pages/6228738069/ENGINE-9471+Endicia+web+client+communication
14261
14261
  */
14262
14262
  this.requestStampsAccountUrls = (_a) => {
14263
- var _b = _a, { carrierId } = _b, rest = __objRest$v(_b, ["carrierId"]);
14263
+ var _b = _a, { carrierId } = _b, rest = __objRest$w(_b, ["carrierId"]);
14264
14264
  return this.client.put(
14265
14265
  `v1/connections/carriers/stamps_com/${carrierId}/request_account_url`,
14266
14266
  rest
@@ -16381,17 +16381,17 @@ class CustomPackagesAPI {
16381
16381
  }
16382
16382
 
16383
16383
  var __defProp$W = Object.defineProperty;
16384
- var __getOwnPropSymbols$14 = Object.getOwnPropertySymbols;
16385
- var __hasOwnProp$14 = Object.prototype.hasOwnProperty;
16386
- var __propIsEnum$14 = Object.prototype.propertyIsEnumerable;
16384
+ var __getOwnPropSymbols$15 = Object.getOwnPropertySymbols;
16385
+ var __hasOwnProp$15 = Object.prototype.hasOwnProperty;
16386
+ var __propIsEnum$15 = Object.prototype.propertyIsEnumerable;
16387
16387
  var __defNormalProp$W = (obj, key, value) => key in obj ? __defProp$W(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16388
16388
  var __spreadValues$W = (a, b) => {
16389
16389
  for (var prop in b || (b = {}))
16390
- if (__hasOwnProp$14.call(b, prop))
16390
+ if (__hasOwnProp$15.call(b, prop))
16391
16391
  __defNormalProp$W(a, prop, b[prop]);
16392
- if (__getOwnPropSymbols$14)
16393
- for (var prop of __getOwnPropSymbols$14(b)) {
16394
- if (__propIsEnum$14.call(b, prop))
16392
+ if (__getOwnPropSymbols$15)
16393
+ for (var prop of __getOwnPropSymbols$15(b)) {
16394
+ if (__propIsEnum$15.call(b, prop))
16395
16395
  __defNormalProp$W(a, prop, b[prop]);
16396
16396
  }
16397
16397
  return a;
@@ -16666,17 +16666,17 @@ class LabelsAPI {
16666
16666
  }
16667
16667
  }
16668
16668
 
16669
- var __getOwnPropSymbols$13 = Object.getOwnPropertySymbols;
16670
- var __hasOwnProp$13 = Object.prototype.hasOwnProperty;
16671
- var __propIsEnum$13 = Object.prototype.propertyIsEnumerable;
16672
- var __objRest$u = (source, exclude) => {
16669
+ var __getOwnPropSymbols$14 = Object.getOwnPropertySymbols;
16670
+ var __hasOwnProp$14 = Object.prototype.hasOwnProperty;
16671
+ var __propIsEnum$14 = Object.prototype.propertyIsEnumerable;
16672
+ var __objRest$v = (source, exclude) => {
16673
16673
  var target = {};
16674
16674
  for (var prop in source)
16675
- if (__hasOwnProp$13.call(source, prop) && exclude.indexOf(prop) < 0)
16675
+ if (__hasOwnProp$14.call(source, prop) && exclude.indexOf(prop) < 0)
16676
16676
  target[prop] = source[prop];
16677
- if (source != null && __getOwnPropSymbols$13)
16678
- for (var prop of __getOwnPropSymbols$13(source)) {
16679
- if (exclude.indexOf(prop) < 0 && __propIsEnum$13.call(source, prop))
16677
+ if (source != null && __getOwnPropSymbols$14)
16678
+ for (var prop of __getOwnPropSymbols$14(source)) {
16679
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$14.call(source, prop))
16680
16680
  target[prop] = source[prop];
16681
16681
  }
16682
16682
  return target;
@@ -16708,7 +16708,7 @@ class OrderSourcesAPI {
16708
16708
  * The `update` method will allow the user to update a connected Order Source
16709
16709
  */
16710
16710
  this.update = (_a) => {
16711
- var _b = _a, { orderSourceId } = _b, rest = __objRest$u(_b, ["orderSourceId"]);
16711
+ var _b = _a, { orderSourceId } = _b, rest = __objRest$v(_b, ["orderSourceId"]);
16712
16712
  return this.client.put(`/v-beta/order_sources/${orderSourceId}`, rest);
16713
16713
  };
16714
16714
  /**
@@ -16837,17 +16837,17 @@ class RateShoppersAPI {
16837
16837
  }
16838
16838
 
16839
16839
  var __defProp$V = Object.defineProperty;
16840
- var __getOwnPropSymbols$12 = Object.getOwnPropertySymbols;
16841
- var __hasOwnProp$12 = Object.prototype.hasOwnProperty;
16842
- var __propIsEnum$12 = Object.prototype.propertyIsEnumerable;
16840
+ var __getOwnPropSymbols$13 = Object.getOwnPropertySymbols;
16841
+ var __hasOwnProp$13 = Object.prototype.hasOwnProperty;
16842
+ var __propIsEnum$13 = Object.prototype.propertyIsEnumerable;
16843
16843
  var __defNormalProp$V = (obj, key, value) => key in obj ? __defProp$V(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16844
16844
  var __spreadValues$V = (a, b) => {
16845
16845
  for (var prop in b || (b = {}))
16846
- if (__hasOwnProp$12.call(b, prop))
16846
+ if (__hasOwnProp$13.call(b, prop))
16847
16847
  __defNormalProp$V(a, prop, b[prop]);
16848
- if (__getOwnPropSymbols$12)
16849
- for (var prop of __getOwnPropSymbols$12(b)) {
16850
- if (__propIsEnum$12.call(b, prop))
16848
+ if (__getOwnPropSymbols$13)
16849
+ for (var prop of __getOwnPropSymbols$13(b)) {
16850
+ if (__propIsEnum$13.call(b, prop))
16851
16851
  __defNormalProp$V(a, prop, b[prop]);
16852
16852
  }
16853
16853
  return a;
@@ -17055,17 +17055,17 @@ class SellersAPI {
17055
17055
  }
17056
17056
 
17057
17057
  var __defProp$U = Object.defineProperty;
17058
- var __getOwnPropSymbols$11 = Object.getOwnPropertySymbols;
17059
- var __hasOwnProp$11 = Object.prototype.hasOwnProperty;
17060
- var __propIsEnum$11 = Object.prototype.propertyIsEnumerable;
17058
+ var __getOwnPropSymbols$12 = Object.getOwnPropertySymbols;
17059
+ var __hasOwnProp$12 = Object.prototype.hasOwnProperty;
17060
+ var __propIsEnum$12 = Object.prototype.propertyIsEnumerable;
17061
17061
  var __defNormalProp$U = (obj, key, value) => key in obj ? __defProp$U(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17062
17062
  var __spreadValues$U = (a, b) => {
17063
17063
  for (var prop in b || (b = {}))
17064
- if (__hasOwnProp$11.call(b, prop))
17064
+ if (__hasOwnProp$12.call(b, prop))
17065
17065
  __defNormalProp$U(a, prop, b[prop]);
17066
- if (__getOwnPropSymbols$11)
17067
- for (var prop of __getOwnPropSymbols$11(b)) {
17068
- if (__propIsEnum$11.call(b, prop))
17066
+ if (__getOwnPropSymbols$12)
17067
+ for (var prop of __getOwnPropSymbols$12(b)) {
17068
+ if (__propIsEnum$12.call(b, prop))
17069
17069
  __defNormalProp$U(a, prop, b[prop]);
17070
17070
  }
17071
17071
  return a;
@@ -34565,30 +34565,30 @@ class WebhooksAPI {
34565
34565
  var __defProp$T = Object.defineProperty;
34566
34566
  var __defProps$Q = Object.defineProperties;
34567
34567
  var __getOwnPropDescs$Q = Object.getOwnPropertyDescriptors;
34568
- var __getOwnPropSymbols$10 = Object.getOwnPropertySymbols;
34569
- var __hasOwnProp$10 = Object.prototype.hasOwnProperty;
34570
- var __propIsEnum$10 = Object.prototype.propertyIsEnumerable;
34568
+ var __getOwnPropSymbols$11 = Object.getOwnPropertySymbols;
34569
+ var __hasOwnProp$11 = Object.prototype.hasOwnProperty;
34570
+ var __propIsEnum$11 = Object.prototype.propertyIsEnumerable;
34571
34571
  var __defNormalProp$T = (obj, key, value) => key in obj ? __defProp$T(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
34572
34572
  var __spreadValues$T = (a, b) => {
34573
34573
  for (var prop in b || (b = {}))
34574
- if (__hasOwnProp$10.call(b, prop))
34574
+ if (__hasOwnProp$11.call(b, prop))
34575
34575
  __defNormalProp$T(a, prop, b[prop]);
34576
- if (__getOwnPropSymbols$10)
34577
- for (var prop of __getOwnPropSymbols$10(b)) {
34578
- if (__propIsEnum$10.call(b, prop))
34576
+ if (__getOwnPropSymbols$11)
34577
+ for (var prop of __getOwnPropSymbols$11(b)) {
34578
+ if (__propIsEnum$11.call(b, prop))
34579
34579
  __defNormalProp$T(a, prop, b[prop]);
34580
34580
  }
34581
34581
  return a;
34582
34582
  };
34583
34583
  var __spreadProps$Q = (a, b) => __defProps$Q(a, __getOwnPropDescs$Q(b));
34584
- var __objRest$t = (source, exclude) => {
34584
+ var __objRest$u = (source, exclude) => {
34585
34585
  var target = {};
34586
34586
  for (var prop in source)
34587
- if (__hasOwnProp$10.call(source, prop) && exclude.indexOf(prop) < 0)
34587
+ if (__hasOwnProp$11.call(source, prop) && exclude.indexOf(prop) < 0)
34588
34588
  target[prop] = source[prop];
34589
- if (source != null && __getOwnPropSymbols$10)
34590
- for (var prop of __getOwnPropSymbols$10(source)) {
34591
- if (exclude.indexOf(prop) < 0 && __propIsEnum$10.call(source, prop))
34589
+ if (source != null && __getOwnPropSymbols$11)
34590
+ for (var prop of __getOwnPropSymbols$11(source)) {
34591
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$11.call(source, prop))
34592
34592
  target[prop] = source[prop];
34593
34593
  }
34594
34594
  return target;
@@ -34651,7 +34651,7 @@ class ShipEngineAPI {
34651
34651
  return decamelizeKeys(data);
34652
34652
  else {
34653
34653
  if (data && data.__skipDecamelize) {
34654
- const _a = data, cleanData = __objRest$t(_a, ["__skipDecamelize"]);
34654
+ const _a = data, cleanData = __objRest$u(_a, ["__skipDecamelize"]);
34655
34655
  return cleanData;
34656
34656
  }
34657
34657
  return data;
@@ -35028,6 +35028,21 @@ class ShipEngineAPI {
35028
35028
  }
35029
35029
  }
35030
35030
 
35031
+ var __getOwnPropSymbols$10 = Object.getOwnPropertySymbols;
35032
+ var __hasOwnProp$10 = Object.prototype.hasOwnProperty;
35033
+ var __propIsEnum$10 = Object.prototype.propertyIsEnumerable;
35034
+ var __objRest$t = (source, exclude) => {
35035
+ var target = {};
35036
+ for (var prop in source)
35037
+ if (__hasOwnProp$10.call(source, prop) && exclude.indexOf(prop) < 0)
35038
+ target[prop] = source[prop];
35039
+ if (source != null && __getOwnPropSymbols$10)
35040
+ for (var prop of __getOwnPropSymbols$10(source)) {
35041
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$10.call(source, prop))
35042
+ target[prop] = source[prop];
35043
+ }
35044
+ return target;
35045
+ };
35031
35046
  const ShipEngineContext = createContext(void 0);
35032
35047
  const ShipEngine = ({
35033
35048
  baseURL,
@@ -35040,9 +35055,22 @@ const ShipEngine = ({
35040
35055
  defaultQueryClientOptions = {}
35041
35056
  }) => {
35042
35057
  const [client, setClient] = useState();
35058
+ const _a = defaultQueryClientOptions, { onError, onSuccess } = _a, restQueryClientOptions = __objRest$t(_a, ["onError", "onSuccess"]);
35059
+ const callbacksRef = useRef({ onError, onSuccess });
35060
+ callbacksRef.current = { onError, onSuccess };
35043
35061
  const [queryClient] = useState(
35044
35062
  () => new QueryClient({
35045
- defaultOptions: defaultQueryClientOptions
35063
+ defaultOptions: restQueryClientOptions,
35064
+ queryCache: new QueryCache({
35065
+ onError: (...args) => {
35066
+ var _a2, _b;
35067
+ return (_b = (_a2 = callbacksRef.current).onError) == null ? void 0 : _b.call(_a2, ...args);
35068
+ },
35069
+ onSuccess: (...args) => {
35070
+ var _a2, _b;
35071
+ return (_b = (_a2 = callbacksRef.current).onSuccess) == null ? void 0 : _b.call(_a2, ...args);
35072
+ }
35073
+ })
35046
35074
  })
35047
35075
  );
35048
35076
  useEffect(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/alchemy",
3
- "version": "6.0.97",
3
+ "version": "6.0.98-next.1",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {