@shipengine/alchemy 5.0.29 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/alchemy-provider/alchemy-provider.d.ts +4 -6
- package/index.js +40 -58
- package/index.mjs +39 -58
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CustomThemeData, Theme } from "@shipengine/giger-theme";
|
|
2
|
-
import { ShipEngineProps } from "@shipengine/react-api";
|
|
2
|
+
import { ShipEngineAPIConfig, ShipEngineProps } from "@shipengine/react-api";
|
|
3
3
|
export type AlchemyErrorHandler = (err: Error) => void;
|
|
4
4
|
export type AlchemyContextValue = {
|
|
5
5
|
baseURL: string;
|
|
@@ -12,17 +12,15 @@ export type AlchemyContextValue = {
|
|
|
12
12
|
theme: Theme;
|
|
13
13
|
};
|
|
14
14
|
export declare const AlchemyContext: import("react").Context<AlchemyContextValue | undefined>;
|
|
15
|
-
export
|
|
16
|
-
baseURL?: string;
|
|
15
|
+
export type AlchemyProviderProps = {
|
|
17
16
|
cdnURL?: string;
|
|
18
17
|
children: React.ReactNode;
|
|
19
18
|
container?: HTMLElement;
|
|
20
|
-
getToken: ShipEngineProps["getToken"];
|
|
21
19
|
locale?: string;
|
|
22
20
|
onError?: AlchemyErrorHandler;
|
|
23
21
|
/** Scope of the Alchemy Provider. Can be null to not specify a specific element */
|
|
24
22
|
scope?: string | null;
|
|
25
23
|
themeConfig?: CustomThemeData;
|
|
26
|
-
}
|
|
27
|
-
export declare const AlchemyProvider: ({ baseURL, cdnURL, container, children, getToken, locale: localeProp, onError, scope, themeConfig, }: AlchemyProviderProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
24
|
+
} & ShipEngineAPIConfig;
|
|
25
|
+
export declare const AlchemyProvider: ({ baseURL, cdnURL, container, children, getToken, locale: localeProp, onError, scope, themeConfig, onApiError, headers, }: AlchemyProviderProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
28
26
|
export declare const useAlchemy: () => AlchemyContextValue;
|
package/index.js
CHANGED
|
@@ -11005,6 +11005,21 @@ class AddressesAPI {
|
|
|
11005
11005
|
|
|
11006
11006
|
const isCodedErrors = (errs) => Array.isArray(errs) && errs.every((err) => isCodedError(err));
|
|
11007
11007
|
const isCodedError = (err) => !!err.errorCode;
|
|
11008
|
+
const isDataCodedErrors = (data) => !!data.errors && isCodedErrors(data.errors);
|
|
11009
|
+
const parseError = (err) => {
|
|
11010
|
+
var _a;
|
|
11011
|
+
if (!((_a = err.response) == null ? void 0 : _a.data))
|
|
11012
|
+
return [new CodedError(err.message)];
|
|
11013
|
+
if (isDataCodedErrors(err.response.data)) {
|
|
11014
|
+
return err.response.data.errors.map((err2) => CodedError.fromObject(err2));
|
|
11015
|
+
} else if (isCodedErrors(err.response.data)) {
|
|
11016
|
+
return err.response.data.map((err2) => CodedError.fromObject(err2));
|
|
11017
|
+
} else if (isCodedError(err.response.data)) {
|
|
11018
|
+
return [CodedError.fromObject(err.response.data)];
|
|
11019
|
+
} else {
|
|
11020
|
+
return [new CodedError(err.message)];
|
|
11021
|
+
}
|
|
11022
|
+
};
|
|
11008
11023
|
|
|
11009
11024
|
var axiosExports$1 = {};
|
|
11010
11025
|
var axios$3 = {
|
|
@@ -13784,19 +13799,6 @@ class CarriersAPI {
|
|
|
13784
13799
|
`/v1/carriers/${carrierId}/auto_funding`
|
|
13785
13800
|
);
|
|
13786
13801
|
};
|
|
13787
|
-
/**
|
|
13788
|
-
* The `getWalletHistory` method retrieves the wallet transaction history for
|
|
13789
|
-
* a ShipEngine wallet account.
|
|
13790
|
-
*/
|
|
13791
|
-
this.getWalletHistory = (startDate, endDate, page) => {
|
|
13792
|
-
return this.client.get(`/v1/carriers/wallet_history`, {
|
|
13793
|
-
params: {
|
|
13794
|
-
endDate: endDate.toISOString(),
|
|
13795
|
-
page,
|
|
13796
|
-
startDate: startDate.toISOString()
|
|
13797
|
-
}
|
|
13798
|
-
});
|
|
13799
|
-
};
|
|
13800
13802
|
/**
|
|
13801
13803
|
* The `getServices` method retrieves a list of shipping services that a given carrier offers.
|
|
13802
13804
|
*/
|
|
@@ -16583,6 +16585,7 @@ var __async$y = (__this, __arguments, generator) => {
|
|
|
16583
16585
|
});
|
|
16584
16586
|
};
|
|
16585
16587
|
const logger$1 = E({
|
|
16588
|
+
level: process.env.NODE_ENV === "production" ? "fatal" : "info",
|
|
16586
16589
|
name: "shipengine-api",
|
|
16587
16590
|
serializers: __spreadProps$2(__spreadValues$4({}, k), {
|
|
16588
16591
|
req: (req) => ({
|
|
@@ -16604,9 +16607,8 @@ const logger$1 = E({
|
|
|
16604
16607
|
}
|
|
16605
16608
|
]
|
|
16606
16609
|
});
|
|
16607
|
-
const isDataCodedErrors = (data) => !!data.errors && isCodedErrors(data.errors);
|
|
16608
16610
|
class ShipEngineAPI {
|
|
16609
|
-
constructor(token, { baseURL, headers, getToken }) {
|
|
16611
|
+
constructor(token, { baseURL, headers, getToken, onApiError }) {
|
|
16610
16612
|
const client = axios.create({
|
|
16611
16613
|
baseURL,
|
|
16612
16614
|
headers: __spreadProps$2(__spreadValues$4({}, headers), {
|
|
@@ -16657,7 +16659,7 @@ class ShipEngineAPI {
|
|
|
16657
16659
|
return res;
|
|
16658
16660
|
},
|
|
16659
16661
|
(err) => __async$y(this, null, function* () {
|
|
16660
|
-
var _a, _b, _c, _d, _e, _f
|
|
16662
|
+
var _a, _b, _c, _d, _e, _f;
|
|
16661
16663
|
logger$1.error(
|
|
16662
16664
|
{ err, req: err.config, res: err.response },
|
|
16663
16665
|
"%s %s: %s %s - %s",
|
|
@@ -16676,22 +16678,9 @@ class ShipEngineAPI {
|
|
|
16676
16678
|
}
|
|
16677
16679
|
return axios(config);
|
|
16678
16680
|
}
|
|
16679
|
-
|
|
16680
|
-
|
|
16681
|
-
|
|
16682
|
-
err.response.data.errors.map((err2) => CodedError.fromObject(err2))
|
|
16683
|
-
);
|
|
16684
|
-
}
|
|
16685
|
-
if (isCodedErrors(err.response.data)) {
|
|
16686
|
-
return Promise.reject(err.response.data.map((err2) => CodedError.fromObject(err2)));
|
|
16687
|
-
}
|
|
16688
|
-
if (isCodedError(err.response.data)) {
|
|
16689
|
-
return Promise.reject([CodedError.fromObject(err.response.data)]);
|
|
16690
|
-
}
|
|
16691
|
-
return Promise.reject([new CodedError(err.response.data)]);
|
|
16692
|
-
} else {
|
|
16693
|
-
return Promise.reject([new CodedError(err.message)]);
|
|
16694
|
-
}
|
|
16681
|
+
const codedErrors = parseError(err);
|
|
16682
|
+
onApiError == null ? void 0 : onApiError(codedErrors, err);
|
|
16683
|
+
return Promise.reject(codedErrors);
|
|
16695
16684
|
})
|
|
16696
16685
|
);
|
|
16697
16686
|
this.client = client;
|
|
@@ -16855,21 +16844,29 @@ class ShipEngineAPI {
|
|
|
16855
16844
|
}
|
|
16856
16845
|
|
|
16857
16846
|
const ShipEngineContext = React.createContext(void 0);
|
|
16858
|
-
const ShipEngine = ({
|
|
16847
|
+
const ShipEngine = ({
|
|
16848
|
+
baseURL,
|
|
16849
|
+
children,
|
|
16850
|
+
headers,
|
|
16851
|
+
getToken,
|
|
16852
|
+
onApiError
|
|
16853
|
+
}) => {
|
|
16859
16854
|
const [client, setClient] = React.useState(() => {
|
|
16860
16855
|
const token = getToken();
|
|
16861
16856
|
if (typeof token === "string")
|
|
16862
16857
|
return new ShipEngineAPI(token, {
|
|
16863
16858
|
baseURL,
|
|
16864
16859
|
getToken,
|
|
16865
|
-
headers: headers != null ? headers : {}
|
|
16860
|
+
headers: headers != null ? headers : {},
|
|
16861
|
+
onApiError
|
|
16866
16862
|
});
|
|
16867
16863
|
token.then(
|
|
16868
16864
|
(t) => setClient(
|
|
16869
16865
|
new ShipEngineAPI(t, {
|
|
16870
16866
|
baseURL,
|
|
16871
16867
|
getToken,
|
|
16872
|
-
headers: headers != null ? headers : {}
|
|
16868
|
+
headers: headers != null ? headers : {},
|
|
16869
|
+
onApiError
|
|
16873
16870
|
})
|
|
16874
16871
|
)
|
|
16875
16872
|
);
|
|
@@ -16905,7 +16902,7 @@ const delay = (ms) => new Promise((resolve) => {
|
|
|
16905
16902
|
setTimeout(() => resolve(true), ms);
|
|
16906
16903
|
});
|
|
16907
16904
|
|
|
16908
|
-
const onError = (
|
|
16905
|
+
const onError = (_errors) => _default();
|
|
16909
16906
|
|
|
16910
16907
|
var __defProp$3 = Object.defineProperty;
|
|
16911
16908
|
var __defProps$1 = Object.defineProperties;
|
|
@@ -17335,24 +17332,6 @@ const useGetServicesByCarrier = (carrierId) => {
|
|
|
17335
17332
|
});
|
|
17336
17333
|
};
|
|
17337
17334
|
|
|
17338
|
-
const useGetWalletHistory = ({
|
|
17339
|
-
enabled,
|
|
17340
|
-
page,
|
|
17341
|
-
range
|
|
17342
|
-
}) => {
|
|
17343
|
-
const { client } = useShipEngine();
|
|
17344
|
-
const [startDate, endDate] = range;
|
|
17345
|
-
return reactQuery.useQuery({
|
|
17346
|
-
enabled,
|
|
17347
|
-
keepPreviousData: true,
|
|
17348
|
-
// See https://react-query-v3.tanstack.com/guides/paginated-queries#better-paginated-queries-with-keeppreviousdata
|
|
17349
|
-
onError,
|
|
17350
|
-
queryFn: () => client.carriers.getWalletHistory(startDate, endDate, page),
|
|
17351
|
-
queryKey: ["useGetWalletHistory", startDate, endDate, page],
|
|
17352
|
-
select: (result) => result.data
|
|
17353
|
-
});
|
|
17354
|
-
};
|
|
17355
|
-
|
|
17356
17335
|
const useListCarriers = () => {
|
|
17357
17336
|
const { client } = useShipEngine();
|
|
17358
17337
|
return reactQuery.useQuery({
|
|
@@ -17595,8 +17574,8 @@ const useGetFundingSourceMetadata = () => {
|
|
|
17595
17574
|
const useGetFundingSourceTransactions = (fundingSourceId, params) => {
|
|
17596
17575
|
const { client } = useShipEngine();
|
|
17597
17576
|
return reactQuery.useQuery({
|
|
17577
|
+
enabled: !!fundingSourceId,
|
|
17598
17578
|
keepPreviousData: true,
|
|
17599
|
-
onError,
|
|
17600
17579
|
queryFn: () => client.fundingSources.transactions(fundingSourceId, params),
|
|
17601
17580
|
queryKey: ["useGetFundingSourceTransactions", fundingSourceId, params],
|
|
17602
17581
|
select: (result) => result.data
|
|
@@ -19087,7 +19066,9 @@ const AlchemyProvider = ({
|
|
|
19087
19066
|
locale: localeProp,
|
|
19088
19067
|
onError = _default,
|
|
19089
19068
|
scope = "lmnt",
|
|
19090
|
-
themeConfig
|
|
19069
|
+
themeConfig,
|
|
19070
|
+
onApiError,
|
|
19071
|
+
headers
|
|
19091
19072
|
}) => {
|
|
19092
19073
|
const locale = localeProp || getDefaultLocale();
|
|
19093
19074
|
const resolveIcon = useLoadIcons({ cdnURL });
|
|
@@ -19109,7 +19090,7 @@ const AlchemyProvider = ({
|
|
|
19109
19090
|
cdnUrl: cdnURL,
|
|
19110
19091
|
resolveIcon,
|
|
19111
19092
|
theme,
|
|
19112
|
-
children: /* @__PURE__ */ jsx(ShipEngine, { baseURL, getToken, children })
|
|
19093
|
+
children: /* @__PURE__ */ jsx(ShipEngine, { baseURL, headers, getToken, onApiError, children })
|
|
19113
19094
|
}
|
|
19114
19095
|
) });
|
|
19115
19096
|
};
|
|
@@ -19825,8 +19806,10 @@ exports.getEmotionCache = getEmotionCache;
|
|
|
19825
19806
|
exports.getEndUserIpAddress = getEndUserIpAddress;
|
|
19826
19807
|
exports.isCodedError = isCodedError;
|
|
19827
19808
|
exports.isCodedErrors = isCodedErrors;
|
|
19809
|
+
exports.isDataCodedErrors = isDataCodedErrors;
|
|
19828
19810
|
exports.logger = logger;
|
|
19829
19811
|
exports.onError = onError;
|
|
19812
|
+
exports.parseError = parseError;
|
|
19830
19813
|
exports.retryUntil = retryUntil;
|
|
19831
19814
|
exports.useAddFunds = useAddFunds;
|
|
19832
19815
|
exports.useAlchemy = useAlchemy;
|
|
@@ -19869,7 +19852,6 @@ exports.useGetShipmentRates = useGetShipmentRates;
|
|
|
19869
19852
|
exports.useGetShippingRuleById = useGetShippingRuleById;
|
|
19870
19853
|
exports.useGetShippingRuleConditionsOptions = useGetShippingRuleConditionsOptions;
|
|
19871
19854
|
exports.useGetThemeById = useGetThemeById;
|
|
19872
|
-
exports.useGetWalletHistory = useGetWalletHistory;
|
|
19873
19855
|
exports.useGetZonesByCarrier = useGetZonesByCarrier;
|
|
19874
19856
|
exports.useI18n = useI18n;
|
|
19875
19857
|
exports.useListCarriers = useListCarriers;
|
package/index.mjs
CHANGED
|
@@ -10983,6 +10983,21 @@ class AddressesAPI {
|
|
|
10983
10983
|
|
|
10984
10984
|
const isCodedErrors = (errs) => Array.isArray(errs) && errs.every((err) => isCodedError(err));
|
|
10985
10985
|
const isCodedError = (err) => !!err.errorCode;
|
|
10986
|
+
const isDataCodedErrors = (data) => !!data.errors && isCodedErrors(data.errors);
|
|
10987
|
+
const parseError = (err) => {
|
|
10988
|
+
var _a;
|
|
10989
|
+
if (!((_a = err.response) == null ? void 0 : _a.data))
|
|
10990
|
+
return [new CodedError(err.message)];
|
|
10991
|
+
if (isDataCodedErrors(err.response.data)) {
|
|
10992
|
+
return err.response.data.errors.map((err2) => CodedError.fromObject(err2));
|
|
10993
|
+
} else if (isCodedErrors(err.response.data)) {
|
|
10994
|
+
return err.response.data.map((err2) => CodedError.fromObject(err2));
|
|
10995
|
+
} else if (isCodedError(err.response.data)) {
|
|
10996
|
+
return [CodedError.fromObject(err.response.data)];
|
|
10997
|
+
} else {
|
|
10998
|
+
return [new CodedError(err.message)];
|
|
10999
|
+
}
|
|
11000
|
+
};
|
|
10986
11001
|
|
|
10987
11002
|
var axiosExports$1 = {};
|
|
10988
11003
|
var axios$3 = {
|
|
@@ -13762,19 +13777,6 @@ class CarriersAPI {
|
|
|
13762
13777
|
`/v1/carriers/${carrierId}/auto_funding`
|
|
13763
13778
|
);
|
|
13764
13779
|
};
|
|
13765
|
-
/**
|
|
13766
|
-
* The `getWalletHistory` method retrieves the wallet transaction history for
|
|
13767
|
-
* a ShipEngine wallet account.
|
|
13768
|
-
*/
|
|
13769
|
-
this.getWalletHistory = (startDate, endDate, page) => {
|
|
13770
|
-
return this.client.get(`/v1/carriers/wallet_history`, {
|
|
13771
|
-
params: {
|
|
13772
|
-
endDate: endDate.toISOString(),
|
|
13773
|
-
page,
|
|
13774
|
-
startDate: startDate.toISOString()
|
|
13775
|
-
}
|
|
13776
|
-
});
|
|
13777
|
-
};
|
|
13778
13780
|
/**
|
|
13779
13781
|
* The `getServices` method retrieves a list of shipping services that a given carrier offers.
|
|
13780
13782
|
*/
|
|
@@ -16561,6 +16563,7 @@ var __async$y = (__this, __arguments, generator) => {
|
|
|
16561
16563
|
});
|
|
16562
16564
|
};
|
|
16563
16565
|
const logger$1 = E({
|
|
16566
|
+
level: process.env.NODE_ENV === "production" ? "fatal" : "info",
|
|
16564
16567
|
name: "shipengine-api",
|
|
16565
16568
|
serializers: __spreadProps$2(__spreadValues$4({}, k), {
|
|
16566
16569
|
req: (req) => ({
|
|
@@ -16582,9 +16585,8 @@ const logger$1 = E({
|
|
|
16582
16585
|
}
|
|
16583
16586
|
]
|
|
16584
16587
|
});
|
|
16585
|
-
const isDataCodedErrors = (data) => !!data.errors && isCodedErrors(data.errors);
|
|
16586
16588
|
class ShipEngineAPI {
|
|
16587
|
-
constructor(token, { baseURL, headers, getToken }) {
|
|
16589
|
+
constructor(token, { baseURL, headers, getToken, onApiError }) {
|
|
16588
16590
|
const client = axios.create({
|
|
16589
16591
|
baseURL,
|
|
16590
16592
|
headers: __spreadProps$2(__spreadValues$4({}, headers), {
|
|
@@ -16635,7 +16637,7 @@ class ShipEngineAPI {
|
|
|
16635
16637
|
return res;
|
|
16636
16638
|
},
|
|
16637
16639
|
(err) => __async$y(this, null, function* () {
|
|
16638
|
-
var _a, _b, _c, _d, _e, _f
|
|
16640
|
+
var _a, _b, _c, _d, _e, _f;
|
|
16639
16641
|
logger$1.error(
|
|
16640
16642
|
{ err, req: err.config, res: err.response },
|
|
16641
16643
|
"%s %s: %s %s - %s",
|
|
@@ -16654,22 +16656,9 @@ class ShipEngineAPI {
|
|
|
16654
16656
|
}
|
|
16655
16657
|
return axios(config);
|
|
16656
16658
|
}
|
|
16657
|
-
|
|
16658
|
-
|
|
16659
|
-
|
|
16660
|
-
err.response.data.errors.map((err2) => CodedError.fromObject(err2))
|
|
16661
|
-
);
|
|
16662
|
-
}
|
|
16663
|
-
if (isCodedErrors(err.response.data)) {
|
|
16664
|
-
return Promise.reject(err.response.data.map((err2) => CodedError.fromObject(err2)));
|
|
16665
|
-
}
|
|
16666
|
-
if (isCodedError(err.response.data)) {
|
|
16667
|
-
return Promise.reject([CodedError.fromObject(err.response.data)]);
|
|
16668
|
-
}
|
|
16669
|
-
return Promise.reject([new CodedError(err.response.data)]);
|
|
16670
|
-
} else {
|
|
16671
|
-
return Promise.reject([new CodedError(err.message)]);
|
|
16672
|
-
}
|
|
16659
|
+
const codedErrors = parseError(err);
|
|
16660
|
+
onApiError == null ? void 0 : onApiError(codedErrors, err);
|
|
16661
|
+
return Promise.reject(codedErrors);
|
|
16673
16662
|
})
|
|
16674
16663
|
);
|
|
16675
16664
|
this.client = client;
|
|
@@ -16833,21 +16822,29 @@ class ShipEngineAPI {
|
|
|
16833
16822
|
}
|
|
16834
16823
|
|
|
16835
16824
|
const ShipEngineContext = createContext(void 0);
|
|
16836
|
-
const ShipEngine = ({
|
|
16825
|
+
const ShipEngine = ({
|
|
16826
|
+
baseURL,
|
|
16827
|
+
children,
|
|
16828
|
+
headers,
|
|
16829
|
+
getToken,
|
|
16830
|
+
onApiError
|
|
16831
|
+
}) => {
|
|
16837
16832
|
const [client, setClient] = useState(() => {
|
|
16838
16833
|
const token = getToken();
|
|
16839
16834
|
if (typeof token === "string")
|
|
16840
16835
|
return new ShipEngineAPI(token, {
|
|
16841
16836
|
baseURL,
|
|
16842
16837
|
getToken,
|
|
16843
|
-
headers: headers != null ? headers : {}
|
|
16838
|
+
headers: headers != null ? headers : {},
|
|
16839
|
+
onApiError
|
|
16844
16840
|
});
|
|
16845
16841
|
token.then(
|
|
16846
16842
|
(t) => setClient(
|
|
16847
16843
|
new ShipEngineAPI(t, {
|
|
16848
16844
|
baseURL,
|
|
16849
16845
|
getToken,
|
|
16850
|
-
headers: headers != null ? headers : {}
|
|
16846
|
+
headers: headers != null ? headers : {},
|
|
16847
|
+
onApiError
|
|
16851
16848
|
})
|
|
16852
16849
|
)
|
|
16853
16850
|
);
|
|
@@ -16883,7 +16880,7 @@ const delay = (ms) => new Promise((resolve) => {
|
|
|
16883
16880
|
setTimeout(() => resolve(true), ms);
|
|
16884
16881
|
});
|
|
16885
16882
|
|
|
16886
|
-
const onError = (
|
|
16883
|
+
const onError = (_errors) => _default();
|
|
16887
16884
|
|
|
16888
16885
|
var __defProp$3 = Object.defineProperty;
|
|
16889
16886
|
var __defProps$1 = Object.defineProperties;
|
|
@@ -17313,24 +17310,6 @@ const useGetServicesByCarrier = (carrierId) => {
|
|
|
17313
17310
|
});
|
|
17314
17311
|
};
|
|
17315
17312
|
|
|
17316
|
-
const useGetWalletHistory = ({
|
|
17317
|
-
enabled,
|
|
17318
|
-
page,
|
|
17319
|
-
range
|
|
17320
|
-
}) => {
|
|
17321
|
-
const { client } = useShipEngine();
|
|
17322
|
-
const [startDate, endDate] = range;
|
|
17323
|
-
return useQuery({
|
|
17324
|
-
enabled,
|
|
17325
|
-
keepPreviousData: true,
|
|
17326
|
-
// See https://react-query-v3.tanstack.com/guides/paginated-queries#better-paginated-queries-with-keeppreviousdata
|
|
17327
|
-
onError,
|
|
17328
|
-
queryFn: () => client.carriers.getWalletHistory(startDate, endDate, page),
|
|
17329
|
-
queryKey: ["useGetWalletHistory", startDate, endDate, page],
|
|
17330
|
-
select: (result) => result.data
|
|
17331
|
-
});
|
|
17332
|
-
};
|
|
17333
|
-
|
|
17334
17313
|
const useListCarriers = () => {
|
|
17335
17314
|
const { client } = useShipEngine();
|
|
17336
17315
|
return useQuery({
|
|
@@ -17573,8 +17552,8 @@ const useGetFundingSourceMetadata = () => {
|
|
|
17573
17552
|
const useGetFundingSourceTransactions = (fundingSourceId, params) => {
|
|
17574
17553
|
const { client } = useShipEngine();
|
|
17575
17554
|
return useQuery({
|
|
17555
|
+
enabled: !!fundingSourceId,
|
|
17576
17556
|
keepPreviousData: true,
|
|
17577
|
-
onError,
|
|
17578
17557
|
queryFn: () => client.fundingSources.transactions(fundingSourceId, params),
|
|
17579
17558
|
queryKey: ["useGetFundingSourceTransactions", fundingSourceId, params],
|
|
17580
17559
|
select: (result) => result.data
|
|
@@ -19065,7 +19044,9 @@ const AlchemyProvider = ({
|
|
|
19065
19044
|
locale: localeProp,
|
|
19066
19045
|
onError = _default,
|
|
19067
19046
|
scope = "lmnt",
|
|
19068
|
-
themeConfig
|
|
19047
|
+
themeConfig,
|
|
19048
|
+
onApiError,
|
|
19049
|
+
headers
|
|
19069
19050
|
}) => {
|
|
19070
19051
|
const locale = localeProp || getDefaultLocale();
|
|
19071
19052
|
const resolveIcon = useLoadIcons({ cdnURL });
|
|
@@ -19087,7 +19068,7 @@ const AlchemyProvider = ({
|
|
|
19087
19068
|
cdnUrl: cdnURL,
|
|
19088
19069
|
resolveIcon,
|
|
19089
19070
|
theme,
|
|
19090
|
-
children: /* @__PURE__ */ jsx(ShipEngine, { baseURL, getToken, children })
|
|
19071
|
+
children: /* @__PURE__ */ jsx(ShipEngine, { baseURL, headers, getToken, onApiError, children })
|
|
19091
19072
|
}
|
|
19092
19073
|
) });
|
|
19093
19074
|
};
|
|
@@ -19760,4 +19741,4 @@ const alchemy = {
|
|
|
19760
19741
|
createElement
|
|
19761
19742
|
};
|
|
19762
19743
|
|
|
19763
|
-
export { AccountSettingsAPI, AddressesAPI, AlchemyContext, AlchemyProvider, AlchemyTestProvider, CarriersAPI, CodedError, ConfirmationType, 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, logger, onError, retryUntil, useAddFunds, useAlchemy, useCalculateRates, useConnectCarrier, useCreateAccountImage, useCreateFundingSource, useCreateLabel, useCreateRateCard, useCreateSalesOrderShipment, useCreateShipment, useCreateShippingRule, useCreateWarehouse, useDeleteAccountImage, useDeleteRateCard, useDeleteShippingRule, useDeleteWarehouse, useDownloadRateCard, useEditShippingRule, useFundingSourcesAddFunds, useGetAccountBillingPlan, useGetAccountImages, useGetAccountSettings, useGetAutoFundingConfiguration, useGetCarrierById, useGetCountriesByCarrier, useGetCurrenciesByCarrier, useGetFundingSourceById, useGetFundingSourceMetadata, useGetFundingSourceTransactions, useGetInsuranceAccount, useGetLabel, useGetPackageRatingGroupByCarrier, useGetRateCardById, useGetSalesOrder, useGetSalesOrderShipment, useGetServicesByCarrier, useGetShipment, useGetShipmentRates, useGetShippingRuleById, useGetShippingRuleConditionsOptions, useGetThemeById,
|
|
19744
|
+
export { AccountSettingsAPI, AddressesAPI, AlchemyContext, AlchemyProvider, AlchemyTestProvider, CarriersAPI, CodedError, ConfirmationType, 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, logger, onError, parseError, retryUntil, useAddFunds, useAlchemy, useCalculateRates, useConnectCarrier, useCreateAccountImage, useCreateFundingSource, useCreateLabel, useCreateRateCard, useCreateSalesOrderShipment, useCreateShipment, useCreateShippingRule, useCreateWarehouse, useDeleteAccountImage, useDeleteRateCard, useDeleteShippingRule, useDeleteWarehouse, useDownloadRateCard, useEditShippingRule, useFundingSourcesAddFunds, useGetAccountBillingPlan, useGetAccountImages, useGetAccountSettings, useGetAutoFundingConfiguration, useGetCarrierById, useGetCountriesByCarrier, useGetCurrenciesByCarrier, useGetFundingSourceById, useGetFundingSourceMetadata, useGetFundingSourceTransactions, useGetInsuranceAccount, useGetLabel, useGetPackageRatingGroupByCarrier, useGetRateCardById, useGetSalesOrder, useGetSalesOrderShipment, useGetServicesByCarrier, useGetShipment, useGetShipmentRates, useGetShippingRuleById, useGetShippingRuleConditionsOptions, useGetThemeById, useGetZonesByCarrier, useI18n, 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 };
|