@shipengine/react-api 0.6.0 → 0.8.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/hooks/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export * from "./use-delete-warehouse";
|
|
|
9
9
|
export * from "./use-get-account-settings";
|
|
10
10
|
export * from "./use-get-auto-funding-configuration";
|
|
11
11
|
export * from "./use-get-carrier-by-id";
|
|
12
|
+
export * from "./use-get-funding-source-by-id";
|
|
12
13
|
export * from "./use-get-insurance-account";
|
|
13
14
|
export * from "./use-get-label";
|
|
14
15
|
export * from "./use-get-sales-order";
|
|
@@ -17,6 +18,7 @@ export * from "./use-get-shipment";
|
|
|
17
18
|
export * from "./use-get-wallet-history";
|
|
18
19
|
export * from "./use-list-carriers";
|
|
19
20
|
export * from "./use-list-custom-package-types";
|
|
21
|
+
export * from "./use-list-funding-sources";
|
|
20
22
|
export * from "./use-list-labels";
|
|
21
23
|
export * from "./use-list-order-sources";
|
|
22
24
|
export * from "./use-list-sales-order-shipments";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @category ShipEngine API Hooks
|
|
3
|
+
*/
|
|
4
|
+
export declare const useListFundingSources: () => import("react-query").UseQueryResult<[{
|
|
5
|
+
billingInfo: import("@shipengine/js-api").FundingSourceAddress;
|
|
6
|
+
currencyCode: string;
|
|
7
|
+
fundingSourceId: string;
|
|
8
|
+
paymentMethod: import("@shipengine/js-api").PaymentMethod | {
|
|
9
|
+
creditCardInfo: null;
|
|
10
|
+
};
|
|
11
|
+
}], import("@shipengine/js-api").CodedError[]>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SE } from "@shipengine/js-api";
|
|
2
2
|
export type UpdateFundingSourceData = {
|
|
3
|
-
billingInfo: SE.
|
|
3
|
+
billingInfo: SE.FundingSourceAddress;
|
|
4
|
+
creditCardInfo: SE.CreditCardInfo;
|
|
4
5
|
fundingSourceId: string;
|
|
5
|
-
paymentMethod: SE.PaymentMethod;
|
|
6
6
|
};
|
|
7
7
|
/**
|
|
8
8
|
* @category ShipEngine API Hooks
|
package/index.js
CHANGED
|
@@ -444,6 +444,16 @@ const useGetCarrierById = (carrierId) => {
|
|
|
444
444
|
});
|
|
445
445
|
};
|
|
446
446
|
|
|
447
|
+
const useGetFundingSourceById = (fundingSourceId) => {
|
|
448
|
+
const { client } = useShipEngine();
|
|
449
|
+
return reactQuery.useQuery({
|
|
450
|
+
onError,
|
|
451
|
+
queryFn: () => client.fundingSources.get(fundingSourceId),
|
|
452
|
+
queryKey: ["getFundingSourceById"],
|
|
453
|
+
select: (result) => result.data
|
|
454
|
+
});
|
|
455
|
+
};
|
|
456
|
+
|
|
447
457
|
const useGetInsuranceAccount = (insuranceProvider) => {
|
|
448
458
|
const { client } = useShipEngine();
|
|
449
459
|
return reactQuery.useQuery({
|
|
@@ -558,6 +568,16 @@ const useListCustomPackageTypes = () => {
|
|
|
558
568
|
});
|
|
559
569
|
};
|
|
560
570
|
|
|
571
|
+
const useListFundingSources = () => {
|
|
572
|
+
const { client } = useShipEngine();
|
|
573
|
+
return reactQuery.useQuery({
|
|
574
|
+
onError,
|
|
575
|
+
queryFn: () => client.fundingSources.list(),
|
|
576
|
+
queryKey: ["useListFundingSources"],
|
|
577
|
+
select: (result) => result.data.fundingSources
|
|
578
|
+
});
|
|
579
|
+
};
|
|
580
|
+
|
|
561
581
|
const useListLabels = (params) => {
|
|
562
582
|
const { client } = useShipEngine();
|
|
563
583
|
return reactQuery.useQuery({
|
|
@@ -882,12 +902,12 @@ const useUpdateFundingSource = () => {
|
|
|
882
902
|
return reactQuery.useMutation({
|
|
883
903
|
mutationFn: (_0) => __async$4(void 0, [_0], function* ({
|
|
884
904
|
billingInfo,
|
|
885
|
-
|
|
905
|
+
creditCardInfo,
|
|
886
906
|
fundingSourceId
|
|
887
907
|
}) {
|
|
888
908
|
const result = yield client.fundingSources.update(
|
|
889
909
|
billingInfo,
|
|
890
|
-
|
|
910
|
+
creditCardInfo,
|
|
891
911
|
fundingSourceId
|
|
892
912
|
);
|
|
893
913
|
return result.data;
|
|
@@ -1074,6 +1094,7 @@ exports.useDeleteWarehouse = useDeleteWarehouse;
|
|
|
1074
1094
|
exports.useGetAccountSettings = useGetAccountSettings;
|
|
1075
1095
|
exports.useGetAutoFundingConfiguration = useGetAutoFundingConfiguration;
|
|
1076
1096
|
exports.useGetCarrierById = useGetCarrierById;
|
|
1097
|
+
exports.useGetFundingSourceById = useGetFundingSourceById;
|
|
1077
1098
|
exports.useGetInsuranceAccount = useGetInsuranceAccount;
|
|
1078
1099
|
exports.useGetLabel = useGetLabel;
|
|
1079
1100
|
exports.useGetSalesOrder = useGetSalesOrder;
|
|
@@ -1083,6 +1104,7 @@ exports.useGetShipmentRates = useGetShipmentRates;
|
|
|
1083
1104
|
exports.useGetWalletHistory = useGetWalletHistory;
|
|
1084
1105
|
exports.useListCarriers = useListCarriers;
|
|
1085
1106
|
exports.useListCustomPackageTypes = useListCustomPackageTypes;
|
|
1107
|
+
exports.useListFundingSources = useListFundingSources;
|
|
1086
1108
|
exports.useListLabels = useListLabels;
|
|
1087
1109
|
exports.useListOrderSources = useListOrderSources;
|
|
1088
1110
|
exports.useListSalesOrderShipments = useListSalesOrderShipments;
|
package/index.mjs
CHANGED
|
@@ -441,6 +441,16 @@ const useGetCarrierById = (carrierId) => {
|
|
|
441
441
|
});
|
|
442
442
|
};
|
|
443
443
|
|
|
444
|
+
const useGetFundingSourceById = (fundingSourceId) => {
|
|
445
|
+
const { client } = useShipEngine();
|
|
446
|
+
return useQuery({
|
|
447
|
+
onError,
|
|
448
|
+
queryFn: () => client.fundingSources.get(fundingSourceId),
|
|
449
|
+
queryKey: ["getFundingSourceById"],
|
|
450
|
+
select: (result) => result.data
|
|
451
|
+
});
|
|
452
|
+
};
|
|
453
|
+
|
|
444
454
|
const useGetInsuranceAccount = (insuranceProvider) => {
|
|
445
455
|
const { client } = useShipEngine();
|
|
446
456
|
return useQuery({
|
|
@@ -555,6 +565,16 @@ const useListCustomPackageTypes = () => {
|
|
|
555
565
|
});
|
|
556
566
|
};
|
|
557
567
|
|
|
568
|
+
const useListFundingSources = () => {
|
|
569
|
+
const { client } = useShipEngine();
|
|
570
|
+
return useQuery({
|
|
571
|
+
onError,
|
|
572
|
+
queryFn: () => client.fundingSources.list(),
|
|
573
|
+
queryKey: ["useListFundingSources"],
|
|
574
|
+
select: (result) => result.data.fundingSources
|
|
575
|
+
});
|
|
576
|
+
};
|
|
577
|
+
|
|
558
578
|
const useListLabels = (params) => {
|
|
559
579
|
const { client } = useShipEngine();
|
|
560
580
|
return useQuery({
|
|
@@ -879,12 +899,12 @@ const useUpdateFundingSource = () => {
|
|
|
879
899
|
return useMutation({
|
|
880
900
|
mutationFn: (_0) => __async$4(void 0, [_0], function* ({
|
|
881
901
|
billingInfo,
|
|
882
|
-
|
|
902
|
+
creditCardInfo,
|
|
883
903
|
fundingSourceId
|
|
884
904
|
}) {
|
|
885
905
|
const result = yield client.fundingSources.update(
|
|
886
906
|
billingInfo,
|
|
887
|
-
|
|
907
|
+
creditCardInfo,
|
|
888
908
|
fundingSourceId
|
|
889
909
|
);
|
|
890
910
|
return result.data;
|
|
@@ -1054,4 +1074,4 @@ const useVoidLabel = () => {
|
|
|
1054
1074
|
});
|
|
1055
1075
|
};
|
|
1056
1076
|
|
|
1057
|
-
export { ShipEngine, ShipEngineContext, delay, logger, onError, retryUntil, useAddFunds, useCalculateRates, useConnectCarrier, useCreateFundingSource, useCreateLabel, useCreateSalesOrderShipment, useCreateWarehouse, useDeleteWarehouse, useGetAccountSettings, useGetAutoFundingConfiguration, useGetCarrierById, useGetInsuranceAccount, useGetLabel, useGetSalesOrder, useGetSalesOrderShipment, useGetShipment, useGetShipmentRates, useGetWalletHistory, useListCarriers, useListCustomPackageTypes, useListLabels, useListOrderSources, useListSalesOrderShipments, useListSalesOrders, useListWarehouses, useNotifySalesOrderShipped, useParseAddress, useRefreshOrderSource, useRefreshOrderSourceAsync, useRegisterCarrier, useShipEngine, useUpdateAccountSettings, useUpdateAutoFunding, useUpdateFundingSource, useUpdateSalesOrderShipment, useUpdateWarehouse, useValidateAddresses, useVoidLabel };
|
|
1077
|
+
export { ShipEngine, ShipEngineContext, delay, logger, onError, retryUntil, useAddFunds, useCalculateRates, useConnectCarrier, useCreateFundingSource, useCreateLabel, useCreateSalesOrderShipment, useCreateWarehouse, useDeleteWarehouse, useGetAccountSettings, useGetAutoFundingConfiguration, useGetCarrierById, useGetFundingSourceById, useGetInsuranceAccount, useGetLabel, useGetSalesOrder, useGetSalesOrderShipment, useGetShipment, useGetShipmentRates, useGetWalletHistory, useListCarriers, useListCustomPackageTypes, useListFundingSources, useListLabels, useListOrderSources, useListSalesOrderShipments, useListSalesOrders, useListWarehouses, useNotifySalesOrderShipped, useParseAddress, useRefreshOrderSource, useRefreshOrderSourceAsync, useRegisterCarrier, useShipEngine, useUpdateAccountSettings, useUpdateAutoFunding, useUpdateFundingSource, useUpdateSalesOrderShipment, useUpdateWarehouse, useValidateAddresses, useVoidLabel };
|